@kumori/kdsl 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/main.cjs ADDED
@@ -0,0 +1,738 @@
1
+ "use strict";var lH=Object.create;var am=Object.defineProperty,fH=Object.defineProperties,dH=Object.getOwnPropertyDescriptor,pH=Object.getOwnPropertyDescriptors,mH=Object.getOwnPropertyNames,cS=Object.getOwnPropertySymbols,hH=Object.getPrototypeOf,lS=Object.prototype.hasOwnProperty,gH=Object.prototype.propertyIsEnumerable;var uS=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var u8=(t,e,r)=>e in t?am(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C=(t,e)=>{for(var r in e||(e={}))lS.call(e,r)&&u8(t,r,e[r]);if(cS)for(var r of cS(e))gH.call(e,r)&&u8(t,r,e[r]);return t},Y=(t,e)=>fH(t,pH(e));var q=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ua=(t,e)=>{for(var r in e)am(t,r,{get:e[r],enumerable:!0})},Vg=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of mH(e))!lS.call(t,i)&&i!==r&&am(t,i,{get:()=>e[i],enumerable:!(n=dH(e,i))||n.enumerable});return t},Ot=(t,e,r)=>(Vg(t,e,"default"),r&&Vg(r,e,"default")),ke=(t,e,r)=>(r=t!=null?lH(hH(t)):{},Vg(e||!t||!t.__esModule?am(r,"default",{value:t,enumerable:!0}):r,t)),yH=t=>Vg(am({},"__esModule",{value:!0}),t);var wt=(t,e,r)=>(u8(t,typeof e!="symbol"?e+"":e,r),r);var jg=(t,e,r)=>{if(e!=null){if(typeof e!="object"&&typeof e!="function")throw TypeError("Object expected");var n;if(r&&(n=e[uS("asyncDispose")]),n===void 0&&(n=e[uS("dispose")]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},Ug=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,c,u){return u=Error(c),u.name="SuppressedError",u.error=o,u.suppressed=a,u},i=o=>e=r?new n(o,e,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=t.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,c=>(i(c),s()))}catch(c){i(c)}if(r)throw e};return s()};var cm=q(f8=>{var qg=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}},l8=class extends qg{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};f8.CommanderError=qg;f8.InvalidArgumentError=l8});var Bg=q(p8=>{var{InvalidArgumentError:vH}=cm(),d8=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.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new vH(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function xH(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}p8.Argument=d8;p8.humanReadableArgName=xH});var g8=q(h8=>{var{humanReadableArgName:_H}=Bg(),m8=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){var r,n;this.helpWidth=(n=(r=this.helpWidth)!=null?r:e.helpWidth)!=null?n:80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,s)=>i.name().localeCompare(s.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!i&&!s?r.push(n):n.long&&!s?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(s=>!s.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>_H(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,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),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.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),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){var l;let n=r.padWidth(e,r),i=(l=r.helpWidth)!=null?l:80;function s(p,d){return r.formatItem(p,n,d,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(p=>s(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));c.length>0&&(o=o.concat([r.styleTitle("Arguments:"),...c,""]));let u=r.visibleOptions(e).map(p=>s(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));if(u.length>0&&(o=o.concat([r.styleTitle("Options:"),...u,""])),r.showGlobalOptions){let p=r.visibleGlobalOptions(e).map(d=>s(r.styleOptionTerm(r.optionTerm(d)),r.styleOptionDescription(r.optionDescription(d))));p.length>0&&(o=o.concat([r.styleTitle("Global Options:"),...p,""]))}let f=r.visibleCommands(e).map(p=>s(r.styleSubcommandTerm(r.subcommandTerm(p)),r.styleSubcommandDescription(r.subcommandDescription(p))));return f.length>0&&(o=o.concat([r.styleTitle("Commands:"),...f,""])),o.join(`
2
+ `)}displayWidth(e){return fS(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){var p;let o=" ".repeat(2);if(!n)return o+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,f=((p=this.helpWidth)!=null?p:80)-r-c-2,l;return f<this.minWidthToWrap||i.preformatted(n)?l=n:l=i.boxWrap(n,f).replace(/\n/g,`
3
+ `+" ".repeat(r+c)),o+a+" ".repeat(c)+l.replace(/\n/g,`
4
+ ${o}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return n.forEach(o=>{let a=o.match(i);if(a===null){s.push("");return}let c=[a.shift()],u=this.displayWidth(c[0]);a.forEach(f=>{let l=this.displayWidth(f);if(u+l<=r){c.push(f),u+=l;return}s.push(c.join(""));let p=f.trimStart();c=[p],u=this.displayWidth(p)}),s.push(c.join(""))}),s.join(`
5
+ `)}};function fS(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}h8.Help=m8;h8.stripColor=fS});var _8=q(x8=>{var{InvalidArgumentError:bH}=cm(),y8=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=SH(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.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},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.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new bH(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?dS(this.name().replace(/^no-/,"")):dS(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},v8=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,s=i!==void 0?i:!1;return r.negate===(s===e)}};function dS(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function SH(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,s=t.split(/[ |,]+/).concat("guard");if(n.test(s[0])&&(e=s.shift()),i.test(s[0])&&(r=s.shift()),!e&&n.test(s[0])&&(e=s.shift()),!e&&i.test(s[0])&&(e=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${t}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
6
+ - a short flag is a single dash and a single character
7
+ - either use a single dash and a single character (for a short flag)
8
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(o)?new Error(`${a}
9
+ - too many short flags`):i.test(o)?new Error(`${a}
10
+ - too many long flags`):new Error(`${a}
11
+ - unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}x8.Option=y8;x8.DualOptions=v8});var mS=q(pS=>{function EH(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 s=1;t[i-1]===e[n-1]?s=0:s=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+s),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 TH(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(o=>o.slice(2)));let n=[],i=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=EH(t,o),c=Math.max(t.length,o.length);(c-a)/c>s&&(a<i?(i=a,n=[o]):a===i&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
12
+ (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
13
+ (Did you mean ${n[0]}?)`:""}pS.suggestSimilar=TH});var vS=q(C8=>{var CH=require("events").EventEmitter,b8=require("child_process"),la=require("path"),Hg=require("fs"),Wt=require("process"),{Argument:kH,humanReadableArgName:wH}=Bg(),{CommanderError:S8}=cm(),{Help:AH,stripColor:RH}=g8(),{Option:hS,DualOptions:PH}=_8(),{suggestSimilar:gS}=mS(),E8=class t extends CH{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,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._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>Wt.stdout.write(r),writeErr:r=>Wt.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>Wt.stdout.isTTY?Wt.stdout.columns:void 0,getErrHelpWidth:()=>Wt.stderr.isTTY?Wt.stderr.columns:void 0,getOutHasColors:()=>{var r,n,i;return(i=T8())!=null?i:Wt.stdout.isTTY&&((n=(r=Wt.stdout).hasColors)==null?void 0:n.call(r))},getErrHasColors:()=>{var r,n,i;return(i=T8())!=null?i:Wt.stderr.isTTY&&((n=(r=Wt.stderr).hasColors)==null?void 0:n.call(r))},stripColor:r=>RH(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,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}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,s=n;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(o);return i&&(c.description(i),c._executableHandler=!0),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new AH,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
14
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new kH(e,r)}argument(e,r,n,i){let s=this.createArgument(e,r);return typeof n=="function"?s.default(i).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.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.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e!=null?e:"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),s=r!=null?r:"display help for command",o=this.createCommand(n);return o.helpOption(!1),i&&o.arguments(i),s&&o.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){var r;return((r=this._addImplicitHelpCommand)!=null?r:this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
15
+ 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 S8(e,r,n)),Wt.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,s=n.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=r,this}createOption(e,r){return new hS(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${i} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
16
+ - already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),s=r(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(s,o,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let c=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,c,o):s!==null&&e.variadic&&(s=e._concatValue(s,c)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,a)};return this.on("option:"+r,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;i(s,o,"cli")}),e.envVar&&this.on("optionEnv:"+r,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;i(s,o,"env")}),this}_optionEx(e,r,n,i,s){if(typeof r=="object"&&r instanceof hS)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!e.mandatory),typeof i=="function")o.default(s).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,u)=>{let f=a.exec(c);return f?f[0]:u},o.default(s).argParser(i)}else o.default(i);return this.addOption(o)}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){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){var i,s;if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){(i=Wt.versions)!=null&&i.electron&&(r.from="electron");let o=(s=Wt.execArgv)!=null?s:[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Wt.argv),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":Wt.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:C({},this._optionValues),_optionValueSources:C({},this._optionValueSources)}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
17
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues=C({},this._savedState._optionValues),this._optionValueSources=C({},this._savedState._optionValueSources),this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(Hg.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
18
+ - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
19
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
20
+ - ${i}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(f,l){let p=la.resolve(f,l);if(Hg.existsSync(p))return p;if(i.includes(la.extname(l)))return;let d=i.find(h=>Hg.existsSync(`${p}${h}`));if(d)return`${p}${d}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let f;try{f=Hg.realpathSync(this._scriptPath)}catch(l){f=this._scriptPath}a=la.resolve(la.dirname(f),a)}if(a){let f=s(a,o);if(!f&&!e._executableFile&&this._scriptPath){let l=la.basename(this._scriptPath,la.extname(this._scriptPath));l!==this._name&&(f=s(a,`${l}-${e._name}`))}o=f||o}n=i.includes(la.extname(o));let c;Wt.platform!=="win32"?n?(r.unshift(o),r=yS(Wt.execArgv).concat(r),c=b8.spawn(Wt.argv[0],r,{stdio:"inherit"})):c=b8.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),r.unshift(o),r=yS(Wt.execArgv).concat(r),c=b8.spawn(Wt.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(l=>{Wt.on(l,()=>{c.killed===!1&&c.exitCode===null&&c.kill(l)})});let u=this._exitCallback;c.on("close",f=>{f=f!=null?f:1,u?u(new S8(f,"commander.executeSubCommandAsync","(close)")):Wt.exit(f)}),c.on("error",f=>{if(f.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(f.code==="EACCES")throw new Error(`'${o}' not executable`);if(!u)Wt.exit(1);else{let l=new S8(1,"commander.executeSubCommandAsync","(error)");l.nestedError=f,u(l)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),s}_dispatchHelpCommand(e){var n,i,s,o;e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[(o=(s=(n=this._getHelpOption())==null?void 0:n.long)!=null?s:(i=this._getHelpOption())==null?void 0:i.short)!=null?o:"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,s)=>{let o=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,i,s,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let s=n.defaultValue;n.variadic?i<this.args.length?(s=this.args.slice(i),n.parseArg&&(s=s.reduce((o,a)=>e(n,a,o),n.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],n.parseArg&&(s=e(n,s,n.defaultValue))),r[i]=s}),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 this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{i.push({hookedCommand:s,callback:o})})}),r==="postAction"&&i.reverse(),i.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{i=this._chainOrCall(i,()=>s(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),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._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,e,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,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(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(s=>n.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r,s=e.slice();function o(c){return c.length>1&&c[0]==="-"}let a=null;for(;s.length;){let c=s.shift();if(c==="--"){i===n&&i.push(c),i.push(...s);break}if(a&&!o(c)){this.emit(`option:${a.name()}`,c);continue}if(a=null,o(c)){let u=this._findOption(c);if(u){if(u.required){let f=s.shift();f===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,f)}else if(u.optional){let f=null;s.length>0&&!o(s[0])&&(f=s.shift()),this.emit(`option:${u.name()}`,f)}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let u=this._findOption(`-${c[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,c.slice(2)):(this.emit(`option:${u.name()}`),s.unshift(`-${c.slice(2)}`));continue}}if(/^--[^=]+=/.test(c)){let u=c.indexOf("="),f=this._findOption(c.slice(0,u));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,c.slice(u+1));continue}}if(o(c)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(c)){r.push(c),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){r.push(c),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){n.push(c),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){i.push(c),s.length>0&&i.push(...s);break}i.push(c)}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}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
21
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
22
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
23
+ `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,s=n.code||"commander.error";this._exit(i,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Wt.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()}`,Wt.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new PH(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=o=>{let a=o.attributeName(),c=this.getOptionValue(a),u=this.options.find(l=>l.negate&&a===l.attributeName()),f=this.options.find(l=>!l.negate&&a===l.attributeName());return u&&(u.presetArg===void 0&&c===!1||u.presetArg!==void 0&&c===u.presetArg)?u:f||o},i=o=>{let a=n(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);i=i.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);r=gS(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),r=gS(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}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._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
24
+ `),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)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){var i;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");let n=(i=this.parent)==null?void 0:i._findCommand(e);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}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.registeredArguments.map(n=>wH(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=la.basename(e,la.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,s;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:s}}outputHelp(e){var o;let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:n.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),(o=this._getHelpOption())!=null&&o.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",i))}helpOption(e,r){var n;return typeof e=="boolean"?(e?this._helpOption=(n=this._helpOption)!=null?n:void 0:this._helpOption=null,this):(e=e!=null?e:"-h, --help",r=r!=null?r:"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){var n;this.outputHelp(e);let r=Number((n=Wt.exitCode)!=null?n: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.
25
+ Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let o;typeof r=="function"?o=r({error:s.error,command:s.command}):o=r,o&&s.write(`${o}
26
+ `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function yS(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?i=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],i=s[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function T8(){if(Wt.env.NO_COLOR||Wt.env.FORCE_COLOR==="0"||Wt.env.FORCE_COLOR==="false")return!1;if(Wt.env.FORCE_COLOR||Wt.env.CLICOLOR_FORCE!==void 0)return!0}C8.Command=E8;C8.useColor=T8});var SS=q(Cs=>{var{Argument:xS}=Bg(),{Command:k8}=vS(),{CommanderError:NH,InvalidArgumentError:_S}=cm(),{Help:OH}=g8(),{Option:bS}=_8();Cs.program=new k8;Cs.createCommand=t=>new k8(t);Cs.createOption=(t,e)=>new bS(t,e);Cs.createArgument=(t,e)=>new xS(t,e);Cs.Command=k8;Cs.Option=bS;Cs.Argument=xS;Cs.Help=OH;Cs.CommanderError=NH;Cs.InvalidArgumentError=_S;Cs.InvalidOptionArgumentError=_S});var TS=q((rs,ES)=>{var Xs=SS();rs=ES.exports={};rs.program=new Xs.Command;rs.Argument=Xs.Argument;rs.Command=Xs.Command;rs.CommanderError=Xs.CommanderError;rs.Help=Xs.Help;rs.InvalidArgumentError=Xs.InvalidArgumentError;rs.InvalidOptionArgumentError=Xs.InvalidArgumentError;rs.Option=Xs.Option;rs.createCommand=t=>new Xs.Command(t);rs.createOption=(t,e)=>new Xs.Option(t,e);rs.createArgument=(t,e)=>new Xs.Argument(t,e)});var vc=q(_9=>{"use strict";Object.defineProperty(_9,"__esModule",{value:!0});var v9;function x9(){if(v9===void 0)throw new Error("No runtime abstraction layer installed");return v9}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");v9=r}t.install=e})(x9||(x9={}));_9.default=x9});var Pd=q(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.stringArray=ei.array=ei.func=ei.error=ei.number=ei.string=ei.boolean=void 0;function zee(t){return t===!0||t===!1}ei.boolean=zee;function fA(t){return typeof t=="string"||t instanceof String}ei.string=fA;function Wee(t){return typeof t=="number"||t instanceof Number}ei.number=Wee;function Kee(t){return t instanceof Error}ei.error=Kee;function Gee(t){return typeof t=="function"}ei.func=Gee;function dA(t){return Array.isArray(t)}ei.array=dA;function Jee(t){return dA(t)&&t.every(e=>fA(e))}ei.stringArray=Jee});var Au=q(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.Emitter=Nd.Event=void 0;var Qee=vc(),pA;(function(t){let e={dispose(){}};t.None=function(){return e}})(pA||(Nd.Event=pA={}));var b9=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,s=this._callbacks.length;i<s;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 s=0,o=n.length;s<o;s++)try{r.push(n[s].apply(i[s],e))}catch(a){(0,Qee.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},T2=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new b9),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Nd.Emitter=T2;T2._noop=function(){}});var mh=q(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.CancellationTokenSource=Od.CancellationToken=void 0;var Yee=vc(),Zee=Pd(),S9=Au(),C2;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:S9.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:S9.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||Zee.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(C2||(Od.CancellationToken=C2={}));var Xee=Object.freeze(function(t,e){let r=(0,Yee.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),k2=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?Xee:(this._emitter||(this._emitter=new S9.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},E9=class{get token(){return this._token||(this._token=new k2),this._token}cancel(){this._token?this._token.cancel():this._token=C2.Cancelled}dispose(){this._token?this._token instanceof k2&&this._token.dispose():this._token=C2.None}};Od.CancellationTokenSource=E9});var a3=q(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.thenable=gn.typedArray=gn.stringArray=gn.array=gn.func=gn.error=gn.number=gn.string=gn.boolean=void 0;function gte(t){return t===!0||t===!1}gn.boolean=gte;function UA(t){return typeof t=="string"||t instanceof String}gn.string=UA;function yte(t){return typeof t=="number"||t instanceof Number}gn.number=yte;function vte(t){return t instanceof Error}gn.error=vte;function qA(t){return typeof t=="function"}gn.func=qA;function BA(t){return Array.isArray(t)}gn.array=BA;function xte(t){return BA(t)&&t.every(e=>UA(e))}gn.stringArray=xte;function _te(t,e){return Array.isArray(t)&&t.every(e)}gn.typedArray=_te;function bte(t){return t&&qA(t.then)}gn.thenable=bte});var p5=q(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.Message=Ge.NotificationType9=Ge.NotificationType8=Ge.NotificationType7=Ge.NotificationType6=Ge.NotificationType5=Ge.NotificationType4=Ge.NotificationType3=Ge.NotificationType2=Ge.NotificationType1=Ge.NotificationType0=Ge.NotificationType=Ge.RequestType9=Ge.RequestType8=Ge.RequestType7=Ge.RequestType6=Ge.RequestType5=Ge.RequestType4=Ge.RequestType3=Ge.RequestType2=Ge.RequestType1=Ge.RequestType=Ge.RequestType0=Ge.AbstractMessageSignature=Ge.ParameterStructures=Ge.ResponseError=Ge.ErrorCodes=void 0;var Gu=Pd(),B9;(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})(B9||(Ge.ErrorCodes=B9={}));var H9=class t extends Error{constructor(e,r,n){super(r),this.code=Gu.number(e)?e:B9.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Ge.ResponseError=H9;var $i=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};Ge.ParameterStructures=$i;$i.auto=new $i("auto");$i.byPosition=new $i("byPosition");$i.byName=new $i("byName");var Tr=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return $i.auto}};Ge.AbstractMessageSignature=Tr;var z9=class extends Tr{constructor(e){super(e,0)}};Ge.RequestType0=z9;var W9=class extends Tr{constructor(e,r=$i.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};Ge.RequestType=W9;var K9=class extends Tr{constructor(e,r=$i.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};Ge.RequestType1=K9;var G9=class extends Tr{constructor(e){super(e,2)}};Ge.RequestType2=G9;var J9=class extends Tr{constructor(e){super(e,3)}};Ge.RequestType3=J9;var Q9=class extends Tr{constructor(e){super(e,4)}};Ge.RequestType4=Q9;var Y9=class extends Tr{constructor(e){super(e,5)}};Ge.RequestType5=Y9;var Z9=class extends Tr{constructor(e){super(e,6)}};Ge.RequestType6=Z9;var X9=class extends Tr{constructor(e){super(e,7)}};Ge.RequestType7=X9;var e5=class extends Tr{constructor(e){super(e,8)}};Ge.RequestType8=e5;var t5=class extends Tr{constructor(e){super(e,9)}};Ge.RequestType9=t5;var r5=class extends Tr{constructor(e,r=$i.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};Ge.NotificationType=r5;var n5=class extends Tr{constructor(e){super(e,0)}};Ge.NotificationType0=n5;var i5=class extends Tr{constructor(e,r=$i.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};Ge.NotificationType1=i5;var s5=class extends Tr{constructor(e){super(e,2)}};Ge.NotificationType2=s5;var o5=class extends Tr{constructor(e){super(e,3)}};Ge.NotificationType3=o5;var a5=class extends Tr{constructor(e){super(e,4)}};Ge.NotificationType4=a5;var c5=class extends Tr{constructor(e){super(e,5)}};Ge.NotificationType5=c5;var u5=class extends Tr{constructor(e){super(e,6)}};Ge.NotificationType6=u5;var l5=class extends Tr{constructor(e){super(e,7)}};Ge.NotificationType7=l5;var f5=class extends Tr{constructor(e){super(e,8)}};Ge.NotificationType8=f5;var d5=class extends Tr{constructor(e){super(e,9)}};Ge.NotificationType9=d5;var HA;(function(t){function e(i){let s=i;return s&&Gu.string(s.method)&&(Gu.string(s.id)||Gu.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&Gu.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(Gu.string(s.id)||Gu.number(s.id)||s.id===null)}t.isResponse=n})(HA||(Ge.Message=HA={}))});var h5=q(Sc=>{"use strict";var zA;Object.defineProperty(Sc,"__esModule",{value:!0});Sc.LRUCache=Sc.LinkedMap=Sc.Touch=void 0;var ni;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(ni||(Sc.Touch=ni={}));var c3=class{constructor(){this[zA]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)==null?void 0:e.value}get last(){var e;return(e=this._tail)==null?void 0:e.value}has(e){return this._map.has(e)}get(e,r=ni.None){let n=this._map.get(e);if(n)return r!==ni.None&&this.touch(n,r),n.value}set(e,r,n=ni.None){let i=this._map.get(e);if(i)i.value=r,n!==ni.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case ni.None:this.addItemLast(i);break;case ni.First:this.addItemFirst(i);break;case ni.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}[(zA=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!==ni.First&&r!==ni.Last)){if(r===ni.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===ni.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)}};Sc.LinkedMap=c3;var m5=class extends c3{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=ni.AsNew){return super.get(e,r)}peek(e){return super.get(e,ni.None)}set(e,r){return super.set(e,r,ni.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Sc.LRUCache=m5});var KA=q(u3=>{"use strict";Object.defineProperty(u3,"__esModule",{value:!0});u3.Disposable=void 0;var WA;(function(t){function e(r){return{dispose:r}}t.create=e})(WA||(u3.Disposable=WA={}))});var GA=q(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.SharedArrayReceiverStrategy=Hd.SharedArraySenderStrategy=void 0;var Ste=mh(),p1;(function(t){t.Continue=0,t.Cancelled=1})(p1||(p1={}));var g5=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=p1.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,p1.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Hd.SharedArraySenderStrategy=g5;var y5=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===p1.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},v5=class{constructor(e){this.token=new y5(e)}cancel(){}dispose(){}},x5=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new Ste.CancellationTokenSource:new v5(r)}};Hd.SharedArrayReceiverStrategy=x5});var b5=q(l3=>{"use strict";Object.defineProperty(l3,"__esModule",{value:!0});l3.Semaphore=void 0;var Ete=vc(),_5=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,Ete.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()}}};l3.Semaphore=_5});var QA=q(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.ReadableStreamMessageReader=Ec.AbstractMessageReader=Ec.MessageReader=void 0;var E5=vc(),zd=Pd(),S5=Au(),Tte=b5(),JA;(function(t){function e(r){let n=r;return n&&zd.func(n.listen)&&zd.func(n.dispose)&&zd.func(n.onError)&&zd.func(n.onClose)&&zd.func(n.onPartialMessage)}t.is=e})(JA||(Ec.MessageReader=JA={}));var f3=class{constructor(){this.errorEmitter=new S5.Emitter,this.closeEmitter=new S5.Emitter,this.partialMessageEmitter=new S5.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: ${zd.string(e.message)?e.message:"unknown"}`)}};Ec.AbstractMessageReader=f3;var T5;(function(t){function e(r){var u;let n,i,s,o=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r!=null?r:"utf-8";else{if(n=(u=r.charset)!=null?u:"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,o.set(s.name,s)),r.contentDecoders!==void 0)for(let f of r.contentDecoders)o.set(f.name,f);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let f of r.contentTypeDecoders)c.set(f.name,f)}return a===void 0&&(a=(0,E5.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(T5||(T5={}));var C5=class extends f3{constructor(e,r){super(),this.readable=e,this.options=T5.fromOptions(r),this.buffer=(0,E5.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Tte.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
27
+ ${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,E5.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))}};Ec.ReadableStreamMessageReader=C5});var tR=q(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.WriteableStreamMessageWriter=Tc.AbstractMessageWriter=Tc.MessageWriter=void 0;var YA=vc(),m1=Pd(),Cte=b5(),ZA=Au(),kte="Content-Length: ",XA=`\r
28
+ `,eR;(function(t){function e(r){let n=r;return n&&m1.func(n.dispose)&&m1.func(n.onClose)&&m1.func(n.onError)&&m1.func(n.write)}t.is=e})(eR||(Tc.MessageWriter=eR={}));var d3=class{constructor(){this.errorEmitter=new ZA.Emitter,this.closeEmitter=new ZA.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: ${m1.string(e.message)?e.message:"unknown"}`)}};Tc.AbstractMessageWriter=d3;var k5;(function(t){function e(r){var n,i;return r===void 0||typeof r=="string"?{charset:r!=null?r:"utf-8",contentTypeEncoder:(0,YA.default)().applicationJson.encoder}:{charset:(n=r.charset)!=null?n:"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:(i=r.contentTypeEncoder)!=null?i:(0,YA.default)().applicationJson.encoder}}t.fromOptions=e})(k5||(k5={}));var w5=class extends d3{constructor(e,r){super(),this.writable=e,this.options=k5.fromOptions(r),this.errorCount=0,this.writeSemaphore=new Cte.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(kte,n.byteLength.toString(),XA),i.push(XA),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()}};Tc.WriteableStreamMessageWriter=w5});var rR=q(p3=>{"use strict";Object.defineProperty(p3,"__esModule",{value:!0});p3.AbstractMessageBuffer=void 0;var wte=13,Ate=10,Rte=`\r
29
+ `,A5=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let u=this._chunks[n];for(i=0;i<u.length;){switch(u[i]){case wte:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case Ate:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=u.byteLength,n++}if(r!==4)return;let o=this._read(s+i),a=new Map,c=this.toString(o,"ascii").split(Rte);if(c.length<2)return a;for(let u=0;u<c.length-2;u++){let f=c[u],l=f.indexOf(":");if(l===-1)throw new Error(`Message header must separate key and value using ':'
30
+ ${f}`);let p=f.substr(0,l),d=f.substr(l+1).trim();a.set(e?p.toLowerCase():p,d)}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 s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);r.set(o,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};p3.AbstractMessageBuffer=A5});var aR=q(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.createMessageConnection=ft.ConnectionOptions=ft.MessageStrategy=ft.CancellationStrategy=ft.CancellationSenderStrategy=ft.CancellationReceiverStrategy=ft.RequestCancellationReceiverStrategy=ft.IdCancellationReceiverStrategy=ft.ConnectionStrategy=ft.ConnectionError=ft.ConnectionErrors=ft.LogTraceNotification=ft.SetTraceNotification=ft.TraceFormat=ft.TraceValues=ft.Trace=ft.NullLogger=ft.ProgressType=ft.ProgressToken=void 0;var nR=vc(),Br=Pd(),et=p5(),iR=h5(),h1=Au(),R5=mh(),v1;(function(t){t.type=new et.NotificationType("$/cancelRequest")})(v1||(v1={}));var P5;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(P5||(ft.ProgressToken=P5={}));var g1;(function(t){t.type=new et.NotificationType("$/progress")})(g1||(g1={}));var N5=class{constructor(){}};ft.ProgressType=N5;var O5;(function(t){function e(r){return Br.func(r)}t.is=e})(O5||(O5={}));ft.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Kt;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Kt||(ft.Trace=Kt={}));var sR;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(sR||(ft.TraceValues=sR={}));(function(t){function e(n){if(!Br.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})(Kt||(ft.Trace=Kt={}));var ls;(function(t){t.Text="text",t.JSON="json"})(ls||(ft.TraceFormat=ls={}));(function(t){function e(r){return Br.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(ls||(ft.TraceFormat=ls={}));var I5;(function(t){t.type=new et.NotificationType("$/setTrace")})(I5||(ft.SetTraceNotification=I5={}));var m3;(function(t){t.type=new et.NotificationType("$/logTrace")})(m3||(ft.LogTraceNotification=m3={}));var y1;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(y1||(ft.ConnectionErrors=y1={}));var Wd=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ft.ConnectionError=Wd;var D5;(function(t){function e(r){let n=r;return n&&Br.func(n.cancelUndispatched)}t.is=e})(D5||(ft.ConnectionStrategy=D5={}));var h3;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Br.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Br.func(n.dispose))}t.is=e})(h3||(ft.IdCancellationReceiverStrategy=h3={}));var L5;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Br.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Br.func(n.dispose))}t.is=e})(L5||(ft.RequestCancellationReceiverStrategy=L5={}));var g3;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new R5.CancellationTokenSource}});function e(r){return h3.is(r)||L5.is(r)}t.is=e})(g3||(ft.CancellationReceiverStrategy=g3={}));var y3;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(v1.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Br.func(n.sendCancellation)&&Br.func(n.cleanup)}t.is=e})(y3||(ft.CancellationSenderStrategy=y3={}));var v3;(function(t){t.Message=Object.freeze({receiver:g3.Message,sender:y3.Message});function e(r){let n=r;return n&&g3.is(n.receiver)&&y3.is(n.sender)}t.is=e})(v3||(ft.CancellationStrategy=v3={}));var x3;(function(t){function e(r){let n=r;return n&&Br.func(n.handleMessage)}t.is=e})(x3||(ft.MessageStrategy=x3={}));var oR;(function(t){function e(r){let n=r;return n&&(v3.is(n.cancellationStrategy)||D5.is(n.connectionStrategy)||x3.is(n.messageStrategy))}t.is=e})(oR||(ft.ConnectionOptions=oR={}));var so;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(so||(so={}));function Pte(t,e,r,n){let i=r!==void 0?r:ft.NullLogger,s=0,o=0,a=0,c="2.0",u,f=new Map,l,p=new Map,d=new Map,h,g=new iR.LinkedMap,v=new Map,b=new Set,_=new Map,x=Kt.Off,T=ls.Text,R,V=so.New,$=new h1.Emitter,K=new h1.Emitter,z=new h1.Emitter,W=new h1.Emitter,D=new h1.Emitter,P=n&&n.cancellationStrategy?n.cancellationStrategy:v3.Message;function M(O){if(O===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+O.toString()}function j(O){return O===null?"res-unknown-"+(++a).toString():"res-"+O.toString()}function J(){return"not-"+(++o).toString()}function te(O,X){et.Message.isRequest(X)?O.set(M(X.id),X):et.Message.isResponse(X)?O.set(j(X.id),X):O.set(J(),X)}function re(O){}function we(){return V===so.Listening}function Q(){return V===so.Closed}function F(){return V===so.Disposed}function Oe(){(V===so.New||V===so.Listening)&&(V=so.Closed,K.fire(void 0))}function ze(O){$.fire([O,void 0,void 0])}function pt(O){$.fire(O)}t.onClose(Oe),t.onError(ze),e.onClose(Oe),e.onError(pt);function qe(){h||g.size===0||(h=(0,nR.default)().timer.setImmediate(()=>{h=void 0,Te()}))}function Je(O){et.Message.isRequest(O)?he(O):et.Message.isNotification(O)?Ce(O):et.Message.isResponse(O)?Ee(O):We(O)}function Te(){if(g.size===0)return;let O=g.shift();try{let X=n==null?void 0:n.messageStrategy;x3.is(X)?X.handleMessage(O,Je):Je(O)}finally{qe()}}let ie=O=>{try{if(et.Message.isNotification(O)&&O.method===v1.type.method){let X=O.params.id,fe=M(X),Me=g.get(fe);if(et.Message.isRequest(Me)){let Lt=n==null?void 0:n.connectionStrategy,$t=Lt&&Lt.cancelUndispatched?Lt.cancelUndispatched(Me,re):void 0;if($t&&($t.error!==void 0||$t.result!==void 0)){g.delete(fe),_.delete(X),$t.id=Me.id,ve($t,O.method,Date.now()),e.write($t).catch(()=>i.error("Sending response for canceled message failed."));return}}let Jt=_.get(X);if(Jt!==void 0){Jt.cancel(),Gt(O);return}else b.add(X)}te(g,O)}finally{qe()}};function he(O){var $r;if(F())return;function X(kt,ur,zt){let lr={jsonrpc:c,id:O.id};kt instanceof et.ResponseError?lr.error=kt.toJson():lr.result=kt===void 0?null:kt,ve(lr,ur,zt),e.write(lr).catch(()=>i.error("Sending response failed."))}function fe(kt,ur,zt){let lr={jsonrpc:c,id:O.id,error:kt.toJson()};ve(lr,ur,zt),e.write(lr).catch(()=>i.error("Sending response failed."))}function Me(kt,ur,zt){kt===void 0&&(kt=null);let lr={jsonrpc:c,id:O.id,result:kt};ve(lr,ur,zt),e.write(lr).catch(()=>i.error("Sending response failed."))}at(O);let Jt=f.get(O.method),Lt,$t;Jt&&(Lt=Jt.type,$t=Jt.handler);let Ct=Date.now();if($t||u){let kt=($r=O.id)!=null?$r:String(Date.now()),ur=h3.is(P.receiver)?P.receiver.createCancellationTokenSource(kt):P.receiver.createCancellationTokenSource(O);O.id!==null&&b.has(O.id)&&ur.cancel(),O.id!==null&&_.set(kt,ur);try{let zt;if($t)if(O.params===void 0){if(Lt!==void 0&&Lt.numberOfParams!==0){fe(new et.ResponseError(et.ErrorCodes.InvalidParams,`Request ${O.method} defines ${Lt.numberOfParams} params but received none.`),O.method,Ct);return}zt=$t(ur.token)}else if(Array.isArray(O.params)){if(Lt!==void 0&&Lt.parameterStructures===et.ParameterStructures.byName){fe(new et.ResponseError(et.ErrorCodes.InvalidParams,`Request ${O.method} defines parameters by name but received parameters by position`),O.method,Ct);return}zt=$t(...O.params,ur.token)}else{if(Lt!==void 0&&Lt.parameterStructures===et.ParameterStructures.byPosition){fe(new et.ResponseError(et.ErrorCodes.InvalidParams,`Request ${O.method} defines parameters by position but received parameters by name`),O.method,Ct);return}zt=$t(O.params,ur.token)}else u&&(zt=u(O.method,O.params,ur.token));let lr=zt;zt?lr.then?lr.then(Mr=>{_.delete(kt),X(Mr,O.method,Ct)},Mr=>{_.delete(kt),Mr instanceof et.ResponseError?fe(Mr,O.method,Ct):Mr&&Br.string(Mr.message)?fe(new et.ResponseError(et.ErrorCodes.InternalError,`Request ${O.method} failed with message: ${Mr.message}`),O.method,Ct):fe(new et.ResponseError(et.ErrorCodes.InternalError,`Request ${O.method} failed unexpectedly without providing any details.`),O.method,Ct)}):(_.delete(kt),X(zt,O.method,Ct)):(_.delete(kt),Me(zt,O.method,Ct))}catch(zt){_.delete(kt),zt instanceof et.ResponseError?X(zt,O.method,Ct):zt&&Br.string(zt.message)?fe(new et.ResponseError(et.ErrorCodes.InternalError,`Request ${O.method} failed with message: ${zt.message}`),O.method,Ct):fe(new et.ResponseError(et.ErrorCodes.InternalError,`Request ${O.method} failed unexpectedly without providing any details.`),O.method,Ct)}}else fe(new et.ResponseError(et.ErrorCodes.MethodNotFound,`Unhandled method ${O.method}`),O.method,Ct)}function Ee(O){if(!F())if(O.id===null)O.error?i.error(`Received response message without id: Error is:
31
+ ${JSON.stringify(O.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let X=O.id,fe=v.get(X);if(wr(O,fe),fe!==void 0){v.delete(X);try{if(O.error){let Me=O.error;fe.reject(new et.ResponseError(Me.code,Me.message,Me.data))}else if(O.result!==void 0)fe.resolve(O.result);else throw new Error("Should never happen.")}catch(Me){Me.message?i.error(`Response handler '${fe.method}' failed with message: ${Me.message}`):i.error(`Response handler '${fe.method}' failed unexpectedly.`)}}}}function Ce(O){if(F())return;let X,fe;if(O.method===v1.type.method){let Me=O.params.id;b.delete(Me),Gt(O);return}else{let Me=p.get(O.method);Me&&(fe=Me.handler,X=Me.type)}if(fe||l)try{if(Gt(O),fe)if(O.params===void 0)X!==void 0&&X.numberOfParams!==0&&X.parameterStructures!==et.ParameterStructures.byName&&i.error(`Notification ${O.method} defines ${X.numberOfParams} params but received none.`),fe();else if(Array.isArray(O.params)){let Me=O.params;O.method===g1.type.method&&Me.length===2&&P5.is(Me[0])?fe({token:Me[0],value:Me[1]}):(X!==void 0&&(X.parameterStructures===et.ParameterStructures.byName&&i.error(`Notification ${O.method} defines parameters by name but received parameters by position`),X.numberOfParams!==O.params.length&&i.error(`Notification ${O.method} defines ${X.numberOfParams} params but received ${Me.length} arguments`)),fe(...Me))}else X!==void 0&&X.parameterStructures===et.ParameterStructures.byPosition&&i.error(`Notification ${O.method} defines parameters by position but received parameters by name`),fe(O.params);else l&&l(O.method,O.params)}catch(Me){Me.message?i.error(`Notification handler '${O.method}' failed with message: ${Me.message}`):i.error(`Notification handler '${O.method}' failed unexpectedly.`)}else z.fire(O)}function We(O){if(!O){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
32
+ ${JSON.stringify(O,null,4)}`);let X=O;if(Br.string(X.id)||Br.number(X.id)){let fe=X.id,Me=v.get(fe);Me&&Me.reject(new Error("The received response has neither a result nor an error property."))}}function me(O){if(O!=null)switch(x){case Kt.Verbose:return JSON.stringify(O,null,4);case Kt.Compact:return JSON.stringify(O);default:return}}function Nt(O){if(!(x===Kt.Off||!R))if(T===ls.Text){let X;(x===Kt.Verbose||x===Kt.Compact)&&O.params&&(X=`Params: ${me(O.params)}
33
+
34
+ `),R.log(`Sending request '${O.method} - (${O.id})'.`,X)}else Ht("send-request",O)}function G(O){if(!(x===Kt.Off||!R))if(T===ls.Text){let X;(x===Kt.Verbose||x===Kt.Compact)&&(O.params?X=`Params: ${me(O.params)}
35
+
36
+ `:X=`No parameters provided.
37
+
38
+ `),R.log(`Sending notification '${O.method}'.`,X)}else Ht("send-notification",O)}function ve(O,X,fe){if(!(x===Kt.Off||!R))if(T===ls.Text){let Me;(x===Kt.Verbose||x===Kt.Compact)&&(O.error&&O.error.data?Me=`Error data: ${me(O.error.data)}
39
+
40
+ `:O.result?Me=`Result: ${me(O.result)}
41
+
42
+ `:O.error===void 0&&(Me=`No result returned.
43
+
44
+ `)),R.log(`Sending response '${X} - (${O.id})'. Processing request took ${Date.now()-fe}ms`,Me)}else Ht("send-response",O)}function at(O){if(!(x===Kt.Off||!R))if(T===ls.Text){let X;(x===Kt.Verbose||x===Kt.Compact)&&O.params&&(X=`Params: ${me(O.params)}
45
+
46
+ `),R.log(`Received request '${O.method} - (${O.id})'.`,X)}else Ht("receive-request",O)}function Gt(O){if(!(x===Kt.Off||!R||O.method===m3.type.method))if(T===ls.Text){let X;(x===Kt.Verbose||x===Kt.Compact)&&(O.params?X=`Params: ${me(O.params)}
47
+
48
+ `:X=`No parameters provided.
49
+
50
+ `),R.log(`Received notification '${O.method}'.`,X)}else Ht("receive-notification",O)}function wr(O,X){if(!(x===Kt.Off||!R))if(T===ls.Text){let fe;if((x===Kt.Verbose||x===Kt.Compact)&&(O.error&&O.error.data?fe=`Error data: ${me(O.error.data)}
51
+
52
+ `:O.result?fe=`Result: ${me(O.result)}
53
+
54
+ `:O.error===void 0&&(fe=`No result returned.
55
+
56
+ `)),X){let Me=O.error?` Request failed: ${O.error.message} (${O.error.code}).`:"";R.log(`Received response '${X.method} - (${O.id})' in ${Date.now()-X.timerStart}ms.${Me}`,fe)}else R.log(`Received response ${O.id} without active response promise.`,fe)}else Ht("receive-response",O)}function Ht(O,X){if(!R||x===Kt.Off)return;let fe={isLSPMessage:!0,type:O,message:X,timestamp:Date.now()};R.log(fe)}function en(){if(Q())throw new Wd(y1.Closed,"Connection is closed.");if(F())throw new Wd(y1.Disposed,"Connection is disposed.")}function _n(){if(we())throw new Wd(y1.AlreadyListening,"Connection is already listening")}function fn(){if(!we())throw new Error("Call listen() first.")}function tn(O){return O===void 0?null:O}function bn(O){if(O!==null)return O}function vo(O){return O!=null&&!Array.isArray(O)&&typeof O=="object"}function xo(O,X){switch(O){case et.ParameterStructures.auto:return vo(X)?bn(X):[tn(X)];case et.ParameterStructures.byName:if(!vo(X))throw new Error("Received parameters by name but param is not an object literal.");return bn(X);case et.ParameterStructures.byPosition:return[tn(X)];default:throw new Error(`Unknown parameter structure ${O.toString()}`)}}function Fn(O,X){let fe,Me=O.numberOfParams;switch(Me){case 0:fe=void 0;break;case 1:fe=xo(O.parameterStructures,X[0]);break;default:fe=[];for(let Jt=0;Jt<X.length&&Jt<Me;Jt++)fe.push(tn(X[Jt]));if(X.length<Me)for(let Jt=X.length;Jt<Me;Jt++)fe.push(null);break}return fe}let di={sendNotification:(O,...X)=>{en();let fe,Me;if(Br.string(O)){fe=O;let Lt=X[0],$t=0,Ct=et.ParameterStructures.auto;et.ParameterStructures.is(Lt)&&($t=1,Ct=Lt);let $r=X.length,kt=$r-$t;switch(kt){case 0:Me=void 0;break;case 1:Me=xo(Ct,X[$t]);break;default:if(Ct===et.ParameterStructures.byName)throw new Error(`Received ${kt} parameters for 'by Name' notification parameter structure.`);Me=X.slice($t,$r).map(ur=>tn(ur));break}}else{let Lt=X;fe=O.method,Me=Fn(O,Lt)}let Jt={jsonrpc:c,method:fe,params:Me};return G(Jt),e.write(Jt).catch(Lt=>{throw i.error("Sending notification failed."),Lt})},onNotification:(O,X)=>{en();let fe;return Br.func(O)?l=O:X&&(Br.string(O)?(fe=O,p.set(O,{type:void 0,handler:X})):(fe=O.method,p.set(O.method,{type:O,handler:X}))),{dispose:()=>{fe!==void 0?p.delete(fe):l=void 0}}},onProgress:(O,X,fe)=>{if(d.has(X))throw new Error(`Progress handler for token ${X} already registered`);return d.set(X,fe),{dispose:()=>{d.delete(X)}}},sendProgress:(O,X,fe)=>di.sendNotification(g1.type,{token:X,value:fe}),onUnhandledProgress:W.event,sendRequest:(O,...X)=>{en(),fn();let fe,Me,Jt;if(Br.string(O)){fe=O;let $r=X[0],kt=X[X.length-1],ur=0,zt=et.ParameterStructures.auto;et.ParameterStructures.is($r)&&(ur=1,zt=$r);let lr=X.length;R5.CancellationToken.is(kt)&&(lr=lr-1,Jt=kt);let Mr=lr-ur;switch(Mr){case 0:Me=void 0;break;case 1:Me=xo(zt,X[ur]);break;default:if(zt===et.ParameterStructures.byName)throw new Error(`Received ${Mr} parameters for 'by Name' request parameter structure.`);Me=X.slice(ur,lr).map(Zs=>tn(Zs));break}}else{let $r=X;fe=O.method,Me=Fn(O,$r);let kt=O.numberOfParams;Jt=R5.CancellationToken.is($r[kt])?$r[kt]:void 0}let Lt=s++,$t;Jt&&($t=Jt.onCancellationRequested(()=>{let $r=P.sender.sendCancellation(di,Lt);return $r===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Lt}`),Promise.resolve()):$r.catch(()=>{i.log(`Sending cancellation messages for id ${Lt} failed`)})}));let Ct={jsonrpc:c,id:Lt,method:fe,params:Me};return Nt(Ct),typeof P.sender.enableCancellation=="function"&&P.sender.enableCancellation(Ct),new Promise(async($r,kt)=>{let ur=Mr=>{$r(Mr),P.sender.cleanup(Lt),$t==null||$t.dispose()},zt=Mr=>{kt(Mr),P.sender.cleanup(Lt),$t==null||$t.dispose()},lr={method:fe,timerStart:Date.now(),resolve:ur,reject:zt};try{await e.write(Ct),v.set(Lt,lr)}catch(Mr){throw i.error("Sending request failed."),lr.reject(new et.ResponseError(et.ErrorCodes.MessageWriteError,Mr.message?Mr.message:"Unknown reason")),Mr}})},onRequest:(O,X)=>{en();let fe=null;return O5.is(O)?(fe=void 0,u=O):Br.string(O)?(fe=null,X!==void 0&&(fe=O,f.set(O,{handler:X,type:void 0}))):X!==void 0&&(fe=O.method,f.set(O.method,{type:O,handler:X})),{dispose:()=>{fe!==null&&(fe!==void 0?f.delete(fe):u=void 0)}}},hasPendingResponse:()=>v.size>0,trace:async(O,X,fe)=>{let Me=!1,Jt=ls.Text;fe!==void 0&&(Br.boolean(fe)?Me=fe:(Me=fe.sendNotification||!1,Jt=fe.traceFormat||ls.Text)),x=O,T=Jt,x===Kt.Off?R=void 0:R=X,Me&&!Q()&&!F()&&await di.sendNotification(I5.type,{value:Kt.toString(O)})},onError:$.event,onClose:K.event,onUnhandledNotification:z.event,onDispose:D.event,end:()=>{e.end()},dispose:()=>{if(F())return;V=so.Disposed,D.fire(void 0);let O=new et.ResponseError(et.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let X of v.values())X.reject(O);v=new Map,_=new Map,b=new Set,g=new iR.LinkedMap,Br.func(e.dispose)&&e.dispose(),Br.func(t.dispose)&&t.dispose()},listen:()=>{en(),_n(),V=so.Listening,t.listen(ie)},inspect:()=>{(0,nR.default)().console.log("inspect")}};return di.onNotification(m3.type,O=>{if(x===Kt.Off||!R)return;let X=x===Kt.Verbose||x===Kt.Compact;R.log(O.message,X?O.verbose:void 0)}),di.onNotification(g1.type,O=>{let X=d.get(O.token);X?X(O.value):W.fire(O)}),di}ft.createMessageConnection=Pte});var _3=q(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.ProgressType=Z.ProgressToken=Z.createMessageConnection=Z.NullLogger=Z.ConnectionOptions=Z.ConnectionStrategy=Z.AbstractMessageBuffer=Z.WriteableStreamMessageWriter=Z.AbstractMessageWriter=Z.MessageWriter=Z.ReadableStreamMessageReader=Z.AbstractMessageReader=Z.MessageReader=Z.SharedArrayReceiverStrategy=Z.SharedArraySenderStrategy=Z.CancellationToken=Z.CancellationTokenSource=Z.Emitter=Z.Event=Z.Disposable=Z.LRUCache=Z.Touch=Z.LinkedMap=Z.ParameterStructures=Z.NotificationType9=Z.NotificationType8=Z.NotificationType7=Z.NotificationType6=Z.NotificationType5=Z.NotificationType4=Z.NotificationType3=Z.NotificationType2=Z.NotificationType1=Z.NotificationType0=Z.NotificationType=Z.ErrorCodes=Z.ResponseError=Z.RequestType9=Z.RequestType8=Z.RequestType7=Z.RequestType6=Z.RequestType5=Z.RequestType4=Z.RequestType3=Z.RequestType2=Z.RequestType1=Z.RequestType0=Z.RequestType=Z.Message=Z.RAL=void 0;Z.MessageStrategy=Z.CancellationStrategy=Z.CancellationSenderStrategy=Z.CancellationReceiverStrategy=Z.ConnectionError=Z.ConnectionErrors=Z.LogTraceNotification=Z.SetTraceNotification=Z.TraceFormat=Z.TraceValues=Z.Trace=void 0;var yr=p5();Object.defineProperty(Z,"Message",{enumerable:!0,get:function(){return yr.Message}});Object.defineProperty(Z,"RequestType",{enumerable:!0,get:function(){return yr.RequestType}});Object.defineProperty(Z,"RequestType0",{enumerable:!0,get:function(){return yr.RequestType0}});Object.defineProperty(Z,"RequestType1",{enumerable:!0,get:function(){return yr.RequestType1}});Object.defineProperty(Z,"RequestType2",{enumerable:!0,get:function(){return yr.RequestType2}});Object.defineProperty(Z,"RequestType3",{enumerable:!0,get:function(){return yr.RequestType3}});Object.defineProperty(Z,"RequestType4",{enumerable:!0,get:function(){return yr.RequestType4}});Object.defineProperty(Z,"RequestType5",{enumerable:!0,get:function(){return yr.RequestType5}});Object.defineProperty(Z,"RequestType6",{enumerable:!0,get:function(){return yr.RequestType6}});Object.defineProperty(Z,"RequestType7",{enumerable:!0,get:function(){return yr.RequestType7}});Object.defineProperty(Z,"RequestType8",{enumerable:!0,get:function(){return yr.RequestType8}});Object.defineProperty(Z,"RequestType9",{enumerable:!0,get:function(){return yr.RequestType9}});Object.defineProperty(Z,"ResponseError",{enumerable:!0,get:function(){return yr.ResponseError}});Object.defineProperty(Z,"ErrorCodes",{enumerable:!0,get:function(){return yr.ErrorCodes}});Object.defineProperty(Z,"NotificationType",{enumerable:!0,get:function(){return yr.NotificationType}});Object.defineProperty(Z,"NotificationType0",{enumerable:!0,get:function(){return yr.NotificationType0}});Object.defineProperty(Z,"NotificationType1",{enumerable:!0,get:function(){return yr.NotificationType1}});Object.defineProperty(Z,"NotificationType2",{enumerable:!0,get:function(){return yr.NotificationType2}});Object.defineProperty(Z,"NotificationType3",{enumerable:!0,get:function(){return yr.NotificationType3}});Object.defineProperty(Z,"NotificationType4",{enumerable:!0,get:function(){return yr.NotificationType4}});Object.defineProperty(Z,"NotificationType5",{enumerable:!0,get:function(){return yr.NotificationType5}});Object.defineProperty(Z,"NotificationType6",{enumerable:!0,get:function(){return yr.NotificationType6}});Object.defineProperty(Z,"NotificationType7",{enumerable:!0,get:function(){return yr.NotificationType7}});Object.defineProperty(Z,"NotificationType8",{enumerable:!0,get:function(){return yr.NotificationType8}});Object.defineProperty(Z,"NotificationType9",{enumerable:!0,get:function(){return yr.NotificationType9}});Object.defineProperty(Z,"ParameterStructures",{enumerable:!0,get:function(){return yr.ParameterStructures}});var $5=h5();Object.defineProperty(Z,"LinkedMap",{enumerable:!0,get:function(){return $5.LinkedMap}});Object.defineProperty(Z,"LRUCache",{enumerable:!0,get:function(){return $5.LRUCache}});Object.defineProperty(Z,"Touch",{enumerable:!0,get:function(){return $5.Touch}});var Nte=KA();Object.defineProperty(Z,"Disposable",{enumerable:!0,get:function(){return Nte.Disposable}});var cR=Au();Object.defineProperty(Z,"Event",{enumerable:!0,get:function(){return cR.Event}});Object.defineProperty(Z,"Emitter",{enumerable:!0,get:function(){return cR.Emitter}});var uR=mh();Object.defineProperty(Z,"CancellationTokenSource",{enumerable:!0,get:function(){return uR.CancellationTokenSource}});Object.defineProperty(Z,"CancellationToken",{enumerable:!0,get:function(){return uR.CancellationToken}});var lR=GA();Object.defineProperty(Z,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return lR.SharedArraySenderStrategy}});Object.defineProperty(Z,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return lR.SharedArrayReceiverStrategy}});var M5=QA();Object.defineProperty(Z,"MessageReader",{enumerable:!0,get:function(){return M5.MessageReader}});Object.defineProperty(Z,"AbstractMessageReader",{enumerable:!0,get:function(){return M5.AbstractMessageReader}});Object.defineProperty(Z,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return M5.ReadableStreamMessageReader}});var F5=tR();Object.defineProperty(Z,"MessageWriter",{enumerable:!0,get:function(){return F5.MessageWriter}});Object.defineProperty(Z,"AbstractMessageWriter",{enumerable:!0,get:function(){return F5.AbstractMessageWriter}});Object.defineProperty(Z,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return F5.WriteableStreamMessageWriter}});var Ote=rR();Object.defineProperty(Z,"AbstractMessageBuffer",{enumerable:!0,get:function(){return Ote.AbstractMessageBuffer}});var Hn=aR();Object.defineProperty(Z,"ConnectionStrategy",{enumerable:!0,get:function(){return Hn.ConnectionStrategy}});Object.defineProperty(Z,"ConnectionOptions",{enumerable:!0,get:function(){return Hn.ConnectionOptions}});Object.defineProperty(Z,"NullLogger",{enumerable:!0,get:function(){return Hn.NullLogger}});Object.defineProperty(Z,"createMessageConnection",{enumerable:!0,get:function(){return Hn.createMessageConnection}});Object.defineProperty(Z,"ProgressToken",{enumerable:!0,get:function(){return Hn.ProgressToken}});Object.defineProperty(Z,"ProgressType",{enumerable:!0,get:function(){return Hn.ProgressType}});Object.defineProperty(Z,"Trace",{enumerable:!0,get:function(){return Hn.Trace}});Object.defineProperty(Z,"TraceValues",{enumerable:!0,get:function(){return Hn.TraceValues}});Object.defineProperty(Z,"TraceFormat",{enumerable:!0,get:function(){return Hn.TraceFormat}});Object.defineProperty(Z,"SetTraceNotification",{enumerable:!0,get:function(){return Hn.SetTraceNotification}});Object.defineProperty(Z,"LogTraceNotification",{enumerable:!0,get:function(){return Hn.LogTraceNotification}});Object.defineProperty(Z,"ConnectionErrors",{enumerable:!0,get:function(){return Hn.ConnectionErrors}});Object.defineProperty(Z,"ConnectionError",{enumerable:!0,get:function(){return Hn.ConnectionError}});Object.defineProperty(Z,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Hn.CancellationReceiverStrategy}});Object.defineProperty(Z,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Hn.CancellationSenderStrategy}});Object.defineProperty(Z,"CancellationStrategy",{enumerable:!0,get:function(){return Hn.CancellationStrategy}});Object.defineProperty(Z,"MessageStrategy",{enumerable:!0,get:function(){return Hn.MessageStrategy}});var Ite=vc();Z.RAL=Ite.default});var pR=q(q5=>{"use strict";Object.defineProperty(q5,"__esModule",{value:!0});var fR=require("util"),ka=_3(),b3=class t extends ka.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new fR.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)}};b3.emptyBuffer=Buffer.allocUnsafe(0);var V5=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ka.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ka.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ka.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ka.Disposable.create(()=>this.stream.off("data",e))}},j5=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ka.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ka.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ka.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=o=>{o==null?n():i(o)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},dR=Object.freeze({messageBuffer:Object.freeze({create:t=>new b3(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 fR.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new V5(t),asWritableStream:t=>new j5(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 U5(){return dR}(function(t){function e(){ka.RAL.install(dR)}t.install=e})(U5||(U5={}));q5.default=U5});var Yu=q(Pt=>{"use strict";var Dte=Pt&&Pt.__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]}),Lte=Pt&&Pt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dte(e,t,r)};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.createMessageConnection=Pt.createServerSocketTransport=Pt.createClientSocketTransport=Pt.createServerPipeTransport=Pt.createClientPipeTransport=Pt.generateRandomPipeName=Pt.StreamMessageWriter=Pt.StreamMessageReader=Pt.SocketMessageWriter=Pt.SocketMessageReader=Pt.PortMessageWriter=Pt.PortMessageReader=Pt.IPCMessageWriter=Pt.IPCMessageReader=void 0;var Kd=pR();Kd.default.install();var mR=require("path"),$te=require("os"),Mte=require("crypto"),T3=require("net"),fs=_3();Lte(_3(),Pt);var B5=class extends fs.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),fs.Disposable.create(()=>this.process.off("message",e))}};Pt.IPCMessageReader=B5;var H5=class extends fs.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(){}};Pt.IPCMessageWriter=H5;var z5=class extends fs.AbstractMessageReader{constructor(e){super(),this.onData=new fs.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Pt.PortMessageReader=z5;var W5=class extends fs.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Pt.PortMessageWriter=W5;var Ju=class extends fs.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,Kd.default)().stream.asReadableStream(e),r)}};Pt.SocketMessageReader=Ju;var Qu=class extends fs.WriteableStreamMessageWriter{constructor(e,r){super((0,Kd.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Pt.SocketMessageWriter=Qu;var S3=class extends fs.ReadableStreamMessageReader{constructor(e,r){super((0,Kd.default)().stream.asReadableStream(e),r)}};Pt.StreamMessageReader=S3;var E3=class extends fs.WriteableStreamMessageWriter{constructor(e,r){super((0,Kd.default)().stream.asWritableStream(e),r)}};Pt.StreamMessageWriter=E3;var hR=process.env.XDG_RUNTIME_DIR,Fte=new Map([["linux",107],["darwin",103]]);function Vte(){let t=(0,Mte.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;hR?e=mR.join(hR,`vscode-ipc-${t}.sock`):e=mR.join($te.tmpdir(),`vscode-${t}.sock`);let r=Fte.get(process.platform);return r!==void 0&&e.length>r&&(0,Kd.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}Pt.generateRandomPipeName=Vte;function jte(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,T3.createServer)(a=>{o.close(),r([new Ju(a,e),new Qu(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Pt.createClientPipeTransport=jte;function Ute(t,e="utf-8"){let r=(0,T3.createConnection)(t);return[new Ju(r,e),new Qu(r,e)]}Pt.createServerPipeTransport=Ute;function qte(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,T3.createServer)(a=>{o.close(),r([new Ju(a,e),new Qu(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Pt.createClientSocketTransport=qte;function Bte(t,e="utf-8"){let r=(0,T3.createConnection)(t,"127.0.0.1");return[new Ju(r,e),new Qu(r,e)]}Pt.createServerSocketTransport=Bte;function Hte(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function zte(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function Wte(t,e,r,n){r||(r=fs.NullLogger);let i=Hte(t)?new S3(t):t,s=zte(e)?new E3(e):e;return fs.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,fs.createMessageConnection)(i,s,r,n)}Pt.createMessageConnection=Wte});var K5=q((XRe,gR)=>{"use strict";gR.exports=Yu()});var k3=q((yR,C3)=>{(function(t){if(typeof C3=="object"&&typeof C3.exports=="object"){var e=t(require,yR);e!==void 0&&(C3.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.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=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(S){function I(L){return typeof L=="string"}S.is=I})(r||(e.DocumentUri=r={}));var n;(function(S){function I(L){return typeof L=="string"}S.is=I})(n||(e.URI=n={}));var i;(function(S){S.MIN_VALUE=-2147483648,S.MAX_VALUE=2147483647;function I(L){return typeof L=="number"&&S.MIN_VALUE<=L&&L<=S.MAX_VALUE}S.is=I})(i||(e.integer=i={}));var s;(function(S){S.MIN_VALUE=0,S.MAX_VALUE=2147483647;function I(L){return typeof L=="number"&&S.MIN_VALUE<=L&&L<=S.MAX_VALUE}S.is=I})(s||(e.uinteger=s={}));var o;(function(S){function I(y,m){return y===Number.MAX_VALUE&&(y=s.MAX_VALUE),m===Number.MAX_VALUE&&(m=s.MAX_VALUE),{line:y,character:m}}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&B.uinteger(m.line)&&B.uinteger(m.character)}S.is=L})(o||(e.Position=o={}));var a;(function(S){function I(y,m,E,w){if(B.uinteger(y)&&B.uinteger(m)&&B.uinteger(E)&&B.uinteger(w))return{start:o.create(y,m),end:o.create(E,w)};if(o.is(y)&&o.is(m))return{start:y,end:m};throw new Error("Range#create called with invalid arguments[".concat(y,", ").concat(m,", ").concat(E,", ").concat(w,"]"))}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&o.is(m.start)&&o.is(m.end)}S.is=L})(a||(e.Range=a={}));var c;(function(S){function I(y,m){return{uri:y,range:m}}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&a.is(m.range)&&(B.string(m.uri)||B.undefined(m.uri))}S.is=L})(c||(e.Location=c={}));var u;(function(S){function I(y,m,E,w){return{targetUri:y,targetRange:m,targetSelectionRange:E,originSelectionRange:w}}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&a.is(m.targetRange)&&B.string(m.targetUri)&&a.is(m.targetSelectionRange)&&(a.is(m.originSelectionRange)||B.undefined(m.originSelectionRange))}S.is=L})(u||(e.LocationLink=u={}));var f;(function(S){function I(y,m,E,w){return{red:y,green:m,blue:E,alpha:w}}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&B.numberRange(m.red,0,1)&&B.numberRange(m.green,0,1)&&B.numberRange(m.blue,0,1)&&B.numberRange(m.alpha,0,1)}S.is=L})(f||(e.Color=f={}));var l;(function(S){function I(y,m){return{range:y,color:m}}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&a.is(m.range)&&f.is(m.color)}S.is=L})(l||(e.ColorInformation=l={}));var p;(function(S){function I(y,m,E){return{label:y,textEdit:m,additionalTextEdits:E}}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&B.string(m.label)&&(B.undefined(m.textEdit)||R.is(m))&&(B.undefined(m.additionalTextEdits)||B.typedArray(m.additionalTextEdits,R.is))}S.is=L})(p||(e.ColorPresentation=p={}));var d;(function(S){S.Comment="comment",S.Imports="imports",S.Region="region"})(d||(e.FoldingRangeKind=d={}));var h;(function(S){function I(y,m,E,w,U,ce){var Ie={startLine:y,endLine:m};return B.defined(E)&&(Ie.startCharacter=E),B.defined(w)&&(Ie.endCharacter=w),B.defined(U)&&(Ie.kind=U),B.defined(ce)&&(Ie.collapsedText=ce),Ie}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&B.uinteger(m.startLine)&&B.uinteger(m.startLine)&&(B.undefined(m.startCharacter)||B.uinteger(m.startCharacter))&&(B.undefined(m.endCharacter)||B.uinteger(m.endCharacter))&&(B.undefined(m.kind)||B.string(m.kind))}S.is=L})(h||(e.FoldingRange=h={}));var g;(function(S){function I(y,m){return{location:y,message:m}}S.create=I;function L(y){var m=y;return B.defined(m)&&c.is(m.location)&&B.string(m.message)}S.is=L})(g||(e.DiagnosticRelatedInformation=g={}));var v;(function(S){S.Error=1,S.Warning=2,S.Information=3,S.Hint=4})(v||(e.DiagnosticSeverity=v={}));var b;(function(S){S.Unnecessary=1,S.Deprecated=2})(b||(e.DiagnosticTag=b={}));var _;(function(S){function I(L){var y=L;return B.objectLiteral(y)&&B.string(y.href)}S.is=I})(_||(e.CodeDescription=_={}));var x;(function(S){function I(y,m,E,w,U,ce){var Ie={range:y,message:m};return B.defined(E)&&(Ie.severity=E),B.defined(w)&&(Ie.code=w),B.defined(U)&&(Ie.source=U),B.defined(ce)&&(Ie.relatedInformation=ce),Ie}S.create=I;function L(y){var m,E=y;return B.defined(E)&&a.is(E.range)&&B.string(E.message)&&(B.number(E.severity)||B.undefined(E.severity))&&(B.integer(E.code)||B.string(E.code)||B.undefined(E.code))&&(B.undefined(E.codeDescription)||B.string((m=E.codeDescription)===null||m===void 0?void 0:m.href))&&(B.string(E.source)||B.undefined(E.source))&&(B.undefined(E.relatedInformation)||B.typedArray(E.relatedInformation,g.is))}S.is=L})(x||(e.Diagnostic=x={}));var T;(function(S){function I(y,m){for(var E=[],w=2;w<arguments.length;w++)E[w-2]=arguments[w];var U={title:y,command:m};return B.defined(E)&&E.length>0&&(U.arguments=E),U}S.create=I;function L(y){var m=y;return B.defined(m)&&B.string(m.title)&&B.string(m.command)}S.is=L})(T||(e.Command=T={}));var R;(function(S){function I(E,w){return{range:E,newText:w}}S.replace=I;function L(E,w){return{range:{start:E,end:E},newText:w}}S.insert=L;function y(E){return{range:E,newText:""}}S.del=y;function m(E){var w=E;return B.objectLiteral(w)&&B.string(w.newText)&&a.is(w.range)}S.is=m})(R||(e.TextEdit=R={}));var V;(function(S){function I(y,m,E){var w={label:y};return m!==void 0&&(w.needsConfirmation=m),E!==void 0&&(w.description=E),w}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&B.string(m.label)&&(B.boolean(m.needsConfirmation)||m.needsConfirmation===void 0)&&(B.string(m.description)||m.description===void 0)}S.is=L})(V||(e.ChangeAnnotation=V={}));var $;(function(S){function I(L){var y=L;return B.string(y)}S.is=I})($||(e.ChangeAnnotationIdentifier=$={}));var K;(function(S){function I(E,w,U){return{range:E,newText:w,annotationId:U}}S.replace=I;function L(E,w,U){return{range:{start:E,end:E},newText:w,annotationId:U}}S.insert=L;function y(E,w){return{range:E,newText:"",annotationId:w}}S.del=y;function m(E){var w=E;return R.is(w)&&(V.is(w.annotationId)||$.is(w.annotationId))}S.is=m})(K||(e.AnnotatedTextEdit=K={}));var z;(function(S){function I(y,m){return{textDocument:y,edits:m}}S.create=I;function L(y){var m=y;return B.defined(m)&&Q.is(m.textDocument)&&Array.isArray(m.edits)}S.is=L})(z||(e.TextDocumentEdit=z={}));var W;(function(S){function I(y,m,E){var w={kind:"create",uri:y};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(w.options=m),E!==void 0&&(w.annotationId=E),w}S.create=I;function L(y){var m=y;return m&&m.kind==="create"&&B.string(m.uri)&&(m.options===void 0||(m.options.overwrite===void 0||B.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||B.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||$.is(m.annotationId))}S.is=L})(W||(e.CreateFile=W={}));var D;(function(S){function I(y,m,E,w){var U={kind:"rename",oldUri:y,newUri:m};return E!==void 0&&(E.overwrite!==void 0||E.ignoreIfExists!==void 0)&&(U.options=E),w!==void 0&&(U.annotationId=w),U}S.create=I;function L(y){var m=y;return m&&m.kind==="rename"&&B.string(m.oldUri)&&B.string(m.newUri)&&(m.options===void 0||(m.options.overwrite===void 0||B.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||B.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||$.is(m.annotationId))}S.is=L})(D||(e.RenameFile=D={}));var P;(function(S){function I(y,m,E){var w={kind:"delete",uri:y};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(w.options=m),E!==void 0&&(w.annotationId=E),w}S.create=I;function L(y){var m=y;return m&&m.kind==="delete"&&B.string(m.uri)&&(m.options===void 0||(m.options.recursive===void 0||B.boolean(m.options.recursive))&&(m.options.ignoreIfNotExists===void 0||B.boolean(m.options.ignoreIfNotExists)))&&(m.annotationId===void 0||$.is(m.annotationId))}S.is=L})(P||(e.DeleteFile=P={}));var M;(function(S){function I(L){var y=L;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(m){return B.string(m.kind)?W.is(m)||D.is(m)||P.is(m):z.is(m)}))}S.is=I})(M||(e.WorkspaceEdit=M={}));var j=function(){function S(I,L){this.edits=I,this.changeAnnotations=L}return S.prototype.insert=function(I,L,y){var m,E;if(y===void 0?m=R.insert(I,L):$.is(y)?(E=y,m=K.insert(I,L,y)):(this.assertChangeAnnotations(this.changeAnnotations),E=this.changeAnnotations.manage(y),m=K.insert(I,L,E)),this.edits.push(m),E!==void 0)return E},S.prototype.replace=function(I,L,y){var m,E;if(y===void 0?m=R.replace(I,L):$.is(y)?(E=y,m=K.replace(I,L,y)):(this.assertChangeAnnotations(this.changeAnnotations),E=this.changeAnnotations.manage(y),m=K.replace(I,L,E)),this.edits.push(m),E!==void 0)return E},S.prototype.delete=function(I,L){var y,m;if(L===void 0?y=R.del(I):$.is(L)?(m=L,y=K.del(I,L)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(L),y=K.del(I,m)),this.edits.push(y),m!==void 0)return m},S.prototype.add=function(I){this.edits.push(I)},S.prototype.all=function(){return this.edits},S.prototype.clear=function(){this.edits.splice(0,this.edits.length)},S.prototype.assertChangeAnnotations=function(I){if(I===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},S}(),J=function(){function S(I){this._annotations=I===void 0?Object.create(null):I,this._counter=0,this._size=0}return S.prototype.all=function(){return this._annotations},Object.defineProperty(S.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),S.prototype.manage=function(I,L){var y;if($.is(I)?y=I:(y=this.nextId(),L=I),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(L===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=L,this._size++,y},S.prototype.nextId=function(){return this._counter++,this._counter.toString()},S}(),te=function(){function S(I){var L=this;this._textEditChanges=Object.create(null),I!==void 0?(this._workspaceEdit=I,I.documentChanges?(this._changeAnnotations=new J(I.changeAnnotations),I.changeAnnotations=this._changeAnnotations.all(),I.documentChanges.forEach(function(y){if(z.is(y)){var m=new j(y.edits,L._changeAnnotations);L._textEditChanges[y.textDocument.uri]=m}})):I.changes&&Object.keys(I.changes).forEach(function(y){var m=new j(I.changes[y]);L._textEditChanges[y]=m})):this._workspaceEdit={}}return Object.defineProperty(S.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}),S.prototype.getTextEditChange=function(I){if(Q.is(I)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var L={uri:I.uri,version:I.version},y=this._textEditChanges[L.uri];if(!y){var m=[],E={textDocument:L,edits:m};this._workspaceEdit.documentChanges.push(E),y=new j(m,this._changeAnnotations),this._textEditChanges[L.uri]=y}return y}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var y=this._textEditChanges[I];if(!y){var m=[];this._workspaceEdit.changes[I]=m,y=new j(m),this._textEditChanges[I]=y}return y}},S.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new J,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},S.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},S.prototype.createFile=function(I,L,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;V.is(L)||$.is(L)?m=L:y=L;var E,w;if(m===void 0?E=W.create(I,y):(w=$.is(m)?m:this._changeAnnotations.manage(m),E=W.create(I,y,w)),this._workspaceEdit.documentChanges.push(E),w!==void 0)return w},S.prototype.renameFile=function(I,L,y,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E;V.is(y)||$.is(y)?E=y:m=y;var w,U;if(E===void 0?w=D.create(I,L,m):(U=$.is(E)?E:this._changeAnnotations.manage(E),w=D.create(I,L,m,U)),this._workspaceEdit.documentChanges.push(w),U!==void 0)return U},S.prototype.deleteFile=function(I,L,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;V.is(L)||$.is(L)?m=L:y=L;var E,w;if(m===void 0?E=P.create(I,y):(w=$.is(m)?m:this._changeAnnotations.manage(m),E=P.create(I,y,w)),this._workspaceEdit.documentChanges.push(E),w!==void 0)return w},S}();e.WorkspaceChange=te;var re;(function(S){function I(y){return{uri:y}}S.create=I;function L(y){var m=y;return B.defined(m)&&B.string(m.uri)}S.is=L})(re||(e.TextDocumentIdentifier=re={}));var we;(function(S){function I(y,m){return{uri:y,version:m}}S.create=I;function L(y){var m=y;return B.defined(m)&&B.string(m.uri)&&B.integer(m.version)}S.is=L})(we||(e.VersionedTextDocumentIdentifier=we={}));var Q;(function(S){function I(y,m){return{uri:y,version:m}}S.create=I;function L(y){var m=y;return B.defined(m)&&B.string(m.uri)&&(m.version===null||B.integer(m.version))}S.is=L})(Q||(e.OptionalVersionedTextDocumentIdentifier=Q={}));var F;(function(S){function I(y,m,E,w){return{uri:y,languageId:m,version:E,text:w}}S.create=I;function L(y){var m=y;return B.defined(m)&&B.string(m.uri)&&B.string(m.languageId)&&B.integer(m.version)&&B.string(m.text)}S.is=L})(F||(e.TextDocumentItem=F={}));var Oe;(function(S){S.PlainText="plaintext",S.Markdown="markdown";function I(L){var y=L;return y===S.PlainText||y===S.Markdown}S.is=I})(Oe||(e.MarkupKind=Oe={}));var ze;(function(S){function I(L){var y=L;return B.objectLiteral(L)&&Oe.is(y.kind)&&B.string(y.value)}S.is=I})(ze||(e.MarkupContent=ze={}));var pt;(function(S){S.Text=1,S.Method=2,S.Function=3,S.Constructor=4,S.Field=5,S.Variable=6,S.Class=7,S.Interface=8,S.Module=9,S.Property=10,S.Unit=11,S.Value=12,S.Enum=13,S.Keyword=14,S.Snippet=15,S.Color=16,S.File=17,S.Reference=18,S.Folder=19,S.EnumMember=20,S.Constant=21,S.Struct=22,S.Event=23,S.Operator=24,S.TypeParameter=25})(pt||(e.CompletionItemKind=pt={}));var qe;(function(S){S.PlainText=1,S.Snippet=2})(qe||(e.InsertTextFormat=qe={}));var Je;(function(S){S.Deprecated=1})(Je||(e.CompletionItemTag=Je={}));var Te;(function(S){function I(y,m,E){return{newText:y,insert:m,replace:E}}S.create=I;function L(y){var m=y;return m&&B.string(m.newText)&&a.is(m.insert)&&a.is(m.replace)}S.is=L})(Te||(e.InsertReplaceEdit=Te={}));var ie;(function(S){S.asIs=1,S.adjustIndentation=2})(ie||(e.InsertTextMode=ie={}));var he;(function(S){function I(L){var y=L;return y&&(B.string(y.detail)||y.detail===void 0)&&(B.string(y.description)||y.description===void 0)}S.is=I})(he||(e.CompletionItemLabelDetails=he={}));var Ee;(function(S){function I(L){return{label:L}}S.create=I})(Ee||(e.CompletionItem=Ee={}));var Ce;(function(S){function I(L,y){return{items:L||[],isIncomplete:!!y}}S.create=I})(Ce||(e.CompletionList=Ce={}));var We;(function(S){function I(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}S.fromPlainText=I;function L(y){var m=y;return B.string(m)||B.objectLiteral(m)&&B.string(m.language)&&B.string(m.value)}S.is=L})(We||(e.MarkedString=We={}));var me;(function(S){function I(L){var y=L;return!!y&&B.objectLiteral(y)&&(ze.is(y.contents)||We.is(y.contents)||B.typedArray(y.contents,We.is))&&(L.range===void 0||a.is(L.range))}S.is=I})(me||(e.Hover=me={}));var Nt;(function(S){function I(L,y){return y?{label:L,documentation:y}:{label:L}}S.create=I})(Nt||(e.ParameterInformation=Nt={}));var G;(function(S){function I(L,y){for(var m=[],E=2;E<arguments.length;E++)m[E-2]=arguments[E];var w={label:L};return B.defined(y)&&(w.documentation=y),B.defined(m)?w.parameters=m:w.parameters=[],w}S.create=I})(G||(e.SignatureInformation=G={}));var ve;(function(S){S.Text=1,S.Read=2,S.Write=3})(ve||(e.DocumentHighlightKind=ve={}));var at;(function(S){function I(L,y){var m={range:L};return B.number(y)&&(m.kind=y),m}S.create=I})(at||(e.DocumentHighlight=at={}));var Gt;(function(S){S.File=1,S.Module=2,S.Namespace=3,S.Package=4,S.Class=5,S.Method=6,S.Property=7,S.Field=8,S.Constructor=9,S.Enum=10,S.Interface=11,S.Function=12,S.Variable=13,S.Constant=14,S.String=15,S.Number=16,S.Boolean=17,S.Array=18,S.Object=19,S.Key=20,S.Null=21,S.EnumMember=22,S.Struct=23,S.Event=24,S.Operator=25,S.TypeParameter=26})(Gt||(e.SymbolKind=Gt={}));var wr;(function(S){S.Deprecated=1})(wr||(e.SymbolTag=wr={}));var Ht;(function(S){function I(L,y,m,E,w){var U={name:L,kind:y,location:{uri:E,range:m}};return w&&(U.containerName=w),U}S.create=I})(Ht||(e.SymbolInformation=Ht={}));var en;(function(S){function I(L,y,m,E){return E!==void 0?{name:L,kind:y,location:{uri:m,range:E}}:{name:L,kind:y,location:{uri:m}}}S.create=I})(en||(e.WorkspaceSymbol=en={}));var _n;(function(S){function I(y,m,E,w,U,ce){var Ie={name:y,detail:m,kind:E,range:w,selectionRange:U};return ce!==void 0&&(Ie.children=ce),Ie}S.create=I;function L(y){var m=y;return m&&B.string(m.name)&&B.number(m.kind)&&a.is(m.range)&&a.is(m.selectionRange)&&(m.detail===void 0||B.string(m.detail))&&(m.deprecated===void 0||B.boolean(m.deprecated))&&(m.children===void 0||Array.isArray(m.children))&&(m.tags===void 0||Array.isArray(m.tags))}S.is=L})(_n||(e.DocumentSymbol=_n={}));var fn;(function(S){S.Empty="",S.QuickFix="quickfix",S.Refactor="refactor",S.RefactorExtract="refactor.extract",S.RefactorInline="refactor.inline",S.RefactorRewrite="refactor.rewrite",S.Source="source",S.SourceOrganizeImports="source.organizeImports",S.SourceFixAll="source.fixAll"})(fn||(e.CodeActionKind=fn={}));var tn;(function(S){S.Invoked=1,S.Automatic=2})(tn||(e.CodeActionTriggerKind=tn={}));var bn;(function(S){function I(y,m,E){var w={diagnostics:y};return m!=null&&(w.only=m),E!=null&&(w.triggerKind=E),w}S.create=I;function L(y){var m=y;return B.defined(m)&&B.typedArray(m.diagnostics,x.is)&&(m.only===void 0||B.typedArray(m.only,B.string))&&(m.triggerKind===void 0||m.triggerKind===tn.Invoked||m.triggerKind===tn.Automatic)}S.is=L})(bn||(e.CodeActionContext=bn={}));var vo;(function(S){function I(y,m,E){var w={title:y},U=!0;return typeof m=="string"?(U=!1,w.kind=m):T.is(m)?w.command=m:w.edit=m,U&&E!==void 0&&(w.kind=E),w}S.create=I;function L(y){var m=y;return m&&B.string(m.title)&&(m.diagnostics===void 0||B.typedArray(m.diagnostics,x.is))&&(m.kind===void 0||B.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||T.is(m.command))&&(m.isPreferred===void 0||B.boolean(m.isPreferred))&&(m.edit===void 0||M.is(m.edit))}S.is=L})(vo||(e.CodeAction=vo={}));var xo;(function(S){function I(y,m){var E={range:y};return B.defined(m)&&(E.data=m),E}S.create=I;function L(y){var m=y;return B.defined(m)&&a.is(m.range)&&(B.undefined(m.command)||T.is(m.command))}S.is=L})(xo||(e.CodeLens=xo={}));var Fn;(function(S){function I(y,m){return{tabSize:y,insertSpaces:m}}S.create=I;function L(y){var m=y;return B.defined(m)&&B.uinteger(m.tabSize)&&B.boolean(m.insertSpaces)}S.is=L})(Fn||(e.FormattingOptions=Fn={}));var di;(function(S){function I(y,m,E){return{range:y,target:m,data:E}}S.create=I;function L(y){var m=y;return B.defined(m)&&a.is(m.range)&&(B.undefined(m.target)||B.string(m.target))}S.is=L})(di||(e.DocumentLink=di={}));var O;(function(S){function I(y,m){return{range:y,parent:m}}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&a.is(m.range)&&(m.parent===void 0||S.is(m.parent))}S.is=L})(O||(e.SelectionRange=O={}));var X;(function(S){S.namespace="namespace",S.type="type",S.class="class",S.enum="enum",S.interface="interface",S.struct="struct",S.typeParameter="typeParameter",S.parameter="parameter",S.variable="variable",S.property="property",S.enumMember="enumMember",S.event="event",S.function="function",S.method="method",S.macro="macro",S.keyword="keyword",S.modifier="modifier",S.comment="comment",S.string="string",S.number="number",S.regexp="regexp",S.operator="operator",S.decorator="decorator"})(X||(e.SemanticTokenTypes=X={}));var fe;(function(S){S.declaration="declaration",S.definition="definition",S.readonly="readonly",S.static="static",S.deprecated="deprecated",S.abstract="abstract",S.async="async",S.modification="modification",S.documentation="documentation",S.defaultLibrary="defaultLibrary"})(fe||(e.SemanticTokenModifiers=fe={}));var Me;(function(S){function I(L){var y=L;return B.objectLiteral(y)&&(y.resultId===void 0||typeof y.resultId=="string")&&Array.isArray(y.data)&&(y.data.length===0||typeof y.data[0]=="number")}S.is=I})(Me||(e.SemanticTokens=Me={}));var Jt;(function(S){function I(y,m){return{range:y,text:m}}S.create=I;function L(y){var m=y;return m!=null&&a.is(m.range)&&B.string(m.text)}S.is=L})(Jt||(e.InlineValueText=Jt={}));var Lt;(function(S){function I(y,m,E){return{range:y,variableName:m,caseSensitiveLookup:E}}S.create=I;function L(y){var m=y;return m!=null&&a.is(m.range)&&B.boolean(m.caseSensitiveLookup)&&(B.string(m.variableName)||m.variableName===void 0)}S.is=L})(Lt||(e.InlineValueVariableLookup=Lt={}));var $t;(function(S){function I(y,m){return{range:y,expression:m}}S.create=I;function L(y){var m=y;return m!=null&&a.is(m.range)&&(B.string(m.expression)||m.expression===void 0)}S.is=L})($t||(e.InlineValueEvaluatableExpression=$t={}));var Ct;(function(S){function I(y,m){return{frameId:y,stoppedLocation:m}}S.create=I;function L(y){var m=y;return B.defined(m)&&a.is(y.stoppedLocation)}S.is=L})(Ct||(e.InlineValueContext=Ct={}));var $r;(function(S){S.Type=1,S.Parameter=2;function I(L){return L===1||L===2}S.is=I})($r||(e.InlayHintKind=$r={}));var kt;(function(S){function I(y){return{value:y}}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&(m.tooltip===void 0||B.string(m.tooltip)||ze.is(m.tooltip))&&(m.location===void 0||c.is(m.location))&&(m.command===void 0||T.is(m.command))}S.is=L})(kt||(e.InlayHintLabelPart=kt={}));var ur;(function(S){function I(y,m,E){var w={position:y,label:m};return E!==void 0&&(w.kind=E),w}S.create=I;function L(y){var m=y;return B.objectLiteral(m)&&o.is(m.position)&&(B.string(m.label)||B.typedArray(m.label,kt.is))&&(m.kind===void 0||$r.is(m.kind))&&m.textEdits===void 0||B.typedArray(m.textEdits,R.is)&&(m.tooltip===void 0||B.string(m.tooltip)||ze.is(m.tooltip))&&(m.paddingLeft===void 0||B.boolean(m.paddingLeft))&&(m.paddingRight===void 0||B.boolean(m.paddingRight))}S.is=L})(ur||(e.InlayHint=ur={}));var zt;(function(S){function I(L){return{kind:"snippet",value:L}}S.createSnippet=I})(zt||(e.StringValue=zt={}));var lr;(function(S){function I(L,y,m,E){return{insertText:L,filterText:y,range:m,command:E}}S.create=I})(lr||(e.InlineCompletionItem=lr={}));var Mr;(function(S){function I(L){return{items:L}}S.create=I})(Mr||(e.InlineCompletionList=Mr={}));var Zs;(function(S){S.Invoked=0,S.Automatic=1})(Zs||(e.InlineCompletionTriggerKind=Zs={}));var Ig;(function(S){function I(L,y){return{range:L,text:y}}S.create=I})(Ig||(e.SelectedCompletionInfo=Ig={}));var tm;(function(S){function I(L,y){return{triggerKind:L,selectedCompletionInfo:y}}S.create=I})(tm||(e.InlineCompletionContext=tm={}));var Dg;(function(S){function I(L){var y=L;return B.objectLiteral(y)&&n.is(y.uri)&&B.string(y.name)}S.is=I})(Dg||(e.WorkspaceFolder=Dg={})),e.EOL=[`
57
+ `,`\r
58
+ `,"\r"];var Vl;(function(S){function I(E,w,U,ce){return new Lg(E,w,U,ce)}S.create=I;function L(E){var w=E;return!!(B.defined(w)&&B.string(w.uri)&&(B.undefined(w.languageId)||B.string(w.languageId))&&B.uinteger(w.lineCount)&&B.func(w.getText)&&B.func(w.positionAt)&&B.func(w.offsetAt))}S.is=L;function y(E,w){for(var U=E.getText(),ce=m(w,function(Yt,br){var sr=Yt.range.start.line-br.range.start.line;return sr===0?Yt.range.start.character-br.range.start.character:sr}),Ie=U.length,ut=ce.length-1;ut>=0;ut--){var mt=ce[ut],Qt=E.offsetAt(mt.range.start),Re=E.offsetAt(mt.range.end);if(Re<=Ie)U=U.substring(0,Qt)+mt.newText+U.substring(Re,U.length);else throw new Error("Overlapping edit");Ie=Qt}return U}S.applyEdits=y;function m(E,w){if(E.length<=1)return E;var U=E.length/2|0,ce=E.slice(0,U),Ie=E.slice(U);m(ce,w),m(Ie,w);for(var ut=0,mt=0,Qt=0;ut<ce.length&&mt<Ie.length;){var Re=w(ce[ut],Ie[mt]);Re<=0?E[Qt++]=ce[ut++]:E[Qt++]=Ie[mt++]}for(;ut<ce.length;)E[Qt++]=ce[ut++];for(;mt<Ie.length;)E[Qt++]=Ie[mt++];return E}})(Vl||(e.TextDocument=Vl={}));var Lg=function(){function S(I,L,y,m){this._uri=I,this._languageId=L,this._version=y,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(S.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),S.prototype.getText=function(I){if(I){var L=this.offsetAt(I.start),y=this.offsetAt(I.end);return this._content.substring(L,y)}return this._content},S.prototype.update=function(I,L){this._content=I.text,this._version=L,this._lineOffsets=void 0},S.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var I=[],L=this._content,y=!0,m=0;m<L.length;m++){y&&(I.push(m),y=!1);var E=L.charAt(m);y=E==="\r"||E===`
59
+ `,E==="\r"&&m+1<L.length&&L.charAt(m+1)===`
60
+ `&&m++}y&&L.length>0&&I.push(L.length),this._lineOffsets=I}return this._lineOffsets},S.prototype.positionAt=function(I){I=Math.max(Math.min(I,this._content.length),0);var L=this.getLineOffsets(),y=0,m=L.length;if(m===0)return o.create(0,I);for(;y<m;){var E=Math.floor((y+m)/2);L[E]>I?m=E:y=E+1}var w=y-1;return o.create(w,I-L[w])},S.prototype.offsetAt=function(I){var L=this.getLineOffsets();if(I.line>=L.length)return this._content.length;if(I.line<0)return 0;var y=L[I.line],m=I.line+1<L.length?L[I.line+1]:this._content.length;return Math.max(Math.min(y+I.character,m),y)},Object.defineProperty(S.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),S}(),B;(function(S){var I=Object.prototype.toString;function L(Re){return typeof Re!="undefined"}S.defined=L;function y(Re){return typeof Re=="undefined"}S.undefined=y;function m(Re){return Re===!0||Re===!1}S.boolean=m;function E(Re){return I.call(Re)==="[object String]"}S.string=E;function w(Re){return I.call(Re)==="[object Number]"}S.number=w;function U(Re,Yt,br){return I.call(Re)==="[object Number]"&&Yt<=Re&&Re<=br}S.numberRange=U;function ce(Re){return I.call(Re)==="[object Number]"&&-2147483648<=Re&&Re<=2147483647}S.integer=ce;function Ie(Re){return I.call(Re)==="[object Number]"&&0<=Re&&Re<=2147483647}S.uinteger=Ie;function ut(Re){return I.call(Re)==="[object Function]"}S.func=ut;function mt(Re){return Re!==null&&typeof Re=="object"}S.objectLiteral=mt;function Qt(Re,Yt){return Array.isArray(Re)&&Re.every(Yt)}S.typedArray=Qt})(B||(B={}))})});var Ir=q(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.ProtocolNotificationType=Mi.ProtocolNotificationType0=Mi.ProtocolRequestType=Mi.ProtocolRequestType0=Mi.RegistrationType=Mi.MessageDirection=void 0;var Gd=Yu(),vR;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(vR||(Mi.MessageDirection=vR={}));var G5=class{constructor(e){this.method=e}};Mi.RegistrationType=G5;var J5=class extends Gd.RequestType0{constructor(e){super(e)}};Mi.ProtocolRequestType0=J5;var Q5=class extends Gd.RequestType{constructor(e){super(e,Gd.ParameterStructures.byName)}};Mi.ProtocolRequestType=Q5;var Y5=class extends Gd.NotificationType0{constructor(e){super(e)}};Mi.ProtocolNotificationType0=Y5;var Z5=class extends Gd.NotificationType{constructor(e){super(e,Gd.ParameterStructures.byName)}};Mi.ProtocolNotificationType=Z5});var w3=q(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.objectLiteral=yn.typedArray=yn.stringArray=yn.array=yn.func=yn.error=yn.number=yn.string=yn.boolean=void 0;function Kte(t){return t===!0||t===!1}yn.boolean=Kte;function xR(t){return typeof t=="string"||t instanceof String}yn.string=xR;function Gte(t){return typeof t=="number"||t instanceof Number}yn.number=Gte;function Jte(t){return t instanceof Error}yn.error=Jte;function Qte(t){return typeof t=="function"}yn.func=Qte;function _R(t){return Array.isArray(t)}yn.array=_R;function Yte(t){return _R(t)&&t.every(e=>xR(e))}yn.stringArray=Yte;function Zte(t,e){return Array.isArray(t)&&t.every(e)}yn.typedArray=Zte;function Xte(t){return t!==null&&typeof t=="object"}yn.objectLiteral=Xte});var ER=q(A3=>{"use strict";Object.defineProperty(A3,"__esModule",{value:!0});A3.ImplementationRequest=void 0;var bR=Ir(),SR;(function(t){t.method="textDocument/implementation",t.messageDirection=bR.MessageDirection.clientToServer,t.type=new bR.ProtocolRequestType(t.method)})(SR||(A3.ImplementationRequest=SR={}))});var kR=q(R3=>{"use strict";Object.defineProperty(R3,"__esModule",{value:!0});R3.TypeDefinitionRequest=void 0;var TR=Ir(),CR;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=TR.MessageDirection.clientToServer,t.type=new TR.ProtocolRequestType(t.method)})(CR||(R3.TypeDefinitionRequest=CR={}))});var RR=q(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.DidChangeWorkspaceFoldersNotification=Jd.WorkspaceFoldersRequest=void 0;var P3=Ir(),wR;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=P3.MessageDirection.serverToClient,t.type=new P3.ProtocolRequestType0(t.method)})(wR||(Jd.WorkspaceFoldersRequest=wR={}));var AR;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=P3.MessageDirection.clientToServer,t.type=new P3.ProtocolNotificationType(t.method)})(AR||(Jd.DidChangeWorkspaceFoldersNotification=AR={}))});var OR=q(N3=>{"use strict";Object.defineProperty(N3,"__esModule",{value:!0});N3.ConfigurationRequest=void 0;var PR=Ir(),NR;(function(t){t.method="workspace/configuration",t.messageDirection=PR.MessageDirection.serverToClient,t.type=new PR.ProtocolRequestType(t.method)})(NR||(N3.ConfigurationRequest=NR={}))});var LR=q(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.ColorPresentationRequest=Qd.DocumentColorRequest=void 0;var O3=Ir(),IR;(function(t){t.method="textDocument/documentColor",t.messageDirection=O3.MessageDirection.clientToServer,t.type=new O3.ProtocolRequestType(t.method)})(IR||(Qd.DocumentColorRequest=IR={}));var DR;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=O3.MessageDirection.clientToServer,t.type=new O3.ProtocolRequestType(t.method)})(DR||(Qd.ColorPresentationRequest=DR={}))});var FR=q(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.FoldingRangeRefreshRequest=Yd.FoldingRangeRequest=void 0;var I3=Ir(),$R;(function(t){t.method="textDocument/foldingRange",t.messageDirection=I3.MessageDirection.clientToServer,t.type=new I3.ProtocolRequestType(t.method)})($R||(Yd.FoldingRangeRequest=$R={}));var MR;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=I3.MessageDirection.serverToClient,t.type=new I3.ProtocolRequestType0(t.method)})(MR||(Yd.FoldingRangeRefreshRequest=MR={}))});var UR=q(D3=>{"use strict";Object.defineProperty(D3,"__esModule",{value:!0});D3.DeclarationRequest=void 0;var VR=Ir(),jR;(function(t){t.method="textDocument/declaration",t.messageDirection=VR.MessageDirection.clientToServer,t.type=new VR.ProtocolRequestType(t.method)})(jR||(D3.DeclarationRequest=jR={}))});var HR=q(L3=>{"use strict";Object.defineProperty(L3,"__esModule",{value:!0});L3.SelectionRangeRequest=void 0;var qR=Ir(),BR;(function(t){t.method="textDocument/selectionRange",t.messageDirection=qR.MessageDirection.clientToServer,t.type=new qR.ProtocolRequestType(t.method)})(BR||(L3.SelectionRangeRequest=BR={}))});var GR=q(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.WorkDoneProgressCancelNotification=Cc.WorkDoneProgressCreateRequest=Cc.WorkDoneProgress=void 0;var ere=Yu(),$3=Ir(),zR;(function(t){t.type=new ere.ProgressType;function e(r){return r===t.type}t.is=e})(zR||(Cc.WorkDoneProgress=zR={}));var WR;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=$3.MessageDirection.serverToClient,t.type=new $3.ProtocolRequestType(t.method)})(WR||(Cc.WorkDoneProgressCreateRequest=WR={}));var KR;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=$3.MessageDirection.clientToServer,t.type=new $3.ProtocolNotificationType(t.method)})(KR||(Cc.WorkDoneProgressCancelNotification=KR={}))});var ZR=q(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.CallHierarchyOutgoingCallsRequest=kc.CallHierarchyIncomingCallsRequest=kc.CallHierarchyPrepareRequest=void 0;var Zd=Ir(),JR;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Zd.MessageDirection.clientToServer,t.type=new Zd.ProtocolRequestType(t.method)})(JR||(kc.CallHierarchyPrepareRequest=JR={}));var QR;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Zd.MessageDirection.clientToServer,t.type=new Zd.ProtocolRequestType(t.method)})(QR||(kc.CallHierarchyIncomingCallsRequest=QR={}));var YR;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Zd.MessageDirection.clientToServer,t.type=new Zd.ProtocolRequestType(t.method)})(YR||(kc.CallHierarchyOutgoingCallsRequest=YR={}))});var iP=q(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.SemanticTokensRefreshRequest=Fi.SemanticTokensRangeRequest=Fi.SemanticTokensDeltaRequest=Fi.SemanticTokensRequest=Fi.SemanticTokensRegistrationType=Fi.TokenFormat=void 0;var wa=Ir(),XR;(function(t){t.Relative="relative"})(XR||(Fi.TokenFormat=XR={}));var x1;(function(t){t.method="textDocument/semanticTokens",t.type=new wa.RegistrationType(t.method)})(x1||(Fi.SemanticTokensRegistrationType=x1={}));var eP;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=wa.MessageDirection.clientToServer,t.type=new wa.ProtocolRequestType(t.method),t.registrationMethod=x1.method})(eP||(Fi.SemanticTokensRequest=eP={}));var tP;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=wa.MessageDirection.clientToServer,t.type=new wa.ProtocolRequestType(t.method),t.registrationMethod=x1.method})(tP||(Fi.SemanticTokensDeltaRequest=tP={}));var rP;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=wa.MessageDirection.clientToServer,t.type=new wa.ProtocolRequestType(t.method),t.registrationMethod=x1.method})(rP||(Fi.SemanticTokensRangeRequest=rP={}));var nP;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=wa.MessageDirection.serverToClient,t.type=new wa.ProtocolRequestType0(t.method)})(nP||(Fi.SemanticTokensRefreshRequest=nP={}))});var aP=q(M3=>{"use strict";Object.defineProperty(M3,"__esModule",{value:!0});M3.ShowDocumentRequest=void 0;var sP=Ir(),oP;(function(t){t.method="window/showDocument",t.messageDirection=sP.MessageDirection.serverToClient,t.type=new sP.ProtocolRequestType(t.method)})(oP||(M3.ShowDocumentRequest=oP={}))});var lP=q(F3=>{"use strict";Object.defineProperty(F3,"__esModule",{value:!0});F3.LinkedEditingRangeRequest=void 0;var cP=Ir(),uP;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=cP.MessageDirection.clientToServer,t.type=new cP.ProtocolRequestType(t.method)})(uP||(F3.LinkedEditingRangeRequest=uP={}))});var vP=q(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.WillDeleteFilesRequest=ii.DidDeleteFilesNotification=ii.DidRenameFilesNotification=ii.WillRenameFilesRequest=ii.DidCreateFilesNotification=ii.WillCreateFilesRequest=ii.FileOperationPatternKind=void 0;var Os=Ir(),fP;(function(t){t.file="file",t.folder="folder"})(fP||(ii.FileOperationPatternKind=fP={}));var dP;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Os.MessageDirection.clientToServer,t.type=new Os.ProtocolRequestType(t.method)})(dP||(ii.WillCreateFilesRequest=dP={}));var pP;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Os.MessageDirection.clientToServer,t.type=new Os.ProtocolNotificationType(t.method)})(pP||(ii.DidCreateFilesNotification=pP={}));var mP;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Os.MessageDirection.clientToServer,t.type=new Os.ProtocolRequestType(t.method)})(mP||(ii.WillRenameFilesRequest=mP={}));var hP;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Os.MessageDirection.clientToServer,t.type=new Os.ProtocolNotificationType(t.method)})(hP||(ii.DidRenameFilesNotification=hP={}));var gP;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Os.MessageDirection.clientToServer,t.type=new Os.ProtocolNotificationType(t.method)})(gP||(ii.DidDeleteFilesNotification=gP={}));var yP;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Os.MessageDirection.clientToServer,t.type=new Os.ProtocolRequestType(t.method)})(yP||(ii.WillDeleteFilesRequest=yP={}))});var EP=q(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.MonikerRequest=wc.MonikerKind=wc.UniquenessLevel=void 0;var xP=Ir(),_P;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(_P||(wc.UniquenessLevel=_P={}));var bP;(function(t){t.$import="import",t.$export="export",t.local="local"})(bP||(wc.MonikerKind=bP={}));var SP;(function(t){t.method="textDocument/moniker",t.messageDirection=xP.MessageDirection.clientToServer,t.type=new xP.ProtocolRequestType(t.method)})(SP||(wc.MonikerRequest=SP={}))});var wP=q(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.TypeHierarchySubtypesRequest=Ac.TypeHierarchySupertypesRequest=Ac.TypeHierarchyPrepareRequest=void 0;var Xd=Ir(),TP;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Xd.MessageDirection.clientToServer,t.type=new Xd.ProtocolRequestType(t.method)})(TP||(Ac.TypeHierarchyPrepareRequest=TP={}));var CP;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Xd.MessageDirection.clientToServer,t.type=new Xd.ProtocolRequestType(t.method)})(CP||(Ac.TypeHierarchySupertypesRequest=CP={}));var kP;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Xd.MessageDirection.clientToServer,t.type=new Xd.ProtocolRequestType(t.method)})(kP||(Ac.TypeHierarchySubtypesRequest=kP={}))});var PP=q(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.InlineValueRefreshRequest=ep.InlineValueRequest=void 0;var V3=Ir(),AP;(function(t){t.method="textDocument/inlineValue",t.messageDirection=V3.MessageDirection.clientToServer,t.type=new V3.ProtocolRequestType(t.method)})(AP||(ep.InlineValueRequest=AP={}));var RP;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=V3.MessageDirection.serverToClient,t.type=new V3.ProtocolRequestType0(t.method)})(RP||(ep.InlineValueRefreshRequest=RP={}))});var DP=q(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.InlayHintRefreshRequest=Rc.InlayHintResolveRequest=Rc.InlayHintRequest=void 0;var tp=Ir(),NP;(function(t){t.method="textDocument/inlayHint",t.messageDirection=tp.MessageDirection.clientToServer,t.type=new tp.ProtocolRequestType(t.method)})(NP||(Rc.InlayHintRequest=NP={}));var OP;(function(t){t.method="inlayHint/resolve",t.messageDirection=tp.MessageDirection.clientToServer,t.type=new tp.ProtocolRequestType(t.method)})(OP||(Rc.InlayHintResolveRequest=OP={}));var IP;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=tp.MessageDirection.serverToClient,t.type=new tp.ProtocolRequestType0(t.method)})(IP||(Rc.InlayHintRefreshRequest=IP={}))});var UP=q(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.DiagnosticRefreshRequest=Is.WorkspaceDiagnosticRequest=Is.DocumentDiagnosticRequest=Is.DocumentDiagnosticReportKind=Is.DiagnosticServerCancellationData=void 0;var jP=Yu(),tre=w3(),rp=Ir(),LP;(function(t){function e(r){let n=r;return n&&tre.boolean(n.retriggerRequest)}t.is=e})(LP||(Is.DiagnosticServerCancellationData=LP={}));var $P;(function(t){t.Full="full",t.Unchanged="unchanged"})($P||(Is.DocumentDiagnosticReportKind=$P={}));var MP;(function(t){t.method="textDocument/diagnostic",t.messageDirection=rp.MessageDirection.clientToServer,t.type=new rp.ProtocolRequestType(t.method),t.partialResult=new jP.ProgressType})(MP||(Is.DocumentDiagnosticRequest=MP={}));var FP;(function(t){t.method="workspace/diagnostic",t.messageDirection=rp.MessageDirection.clientToServer,t.type=new rp.ProtocolRequestType(t.method),t.partialResult=new jP.ProgressType})(FP||(Is.WorkspaceDiagnosticRequest=FP={}));var VP;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=rp.MessageDirection.serverToClient,t.type=new rp.ProtocolRequestType0(t.method)})(VP||(Is.DiagnosticRefreshRequest=VP={}))});var GP=q(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.DidCloseNotebookDocumentNotification=Wr.DidSaveNotebookDocumentNotification=Wr.DidChangeNotebookDocumentNotification=Wr.NotebookCellArrayChange=Wr.DidOpenNotebookDocumentNotification=Wr.NotebookDocumentSyncRegistrationType=Wr.NotebookDocument=Wr.NotebookCell=Wr.ExecutionSummary=Wr.NotebookCellKind=void 0;var _1=k3(),oo=w3(),Uo=Ir(),X5;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(X5||(Wr.NotebookCellKind=X5={}));var e7;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function r(i){let s=i;return oo.objectLiteral(s)&&_1.uinteger.is(s.executionOrder)&&(s.success===void 0||oo.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(e7||(Wr.ExecutionSummary=e7={}));var j3;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function r(s){let o=s;return oo.objectLiteral(o)&&X5.is(o.kind)&&_1.DocumentUri.is(o.document)&&(o.metadata===void 0||oo.objectLiteral(o.metadata))}t.is=r;function n(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!e7.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(s.length!==o.length)return!1;for(let u=0;u<s.length;u++)if(!i(s[u],o[u]))return!1}if(oo.objectLiteral(s)&&oo.objectLiteral(o)){let u=Object.keys(s),f=Object.keys(o);if(u.length!==f.length||(u.sort(),f.sort(),!i(u,f)))return!1;for(let l=0;l<u.length;l++){let p=u[l];if(!i(s[p],o[p]))return!1}}return!0}})(j3||(Wr.NotebookCell=j3={}));var qP;(function(t){function e(n,i,s,o){return{uri:n,notebookType:i,version:s,cells:o}}t.create=e;function r(n){let i=n;return oo.objectLiteral(i)&&oo.string(i.uri)&&_1.integer.is(i.version)&&oo.typedArray(i.cells,j3.is)}t.is=r})(qP||(Wr.NotebookDocument=qP={}));var np;(function(t){t.method="notebookDocument/sync",t.messageDirection=Uo.MessageDirection.clientToServer,t.type=new Uo.RegistrationType(t.method)})(np||(Wr.NotebookDocumentSyncRegistrationType=np={}));var BP;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Uo.MessageDirection.clientToServer,t.type=new Uo.ProtocolNotificationType(t.method),t.registrationMethod=np.method})(BP||(Wr.DidOpenNotebookDocumentNotification=BP={}));var HP;(function(t){function e(n){let i=n;return oo.objectLiteral(i)&&_1.uinteger.is(i.start)&&_1.uinteger.is(i.deleteCount)&&(i.cells===void 0||oo.typedArray(i.cells,j3.is))}t.is=e;function r(n,i,s){let o={start:n,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=r})(HP||(Wr.NotebookCellArrayChange=HP={}));var zP;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Uo.MessageDirection.clientToServer,t.type=new Uo.ProtocolNotificationType(t.method),t.registrationMethod=np.method})(zP||(Wr.DidChangeNotebookDocumentNotification=zP={}));var WP;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Uo.MessageDirection.clientToServer,t.type=new Uo.ProtocolNotificationType(t.method),t.registrationMethod=np.method})(WP||(Wr.DidSaveNotebookDocumentNotification=WP={}));var KP;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Uo.MessageDirection.clientToServer,t.type=new Uo.ProtocolNotificationType(t.method),t.registrationMethod=np.method})(KP||(Wr.DidCloseNotebookDocumentNotification=KP={}))});var YP=q(U3=>{"use strict";Object.defineProperty(U3,"__esModule",{value:!0});U3.InlineCompletionRequest=void 0;var JP=Ir(),QP;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=JP.MessageDirection.clientToServer,t.type=new JP.ProtocolRequestType(t.method)})(QP||(U3.InlineCompletionRequest=QP={}))});var lO=q(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.WorkspaceSymbolRequest=A.CodeActionResolveRequest=A.CodeActionRequest=A.DocumentSymbolRequest=A.DocumentHighlightRequest=A.ReferencesRequest=A.DefinitionRequest=A.SignatureHelpRequest=A.SignatureHelpTriggerKind=A.HoverRequest=A.CompletionResolveRequest=A.CompletionRequest=A.CompletionTriggerKind=A.PublishDiagnosticsNotification=A.WatchKind=A.RelativePattern=A.FileChangeType=A.DidChangeWatchedFilesNotification=A.WillSaveTextDocumentWaitUntilRequest=A.WillSaveTextDocumentNotification=A.TextDocumentSaveReason=A.DidSaveTextDocumentNotification=A.DidCloseTextDocumentNotification=A.DidChangeTextDocumentNotification=A.TextDocumentContentChangeEvent=A.DidOpenTextDocumentNotification=A.TextDocumentSyncKind=A.TelemetryEventNotification=A.LogMessageNotification=A.ShowMessageRequest=A.ShowMessageNotification=A.MessageType=A.DidChangeConfigurationNotification=A.ExitNotification=A.ShutdownRequest=A.InitializedNotification=A.InitializeErrorCodes=A.InitializeRequest=A.WorkDoneProgressOptions=A.TextDocumentRegistrationOptions=A.StaticRegistrationOptions=A.PositionEncodingKind=A.FailureHandlingKind=A.ResourceOperationKind=A.UnregistrationRequest=A.RegistrationRequest=A.DocumentSelector=A.NotebookCellTextDocumentFilter=A.NotebookDocumentFilter=A.TextDocumentFilter=void 0;A.MonikerRequest=A.MonikerKind=A.UniquenessLevel=A.WillDeleteFilesRequest=A.DidDeleteFilesNotification=A.WillRenameFilesRequest=A.DidRenameFilesNotification=A.WillCreateFilesRequest=A.DidCreateFilesNotification=A.FileOperationPatternKind=A.LinkedEditingRangeRequest=A.ShowDocumentRequest=A.SemanticTokensRegistrationType=A.SemanticTokensRefreshRequest=A.SemanticTokensRangeRequest=A.SemanticTokensDeltaRequest=A.SemanticTokensRequest=A.TokenFormat=A.CallHierarchyPrepareRequest=A.CallHierarchyOutgoingCallsRequest=A.CallHierarchyIncomingCallsRequest=A.WorkDoneProgressCancelNotification=A.WorkDoneProgressCreateRequest=A.WorkDoneProgress=A.SelectionRangeRequest=A.DeclarationRequest=A.FoldingRangeRefreshRequest=A.FoldingRangeRequest=A.ColorPresentationRequest=A.DocumentColorRequest=A.ConfigurationRequest=A.DidChangeWorkspaceFoldersNotification=A.WorkspaceFoldersRequest=A.TypeDefinitionRequest=A.ImplementationRequest=A.ApplyWorkspaceEditRequest=A.ExecuteCommandRequest=A.PrepareRenameRequest=A.RenameRequest=A.PrepareSupportDefaultBehavior=A.DocumentOnTypeFormattingRequest=A.DocumentRangesFormattingRequest=A.DocumentRangeFormattingRequest=A.DocumentFormattingRequest=A.DocumentLinkResolveRequest=A.DocumentLinkRequest=A.CodeLensRefreshRequest=A.CodeLensResolveRequest=A.CodeLensRequest=A.WorkspaceSymbolResolveRequest=void 0;A.InlineCompletionRequest=A.DidCloseNotebookDocumentNotification=A.DidSaveNotebookDocumentNotification=A.DidChangeNotebookDocumentNotification=A.NotebookCellArrayChange=A.DidOpenNotebookDocumentNotification=A.NotebookDocumentSyncRegistrationType=A.NotebookDocument=A.NotebookCell=A.ExecutionSummary=A.NotebookCellKind=A.DiagnosticRefreshRequest=A.WorkspaceDiagnosticRequest=A.DocumentDiagnosticRequest=A.DocumentDiagnosticReportKind=A.DiagnosticServerCancellationData=A.InlayHintRefreshRequest=A.InlayHintResolveRequest=A.InlayHintRequest=A.InlineValueRefreshRequest=A.InlineValueRequest=A.TypeHierarchySupertypesRequest=A.TypeHierarchySubtypesRequest=A.TypeHierarchyPrepareRequest=void 0;var le=Ir(),ZP=k3(),In=w3(),rre=ER();Object.defineProperty(A,"ImplementationRequest",{enumerable:!0,get:function(){return rre.ImplementationRequest}});var nre=kR();Object.defineProperty(A,"TypeDefinitionRequest",{enumerable:!0,get:function(){return nre.TypeDefinitionRequest}});var oO=RR();Object.defineProperty(A,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return oO.WorkspaceFoldersRequest}});Object.defineProperty(A,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return oO.DidChangeWorkspaceFoldersNotification}});var ire=OR();Object.defineProperty(A,"ConfigurationRequest",{enumerable:!0,get:function(){return ire.ConfigurationRequest}});var aO=LR();Object.defineProperty(A,"DocumentColorRequest",{enumerable:!0,get:function(){return aO.DocumentColorRequest}});Object.defineProperty(A,"ColorPresentationRequest",{enumerable:!0,get:function(){return aO.ColorPresentationRequest}});var cO=FR();Object.defineProperty(A,"FoldingRangeRequest",{enumerable:!0,get:function(){return cO.FoldingRangeRequest}});Object.defineProperty(A,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return cO.FoldingRangeRefreshRequest}});var sre=UR();Object.defineProperty(A,"DeclarationRequest",{enumerable:!0,get:function(){return sre.DeclarationRequest}});var ore=HR();Object.defineProperty(A,"SelectionRangeRequest",{enumerable:!0,get:function(){return ore.SelectionRangeRequest}});var s7=GR();Object.defineProperty(A,"WorkDoneProgress",{enumerable:!0,get:function(){return s7.WorkDoneProgress}});Object.defineProperty(A,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return s7.WorkDoneProgressCreateRequest}});Object.defineProperty(A,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return s7.WorkDoneProgressCancelNotification}});var o7=ZR();Object.defineProperty(A,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return o7.CallHierarchyIncomingCallsRequest}});Object.defineProperty(A,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return o7.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(A,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return o7.CallHierarchyPrepareRequest}});var ip=iP();Object.defineProperty(A,"TokenFormat",{enumerable:!0,get:function(){return ip.TokenFormat}});Object.defineProperty(A,"SemanticTokensRequest",{enumerable:!0,get:function(){return ip.SemanticTokensRequest}});Object.defineProperty(A,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ip.SemanticTokensDeltaRequest}});Object.defineProperty(A,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ip.SemanticTokensRangeRequest}});Object.defineProperty(A,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ip.SemanticTokensRefreshRequest}});Object.defineProperty(A,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ip.SemanticTokensRegistrationType}});var are=aP();Object.defineProperty(A,"ShowDocumentRequest",{enumerable:!0,get:function(){return are.ShowDocumentRequest}});var cre=lP();Object.defineProperty(A,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return cre.LinkedEditingRangeRequest}});var Zu=vP();Object.defineProperty(A,"FileOperationPatternKind",{enumerable:!0,get:function(){return Zu.FileOperationPatternKind}});Object.defineProperty(A,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Zu.DidCreateFilesNotification}});Object.defineProperty(A,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Zu.WillCreateFilesRequest}});Object.defineProperty(A,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Zu.DidRenameFilesNotification}});Object.defineProperty(A,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Zu.WillRenameFilesRequest}});Object.defineProperty(A,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Zu.DidDeleteFilesNotification}});Object.defineProperty(A,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Zu.WillDeleteFilesRequest}});var a7=EP();Object.defineProperty(A,"UniquenessLevel",{enumerable:!0,get:function(){return a7.UniquenessLevel}});Object.defineProperty(A,"MonikerKind",{enumerable:!0,get:function(){return a7.MonikerKind}});Object.defineProperty(A,"MonikerRequest",{enumerable:!0,get:function(){return a7.MonikerRequest}});var c7=wP();Object.defineProperty(A,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return c7.TypeHierarchyPrepareRequest}});Object.defineProperty(A,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return c7.TypeHierarchySubtypesRequest}});Object.defineProperty(A,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return c7.TypeHierarchySupertypesRequest}});var uO=PP();Object.defineProperty(A,"InlineValueRequest",{enumerable:!0,get:function(){return uO.InlineValueRequest}});Object.defineProperty(A,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return uO.InlineValueRefreshRequest}});var u7=DP();Object.defineProperty(A,"InlayHintRequest",{enumerable:!0,get:function(){return u7.InlayHintRequest}});Object.defineProperty(A,"InlayHintResolveRequest",{enumerable:!0,get:function(){return u7.InlayHintResolveRequest}});Object.defineProperty(A,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return u7.InlayHintRefreshRequest}});var b1=UP();Object.defineProperty(A,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return b1.DiagnosticServerCancellationData}});Object.defineProperty(A,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return b1.DocumentDiagnosticReportKind}});Object.defineProperty(A,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return b1.DocumentDiagnosticRequest}});Object.defineProperty(A,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return b1.WorkspaceDiagnosticRequest}});Object.defineProperty(A,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return b1.DiagnosticRefreshRequest}});var qo=GP();Object.defineProperty(A,"NotebookCellKind",{enumerable:!0,get:function(){return qo.NotebookCellKind}});Object.defineProperty(A,"ExecutionSummary",{enumerable:!0,get:function(){return qo.ExecutionSummary}});Object.defineProperty(A,"NotebookCell",{enumerable:!0,get:function(){return qo.NotebookCell}});Object.defineProperty(A,"NotebookDocument",{enumerable:!0,get:function(){return qo.NotebookDocument}});Object.defineProperty(A,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return qo.NotebookDocumentSyncRegistrationType}});Object.defineProperty(A,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return qo.DidOpenNotebookDocumentNotification}});Object.defineProperty(A,"NotebookCellArrayChange",{enumerable:!0,get:function(){return qo.NotebookCellArrayChange}});Object.defineProperty(A,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return qo.DidChangeNotebookDocumentNotification}});Object.defineProperty(A,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return qo.DidSaveNotebookDocumentNotification}});Object.defineProperty(A,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return qo.DidCloseNotebookDocumentNotification}});var ure=YP();Object.defineProperty(A,"InlineCompletionRequest",{enumerable:!0,get:function(){return ure.InlineCompletionRequest}});var t7;(function(t){function e(r){let n=r;return In.string(n)||In.string(n.language)||In.string(n.scheme)||In.string(n.pattern)}t.is=e})(t7||(A.TextDocumentFilter=t7={}));var r7;(function(t){function e(r){let n=r;return In.objectLiteral(n)&&(In.string(n.notebookType)||In.string(n.scheme)||In.string(n.pattern))}t.is=e})(r7||(A.NotebookDocumentFilter=r7={}));var n7;(function(t){function e(r){let n=r;return In.objectLiteral(n)&&(In.string(n.notebook)||r7.is(n.notebook))&&(n.language===void 0||In.string(n.language))}t.is=e})(n7||(A.NotebookCellTextDocumentFilter=n7={}));var i7;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!In.string(n)&&!t7.is(n)&&!n7.is(n))return!1;return!0}t.is=e})(i7||(A.DocumentSelector=i7={}));var XP;(function(t){t.method="client/registerCapability",t.messageDirection=le.MessageDirection.serverToClient,t.type=new le.ProtocolRequestType(t.method)})(XP||(A.RegistrationRequest=XP={}));var eN;(function(t){t.method="client/unregisterCapability",t.messageDirection=le.MessageDirection.serverToClient,t.type=new le.ProtocolRequestType(t.method)})(eN||(A.UnregistrationRequest=eN={}));var tN;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(tN||(A.ResourceOperationKind=tN={}));var rN;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(rN||(A.FailureHandlingKind=rN={}));var nN;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(nN||(A.PositionEncodingKind=nN={}));var iN;(function(t){function e(r){let n=r;return n&&In.string(n.id)&&n.id.length>0}t.hasId=e})(iN||(A.StaticRegistrationOptions=iN={}));var sN;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||i7.is(n.documentSelector))}t.is=e})(sN||(A.TextDocumentRegistrationOptions=sN={}));var oN;(function(t){function e(n){let i=n;return In.objectLiteral(i)&&(i.workDoneProgress===void 0||In.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&In.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(oN||(A.WorkDoneProgressOptions=oN={}));var aN;(function(t){t.method="initialize",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(aN||(A.InitializeRequest=aN={}));var cN;(function(t){t.unknownProtocolVersion=1})(cN||(A.InitializeErrorCodes=cN={}));var uN;(function(t){t.method="initialized",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolNotificationType(t.method)})(uN||(A.InitializedNotification=uN={}));var lN;(function(t){t.method="shutdown",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType0(t.method)})(lN||(A.ShutdownRequest=lN={}));var fN;(function(t){t.method="exit",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolNotificationType0(t.method)})(fN||(A.ExitNotification=fN={}));var dN;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolNotificationType(t.method)})(dN||(A.DidChangeConfigurationNotification=dN={}));var pN;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(pN||(A.MessageType=pN={}));var mN;(function(t){t.method="window/showMessage",t.messageDirection=le.MessageDirection.serverToClient,t.type=new le.ProtocolNotificationType(t.method)})(mN||(A.ShowMessageNotification=mN={}));var hN;(function(t){t.method="window/showMessageRequest",t.messageDirection=le.MessageDirection.serverToClient,t.type=new le.ProtocolRequestType(t.method)})(hN||(A.ShowMessageRequest=hN={}));var gN;(function(t){t.method="window/logMessage",t.messageDirection=le.MessageDirection.serverToClient,t.type=new le.ProtocolNotificationType(t.method)})(gN||(A.LogMessageNotification=gN={}));var yN;(function(t){t.method="telemetry/event",t.messageDirection=le.MessageDirection.serverToClient,t.type=new le.ProtocolNotificationType(t.method)})(yN||(A.TelemetryEventNotification=yN={}));var vN;(function(t){t.None=0,t.Full=1,t.Incremental=2})(vN||(A.TextDocumentSyncKind=vN={}));var xN;(function(t){t.method="textDocument/didOpen",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolNotificationType(t.method)})(xN||(A.DidOpenTextDocumentNotification=xN={}));var _N;(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})(_N||(A.TextDocumentContentChangeEvent=_N={}));var bN;(function(t){t.method="textDocument/didChange",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolNotificationType(t.method)})(bN||(A.DidChangeTextDocumentNotification=bN={}));var SN;(function(t){t.method="textDocument/didClose",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolNotificationType(t.method)})(SN||(A.DidCloseTextDocumentNotification=SN={}));var EN;(function(t){t.method="textDocument/didSave",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolNotificationType(t.method)})(EN||(A.DidSaveTextDocumentNotification=EN={}));var TN;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(TN||(A.TextDocumentSaveReason=TN={}));var CN;(function(t){t.method="textDocument/willSave",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolNotificationType(t.method)})(CN||(A.WillSaveTextDocumentNotification=CN={}));var kN;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(kN||(A.WillSaveTextDocumentWaitUntilRequest=kN={}));var wN;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolNotificationType(t.method)})(wN||(A.DidChangeWatchedFilesNotification=wN={}));var AN;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(AN||(A.FileChangeType=AN={}));var RN;(function(t){function e(r){let n=r;return In.objectLiteral(n)&&(ZP.URI.is(n.baseUri)||ZP.WorkspaceFolder.is(n.baseUri))&&In.string(n.pattern)}t.is=e})(RN||(A.RelativePattern=RN={}));var PN;(function(t){t.Create=1,t.Change=2,t.Delete=4})(PN||(A.WatchKind=PN={}));var NN;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=le.MessageDirection.serverToClient,t.type=new le.ProtocolNotificationType(t.method)})(NN||(A.PublishDiagnosticsNotification=NN={}));var ON;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(ON||(A.CompletionTriggerKind=ON={}));var IN;(function(t){t.method="textDocument/completion",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(IN||(A.CompletionRequest=IN={}));var DN;(function(t){t.method="completionItem/resolve",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(DN||(A.CompletionResolveRequest=DN={}));var LN;(function(t){t.method="textDocument/hover",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(LN||(A.HoverRequest=LN={}));var $N;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})($N||(A.SignatureHelpTriggerKind=$N={}));var MN;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(MN||(A.SignatureHelpRequest=MN={}));var FN;(function(t){t.method="textDocument/definition",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(FN||(A.DefinitionRequest=FN={}));var VN;(function(t){t.method="textDocument/references",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(VN||(A.ReferencesRequest=VN={}));var jN;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(jN||(A.DocumentHighlightRequest=jN={}));var UN;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(UN||(A.DocumentSymbolRequest=UN={}));var qN;(function(t){t.method="textDocument/codeAction",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(qN||(A.CodeActionRequest=qN={}));var BN;(function(t){t.method="codeAction/resolve",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(BN||(A.CodeActionResolveRequest=BN={}));var HN;(function(t){t.method="workspace/symbol",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(HN||(A.WorkspaceSymbolRequest=HN={}));var zN;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(zN||(A.WorkspaceSymbolResolveRequest=zN={}));var WN;(function(t){t.method="textDocument/codeLens",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(WN||(A.CodeLensRequest=WN={}));var KN;(function(t){t.method="codeLens/resolve",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(KN||(A.CodeLensResolveRequest=KN={}));var GN;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=le.MessageDirection.serverToClient,t.type=new le.ProtocolRequestType0(t.method)})(GN||(A.CodeLensRefreshRequest=GN={}));var JN;(function(t){t.method="textDocument/documentLink",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(JN||(A.DocumentLinkRequest=JN={}));var QN;(function(t){t.method="documentLink/resolve",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(QN||(A.DocumentLinkResolveRequest=QN={}));var YN;(function(t){t.method="textDocument/formatting",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(YN||(A.DocumentFormattingRequest=YN={}));var ZN;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(ZN||(A.DocumentRangeFormattingRequest=ZN={}));var XN;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(XN||(A.DocumentRangesFormattingRequest=XN={}));var eO;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(eO||(A.DocumentOnTypeFormattingRequest=eO={}));var tO;(function(t){t.Identifier=1})(tO||(A.PrepareSupportDefaultBehavior=tO={}));var rO;(function(t){t.method="textDocument/rename",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(rO||(A.RenameRequest=rO={}));var nO;(function(t){t.method="textDocument/prepareRename",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(nO||(A.PrepareRenameRequest=nO={}));var iO;(function(t){t.method="workspace/executeCommand",t.messageDirection=le.MessageDirection.clientToServer,t.type=new le.ProtocolRequestType(t.method)})(iO||(A.ExecuteCommandRequest=iO={}));var sO;(function(t){t.method="workspace/applyEdit",t.messageDirection=le.MessageDirection.serverToClient,t.type=new le.ProtocolRequestType("workspace/applyEdit")})(sO||(A.ApplyWorkspaceEditRequest=sO={}))});var dO=q(q3=>{"use strict";Object.defineProperty(q3,"__esModule",{value:!0});q3.createProtocolConnection=void 0;var fO=Yu();function lre(t,e,r,n){return fO.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,fO.createMessageConnection)(t,e,r,n)}q3.createProtocolConnection=lre});var mO=q(Vi=>{"use strict";var fre=Vi&&Vi.__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=Vi&&Vi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fre(e,t,r)};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.LSPErrorCodes=Vi.createProtocolConnection=void 0;B3(Yu(),Vi);B3(k3(),Vi);B3(Ir(),Vi);B3(lO(),Vi);var dre=dO();Object.defineProperty(Vi,"createProtocolConnection",{enumerable:!0,get:function(){return dre.createProtocolConnection}});var pO;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(pO||(Vi.LSPErrorCodes=pO={}))});var Kr=q(Bo=>{"use strict";var pre=Bo&&Bo.__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]}),hO=Bo&&Bo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pre(e,t,r)};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.createProtocolConnection=void 0;var mre=K5();hO(K5(),Bo);hO(mO(),Bo);function hre(t,e,r,n){return(0,mre.createMessageConnection)(t,e,r,n)}Bo.createProtocolConnection=hre});var l7=q(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.generateUuid=Ds.parse=Ds.isUUID=Ds.v4=Ds.empty=void 0;var S1=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},E1=class t extends S1{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};E1._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];E1._timeHighBits=["8","9","a","b"];Ds.empty=new S1("00000000-0000-0000-0000-000000000000");function gO(){return new E1}Ds.v4=gO;var gre=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function yO(t){return gre.test(t)}Ds.isUUID=yO;function yre(t){if(!yO(t))throw new Error("invalid uuid");return new S1(t)}Ds.parse=yre;function vre(){return gO().asHex()}Ds.generateUuid=vre});var vO=q(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.attachPartialResult=Nc.ProgressFeature=Nc.attachWorkDone=void 0;var Pc=Kr(),xre=l7(),Xu=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(Pc.WorkDoneProgress.type,this._token,s)}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(Pc.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Pc.WorkDoneProgress.type,this._token,{kind:"end"})}};Xu.Instances=new Map;var H3=class extends Xu{constructor(e,r){super(e,r),this._source=new Pc.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},T1=class{constructor(){}begin(){}report(){}done(){}},z3=class extends T1{constructor(){super(),this._source=new Pc.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function _re(t,e){if(e===void 0||e.workDoneToken===void 0)return new T1;let r=e.workDoneToken;return delete e.workDoneToken,new Xu(t,r)}Nc.attachWorkDone=_re;var bre=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){var r;super.initialize(e),((r=e==null?void 0:e.window)==null?void 0:r.workDoneProgress)===!0&&(this._progressSupported=!0,this.connection.onNotification(Pc.WorkDoneProgressCancelNotification.type,n=>{let i=Xu.Instances.get(n.token);(i instanceof H3||i instanceof z3)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new T1:new Xu(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,xre.generateUuid)();return this.connection.sendRequest(Pc.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new H3(this.connection,e))}else return Promise.resolve(new z3)}};Nc.ProgressFeature=bre;var f7;(function(t){t.type=new Pc.ProgressType})(f7||(f7={}));var d7=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(f7.type,this._token,e)}};function Sre(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new d7(t,r)}Nc.attachPartialResult=Sre});var xO=q(W3=>{"use strict";Object.defineProperty(W3,"__esModule",{value:!0});W3.ConfigurationFeature=void 0;var Ere=Kr(),Tre=a3(),Cre=t=>class extends t{getConfiguration(e){return e?Tre.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(Ere.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};W3.ConfigurationFeature=Cre});var _O=q(G3=>{"use strict";Object.defineProperty(G3,"__esModule",{value:!0});G3.WorkspaceFoldersFeature=void 0;var K3=Kr(),kre=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new K3.Emitter,this.connection.onNotification(K3.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){var n,i;super.fillServerCapabilities(e);let r=(i=(n=e.workspace)==null?void 0:n.workspaceFolders)==null?void 0:i.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(K3.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(K3.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};G3.WorkspaceFoldersFeature=kre});var bO=q(J3=>{"use strict";Object.defineProperty(J3,"__esModule",{value:!0});J3.CallHierarchyFeature=void 0;var p7=Kr(),wre=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(p7.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=p7.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=p7.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};J3.CallHierarchyFeature=wre});var h7=q(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.SemanticTokensBuilder=Oc.SemanticTokensDiff=Oc.SemanticTokensFeature=void 0;var Q3=Kr(),Are=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Q3.SemanticTokensRefreshRequest.type),on:e=>{let r=Q3.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Q3.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Q3.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Oc.SemanticTokensFeature=Are;var Y3=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,s=r-1;for(;i>=n&&s>=n&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<n||s<n)&&(i++,s++);let o=i-n+1,a=this.modifiedSequence.slice(n,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};Oc.SemanticTokensDiff=Y3;var m7=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,s){let o=e,a=r;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,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 Y3(this._prevData,this._data).computeDiff()}:this.build()}};Oc.SemanticTokensBuilder=m7});var SO=q(Z3=>{"use strict";Object.defineProperty(Z3,"__esModule",{value:!0});Z3.ShowDocumentFeature=void 0;var Rre=Kr(),Pre=t=>class extends t{showDocument(e){return this.connection.sendRequest(Rre.ShowDocumentRequest.type,e)}};Z3.ShowDocumentFeature=Pre});var EO=q(X3=>{"use strict";Object.defineProperty(X3,"__esModule",{value:!0});X3.FileOperationsFeature=void 0;var sp=Kr(),Nre=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(sp.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(sp.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(sp.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(sp.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(sp.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(sp.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};X3.FileOperationsFeature=Nre});var TO=q(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});ey.LinkedEditingRangeFeature=void 0;var Ore=Kr(),Ire=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Ore.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};ey.LinkedEditingRangeFeature=Ire});var CO=q(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.TypeHierarchyFeature=void 0;var g7=Kr(),Dre=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(g7.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=g7.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=g7.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};ty.TypeHierarchyFeature=Dre});var wO=q(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.InlineValueFeature=void 0;var kO=Kr(),Lre=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(kO.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(kO.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};ry.InlineValueFeature=Lre});var RO=q(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.FoldingRangeFeature=void 0;var AO=Kr(),$re=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(AO.FoldingRangeRefreshRequest.type),on:e=>{let r=AO.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};ny.FoldingRangeFeature=$re});var PO=q(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.InlayHintFeature=void 0;var y7=Kr(),Mre=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(y7.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(y7.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(y7.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};iy.InlayHintFeature=Mre});var NO=q(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.DiagnosticFeature=void 0;var C1=Kr(),Fre=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(C1.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(C1.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(C1.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(C1.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(C1.WorkspaceDiagnosticRequest.partialResult,r)))}}};sy.DiagnosticFeature=Fre});var x7=q(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});oy.TextDocuments=void 0;var el=Kr(),v7=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new el.Emitter,this._onDidOpen=new el.Emitter,this._onDidClose=new el.Emitter,this._onDidSave=new el.Emitter,this._onWillSave=new el.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=el.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),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 s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,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}))})),el.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};oy.TextDocuments=v7});var b7=q(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.NotebookDocuments=op.NotebookSyncFeature=void 0;var Ls=Kr(),OO=x7(),Vre=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Ls.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Ls.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Ls.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Ls.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};op.NotebookSyncFeature=Vre;var ay=class t{onDidOpenTextDocument(e){return this.openHandler=e,Ls.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Ls.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Ls.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};ay.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var _7=class{constructor(e){e instanceof OO.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new OO.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Ls.Emitter,this._onDidChange=new Ls.Emitter,this._onDidSave=new Ls.Emitter,this._onDidClose=new Ls.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 ay,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 s of i.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,c=i.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let u=[],f=[],l=[],p=[];if(c.cells!==void 0){let b=c.cells;if(b.structure!==void 0){let _=b.structure.array;if(s.cells.splice(_.start,_.deleteCount,..._.cells!==void 0?_.cells:[]),b.structure.didOpen!==void 0)for(let x of b.structure.didOpen)r.openTextDocument({textDocument:x}),u.push(x.uri);if(b.structure.didClose)for(let x of b.structure.didClose)r.closeTextDocument({textDocument:x}),f.push(x.uri)}if(b.data!==void 0){let _=new Map(b.data.map(x=>[x.document,x]));for(let x=0;x<=s.cells.length;x++){let T=_.get(s.cells[x].document);if(T!==void 0){let R=s.cells.splice(x,1,T);if(l.push({old:R[0],new:T}),_.delete(T.document),_.size===0)break}}}if(b.textContent!==void 0)for(let _ of b.textContent)r.changeTextDocument({textDocument:_.document,contentChanges:_.changes}),p.push(_.document.uri)}this.updateCellMap(s);let d={notebookDocument:s};a&&(d.metadata={old:o,new:s.metadata});let h=[];for(let b of u)h.push(this.getNotebookCell(b));let g=[];for(let b of f)g.push(this.getNotebookCell(b));let v=[];for(let b of p)v.push(this.getNotebookCell(b));(h.length>0||g.length>0||l.length>0||v.length>0)&&(d.cells={added:h,removed:g,changed:{data:l,textContent:v}}),(d.metadata!==void 0||d.cells!==void 0)&&this._onDidChange.fire(d)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)r.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Ls.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};op.NotebookDocuments=_7});var IO=q(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.MonikerFeature=void 0;var jre=Kr(),Ure=t=>class extends t{get moniker(){return{on:e=>{let r=jre.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};cy.MonikerFeature=Ure});var w7=q(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.createConnection=jt.combineFeatures=jt.combineNotebooksFeatures=jt.combineLanguagesFeatures=jt.combineWorkspaceFeatures=jt.combineWindowFeatures=jt.combineClientFeatures=jt.combineTracerFeatures=jt.combineTelemetryFeatures=jt.combineConsoleFeatures=jt._NotebooksImpl=jt._LanguagesImpl=jt.BulkUnregistration=jt.BulkRegistration=jt.ErrorMessageTracker=void 0;var _e=Kr(),$s=a3(),E7=l7(),lt=vO(),qre=xO(),Bre=_O(),Hre=bO(),zre=h7(),Wre=SO(),Kre=EO(),Gre=TO(),Jre=CO(),Qre=wO(),Yre=RO(),Zre=PO(),Xre=NO(),ene=b7(),tne=IO();function S7(t){if(t!==null)return t}var T7=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)})}};jt.ErrorMessageTracker=T7;var uy=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(_e.MessageType.Error,e)}warn(e){this.send(_e.MessageType.Warning,e)}info(e){this.send(_e.MessageType.Info,e)}log(e){this.send(_e.MessageType.Log,e)}debug(e){this.send(_e.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(_e.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,_e.RAL)().console.error("Sending log message failed")})}},C7=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:_e.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(_e.ShowMessageRequest.type,n).then(S7)}showWarningMessage(e,...r){let n={type:_e.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(_e.ShowMessageRequest.type,n).then(S7)}showInformationMessage(e,...r){let n={type:_e.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(_e.ShowMessageRequest.type,n).then(S7)}},DO=(0,Wre.ShowDocumentFeature)((0,lt.ProgressFeature)(C7)),LO;(function(t){function e(){return new ly}t.create=e})(LO||(jt.BulkRegistration=LO={}));var ly=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=$s.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=E7.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},$O;(function(t){function e(){return new k1(void 0,[])}t.create=e})($O||(jt.BulkUnregistration=$O={}));var k1=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(_e.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=$s.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(_e.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},fy=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 ly?this.registerMany(e):e instanceof k1?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=$s.string(r)?r:r.method,s=E7.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(_e.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=$s.string(e)?e:e.method,i=E7.generateUuid(),s={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(_e.RegistrationRequest.type,s).then(o=>_e.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(o)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(_e.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(_e.RegistrationRequest.type,r).then(()=>new k1(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},k7=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(_e.ApplyWorkspaceEditRequest.type,n)}},MO=(0,Kre.FileOperationsFeature)((0,Bre.WorkspaceFoldersFeature)((0,qre.ConfigurationFeature)(k7))),dy=class{constructor(){this._trace=_e.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!==_e.Trace.Off&&this.connection.sendNotification(_e.LogTraceNotification.type,{message:e,verbose:this._trace===_e.Trace.Verbose?r:void 0}).catch(()=>{})}},py=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(_e.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},my=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,lt.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,lt.attachPartialResult)(this.connection,r)}};jt._LanguagesImpl=my;var FO=(0,Yre.FoldingRangeFeature)((0,tne.MonikerFeature)((0,Xre.DiagnosticFeature)((0,Zre.InlayHintFeature)((0,Qre.InlineValueFeature)((0,Jre.TypeHierarchyFeature)((0,Gre.LinkedEditingRangeFeature)((0,zre.SemanticTokensFeature)((0,Hre.CallHierarchyFeature)(my))))))))),hy=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,lt.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,lt.attachPartialResult)(this.connection,r)}};jt._NotebooksImpl=hy;var VO=(0,ene.NotebookSyncFeature)(hy);function jO(t,e){return function(r){return e(t(r))}}jt.combineConsoleFeatures=jO;function UO(t,e){return function(r){return e(t(r))}}jt.combineTelemetryFeatures=UO;function qO(t,e){return function(r){return e(t(r))}}jt.combineTracerFeatures=qO;function BO(t,e){return function(r){return e(t(r))}}jt.combineClientFeatures=BO;function HO(t,e){return function(r){return e(t(r))}}jt.combineWindowFeatures=HO;function zO(t,e){return function(r){return e(t(r))}}jt.combineWorkspaceFeatures=zO;function WO(t,e){return function(r){return e(t(r))}}jt.combineLanguagesFeatures=WO;function KO(t,e){return function(r){return e(t(r))}}jt.combineNotebooksFeatures=KO;function rne(t,e){function r(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:r(t.console,e.console,jO),tracer:r(t.tracer,e.tracer,qO),telemetry:r(t.telemetry,e.telemetry,UO),client:r(t.client,e.client,BO),window:r(t.window,e.window,HO),workspace:r(t.workspace,e.workspace,zO),languages:r(t.languages,e.languages,WO),notebooks:r(t.notebooks,e.notebooks,KO)}}jt.combineFeatures=rne;function nne(t,e,r){let n=r&&r.console?new(r.console(uy)):new uy,i=t(n);n.rawAttach(i);let s=r&&r.tracer?new(r.tracer(dy)):new dy,o=r&&r.telemetry?new(r.telemetry(py)):new py,a=r&&r.client?new(r.client(fy)):new fy,c=r&&r.window?new(r.window(DO)):new DO,u=r&&r.workspace?new(r.workspace(MO)):new MO,f=r&&r.languages?new(r.languages(FO)):new FO,l=r&&r.notebooks?new(r.notebooks(VO)):new VO,p=[n,s,o,a,c,u,f,l];function d(_){return _ instanceof Promise?_:$s.thenable(_)?new Promise((x,T)=>{_.then(R=>x(R),R=>T(R))}):Promise.resolve(_)}let h,g,v,b={listen:()=>i.listen(),sendRequest:(_,...x)=>i.sendRequest($s.string(_)?_:_.method,...x),onRequest:(_,x)=>i.onRequest(_,x),sendNotification:(_,x)=>{let T=$s.string(_)?_:_.method;return i.sendNotification(T,x)},onNotification:(_,x)=>i.onNotification(_,x),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:_=>(g=_,{dispose:()=>{g=void 0}}),onInitialized:_=>i.onNotification(_e.InitializedNotification.type,_),onShutdown:_=>(h=_,{dispose:()=>{h=void 0}}),onExit:_=>(v=_,{dispose:()=>{v=void 0}}),get console(){return n},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return c},get workspace(){return u},get languages(){return f},get notebooks(){return l},onDidChangeConfiguration:_=>i.onNotification(_e.DidChangeConfigurationNotification.type,_),onDidChangeWatchedFiles:_=>i.onNotification(_e.DidChangeWatchedFilesNotification.type,_),__textDocumentSync:void 0,onDidOpenTextDocument:_=>i.onNotification(_e.DidOpenTextDocumentNotification.type,_),onDidChangeTextDocument:_=>i.onNotification(_e.DidChangeTextDocumentNotification.type,_),onDidCloseTextDocument:_=>i.onNotification(_e.DidCloseTextDocumentNotification.type,_),onWillSaveTextDocument:_=>i.onNotification(_e.WillSaveTextDocumentNotification.type,_),onWillSaveTextDocumentWaitUntil:_=>i.onRequest(_e.WillSaveTextDocumentWaitUntilRequest.type,_),onDidSaveTextDocument:_=>i.onNotification(_e.DidSaveTextDocumentNotification.type,_),sendDiagnostics:_=>i.sendNotification(_e.PublishDiagnosticsNotification.type,_),onHover:_=>i.onRequest(_e.HoverRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),void 0)),onCompletion:_=>i.onRequest(_e.CompletionRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onCompletionResolve:_=>i.onRequest(_e.CompletionResolveRequest.type,_),onSignatureHelp:_=>i.onRequest(_e.SignatureHelpRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),void 0)),onDeclaration:_=>i.onRequest(_e.DeclarationRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onDefinition:_=>i.onRequest(_e.DefinitionRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onTypeDefinition:_=>i.onRequest(_e.TypeDefinitionRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onImplementation:_=>i.onRequest(_e.ImplementationRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onReferences:_=>i.onRequest(_e.ReferencesRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onDocumentHighlight:_=>i.onRequest(_e.DocumentHighlightRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onDocumentSymbol:_=>i.onRequest(_e.DocumentSymbolRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onWorkspaceSymbol:_=>i.onRequest(_e.WorkspaceSymbolRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onWorkspaceSymbolResolve:_=>i.onRequest(_e.WorkspaceSymbolResolveRequest.type,_),onCodeAction:_=>i.onRequest(_e.CodeActionRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onCodeActionResolve:_=>i.onRequest(_e.CodeActionResolveRequest.type,(x,T)=>_(x,T)),onCodeLens:_=>i.onRequest(_e.CodeLensRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onCodeLensResolve:_=>i.onRequest(_e.CodeLensResolveRequest.type,(x,T)=>_(x,T)),onDocumentFormatting:_=>i.onRequest(_e.DocumentFormattingRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),void 0)),onDocumentRangeFormatting:_=>i.onRequest(_e.DocumentRangeFormattingRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),void 0)),onDocumentOnTypeFormatting:_=>i.onRequest(_e.DocumentOnTypeFormattingRequest.type,(x,T)=>_(x,T)),onRenameRequest:_=>i.onRequest(_e.RenameRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),void 0)),onPrepareRename:_=>i.onRequest(_e.PrepareRenameRequest.type,(x,T)=>_(x,T)),onDocumentLinks:_=>i.onRequest(_e.DocumentLinkRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onDocumentLinkResolve:_=>i.onRequest(_e.DocumentLinkResolveRequest.type,(x,T)=>_(x,T)),onDocumentColor:_=>i.onRequest(_e.DocumentColorRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onColorPresentation:_=>i.onRequest(_e.ColorPresentationRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onFoldingRanges:_=>i.onRequest(_e.FoldingRangeRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onSelectionRanges:_=>i.onRequest(_e.SelectionRangeRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),(0,lt.attachPartialResult)(i,x))),onExecuteCommand:_=>i.onRequest(_e.ExecuteCommandRequest.type,(x,T)=>_(x,T,(0,lt.attachWorkDone)(i,x),void 0)),dispose:()=>i.dispose()};for(let _ of p)_.attach(b);return i.onRequest(_e.InitializeRequest.type,_=>{e.initialize(_),$s.string(_.trace)&&(s.trace=_e.Trace.fromString(_.trace));for(let x of p)x.initialize(_.capabilities);if(g){let x=g(_,new _e.CancellationTokenSource().token,(0,lt.attachWorkDone)(i,_),void 0);return d(x).then(T=>{if(T instanceof _e.ResponseError)return T;let R=T;R||(R={capabilities:{}});let V=R.capabilities;V||(V={},R.capabilities=V),V.textDocumentSync===void 0||V.textDocumentSync===null?V.textDocumentSync=$s.number(b.__textDocumentSync)?b.__textDocumentSync:_e.TextDocumentSyncKind.None:!$s.number(V.textDocumentSync)&&!$s.number(V.textDocumentSync.change)&&(V.textDocumentSync.change=$s.number(b.__textDocumentSync)?b.__textDocumentSync:_e.TextDocumentSyncKind.None);for(let $ of p)$.fillServerCapabilities(V);return R})}else{let x={capabilities:{textDocumentSync:_e.TextDocumentSyncKind.None}};for(let T of p)T.fillServerCapabilities(x.capabilities);return x}}),i.onRequest(_e.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,h)return h(new _e.CancellationTokenSource().token)}),i.onNotification(_e.ExitNotification.type,()=>{try{v&&v()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(_e.SetTraceNotification.type,_=>{s.trace=_e.Trace.fromString(_.value)}),b}jt.createConnection=nne});var GO=q(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.resolveModulePath=ji.FileSystem=ji.resolveGlobalYarnPath=ji.resolveGlobalNodePath=ji.resolve=ji.uriToFilePath=void 0;var ine=require("url"),ao=require("path"),A7=require("fs"),O7=require("child_process");function sne(t){let e=ine.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 s=r[0],o=r[1];s.length===0&&o.length>1&&o[1]===":"&&r.shift()}return ao.normalize(r.join("/"))}ji.uriToFilePath=sne;function R7(){return process.platform==="win32"}function gy(t,e,r,n){let i="NODE_PATH",s=["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((o,a)=>{let c=process.env,u=Object.create(null);Object.keys(c).forEach(f=>u[f]=c[f]),e&&A7.existsSync(e)&&(u[i]?u[i]=e+ao.delimiter+u[i]:u[i]=e,n&&n(`NODE_PATH value is: ${u[i]}`)),u.ELECTRON_RUN_AS_NODE="1";try{let f=(0,O7.fork)("",[],{cwd:r,env:u,execArgv:["-e",s]});if(f.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}f.on("error",p=>{a(p)}),f.on("message",p=>{p.c==="r"&&(f.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${t}`)))});let l={c:"rs",a:t};f.send(l)}catch(f){a(f)}})}ji.resolve=gy;function P7(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};R7()&&(e="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,O7.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?R7()?ao.join(o,"node_modules"):ao.join(o,"lib","node_modules"):void 0}catch(s){return}finally{process.removeListener("SIGPIPE",i)}}ji.resolveGlobalNodePath=P7;function one(t){let e="yarn",r={encoding:"utf8"};R7()&&(e="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0,O7.spawnSync)(e,["global","dir","--json"],r),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return ao.join(c.data,"node_modules")}catch(c){}return}catch(i){return}finally{process.removeListener("SIGPIPE",n)}}ji.resolveGlobalYarnPath=one;var N7;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!A7.existsSync(__filename.toUpperCase())||!A7.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=r;function n(i,s){return r()?ao.normalize(s).indexOf(ao.normalize(i))===0:ao.normalize(s).toLowerCase().indexOf(ao.normalize(i).toLowerCase())===0}t.isParent=n})(N7||(ji.FileSystem=N7={}));function ane(t,e,r,n){return r?(ao.isAbsolute(r)||(r=ao.join(t,r)),gy(e,r,r,n).then(i=>N7.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>gy(e,P7(n),t,n))):gy(e,P7(n),t,n)}ji.resolveModulePath=ane});var I7=q((aNe,JO)=>{"use strict";JO.exports=Kr()});var QO=q(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.InlineCompletionFeature=void 0;var cne=Kr(),une=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(cne.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};yy.InlineCompletionFeature=une});var XO=q(si=>{"use strict";var lne=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]}),ZO=si&&si.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lne(e,t,r)};Object.defineProperty(si,"__esModule",{value:!0});si.ProposedFeatures=si.NotebookDocuments=si.TextDocuments=si.SemanticTokensBuilder=void 0;var fne=h7();Object.defineProperty(si,"SemanticTokensBuilder",{enumerable:!0,get:function(){return fne.SemanticTokensBuilder}});var dne=QO();ZO(Kr(),si);var pne=x7();Object.defineProperty(si,"TextDocuments",{enumerable:!0,get:function(){return pne.TextDocuments}});var mne=b7();Object.defineProperty(si,"NotebookDocuments",{enumerable:!0,get:function(){return mne.NotebookDocuments}});ZO(w7(),si);var YO;(function(t){t.all={__brand:"features",languages:dne.InlineCompletionFeature}})(YO||(si.ProposedFeatures=YO={}))});var Ui=q(Ms=>{"use strict";var hne=Ms&&Ms.__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]}),nI=Ms&&Ms.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hne(e,t,r)};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.createConnection=Ms.Files=void 0;var eI=require("util"),D7=a3(),gne=w7(),w1=GO(),tl=I7();nI(I7(),Ms);nI(XO(),Ms);var tI;(function(t){t.uriToFilePath=w1.uriToFilePath,t.resolveGlobalNodePath=w1.resolveGlobalNodePath,t.resolveGlobalYarnPath=w1.resolveGlobalYarnPath,t.resolve=w1.resolve,t.resolveModulePath=w1.resolveModulePath})(tI||(Ms.Files=tI={}));var rI;function vy(){if(rI!==void 0)try{rI.end()}catch(t){}}var ap=!1,iI;function yne(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(iI=setInterval(()=>{try{process.kill(n,0)}catch(i){vy(),process.exit(ap?0:1)}},3e3))}catch(n){}}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])}}}yne();var vne={initialize:t=>{let e=t.processId;D7.number(e)&&iI===void 0&&setInterval(()=>{try{process.kill(e,0)}catch(r){process.exit(ap?0:1)}},3e3)},get shutdownReceived(){return ap},set shutdownReceived(t){ap=t},exit:t=>{vy(),process.exit(t)}};function xne(t,e,r,n){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),tl.ConnectionStrategy.is(t)||tl.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=r),_ne(s,o,a,i)}Ms.createConnection=xne;function _ne(t,e,r,n){let i=!1;if(!t&&!e&&process.argv.length>2){let c,u,f=process.argv.slice(2);for(let l=0;l<f.length;l++){let p=f[l];if(p==="--node-ipc"){t=new tl.IPCMessageReader(process),e=new tl.IPCMessageWriter(process);break}else if(p==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(p==="--socket"){c=parseInt(f[l+1]);break}else if(p==="--pipe"){u=f[l+1];break}else{var s=p.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){u=s[1];break}}}if(c){let l=(0,tl.createServerSocketTransport)(c);t=l[0],e=l[1]}else if(u){let l=(0,tl.createServerPipeTransport)(u);t=l[0],e=l[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(D7.func(t.read)&&D7.func(t.on)){let c=t;c.on("end",()=>{vy(),process.exit(ap?0:1)}),c.on("close",()=>{vy(),process.exit(ap?0:1)})}let a=c=>{let u=(0,tl.createProtocolConnection)(t,e,c,r);return i&&bne(c),u};return(0,gne.createConnection)(a,vne,n)}function bne(t){function e(n){return n.map(i=>typeof i=="string"?i:(0,eI.inspect)(i)).join(" ")}let r=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){var a;let s=String(i),o=(a=r.get(s))!=null?a:0;o+=1,r.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?r.clear():r.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,eI.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
61
+ ${s}`)},console.warn=function(...i){t.warn(e(i))}}});var Ei=q(gs=>{"use strict";gs.__esModule=!0;gs.extend=tD;gs.indexOf=sse;gs.escapeExpression=ose;gs.isEmpty=ase;gs.createFrame=cse;gs.blockParams=use;gs.appendContextPath=lse;var tse={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},rse=/[&<>"'`=]/g,nse=/[&<>"'`=]/;function ise(t){return tse[t]}function tD(t){for(var e=1;e<arguments.length;e++)for(var r in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],r)&&(t[r]=arguments[e][r]);return t}var G7=Object.prototype.toString;gs.toString=G7;var K7=function(e){return typeof e=="function"};K7(/x/)&&(gs.isFunction=K7=function(t){return typeof t=="function"&&G7.call(t)==="[object Function]"});gs.isFunction=K7;var rD=Array.isArray||function(t){return t&&typeof t=="object"?G7.call(t)==="[object Array]":!1};gs.isArray=rD;function sse(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function ose(t){if(typeof t!="string"){if(t&&t.toHTML)return t.toHTML();if(t==null)return"";if(!t)return t+"";t=""+t}return nse.test(t)?t.replace(rse,ise):t}function ase(t){return!t&&t!==0?!0:!!(rD(t)&&t.length===0)}function cse(t){var e=tD({},t);return e._parent=t,e}function use(t,e){return t.path=e,t}function lse(t,e){return(t?t+".":"")+e}});var zs=q((o4,nD)=>{"use strict";o4.__esModule=!0;var J7=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function Q7(t,e){var r=e&&e.loc,n=void 0,i=void 0,s=void 0,o=void 0;r&&(n=r.start.line,i=r.end.line,s=r.start.column,o=r.end.column,t+=" - "+n+":"+s);for(var a=Error.prototype.constructor.call(this,t),c=0;c<J7.length;c++)this[J7[c]]=a[J7[c]];Error.captureStackTrace&&Error.captureStackTrace(this,Q7);try{r&&(this.lineNumber=n,this.endLineNumber=i,Object.defineProperty?(Object.defineProperty(this,"column",{value:s,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:o,enumerable:!0})):(this.column=s,this.endColumn=o))}catch(u){}}Q7.prototype=new Error;o4.default=Q7;nD.exports=o4.default});var sD=q((a4,iD)=>{"use strict";a4.__esModule=!0;var Y7=Ei();a4.default=function(t){t.registerHelper("blockHelperMissing",function(e,r){var n=r.inverse,i=r.fn;if(e===!0)return i(this);if(e===!1||e==null)return n(this);if(Y7.isArray(e))return e.length>0?(r.ids&&(r.ids=[r.name]),t.helpers.each(e,r)):n(this);if(r.data&&r.ids){var s=Y7.createFrame(r.data);s.contextPath=Y7.appendContextPath(r.data.contextPath,r.name),r={data:s}}return i(e,r)})};iD.exports=a4.default});var aD=q((c4,oD)=>{"use strict";c4.__esModule=!0;function fse(t){return t&&t.__esModule?t:{default:t}}var V1=Ei(),dse=zs(),pse=fse(dse);c4.default=function(t){t.registerHelper("each",function(e,r){if(!r)throw new pse.default("Must pass iterator to #each");var n=r.fn,i=r.inverse,s=0,o="",a=void 0,c=void 0;r.data&&r.ids&&(c=V1.appendContextPath(r.data.contextPath,r.ids[0])+"."),V1.isFunction(e)&&(e=e.call(this)),r.data&&(a=V1.createFrame(r.data));function u(h,g,v){a&&(a.key=h,a.index=g,a.first=g===0,a.last=!!v,c&&(a.contextPath=c+h)),o=o+n(e[h],{data:a,blockParams:V1.blockParams([e[h],h],[c+h,null])})}if(e&&typeof e=="object")if(V1.isArray(e))for(var f=e.length;s<f;s++)s in e&&u(s,s,s===e.length-1);else if(typeof Symbol=="function"&&e[Symbol.iterator]){for(var l=[],p=e[Symbol.iterator](),d=p.next();!d.done;d=p.next())l.push(d.value);e=l;for(var f=e.length;s<f;s++)u(s,s,s===e.length-1)}else(function(){var h=void 0;Object.keys(e).forEach(function(g){h!==void 0&&u(h,s-1),h=g,s++}),h!==void 0&&u(h,s-1,!0)})();return s===0&&(o=i(this)),o})};oD.exports=c4.default});var uD=q((u4,cD)=>{"use strict";u4.__esModule=!0;function mse(t){return t&&t.__esModule?t:{default:t}}var hse=zs(),gse=mse(hse);u4.default=function(t){t.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new gse.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};cD.exports=u4.default});var pD=q((l4,dD)=>{"use strict";l4.__esModule=!0;function yse(t){return t&&t.__esModule?t:{default:t}}var lD=Ei(),vse=zs(),fD=yse(vse);l4.default=function(t){t.registerHelper("if",function(e,r){if(arguments.length!=2)throw new fD.default("#if requires exactly one argument");return lD.isFunction(e)&&(e=e.call(this)),!r.hash.includeZero&&!e||lD.isEmpty(e)?r.inverse(this):r.fn(this)}),t.registerHelper("unless",function(e,r){if(arguments.length!=2)throw new fD.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:r.inverse,inverse:r.fn,hash:r.hash})})};dD.exports=l4.default});var hD=q((f4,mD)=>{"use strict";f4.__esModule=!0;f4.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],r=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)e.push(arguments[n]);var i=1;r.hash.level!=null?i=r.hash.level:r.data&&r.data.level!=null&&(i=r.data.level),e[0]=i,t.log.apply(t,e)})};mD.exports=f4.default});var yD=q((d4,gD)=>{"use strict";d4.__esModule=!0;d4.default=function(t){t.registerHelper("lookup",function(e,r,n){return e&&n.lookupProperty(e,r)})};gD.exports=d4.default});var xD=q((p4,vD)=>{"use strict";p4.__esModule=!0;function xse(t){return t&&t.__esModule?t:{default:t}}var j1=Ei(),_se=zs(),bse=xse(_se);p4.default=function(t){t.registerHelper("with",function(e,r){if(arguments.length!=2)throw new bse.default("#with requires exactly one argument");j1.isFunction(e)&&(e=e.call(this));var n=r.fn;if(j1.isEmpty(e))return r.inverse(this);var i=r.data;return r.data&&r.ids&&(i=j1.createFrame(r.data),i.contextPath=j1.appendContextPath(r.data.contextPath,r.ids[0])),n(e,{data:i,blockParams:j1.blockParams([e],[i&&i.contextPath])})})};vD.exports=p4.default});var Z7=q(m4=>{"use strict";m4.__esModule=!0;m4.registerDefaultHelpers=$se;m4.moveHelperToHooks=Mse;function bl(t){return t&&t.__esModule?t:{default:t}}var Sse=sD(),Ese=bl(Sse),Tse=aD(),Cse=bl(Tse),kse=uD(),wse=bl(kse),Ase=pD(),Rse=bl(Ase),Pse=hD(),Nse=bl(Pse),Ose=yD(),Ise=bl(Ose),Dse=xD(),Lse=bl(Dse);function $se(t){Ese.default(t),Cse.default(t),wse.default(t),Rse.default(t),Nse.default(t),Ise.default(t),Lse.default(t)}function Mse(t,e,r){t.helpers[e]&&(t.hooks[e]=t.helpers[e],r||delete t.helpers[e])}});var bD=q((h4,_D)=>{"use strict";h4.__esModule=!0;var Fse=Ei();h4.default=function(t){t.registerDecorator("inline",function(e,r,n,i){var s=e;return r.partials||(r.partials={},s=function(o,a){var c=n.partials;n.partials=Fse.extend({},c,r.partials);var u=e(o,a);return n.partials=c,u}),r.partials[i.args[0]]=i.fn,s})};_D.exports=h4.default});var SD=q(X7=>{"use strict";X7.__esModule=!0;X7.registerDefaultDecorators=qse;function Vse(t){return t&&t.__esModule?t:{default:t}}var jse=bD(),Use=Vse(jse);function qse(t){Use.default(t)}});var ex=q((g4,ED)=>{"use strict";g4.__esModule=!0;var Bse=Ei(),bp={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var r=Bse.indexOf(bp.methodMap,e.toLowerCase());r>=0?e=r:e=parseInt(e,10)}return e},log:function(e){if(e=bp.lookupLevel(e),typeof console!="undefined"&&bp.lookupLevel(bp.level)<=e){var r=bp.methodMap[e];console[r]||(r="log");for(var n=arguments.length,i=Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];console[r].apply(console,i)}}};g4.default=bp;ED.exports=g4.default});var TD=q(tx=>{"use strict";tx.__esModule=!0;tx.createNewLookupObject=zse;var Hse=Ei();function zse(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return Hse.extend.apply(void 0,[Object.create(null)].concat(e))}});var rx=q(U1=>{"use strict";U1.__esModule=!0;U1.createProtoAccessControl=Jse;U1.resultIsAllowed=Qse;U1.resetLoggedProperties=Zse;function Wse(t){return t&&t.__esModule?t:{default:t}}var CD=TD(),Kse=ex(),Gse=Wse(Kse),y4=Object.create(null);function Jse(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:CD.createNewLookupObject(r,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:CD.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}}function Qse(t,e,r){return kD(typeof t=="function"?e.methods:e.properties,r)}function kD(t,e){return t.whitelist[e]!==void 0?t.whitelist[e]===!0:t.defaultValue!==void 0?t.defaultValue:(Yse(e),!1)}function Yse(t){y4[t]!==!0&&(y4[t]=!0,Gse.default.log("error",'Handlebars: Access has been denied to resolve the property "'+t+`" because it is not an "own property" of its parent.
62
+ You can add a runtime option to disable the check or this warning:
63
+ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function Zse(){Object.keys(y4).forEach(function(t){delete y4[t]})}});var x4=q(Yo=>{"use strict";Yo.__esModule=!0;Yo.HandlebarsEnvironment=sx;function wD(t){return t&&t.__esModule?t:{default:t}}var Sl=Ei(),Xse=zs(),nx=wD(Xse),eoe=Z7(),toe=SD(),roe=ex(),v4=wD(roe),noe=rx(),ioe="4.7.8";Yo.VERSION=ioe;var soe=8;Yo.COMPILER_REVISION=soe;var ooe=7;Yo.LAST_COMPATIBLE_COMPILER_REVISION=ooe;var aoe={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};Yo.REVISION_CHANGES=aoe;var ix="[object Object]";function sx(t,e,r){this.helpers=t||{},this.partials=e||{},this.decorators=r||{},eoe.registerDefaultHelpers(this),toe.registerDefaultDecorators(this)}sx.prototype={constructor:sx,logger:v4.default,log:v4.default.log,registerHelper:function(e,r){if(Sl.toString.call(e)===ix){if(r)throw new nx.default("Arg not supported with multiple helpers");Sl.extend(this.helpers,e)}else this.helpers[e]=r},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,r){if(Sl.toString.call(e)===ix)Sl.extend(this.partials,e);else{if(typeof r=="undefined")throw new nx.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=r}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,r){if(Sl.toString.call(e)===ix){if(r)throw new nx.default("Arg not supported with multiple decorators");Sl.extend(this.decorators,e)}else this.decorators[e]=r},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){noe.resetLoggedProperties()}};var coe=v4.default.log;Yo.log=coe;Yo.createFrame=Sl.createFrame;Yo.logger=v4.default});var RD=q((_4,AD)=>{"use strict";_4.__esModule=!0;function ox(t){this.string=t}ox.prototype.toString=ox.prototype.toHTML=function(){return""+this.string};_4.default=ox;AD.exports=_4.default});var PD=q(ax=>{"use strict";ax.__esModule=!0;ax.wrapHelper=uoe;function uoe(t,e){if(typeof t!="function")return t;var r=function(){var i=arguments[arguments.length-1];return arguments[arguments.length-1]=e(i),t.apply(this,arguments)};return r}});var LD=q(Fc=>{"use strict";Fc.__esModule=!0;Fc.checkRevision=hoe;Fc.template=goe;Fc.wrapProgram=b4;Fc.resolvePartial=yoe;Fc.invokePartial=voe;Fc.noop=ID;function loe(t){return t&&t.__esModule?t:{default:t}}function foe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}var doe=Ei(),La=foe(doe),poe=zs(),$a=loe(poe),Ma=x4(),ND=Z7(),moe=PD(),OD=rx();function hoe(t){var e=t&&t[0]||1,r=Ma.COMPILER_REVISION;if(!(e>=Ma.LAST_COMPATIBLE_COMPILER_REVISION&&e<=Ma.COMPILER_REVISION))if(e<Ma.LAST_COMPATIBLE_COMPILER_REVISION){var n=Ma.REVISION_CHANGES[r],i=Ma.REVISION_CHANGES[e];throw new $a.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+i+").")}else throw new $a.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}function goe(t,e){if(!e)throw new $a.default("No environment passed to template");if(!t||!t.main)throw new $a.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var r=t.compiler&&t.compiler[0]===7;function n(o,a,c){c.hash&&(a=La.extend({},a,c.hash),c.ids&&(c.ids[0]=!0)),o=e.VM.resolvePartial.call(this,o,a,c);var u=La.extend({},c,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),f=e.VM.invokePartial.call(this,o,a,u);if(f==null&&e.compile&&(c.partials[c.name]=e.compile(o,t.compilerOptions,e),f=c.partials[c.name](a,u)),f!=null){if(c.indent){for(var l=f.split(`
64
+ `),p=0,d=l.length;p<d&&!(!l[p]&&p+1===d);p++)l[p]=c.indent+l[p];f=l.join(`
65
+ `)}return f}else throw new $a.default("The partial "+c.name+" could not be compiled when running in runtime-only mode")}var i={strict:function(a,c,u){if(!a||!(c in a))throw new $a.default('"'+c+'" not defined in '+a,{loc:u});return i.lookupProperty(a,c)},lookupProperty:function(a,c){var u=a[c];if(u==null||Object.prototype.hasOwnProperty.call(a,c)||OD.resultIsAllowed(u,i.protoAccessControl,c))return u},lookup:function(a,c){for(var u=a.length,f=0;f<u;f++){var l=a[f]&&i.lookupProperty(a[f],c);if(l!=null)return a[f][c]}},lambda:function(a,c){return typeof a=="function"?a.call(c):a},escapeExpression:La.escapeExpression,invokePartial:n,fn:function(a){var c=t[a];return c.decorator=t[a+"_d"],c},programs:[],program:function(a,c,u,f,l){var p=this.programs[a],d=this.fn(a);return c||l||f||u?p=b4(this,a,d,c,u,f,l):p||(p=this.programs[a]=b4(this,a,d)),p},data:function(a,c){for(;a&&c--;)a=a._parent;return a},mergeIfNeeded:function(a,c){var u=a||c;return a&&c&&a!==c&&(u=La.extend({},c,a)),u},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:t.compiler};function s(o){var a=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],c=a.data;s._setup(a),!a.partial&&t.useData&&(c=xoe(o,c));var u=void 0,f=t.useBlockParams?[]:void 0;t.useDepths&&(a.depths?u=o!=a.depths[0]?[o].concat(a.depths):a.depths:u=[o]);function l(p){return""+t.main(i,p,i.helpers,i.partials,c,f,u)}return l=DD(t.main,l,i,a.depths||[],c,f),l(o,a)}return s.isTop=!0,s._setup=function(o){if(o.partial)i.protoAccessControl=o.protoAccessControl,i.helpers=o.helpers,i.partials=o.partials,i.decorators=o.decorators,i.hooks=o.hooks;else{var a=La.extend({},e.helpers,o.helpers);_oe(a,i),i.helpers=a,t.usePartial&&(i.partials=i.mergeIfNeeded(o.partials,e.partials)),(t.usePartial||t.useDecorators)&&(i.decorators=La.extend({},e.decorators,o.decorators)),i.hooks={},i.protoAccessControl=OD.createProtoAccessControl(o);var c=o.allowCallsToHelperMissing||r;ND.moveHelperToHooks(i,"helperMissing",c),ND.moveHelperToHooks(i,"blockHelperMissing",c)}},s._child=function(o,a,c,u){if(t.useBlockParams&&!c)throw new $a.default("must pass block params");if(t.useDepths&&!u)throw new $a.default("must pass parent depths");return b4(i,o,t[o],a,0,c,u)},s}function b4(t,e,r,n,i,s,o){function a(c){var u=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],f=o;return o&&c!=o[0]&&!(c===t.nullContext&&o[0]===null)&&(f=[c].concat(o)),r(t,c,t.helpers,t.partials,u.data||n,s&&[u.blockParams].concat(s),f)}return a=DD(r,a,t,o,n,s),a.program=e,a.depth=o?o.length:0,a.blockParams=i||0,a}function yoe(t,e,r){return t?!t.call&&!r.name&&(r.name=t,t=r.partials[t]):r.name==="@partial-block"?t=r.data["partial-block"]:t=r.partials[r.name],t}function voe(t,e,r){var n=r.data&&r.data["partial-block"];r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var i=void 0;if(r.fn&&r.fn!==ID&&function(){r.data=Ma.createFrame(r.data);var s=r.fn;i=r.data["partial-block"]=function(a){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return c.data=Ma.createFrame(c.data),c.data["partial-block"]=n,s(a,c)},s.partials&&(r.partials=La.extend({},r.partials,s.partials))}(),t===void 0&&i&&(t=i),t===void 0)throw new $a.default("The partial "+r.name+" could not be found");if(t instanceof Function)return t(e,r)}function ID(){return""}function xoe(t,e){return(!e||!("root"in e))&&(e=e?Ma.createFrame(e):{},e.root=t),e}function DD(t,e,r,n,i,s){if(t.decorator){var o={};e=t.decorator(e,o,r,n&&n[0],i,s,n),La.extend(e,o)}return e}function _oe(t,e){Object.keys(t).forEach(function(r){var n=t[r];t[r]=boe(n,e)})}function boe(t,e){var r=e.lookupProperty;return moe.wrapHelper(t,function(n){return La.extend({lookupProperty:r},n)})}});var cx=q((S4,$D)=>{"use strict";S4.__esModule=!0;S4.default=function(t){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var e=globalThis.Handlebars;t.noConflict=function(){return globalThis.Handlebars===t&&(globalThis.Handlebars=e),t}};$D.exports=S4.default});var UD=q((E4,jD)=>{"use strict";E4.__esModule=!0;function lx(t){return t&&t.__esModule?t:{default:t}}function fx(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}var Soe=x4(),MD=fx(Soe),Eoe=RD(),Toe=lx(Eoe),Coe=zs(),koe=lx(Coe),woe=Ei(),ux=fx(woe),Aoe=LD(),FD=fx(Aoe),Roe=cx(),Poe=lx(Roe);function VD(){var t=new MD.HandlebarsEnvironment;return ux.extend(t,MD),t.SafeString=Toe.default,t.Exception=koe.default,t.Utils=ux,t.escapeExpression=ux.escapeExpression,t.VM=FD,t.template=function(e){return FD.template(e,t)},t}var q1=VD();q1.create=VD;Poe.default(q1);q1.default=q1;E4.default=q1;jD.exports=E4.default});var dx=q((T4,BD)=>{"use strict";T4.__esModule=!0;var qD={helpers:{helperExpression:function(e){return e.type==="SubExpression"||(e.type==="MustacheStatement"||e.type==="BlockStatement")&&!!(e.params&&e.params.length||e.hash)},scopedId:function(e){return/^\.|this\b/.test(e.original)},simpleId:function(e){return e.parts.length===1&&!qD.helpers.scopedId(e)&&!e.depth}}};T4.default=qD;BD.exports=T4.default});var zD=q((C4,HD)=>{"use strict";C4.__esModule=!0;var Noe=function(){var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(i,s,o,a,c,u,f){var l=u.length-1;switch(c){case 1:return u[l-1];case 2:this.$=a.prepareProgram(u[l]);break;case 3:this.$=u[l];break;case 4:this.$=u[l];break;case 5:this.$=u[l];break;case 6:this.$=u[l];break;case 7:this.$=u[l];break;case 8:this.$=u[l];break;case 9:this.$={type:"CommentStatement",value:a.stripComment(u[l]),strip:a.stripFlags(u[l],u[l]),loc:a.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:u[l],value:u[l],loc:a.locInfo(this._$)};break;case 11:this.$=a.prepareRawBlock(u[l-2],u[l-1],u[l],this._$);break;case 12:this.$={path:u[l-3],params:u[l-2],hash:u[l-1]};break;case 13:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!1,this._$);break;case 14:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!0,this._$);break;case 15:this.$={open:u[l-5],path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 16:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 17:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 18:this.$={strip:a.stripFlags(u[l-1],u[l-1]),program:u[l]};break;case 19:var p=a.prepareBlock(u[l-2],u[l-1],u[l],u[l],!1,this._$),d=a.prepareProgram([p],u[l-1].loc);d.chained=!0,this.$={strip:u[l-2].strip,program:d,chain:!0};break;case 20:this.$=u[l];break;case 21:this.$={path:u[l-1],strip:a.stripFlags(u[l-2],u[l])};break;case 22:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 23:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 24:this.$={type:"PartialStatement",name:u[l-3],params:u[l-2],hash:u[l-1],indent:"",strip:a.stripFlags(u[l-4],u[l]),loc:a.locInfo(this._$)};break;case 25:this.$=a.preparePartialBlock(u[l-2],u[l-1],u[l],this._$);break;case 26:this.$={path:u[l-3],params:u[l-2],hash:u[l-1],strip:a.stripFlags(u[l-4],u[l])};break;case 27:this.$=u[l];break;case 28:this.$=u[l];break;case 29:this.$={type:"SubExpression",path:u[l-3],params:u[l-2],hash:u[l-1],loc:a.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:u[l],loc:a.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:a.id(u[l-2]),value:u[l],loc:a.locInfo(this._$)};break;case 32:this.$=a.id(u[l-1]);break;case 33:this.$=u[l];break;case 34:this.$=u[l];break;case 35:this.$={type:"StringLiteral",value:u[l],original:u[l],loc:a.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(u[l]),original:Number(u[l]),loc:a.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:u[l]==="true",original:u[l]==="true",loc:a.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:a.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:a.locInfo(this._$)};break;case 40:this.$=u[l];break;case 41:this.$=u[l];break;case 42:this.$=a.preparePath(!0,u[l],this._$);break;case 43:this.$=a.preparePath(!1,u[l],this._$);break;case 44:u[l-2].push({part:a.id(u[l]),original:u[l],separator:u[l-1]}),this.$=u[l-2];break;case 45:this.$=[{part:a.id(u[l]),original:u[l]}];break;case 46:this.$=[];break;case 47:u[l-1].push(u[l]);break;case 48:this.$=[];break;case 49:u[l-1].push(u[l]);break;case 50:this.$=[];break;case 51:u[l-1].push(u[l]);break;case 58:this.$=[];break;case 59:u[l-1].push(u[l]);break;case 64:this.$=[];break;case 65:u[l-1].push(u[l]);break;case 70:this.$=[];break;case 71:u[l-1].push(u[l]);break;case 78:this.$=[];break;case 79:u[l-1].push(u[l]);break;case 82:this.$=[];break;case 83:u[l-1].push(u[l]);break;case 86:this.$=[];break;case 87:u[l-1].push(u[l]);break;case 90:this.$=[];break;case 91:u[l-1].push(u[l]);break;case 94:this.$=[];break;case 95:u[l-1].push(u[l]);break;case 98:this.$=[u[l]];break;case 99:u[l-1].push(u[l]);break;case 100:this.$=[u[l]];break;case 101:u[l-1].push(u[l]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(i,s){throw new Error(i)},parse:function(i){var s=this,o=[0],a=[null],c=[],u=this.table,f="",l=0,p=0,d=0,h=2,g=1;this.lexer.setInput(i),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={});var v=this.lexer.yylloc;c.push(v);var b=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function _(te){o.length=o.length-2*te,a.length=a.length-te,c.length=c.length-te}function x(){var te;return te=s.lexer.lex()||1,typeof te!="number"&&(te=s.symbols_[te]||te),te}for(var T,R,V,$,K,z,W={},D,P,M,j;;){if(V=o[o.length-1],this.defaultActions[V]?$=this.defaultActions[V]:((T===null||typeof T=="undefined")&&(T=x()),$=u[V]&&u[V][T]),typeof $=="undefined"||!$.length||!$[0]){var J="";if(!d){j=[];for(D in u[V])this.terminals_[D]&&D>2&&j.push("'"+this.terminals_[D]+"'");this.lexer.showPosition?J="Parse error on line "+(l+1)+`:
66
+ `+this.lexer.showPosition()+`
67
+ Expecting `+j.join(", ")+", got '"+(this.terminals_[T]||T)+"'":J="Parse error on line "+(l+1)+": Unexpected "+(T==1?"end of input":"'"+(this.terminals_[T]||T)+"'"),this.parseError(J,{text:this.lexer.match,token:this.terminals_[T]||T,line:this.lexer.yylineno,loc:v,expected:j})}}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+T);switch($[0]){case 1:o.push(T),a.push(this.lexer.yytext),c.push(this.lexer.yylloc),o.push($[1]),T=null,R?(T=R,R=null):(p=this.lexer.yyleng,f=this.lexer.yytext,l=this.lexer.yylineno,v=this.lexer.yylloc,d>0&&d--);break;case 2:if(P=this.productions_[$[1]][1],W.$=a[a.length-P],W._$={first_line:c[c.length-(P||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(P||1)].first_column,last_column:c[c.length-1].last_column},b&&(W._$.range=[c[c.length-(P||1)].range[0],c[c.length-1].range[1]]),z=this.performAction.call(W,f,p,l,this.yy,$[1],a,c),typeof z!="undefined")return z;P&&(o=o.slice(0,-1*P*2),a=a.slice(0,-1*P),c=c.slice(0,-1*P)),o.push(this.productions_[$[1]][0]),a.push(W.$),c.push(W._$),M=u[o[o.length-2]][o[o.length-1]],o.push(M);break;case 3:return!0}}return!0}},e=function(){var n={EOF:1,parseError:function(s,o){if(this.yy.parser)this.yy.parser.parseError(s,o);else throw new Error(s)},setInput:function(s){return this._input=s,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var o=s.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},unput:function(s){var o=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o-1),this.offset-=o;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===c.length?this.yylloc.first_column:0)+c[c.length-a.length].length-a[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-o]),this},more:function(){return this._more=!0,this},less:function(s){this.unput(this.match.slice(s))},pastInput:function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var s=this.pastInput(),o=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
68
+ `+o+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,o,a,c,u,f;this._more||(this.yytext="",this.match="");for(var l=this._currentRules(),p=0;p<l.length&&(a=this._input.match(this.rules[l[p]]),!(a&&(!o||a[0].length>o[0].length)&&(o=a,c=p,!this.options.flex)));p++);return o?(f=o[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],s=this.performAction.call(this,this.yy,this,l[c],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
69
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return typeof s!="undefined"?s:this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(s){this.begin(s)}};return n.options={},n.performAction=function(s,o,a,c){function u(l,p){return o.yytext=o.yytext.substring(l,o.yyleng-p+l)}var f=c;switch(a){case 0:if(o.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):o.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),o.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(u(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(o.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return o.yytext=u(1,2).replace(/\\"/g,'"'),80;break;case 32:return o.yytext=u(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return o.yytext=o.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n}();t.lexer=e;function r(){this.yy={}}return r.prototype=t,t.Parser=r,new r}();C4.default=Noe;HD.exports=C4.default});var R4=q((A4,GD)=>{"use strict";A4.__esModule=!0;function Ooe(t){return t&&t.__esModule?t:{default:t}}var Ioe=zs(),px=Ooe(Ioe);function k4(){this.parents=[]}k4.prototype={constructor:k4,mutating:!1,acceptKey:function(e,r){var n=this.accept(e[r]);if(this.mutating){if(n&&!k4.prototype[n.type])throw new px.default('Unexpected node type "'+n.type+'" found when accepting '+r+" on "+e.type);e[r]=n}},acceptRequired:function(e,r){if(this.acceptKey(e,r),!e[r])throw new px.default(e.type+" requires "+r)},acceptArray:function(e){for(var r=0,n=e.length;r<n;r++)this.acceptKey(e,r),e[r]||(e.splice(r,1),r--,n--)},accept:function(e){if(e){if(!this[e.type])throw new px.default("Unknown type: "+e.type,e);this.current&&this.parents.unshift(this.current),this.current=e;var r=this[e.type](e);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return e}},Program:function(e){this.acceptArray(e.body)},MustacheStatement:w4,Decorator:w4,BlockStatement:WD,DecoratorBlock:WD,PartialStatement:KD,PartialBlockStatement:function(e){KD.call(this,e),this.acceptKey(e,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:w4,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(e){this.acceptArray(e.pairs)},HashPair:function(e){this.acceptRequired(e,"value")}};function w4(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function WD(t){w4.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function KD(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}A4.default=k4;GD.exports=A4.default});var QD=q((P4,JD)=>{"use strict";P4.__esModule=!0;function Doe(t){return t&&t.__esModule?t:{default:t}}var Loe=R4(),$oe=Doe(Loe);function Zo(){var t=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=t}Zo.prototype=new $oe.default;Zo.prototype.Program=function(t){var e=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var n=t.body,i=0,s=n.length;i<s;i++){var o=n[i],a=this.accept(o);if(a){var c=mx(n,i,r),u=hx(n,i,r),f=a.openStandalone&&c,l=a.closeStandalone&&u,p=a.inlineStandalone&&c&&u;a.close&&El(n,i,!0),a.open&&Vc(n,i,!0),e&&p&&(El(n,i),Vc(n,i)&&o.type==="PartialStatement"&&(o.indent=/([ \t]+$)/.exec(n[i-1].original)[1])),e&&f&&(El((o.program||o.inverse).body),Vc(n,i)),e&&l&&(El(n,i),Vc((o.inverse||o.program).body))}}return t};Zo.prototype.BlockStatement=Zo.prototype.DecoratorBlock=Zo.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,r=t.program&&t.inverse,n=r,i=r;if(r&&r.chained)for(n=r.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var s={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:hx(e.body),closeStandalone:mx((n||e).body)};if(t.openStrip.close&&El(e.body,null,!0),r){var o=t.inverseStrip;o.open&&Vc(e.body,null,!0),o.close&&El(n.body,null,!0),t.closeStrip.open&&Vc(i.body,null,!0),!this.options.ignoreStandalone&&mx(e.body)&&hx(n.body)&&(Vc(e.body),El(n.body))}else t.closeStrip.open&&Vc(e.body,null,!0);return s};Zo.prototype.Decorator=Zo.prototype.MustacheStatement=function(t){return t.strip};Zo.prototype.PartialStatement=Zo.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}};function mx(t,e,r){e===void 0&&(e=t.length);var n=t[e-1],i=t[e-2];if(!n)return r;if(n.type==="ContentStatement")return(i||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original)}function hx(t,e,r){e===void 0&&(e=-1);var n=t[e+1],i=t[e+2];if(!n)return r;if(n.type==="ContentStatement")return(i||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original)}function El(t,e,r){var n=t[e==null?0:e+1];if(!(!n||n.type!=="ContentStatement"||!r&&n.rightStripped)){var i=n.value;n.value=n.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==i}}function Vc(t,e,r){var n=t[e==null?t.length-1:e-1];if(!(!n||n.type!=="ContentStatement"||!r&&n.leftStripped)){var i=n.value;return n.value=n.value.replace(r?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==i,n.leftStripped}}P4.default=Zo;JD.exports=P4.default});var YD=q(Ws=>{"use strict";Ws.__esModule=!0;Ws.SourceLocation=Voe;Ws.id=joe;Ws.stripFlags=Uoe;Ws.stripComment=qoe;Ws.preparePath=Boe;Ws.prepareMustache=Hoe;Ws.prepareRawBlock=zoe;Ws.prepareBlock=Woe;Ws.prepareProgram=Koe;Ws.preparePartialBlock=Goe;function Moe(t){return t&&t.__esModule?t:{default:t}}var Foe=zs(),gx=Moe(Foe);function yx(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var r={loc:t.path.loc};throw new gx.default(t.path.original+" doesn't match "+e,r)}}function Voe(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}}function joe(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t}function Uoe(t,e){return{open:t.charAt(2)==="~",close:e.charAt(e.length-3)==="~"}}function qoe(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function Boe(t,e,r){r=this.locInfo(r);for(var n=t?"@":"",i=[],s=0,o=0,a=e.length;o<a;o++){var c=e[o].part,u=e[o].original!==c;if(n+=(e[o].separator||"")+c,!u&&(c===".."||c==="."||c==="this")){if(i.length>0)throw new gx.default("Invalid path: "+n,{loc:r});c===".."&&s++}else i.push(c)}return{type:"PathExpression",data:t,depth:s,parts:i,original:n,loc:r}}function Hoe(t,e,r,n,i,s){var o=n.charAt(3)||n.charAt(2),a=o!=="{"&&o!=="&",c=/\*/.test(n);return{type:c?"Decorator":"MustacheStatement",path:t,params:e,hash:r,escaped:a,strip:i,loc:this.locInfo(s)}}function zoe(t,e,r,n){yx(t,r),n=this.locInfo(n);var i={type:"Program",body:e,strip:{},loc:n};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:i,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}}function Woe(t,e,r,n,i,s){n&&n.path&&yx(t,n);var o=/\*/.test(t.open);e.blockParams=t.blockParams;var a=void 0,c=void 0;if(r){if(o)throw new gx.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),c=r.strip,a=r.program}return i&&(i=a,a=e,e=i),{type:o?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:a,openStrip:t.strip,inverseStrip:c,closeStrip:n&&n.strip,loc:this.locInfo(s)}}function Koe(t,e){if(!e&&t.length){var r=t[0].loc,n=t[t.length-1].loc;r&&n&&(e={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:t,strip:{},loc:e}}function Goe(t,e,r,n){return yx(t,r),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}}});var eL=q(B1=>{"use strict";B1.__esModule=!0;B1.parseWithoutProcessing=XD;B1.parse=rae;function Joe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function ZD(t){return t&&t.__esModule?t:{default:t}}var Qoe=zD(),vx=ZD(Qoe),Yoe=QD(),Zoe=ZD(Yoe),Xoe=YD(),eae=Joe(Xoe),tae=Ei();B1.parser=vx.default;var N4={};tae.extend(N4,eae);function XD(t,e){if(t.type==="Program")return t;vx.default.yy=N4,N4.locInfo=function(n){return new N4.SourceLocation(e&&e.srcName,n)};var r=vx.default.parse(t);return r}function rae(t,e){var r=XD(t,e),n=new Zoe.default(e);return n.accept(r)}});var iL=q(K1=>{"use strict";K1.__esModule=!0;K1.Compiler=xx;K1.precompile=oae;K1.compile=aae;function rL(t){return t&&t.__esModule?t:{default:t}}var nae=zs(),z1=rL(nae),W1=Ei(),iae=dx(),H1=rL(iae),sae=[].slice;function xx(){}xx.prototype={compiler:xx,equals:function(e){var r=this.opcodes.length;if(e.opcodes.length!==r)return!1;for(var n=0;n<r;n++){var i=this.opcodes[n],s=e.opcodes[n];if(i.opcode!==s.opcode||!nL(i.args,s.args))return!1}r=this.children.length;for(var n=0;n<r;n++)if(!this.children[n].equals(e.children[n]))return!1;return!0},guid:0,compile:function(e,r){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=r,this.stringParams=r.stringParams,this.trackIds=r.trackIds,r.blockParams=r.blockParams||[],r.knownHelpers=W1.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r.knownHelpers),this.accept(e)},compileProgram:function(e){var r=new this.compiler,n=r.compile(e,this.options),i=this.guid++;return this.usePartial=this.usePartial||n.usePartial,this.children[i]=n,this.useDepths=this.useDepths||n.useDepths,i},accept:function(e){if(!this[e.type])throw new z1.default("Unknown type: "+e.type,e);this.sourceNode.unshift(e);var r=this[e.type](e);return this.sourceNode.shift(),r},Program:function(e){this.options.blockParams.unshift(e.blockParams);for(var r=e.body,n=r.length,i=0;i<n;i++)this.accept(r[i]);return this.options.blockParams.shift(),this.isSimple=n===1,this.blockParams=e.blockParams?e.blockParams.length:0,this},BlockStatement:function(e){tL(e);var r=e.program,n=e.inverse;r=r&&this.compileProgram(r),n=n&&this.compileProgram(n);var i=this.classifySexpr(e);i==="helper"?this.helperSexpr(e,r,n):i==="simple"?(this.simpleSexpr(e),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("blockValue",e.path.original)):(this.ambiguousSexpr(e,r,n),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(e){var r=e.program&&this.compileProgram(e.program),n=this.setupFullMustacheParams(e,r,void 0),i=e.path;this.useDecorators=!0,this.opcode("registerDecorator",n.length,i.original)},PartialStatement:function(e){this.usePartial=!0;var r=e.program;r&&(r=this.compileProgram(e.program));var n=e.params;if(n.length>1)throw new z1.default("Unsupported number of partial arguments: "+n.length,e);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var i=e.name.original,s=e.name.type==="SubExpression";s&&this.accept(e.name),this.setupFullMustacheParams(e,r,void 0,!0);var o=e.indent||"";this.options.preventIndent&&o&&(this.opcode("appendContent",o),o=""),this.opcode("invokePartial",s,i,o),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){tL(e);var r=this.classifySexpr(e);r==="simple"?this.simpleSexpr(e):r==="helper"?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,r,n){var i=e.path,s=i.parts[0],o=r!=null||n!=null;this.opcode("getContext",i.depth),this.opcode("pushProgram",r),this.opcode("pushProgram",n),i.strict=!0,this.accept(i),this.opcode("invokeAmbiguous",s,o)},simpleSexpr:function(e){var r=e.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,r,n){var i=this.setupFullMustacheParams(e,r,n),s=e.path,o=s.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",i.length,o);else{if(this.options.knownHelpersOnly)throw new z1.default("You specified knownHelpersOnly, but used the unknown helper "+o,e);s.strict=!0,s.falsy=!0,this.accept(s),this.opcode("invokeHelper",i.length,s.original,H1.default.helpers.simpleId(s))}},PathExpression:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth);var r=e.parts[0],n=H1.default.helpers.scopedId(e),i=!e.depth&&!n&&this.blockParamIndex(r);i?this.opcode("lookupBlockParam",i,e.parts):r?e.data?(this.options.data=!0,this.opcode("lookupData",e.depth,e.parts,e.strict)):this.opcode("lookupOnContext",e.parts,e.falsy,e.strict,n):this.opcode("pushContext")},StringLiteral:function(e){this.opcode("pushString",e.value)},NumberLiteral:function(e){this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var r=e.pairs,n=0,i=r.length;for(this.opcode("pushHash");n<i;n++)this.pushParam(r[n].value);for(;n--;)this.opcode("assignToHash",r[n].key);this.opcode("popHash")},opcode:function(e){this.opcodes.push({opcode:e,args:sae.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(e){e&&(this.useDepths=!0)},classifySexpr:function(e){var r=H1.default.helpers.simpleId(e.path),n=r&&!!this.blockParamIndex(e.path.parts[0]),i=!n&&H1.default.helpers.helperExpression(e),s=!n&&(i||r);if(s&&!i){var o=e.path.parts[0],a=this.options;a.knownHelpers[o]?i=!0:a.knownHelpersOnly&&(s=!1)}return i?"helper":s?"ambiguous":"simple"},pushParams:function(e){for(var r=0,n=e.length;r<n;r++)this.pushParam(e[r])},pushParam:function(e){var r=e.value!=null?e.value:e.original||"";if(this.stringParams)r.replace&&(r=r.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),e.depth&&this.addDepth(e.depth),this.opcode("getContext",e.depth||0),this.opcode("pushStringParam",r,e.type),e.type==="SubExpression"&&this.accept(e);else{if(this.trackIds){var n=void 0;if(e.parts&&!H1.default.helpers.scopedId(e)&&!e.depth&&(n=this.blockParamIndex(e.parts[0])),n){var i=e.parts.slice(1).join(".");this.opcode("pushId","BlockParam",n,i)}else r=e.original||r,r.replace&&(r=r.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",e.type,r)}this.accept(e)}},setupFullMustacheParams:function(e,r,n,i){var s=e.params;return this.pushParams(s),this.opcode("pushProgram",r),this.opcode("pushProgram",n),e.hash?this.accept(e.hash):this.opcode("emptyHash",i),s},blockParamIndex:function(e){for(var r=0,n=this.options.blockParams.length;r<n;r++){var i=this.options.blockParams[r],s=i&&W1.indexOf(i,e);if(i&&s>=0)return[r,s]}}};function oae(t,e,r){if(t==null||typeof t!="string"&&t.type!=="Program")throw new z1.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);e=e||{},"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var n=r.parse(t,e),i=new r.Compiler().compile(n,e);return new r.JavaScriptCompiler().compile(i,e)}function aae(t,e,r){if(e===void 0&&(e={}),t==null||typeof t!="string"&&t.type!=="Program")throw new z1.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);e=W1.extend({},e),"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var n=void 0;function i(){var o=r.parse(t,e),a=new r.Compiler().compile(o,e),c=new r.JavaScriptCompiler().compile(a,e,void 0,!0);return r.template(c)}function s(o,a){return n||(n=i()),n.call(this,o,a)}return s._setup=function(o){return n||(n=i()),n._setup(o)},s._child=function(o,a,c,u){return n||(n=i()),n._child(o,a,c,u)},s}function nL(t,e){if(t===e)return!0;if(W1.isArray(t)&&W1.isArray(e)&&t.length===e.length){for(var r=0;r<t.length;r++)if(!nL(t[r],e[r]))return!1;return!0}}function tL(t){if(!t.path.parts){var e=t.path;t.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}});var oL=q(_x=>{var sL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");_x.encode=function(t){if(0<=t&&t<sL.length)return sL[t];throw new TypeError("Must be between 0 and 63: "+t)};_x.decode=function(t){var e=65,r=90,n=97,i=122,s=48,o=57,a=43,c=47,u=26,f=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+u:s<=t&&t<=o?t-s+f:t==a?62:t==c?63:-1}});var Ex=q(Sx=>{var aL=oL(),bx=5,cL=1<<bx,uL=cL-1,lL=cL;function cae(t){return t<0?(-t<<1)+1:(t<<1)+0}function uae(t){var e=(t&1)===1,r=t>>1;return e?-r:r}Sx.encode=function(e){var r="",n,i=cae(e);do n=i&uL,i>>>=bx,i>0&&(n|=lL),r+=aL.encode(n);while(i>0);return r};Sx.decode=function(e,r,n){var i=e.length,s=0,o=0,a,c;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(c=aL.decode(e.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(c&lL),c&=uL,s=s+(c<<o),o+=bx}while(a);n.value=uae(s),n.rest=r}});var Tp=q(ui=>{function lae(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}ui.getArg=lae;var fL=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,fae=/^data:.+\,.+$/;function G1(t){var e=t.match(fL);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}ui.urlParse=G1;function Sp(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}ui.urlGenerate=Sp;function Tx(t){var e=t,r=G1(t);if(r){if(!r.path)return t;e=r.path}for(var n=ui.isAbsolute(e),i=e.split(/\/+/),s,o=0,a=i.length-1;a>=0;a--)s=i[a],s==="."?i.splice(a,1):s===".."?o++:o>0&&(s===""?(i.splice(a+1,o),o=0):(i.splice(a,2),o--));return e=i.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,Sp(r)):e}ui.normalize=Tx;function dL(t,e){t===""&&(t="."),e===""&&(e=".");var r=G1(e),n=G1(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Sp(r);if(r||e.match(fae))return e;if(n&&!n.host&&!n.path)return n.host=e,Sp(n);var i=e.charAt(0)==="/"?e:Tx(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,Sp(n)):i}ui.join=dL;ui.isAbsolute=function(t){return t.charAt(0)==="/"||fL.test(t)};function dae(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}ui.relative=dae;var pL=function(){var t=Object.create(null);return!("__proto__"in t)}();function mL(t){return t}function pae(t){return hL(t)?"$"+t:t}ui.toSetString=pL?mL:pae;function mae(t){return hL(t)?t.slice(1):t}ui.fromSetString=pL?mL:mae;function hL(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function hae(t,e,r){var n=Ep(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:Ep(t.name,e.name)}ui.compareByOriginalPositions=hae;function gae(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=Ep(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:Ep(t.name,e.name)}ui.compareByGeneratedPositionsDeflated=gae;function Ep(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function yae(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=Ep(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:Ep(t.name,e.name)}ui.compareByGeneratedPositionsInflated=yae;function vae(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}ui.parseSourceMapInput=vae;function xae(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=G1(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=dL(Sp(n),e)}return Tx(e)}ui.computeSourceURL=xae});var wx=q(gL=>{var Cx=Tp(),kx=Object.prototype.hasOwnProperty,Tl=typeof Map!="undefined";function Fa(){this._array=[],this._set=Tl?new Map:Object.create(null)}Fa.fromArray=function(e,r){for(var n=new Fa,i=0,s=e.length;i<s;i++)n.add(e[i],r);return n};Fa.prototype.size=function(){return Tl?this._set.size:Object.getOwnPropertyNames(this._set).length};Fa.prototype.add=function(e,r){var n=Tl?e:Cx.toSetString(e),i=Tl?this.has(e):kx.call(this._set,n),s=this._array.length;(!i||r)&&this._array.push(e),i||(Tl?this._set.set(e,s):this._set[n]=s)};Fa.prototype.has=function(e){if(Tl)return this._set.has(e);var r=Cx.toSetString(e);return kx.call(this._set,r)};Fa.prototype.indexOf=function(e){if(Tl){var r=this._set.get(e);if(r>=0)return r}else{var n=Cx.toSetString(e);if(kx.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};Fa.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};Fa.prototype.toArray=function(){return this._array.slice()};gL.ArraySet=Fa});var xL=q(vL=>{var yL=Tp();function _ae(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=i||yL.compareByGeneratedPositionsInflated(t,e)<=0}function O4(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}O4.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};O4.prototype.add=function(e){_ae(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};O4.prototype.toArray=function(){return this._sorted||(this._array.sort(yL.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};vL.MappingList=O4});var Ax=q(_L=>{var J1=Ex(),vn=Tp(),I4=wx().ArraySet,bae=xL().MappingList;function Ks(t){t||(t={}),this._file=vn.getArg(t,"file",null),this._sourceRoot=vn.getArg(t,"sourceRoot",null),this._skipValidation=vn.getArg(t,"skipValidation",!1),this._sources=new I4,this._names=new I4,this._mappings=new bae,this._sourcesContents=null}Ks.prototype._version=3;Ks.fromSourceMap=function(e){var r=e.sourceRoot,n=new Ks({file:e.file,sourceRoot:r});return e.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,r!=null&&(s.source=vn.relative(r,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),n.addMapping(s)}),e.sources.forEach(function(i){var s=i;r!==null&&(s=vn.relative(r,i)),n._sources.has(s)||n._sources.add(s);var o=e.sourceContentFor(i);o!=null&&n.setSourceContent(i,o)}),n};Ks.prototype.addMapping=function(e){var r=vn.getArg(e,"generated"),n=vn.getArg(e,"original",null),i=vn.getArg(e,"source",null),s=vn.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,i,s),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s})};Ks.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=vn.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[vn.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[vn.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Ks.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var s=this._sourceRoot;s!=null&&(i=vn.relative(s,i));var o=new I4,a=new I4;this._mappings.unsortedForEach(function(c){if(c.source===i&&c.originalLine!=null){var u=e.originalPositionFor({line:c.originalLine,column:c.originalColumn});u.source!=null&&(c.source=u.source,n!=null&&(c.source=vn.join(n,c.source)),s!=null&&(c.source=vn.relative(s,c.source)),c.originalLine=u.line,c.originalColumn=u.column,u.name!=null&&(c.name=u.name))}var f=c.source;f!=null&&!o.has(f)&&o.add(f);var l=c.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=o,this._names=a,e.sources.forEach(function(c){var u=e.sourceContentFor(c);u!=null&&(n!=null&&(c=vn.join(n,c)),s!=null&&(c=vn.relative(s,c)),this.setSourceContent(c,u))},this)};Ks.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i}))}};Ks.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,s=0,o=0,a="",c,u,f,l,p=this._mappings.toArray(),d=0,h=p.length;d<h;d++){if(u=p[d],c="",u.generatedLine!==r)for(e=0;u.generatedLine!==r;)c+=";",r++;else if(d>0){if(!vn.compareByGeneratedPositionsInflated(u,p[d-1]))continue;c+=","}c+=J1.encode(u.generatedColumn-e),e=u.generatedColumn,u.source!=null&&(l=this._sources.indexOf(u.source),c+=J1.encode(l-o),o=l,c+=J1.encode(u.originalLine-1-i),i=u.originalLine-1,c+=J1.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(f=this._names.indexOf(u.name),c+=J1.encode(f-s),s=f)),a+=c}return a};Ks.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=vn.relative(r,n));var i=vn.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};Ks.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};Ks.prototype.toString=function(){return JSON.stringify(this.toJSON())};_L.SourceMapGenerator=Ks});var bL=q(Cl=>{Cl.GREATEST_LOWER_BOUND=1;Cl.LEAST_UPPER_BOUND=2;function Rx(t,e,r,n,i,s){var o=Math.floor((e-t)/2)+t,a=i(r,n[o],!0);return a===0?o:a>0?e-o>1?Rx(o,e,r,n,i,s):s==Cl.LEAST_UPPER_BOUND?e<n.length?e:-1:o:o-t>1?Rx(t,o,r,n,i,s):s==Cl.LEAST_UPPER_BOUND?o:t<0?-1:t}Cl.search=function(e,r,n,i){if(r.length===0)return-1;var s=Rx(-1,r.length,e,r,n,i||Cl.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s}});var EL=q(SL=>{function Px(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Sae(t,e){return Math.round(t+Math.random()*(e-t))}function Nx(t,e,r,n){if(r<n){var i=Sae(r,n),s=r-1;Px(t,i,n);for(var o=t[n],a=r;a<n;a++)e(t[a],o)<=0&&(s+=1,Px(t,s,a));Px(t,s+1,a);var c=s+1;Nx(t,e,r,c-1),Nx(t,e,c+1,n)}}SL.quickSort=function(t,e){Nx(t,e,0,t.length-1)}});var CL=q(D4=>{var Ue=Tp(),Ox=bL(),Cp=wx().ArraySet,Eae=Ex(),Q1=EL().quickSort;function Cr(t,e){var r=t;return typeof t=="string"&&(r=Ue.parseSourceMapInput(t)),r.sections!=null?new po(r,e):new Gn(r,e)}Cr.fromSourceMap=function(t,e){return Gn.fromSourceMap(t,e)};Cr.prototype._version=3;Cr.prototype.__generatedMappings=null;Object.defineProperty(Cr.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Cr.prototype.__originalMappings=null;Object.defineProperty(Cr.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Cr.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};Cr.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};Cr.GENERATED_ORDER=1;Cr.ORIGINAL_ORDER=2;Cr.GREATEST_LOWER_BOUND=1;Cr.LEAST_UPPER_BOUND=2;Cr.prototype.eachMapping=function(e,r,n){var i=r||null,s=n||Cr.GENERATED_ORDER,o;switch(s){case Cr.GENERATED_ORDER:o=this._generatedMappings;break;case Cr.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;o.map(function(c){var u=c.source===null?null:this._sources.at(c.source);return u=Ue.computeSourceURL(a,u,this._sourceMapURL),{source:u,generatedLine:c.generatedLine,generatedColumn:c.generatedColumn,originalLine:c.originalLine,originalColumn:c.originalColumn,name:c.name===null?null:this._names.at(c.name)}},this).forEach(e,i)};Cr.prototype.allGeneratedPositionsFor=function(e){var r=Ue.getArg(e,"line"),n={source:Ue.getArg(e,"source"),originalLine:r,originalColumn:Ue.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ue.compareByOriginalPositions,Ox.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(e.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)i.push({line:Ue.getArg(o,"generatedLine",null),column:Ue.getArg(o,"generatedColumn",null),lastColumn:Ue.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var c=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==c;)i.push({line:Ue.getArg(o,"generatedLine",null),column:Ue.getArg(o,"generatedColumn",null),lastColumn:Ue.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return i};D4.SourceMapConsumer=Cr;function Gn(t,e){var r=t;typeof t=="string"&&(r=Ue.parseSourceMapInput(t));var n=Ue.getArg(r,"version"),i=Ue.getArg(r,"sources"),s=Ue.getArg(r,"names",[]),o=Ue.getArg(r,"sourceRoot",null),a=Ue.getArg(r,"sourcesContent",null),c=Ue.getArg(r,"mappings"),u=Ue.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=Ue.normalize(o)),i=i.map(String).map(Ue.normalize).map(function(f){return o&&Ue.isAbsolute(o)&&Ue.isAbsolute(f)?Ue.relative(o,f):f}),this._names=Cp.fromArray(s.map(String),!0),this._sources=Cp.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(f){return Ue.computeSourceURL(o,f,e)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=e,this.file=u}Gn.prototype=Object.create(Cr.prototype);Gn.prototype.consumer=Cr;Gn.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Ue.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};Gn.fromSourceMap=function(e,r){var n=Object.create(Gn.prototype),i=n._names=Cp.fromArray(e._names.toArray(),!0),s=n._sources=Cp.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(d){return Ue.computeSourceURL(n.sourceRoot,d,r)});for(var o=e._mappings.toArray().slice(),a=n.__generatedMappings=[],c=n.__originalMappings=[],u=0,f=o.length;u<f;u++){var l=o[u],p=new TL;p.generatedLine=l.generatedLine,p.generatedColumn=l.generatedColumn,l.source&&(p.source=s.indexOf(l.source),p.originalLine=l.originalLine,p.originalColumn=l.originalColumn,l.name&&(p.name=i.indexOf(l.name)),c.push(p)),a.push(p)}return Q1(n.__originalMappings,Ue.compareByOriginalPositions),n};Gn.prototype._version=3;Object.defineProperty(Gn.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function TL(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Gn.prototype._parseMappings=function(e,r){for(var n=1,i=0,s=0,o=0,a=0,c=0,u=e.length,f=0,l={},p={},d=[],h=[],g,v,b,_,x;f<u;)if(e.charAt(f)===";")n++,f++,i=0;else if(e.charAt(f)===",")f++;else{for(g=new TL,g.generatedLine=n,_=f;_<u&&!this._charIsMappingSeparator(e,_);_++);if(v=e.slice(f,_),b=l[v],b)f+=v.length;else{for(b=[];f<_;)Eae.decode(e,f,p),x=p.value,f=p.rest,b.push(x);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");l[v]=b}g.generatedColumn=i+b[0],i=g.generatedColumn,b.length>1&&(g.source=a+b[1],a+=b[1],g.originalLine=s+b[2],s=g.originalLine,g.originalLine+=1,g.originalColumn=o+b[3],o=g.originalColumn,b.length>4&&(g.name=c+b[4],c+=b[4])),h.push(g),typeof g.originalLine=="number"&&d.push(g)}Q1(h,Ue.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,Q1(d,Ue.compareByOriginalPositions),this.__originalMappings=d};Gn.prototype._findMapping=function(e,r,n,i,s,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return Ox.search(e,r,s,o)};Gn.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};Gn.prototype.originalPositionFor=function(e){var r={generatedLine:Ue.getArg(e,"line"),generatedColumn:Ue.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",Ue.compareByGeneratedPositionsDeflated,Ue.getArg(e,"bias",Cr.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var s=Ue.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=Ue.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=Ue.getArg(i,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:Ue.getArg(i,"originalLine",null),column:Ue.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};Gn.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};Gn.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=Ue.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=Ue.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};Gn.prototype.generatedPositionFor=function(e){var r=Ue.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Ue.getArg(e,"line"),originalColumn:Ue.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ue.compareByOriginalPositions,Ue.getArg(e,"bias",Cr.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:Ue.getArg(s,"generatedLine",null),column:Ue.getArg(s,"generatedColumn",null),lastColumn:Ue.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};D4.BasicSourceMapConsumer=Gn;function po(t,e){var r=t;typeof t=="string"&&(r=Ue.parseSourceMapInput(t));var n=Ue.getArg(r,"version"),i=Ue.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Cp,this._names=new Cp;var s={line:-1,column:0};this._sections=i.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=Ue.getArg(o,"offset"),c=Ue.getArg(a,"line"),u=Ue.getArg(a,"column");if(c<s.line||c===s.line&&u<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=a,{generatedOffset:{generatedLine:c+1,generatedColumn:u+1},consumer:new Cr(Ue.getArg(o,"map"),e)}})}po.prototype=Object.create(Cr.prototype);po.prototype.constructor=Cr;po.prototype._version=3;Object.defineProperty(po.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});po.prototype.originalPositionFor=function(e){var r={generatedLine:Ue.getArg(e,"line"),generatedColumn:Ue.getArg(e,"column")},n=Ox.search(r,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};po.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};po.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],s=i.consumer.sourceContentFor(e,!0);if(s)return s}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};po.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(Ue.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var s={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};po.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],s=i.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],c=i.consumer._sources.at(a.source);c=Ue.computeSourceURL(i.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;a.name&&(u=i.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var f={source:c,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(f),typeof f.originalLine=="number"&&this.__originalMappings.push(f)}Q1(this.__generatedMappings,Ue.compareByGeneratedPositionsDeflated),Q1(this.__originalMappings,Ue.compareByOriginalPositions)};D4.IndexedSourceMapConsumer=po});var wL=q(kL=>{var Tae=Ax().SourceMapGenerator,L4=Tp(),Cae=/(\r?\n)/,kae=10,kp="$$$isSourceNode$$$";function ys(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t==null?null:t,this.column=e==null?null:e,this.source=r==null?null:r,this.name=i==null?null:i,this[kp]=!0,n!=null&&this.add(n)}ys.fromStringWithSourceMap=function(e,r,n){var i=new ys,s=e.split(Cae),o=0,a=function(){var p=h(),d=h()||"";return p+d;function h(){return o<s.length?s[o++]:void 0}},c=1,u=0,f=null;return r.eachMapping(function(p){if(f!==null)if(c<p.generatedLine)l(f,a()),c++,u=0;else{var d=s[o]||"",h=d.substr(0,p.generatedColumn-u);s[o]=d.substr(p.generatedColumn-u),u=p.generatedColumn,l(f,h),f=p;return}for(;c<p.generatedLine;)i.add(a()),c++;if(u<p.generatedColumn){var d=s[o]||"";i.add(d.substr(0,p.generatedColumn)),s[o]=d.substr(p.generatedColumn),u=p.generatedColumn}f=p},this),o<s.length&&(f&&l(f,a()),i.add(s.splice(o).join(""))),r.sources.forEach(function(p){var d=r.sourceContentFor(p);d!=null&&(n!=null&&(p=L4.join(n,p)),i.setSourceContent(p,d))}),i;function l(p,d){if(p===null||p.source===void 0)i.add(d);else{var h=n?L4.join(n,p.source):p.source;i.add(new ys(p.originalLine,p.originalColumn,h,d,p.name))}}};ys.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[kp]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};ys.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[kp]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};ys.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[kp]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};ys.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};ys.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[kp]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};ys.prototype.setSourceContent=function(e,r){this.sourceContents[L4.toSetString(e)]=r};ys.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][kp]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(L4.fromSetString(i[r]),this.sourceContents[i[r]])};ys.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};ys.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new Tae(e),i=!1,s=null,o=null,a=null,c=null;return this.walk(function(u,f){r.code+=u,f.source!==null&&f.line!==null&&f.column!==null?((s!==f.source||o!==f.line||a!==f.column||c!==f.name)&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name}),s=f.source,o=f.line,a=f.column,c=f.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),s=null,i=!1);for(var l=0,p=u.length;l<p;l++)u.charCodeAt(l)===kae?(r.line++,r.column=0,l+1===p?(s=null,i=!1):i&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name})):r.column++}),this.walkSourceContents(function(u,f){n.setSourceContent(u,f)}),{code:r.code,map:n}};kL.SourceNode=ys});var AL=q($4=>{$4.SourceMapGenerator=Ax().SourceMapGenerator;$4.SourceMapConsumer=CL().SourceMapConsumer;$4.SourceNode=wL().SourceNode});var OL=q((M4,NL)=>{"use strict";M4.__esModule=!0;var Dx=Ei(),kl=void 0;try{(typeof define!="function"||!define.amd)&&(RL=AL(),kl=RL.SourceNode)}catch(t){}var RL;kl||(kl=function(t,e,r,n){this.src="",n&&this.add(n)},kl.prototype={add:function(e){Dx.isArray(e)&&(e=e.join("")),this.src+=e},prepend:function(e){Dx.isArray(e)&&(e=e.join("")),this.src=e+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function Ix(t,e,r){if(Dx.isArray(t)){for(var n=[],i=0,s=t.length;i<s;i++)n.push(e.wrap(t[i],r));return n}else if(typeof t=="boolean"||typeof t=="number")return t+"";return t}function PL(t){this.srcFile=t,this.source=[]}PL.prototype={isEmpty:function(){return!this.source.length},prepend:function(e,r){this.source.unshift(this.wrap(e,r))},push:function(e,r){this.source.push(this.wrap(e,r))},merge:function(){var e=this.empty();return this.each(function(r){e.add([" ",r,`
70
+ `])}),e},each:function(e){for(var r=0,n=this.source.length;r<n;r++)e(this.source[r])},empty:function(){var e=this.currentLocation||{start:{}};return new kl(e.start.line,e.start.column,this.srcFile)},wrap:function(e){var r=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return e instanceof kl?e:(e=Ix(e,this,r),new kl(r.start.line,r.start.column,this.srcFile,e))},functionCall:function(e,r,n){return n=this.generateList(n),this.wrap([e,r?"."+r+"(":"(",n,")"])},quotedString:function(e){return'"'+(e+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(e){var r=this,n=[];Object.keys(e).forEach(function(s){var o=Ix(e[s],r);o!=="undefined"&&n.push([r.quotedString(s),":",o])});var i=this.generateList(n);return i.prepend("{"),i.add("}"),i},generateList:function(e){for(var r=this.empty(),n=0,i=e.length;n<i;n++)n&&r.add(","),r.add(Ix(e[n],this));return r},generateArray:function(e){var r=this.generateList(e);return r.prepend("["),r.add("]"),r}};M4.default=PL;NL.exports=M4.default});var ML=q((F4,$L)=>{"use strict";F4.__esModule=!0;function LL(t){return t&&t.__esModule?t:{default:t}}var IL=x4(),wae=zs(),Lx=LL(wae),Aae=Ei(),Rae=OL(),DL=LL(Rae);function wp(t){this.value=t}function Ap(){}Ap.prototype={nameLookup:function(e,r){return this.internalNameLookup(e,r)},depthedLookup:function(e){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(e),")"]},compilerInfo:function(){var e=IL.COMPILER_REVISION,r=IL.REVISION_CHANGES[e];return[e,r]},appendToBuffer:function(e,r,n){return Aae.isArray(e)||(e=[e]),e=this.source.wrap(e,r),this.environment.isSimple?["return ",e,";"]:n?["buffer += ",e,";"]:(e.appendToBuffer=!0,e)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(e,r){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",e,",",JSON.stringify(r),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(e,r,n,i){this.environment=e,this.options=r,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!i,this.name=this.environment.name,this.isChild=!!n,this.context=n||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(e,r),this.useDepths=this.useDepths||e.useDepths||e.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||e.useBlockParams;var s=e.opcodes,o=void 0,a=void 0,c=void 0,u=void 0;for(c=0,u=s.length;c<u;c++)o=s[c],this.source.currentLocation=o.loc,a=a||o.loc,this[o.opcode].apply(this,o.args);if(this.source.currentLocation=a,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new Lx.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
71
+ `]),this.decorators.push("return fn;"),i?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
72
+ `),this.decorators.push(`}
73
+ `),this.decorators=this.decorators.merge()));var f=this.createFunctionContext(i);if(this.isChild)return f;var l={compiler:this.compilerInfo(),main:f};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var p=this.context,d=p.programs,h=p.decorators;for(c=0,u=d.length;c<u;c++)d[c]&&(l[c]=d[c],h[c]&&(l[c+"_d"]=h[c],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),i?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),r.srcName?(l=l.toStringWithSourceMap({file:r.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new DL.default(this.options.srcName),this.decorators=new DL.default(this.options.srcName)},createFunctionContext:function(e){var r=this,n="",i=this.stackVars.concat(this.registers.list);i.length>0&&(n+=", "+i.join(", "));var s=0;Object.keys(this.aliases).forEach(function(c){var u=r.aliases[c];u.children&&u.referenceCount>1&&(n+=", alias"+ ++s+"="+c,u.children[0]="alias"+s)}),this.lookupPropertyFunctionIsUsed&&(n+=", "+this.lookupPropertyFunctionVarDeclaration());var o=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&o.push("blockParams"),this.useDepths&&o.push("depths");var a=this.mergeSource(n);return e?(o.push(a),Function.apply(this,o)):this.source.wrap(["function(",o.join(","),`) {
74
+ `,a,"}"])},mergeSource:function(e){var r=this.environment.isSimple,n=!this.forceBuffer,i=void 0,s=void 0,o=void 0,a=void 0;return this.source.each(function(c){c.appendToBuffer?(o?c.prepend(" + "):o=c,a=c):(o&&(s?o.prepend("buffer += "):i=!0,a.add(";"),o=a=void 0),s=!0,r||(n=!1))}),n?o?(o.prepend("return "),a.add(";")):s||this.source.push('return "";'):(e+=", buffer = "+(i?"":this.initializeBuffer()),o?(o.prepend("return buffer + "),a.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(i?"":`;
75
+ `)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`
76
+ lookupProperty = container.lookupProperty || function(parent, propertyName) {
77
+ if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
78
+ return parent[propertyName];
79
+ }
80
+ return undefined
81
+ }
82
+ `.trim()},blockValue:function(e){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(e,0,n);var i=this.popStack();n.splice(1,0,i),this.push(this.source.functionCall(r,"call",n))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var n=this.topStack();r.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(e,"call",r),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,r,n,i){var s=0;!i&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[s++])):this.pushContext(),this.resolvePath("context",e,s,r,n)},lookupBlockParam:function(e,r){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",r,1)},lookupData:function(e,r,n){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,n)},resolvePath:function(e,r,n,i,s){var o=this;if(this.options.strict||this.options.assumeObjects){this.push(Pae(this.options.strict&&s,this,r,n,e));return}for(var a=r.length;n<a;n++)this.replaceStack(function(c){var u=o.nameLookup(c,r[n],e);return i?[" && ",u]:[" != null ? ",u," : ",c]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(e,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof e=="string"?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(e?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e!=null?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},registerDecorator:function(e,r){var n=this.nameLookup("decorators",r,"decorator"),i=this.setupHelperArgs(r,e);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",i])," || fn;"])},invokeHelper:function(e,r,n){var i=this.popStack(),s=this.setupHelper(e,r),o=[];n&&o.push(s.name),o.push(i),this.options.strict||o.push(this.aliasable("container.hooks.helperMissing"));var a=["(",this.itemsSeparatedBy(o,"||"),")"],c=this.source.functionCall(a,"call",s.callParams);this.push(c)},itemsSeparatedBy:function(e,r){var n=[];n.push(e[0]);for(var i=1;i<e.length;i++)n.push(r,e[i]);return n},invokeKnownHelper:function(e,r){var n=this.setupHelper(e,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},invokeAmbiguous:function(e,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var i=this.setupHelper(0,e,r),s=this.lastHelper=this.nameLookup("helpers",e,"helper"),o=["(","(helper = ",s," || ",n,")"];this.options.strict||(o[0]="(helper = ",o.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",o,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},invokePartial:function(e,r,n){var i=[],s=this.setupParams(r,1,i);e&&(r=this.popStack(),delete s.name),n&&(s.indent=JSON.stringify(n)),s.helpers="helpers",s.partials="partials",s.decorators="container.decorators",e?i.unshift(r):i.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(s.depths="depths"),s=this.objectLiteral(s),i.push(s),this.push(this.source.functionCall("container.invokePartial","",i))},assignToHash:function(e){var r=this.popStack(),n=void 0,i=void 0,s=void 0;this.trackIds&&(s=this.popStack()),this.stringParams&&(i=this.popStack(),n=this.popStack());var o=this.hash;n&&(o.contexts[e]=n),i&&(o.types[e]=i),s&&(o.ids[e]=s),o.values[e]=r},pushId:function(e,r,n){e==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):e==="PathExpression"?this.pushString(r):e==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:Ap,compileChildren:function(e,r){for(var n=e.children,i=void 0,s=void 0,o=0,a=n.length;o<a;o++){i=n[o],s=new this.compiler;var c=this.matchExistingProgram(i);if(c==null){this.context.programs.push("");var u=this.context.programs.length;i.index=u,i.name="program"+u,this.context.programs[u]=s.compile(i,r,this.context,!this.precompile),this.context.decorators[u]=s.decorators,this.context.environments[u]=i,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams}else i.index=c.index,i.name="program"+c.index,this.useDepths=this.useDepths||c.useDepths,this.useBlockParams=this.useBlockParams||c.useBlockParams}},matchExistingProgram:function(e){for(var r=0,n=this.context.environments.length;r<n;r++){var i=this.context.environments[r];if(i&&i.equals(e))return i}},programExpression:function(e){var r=this.environment.children[e],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof wp||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new wp(e))},pushSource:function(e){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),e&&this.source.push(e)},replaceStack:function(e){var r=["("],n=void 0,i=void 0,s=void 0;if(!this.isInline())throw new Lx.default("replaceStack on non-inline");var o=this.popStack(!0);if(o instanceof wp)n=[o.value],r=["(",n],s=!0;else{i=!0;var a=this.incrStack();r=["((",this.push(a)," = ",o,")"],n=this.topStack()}var c=e.call(this,n);s||this.popStack(),i&&this.stackSlot--,this.push(r.concat(c,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var r=0,n=e.length;r<n;r++){var i=e[r];if(i instanceof wp)this.compileStack.push(i);else{var s=this.incrStack();this.pushSource([s," = ",i,";"]),this.compileStack.push(s)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var r=this.isInline(),n=(r?this.inlineStack:this.compileStack).pop();if(!e&&n instanceof wp)return n.value;if(!r){if(!this.stackSlot)throw new Lx.default("Invalid stack pop");this.stackSlot--}return n},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,r=e[e.length-1];return r instanceof wp?r.value:r},contextName:function(e){return this.useDepths&&e?"depths["+e+"]":"depth"+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var r=this.aliases[e];return r?(r.referenceCount++,r):(r=this.aliases[e]=this.source.wrap(e),r.aliasable=!0,r.referenceCount=1,r)},setupHelper:function(e,r,n){var i=[],s=this.setupHelperArgs(r,e,i,n),o=this.nameLookup("helpers",r,"helper"),a=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:i,paramsInit:s,name:o,callParams:[a].concat(i)}},setupParams:function(e,r,n){var i={},s=[],o=[],a=[],c=!n,u=void 0;c&&(n=[]),i.name=this.quotedString(e),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var f=this.popStack(),l=this.popStack();(l||f)&&(i.fn=l||"container.noop",i.inverse=f||"container.noop");for(var p=r;p--;)u=this.popStack(),n[p]=u,this.trackIds&&(a[p]=this.popStack()),this.stringParams&&(o[p]=this.popStack(),s[p]=this.popStack());return c&&(i.args=this.source.generateArray(n)),this.trackIds&&(i.ids=this.source.generateArray(a)),this.stringParams&&(i.types=this.source.generateArray(o),i.contexts=this.source.generateArray(s)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},setupHelperArgs:function(e,r,n,i){var s=this.setupParams(e,r,n);return s.loc=JSON.stringify(this.source.currentLocation),s=this.objectLiteral(s),i?(this.useRegister("options"),n.push("options"),["options=",s]):n?(n.push(s),""):s}};(function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=Ap.RESERVED_WORDS={},r=0,n=t.length;r<n;r++)e[t[r]]=!0})();Ap.isValidJavaScriptVariableName=function(t){return!Ap.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)};function Pae(t,e,r,n,i){var s=e.popStack(),o=r.length;for(t&&o--;n<o;n++)s=e.nameLookup(s,r[n],i);return t?[e.aliasable("container.strict"),"(",s,", ",e.quotedString(r[n]),", ",JSON.stringify(e.source.currentLocation)," )"]:s}F4.default=Ap;$L.exports=F4.default});var jL=q((V4,VL)=>{"use strict";V4.__esModule=!0;function Y1(t){return t&&t.__esModule?t:{default:t}}var Nae=UD(),Oae=Y1(Nae),Iae=dx(),Dae=Y1(Iae),$x=eL(),Mx=iL(),Lae=ML(),$ae=Y1(Lae),Mae=R4(),Fae=Y1(Mae),Vae=cx(),jae=Y1(Vae),Uae=Oae.default.create;function FL(){var t=Uae();return t.compile=function(e,r){return Mx.compile(e,r,t)},t.precompile=function(e,r){return Mx.precompile(e,r,t)},t.AST=Dae.default,t.Compiler=Mx.Compiler,t.JavaScriptCompiler=$ae.default,t.Parser=$x.parser,t.parse=$x.parse,t.parseWithoutProcessing=$x.parseWithoutProcessing,t}var Rp=FL();Rp.create=FL;jae.default(Rp);Rp.Visitor=Fae.default;Rp.default=Rp;V4.default=Rp;VL.exports=V4.default});var UL=q(j4=>{"use strict";j4.__esModule=!0;j4.print=zae;j4.PrintVisitor=Qr;function qae(t){return t&&t.__esModule?t:{default:t}}var Bae=R4(),Hae=qae(Bae);function zae(t){return new Qr().accept(t)}function Qr(){this.padding=0}Qr.prototype=new Hae.default;Qr.prototype.pad=function(t){for(var e="",r=0,n=this.padding;r<n;r++)e+=" ";return e+=t+`
83
+ `,e};Qr.prototype.Program=function(t){var e="",r=t.body,n=void 0,i=void 0;if(t.blockParams){var s="BLOCK PARAMS: [";for(n=0,i=t.blockParams.length;n<i;n++)s+=" "+t.blockParams[n];s+=" ]",e+=this.pad(s)}for(n=0,i=r.length;n<i;n++)e+=this.accept(r[n]);return this.padding--,e};Qr.prototype.MustacheStatement=function(t){return this.pad("{{ "+this.SubExpression(t)+" }}")};Qr.prototype.Decorator=function(t){return this.pad("{{ DIRECTIVE "+this.SubExpression(t)+" }}")};Qr.prototype.BlockStatement=Qr.prototype.DecoratorBlock=function(t){var e="";return e+=this.pad((t.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.SubExpression(t)),t.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--),t.inverse&&(t.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(t.inverse),this.padding--,t.program&&this.padding--),this.padding--,e};Qr.prototype.PartialStatement=function(t){var e="PARTIAL:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),this.pad("{{> "+e+" }}")};Qr.prototype.PartialBlockStatement=function(t){var e="PARTIAL BLOCK:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--,this.pad("{{> "+e+" }}")};Qr.prototype.ContentStatement=function(t){return this.pad("CONTENT[ '"+t.value+"' ]")};Qr.prototype.CommentStatement=function(t){return this.pad("{{! '"+t.value+"' }}")};Qr.prototype.SubExpression=function(t){for(var e=t.params,r=[],n=void 0,i=0,s=e.length;i<s;i++)r.push(this.accept(e[i]));return e="["+r.join(", ")+"]",n=t.hash?" "+this.accept(t.hash):"",this.accept(t.path)+" "+e+n};Qr.prototype.PathExpression=function(t){var e=t.parts.join("/");return(t.data?"@":"")+"PATH:"+e};Qr.prototype.StringLiteral=function(t){return'"'+t.value+'"'};Qr.prototype.NumberLiteral=function(t){return"NUMBER{"+t.value+"}"};Qr.prototype.BooleanLiteral=function(t){return"BOOLEAN{"+t.value+"}"};Qr.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Qr.prototype.NullLiteral=function(){return"NULL"};Qr.prototype.Hash=function(t){for(var e=t.pairs,r=[],n=0,i=e.length;n<i;n++)r.push(this.accept(e[n]));return"HASH{"+r.join(", ")+"}"};Qr.prototype.HashPair=function(t){return t.key+"="+this.accept(t.value)}});var zL=q((w$e,HL)=>{var U4=jL().default,BL=UL();U4.PrintVisitor=BL.PrintVisitor;U4.print=BL.print;HL.exports=U4;function qL(t,e){var r=require("fs"),n=r.readFileSync(e,"utf8");t.exports=U4.compile(n)}typeof require!="undefined"&&require.extensions&&(require.extensions[".handlebars"]=qL,require.extensions[".hbs"]=qL)});var TM=q(Al=>{"use strict";function $ue(t,e){return t.endsWith(e)?t.length===e.length||t[t.length-e.length-1]===".":!1}function Mue(t,e){let r=t.length-e.length-2,n=t.lastIndexOf(".",r);return n===-1?t:t.slice(n+1)}function Fue(t,e,r){if(r.validHosts!==null){let i=r.validHosts;for(let s of i)if($ue(e,s))return s}let n=0;if(e.startsWith("."))for(;n<e.length&&e[n]===".";)n+=1;return t.length===e.length-n?null:Mue(e,t)}function Vue(t,e){return t.slice(0,-e.length-1)}function xM(t,e){let r=0,n=t.length,i=!1;if(!e){if(t.startsWith("data:"))return null;for(;r<t.length&&t.charCodeAt(r)<=32;)r+=1;for(;n>r+1&&t.charCodeAt(n-1)<=32;)n-=1;if(t.charCodeAt(r)===47&&t.charCodeAt(r+1)===47)r+=2;else{let u=t.indexOf(":/",r);if(u!==-1){let f=u-r,l=t.charCodeAt(r),p=t.charCodeAt(r+1),d=t.charCodeAt(r+2),h=t.charCodeAt(r+3),g=t.charCodeAt(r+4);if(!(f===5&&l===104&&p===116&&d===116&&h===112&&g===115)){if(!(f===4&&l===104&&p===116&&d===116&&h===112)){if(!(f===3&&l===119&&p===115&&d===115)){if(!(f===2&&l===119&&p===115))for(let v=r;v<u;v+=1){let b=t.charCodeAt(v)|32;if(!(b>=97&&b<=122||b>=48&&b<=57||b===46||b===45||b===43))return null}}}}for(r=u+2;t.charCodeAt(r)===47;)r+=1}}let o=-1,a=-1,c=-1;for(let u=r;u<n;u+=1){let f=t.charCodeAt(u);if(f===35||f===47||f===63){n=u;break}else f===64?o=u:f===93?a=u:f===58?c=u:f>=65&&f<=90&&(i=!0)}if(o!==-1&&o>r&&o<n&&(r=o+1),t.charCodeAt(r)===91)return a!==-1?t.slice(r+1,a).toLowerCase():null;c!==-1&&c>r&&c<n&&(n=c)}for(;n>r+1&&t.charCodeAt(n-1)===46;)n-=1;let s=r!==0||n!==t.length?t.slice(r,n):t;return i?s.toLowerCase():s}function jue(t){if(t.length<7||t.length>15)return!1;let e=0;for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n===46)e+=1;else if(n<48||n>57)return!1}return e===3&&t.charCodeAt(0)!==46&&t.charCodeAt(t.length-1)!==46}function Uue(t){if(t.length<3)return!1;let e=t.startsWith("[")?1:0,r=t.length;if(t[r-1]==="]"&&(r-=1),r-e>39)return!1;let n=!1;for(;e<r;e+=1){let i=t.charCodeAt(e);if(i===58)n=!0;else if(!(i>=48&&i<=57||i>=97&&i<=102||i>=65&&i<=90))return!1}return n}function que(t){return Uue(t)||jue(t)}function _M(t){return t>=97&&t<=122||t>=48&&t<=57||t>127}function bM(t){if(t.length>255||t.length===0||!_M(t.charCodeAt(0))&&t.charCodeAt(0)!==46&&t.charCodeAt(0)!==95)return!1;let e=-1,r=-1,n=t.length;for(let i=0;i<n;i+=1){let s=t.charCodeAt(i);if(s===46){if(i-e>64||r===46||r===45||r===95)return!1;e=i}else if(!(_M(s)||s===45||s===95))return!1;r=s}return n-e-1<=63&&r!==45}function SM({allowIcannDomains:t=!0,allowPrivateDomains:e=!1,detectIp:r=!0,extractHostname:n=!0,mixedInputs:i=!0,validHosts:s=null,validateHostname:o=!0}){return{allowIcannDomains:t,allowPrivateDomains:e,detectIp:r,extractHostname:n,mixedInputs:i,validHosts:s,validateHostname:o}}var Bue=SM({});function Hue(t){return t===void 0?Bue:SM(t)}function zue(t,e){return e.length===t.length?"":t.slice(0,-e.length-1)}function EM(){return{domain:null,domainWithoutSuffix:null,hostname:null,isIcann:null,isIp:null,isPrivate:null,publicSuffix:null,subdomain:null}}function sg(t){t.domain=null,t.domainWithoutSuffix=null,t.hostname=null,t.isIcann=null,t.isIp=null,t.isPrivate=null,t.publicSuffix=null,t.subdomain=null}function Fp(t,e,r,n,i){let s=Hue(n);return typeof t!="string"||(s.extractHostname?s.mixedInputs?i.hostname=xM(t,bM(t)):i.hostname=xM(t,!1):i.hostname=t,s.detectIp&&i.hostname!==null&&(i.isIp=que(i.hostname),i.isIp))?i:s.validateHostname&&s.extractHostname&&i.hostname!==null&&!bM(i.hostname)?(i.hostname=null,i):(e===0||i.hostname===null||(r(i.hostname,s,i),e===2||i.publicSuffix===null)||(i.domain=Fue(i.publicSuffix,i.hostname,s),e===3||i.domain===null)||(i.subdomain=zue(i.hostname,i.domain),e===4)||(i.domainWithoutSuffix=Vue(i.domain,i.publicSuffix)),i)}function Wue(t,e,r){if(!e.allowPrivateDomains&&t.length>3){let n=t.length-1,i=t.charCodeAt(n),s=t.charCodeAt(n-1),o=t.charCodeAt(n-2),a=t.charCodeAt(n-3);if(i===109&&s===111&&o===99&&a===46)return r.isIcann=!0,r.isPrivate=!1,r.publicSuffix="com",!0;if(i===103&&s===114&&o===111&&a===46)return r.isIcann=!0,r.isPrivate=!1,r.publicSuffix="org",!0;if(i===117&&s===100&&o===101&&a===46)return r.isIcann=!0,r.isPrivate=!1,r.publicSuffix="edu",!0;if(i===118&&s===111&&o===103&&a===46)return r.isIcann=!0,r.isPrivate=!1,r.publicSuffix="gov",!0;if(i===116&&s===101&&o===110&&a===46)return r.isIcann=!0,r.isPrivate=!1,r.publicSuffix="net",!0;if(i===101&&s===100&&o===46)return r.isIcann=!0,r.isPrivate=!1,r.publicSuffix="de",!0}return!1}var kn=new Uint32Array([6,0,0,9,5860739,5860978,5861026,5861029,5861126,5861352,5861357,5861403,5861586,0,0,0,1,1850179732,0,9,328184559,1866923597,2123501943,2282562397,2795346450,3130446446,3136607046,3453334789,4194175729,72,3156266,19510334,20989895,64887183,65021741,101876503,177080427,179500755,311298055,425802535,460682395,582839475,819014943,819028732,922117623,1075688039,1139486022,1156921983,1179004234,1241916785,1329165410,1335010188,1370787547,1370800824,1431231509,1498275876,1516508161,1522025464,1544104458,1554032448,1554653742,1570707647,1626814538,1675555530,1679919230,1692185483,1730108052,1789539963,1873769763,1881070667,1890696062,1893848785,1927992574,2001752368,2182413090,2391299855,2419619562,2445171142,2453492351,2496327381,2525245455,2573179642,2703420555,2709520566,2800127296,2921343336,2989808530,3000405309,3015527775,3047607849,3160720065,3382460164,3461355676,3498015045,3688442504,3738715095,3843717774,3934774481,4033285539,4085096371,4146774829,4208486561,3739,100835,372942,373596,399643,403867,589540,737224,1210028,1861414,2424682,2658901,2946999,3329363,3333156,6942202,9086062,9095117,9267209,9340158,9485932,11010102,11406846,16314893,17546564,18146303,18331450,19211200,20314441,20797457,25057869,26663359,28320278,30499151,30585840,36605120,36775470,36775473,36990037,39275208,41892561,42049478,42538024,45214788,47656662,50173535,53599326,53858455,54537430,63815836,69971116,73517283,73904368,75706244,78793775,78794171,79558910,80324123,84993902,87977581,87978853,87978860,93811268,95641381,95641777,96671837,100511481,100947456,108215410,108929491,110526112,110662188,112311307,114507832,116811054,120488259,122521550,133427701,134012911,141513861,141517490,144349377,144362028,144550088,144770230,147205859,147810002,147989623,149598895,150736276,150856054,152379730,156555774,164189124,164189258,164189262,164189691,164189842,164560958,165069166,165106627,165107021,165339368,165444557,165444558,165444615,165444629,165444745,165444749,165445368,165512129,165512527,165749053,165749188,165749299,165749435,165749535,165779060,167155067,169909265,169909275,169909419,169909512,169909517,169909531,169909608,169909724,169909733,169909734,169909738,169909857,169910036,169910195,169910226,169939304,169977029,169977163,170281136,170281250,170281253,170281258,170281275,170281382,170281390,170281415,170281447,170281457,170281473,170281497,170281511,170281522,170281525,170281528,170281579,170281589,170281687,170281689,170281699,170281742,170281776,170281812,170281852,170281902,170281972,170311352,170649202,170649385,170649596,171188220,172078401,172145927,172213761,172213835,172214443,172484301,172788260,172788319,172788689,172788693,172788754,172788809,172788827,173118530,173118924,173253960,173254504,173456648,173591948,173930212,173930286,174129293,174306499,174306893,174307245,174307439,174358551,174374100,174407806,174410098,174488250,174509317,174577099,174606766,174644617,174843632,174844030,174847160,175181758,175524135,175524873,176843304,176948764,178529610,178530165,178530256,178530299,178530303,178530355,178868363,178868576,178868974,179274397,179274476,179379459,179379616,179379849,179379853,179380220,179657877,179692651,179714168,179913714,180090112,180090244,180090304,180090314,180090337,180090372,180090450,180090510,180090525,180090526,180090587,180090702,180091049,180091118,180091210,180091228,180091258,180091259,180283722,180292996,180293014,180293036,180293067,180293093,180293105,180293124,180293152,180293156,180293169,180293179,180293199,180293253,180293290,180293294,180293300,180293302,180293304,180293317,180293344,180293346,180293381,180293447,180293487,180293501,180293503,180293522,180293535,180293716,180293796,180293819,180293997,180294e3,180294004,180294009,180428032,180902137,180969265,180969566,180969653,180969723,181105061,181105190,181105676,181240259,181240353,181240367,181240371,181240391,181240392,181240393,181240398,181240404,181240451,181240474,181240479,181240483,181240490,181240509,181240515,181240844,181240853,181240956,181241149,181241165,181241168,181244839,181278273,181375748,181548621,181548644,181548727,181548873,181549108,181549176,181949900,181950639,182056031,182385920,182419943,182893167,182893283,182893394,182893788,183163149,183163151,183163155,183163168,183163169,183163171,183163181,183163182,183163183,183163186,183163188,183163233,183163248,183163251,183163252,183163254,183163270,183163303,183163314,183163317,183163334,183163335,183163336,183163340,183163345,183163347,183163350,183163362,183163363,183163365,183163366,183163367,183163371,183163375,183163376,183163378,183163380,183163383,183163630,183163631,183163644,183163649,183163651,183163653,183163655,183163664,183163668,183163669,183163678,183163679,183163682,183163687,183163713,183163715,183163728,183163731,183163735,183163742,183163777,183163779,183163780,183163781,183163783,183163796,183163797,183163801,183163843,183163845,183163847,183163859,183163864,183163865,183163874,183163895,183163897,183163913,183163922,183163933,183163960,183163961,183163963,183163977,183163978,183163979,183163981,183163988,183163989,183163991,183163992,183163994,183163995,183163998,183164008,183164010,183164012,183164021,183164025,183164026,183164027,183164029,183164041,183164044,183164045,183164047,183164050,183164051,183164057,183164060,183164061,183164093,184080938,184081253,184081673,184081677,184081778,184246330,184246511,184486318,184486865,184487263,184828195,184828212,184844696,184844824,184848486,184848491,184849029,184849387,184859173,184869208,184869819,184994607,185163947,185216284,185289081,185292632,185295605,185501943,185502073,185502077,185772974,186723357,186723671,186723801,186753074,186763265,186771866,186840059,186858006,186875993,186950941,186953244,186994101,186994720,187011432,187022814,187064894,187067400,187076090,187078647,187088813,187161171,187188812,187203075,187219343,187222314,187251332,187328908,187332203,187378741,187385256,187386889,187403121,187403860,187404132,187409119,187410536,187415116,187415841,187417183,187453423,187455618,187483569,187506658,187521457,187531575,187554851,187557872,187932036,187932044,187932595,187932730,187932752,187932756,187932794,187932985,187932989,189797875,189851312,190236828,190304994,190305388,190575460,190575594,190879986,190880380,191458643,191459037,193856736,193857103,193857114,193857243,193991787,194363750,194498585,194498630,194498988,194499056,194499063,194532263,194532626,194532630,194532693,194532760,194532936,194533115,194802308,194802313,194802316,194802351,194802671,194802818,194802832,194802974,194803141,194803143,194803161,194803162,194803220,194803226,194803230,194803290,194836546,194870589,194870610,194871004,195040013,195040230,195040360,195077902,195078025,195078028,195078034,195078035,195078038,195078058,195078062,195078071,195078081,195078095,195078112,195078119,195078120,195078149,195078150,195078156,195078185,195078215,195078217,195078250,195078251,195078272,195078273,195078277,195078283,195078287,195078298,195078299,195078300,195078368,195078372,195078375,195078394,195078464,195078474,195078493,195078531,195078554,195078559,195078687,195078710,195078753,195078828,195078837,195078892,195078895,195078900,195078906,195078959,195078960,195078974,195078995,195078997,195079007,195145607,195146051,195817892,195817910,195818040,196653590,197775763,198219289,198248729,198354195,198354632,200387773,202063369,203326381,203326382,203326695,203326709,203326825,203326829,203327047,203327192,203360584,203427712,203428110,203563443,203563837,203664976,203665374,203762913,203901612,203969343,204069808,204070876,206121592,207568995,208227118,218659706,219797064,231775478,232791016,232866163,232870916,237059472,238230825,238671321,241611072,245880244,249954601,256262487,257210252,257542887,259829097,260353797,260353928,260353938,260354380,260381156,260390354,271387034,274691435,279382168,280527902,280532777,280535076,280542659,281931451,292827804,295209043,296292341,297619746,305011770,306510696,313583e3,314643431,320313766,320318114,321023689,321141002,321447655,325454853,326762411,337081594,338040061,339830659,340010259,341833935,342149828,342665371,356194258,359223603,359276554,360327984,368215882,370146306,370150662,373255328,373394720,374785091,376173808,377307531,377336144,377652210,381874529,381884647,382049883,382486912,382598847,389909922,392084057,393290800,395076177,395140257,402724451,403769719,404122044,410188633,413977571,418962805,419080649,423458772,430711818,430784915,431116435,431157415,431370962,431390595,431489022,431585240,431586828,431608121,433686700,442888655,442922019,445176561,449218512,449424719,451217894,451870618,459172225,459395692,464626711,464765206,464834904,469098393,471052880,478642118,480635114,480636362,480638119,480638181,480638612,480653244,480658155,480658807,484603510,484645735,486805732,490264076,490274093,493445761,511578298,513731936,514111995,514955151,515474792,515491843,515593995,518161197,520595267,522631343,523234636,525872321,527144416,531170133,531427447,533682535,533847771,534396735,545433338,547443445,550462929,551440509,557981738,559064708,560636591,572640614,572652435,572800203,572833146,572867160,575127842,575742406,575835832,576106402,576590271,577168455,582462766,583917065,583936789,584490345,587768078,588145733,596395114,596517435,602054693,609523853,627471386,630686153,632559259,635121653,635859009,637007260,641121432,643488605,643663853,648304671,650538190,656171171,656243914,656640963,665693626,667797222,678076451,684522993,684536293,689172736,689202009,693611235,694324728,695649196,703142796,706540885,707132367,715533184,722903474,725879070,728415570,731964179,733989474,744440632,745674128,752520493,752687122,752687226,752699150,752938578,753314817,762792020,766278458,771168358,772916985,785945688,787032422,793080342,794341423,794638681,799598398,803443550,803504423,803576910,803750530,804899040,810638083,813049915,813882670,813882809,821390609,822184173,824372117,826639012,826993974,827624512,831815016,834750300,834856638,834963202,835666250,838463501,843454848,845393562,845537310,846032279,853098265,855980394,858467853,869651422,878524814,881613818,885943745,896206971,896253025,900375831,900562876,904696072,907903147,911040096,912288153,912452591,913046780,914761571,915088911,915769822,915838470,919008564,919376364,928343570,933141848,935240483,936096500,939243980,939281294,939375524,939697158,939922440,940027871,942743627,943328481,943363810,947022624,950098348,954017396,958817278,959069811,961909457,961915153,962363178,962549619,962816118,963013768,968961134,973306633,973587946,973591516,973595243,973613934,973618563,976871270,977251657,983929219,983931665,983936021,984542401,985854160,994961720,1002154839,1005485664,1005660307,1005931709,1008280710,1009678005,1015938248,1018008327,1024510565,1027688850,1033879086,1034357170,1038843968,1039500800,1043537387,1043742405,1044060157,1045601283,1046273911,1046743273,1046756254,1048099261,1052311686,1052441930,1052883806,1055187548,1056740120,1058016469,1059921109,1068743400,1072264613,1080832696,1083646554,1084662717,1086818213,1087030220,1088313455,1101657937,1101658065,1102136407,1102691201,1104888372,1107574816,1107604513,1107608406,1115517588,1116603570,1116886791,1121068214,1121069468,1123274870,1123277038,1123281470,1123286137,1123290290,1123300855,1135543458,1135544712,1135545955,1135553917,1135559494,1135563376,1141006631,1141018311,1142918810,1143019669,1145288372,1146787097,1149112251,1151589762,1152383075,1153556935,1153560693,1153560855,1153576209,1153582928,1155609853,1158010336,1158014282,1158019276,1158022529,1158025585,1158030151,1158040127,1158040853,1158043091,1160141196,1160246728,1160253683,1160271099,1160271446,1160272445,1160277399,1161223806,1161235355,1162489113,1166908086,1166937977,1166949933,1166952503,1166953757,1166959964,1169030529,1169037994,1169039382,1169046802,1169046815,1169048548,1169054036,1169994302,1171270813,1172775704,1174752677,1174762471,1175721241,1175725254,1175726508,1175727467,1175727495,1175735444,1175735449,1175736592,1175738385,1175738578,1175738760,1175746250,1175746252,1175749986,1175793566,1181427747,1181429001,1181435208,1181446765,1181453654,1181460959,1185692184,1189090107,1193567716,1194400508,1204258276,1204470469,1207765705,1207825797,1208230324,1208517393,1208911775,1211364607,1212671635,1214258492,1217924538,1220965831,1229000062,1229783327,1232816452,1237771172,1237773393,1237773841,1245899123,1247245722,1257366451,1260762188,1261854970,1265324777,1265669119,1273073240,1280280379,1280768035,1291368159,1295085673,1296518360,1297048848,1300364681,1303650868,1304687455,1304781392,1304918086,1305056028,1306968125,1306972554,1306973586,1307665177,1308558601,1308559744,1308574194,1308583254,1308584508,1308585495,1310785148,1310799239,1310800921,1310801269,1310803416,1310807041,1310808370,1311349087,1313021694,1313023237,1313031514,1313033243,1313033533,1314270973,1314287001,1314293208,1321085506,1324313259,1324313985,1324320704,1324322270,1324332261,1324636022,1325293061,1325300526,1325303158,1325308368,1325309334,1325309339,1325310241,1325310486,1325311328,1325311482,1326707500,1327036152,1327646591,1328209699,1328777903,1328778629,1328785348,1328786906,1328789635,1328794451,1328797153,1329963165,1329987910,1330666198,1330807345,1330903052,1331009222,1331010221,1331013633,1331015175,1331019352,1331025251,1331026645,1331028446,1331143849,1335892543,1336436046,1336436772,1336437775,1336438057,1336439236,1336443338,1336449024,1336456660,1336460266,1336462620,1336463768,1336469142,1341018428,1341081128,1341091249,1341179896,1342001696,1344411053,1344426134,1344436952,1344437939,1344444146,1346529166,1349466130,1350170659,1350170661,1350356518,1350356534,1350620578,1351056251,1351154191,1351382419,1351445663,1354447091,1354448055,1354464484,1354467042,1354475004,1354584300,1355466970,1355483586,1355607656,1355929695,1355947655,1356150953,1356150969,1356150973,1356457867,1356471002,1356757572,1357240883,1357692080,1357876668,1357880232,1360043731,1360220638,1362168625,1362262729,1362271868,1362285703,1362326863,1362506071,1362656266,1365811994,1367692098,1367811071,1368820926,1369663049,1377739598,1378565283,1379014609,1383613953,1383613964,1383629111,1383647122,1385857457,1385879444,1388074128,1388078600,1388084119,1388086017,1388094003,1388104573,1388109527,1388111766,1390304957,1390318095,1390319238,1390327192,1390328435,1390329689,1391292472,1391295130,1391298115,1391299402,1391302044,1391307254,1391308253,1392560940,1396553940,1397006395,1397007527,1397007872,1397007885,1397015305,1397016949,1397022431,1400354688,1400355947,1400356673,1400364702,1400366245,1401334766,1401741660,1407044461,1407049415,1407053336,1407060753,1407067683,1409840426,1410939834,1414623055,1417953492,1417953925,1417969521,1417971248,1418042854,1418666866,1422407147,1422418384,1422432926,1422433613,1422434165,1422435892,1423090882,1425971467,1426162994,1426865884,1426871783,1426872814,1426880658,1426881913,1426884152,1428612014,1429098926,1429105132,1429112250,1430623854,1433558874,1433568865,1433577620,1433578879,1435862377,1444705448,1444706435,1444707945,1444708598,1444713016,1444718265,1444720166,1444723003,1444725453,1444731199,1444731564,1444731950,1444732047,1444732342,1444732347,1444738453,1448052138,1448052864,1448054123,1448067662,1448078965,1449172589,1452091461,1453961462,1457037634,1457145422,1457156469,1457178704,1459376581,1459377857,1459377868,1459384567,1459385707,1459403577,1459405260,1459408531,1463053013,1463840740,1463842504,1463849459,1463849797,1463867222,1463868221,1463873175,1464819582,1464821125,1464829402,1464830128,1464831131,1465838987,1466068861,1466074694,1466091096,1466403701,1467047928,1467061763,1467063453,1467065948,1467070902,1468307140,1468314970,1468321435,1469284474,1469285761,1469294772,1469295775,1471526086,1474720970,1474751199,1474796155,1474852365,1474856386,1474857640,1474858627,1474866589,1474867476,1474871748,1474880870,1482183211,1482187228,1482389973,1486003341,1486005836,1486010790,1486021608,1486029338,1486036499,1486036510,1491300687,1492905126,1495099017,1496999162,1497335658,1497338257,1497341434,1497353781,1497360500,1497361503,1503214457,1504022303,1504024292,1504032122,1504033105,1504038587,1509379857,1510741574,1514359714,1514604870,1517410020,1517415502,1517416485,1517424315,1517426048,1519466742,1519486936,1521633706,1524564715,1526518672,1534242148,1535379077,1535411685,1535411852,1535411990,1535416896,1535416972,1535417153,1535418201,1535418206,1535418272,1535418759,1535418771,1535419013,1535419392,1535420502,1535420894,1535421252,1535425151,1535426337,1535426473,1535426999,1535427585,1535429447,1535430154,1535430405,1535437817,1535440501,1535442771,1535444522,1535444884,1535444944,1535445002,1535445010,1535446558,1535446757,1535447196,1535447220,1538631370,1539876488,1539883905,1539891891,1539902461,1539907415,1539909654,1540853566,1540863813,1540865371,1540871834,1540872816,1540972285,1544565822,1547523228,1548000883,1548203684,1548662272,1548668010,1548668993,1548676831,1548677846,1548686756,1550655859,1551291701,1552780862,1554083280,1554160502,1556617220,1556618479,1556619205,1556627226,1556629025,1571587981,1572843623,1577978899,1578737375,1579027766,1580891870,1580902117,1580903020,1580910138,1580910864,1580912123,1580922741,1581061599,1584242651,1584252576,1584258687,1584260414,1584261397,1594150134,1594318433,1594644051,1595762332,1596503336,1599871881,1600554193,1600562964,1600967980,1600968967,1600970477,1600988233,1600993979,1600994866,1600997301,1601541268,1602995891,1603061457,1604314670,1604316655,1604330442,1604341489,1604342648,1605183784,1605406132,1605908391,1607689728,1607689741,1607690628,1607701062,1607701276,1607705078,1607710365,1607715640,1607716607,1607716627,1608344260,1610313759,1610666926,1611239998,1611396088,1614382839,1614530679,1615167003,1615172374,1615640392,1615647347,1615658840,1615665110,1615666109,1615671063,1620094847,1620095619,1620095929,1620105028,1620113841,1620119323,1620795340,1621082362,1621083649,1621092660,1622329964,1622331641,1622337218,1622353628,1623408910,1624559739,1624569664,1624577502,1624577906,1624578485,1626556599,1628470609,1630022199,1632310642,1633163415,1635568907,1635591150,1635593749,1635643420,1635994183,1635994320,1641006393,1645672758,1645785364,1645803376,1645808858,1645809841,1646891621,1646892908,1646907799,1646910247,1646917618,1646918617,1648006829,1648007716,1648013185,1648013984,1648016015,1648021910,1648025704,1648032728,1648033439,1648033715,1648035901,1648039922,1648043240,1649454738,1649581121,1652486802,1652497372,1652504566,1652932064,1652936599,1653583645,1653598182,1653599929,1653606136,1653607123,1654697756,1654712103,1654713134,1654716280,1654721234,1654722233,1656168200,1659162648,1659176739,1659180924,1659185878,1659186877,1659695250,1660874915,1664393911,1666510724,1668155429,1669474757,1673661122,1673662353,1673671436,1673686839,1673856704,1674136053,1674769898,1674770881,1674776363,1674793871,1675780006,1676641114,1677004461,1677008482,1677010668,1677010688,1677011655,1677022217,1677030942,1677037554,1679194024,1679234542,1679234666,1679237897,1679241007,1679252114,1679258763,1679261552,1679266928,1681499983,1681500998,1681504918,1681509234,1681510306,1681510964,1681520272,1681524681,1681526010,1681526993,1682221833,1682359277,1685960411,1685962398,1685964612,1685965520,1685965569,1685965582,1685965890,1685967499,1685968865,1685974082,1685987547,1685988215,1685988552,1685991645,1686112357,1686592668,1686670946,1687209729,1687209740,1687216901,1687224887,1687235705,1687240659,1687242898,1690419670,1690419852,1690423356,1690429255,1690430286,1690438386,1690439385,1690439477,1691674376,1691689779,1691700349,1691705303,1691707542,1691739899,1692242488,1693900733,1693913871,1693915014,1693915019,1693922968,1693924211,1693925465,1696137279,1696148081,1696153563,1696514991,1697110779,1697112784,1697112842,1697116346,1697119048,1697126337,1697127463,1697127903,1697134366,1697135348,1699859798,1705948764,1706596362,1707661217,1709380801,1709397036,1709401602,1709403991,1709403994,1709715630,1709719753,1710553669,1710842194,1711349139,1711911296,1712862856,1712864099,1712865353,1712874413,1712889750,1715042583,1716067791,1716074254,1716075236,1716090026,1716093784,1716101073,1716987897,1717046504,1717344945,1717458342,1717567159,1717665490,1720424110,1720435157,1720448732,1720448944,1720449947,1720450929,1722611952,1723770733,1723771620,1723777366,1723796376,1723797619,1723869014,1724144999,1724360630,1724887843,1724888746,1724891334,1724900049,1724902970,1724913588,1724914591,1724915573,1727744610,1733044570,1737465416,1740104597,1740108386,1741479646,1741618915,1741621154,1741622153,1741631292,1741636935,1741709977,1742216984,1743089654,1744959211,1744968590,1744969829,1744971556,1744977659,1744987840,1745343269,1745488513,1746392299,1747200908,1747202151,1747210105,1747211248,1747212978,1747215938,1747219291,1747533677,1747671543,1747762259,1748301224,1748301648,1748302211,1748318651,1748321229,1748327140,1748327340,1748328118,1748329946,1749416322,1749419816,1749422630,1749422974,1749423815,1749423848,1749423862,1749423980,1749432545,1749435316,1749435457,1749435956,1749437829,1749437986,1749440303,1749441388,1749442296,1749442361,1749443256,1749443576,1749444398,1749445477,1749445739,1749750164,1749955965,1752768365,1753028168,1753430927,1753880966,1753882221,1753900232,1753906931,1756680747,1759105063,1762715404,1763952265,1763967858,1763978172,1763979159,1765274516,1768132013,1774870841,1775278057,1776446407,1778765218,1779479261,1779706923,1779707649,1779709525,1779713177,1779714057,1779714368,1779715934,1779715971,1779725925,1779730307,1779731494,1780768183,1781938118,1781938242,1781939241,1781948380,1781954023,1781961852,1781965719,1783657515,1785147288,1785152492,1785564290,1786402886,1786403885,1786408839,1786413016,1786418915,1786422601,1793085197,1793091404,1793103209,1793109842,1794311882,1796513490,1798682988,1799934413,1800873944,1804734874,1804986274,1805201900,1805201909,1805381533,1805390218,1805394927,1805396070,1805397817,1805404024,1805410294,1808346875,1809278593,1809846425,1809852765,1809854826,1809860706,1809868668,1809869655,1809909084,1810126394,1810162729,1811189710,1812804641,1813167465,1818860644,1819164253,1824377544,1826567786,1826567942,1826568769,1826574251,1826586852,1826591759,1826593533,1826594804,1826595685,1826597041,1826838298,1830073720,1832102940,1835526804,1835527882,1835530317,1835531888,1835536950,1835540435,1835541852,1835548479,1835548755,1835552425,1835554706,1835556216,1836706536,1838062951,1839007628,1839021100,1839022775,1839033593,1839038547,1839040786,1839994953,1840001842,1840013399,1840019350,1840019827,1840020860,1843076481,1845608978,1846070315,1848013570,1854921046,1859450748,1859510931,1859511204,1860240647,1860312281,1860334137,1861101595,1863024310,1866891339,1866893066,1866896736,1866908847,1866910185,1866914026,1867191437,1867861644,1867861768,1867865679,1867867083,1867872142,1867873124,1867876289,1867885376,1867885466,1867887914,1867888607,1867892691,1867898961,1867899162,1873521117,1875950626,1878219696,1883713830,1883718737,1883722494,1883726489,1883992567,1884025074,1889208808,1889317056,1890185274,1890552293,1891315242,1893129355,1894534152,1894535395,1894543357,1894548934,1895822736,1896748195,1896864381,1896883495,1896884690,1896893413,1897086584,1897144569,1897150382,1897161336,1898308423,1899713189,1903920486,1903920882,1906518923,1906815088,1907758428,1907908343,1907910446,1907911172,1907924055,1907926218,1907937265,1910568778,1912588116,1912664290,1912773142,1919704439,1919708663,1925589573,1928014104,1931786446,1933270769,1933847987,1934282690,1935832225,1937137824,1940180687,1941545223,1944881831,1944883085,1944889292,1944901097,1944907730,1944915291,1947690884,1949378607,1949381140,1949385828,1949388221,1949404634,1953208595,1957126749,1965980590,1966393263,1967560433,1968030901,1968344522,1968345101,1968345505,1968353343,1968354820,1969952988,1969953274,1970271924,1982830318,1982831301,1982836783,1982854539,1982856313,1982857328,1982862253,1982863214,1983945412,1983946415,1983946627,1983953134,1983957025,1983968650,1983971249,1983972408,1983977373,1985096774,1985106740,1985116048,1985122769,1987352594,1989155232,1991785536,1991792841,1991799730,1991811287,1991817238,1991817715,1991818748,1994019132,1994026062,1994028952,1994613365,2000627256,2002587178,2002703477,2004055936,2004062657,2004080420,2007546240,2007547499,2007556254,2007557797,2009780252,2013938002,2016158046,2016458632,2016459875,2016461129,2016470189,2016476340,2016482461,2016485526,2019785049,2023148389,2023153871,2023155598,2023156002,2023157760,2023171627,2023174160,2023812622,2029256230,2029286951,2029296544,2037064184,2042215210,2042272668,2042423451,2043073993,2044012869,2046744295,2047386704,2047490213,2047625030,2047828609,2051192703,2052284669,2056364987,2056365175,2056459861,2057257910,2058376024,2058382302,2058436464,2058440319,2058445367,2058448694,2058452545,2058552215,2058569521,2058573621,2058924197,2058929805,2058958371,2058984507,2058988863,2059003240,2059051015,2059075746,2059422408,2059824807,2061714098,2062014471,2063260135,2063415690,2063627333,2063814283,2064238717,2064313581,2064484772,2064499575,2064635107,2064635452,2064635773,2064639428,2064639883,2064648773,2064654772,2064655646,2065476844,2065542420,2065542544,2065543022,2065727011,2066567940,2066734284,2066828553,2066833534,2067202738,2067233317,2068031208,2068725531,2068831008,2068854498,2068854512,2068858196,2068859575,2068860177,2068862627,2068863232,2068869021,2068950273,2068994789,2068994807,2069062998,2069102686,2069161595,2069263945,2069338842,2069365704,2069468800,2069558220,2069561350,2069566268,2069591394,2069593072,2069595618,2069600040,2069600946,2069600957,2069604100,2069765192,2069904166,2069904305,2071035931,2071149679,2071643658,2073289171,2073308845,2073310709,2073312474,2073322881,2073335784,2073440452,2073448514,2073457247,2073500084,2073509625,2073523923,2073533208,2073640292,2073794194,2073803151,2073803461,2073808229,2073811616,2073811996,2073815760,2073826308,2073826688,2073827152,2073830759,2073831593,2073831601,2074299520,2075044848,2075423284,2075693433,2078935992,2078936931,2078937889,2078937913,2078938163,2078938295,2078944407,2078944555,2078944613,2078944933,2081181239,2082063743,2082285629,2082430948,2084946688,2086083080,2087431076,2087431077,2087431079,2087431080,2087431081,2087431082,2087431085,2087431086,2087431087,2087431088,2087431089,2087431090,2087431091,2087431092,2087431093,2087431094,2087431096,2087431097,2087431098,2087431099,2087431100,2087431102,2087431103,2087617590,2087617591,2087617592,2087617593,2087617594,2087617595,2087617596,2087617597,2087617598,2087617599,2087617632,2087617633,2087617634,2087617635,2087617636,2087617637,2087617638,2087617639,2087617640,2087617641,2087617642,2087617643,2087617644,2087617645,2087617647,2087617652,2087617654,2087617655,2087617656,2087617657,2087617658,2087617659,2087617660,2087617661,2087617662,2087617663,2087629931,2087822490,2088302297,2088726760,2088953542,2090213881,2090218574,2090297888,2090298020,2090439875,2090439900,2091225604,2092577468,2092702023,2092715579,2092766986,2092957042,2093991393,2093995617,2093995632,2097113374,2098599777,2098599792,2099138174,2102249573,2102285158,2102285168,2102285285,2102285374,2102286572,2102291553,2102297313,2102301463,2102304381,2102311282,2102312281,2102313468,2102315379,2102317235,2102322718,2103529616,2105684477,2105873178,2106751208,2106757636,2106766355,2106769656,2106775467,2106775926,2106776925,2106781879,2118750891,2119037299,2119037310,2119041270,2119043865,2119381911,2119891962,2120136928,2120142410,2120143393,2120151231,2120152708,2121629990,2122433548,2123414271,2123472843,2123472936,2123472941,2123472990,2123479292,2123481132,2123481326,2123481391,2123481939,2123481960,2123482409,2123482928,2123482935,2123485221,2123485512,2123485548,2123486092,2123487587,2123487602,2123487868,2123488061,2123488218,2123489049,2123491458,2123491494,2123491502,2123491940,2123491944,2123491950,2123491964,2123492067,2123492380,2123492410,2123492613,2123492943,2123493403,2123494323,2123494721,2123494806,2123495205,2123495222,2123495263,2123495538,2123495599,2123495615,2123495829,2123496707,2123496945,2123497027,2123497539,2123498152,2123498482,2123498621,2123498738,2123499337,2123499387,2123499393,2123499675,2123499817,2123499823,2123500085,2123500670,2123501043,2123501651,2123501946,2123502012,2123502614,2123502618,2123502909,2123502931,2123502972,2123503489,2123503580,2123503633,2123503639,2123503645,2123503683,2123503690,2123503871,2123503914,2123503925,2123506021,2123508761,2123508887,2123508888,2123509104,2123509367,2123510210,2126830924,2126831627,2126831911,2126831915,2126834731,2126838118,2126839865,2126841008,2126851442,2126854146,2126854761,2127933481,2127939688,2127940675,2127945958,2127950989,2127966582,2130163562,2130164545,2130170027,2130187535,2130190580,2131286378,2132327224,2132331087,2132359596,2133546426,2134655216,2135730753,2135744303,2135751022,2135766376,2135766538,2136033383,2136198665,2140379406,2140382005,2140404240,2140405499,2140406225,2141369520,2141378580,2141384318,2142607534,2142608862,2142616598,2143588731,2143590729,2143592861,2143597618,2143609175,2143615126,2143616636,2144000095,2144838611,2144844042,2144846897,2144858266,2144868884,2144870143,2144870869,2157945278,2158338411,2160318468,2160324206,2160325189,2160333019,2160343200,2161569257,2161578129,2161578140,2161592231,2161595735,2165898261,2166038855,2166996811,2167003274,2167004256,2167015877,2167018798,2167213797,2167993101,2169327252,2170481633,2170487115,2170488842,2170504623,2170507412,2176528068,2179101309,2180545870,2191744103,2191744212,2191821366,2191883015,2192566334,2193960351,2195897610,2195898849,2195906687,2195916612,2195922100,2196631346,2205406696,2211506222,2216825796,2219145843,2221394610,2225058301,2225061335,2225064134,2225071439,2225073075,2225080536,2226037368,2226044042,2226051203,2226052893,2226055388,2226060342,2226419862,2229788675,2230793522,2230840997,2231615745,2231617728,2231623210,2231628742,2231632031,2231633170,2231633764,2231638049,2231729235,2231751291,2231760201,2231761216,2231769054,2231770037,2231775519,2233884981,2235097422,2235100587,2235101313,2235108032,2235109598,2235116887,2235119589,2236869449,2241796550,2241797549,2241806680,2241812579,2242828527,2246244298,2246245281,2246250763,2246260079,2246271316,2247223374,2247249937,2247251096,2248592412,2250708942,2250715407,2250719552,2250724971,2250725805,2250733692,2250734937,2250735952,2258665553,2258878642,2264886749,2266447633,2267607e3,2274782645,2282544968,2285662351,2290599544,2292158595,2293175691,2293351636,2296071446,2299255515,2301040846,2306079466,2307580553,2313504811,2318220358,2320224028,2325476095,2337176745,2339504386,2344847762,2345345412,2345556981,2346482211,2346482871,2351498341,2352240646,2352738840,2358991500,2361087993,2364634824,2371011349,2373457221,2376425283,2379512524,2379580075,2390286898,2390518325,2390736011,2392516839,2392521063,2400874900,2400879124,2402335630,2404974948,2405102721,2405117283,2405120727,2414810349,2415093005,2415923742,2415925541,2415935547,2415976346,2418152088,2422623072,2422625395,2422631927,2422634373,2422636295,2422636392,2425962056,2425963043,2425969250,2425969487,2425971892,2425985030,2428197348,2428202830,2428203813,2428211643,2428212914,2428213376,2428240545,2430223084,2433759338,2433759634,2433760321,2433765803,2433783311,2433785126,2433786356,2433788522,2435993901,2436000108,2436001095,2436011657,2436026994,2439339076,2439340079,2439340291,2439346798,2439350689,2439362314,2439364913,2439366072,2439371037,2439876345,2440431898,2440444045,2440449369,2444112661,2447928023,2452264162,2454797153,2458316286,2459819944,2462285242,2462802458,2463186757,2466741694,2466758807,2467213089,2467545358,2467601561,2467655846,2467686484,2467740953,2473985870,2474042431,2474150919,2474285829,2474577412,2474661520,2475343068,2475470210,2475772433,2475877012,2475877016,2475892298,2476213365,2476552306,2479517659,2489453909,2489531547,2498555779,2501597440,2507278661,2510852110,2511694664,2512156190,2540805343,2542362598,2543008264,2547140668,2553182506,2558063998,2558416820,2560726248,2564751176,2566787042,2569608194,2572602371,2577853220,2579803386,2583084289,2586020617,2600402029,2604613571,2614694552,2616608417,2623678483,2624091113,2626979216,2627765050,2629831661,2630340943,2630577386,2637047575,2637160117,2637393619,2637589507,2639283063,2642320383,2657728452,2661288721,2663538084,2673250796,2673678071,2673953045,2683622002,2686768508,2689921282,2691751732,2691869931,2692015714,2693065457,2693628719,2694158948,2699054734,2699567323,2701589506,2708247797,2710218932,2712973569,2713114330,2714570818,2714658156,2715859111,2716538256,2717691085,2718235570,2719851426,2722275573,2728431851,2731033959,2733567145,2745064373,2747735009,2748168364,2748310006,2753354596,2761147374,2762813598,2767767034,2769808878,2775691349,2789347571,2792452218,2793624174,2794767436,2795183554,2795185357,2795205893,2798224110,2803597621,2804113804,2807804736,2809486328,2812191981,2813025413,2815428841,2815585428,2816618421,2819662823,2822221150,2824682484,2828575765,2828866516,2829935276,2834927579,2836892761,2839658405,2844621372,2844815106,2845489684,2845638303,2857120519,2857193006,2859698097,2860702321,2870435535,2874906565,2880233005,2885526550,2889073982,2893961579,2896360091,2896815948,2898520762,2898642745,2908250170,2908376536,2911135641,2915014315,2918403731,2918486269,2919235927,2920587887,2922468503,2922493886,2923084706,2929584080,2931398379,2931402541,2934893225,2937779198,2941551192,2942859576,2948690168,2948867989,2949433359,2951266128,2954570766,2956489777,2960184498,2960188722,2960612931,2962892549,2963032843,2966548328,2976545290,2976620947,2978924197,2982913903,2986096991,2987284613,2988637881,2993692642,2996709992,2999106536,3000568496,3005531064,3005732955,3007175865,3007286028,3008753857,3010444860,3010880247,3019938621,3020499579,3022866914,3023311759,3024482653,3024795687,3024807531,3027071777,3029820267,3032088673,3032839979,3033043261,3033965900,3036878933,3037343835,3038234864,3051293097,3052701732,3055037923,3056484673,3060407188,3061523114,3071254387,3071254500,3071254881,3073058130,3074871971,3074935051,3075008146,3075048985,3075285442,3075422693,3075548305,3075766008,3075860343,3075962648,3076097045,3077391764,3079190285,3085252246,3091553195,3103424085,3107541791,3107727924,3107749241,3107778469,3107783354,3107787446,3107790299,3107948057,3107956419,3107974264,3107984588,3107991466,3108296169,3111583245,3113459538,3116256345,3116975703,3117043431,3121647752,3123411243,3123445549,3123737595,3127243644,3131616468,3134139083,3134716611,3141709512,3148676509,3154082174,3155375542,3160028447,3163162577,3163167462,3163515572,3163650864,3172095015,3178395499,3179705353,3183658699,3187099641,3187299343,3189362935,3189614929,3189845278,3191231848,3191324353,3196795314,3196799538,3197664642,3200115829,3202732235,3206363778,3207294280,3218691622,3224832477,3226582088,3231960701,3231960825,3238444781,3240506687,3241127686,3245505639,3246685420,3255250502,3255475289,3255493270,3258010725,3259268259,3259708744,3272088211,3277477189,3287497511,3289363789,3294281816,3300709686,3302430666,3307080284,3310372188,3310580422,3313110325,3317570505,3323504524,3331794938,3332552236,3344936763,3351242611,3354164541,3356161036,3357443896,3358280978,3360549707,3361435146,3362509089,3362630778,3366341181,3366920760,3368509209,3372160500,3373297021,3374596217,3375285141,3377755895,3379029866,3380241983,3380595728,3381834713,3385946526,3386125251,3388057612,3393544563,3404840083,3405857857,3407191084,3408814815,3408819560,3409018494,3409457570,3410577155,3411051814,3411102162,3413983999,3416635233,3418887913,3424150275,3424328663,3424396902,3424402597,3424461304,3424574116,3424937078,3425024187,3425041814,3425042139,3425175341,3426036948,3426656604,3429124e3,3430316367,3430320824,3430870942,3431771155,3432731814,3434192147,3440930072,3441289467,3448289841,3448536520,3452859864,3455445539,3455973701,3456106851,3456282588,3457601666,3463597433,3467469261,3473077716,3481649290,3487446962,3488816292,3495434909,3503723552,3503962589,3503975251,3504086267,3504111353,3504116046,3504274912,3506277065,3508805241,3509081590,3511319965,3513566261,3515728076,3515960057,3516630755,3523519258,3526432473,3530287752,3530798581,3531066474,3531601080,3532265658,3532567787,3533680386,3538145547,3540002868,3540019679,3541120058,3551826674,3554146688,3557238629,3557288966,3560409651,3560721423,3560755308,3560772904,3560776799,3560843986,3563273081,3564677062,3564681286,3567399383,3582031081,3584271853,3584286131,3585048866,3585049834,3585528102,3593775985,3599378282,3602300234,3607509617,3611661676,3611790203,3621964687,3621965124,3621966081,3621966083,3621968414,3621969916,3621970585,3621975893,3622095083,3622538650,3627671724,3631197772,3636965307,3639447013,3650032210,3667545339,3668394990,3668555001,3668632957,3671699945,3674122558,3682693088,3690182854,3691035506,3691048605,3691317036,3693068020,3697923226,3699114476,3702342894,3706900355,3708334595,3709045244,3712703179,3712728440,3712733478,3718845099,3718930524,3720827503,3728968422,3729352785,3730027878,3734185373,3735541918,3737224996,3738382782,3738387349,3738389800,3738389990,3738390006,3738390241,3738390427,3738394220,3738394620,3738394722,3738394744,3738394859,3738396519,3738397033,3738399064,3738400460,3738887202,3738887334,3739466542,3743223168,3743289449,3744330913,3745299015,3748385635,3749221030,3756564018,3766265917,3766587032,3767014136,3767872686,3768672199,3771941409,3772113601,3772128853,3772772804,3776028623,3776032376,3777321837,3777702607,3777706691,3777840696,3778052019,3778877784,3788596678,3788641118,3789096147,3790949066,3792555306,3792675197,3794434962,3795445637,3799396589,3802359444,3802425981,3802900168,3803509878,3803533553,3803824710,3817195077,3825134626,3831783888,3836226283,3837130236,3839963077,3842564401,3842605521,3845461162,3845489549,3848928610,3854658802,3856336918,3857323999,3858008723,3862352064,3867966833,3870049918,3871085378,3871829833,3872291932,3872427595,3873740388,3875975886,3876231871,3878080222,3881750832,3882302039,3886373040,3890622701,3890644440,3890892359,3896043913,3896689307,3899279503,3900747045,3906847659,3911916015,3927826024,3935292304,3943337509,3944324480,3944448839,3945529821,3947301018,3949488650,3950038675,3952494101,3960241116,3960376152,3961917741,3963099658,3963421060,3963723254,3967007952,3967259205,3969124422,3970612783,3970678261,3973713485,3975040093,3975243357,3975693785,3987058095,3989825156,3989847268,3990634986,3990704705,3992681822,3994071046,3995478227,3998971354,3999298006,4000670401,4000993351,4001099777,4001277861,4001735503,4002465742,4003357293,4005356768,4007925342,4011050686,4011066530,4011075332,4011273939,4011552428,4011788459,4012217148,4012217259,4024186918,4027830515,4028975169,4029110469,4029583348,4030423947,4031498693,4031499367,4031499504,4031509172,4031928713,4032208645,4032479130,4033316487,4036743247,4038287798,4038545865,4040900190,4042024153,4059950647,4061045790,4064482362,4064482494,4064686007,4068398139,4074270800,4074270919,4074308286,4075674315,4075712516,4075885548,4078878227,4080178633,4081049105,4089654486,4090206590,4090679933,4091412422,4095259202,4095274203,4097043581,4097047544,4097047888,4097050487,4097053538,4097079538,4097094723,4097094855,4097218811,4097289420,4097298261,4097355529,4097358800,4097358806,4097359478,4097365147,4097365569,4097368351,4097368475,4097373732,4097381131,4097390898,4097493023,4097494448,4097500420,4097504860,4097508952,4097518447,4097523657,4097528230,4097528249,4097565588,4097595928,4097769515,4097769660,4097770040,4097900631,4097993352,4097993363,4098078311,4098093255,4098096816,4098101881,4098102013,4098120408,4099257624,4099391059,4100119818,4101141701,4101990706,4102099355,4102141580,4102295291,4103385373,4104416776,4108421678,4108481771,4113654278,4119925923,4120143040,4120573143,4120685305,4120832270,4121323786,4122797449,4123137490,4123141719,4123166778,4123237466,4124517918,4124852870,4126190390,4126265264,4126330058,4126584791,4128561486,4130538182,4130665595,4135804702,4138805004,4138959002,4142649353,4143010615,4143011353,4149276818,4149741566,4155964946,4160851306,4165043845,4165602674,4166101816,4168666626,4168671212,4169534192,4169538416,4175499442,4178182706,4179726175,4180321577,4180398911,4180437564,4180584501,4180592595,4180655876,4182610142,4190427894,4190436241,4190438903,4190464587,4190536489,4191350062,4197904504,4208748285,4213114634,4213114766,4213115878,4213133169,4213139443,4216213600,4229539334,4230260404,4236039784,4239211903,4244301284,4244359264,4244636840,4244650461,4244697370,4246504751,4248927363,4249781266,4250093591,4255547342,4269915810,4271230391,4273205904,4280822506,4281987205,4281991429,4288642117,4290818353,4290862694,4290938088,4291163255,4291519114,4292375442,1694,113029,2431109,9085905,10454523,11833936,15005411,29039073,29369909,32348563,32392946,34831997,35241656,35407085,38660731,41719852,42040525,44148994,49751269,54657448,54829135,56701348,61297674,64616140,64789207,64792746,65243007,69912355,73497087,75564691,84754216,85474843,88950783,95227810,97869711,98556036,99860970,111529024,118457586,119013459,124940101,129204800,129504899,132934253,133576354,140643360,141325108,142928709,144351849,147399388,148485881,153516070,162751717,164324729,165338893,166383271,169804649,169909381,170281316,170281555,170281599,170281951,172221532,172281601,172282023,173287589,173930363,176844018,177079695,177546706,179139641,179312238,179569944,179956098,180259371,181198501,181205574,181240422,181950714,182150488,183129361,183468910,183469260,186043176,187501046,187763081,189174183,190912115,193357074,193420201,193885172,194024818,194130004,195040605,195184107,195615400,195788148,196491587,201802654,202716248,203969128,204000291,204003102,205844479,207663471,208540214,211702237,213315812,216283771,216404638,221220686,225036633,233832515,235585683,236122625,238349947,244953360,244983020,253603556,270508724,274628826,279497384,282260013,282734069,286117940,288337735,294222691,294944592,297796540,299806932,301175958,305396028,309814229,316711416,319659866,321667918,322393118,323472705,329290740,336073493,344556873,345150446,345725228,346582968,348036069,348240977,349085323,352942917,361618841,362641227,363650316,368392429,371447569,379018060,379803748,381683792,384388494,390037588,392534911,393050977,393824765,398079720,401473592,404580880,408076405,409551689,412923104,413989960,417762611,418643706,419980117,420076057,423460135,424671062,425273951,430774757,431128362,431420666,431463230,433024678,433601547,433960232,434424313,440846816,440990792,445424682,448347366,453082265,459993498,467355959,468677861,470584767,478194174,481007914,483933287,492579864,492820046,495294245,500922416,501132892,502571724,503870109,505520155,505540840,505547348,507674743,507704542,508155006,508732896,508756709,518314331,524499536,527090713,528698966,532828844,533082472,536472645,536606854,536706420,543383677,544035780,545100578,547829195,548068662,550157112,554422931,557980541,558904957,559619560,566123574,569085212,569128746,575078226,579214441,582810837,583362052,583453417,594063106,598128236,601157755,601161740,601948346,602413319,603986209,605582466,609198625,610045978,617827459,620396524,626039263,626988485,629099694,630452394,635400744,640415961,643558590,645257576,652659119,656273907,665354414,666296511,667333922,668403785,669929645,682364285,689215333,699075989,704136516,706383966,708808466,710978465,712995495,717519098,722655660,722956329,725449644,727209749,729977159,734622016,735035205,737142807,737152212,737166334,737644692,737837074,739516787,739566545,739985822,741816033,742252614,742260586,745092996,747930588,750219296,750508933,752522257,753857751,754000708,757807602,758478444,761228031,762067870,762641736,764248075,764320946,764825188,766296725,766355544,766543587,766643209,766774330,767540529,772363084,774299734,777688891,787564577,789530990,792068311,792844833,796533587,800010738,800087019,809563086,810061706,810813298,811092091,817847511,819009519,826260124,833658992,834470340,839856739,842147301,847675799,861294299,862950715,867021650,867036335,867732810,869064225,870151875,874296659,875096251,875944810,876149555,879009267,884498580,887482102,893652881,894264732,896104248,896979123,897240751,902139830,911653942,912249299,919599881,927052135,933697266,933717702,933742623,939098524,939114841,948752149,955130439,955354780,955942299,956480228,958121442,961145400,966830075,968732370,970076747,972273212,976381303,978919739,981829565,984418838,997412732,1001458257,1001637783,1001651627,1005191377,1008948875,1010556097,1016009727,1016348317,1019849895,1023879932,1024317101,1027786481,1027856392,1032266307,1033049924,1035709107,1041294385,1043437244,1049779946,1051535617,1053737172,1054370922,1056150770,1056645919,1056720884,1063952736,1064188994,1064732809,1064857294,1065290596,1080478458,1081536009,1086069586,1088535269,1090938281,1094421058,1095718313,1096687866,1100372480,1101019943,1101043104,1102004406,1104733017,1110237878,1112959177,1113096701,1114972095,1118952562,1125668821,1130216203,1132104794,1132534664,1132579070,1132598106,1136018325,1137104375,1145147923,1145899518,1146014840,1146523166,1149204820,1151262913,1152056864,1154446700,1154536335,1154536715,1154542665,1155367440,1155994599,1158265339,1158326174,1161218045,1164964007,1166033123,1166422202,1167024992,1167025137,1171269392,1174582808,1174756828,1179491634,1181469438,1186977866,1187653498,1188208310,1189560180,1191923730,1192723278,1195304992,1198195980,1199133859,1199554249,1199600208,1202045876,1204911535,1208429990,1210779948,1210807525,1221782335,1221920801,1236932222,1238449939,1246474378,1257256866,1257395124,1257876060,1257878939,1258281930,1258346504,1259689738,1260820433,1260836076,1261324364,1268763191,1269301612,1271531819,1273274467,1276658942,1282928227,1283757717,1296032318,1296235125,1301946320,1305140481,1308857550,1310807544,1310899277,1312056732,1312163653,1316036626,1316125796,1324285266,1324310094,1324331646,1324337571,1324579984,1325750278,1326569216,1332893391,1333842476,1349684561,1351415139,1351558342,1351862653,1351880550,1354386923,1356250756,1356331589,1357629674,1362733356,1363404812,1364008114,1364487272,1365133140,1365599531,1365623138,1366730785,1366987615,1372705460,1372794328,1373871548,1375834117,1377641421,1378095694,1378253217,1383623210,1391288061,1391291390,1391293134,1391299074,1391300548,1391306067,1393577155,1394469288,1394469303,1394469473,1394469866,1394470005,1394470066,1396870772,1399867662,1413067533,1419304208,1423547895,1430902259,1431096661,1433581041,1435770227,1436788950,1441443055,1441473969,1443172426,1444705872,1444722875,1444727957,1445594238,1447082963,1448082324,1455246557,1457519039,1458493639,1459794391,1460930084,1465058743,1465974914,1465976327,1465976425,1465976436,1465976550,1465976625,1465976632,1465976747,1465976986,1465976991,1465977196,1465977261,1465977274,1465977303,1465977323,1474444421,1478092049,1478716185,1481566528,1482522967,1489772937,1492902674,1494181387,1503721626,1504535254,1509029106,1510450262,1511907991,1515598870,1519441587,1520424549,1522685369,1525831150,1526085253,1527459723,1529619411,1532042759,1533712942,1535986906,1537663939,1539580287,1539902893,1541073018,1541496652,1542773859,1549199388,1549209224,1549210203,1553692884,1555806428,1561102750,1568416773,1570440897,1570561776,1573188605,1576134740,1582406800,1585380899,1587251606,1592687509,1594093747,1601662530,1602151715,1602222565,1602416912,1604313702,1610069144,1610724928,1613430619,1616149762,1616623247,1616826805,1622345684,1624120544,1630208269,1631446240,1634840328,1635306209,1637735434,1639041637,1640826914,1643893360,1645239134,1645714411,1646967505,1647700483,1648026812,1648459154,1652482428,1654623339,1659538076,1660752253,1661285202,1662950537,1664993389,1675032552,1676328914,1681382184,1683407715,1684605451,1684964181,1686375531,1686572406,1687228988,1687236156,1687238599,1687241697,1688907428,1693905970,1694678234,1696017211,1697022103,1698247372,1700196518,1700874190,1702743585,1704831752,1705191422,1705572464,1705775316,1705920264,1708553688,1709604401,1711224201,1713051167,1715999558,1716087943,1716947524,1721557559,1722492001,1724478613,1728197301,1730461660,1732377833,1740500925,1740503023,1747349646,1747349737,1747349747,1747349811,1747350242,1747350353,1747350383,1747350483,1747350570,1754249179,1757625214,1758838683,1759487629,1759488516,1759498393,1759499821,1759502442,1759502966,1759512274,1759512283,1759513528,1759514495,1759514515,1759516437,1759524172,1759589336,1760335250,1762975960,1762992044,1763004314,1771261987,1772061961,1772164204,1772475101,1775305704,1778177081,1782043531,1788148481,1789421301,1793905730,1800839994,1801140929,1801396125,1804673412,1806579373,1813955111,1814430790,1816595094,1817436421,1822787251,1828043124,1839996532,1839996844,1841030555,1842560365,1844006530,1844448916,1844480213,1846724376,1856607747,1860761623,1861064328,1863000850,1867708596,1869007419,1872936175,1873771601,1873773882,1873774456,1873776479,1874142716,1875798230,1880233189,1882601503,1885862630,1890372289,1891031342,1891205640,1891938925,1892631265,1896919160,1896919227,1896919294,1897898461,1899147627,1900573373,1901379444,1902628941,1906789934,1906790006,1906790139,1906795057,1906796594,1906797455,1906801573,1906801694,1906806837,1906810233,1906810485,1906811690,1906812875,1906817274,1906818921,1906820915,1906820924,1906823423,1906823469,1906857590,1906857691,1906857989,1918700844,1921631441,1925206882,1927020241,1928994e3,1936188797,1939994885,1941474619,1944071536,1945201987,1946130305,1946324244,1947055740,1949193282,1951127334,1960661844,1964294607,1971670426,1973838680,1975660003,1977074332,1977076352,1979063800,1987660949,1991785763,1992080509,1995174355,1995890751,2001507875,2004488903,2015900220,2018783243,2021213332,2023260368,2025018361,2025037989,2025039155,2026455612,2026543248,2027114414,2027551630,2034028822,2034497157,2034927376,2035815698,2037403782,2037552632,2038238057,2038463378,2038609522,2040354520,2040943501,2041028464,2047340057,2047377876,2047791608,2047824538,2050823774,2050838609,2051525062,2051827668,2052255777,2052901511,2053206810,2053240934,2053478875,2053493456,2053853373,2054449324,2055229681,2055578022,2056180496,2057710300,2058751811,2059048621,2061275137,2064241908,2066721635,2067699997,2071301924,2075934693,2077460241,2077463931,2082273412,2082279457,2082340026,2082350395,2082490504,2083899515,2084905908,2087506861,2087568425,2087595516,2092046651,2092301721,2092419132,2097381010,2097529923,2100199727,2103470828,2105481502,2107063121,2107436658,2113664954,2116750738,2117068897,2119040128,2122563214,2122618177,2124668692,2133443920,2133514276,2133540902,2134191641,2134715695,2138049165,2138494997,2142609419,2142633914,2144770101,2146688546,2151094932,2151644274,2153187194,2163712208,2163898589,2168105062,2176727539,2177318798,2178944930,2179027416,2184528600,2185606643,2186571792,2187374596,2190645414,2190660247,2190897184,2191637858,2194211966,2195314033,2195413098,2195424198,2203121973,2211529485,2216861598,2219976143,2224936471,2229428098,2233205867,2235535537,2238302643,2239584661,2243922068,2246095470,2249578444,2251500542,2253395698,2256423319,2257131811,2258848076,2259012151,2265403416,2277922362,2278366865,2281444864,2283990470,2284221844,2290521795,2298483014,2298859942,2303709693,2305684069,2306183534,2310688315,2313038876,2315634657,2319104481,2326416557,2327685947,2330979339,2331542577,2339348712,2340566443,2343955873,2343987387,2344081298,2354634240,2357782940,2360233424,2365749167,2372460029,2372478071,2380959235,2384339112,2385564998,2387086868,2391410598,2392072803,2393811335,2399346319,2401643245,2401782259,2403261116,2406918497,2407789481,2409182571,2417084170,2417165267,2417652035,2419411749,2419417423,2422324904,2423117096,2424431334,2424771770,2432634086,2432728198,2433143557,2435584133,2436015021,2441679501,2441854846,2444838503,2451094457,2453483137,2453497460,2454448917,2456215407,2459247176,2463271525,2463506842,2467234433,2469945372,2473920266,2476783882,2485004952,2486666796,2489018185,2489169796,2490847830,2492077342,2492970238,2497220049,2503042985,2515254157,2518379243,2518777282,2525588137,2525608018,2528358668,2531896313,2539686262,2551310943,2554772601,2556085817,2558131228,2564231467,2568929373,2569358076,2571159128,2572746788,2575905107,2579846032,2582295686,2585286228,2585297154,2587884409,2590263013,2592032772,2597156358,2600208325,2602467246,2614031703,2617427457,2622453927,2622601193,2622997773,2635726130,2636739119,2637611531,2637745410,2637827916,2639832942,2644708943,2646831691,2652889161,2656916375,2658971428,2660417858,2667387895,2669967601,2671812960,2675377616,2677517890,2677527742,2680331975,2682569422,2688047810,2692646873,2694622232,2697812844,2707358863,2707431632,2708098424,2708256980,2721005193,2721996537,2727613517,2729386864,2732129495,2738025026,2739504392,2743561936,2745053658,2748129339,2755346949,2756835810,2762308724,2762732310,2772048233,2773342582,2774237802,2777215669,2779765943,2780442125,2780900117,2784038323,2786612080,2787145966,2787151566,2791623281,2792656912,2793843165,2794535853,2794558276,2794571602,2794589073,2794607684,2794781905,2794812897,2794904579,2795201682,2795215251,2795316793,2795413889,2795489178,2795518714,2795546979,2795547152,2795551511,2795554576,2795555553,2795567189,2795581043,2795588603,2796767057,2797512177,2799152382,2799526810,2799947922,2802973072,2804403738,2804874542,2805637755,2805753744,2809447657,2812187177,2812916202,2815541885,2820491263,2822394574,2829422945,2831048350,2832237259,2834623189,2837348717,2839958087,2840525902,2841159353,2842490055,2843506215,2844781614,2846385194,2846982791,2849248490,2849860412,2850213786,2852028874,2852573181,2854701866,2854943229,2855519660,2857974075,2859686627,2873369054,2873382924,2877054650,2878248977,2878625875,2880150758,2882016813,2883677644,2889508141,2894321712,2896549226,2900972274,2905747927,2907164383,2909422460,2910191497,2912050734,2914081458,2914744694,2914938714,2915009556,2917041430,2918571873,2924790692,2931708704,2932164581,2932643151,2933052029,2935350303,2939956665,2941858877,2943539162,2944512053,2944562948,2945364171,2947166646,2950332665,2953041500,2955690868,2958695479,2959025464,2963193938,2963907974,2964323647,2965610869,2969439522,2972958854,2976917923,2978201778,2982085395,2985605450,2996423818,2999691650,3008190733,3008855969,3016122305,3017646001,3023766416,3029366772,3031325313,3032047068,3036119914,3036992672,3039024727,3042813479,3050467218,3051886594,3053067553,3053287882,3065938060,3067331584,3067801157,3067842181,3068762275,3074108603,3077857486,3080857101,3087935921,3088190003,3091255985,3095401268,3096813247,3098725318,3105671535,3111527444,3115079967,3117883740,3118052513,3118932015,3119183299,3121944857,3123256667,3124496054,3126706525,3129135980,3130292716,3136193853,3143250549,3145203874,3146277579,3146688e3,3150523560,3151212508,3154412692,3156177950,3159557566,3164499075,3164706839,3168577861,3171832589,3173559921,3174529089,3176196996,3176871024,3180784320,3181226348,3185392090,3187205025,3189849017,3190997898,3192015124,3206103617,3212240200,3229338204,3231038915,3236684869,3240062262,3241501460,3243217472,3244361100,3245554401,3249410406,3254464708,3257959952,3274402918,3276160836,3276181105,3276196901,3278107133,3289739448,3290502878,3291450742,3293286977,3293297241,3296419295,3299472058,3299767442,3301223392,3301309499,3301391192,3304599725,3306064327,3313552392,3328014532,3331885553,3332277580,3333914252,3337182013,3337858974,3341471161,3342158460,3346063476,3347209717,3350345047,3350816321,3351869587,3352060268,3355691995,3356175586,3357239148,3362723114,3366755503,3367073048,3367944003,3372319994,3375346812,3376868662,3382258705,3385088233,3389287501,3391503522,3392485763,3403435361,3403782237,3406109171,3406111906,3407122639,3411575670,3423045385,3424242744,3426100153,3426523263,3430187119,3431675506,3431798787,3431896672,3432167999,3432725491,3433958809,3443103158,3445734210,3450482982,3453219838,3455171543,3458629656,3460581568,3460835389,3471910127,3474158466,3478804050,3479897537,3480605972,3480868929,3481097537,3485240025,3491815953,3492209950,3494777461,3500328283,3503665706,3503925212,3506796962,3514565086,3519718992,3519725933,3524188747,3529349528,3542452078,3550700124,3550989552,3551573749,3553175952,3553442167,3554781799,3556847596,3557221487,3557691349,3558264087,3560824248,3563344816,3565186253,3565418379,3566074326,3569886279,3570187564,3576593305,3584104748,3586564634,3588013803,3590119076,3591676857,3594126223,3605649145,3607964178,3610130320,3611466472,3618863110,3629119210,3629792790,3635135986,3635459541,3636074310,3638424639,3640911628,3642130958,3642225062,3647798063,3656108419,3657615451,3659534155,3659534172,3659611370,3659667263,3660545348,3660867367,3662104715,3671487562,3674207720,3678946749,3680027665,3684023399,3686510836,3686613485,3686646984,3691543485,3691543777,3694814128,3695175653,3697285380,3698130051,3700803863,3704722354,3717443225,3718851041,3722297297,3724304421,3727475379,3727535579,3735375385,3735382080,3740438523,3740440657,3748157778,3751843037,3759175702,3760229117,3767579376,3767636566,3774416951,3774620406,3775107448,3777554302,3784459817,3789217359,3790213466,3791430232,3792756850,3797275201,3797334865,3797547975,3797752814,3798120765,3799727891,3800284920,3804066593,3807736858,3811590943,3812650457,3814583456,3816238011,3818244185,3821631768,3824973847,3830752599,3831121452,3831131041,3837373870,3839962587,3842157165,3849728326,3849729892,3849734551,3849787726,3849792721,3849819373,3853184002,3854490492,3856121458,3857014848,3860607422,3861431943,3861926244,3867504094,3869648625,3871255217,3879613384,3888702999,3893630517,3895969787,3897018811,3898712433,3902486573,3904611129,3909678524,3911290870,3914258422,3919568627,3924938673,3928836058,3929271846,3932881151,3932899585,3933213384,3934007962,3950379841,3960912026,3973890763,3976040035,3977971580,3981048153,3981060932,3981985710,3988202550,3991078309,3992022849,3992259208,3993609185,4010941807,4012569891,4013412307,4021161495,4025854722,4027536004,4030686503,4033312623,4037300319,4043405137,4048222256,4048420974,4048962899,4049948378,4051811237,4052267313,4062598208,4064836207,4066383490,4070580503,4073707968,4080427569,4104807039,4115427659,4116271014,4117626035,4127381498,4128299636,4132054341,4132795027,4133480683,4136878052,4137094151,4137128166,4138537192,4138587115,4148483014,4149626272,4149641566,4149809179,4152090640,4152153727,4154732349,4156628388,4157060403,4159166567,4161006924,4161031359,4166727800,4167095051,4168702437,4168921085,4175490343,4178043127,4179607399,4182917435,4196816243,4201195770,4201710836,4204344500,4207814302,4212159173,4216249688,4218603456,4220181346,4230252988,4230808631,4236867197,4243509465,4245730359,4250048329,4251017064,4254397175,4261049438,4265986719,4266150865,4270257086,4272517612,4285995571,4287463560,4287809158,4287924367,4293141634,4293320049,7,171252454,314658260,1911007288,2310391087,2705648135,3085052283,4199583372,0,0,44,66987915,193433406,366428436,366991379,487687151,649399193,716916462,900018457,911616432,914855142,981141093,981156754,1135214957,1135523977,1213136917,1357549542,1437166305,1491010671,1491010869,1881252413,2035443912,2412701058,2447973967,2572472237,2572499572,2572504631,2734871983,2819823116,2856570282,2856570297,2873757688,2905936018,3147193074,3229893628,3497603669,3613204738,3628727675,4020469118,4072506013,4072506079,4072506170,4072506203,4072506236,4072506360,1985,3609572,4707302,4731941,7066741,12732264,12733869,12874473,12898727,15239865,15443925,15464989,17770158,18806137,22641470,34805542,37254453,38352510,47103897,47124528,47160482,47264668,47270558,47521880,47670735,47682584,48206184,54052064,55399270,55790429,57861540,64629239,65951659,73540622,74816563,79005572,79010572,79432449,79977826,80960607,90941114,91781471,93732497,101061895,101792620,105281118,114635485,121111459,126395821,127613999,134819976,135124399,135156325,135512978,139443164,140195744,146403274,147165318,147311351,147680945,154712981,156193153,157683252,162021680,165184869,165682351,167795310,169177047,169285407,170248114,175536255,176298648,181584625,186190871,188366635,190461039,190805290,190817793,191644192,193330267,200367649,204872798,208246903,213994908,222038678,222914983,226753977,227658815,230657663,231976681,232418677,234224516,235125560,235385397,235630461,235880887,236100347,237106084,237695302,243768879,244905302,245221564,245221621,245248688,246957980,247379872,247404538,247547714,249186148,249832804,250298968,252007821,252166643,254498243,256250975,256734086,257675257,258276240,260078806,269653037,270614174,270803459,279865482,290747254,296104342,296106331,296214241,297365588,297388265,297388314,297395043,297872731,297875338,305678573,310113063,317059542,318726251,320983337,321380700,329390871,340233049,343985311,368331859,368339983,374202536,374729119,377042975,377218502,377330983,379160277,387137528,390536878,397426025,410462833,410898354,411028646,415359567,418289923,418809394,420699727,422768411,423087664,434374676,434499530,439966930,443910462,444881445,446735168,470802373,473022090,475752042,480190019,481797890,482141996,493334140,493996949,494002753,494111972,496668263,497004637,505642028,513006918,520166698,522732652,524323805,524791178,525296785,532366388,537994409,538156652,539123093,539125333,540384923,545724556,546598380,552815312,564847266,572585472,572589595,572660745,572917514,572938118,581295982,583116728,584477771,585356786,585510953,586974440,588341431,590260151,593171510,600861600,602587622,608185550,608501e3,611172806,617227910,620862123,625412750,626878575,627192073,628675473,636454657,644892435,645708934,646772532,650376939,653264074,653865504,654835286,655274400,657684596,657843927,665654464,665772443,667917050,667982163,668803663,678409190,685972429,687873546,699223116,722349553,723381066,723506578,725289629,728910939,728916446,729301272,730375222,731520837,731524865,731524893,733458327,734942836,742063133,744425628,745118723,750501894,753379261,753585532,755936840,755999442,757164322,757742871,758908039,758927262,766978617,767310694,767319597,768502512,775086059,775783015,776818569,777129529,782249017,782470551,782586541,783225086,783819749,787058931,793173186,793643539,793791572,794069868,797737785,801549019,805476735,809560577,810471911,810660018,813069363,813965189,814609400,819689086,822265343,827811881,828807618,840895172,842670706,845178939,849626506,857304293,867054787,875581912,878480613,878489001,888652626,892902192,904040802,904780949,904781069,904781208,904781211,904781269,904781270,904781407,904781445,904781469,904781569,904781597,904781741,904781750,904781797,904781798,907680375,909542970,913350787,915552624,943105427,944616168,945567936,946059164,946112067,950116031,950459761,950797941,950991772,952407653,954708706,954904735,956279390,959296218,959317553,960000436,960088334,964474682,965248297,965252181,968600148,969495568,969714387,969714391,969714751,975014436,976847064,977515724,978655375,985441466,985451059,988676432,989199112,995754553,995754557,998100773,998582596,1001682227,1002897238,1005026102,1007267340,1018029509,1019292109,1021170671,1021615491,1027478448,1027904949,1028176876,1028524011,1033544761,1037073656,1039464298,1041396131,1043364491,1051084878,1053049944,1055328538,1055480209,1058862972,1066609925,1068948457,1071874351,1072134738,1082834847,1084511341,1087693738,1089012798,1089634494,1093384439,1093825560,1094815391,1098082937,1102471353,1113642022,1113846049,1121249692,1127953536,1132317159,1132485954,1132585385,1132689597,1132723356,1132858392,1133501028,1133636064,1134046361,1134351151,1134824033,1135467502,1135737574,1135775689,1136782059,1136883336,1137085890,1137173922,1138138823,1138714596,1139072942,1139153897,1139221159,1139981182,1140405028,1140510661,1141246959,1141280718,1141381995,1141584549,1141719585,1141874653,1142159541,1142193300,1142260818,1142366610,1144440814,1144457023,1144667374,1144802410,1144975561,1145579956,1145625081,1147135141,1147314976,1148184718,1148522564,1149131059,1150514349,1150729533,1151393172,1151494449,1153073825,1154465661,1155177503,1156094385,1156940664,1158572559,1160038984,1160487168,1161167906,1161578459,1161965872,1162013821,1163255421,1163472226,1163645377,1163777146,1163979700,1164916562,1165010690,1165068597,1165937726,1165940993,1166410608,1167096330,1167193469,1167260731,1167598577,1169823858,1170720439,1171147706,1171150005,1180230175,1180849387,1188216287,1188228500,1188701654,1190334387,1190352716,1190641324,1202600586,1206718941,1209302133,1214814043,1216095517,1220486075,1223892937,1224444732,1225577971,1229986049,1243738793,1247471306,1252266596,1252792940,1253960230,1254127330,1255848785,1255859538,1257563663,1257583343,1258195056,1258213434,1262993336,1263908042,1265512654,1267283463,1278475387,1281229947,1281889125,1284797630,1288585218,1290240457,1290513099,1293031053,1295516865,1297095740,1297597617,1298827289,1298832842,1299380998,1300818337,1304310342,1304455504,1310534169,1316956180,1336232039,1337809090,1340075459,1343684265,1347737800,1348149256,1354685816,1355025196,1357282216,1357301365,1363667295,1364395531,1364732891,1373278040,1373514813,1373685873,1375205051,1375419602,1376146087,1380234474,1380513046,1381723825,1382632688,1382645602,1382709874,1386126578,1388184353,1389190819,1389902309,1389912616,1390104485,1390958270,1391687090,1391699393,1393151104,1395748391,1395924208,1397018707,1397022500,1397827261,1398423514,1400330808,1401462671,1410284129,1411428439,1412479074,1412717811,1412831927,1420822802,1423109435,1423890423,1424552007,1425040900,1428131728,1431817030,1431897749,1433480127,1433483767,1434457973,1451286836,1451565010,1452211848,1452224159,1455851258,1458060161,1458176029,1458620255,1463365872,1466302404,1472319400,1475303091,1484355552,1486115226,1486401243,1489893113,1490054949,1492145100,1494001659,1494630697,1494690535,1494695213,1494714660,1494714786,1494714930,1494889015,1494990523,1494992680,1494997876,1495466906,1500014997,1502962162,1504548128,1505655813,1508029184,1508045454,1509815249,1518807662,1524160328,1529373691,1536802563,1538089784,1539586715,1544812783,1547140470,1552392687,1552405115,1552405169,1553111822,1553462237,1554120313,1554158027,1555241094,1555436471,1555595989,1556675361,1557492455,1557696008,1558835738,1558865070,1559582938,1559928005,1561078602,1565016185,1565113430,1565407826,1568314306,1568314316,1568317266,1568696751,1568699472,1568940804,1569248185,1570879860,1573625992,1573800670,1576869802,1581247153,1581398717,1581675892,1581718434,1583510121,1583803496,1588886160,1595292826,1602148307,1605015374,1609481646,1612153257,1618209596,1618218864,1618873873,1619384363,1624861042,1630153983,1638526919,1639454708,1640524262,1641042489,1641812886,1647303548,1648240296,1650468220,1650500409,1651513056,1658862087,1658979753,1661301475,1667470132,1667473335,1667728240,1667806132,1677105623,1680875001,1680882207,1681660610,1685495090,1685495093,1685495270,1685495398,1688394353,1688567575,1688665455,1688778883,1690751126,1691125863,1693300755,1694472929,1703388735,1709297356,1709313729,1712511978,1715661089,1717927392,1718114956,1721373840,1722360575,1724823399,1726408681,1726606395,1726645504,1732927910,1736066754,1736347741,1740486766,1742215384,1745377406,1758824175,1758930481,1758975612,1759122505,1759143730,1759143733,1759227293,1759313682,1759313685,1759412017,1759432510,1759498975,1759505228,1759507354,1759515800,1759642661,1759864276,1759893786,1760159824,1763810143,1766750547,1769211545,1769618102,1772590156,1775156822,1780760274,1783870720,1784406502,1786353732,1793007575,1811810046,1815656403,1816569647,1816866992,1822574126,1822868024,1822868031,1823268852,1823275309,1823288115,1823390804,1823768300,1833535991,1842420860,1844031908,1844296341,1844524436,1844853963,1845272265,1845433501,1850725233,1851761689,1851765614,1852766386,1853687691,1854177922,1861204803,1863593250,1872674263,1872992134,1873841021,1877281407,1877305076,1881597618,1884316146,1886743174,1887188539,1892879921,1905997196,1912353097,1916296381,1919640688,1919643810,1924325687,1935798204,1935801369,1935813711,1935815187,1935818499,1941710024,1944260378,1945210145,1951157591,1955955663,1957378415,1957388660,1957444069,1958153525,1958153878,1962799016,1964448624,1967235715,1967514117,1968334692,1970709900,1974828022,1977445003,1980811473,1981302481,1984866213,1986874949,1987285901,1987558613,1988913069,1998855379,2023930736,2026542768,2029442974,2029502301,2031253491,2041190670,2044176332,2044519717,2044521677,2044845895,2044862336,2050748464,2055299797,2059226128,2060744697,2060874008,2061631935,2062602594,2062613436,2062713055,2062721365,2062782118,2064194523,2064289093,2064667157,2064835977,2065546931,2065580690,2065783508,2066019598,2067177842,2067640249,2068518016,2068619301,2069026672,2069773511,2070805664,2073324624,2075547993,2076314666,2076760108,2076927096,2078661044,2080078919,2080126248,2080270176,2080768362,2080948565,2081049148,2081811414,2082081519,2083365940,2084275182,2089789238,2090043919,2090165361,2090287045,2092471497,2092773191,2093281591,2093290649,2093484170,2095261287,2096596043,2096775591,2100685312,2102866955,2108433077,2109903284,2110249550,2112026046,2112754908,2114424326,2115251185,2116737470,2118764990,2119510407,2120903194,2121183749,2121530494,2121539444,2122085862,2123968241,2123974461,2124038667,2126585211,2127702833,2127711196,2129393172,2140172366,2141043403,2144163444,2144352359,2146552134,2146559400,2146579609,2146771534,2146787712,2147192784,2149214372,2150227387,2151276842,2152677197,2158829447,2159124528,2159550475,2161337980,2161361535,2163722410,2163917836,2165826914,2169168320,2170868227,2173022808,2174751247,2179048400,2184998274,2196541409,2200622033,2203412941,2206322353,2208794483,2219653172,2219657520,2225010953,2226828879,2238722895,2238722920,2238723506,2241976578,2245936247,2248375230,2249276550,2249625301,2254065144,2254179087,2254183431,2254275149,2254449430,2254449877,2255178054,2264880989,2270863210,2290294367,2304704334,2304866355,2305219189,2310350875,2310486036,2312897274,2314773060,2315564905,2319231065,2319463533,2325240383,2327016339,2330482855,2337919027,2340169455,2359883328,2361871491,2366081778,2369823335,2369831600,2371523459,2372759050,2374977123,2376431395,2378889732,2382890223,2383755454,2386589953,2387052696,2389856295,2391789782,2398718314,2399324290,2400888860,2401211408,2404756392,2406557074,2407241140,2409418646,2411497922,2411691127,2413846222,2413908037,2414944572,2415208709,2417936111,2419639306,2423159152,2423360684,2425978408,2428076111,2437572023,2440527060,2444775143,2449407487,2457428534,2469735934,2475146676,2475744613,2476033552,2476112212,2476147614,2477393954,2478803388,2479415778,2482075359,2485317413,2485370363,2488499588,2488699734,2491415998,2492607180,2493496209,2497515972,2499072481,2499532790,2504383993,2504870149,2505121421,2505147736,2513647314,2513693640,2513701512,2513706827,2521253655,2521398855,2526527953,2526528078,2527291586,2527292245,2527666001,2528098475,2536669081,2536933437,2537106090,2538335365,2541170503,2541170604,2541177518,2545965593,2546249066,2546819122,2548278991,2548782015,2549421379,2557808039,2557863700,2558865115,2568950385,2569073380,2569341502,2569405925,2570837952,2575053435,2575619554,2575627585,2579451785,2581687876,2582936524,2586547509,2590439971,2600983050,2602643559,2605946857,2608238576,2608504686,2611889973,2612202111,2619739935,2621175072,2627204334,2627570013,2627677159,2631480810,2631901285,2635187702,2637430468,2638897207,2639751704,2642390316,2644459471,2644532855,2644906311,2645171587,2647433605,2647443463,2649904288,2651288351,2652440186,2655263134,2660229222,2660362019,2662714632,2671981072,2673085999,2676359415,2678218950,2680015310,2683201101,2683726243,2687071289,2687546085,2689958531,2690565794,2691049537,2696922944,2702278755,2705586928,2707450736,2708750293,2710694053,2710777678,2717039465,2719746264,2719953243,2722365346,2724396360,2730361077,2732178535,2732249147,2732255792,2732453216,2732465831,2733162785,2733179003,2740913336,2743326046,2745816408,2746770100,2768031559,2768594053,2769743066,2770453396,2777301260,2777413063,2779047561,2779131760,2781151044,2788878449,2791114477,2792266216,2795123222,2795130739,2795148393,2803000277,2803220098,2820015673,2824852881,2825063248,2825297984,2826183623,2826618777,2828159974,2830840737,2840364717,2844137461,2844192015,2844331414,2844474265,2845536368,2847702680,2847708560,2849875839,2854691117,2857021867,2857111846,2857167445,2857291628,2857718467,2857718874,2859609075,2860369035,2860944275,2861234828,2861431296,2861773187,2862323803,2862729831,2862789186,2862818280,2865000297,2865536587,2872917161,2879220442,2885591219,2886256228,2886266660,2886337850,2886340600,2886347487,2886358758,2886559394,2888553420,2893735969,2893987517,2894277589,2895201770,2895970159,2903889952,2904798808,2907566289,2911967032,2913775681,2917443420,2921648360,2921994283,2925162127,2925540459,2931480722,2936112276,2938485423,2939997155,2941295122,2942568797,2944555176,2950549599,2952067971,2952072562,2955690120,2961421753,2962144430,2962519996,2962841785,2964270344,2964373735,2965548040,2966852375,2970298080,2974400461,2975755381,2981996158,2987922608,2991195167,2991625994,2993771546,2995901561,3000958971,3001281849,3001388716,3004478994,3004479027,3004479111,3004479159,3004479171,3004479184,3004479190,3004479239,3004479240,3004479258,3004479289,3004479305,3004479323,3004479334,3004479373,3004479389,3004479390,3004479401,3004479425,3004479785,3004479787,3004479818,3004479829,3004479837,3004479976,3004479994,3004480114,3005847375,3006723884,3006726944,3006727797,3006731179,3006737252,3006744684,3006811183,3012299493,3014399025,3019017018,3019072181,3019996757,3020108825,3020133371,3020188532,3023885513,3024558034,3024589567,3024626538,3033483503,3034109278,3035739007,3035887950,3044634578,3044797796,3044821749,3045244983,3045788419,3045876876,3046124074,3046256428,3050244615,3050333064,3050334784,3056297406,3062281966,3063798750,3063849681,3073445035,3073797863,3073848296,3086119708,3087786680,3089398889,3089451715,3089454054,3089461994,3089735415,3094552970,3097888413,3098875466,3099276787,3104375123,3104503715,3105798493,3107144912,3107146953,3110631110,3110681545,3111601102,3111601746,3111606786,3114815727,3119543502,3119594433,3120807553,3120857998,3122897068,3125786613,3128821880,3133975234,3135838657,3136281421,3145164732,3147940006,3154068140,3154152867,3157412719,3157501664,3159380027,3160589879,3161016478,3161897203,3174437714,3180245112,3180300610,3182786585,3183126568,3183293814,3183325319,3184294753,3188347051,3191217062,3196370198,3197567695,3198643172,3198783739,3198824989,3198841920,3198930383,3199640352,3200095506,3203439089,3203573947,3203579445,3208441350,3209729826,3210506925,3210514725,3210570457,3214383466,3214394316,3214653823,3215790970,3217760577,3218901480,3218928718,3218996674,3218997101,3219339071,3219427268,3220535722,3220543483,3221757640,3223098753,3224727829,3232284385,3232339054,3234508143,3234559072,3235473148,3237969392,3243142044,3247991594,3253953941,3269910681,3270985722,3273573836,3273628995,3275986591,3277061645,3277112578,3277868236,3277980164,3278129999,3278154322,3280832255,3280992609,3283017533,3286262047,3290414111,3301409832,3301494567,3302526185,3302610918,3305712858,3305866028,3305950755,3309540327,3309590022,3309595898,3309596203,3309660560,3309660597,3309937069,3312550946,3312639405,3317007142,3317095593,3324397363,3331028046,3331525682,3331580349,3331802213,3332642035,3332696700,3333929978,3334870005,3334920442,3335058344,3335315569,3343940221,3345496201,3350023967,3353092349,3358586999,3365687143,3366763202,3368167300,3371155980,3372842751,3373802982,3374003367,3374007861,3374013921,3374033257,3374071862,3374072315,3374075119,3374222601,3374506623,3377952754,3382868701,3384928690,3388197033,3390931348,3391051206,3391063809,3391068622,3391334282,3391402631,3391423133,3391432603,3392425741,3394879910,3395277647,3399311251,3402270417,3404440519,3414226886,3414277321,3415566709,3417045783,3417060092,3418683074,3418733517,3424453774,3431921225,3437307073,3437430868,3437705452,3444401619,3445590826,3447374472,3456431399,3458638240,3461359920,3463272868,3468986640,3469121667,3471246134,3474393156,3474446194,3476056250,3478543821,3486841411,3486906847,3489097968,3491201265,3495569706,3496705474,3497897502,3497994843,3498252682,3502149957,3504414102,3504826781,3506839508,3506948350,3508950458,3509210745,3509498189,3511959565,3512025010,3512493029,3514111400,3517669498,3518790968,3521920341,3523035738,3523862571,3524226140,3530307622,3530358057,3536335853,3536792162,3538712404,3541452460,3541507619,3542648636,3544416242,3550676375,3551025439,3553383951,3556498831,3561501051,3561585780,3565016796,3565023071,3565174365,3565227623,3565288856,3566089568,3572109810,3575114019,3577841990,3586425916,3589694483,3591020567,3592221649,3594125448,3595182758,3596128381,3602035250,3602533630,3602552275,3604829927,3607233834,3607322789,3607604079,3608554389,3610981370,3617629034,3619761411,3623812162,3629877419,3636237811,3636292476,3639577654,3639632313,3645953597,3647523178,3649784978,3653883892,3660676457,3664234276,3674197367,3675513627,3681233287,3684650455,3688377898,3689406359,3692544695,3693437133,3694959415,3703294733,3704443907,3704956777,3706490306,3709178884,3709268355,3709272958,3717182590,3718660896,3719413702,3721853564,3731122282,3734934472,3736397122,3736397691,3738359136,3744502996,3744505315,3744515994,3744516038,3745225898,3745403285,3749377655,3751498613,3752631559,3753565240,3756319792,3758308501,3758308691,3761682835,3762386667,3762488637,3763193356,3763904751,3764062969,3764739038,3769398133,3770065529,3774076759,3779092995,3780318738,3781089827,3783201212,3785420602,3786786081,3788364543,3791375542,3791430201,3791912060,3792007260,3792147146,3793208754,3794029235,3805317549,3808957225,3809652473,3811984999,3812594538,3819295903,3819351056,3821104144,3821104746,3829518367,3832811824,3833121835,3833171090,3833706374,3838812042,3843969806,3844552031,3850681433,3851222744,3851541567,3851602009,3851679807,3853676291,3855415829,3856249405,3859110665,3859972063,3862928629,3865386916,3865396334,3873108359,3873163016,3876524049,3883472548,3885986978,3888196487,3895773227,3898366596,3900605466,3900796753,3906034907,3907036333,3914330405,3916906002,3922403377,3925982068,3933039724,3936549300,3939824482,3940957272,3941201834,3941535714,3943160335,3943296300,3950173236,3955179593,3959867562,3960938237,3961299015,3961303520,3961836502,3962329360,3963273426,3966271140,3969493837,3970184201,3971378905,3972349404,3972404563,3974206923,3977375686,3977639927,3981851856,3984175284,3984369770,3984383153,3984388901,3984577838,3986753035,3987449768,3988320676,3989122328,3989124781,3989300792,3991957101,3991978776,3992246021,3993156440,3995285601,4002046206,4002059123,4002298131,4007368305,4009075902,4012314248,4014272956,4018800601,4021398623,4022152923,4023242992,4034787018,4034837957,4040007159,4040507273,4040558214,4042630615,4042667369,4044815570,4044899805,4046325025,4051504220,4051593171,4059166898,4059387372,4060969098,4060986772,4062588735,4063625944,4063736412,4064813411,4074640059,4077930265,4080197122,4081731399,4081736449,4081740860,4081761692,4082508192,4082648933,4085037592,4085499470,4085741867,4086206754,4087477773,4087973382,4087974431,4087975312,4087977920,4087977986,4087982672,4087983230,4087984585,4087984590,4087984656,4087988411,4087993231,4087993234,4087993291,4087993428,4088004545,4089941093,4090379779,4094838531,4095533224,4098180267,4104794847,4104808845,4105491350,4105500480,4109580593,4111598640,4115797781,4116207257,4116258198,4116322118,4116406345,4116912946,4122262153,4126221625,4127308650,4128209898,4128210099,4128224738,4128228031,4128452341,4131804567,4131859224,4137741343,4141029933,4142953920,4145022541,4149201544,4150566897,4151710650,4152474623,4155185738,4156445644,4157556469,4157644922,4159136925,4159401066,4159780211,4159864444,4164601660,4166043368,4168091484,4169450331,4170161097,4170579962,4170925049,4171014006,4171016671,4171029715,4172482250,4175353143,4176008925,4178981053,4184703759,4186748423,4188894668,4189635776,4190045706,4190142208,4195146068,4196943735,4199824850,4203521301,4206809827,4206944958,4207535653,4208164707,4211585807,4215346074,4215356593,4218114605,4218115138,4218132009,4219656584,4219999876,4220379359,4221957810,4222018626,4225873997,4227433758,4228171984,4228217908,4228360888,4228368741,4228368760,4231583294,4231662792,4232149414,4232629512,4234942237,4235762280,4240864861,4241320459,4241740950,4242647335,4243702915,4245105172,4246629902,4248741847,4252833472,4252840599,4254781707,4254799704,4255058051,4260594638,4261873154,4261894730,4262104449,4262374147,4262375371,4262499171,4264253465,4265048576,4267292711,4271528787,4272039260,4272350188,4272417877,4276136562,4288066094,395,6205003,47871540,54631547,68945260,76317054,90122581,107533418,134757519,149084067,159782934,165071847,169736776,205527546,224032181,244603010,255553804,262051769,263431316,289494951,371032970,373243562,374621869,387545720,415171499,415171548,415171976,418990556,418990602,435420269,461226423,483976516,501379566,531625563,553327069,557914884,590191545,595217502,631419393,656131164,668816409,678957092,680578927,714686602,715141614,717942499,720974524,720974736,720975995,725617684,744932012,793535325,806495002,817571047,823641433,857348365,859756734,862586280,862607507,862637170,862767957,863187547,863261727,871542102,874127079,874448701,877175745,893771636,914435801,931438088,937200556,985925171,999743180,1015486168,1026348750,1029964103,1030875558,1083568115,1106088318,1206251138,1219433535,1220725895,1220852235,1220852260,1220852796,1220852957,1230410191,1236957398,1240508317,1242746690,1260212779,1282239389,1338160975,1340954405,1351436722,1361325259,1374669131,1374800320,1389479998,1389489864,1401511709,1421711922,1442213995,1451199708,1452449030,1467196671,1467386990,1490648152,1514073041,1515784934,1515785058,1523142552,1553174585,1554493328,1629584534,1641166031,1651813653,1651813852,1651813873,1651813877,1651814134,1661678914,1679178836,1704277516,1705410866,1705908110,1716909455,1772526810,1780819577,1792953560,1818263278,1821800212,1833750850,1834601376,1834613468,1866278547,1867401367,1877316119,1936236019,1945296852,1997464432,2003082032,2013078789,2055461758,2058918178,2080694907,2086814061,2089989988,2123843096,2170766397,2172738430,2174442073,2177527468,2178512614,2233637259,2246941078,2268386306,2274845447,2274845649,2279046513,2293400491,2299670458,2300280964,2300527715,2305877279,2307152224,2316307169,2322963439,2335588857,2337430377,2359562546,2360555826,2389375265,2396889473,2405952063,2419834458,2423179189,2436862648,2436862650,2436862651,2436862652,2436862653,2436862654,2436862655,2439178127,2460729245,2517521888,2517875246,2585317679,2631335866,2712012329,2717013248,2718435811,2726590321,2726667654,2726667661,2726667752,2726667756,2726667834,2726667995,2726668398,2726870506,2726991293,2737177336,2757711981,2787445139,2796817467,2812190333,2816464305,2817592022,2824075537,2826795200,2827908591,2830699603,2830965258,2841353452,2872823135,2876785673,2876785759,2901134565,2913059937,2938670220,2939089089,2943360116,2945389039,3005172573,3015670621,3022308183,3050185270,3050185436,3056015384,3056015484,3079506072,3079929644,3109459404,3116612793,3131379081,3149479373,3164097381,3176028223,3176996220,3183078197,3227651590,3234391576,3234432745,3278041418,3278041727,3278041816,3319967633,3330642108,3334769994,3354637514,3375261606,3375312977,3410061515,3410068256,3417365519,3423153883,3461071037,3473412940,3486684134,3504293483,3517650814,3547292615,3571189672,3593285841,3612407497,3654320918,3666061454,3666061458,3666061568,3666061577,3666061585,3666061591,3666061602,3666061610,3666061613,3666061619,3666061666,3666061672,3666061702,3666061706,3666061732,3666061760,3666061781,3666061864,3666061891,3666061895,3666061896,3666061902,3666061903,3666061913,3666062029,3666062293,3666062299,3666062326,3666062331,3666062345,3666062357,3666062361,3666062379,3666062386,3666062390,3666062391,3666062394,3666062408,3666062418,3666062422,3666062427,3666062453,3666062517,3666062569,3666062581,3666062582,3666062586,3666062587,3666099519,3667007182,3676644409,3676644411,3676644421,3676644429,3676644442,3676644586,3676644600,3676644610,3676644643,3676644706,3676644759,3676644775,3676644800,3676644806,3676644819,3676644874,3676644887,3676644888,3676644905,3676644939,3676644953,3676644982,3676645005,3676645006,3676645021,3676645049,3676645073,3691777760,3697941178,3708654452,3739453678,3749170769,3808938955,3809042458,3809042834,3820675046,3829710462,3829710568,3845152461,3847111189,3848170841,3848172796,3861225221,3871154340,3872238039,3877533355,3916589493,3952274701,3956209759,3956209883,3967179311,4020468984,4088042711,4088042763,4088043471,4098608917,4098609219,4098704176,4098704230,4098775844,4098776178,4098815877,4098816211,4126370696,4128194716,4152440610,4155818428,4160641621,4179162156,4189349925,4196060584,4224941776,4233200080,4233407375,4248600132,4259920717,4268151753,4268562148,0,0,0,31,32645503,343511425,1030334438,1035444912,1035444966,1126785125,1126785220,1126785554,1126785661,1160516735,1286944368,2016993734,2016993895,2496101809,2496102290,2496102373,2501069285,2501069363,2501069943,2506938014,2613448893,2668096359,2767610756,2943255975,3483670337,3483670475,3483670694,3483670995,3641922754,4206482405,4233599295,4,989615076,1348282182,2372695675,2793429742,473,2315777,2516160,11643297,13203897,21231554,35967653,38712935,47792331,72865995,74144458,82734700,83460346,105527502,113271207,133175084,133306274,134752460,139681591,140540365,149081424,153628834,159784149,160693466,187981691,192478478,196554557,201714711,248032557,257089230,271126044,284628322,288401789,293512087,299470436,301921344,303087651,310748895,315932160,317229038,318673258,321508235,328967865,331740776,333043316,343618051,344116268,349554276,368842915,373240553,380288946,385653806,387546555,391603917,397299232,399675396,407552584,411195e3,444280280,457925677,459126046,465045723,466546683,476300545,492825035,496262010,508940895,516076913,528158848,556967719,576308682,587182649,599016891,599034260,599035482,617473653,629010449,643159709,649306413,657763177,658030821,663498697,666920016,684079208,718967674,730892591,745170160,748876721,748886222,752803028,756281027,761348098,764441186,767592699,768148470,771634050,771637032,797075449,798164153,806496217,807477757,814547322,823640218,828791723,830209933,830328663,830812219,831086733,843422410,848961657,865242478,871543061,884068409,884552461,885566443,898403917,903718636,931459402,935392831,935834596,953760609,956026316,973201175,985556812,990107236,1002251210,1006286666,1015491227,1017212284,1017751931,1021423441,1026349709,1027559288,1039189287,1040655967,1048681185,1049173028,1069937338,1071441344,1072691903,1128950639,1139782538,1139843834,1141008431,1156523661,1160815779,1194239092,1197936283,1211577197,1211637010,1222641289,1240507358,1250860863,1264600767,1288872441,1321698432,1329660539,1338155660,1339210968,1373285759,1382125974,1390628516,1399578255,1399657308,1403708559,1408484449,1421977812,1432456391,1433498959,1468959011,1474134153,1481167509,1481892069,1485735468,1512063165,1514478145,1519263375,1522675342,1541305645,1542981532,1545890970,1547575222,1553720283,1557499238,1632730660,1635518266,1640297675,1644040136,1645084619,1672625515,1675268949,1675573659,1679183895,1701744405,1704282831,1705918154,1709094170,1740118996,1745197398,1746168006,1763490076,1764138250,1778504542,1804707890,1807895638,1812124962,1825087480,1826407997,1827997201,1834433178,1836295865,1836721468,1842831596,1855831597,1871287494,1874044309,1894472089,1911094612,1944286571,1945301911,1964668429,1992457158,2001245397,2005254865,2009607860,2045076089,2048724462,2072914399,2073220142,2080693816,2086817070,2091822363,2106898657,2116894487,2120589916,2132854800,2138833857,2149555928,2149786502,2159131792,2166792548,2193556503,2203826663,2222814745,2233632200,2234478015,2266871804,2270958851,2280109123,2300684501,2320975486,2363964101,2368015199,2368150205,2378859099,2402357659,2406246052,2420231640,2421832104,2429899162,2437980806,2442099500,2445444524,2450316872,2477231344,2480056360,2497381376,2511017726,2535682339,2548872209,2564758885,2577440767,2580206998,2581034625,2634443356,2647576485,2655498207,2659744440,2664398480,2665288759,2683912382,2685363948,2697995386,2705244823,2707054618,2722204667,2731911143,2746095604,2750223108,2751457001,2757038073,2757714990,2757832374,2763102979,2764615893,2768173321,2769632227,2788021838,2789621599,2804556717,2805563472,2808290141,2812672828,2813866328,2817995155,2823576784,2832963785,2833300206,2839929991,2842899363,2855442276,2856513455,2861724882,2873826097,2875201553,2889802328,2894057006,2902844704,2920776771,2938675535,2940382413,2940687092,2942499160,2944606430,2976147113,2999699036,3012594373,3014878073,3018472732,3021947486,3024482894,3027886950,3033143700,3041972547,3043054392,3061104959,3068421535,3068451149,3073259213,3076287128,3092740204,3097180103,3100000510,3103387337,3126517186,3134714387,3141033517,3153726305,3161099645,3164570023,3168616586,3171093691,3174505760,3178721795,3185964212,3199657339,3213212569,3227558031,3234959359,3242752110,3245911312,3250117513,3255207552,3263028169,3267416959,3271443733,3276067803,3303582289,3303582897,3303582994,3303614961,3327283712,3336973745,3344426237,3345667381,3346748653,3355942409,3358811093,3365430328,3371744816,3378392276,3393399711,3418876414,3451234301,3462047339,3466186248,3487461167,3489942689,3497005689,3511023565,3528253833,3567612396,3577832733,3577832874,3579570991,3581968529,3587382024,3594263141,3597175734,3609198260,3620670314,3644061745,3686687805,3699471696,3704450806,3719669200,3724302375,3732631655,3737867596,3737869333,3737882439,3743824089,3748450386,3755463030,3762725071,3780090414,3786960458,3789613664,3804622433,3826380201,3829814476,3834232417,3836376093,3843018675,3847110230,3849573984,3888536498,3895950835,3925391633,3927045026,3929681833,3930866393,3974478460,3989861270,3990612749,3994206764,3994206767,4003176468,4005639964,4013705057,4020891302,4040130402,4048452106,4055956024,4064081091,4069710253,4076793042,4078153021,4081704564,4090215578,4095557691,4103392506,4105790268,4130682685,4131077260,4150503708,4155492542,4165042016,4180101814,4186885299,4188349987,4190709408,4193373567,4197651626,4198443983,4202984206,4210375752,4212069506,4216891535,4228991204,4251429164,4263509307,4279717352,4282015733,0,0,0,2,898804372,2420122849,0,201,14034108,23188555,46966025,63548133,69988957,176179919,181602757,199230788,231162178,234878220,241015393,282017655,286917352,298380305,303225044,333040682,436746473,437068413,449019336,449464240,451920903,472319354,495318858,500388520,512606097,527005648,531402563,554651161,561857715,570474602,588675343,615779940,680838102,688229624,722503086,733631603,759879349,760863762,768579191,769161927,777931472,804592434,820388681,834351359,838060561,871806992,907959623,917609192,921095799,922653385,936253712,951807472,976944213,1057868108,1061438860,1097991931,1099387701,1118780323,1129127307,1134058690,1149298066,1173449599,1188365042,1221482277,1242510922,1244344576,1249042959,1256956692,1322375458,1340682260,1389219463,1394442279,1420709285,1468300758,1544881072,1554252850,1557974723,1564485910,1566036640,1637844009,1641584834,1668922875,1697481902,1700564263,1779722906,1817679755,1844196310,1862443027,1862944289,1863425670,1874439438,1918635827,1942164974,1953292144,1996832610,2005075462,2023914578,2171493616,2174172768,2200270403,2224853335,2232538822,2253530761,2271804726,2307427283,2314778321,2325064176,2347507979,2356867634,2422267260,2435625787,2442761119,2448910470,2454582508,2471444403,2478294033,2487762682,2505529649,2513007594,2514973059,2523046044,2584135332,2644823364,2645305307,2697781106,2700249759,2713921343,2858583336,2869381059,2875883974,2877426354,2906087318,2940183875,2941854634,2983778787,2991311078,3020661286,3033841873,3036938981,3061233249,3088839886,3090851e3,311688e4,3160125774,3173697968,3175256934,3193365922,3209525171,3247520471,3248874150,3262696949,3293334302,3294129343,3298593e3,3336190368,3342381501,3344449059,3367460946,3387371732,3391640312,3415133140,3415553447,3416872467,3486599559,3505446608,3554833241,3594782899,3615198865,3629910769,3642670614,3643744473,3654513786,3675702820,3697030868,3710380917,3732976135,3779661543,3795518186,3803370028,3804920752,3840174405,3861583079,3867650596,3894082090,3900359633,3942119031,3951224511,4009634354,4063453845,4065646590,4079144597,4096136978,4163056211,4180315949,4189523019,4196008531,4202817696,4241738188,4254148468,4265459019,4273759132,0,0,0,1,1058807915,0,5,1148034389,1373602048,2160920720,2391490885,2722440867]);function Mp(t,e,r,n){if(r>=n)return!1;let i=r,s=n-1;for(;i<=s;){let o=i+s>>>1,a=t[o];if(a<e)i=o+1;else if(a>e)s=o-1;else return!0}return!1}var Ua=new Uint32Array(20);function Kue(t,e){let r=5381,n=0;for(let i=t.length-1;i>=0;i-=1){let s=t.charCodeAt(i);if(s===46&&(Ua[n<<1]=r>>>0,Ua[(n<<1)+1]=i+1,n+=1,n===e))return n;r=r*33^s}return Ua[n<<1]=r>>>0,Ua[(n<<1)+1]=0,n+=1,n}function Vp(t,e,r){if(Wue(t,e,r))return;let{allowIcannDomains:n,allowPrivateDomains:i}=e,s=-1,o=0,a=0,c=1,u=Kue(t,kn[0]);for(let f=0;f<u;f+=1){let l=Ua[f<<1],p=Ua[(f<<1)+1],d=0;n&&(d=Mp(kn,l,c+1,c+kn[c]+1)?5:0),c+=kn[c]+1,i&&d===0&&(d=Mp(kn,l,c+1,c+kn[c]+1)?6:0),c+=kn[c]+1,n&&d===0&&!(o&4)&&(d=Mp(kn,l,c+1,c+kn[c]+1)?17:0),c+=kn[c]+1,i&&d===0&&!(o&4)&&(d=Mp(kn,l,c+1,c+kn[c]+1)?18:0),c+=kn[c]+1,n&&d===0&&!(o&4)&&a<=f&&(d=Mp(kn,l,c+1,c+kn[c]+1)?9:0),c+=kn[c]+1,i&&d===0&&!(o&4)&&a<=f&&(d=Mp(kn,l,c+1,c+kn[c]+1)?10:0),c+=kn[c]+1,d!==0&&(o=d,a=f+(d&16?2:1),s=p)}if(r.isIcann=(o&1)!==0,r.isPrivate=(o&2)!==0,s===-1){r.publicSuffix=u===1?t:t.slice(Ua[1]);return}if(o&4){r.publicSuffix=t.slice(Ua[(a-2<<1)+1]);return}if(o&16){if(a<u){r.publicSuffix=t.slice(Ua[(a-1<<1)+1]);return}let f=t.split(".");for(;f.length>a;)f.shift();r.publicSuffix=f.join(".");return}r.publicSuffix=t.slice(s)}var Xo=EM();function Gue(t,e={}){return Fp(t,5,Vp,e,EM())}function Jue(t,e={}){return sg(Xo),Fp(t,0,Vp,e,Xo).hostname}function Que(t,e={}){return sg(Xo),Fp(t,2,Vp,e,Xo).publicSuffix}function Yue(t,e={}){return sg(Xo),Fp(t,3,Vp,e,Xo).domain}function Zue(t,e={}){return sg(Xo),Fp(t,4,Vp,e,Xo).subdomain}function Xue(t,e={}){return sg(Xo),Fp(t,5,Vp,e,Xo).domainWithoutSuffix}Al.getDomain=Yue;Al.getDomainWithoutSuffix=Xue;Al.getHostname=Jue;Al.getPublicSuffix=Que;Al.getSubdomain=Zue;Al.parse=Gue});var RM=q((X4,AM)=>{(function(t,e){typeof X4=="object"&&typeof AM!="undefined"?e(X4):typeof define=="function"&&define.amd?define(["exports"],e):e(t.URI=t.URI||{})})(X4,function(t){"use strict";function e(){for(var y=arguments.length,m=Array(y),E=0;E<y;E++)m[E]=arguments[E];if(m.length>1){m[0]=m[0].slice(0,-1);for(var w=m.length-1,U=1;U<w;++U)m[U]=m[U].slice(1,-1);return m[w]=m[w].slice(1),m.join("")}else return m[0]}function r(y){return"(?:"+y+")"}function n(y){return y===void 0?"undefined":y===null?"null":Object.prototype.toString.call(y).split(" ").pop().split("]").shift().toLowerCase()}function i(y){return y.toUpperCase()}function s(y){return y!=null?y instanceof Array?y:typeof y.length!="number"||y.split||y.setInterval||y.call?[y]:Array.prototype.slice.call(y):[]}function o(y,m){var E=y;if(m)for(var w in m)E[w]=m[w];return E}function a(y){var m="[A-Za-z]",E="[\\x0D]",w="[0-9]",U="[\\x22]",ce=e(w,"[A-Fa-f]"),Ie="[\\x0A]",ut="[\\x20]",mt=r(r("%[EFef]"+ce+"%"+ce+ce+"%"+ce+ce)+"|"+r("%[89A-Fa-f]"+ce+"%"+ce+ce)+"|"+r("%"+ce+ce)),Qt="[\\:\\/\\?\\#\\[\\]\\@]",Re="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Yt=e(Qt,Re),br=y?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",sr=y?"[\\uE000-\\uF8FF]":"[]",Mt=e(m,w,"[\\-\\.\\_\\~]",br),Fr=r(m+e(m,w,"[\\+\\-\\.]")+"*"),tr=r(r(mt+"|"+e(Mt,Re,"[\\:]"))+"*"),Xc=r(r("25[0-5]")+"|"+r("2[0-4]"+w)+"|"+r("1"+w+w)+"|"+r("[1-9]"+w)+"|"+w),es=r(r("25[0-5]")+"|"+r("2[0-4]"+w)+"|"+r("1"+w+w)+"|"+r("0?[1-9]"+w)+"|0?0?"+w),Es=r(es+"\\."+es+"\\."+es+"\\."+es),or=r(ce+"{1,4}"),ts=r(r(or+"\\:"+or)+"|"+Es),Ts=r(r(or+"\\:")+"{6}"+ts),_o=r("\\:\\:"+r(or+"\\:")+"{5}"+ts),eu=r(r(or)+"?\\:\\:"+r(or+"\\:")+"{4}"+ts),oa=r(r(r(or+"\\:")+"{0,1}"+or)+"?\\:\\:"+r(or+"\\:")+"{3}"+ts),rm=r(r(r(or+"\\:")+"{0,2}"+or)+"?\\:\\:"+r(or+"\\:")+"{2}"+ts),$g=r(r(r(or+"\\:")+"{0,3}"+or)+"?\\:\\:"+or+"\\:"+ts),Mg=r(r(r(or+"\\:")+"{0,4}"+or)+"?\\:\\:"+ts),jl=r(r(r(or+"\\:")+"{0,5}"+or)+"?\\:\\:"+or),Ul=r(r(r(or+"\\:")+"{0,6}"+or)+"?\\:\\:"),aa=r([Ts,_o,eu,oa,rm,$g,Mg,jl,Ul].join("|")),ql=r(r(Mt+"|"+mt)+"+"),a8=r(aa+"\\%25"+ql),tu=r(aa+r("\\%25|\\%(?!"+ce+"{2})")+ql),nH=r("[vV]"+ce+"+\\."+e(Mt,Re,"[\\:]")+"+"),iH=r("\\["+r(tu+"|"+aa+"|"+nH)+"\\]"),iS=r(r(mt+"|"+e(Mt,Re))+"*"),nm=r(iH+"|"+Es+"(?!"+iS+")|"+iS),im=r(w+"*"),sS=r(r(tr+"@")+"?"+nm+r("\\:"+im)+"?"),sm=r(mt+"|"+e(Mt,Re,"[\\:\\@]")),sH=r(sm+"*"),oS=r(sm+"+"),oH=r(r(mt+"|"+e(Mt,Re,"[\\@]"))+"+"),ca=r(r("\\/"+sH)+"*"),Bl=r("\\/"+r(oS+ca)+"?"),c8=r(oH+ca),Fg=r(oS+ca),Hl="(?!"+sm+")",yge=r(ca+"|"+Bl+"|"+c8+"|"+Fg+"|"+Hl),zl=r(r(sm+"|"+e("[\\/\\?]",sr))+"*"),om=r(r(sm+"|[\\/\\?]")+"*"),aS=r(r("\\/\\/"+sS+ca)+"|"+Bl+"|"+Fg+"|"+Hl),aH=r(Fr+"\\:"+aS+r("\\?"+zl)+"?"+r("\\#"+om)+"?"),cH=r(r("\\/\\/"+sS+ca)+"|"+Bl+"|"+c8+"|"+Hl),uH=r(cH+r("\\?"+zl)+"?"+r("\\#"+om)+"?"),vge=r(aH+"|"+uH),xge=r(Fr+"\\:"+aS+r("\\?"+zl)+"?"),_ge="^("+Fr+")\\:"+r(r("\\/\\/("+r("("+tr+")@")+"?("+nm+")"+r("\\:("+im+")")+"?)")+"?("+ca+"|"+Bl+"|"+Fg+"|"+Hl+")")+r("\\?("+zl+")")+"?"+r("\\#("+om+")")+"?$",bge="^(){0}"+r(r("\\/\\/("+r("("+tr+")@")+"?("+nm+")"+r("\\:("+im+")")+"?)")+"?("+ca+"|"+Bl+"|"+c8+"|"+Hl+")")+r("\\?("+zl+")")+"?"+r("\\#("+om+")")+"?$",Sge="^("+Fr+")\\:"+r(r("\\/\\/("+r("("+tr+")@")+"?("+nm+")"+r("\\:("+im+")")+"?)")+"?("+ca+"|"+Bl+"|"+Fg+"|"+Hl+")")+r("\\?("+zl+")")+"?$",Ege="^"+r("\\#("+om+")")+"?$",Tge="^"+r("("+tr+")@")+"?("+nm+")"+r("\\:("+im+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",m,w,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",Mt,Re),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",Mt,Re),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",Mt,Re),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",Mt,Re),"g"),NOT_QUERY:new RegExp(e("[^\\%]",Mt,Re,"[\\:\\@\\/\\?]",sr),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",Mt,Re,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",Mt,Re),"g"),UNRESERVED:new RegExp(Mt,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",Mt,Yt),"g"),PCT_ENCODED:new RegExp(mt,"g"),IPV4ADDRESS:new RegExp("^("+Es+")$"),IPV6ADDRESS:new RegExp("^\\[?("+aa+")"+r(r("\\%25|\\%(?!"+ce+"{2})")+"("+ql+")")+"?\\]?$")}}var c=a(!1),u=a(!0),f=function(){function y(m,E){var w=[],U=!0,ce=!1,Ie=void 0;try{for(var ut=m[Symbol.iterator](),mt;!(U=(mt=ut.next()).done)&&(w.push(mt.value),!(E&&w.length===E));U=!0);}catch(Qt){ce=!0,Ie=Qt}finally{try{!U&&ut.return&&ut.return()}finally{if(ce)throw Ie}}return w}return function(m,E){if(Array.isArray(m))return m;if(Symbol.iterator in Object(m))return y(m,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(y){if(Array.isArray(y)){for(var m=0,E=Array(y.length);m<y.length;m++)E[m]=y[m];return E}else return Array.from(y)},p=2147483647,d=36,h=1,g=26,v=38,b=700,_=72,x=128,T="-",R=/^xn--/,V=/[^\0-\x7E]/,$=/[\x2E\u3002\uFF0E\uFF61]/g,K={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=d-h,W=Math.floor,D=String.fromCharCode;function P(y){throw new RangeError(K[y])}function M(y,m){for(var E=[],w=y.length;w--;)E[w]=m(y[w]);return E}function j(y,m){var E=y.split("@"),w="";E.length>1&&(w=E[0]+"@",y=E[1]),y=y.replace($,".");var U=y.split("."),ce=M(U,m).join(".");return w+ce}function J(y){for(var m=[],E=0,w=y.length;E<w;){var U=y.charCodeAt(E++);if(U>=55296&&U<=56319&&E<w){var ce=y.charCodeAt(E++);(ce&64512)==56320?m.push(((U&1023)<<10)+(ce&1023)+65536):(m.push(U),E--)}else m.push(U)}return m}var te=function(m){return String.fromCodePoint.apply(String,l(m))},re=function(m){return m-48<10?m-22:m-65<26?m-65:m-97<26?m-97:d},we=function(m,E){return m+22+75*(m<26)-((E!=0)<<5)},Q=function(m,E,w){var U=0;for(m=w?W(m/b):m>>1,m+=W(m/E);m>z*g>>1;U+=d)m=W(m/z);return W(U+(z+1)*m/(m+v))},F=function(m){var E=[],w=m.length,U=0,ce=x,Ie=_,ut=m.lastIndexOf(T);ut<0&&(ut=0);for(var mt=0;mt<ut;++mt)m.charCodeAt(mt)>=128&&P("not-basic"),E.push(m.charCodeAt(mt));for(var Qt=ut>0?ut+1:0;Qt<w;){for(var Re=U,Yt=1,br=d;;br+=d){Qt>=w&&P("invalid-input");var sr=re(m.charCodeAt(Qt++));(sr>=d||sr>W((p-U)/Yt))&&P("overflow"),U+=sr*Yt;var Mt=br<=Ie?h:br>=Ie+g?g:br-Ie;if(sr<Mt)break;var Fr=d-Mt;Yt>W(p/Fr)&&P("overflow"),Yt*=Fr}var tr=E.length+1;Ie=Q(U-Re,tr,Re==0),W(U/tr)>p-ce&&P("overflow"),ce+=W(U/tr),U%=tr,E.splice(U++,0,ce)}return String.fromCodePoint.apply(String,E)},Oe=function(m){var E=[];m=J(m);var w=m.length,U=x,ce=0,Ie=_,ut=!0,mt=!1,Qt=void 0;try{for(var Re=m[Symbol.iterator](),Yt;!(ut=(Yt=Re.next()).done);ut=!0){var br=Yt.value;br<128&&E.push(D(br))}}catch(tu){mt=!0,Qt=tu}finally{try{!ut&&Re.return&&Re.return()}finally{if(mt)throw Qt}}var sr=E.length,Mt=sr;for(sr&&E.push(T);Mt<w;){var Fr=p,tr=!0,Xc=!1,es=void 0;try{for(var Es=m[Symbol.iterator](),or;!(tr=(or=Es.next()).done);tr=!0){var ts=or.value;ts>=U&&ts<Fr&&(Fr=ts)}}catch(tu){Xc=!0,es=tu}finally{try{!tr&&Es.return&&Es.return()}finally{if(Xc)throw es}}var Ts=Mt+1;Fr-U>W((p-ce)/Ts)&&P("overflow"),ce+=(Fr-U)*Ts,U=Fr;var _o=!0,eu=!1,oa=void 0;try{for(var rm=m[Symbol.iterator](),$g;!(_o=($g=rm.next()).done);_o=!0){var Mg=$g.value;if(Mg<U&&++ce>p&&P("overflow"),Mg==U){for(var jl=ce,Ul=d;;Ul+=d){var aa=Ul<=Ie?h:Ul>=Ie+g?g:Ul-Ie;if(jl<aa)break;var ql=jl-aa,a8=d-aa;E.push(D(we(aa+ql%a8,0))),jl=W(ql/a8)}E.push(D(we(jl,0))),Ie=Q(ce,Ts,Mt==sr),ce=0,++Mt}}}catch(tu){eu=!0,oa=tu}finally{try{!_o&&rm.return&&rm.return()}finally{if(eu)throw oa}}++ce,++U}return E.join("")},ze=function(m){return j(m,function(E){return R.test(E)?F(E.slice(4).toLowerCase()):E})},pt=function(m){return j(m,function(E){return V.test(E)?"xn--"+Oe(E):E})},qe={version:"2.1.0",ucs2:{decode:J,encode:te},decode:F,encode:Oe,toASCII:pt,toUnicode:ze},Je={};function Te(y){var m=y.charCodeAt(0),E=void 0;return m<16?E="%0"+m.toString(16).toUpperCase():m<128?E="%"+m.toString(16).toUpperCase():m<2048?E="%"+(m>>6|192).toString(16).toUpperCase()+"%"+(m&63|128).toString(16).toUpperCase():E="%"+(m>>12|224).toString(16).toUpperCase()+"%"+(m>>6&63|128).toString(16).toUpperCase()+"%"+(m&63|128).toString(16).toUpperCase(),E}function ie(y){for(var m="",E=0,w=y.length;E<w;){var U=parseInt(y.substr(E+1,2),16);if(U<128)m+=String.fromCharCode(U),E+=3;else if(U>=194&&U<224){if(w-E>=6){var ce=parseInt(y.substr(E+4,2),16);m+=String.fromCharCode((U&31)<<6|ce&63)}else m+=y.substr(E,6);E+=6}else if(U>=224){if(w-E>=9){var Ie=parseInt(y.substr(E+4,2),16),ut=parseInt(y.substr(E+7,2),16);m+=String.fromCharCode((U&15)<<12|(Ie&63)<<6|ut&63)}else m+=y.substr(E,9);E+=9}else m+=y.substr(E,3),E+=3}return m}function he(y,m){function E(w){var U=ie(w);return U.match(m.UNRESERVED)?U:w}return y.scheme&&(y.scheme=String(y.scheme).replace(m.PCT_ENCODED,E).toLowerCase().replace(m.NOT_SCHEME,"")),y.userinfo!==void 0&&(y.userinfo=String(y.userinfo).replace(m.PCT_ENCODED,E).replace(m.NOT_USERINFO,Te).replace(m.PCT_ENCODED,i)),y.host!==void 0&&(y.host=String(y.host).replace(m.PCT_ENCODED,E).toLowerCase().replace(m.NOT_HOST,Te).replace(m.PCT_ENCODED,i)),y.path!==void 0&&(y.path=String(y.path).replace(m.PCT_ENCODED,E).replace(y.scheme?m.NOT_PATH:m.NOT_PATH_NOSCHEME,Te).replace(m.PCT_ENCODED,i)),y.query!==void 0&&(y.query=String(y.query).replace(m.PCT_ENCODED,E).replace(m.NOT_QUERY,Te).replace(m.PCT_ENCODED,i)),y.fragment!==void 0&&(y.fragment=String(y.fragment).replace(m.PCT_ENCODED,E).replace(m.NOT_FRAGMENT,Te).replace(m.PCT_ENCODED,i)),y}function Ee(y){return y.replace(/^0*(.*)/,"$1")||"0"}function Ce(y,m){var E=y.match(m.IPV4ADDRESS)||[],w=f(E,2),U=w[1];return U?U.split(".").map(Ee).join("."):y}function We(y,m){var E=y.match(m.IPV6ADDRESS)||[],w=f(E,3),U=w[1],ce=w[2];if(U){for(var Ie=U.toLowerCase().split("::").reverse(),ut=f(Ie,2),mt=ut[0],Qt=ut[1],Re=Qt?Qt.split(":").map(Ee):[],Yt=mt.split(":").map(Ee),br=m.IPV4ADDRESS.test(Yt[Yt.length-1]),sr=br?7:8,Mt=Yt.length-sr,Fr=Array(sr),tr=0;tr<sr;++tr)Fr[tr]=Re[tr]||Yt[Mt+tr]||"";br&&(Fr[sr-1]=Ce(Fr[sr-1],m));var Xc=Fr.reduce(function(Ts,_o,eu){if(!_o||_o==="0"){var oa=Ts[Ts.length-1];oa&&oa.index+oa.length===eu?oa.length++:Ts.push({index:eu,length:1})}return Ts},[]),es=Xc.sort(function(Ts,_o){return _o.length-Ts.length})[0],Es=void 0;if(es&&es.length>1){var or=Fr.slice(0,es.index),ts=Fr.slice(es.index+es.length);Es=or.join(":")+"::"+ts.join(":")}else Es=Fr.join(":");return ce&&(Es+="%"+ce),Es}else return y}var me=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Nt="".match(/(){0}/)[1]===void 0;function G(y){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E={},w=m.iri!==!1?u:c;m.reference==="suffix"&&(y=(m.scheme?m.scheme+":":"")+"//"+y);var U=y.match(me);if(U){Nt?(E.scheme=U[1],E.userinfo=U[3],E.host=U[4],E.port=parseInt(U[5],10),E.path=U[6]||"",E.query=U[7],E.fragment=U[8],isNaN(E.port)&&(E.port=U[5])):(E.scheme=U[1]||void 0,E.userinfo=y.indexOf("@")!==-1?U[3]:void 0,E.host=y.indexOf("//")!==-1?U[4]:void 0,E.port=parseInt(U[5],10),E.path=U[6]||"",E.query=y.indexOf("?")!==-1?U[7]:void 0,E.fragment=y.indexOf("#")!==-1?U[8]:void 0,isNaN(E.port)&&(E.port=y.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?U[4]:void 0)),E.host&&(E.host=We(Ce(E.host,w),w)),E.scheme===void 0&&E.userinfo===void 0&&E.host===void 0&&E.port===void 0&&!E.path&&E.query===void 0?E.reference="same-document":E.scheme===void 0?E.reference="relative":E.fragment===void 0?E.reference="absolute":E.reference="uri",m.reference&&m.reference!=="suffix"&&m.reference!==E.reference&&(E.error=E.error||"URI is not a "+m.reference+" reference.");var ce=Je[(m.scheme||E.scheme||"").toLowerCase()];if(!m.unicodeSupport&&(!ce||!ce.unicodeSupport)){if(E.host&&(m.domainHost||ce&&ce.domainHost))try{E.host=qe.toASCII(E.host.replace(w.PCT_ENCODED,ie).toLowerCase())}catch(Ie){E.error=E.error||"Host's domain name can not be converted to ASCII via punycode: "+Ie}he(E,c)}else he(E,w);ce&&ce.parse&&ce.parse(E,m)}else E.error=E.error||"URI can not be parsed.";return E}function ve(y,m){var E=m.iri!==!1?u:c,w=[];return y.userinfo!==void 0&&(w.push(y.userinfo),w.push("@")),y.host!==void 0&&w.push(We(Ce(String(y.host),E),E).replace(E.IPV6ADDRESS,function(U,ce,Ie){return"["+ce+(Ie?"%25"+Ie:"")+"]"})),(typeof y.port=="number"||typeof y.port=="string")&&(w.push(":"),w.push(String(y.port))),w.length?w.join(""):void 0}var at=/^\.\.?\//,Gt=/^\/\.(\/|$)/,wr=/^\/\.\.(\/|$)/,Ht=/^\/?(?:.|\n)*?(?=\/|$)/;function en(y){for(var m=[];y.length;)if(y.match(at))y=y.replace(at,"");else if(y.match(Gt))y=y.replace(Gt,"/");else if(y.match(wr))y=y.replace(wr,"/"),m.pop();else if(y==="."||y==="..")y="";else{var E=y.match(Ht);if(E){var w=E[0];y=y.slice(w.length),m.push(w)}else throw new Error("Unexpected dot segment condition")}return m.join("")}function _n(y){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=m.iri?u:c,w=[],U=Je[(m.scheme||y.scheme||"").toLowerCase()];if(U&&U.serialize&&U.serialize(y,m),y.host&&!E.IPV6ADDRESS.test(y.host)){if(m.domainHost||U&&U.domainHost)try{y.host=m.iri?qe.toUnicode(y.host):qe.toASCII(y.host.replace(E.PCT_ENCODED,ie).toLowerCase())}catch(ut){y.error=y.error||"Host's domain name can not be converted to "+(m.iri?"Unicode":"ASCII")+" via punycode: "+ut}}he(y,E),m.reference!=="suffix"&&y.scheme&&(w.push(y.scheme),w.push(":"));var ce=ve(y,m);if(ce!==void 0&&(m.reference!=="suffix"&&w.push("//"),w.push(ce),y.path&&y.path.charAt(0)!=="/"&&w.push("/")),y.path!==void 0){var Ie=y.path;!m.absolutePath&&(!U||!U.absolutePath)&&(Ie=en(Ie)),ce===void 0&&(Ie=Ie.replace(/^\/\//,"/%2F")),w.push(Ie)}return y.query!==void 0&&(w.push("?"),w.push(y.query)),y.fragment!==void 0&&(w.push("#"),w.push(y.fragment)),w.join("")}function fn(y,m){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=arguments[3],U={};return w||(y=G(_n(y,E),E),m=G(_n(m,E),E)),E=E||{},!E.tolerant&&m.scheme?(U.scheme=m.scheme,U.userinfo=m.userinfo,U.host=m.host,U.port=m.port,U.path=en(m.path||""),U.query=m.query):(m.userinfo!==void 0||m.host!==void 0||m.port!==void 0?(U.userinfo=m.userinfo,U.host=m.host,U.port=m.port,U.path=en(m.path||""),U.query=m.query):(m.path?(m.path.charAt(0)==="/"?U.path=en(m.path):((y.userinfo!==void 0||y.host!==void 0||y.port!==void 0)&&!y.path?U.path="/"+m.path:y.path?U.path=y.path.slice(0,y.path.lastIndexOf("/")+1)+m.path:U.path=m.path,U.path=en(U.path)),U.query=m.query):(U.path=y.path,m.query!==void 0?U.query=m.query:U.query=y.query),U.userinfo=y.userinfo,U.host=y.host,U.port=y.port),U.scheme=y.scheme),U.fragment=m.fragment,U}function tn(y,m,E){var w=o({scheme:"null"},E);return _n(fn(G(y,w),G(m,w),w,!0),w)}function bn(y,m){return typeof y=="string"?y=_n(G(y,m),m):n(y)==="object"&&(y=G(_n(y,m),m)),y}function vo(y,m,E){return typeof y=="string"?y=_n(G(y,E),E):n(y)==="object"&&(y=_n(y,E)),typeof m=="string"?m=_n(G(m,E),E):n(m)==="object"&&(m=_n(m,E)),y===m}function xo(y,m){return y&&y.toString().replace(!m||!m.iri?c.ESCAPE:u.ESCAPE,Te)}function Fn(y,m){return y&&y.toString().replace(!m||!m.iri?c.PCT_ENCODED:u.PCT_ENCODED,ie)}var di={scheme:"http",domainHost:!0,parse:function(m,E){return m.host||(m.error=m.error||"HTTP URIs must have a host."),m},serialize:function(m,E){var w=String(m.scheme).toLowerCase()==="https";return(m.port===(w?443:80)||m.port==="")&&(m.port=void 0),m.path||(m.path="/"),m}},O={scheme:"https",domainHost:di.domainHost,parse:di.parse,serialize:di.serialize};function X(y){return typeof y.secure=="boolean"?y.secure:String(y.scheme).toLowerCase()==="wss"}var fe={scheme:"ws",domainHost:!0,parse:function(m,E){var w=m;return w.secure=X(w),w.resourceName=(w.path||"/")+(w.query?"?"+w.query:""),w.path=void 0,w.query=void 0,w},serialize:function(m,E){if((m.port===(X(m)?443:80)||m.port==="")&&(m.port=void 0),typeof m.secure=="boolean"&&(m.scheme=m.secure?"wss":"ws",m.secure=void 0),m.resourceName){var w=m.resourceName.split("?"),U=f(w,2),ce=U[0],Ie=U[1];m.path=ce&&ce!=="/"?ce:void 0,m.query=Ie,m.resourceName=void 0}return m.fragment=void 0,m}},Me={scheme:"wss",domainHost:fe.domainHost,parse:fe.parse,serialize:fe.serialize},Jt={},Lt=!0,$t="[A-Za-z0-9\\-\\.\\_\\~"+(Lt?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Ct="[0-9A-Fa-f]",$r=r(r("%[EFef]"+Ct+"%"+Ct+Ct+"%"+Ct+Ct)+"|"+r("%[89A-Fa-f]"+Ct+"%"+Ct+Ct)+"|"+r("%"+Ct+Ct)),kt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ur="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",zt=e(ur,'[\\"\\\\]'),lr="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Mr=new RegExp($t,"g"),Zs=new RegExp($r,"g"),Ig=new RegExp(e("[^]",kt,"[\\.]",'[\\"]',zt),"g"),tm=new RegExp(e("[^]",$t,lr),"g"),Dg=tm;function Vl(y){var m=ie(y);return m.match(Mr)?m:y}var Lg={scheme:"mailto",parse:function(m,E){var w=m,U=w.to=w.path?w.path.split(","):[];if(w.path=void 0,w.query){for(var ce=!1,Ie={},ut=w.query.split("&"),mt=0,Qt=ut.length;mt<Qt;++mt){var Re=ut[mt].split("=");switch(Re[0]){case"to":for(var Yt=Re[1].split(","),br=0,sr=Yt.length;br<sr;++br)U.push(Yt[br]);break;case"subject":w.subject=Fn(Re[1],E);break;case"body":w.body=Fn(Re[1],E);break;default:ce=!0,Ie[Fn(Re[0],E)]=Fn(Re[1],E);break}}ce&&(w.headers=Ie)}w.query=void 0;for(var Mt=0,Fr=U.length;Mt<Fr;++Mt){var tr=U[Mt].split("@");if(tr[0]=Fn(tr[0]),E.unicodeSupport)tr[1]=Fn(tr[1],E).toLowerCase();else try{tr[1]=qe.toASCII(Fn(tr[1],E).toLowerCase())}catch(Xc){w.error=w.error||"Email address's domain name can not be converted to ASCII via punycode: "+Xc}U[Mt]=tr.join("@")}return w},serialize:function(m,E){var w=m,U=s(m.to);if(U){for(var ce=0,Ie=U.length;ce<Ie;++ce){var ut=String(U[ce]),mt=ut.lastIndexOf("@"),Qt=ut.slice(0,mt).replace(Zs,Vl).replace(Zs,i).replace(Ig,Te),Re=ut.slice(mt+1);try{Re=E.iri?qe.toUnicode(Re):qe.toASCII(Fn(Re,E).toLowerCase())}catch(Mt){w.error=w.error||"Email address's domain name can not be converted to "+(E.iri?"Unicode":"ASCII")+" via punycode: "+Mt}U[ce]=Qt+"@"+Re}w.path=U.join(",")}var Yt=m.headers=m.headers||{};m.subject&&(Yt.subject=m.subject),m.body&&(Yt.body=m.body);var br=[];for(var sr in Yt)Yt[sr]!==Jt[sr]&&br.push(sr.replace(Zs,Vl).replace(Zs,i).replace(tm,Te)+"="+Yt[sr].replace(Zs,Vl).replace(Zs,i).replace(Dg,Te));return br.length&&(w.query=br.join("&")),w}},B=/^([^\:]+)\:(.*)/,S={scheme:"urn",parse:function(m,E){var w=m.path&&m.path.match(B),U=m;if(w){var ce=E.scheme||U.scheme||"urn",Ie=w[1].toLowerCase(),ut=w[2],mt=ce+":"+(E.nid||Ie),Qt=Je[mt];U.nid=Ie,U.nss=ut,U.path=void 0,Qt&&(U=Qt.parse(U,E))}else U.error=U.error||"URN can not be parsed.";return U},serialize:function(m,E){var w=E.scheme||m.scheme||"urn",U=m.nid,ce=w+":"+(E.nid||U),Ie=Je[ce];Ie&&(m=Ie.serialize(m,E));var ut=m,mt=m.nss;return ut.path=(U||E.nid)+":"+mt,ut}},I=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,L={scheme:"urn:uuid",parse:function(m,E){var w=m;return w.uuid=w.nss,w.nss=void 0,!E.tolerant&&(!w.uuid||!w.uuid.match(I))&&(w.error=w.error||"UUID is not valid."),w},serialize:function(m,E){var w=m;return w.nss=(m.uuid||"").toLowerCase(),w}};Je[di.scheme]=di,Je[O.scheme]=O,Je[fe.scheme]=fe,Je[Me.scheme]=Me,Je[Lg.scheme]=Lg,Je[S.scheme]=S,Je[L.scheme]=L,t.SCHEMES=Je,t.pctEncChar=Te,t.pctDecChars=ie,t.parse=G,t.removeDotSegments=en,t.serialize=_n,t.resolveComponents=fn,t.resolve=tn,t.normalize=bn,t.equal=vo,t.escapeComponent=xo,t.unescapeComponent=Fn,Object.defineProperty(t,"__esModule",{value:!0})})});var ev=q((TBe,PM)=>{"use strict";PM.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var OM=q((CBe,NM)=>{"use strict";NM.exports=function(e){for(var r=0,n=e.length,i=0,s;i<n;)r++,s=e.charCodeAt(i++),s>=55296&&s<=56319&&i<n&&(s=e.charCodeAt(i),(s&64512)==56320&&i++);return r}});var Rl=q((kBe,LM)=>{"use strict";LM.exports={copy:ile,checkDataType:u_,checkDataTypes:sle,coerceToTypes:ole,toHash:f_,getProperty:d_,escapeQuotes:p_,equal:ev(),ucs2length:OM(),varOccurences:ule,varReplace:lle,schemaHasRules:fle,schemaHasRulesExcept:dle,schemaUnknownRules:ple,toQuotedString:l_,getPathExpr:mle,getPath:hle,getData:vle,unescapeFragment:xle,unescapeJsonPointer:h_,escapeFragment:_le,escapeJsonPointer:m_};function ile(t,e){e=e||{};for(var r in t)e[r]=t[r];return e}function u_(t,e,r,n){var i=n?" !== ":" === ",s=n?" || ":" && ",o=n?"!":"",a=n?"":"!";switch(t){case"null":return e+i+"null";case"array":return o+"Array.isArray("+e+")";case"object":return"("+o+e+s+"typeof "+e+i+'"object"'+s+a+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+i+'"number"'+s+a+"("+e+" % 1)"+s+e+i+e+(r?s+o+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+i+'"'+t+'"'+(r?s+o+"isFinite("+e+")":"")+")";default:return"typeof "+e+i+'"'+t+'"'}}function sle(t,e,r){switch(t.length){case 1:return u_(t[0],e,r,!0);default:var n="",i=f_(t);i.array&&i.object&&(n=i.null?"(":"(!"+e+" || ",n+="typeof "+e+' !== "object")',delete i.null,delete i.array,delete i.object),i.number&&delete i.integer;for(var s in i)n+=(n?" && ":"")+u_(s,e,r,!0);return n}}var IM=f_(["string","number","integer","boolean","null"]);function ole(t,e){if(Array.isArray(e)){for(var r=[],n=0;n<e.length;n++){var i=e[n];(IM[i]||t==="array"&&i==="array")&&(r[r.length]=i)}if(r.length)return r}else{if(IM[e])return[e];if(t==="array"&&e==="array")return["array"]}}function f_(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!0;return e}var ale=/^[a-z$_][a-z$_0-9]*$/i,cle=/'|\\/g;function d_(t){return typeof t=="number"?"["+t+"]":ale.test(t)?"."+t:"['"+p_(t)+"']"}function p_(t){return t.replace(cle,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function ule(t,e){e+="[^0-9]";var r=t.match(new RegExp(e,"g"));return r?r.length:0}function lle(t,e,r){return e+="([^0-9])",r=r.replace(/\$/g,"$$$$"),t.replace(new RegExp(e,"g"),r+"$1")}function fle(t,e){if(typeof t=="boolean")return!t;for(var r in t)if(e[r])return!0}function dle(t,e,r){if(typeof t=="boolean")return!t&&r!="not";for(var n in t)if(n!=r&&e[n])return!0}function ple(t,e){if(typeof t!="boolean"){for(var r in t)if(!e[r])return r}}function l_(t){return"'"+p_(t)+"'"}function mle(t,e,r,n){var i=r?"'/' + "+e+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return DM(t,i)}function hle(t,e,r){var n=l_(r?"/"+m_(e):d_(e));return DM(t,n)}var gle=/^\/(?:[^~]|~0|~1)*$/,yle=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function vle(t,e,r){var n,i,s,o;if(t==="")return"rootData";if(t[0]=="/"){if(!gle.test(t))throw new Error("Invalid JSON-pointer: "+t);i=t,s="rootData"}else{if(o=t.match(yle),!o)throw new Error("Invalid JSON-pointer: "+t);if(n=+o[1],i=o[2],i=="#"){if(n>=e)throw new Error("Cannot access property/index "+n+" levels up, current level is "+e);return r[e-n]}if(n>e)throw new Error("Cannot access data "+n+" levels up, current level is "+e);if(s="data"+(e-n||""),!i)return s}for(var a=s,c=i.split("/"),u=0;u<c.length;u++){var f=c[u];f&&(s+=d_(h_(f)),a+=" && "+s)}return a}function DM(t,e){return t=='""'?e:(t+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function xle(t){return h_(decodeURIComponent(t))}function _le(t){return encodeURIComponent(m_(t))}function m_(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function h_(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}});var g_=q((wBe,$M)=>{"use strict";var ble=Rl();$M.exports=Sle;function Sle(t){ble.copy(t,this)}});var FM=q((ABe,MM)=>{"use strict";var zc=MM.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};tv(e,n,i,t,"",t)};zc.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};zc.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};zc.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};zc.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function tv(t,e,r,n,i,s,o,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,a,c,u);for(var f in n){var l=n[f];if(Array.isArray(l)){if(f in zc.arrayKeywords)for(var p=0;p<l.length;p++)tv(t,e,r,l[p],i+"/"+f+"/"+p,s,i,f,n,p)}else if(f in zc.propsKeywords){if(l&&typeof l=="object")for(var d in l)tv(t,e,r,l[d],i+"/"+f+"/"+Ele(d),s,i,f,n,d)}else(f in zc.keywords||t.allKeys&&!(f in zc.skipKeywords))&&tv(t,e,r,l,i+"/"+f,s,i,f,n)}r(n,i,s,o,a,c,u)}}function Ele(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var av=q((RBe,qM)=>{"use strict";var ag=RM(),VM=ev(),sv=Rl(),rv=g_(),Tle=FM();qM.exports=Kc;Kc.normalizeId=Wc;Kc.fullPath=nv;Kc.url=iv;Kc.ids=Rle;Kc.inlineRef=y_;Kc.schema=ov;function Kc(t,e,r){var n=this._refs[r];if(typeof n=="string")if(this._refs[n])n=this._refs[n];else return Kc.call(this,t,e,n);if(n=n||this._schemas[r],n instanceof rv)return y_(n.schema,this._opts.inlineRefs)?n.schema:n.validate||this._compile(n);var i=ov.call(this,e,r),s,o,a;return i&&(s=i.schema,e=i.root,a=i.baseId),s instanceof rv?o=s.validate||t.call(this,s.schema,e,void 0,a):s!==void 0&&(o=y_(s,this._opts.inlineRefs)?s:t.call(this,s,e,void 0,a)),o}function ov(t,e){var r=ag.parse(e),n=UM(r),i=nv(this._getId(t.schema));if(Object.keys(t.schema).length===0||n!==i){var s=Wc(n),o=this._refs[s];if(typeof o=="string")return Cle.call(this,t,o,r);if(o instanceof rv)o.validate||this._compile(o),t=o;else if(o=this._schemas[s],o instanceof rv){if(o.validate||this._compile(o),s==Wc(e))return{schema:o,root:t,baseId:i};t=o}else return;if(!t.schema)return;i=nv(this._getId(t.schema))}return jM.call(this,r,i,t.schema,t)}function Cle(t,e,r){var n=ov.call(this,t,e);if(n){var i=n.schema,s=n.baseId;t=n.root;var o=this._getId(i);return o&&(s=iv(s,o)),jM.call(this,r,s,i,t)}}var kle=sv.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function jM(t,e,r,n){if(t.fragment=t.fragment||"",t.fragment.slice(0,1)=="/"){for(var i=t.fragment.split("/"),s=1;s<i.length;s++){var o=i[s];if(o){if(o=sv.unescapeFragment(o),r=r[o],r===void 0)break;var a;if(!kle[o]&&(a=this._getId(r),a&&(e=iv(e,a)),r.$ref)){var c=iv(e,r.$ref),u=ov.call(this,n,c);u&&(r=u.schema,n=u.root,e=u.baseId)}}}if(r!==void 0&&r!==n.schema)return{schema:r,root:n,baseId:e}}}var wle=sv.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function y_(t,e){if(e===!1)return!1;if(e===void 0||e===!0)return v_(t);if(e)return x_(t)<=e}function v_(t){var e;if(Array.isArray(t)){for(var r=0;r<t.length;r++)if(e=t[r],typeof e=="object"&&!v_(e))return!1}else for(var n in t)if(n=="$ref"||(e=t[n],typeof e=="object"&&!v_(e)))return!1;return!0}function x_(t){var e=0,r;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(r=t[n],typeof r=="object"&&(e+=x_(r)),e==1/0)return 1/0}else for(var i in t){if(i=="$ref")return 1/0;if(wle[i])e++;else if(r=t[i],typeof r=="object"&&(e+=x_(r)+1),e==1/0)return 1/0}return e}function nv(t,e){e!==!1&&(t=Wc(t));var r=ag.parse(t);return UM(r)}function UM(t){return ag.serialize(t).split("#")[0]+"#"}var Ale=/#\/?$/;function Wc(t){return t?t.replace(Ale,""):""}function iv(t,e){return e=Wc(e),ag.resolve(t,e)}function Rle(t){var e=Wc(this._getId(t)),r={"":e},n={"":nv(e,!1)},i={},s=this;return Tle(t,{allKeys:!0},function(o,a,c,u,f,l,p){if(a!==""){var d=s._getId(o),h=r[u],g=n[u]+"/"+f;if(p!==void 0&&(g+="/"+(typeof p=="number"?p:sv.escapeFragment(p))),typeof d=="string"){d=h=Wc(h?ag.resolve(h,d):d);var v=s._refs[d];if(typeof v=="string"&&(v=s._refs[v]),v&&v.schema){if(!VM(o,v.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=Wc(g))if(d[0]=="#"){if(i[d]&&!VM(o,i[d]))throw new Error('id "'+d+'" resolves to more than one schema');i[d]=o}else s._refs[d]=g}r[a]=h,n[a]=g}}),i}});var cv=q((PBe,HM)=>{"use strict";var __=av();HM.exports={Validation:BM(Ple),MissingRef:BM(b_)};function Ple(t){this.message="validation failed",this.errors=t,this.ajv=this.validation=!0}b_.message=function(t,e){return"can't resolve reference "+e+" from id "+t};function b_(t,e,r){this.message=r||b_.message(t,e),this.missingRef=__.url(t,e),this.missingSchema=__.normalizeId(__.fullPath(this.missingRef))}function BM(t){return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}});var S_=q((NBe,zM)=>{"use strict";zM.exports=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&function(s){return function(o){return function(a,c){var u={key:a,value:o[a]},f={key:c,value:o[c]};return s(u,f)}}}(e.cmp),i=[];return function s(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o!==void 0){if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);var a,c;if(Array.isArray(o)){for(c="[",a=0;a<o.length;a++)a&&(c+=","),c+=s(o[a])||"null";return c+"]"}if(o===null)return"null";if(i.indexOf(o)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=i.push(o)-1,f=Object.keys(o).sort(n&&n(o));for(c="",a=0;a<f.length;a++){var l=f[a],p=s(o[l]);p&&(c&&(c+=","),c+=JSON.stringify(l)+":"+p)}return i.splice(u,1),"{"+c+"}"}}(t)}});var E_=q((OBe,WM)=>{"use strict";WM.exports=function(e,r,n){var i="",s=e.schema.$async===!0,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),a=e.self._getId(e.schema);if(e.opts.strictKeywords){var c=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(c){var u="unknown keyword: "+c;if(e.opts.strictKeywords==="log")e.logger.warn(u);else throw new Error(u)}}if(e.isTop&&(i+=" var validate = ",s&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",a&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" "+("/*# sourceURL="+a+" */")+" ")),typeof e.schema=="boolean"||!(o||e.schema.$ref)){var r="false schema",f=e.level,l=e.dataLevel,p=e.schema[r],d=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,R=!e.opts.allErrors,K,g="data"+(l||""),T="valid"+f;if(e.schema===!1){e.isTop?R=!0:i+=" var "+T+" = false; ";var v=v||[];v.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(K||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),i+=" } "):i+=" {} ";var b=i;i=v.pop(),!e.compositeRule&&R?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?s?i+=" return data; ":i+=" validate.errors = null; return true; ":i+=" var "+T+" = true; ";return e.isTop&&(i+=" }; return validate; "),i}if(e.isTop){var _=e.isTop,f=e.level=0,l=e.dataLevel=0,g="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var x="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(x);else throw new Error(x)}i+=" var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data; "}else{var f=e.level,l=e.dataLevel,g="data"+(l||"");if(a&&(e.baseId=e.resolve.url(e.baseId,a)),s&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+f+" = errors;"}var T="valid"+f,R=!e.opts.allErrors,V="",$="",K,z=e.schema.type,W=Array.isArray(z);if(z&&e.opts.nullable&&e.schema.nullable===!0&&(W?z.indexOf("null")==-1&&(z=z.concat("null")):z!="null"&&(z=[z,"null"],W=!0)),W&&z.length==1&&(z=z[0],W=!1),e.schema.$ref&&o){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(o=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),z){if(e.opts.coerceTypes)var D=e.util.coerceToTypes(e.opts.coerceTypes,z);var P=e.RULES.types[z];if(D||W||P===!0||P&&!Ht(P)){var d=e.schemaPath+".type",h=e.errSchemaPath+"/type",d=e.schemaPath+".type",h=e.errSchemaPath+"/type",M=W?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[M](z,g,e.opts.strictNumbers,!0)+") { ",D){var j="dataType"+f,J="coerced"+f;i+=" var "+j+" = typeof "+g+"; var "+J+" = undefined; ",e.opts.coerceTypes=="array"&&(i+=" if ("+j+" == 'object' && Array.isArray("+g+") && "+g+".length == 1) { "+g+" = "+g+"[0]; "+j+" = typeof "+g+"; if ("+e.util.checkDataType(e.schema.type,g,e.opts.strictNumbers)+") "+J+" = "+g+"; } "),i+=" if ("+J+" !== undefined) ; ";var te=D;if(te)for(var re,we=-1,Q=te.length-1;we<Q;)re=te[we+=1],re=="string"?i+=" else if ("+j+" == 'number' || "+j+" == 'boolean') "+J+" = '' + "+g+"; else if ("+g+" === null) "+J+" = ''; ":re=="number"||re=="integer"?(i+=" else if ("+j+" == 'boolean' || "+g+" === null || ("+j+" == 'string' && "+g+" && "+g+" == +"+g+" ",re=="integer"&&(i+=" && !("+g+" % 1)"),i+=")) "+J+" = +"+g+"; "):re=="boolean"?i+=" else if ("+g+" === 'false' || "+g+" === 0 || "+g+" === null) "+J+" = false; else if ("+g+" === 'true' || "+g+" === 1) "+J+" = true; ":re=="null"?i+=" else if ("+g+" === '' || "+g+" === 0 || "+g+" === false) "+J+" = null; ":e.opts.coerceTypes=="array"&&re=="array"&&(i+=" else if ("+j+" == 'string' || "+j+" == 'number' || "+j+" == 'boolean' || "+g+" == null) "+J+" = ["+g+"]; ");i+=" else { ";var v=v||[];v.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(K||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { type: '",W?i+=""+z.join(","):i+=""+z,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",W?i+=""+z.join(","):i+=""+z,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),i+=" } "):i+=" {} ";var b=i;i=v.pop(),!e.compositeRule&&R?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } if ("+J+" !== undefined) { ";var F=l?"data"+(l-1||""):"parentData",Oe=l?e.dataPathArr[l]:"parentDataProperty";i+=" "+g+" = "+J+"; ",l||(i+="if ("+F+" !== undefined)"),i+=" "+F+"["+Oe+"] = "+J+"; } "}else{var v=v||[];v.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(K||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { type: '",W?i+=""+z.join(","):i+=""+z,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",W?i+=""+z.join(","):i+=""+z,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),i+=" } "):i+=" {} ";var b=i;i=v.pop(),!e.compositeRule&&R?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}i+=" } "}}if(e.schema.$ref&&!o)i+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",R&&(i+=" } if (errors === ",_?i+="0":i+="errs_"+f,i+=") { ",$+="}");else{var ze=e.RULES;if(ze){for(var P,pt=-1,qe=ze.length-1;pt<qe;)if(P=ze[pt+=1],Ht(P)){if(P.type&&(i+=" if ("+e.util.checkDataType(P.type,g,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(P.type=="object"&&e.schema.properties){var p=e.schema.properties,Je=Object.keys(p),Te=Je;if(Te)for(var ie,he=-1,Ee=Te.length-1;he<Ee;){ie=Te[he+=1];var Ce=p[ie];if(Ce.default!==void 0){var We=g+e.util.getProperty(ie);if(e.compositeRule){if(e.opts.strictDefaults){var x="default is ignored for: "+We;if(e.opts.strictDefaults==="log")e.logger.warn(x);else throw new Error(x)}}else i+=" if ("+We+" === undefined ",e.opts.useDefaults=="empty"&&(i+=" || "+We+" === null || "+We+" === '' "),i+=" ) "+We+" = ",e.opts.useDefaults=="shared"?i+=" "+e.useDefault(Ce.default)+" ":i+=" "+JSON.stringify(Ce.default)+" ",i+="; "}}}else if(P.type=="array"&&Array.isArray(e.schema.items)){var me=e.schema.items;if(me){for(var Ce,we=-1,Nt=me.length-1;we<Nt;)if(Ce=me[we+=1],Ce.default!==void 0){var We=g+"["+we+"]";if(e.compositeRule){if(e.opts.strictDefaults){var x="default is ignored for: "+We;if(e.opts.strictDefaults==="log")e.logger.warn(x);else throw new Error(x)}}else i+=" if ("+We+" === undefined ",e.opts.useDefaults=="empty"&&(i+=" || "+We+" === null || "+We+" === '' "),i+=" ) "+We+" = ",e.opts.useDefaults=="shared"?i+=" "+e.useDefault(Ce.default)+" ":i+=" "+JSON.stringify(Ce.default)+" ",i+="; "}}}}var G=P.rules;if(G){for(var ve,at=-1,Gt=G.length-1;at<Gt;)if(ve=G[at+=1],en(ve)){var wr=ve.code(e,ve.keyword,P.type);wr&&(i+=" "+wr+" ",R&&(V+="}"))}}if(R&&(i+=" "+V+" ",V=""),P.type&&(i+=" } ",z&&z===P.type&&!D)){i+=" else { ";var d=e.schemaPath+".type",h=e.errSchemaPath+"/type",v=v||[];v.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(K||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { type: '",W?i+=""+z.join(","):i+=""+z,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",W?i+=""+z.join(","):i+=""+z,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),i+=" } "):i+=" {} ";var b=i;i=v.pop(),!e.compositeRule&&R?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } "}R&&(i+=" if (errors === ",_?i+="0":i+="errs_"+f,i+=") { ",$+="}")}}}R&&(i+=" "+$+" "),_?(s?(i+=" if (errors === 0) return data; ",i+=" else throw new ValidationError(vErrors); "):(i+=" validate.errors = vErrors; ",i+=" return errors === 0; "),i+=" }; return validate;"):i+=" var "+T+" = errors === errs_"+f+";";function Ht(fn){for(var tn=fn.rules,bn=0;bn<tn.length;bn++)if(en(tn[bn]))return!0}function en(fn){return e.schema[fn.keyword]!==void 0||fn.implements&&_n(fn)}function _n(fn){for(var tn=fn.implements,bn=0;bn<tn.length;bn++)if(e.schema[tn[bn]]!==void 0)return!0}return i}});var YM=q((IBe,QM)=>{"use strict";var uv=av(),fv=Rl(),GM=cv(),Nle=S_(),KM=E_(),Ole=fv.ucs2length,Ile=ev(),Dle=GM.Validation;QM.exports=T_;function T_(t,e,r,n){var i=this,s=this._opts,o=[void 0],a={},c=[],u={},f=[],l={},p=[];e=e||{schema:t,refVal:o,refs:a};var d=Lle.call(this,t,e,n),h=this._compilations[d.index];if(d.compiling)return h.callValidate=x;var g=this._formats,v=this.RULES;try{var b=T(t,e,r,n);h.validate=b;var _=h.callValidate;return _&&(_.schema=b.schema,_.errors=null,_.refs=b.refs,_.refVal=b.refVal,_.root=b.root,_.$async=b.$async,s.sourceCode&&(_.source=b.source)),b}finally{$le.call(this,t,e,n)}function x(){var M=h.validate,j=M.apply(this,arguments);return x.errors=M.errors,j}function T(M,j,J,te){var re=!j||j&&j.schema==M;if(j.schema!=e.schema)return T_.call(i,M,j,J,te);var we=M.$async===!0,Q=KM({isTop:!0,schema:M,isRoot:re,baseId:te,root:j,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:GM.MissingRef,RULES:v,validate:KM,util:fv,resolve:uv,resolveRef:R,usePattern:W,useDefault:D,useCustomRule:P,opts:s,formats:g,logger:i.logger,self:i});Q=lv(o,Vle)+lv(c,Mle)+lv(f,Fle)+lv(p,jle)+Q,s.processCode&&(Q=s.processCode(Q,M));var F;try{var Oe=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",Q);F=Oe(i,v,g,e,o,f,p,Ile,Ole,Dle),o[0]=F}catch(ze){throw i.logger.error("Error compiling schema, function code:",Q),ze}return F.schema=M,F.errors=null,F.refs=a,F.refVal=o,F.root=re?F:j,we&&(F.$async=!0),s.sourceCode===!0&&(F.source={code:Q,patterns:c,defaults:f}),F}function R(M,j,J){j=uv.url(M,j);var te=a[j],re,we;if(te!==void 0)return re=o[te],we="refVal["+te+"]",z(re,we);if(!J&&e.refs){var Q=e.refs[j];if(Q!==void 0)return re=e.refVal[Q],we=V(j,re),z(re,we)}we=V(j);var F=uv.call(i,T,e,j);if(F===void 0){var Oe=r&&r[j];Oe&&(F=uv.inlineRef(Oe,s.inlineRefs)?Oe:T_.call(i,Oe,e,r,M))}if(F===void 0)$(j);else return K(j,F),z(F,we)}function V(M,j){var J=o.length;return o[J]=j,a[M]=J,"refVal"+J}function $(M){delete a[M]}function K(M,j){var J=a[M];o[J]=j}function z(M,j){return typeof M=="object"||typeof M=="boolean"?{code:j,schema:M,inline:!0}:{code:j,$async:M&&!!M.$async}}function W(M){var j=u[M];return j===void 0&&(j=u[M]=c.length,c[j]=M),"pattern"+j}function D(M){switch(typeof M){case"boolean":case"number":return""+M;case"string":return fv.toQuotedString(M);case"object":if(M===null)return"null";var j=Nle(M),J=l[j];return J===void 0&&(J=l[j]=f.length,f[J]=M),"default"+J}}function P(M,j,J,te){if(i._opts.validateSchema!==!1){var re=M.definition.dependencies;if(re&&!re.every(function(Te){return Object.prototype.hasOwnProperty.call(J,Te)}))throw new Error("parent schema must have all required keywords: "+re.join(","));var we=M.definition.validateSchema;if(we){var Q=we(j);if(!Q){var F="keyword schema is invalid: "+i.errorsText(we.errors);if(i._opts.validateSchema=="log")i.logger.error(F);else throw new Error(F)}}}var Oe=M.definition.compile,ze=M.definition.inline,pt=M.definition.macro,qe;if(Oe)qe=Oe.call(i,j,J,te);else if(pt)qe=pt.call(i,j,J,te),s.validateSchema!==!1&&i.validateSchema(qe,!0);else if(ze)qe=ze.call(i,te,M.keyword,j,J);else if(qe=M.definition.validate,!qe)return;if(qe===void 0)throw new Error('custom keyword "'+M.keyword+'"failed to compile');var Je=p.length;return p[Je]=qe,{code:"customRule"+Je,validate:qe}}}function Lle(t,e,r){var n=JM.call(this,t,e,r);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:t,root:e,baseId:r},{index:n,compiling:!1})}function $le(t,e,r){var n=JM.call(this,t,e,r);n>=0&&this._compilations.splice(n,1)}function JM(t,e,r){for(var n=0;n<this._compilations.length;n++){var i=this._compilations[n];if(i.schema==t&&i.root==e&&i.baseId==r)return n}return-1}function Mle(t,e){return"var pattern"+t+" = new RegExp("+fv.toQuotedString(e[t])+");"}function Fle(t){return"var default"+t+" = defaults["+t+"];"}function Vle(t,e){return e[t]===void 0?"":"var refVal"+t+" = refVal["+t+"];"}function jle(t){return"var customRule"+t+" = customRules["+t+"];"}function lv(t,e){if(!t.length)return"";for(var r="",n=0;n<t.length;n++)r+=e(n,t);return r}});var XM=q((DBe,ZM)=>{"use strict";var dv=ZM.exports=function(){this._cache={}};dv.prototype.put=function(e,r){this._cache[e]=r};dv.prototype.get=function(e){return this._cache[e]};dv.prototype.del=function(e){delete this._cache[e]};dv.prototype.clear=function(){this._cache={}}});var fF=q((LBe,lF)=>{"use strict";var Ule=Rl(),qle=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Ble=[0,31,28,31,30,31,30,31,31,30,31,30,31],Hle=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,eF=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,zle=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Wle=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,tF=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,rF=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,nF=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,iF=/^(?:\/(?:[^~/]|~0|~1)*)*$/,sF=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,oF=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;lF.exports=pv;function pv(t){return t=t=="full"?"full":"fast",Ule.copy(pv[t])}pv.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":tF,url:rF,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:eF,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:uF,uuid:nF,"json-pointer":iF,"json-pointer-uri-fragment":sF,"relative-json-pointer":oF};pv.full={date:aF,time:cF,"date-time":Jle,uri:Yle,"uri-reference":Wle,"uri-template":tF,url:rF,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:eF,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:uF,uuid:nF,"json-pointer":iF,"json-pointer-uri-fragment":sF,"relative-json-pointer":oF};function Kle(t){return t%4===0&&(t%100!==0||t%400===0)}function aF(t){var e=t.match(qle);if(!e)return!1;var r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n==2&&Kle(r)?29:Ble[n])}function cF(t,e){var r=t.match(Hle);if(!r)return!1;var n=r[1],i=r[2],s=r[3],o=r[5];return(n<=23&&i<=59&&s<=59||n==23&&i==59&&s==60)&&(!e||o)}var Gle=/t|\s/i;function Jle(t){var e=t.split(Gle);return e.length==2&&aF(e[0])&&cF(e[1],!0)}var Qle=/\/|:/;function Yle(t){return Qle.test(t)&&zle.test(t)}var Zle=/[^\\]\\Z/;function uF(t){if(Zle.test(t))return!1;try{return new RegExp(t),!0}catch(e){return!1}}});var pF=q(($Be,dF)=>{"use strict";dF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,f="data"+(o||""),l="valid"+s,p,d;if(a=="#"||a=="#/")e.isRoot?(p=e.async,d="validate"):(p=e.root.schema.$async===!0,d="root.refVal[0]");else{var h=e.resolveRef(e.baseId,a,e.isRoot);if(h===void 0){var g=e.MissingRefError.message(e.baseId,a);if(e.opts.missingRefs=="fail"){e.logger.error(g);var v=v||[];v.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(a)+"' } ",e.opts.messages!==!1&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(a)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var b=i;i=v.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(g),u&&(i+=" if (true) { ");else throw new e.MissingRefError(e.baseId,a,g)}else if(h.inline){var _=e.util.copy(e);_.level++;var x="valid"+_.level;_.schema=h.schema,_.schemaPath="",_.errSchemaPath=a;var T=e.validate(_).replace(/validate\.schema/g,h.code);i+=" "+T+" ",u&&(i+=" if ("+x+") { ")}else p=h.$async===!0||e.async&&h.$async!==!1,d=h.code}if(d){var v=v||[];v.push(i),i="",e.opts.passContext?i+=" "+d+".call(this, ":i+=" "+d+"( ",i+=" "+f+", (dataPath || '')",e.errorPath!='""'&&(i+=" + "+e.errorPath);var R=o?"data"+(o-1||""):"parentData",V=o?e.dataPathArr[o]:"parentDataProperty";i+=" , "+R+" , "+V+", rootData) ";var $=i;if(i=v.pop(),p){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(i+=" var "+l+"; "),i+=" try { await "+$+"; ",u&&(i+=" "+l+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(i+=" "+l+" = false; "),i+=" } ",u&&(i+=" if ("+l+") { ")}else i+=" if (!"+$+") { if (vErrors === null) vErrors = "+d+".errors; else vErrors = vErrors.concat("+d+".errors); errors = vErrors.length; } ",u&&(i+=" else { ")}return i}});var hF=q((MBe,mF)=>{"use strict";mF.exports=function(e,r,n){var i=" ",s=e.schema[r],o=e.schemaPath+e.util.getProperty(r),a=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u=e.util.copy(e),f="";u.level++;var l="valid"+u.level,p=u.baseId,d=!0,h=s;if(h)for(var g,v=-1,b=h.length-1;v<b;)g=h[v+=1],(e.opts.strictKeywords?typeof g=="object"&&Object.keys(g).length>0||g===!1:e.util.schemaHasRules(g,e.RULES.all))&&(d=!1,u.schema=g,u.schemaPath=o+"["+v+"]",u.errSchemaPath=a+"/"+v,i+=" "+e.validate(u)+" ",u.baseId=p,c&&(i+=" if ("+l+") { ",f+="}"));return c&&(d?i+=" if (true) { ":i+=" "+f.slice(0,-1)+" "),i}});var yF=q((FBe,gF)=>{"use strict";gF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="valid"+s,d="errs__"+s,h=e.util.copy(e),g="";h.level++;var v="valid"+h.level,b=a.every(function(K){return e.opts.strictKeywords?typeof K=="object"&&Object.keys(K).length>0||K===!1:e.util.schemaHasRules(K,e.RULES.all)});if(b){var _=h.baseId;i+=" var "+d+" = errors; var "+p+" = false; ";var x=e.compositeRule;e.compositeRule=h.compositeRule=!0;var T=a;if(T)for(var R,V=-1,$=T.length-1;V<$;)R=T[V+=1],h.schema=R,h.schemaPath=c+"["+V+"]",h.errSchemaPath=u+"/"+V,i+=" "+e.validate(h)+" ",h.baseId=_,i+=" "+p+" = "+p+" || "+v+"; if (!"+p+") { ",g+="}";e.compositeRule=h.compositeRule=x,i+=" "+g+" if (!"+p+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else f&&(i+=" if (true) { ");return i}});var xF=q((VBe,vF)=>{"use strict";vF.exports=function(e,r,n){var i=" ",s=e.schema[r],o=e.errSchemaPath+"/"+r,a=!e.opts.allErrors,c=e.util.toQuotedString(s);return e.opts.$comment===!0?i+=" console.log("+c+");":typeof e.opts.$comment=="function"&&(i+=" self._opts.$comment("+c+", "+e.util.toQuotedString(o)+", validate.root.schema);"),i}});var bF=q((jBe,_F)=>{"use strict";_F.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="valid"+s,d=e.opts.$data&&a&&a.$data,h;d?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",h="schema"+s):h=a,d||(i+=" var schema"+s+" = validate.schema"+c+";"),i+="var "+p+" = equal("+l+", schema"+s+"); if (!"+p+") { ";var g=g||[];g.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+s+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be equal to constant' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var v=i;return i=g.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",f&&(i+=" else { "),i}});var EF=q((UBe,SF)=>{"use strict";SF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="valid"+s,d="errs__"+s,h=e.util.copy(e),g="";h.level++;var v="valid"+h.level,b="i"+s,_=h.dataLevel=e.dataLevel+1,x="data"+_,T=e.baseId,R=e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all);if(i+="var "+d+" = errors;var "+p+";",R){var V=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=a,h.schemaPath=c,h.errSchemaPath=u,i+=" var "+v+" = false; for (var "+b+" = 0; "+b+" < "+l+".length; "+b+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,b,e.opts.jsonPointers,!0);var $=l+"["+b+"]";h.dataPathArr[_]=b;var K=e.validate(h);h.baseId=T,e.util.varOccurences(K,x)<2?i+=" "+e.util.varReplace(K,x,$)+" ":i+=" var "+x+" = "+$+"; "+K+" ",i+=" if ("+v+") break; } ",e.compositeRule=h.compositeRule=V,i+=" "+g+" if (!"+v+") {"}else i+=" if ("+l+".length == 0) {";var z=z||[];z.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var W=i;return i=z.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+W+"]); ":i+=" validate.errors = ["+W+"]; return false; ":i+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",R&&(i+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i}});var CF=q((qBe,TF)=>{"use strict";TF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="errs__"+s,d=e.util.copy(e),h="";d.level++;var g="valid"+d.level,v={},b={},_=e.opts.ownProperties;for(V in a)if(V!="__proto__"){var x=a[V],T=Array.isArray(x)?b:v;T[V]=x}i+="var "+p+" = errors;";var R=e.errorPath;i+="var missing"+s+";";for(var V in b)if(T=b[V],T.length){if(i+=" if ( "+l+e.util.getProperty(V)+" !== undefined ",_&&(i+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(V)+"') "),f){i+=" && ( ";var $=T;if($)for(var K,z=-1,W=$.length-1;z<W;){K=$[z+=1],z&&(i+=" || ");var D=e.util.getProperty(K),P=l+D;i+=" ( ( "+P+" === undefined ",_&&(i+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(K)+"') "),i+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?K:D)+") ) "}i+=")) { ";var M="missing"+s,j="' + "+M+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(R,M,!0):R+" + "+M);var J=J||[];J.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(V)+"', missingProperty: '"+j+"', depsCount: "+T.length+", deps: '"+e.util.escapeQuotes(T.length==1?T[0]:T.join(", "))+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should have ",T.length==1?i+="property "+e.util.escapeQuotes(T[0]):i+="properties "+e.util.escapeQuotes(T.join(", ")),i+=" when property "+e.util.escapeQuotes(V)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var te=i;i=J.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+te+"]); ":i+=" validate.errors = ["+te+"]; return false; ":i+=" var err = "+te+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{i+=" ) { ";var re=T;if(re)for(var K,we=-1,Q=re.length-1;we<Q;){K=re[we+=1];var D=e.util.getProperty(K),j=e.util.escapeQuotes(K),P=l+D;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(R,K,e.opts.jsonPointers)),i+=" if ( "+P+" === undefined ",_&&(i+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(K)+"') "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(V)+"', missingProperty: '"+j+"', depsCount: "+T.length+", deps: '"+e.util.escapeQuotes(T.length==1?T[0]:T.join(", "))+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should have ",T.length==1?i+="property "+e.util.escapeQuotes(T[0]):i+="properties "+e.util.escapeQuotes(T.join(", ")),i+=" when property "+e.util.escapeQuotes(V)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}i+=" } ",f&&(h+="}",i+=" else { ")}e.errorPath=R;var F=d.baseId;for(var V in v){var x=v[V];(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all))&&(i+=" "+g+" = true; if ( "+l+e.util.getProperty(V)+" !== undefined ",_&&(i+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(V)+"') "),i+=") { ",d.schema=x,d.schemaPath=c+e.util.getProperty(V),d.errSchemaPath=u+"/"+e.util.escapeFragment(V),i+=" "+e.validate(d)+" ",d.baseId=F,i+=" } ",f&&(i+=" if ("+g+") { ",h+="}"))}return f&&(i+=" "+h+" if ("+p+" == errors) {"),i}});var wF=q((BBe,kF)=>{"use strict";kF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="valid"+s,d=e.opts.$data&&a&&a.$data,h;d?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",h="schema"+s):h=a;var g="i"+s,v="schema"+s;d||(i+=" var "+v+" = validate.schema"+c+";"),i+="var "+p+";",d&&(i+=" if (schema"+s+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+s+")) "+p+" = false; else {"),i+=""+p+" = false;for (var "+g+"=0; "+g+"<"+v+".length; "+g+"++) if (equal("+l+", "+v+"["+g+"])) { "+p+" = true; break; }",d&&(i+=" } "),i+=" if (!"+p+") { ";var b=b||[];b.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+s+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var _=i;return i=b.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",f&&(i+=" else { "),i}});var RF=q((HBe,AF)=>{"use strict";AF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||"");if(e.opts.format===!1)return f&&(i+=" if (true) { "),i;var p=e.opts.$data&&a&&a.$data,d;p?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",d="schema"+s):d=a;var h=e.opts.unknownFormats,g=Array.isArray(h);if(p){var v="format"+s,b="isObject"+s,_="formatType"+s;i+=" var "+v+" = formats["+d+"]; var "+b+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+_+" = "+b+" && "+v+".type || 'string'; if ("+b+") { ",e.async&&(i+=" var async"+s+" = "+v+".async; "),i+=" "+v+" = "+v+".validate; } if ( ",p&&(i+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),i+=" (",h!="ignore"&&(i+=" ("+d+" && !"+v+" ",g&&(i+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),i+=") || "),i+=" ("+v+" && "+_+" == '"+n+"' && !(typeof "+v+" == 'function' ? ",e.async?i+=" (async"+s+" ? await "+v+"("+l+") : "+v+"("+l+")) ":i+=" "+v+"("+l+") ",i+=" : "+v+".test("+l+"))))) {"}else{var v=e.formats[a];if(!v){if(h=="ignore")return e.logger.warn('unknown format "'+a+'" ignored in schema at path "'+e.errSchemaPath+'"'),f&&(i+=" if (true) { "),i;if(g&&h.indexOf(a)>=0)return f&&(i+=" if (true) { "),i;throw new Error('unknown format "'+a+'" is used in schema at path "'+e.errSchemaPath+'"')}var b=typeof v=="object"&&!(v instanceof RegExp)&&v.validate,_=b&&v.type||"string";if(b){var x=v.async===!0;v=v.validate}if(_!=n)return f&&(i+=" if (true) { "),i;if(x){if(!e.async)throw new Error("async format in sync schema");var T="formats"+e.util.getProperty(a)+".validate";i+=" if (!(await "+T+"("+l+"))) { "}else{i+=" if (! ";var T="formats"+e.util.getProperty(a);b&&(T+=".validate"),typeof v=="function"?i+=" "+T+"("+l+") ":i+=" "+T+".test("+l+") ",i+=") { "}}var R=R||[];R.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",p?i+=""+d:i+=""+e.util.toQuotedString(a),i+=" } ",e.opts.messages!==!1&&(i+=` , message: 'should match format "`,p?i+="' + "+d+" + '":i+=""+e.util.escapeQuotes(a),i+=`"' `),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+e.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var V=i;return i=R.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+V+"]); ":i+=" validate.errors = ["+V+"]; return false; ":i+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",f&&(i+=" else { "),i}});var NF=q((zBe,PF)=>{"use strict";PF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="valid"+s,d="errs__"+s,h=e.util.copy(e);h.level++;var g="valid"+h.level,v=e.schema.then,b=e.schema.else,_=v!==void 0&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:e.util.schemaHasRules(v,e.RULES.all)),x=b!==void 0&&(e.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:e.util.schemaHasRules(b,e.RULES.all)),T=h.baseId;if(_||x){var R;h.createErrors=!1,h.schema=a,h.schemaPath=c,h.errSchemaPath=u,i+=" var "+d+" = errors; var "+p+" = true; ";var V=e.compositeRule;e.compositeRule=h.compositeRule=!0,i+=" "+e.validate(h)+" ",h.baseId=T,h.createErrors=!0,i+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=V,_?(i+=" if ("+g+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(h)+" ",h.baseId=T,i+=" "+p+" = "+g+"; ",_&&x?(R="ifClause"+s,i+=" var "+R+" = 'then'; "):R="'then'",i+=" } ",x&&(i+=" else { ")):i+=" if (!"+g+") { ",x&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(h)+" ",h.baseId=T,i+=" "+p+" = "+g+"; ",_&&x?(R="ifClause"+s,i+=" var "+R+" = 'else'; "):R="'else'",i+=" } "),i+=" if (!"+p+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+R+" } ",e.opts.messages!==!1&&(i+=` , message: 'should match "' + `+R+` + '" schema' `),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",f&&(i+=" else { ")}else f&&(i+=" if (true) { ");return i}});var IF=q((WBe,OF)=>{"use strict";OF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="valid"+s,d="errs__"+s,h=e.util.copy(e),g="";h.level++;var v="valid"+h.level,b="i"+s,_=h.dataLevel=e.dataLevel+1,x="data"+_,T=e.baseId;if(i+="var "+d+" = errors;var "+p+";",Array.isArray(a)){var R=e.schema.additionalItems;if(R===!1){i+=" "+p+" = "+l+".length <= "+a.length+"; ";var V=u;u=e.errSchemaPath+"/additionalItems",i+=" if (!"+p+") { ";var $=$||[];$.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a.length+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have more than "+a.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var K=i;i=$.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+K+"]); ":i+=" validate.errors = ["+K+"]; return false; ":i+=" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u=V,f&&(g+="}",i+=" else { ")}var z=a;if(z){for(var W,D=-1,P=z.length-1;D<P;)if(W=z[D+=1],e.opts.strictKeywords?typeof W=="object"&&Object.keys(W).length>0||W===!1:e.util.schemaHasRules(W,e.RULES.all)){i+=" "+v+" = true; if ("+l+".length > "+D+") { ";var M=l+"["+D+"]";h.schema=W,h.schemaPath=c+"["+D+"]",h.errSchemaPath=u+"/"+D,h.errorPath=e.util.getPathExpr(e.errorPath,D,e.opts.jsonPointers,!0),h.dataPathArr[_]=D;var j=e.validate(h);h.baseId=T,e.util.varOccurences(j,x)<2?i+=" "+e.util.varReplace(j,x,M)+" ":i+=" var "+x+" = "+M+"; "+j+" ",i+=" } ",f&&(i+=" if ("+v+") { ",g+="}")}}if(typeof R=="object"&&(e.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:e.util.schemaHasRules(R,e.RULES.all))){h.schema=R,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+v+" = true; if ("+l+".length > "+a.length+") { for (var "+b+" = "+a.length+"; "+b+" < "+l+".length; "+b+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,b,e.opts.jsonPointers,!0);var M=l+"["+b+"]";h.dataPathArr[_]=b;var j=e.validate(h);h.baseId=T,e.util.varOccurences(j,x)<2?i+=" "+e.util.varReplace(j,x,M)+" ":i+=" var "+x+" = "+M+"; "+j+" ",f&&(i+=" if (!"+v+") break; "),i+=" } } ",f&&(i+=" if ("+v+") { ",g+="}")}}else if(e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){h.schema=a,h.schemaPath=c,h.errSchemaPath=u,i+=" for (var "+b+" = 0; "+b+" < "+l+".length; "+b+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,b,e.opts.jsonPointers,!0);var M=l+"["+b+"]";h.dataPathArr[_]=b;var j=e.validate(h);h.baseId=T,e.util.varOccurences(j,x)<2?i+=" "+e.util.varReplace(j,x,M)+" ":i+=" var "+x+" = "+M+"; "+j+" ",f&&(i+=" if (!"+v+") break; "),i+=" }"}return f&&(i+=" "+g+" if ("+d+" == errors) {"),i}});var C_=q((KBe,DF)=>{"use strict";DF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,T,l="data"+(o||""),p=e.opts.$data&&a&&a.$data,d;p?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",d="schema"+s):d=a;var h=r=="maximum",g=h?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[g],b=e.opts.$data&&v&&v.$data,_=h?"<":">",x=h?">":"<",T=void 0;if(!(p||typeof a=="number"||a===void 0))throw new Error(r+" must be number");if(!(b||v===void 0||typeof v=="number"||typeof v=="boolean"))throw new Error(g+" must be number or boolean");if(b){var R=e.util.getData(v.$data,o,e.dataPathArr),V="exclusive"+s,$="exclType"+s,K="exclIsNumber"+s,z="op"+s,W="' + "+z+" + '";i+=" var schemaExcl"+s+" = "+R+"; ",R="schemaExcl"+s,i+=" var "+V+"; var "+$+" = typeof "+R+"; if ("+$+" != 'boolean' && "+$+" != 'undefined' && "+$+" != 'number') { ";var T=g,D=D||[];D.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(T||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: '"+g+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var P=i;i=D.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+P+"]); ":i+=" validate.errors = ["+P+"]; return false; ":i+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",p&&(i+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),i+=" "+$+" == 'number' ? ( ("+V+" = "+d+" === undefined || "+R+" "+_+"= "+d+") ? "+l+" "+x+"= "+R+" : "+l+" "+x+" "+d+" ) : ( ("+V+" = "+R+" === true) ? "+l+" "+x+"= "+d+" : "+l+" "+x+" "+d+" ) || "+l+" !== "+l+") { var op"+s+" = "+V+" ? '"+_+"' : '"+_+"='; ",a===void 0&&(T=g,u=e.errSchemaPath+"/"+g,d=R,p=b)}else{var K=typeof v=="number",W=_;if(K&&p){var z="'"+W+"'";i+=" if ( ",p&&(i+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),i+=" ( "+d+" === undefined || "+v+" "+_+"= "+d+" ? "+l+" "+x+"= "+v+" : "+l+" "+x+" "+d+" ) || "+l+" !== "+l+") { "}else{K&&a===void 0?(V=!0,T=g,u=e.errSchemaPath+"/"+g,d=v,x+="="):(K&&(d=Math[h?"min":"max"](v,a)),v===(K?d:!0)?(V=!0,T=g,u=e.errSchemaPath+"/"+g,x+="="):(V=!1,W+="="));var z="'"+W+"'";i+=" if ( ",p&&(i+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),i+=" "+l+" "+x+" "+d+" || "+l+" !== "+l+") { "}}T=T||r;var D=D||[];D.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(T||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+z+", limit: "+d+", exclusive: "+V+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be "+W+" ",p?i+="' + "+d:i+=""+d+"'"),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var P=i;return i=D.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+P+"]); ":i+=" validate.errors = ["+P+"]; return false; ":i+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",f&&(i+=" else { "),i}});var k_=q((GBe,LF)=>{"use strict";LF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,g,l="data"+(o||""),p=e.opts.$data&&a&&a.$data,d;if(p?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",d="schema"+s):d=a,!(p||typeof a=="number"))throw new Error(r+" must be number");var h=r=="maxItems"?">":"<";i+="if ( ",p&&(i+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),i+=" "+l+".length "+h+" "+d+") { ";var g=r,v=v||[];v.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(g||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+d+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have ",r=="maxItems"?i+="more":i+="fewer",i+=" than ",p?i+="' + "+d+" + '":i+=""+a,i+=" items' "),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var b=i;return i=v.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",f&&(i+=" else { "),i}});var w_=q((JBe,$F)=>{"use strict";$F.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,g,l="data"+(o||""),p=e.opts.$data&&a&&a.$data,d;if(p?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",d="schema"+s):d=a,!(p||typeof a=="number"))throw new Error(r+" must be number");var h=r=="maxLength"?">":"<";i+="if ( ",p&&(i+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),e.opts.unicode===!1?i+=" "+l+".length ":i+=" ucs2length("+l+") ",i+=" "+h+" "+d+") { ";var g=r,v=v||[];v.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(g||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+d+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be ",r=="maxLength"?i+="longer":i+="shorter",i+=" than ",p?i+="' + "+d+" + '":i+=""+a,i+=" characters' "),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var b=i;return i=v.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",f&&(i+=" else { "),i}});var A_=q((QBe,MF)=>{"use strict";MF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,g,l="data"+(o||""),p=e.opts.$data&&a&&a.$data,d;if(p?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",d="schema"+s):d=a,!(p||typeof a=="number"))throw new Error(r+" must be number");var h=r=="maxProperties"?">":"<";i+="if ( ",p&&(i+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "),i+=" Object.keys("+l+").length "+h+" "+d+") { ";var g=r,v=v||[];v.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(g||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+d+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have ",r=="maxProperties"?i+="more":i+="fewer",i+=" than ",p?i+="' + "+d+" + '":i+=""+a,i+=" properties' "),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var b=i;return i=v.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",f&&(i+=" else { "),i}});var VF=q((YBe,FF)=>{"use strict";FF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p=e.opts.$data&&a&&a.$data,d;if(p?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",d="schema"+s):d=a,!(p||typeof a=="number"))throw new Error(r+" must be number");i+="var division"+s+";if (",p&&(i+=" "+d+" !== undefined && ( typeof "+d+" != 'number' || "),i+=" (division"+s+" = "+l+" / "+d+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+s+" !== parseInt(division"+s+") ",i+=" ) ",p&&(i+=" ) "),i+=" ) { ";var h=h||[];h.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+d+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be multiple of ",p?i+="' + "+d:i+=""+d+"'"),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var g=i;return i=h.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",f&&(i+=" else { "),i}});var UF=q((ZBe,jF)=>{"use strict";jF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="errs__"+s,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){d.schema=a,d.schemaPath=c,d.errSchemaPath=u,i+=" var "+p+" = errors; ";var g=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1;var v;d.opts.allErrors&&(v=d.opts.allErrors,d.opts.allErrors=!1),i+=" "+e.validate(d)+" ",d.createErrors=!0,v&&(d.opts.allErrors=v),e.compositeRule=d.compositeRule=g,i+=" if ("+h+") { ";var b=b||[];b.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var _=i;i=b.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",e.createErrors!==!1?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f&&(i+=" if (false) { ");return i}});var BF=q((XBe,qF)=>{"use strict";qF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="valid"+s,d="errs__"+s,h=e.util.copy(e),g="";h.level++;var v="valid"+h.level,b=h.baseId,_="prevValid"+s,x="passingSchemas"+s;i+="var "+d+" = errors , "+_+" = false , "+p+" = false , "+x+" = null; ";var T=e.compositeRule;e.compositeRule=h.compositeRule=!0;var R=a;if(R)for(var V,$=-1,K=R.length-1;$<K;)V=R[$+=1],(e.opts.strictKeywords?typeof V=="object"&&Object.keys(V).length>0||V===!1:e.util.schemaHasRules(V,e.RULES.all))?(h.schema=V,h.schemaPath=c+"["+$+"]",h.errSchemaPath=u+"/"+$,i+=" "+e.validate(h)+" ",h.baseId=b):i+=" var "+v+" = true; ",$&&(i+=" if ("+v+" && "+_+") { "+p+" = false; "+x+" = ["+x+", "+$+"]; } else { ",g+="}"),i+=" if ("+v+") { "+p+" = "+_+" = true; "+x+" = "+$+"; }";return e.compositeRule=h.compositeRule=T,i+=""+g+"if (!"+p+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+x+" } ",e.opts.messages!==!1&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}});var zF=q((eHe,HF)=>{"use strict";HF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p=e.opts.$data&&a&&a.$data,d;p?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",d="schema"+s):d=a;var h=p?"(new RegExp("+d+"))":e.usePattern(a);i+="if ( ",p&&(i+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),i+=" !"+h+".test("+l+") ) { ";var g=g||[];g.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",p?i+=""+d:i+=""+e.util.toQuotedString(a),i+=" } ",e.opts.messages!==!1&&(i+=` , message: 'should match pattern "`,p?i+="' + "+d+" + '":i+=""+e.util.escapeQuotes(a),i+=`"' `),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+e.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var v=i;return i=g.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",f&&(i+=" else { "),i}});var KF=q((tHe,WF)=>{"use strict";WF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="errs__"+s,d=e.util.copy(e),h="";d.level++;var g="valid"+d.level,v="key"+s,b="idx"+s,_=d.dataLevel=e.dataLevel+1,x="data"+_,T="dataProperties"+s,R=Object.keys(a||{}).filter(we),V=e.schema.patternProperties||{},$=Object.keys(V).filter(we),K=e.schema.additionalProperties,z=R.length||$.length,W=K===!1,D=typeof K=="object"&&Object.keys(K).length,P=e.opts.removeAdditional,M=W||D||P,j=e.opts.ownProperties,J=e.baseId,te=e.schema.required;if(te&&!(e.opts.$data&&te.$data)&&te.length<e.opts.loopRequired)var re=e.util.toHash(te);function we(Fn){return Fn!=="__proto__"}if(i+="var "+p+" = errors;var "+g+" = true;",j&&(i+=" var "+T+" = undefined;"),M){if(j?i+=" "+T+" = "+T+" || Object.keys("+l+"); for (var "+b+"=0; "+b+"<"+T+".length; "+b+"++) { var "+v+" = "+T+"["+b+"]; ":i+=" for (var "+v+" in "+l+") { ",z){if(i+=" var isAdditional"+s+" = !(false ",R.length)if(R.length>8)i+=" || validate.schema"+c+".hasOwnProperty("+v+") ";else{var Q=R;if(Q)for(var F,Oe=-1,ze=Q.length-1;Oe<ze;)F=Q[Oe+=1],i+=" || "+v+" == "+e.util.toQuotedString(F)+" "}if($.length){var pt=$;if(pt)for(var qe,Je=-1,Te=pt.length-1;Je<Te;)qe=pt[Je+=1],i+=" || "+e.usePattern(qe)+".test("+v+") "}i+=" ); if (isAdditional"+s+") { "}if(P=="all")i+=" delete "+l+"["+v+"]; ";else{var ie=e.errorPath,he="' + "+v+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers)),W)if(P)i+=" delete "+l+"["+v+"]; ";else{i+=" "+g+" = false; ";var Ee=u;u=e.errSchemaPath+"/additionalProperties";var Ce=Ce||[];Ce.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+he+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is an invalid additional property":i+="should NOT have additional properties",i+="' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var We=i;i=Ce.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+We+"]); ":i+=" validate.errors = ["+We+"]; return false; ":i+=" var err = "+We+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=Ee,f&&(i+=" break; ")}else if(D)if(P=="failing"){i+=" var "+p+" = errors; ";var me=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=K,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Nt=l+"["+v+"]";d.dataPathArr[_]=v;var G=e.validate(d);d.baseId=J,e.util.varOccurences(G,x)<2?i+=" "+e.util.varReplace(G,x,Nt)+" ":i+=" var "+x+" = "+Nt+"; "+G+" ",i+=" if (!"+g+") { errors = "+p+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+l+"["+v+"]; } ",e.compositeRule=d.compositeRule=me}else{d.schema=K,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Nt=l+"["+v+"]";d.dataPathArr[_]=v;var G=e.validate(d);d.baseId=J,e.util.varOccurences(G,x)<2?i+=" "+e.util.varReplace(G,x,Nt)+" ":i+=" var "+x+" = "+Nt+"; "+G+" ",f&&(i+=" if (!"+g+") break; ")}e.errorPath=ie}z&&(i+=" } "),i+=" } ",f&&(i+=" if ("+g+") { ",h+="}")}var ve=e.opts.useDefaults&&!e.compositeRule;if(R.length){var at=R;if(at)for(var F,Gt=-1,wr=at.length-1;Gt<wr;){F=at[Gt+=1];var Ht=a[F];if(e.opts.strictKeywords?typeof Ht=="object"&&Object.keys(Ht).length>0||Ht===!1:e.util.schemaHasRules(Ht,e.RULES.all)){var en=e.util.getProperty(F),Nt=l+en,_n=ve&&Ht.default!==void 0;d.schema=Ht,d.schemaPath=c+en,d.errSchemaPath=u+"/"+e.util.escapeFragment(F),d.errorPath=e.util.getPath(e.errorPath,F,e.opts.jsonPointers),d.dataPathArr[_]=e.util.toQuotedString(F);var G=e.validate(d);if(d.baseId=J,e.util.varOccurences(G,x)<2){G=e.util.varReplace(G,x,Nt);var fn=Nt}else{var fn=x;i+=" var "+x+" = "+Nt+"; "}if(_n)i+=" "+G+" ";else{if(re&&re[F]){i+=" if ( "+fn+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(F)+"') "),i+=") { "+g+" = false; ";var ie=e.errorPath,Ee=u,tn=e.util.escapeQuotes(F);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(ie,F,e.opts.jsonPointers)),u=e.errSchemaPath+"/required";var Ce=Ce||[];Ce.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+tn+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+tn+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var We=i;i=Ce.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+We+"]); ":i+=" validate.errors = ["+We+"]; return false; ":i+=" var err = "+We+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=Ee,e.errorPath=ie,i+=" } else { "}else f?(i+=" if ( "+fn+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(F)+"') "),i+=") { "+g+" = true; } else { "):(i+=" if ("+fn+" !== undefined ",j&&(i+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(F)+"') "),i+=" ) { ");i+=" "+G+" } "}}f&&(i+=" if ("+g+") { ",h+="}")}}if($.length){var bn=$;if(bn)for(var qe,vo=-1,xo=bn.length-1;vo<xo;){qe=bn[vo+=1];var Ht=V[qe];if(e.opts.strictKeywords?typeof Ht=="object"&&Object.keys(Ht).length>0||Ht===!1:e.util.schemaHasRules(Ht,e.RULES.all)){d.schema=Ht,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(qe),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(qe),j?i+=" "+T+" = "+T+" || Object.keys("+l+"); for (var "+b+"=0; "+b+"<"+T+".length; "+b+"++) { var "+v+" = "+T+"["+b+"]; ":i+=" for (var "+v+" in "+l+") { ",i+=" if ("+e.usePattern(qe)+".test("+v+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var Nt=l+"["+v+"]";d.dataPathArr[_]=v;var G=e.validate(d);d.baseId=J,e.util.varOccurences(G,x)<2?i+=" "+e.util.varReplace(G,x,Nt)+" ":i+=" var "+x+" = "+Nt+"; "+G+" ",f&&(i+=" if (!"+g+") break; "),i+=" } ",f&&(i+=" else "+g+" = true; "),i+=" } ",f&&(i+=" if ("+g+") { ",h+="}")}}}return f&&(i+=" "+h+" if ("+p+" == errors) {"),i}});var JF=q((rHe,GF)=>{"use strict";GF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="errs__"+s,d=e.util.copy(e),h="";d.level++;var g="valid"+d.level;if(i+="var "+p+" = errors;",e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){d.schema=a,d.schemaPath=c,d.errSchemaPath=u;var v="key"+s,b="idx"+s,_="i"+s,x="' + "+v+" + '",T=d.dataLevel=e.dataLevel+1,R="data"+T,V="dataProperties"+s,$=e.opts.ownProperties,K=e.baseId;$&&(i+=" var "+V+" = undefined; "),$?i+=" "+V+" = "+V+" || Object.keys("+l+"); for (var "+b+"=0; "+b+"<"+V+".length; "+b+"++) { var "+v+" = "+V+"["+b+"]; ":i+=" for (var "+v+" in "+l+") { ",i+=" var startErrs"+s+" = errors; ";var z=v,W=e.compositeRule;e.compositeRule=d.compositeRule=!0;var D=e.validate(d);d.baseId=K,e.util.varOccurences(D,R)<2?i+=" "+e.util.varReplace(D,R,z)+" ":i+=" var "+R+" = "+z+"; "+D+" ",e.compositeRule=d.compositeRule=W,i+=" if (!"+g+") { for (var "+_+"=startErrs"+s+"; "+_+"<errors; "+_+"++) { vErrors["+_+"].propertyName = "+v+"; } var err = ",e.createErrors!==!1?(i+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+x+"' } ",e.opts.messages!==!1&&(i+=" , message: 'property name \\'"+x+"\\' is invalid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),f&&(i+=" break; "),i+=" } }"}return f&&(i+=" "+h+" if ("+p+" == errors) {"),i}});var YF=q((nHe,QF)=>{"use strict";QF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="valid"+s,d=e.opts.$data&&a&&a.$data,h;d?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",h="schema"+s):h=a;var g="schema"+s;if(!d)if(a.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var v=[],b=a;if(b)for(var _,x=-1,T=b.length-1;x<T;){_=b[x+=1];var R=e.schema.properties[_];R&&(e.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:e.util.schemaHasRules(R,e.RULES.all))||(v[v.length]=_)}}else var v=a;if(d||v.length){var V=e.errorPath,$=d||v.length>=e.opts.loopRequired,K=e.opts.ownProperties;if(f)if(i+=" var missing"+s+"; ",$){d||(i+=" var "+g+" = validate.schema"+c+"; ");var z="i"+s,W="schema"+s+"["+z+"]",D="' + "+W+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(V,W,e.opts.jsonPointers)),i+=" var "+p+" = true; ",d&&(i+=" if (schema"+s+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+s+")) "+p+" = false; else {"),i+=" for (var "+z+" = 0; "+z+" < "+g+".length; "+z+"++) { "+p+" = "+l+"["+g+"["+z+"]] !== undefined ",K&&(i+=" && Object.prototype.hasOwnProperty.call("+l+", "+g+"["+z+"]) "),i+="; if (!"+p+") break; } ",d&&(i+=" } "),i+=" if (!"+p+") { ";var P=P||[];P.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+D+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+D+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var M=i;i=P.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+M+"]); ":i+=" validate.errors = ["+M+"]; return false; ":i+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=v;if(j)for(var J,z=-1,te=j.length-1;z<te;){J=j[z+=1],z&&(i+=" || ");var re=e.util.getProperty(J),we=l+re;i+=" ( ( "+we+" === undefined ",K&&(i+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(J)+"') "),i+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?J:re)+") ) "}i+=") { ";var W="missing"+s,D="' + "+W+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(V,W,!0):V+" + "+W);var P=P||[];P.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+D+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+D+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var M=i;i=P.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+M+"]); ":i+=" validate.errors = ["+M+"]; return false; ":i+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if($){d||(i+=" var "+g+" = validate.schema"+c+"; ");var z="i"+s,W="schema"+s+"["+z+"]",D="' + "+W+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(V,W,e.opts.jsonPointers)),d&&(i+=" if ("+g+" && !Array.isArray("+g+")) { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+D+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+D+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+g+" !== undefined) { "),i+=" for (var "+z+" = 0; "+z+" < "+g+".length; "+z+"++) { if ("+l+"["+g+"["+z+"]] === undefined ",K&&(i+=" || ! Object.prototype.hasOwnProperty.call("+l+", "+g+"["+z+"]) "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+D+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+D+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",d&&(i+=" } ")}else{var Q=v;if(Q)for(var J,F=-1,Oe=Q.length-1;F<Oe;){J=Q[F+=1];var re=e.util.getProperty(J),D=e.util.escapeQuotes(J),we=l+re;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(V,J,e.opts.jsonPointers)),i+=" if ( "+we+" === undefined ",K&&(i+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(J)+"') "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+D+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+D+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=V}else f&&(i+=" if (true) {");return i}});var XF=q((iHe,ZF)=>{"use strict";ZF.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l="data"+(o||""),p="valid"+s,d=e.opts.$data&&a&&a.$data,h;if(d?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",h="schema"+s):h=a,(a||d)&&e.opts.uniqueItems!==!1){d&&(i+=" var "+p+"; if ("+h+" === false || "+h+" === undefined) "+p+" = true; else if (typeof "+h+" != 'boolean') "+p+" = false; else { "),i+=" var i = "+l+".length , "+p+" = true , j; if (i > 1) { ";var g=e.schema.items&&e.schema.items.type,v=Array.isArray(g);if(!g||g=="object"||g=="array"||v&&(g.indexOf("object")>=0||g.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+l+"[i], "+l+"[j])) { "+p+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+l+"[i]; ";var b="checkDataType"+(v?"s":"");i+=" if ("+e.util[b](g,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(i+=` if (typeof item == 'string') item = '"' + item; `),i+=" if (typeof itemIndices[item] == 'number') { "+p+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",d&&(i+=" } "),i+=" if (!"+p+") { ";var _=_||[];_.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",d?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),i+=" } "):i+=" {} ";var x=i;i=_.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+x+"]); ":i+=" validate.errors = ["+x+"]; return false; ":i+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",f&&(i+=" else { ")}else f&&(i+=" if (true) { ");return i}});var tV=q((sHe,eV)=>{"use strict";eV.exports={$ref:pF(),allOf:hF(),anyOf:yF(),$comment:xF(),const:bF(),contains:EF(),dependencies:CF(),enum:wF(),format:RF(),if:NF(),items:IF(),maximum:C_(),minimum:C_(),maxItems:k_(),minItems:k_(),maxLength:w_(),minLength:w_(),maxProperties:A_(),minProperties:A_(),multipleOf:VF(),not:UF(),oneOf:BF(),pattern:zF(),properties:KF(),propertyNames:JF(),required:YF(),uniqueItems:XF(),validate:E_()}});var iV=q((oHe,nV)=>{"use strict";var rV=tV(),R_=Rl().toHash;nV.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],r=["type","$comment"],n=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],i=["number","integer","string","array","object","boolean","null"];return e.all=R_(r),e.types=R_(i),e.forEach(function(s){s.rules=s.rules.map(function(o){var a;if(typeof o=="object"){var c=Object.keys(o)[0];a=o[c],o=c,a.forEach(function(f){r.push(f),e.all[f]=!0})}r.push(o);var u=e.all[o]={keyword:o,code:rV[o],implements:a};return u}),e.all.$comment={keyword:"$comment",code:rV.$comment},s.type&&(e.types[s.type]=s)}),e.keywords=R_(r.concat(n)),e.custom={},e}});var aV=q((aHe,oV)=>{"use strict";var sV=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];oV.exports=function(t,e){for(var r=0;r<e.length;r++){t=JSON.parse(JSON.stringify(t));var n=e[r].split("/"),i=t,s;for(s=1;s<n.length;s++)i=i[n[s]];for(s=0;s<sV.length;s++){var o=sV[s],a=i[o];a&&(i[o]={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return t}});var lV=q((cHe,uV)=>{"use strict";var Xle=cv().MissingRef;uV.exports=cV;function cV(t,e,r){var n=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(r=e,e=void 0);var i=s(t).then(function(){var a=n._addSchema(t,void 0,e);return a.validate||o(a)});return r&&i.then(function(a){r(null,a)},r),i;function s(a){var c=a.$schema;return c&&!n.getSchema(c)?cV.call(n,{$ref:c},!0):Promise.resolve()}function o(a){try{return n._compile(a)}catch(u){if(u instanceof Xle)return c(u);throw u}function c(u){var f=u.missingSchema;if(d(f))throw new Error("Schema "+f+" is loaded but "+u.missingRef+" cannot be resolved");var l=n._loadingSchemas[f];return l||(l=n._loadingSchemas[f]=n._opts.loadSchema(f),l.then(p,p)),l.then(function(h){if(!d(f))return s(h).then(function(){d(f)||n.addSchema(h,f,void 0,e)})}).then(function(){return o(a)});function p(){delete n._loadingSchemas[f]}function d(h){return n._refs[h]||n._schemas[h]}}}}});var dV=q((uHe,fV)=>{"use strict";fV.exports=function(e,r,n){var i=" ",s=e.level,o=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,l,p="data"+(o||""),d="valid"+s,h="errs__"+s,g=e.opts.$data&&a&&a.$data,v;g?(i+=" var schema"+s+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",v="schema"+s):v=a;var b=this,_="definition"+s,x=b.definition,T="",R,V,$,K,z;if(g&&x.$data){z="keywordValidate"+s;var W=x.validateSchema;i+=" var "+_+" = RULES.custom['"+r+"'].definition; var "+z+" = "+_+".validate;"}else{if(K=e.useCustomRule(b,a,e.schema,e),!K)return;v="validate.schema"+c,z=K.code,R=x.compile,V=x.inline,$=x.macro}var D=z+".errors",P="i"+s,M="ruleErr"+s,j=x.async;if(j&&!e.async)throw new Error("async keyword in sync schema");if(V||$||(i+=""+D+" = null;"),i+="var "+h+" = errors;var "+d+";",g&&x.$data&&(T+="}",i+=" if ("+v+" === undefined) { "+d+" = true; } else { ",W&&(T+="}",i+=" "+d+" = "+_+".validateSchema("+v+"); if ("+d+") { ")),V)x.statements?i+=" "+K.validate+" ":i+=" "+d+" = "+K.validate+"; ";else if($){var J=e.util.copy(e),T="";J.level++;var te="valid"+J.level;J.schema=K.validate,J.schemaPath="";var re=e.compositeRule;e.compositeRule=J.compositeRule=!0;var we=e.validate(J).replace(/validate\.schema/g,z);e.compositeRule=J.compositeRule=re,i+=" "+we}else{var Q=Q||[];Q.push(i),i="",i+=" "+z+".call( ",e.opts.passContext?i+="this":i+="self",R||x.schema===!1?i+=" , "+p+" ":i+=" , "+v+" , "+p+" , validate.schema"+e.schemaPath+" ",i+=" , (dataPath || '')",e.errorPath!='""'&&(i+=" + "+e.errorPath);var F=o?"data"+(o-1||""):"parentData",Oe=o?e.dataPathArr[o]:"parentDataProperty";i+=" , "+F+" , "+Oe+" , rootData ) ";var ze=i;i=Q.pop(),x.errors===!1?(i+=" "+d+" = ",j&&(i+="await "),i+=""+ze+"; "):j?(D="customErrors"+s,i+=" var "+D+" = null; try { "+d+" = await "+ze+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+D+" = e.errors; else throw e; } "):i+=" "+D+" = null; "+d+" = "+ze+"; "}if(x.modifying&&(i+=" if ("+F+") "+p+" = "+F+"["+Oe+"];"),i+=""+T,x.valid)f&&(i+=" if (true) { ");else{i+=" if ( ",x.valid===void 0?(i+=" !",$?i+=""+te:i+=""+d):i+=" "+!x.valid+" ",i+=") { ",l=b.keyword;var Q=Q||[];Q.push(i),i="";var Q=Q||[];Q.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(l||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+b.keyword+"' } ",e.opts.messages!==!1&&(i+=` , message: 'should pass "`+b.keyword+`" keyword validation' `),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var pt=i;i=Q.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+pt+"]); ":i+=" validate.errors = ["+pt+"]; return false; ":i+=" var err = "+pt+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var qe=i;i=Q.pop(),V?x.errors?x.errors!="full"&&(i+=" for (var "+P+"="+h+"; "+P+"<errors; "+P+"++) { var "+M+" = vErrors["+P+"]; if ("+M+".dataPath === undefined) "+M+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+M+".schemaPath === undefined) { "+M+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+M+".schema = "+v+"; "+M+".data = "+p+"; "),i+=" } "):x.errors===!1?i+=" "+qe+" ":(i+=" if ("+h+" == errors) { "+qe+" } else { for (var "+P+"="+h+"; "+P+"<errors; "+P+"++) { var "+M+" = vErrors["+P+"]; if ("+M+".dataPath === undefined) "+M+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+M+".schemaPath === undefined) { "+M+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+M+".schema = "+v+"; "+M+".data = "+p+"; "),i+=" } } "):$?(i+=" var err = ",e.createErrors!==!1?(i+=" { keyword: '"+(l||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+b.keyword+"' } ",e.opts.messages!==!1&&(i+=` , message: 'should pass "`+b.keyword+`" keyword validation' `),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; ")):x.errors===!1?i+=" "+qe+" ":(i+=" if (Array.isArray("+D+")) { if (vErrors === null) vErrors = "+D+"; else vErrors = vErrors.concat("+D+"); errors = vErrors.length; for (var "+P+"="+h+"; "+P+"<errors; "+P+"++) { var "+M+" = vErrors["+P+"]; if ("+M+".dataPath === undefined) "+M+".dataPath = (dataPath || '') + "+e.errorPath+"; "+M+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(i+=" "+M+".schema = "+v+"; "+M+".data = "+p+"; "),i+=" } } else { "+qe+" } "),i+=" } ",f&&(i+=" else { ")}return i}});var P_=q((lHe,efe)=>{efe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var hV=q((fHe,mV)=>{"use strict";var pV=P_();mV.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:pV.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:pV.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var yV=q((dHe,gV)=>{"use strict";var tfe=/^[a-z_$][a-z0-9_$-]*$/i,rfe=dV(),nfe=hV();gV.exports={add:ife,get:sfe,remove:ofe,validate:N_};function ife(t,e){var r=this.RULES;if(r.keywords[t])throw new Error("Keyword "+t+" is already defined");if(!tfe.test(t))throw new Error("Keyword "+t+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var n=e.type;if(Array.isArray(n))for(var i=0;i<n.length;i++)o(t,n[i],e);else o(t,n,e);var s=e.metaSchema;s&&(e.$data&&this._opts.$data&&(s={anyOf:[s,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(s,!0))}r.keywords[t]=r.all[t]=!0;function o(a,c,u){for(var f,l=0;l<r.length;l++){var p=r[l];if(p.type==c){f=p;break}}f||(f={type:c,rules:[]},r.push(f));var d={keyword:a,definition:u,custom:!0,code:rfe,implements:u.implements};f.rules.push(d),r.custom[a]=d}return this}function sfe(t){var e=this.RULES.custom[t];return e?e.definition:this.RULES.keywords[t]||!1}function ofe(t){var e=this.RULES;delete e.keywords[t],delete e.all[t],delete e.custom[t];for(var r=0;r<e.length;r++)for(var n=e[r].rules,i=0;i<n.length;i++)if(n[i].keyword==t){n.splice(i,1);break}return this}function N_(t,e){N_.errors=null;var r=this._validateKeyword=this._validateKeyword||this.compile(nfe,!0);if(r(t))return!0;if(N_.errors=r.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(r.errors));return!1}});var vV=q((pHe,afe)=>{afe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var I_=q((mHe,wV)=>{"use strict";var _V=YM(),Pl=av(),cfe=XM(),bV=g_(),ufe=S_(),lfe=fF(),ffe=iV(),SV=aV(),EV=Rl();wV.exports=Yr;Yr.prototype.validate=pfe;Yr.prototype.compile=mfe;Yr.prototype.addSchema=hfe;Yr.prototype.addMetaSchema=gfe;Yr.prototype.validateSchema=yfe;Yr.prototype.getSchema=xfe;Yr.prototype.removeSchema=bfe;Yr.prototype.addFormat=Rfe;Yr.prototype.errorsText=Afe;Yr.prototype._addSchema=Sfe;Yr.prototype._compile=Efe;Yr.prototype.compileAsync=lV();var gv=yV();Yr.prototype.addKeyword=gv.add;Yr.prototype.getKeyword=gv.get;Yr.prototype.removeKeyword=gv.remove;Yr.prototype.validateKeyword=gv.validate;var TV=cv();Yr.ValidationError=TV.Validation;Yr.MissingRefError=TV.MissingRef;Yr.$dataMetaSchema=SV;var hv="http://json-schema.org/draft-07/schema",xV=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],dfe=["/properties"];function Yr(t){if(!(this instanceof Yr))return new Yr(t);t=this._opts=EV.copy(t)||{},Lfe(this),this._schemas={},this._refs={},this._fragments={},this._formats=lfe(t.format),this._cache=t.cache||new cfe,this._loadingSchemas={},this._compilations=[],this.RULES=ffe(),this._getId=Tfe(t),t.loopRequired=t.loopRequired||1/0,t.errorDataPath=="property"&&(t._errorDataPathProperty=!0),t.serialize===void 0&&(t.serialize=ufe),this._metaOpts=Dfe(this),t.formats&&Ofe(this),t.keywords&&Ife(this),Pfe(this),typeof t.meta=="object"&&this.addMetaSchema(t.meta),t.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),Nfe(this)}function pfe(t,e){var r;if(typeof t=="string"){if(r=this.getSchema(t),!r)throw new Error('no schema with key or ref "'+t+'"')}else{var n=this._addSchema(t);r=n.validate||this._compile(n)}var i=r(e);return r.$async!==!0&&(this.errors=r.errors),i}function mfe(t,e){var r=this._addSchema(t,void 0,e);return r.validate||this._compile(r)}function hfe(t,e,r,n){if(Array.isArray(t)){for(var i=0;i<t.length;i++)this.addSchema(t[i],void 0,r,n);return this}var s=this._getId(t);if(s!==void 0&&typeof s!="string")throw new Error("schema id must be string");return e=Pl.normalizeId(e||s),kV(this,e),this._schemas[e]=this._addSchema(t,r,n,!0),this}function gfe(t,e,r){return this.addSchema(t,e,r,!0),this}function yfe(t,e){var r=t.$schema;if(r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this._opts.defaultMeta||vfe(this),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var n=this.validate(r,t);if(!n&&e){var i="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(i);else throw new Error(i)}return n}function vfe(t){var e=t._opts.meta;return t._opts.defaultMeta=typeof e=="object"?t._getId(e)||e:t.getSchema(hv)?hv:void 0,t._opts.defaultMeta}function xfe(t){var e=CV(this,t);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return _fe(this,t)}}function _fe(t,e){var r=Pl.schema.call(t,{schema:{}},e);if(r){var n=r.schema,i=r.root,s=r.baseId,o=_V.call(t,n,i,void 0,s);return t._fragments[e]=new bV({ref:e,fragment:!0,schema:n,root:i,baseId:s,validate:o}),o}}function CV(t,e){return e=Pl.normalizeId(e),t._schemas[e]||t._refs[e]||t._fragments[e]}function bfe(t){if(t instanceof RegExp)return mv(this,this._schemas,t),mv(this,this._refs,t),this;switch(typeof t){case"undefined":return mv(this,this._schemas),mv(this,this._refs),this._cache.clear(),this;case"string":var e=CV(this,t);return e&&this._cache.del(e.cacheKey),delete this._schemas[t],delete this._refs[t],this;case"object":var r=this._opts.serialize,n=r?r(t):t;this._cache.del(n);var i=this._getId(t);i&&(i=Pl.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this}function mv(t,e,r){for(var n in e){var i=e[n];!i.meta&&(!r||r.test(n))&&(t._cache.del(i.cacheKey),delete e[n])}}function Sfe(t,e,r,n){if(typeof t!="object"&&typeof t!="boolean")throw new Error("schema should be object or boolean");var i=this._opts.serialize,s=i?i(t):t,o=this._cache.get(s);if(o)return o;n=n||this._opts.addUsedSchema!==!1;var a=Pl.normalizeId(this._getId(t));a&&n&&kV(this,a);var c=this._opts.validateSchema!==!1&&!e,u;c&&!(u=a&&a==Pl.normalizeId(t.$schema))&&this.validateSchema(t,!0);var f=Pl.ids.call(this,t),l=new bV({id:a,schema:t,localRefs:f,cacheKey:s,meta:r});return a[0]!="#"&&n&&(this._refs[a]=l),this._cache.put(s,l),c&&u&&this.validateSchema(t,!0),l}function Efe(t,e){if(t.compiling)return t.validate=i,i.schema=t.schema,i.errors=null,i.root=e||i,t.schema.$async===!0&&(i.$async=!0),i;t.compiling=!0;var r;t.meta&&(r=this._opts,this._opts=this._metaOpts);var n;try{n=_V.call(this,t.schema,e,t.localRefs)}catch(s){throw delete t.validate,s}finally{t.compiling=!1,t.meta&&(this._opts=r)}return t.validate=n,t.refs=n.refs,t.refVal=n.refVal,t.root=n.root,n;function i(){var s=t.validate,o=s.apply(this,arguments);return i.errors=s.errors,o}}function Tfe(t){switch(t.schemaId){case"auto":return wfe;case"id":return Cfe;default:return kfe}}function Cfe(t){return t.$id&&this.logger.warn("schema $id ignored",t.$id),t.id}function kfe(t){return t.id&&this.logger.warn("schema id ignored",t.id),t.$id}function wfe(t){if(t.$id&&t.id&&t.$id!=t.id)throw new Error("schema $id is different from id");return t.$id||t.id}function Afe(t,e){if(t=t||this.errors,!t)return"No errors";e=e||{};for(var r=e.separator===void 0?", ":e.separator,n=e.dataVar===void 0?"data":e.dataVar,i="",s=0;s<t.length;s++){var o=t[s];o&&(i+=n+o.dataPath+" "+o.message+r)}return i.slice(0,-r.length)}function Rfe(t,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[t]=e,this}function Pfe(t){var e;if(t._opts.$data&&(e=vV(),t.addMetaSchema(e,e.$id,!0)),t._opts.meta!==!1){var r=P_();t._opts.$data&&(r=SV(r,dfe)),t.addMetaSchema(r,hv,!0),t._refs["http://json-schema.org/schema"]=hv}}function Nfe(t){var e=t._opts.schemas;if(e)if(Array.isArray(e))t.addSchema(e);else for(var r in e)t.addSchema(e[r],r)}function Ofe(t){for(var e in t._opts.formats){var r=t._opts.formats[e];t.addFormat(e,r)}}function Ife(t){for(var e in t._opts.keywords){var r=t._opts.keywords[e];t.addKeyword(e,r)}}function kV(t,e){if(t._schemas[e]||t._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function Dfe(t){for(var e=EV.copy(t._opts),r=0;r<xV.length;r++)delete e[xV[r]];return e}function Lfe(t){var e=t._opts.logger;if(e===!1)t.logger={log:O_,warn:O_,error:O_};else{if(e===void 0&&(e=console),!(typeof e=="object"&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");t.logger=e}}function O_(){}});var ej=q((sKe,XV)=>{var Wp=1e3,Kp=Wp*60,Gp=Kp*60,Il=Gp*24,Zfe=Il*7,Xfe=Il*365.25;XV.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return ede(t);if(r==="number"&&isFinite(t))return e.long?rde(t):tde(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function ede(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*Xfe;case"weeks":case"week":case"w":return r*Zfe;case"days":case"day":case"d":return r*Il;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Gp;case"minutes":case"minute":case"mins":case"min":case"m":return r*Kp;case"seconds":case"second":case"secs":case"sec":case"s":return r*Wp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function tde(t){var e=Math.abs(t);return e>=Il?Math.round(t/Il)+"d":e>=Gp?Math.round(t/Gp)+"h":e>=Kp?Math.round(t/Kp)+"m":e>=Wp?Math.round(t/Wp)+"s":t+"ms"}function rde(t){var e=Math.abs(t);return e>=Il?Ev(t,e,Il,"day"):e>=Gp?Ev(t,e,Gp,"hour"):e>=Kp?Ev(t,e,Kp,"minute"):e>=Wp?Ev(t,e,Wp,"second"):t+" ms"}function Ev(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var z_=q((oKe,tj)=>{function nde(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=ej(),r.destroy=u,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let l=0;for(let p=0;p<f.length;p++)l=(l<<5)-l+f.charCodeAt(p),l|=0;return r.colors[Math.abs(l)%r.colors.length]}r.selectColor=e;function r(f){let l,p=null,d,h;function g(...v){if(!g.enabled)return;let b=g,_=Number(new Date),x=_-(l||_);b.diff=x,b.prev=l,b.curr=_,l=_,v[0]=r.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let T=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(V,$)=>{if(V==="%%")return"%";T++;let K=r.formatters[$];if(typeof K=="function"){let z=v[T];V=K.call(b,z),v.splice(T,1),T--}return V}),r.formatArgs.call(b,v),(b.log||r.log).apply(b,v)}return g.namespace=f,g.useColors=r.useColors(),g.color=r.selectColor(f),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(d!==r.namespaces&&(d=r.namespaces,h=r.enabled(f)),h),set:v=>{p=v}}),typeof r.init=="function"&&r.init(g),g}function n(f,l){let p=r(this.namespace+(typeof l=="undefined"?":":l)+f);return p.log=this.log,p}function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let l=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of l)p[0]==="-"?r.skips.push(p.slice(1)):r.names.push(p)}function s(f,l){let p=0,d=0,h=-1,g=0;for(;p<f.length;)if(d<l.length&&(l[d]===f[p]||l[d]==="*"))l[d]==="*"?(h=d,g=p,d++):(p++,d++);else if(h!==-1)d=h+1,g++,p=g;else return!1;for(;d<l.length&&l[d]==="*";)d++;return d===l.length}function o(){let f=[...r.names,...r.skips.map(l=>"-"+l)].join(",");return r.enable(""),f}function a(f){for(let l of r.skips)if(s(f,l))return!1;for(let l of r.names)if(s(f,l))return!0;return!1}function c(f){return f instanceof Error?f.stack||f.message:f}function u(){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}tj.exports=nde});var rj=q((Qi,Tv)=>{Qi.formatArgs=sde;Qi.save=ode;Qi.load=ade;Qi.useColors=ide;Qi.storage=cde();Qi.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`."))}})();Qi.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 ide(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function sde(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Tv.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)}Qi.log=console.debug||console.log||(()=>{});function ode(t){try{t?Qi.storage.setItem("debug",t):Qi.storage.removeItem("debug")}catch(e){}}function ade(){let t;try{t=Qi.storage.getItem("debug")||Qi.storage.getItem("DEBUG")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function cde(){try{return localStorage}catch(t){}}Tv.exports=z_()(Qi);var{formatters:ude}=Tv.exports;ude.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ij=q((aKe,nj)=>{"use strict";nj.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 aj=q((cKe,oj)=>{"use strict";var lde=require("os"),sj=require("tty"),Qs=ij(),{env:$n}=process,Jc;Qs("no-color")||Qs("no-colors")||Qs("color=false")||Qs("color=never")?Jc=0:(Qs("color")||Qs("colors")||Qs("color=true")||Qs("color=always"))&&(Jc=1);"FORCE_COLOR"in $n&&($n.FORCE_COLOR==="true"?Jc=1:$n.FORCE_COLOR==="false"?Jc=0:Jc=$n.FORCE_COLOR.length===0?1:Math.min(parseInt($n.FORCE_COLOR,10),3));function W_(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function K_(t,e){if(Jc===0)return 0;if(Qs("color=16m")||Qs("color=full")||Qs("color=truecolor"))return 3;if(Qs("color=256"))return 2;if(t&&!e&&Jc===void 0)return 0;let r=Jc||0;if($n.TERM==="dumb")return r;if(process.platform==="win32"){let n=lde.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in $n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in $n)||$n.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in $n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($n.TEAMCITY_VERSION)?1:0;if($n.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $n){let n=parseInt(($n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($n.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($n.TERM)||"COLORTERM"in $n?1:r}function fde(t){let e=K_(t,t&&t.isTTY);return W_(e)}oj.exports={supportsColor:fde,stdout:W_(K_(!0,sj.isatty(1))),stderr:W_(K_(!0,sj.isatty(2)))}});var uj=q((Mn,kv)=>{var dde=require("tty"),Cv=require("util");Mn.init=xde;Mn.log=gde;Mn.formatArgs=mde;Mn.save=yde;Mn.load=vde;Mn.useColors=pde;Mn.destroy=Cv.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Mn.colors=[6,2,3,4,5,1];try{let t=aj();t&&(t.stderr||t).level>=2&&(Mn.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(t){}Mn.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,s)=>s.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 pde(){return"colors"in Mn.inspectOpts?!!Mn.inspectOpts.colors:dde.isatty(process.stderr.fd)}function mde(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
84
+ `).join(`
85
+ `+s),t.push(i+"m+"+kv.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=hde()+e+" "+t[0]}function hde(){return Mn.inspectOpts.hideDate?"":new Date().toISOString()+" "}function gde(...t){return process.stderr.write(Cv.formatWithOptions(Mn.inspectOpts,...t)+`
86
+ `)}function yde(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function vde(){return process.env.DEBUG}function xde(t){t.inspectOpts={};let e=Object.keys(Mn.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Mn.inspectOpts[e[r]]}kv.exports=z_()(Mn);var{formatters:cj}=kv.exports;cj.o=function(t){return this.inspectOpts.colors=this.useColors,Cv.inspect(t,this.inspectOpts).split(`
87
+ `).map(e=>e.trim()).join(" ")};cj.O=function(t){return this.inspectOpts.colors=this.useColors,Cv.inspect(t,this.inspectOpts)}});var J_=q((uKe,G_)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?G_.exports=rj():G_.exports=uj()});var lj=q(_s=>{"use strict";var _de=_s&&_s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_s,"__esModule",{value:!0});var bde=require("fs"),Sde=_de(J_()),Jp=Sde.default("@kwsites/file-exists");function Ede(t,e,r){Jp("checking %s",t);try{let n=bde.statSync(t);return n.isFile()&&e?(Jp("[OK] path represents a file"),!0):n.isDirectory()&&r?(Jp("[OK] path represents a directory"),!0):(Jp("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Jp("[FAIL] path is not accessible: %o",n),!1;throw Jp("[FATAL] %o",n),n}}function Tde(t,e=_s.READABLE){return Ede(t,(e&_s.FILE)>0,(e&_s.FOLDER)>0)}_s.exists=Tde;_s.FILE=1;_s.FOLDER=2;_s.READABLE=_s.FILE+_s.FOLDER});var fj=q(wv=>{"use strict";function Cde(t){for(var e in t)wv.hasOwnProperty(e)||(wv[e]=t[e])}Object.defineProperty(wv,"__esModule",{value:!0});Cde(lj())});var Y_=q(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.createDeferred=Dl.deferred=void 0;function Q_(){let t,e,r="pending";return{promise:new Promise((i,s)=>{t=i,e=s}),done(i){r==="pending"&&(r="resolved",t(i))},fail(i){r==="pending"&&(r="rejected",e(i))},get fulfilled(){return r!=="pending"},get status(){return r}}}Dl.deferred=Q_;Dl.createDeferred=Q_;Dl.default=Q_});var gge={};ua(gge,{main:()=>hge});module.exports=yH(gge);var CS=ke(TS(),1),{program:Dge,createCommand:Lge,createArgument:$ge,createOption:Mge,CommanderError:Fge,InvalidArgumentError:Vge,InvalidOptionArgumentError:jge,Command:kS,Argument:Uge,Option:qge,Help:Bge}=CS.default;var be={};ua(be,{AbstractAstReflection:()=>ru,AbstractCstNode:()=>ch,AbstractLangiumParser:()=>uh,AbstractParserErrorMessageProvider:()=>S2,AbstractThreadedAsyncParser:()=>O9,AstUtils:()=>Fe,BiMap:()=>Ru,Cancellation:()=>ye,CompositeCstNodeImpl:()=>Cu,ContextCache:()=>Nu,CstNodeBuilder:()=>ah,CstUtils:()=>Kg,DEFAULT_TOKENIZE_OPTIONS:()=>I2,DONE_RESULT:()=>Qn,DatatypeSymbol:()=>b2,DefaultAstNodeDescriptionProvider:()=>wh,DefaultAstNodeLocator:()=>Rh,DefaultAsyncParser:()=>Vh,DefaultCommentProvider:()=>Fh,DefaultConfigurationProvider:()=>Ph,DefaultDocumentBuilder:()=>Du,DefaultDocumentValidator:()=>Iu,DefaultHydrator:()=>jh,DefaultIndexManager:()=>Lu,DefaultJsonSerializer:()=>Eh,DefaultLangiumDocumentFactory:()=>hh,DefaultLangiumDocuments:()=>gh,DefaultLexer:()=>$u,DefaultLexerErrorMessageProvider:()=>Oh,DefaultLinker:()=>yh,DefaultNameProvider:()=>vh,DefaultReferenceDescriptionProvider:()=>Ah,DefaultReferences:()=>xh,DefaultScopeComputation:()=>_h,DefaultScopeProvider:()=>Sh,DefaultServiceRegistry:()=>Ch,DefaultTokenBuilder:()=>wu,DefaultValueConverter:()=>ph,DefaultWorkspaceLock:()=>Mu,DefaultWorkspaceManager:()=>Nh,Deferred:()=>qn,Disposable:()=>bc,DisposableCache:()=>Dd,DocumentCache:()=>N2,DocumentState:()=>er,DocumentValidator:()=>Rs,EMPTY_SCOPE:()=>us,EMPTY_STREAM:()=>fm,EmptyFileSystem:()=>$9,EmptyFileSystemProvider:()=>V2,ErrorWithLocation:()=>su,GrammarAST:()=>cu,GrammarUtils:()=>n0,IndentationAwareLexer:()=>L9,IndentationAwareTokenBuilder:()=>F2,JSDocDocumentationProvider:()=>Mh,LangiumCompletionParser:()=>fh,LangiumParser:()=>lh,LangiumParserErrorMessageProvider:()=>Rd,LeafCstNodeImpl:()=>Tu,LexingMode:()=>Vu,MapScope:()=>Pu,Module:()=>Ld,MultiMap:()=>On,OperationCancelled:()=>Vo,ParserWorker:()=>I9,Reduction:()=>Wl,RegExpUtils:()=>t0,RootCstNodeImpl:()=>Ad,SimpleCache:()=>bh,StreamImpl:()=>ns,StreamScope:()=>Cn,TextDocument:()=>xc,TreeStreamImpl:()=>bo,URI:()=>De,UriUtils:()=>ee,ValidationCategory:()=>_c,ValidationRegistry:()=>kh,ValueConverter:()=>Fo,WorkspaceCache:()=>nr,assertUnreachable:()=>Eo,createCompletionParser:()=>g9,createDefaultCoreModule:()=>Uh,createDefaultSharedCoreModule:()=>qh,createGrammarConfig:()=>d6,createLangiumParser:()=>y9,createParser:()=>dh,delayNextTick:()=>T9,diagnosticData:()=>Ou,eagerLoad:()=>Bh,getDiagnosticRange:()=>bA,indentationBuilderDefaultOptions:()=>D9,inject:()=>Fu,interruptAndCheck:()=>it,isAstNode:()=>It,isAstNodeDescription:()=>um,isAstNodeWithComment:()=>Th,isCompositeCstNode:()=>to,isIMultiModeLexerDefinition:()=>A9,isJSDoc:()=>$h,isLeafCstNode:()=>Qa,isLinkingError:()=>eo,isNamed:()=>P2,isOperationCancelled:()=>jo,isReference:()=>Vn,isRootCstNode:()=>lm,isTokenTypeArray:()=>D2,isTokenTypeDictionary:()=>w9,loadGrammarFromJson:()=>j2,parseJSDoc:()=>Lh,prepareLangiumParser:()=>lA,setInterruptionPeriod:()=>hA,startCancelableOperation:()=>A2,stream:()=>nt,toDiagnosticData:()=>SA,toDiagnosticSeverity:()=>O2});var Kg={};ua(Kg,{DefaultNameRegexp:()=>Wg,RangeComparison:()=>So,compareRange:()=>AS,findCommentNode:()=>pm,findDeclarationNodeAtOffset:()=>Ai,findLeafNodeAtOffset:()=>P8,findLeafNodeBeforeOffset:()=>mm,flattenCst:()=>A8,getInteriorNodes:()=>MH,getNextNode:()=>LH,getPreviousNode:()=>PS,getStartlineNode:()=>$H,inRange:()=>dm,isChildNode:()=>R8,isCommentNode:()=>w8,streamCst:()=>nu,toDocumentSegment:()=>iu,tokenToRange:()=>Kl});function It(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Vn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function um(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function eo(t){return typeof t=="object"&&t!==null&&It(t.container)&&Vn(t.reference)&&typeof t.message=="string"}var ru=class{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,r){return It(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});let i=n[r];if(i!==void 0)return i;{let s=this.computeIsSubtype(e,r);return n[r]=s,s}}getAllSubTypes(e){let r=this.allSubtypes[e];if(r)return r;{let n=this.getAllTypes(),i=[];for(let s of n)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}};function to(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Qa(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function lm(t){return to(t)&&typeof t.fullText=="string"}var ns=class t{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){let e=[],r=this.iterator(),n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){let n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new t(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Qn})}join(e=","){let r=this.iterator(),n="",i,s=!1;do i=r.next(),i.done||(s&&(n+=e),n+=DH(i.value)),s=!0;while(!i.done);return n}indexOf(e,r=0){let n=this.iterator(),i=0,s=n.next();for(;!s.done;){if(i>=r&&s.value===e)return i;s=n.next(),i++}return-1}every(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new t(this.startFn,r=>{let{done:n,value:i}=this.nextFn(r);return n?Qn:{done:!1,value:e(i)}})}filter(e){return new t(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Qn})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){let n=this.iterator(),i=r,s=n.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=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 s=this.recursiveReduce(e,r,n);return s===void 0?i.value:r(s,i.value)}find(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){let r=this.iterator(),n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){let r=this.iterator(),n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new t(()=>({this:this.startFn()}),r=>{do{if(r.iterator){let s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}let{done:n,value:i}=this.nextFn(r.this);if(!n){let s=e(i);if(zg(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return Qn})}flat(e){if(e===void 0&&(e=1),e<=0)return this;let r=e>1?this.flat(e-1):this;return new t(()=>({this:r.startFn()}),n=>{do{if(n.iterator){let o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}let{done:i,value:s}=r.nextFn(n.this);if(!i)if(zg(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return Qn})}head(){let r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new t(()=>{let r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new t(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Qn:this.nextFn(r.state)))}distinct(e){return new t(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){let i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Qn})}exclude(e,r){let n=new Set;for(let i of e){let s=r?r(i):i;n.add(s)}return this.filter(i=>{let s=r?r(i):i;return!n.has(s)})}};function DH(t){return typeof t=="string"?t:typeof t=="undefined"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function zg(t){return!!t&&typeof t[Symbol.iterator]=="function"}var fm=new ns(()=>{},()=>Qn),Qn=Object.freeze({done:!0,value:void 0});function nt(...t){if(t.length===1){let e=t[0];if(e instanceof ns)return e;if(zg(e))return new ns(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new ns(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Qn)}return t.length>1?new ns(()=>({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++];zg(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Qn}):fm}var bo=class extends ns{constructor(e,r,n){super(()=>({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let o=i.iterators[i.iterators.length-1].next();if(o.done)i.iterators.pop();else return i.iterators.push(r(o.value)[Symbol.iterator]()),o}return Qn})}iterator(){let e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}},Wl;(function(t){function e(s){return s.reduce((o,a)=>o+a,0)}t.sum=e;function r(s){return s.reduce((o,a)=>o*a,0)}t.product=r;function n(s){return s.reduce((o,a)=>Math.min(o,a))}t.min=n;function i(s){return s.reduce((o,a)=>Math.max(o,a))}t.max=i})(Wl||(Wl={}));function nu(t){return new bo(t,e=>to(e)?e.content:[],{includeRoot:!0})}function A8(t){return nu(t).filter(Qa)}function R8(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Kl(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function iu(t){if(!t)return;let{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var So;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(So||(So={}));function AS(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return So.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return So.After;let r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?So.Inside:r?So.OverlapBack:n?So.OverlapFront:So.Outside}function dm(t,e){return AS(t,e)>So.After}var Wg=/^[\w\p{L}]$/u;function Ai(t,e,r=Wg){if(t){if(e>0){let n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return P8(t,e)}}function pm(t,e){if(t){let r=PS(t,!0);if(r&&w8(r,e))return r;if(lm(t)){let n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){let s=t.content[i];if(w8(s,e))return s}}}}function w8(t,e){return Qa(t)&&e.includes(t.tokenType.name)}function P8(t,e){if(Qa(t))return t;if(to(t)){let r=RS(t,e,!1);if(r)return P8(r,e)}}function mm(t,e){if(Qa(t))return t;if(to(t)){let r=RS(t,e,!0);if(r)return mm(r,e)}}function RS(t,e,r){let n=0,i=t.content.length-1,s;for(;n<=i;){let o=Math.floor((n+i)/2),a=t.content[o];if(a.offset<=e&&a.end>e)return a;a.end<=e?(s=r?a:void 0,n=o+1):i=o-1}return s}function PS(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t);for(;n>0;){n--;let i=r.content[n];if(e||!i.hidden)return i}t=r}}function LH(t,e=!0){for(;t.container;){let r=t.container,n=r.content.indexOf(t),i=r.content.length-1;for(;n<i;){n++;let s=r.content[n];if(e||!s.hidden)return s}t=r}}function $H(t){if(t.range.start.character===0)return t;let e=t.range.start.line,r=t,n;for(;t.container;){let i=t.container,s=n!=null?n:i.content.indexOf(t);if(s===0?(t=i,n=void 0):(n=s-1,t=i.content[n]),t.range.start.line!==e)break;r=t}return r}function MH(t,e){let r=FH(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function FH(t,e){let r=wS(t),n=wS(e),i;for(let s=0;s<r.length&&s<n.length;s++){let o=r[s],a=n[s];if(o.parent===a.parent)i={parent:o.parent,a:o.index,b:a.index};else break}return i}function wS(t){let e=[];for(;t.container;){let r=t.container,n=r.content.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}var n0={};ua(n0,{findAssignment:()=>c6,findNameAssignment:()=>r0,findNodeForKeyword:()=>Im,findNodeForProperty:()=>pu,findNodesForKeyword:()=>o6,findNodesForKeywordInternal:()=>a6,findNodesForProperty:()=>Om,getActionAtElement:()=>VS,getActionType:()=>US,getAllReachableRules:()=>Pm,getAllRulesUsedForCrossReferences:()=>sz,getCrossReferenceTerminal:()=>Nm,getEntryRule:()=>Rm,getExplicitRuleType:()=>Co,getHiddenRules:()=>$S,getRuleType:()=>l6,getRuleTypeName:()=>cz,getTypeName:()=>hu,isArrayCardinality:()=>u6,isArrayOperator:()=>oz,isCommentTerminal:()=>i6,isDataType:()=>az,isDataTypeRule:()=>Dm,isOptionalCardinality:()=>mu,terminalRegex:()=>Za});var su=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}};function Eo(t){throw new Error("Error! The input value was not handled.")}var cu={};ua(cu,{AbstractElement:()=>Ql,AbstractRule:()=>Gl,AbstractType:()=>Jl,Action:()=>gf,Alternatives:()=>yf,ArrayLiteral:()=>Yl,ArrayType:()=>Zl,Assignment:()=>vf,BooleanLiteral:()=>Xl,CharacterRange:()=>xf,Condition:()=>hm,Conjunction:()=>ef,CrossReference:()=>_f,Disjunction:()=>tf,EndOfFile:()=>bf,Grammar:()=>rf,GrammarImport:()=>ym,Group:()=>Sf,InferredType:()=>nf,Interface:()=>sf,Keyword:()=>Ef,LangiumGrammarAstReflection:()=>If,LangiumGrammarTerminals:()=>VH,NamedArgument:()=>vm,NegatedToken:()=>Tf,Negation:()=>of,NumberLiteral:()=>af,Parameter:()=>cf,ParameterReference:()=>uf,ParserRule:()=>lf,ReferenceType:()=>ff,RegexToken:()=>Cf,ReturnType:()=>xm,RuleCall:()=>kf,SimpleType:()=>df,StringLiteral:()=>pf,TerminalAlternatives:()=>wf,TerminalGroup:()=>Af,TerminalRule:()=>ou,TerminalRuleCall:()=>Rf,Type:()=>mf,TypeAttribute:()=>_m,TypeDefinition:()=>Gg,UnionType:()=>hf,UnorderedGroup:()=>Pf,UntilToken:()=>Nf,ValueLiteral:()=>gm,Wildcard:()=>Of,isAbstractElement:()=>au,isAbstractRule:()=>jH,isAbstractType:()=>UH,isAction:()=>ro,isAlternatives:()=>Df,isArrayLiteral:()=>WH,isArrayType:()=>N8,isAssignment:()=>Yn,isBooleanLiteral:()=>O8,isCharacterRange:()=>j8,isCondition:()=>qH,isConjunction:()=>I8,isCrossReference:()=>is,isDisjunction:()=>D8,isEndOfFile:()=>U8,isFeatureName:()=>BH,isGrammar:()=>KH,isGrammarImport:()=>GH,isGroup:()=>ks,isInferredType:()=>bm,isInterface:()=>Jg,isKeyword:()=>Sn,isNamedArgument:()=>JH,isNegatedToken:()=>q8,isNegation:()=>L8,isNumberLiteral:()=>QH,isParameter:()=>YH,isParameterReference:()=>$8,isParserRule:()=>Ar,isPrimitiveType:()=>NS,isReferenceType:()=>M8,isRegexToken:()=>B8,isReturnType:()=>F8,isRuleCall:()=>Ri,isSimpleType:()=>Qg,isStringLiteral:()=>ZH,isTerminalAlternatives:()=>H8,isTerminalGroup:()=>z8,isTerminalRule:()=>pi,isTerminalRuleCall:()=>Yg,isType:()=>Sm,isTypeAttribute:()=>XH,isTypeDefinition:()=>HH,isUnionType:()=>V8,isUnorderedGroup:()=>Lf,isUntilToken:()=>W8,isValueLiteral:()=>zH,isWildcard:()=>K8,reflection:()=>st});var VH={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},Gl="AbstractRule";function jH(t){return st.isInstance(t,Gl)}var Jl="AbstractType";function UH(t){return st.isInstance(t,Jl)}var hm="Condition";function qH(t){return st.isInstance(t,hm)}function BH(t){return NS(t)||t==="current"||t==="entry"||t==="extends"||t==="false"||t==="fragment"||t==="grammar"||t==="hidden"||t==="import"||t==="interface"||t==="returns"||t==="terminal"||t==="true"||t==="type"||t==="infer"||t==="infers"||t==="with"||typeof t=="string"&&/\^?[_a-zA-Z][\w_]*/.test(t)}function NS(t){return t==="string"||t==="number"||t==="boolean"||t==="Date"||t==="bigint"}var Gg="TypeDefinition";function HH(t){return st.isInstance(t,Gg)}var gm="ValueLiteral";function zH(t){return st.isInstance(t,gm)}var Ql="AbstractElement";function au(t){return st.isInstance(t,Ql)}var Yl="ArrayLiteral";function WH(t){return st.isInstance(t,Yl)}var Zl="ArrayType";function N8(t){return st.isInstance(t,Zl)}var Xl="BooleanLiteral";function O8(t){return st.isInstance(t,Xl)}var ef="Conjunction";function I8(t){return st.isInstance(t,ef)}var tf="Disjunction";function D8(t){return st.isInstance(t,tf)}var rf="Grammar";function KH(t){return st.isInstance(t,rf)}var ym="GrammarImport";function GH(t){return st.isInstance(t,ym)}var nf="InferredType";function bm(t){return st.isInstance(t,nf)}var sf="Interface";function Jg(t){return st.isInstance(t,sf)}var vm="NamedArgument";function JH(t){return st.isInstance(t,vm)}var of="Negation";function L8(t){return st.isInstance(t,of)}var af="NumberLiteral";function QH(t){return st.isInstance(t,af)}var cf="Parameter";function YH(t){return st.isInstance(t,cf)}var uf="ParameterReference";function $8(t){return st.isInstance(t,uf)}var lf="ParserRule";function Ar(t){return st.isInstance(t,lf)}var ff="ReferenceType";function M8(t){return st.isInstance(t,ff)}var xm="ReturnType";function F8(t){return st.isInstance(t,xm)}var df="SimpleType";function Qg(t){return st.isInstance(t,df)}var pf="StringLiteral";function ZH(t){return st.isInstance(t,pf)}var ou="TerminalRule";function pi(t){return st.isInstance(t,ou)}var mf="Type";function Sm(t){return st.isInstance(t,mf)}var _m="TypeAttribute";function XH(t){return st.isInstance(t,_m)}var hf="UnionType";function V8(t){return st.isInstance(t,hf)}var gf="Action";function ro(t){return st.isInstance(t,gf)}var yf="Alternatives";function Df(t){return st.isInstance(t,yf)}var vf="Assignment";function Yn(t){return st.isInstance(t,vf)}var xf="CharacterRange";function j8(t){return st.isInstance(t,xf)}var _f="CrossReference";function is(t){return st.isInstance(t,_f)}var bf="EndOfFile";function U8(t){return st.isInstance(t,bf)}var Sf="Group";function ks(t){return st.isInstance(t,Sf)}var Ef="Keyword";function Sn(t){return st.isInstance(t,Ef)}var Tf="NegatedToken";function q8(t){return st.isInstance(t,Tf)}var Cf="RegexToken";function B8(t){return st.isInstance(t,Cf)}var kf="RuleCall";function Ri(t){return st.isInstance(t,kf)}var wf="TerminalAlternatives";function H8(t){return st.isInstance(t,wf)}var Af="TerminalGroup";function z8(t){return st.isInstance(t,Af)}var Rf="TerminalRuleCall";function Yg(t){return st.isInstance(t,Rf)}var Pf="UnorderedGroup";function Lf(t){return st.isInstance(t,Pf)}var Nf="UntilToken";function W8(t){return st.isInstance(t,Nf)}var Of="Wildcard";function K8(t){return st.isInstance(t,Of)}var If=class extends ru{getAllTypes(){return[Ql,Gl,Jl,gf,yf,Yl,Zl,vf,Xl,xf,hm,ef,_f,tf,bf,rf,ym,Sf,nf,sf,Ef,vm,Tf,of,af,cf,uf,lf,ff,Cf,xm,kf,df,pf,wf,Af,ou,Rf,mf,_m,Gg,hf,Pf,Nf,gm,Of]}computeIsSubtype(e,r){switch(e){case gf:case yf:case vf:case xf:case _f:case bf:case Sf:case Ef:case Tf:case Cf:case kf:case wf:case Af:case Rf:case Pf:case Nf:case Of:return this.isSubtype(Ql,r);case Yl:case af:case pf:return this.isSubtype(gm,r);case Zl:case ff:case df:case hf:return this.isSubtype(Gg,r);case Xl:return this.isSubtype(hm,r)||this.isSubtype(gm,r);case ef:case tf:case of:case uf:return this.isSubtype(hm,r);case nf:case sf:case mf:return this.isSubtype(Jl,r);case lf:return this.isSubtype(Gl,r)||this.isSubtype(Jl,r);case ou:return this.isSubtype(Gl,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Jl;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Gl;case"Grammar:usedGrammars":return rf;case"NamedArgument:parameter":case"ParameterReference:parameter":return cf;case"TerminalRuleCall:rule":return ou;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Ql:return{name:Ql,properties:[{name:"cardinality"},{name:"lookahead"}]};case Yl:return{name:Yl,properties:[{name:"elements",defaultValue:[]}]};case Zl:return{name:Zl,properties:[{name:"elementType"}]};case Xl:return{name:Xl,properties:[{name:"true",defaultValue:!1}]};case ef:return{name:ef,properties:[{name:"left"},{name:"right"}]};case tf:return{name:tf,properties:[{name:"left"},{name:"right"}]};case rf:return{name:rf,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case ym:return{name:ym,properties:[{name:"path"}]};case nf:return{name:nf,properties:[{name:"name"}]};case sf:return{name:sf,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case vm:return{name:vm,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case of:return{name:of,properties:[{name:"value"}]};case af:return{name:af,properties:[{name:"value"}]};case cf:return{name:cf,properties:[{name:"name"}]};case uf:return{name:uf,properties:[{name:"parameter"}]};case lf:return{name:lf,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case ff:return{name:ff,properties:[{name:"referenceType"}]};case xm:return{name:xm,properties:[{name:"name"}]};case df:return{name:df,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case pf:return{name:pf,properties:[{name:"value"}]};case ou:return{name:ou,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case mf:return{name:mf,properties:[{name:"name"},{name:"type"}]};case _m:return{name:_m,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case hf:return{name:hf,properties:[{name:"types",defaultValue:[]}]};case gf:return{name:gf,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case yf:return{name:yf,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case vf:return{name:vf,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case xf:return{name:xf,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case _f:return{name:_f,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case bf:return{name:bf,properties:[{name:"cardinality"},{name:"lookahead"}]};case Sf:return{name:Sf,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Ef:return{name:Ef,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case Tf:return{name:Tf,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Cf:return{name:Cf,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case kf:return{name:kf,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case wf:return{name:wf,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Af:return{name:Af,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Rf:return{name:Rf,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Pf:return{name:Pf,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Nf:return{name:Nf,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Of:return{name:Of,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}},st=new If;var Fe={};ua(Fe,{assignMandatoryProperties:()=>Tm,copyAstNode:()=>J8,findLocalReferences:()=>tz,findRootNode:()=>Em,getContainerOfType:()=>ss,getDocument:()=>dn,hasContainerOfType:()=>ez,linkContentToContainer:()=>Zg,streamAllContents:()=>os,streamAst:()=>Pi,streamContents:()=>uu,streamReferences:()=>$f});function Zg(t){for(let[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{It(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):It(r)&&(r.$container=t,r.$containerProperty=e))}function ss(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function ez(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function dn(t){let r=Em(t).$document;if(!r)throw new Error("AST node has no document.");return r}function Em(t){for(;t.$container;)t=t.$container;return t}function uu(t,e){if(!t)throw new Error("Node must be an AstNode.");let r=e==null?void 0:e.range;return new ns(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){let i=n.keys[n.keyIndex];if(!i.startsWith("$")){let s=t[i];if(It(s)){if(n.keyIndex++,G8(s,r))return{done:!1,value:s}}else if(Array.isArray(s)){for(;n.arrayIndex<s.length;){let o=n.arrayIndex++,a=s[o];if(It(a)&&G8(a,r))return{done:!1,value:a}}n.arrayIndex=0}}n.keyIndex++}return Qn})}function os(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new bo(t,r=>uu(r,e))}function Pi(t,e){if(t){if(e!=null&&e.range&&!G8(t,e.range))return new bo(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new bo(t,r=>uu(r,e),{includeRoot:!0})}function G8(t,e){var r;if(!e)return!0;let n=(r=t.$cstNode)===null||r===void 0?void 0:r.range;return n?dm(n,e):!1}function $f(t){return new ns(()=>({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(Vn(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++,s=n[i];if(Vn(s))return{done:!1,value:{reference:s,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Qn})}function tz(t,e=dn(t).parseResult.value){let r=[];return Pi(e).forEach(n=>{$f(n).forEach(i=>{i.reference.ref===t&&r.push(i.reference)})}),nt(r)}function Tm(t,e){let r=t.getTypeMetaData(e.$type),n=e;for(let i of r.properties)i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=OS(i.defaultValue))}function OS(t){return Array.isArray(t)?[...t.map(OS)]:t}function J8(t,e){let r={$type:t.$type};for(let[n,i]of Object.entries(t))if(!n.startsWith("$"))if(It(i))r[n]=J8(i,e);else if(Vn(i))r[n]=e(r,n,i.$refNode,i.$refText);else if(Array.isArray(i)){let s=[];for(let o of i)It(o)?s.push(J8(o,e)):Vn(o)?s.push(e(r,n,o.$refNode,o.$refText)):s.push(o);r[n]=s}else r[n]=i;return Zg(r),r}var t0={};ua(t0,{NEWLINE_REGEXP:()=>X8,escapeRegExp:()=>Ya,getTerminalParts:()=>iz,isMultilineComment:()=>e6,isWhitespace:()=>Am,partialMatches:()=>t6,partialRegExp:()=>LS,whitespaceCharacters:()=>DS});function Xe(t){return t.charCodeAt(0)}function Xg(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Mf(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function lu(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Cm(){throw Error("Internal Error - Should never get here!")}function Q8(t){return t.type==="Character"}var km=[];for(let t=Xe("0");t<=Xe("9");t++)km.push(t);var wm=[Xe("_")].concat(km);for(let t=Xe("a");t<=Xe("z");t++)wm.push(t);for(let t=Xe("A");t<=Xe("Z");t++)wm.push(t);var Y8=[Xe(" "),Xe("\f"),Xe(`
88
+ `),Xe("\r"),Xe(" "),Xe("\v"),Xe(" "),Xe("\xA0"),Xe("\u1680"),Xe("\u2000"),Xe("\u2001"),Xe("\u2002"),Xe("\u2003"),Xe("\u2004"),Xe("\u2005"),Xe("\u2006"),Xe("\u2007"),Xe("\u2008"),Xe("\u2009"),Xe("\u200A"),Xe("\u2028"),Xe("\u2029"),Xe("\u202F"),Xe("\u205F"),Xe("\u3000"),Xe("\uFEFF")];var rz=/[0-9a-fA-F]/,e0=/[0-9]/,nz=/[1-9]/,fu=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Mf(n,"global");break;case"i":Mf(n,"ignoreCase");break;case"m":Mf(n,"multiLine");break;case"u":Mf(n,"unicode");break;case"y":Mf(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}lu(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Cm()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),r={atLeast:i,atMost:s}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;lu(r);break}if(!(e===!0&&r===void 0)&&lu(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),lu(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Cm()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Xe(`
89
+ `),Xe("\r"),Xe("\u2028"),Xe("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=km;break;case"D":e=km,r=!0;break;case"s":e=Y8;break;case"S":e=Y8,r=!0;break;case"w":e=wm;break;case"W":e=wm,r=!0;break}return lu(e)?{type:"Set",value:e,complement:r}:Cm()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Xe("\f");break;case"n":e=Xe(`
90
+ `);break;case"r":e=Xe("\r");break;case"t":e=Xe(" ");break;case"v":e=Xe("\v");break}return lu(e)?{type:"Character",value:e}:Cm()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Xe("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:Xe(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
91
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:Xe(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(Q8(n)&&this.isRangeDash()){this.consumeChar("-");let s=this.classAtom(),o=s.type==="Character";if(Q8(s)){if(s.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:s.value})}else Xg(n.value,e),e.push(Xe("-")),Xg(s.value,e)}else Xg(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
92
+ `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:Xe("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(nz.test(e)===!1)throw Error("Expecting a positive integer");for(;e0.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(e0.test(e)===!1)throw Error("Expecting an integer");for(;e0.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
93
+ `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:Xe(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return e0.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
94
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch(r){return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
95
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let s=this.popChar();if(rz.test(s)===!1)throw Error("Expecting a HexDecimal digits");r+=s}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var To=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var X8=/\r?\n/gm,IS=new fu,Z8=class extends To{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){let r=String.fromCharCode(e.value);if(!this.multiline&&r===`
96
+ `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=Ya(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){let r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
97
+ `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},du=new Z8;function iz(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;let e=IS.pattern(t),r=[];for(let n of e.value.value)du.reset(t),du.visit(n),r.push({start:du.startRegexp,end:du.endRegex});return r}catch(e){return[]}}function e6(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),du.reset(t),du.visit(IS.pattern(t)),du.multiline}catch(e){return!1}}var DS=`\f
98
+ \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function Am(t){let e=typeof t=="string"?new RegExp(t):t;return DS.some(r=>e.test(r))}function Ya(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function t6(t,e){let r=LS(t),n=e.match(r);return!!n&&n[0].length>0}function LS(t){typeof t=="string"&&(t=new RegExp(t));let e=t,r=t.source,n=0;function i(){let s="",o;function a(u){s+=r.substr(n,u),n+=u}function c(u){s+="(?:"+r.substr(n,u)+"|$)",n+=u}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?r[n+2]==="{"?c(r.indexOf("}",n)-n+1):c(6):c(2);break;case"p":case"P":e.unicode?c(r.indexOf("}",n)-n+1):c(2);break;case"k":c(r.indexOf(">",n)-n+1);break;default:c(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],c(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?a(o[0].length):c(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=i()+"|$)";break;case"=":s+="(?=",n+=3,s+=i()+")";break;case"!":o=n,n+=3,i(),s+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,i(),s+=r.substr(o,n-o);break;default:a(r.indexOf(">",n)-n+1),s+=i()+"|$)";break}break}else a(1),s+=i()+"|$)";break;case")":return++n,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function Rm(t){return t.rules.find(e=>Ar(e)&&e.entry)}function $S(t){return t.rules.filter(e=>pi(e)&&e.hidden)}function Pm(t,e){let r=new Set,n=Rm(t);if(!n)return new Set(t.rules);let i=[n].concat($S(t));for(let o of i)MS(o,r,e);let s=new Set;for(let o of t.rules)(r.has(o.name)||pi(o)&&o.hidden)&&s.add(o);return s}function MS(t,e,r){e.add(t.name),os(t).forEach(n=>{if(Ri(n)||r&&Yg(n)){let i=n.rule.ref;i&&!e.has(i.name)&&MS(i,e,r)}})}function sz(t){let e=new Set;return os(t).forEach(r=>{is(r)&&(Ar(r.type.ref)&&e.add(r.type.ref),bm(r.type.ref)&&Ar(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}function Nm(t){if(t.terminal)return t.terminal;if(t.type.ref){let e=r0(t.type.ref);return e==null?void 0:e.terminal}}function i6(t){return t.hidden&&!Am(Za(t))}function Om(t,e){return!t||!e?[]:s6(t,e,t.astNode,!0)}function pu(t,e,r){if(!t||!e)return;let n=s6(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function s6(t,e,r,n){if(!n){let i=ss(t.grammarSource,Yn);if(i&&i.feature===e)return[t]}return to(t)&&t.astNode===r?t.content.flatMap(i=>s6(i,e,r,!1)):[]}function o6(t,e){return t?a6(t,e,t==null?void 0:t.astNode):[]}function Im(t,e,r){if(!t)return;let n=a6(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function a6(t,e,r){if(t.astNode!==r)return[];if(Sn(t.grammarSource)&&t.grammarSource.value===e)return[t];let n=nu(t).iterator(),i,s=[];do if(i=n.next(),!i.done){let o=i.value;o.astNode===r?Sn(o.grammarSource)&&o.grammarSource.value===e&&s.push(o):n.prune()}while(!i.done);return s}function c6(t){var e;let r=t.astNode;for(;r===((e=t.container)===null||e===void 0?void 0:e.astNode);){let n=ss(t.grammarSource,Yn);if(n)return n;t=t.container}}function r0(t){let e=t;return bm(e)&&(ro(e.$container)?e=e.$container.$container:Ar(e.$container)?e=e.$container:Eo(e.$container)),FS(t,e,new Map)}function FS(t,e,r){var n;function i(s,o){let a;return ss(s,Yn)||(a=FS(o,o,r)),r.set(t,a),a}if(r.has(t))return r.get(t);r.set(t,void 0);for(let s of os(e)){if(Yn(s)&&s.feature.toLowerCase()==="name")return r.set(t,s),s;if(Ri(s)&&Ar(s.rule.ref))return i(s,s.rule.ref);if(Qg(s)&&(!((n=s.typeRef)===null||n===void 0)&&n.ref))return i(s,s.typeRef.ref)}}function VS(t){let e=t.$container;if(ks(e)){let r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){let s=r[i];if(ro(s))return s;{let o=os(r[i]).find(ro);if(o)return o}}}if(au(e))return VS(e)}function mu(t,e){return t==="?"||t==="*"||ks(e)&&!!e.guardCondition}function u6(t){return t==="*"||t==="+"}function oz(t){return t==="+="}function Dm(t){return jS(t,new Set)}function jS(t,e){if(e.has(t))return!0;e.add(t);for(let r of os(t))if(Ri(r)){if(!r.rule.ref||Ar(r.rule.ref)&&!jS(r.rule.ref,e))return!1}else{if(Yn(r))return!1;if(ro(r))return!1}return!!t.definition}function az(t){return n6(t.type,new Set)}function n6(t,e){if(e.has(t))return!0;if(e.add(t),N8(t))return!1;if(M8(t))return!1;if(V8(t))return t.types.every(r=>n6(r,e));if(Qg(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){let r=t.typeRef.ref;return Sm(r)?n6(r.type,e):!1}else return!1}else return!1}function Co(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(Ar(e))return e.name;if(Jg(e)||Sm(e))return e.name}}}function hu(t){var e;if(Ar(t))return Dm(t)?t.name:(e=Co(t))!==null&&e!==void 0?e:t.name;if(Jg(t)||Sm(t)||F8(t))return t.name;if(ro(t)){let r=US(t);if(r)return r}else if(bm(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function US(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return hu(t.type.ref)}function cz(t){var e,r,n;return pi(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":Dm(t)?t.name:(n=Co(t))!==null&&n!==void 0?n:t.name}function l6(t){var e,r,n;return pi(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":(n=Co(t))!==null&&n!==void 0?n:t.name}function Za(t){let e={s:!1,i:!1,u:!1},r=Ff(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}var f6=/[\s\S]/.source;function Ff(t,e){if(H8(t))return uz(t);if(z8(t))return lz(t);if(j8(t))return pz(t);if(Yg(t)){let r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return fa(Ff(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(q8(t))return dz(t);if(W8(t))return fz(t);if(B8(t)){let r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),fa(n,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(K8(t))return fa(f6,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}`)}}}function uz(t){return fa(t.elements.map(e=>Ff(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function lz(t){return fa(t.elements.map(e=>Ff(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function fz(t){return fa(`${f6}*?${Ff(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function dz(t){return fa(`(?!${Ff(t.terminal)})${f6}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function pz(t){return t.right?fa(`[${r6(t.left)}-${r6(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):fa(r6(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function r6(t){return Ya(t.value)}function fa(t,e){var r;return(e.wrap!==!1||e.lookahead)&&(t=`(${(r=e.lookahead)!==null&&r!==void 0?r:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function d6(t){let e=[],r=t.Grammar;for(let n of r.rules)pi(n)&&i6(n)&&e6(Za(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:Wg}}var mz=typeof global=="object"&&global&&global.Object===Object&&global,i0=mz;var hz=typeof self=="object"&&self&&self.Object===Object&&self,gz=i0||hz||Function("return this")(),pn=gz;var yz=pn.Symbol,An=yz;var qS=Object.prototype,vz=qS.hasOwnProperty,xz=qS.toString,Lm=An?An.toStringTag:void 0;function _z(t){var e=vz.call(t,Lm),r=t[Lm];try{t[Lm]=void 0;var n=!0}catch(s){}var i=xz.call(t);return n&&(e?t[Lm]=r:delete t[Lm]),i}var BS=_z;var bz=Object.prototype,Sz=bz.toString;function Ez(t){return Sz.call(t)}var HS=Ez;var Tz="[object Null]",Cz="[object Undefined]",zS=An?An.toStringTag:void 0;function kz(t){return t==null?t===void 0?Cz:Tz:zS&&zS in Object(t)?BS(t):HS(t)}var mi=kz;function wz(t){return t!=null&&typeof t=="object"}var rn=wz;var Az="[object Symbol]";function Rz(t){return typeof t=="symbol"||rn(t)&&mi(t)==Az}var ko=Rz;function Pz(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var wo=Pz;var Nz=Array.isArray,Be=Nz;var Oz=1/0,WS=An?An.prototype:void 0,KS=WS?WS.toString:void 0;function GS(t){if(typeof t=="string")return t;if(Be(t))return wo(t,GS)+"";if(ko(t))return KS?KS.call(t):"";var e=t+"";return e=="0"&&1/t==-Oz?"-0":e}var JS=GS;var Iz=/\s/;function Dz(t){for(var e=t.length;e--&&Iz.test(t.charAt(e)););return e}var QS=Dz;var Lz=/^\s+/;function $z(t){return t&&t.slice(0,QS(t)+1).replace(Lz,"")}var YS=$z;function Mz(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Vr=Mz;var ZS=NaN,Fz=/^[-+]0x[0-9a-f]+$/i,Vz=/^0b[01]+$/i,jz=/^0o[0-7]+$/i,Uz=parseInt;function qz(t){if(typeof t=="number")return t;if(ko(t))return ZS;if(Vr(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Vr(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=YS(t);var r=Vz.test(t);return r||jz.test(t)?Uz(t.slice(2),r?2:8):Fz.test(t)?ZS:+t}var XS=qz;var eE=1/0,Bz=17976931348623157e292;function Hz(t){if(!t)return t===0?t:0;if(t=XS(t),t===eE||t===-eE){var e=t<0?-1:1;return e*Bz}return t===t?t:0}var tE=Hz;function zz(t){var e=tE(t),r=e%1;return e===e?r?e-r:e:0}var Ao=zz;function Wz(t){return t}var Ni=Wz;var Kz="[object AsyncFunction]",Gz="[object Function]",Jz="[object GeneratorFunction]",Qz="[object Proxy]";function Yz(t){if(!Vr(t))return!1;var e=mi(t);return e==Gz||e==Jz||e==Kz||e==Qz}var hi=Yz;var Zz=pn["__core-js_shared__"],s0=Zz;var rE=function(){var t=/[^.]+$/.exec(s0&&s0.keys&&s0.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Xz(t){return!!rE&&rE in t}var nE=Xz;var eW=Function.prototype,tW=eW.toString;function rW(t){if(t!=null){try{return tW.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var da=rW;var nW=/[\\^$.*+?()[\]{}|]/g,iW=/^\[object .+?Constructor\]$/,sW=Function.prototype,oW=Object.prototype,aW=sW.toString,cW=oW.hasOwnProperty,uW=RegExp("^"+aW.call(cW).replace(nW,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lW(t){if(!Vr(t)||nE(t))return!1;var e=hi(t)?uW:iW;return e.test(da(t))}var iE=lW;function fW(t,e){return t==null?void 0:t[e]}var sE=fW;function dW(t,e){var r=sE(t,e);return iE(r)?r:void 0}var Oi=dW;var pW=Oi(pn,"WeakMap"),o0=pW;var oE=Object.create,mW=function(){function t(){}return function(e){if(!Vr(e))return{};if(oE)return oE(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),aE=mW;function hW(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var cE=hW;function gW(){}var jr=gW;function yW(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var uE=yW;var vW=800,xW=16,_W=Date.now;function bW(t){var e=0,r=0;return function(){var n=_W(),i=xW-(n-r);if(r=n,i>0){if(++e>=vW)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var lE=bW;function SW(t){return function(){return t}}var fE=SW;var EW=function(){try{var t=Oi(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),Vf=EW;var TW=Vf?function(t,e){return Vf(t,"toString",{configurable:!0,enumerable:!1,value:fE(e),writable:!0})}:Ni,dE=TW;var CW=lE(dE),pE=CW;function kW(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var a0=kW;function wW(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s<i;)if(e(t[s],s,t))return s;return-1}var c0=wW;function AW(t){return t!==t}var mE=AW;function RW(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var hE=RW;function PW(t,e,r){return e===e?hE(t,e,r):c0(t,mE,r)}var jf=PW;function NW(t,e){var r=t==null?0:t.length;return!!r&&jf(t,e,0)>-1}var u0=NW;var OW=9007199254740991,IW=/^(?:0|[1-9]\d*)$/;function DW(t,e){var r=typeof t;return e=e==null?OW:e,!!e&&(r=="number"||r!="symbol"&&IW.test(t))&&t>-1&&t%1==0&&t<e}var Xa=DW;function LW(t,e,r){e=="__proto__"&&Vf?Vf(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Uf=LW;function $W(t,e){return t===e||t!==t&&e!==e}var Ro=$W;var MW=Object.prototype,FW=MW.hasOwnProperty;function VW(t,e,r){var n=t[e];(!(FW.call(t,e)&&Ro(n,r))||r===void 0&&!(e in t))&&Uf(t,e,r)}var ec=VW;function jW(t,e,r,n){var i=!r;r||(r={});for(var s=-1,o=e.length;++s<o;){var a=e[s],c=n?n(r[a],t[a],a,r,t):void 0;c===void 0&&(c=t[a]),i?Uf(r,a,c):ec(r,a,c)}return r}var Po=jW;var gE=Math.max;function UW(t,e,r){return e=gE(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,s=gE(n.length-e,0),o=Array(s);++i<s;)o[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(o),cE(t,this,a)}}var yE=UW;function qW(t,e){return pE(yE(t,e,Ni),t+"")}var qf=qW;var BW=9007199254740991;function HW(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=BW}var Bf=HW;function zW(t){return t!=null&&Bf(t.length)&&!hi(t)}var mn=zW;function WW(t,e,r){if(!Vr(r))return!1;var n=typeof e;return(n=="number"?mn(r)&&Xa(e,r.length):n=="string"&&e in r)?Ro(r[e],t):!1}var tc=WW;function KW(t){return qf(function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,o&&tc(r[0],r[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,s)}return e})}var vE=KW;var GW=Object.prototype;function JW(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||GW;return t===r}var No=JW;function QW(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var xE=QW;var YW="[object Arguments]";function ZW(t){return rn(t)&&mi(t)==YW}var p6=ZW;var _E=Object.prototype,XW=_E.hasOwnProperty,eK=_E.propertyIsEnumerable,tK=p6(function(){return arguments}())?p6:function(t){return rn(t)&&XW.call(t,"callee")&&!eK.call(t,"callee")},rc=tK;function rK(){return!1}var bE=rK;var TE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,SE=TE&&typeof module=="object"&&module&&!module.nodeType&&module,nK=SE&&SE.exports===TE,EE=nK?pn.Buffer:void 0,iK=EE?EE.isBuffer:void 0,sK=iK||bE,pa=sK;var oK="[object Arguments]",aK="[object Array]",cK="[object Boolean]",uK="[object Date]",lK="[object Error]",fK="[object Function]",dK="[object Map]",pK="[object Number]",mK="[object Object]",hK="[object RegExp]",gK="[object Set]",yK="[object String]",vK="[object WeakMap]",xK="[object ArrayBuffer]",_K="[object DataView]",bK="[object Float32Array]",SK="[object Float64Array]",EK="[object Int8Array]",TK="[object Int16Array]",CK="[object Int32Array]",kK="[object Uint8Array]",wK="[object Uint8ClampedArray]",AK="[object Uint16Array]",RK="[object Uint32Array]",Sr={};Sr[bK]=Sr[SK]=Sr[EK]=Sr[TK]=Sr[CK]=Sr[kK]=Sr[wK]=Sr[AK]=Sr[RK]=!0;Sr[oK]=Sr[aK]=Sr[xK]=Sr[cK]=Sr[_K]=Sr[uK]=Sr[lK]=Sr[fK]=Sr[dK]=Sr[pK]=Sr[mK]=Sr[hK]=Sr[gK]=Sr[yK]=Sr[vK]=!1;function PK(t){return rn(t)&&Bf(t.length)&&!!Sr[mi(t)]}var CE=PK;function NK(t){return function(e){return t(e)}}var Oo=NK;var kE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$m=kE&&typeof module=="object"&&module&&!module.nodeType&&module,OK=$m&&$m.exports===kE,m6=OK&&i0.process,IK=function(){try{var t=$m&&$m.require&&$m.require("util").types;return t||m6&&m6.binding&&m6.binding("util")}catch(e){}}(),ws=IK;var wE=ws&&ws.isTypedArray,DK=wE?Oo(wE):CE,Hf=DK;var LK=Object.prototype,$K=LK.hasOwnProperty;function MK(t,e){var r=Be(t),n=!r&&rc(t),i=!r&&!n&&pa(t),s=!r&&!n&&!i&&Hf(t),o=r||n||i||s,a=o?xE(t.length,String):[],c=a.length;for(var u in t)(e||$K.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Xa(u,c)))&&a.push(u);return a}var l0=MK;function FK(t,e){return function(r){return t(e(r))}}var f0=FK;var VK=f0(Object.keys,Object),AE=VK;var jK=Object.prototype,UK=jK.hasOwnProperty;function qK(t){if(!No(t))return AE(t);var e=[];for(var r in Object(t))UK.call(t,r)&&r!="constructor"&&e.push(r);return e}var d0=qK;function BK(t){return mn(t)?l0(t):d0(t)}var fr=BK;var HK=Object.prototype,zK=HK.hasOwnProperty,WK=vE(function(t,e){if(No(e)||mn(e)){Po(e,fr(e),t);return}for(var r in e)zK.call(e,r)&&ec(t,r,e[r])}),jn=WK;function KK(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var RE=KK;var GK=Object.prototype,JK=GK.hasOwnProperty;function QK(t){if(!Vr(t))return RE(t);var e=No(t),r=[];for(var n in t)n=="constructor"&&(e||!JK.call(t,n))||r.push(n);return r}var PE=QK;function YK(t){return mn(t)?l0(t,!0):PE(t)}var nc=YK;var ZK=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,XK=/^\w*$/;function eG(t,e){if(Be(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||ko(t)?!0:XK.test(t)||!ZK.test(t)||e!=null&&t in Object(e)}var zf=eG;var tG=Oi(Object,"create"),ma=tG;function rG(){this.__data__=ma?ma(null):{},this.size=0}var NE=rG;function nG(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var OE=nG;var iG="__lodash_hash_undefined__",sG=Object.prototype,oG=sG.hasOwnProperty;function aG(t){var e=this.__data__;if(ma){var r=e[t];return r===iG?void 0:r}return oG.call(e,t)?e[t]:void 0}var IE=aG;var cG=Object.prototype,uG=cG.hasOwnProperty;function lG(t){var e=this.__data__;return ma?e[t]!==void 0:uG.call(e,t)}var DE=lG;var fG="__lodash_hash_undefined__";function dG(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ma&&e===void 0?fG:e,this}var LE=dG;function Wf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Wf.prototype.clear=NE;Wf.prototype.delete=OE;Wf.prototype.get=IE;Wf.prototype.has=DE;Wf.prototype.set=LE;var h6=Wf;function pG(){this.__data__=[],this.size=0}var $E=pG;function mG(t,e){for(var r=t.length;r--;)if(Ro(t[r][0],e))return r;return-1}var ic=mG;var hG=Array.prototype,gG=hG.splice;function yG(t){var e=this.__data__,r=ic(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():gG.call(e,r,1),--this.size,!0}var ME=yG;function vG(t){var e=this.__data__,r=ic(e,t);return r<0?void 0:e[r][1]}var FE=vG;function xG(t){return ic(this.__data__,t)>-1}var VE=xG;function _G(t,e){var r=this.__data__,n=ic(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var jE=_G;function Kf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Kf.prototype.clear=$E;Kf.prototype.delete=ME;Kf.prototype.get=FE;Kf.prototype.has=VE;Kf.prototype.set=jE;var sc=Kf;var bG=Oi(pn,"Map"),oc=bG;function SG(){this.size=0,this.__data__={hash:new h6,map:new(oc||sc),string:new h6}}var UE=SG;function EG(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var qE=EG;function TG(t,e){var r=t.__data__;return qE(e)?r[typeof e=="string"?"string":"hash"]:r.map}var ac=TG;function CG(t){var e=ac(this,t).delete(t);return this.size-=e?1:0,e}var BE=CG;function kG(t){return ac(this,t).get(t)}var HE=kG;function wG(t){return ac(this,t).has(t)}var zE=wG;function AG(t,e){var r=ac(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var WE=AG;function Gf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Gf.prototype.clear=UE;Gf.prototype.delete=BE;Gf.prototype.get=HE;Gf.prototype.has=zE;Gf.prototype.set=WE;var gu=Gf;var RG="Expected a function";function g6(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(RG);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=t.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(g6.Cache||gu),r}g6.Cache=gu;var KE=g6;var PG=500;function NG(t){var e=KE(t,function(n){return r.size===PG&&r.clear(),n}),r=e.cache;return e}var GE=NG;var OG=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,IG=/\\(\\)?/g,DG=GE(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(OG,function(r,n,i,s){e.push(i?s.replace(IG,"$1"):n||r)}),e}),JE=DG;function LG(t){return t==null?"":JS(t)}var QE=LG;function $G(t,e){return Be(t)?t:zf(t,e)?[t]:JE(QE(t))}var cc=$G;var MG=1/0;function FG(t){if(typeof t=="string"||ko(t))return t;var e=t+"";return e=="0"&&1/t==-MG?"-0":e}var Io=FG;function VG(t,e){e=cc(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Io(e[r++])];return r&&r==n?t:void 0}var Jf=VG;function jG(t,e,r){var n=t==null?void 0:Jf(t,e);return n===void 0?r:n}var YE=jG;function UG(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Qf=UG;var ZE=An?An.isConcatSpreadable:void 0;function qG(t){return Be(t)||rc(t)||!!(ZE&&t&&t[ZE])}var XE=qG;function eT(t,e,r,n,i){var s=-1,o=t.length;for(r||(r=XE),i||(i=[]);++s<o;){var a=t[s];e>0&&r(a)?e>1?eT(a,e-1,r,n,i):Qf(i,a):n||(i[i.length]=a)}return i}var Yf=eT;function BG(t){var e=t==null?0:t.length;return e?Yf(t,1):[]}var nn=BG;var HG=f0(Object.getPrototypeOf,Object),p0=HG;function zG(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(i);++n<i;)s[n]=t[n+e];return s}var m0=zG;function WG(t,e,r,n){var i=-1,s=t==null?0:t.length;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}var tT=WG;function KG(){this.__data__=new sc,this.size=0}var rT=KG;function GG(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var nT=GG;function JG(t){return this.__data__.get(t)}var iT=JG;function QG(t){return this.__data__.has(t)}var sT=QG;var YG=200;function ZG(t,e){var r=this.__data__;if(r instanceof sc){var n=r.__data__;if(!oc||n.length<YG-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new gu(n)}return r.set(t,e),this.size=r.size,this}var oT=ZG;function Zf(t){var e=this.__data__=new sc(t);this.size=e.size}Zf.prototype.clear=rT;Zf.prototype.delete=nT;Zf.prototype.get=iT;Zf.prototype.has=sT;Zf.prototype.set=oT;var uc=Zf;function XG(t,e){return t&&Po(e,fr(e),t)}var aT=XG;function eJ(t,e){return t&&Po(e,nc(e),t)}var cT=eJ;var dT=typeof exports=="object"&&exports&&!exports.nodeType&&exports,uT=dT&&typeof module=="object"&&module&&!module.nodeType&&module,tJ=uT&&uT.exports===dT,lT=tJ?pn.Buffer:void 0,fT=lT?lT.allocUnsafe:void 0;function rJ(t,e){if(e)return t.slice();var r=t.length,n=fT?fT(r):new t.constructor(r);return t.copy(n),n}var pT=rJ;function nJ(t,e){for(var r=-1,n=t==null?0:t.length,i=0,s=[];++r<n;){var o=t[r];e(o,r,t)&&(s[i++]=o)}return s}var Xf=nJ;function iJ(){return[]}var h0=iJ;var sJ=Object.prototype,oJ=sJ.propertyIsEnumerable,mT=Object.getOwnPropertySymbols,aJ=mT?function(t){return t==null?[]:(t=Object(t),Xf(mT(t),function(e){return oJ.call(t,e)}))}:h0,ed=aJ;function cJ(t,e){return Po(t,ed(t),e)}var hT=cJ;var uJ=Object.getOwnPropertySymbols,lJ=uJ?function(t){for(var e=[];t;)Qf(e,ed(t)),t=p0(t);return e}:h0,g0=lJ;function fJ(t,e){return Po(t,g0(t),e)}var gT=fJ;function dJ(t,e,r){var n=e(t);return Be(t)?n:Qf(n,r(t))}var y0=dJ;function pJ(t){return y0(t,fr,ed)}var Mm=pJ;function mJ(t){return y0(t,nc,g0)}var v0=mJ;var hJ=Oi(pn,"DataView"),x0=hJ;var gJ=Oi(pn,"Promise"),_0=gJ;var yJ=Oi(pn,"Set"),lc=yJ;var yT="[object Map]",vJ="[object Object]",vT="[object Promise]",xT="[object Set]",_T="[object WeakMap]",bT="[object DataView]",xJ=da(x0),_J=da(oc),bJ=da(_0),SJ=da(lc),EJ=da(o0),yu=mi;(x0&&yu(new x0(new ArrayBuffer(1)))!=bT||oc&&yu(new oc)!=yT||_0&&yu(_0.resolve())!=vT||lc&&yu(new lc)!=xT||o0&&yu(new o0)!=_T)&&(yu=function(t){var e=mi(t),r=e==vJ?t.constructor:void 0,n=r?da(r):"";if(n)switch(n){case xJ:return bT;case _J:return yT;case bJ:return vT;case SJ:return xT;case EJ:return _T}return e});var no=yu;var TJ=Object.prototype,CJ=TJ.hasOwnProperty;function kJ(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&CJ.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var ST=kJ;var wJ=pn.Uint8Array,td=wJ;function AJ(t){var e=new t.constructor(t.byteLength);return new td(e).set(new td(t)),e}var rd=AJ;function RJ(t,e){var r=e?rd(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var ET=RJ;var PJ=/\w*$/;function NJ(t){var e=new t.constructor(t.source,PJ.exec(t));return e.lastIndex=t.lastIndex,e}var TT=NJ;var CT=An?An.prototype:void 0,kT=CT?CT.valueOf:void 0;function OJ(t){return kT?Object(kT.call(t)):{}}var wT=OJ;function IJ(t,e){var r=e?rd(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var AT=IJ;var DJ="[object Boolean]",LJ="[object Date]",$J="[object Map]",MJ="[object Number]",FJ="[object RegExp]",VJ="[object Set]",jJ="[object String]",UJ="[object Symbol]",qJ="[object ArrayBuffer]",BJ="[object DataView]",HJ="[object Float32Array]",zJ="[object Float64Array]",WJ="[object Int8Array]",KJ="[object Int16Array]",GJ="[object Int32Array]",JJ="[object Uint8Array]",QJ="[object Uint8ClampedArray]",YJ="[object Uint16Array]",ZJ="[object Uint32Array]";function XJ(t,e,r){var n=t.constructor;switch(e){case qJ:return rd(t);case DJ:case LJ:return new n(+t);case BJ:return ET(t,r);case HJ:case zJ:case WJ:case KJ:case GJ:case JJ:case QJ:case YJ:case ZJ:return AT(t,r);case $J:return new n;case MJ:case jJ:return new n(t);case FJ:return TT(t);case VJ:return new n;case UJ:return wT(t)}}var RT=XJ;function eQ(t){return typeof t.constructor=="function"&&!No(t)?aE(p0(t)):{}}var PT=eQ;var tQ="[object Map]";function rQ(t){return rn(t)&&no(t)==tQ}var NT=rQ;var OT=ws&&ws.isMap,nQ=OT?Oo(OT):NT,IT=nQ;var iQ="[object Set]";function sQ(t){return rn(t)&&no(t)==iQ}var DT=sQ;var LT=ws&&ws.isSet,oQ=LT?Oo(LT):DT,$T=oQ;var aQ=1,cQ=2,uQ=4,MT="[object Arguments]",lQ="[object Array]",fQ="[object Boolean]",dQ="[object Date]",pQ="[object Error]",FT="[object Function]",mQ="[object GeneratorFunction]",hQ="[object Map]",gQ="[object Number]",VT="[object Object]",yQ="[object RegExp]",vQ="[object Set]",xQ="[object String]",_Q="[object Symbol]",bQ="[object WeakMap]",SQ="[object ArrayBuffer]",EQ="[object DataView]",TQ="[object Float32Array]",CQ="[object Float64Array]",kQ="[object Int8Array]",wQ="[object Int16Array]",AQ="[object Int32Array]",RQ="[object Uint8Array]",PQ="[object Uint8ClampedArray]",NQ="[object Uint16Array]",OQ="[object Uint32Array]",dr={};dr[MT]=dr[lQ]=dr[SQ]=dr[EQ]=dr[fQ]=dr[dQ]=dr[TQ]=dr[CQ]=dr[kQ]=dr[wQ]=dr[AQ]=dr[hQ]=dr[gQ]=dr[VT]=dr[yQ]=dr[vQ]=dr[xQ]=dr[_Q]=dr[RQ]=dr[PQ]=dr[NQ]=dr[OQ]=!0;dr[pQ]=dr[FT]=dr[bQ]=!1;function b0(t,e,r,n,i,s){var o,a=e&aQ,c=e&cQ,u=e&uQ;if(r&&(o=i?r(t,n,i,s):r(t)),o!==void 0)return o;if(!Vr(t))return t;var f=Be(t);if(f){if(o=ST(t),!a)return uE(t,o)}else{var l=no(t),p=l==FT||l==mQ;if(pa(t))return pT(t,a);if(l==VT||l==MT||p&&!i){if(o=c||p?{}:PT(t),!a)return c?gT(t,cT(o,t)):hT(t,aT(o,t))}else{if(!dr[l])return i?t:{};o=RT(t,l,a)}}s||(s=new uc);var d=s.get(t);if(d)return d;s.set(t,o),$T(t)?t.forEach(function(v){o.add(b0(v,e,r,v,t,s))}):IT(t)&&t.forEach(function(v,b){o.set(b,b0(v,e,r,b,t,s))});var h=u?c?v0:Mm:c?nc:fr,g=f?void 0:h(t);return a0(g||t,function(v,b){g&&(b=v,v=t[b]),ec(o,b,b0(v,e,r,b,t,s))}),o}var jT=b0;var IQ=4;function DQ(t){return jT(t,IQ)}var pr=DQ;function LQ(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var s=t[e];s&&(i[n++]=s)}return i}var Do=LQ;var $Q="__lodash_hash_undefined__";function MQ(t){return this.__data__.set(t,$Q),this}var UT=MQ;function FQ(t){return this.__data__.has(t)}var qT=FQ;function S0(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new gu;++e<r;)this.add(t[e])}S0.prototype.add=S0.prototype.push=UT;S0.prototype.has=qT;var nd=S0;function VQ(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var E0=VQ;function jQ(t,e){return t.has(e)}var id=jQ;var UQ=1,qQ=2;function BQ(t,e,r,n,i,s){var o=r&UQ,a=t.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var u=s.get(t),f=s.get(e);if(u&&f)return u==e&&f==t;var l=-1,p=!0,d=r&qQ?new nd:void 0;for(s.set(t,e),s.set(e,t);++l<a;){var h=t[l],g=e[l];if(n)var v=o?n(g,h,l,e,t,s):n(h,g,l,t,e,s);if(v!==void 0){if(v)continue;p=!1;break}if(d){if(!E0(e,function(b,_){if(!id(d,_)&&(h===b||i(h,b,r,n,s)))return d.push(_)})){p=!1;break}}else if(!(h===g||i(h,g,r,n,s))){p=!1;break}}return s.delete(t),s.delete(e),p}var T0=BQ;function HQ(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var BT=HQ;function zQ(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var sd=zQ;var WQ=1,KQ=2,GQ="[object Boolean]",JQ="[object Date]",QQ="[object Error]",YQ="[object Map]",ZQ="[object Number]",XQ="[object RegExp]",eY="[object Set]",tY="[object String]",rY="[object Symbol]",nY="[object ArrayBuffer]",iY="[object DataView]",HT=An?An.prototype:void 0,y6=HT?HT.valueOf:void 0;function sY(t,e,r,n,i,s,o){switch(r){case iY:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case nY:return!(t.byteLength!=e.byteLength||!s(new td(t),new td(e)));case GQ:case JQ:case ZQ:return Ro(+t,+e);case QQ:return t.name==e.name&&t.message==e.message;case XQ:case tY:return t==e+"";case YQ:var a=BT;case eY:var c=n&WQ;if(a||(a=sd),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=KQ,o.set(t,e);var f=T0(a(t),a(e),n,i,s,o);return o.delete(t),f;case rY:if(y6)return y6.call(t)==y6.call(e)}return!1}var zT=sY;var oY=1,aY=Object.prototype,cY=aY.hasOwnProperty;function uY(t,e,r,n,i,s){var o=r&oY,a=Mm(t),c=a.length,u=Mm(e),f=u.length;if(c!=f&&!o)return!1;for(var l=c;l--;){var p=a[l];if(!(o?p in e:cY.call(e,p)))return!1}var d=s.get(t),h=s.get(e);if(d&&h)return d==e&&h==t;var g=!0;s.set(t,e),s.set(e,t);for(var v=o;++l<c;){p=a[l];var b=t[p],_=e[p];if(n)var x=o?n(_,b,p,e,t,s):n(b,_,p,t,e,s);if(!(x===void 0?b===_||i(b,_,r,n,s):x)){g=!1;break}v||(v=p=="constructor")}if(g&&!v){var T=t.constructor,R=e.constructor;T!=R&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof R=="function"&&R instanceof R)&&(g=!1)}return s.delete(t),s.delete(e),g}var WT=uY;var lY=1,KT="[object Arguments]",GT="[object Array]",C0="[object Object]",fY=Object.prototype,JT=fY.hasOwnProperty;function dY(t,e,r,n,i,s){var o=Be(t),a=Be(e),c=o?GT:no(t),u=a?GT:no(e);c=c==KT?C0:c,u=u==KT?C0:u;var f=c==C0,l=u==C0,p=c==u;if(p&&pa(t)){if(!pa(e))return!1;o=!0,f=!1}if(p&&!f)return s||(s=new uc),o||Hf(t)?T0(t,e,r,n,i,s):zT(t,e,c,r,n,i,s);if(!(r&lY)){var d=f&&JT.call(t,"__wrapped__"),h=l&&JT.call(e,"__wrapped__");if(d||h){var g=d?t.value():t,v=h?e.value():e;return s||(s=new uc),i(g,v,r,n,s)}}return p?(s||(s=new uc),WT(t,e,r,n,i,s)):!1}var QT=dY;function YT(t,e,r,n,i){return t===e?!0:t==null||e==null||!rn(t)&&!rn(e)?t!==t&&e!==e:QT(t,e,r,n,YT,i)}var k0=YT;var pY=1,mY=2;function hY(t,e,r,n){var i=r.length,s=i,o=!n;if(t==null)return!s;for(t=Object(t);i--;){var a=r[i];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=r[i];var c=a[0],u=t[c],f=a[1];if(o&&a[2]){if(u===void 0&&!(c in t))return!1}else{var l=new uc;if(n)var p=n(u,f,c,t,e,l);if(!(p===void 0?k0(f,u,pY|mY,n,l):p))return!1}}return!0}var ZT=hY;function gY(t){return t===t&&!Vr(t)}var w0=gY;function yY(t){for(var e=fr(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,w0(i)]}return e}var XT=yY;function vY(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var A0=vY;function xY(t){var e=XT(t);return e.length==1&&e[0][2]?A0(e[0][0],e[0][1]):function(r){return r===t||ZT(r,t,e)}}var eC=xY;function _Y(t,e){return t!=null&&e in Object(t)}var tC=_Y;function bY(t,e,r){e=cc(e,t);for(var n=-1,i=e.length,s=!1;++n<i;){var o=Io(e[n]);if(!(s=t!=null&&r(t,o)))break;t=t[o]}return s||++n!=i?s:(i=t==null?0:t.length,!!i&&Bf(i)&&Xa(o,i)&&(Be(t)||rc(t)))}var R0=bY;function SY(t,e){return t!=null&&R0(t,e,tC)}var rC=SY;var EY=1,TY=2;function CY(t,e){return zf(t)&&w0(e)?A0(Io(t),e):function(r){var n=YE(r,t);return n===void 0&&n===e?rC(r,t):k0(e,n,EY|TY)}}var nC=CY;function kY(t){return function(e){return e==null?void 0:e[t]}}var iC=kY;function wY(t){return function(e){return Jf(e,t)}}var sC=wY;function AY(t){return zf(t)?iC(Io(t)):sC(t)}var oC=AY;function RY(t){return typeof t=="function"?t:t==null?Ni:typeof t=="object"?Be(t)?nC(t[0],t[1]):eC(t):oC(t)}var Hr=RY;function PY(t,e,r,n){for(var i=-1,s=t==null?0:t.length;++i<s;){var o=t[i];e(n,o,r(o),t)}return n}var aC=PY;function NY(t){return function(e,r,n){for(var i=-1,s=Object(e),o=n(e),a=o.length;a--;){var c=o[t?a:++i];if(r(s[c],c,s)===!1)break}return e}}var cC=NY;var OY=cC(),uC=OY;function IY(t,e){return t&&uC(t,e,fr)}var lC=IY;function DY(t,e){return function(r,n){if(r==null)return r;if(!mn(r))return t(r,n);for(var i=r.length,s=e?i:-1,o=Object(r);(e?s--:++s<i)&&n(o[s],s,o)!==!1;);return r}}var fC=DY;var LY=fC(lC),Ii=LY;function $Y(t,e,r,n){return Ii(t,function(i,s,o){e(n,i,r(i),o)}),n}var dC=$Y;function MY(t,e){return function(r,n){var i=Be(r)?aC:dC,s=e?e():{};return i(r,t,Hr(n,2),s)}}var pC=MY;var mC=Object.prototype,FY=mC.hasOwnProperty,VY=qf(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&tc(e[0],e[1],i)&&(n=1);++r<n;)for(var s=e[r],o=nc(s),a=-1,c=o.length;++a<c;){var u=o[a],f=t[u];(f===void 0||Ro(f,mC[u])&&!FY.call(t,u))&&(t[u]=s[u])}return t}),od=VY;function jY(t){return rn(t)&&mn(t)}var v6=jY;function UY(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var P0=UY;var qY=200;function BY(t,e,r,n){var i=-1,s=u0,o=!0,a=t.length,c=[],u=e.length;if(!a)return c;r&&(e=wo(e,Oo(r))),n?(s=P0,o=!1):e.length>=qY&&(s=id,o=!1,e=new nd(e));e:for(;++i<a;){var f=t[i],l=r==null?f:r(f);if(f=n||f!==0?f:0,o&&l===l){for(var p=u;p--;)if(e[p]===l)continue e;c.push(f)}else s(e,l,n)||c.push(f)}return c}var hC=BY;var HY=qf(function(t,e){return v6(t)?hC(t,Yf(e,1,v6,!0)):[]}),fc=HY;function zY(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var Lo=zY;function WY(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Ao(e),m0(t,e<0?0:e,n)):[]}var sn=WY;function KY(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Ao(e),e=n-e,m0(t,0,e<0?0:e)):[]}var ha=KY;function GY(t){return typeof t=="function"?t:Ni}var gC=GY;function JY(t,e){var r=Be(t)?a0:Ii;return r(t,gC(e))}var Pe=JY;function QY(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var yC=QY;function YY(t,e){var r=!0;return Ii(t,function(n,i,s){return r=!!e(n,i,s),r}),r}var vC=YY;function ZY(t,e,r){var n=Be(t)?yC:vC;return r&&tc(t,e,r)&&(e=void 0),n(t,Hr(e,3))}var Zn=ZY;function XY(t,e){var r=[];return Ii(t,function(n,i,s){e(n,i,s)&&r.push(n)}),r}var N0=XY;function eZ(t,e){var r=Be(t)?Xf:N0;return r(t,Hr(e,3))}var Rn=eZ;function tZ(t){return function(e,r,n){var i=Object(e);if(!mn(e)){var s=Hr(r,3);e=fr(e),r=function(a){return s(i[a],a,i)}}var o=t(e,r,n);return o>-1?i[s?e[o]:o]:void 0}}var xC=tZ;var rZ=Math.max;function nZ(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Ao(r);return i<0&&(i=rZ(n+i,0)),c0(t,Hr(e,3),i)}var _C=nZ;var iZ=xC(_C),$o=iZ;function sZ(t){return t&&t.length?t[0]:void 0}var Pn=sZ;function oZ(t,e){var r=-1,n=mn(t)?Array(t.length):[];return Ii(t,function(i,s,o){n[++r]=e(i,s,o)}),n}var bC=oZ;function aZ(t,e){var r=Be(t)?wo:bC;return r(t,Hr(e,3))}var ge=aZ;function cZ(t,e){return Yf(ge(t,e),1)}var Un=cZ;var uZ=Object.prototype,lZ=uZ.hasOwnProperty,fZ=pC(function(t,e,r){lZ.call(t,r)?t[r].push(e):Uf(t,r,[e])}),x6=fZ;var dZ=Object.prototype,pZ=dZ.hasOwnProperty;function mZ(t,e){return t!=null&&pZ.call(t,e)}var SC=mZ;function hZ(t,e){return t!=null&&R0(t,e,SC)}var je=hZ;var gZ="[object String]";function yZ(t){return typeof t=="string"||!Be(t)&&rn(t)&&mi(t)==gZ}var En=yZ;function vZ(t,e){return wo(e,function(r){return t[r]})}var EC=vZ;function xZ(t){return t==null?[]:EC(t,fr(t))}var rr=xZ;var _Z=Math.max;function bZ(t,e,r,n){t=mn(t)?t:rr(t),r=r&&!n?Ao(r):0;var i=t.length;return r<0&&(r=_Z(i+r,0)),En(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&jf(t,e,r)>-1}var Rr=bZ;var SZ=Math.max;function EZ(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Ao(r);return i<0&&(i=SZ(n+i,0)),jf(t,e,i)}var O0=EZ;var TZ="[object Map]",CZ="[object Set]",kZ=Object.prototype,wZ=kZ.hasOwnProperty;function AZ(t){if(t==null)return!0;if(mn(t)&&(Be(t)||typeof t=="string"||typeof t.splice=="function"||pa(t)||Hf(t)||rc(t)))return!t.length;var e=no(t);if(e==TZ||e==CZ)return!t.size;if(No(t))return!d0(t).length;for(var r in t)if(wZ.call(t,r))return!1;return!0}var gt=AZ;var RZ="[object RegExp]";function PZ(t){return rn(t)&&mi(t)==RZ}var TC=PZ;var CC=ws&&ws.isRegExp,NZ=CC?Oo(CC):TC,As=NZ;function OZ(t){return t===void 0}var Xn=OZ;function IZ(t,e){return t<e}var kC=IZ;function DZ(t,e,r){for(var n=-1,i=t.length;++n<i;){var s=t[n],o=e(s);if(o!=null&&(a===void 0?o===o&&!ko(o):r(o,a)))var a=o,c=s}return c}var wC=DZ;function LZ(t){return t&&t.length?wC(t,Ni,kC):void 0}var AC=LZ;var $Z="Expected a function";function MZ(t){if(typeof t!="function")throw new TypeError($Z);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var RC=MZ;function FZ(t,e,r,n){if(!Vr(t))return t;e=cc(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var c=Io(e[i]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=o){var f=a[c];u=n?n(f,c,a):void 0,u===void 0&&(u=Vr(f)?f:Xa(e[i+1])?[]:{})}ec(a,c,u),a=a[c]}return t}var PC=FZ;function VZ(t,e,r){for(var n=-1,i=e.length,s={};++n<i;){var o=e[n],a=Jf(t,o);r(a,o)&&PC(s,cc(o,t),a)}return s}var NC=VZ;function jZ(t,e){if(t==null)return{};var r=wo(v0(t),function(n){return[n]});return e=Hr(e),NC(t,r,function(n,i){return e(n,i[0])})}var Di=jZ;function UZ(t,e,r,n,i){return i(t,function(s,o,a){r=n?(n=!1,s):e(r,s,o,a)}),r}var OC=UZ;function qZ(t,e,r){var n=Be(t)?tT:OC,i=arguments.length<3;return n(t,Hr(e,4),r,i,Ii)}var Ur=qZ;function BZ(t,e){var r=Be(t)?Xf:N0;return r(t,RC(Hr(e,3)))}var dc=BZ;function HZ(t,e){var r;return Ii(t,function(n,i,s){return r=e(n,i,s),!r}),!!r}var IC=HZ;function zZ(t,e,r){var n=Be(t)?E0:IC;return r&&tc(t,e,r)&&(e=void 0),n(t,Hr(e,3))}var Fm=zZ;var WZ=1/0,KZ=lc&&1/sd(new lc([,-0]))[1]==WZ?function(t){return new lc(t)}:jr,DC=KZ;var GZ=200;function JZ(t,e,r){var n=-1,i=u0,s=t.length,o=!0,a=[],c=a;if(r)o=!1,i=P0;else if(s>=GZ){var u=e?null:DC(t);if(u)return sd(u);o=!1,i=id,c=new nd}else c=e?[]:a;e:for(;++n<s;){var f=t[n],l=e?e(f):f;if(f=r||f!==0?f:0,o&&l===l){for(var p=c.length;p--;)if(c[p]===l)continue e;e&&c.push(l),a.push(f)}else i(c,l,r)||(c!==a&&c.push(l),a.push(f))}return a}var I0=JZ;function QZ(t){return t&&t.length?I0(t):[]}var ad=QZ;function YZ(t,e){return t&&t.length?I0(t,Hr(e,2)):[]}var LC=YZ;function cd(t){console&&console.error&&console.error(`Error: ${t}`)}function Vm(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function jm(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Um(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function ZZ(t){return XZ(t)?t.LABEL:t.name}function XZ(t){return En(t.LABEL)&&t.LABEL!==""}var as=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Pe(this.definition,r=>{r.accept(e)})}},Zt=class extends as{constructor(e){super([]),this.idx=1,jn(this,Di(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},gi=class extends as{constructor(e){super(e.definition),this.orgText="",jn(this,Di(e,r=>r!==void 0))}},mr=class extends as{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,jn(this,Di(e,r=>r!==void 0))}},Xt=class extends as{constructor(e){super(e.definition),this.idx=1,jn(this,Di(e,r=>r!==void 0))}},hr=class extends as{constructor(e){super(e.definition),this.idx=1,jn(this,Di(e,r=>r!==void 0))}},gr=class extends as{constructor(e){super(e.definition),this.idx=1,jn(this,Di(e,r=>r!==void 0))}},At=class extends as{constructor(e){super(e.definition),this.idx=1,jn(this,Di(e,r=>r!==void 0))}},ar=class extends as{constructor(e){super(e.definition),this.idx=1,jn(this,Di(e,r=>r!==void 0))}},cr=class extends as{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,jn(this,Di(e,r=>r!==void 0))}},xt=class{constructor(e){this.idx=1,jn(this,Di(e,r=>r!==void 0))}accept(e){e.visit(this)}};function D0(t){return ge(t,ud)}function ud(t){function e(r){return ge(r,ud)}if(t instanceof Zt){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return En(t.label)&&(r.label=t.label),r}else{if(t instanceof mr)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Xt)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof hr)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof gr)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:ud(new xt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ar)return{type:"RepetitionWithSeparator",idx:t.idx,separator:ud(new xt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof At)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof cr)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof xt){let r={type:"Terminal",name:t.terminalType.name,label:ZZ(t.terminalType),idx:t.idx};En(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=As(n)?n.source:n),r}else{if(t instanceof gi)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var yi=class{visit(e){let r=e;switch(r.constructor){case Zt:return this.visitNonTerminal(r);case mr:return this.visitAlternative(r);case Xt:return this.visitOption(r);case hr:return this.visitRepetitionMandatory(r);case gr:return this.visitRepetitionMandatoryWithSeparator(r);case ar:return this.visitRepetitionWithSeparator(r);case At:return this.visitRepetition(r);case cr:return this.visitAlternation(r);case xt:return this.visitTerminal(r);case gi:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function _6(t){return t instanceof mr||t instanceof Xt||t instanceof At||t instanceof hr||t instanceof gr||t instanceof ar||t instanceof xt||t instanceof gi}function vu(t,e=[]){return t instanceof Xt||t instanceof At||t instanceof ar?!0:t instanceof cr?Fm(t.definition,n=>vu(n,e)):t instanceof Zt&&Rr(e,t)?!1:t instanceof as?(t instanceof Zt&&e.push(t),Zn(t.definition,n=>vu(n,e))):!1}function b6(t){return t instanceof cr}function Li(t){if(t instanceof Zt)return"SUBRULE";if(t instanceof Xt)return"OPTION";if(t instanceof cr)return"OR";if(t instanceof hr)return"AT_LEAST_ONE";if(t instanceof gr)return"AT_LEAST_ONE_SEP";if(t instanceof ar)return"MANY_SEP";if(t instanceof At)return"MANY";if(t instanceof xt)return"CONSUME";throw Error("non exhaustive match")}var ga=class{walk(e,r=[]){Pe(e.definition,(n,i)=>{let s=sn(e.definition,i+1);if(n instanceof Zt)this.walkProdRef(n,s,r);else if(n instanceof xt)this.walkTerminal(n,s,r);else if(n instanceof mr)this.walkFlat(n,s,r);else if(n instanceof Xt)this.walkOption(n,s,r);else if(n instanceof hr)this.walkAtLeastOne(n,s,r);else if(n instanceof gr)this.walkAtLeastOneSep(n,s,r);else if(n instanceof ar)this.walkManySep(n,s,r);else if(n instanceof At)this.walkMany(n,s,r);else if(n instanceof cr)this.walkOr(n,s,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Xt({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=$C(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Xt({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=$C(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);Pe(e.definition,s=>{let o=new mr({definition:[s]});this.walk(o,i)})}};function $C(t,e,r){return[new Xt({definition:[new xt({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function xu(t){if(t instanceof Zt)return xu(t.referencedRule);if(t instanceof xt)return rX(t);if(_6(t))return eX(t);if(b6(t))return tX(t);throw Error("non exhaustive match")}function eX(t){let e=[],r=t.definition,n=0,i=r.length>n,s,o=!0;for(;i&&o;)s=r[n],o=vu(s),e=e.concat(xu(s)),n=n+1,i=r.length>n;return ad(e)}function tX(t){let e=ge(t.definition,r=>xu(r));return ad(nn(e))}function rX(t){return[t.terminalType]}var L0="_~IN~_";var S6=class extends ga{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=nX(e.referencedRule,e.idx)+this.topProd.name,s=r.concat(n),o=new mr({definition:s}),a=xu(o);this.follows[i]=a}};function MC(t){let e={};return Pe(t,r=>{let n=new S6(r).startWalking();jn(e,n)}),e}function nX(t,e){return t.name+e+L0}var $0={},iX=new fu;function ld(t){let e=t.toString();if($0.hasOwnProperty(e))return $0[e];{let r=iX.pattern(e);return $0[e]=r,r}}function FC(){$0={}}var jC="Complement Sets are not supported for first char optimization",qm=`Unable to use "first char" lexer optimizations:
99
+ `;function UC(t,e=!1){try{let r=ld(t);return E6(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===jC)e&&Vm(`${qm} Unable to optimize: < ${t.toString()} >
100
+ Complement Sets cannot be automatically optimized.
101
+ This will disable the lexer's first char optimizations.
102
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
103
+ This will disable the lexer's first char optimizations.
104
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),cd(`${qm}
105
+ Failed parsing: < ${t.toString()} >
106
+ Using the @chevrotain/regexp-to-ast library
107
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function E6(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)E6(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let s=n[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let o=s;switch(o.type){case"Character":M0(o.value,e,r);break;case"Set":if(o.complement===!0)throw Error(jC);Pe(o.value,c=>{if(typeof c=="number")M0(c,e,r);else{let u=c;if(r===!0)for(let f=u.from;f<=u.to;f++)M0(f,e,r);else{for(let f=u.from;f<=u.to&&f<fd;f++)M0(f,e,r);if(u.to>=fd){let f=u.from>=fd?u.from:fd,l=u.to,p=Mo(f),d=Mo(l);for(let h=p;h<=d;h++)e[h]=h}}}});break;case"Group":E6(o.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&T6(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return rr(e)}function M0(t,e,r){let n=Mo(t);e[n]=n,r===!0&&sX(t,e)}function sX(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Mo(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let s=Mo(i.charCodeAt(0));e[s]=s}}}function VC(t,e){return $o(t.value,r=>{if(typeof r=="number")return Rr(e,r);{let n=r;return $o(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function T6(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Be(t.value)?Zn(t.value,T6):T6(t.value):!1}var C6=class extends To{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){Rr(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?VC(e,this.targetCharCodes)===void 0&&(this.found=!0):VC(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function F0(t,e){if(e instanceof RegExp){let r=ld(e),n=new C6(t);return n.visit(r),n.found}else return $o(e,r=>Rr(t,r.charCodeAt(0)))!==void 0}var _u="PATTERN",dd="defaultMode",V0="modes",w6=typeof new RegExp("(?:)").sticky=="boolean";function HC(t,e){e=od(e,{useSticky:w6,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
108
+ `],tracer:(_,x)=>x()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{EX()});let n;r("Reject Lexer.NA",()=>{n=dc(t,_=>_[_u]===Nr.NA)});let i=!1,s;r("Transform Patterns",()=>{i=!1,s=ge(n,_=>{let x=_[_u];if(As(x)){let T=x.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!x.ignoreCase?T:T.length===2&&T[0]==="\\"&&!Rr(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:e.useSticky?BC(x):qC(x)}else{if(hi(x))return i=!0,{exec:x};if(typeof x=="object")return i=!0,x;if(typeof x=="string"){if(x.length===1)return x;{let T=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),R=new RegExp(T);return e.useSticky?BC(R):qC(R)}}else throw Error("non exhaustive match")}})});let o,a,c,u,f;r("misc mapping",()=>{o=ge(n,_=>_.tokenTypeIdx),a=ge(n,_=>{let x=_.GROUP;if(x!==Nr.SKIPPED){if(En(x))return x;if(Xn(x))return!1;throw Error("non exhaustive match")}}),c=ge(n,_=>{let x=_.LONGER_ALT;if(x)return Be(x)?ge(x,R=>O0(n,R)):[O0(n,x)]}),u=ge(n,_=>_.PUSH_MODE),f=ge(n,_=>je(_,"POP_MODE"))});let l;r("Line Terminator Handling",()=>{let _=ZC(e.lineTerminatorCharacters);l=ge(n,x=>!1),e.positionTracking!=="onlyOffset"&&(l=ge(n,x=>je(x,"LINE_BREAKS")?!!x.LINE_BREAKS:YC(x,_)===!1&&F0(_,x.PATTERN)))});let p,d,h,g;r("Misc Mapping #2",()=>{p=ge(n,JC),d=ge(s,bX),h=Ur(n,(_,x)=>{let T=x.GROUP;return En(T)&&T!==Nr.SKIPPED&&(_[T]=[]),_},{}),g=ge(s,(_,x)=>({pattern:s[x],longerAlt:c[x],canLineTerminator:l[x],isCustom:p[x],short:d[x],group:a[x],push:u[x],pop:f[x],tokenTypeIdx:o[x],tokenType:n[x]}))});let v=!0,b=[];return e.safeMode||r("First Char Optimization",()=>{b=Ur(n,(_,x,T)=>{if(typeof x.PATTERN=="string"){let R=x.PATTERN.charCodeAt(0),V=Mo(R);k6(_,V,g[T])}else if(Be(x.START_CHARS_HINT)){let R;Pe(x.START_CHARS_HINT,V=>{let $=typeof V=="string"?V.charCodeAt(0):V,K=Mo($);R!==K&&(R=K,k6(_,K,g[T]))})}else if(As(x.PATTERN))if(x.PATTERN.unicode)v=!1,e.ensureOptimizations&&cd(`${qm} Unable to analyze < ${x.PATTERN.toString()} > pattern.
109
+ The regexp unicode flag is not currently supported by the regexp-to-ast library.
110
+ This will disable the lexer's first char optimizations.
111
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let R=UC(x.PATTERN,e.ensureOptimizations);gt(R)&&(v=!1),Pe(R,V=>{k6(_,V,g[T])})}else e.ensureOptimizations&&cd(`${qm} TokenType: <${x.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
112
+ This will disable the lexer's first char optimizations.
113
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),v=!1;return _},[])}),{emptyGroups:h,patternIdxToConfig:g,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:v}}function zC(t,e){let r=[],n=aX(t);r=r.concat(n.errors);let i=cX(n.valid),s=i.valid;return r=r.concat(i.errors),r=r.concat(oX(s)),r=r.concat(gX(s)),r=r.concat(yX(s,e)),r=r.concat(vX(s)),r}function oX(t){let e=[],r=Rn(t,n=>As(n[_u]));return e=e.concat(lX(r)),e=e.concat(pX(r)),e=e.concat(mX(r)),e=e.concat(hX(r)),e=e.concat(fX(r)),e}function aX(t){let e=Rn(t,i=>!je(i,_u)),r=ge(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Pr.MISSING_PATTERN,tokenTypes:[i]})),n=fc(t,e);return{errors:r,valid:n}}function cX(t){let e=Rn(t,i=>{let s=i[_u];return!As(s)&&!hi(s)&&!je(s,"exec")&&!En(s)}),r=ge(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Pr.INVALID_PATTERN,tokenTypes:[i]})),n=fc(t,e);return{errors:r,valid:n}}var uX=/[^\\][$]/;function lX(t){class e extends To{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}let r=Rn(t,i=>{let s=i.PATTERN;try{let o=ld(s),a=new e;return a.visit(o),a.found}catch(o){return uX.test(s.source)}});return ge(r,i=>({message:`Unexpected RegExp Anchor Error:
114
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
115
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Pr.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function fX(t){let e=Rn(t,n=>n.PATTERN.test(""));return ge(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Pr.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var dX=/[^\\[][\^]|^\^/;function pX(t){class e extends To{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}let r=Rn(t,i=>{let s=i.PATTERN;try{let o=ld(s),a=new e;return a.visit(o),a.found}catch(o){return dX.test(s.source)}});return ge(r,i=>({message:`Unexpected RegExp Anchor Error:
116
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
117
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Pr.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function mX(t){let e=Rn(t,n=>{let i=n[_u];return i instanceof RegExp&&(i.multiline||i.global)});return ge(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Pr.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function hX(t){let e=[],r=ge(t,s=>Ur(t,(o,a)=>(s.PATTERN.source===a.PATTERN.source&&!Rr(e,a)&&a.PATTERN!==Nr.NA&&(e.push(a),o.push(a)),o),[]));r=Do(r);let n=Rn(r,s=>s.length>1);return ge(n,s=>{let o=ge(s,c=>c.name);return{message:`The same RegExp pattern ->${Pn(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:Pr.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function gX(t){let e=Rn(t,n=>{if(!je(n,"GROUP"))return!1;let i=n.GROUP;return i!==Nr.SKIPPED&&i!==Nr.NA&&!En(i)});return ge(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Pr.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function yX(t,e){let r=Rn(t,i=>i.PUSH_MODE!==void 0&&!Rr(e,i.PUSH_MODE));return ge(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Pr.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function vX(t){let e=[],r=Ur(t,(n,i,s)=>{let o=i.PATTERN;return o===Nr.NA||(En(o)?n.push({str:o,idx:s,tokenType:i}):As(o)&&_X(o)&&n.push({str:o.source,idx:s,tokenType:i})),n},[]);return Pe(t,(n,i)=>{Pe(r,({str:s,idx:o,tokenType:a})=>{if(i<o&&xX(s,n.PATTERN)){let c=`Token: ->${a.name}<- can never be matched.
118
+ Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
119
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Pr.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function xX(t,e){if(As(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(hi(e))return e(t,0,[],{});if(je(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function _X(t){return $o([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function qC(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function BC(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function WC(t,e,r){let n=[];return je(t,dd)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+dd+`> property in its definition
120
+ `,type:Pr.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),je(t,V0)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+V0+`> property in its definition
121
+ `,type:Pr.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),je(t,V0)&&je(t,dd)&&!je(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${dd}: <${t.defaultMode}>which does not exist
122
+ `,type:Pr.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),je(t,V0)&&Pe(t.modes,(i,s)=>{Pe(i,(o,a)=>{if(Xn(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${a}>
123
+ `,type:Pr.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(je(o,"LONGER_ALT")){let c=Be(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];Pe(c,u=>{!Xn(u)&&!Rr(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${o.name}> outside of mode <${s}>
124
+ `,type:Pr.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function KC(t,e,r){let n=[],i=!1,s=Do(nn(rr(t.modes))),o=dc(s,c=>c[_u]===Nr.NA),a=ZC(r);return e&&Pe(o,c=>{let u=YC(c,a);if(u!==!1){let l={message:SX(c,u),type:u.issue,tokenType:c};n.push(l)}else je(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):F0(a,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
125
+ This Lexer has been defined to track line and column information,
126
+ But none of the Token Types can be identified as matching a line terminator.
127
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
128
+ for details.`,type:Pr.NO_LINE_BREAKS_FLAGS}),n}function GC(t){let e={},r=fr(t);return Pe(r,n=>{let i=t[n];if(Be(i))e[n]=[];else throw Error("non exhaustive match")}),e}function JC(t){let e=t.PATTERN;if(As(e))return!1;if(hi(e))return!0;if(je(e,"exec"))return!0;if(En(e))return!1;throw Error("non exhaustive match")}function bX(t){return En(t)&&t.length===1?t.charCodeAt(0):!1}var QC={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function YC(t,e){if(je(t,"LINE_BREAKS"))return!1;if(As(t.PATTERN)){try{F0(e,t.PATTERN)}catch(r){return{issue:Pr.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(En(t.PATTERN))return!1;if(JC(t))return{issue:Pr.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function SX(t,e){if(e.issue===Pr.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
129
+ The problem is in the <${t.name}> Token Type
130
+ Root cause: ${e.errMsg}.
131
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Pr.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
132
+ The problem is in the <${t.name}> Token Type
133
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function ZC(t){return ge(t,r=>En(r)?r.charCodeAt(0):r)}function k6(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var fd=256,j0=[];function Mo(t){return t<fd?t:j0[t]}function EX(){if(gt(j0)){j0=new Array(65536);for(let t=0;t<65536;t++)j0[t]=t>255?255+~~(t/255):t}}function ya(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function pd(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var XC=1,tk={};function va(t){let e=TX(t);CX(e),wX(e),kX(e),Pe(e,r=>{r.isParent=r.categoryMatches.length>0})}function TX(t){let e=pr(t),r=t,n=!0;for(;n;){r=Do(nn(ge(r,s=>s.CATEGORIES)));let i=fc(r,e);e=e.concat(i),gt(i)?n=!1:r=i}return e}function CX(t){Pe(t,e=>{A6(e)||(tk[XC]=e,e.tokenTypeIdx=XC++),ek(e)&&!Be(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),ek(e)||(e.CATEGORIES=[]),AX(e)||(e.categoryMatches=[]),RX(e)||(e.categoryMatchesMap={})})}function kX(t){Pe(t,e=>{e.categoryMatches=[],Pe(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(tk[n].tokenTypeIdx)})})}function wX(t){Pe(t,e=>{rk([],e)})}function rk(t,e){Pe(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Pe(e.CATEGORIES,r=>{let n=t.concat(e);Rr(n,r)||rk(n,r)})}function A6(t){return je(t,"tokenTypeIdx")}function ek(t){return je(t,"CATEGORIES")}function AX(t){return je(t,"categoryMatches")}function RX(t){return je(t,"categoryMatchesMap")}function nk(t){return je(t,"tokenTypeIdx")}var md={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var Pr;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Pr||(Pr={}));var Bm={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
134
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:md,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Bm);var Nr=class{constructor(e,r=Bm){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${i}>`);let{time:a,value:c}=jm(s),u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${o}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return s()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
135
+ a boolean 2nd argument is no longer supported`);this.config=jn({},Bm,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Bm.lineTerminatorsPattern)this.config.lineTerminatorsPattern=QC;else if(this.config.lineTerminatorCharacters===Bm.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
136
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Be(e)?i={modes:{defaultMode:pr(e)},defaultMode:dd}:(s=!1,i=pr(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(WC(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(KC(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Pe(i.modes,(a,c)=>{i.modes[c]=dc(a,u=>Xn(u))});let o=fr(i.modes);if(Pe(i.modes,(a,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(zC(a,o))}),gt(this.lexerDefinitionErrors)){va(a);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=HC(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=u.charCodeToPatternIdxToConfig,this.emptyGroups=jn({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!gt(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let c=ge(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
137
+ `);throw new Error(`Errors detected in definition of Lexer:
138
+ `+c)}Pe(this.lexerDefinitionWarning,a=>{Vm(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(w6?(this.chopInput=Ni,this.match=this.matchWithTest):(this.updateLastIndex=jr,this.match=this.matchWithExec),s&&(this.handleModes=jr),this.trackStartLines===!1&&(this.computeNewColumn=Ni),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=jr),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=Ur(this.canModeBeOptimized,(c,u,f)=>(u===!1&&c.push(f),c),[]);if(r.ensureOptimizations&&!gt(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
139
+ Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
140
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{FC()}),this.TRACE_INIT("toFastProperties",()=>{Um(this)})})}tokenize(e,r=this.defaultMode){if(!gt(this.lexerDefinitionErrors)){let i=ge(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
141
+ `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
142
+ `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,s,o,a,c,u,f,l,p,d,h,g,v,b,_,x=e,T=x.length,R=0,V=0,$=this.hasCustom?0:Math.floor(e.length/10),K=new Array($),z=[],W=this.trackStartLines?1:void 0,D=this.trackStartLines?1:void 0,P=GC(this.emptyGroups),M=this.trackStartLines,j=this.config.lineTerminatorsPattern,J=0,te=[],re=[],we=[],Q=[];Object.freeze(Q);let F;function Oe(){return te}function ze(ie){let he=Mo(ie),Ee=re[he];return Ee===void 0?Q:Ee}let pt=ie=>{if(we.length===1&&ie.tokenType.PUSH_MODE===void 0){let he=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ie);z.push({offset:ie.startOffset,line:ie.startLine,column:ie.startColumn,length:ie.image.length,message:he})}else{we.pop();let he=Lo(we);te=this.patternIdxToConfig[he],re=this.charCodeToPatternIdxToConfig[he],J=te.length;let Ee=this.canModeBeOptimized[he]&&this.config.safeMode===!1;re&&Ee?F=ze:F=Oe}};function qe(ie){we.push(ie),re=this.charCodeToPatternIdxToConfig[ie],te=this.patternIdxToConfig[ie],J=te.length,J=te.length;let he=this.canModeBeOptimized[ie]&&this.config.safeMode===!1;re&&he?F=ze:F=Oe}qe.call(this,r);let Je,Te=this.config.recoveryEnabled;for(;R<T;){c=null;let ie=x.charCodeAt(R),he=F(ie),Ee=he.length;for(n=0;n<Ee;n++){Je=he[n];let Ce=Je.pattern;u=null;let We=Je.short;if(We!==!1?ie===We&&(c=Ce):Je.isCustom===!0?(_=Ce.exec(x,R,K,P),_!==null?(c=_[0],_.payload!==void 0&&(u=_.payload)):c=null):(this.updateLastIndex(Ce,R),c=this.match(Ce,e,R)),c!==null){if(a=Je.longerAlt,a!==void 0){let me=a.length;for(s=0;s<me;s++){let Nt=te[a[s]],G=Nt.pattern;if(f=null,Nt.isCustom===!0?(_=G.exec(x,R,K,P),_!==null?(o=_[0],_.payload!==void 0&&(f=_.payload)):o=null):(this.updateLastIndex(G,R),o=this.match(G,e,R)),o&&o.length>c.length){c=o,u=f,Je=Nt;break}}}break}}if(c!==null){if(l=c.length,p=Je.group,p!==void 0&&(d=Je.tokenTypeIdx,h=this.createTokenInstance(c,R,d,Je.tokenType,W,D,l),this.handlePayload(h,u),p===!1?V=this.addToken(K,V,h):P[p].push(h)),e=this.chopInput(e,l),R=R+l,D=this.computeNewColumn(D,l),M===!0&&Je.canLineTerminator===!0){let Ce=0,We,me;j.lastIndex=0;do We=j.test(c),We===!0&&(me=j.lastIndex-1,Ce++);while(We===!0);Ce!==0&&(W=W+Ce,D=l-me,this.updateTokenEndLineColumnLocation(h,p,me,Ce,W,D,l))}this.handleModes(Je,pt,qe,h)}else{let Ce=R,We=W,me=D,Nt=Te===!1;for(;Nt===!1&&R<T;)for(e=this.chopInput(e,1),R++,i=0;i<J;i++){let G=te[i],ve=G.pattern,at=G.short;if(at!==!1?x.charCodeAt(R)===at&&(Nt=!0):G.isCustom===!0?Nt=ve.exec(x,R,K,P)!==null:(this.updateLastIndex(ve,R),Nt=ve.exec(e)!==null),Nt===!0)break}if(g=R-Ce,D=this.computeNewColumn(D,g),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(x,Ce,g,We,me),z.push({offset:Ce,line:We,column:me,length:g,message:b}),Te===!1)break}}return this.hasCustom||(K.length=V),{tokens:K,groups:P,errors:z}}handleModes(e,r,n,i){if(e.pop===!0){let s=e.push;r(i),s!==void 0&&n.call(this,s)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,s,o,a){let c,u;r!==void 0&&(c=n===a-1,u=c?-1:0,i===1&&c===!0||(e.endLine=s+u,e.endColumn=o-1+-u))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,s,o){return{image:e,startOffset:r,startLine:s,startColumn:o,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,s,o,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:s,endLine:s,startColumn:o,endColumn:o+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};Nr.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.";Nr.NA=/NOT_APPLICABLE/;function xa(t){return R6(t)?t.LABEL:t.name}function R6(t){return En(t.LABEL)&&t.LABEL!==""}var PX="parent",ik="categories",sk="label",ok="group",ak="push_mode",ck="pop_mode",uk="longer_alt",lk="line_breaks",fk="start_chars_hint";function pc(t){return NX(t)}function NX(t){let e=t.pattern,r={};if(r.name=t.name,Xn(e)||(r.PATTERN=e),je(t,PX))throw`The parent property is no longer supported.
143
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return je(t,ik)&&(r.CATEGORIES=t[ik]),va([r]),je(t,sk)&&(r.LABEL=t[sk]),je(t,ok)&&(r.GROUP=t[ok]),je(t,ck)&&(r.POP_MODE=t[ck]),je(t,ak)&&(r.PUSH_MODE=t[ak]),je(t,uk)&&(r.LONGER_ALT=t[uk]),je(t,lk)&&(r.LINE_BREAKS=t[lk]),je(t,fk)&&(r.START_CHARS_HINT=t[fk]),r}var cs=pc({name:"EOF",pattern:Nr.NA});va([cs]);function _a(t,e,r,n,i,s,o,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Hm(t,e){return ya(t,e)}var ba={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${R6(t)?`--> ${xa(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let s="Expecting: ",a=`
144
+ but found: '`+Pn(e).image+"'";if(n)return s+n+a;{let c=Ur(t,(p,d)=>p.concat(d),[]),u=ge(c,p=>`[${ge(p,d=>xa(d)).join(", ")}]`),l=`one of these possible Token sequences:
145
+ ${ge(u,(p,d)=>` ${d+1}. ${p}`).join(`
146
+ `)}`;return s+l+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",o=`
147
+ but found: '`+Pn(e).image+"'";if(r)return i+r+o;{let c=`expecting at least one iteration which starts with one of these possible Token sequences::
148
+ <${ge(t,u=>`[${ge(u,f=>xa(f)).join(",")}]`).join(" ,")}>`;return i+c+o}}};Object.freeze(ba);var dk={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
149
+ inside top level rule: ->`+t.name+"<-"}},io={buildDuplicateFoundError(t,e){function r(f){return f instanceof xt?f.terminalType.name:f instanceof Zt?f.nonTerminalName:""}let n=t.name,i=Pn(e),s=i.idx,o=Li(i),a=r(i),c=s>0,u=`->${o}${c?s:""}<- ${a?`with argument: ->${a}<-`:""}
150
+ appears more than once (${e.length} times) in the top level rule: ->${n}<-.
151
+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
152
+ `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
153
+ `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
154
+ The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
155
+ To resolve this make sure each Terminal and Non-Terminal names are unique
156
+ This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
157
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=ge(t.prefixPath,i=>xa(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
158
+ in <OR${r}> inside <${t.topLevelRule.name}> Rule,
159
+ <${e}> may appears as a prefix path in all these alternatives.
160
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
161
+ For Further details.`},buildAlternationAmbiguityError(t){let e=ge(t.prefixPath,i=>xa(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
162
+ <${e}> may appears as a prefix path in all these alternatives.
163
+ `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
164
+ For Further details.`,n},buildEmptyRepetitionError(t){let e=Li(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
165
+ This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
166
+ Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
167
+ <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
168
+ has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){let e=t.topLevelRule.name,r=ge(t.leftRecursionPath,s=>s.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
169
+ rule: <${e}> can be invoked from itself (directly or indirectly)
170
+ without consuming any Tokens. The grammar path that causes this is:
171
+ ${n}
172
+ To fix this refactor your grammar to remove the left recursion.
173
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof gi?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function pk(t,e){let r=new P6(t,e);return r.resolveRefs(),r.errors}var P6=class extends yi{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Pe(rr(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Tn.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var N6=class extends ga{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=pr(this.path.ruleStack).reverse(),this.occurrenceStack=pr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){gt(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},U0=class extends N6{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),s=new mr({definition:i});this.possibleTokTypes=xu(s),this.found=!0}}},hd=class extends ga{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},q0=class extends hd{walkMany(e,r,n){if(e.idx===this.occurrence){let i=Pn(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof xt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},zm=class extends hd{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=Pn(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof xt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},B0=class extends hd{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=Pn(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof xt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Wm=class extends hd{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=Pn(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof xt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function H0(t,e,r=[]){r=pr(r);let n=[],i=0;function s(a){return a.concat(sn(t,i+1))}function o(a){let c=H0(s(a),e,r);return n.concat(c)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof mr)return o(a.definition);if(a instanceof Zt)return o(a.definition);if(a instanceof Xt)n=o(a.definition);else if(a instanceof hr){let c=a.definition.concat([new At({definition:a.definition})]);return o(c)}else if(a instanceof gr){let c=[new mr({definition:a.definition}),new At({definition:[new xt({terminalType:a.separator})].concat(a.definition)})];return o(c)}else if(a instanceof ar){let c=a.definition.concat([new At({definition:[new xt({terminalType:a.separator})].concat(a.definition)})]);n=o(c)}else if(a instanceof At){let c=a.definition.concat([new At({definition:a.definition})]);n=o(c)}else{if(a instanceof cr)return Pe(a.definition,c=>{gt(c.definition)===!1&&(n=o(c.definition))}),n;if(a instanceof xt)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:sn(t,i)}),n}function z0(t,e,r,n){let i="EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE",a=!1,c=e.length,u=c-n-1,f=[],l=[];for(l.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!gt(l);){let p=l.pop();if(p===o){a&&Lo(l).idx<=u&&l.pop();continue}let d=p.def,h=p.idx,g=p.ruleStack,v=p.occurrenceStack;if(gt(d))continue;let b=d[0];if(b===i){let _={idx:h,def:sn(d),ruleStack:ha(g),occurrenceStack:ha(v)};l.push(_)}else if(b instanceof xt)if(h<c-1){let _=h+1,x=e[_];if(r(x,b.terminalType)){let T={idx:_,def:sn(d),ruleStack:g,occurrenceStack:v};l.push(T)}}else if(h===c-1)f.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:g,occurrenceStack:v}),a=!0;else throw Error("non exhaustive match");else if(b instanceof Zt){let _=pr(g);_.push(b.nonTerminalName);let x=pr(v);x.push(b.idx);let T={idx:h,def:b.definition.concat(s,sn(d)),ruleStack:_,occurrenceStack:x};l.push(T)}else if(b instanceof Xt){let _={idx:h,def:sn(d),ruleStack:g,occurrenceStack:v};l.push(_),l.push(o);let x={idx:h,def:b.definition.concat(sn(d)),ruleStack:g,occurrenceStack:v};l.push(x)}else if(b instanceof hr){let _=new At({definition:b.definition,idx:b.idx}),x=b.definition.concat([_],sn(d)),T={idx:h,def:x,ruleStack:g,occurrenceStack:v};l.push(T)}else if(b instanceof gr){let _=new xt({terminalType:b.separator}),x=new At({definition:[_].concat(b.definition),idx:b.idx}),T=b.definition.concat([x],sn(d)),R={idx:h,def:T,ruleStack:g,occurrenceStack:v};l.push(R)}else if(b instanceof ar){let _={idx:h,def:sn(d),ruleStack:g,occurrenceStack:v};l.push(_),l.push(o);let x=new xt({terminalType:b.separator}),T=new At({definition:[x].concat(b.definition),idx:b.idx}),R=b.definition.concat([T],sn(d)),V={idx:h,def:R,ruleStack:g,occurrenceStack:v};l.push(V)}else if(b instanceof At){let _={idx:h,def:sn(d),ruleStack:g,occurrenceStack:v};l.push(_),l.push(o);let x=new At({definition:b.definition,idx:b.idx}),T=b.definition.concat([x],sn(d)),R={idx:h,def:T,ruleStack:g,occurrenceStack:v};l.push(R)}else if(b instanceof cr)for(let _=b.definition.length-1;_>=0;_--){let x=b.definition[_],T={idx:h,def:x.definition.concat(sn(d)),ruleStack:g,occurrenceStack:v};l.push(T),l.push(o)}else if(b instanceof mr)l.push({idx:h,def:b.definition.concat(sn(d)),ruleStack:g,occurrenceStack:v});else if(b instanceof gi)l.push(OX(b,h,g,v));else throw Error("non exhaustive match")}return f}function OX(t,e,r,n){let i=pr(r);i.push(t.name);let s=pr(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var Or;(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"})(Or||(Or={}));function Km(t){if(t instanceof Xt||t==="Option")return Or.OPTION;if(t instanceof At||t==="Repetition")return Or.REPETITION;if(t instanceof hr||t==="RepetitionMandatory")return Or.REPETITION_MANDATORY;if(t instanceof gr||t==="RepetitionMandatoryWithSeparator")return Or.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ar||t==="RepetitionWithSeparator")return Or.REPETITION_WITH_SEPARATOR;if(t instanceof cr||t==="Alternation")return Or.ALTERNATION;throw Error("non exhaustive match")}function K0(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=Km(n);return s===Or.ALTERNATION?gd(e,r,i):yd(e,r,s,i)}function hk(t,e,r,n,i,s){let o=gd(t,e,r),a=bk(o)?pd:ya;return s(o,n,a,i)}function gk(t,e,r,n,i,s){let o=yd(t,e,i,r),a=bk(o)?pd:ya;return s(o[0],a,n)}function yk(t,e,r,n){let i=t.length,s=Zn(t,o=>Zn(o,a=>a.length===1));if(e)return function(o){let a=ge(o,c=>c.GATE);for(let c=0;c<i;c++){let u=t[c],f=u.length,l=a[c];if(!(l!==void 0&&l.call(this)===!1))e:for(let p=0;p<f;p++){let d=u[p],h=d.length;for(let g=0;g<h;g++){let v=this.LA(g+1);if(r(v,d[g])===!1)continue e}return c}}};if(s&&!n){let o=ge(t,c=>nn(c)),a=Ur(o,(c,u,f)=>(Pe(u,l=>{je(c,l.tokenTypeIdx)||(c[l.tokenTypeIdx]=f),Pe(l.categoryMatches,p=>{je(c,p)||(c[p]=f)})}),c),{});return function(){let c=this.LA(1);return a[c.tokenTypeIdx]}}else return function(){for(let o=0;o<i;o++){let a=t[o],c=a.length;e:for(let u=0;u<c;u++){let f=a[u],l=f.length;for(let p=0;p<l;p++){let d=this.LA(p+1);if(r(d,f[p])===!1)continue e}return o}}}}function vk(t,e,r){let n=Zn(t,s=>s.length===1),i=t.length;if(n&&!r){let s=nn(t);if(s.length===1&&gt(s[0].categoryMatches)){let a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{let o=Ur(s,(a,c,u)=>(a[c.tokenTypeIdx]=!0,Pe(c.categoryMatches,f=>{a[f]=!0}),a),[]);return function(){let a=this.LA(1);return o[a.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){let o=t[s],a=o.length;for(let c=0;c<a;c++){let u=this.LA(c+1);if(e(u,o[c])===!1)continue e}return!0}return!1}}var I6=class extends ga{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,Or.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Or.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Or.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Or.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Or.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},W0=class extends yi{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Or.OPTION)}visitRepetition(e){this.checkIsTarget(e,Or.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Or.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Or.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Or.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Or.ALTERNATION)}};function mk(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function O6(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let s=0;s<e.length;s++){let o=e[s];i.push(o+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let c="_"+n.categoryMatches[a];i.push(o+c)}}e=i}return e}function IX(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let s=0;s<e.length;s++){let o=e[s];if(i[o]===!0)return!1}}return!0}function xk(t,e){let r=ge(t,o=>H0([o],1)),n=mk(r.length),i=ge(r,o=>{let a={};return Pe(o,c=>{let u=O6(c.partialPath);Pe(u,f=>{a[f]=!0})}),a}),s=r;for(let o=1;o<=e;o++){let a=s;s=mk(a.length);for(let c=0;c<a.length;c++){let u=a[c];for(let f=0;f<u.length;f++){let l=u[f].partialPath,p=u[f].suffixDef,d=O6(l);if(IX(i,d,c)||gt(p)||l.length===e){let g=n[c];if(G0(g,l)===!1){g.push(l);for(let v=0;v<d.length;v++){let b=d[v];i[c][b]=!0}}}else{let g=H0(p,o+1,l);s[c]=s[c].concat(g),Pe(g,v=>{let b=O6(v.partialPath);Pe(b,_=>{i[c][_]=!0})})}}}}return n}function gd(t,e,r,n){let i=new W0(t,Or.ALTERNATION,n);return e.accept(i),xk(i.result,r)}function yd(t,e,r,n){let i=new W0(t,r);e.accept(i);let s=i.result,a=new I6(e,t,r).startWalking(),c=new mr({definition:s}),u=new mr({definition:a});return xk([c,u],n)}function G0(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let s=e[i],o=n[i];if((s===o||o.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function _k(t,e){return t.length<e.length&&Zn(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function bk(t){return Zn(t,e=>Zn(e,r=>Zn(r,n=>gt(n.categoryMatches))))}function Sk(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ge(e,r=>Object.assign({type:Tn.CUSTOM_LOOKAHEAD_VALIDATION},r))}function Ek(t,e,r,n){let i=Un(t,c=>DX(c,r)),s=jX(t,e,r),o=Un(t,c=>MX(c,r)),a=Un(t,c=>$X(c,t,n,r));return i.concat(s,o,a)}function DX(t,e){let r=new D6;t.accept(r);let n=r.allProductions,i=x6(n,LX),s=Di(i,a=>a.length>1);return ge(rr(s),a=>{let c=Pn(a),u=e.buildDuplicateFoundError(t,a),f=Li(c),l={message:u,type:Tn.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:f,occurrence:c.idx},p=Tk(c);return p&&(l.parameter=p),l})}function LX(t){return`${Li(t)}_#_${t.idx}_#_${Tk(t)}`}function Tk(t){return t instanceof xt?t.terminalType.name:t instanceof Zt?t.nonTerminalName:""}var D6=class extends yi{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function $X(t,e,r,n){let i=[];if(Ur(e,(o,a)=>a.name===t.name?o+1:o,0)>1){let o=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:o,type:Tn.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Ck(t,e,r){let n=[],i;return Rr(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:Tn.INVALID_RULE_OVERRIDE,ruleName:t})),n}function $6(t,e,r,n=[]){let i=[],s=J0(e.definition);if(gt(s))return[];{let o=t.name;Rr(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:Tn.LEFT_RECURSION,ruleName:o});let c=fc(s,n.concat([t])),u=Un(c,f=>{let l=pr(n);return l.push(f),$6(t,f,r,l)});return i.concat(u)}}function J0(t){let e=[];if(gt(t))return e;let r=Pn(t);if(r instanceof Zt)e.push(r.referencedRule);else if(r instanceof mr||r instanceof Xt||r instanceof hr||r instanceof gr||r instanceof ar||r instanceof At)e=e.concat(J0(r.definition));else if(r instanceof cr)e=nn(ge(r.definition,s=>J0(s.definition)));else if(!(r instanceof xt))throw Error("non exhaustive match");let n=vu(r),i=t.length>1;if(n&&i){let s=sn(t);return e.concat(J0(s))}else return e}var Gm=class extends yi{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function kk(t,e){let r=new Gm;t.accept(r);let n=r.alternations;return Un(n,s=>{let o=ha(s.definition);return Un(o,(a,c)=>{let u=z0([a],[],ya,1);return gt(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:Tn.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function wk(t,e,r){let n=new Gm;t.accept(n);let i=n.alternations;return i=dc(i,o=>o.ignoreAmbiguities===!0),Un(i,o=>{let a=o.idx,c=o.maxLookahead||e,u=gd(a,t,c,o),f=FX(u,o,t,r),l=VX(u,o,t,r);return f.concat(l)})}var L6=class extends yi{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function MX(t,e){let r=new Gm;t.accept(r);let n=r.alternations;return Un(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Tn.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function Ak(t,e,r){let n=[];return Pe(t,i=>{let s=new L6;i.accept(s);let o=s.allProductions;Pe(o,a=>{let c=Km(a),u=a.maxLookahead||e,f=a.idx,p=yd(f,i,c,u)[0];if(gt(nn(p))){let d=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:d,type:Tn.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function FX(t,e,r,n){let i=[],s=Ur(t,(a,c,u)=>(e.definition[u].ignoreAmbiguities===!0||Pe(c,f=>{let l=[u];Pe(t,(p,d)=>{u!==d&&G0(p,f)&&e.definition[d].ignoreAmbiguities!==!0&&l.push(d)}),l.length>1&&!G0(i,f)&&(i.push(f),a.push({alts:l,path:f}))}),a),[]);return ge(s,a=>{let c=ge(a.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:Tn.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function VX(t,e,r,n){let i=Ur(t,(o,a,c)=>{let u=ge(a,f=>({idx:c,path:f}));return o.concat(u)},[]);return Do(Un(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];let c=o.idx,u=o.path,f=Rn(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<c&&_k(p.path,u));return ge(f,p=>{let d=[p.idx+1,c+1],h=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:d,prefixPath:p.path}),type:Tn.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:h,alternatives:d}})}))}function jX(t,e,r){let n=[],i=ge(e,s=>s.name);return Pe(t,s=>{let o=s.name;if(Rr(i,o)){let a=r.buildNamespaceConflictError(s);n.push({message:a,type:Tn.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}function Rk(t){let e=od(t,{errMsgProvider:dk}),r={};return Pe(t.rules,n=>{r[n.name]=n}),pk(r,e.errMsgProvider)}function Pk(t){return t=od(t,{errMsgProvider:io}),Ek(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var Nk="MismatchedTokenException",Ok="NoViableAltException",Ik="EarlyExitException",Dk="NotAllInputParsedException",Lk=[Nk,Ok,Ik,Dk];Object.freeze(Lk);function mc(t){return Rr(Lk,t.name)}var vd=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},bu=class extends vd{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Nk}},Jm=class extends vd{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Ok}},Qm=class extends vd{constructor(e,r){super(e,r),this.name=Dk}},Ym=class extends vd{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Ik}};var M6={},V6="InRuleRecoveryException",F6=class extends Error{constructor(e){super(e),this.name=V6}},Q0=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=je(e,"recoveryEnabled")?e.recoveryEnabled:vi.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=UX)}getTokenToInsert(e){let r=_a(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let s=this.findReSyncTokenType(),o=this.exportLexerState(),a=[],c=!1,u=this.LA(1),f=this.LA(1),l=()=>{let p=this.LA(0),d=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:p,ruleName:this.getCurrRuleFullName()}),h=new bu(d,u,this.LA(0));h.resyncedTokens=ha(a),this.SAVE_ERROR(h)};for(;!c;)if(this.tokenMatcher(f,i)){l();return}else if(n.call(this)){l(),e.apply(this,r);return}else this.tokenMatcher(f,s)?c=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,a));this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new F6("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||gt(r))return!1;let n=this.LA(1);return $o(r,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Rr(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=$o(e,s=>Hm(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return M6;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return ge(e,(n,i)=>i===0?M6:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=ge(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return nn(e)}getFollowSetFromFollowKey(e){if(e===M6)return[cs];let r=e.ruleName+e.idxInCallingRule+L0+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,cs)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return ha(r)}attemptInRepetitionRecovery(e,r,n,i,s,o,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=pr(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return ge(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function UX(t,e,r,n,i,s,o){let a=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[a];if(c===void 0){let p=this.getCurrRuleFullName(),d=this.getGAstProductions()[p];c=new s(d,i).startWalking(),this.firstAfterRepMap[a]=c}let u=c.token,f=c.occurrence,l=c.isEndOfRule;this.RULE_STACK.length===1&&l&&u===void 0&&(u=cs,f=1),!(u===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,f,o)&&this.tryInRepetitionRecovery(t,e,r,u)}function Y0(t,e,r){return r|e|t}var Sa=class{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:vi.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(gt(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...s]}return r}validateNoLeftRecursion(e){return Un(e,r=>$6(r,r,io))}validateEmptyOrAlternatives(e){return Un(e,r=>kk(r,io))}validateAmbiguousAlternationAlternatives(e,r){return Un(e,n=>wk(n,r,io))}validateSomeNonEmptyLookaheadPath(e,r){return Ak(e,r,io)}buildLookaheadForAlternation(e){return hk(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,yk)}buildLookaheadForOptional(e){return gk(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Km(e.prodType),vk)}};var X0=class{initLooksAhead(e){this.dynamicTokensEnabled=je(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:vi.dynamicTokensEnabled,this.maxLookahead=je(e,"maxLookahead")?e.maxLookahead:vi.maxLookahead,this.lookaheadStrategy=je(e,"lookaheadStrategy")?e.lookaheadStrategy:new Sa({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Pe(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:s,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=qX(r);Pe(n,u=>{let f=u.idx===0?"":u.idx;this.TRACE_INIT(`${Li(u)}${f}`,()=>{let l=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=Y0(this.fullRuleNameToShort[r.name],256,u.idx);this.setLaFuncCache(p,l)})}),Pe(i,u=>{this.computeLookaheadFunc(r,u.idx,768,"Repetition",u.maxLookahead,Li(u))}),Pe(s,u=>{this.computeLookaheadFunc(r,u.idx,512,"Option",u.maxLookahead,Li(u))}),Pe(o,u=>{this.computeLookaheadFunc(r,u.idx,1024,"RepetitionMandatory",u.maxLookahead,Li(u))}),Pe(a,u=>{this.computeLookaheadFunc(r,u.idx,1536,"RepetitionMandatoryWithSeparator",u.maxLookahead,Li(u))}),Pe(c,u=>{this.computeLookaheadFunc(r,u.idx,1280,"RepetitionWithSeparator",u.maxLookahead,Li(u))})})})}computeLookaheadFunc(e,r,n,i,s,o){this.TRACE_INIT(`${o}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=Y0(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return Y0(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},j6=class extends yi{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},Z0=new j6;function qX(t){Z0.reset(),t.accept(Z0);let e=Z0.dslMethods;return Z0.reset(),e}function B6(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function H6(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function $k(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function Mk(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var BX="name";function z6(t,e){Object.defineProperty(t,BX,{enumerable:!1,configurable:!0,writable:!1,value:e})}function HX(t,e){let r=fr(t),n=r.length;for(let i=0;i<n;i++){let s=r[i],o=t[s],a=o.length;for(let c=0;c<a;c++){let u=o[c];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}function Fk(t,e){let r=function(){};z6(r,t+"BaseSemantics");let n={visit:function(i,s){if(Be(i)&&(i=i[0]),!Xn(i))return this[i.name](i.children,s)},validateVisitor:function(){let i=zX(this,e);if(!gt(i)){let s=ge(i,o=>o.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
174
+ ${s.join(`
175
+
176
+ `).replace(/\n/g,`
177
+ `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function Vk(t,e,r){let n=function(){};z6(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return Pe(e,s=>{i[s]=HX}),n.prototype=i,n.prototype.constructor=n,n}var W6;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(W6||(W6={}));function zX(t,e){return WX(t,e)}function WX(t,e){let r=Rn(e,i=>hi(t[i])===!1),n=ge(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:W6.MISSING_METHOD,methodName:i}));return Do(n)}var n2=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=je(e,"nodeLocationTracking")?e.nodeLocationTracking:vi.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=jr,this.cstFinallyStateUpdate=jr,this.cstPostTerminal=jr,this.cstPostNonTerminal=jr,this.cstPostRule=jr;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=H6,this.setNodeLocationFromNode=H6,this.cstPostRule=jr,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=jr,this.setNodeLocationFromNode=jr,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=B6,this.setNodeLocationFromNode=B6,this.cstPostRule=jr,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=jr,this.setNodeLocationFromNode=jr,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=jr,this.setNodeLocationFromNode=jr,this.cstPostRule=jr,this.setInitialNodeLocation=jr;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];$k(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];Mk(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Xn(this.baseCstVisitorConstructor)){let e=Fk(this.className,fr(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Xn(this.baseCstVisitorWithDefaultsConstructor)){let e=Vk(this.className,fr(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var i2=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):xd}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?xd:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var s2=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=_d){if(Rr(this.definedRulesNames,e)){let o={message:io.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Tn.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=_d){let i=Ck(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let s=this.defineRule(e,r,n);return this[e]=s,s}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(mc(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return D0(rr(this.gastProductionsCache))}};var o2=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pd,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},je(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
178
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
179
+ For Further details.`);if(Be(e)){if(gt(e))throw Error(`A Token Vocabulary cannot be empty.
180
+ Note that the first argument for the parser constructor
181
+ 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.
182
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
183
+ For Further details.`)}if(Be(e))this.tokensMap=Ur(e,(s,o)=>(s[o.name]=o,s),{});else if(je(e,"modes")&&Zn(nn(rr(e.modes)),nk)){let s=nn(rr(e.modes)),o=ad(s);this.tokensMap=Ur(o,(a,c)=>(a[c.name]=c,a),{})}else if(Vr(e))this.tokensMap=pr(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=cs;let n=je(e,"modes")?nn(rr(e.modes)):rr(e),i=Zn(n,s=>gt(s.categoryMatches));this.tokenMatcher=i?pd:ya,va(rr(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
184
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=je(n,"resyncEnabled")?n.resyncEnabled:_d.resyncEnabled,s=je(n,"recoveryValueFunc")?n.recoveryValueFunc:_d.recoveryValueFunc,o=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let a;return this.outputCst===!0?a=function(...f){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),r.apply(this,f);let l=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(l),l}catch(l){return this.invokeRuleCatch(l,i,s)}finally{this.ruleFinallyStateUpdate()}}:a=function(...f){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),r.apply(this,f)}catch(l){return this.invokeRuleCatch(l,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,s=r&&!this.isBackTracking()&&this.recoveryEnabled;if(mc(e)){let o=e;if(s){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(o.resyncedTokens=this.reSyncTo(a),this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n(e);else{if(this.outputCst){let c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,o.partialCstResult=c}throw o}}else{if(i)return this.moveToTerminatedState(),n(e);throw o}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof e!="function"){s=e.DEF;let o=e.GATE;if(o!==void 0){let a=i;i=()=>o.call(this)&&a.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;let o=r.GATE;if(o!==void 0){let a=i;i=()=>o.call(this)&&a.call(this)}}else s=r;if(i.call(this)===!0){let o=this.doSingleRepetition(s);for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,Or.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,B0)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,Wm],a,1536,e,Wm)}else throw this.raiseEarlyExitException(e,Or.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;let a=r.GATE;if(a!==void 0){let c=i;i=()=>a.call(this)&&c.call(this)}}else s=r;let o=!0;for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,q0,o)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,zm],a,1280,e,zm)}}repetitionSepSecondInternal(e,r,n,i,s){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,s],n,1536,e,s)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=Be(e)?e:e.DEF,o=this.getLaFuncFromCache(n).call(this,i);if(o!==void 0)return i[o].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Qm(r,e))}}subruleInternal(e,r,n){let i;try{let s=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,s),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,n,e.ruleName)}}subruleInternalError(e,r,n){throw mc(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,n)}catch(s){i=this.consumeInternalRecovery(e,r,s)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,s=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(i,r,s))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===V6?n:s}}else throw n}saveRecogState(){let e=this.errors,r=pr(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),cs)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var a2=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=je(e,"errorMessageProvider")?e.errorMessageProvider:vi.errorMessageProvider}SAVE_ERROR(e){if(mc(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:pr(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return pr(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],a=yd(e,s,r,this.maxLookahead)[0],c=[];for(let f=1;f<=this.maxLookahead;f++)c.push(this.LA(f));let u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Ym(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],s=gd(e,i,this.maxLookahead),o=[];for(let u=1;u<=this.maxLookahead;u++)o.push(this.LA(u));let a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Jm(c,this.LA(1),a))}};var c2=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(Xn(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return z0([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=Pn(e.ruleStack),i=this.getGAstProductions()[r];return new U0(i,e).startWalking()}};var f2={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(f2);var jk=!0,Uk=Math.pow(2,8)-1,Bk=pc({name:"RECORDING_PHASE_TOKEN",pattern:Nr.NA});va([Bk]);var Hk=_a(Bk,`This IToken indicates the Parser is in Recording Phase
185
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Hk);var GX={name:`This CSTNode indicates the Parser is in Recording Phase
186
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},u2=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return xd}topLevelRuleRecord(e,r){try{let n=new gi({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
187
+ This error was thrown during the "grammar recording phase" For more info see:
188
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch(i){throw n}throw n}}optionInternalRecord(e,r){return Xm.call(this,Xt,e,r)}atLeastOneInternalRecord(e,r){Xm.call(this,hr,r,e)}atLeastOneSepFirstInternalRecord(e,r){Xm.call(this,gr,r,e,jk)}manyInternalRecord(e,r){Xm.call(this,At,r,e)}manySepFirstInternalRecord(e,r){Xm.call(this,ar,r,e,jk)}orInternalRecord(e,r){return JX.call(this,e,r)}subruleInternalRecord(e,r,n){if(l2(r),!e||je(e,"ruleName")===!1){let a=new Error(`<SUBRULE${qk(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
189
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=Lo(this.recordingProdStack),s=e.ruleName,o=new Zt({idx:r,nonTerminalName:s,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?GX:f2}consumeInternalRecord(e,r,n){if(l2(r),!A6(e)){let o=new Error(`<CONSUME${qk(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
190
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}let i=Lo(this.recordingProdStack),s=new xt({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(s),Hk}};function Xm(t,e,r,n=!1){l2(r);let i=Lo(this.recordingProdStack),s=hi(e)?e:e.DEF,o=new t({definition:[],idx:r});return n&&(o.separator=e.SEP),je(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.pop(),f2}function JX(t,e){l2(e);let r=Lo(this.recordingProdStack),n=Be(t)===!1,i=n===!1?t:t.DEF,s=new cr({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});je(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);let o=Fm(i,a=>hi(a.GATE));return s.hasPredicates=o,r.definition.push(s),Pe(i,a=>{let c=new mr({definition:[]});s.definition.push(c),je(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:je(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),f2}function qk(t){return t===0?"":`${t}`}function l2(t){if(t<0||t>Uk){let e=new Error(`Invalid DSL Method idx value: <${t}>
191
+ Idx value must be a none negative value smaller than ${Uk+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var d2=class{initPerformanceTracer(e){if(je(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=vi.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:s}=jm(r),o=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return r()}};function zk(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let s=Object.getOwnPropertyDescriptor(n,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=r.prototype[i]})})}var xd=_a(cs,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(xd);var vi=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:ba,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),_d=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),Tn;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Tn||(Tn={}));function p2(t=void 0){return function(){return t}}var eh=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Um(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Pe(this.definedRulesNames,i=>{let o=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Rk({rules:rr(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(gt(n)&&this.skipValidations===!1){let i=Pk({rules:rr(this.gastProductionsCache),tokenTypes:rr(this.tokensMap),errMsgProvider:io,grammarName:r}),s=Sk({lookaheadStrategy:this.lookaheadStrategy,rules:rr(this.gastProductionsCache),tokenTypes:rr(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,s)}}),gt(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=MC(rr(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:rr(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(rr(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!gt(this.definitionErrors))throw e=ge(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
192
+ ${e.join(`
193
+ -------------------------------
194
+ `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),je(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
195
+ Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
196
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
197
+ For further details.`);this.skipValidations=je(r,"skipValidations")?r.skipValidations:vi.skipValidations}};eh.DEFER_DEFINITION_ERRORS_HANDLING=!1;zk(eh,[Q0,X0,n2,i2,o2,s2,a2,c2,u2,d2]);var th=class extends eh{constructor(e,r=vi){let n=pr(r);n.outputCst=!1,super(e,n)}};function Su(t,e,r){return`${t.name}_${e}_${r}`}var hc=1,YX=2,Wk=4,Kk=5;var Ed=7,ZX=8,XX=9,eee=10,tee=11,Gk=12,rh=class{constructor(e){this.target=e}isEpsilon(){return!1}},bd=class extends rh{constructor(e,r){super(e),this.tokenType=r}},nh=class extends rh{constructor(e){super(e)}isEpsilon(){return!0}},Sd=class extends rh{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}};function Jk(t){let e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};ree(e,t);let r=t.length;for(let n=0;n<r;n++){let i=t[n],s=Eu(e,i,i);s!==void 0&&pee(e,i,s)}return e}function ree(t,e){let r=e.length;for(let n=0;n<r;n++){let i=e[n],s=Nn(t,i,void 0,{type:YX}),o=Nn(t,i,void 0,{type:Ed});s.stop=o,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,o)}}function Qk(t,e,r){return r instanceof xt?G6(t,e,r.terminalType,r):r instanceof Zt?dee(t,e,r):r instanceof cr?aee(t,e,r):r instanceof Xt?cee(t,e,r):r instanceof At?nee(t,e,r):r instanceof ar?iee(t,e,r):r instanceof hr?see(t,e,r):r instanceof gr?oee(t,e,r):Eu(t,e,r)}function nee(t,e,r){let n=Nn(t,e,r,{type:Kk});gc(t,n);let i=Td(t,e,n,r,Eu(t,e,r));return Zk(t,e,r,i)}function iee(t,e,r){let n=Nn(t,e,r,{type:Kk});gc(t,n);let i=Td(t,e,n,r,Eu(t,e,r)),s=G6(t,e,r.separator,r);return Zk(t,e,r,i,s)}function see(t,e,r){let n=Nn(t,e,r,{type:Wk});gc(t,n);let i=Td(t,e,n,r,Eu(t,e,r));return Yk(t,e,r,i)}function oee(t,e,r){let n=Nn(t,e,r,{type:Wk});gc(t,n);let i=Td(t,e,n,r,Eu(t,e,r)),s=G6(t,e,r.separator,r);return Yk(t,e,r,i,s)}function aee(t,e,r){let n=Nn(t,e,r,{type:hc});gc(t,n);let i=ge(r.definition,o=>Qk(t,e,o));return Td(t,e,n,r,...i)}function cee(t,e,r){let n=Nn(t,e,r,{type:hc});gc(t,n);let i=Td(t,e,n,r,Eu(t,e,r));return uee(t,e,r,i)}function Eu(t,e,r){let n=Rn(ge(r.definition,i=>Qk(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:fee(t,n)}function Yk(t,e,r,n,i){let s=n.left,o=n.right,a=Nn(t,e,r,{type:tee});gc(t,a);let c=Nn(t,e,r,{type:Gk});return s.loopback=a,c.loopback=a,t.decisionMap[Su(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=a,hn(o,a),i===void 0?(hn(a,s),hn(a,c)):(hn(a,c),hn(a,i.left),hn(i.right,s)),{left:s,right:c}}function Zk(t,e,r,n,i){let s=n.left,o=n.right,a=Nn(t,e,r,{type:eee});gc(t,a);let c=Nn(t,e,r,{type:Gk}),u=Nn(t,e,r,{type:XX});return a.loopback=u,c.loopback=u,hn(a,s),hn(a,c),hn(o,u),i!==void 0?(hn(u,c),hn(u,i.left),hn(i.right,s)):hn(u,a),t.decisionMap[Su(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=a,{left:a,right:c}}function uee(t,e,r,n){let i=n.left,s=n.right;return hn(i,s),t.decisionMap[Su(e,"Option",r.idx)]=i,n}function gc(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Td(t,e,r,n,...i){let s=Nn(t,e,n,{type:ZX,start:r});r.end=s;for(let a of i)a!==void 0?(hn(r,a.left),hn(a.right,s)):hn(r,s);let o={left:r,right:s};return t.decisionMap[Su(e,lee(n),n.idx)]=r,o}function lee(t){if(t instanceof cr)return"Alternation";if(t instanceof Xt)return"Option";if(t instanceof At)return"Repetition";if(t instanceof ar)return"RepetitionWithSeparator";if(t instanceof hr)return"RepetitionMandatory";if(t instanceof gr)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function fee(t,e){let r=e.length;for(let s=0;s<r-1;s++){let o=e[s],a;o.left.transitions.length===1&&(a=o.left.transitions[0]);let c=a instanceof Sd,u=a,f=e[s+1].left;o.left.type===hc&&o.right.type===hc&&a!==void 0&&(c&&u.followState===o.right||a.target===o.right)?(c?u.followState=f:a.target=f,mee(t,o.right)):hn(o.right,f)}let n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function G6(t,e,r,n){let i=Nn(t,e,n,{type:hc}),s=Nn(t,e,n,{type:hc});return J6(i,new bd(s,r)),{left:i,right:s}}function dee(t,e,r){let n=r.referencedRule,i=t.ruleToStartState.get(n),s=Nn(t,e,r,{type:hc}),o=Nn(t,e,r,{type:hc}),a=new Sd(i,n,o);return J6(s,a),{left:s,right:o}}function pee(t,e,r){let n=t.ruleToStartState.get(e);hn(n,r.left);let i=t.ruleToStopState.get(e);return hn(r.right,i),{left:n,right:i}}function hn(t,e){let r=new nh(e);J6(t,r)}function Nn(t,e,r,n){let i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function J6(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function mee(t,e){t.states.splice(t.states.indexOf(e),1)}var ih={},Cd=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let r=Q6(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return ge(this.configs,e=>e.alt)}get key(){let e="";for(let r in this.map)e+=r+":";return e}};function Q6(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function hee(t,e){let r={};return n=>{let i=n.toString(),s=r[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},r[i]=s),s}}var m2=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="",r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}},Xk=new m2,sh=class extends Sa{constructor(e){var r;super(),this.logging=(r=e==null?void 0:e.logging)!==null&&r!==void 0?r:n=>console.log(n)}initialize(e){this.atn=Jk(e.rules),this.dfas=gee(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=Su(n,"Alternation",r),f=this.atn.decisionMap[c].decision,l=ge(K0({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),p=>ge(p,d=>d[0]));if(ew(l,!1)&&!s){let p=Ur(l,(d,h,g)=>(Pe(h,v=>{v&&(d[v.tokenTypeIdx]=g,Pe(v.categoryMatches,b=>{d[b]=g}))}),d),{});return i?function(d){var h;let g=this.LA(1),v=p[g.tokenTypeIdx];if(d!==void 0&&v!==void 0){let b=(h=d[v])===null||h===void 0?void 0:h.GATE;if(b!==void 0&&b.call(this)===!1)return}return v}:function(){let d=this.LA(1);return p[d.tokenTypeIdx]}}else return i?function(p){let d=new m2,h=p===void 0?0:p.length;for(let v=0;v<h;v++){let b=p==null?void 0:p[v].GATE;d.set(v,b===void 0||b.call(this))}let g=Y6.call(this,o,f,d,a);return typeof g=="number"?g:void 0}:function(){let p=Y6.call(this,o,f,Xk,a);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=Su(n,i,r),f=this.atn.decisionMap[c].decision,l=ge(K0({maxLookahead:1,occurrence:r,prodType:i,rule:n}),p=>ge(p,d=>d[0]));if(ew(l)&&l[0][0]&&!s){let p=l[0],d=nn(p);if(d.length===1&&gt(d[0].categoryMatches)){let g=d[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===g}}else{let h=Ur(d,(g,v)=>(v!==void 0&&(g[v.tokenTypeIdx]=!0,Pe(v.categoryMatches,b=>{g[b]=!0})),g),{});return function(){let g=this.LA(1);return h[g.tokenTypeIdx]===!0}}}return function(){let p=Y6.call(this,o,f,Xk,a);return typeof p=="object"?!1:p===0}}};function ew(t,e=!0){let r=new Set;for(let n of t){let i=new Set;for(let s of n){if(s===void 0){if(e)break;return!1}let o=[s.tokenTypeIdx].concat(s.categoryMatches);for(let a of o)if(r.has(a)){if(!i.has(a))return!1}else r.add(a),i.add(a)}}return!0}function gee(t){let e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=hee(t.decisionStates[n],n);return r}function Y6(t,e,r,n){let i=t[e](r),s=i.start;if(s===void 0){let a=wee(i.atnStartState);s=nw(i,rw(a)),i.start=s}return yee.apply(this,[i,s,r,n])}function yee(t,e,r,n){let i=e,s=1,o=[],a=this.LA(s++);for(;;){let c=Eee(i,a);if(c===void 0&&(c=vee.apply(this,[t,i,a,s,r,n])),c===ih)return See(o,i,a);if(c.isAcceptState===!0)return c.prediction;i=c,o.push(a),a=this.LA(s++)}}function vee(t,e,r,n,i,s){let o=Tee(e.configs,r,i);if(o.size===0)return tw(t,e,r,ih),ih;let a=rw(o),c=kee(o,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(Nee(o)){let u=AC(o.alts);a.isAcceptState=!0,a.prediction=u,a.configs.uniqueAlt=u,xee.apply(this,[t,n,o.alts,s])}return a=tw(t,e,r,a),a}function xee(t,e,r,n){let i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);let s=t.atnStartState,o=s.rule,a=s.production,c=_ee({topLevelRule:o,ambiguityIndices:r,production:a,prefixPath:i});n(c)}function _ee(t){let e=ge(t.prefixPath,i=>xa(i)).join(", "),r=t.production.idx===0?"":t.production.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${bee(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
198
+ <${e}> may appears as a prefix path in all these alternatives.
199
+ `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
200
+ For Further details.`,n}function bee(t){if(t instanceof Zt)return"SUBRULE";if(t instanceof Xt)return"OPTION";if(t instanceof cr)return"OR";if(t instanceof hr)return"AT_LEAST_ONE";if(t instanceof gr)return"AT_LEAST_ONE_SEP";if(t instanceof ar)return"MANY_SEP";if(t instanceof At)return"MANY";if(t instanceof xt)return"CONSUME";throw Error("non exhaustive match")}function See(t,e,r){let n=Un(e.configs.elements,s=>s.state.transitions),i=LC(n.filter(s=>s instanceof bd).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function Eee(t,e){return t.edges[e.tokenTypeIdx]}function Tee(t,e,r){let n=new Cd,i=[];for(let o of t.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===Ed){i.push(o);continue}let a=o.state.transitions.length;for(let c=0;c<a;c++){let u=o.state.transitions[c],f=Cee(u,e);f!==void 0&&n.add({state:f,alt:o.alt,stack:o.stack})}}let s;if(i.length===0&&n.size===1&&(s=n),s===void 0){s=new Cd;for(let o of n.elements)h2(o,s)}if(i.length>0&&!Ree(s))for(let o of i)s.add(o);return s}function Cee(t,e){if(t instanceof bd&&Hm(e,t.tokenType))return t.target}function kee(t,e){let r;for(let n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function rw(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function tw(t,e,r,n){return n=nw(t,n),e.edges[r.tokenTypeIdx]=n,n}function nw(t,e){if(e===ih)return e;let r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function wee(t){let e=new Cd,r=t.transitions.length;for(let n=0;n<r;n++){let s={state:t.transitions[n].target,alt:n,stack:[]};h2(s,e)}return e}function h2(t,e){let r=t.state;if(r.type===Ed){if(t.stack.length>0){let i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};h2(o,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);let n=r.transitions.length;for(let i=0;i<n;i++){let s=r.transitions[i],o=Aee(t,s);o!==void 0&&h2(o,e)}}function Aee(t,e){if(e instanceof nh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Sd){let r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function Ree(t){for(let e of t.elements)if(e.state.type===Ed)return!0;return!1}function Pee(t){for(let e of t.elements)if(e.state.type!==Ed)return!1;return!0}function Nee(t){if(Pee(t))return!0;let e=Oee(t.elements);return Iee(e)&&!Dee(e)}function Oee(t){let e=new Map;for(let r of t){let n=Q6(r,!1),i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function Iee(t){for(let e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function Dee(t){for(let e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var iw;(function(t){function e(r){return typeof r=="string"}t.is=e})(iw||(iw={}));var Z6;(function(t){function e(r){return typeof r=="string"}t.is=e})(Z6||(Z6={}));var sw;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(sw||(sw={}));var g2;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(g2||(g2={}));var Ft;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=g2.MAX_VALUE),i===Number.MAX_VALUE&&(i=g2.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&H.uinteger(i.line)&&H.uinteger(i.character)}t.is=r})(Ft||(Ft={}));var Rt;(function(t){function e(n,i,s,o){if(H.uinteger(n)&&H.uinteger(i)&&H.uinteger(s)&&H.uinteger(o))return{start:Ft.create(n,i),end:Ft.create(s,o)};if(Ft.is(n)&&Ft.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${s}, ${o}]`)}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&Ft.is(i.start)&&Ft.is(i.end)}t.is=r})(Rt||(Rt={}));var y2;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&Rt.is(i.range)&&(H.string(i.uri)||H.undefined(i.uri))}t.is=r})(y2||(y2={}));var ow;(function(t){function e(n,i,s,o){return{targetUri:n,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&Rt.is(i.targetRange)&&H.string(i.targetUri)&&Rt.is(i.targetSelectionRange)&&(Rt.is(i.originSelectionRange)||H.undefined(i.originSelectionRange))}t.is=r})(ow||(ow={}));var X6;(function(t){function e(n,i,s,o){return{red:n,green:i,blue:s,alpha:o}}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&H.numberRange(i.red,0,1)&&H.numberRange(i.green,0,1)&&H.numberRange(i.blue,0,1)&&H.numberRange(i.alpha,0,1)}t.is=r})(X6||(X6={}));var aw;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&Rt.is(i.range)&&X6.is(i.color)}t.is=r})(aw||(aw={}));var cw;(function(t){function e(n,i,s){return{label:n,textEdit:i,additionalTextEdits:s}}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&H.string(i.label)&&(H.undefined(i.textEdit)||yc.is(i))&&(H.undefined(i.additionalTextEdits)||H.typedArray(i.additionalTextEdits,yc.is))}t.is=r})(cw||(cw={}));var uw;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(uw||(uw={}));var lw;(function(t){function e(n,i,s,o,a,c){let u={startLine:n,endLine:i};return H.defined(s)&&(u.startCharacter=s),H.defined(o)&&(u.endCharacter=o),H.defined(a)&&(u.kind=a),H.defined(c)&&(u.collapsedText=c),u}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&H.uinteger(i.startLine)&&H.uinteger(i.startLine)&&(H.undefined(i.startCharacter)||H.uinteger(i.startCharacter))&&(H.undefined(i.endCharacter)||H.uinteger(i.endCharacter))&&(H.undefined(i.kind)||H.string(i.kind))}t.is=r})(lw||(lw={}));var e9;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return H.defined(i)&&y2.is(i.location)&&H.string(i.message)}t.is=r})(e9||(e9={}));var fw;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(fw||(fw={}));var dw;(function(t){t.Unnecessary=1,t.Deprecated=2})(dw||(dw={}));var pw;(function(t){function e(r){let n=r;return H.objectLiteral(n)&&H.string(n.href)}t.is=e})(pw||(pw={}));var v2;(function(t){function e(n,i,s,o,a,c){let u={range:n,message:i};return H.defined(s)&&(u.severity=s),H.defined(o)&&(u.code=o),H.defined(a)&&(u.source=a),H.defined(c)&&(u.relatedInformation=c),u}t.create=e;function r(n){var i;let s=n;return H.defined(s)&&Rt.is(s.range)&&H.string(s.message)&&(H.number(s.severity)||H.undefined(s.severity))&&(H.integer(s.code)||H.string(s.code)||H.undefined(s.code))&&(H.undefined(s.codeDescription)||H.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(H.string(s.source)||H.undefined(s.source))&&(H.undefined(s.relatedInformation)||H.typedArray(s.relatedInformation,e9.is))}t.is=r})(v2||(v2={}));var kd;(function(t){function e(n,i,...s){let o={title:n,command:i};return H.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function r(n){let i=n;return H.defined(i)&&H.string(i.title)&&H.string(i.command)}t.is=r})(kd||(kd={}));var yc;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function r(s,o){return{range:{start:s,end:s},newText:o}}t.insert=r;function n(s){return{range:s,newText:""}}t.del=n;function i(s){let o=s;return H.objectLiteral(o)&&H.string(o.newText)&&Rt.is(o.range)}t.is=i})(yc||(yc={}));var t9;(function(t){function e(n,i,s){let o={label:n};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&H.string(i.label)&&(H.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(H.string(i.description)||i.description===void 0)}t.is=r})(t9||(t9={}));var wd;(function(t){function e(r){let n=r;return H.string(n)}t.is=e})(wd||(wd={}));var mw;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function r(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}t.del=n;function i(s){let o=s;return yc.is(o)&&(t9.is(o.annotationId)||wd.is(o.annotationId))}t.is=i})(mw||(mw={}));var r9;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return H.defined(i)&&a9.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(r9||(r9={}));var n9;(function(t){function e(n,i,s){let o={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&H.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||H.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||H.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||wd.is(i.annotationId))}t.is=r})(n9||(n9={}));var i9;(function(t){function e(n,i,s,o){let a={kind:"rename",oldUri:n,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&H.string(i.oldUri)&&H.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||H.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||H.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||wd.is(i.annotationId))}t.is=r})(i9||(i9={}));var s9;(function(t){function e(n,i,s){let o={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&H.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||H.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||H.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||wd.is(i.annotationId))}t.is=r})(s9||(s9={}));var o9;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>H.string(i.kind)?n9.is(i)||i9.is(i)||s9.is(i):r9.is(i)))}t.is=e})(o9||(o9={}));var hw;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return H.defined(i)&&H.string(i.uri)}t.is=r})(hw||(hw={}));var gw;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return H.defined(i)&&H.string(i.uri)&&H.integer(i.version)}t.is=r})(gw||(gw={}));var a9;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return H.defined(i)&&H.string(i.uri)&&(i.version===null||H.integer(i.version))}t.is=r})(a9||(a9={}));var yw;(function(t){function e(n,i,s,o){return{uri:n,languageId:i,version:s,text:o}}t.create=e;function r(n){let i=n;return H.defined(i)&&H.string(i.uri)&&H.string(i.languageId)&&H.integer(i.version)&&H.string(i.text)}t.is=r})(yw||(yw={}));var c9;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(c9||(c9={}));var oh;(function(t){function e(r){let n=r;return H.objectLiteral(r)&&c9.is(n.kind)&&H.string(n.value)}t.is=e})(oh||(oh={}));var vw;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(vw||(vw={}));var xw;(function(t){t.PlainText=1,t.Snippet=2})(xw||(xw={}));var _w;(function(t){t.Deprecated=1})(_w||(_w={}));var bw;(function(t){function e(n,i,s){return{newText:n,insert:i,replace:s}}t.create=e;function r(n){let i=n;return i&&H.string(i.newText)&&Rt.is(i.insert)&&Rt.is(i.replace)}t.is=r})(bw||(bw={}));var Sw;(function(t){t.asIs=1,t.adjustIndentation=2})(Sw||(Sw={}));var Ew;(function(t){function e(r){let n=r;return n&&(H.string(n.detail)||n.detail===void 0)&&(H.string(n.description)||n.description===void 0)}t.is=e})(Ew||(Ew={}));var Tw;(function(t){function e(r){return{label:r}}t.create=e})(Tw||(Tw={}));var Cw;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(Cw||(Cw={}));var x2;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){let i=n;return H.string(i)||H.objectLiteral(i)&&H.string(i.language)&&H.string(i.value)}t.is=r})(x2||(x2={}));var kw;(function(t){function e(r){let n=r;return!!n&&H.objectLiteral(n)&&(oh.is(n.contents)||x2.is(n.contents)||H.typedArray(n.contents,x2.is))&&(r.range===void 0||Rt.is(r.range))}t.is=e})(kw||(kw={}));var ww;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(ww||(ww={}));var Aw;(function(t){function e(r,n,...i){let s={label:r};return H.defined(n)&&(s.documentation=n),H.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(Aw||(Aw={}));var Rw;(function(t){t.Text=1,t.Read=2,t.Write=3})(Rw||(Rw={}));var Pw;(function(t){function e(r,n){let i={range:r};return H.number(n)&&(i.kind=n),i}t.create=e})(Pw||(Pw={}));var Nw;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Nw||(Nw={}));var Ow;(function(t){t.Deprecated=1})(Ow||(Ow={}));var Iw;(function(t){function e(r,n,i,s,o){let a={name:r,kind:n,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(Iw||(Iw={}));var Dw;(function(t){function e(r,n,i,s){return s!==void 0?{name:r,kind:n,location:{uri:i,range:s}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(Dw||(Dw={}));var Lw;(function(t){function e(n,i,s,o,a,c){let u={name:n,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(u.children=c),u}t.create=e;function r(n){let i=n;return i&&H.string(i.name)&&H.number(i.kind)&&Rt.is(i.range)&&Rt.is(i.selectionRange)&&(i.detail===void 0||H.string(i.detail))&&(i.deprecated===void 0||H.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(Lw||(Lw={}));var $w;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})($w||($w={}));var _2;(function(t){t.Invoked=1,t.Automatic=2})(_2||(_2={}));var Mw;(function(t){function e(n,i,s){let o={diagnostics:n};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function r(n){let i=n;return H.defined(i)&&H.typedArray(i.diagnostics,v2.is)&&(i.only===void 0||H.typedArray(i.only,H.string))&&(i.triggerKind===void 0||i.triggerKind===_2.Invoked||i.triggerKind===_2.Automatic)}t.is=r})(Mw||(Mw={}));var Fw;(function(t){function e(n,i,s){let o={title:n},a=!0;return typeof i=="string"?(a=!1,o.kind=i):kd.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return i&&H.string(i.title)&&(i.diagnostics===void 0||H.typedArray(i.diagnostics,v2.is))&&(i.kind===void 0||H.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||kd.is(i.command))&&(i.isPreferred===void 0||H.boolean(i.isPreferred))&&(i.edit===void 0||o9.is(i.edit))}t.is=r})(Fw||(Fw={}));var Vw;(function(t){function e(n,i){let s={range:n};return H.defined(i)&&(s.data=i),s}t.create=e;function r(n){let i=n;return H.defined(i)&&Rt.is(i.range)&&(H.undefined(i.command)||kd.is(i.command))}t.is=r})(Vw||(Vw={}));var jw;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return H.defined(i)&&H.uinteger(i.tabSize)&&H.boolean(i.insertSpaces)}t.is=r})(jw||(jw={}));var Uw;(function(t){function e(n,i,s){return{range:n,target:i,data:s}}t.create=e;function r(n){let i=n;return H.defined(i)&&Rt.is(i.range)&&(H.undefined(i.target)||H.string(i.target))}t.is=r})(Uw||(Uw={}));var qw;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&Rt.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(qw||(qw={}));var Bw;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Bw||(Bw={}));var Hw;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Hw||(Hw={}));var zw;(function(t){function e(r){let n=r;return H.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(zw||(zw={}));var Ww;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&Rt.is(i.range)&&H.string(i.text)}t.is=r})(Ww||(Ww={}));var Kw;(function(t){function e(n,i,s){return{range:n,variableName:i,caseSensitiveLookup:s}}t.create=e;function r(n){let i=n;return i!=null&&Rt.is(i.range)&&H.boolean(i.caseSensitiveLookup)&&(H.string(i.variableName)||i.variableName===void 0)}t.is=r})(Kw||(Kw={}));var Gw;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&Rt.is(i.range)&&(H.string(i.expression)||i.expression===void 0)}t.is=r})(Gw||(Gw={}));var Jw;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return H.defined(i)&&Rt.is(n.stoppedLocation)}t.is=r})(Jw||(Jw={}));var u9;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(u9||(u9={}));var l9;(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&(i.tooltip===void 0||H.string(i.tooltip)||oh.is(i.tooltip))&&(i.location===void 0||y2.is(i.location))&&(i.command===void 0||kd.is(i.command))}t.is=r})(l9||(l9={}));var Qw;(function(t){function e(n,i,s){let o={position:n,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return H.objectLiteral(i)&&Ft.is(i.position)&&(H.string(i.label)||H.typedArray(i.label,l9.is))&&(i.kind===void 0||u9.is(i.kind))&&i.textEdits===void 0||H.typedArray(i.textEdits,yc.is)&&(i.tooltip===void 0||H.string(i.tooltip)||oh.is(i.tooltip))&&(i.paddingLeft===void 0||H.boolean(i.paddingLeft))&&(i.paddingRight===void 0||H.boolean(i.paddingRight))}t.is=r})(Qw||(Qw={}));var Yw;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(Yw||(Yw={}));var Zw;(function(t){function e(r,n,i,s){return{insertText:r,filterText:n,range:i,command:s}}t.create=e})(Zw||(Zw={}));var Xw;(function(t){function e(r){return{items:r}}t.create=e})(Xw||(Xw={}));var eA;(function(t){t.Invoked=0,t.Automatic=1})(eA||(eA={}));var tA;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(tA||(tA={}));var rA;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(rA||(rA={}));var nA;(function(t){function e(r){let n=r;return H.objectLiteral(n)&&Z6.is(n.uri)&&H.string(n.name)}t.is=e})(nA||(nA={}));var iA;(function(t){function e(s,o,a,c){return new f9(s,o,a,c)}t.create=e;function r(s){let o=s;return!!(H.defined(o)&&H.string(o.uri)&&(H.undefined(o.languageId)||H.string(o.languageId))&&H.uinteger(o.lineCount)&&H.func(o.getText)&&H.func(o.positionAt)&&H.func(o.offsetAt))}t.is=r;function n(s,o){let a=s.getText(),c=i(o,(f,l)=>{let p=f.range.start.line-l.range.start.line;return p===0?f.range.start.character-l.range.start.character:p}),u=a.length;for(let f=c.length-1;f>=0;f--){let l=c[f],p=s.offsetAt(l.range.start),d=s.offsetAt(l.range.end);if(d<=u)a=a.substring(0,p)+l.newText+a.substring(d,a.length);else throw new Error("Overlapping edit");u=p}return a}t.applyEdits=n;function i(s,o){if(s.length<=1)return s;let a=s.length/2|0,c=s.slice(0,a),u=s.slice(a);i(c,o),i(u,o);let f=0,l=0,p=0;for(;f<c.length&&l<u.length;)o(c[f],u[l])<=0?s[p++]=c[f++]:s[p++]=u[l++];for(;f<c.length;)s[p++]=c[f++];for(;l<u.length;)s[p++]=u[l++];return s}})(iA||(iA={}));var f9=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let s=r.charAt(i);n=s==="\r"||s===`
201
+ `,s==="\r"&&i+1<r.length&&r.charAt(i+1)===`
202
+ `&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return Ft.create(0,e);for(;n<i;){let o=Math.floor((n+i)/2);r[o]>e?i=o:n=o+1}let s=n-1;return Ft.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}},H;(function(t){let e=Object.prototype.toString;function r(d){return typeof d!="undefined"}t.defined=r;function n(d){return typeof d=="undefined"}t.undefined=n;function i(d){return d===!0||d===!1}t.boolean=i;function s(d){return e.call(d)==="[object String]"}t.string=s;function o(d){return e.call(d)==="[object Number]"}t.number=o;function a(d,h,g){return e.call(d)==="[object Number]"&&h<=d&&d<=g}t.numberRange=a;function c(d){return e.call(d)==="[object Number]"&&-2147483648<=d&&d<=2147483647}t.integer=c;function u(d){return e.call(d)==="[object Number]"&&0<=d&&d<=2147483647}t.uinteger=u;function f(d){return e.call(d)==="[object Function]"}t.func=f;function l(d){return d!==null&&typeof d=="object"}t.objectLiteral=l;function p(d,h){return Array.isArray(d)&&d.every(h)}t.typedArray=p})(H||(H={}));var ah=class{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new Ad(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let r=new Cu;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){let n=new Tu(e.startOffset,e.image.length,Kl(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let r=e.container;if(r){let n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){let r=[];for(let s of e){let o=new Tu(s.startOffset,s.image.length,Kl(s),s.tokenType,!0);o.root=this.rootNode,r.push(o)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){let s=n.container.content.indexOf(n);if(s>0){n.container.content.splice(s,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){let r=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=r;let n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},ch=class{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,r;let n=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(r=this.container)===null||r===void 0?void 0:r.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}},Tu=class extends ch{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},Cu=class extends ch{constructor(){super(...arguments),this.content=new d9(this)}get children(){return this.content}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:Ft.create(0,0),end:Ft.create(0,0)}}get firstNonHiddenNode(){for(let e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){let r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},d9=class t extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,t.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(let r of e)r.container=this.parent}},Ad=class extends Cu{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e!=null?e:""}};var b2=Symbol("Datatype");function p9(t){return t.$type===b2}var sA="\u200B",oA=t=>t.endsWith(sA)?t:t+sA,uh=class{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;let r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";this.wrapper=new m9(r,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},lh=class extends uh{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new ah,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){let n=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(oA(e.name),this.startImplementation(n,r).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(Dm(e))return b2;{let r=Co(e);return r!=null?r:e.name}}}parse(e,r={}){this.nodeBuilder.buildRootNode(e);let n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;let i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");let s=this.doParse(i);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:s,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}doParse(e){let r=e.call(this.wrapper,{});if(this.stack.length>0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r){return n=>{let i=!this.isRecording()&&e!==void 0;if(i){let s={$type:e};this.stack.push(s),e===b2&&(s.value="")}return r(n),i?this.construct():void 0}}extractHiddenTokens(e){let r=this.lexerResult.hidden;if(!r.length)return[];let n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){let i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){let s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);let o=this.nodeBuilder.buildLeafNode(i,n),{assignment:a,isCrossRef:c}=this.getAssignment(n),u=this.current;if(a){let f=Sn(n)?i.image:this.converter.convert(i.image,o);this.assign(a.operator,a.feature,f,o,c)}else if(p9(u)){let f=i.image;Sn(n)||(f=this.converter.convert(f,o).toString()),u.value+=f}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,s){let o;!this.isRecording()&&!n&&(o=this.nodeBuilder.buildCompositeNode(i));let a;try{a=this.wrapper.wrapSubrule(e,r,s)}finally{this.isRecording()||(a===void 0&&!n&&(a=this.construct()),a!==void 0&&o&&o.length>0&&this.performSubruleAssignment(a,i,o))}}performSubruleAssignment(e,r,n){let{assignment:i,isCrossRef:s}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,s);else if(!i){let o=this.current;if(p9(o))o.value+=e.toString();else if(typeof e=="object"&&e){let c=this.assignWithoutOverride(e,o);this.stack.pop(),this.stack.push(c)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);let s={$type:e};this.stack.push(s),this.assign(r.operator,r.feature,n,n.$cstNode,!1)}else n.$type=e}}construct(){if(this.isRecording())return;let e=this.current;return Zg(e),this.nodeBuilder.construct(e),this.stack.pop(),p9(e)?this.converter.convert(e.value,e.$cstNode):(Tm(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){let r=ss(e,Yn);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?is(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,s){let o=this.current,a;switch(s&&typeof n=="string"?a=this.linker.buildReference(o,r,i,n):a=n,e){case"=":{o[r]=a;break}case"?=":{o[r]=!0;break}case"+=":Array.isArray(o[r])||(o[r]=[]),o[r].push(a)}}assignWithoutOverride(e,r){for(let[i,s]of Object.entries(r)){let o=e[i];o===void 0?e[i]=s:Array.isArray(o)&&Array.isArray(s)&&(s.push(...o),e[i]=s)}let n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},S2=class{buildMismatchTokenMessage(e){return ba.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return ba.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return ba.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return ba.buildEarlyExitMessage(e)}},Rd=class extends S2{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}\`.`}},fh=class extends uh{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,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){let n=this.wrapper.DEFINE_RULE(oA(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{let n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,s){this.before(i),this.wrapper.wrapSubrule(e,r,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},Lee={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Rd},m9=class extends th{constructor(e,r){let n=r&&"maxLookahead"in r;super(e,Object.assign(Object.assign(Object.assign({},Lee),{lookaheadStrategy:n?new Sa({maxLookahead:r.maxLookahead}):new sh({logging:r.skipValidations?()=>{}:void 0})}),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}};function dh(t,e,r){return $ee({parser:e,tokens:r,ruleNames:new Map},t),e}function $ee(t,e){let r=Pm(e,!1),n=nt(e.rules).filter(Ar).filter(i=>r.has(i));for(let i of n){let s=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,ku(s,i.definition))}}function ku(t,e,r=!1){let n;if(Sn(e))n=Bee(t,e);else if(ro(e))n=Mee(t,e);else if(Yn(e))n=ku(t,e.terminal);else if(is(e))n=aA(t,e);else if(Ri(e))n=Fee(t,e);else if(Df(e))n=jee(t,e);else if(Lf(e))n=Uee(t,e);else if(ks(e))n=qee(t,e);else if(U8(e)){let i=t.consume++;n=()=>t.parser.consume(i,cs,e)}else throw new su(e.$cstNode,`Unexpected element type: ${e.$type}`);return cA(t,r?void 0:E2(e),n,e.cardinality)}function Mee(t,e){let r=hu(e);return()=>t.parser.action(r,e)}function Fee(t,e){let r=e.rule.ref;if(Ar(r)){let n=t.subrule++,i=r.fragment,s=e.arguments.length>0?Vee(r,e.arguments):()=>({});return o=>t.parser.subrule(n,uA(t,r),i,e,s(o))}else if(pi(r)){let n=t.consume++,i=h9(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Eo(r);else throw new su(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function Vee(t,e){let r=e.map(n=>Ea(n.value));return n=>{let i={};for(let s=0;s<r.length;s++){let o=t.parameters[s],a=r[s];i[o.name]=a(n)}return i}}function Ea(t){if(D8(t)){let e=Ea(t.left),r=Ea(t.right);return n=>e(n)||r(n)}else if(I8(t)){let e=Ea(t.left),r=Ea(t.right);return n=>e(n)&&r(n)}else if(L8(t)){let e=Ea(t.value);return r=>!e(r)}else if($8(t)){let e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(O8(t)){let e=!!t.true;return()=>e}Eo(t)}function jee(t,e){if(e.elements.length===1)return ku(t,e.elements[0]);{let r=[];for(let i of e.elements){let s={ALT:ku(t,i,!0)},o=E2(i);o&&(s.GATE=Ea(o)),r.push(s)}let n=t.or++;return i=>t.parser.alternatives(n,r.map(s=>{let o={ALT:()=>s.ALT(i)},a=s.GATE;return a&&(o.GATE=()=>a(i)),o}))}}function Uee(t,e){if(e.elements.length===1)return ku(t,e.elements[0]);let r=[];for(let a of e.elements){let c={ALT:ku(t,a,!0)},u=E2(a);u&&(c.GATE=Ea(u)),r.push(c)}let n=t.or++,i=(a,c)=>{let u=c.getRuleStack().join("-");return`uGroup_${a}_${u}`},s=a=>t.parser.alternatives(n,r.map((c,u)=>{let f={ALT:()=>!0},l=t.parser;f.ALT=()=>{if(c.ALT(a),!l.isRecording()){let d=i(n,l);l.unorderedGroups.get(d)||l.unorderedGroups.set(d,[]);let h=l.unorderedGroups.get(d);typeof(h==null?void 0:h[u])=="undefined"&&(h[u]=!0)}};let p=c.GATE;return p?f.GATE=()=>p(a):f.GATE=()=>{let d=l.unorderedGroups.get(i(n,l));return!(d!=null&&d[u])},f})),o=cA(t,E2(e),s,"*");return a=>{o(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function qee(t,e){let r=e.elements.map(n=>ku(t,n));return n=>r.forEach(i=>i(n))}function E2(t){if(ks(t))return t.guardCondition}function aA(t,e,r=e.terminal){if(r)if(Ri(r)&&Ar(r.rule.ref)){let n=r.rule.ref,i=t.subrule++;return s=>t.parser.subrule(i,uA(t,n),!1,e,s)}else if(Ri(r)&&pi(r.rule.ref)){let n=t.consume++,i=h9(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Sn(r)){let n=t.consume++,i=h9(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);let n=r0(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+hu(e.type.ref));return aA(t,e,i)}}function Bee(t,e){let r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function cA(t,e,r,n){let i=e&&Ea(e);if(!n)if(i){let s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>r(o),GATE:()=>i(o)},{ALT:p2(),GATE:()=>!i(o)}])}else return r;if(n==="*"){let s=t.many++;return o=>t.parser.many(s,{DEF:()=>r(o),GATE:i?()=>i(o):void 0})}else if(n==="+"){let s=t.many++;if(i){let o=t.or++;return a=>t.parser.alternatives(o,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>r(a)}),GATE:()=>i(a)},{ALT:p2(),GATE:()=>!i(a)}])}else return o=>t.parser.atLeastOne(s,{DEF:()=>r(o)})}else if(n==="?"){let s=t.optional++;return o=>t.parser.optional(s,{DEF:()=>r(o),GATE:i?()=>i(o):void 0})}else Eo(n)}function uA(t,e){let r=Hee(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function Hee(t,e){if(Ar(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ar(n);)(ks(n)||Df(n)||Lf(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 h9(t,e){let r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function g9(t){let e=t.Grammar,r=t.parser.Lexer,n=new fh(t);return dh(e,n,r.definition),n.finalize(),n}function y9(t){let e=lA(t);return e.finalize(),e}function lA(t){let e=t.Grammar,r=t.parser.Lexer,n=new lh(t);return dh(e,n,r.definition)}var wu=class{constructor(){this.diagnostics=[]}buildTokens(e,r){let n=nt(Pm(e,!1)),i=this.buildTerminalTokens(n),s=this.buildKeywordTokens(n,i,r);return s.push(...i),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(pi).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){let r=Za(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Am(r)?Nr.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){let r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Ar).flatMap(i=>os(i).filter(Sn)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){let i=this.buildKeywordPattern(e,n),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,r){return r?new RegExp(Ya(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{let s=i==null?void 0:i.PATTERN;return s!=null&&s.source&&t6("^"+s.source+"$",e.value)&&n.push(i),n},[])}};var ph=class{convert(e,r){let n=r.grammarSource;if(is(n)&&(n=Nm(n)),Ri(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 Fo.convertInt(r);case"STRING":return Fo.convertString(r);case"ID":return Fo.convertID(r)}switch((i=l6(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return Fo.convertNumber(r);case"boolean":return Fo.convertBoolean(r);case"bigint":return Fo.convertBigint(r);case"date":return Fo.convertDate(r);default:return r}}},Fo;(function(t){function e(u){let f="";for(let l=1;l<u.length-1;l++){let p=u.charAt(l);if(p==="\\"){let d=u.charAt(++l);f+=r(d)}else f+=p}return f}t.convertString=e;function r(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
203
+ `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}function n(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=n;function i(u){return parseInt(u)}t.convertInt=i;function s(u){return BigInt(u)}t.convertBigint=s;function o(u){return new Date(u)}t.convertDate=o;function a(u){return Number(u)}t.convertNumber=a;function c(u){return u.toLowerCase()==="true"}t.convertBoolean=c})(Fo||(Fo={}));var ye={};Ot(ye,ke(mh(),1));function T9(){return new Promise(t=>{typeof setImmediate=="undefined"?setTimeout(t,0):setImmediate(t)})}var w2=0,mA=10;function A2(){return w2=performance.now(),new ye.CancellationTokenSource}function hA(t){mA=t}var Vo=Symbol("OperationCancelled");function jo(t){return t===Vo}async function it(t){if(t===ye.CancellationToken.None)return;let e=performance.now();if(e-w2>=mA&&(w2=e,await T9(),w2=performance.now()),t.isCancellationRequested)throw Vo}var qn=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}};var R2=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=vA(n.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),u=this._lineOffsets,f=gA(n.text,!1,s);if(c-a===f.length)for(let p=0,d=f.length;p<d;p++)u[p+a+1]=f[p];else f.length<1e4?u.splice(a+1,c-a,...f):this._lineOffsets=u=u.slice(0,a+1).concat(f,u.slice(c+1));let l=n.text.length-(o-s);if(l!==0)for(let p=a+1+f.length,d=u.length;p<d;p++)u[p]=u[p]+l}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=gA(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let o=Math.floor((n+i)/2);r[o]>e?i=o:n=o+1}let s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let i=e.line+1<r.length?r[e.line+1]:this._content.length,s=Math.min(n+e.character,i);return this.ensureBeforeEOL(s,n)}ensureBeforeEOL(e,r){for(;e>r&&yA(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},xc;(function(t){function e(i,s,o,a){return new R2(i,s,o,a)}t.create=e;function r(i,s,o){if(i instanceof R2)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,s){let o=i.getText(),a=C9(s.map(ete),(f,l)=>{let p=f.range.start.line-l.range.start.line;return p===0?f.range.start.character-l.range.start.character:p}),c=0,u=[];for(let f of a){let l=i.offsetAt(f.range.start);if(l<c)throw new Error("Overlapping edit");l>c&&u.push(o.substring(c,l)),f.newText.length&&u.push(f.newText),c=i.offsetAt(f.range.end)}return u.push(o.substr(c)),u.join("")}t.applyEdits=n})(xc||(xc={}));function C9(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);C9(n,e),C9(i,e);let s=0,o=0,a=0;for(;s<n.length&&o<i.length;)e(n[s],i[o])<=0?t[a++]=n[s++]:t[a++]=i[o++];for(;s<n.length;)t[a++]=n[s++];for(;o<i.length;)t[a++]=i[o++];return t}function gA(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);yA(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function yA(t){return t===13||t===10}function vA(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function ete(t){let e=vA(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var xA;(()=>{"use strict";var t={470:i=>{function s(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}function o(c,u){for(var f,l="",p=0,d=-1,h=0,g=0;g<=c.length;++g){if(g<c.length)f=c.charCodeAt(g);else{if(f===47)break;f=47}if(f===47){if(!(d===g-1||h===1))if(d!==g-1&&h===2){if(l.length<2||p!==2||l.charCodeAt(l.length-1)!==46||l.charCodeAt(l.length-2)!==46){if(l.length>2){var v=l.lastIndexOf("/");if(v!==l.length-1){v===-1?(l="",p=0):p=(l=l.slice(0,v)).length-1-l.lastIndexOf("/"),d=g,h=0;continue}}else if(l.length===2||l.length===1){l="",p=0,d=g,h=0;continue}}u&&(l.length>0?l+="/..":l="..",p=2)}else l.length>0?l+="/"+c.slice(d+1,g):l=c.slice(d+1,g),p=g-d-1;d=g,h=0}else f===46&&h!==-1?++h:h=-1}return l}var a={resolve:function(){for(var c,u="",f=!1,l=arguments.length-1;l>=-1&&!f;l--){var p;l>=0?p=arguments[l]:(c===void 0&&(c=process.cwd()),p=c),s(p),p.length!==0&&(u=p+"/"+u,f=p.charCodeAt(0)===47)}return u=o(u,!f),f?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(c){if(s(c),c.length===0)return".";var u=c.charCodeAt(0)===47,f=c.charCodeAt(c.length-1)===47;return(c=o(c,!u)).length!==0||u||(c="."),c.length>0&&f&&(c+="/"),u?"/"+c:c},isAbsolute:function(c){return s(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,u=0;u<arguments.length;++u){var f=arguments[u];s(f),f.length>0&&(c===void 0?c=f:c+="/"+f)}return c===void 0?".":a.normalize(c)},relative:function(c,u){if(s(c),s(u),c===u||(c=a.resolve(c))===(u=a.resolve(u)))return"";for(var f=1;f<c.length&&c.charCodeAt(f)===47;++f);for(var l=c.length,p=l-f,d=1;d<u.length&&u.charCodeAt(d)===47;++d);for(var h=u.length-d,g=p<h?p:h,v=-1,b=0;b<=g;++b){if(b===g){if(h>g){if(u.charCodeAt(d+b)===47)return u.slice(d+b+1);if(b===0)return u.slice(d+b)}else p>g&&(c.charCodeAt(f+b)===47?v=b:b===0&&(v=0));break}var _=c.charCodeAt(f+b);if(_!==u.charCodeAt(d+b))break;_===47&&(v=b)}var x="";for(b=f+v+1;b<=l;++b)b!==l&&c.charCodeAt(b)!==47||(x.length===0?x+="..":x+="/..");return x.length>0?x+u.slice(d+v):(d+=v,u.charCodeAt(d)===47&&++d,u.slice(d))},_makeLong:function(c){return c},dirname:function(c){if(s(c),c.length===0)return".";for(var u=c.charCodeAt(0),f=u===47,l=-1,p=!0,d=c.length-1;d>=1;--d)if((u=c.charCodeAt(d))===47){if(!p){l=d;break}}else p=!1;return l===-1?f?"/":".":f&&l===1?"//":c.slice(0,l)},basename:function(c,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');s(c);var f,l=0,p=-1,d=!0;if(u!==void 0&&u.length>0&&u.length<=c.length){if(u.length===c.length&&u===c)return"";var h=u.length-1,g=-1;for(f=c.length-1;f>=0;--f){var v=c.charCodeAt(f);if(v===47){if(!d){l=f+1;break}}else g===-1&&(d=!1,g=f+1),h>=0&&(v===u.charCodeAt(h)?--h==-1&&(p=f):(h=-1,p=g))}return l===p?p=g:p===-1&&(p=c.length),c.slice(l,p)}for(f=c.length-1;f>=0;--f)if(c.charCodeAt(f)===47){if(!d){l=f+1;break}}else p===-1&&(d=!1,p=f+1);return p===-1?"":c.slice(l,p)},extname:function(c){s(c);for(var u=-1,f=0,l=-1,p=!0,d=0,h=c.length-1;h>=0;--h){var g=c.charCodeAt(h);if(g!==47)l===-1&&(p=!1,l=h+1),g===46?u===-1?u=h:d!==1&&(d=1):u!==-1&&(d=-1);else if(!p){f=h+1;break}}return u===-1||l===-1||d===0||d===1&&u===l-1&&u===f+1?"":c.slice(u,l)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return function(u,f){var l=f.dir||f.root,p=f.base||(f.name||"")+(f.ext||"");return l?l===f.root?l+p:l+"/"+p:p}(0,c)},parse:function(c){s(c);var u={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return u;var f,l=c.charCodeAt(0),p=l===47;p?(u.root="/",f=1):f=0;for(var d=-1,h=0,g=-1,v=!0,b=c.length-1,_=0;b>=f;--b)if((l=c.charCodeAt(b))!==47)g===-1&&(v=!1,g=b+1),l===46?d===-1?d=b:_!==1&&(_=1):d!==-1&&(_=-1);else if(!v){h=b+1;break}return d===-1||g===-1||_===0||_===1&&d===g-1&&d===h+1?g!==-1&&(u.base=u.name=h===0&&p?c.slice(1,g):c.slice(h,g)):(h===0&&p?(u.name=c.slice(1,d),u.base=c.slice(1,g)):(u.name=c.slice(h,d),u.base=c.slice(h,g)),u.ext=c.slice(d,g)),h>0?u.dir=c.slice(0,h-1):p&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a}},e={};function r(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,r),o.exports}r.d=(i,s)=>{for(var o in s)r.o(s,o)&&!r.o(i,o)&&Object.defineProperty(i,o,{enumerable:!0,get:s[o]})},r.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),r.r=i=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;r.r(n),r.d(n,{URI:()=>p,Utils:()=>W}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,o=/^\//,a=/^\/\//;function c(D,P){if(!D.scheme&&P)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${D.authority}", path: "${D.path}", query: "${D.query}", fragment: "${D.fragment}"}`);if(D.scheme&&!s.test(D.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(D.path){if(D.authority){if(!o.test(D.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(D.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let u="",f="/",l=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class p{constructor(P,M,j,J,te,re=!1){wt(this,"scheme");wt(this,"authority");wt(this,"path");wt(this,"query");wt(this,"fragment");typeof P=="object"?(this.scheme=P.scheme||u,this.authority=P.authority||u,this.path=P.path||u,this.query=P.query||u,this.fragment=P.fragment||u):(this.scheme=function(we,Q){return we||Q?we:"file"}(P,re),this.authority=M||u,this.path=function(we,Q){switch(we){case"https":case"http":case"file":Q?Q[0]!==f&&(Q=f+Q):Q=f}return Q}(this.scheme,j||u),this.query=J||u,this.fragment=te||u,c(this,re))}static isUri(P){return P instanceof p||!!P&&typeof P.authority=="string"&&typeof P.fragment=="string"&&typeof P.path=="string"&&typeof P.query=="string"&&typeof P.scheme=="string"&&typeof P.fsPath=="string"&&typeof P.with=="function"&&typeof P.toString=="function"}get fsPath(){return _(this,!1)}with(P){if(!P)return this;let{scheme:M,authority:j,path:J,query:te,fragment:re}=P;return M===void 0?M=this.scheme:M===null&&(M=u),j===void 0?j=this.authority:j===null&&(j=u),J===void 0?J=this.path:J===null&&(J=u),te===void 0?te=this.query:te===null&&(te=u),re===void 0?re=this.fragment:re===null&&(re=u),M===this.scheme&&j===this.authority&&J===this.path&&te===this.query&&re===this.fragment?this:new h(M,j,J,te,re)}static parse(P,M=!1){let j=l.exec(P);return j?new h(j[2]||u,V(j[4]||u),V(j[5]||u),V(j[7]||u),V(j[9]||u),M):new h(u,u,u,u,u)}static file(P){let M=u;if(i&&(P=P.replace(/\\/g,f)),P[0]===f&&P[1]===f){let j=P.indexOf(f,2);j===-1?(M=P.substring(2),P=f):(M=P.substring(2,j),P=P.substring(j)||f)}return new h("file",M,P,u,u)}static from(P){let M=new h(P.scheme,P.authority,P.path,P.query,P.fragment);return c(M,!0),M}toString(P=!1){return x(this,P)}toJSON(){return this}static revive(P){if(P){if(P instanceof p)return P;{let M=new h(P);return M._formatted=P.external,M._fsPath=P._sep===d?P.fsPath:null,M}}return P}}let d=i?1:void 0;class h extends p{constructor(){super(...arguments);wt(this,"_formatted",null);wt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=_(this,!1)),this._fsPath}toString(M=!1){return M?x(this,!0):(this._formatted||(this._formatted=x(this,!1)),this._formatted)}toJSON(){let M={$mid:1};return this._fsPath&&(M.fsPath=this._fsPath,M._sep=d),this._formatted&&(M.external=this._formatted),this.path&&(M.path=this.path),this.scheme&&(M.scheme=this.scheme),this.authority&&(M.authority=this.authority),this.query&&(M.query=this.query),this.fragment&&(M.fragment=this.fragment),M}}let g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function v(D,P,M){let j,J=-1;for(let te=0;te<D.length;te++){let re=D.charCodeAt(te);if(re>=97&&re<=122||re>=65&&re<=90||re>=48&&re<=57||re===45||re===46||re===95||re===126||P&&re===47||M&&re===91||M&&re===93||M&&re===58)J!==-1&&(j+=encodeURIComponent(D.substring(J,te)),J=-1),j!==void 0&&(j+=D.charAt(te));else{j===void 0&&(j=D.substr(0,te));let we=g[re];we!==void 0?(J!==-1&&(j+=encodeURIComponent(D.substring(J,te)),J=-1),j+=we):J===-1&&(J=te)}}return J!==-1&&(j+=encodeURIComponent(D.substring(J))),j!==void 0?j:D}function b(D){let P;for(let M=0;M<D.length;M++){let j=D.charCodeAt(M);j===35||j===63?(P===void 0&&(P=D.substr(0,M)),P+=g[j]):P!==void 0&&(P+=D[M])}return P!==void 0?P:D}function _(D,P){let M;return M=D.authority&&D.path.length>1&&D.scheme==="file"?`//${D.authority}${D.path}`:D.path.charCodeAt(0)===47&&(D.path.charCodeAt(1)>=65&&D.path.charCodeAt(1)<=90||D.path.charCodeAt(1)>=97&&D.path.charCodeAt(1)<=122)&&D.path.charCodeAt(2)===58?P?D.path.substr(1):D.path[1].toLowerCase()+D.path.substr(2):D.path,i&&(M=M.replace(/\//g,"\\")),M}function x(D,P){let M=P?b:v,j="",{scheme:J,authority:te,path:re,query:we,fragment:Q}=D;if(J&&(j+=J,j+=":"),(te||J==="file")&&(j+=f,j+=f),te){let F=te.indexOf("@");if(F!==-1){let Oe=te.substr(0,F);te=te.substr(F+1),F=Oe.lastIndexOf(":"),F===-1?j+=M(Oe,!1,!1):(j+=M(Oe.substr(0,F),!1,!1),j+=":",j+=M(Oe.substr(F+1),!1,!0)),j+="@"}te=te.toLowerCase(),F=te.lastIndexOf(":"),F===-1?j+=M(te,!1,!0):(j+=M(te.substr(0,F),!1,!0),j+=te.substr(F))}if(re){if(re.length>=3&&re.charCodeAt(0)===47&&re.charCodeAt(2)===58){let F=re.charCodeAt(1);F>=65&&F<=90&&(re=`/${String.fromCharCode(F+32)}:${re.substr(3)}`)}else if(re.length>=2&&re.charCodeAt(1)===58){let F=re.charCodeAt(0);F>=65&&F<=90&&(re=`${String.fromCharCode(F+32)}:${re.substr(2)}`)}j+=M(re,!0,!1)}return we&&(j+="?",j+=M(we,!1,!1)),Q&&(j+="#",j+=P?Q:v(Q,!1,!1)),j}function T(D){try{return decodeURIComponent(D)}catch(P){return D.length>3?D.substr(0,3)+T(D.substr(3)):D}}let R=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function V(D){return D.match(R)?D.replace(R,P=>T(P)):D}var $=r(470);let K=$.posix||$,z="/";var W;(function(D){D.joinPath=function(P,...M){return P.with({path:K.join(P.path,...M)})},D.resolvePath=function(P,...M){let j=P.path,J=!1;j[0]!==z&&(j=z+j,J=!0);let te=K.resolve(j,...M);return J&&te[0]===z&&!P.authority&&(te=te.substring(1)),P.with({path:te})},D.dirname=function(P){if(P.path.length===0||P.path===z)return P;let M=K.dirname(P.path);return M.length===1&&M.charCodeAt(0)===46&&(M=""),P.with({path:M})},D.basename=function(P){return K.basename(P.path)},D.extname=function(P){return K.extname(P.path)}})(W||(W={}))})(),xA=n})();var{URI:De,Utils:Id}=xA;var ee;(function(t){t.basename=Id.basename,t.dirname=Id.dirname,t.extname=Id.extname,t.joinPath=Id.joinPath,t.resolvePath=Id.resolvePath;let e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}t.equals=r;function n(s,o){let a=typeof s=="string"?De.parse(s).path:s.path,c=typeof o=="string"?De.parse(o).path:o.path,u=a.split("/").filter(h=>h.length>0),f=c.split("/").filter(h=>h.length>0);if(e){let h=/^[A-Z]:$/;if(u[0]&&h.test(u[0])&&(u[0]=u[0].toLowerCase()),f[0]&&h.test(f[0])&&(f[0]=f[0].toLowerCase()),u[0]!==f[0])return c.substring(1)}let l=0;for(;l<u.length&&u[l]===f[l];l++);let p="../".repeat(u.length-l),d=f.slice(l).join("/");return p+d}t.relative=n;function i(s){return De.parse(s.toString()).toString()}t.normalize=i})(ee||(ee={}));var er;(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"})(er||(er={}));var hh=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=ye.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r!=null?r:De.parse(e.uri),ye.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return ye.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){let i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){let i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{let i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){let i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{let i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let s;if(n)s={parseResult:e,uri:r,state:er.Parsed,references:[],textDocument:n};else{let o=this.createTextDocumentGetter(r,i);s={parseResult:e,uri:r,state:er.Parsed,references:[],get textDocument(){return o()}}}return e.value.$document=s,s}async update(e,r){var n,i;let s=(n=e.parseResult.value.$cstNode)===null||n===void 0?void 0:n.root.fullText,o=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),a=o?o.getText():await this.fileSystemProvider.readFile(e.uri);if(o)Object.defineProperty(e,"textDocument",{value:o});else{let c=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:c})}return s!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=er.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){let n=this.serviceRegistry,i;return()=>i!=null?i:i=xc.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r!=null?r:"")}},gh=class{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return nt(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)}getDocument(e){let r=e.toString();return this.documentMap.get(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{let i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n&&(this.serviceRegistry.getServices(e).references.Linker.unlink(n),n.state=er.Changed,n.precomputedScopes=void 0,n.diagnostics=void 0),n}deleteDocument(e){let r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=er.Changed,this.documentMap.delete(r)),n}};var k9=Symbol("ref_resolving"),yh=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=ye.CancellationToken.None){for(let n of Pi(e.parseResult.value))await it(r),$f(n).forEach(i=>this.doLink(i,e))}doLink(e,r){var n;let i=e.reference;if(i._ref===void 0){i._ref=k9;try{let s=this.getCandidate(e);if(eo(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){let o=this.loadAstNode(s);i._ref=o!=null?o:this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);let o=(n=s.message)!==null&&n!==void 0?n:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${o}`})}r.references.push(i)}}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!=null?n:this.createLinkingError(e)}buildReference(e,r,n,i){let s=this,o={$refNode:n,$refText:i,get ref(){var a;if(It(this._ref))return this._ref;if(um(this._nodeDescription)){let c=s.loadAstNode(this._nodeDescription);this._ref=c!=null?c:s.createLinkingError({reference:o,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=k9;let c=Em(e).$document,u=s.getLinkedNode({reference:o,container:e,property:r});if(u.error&&c&&c.state<er.ComputedScopes)return this._ref=void 0;this._ref=(a=u.node)!==null&&a!==void 0?a:u.error,this._nodeDescription=u.descr,c==null||c.references.push(this)}else if(this._ref===k9)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${i}')`);return It(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return eo(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){var r;try{let n=this.getCandidate(e);if(eo(n))return{error:n};let i=this.loadAstNode(n);return i?{node:i,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);let i=(r=n.message)!==null&&r!==void 0?r:String(n);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;let r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){let n=Em(e.container).$document;n&&n.state<er.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})}};function P2(t){return typeof t.name=="string"}var vh=class{getName(e){if(P2(e))return e.name}getNameNode(e){return pu(e.$cstNode,"name")}};var xh=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=c6(e),n=e.astNode;if(r&&n){let i=n[r.feature];if(Vn(i))return i.ref;if(Array.isArray(i)){for(let s of i)if(Vn(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(n){let i=this.nameProvider.getNameNode(n);if(i&&(i===e||R8(e,i)))return n}}}findDeclarationNode(e){let r=this.findDeclaration(e);if(r!=null&&r.$cstNode){let n=this.nameProvider.getNameNode(r);return n!=null?n:r.$cstNode}}findReferences(e,r){let n=[];if(r.includeDeclaration){let s=this.getReferenceToSelf(e);s&&n.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(s=>ee.equals(s.sourceUri,r.documentUri))),n.push(...i),nt(n)}getReferenceToSelf(e){let r=this.nameProvider.getNameNode(e);if(r){let n=dn(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:iu(r),local:!0}}}};var On=class{constructor(e){if(this.map=new Map,e)for(let[r,n]of e)this.add(r,n)}get size(){return Wl.sum(nt(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 nt(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return nt(this.map.keys())}values(){return nt(this.map.values()).flat()}entriesGroupedByKey(){return nt(this.map.entries())}},Ru=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){let r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}};var _h=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=ye.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=uu,i=ye.CancellationToken.None){let s=[];this.exportNode(e,s,r);for(let o of n(e))await it(i),this.exportNode(o,s,r);return s}exportNode(e,r,n){let i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=ye.CancellationToken.None){let n=e.parseResult.value,i=new On;for(let s of os(n))await it(r),this.processNode(s,e,i);return i}processNode(e,r,n){let i=e.$container;if(i){let s=this.nameProvider.getName(e);s&&n.add(i,this.descriptions.createDescription(e,s,r))}}};var Cn=class{constructor(e,r,n){var i;this.elements=e,this.outerScope=r,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1}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)}},Pu=class{constructor(e,r,n){var i;this.elements=new Map,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1;for(let s of e){let o=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(o,s)}this.outerScope=r}getElement(e){let r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=nt(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},us={getElement(){},getAllElements(){return fm}};var Dd=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},bh=class extends Dd{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){let n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Nu=class extends Dd{constructor(e){super(),this.cache=new Map,this.converter=e!=null?e:r=>r}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();let i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){let s=n();return i.set(r,s),s}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){let r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){let r=this.converter(e),n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},N2=class extends Nu{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(let s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{let s=n.concat(i);for(let o of s)this.clear(o)}))}},nr=class extends bh{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var Sh=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new nr(e.shared)}getScope(e){let r=[],n=this.reflection.getReferenceType(e),i=dn(e.container).precomputedScopes;if(i){let o=e.container;do{let a=i.get(o);a.length>0&&r.push(nt(a).filter(c=>this.reflection.isSubtype(c.type,n))),o=o.$container}while(o)}let s=this.getGlobalScope(n,e);for(let o=r.length-1;o>=0;o--)s=this.createScope(r[o],s);return s}createScope(e,r,n){return new Cn(nt(e),r,n)}createScopeForNodes(e,r,n){let i=nt(e).map(s=>{let o=this.nameProvider.getName(s);if(o)return this.descriptions.createDescription(s,o)}).nonNullable();return new Cn(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Pu(this.indexManager.allElements(e)))}};function Th(t){return typeof t.$comment=="string"}function _A(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}var Eh=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){let n=r!=null?r:{},i=r==null?void 0:r.replacer,s=(a,c)=>this.replacer(a,c,n),o=i?(a,c)=>i(a,c,s):s;try{return this.currentDocument=dn(e),JSON.stringify(e,o,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){let n=r!=null?r:{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:s,comments:o,uriConverter:a}){var c,u,f,l;if(!this.ignoreProperties.has(e))if(Vn(r)){let p=r.ref,d=n?r.$refText:void 0;if(p){let h=dn(p),g="";this.currentDocument&&this.currentDocument!==h&&(a?g=a(h.uri,r):g=h.uri.toString());let v=this.astNodeLocator.getAstNodePath(p);return{$ref:`${g}#${v}`,$refText:d}}else return{$error:(u=(c=r.error)===null||c===void 0?void 0:c.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:d}}else if(It(r)){let p;if(s&&(p=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},r)),(!e||r.$document)&&(p!=null&&p.$textRegion)&&(p.$textRegion.documentURI=(f=this.currentDocument)===null||f===void 0?void 0:f.uri.toString())),i&&!e&&(p!=null||(p=Object.assign({},r)),p.$sourceText=(l=r.$cstNode)===null||l===void 0?void 0:l.text),o){p!=null||(p=Object.assign({},r));let d=this.commentProvider.getComment(r);d&&(p.$comment=d.replace(/\r/g,""))}return p!=null?p:r}else return r}addAstNodeRegionWithAssignmentsTo(e){let r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){let n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{let o=Om(e.$cstNode,s).map(r);o.length!==0&&(i[s]=o)}),e}}linkNode(e,r,n,i,s,o){for(let[c,u]of Object.entries(e))if(Array.isArray(u))for(let f=0;f<u.length;f++){let l=u[f];_A(l)?u[f]=this.reviveReference(e,c,r,l,n):It(l)&&this.linkNode(l,r,n,e,c,f)}else _A(u)?e[c]=this.reviveReference(e,c,r,u,n):It(u)&&this.linkNode(u,r,n,e,c);let a=e;a.$container=i,a.$containerProperty=s,a.$containerIndex=o}reviveReference(e,r,n,i,s){let o=i.$refText,a=i.$error;if(i.$ref){let c=this.getRefNode(n,i.$ref,s.uriConverter);if(It(c))return o||(o=this.nameProvider.getName(c)),{$refText:o!=null?o:"",ref:c};a=c}if(a){let c={$refText:o!=null?o:""};return c.error={container:e,property:r,message:a,reference:c},c}else return}getRefNode(e,r,n){try{let i=r.indexOf("#");if(i===0){let c=this.astNodeLocator.getAstNode(e,r.substring(1));return c||"Could not resolve path: "+r}if(i<0){let c=n?n(r):De.parse(r),u=this.langiumDocuments.getDocument(c);return u?u.parseResult.value:"Could not find document for URI: "+r}let s=n?n(r.substring(0,i)):De.parse(r.substring(0,i)),o=this.langiumDocuments.getDocument(s);if(!o)return"Could not find document for URI: "+r;if(i===r.length-1)return o.parseResult.value;let a=this.astNodeLocator.getAstNode(o.parseResult.value,r.substring(i+1));return a||"Could not resolve URI: "+r}catch(i){return String(i)}}};var Ch=class{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){let r=e.LanguageMetaData;for(let n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);if(r.fileNames)for(let n of r.fileNames)this.fileNameMap.has(n)&&console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileNameMap.set(n,e);this.languageIdMap.set(r.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var r,n,i;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let s=(n=(r=this.textDocuments)===null||r===void 0?void 0:r.get(e))===null||n===void 0?void 0:n.languageId;if(s!==void 0){let u=this.languageIdMap.get(s);if(u)return u}let o=ee.extname(e),a=ee.basename(e),c=(i=this.fileNameMap.get(a))!==null&&i!==void 0?i:this.fileExtensionMap.get(o);if(!c)throw s?new Error(`The service registry contains no services for the extension '${o}' for language '${s}'.`):new Error(`The service registry contains no services for the extension '${o}'.`);return c}hasServices(e){try{return this.getServices(e),!0}catch(r){return!1}}get all(){return Array.from(this.languageIdMap.values())}};function Ou(t){return{code:t}}var _c;(function(t){t.all=["fast","slow","built-in"]})(_c||(_c={}));var kh=class{constructor(e){this.entries=new On,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(let[i,s]of Object.entries(e)){let o=s;if(Array.isArray(o))for(let a of o){let c={check:this.wrapValidationException(a,r),category:n};this.addEntry(i,c)}else if(typeof o=="function"){let a={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,a)}else Eo(o)}}wrapValidationException(e,r){return async(n,i,s)=>{await this.handleException(()=>e.call(r,n,i,s),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(s){if(jo(s))throw s;console.error(`${r}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);let o=s instanceof Error?s.message:String(s);n("error",`${r}: ${o}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=nt(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,s,o,a)=>{await this.handleException(()=>e.call(n,i,s,o,a),r,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}};var Iu=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r={},n=ye.CancellationToken.None){let i=e.parseResult,s=[];if(await it(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,s,r),r.stopAfterLexingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===Rs.LexingError})||(this.processParsingErrors(i,s,r),r.stopAfterParsingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===Rs.ParsingError}))||(this.processLinkingErrors(e,s,r),r.stopAfterLinkingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===Rs.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,r,n))}catch(o){if(jo(o))throw o;console.error("An error occurred during validation:",o)}return await it(n),s}processLexingErrors(e,r,n){var i,s,o;let a=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(let c of a){let u=(o=c.severity)!==null&&o!==void 0?o:"error",f={severity:O2(u),range:{start:{line:c.line-1,character:c.column-1},end:{line:c.line-1,character:c.column+c.length-1}},message:c.message,data:SA(u),source:this.getSource()};r.push(f)}}processParsingErrors(e,r,n){for(let i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){let o=i.previousToken;if(isNaN(o.startOffset)){let a={line:0,character:0};s={start:a,end:a}}else{let a={line:o.endLine-1,character:o.endColumn};s={start:a,end:a}}}}else s=Kl(i.token);if(s){let o={severity:O2("error"),range:s,message:i.message,data:Ou(Rs.ParsingError),source:this.getSource()};r.push(o)}}}processLinkingErrors(e,r,n){for(let i of e.references){let s=i.error;if(s){let o={node:s.container,property:s.property,index:s.index,data:{code:Rs.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=ye.CancellationToken.None){let i=[],s=(o,a,c)=>{i.push(this.toDiagnostic(o,a,c))};return await this.validateAstBefore(e,r,s,n),await this.validateAstNodes(e,r,s,n),await this.validateAstAfter(e,r,s,n),i}async validateAstBefore(e,r,n,i=ye.CancellationToken.None){var s;let o=this.validationRegistry.checksBefore;for(let a of o)await it(i),await a(e,n,(s=r.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,r,n,i=ye.CancellationToken.None){await Promise.all(Pi(e).map(async s=>{await it(i);let o=this.validationRegistry.getChecks(s.$type,r.categories);for(let a of o)await a(s,n,i)}))}async validateAstAfter(e,r,n,i=ye.CancellationToken.None){var s;let o=this.validationRegistry.checksAfter;for(let a of o)await it(i),await a(e,n,(s=r.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,r,n){return{message:r,range:bA(n),severity:O2(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function bA(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=pu(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Im(t.node.$cstNode,t.keyword,t.index)),e!=null||(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function O2(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function SA(t){switch(t){case"error":return Ou(Rs.LexingError);case"warning":return Ou(Rs.LexingWarning);case"info":return Ou(Rs.LexingInfo);case"hint":return Ou(Rs.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var Rs;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Rs||(Rs={}));var wh=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){let i=n!=null?n:dn(e);r!=null||(r=this.nameProvider.getName(e));let s=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${s} has no name.`);let o,a=()=>{var c;return o!=null?o:o=iu((c=this.nameProvider.getNameNode(e))!==null&&c!==void 0?c:e.$cstNode)};return{node:e,name:r,get nameSegment(){return a()},selectionSegment:iu(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}},Ah=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=ye.CancellationToken.None){let n=[],i=e.parseResult.value;for(let s of Pi(i))await it(r),$f(s).filter(o=>!eo(o)).forEach(o=>{let a=this.createDescription(o);a&&n.push(a)});return n}createDescription(e){let r=e.reference.$nodeDescription,n=e.reference.$refNode;if(!r||!n)return;let i=dn(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:iu(n),local:ee.equals(r.documentUri,i)}}};var Rh=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,s)=>{if(!i||s.length===0)return i;let o=s.indexOf(this.indexSeparator);if(o>0){let a=s.substring(0,o),c=parseInt(s.substring(o+1)),u=i[a];return u==null?void 0:u[c]}return i[s]},e)}};var Er={};Ot(Er,ke(Au(),1));var Ph=class{constructor(e){this._ready=new qn,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new Er.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r,n;this.workspaceConfig=(n=(r=e.capabilities.workspace)===null||r===void 0?void 0:r.configuration)!==null&&n!==void 0?n:!1}async initialized(e){if(this.workspaceConfig){if(e.register){let r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,s)=>{this.updateSectionConfiguration(i.section,n[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(r=>{let n=e.settings[r];this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};var bc;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(bc||(bc={}));var Du=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new On,this.documentPhaseListeners=new On,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=er.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=ye.CancellationToken.None){var i,s;for(let o of e){let a=o.uri.toString();if(o.state===er.Validated){if(typeof r.validation=="boolean"&&r.validation)o.state=er.IndexedReferences,o.diagnostics=void 0,this.buildState.delete(a);else if(typeof r.validation=="object"){let c=this.buildState.get(a),u=(i=c==null?void 0:c.result)===null||i===void 0?void 0:i.validationChecks;if(u){let l=((s=r.validation.categories)!==null&&s!==void 0?s:_c.all).filter(p=>!u.includes(p));l.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:Object.assign(Object.assign({},r.validation),{categories:l})},result:c.result}),o.state=er.IndexedReferences)}}}else this.buildState.delete(a)}this.currentState=er.Changed,await this.emitUpdate(e.map(o=>o.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=ye.CancellationToken.None){this.currentState=er.Changed;for(let o of r)this.langiumDocuments.deleteDocument(o),this.buildState.delete(o.toString()),this.indexManager.remove(o);for(let o of e){if(!this.langiumDocuments.invalidateDocument(o)){let c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},o);c.state=er.Changed,this.langiumDocuments.addDocument(c)}this.buildState.delete(o.toString())}let i=nt(e).concat(r).map(o=>o.toString()).toSet();this.langiumDocuments.all.filter(o=>!i.has(o.uri.toString())&&this.shouldRelink(o,i)).forEach(o=>{this.serviceRegistry.getServices(o.uri).references.Linker.unlink(o),o.state=Math.min(o.state,er.ComputedScopes),o.diagnostics=void 0}),await this.emitUpdate(e,r),await it(n);let s=this.sortDocuments(this.langiumDocuments.all.filter(o=>{var a;return o.state<er.Linked||!(!((a=this.buildState.get(o.uri.toString()))===null||a===void 0)&&a.completed)}).toArray());await this.buildDocuments(s,this.updateBuildOptions,n)}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){var r;return!!(!((r=this.textDocuments)===null||r===void 0)&&r.get(e.uri))}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),bc.create(()=>{let r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,er.Parsed,n,o=>this.langiumDocumentFactory.update(o,n)),await this.runCancelable(e,er.IndexedContent,n,o=>this.indexManager.updateContent(o,n)),await this.runCancelable(e,er.ComputedScopes,n,async o=>{let a=this.serviceRegistry.getServices(o.uri).references.ScopeComputation;o.precomputedScopes=await a.computeLocalScopes(o,n)});let i=e.filter(o=>this.shouldLink(o));await this.runCancelable(i,er.Linked,n,o=>this.serviceRegistry.getServices(o.uri).references.Linker.link(o,n)),await this.runCancelable(i,er.IndexedReferences,n,o=>this.indexManager.updateReferences(o,n));let s=e.filter(o=>this.shouldValidate(o));await this.runCancelable(s,er.Validated,n,o=>this.validate(o,n));for(let o of e){let a=this.buildState.get(o.uri.toString());a&&(a.completed=!0)}}prepareBuild(e,r){for(let n of e){let i=n.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:r,result:s==null?void 0:s.result})}}async runCancelable(e,r,n,i){let s=e.filter(a=>a.state<r);for(let a of s)await it(n),await i(a),a.state=r,await this.notifyDocumentPhase(a,r,n);let o=e.filter(a=>a.state===r);await this.notifyBuildPhase(o,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),bc.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),bc.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;if(r&&"path"in r?i=r:n=r,n!=null||(n=ye.CancellationToken.None),i){let s=this.langiumDocuments.getDocument(i);if(s&&s.state>=e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(Vo):new Promise((s,o)=>{let a=this.onBuildPhase(e,()=>{if(a.dispose(),c.dispose(),i){let u=this.langiumDocuments.getDocument(i);s(u==null?void 0:u.uri)}else s(void 0)}),c=n.onCancellationRequested(()=>{a.dispose(),c.dispose(),o(Vo)})})}async notifyDocumentPhase(e,r,n){let s=this.documentPhaseListeners.get(r).slice();for(let o of s)try{await o(e,n)}catch(a){if(!jo(a))throw a}}async notifyBuildPhase(e,r,n){if(e.length===0)return;let s=this.buildPhaseListeners.get(r).slice();for(let o of s)await it(n),await o(e,n)}shouldLink(e){var r;return(r=this.getBuildOptions(e).eagerLinking)!==null&&r!==void 0?r:!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){var n,i;let s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,o=this.getBuildOptions(e).validation,a=typeof o=="object"?o:void 0,c=await s.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...c):e.diagnostics=c;let u=this.buildState.get(e.uri.toString());if(u){(n=u.result)!==null&&n!==void 0||(u.result={});let f=(i=a==null?void 0:a.categories)!==null&&i!==void 0?i:_c.all;u.result.validationChecks?u.result.validationChecks.push(...f):u.result.validationChecks=[...f]}}getBuildOptions(e){var r,n;return(n=(r=this.buildState.get(e.uri.toString()))===null||r===void 0?void 0:r.options)!==null&&n!==void 0?n:{}}};var Lu=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Nu,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){let n=dn(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(o=>{ee.equals(o.targetUri,n)&&o.targetPath===r&&i.push(o)})}),nt(i)}allElements(e,r){let n=nt(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){var n;return r?this.symbolByTypeIndex.get(e,r,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(a=>this.astReflection.isSubtype(a.type,r))}):(n=this.symbolIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){let r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r),this.referenceIndex.delete(r)}async updateContent(e,r=ye.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,r=ye.CancellationToken.None){let i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}};var Nh=class{constructor(e){this.initialBuildOptions={},this._ready=new qn,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var r;this.folders=(r=e.workspaceFolders)!==null&&r!==void 0?r:void 0}initialized(e){return this.mutex.write(r=>{var n;return this.initializeWorkspace((n=this.folders)!==null&&n!==void 0?n:[],r)})}async initializeWorkspace(e,r=ye.CancellationToken.None){let n=await this.performStartup(e);await it(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){let r=this.serviceRegistry.all.flatMap(o=>o.LanguageMetaData.fileExtensions),n=this.serviceRegistry.all.flatMap(o=>{var a;return(a=o.LanguageMetaData.fileNames)!==null&&a!==void 0?a:[]}),i=[],s=o=>{i.push(o),this.langiumDocuments.hasDocument(o.uri)||this.langiumDocuments.addDocument(o)};return await this.loadAdditionalDocuments(e,s),await Promise.all(e.map(o=>[o,this.getRootFolder(o)]).map(async o=>this.traverseFolder(...o,{fileExtensions:r,fileNames:n},s))),this._ready.resolve(),i}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return De.parse(e.uri)}async traverseFolder(e,r,n,i){let s=await this.fileSystemProvider.readDirectory(r);await Promise.all(s.map(async o=>{if(this.includeEntry(e,o,n)){if(o.isDirectory)await this.traverseFolder(e,o.uri,n,i);else if(o.isFile){let a=await this.langiumDocuments.getOrCreateDocument(o.uri);i(a)}}}))}includeEntry(e,r,n){let i=ee.basename(r.uri);return i.startsWith(".")?!1:r.isDirectory?i!=="node_modules"&&i!=="out":r.isFile?n.fileExtensions.includes(ee.extname(r.uri))||n.fileNames.includes(ee.basename(r.uri)):!1}};var Oh=class{buildUnexpectedCharactersMessage(e,r,n,i,s){return md.buildUnexpectedCharactersMessage(e,r,n,i,s)}buildUnableToPopLexerModeMessage(e){return md.buildUnableToPopLexerModeMessage(e)}},I2={mode:"full"},$u=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;let r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);let n=w9(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Nr(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=I2){var n,i,s;let o=this.chevrotainLexer.tokenize(e);return{tokens:o.tokens,errors:o.errors,hidden:(n=o.groups.hidden)!==null&&n!==void 0?n:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(w9(e))return e;let r=A9(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}};function D2(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function A9(t){return t&&"modes"in t&&"defaultMode"in t}function w9(t){return!D2(t)&&!A9(t)}function Lh(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Ft.create(0,0));let s=CA(t),o=N9(n),a=rte({lines:s,position:i,options:o});return ate({index:0,tokens:a,position:i})}function $h(t,e){let r=N9(e),n=CA(t);if(n.length===0)return!1;let i=n[0],s=n[n.length-1],o=r.start,a=r.end;return!!(o!=null&&o.exec(i))&&!!(a!=null&&a.exec(s))}function CA(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(X8)}var EA=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,tte=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function rte(t){var e,r,n;let i=[],s=t.position.line,o=t.position.character;for(let a=0;a<t.lines.length;a++){let c=a===0,u=a===t.lines.length-1,f=t.lines[a],l=0;if(c&&t.options.start){let d=(e=t.options.start)===null||e===void 0?void 0:e.exec(f);d&&(l=d.index+d[0].length)}else{let d=(r=t.options.line)===null||r===void 0?void 0:r.exec(f);d&&(l=d.index+d[0].length)}if(u){let d=(n=t.options.end)===null||n===void 0?void 0:n.exec(f);d&&(f=f.substring(0,d.index))}if(f=f.substring(0,ote(f)),P9(f,l)>=f.length){if(i.length>0){let d=Ft.create(s,o);i.push({type:"break",content:"",range:Rt.create(d,d)})}}else{EA.lastIndex=l;let d=EA.exec(f);if(d){let h=d[0],g=d[1],v=Ft.create(s,o+l),b=Ft.create(s,o+l+h.length);i.push({type:"tag",content:g,range:Rt.create(v,b)}),l+=h.length,l=P9(f,l)}if(l<f.length){let h=f.substring(l),g=Array.from(h.matchAll(tte));i.push(...nte(g,h,s,o+l))}}s++,o=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function nte(t,e,r,n){let i=[];if(t.length===0){let s=Ft.create(r,n),o=Ft.create(r,n+e.length);i.push({type:"text",content:e,range:Rt.create(s,o)})}else{let s=0;for(let a of t){let c=a.index,u=e.substring(s,c);u.length>0&&i.push({type:"text",content:e.substring(s,c),range:Rt.create(Ft.create(r,s+n),Ft.create(r,c+n))});let f=u.length+1,l=a[1];if(i.push({type:"inline-tag",content:l,range:Rt.create(Ft.create(r,s+f+n),Ft.create(r,s+f+l.length+n))}),f+=l.length,a.length===4){f+=a[2].length;let p=a[3];i.push({type:"text",content:p,range:Rt.create(Ft.create(r,s+f+n),Ft.create(r,s+f+p.length+n))})}else i.push({type:"text",content:"",range:Rt.create(Ft.create(r,s+f+n),Ft.create(r,s+f+n))});s=c+a[0].length}let o=e.substring(s);o.length>0&&i.push({type:"text",content:o,range:Rt.create(Ft.create(r,s+n),Ft.create(r,s+n+o.length))})}return i}var ite=/\S/,ste=/\s*$/;function P9(t,e){let r=t.substring(e).match(ite);return r?e+r.index:t.length}function ote(t){let e=t.match(ste);if(e&&typeof e.index=="number")return e.index}function ate(t){var e,r,n,i;let s=Ft.create(t.position.line,t.position.character);if(t.tokens.length===0)return new L2([],Rt.create(s,s));let o=[];for(;t.index<t.tokens.length;){let u=cte(t,o[o.length-1]);u&&o.push(u)}let a=(r=(e=o[0])===null||e===void 0?void 0:e.range.start)!==null&&r!==void 0?r:s,c=(i=(n=o[o.length-1])===null||n===void 0?void 0:n.range.end)!==null&&i!==void 0?i:s;return new L2(o,Rt.create(a,c))}function cte(t,e){let r=t.tokens[t.index];if(r.type==="tag")return wA(t,!1);if(r.type==="text"||r.type==="inline-tag")return kA(t);ute(r,e),t.index++}function ute(t,e){if(e){let r=new $2("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function kA(t){let e=t.tokens[t.index],r=e,n=e,i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(lte(t)),n=e,e=t.tokens[t.index];return new Dh(i,Rt.create(r.range.start,n.range.end))}function lte(t){return t.tokens[t.index].type==="inline-tag"?wA(t,!0):AA(t)}function wA(t,e){let r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){let s=AA(t);return new Ih(n,new Dh([s],s.range),e,Rt.create(r.range.start,s.range.end))}else{let s=kA(t);return new Ih(n,s,e,Rt.create(r.range.start,s.range.end))}else{let s=r.range;return new Ih(n,new Dh([],s),e,s)}}function AA(t){let e=t.tokens[t.index++];return new $2(e.content,e.range)}function N9(t){if(!t)return N9({start:"/**",end:"*/",line:"*"});let{start:e,end:r,line:n}=t;return{start:R9(e,!0),end:R9(r,!1),line:R9(n,!0)}}function R9(t,e){if(typeof t=="string"||typeof t=="object"){let r=typeof t=="string"?Ya(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}var L2=class{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(let r of this.elements)if(e.length===0)e=r.toString();else{let n=r.toString();e+=TA(e)+n}return e.trim()}toMarkdown(e){let r="";for(let n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{let i=n.toMarkdown(e);r+=TA(r)+i}return r.trim()}},Ih=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`,r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
204
+ ${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r,n;return(n=(r=e==null?void 0:e.renderTag)===null||r===void 0?void 0:r.call(e,this))!==null&&n!==void 0?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){let r=this.content.toMarkdown(e);if(this.inline){let s=fte(this.name,r,e!=null?e:{});if(typeof s=="string")return s}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} \u2014 ${r}`:this.content.inlines.length>1&&(i=`${i}
205
+ ${r}`),this.inline?`{${i}}`:i}};function fte(t,e,r){var n,i;if(t==="linkplain"||t==="linkcode"||t==="link"){let s=e.indexOf(" "),o=e;if(s>0){let c=P9(e,s);o=e.substring(c),e=e.substring(0,s)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(o=`\`${o}\``),(i=(n=r.renderLink)===null||n===void 0?void 0:n.call(r,e,o))!==null&&i!==void 0?i:dte(e,o)}}function dte(t,e){try{return De.parse(t,!0),`[${e}](${t})`}catch(r){return t}}var Dh=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){let n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
206
+ `)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){let i=this.inlines[n],s=this.inlines[n+1];r+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(r+=`
207
+ `)}return r}},$2=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}};function TA(t){return t.endsWith(`
208
+ `)?`
209
+ `:`
210
+
211
+ `}var Mh=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let r=this.commentProvider.getComment(e);if(r&&$h(r))return Lh(r).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,r,n){var i;let s=(i=this.findNameInPrecomputedScopes(e,r))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,r);if(s&&s.nameSegment){let o=s.nameSegment.range.start.line+1,a=s.nameSegment.range.start.character+1,c=s.documentUri.with({fragment:`L${o},${a}`});return`[${n}](${c.toString()})`}else return}documentationTagRenderer(e,r){}findNameInPrecomputedScopes(e,r){let i=dn(e).precomputedScopes;if(!i)return;let s=e;do{let a=i.get(s).find(c=>c.name===r);if(a)return a;s=s.$container}while(s)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}};var Fh=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return Th(e)?e.$comment:(r=pm(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||r===void 0?void 0:r.text}};var Vh=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},O9=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){let e=this.createWorker();e.onReady(()=>{if(this.queue.length>0){let r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){let n=await this.acquireParserWorker(r),i=new qn,s,o=r.onCancellationRequested(()=>{s=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(a=>{let c=this.hydrator.hydrate(a);i.resolve(c)}).catch(a=>{i.reject(a)}).finally(()=>{o.dispose(),clearTimeout(s)}),i.promise}terminateWorker(e){e.terminate();let r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(let n of this.workerPool)if(n.ready)return n.lock(),n;let r=new qn;return e.onCancellationRequested(()=>{let n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Vo)}),this.queue.push(r),r.promise}},I9=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new Er.Emitter,this.deferred=new qn,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(s=>{let o=s;this.deferred.resolve(o),this.unlock()}),n(s=>{this.deferred.reject(s),this.unlock()})}terminate(){this.deferred.reject(Vo),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new qn,this.sendMessage(e),this.deferred.promise}};var Mu=class{constructor(){this.previousTokenSource=new ye.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let r=A2();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=ye.CancellationToken.None){let i=new qn,s={action:r,deferred:i,cancellationToken:n};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;let e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{let s=await Promise.resolve().then(()=>r(i));n.resolve(s)}catch(s){jo(s)?n.resolve(void 0):n.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var jh=class{constructor(e){this.grammarElementIdMap=new Ru,this.tokenTypeIdMap=new Ru,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>Object.assign(Object.assign({},r),{message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){let r=new Map,n=new Map;for(let i of Pi(e))r.set(i,{});if(e.$cstNode)for(let i of nu(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(let[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){let o=[];n[i]=o;for(let a of s)It(a)?o.push(this.dehydrateAstNode(a,r)):Vn(a)?o.push(this.dehydrateReference(a,r)):o.push(a)}else It(s)?n[i]=this.dehydrateAstNode(s,r):Vn(s)?n[i]=this.dehydrateReference(s,r):s!==void 0&&(n[i]=s);return n}dehydrateReference(e,r){let n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){let n=r.cstNodes.get(e);return lm(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),to(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Qa(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){let r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){let r=new Map,n=new Map;for(let s of Pi(e))r.set(s,{});let i;if(e.$cstNode)for(let s of nu(e.$cstNode)){let o;"fullText"in s?(o=new Ad(s.fullText),i=o):"content"in s?o=new Cu:"tokenType"in s&&(o=this.hydrateCstLeafNode(s)),o&&(n.set(s,o),o.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){let n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(let[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){let o=[];n[i]=o;for(let a of s)It(a)?o.push(this.setParent(this.hydrateAstNode(a,r),n)):Vn(a)?o.push(this.hydrateReference(a,n,i,r)):o.push(a)}else It(s)?n[i]=this.setParent(this.hydrateAstNode(s,r),n):Vn(s)?n[i]=this.hydrateReference(s,n,i,r):s!==void 0&&(n[i]=s);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){let i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),to(i))for(let s of e.content){let o=this.hydrateCstNode(s,r,n++);i.content.push(o)}return i}hydrateCstLeafNode(e){let r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,s=e.startLine,o=e.startColumn,a=e.endLine,c=e.endColumn,u=e.hidden;return new Tu(n,i,{start:{line:s,character:o},end:{line:a,character:c}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(let r of Pi(this.grammar))au(r)&&this.grammarElementIdMap.set(r,e++)}};function Uh(t){return{documentation:{CommentProvider:e=>new Fh(e),DocumentationProvider:e=>new Mh(e)},parser:{AsyncParser:e=>new Vh(e),GrammarConfig:e=>d6(e),LangiumParser:e=>y9(e),CompletionParser:e=>g9(e),ValueConverter:()=>new ph,TokenBuilder:()=>new wu,Lexer:e=>new $u(e),ParserErrorMessageProvider:()=>new Rd,LexerErrorMessageProvider:()=>new Oh},workspace:{AstNodeLocator:()=>new Rh,AstNodeDescriptionProvider:e=>new wh(e),ReferenceDescriptionProvider:e=>new Ah(e)},references:{Linker:e=>new yh(e),NameProvider:()=>new vh,ScopeProvider:e=>new Sh(e),ScopeComputation:e=>new _h(e),References:e=>new xh(e)},serializer:{Hydrator:e=>new jh(e),JsonSerializer:e=>new Eh(e)},validation:{DocumentValidator:e=>new Iu(e),ValidationRegistry:e=>new kh(e)},shared:()=>t.shared}}function qh(t){return{ServiceRegistry:e=>new Ch(e),workspace:{LangiumDocuments:e=>new gh(e),LangiumDocumentFactory:e=>new hh(e),DocumentBuilder:e=>new Du(e),IndexManager:e=>new Lu(e),WorkspaceManager:e=>new Nh(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new Mu,ConfigurationProvider:e=>new Ph(e)}}}var Ld;(function(t){t.merge=(e,r)=>M2(M2({},e),r)})(Ld||(Ld={}));function Fu(t,e,r,n,i,s,o,a,c){let u=[t,e,r,n,i,s,o,a,c].reduce(M2,{});return OA(u)}var NA=Symbol("isProxy");function Bh(t){if(t&&t[NA])for(let e of Object.values(t))Bh(e);return t}function OA(t,e){let r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===NA?!0:PA(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(PA(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}var RA=Symbol();function PA(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]===RA)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){let i=r[e];t[e]=RA;try{t[e]=typeof i=="function"?i(n):OA(i,n)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function M2(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]=M2(i,n):t[r]=n}}return t}var D9={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},Vu;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(Vu||(Vu={}));var F2=class extends wu{constructor(e=D9){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options=Object.assign(Object.assign({},D9),e),this.indentTokenType=pc({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=pc({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){let n=super.buildTokens(e,r);if(!D2(n))throw new Error("Invalid tokens built by default builder");let{indentTokenName:i,dedentTokenName:s,whitespaceTokenName:o,ignoreIndentationDelimiters:a}=this.options,c,u,f,l=[];for(let p of n){for(let[d,h]of a)p.name===d?p.PUSH_MODE=Vu.IGNORE_INDENTATION:p.name===h&&(p.POP_MODE=!0);p.name===s?c=p:p.name===i?u=p:p.name===o?f=p:l.push(p)}if(!c||!u||!f)throw new Error("Some indentation/whitespace tokens not found!");return a.length>0?{modes:{[Vu.REGULAR]:[c,u,...l,f],[Vu.IGNORE_INDENTATION]:[...l,f]},defaultMode:Vu.REGULAR}:[c,u,f,...l]}flushLexingReport(e){let r=super.flushLexingReport(e);return Object.assign(Object.assign({},r),{remainingDedents:this.flushRemainingDedents(e)})}isStartOfLine(e,r){return r===0||`\r
212
+ `.includes(e[r-1])}matchWhitespace(e,r,n,i){var s;this.whitespaceRegExp.lastIndex=r;let o=this.whitespaceRegExp.exec(e);return{currIndentLevel:(s=o==null?void 0:o[0].length)!==null&&s!==void 0?s:0,prevIndentLevel:this.indentationStack.at(-1),match:o}}createIndentationTokenInstance(e,r,n,i){let s=this.getLineNumber(r,i);return _a(e,n,i,i+n.length,s,s,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:s,prevIndentLevel:o,match:a}=this.matchWhitespace(e,r,n,i);return s<=o?null:(this.indentationStack.push(s),a)}dedentMatcher(e,r,n,i){var s,o,a,c;if(!this.isStartOfLine(e,r))return null;let{currIndentLevel:u,prevIndentLevel:f,match:l}=this.matchWhitespace(e,r,n,i);if(u>=f)return null;let p=this.indentationStack.lastIndexOf(u);if(p===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${u} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:(o=(s=l==null?void 0:l[0])===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0,line:this.getLineNumber(e,r),column:1}),null;let d=this.indentationStack.length-p-1,h=(c=(a=e.substring(0,r).match(/[\r\n]+$/))===null||a===void 0?void 0:a[0].length)!==null&&c!==void 0?c:1;for(let g=0;g<d;g++){let v=this.createIndentationTokenInstance(this.dedentTokenType,e,"",r-(h-1));n.push(v),this.indentationStack.pop()}return null}buildTerminalToken(e){let r=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:i,whitespaceTokenName:s}=this.options;return r.name===n?this.indentTokenType:r.name===i?this.dedentTokenType:r.name===s?pc({name:s,pattern:this.whitespaceRegExp,group:Nr.SKIPPED}):r}flushRemainingDedents(e){let r=[];for(;this.indentationStack.length>1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},L9=class extends $u{constructor(e){if(super(e),e.parser.TokenBuilder instanceof F2)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=I2){let n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];let{indentTokenType:s,dedentTokenType:o}=this.indentationTokenBuilder,a=s.tokenTypeIdx,c=o.tokenTypeIdx,u=[],f=n.tokens.length-1;for(let l=0;l<f;l++){let p=n.tokens[l],d=n.tokens[l+1];if(p.tokenTypeIdx===a&&d.tokenTypeIdx===c){l++;continue}u.push(p)}return f>=0&&u.push(n.tokens[f]),n.tokens=u,n}};var Vt={};ua(Vt,{AstUtils:()=>Fe,BiMap:()=>Ru,Cancellation:()=>ye,ContextCache:()=>Nu,CstUtils:()=>Kg,DONE_RESULT:()=>Qn,Deferred:()=>qn,Disposable:()=>bc,DisposableCache:()=>Dd,DocumentCache:()=>N2,EMPTY_STREAM:()=>fm,ErrorWithLocation:()=>su,GrammarUtils:()=>n0,MultiMap:()=>On,OperationCancelled:()=>Vo,Reduction:()=>Wl,RegExpUtils:()=>t0,SimpleCache:()=>bh,StreamImpl:()=>ns,TreeStreamImpl:()=>bo,URI:()=>De,UriUtils:()=>ee,WorkspaceCache:()=>nr,assertUnreachable:()=>Eo,delayNextTick:()=>T9,interruptAndCheck:()=>it,isOperationCancelled:()=>jo,loadGrammarFromJson:()=>j2,setInterruptionPeriod:()=>hA,startCancelableOperation:()=>A2,stream:()=>nt});Ot(Vt,Er);var V2=class{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}},$9={fileSystemProvider:()=>new V2};var pte={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},mte={AstReflection:()=>new If};function hte(){let t=Fu(qh($9),mte),e=Fu(Uh({shared:t}),pte);return t.ServiceRegistry.register(e),e}function j2(t){var e;let r=hte(),n=r.serializer.JsonSerializer.deserialize(t);return r.shared.workspace.LangiumDocumentFactory.fromModel(n,De.parse(`memory://${(e=n.name)!==null&&e!==void 0?e:"grammar"}.langium`)),n}Ot(be,Vt);var IA="ArtifactStatement";var DA="Expression";var LA="LibraryStatement";var U9="Model";function d1(t){return bt.isInstance(t,U9)}var Hh="TerminalExpression";var $A="TypeDefinition";var M9="TypeRef";var U2="UnaryTypeDefinition";var zh="AdditionExpression";function K2(t){return bt.isInstance(t,zh)}var q2="ArtifactExpression";function Md(t){return bt.isInstance(t,q2)}var Wh="ArtifactName";function G2(t){return bt.isInstance(t,Wh)}var B2="ArtifactVariable";function Fd(t){return bt.isInstance(t,B2)}var Kh="ArtifactVariables";function zu(t){return bt.isInstance(t,Kh)}var Gh="BooleanLiteralExpression";function Vd(t){return bt.isInstance(t,Gh)}var xi="BuiltinArtifact";function Ta(t){return bt.isInstance(t,xi)}var qr="ComponentArtifact";function Ca(t){return bt.isInstance(t,qr)}var ti="DeploymentArtifact";function Bn(t){return bt.isInstance(t,ti)}var Jh="EqualityComparisonExpression";function J2(t){return bt.isInstance(t,Jh)}var Qh="FunctionCallExpression";function Q2(t){return bt.isInstance(t,Qh)}var ju="FunctionDefinitionExpression";function Y2(t){return bt.isInstance(t,ju)}var H2="FunctionParam";function MA(t){return bt.isInstance(t,H2)}var $d="IdentifierExpression";function ri(t){return bt.isInstance(t,$d)}var z2="Import";function jd(t){return bt.isInstance(t,z2)}var Yh="IncrementExpression";function Z2(t){return bt.isInstance(t,Yh)}var F9="Library";var V9="LibraryBody";var Zh="ListExpression";function X2(t){return bt.isInstance(t,Zh)}var Xh="ListTypeDefinition";function FA(t){return bt.isInstance(t,Xh)}var e1="LogicalANDExpression";function e3(t){return bt.isInstance(t,e1)}var t1="LogicalORExpression";function t3(t){return bt.isInstance(t,t1)}var r1="MultiplicationExpression";function r3(t){return bt.isInstance(t,r1)}var n1="NumberLiteralExpression";function Ud(t){return bt.isInstance(t,n1)}var i1="OrderedComparisonExpression";function n3(t){return bt.isInstance(t,i1)}var Ps="Package";function q9(t){return bt.isInstance(t,Ps)}var W2="PackageDeclaration";function VA(t){return bt.isInstance(t,W2)}var on="ServiceArtifact";function Ns(t){return bt.isInstance(t,on)}var s1="SizeLiteralExpression";function qd(t){return bt.isInstance(t,s1)}var o1="StringLiteralExpression";function Bd(t){return bt.isInstance(t,o1)}var a1="StructEntry";function zr(t){return bt.isInstance(t,a1)}var Uu="StructExpression";function _i(t){return bt.isInstance(t,Uu)}var qu="StructTypeDefinition";function jA(t){return bt.isInstance(t,qu)}var j9="StructTypeDefinitionEntry";var c1="TernaryExpression";function i3(t){return bt.isInstance(t,c1)}var Bu="TypeAliasExpression";function Wu(t){return bt.isInstance(t,Bu)}var Hu="TypeDefinitionExpression";function Ku(t){return bt.isInstance(t,Hu)}var u1="UnaryExpression";function s3(t){return bt.isInstance(t,u1)}var l1="UnionTypeDefinition";function o3(t){return bt.isInstance(t,l1)}var f1=class extends ru{getAllTypes(){return[zh,q2,Wh,IA,B2,Kh,Gh,xi,qr,ti,Jh,DA,Qh,ju,H2,$d,z2,Yh,F9,V9,LA,Zh,Xh,e1,t1,U9,r1,n1,i1,Ps,W2,on,s1,o1,a1,Uu,qu,j9,Hh,c1,Bu,$A,Hu,M9,u1,U2,l1]}computeIsSubtype(e,r){switch(e){case zh:case Jh:case Qh:case Yh:case e1:case t1:case r1:case i1:case Hh:case c1:case u1:return this.isSubtype(DA,r);case Kh:case a1:return this.isSubtype(IA,r);case Gh:case n1:case s1:case o1:return this.isSubtype(Hh,r)||this.isSubtype(U2,r);case ju:case Bu:case Hu:return this.isSubtype(LA,r);case $d:return this.isSubtype(Hh,r)||this.isSubtype(M9,r);case Zh:case Uu:return this.isSubtype(Hh,r);case Xh:case qu:case U2:case l1:return this.isSubtype($A,r);case Ps:return this.isSubtype(U9,r);case M9:return this.isSubtype(U2,r);default:return!1}}getReferenceType(e){let r=`${e.container.$type}:${e.property}`;switch(r){case"ArtifactName:value":return Wh;case"IdentifierExpression:value":return $d;case"Import:target":return Ps;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case zh:return{name:zh,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case q2:return{name:q2,properties:[{name:"stmt",defaultValue:[]}]};case Wh:return{name:Wh,properties:[{name:"value"}]};case B2:return{name:B2,properties:[{name:"key"},{name:"value"}]};case Kh:return{name:Kh,properties:[{name:"variables",defaultValue:[]}]};case Gh:return{name:Gh,properties:[{name:"value"}]};case xi:return{name:xi,properties:[{name:"body"},{name:"name"}]};case qr:return{name:qr,properties:[{name:"body"},{name:"name"}]};case ti:return{name:ti,properties:[{name:"body"}]};case Jh:return{name:Jh,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case Qh:return{name:Qh,properties:[{name:"arguments",defaultValue:[]},{name:"caller"}]};case ju:return{name:ju,properties:[{name:"name"},{name:"params",defaultValue:[]},{name:"returns"}]};case H2:return{name:H2,properties:[{name:"name"},{name:"optional",defaultValue:!1},{name:"type"}]};case $d:return{name:$d,properties:[{name:"next"},{name:"value"}]};case z2:return{name:z2,properties:[{name:"alias"},{name:"target"}]};case Yh:return{name:Yh,properties:[{name:"operator"},{name:"target"}]};case F9:return{name:F9,properties:[{name:"body"}]};case V9:return{name:V9,properties:[{name:"statements",defaultValue:[]}]};case Zh:return{name:Zh,properties:[{name:"values",defaultValue:[]}]};case Xh:return{name:Xh,properties:[{name:"value"}]};case e1:return{name:e1,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case t1:return{name:t1,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case r1:return{name:r1,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case n1:return{name:n1,properties:[{name:"value"}]};case i1:return{name:i1,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case Ps:return{name:Ps,properties:[{name:"artifacts",defaultValue:[]},{name:"declaration"},{name:"imports",defaultValue:[]},{name:"library"}]};case W2:return{name:W2,properties:[{name:"name"}]};case on:return{name:on,properties:[{name:"body"},{name:"name"}]};case s1:return{name:s1,properties:[{name:"value"}]};case o1:return{name:o1,properties:[{name:"value"}]};case a1:return{name:a1,properties:[{name:"key"},{name:"optional",defaultValue:!1},{name:"type"},{name:"value"}]};case Uu:return{name:Uu,properties:[{name:"entries",defaultValue:[]}]};case qu:return{name:qu,properties:[{name:"entries",defaultValue:[]},{name:"open",defaultValue:!1},{name:"restriction"}]};case j9:return{name:j9,properties:[{name:"key"},{name:"optional",defaultValue:!1},{name:"type"}]};case c1:return{name:c1,properties:[{name:"condition"},{name:"falseExpr"},{name:"trueExpr"}]};case Bu:return{name:Bu,properties:[{name:"name"},{name:"value"}]};case Hu:return{name:Hu,properties:[{name:"name"},{name:"value"}]};case u1:return{name:u1,properties:[{name:"left"},{name:"operator"}]};case l1:return{name:l1,properties:[{name:"left"},{name:"right"}]};default:return{name:e,properties:[]}}}},bt=new f1;var up=ke(Ui(),1);function L7(t,e){let r={stacks:t,tokens:e};return Sne(r),r.stacks.flat().forEach(i=>{i.property=void 0}),oI(r.stacks).map(i=>i[i.length-1])}function $7(t){let{next:e,cardinalities:r,visited:n,plus:i}=t,s=[],o=e.feature;if(n.has(o))return[];ks(o)||n.add(o);let a,c=o;for(;c.$container;)if(ks(c.$container)){a=c.$container;break}else if(au(c.$container))c=c.$container;else break;if(u6(c.cardinality)){let u=cp({next:{feature:c,type:e.type},cardinalities:r,visited:n,plus:i});for(let f of u)i.add(f.feature);s.push(...u)}if(a){let u=a.elements.indexOf(c);u!==void 0&&u<a.elements.length-1&&s.push(...sI({feature:a,type:e.type},u+1,r,n,i)),s.every(f=>mu(f.feature.cardinality,f.feature)||mu(r.get(f.feature))||i.has(f.feature))&&s.push(...$7({next:{feature:a,type:e.type},cardinalities:r,visited:n,plus:i}))}return s}function _y(t){return It(t)&&(t={feature:t}),cp({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function cp(t){var e,r,n;let{next:i,cardinalities:s,visited:o,plus:a}=t;if(i===void 0)return[];let{feature:c,type:u}=i;if(ks(c))return o.has(c)?[]:(o.add(c),sI(i,0,s,o,a).map(f=>xy(f,c.cardinality,s)));if(Df(c)||Lf(c))return c.elements.flatMap(f=>cp({next:{feature:f,type:u,property:i.property},cardinalities:s,visited:o,plus:a})).map(f=>xy(f,c.cardinality,s));if(Yn(c)){let f={feature:c.terminal,type:u,property:(e=i.property)!==null&&e!==void 0?e:c.feature};return cp({next:f,cardinalities:s,visited:o,plus:a}).map(l=>xy(l,c.cardinality,s))}else{if(ro(c))return $7({next:{feature:c,type:hu(c),property:(r=i.property)!==null&&r!==void 0?r:c.feature},cardinalities:s,visited:o,plus:a});if(Ri(c)&&Ar(c.rule.ref)){let f=c.rule.ref,l={feature:f.definition,type:f.fragment||f.dataType?void 0:(n=Co(f))!==null&&n!==void 0?n:f.name,property:i.property};return cp({next:l,cardinalities:s,visited:o,plus:a}).map(p=>xy(p,c.cardinality,s))}else return[i]}}function xy(t,e,r){return r.set(t.feature,e),t}function sI(t,e,r,n,i){var s;let o=[],a;for(;e<t.feature.elements.length&&(a={feature:t.feature.elements[e++],type:t.type},o.push(...cp({next:a,cardinalities:r,visited:n,plus:i})),!!mu((s=a.feature.cardinality)!==null&&s!==void 0?s:r.get(a.feature),a.feature)););return o}function Sne(t){for(let e of t.tokens){let r=oI(t.stacks,e);t.stacks=r}}function oI(t,e){let r=[];for(let n of t)r.push(...Ene(n,e));return r}function Ene(t,e){let r=new Map,n=new Set(t.map(s=>s.feature).filter(Tne)),i=[];for(;t.length>0;){let s=t.pop(),o=$7({next:s,cardinalities:r,plus:n,visited:new Set}).filter(a=>e?M7(a.feature,e):!0);for(let a of o)i.push([...t,a]);if(!o.every(a=>mu(a.feature.cardinality,a.feature)||mu(r.get(a.feature))))break}return i}function Tne(t){if(t.cardinality==="+")return!0;let e=ss(t,Yn);return!!(e&&e.cardinality==="+")}function M7(t,e){if(Sn(t))return t.value===e.image;if(Ri(t))return Cne(t.rule.ref,e);if(is(t)){let r=Nm(t);if(r)return M7(r,e)}return!1}function Cne(t,e){return Ar(t)?_y(t.definition).some(n=>M7(n.feature,e)):pi(t)?Za(t).test(e.image):!1}function aI(t){let e=Array.from(new Set(t.flatMap(n=>{var i;return(i=n==null?void 0:n.triggerCharacters)!==null&&i!==void 0?i:[]}))),r=Array.from(new Set(t.flatMap(n=>{var i;return(i=n==null?void 0:n.allCommitCharacters)!==null&&i!==void 0?i:[]})));return{triggerCharacters:e.length>0?e:void 0,allCommitCharacters:r.length>0?r:void 0}}var by=class{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.lexer=e.parser.Lexer,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.fuzzyMatcher=e.shared.lsp.FuzzyMatcher,this.grammarConfig=e.parser.GrammarConfig,this.astReflection=e.shared.AstReflection,this.documentationProvider=e.documentation.DocumentationProvider}async getCompletion(e,r,n){let i=[],s=this.buildContexts(e,r.position),o=(u,f)=>{let l=this.fillCompletionItem(u,f);l&&i.push(l)},a=u=>Sn(u.feature)?u.feature.value:u.feature,c=[];for(let u of s)if(await Promise.all(nt(u.features).distinct(a).exclude(c).map(f=>this.completionFor(u,f,o))),c.push(...u.features),!this.continueCompletion(i))break;return up.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return nt(e).distinct(r=>`${r.kind}_${r.label}_${r.detail}`).toArray()}findFeaturesAt(e,r){let n=e.getText({start:up.Position.create(0,0),end:e.positionAt(r)}),i=this.completionParser.parse(n),s=i.tokens;if(i.tokenIndex===0){let c=Rm(this.grammar),u=_y({feature:c.definition,type:Co(c)});return s.length>0?(s.shift(),L7(u.map(f=>[f]),s)):u}let o=[...s].splice(i.tokenIndex);return L7([i.elementStack.map(c=>({feature:c}))],o)}*buildContexts(e,r){var n,i;let s=e.parseResult.value.$cstNode;if(!s)return;let o=e.textDocument,a=o.getText(),c=o.offsetAt(r),u={document:e,textDocument:o,offset:c,position:r},f=this.findDataTypeRuleStart(s,c);if(f){let[_,x]=f,T=(n=mm(s,_))===null||n===void 0?void 0:n.astNode;yield Object.assign(Object.assign({},u),{node:T,tokenOffset:_,tokenEndOffset:x,features:this.findFeaturesAt(o,_)})}let{nextTokenStart:l,nextTokenEnd:p,previousTokenStart:d,previousTokenEnd:h}=this.backtrackToAnyToken(a,c),g=l;c<=l&&d!==void 0&&(g=d);let v=(i=mm(s,g))===null||i===void 0?void 0:i.astNode,b=!0;if(d!==void 0&&h!==void 0&&h===c&&(yield Object.assign(Object.assign({},u),{node:v,tokenOffset:d,tokenEndOffset:h,features:this.findFeaturesAt(o,d)}),b=this.performNextTokenCompletion(e,a.substring(d,h),d,h),b&&(yield Object.assign(Object.assign({},u),{node:v,tokenOffset:h,tokenEndOffset:h,features:this.findFeaturesAt(o,h)}))),v)b&&(yield Object.assign(Object.assign({},u),{node:v,tokenOffset:l,tokenEndOffset:p,features:this.findFeaturesAt(o,l)}));else{let _=Rm(this.grammar);if(!_)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},u),{tokenOffset:l,tokenEndOffset:p,features:_y(_.definition)})}}performNextTokenCompletion(e,r,n,i){return new RegExp("\\P{L}$","u").test(r)}findDataTypeRuleStart(e,r){var n,i;let s=Ai(e,r,this.grammarConfig.nameRegexp),o=!!(!((n=ss(s==null?void 0:s.grammarSource,Ar))===null||n===void 0)&&n.dataType);if(o){for(;o;)s=s==null?void 0:s.container,o=!!(!((i=ss(s==null?void 0:s.grammarSource,Ar))===null||i===void 0)&&i.dataType);if(s)return[s.offset,s.end]}}continueCompletion(e){return e.length===0}backtrackToAnyToken(e,r){let n=this.lexer.tokenize(e).tokens;if(n.length===0)return{nextTokenStart:r,nextTokenEnd:r};let i;for(let s of n){if(s.startOffset>=r)return{nextTokenStart:r,nextTokenEnd:r,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};if(s.endOffset>=r)return{nextTokenStart:s.startOffset,nextTokenEnd:s.endOffset+1,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};i=s}return{nextTokenStart:r,nextTokenEnd:r,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0}}completionFor(e,r,n){if(Sn(r.feature))return this.completionForKeyword(e,r.feature,n);if(is(r.feature)&&e.node)return this.completionForCrossReference(e,r,n)}completionForCrossReference(e,r,n){let i=ss(r.feature,Yn),s=e.node;if(i&&s){r.type&&(s={$type:r.type,$container:s,$containerProperty:r.property},Tm(this.astReflection,s));let o={reference:{$refText:""},container:s,property:i.feature};try{for(let a of this.getReferenceCandidates(o,e))n(e,this.createReferenceCompletionItem(a))}catch(a){console.error(a)}}}getReferenceCandidates(e,r){return this.scopeProvider.getScope(e).getAllElements()}createReferenceCompletionItem(e){let r=this.nodeKindProvider.getCompletionItemKind(e),n=this.getReferenceDocumentation(e);return{nodeDescription:e,kind:r,documentation:n,detail:e.type,sortText:"0"}}getReferenceDocumentation(e){if(!e.node)return;let r=this.documentationProvider.getDocumentation(e.node);if(r)return{kind:"markdown",value:r}}completionForKeyword(e,r,n){this.filterKeyword(e,r)&&n(e,{label:r.value,kind:this.getKeywordCompletionItemKind(r),detail:"Keyword",sortText:"1"})}getKeywordCompletionItemKind(e){return up.CompletionItemKind.Keyword}filterKeyword(e,r){return new RegExp("\\p{L}","u").test(r.value)}fillCompletionItem(e,r){var n,i;let s;if(typeof r.label=="string")s=r.label;else if("node"in r){let u=this.nameProvider.getName(r.node);if(!u)return;s=u}else if("nodeDescription"in r)s=r.nodeDescription.name;else return;let o;typeof((n=r.textEdit)===null||n===void 0?void 0:n.newText)=="string"?o=r.textEdit.newText:typeof r.insertText=="string"?o=r.insertText:o=s;let a=(i=r.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(e,s,o);return a?{additionalTextEdits:r.additionalTextEdits,command:r.command,commitCharacters:r.commitCharacters,data:r.data,detail:r.detail,documentation:r.documentation,filterText:r.filterText,insertText:r.insertText,insertTextFormat:r.insertTextFormat,insertTextMode:r.insertTextMode,kind:r.kind,labelDetails:r.labelDetails,preselect:r.preselect,sortText:r.sortText,tags:r.tags,textEditText:r.textEditText,textEdit:a,label:s}:void 0}buildCompletionTextEdit(e,r,n){let s=e.textDocument.getText().substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(s,r)){let o=e.textDocument.positionAt(e.tokenOffset),a=e.position;return{newText:n,range:{start:o,end:a}}}else return}};var cI=ke(Ui(),1);var Sy=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,r,n){let i=e.parseResult.value;if(i.$cstNode){let s=i.$cstNode,o=Ai(s,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[cI.LocationLink.create(i.targetDocument.textDocument.uri,((n=i.target.astNode.$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!=null&&r.astNode){let n=dn(r.astNode);if(r&&n)return{source:e,target:r,targetDocument:n}}}};var uI=ke(Ui(),1);var Ey=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,r,n){let i=e.parseResult.value.$cstNode;if(!i)return;let s=Ai(i,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);if(!s)return;let o=this.references.findDeclaration(s);if(o){let a=ee.equals(dn(o).uri,e.uri),c={documentUri:e.uri,includeDeclaration:a};return this.references.findReferences(o,c).map(f=>this.createDocumentHighlight(f)).toArray()}}createDocumentHighlight(e){return uI.DocumentHighlight.create(e.segment.range)}};var Ty=class{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e,r,n){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,r){let n=r.$cstNode,i=this.nameProvider.getNameNode(r);if(i&&n){let s=this.nameProvider.getName(r);return[{kind:this.nodeKindProvider.getSymbolKind(r),name:s||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 uu(r)){let s=this.getSymbol(e,i);n.push(...s)}if(n.length>0)return n}};var A1=ke(Ui(),1);var lp=class{constructor(e){this.workspaceManager=e.workspace.WorkspaceManager,this.documentBuilder=e.workspace.DocumentBuilder,this.workspaceLock=e.workspace.WorkspaceLock,this.serviceRegistry=e.ServiceRegistry;let r=!1;e.lsp.LanguageServer.onInitialize(n=>{var i,s;r=!!(!((s=(i=n.capabilities.workspace)===null||i===void 0?void 0:i.didChangeWatchedFiles)===null||s===void 0)&&s.dynamicRegistration)}),e.lsp.LanguageServer.onInitialized(n=>{r&&this.registerFileWatcher(e)})}registerFileWatcher(e){let r=[],n=nt(e.ServiceRegistry.all).flatMap(s=>s.LanguageMetaData.fileExtensions).map(s=>s.startsWith(".")?s.substring(1):s).distinct().toArray();n.length>0&&r.push({globPattern:n.length===1?`**/*.${n[0]}`:`**/*.{${n.join(",")}}`});let i=nt(e.ServiceRegistry.all).flatMap(s=>{var o;return(o=s.LanguageMetaData.fileNames)!==null&&o!==void 0?o:[]}).distinct().toArray();if(i.length>0&&r.push({globPattern:i.length===1?`**/${i[0]}`:`**/{${i.join(",")}}`}),r.length>0){let s=e.lsp.Connection,o={watchers:r};s==null||s.client.register(A1.DidChangeWatchedFilesNotification.type,o)}}fireDocumentUpdate(e,r){e=e.filter(n=>this.serviceRegistry.hasServices(n)),this.workspaceManager.ready.then(()=>{this.workspaceLock.write(n=>this.documentBuilder.update(e,r,n))}).catch(n=>{console.error("Workspace initialization failed. Could not perform document update.",n)})}didChangeContent(e){this.fireDocumentUpdate([De.parse(e.document.uri)],[])}didChangeWatchedFiles(e){let r=nt(e.changes).filter(i=>i.type!==A1.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>De.parse(i.uri)).toArray(),n=nt(e.changes).filter(i=>i.type===A1.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>De.parse(i.uri)).toArray();this.fireDocumentUpdate(r,n)}};var R1=ke(Ui(),1);var Cy=class{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e,r,n){let i=[],s=o=>i.push(o);return this.collectFolding(e,s),i}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 s=os(i).iterator(),o;do if(o=s.next(),!o.done){let a=o.value;this.shouldProcess(a)&&this.collectObjectFolding(e,a,r),this.shouldProcessContent(a)||s.prune()}while(!o.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 s=this.toFoldingRange(e,i);s&&n(s)}}collectCommentFolding(e,r,n){let i=r.$cstNode;if(i){for(let s of A8(i))if(this.commentNames.includes(s.tokenType.name)){let o=this.toFoldingRange(e,s,R1.FoldingRangeKind.Comment);o&&n(o)}}}toFoldingRange(e,r,n){let i=r.range,s=i.start,o=i.end;if(!(o.line-s.line<2))return this.includeLastFoldingLine(r,n)||(o=e.textDocument.positionAt(e.textDocument.offsetAt({line:o.line,character:0})-1)),R1.FoldingRange.create(s.line,o.line,s.character,o.character,n)}includeLastFoldingLine(e,r){if(r===R1.FoldingRangeKind.Comment)return!1;let n=e.text,i=n.charAt(n.length-1);return!(i==="}"||i===")"||i==="]")}};var ky=class{match(e,r){if(e.length===0)return!0;let n=!1,i,s=0,o=r.length;for(let a=0;a<o;a++){let c=r.charCodeAt(a),u=e.charCodeAt(s);if((c===u||this.toUpperCharCode(c)===this.toUpperCharCode(u))&&(n||(n=i===void 0||this.isWordTransition(i,c)),n&&s++,s===e.length))return!0;i=c}return!1}isWordTransition(e,r){return lI<=e&&e<=fI&&kne<=r&&r<=wne||e===dI&&r!==dI}toUpperCharCode(e){return lI<=e&&e<=fI?e-32:e}},lI=97,fI=122,kne=65,wne=90,dI=95;var F7=class{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,r){var n,i;let s=(i=(n=e.parseResult)===null||n===void 0?void 0:n.value)===null||i===void 0?void 0:i.$cstNode;if(s){let o=e.textDocument.offsetAt(r.position),a=Ai(s,o,this.grammarConfig.nameRegexp);if(a&&a.offset+a.length>o){let c=this.references.findDeclaration(a);if(c)return this.getAstNodeHoverContent(c);if(Sn(a.grammarSource))return this.getKeywordHoverContent(a.grammarSource)}}}getKeywordHoverContent(e){var r;let n=Th(e)?e.$comment:void 0;if(n||(n=(r=pm(e.$cstNode,["ML_COMMENT"]))===null||r===void 0?void 0:r.text),n&&$h(n)){let i=Lh(n).toMarkdown();if(i)return{contents:{kind:"markdown",value:i}}}}},wy=class extends F7{constructor(e){super(e),this.documentationProvider=e.documentation.DocumentationProvider}getAstNodeHoverContent(e){let r=this.documentationProvider.getDocumentation(e);if(r)return{contents:{kind:"markdown",value:r}}}};var Aa=ke(Kr(),1);var St=ke(Ui(),1);var mI={[St.SemanticTokenTypes.class]:0,[St.SemanticTokenTypes.comment]:1,[St.SemanticTokenTypes.enum]:2,[St.SemanticTokenTypes.enumMember]:3,[St.SemanticTokenTypes.event]:4,[St.SemanticTokenTypes.function]:5,[St.SemanticTokenTypes.interface]:6,[St.SemanticTokenTypes.keyword]:7,[St.SemanticTokenTypes.macro]:8,[St.SemanticTokenTypes.method]:9,[St.SemanticTokenTypes.modifier]:10,[St.SemanticTokenTypes.namespace]:11,[St.SemanticTokenTypes.number]:12,[St.SemanticTokenTypes.operator]:13,[St.SemanticTokenTypes.parameter]:14,[St.SemanticTokenTypes.property]:15,[St.SemanticTokenTypes.regexp]:16,[St.SemanticTokenTypes.string]:17,[St.SemanticTokenTypes.struct]:18,[St.SemanticTokenTypes.type]:19,[St.SemanticTokenTypes.typeParameter]:20,[St.SemanticTokenTypes.variable]:21,[St.SemanticTokenTypes.decorator]:22},hI={[St.SemanticTokenModifiers.abstract]:1,[St.SemanticTokenModifiers.async]:2,[St.SemanticTokenModifiers.declaration]:4,[St.SemanticTokenModifiers.defaultLibrary]:8,[St.SemanticTokenModifiers.definition]:16,[St.SemanticTokenModifiers.deprecated]:32,[St.SemanticTokenModifiers.documentation]:64,[St.SemanticTokenModifiers.modification]:128,[St.SemanticTokenModifiers.readonly]:256,[St.SemanticTokenModifiers.static]:512},GNe={legend:{tokenTypes:Object.keys(mI),tokenModifiers:Object.keys(hI)},full:{delta:!0},range:!0};function gI(t){let e=[],r=[],n=!0,i=!0,s=!0;for(let o of t)o&&(o.legend.tokenTypes.forEach((a,c)=>{let u=e[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token types. They use the same index ${c}.`);e[c]=a}),o.legend.tokenModifiers.forEach((a,c)=>{let u=r[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token modifier. They use the same index ${c}.`);r[c]=a}),o.full?typeof o.full=="object"&&!o.full.delta&&(i=!1):n=!1,o.range||(s=!1));return{legend:{tokenTypes:e,tokenModifiers:r},full:n&&{delta:i},range:s}}var V7=class extends St.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,r,n,i,s){this._tokens.push({line:e,char:r,length:n,tokenType:i,tokenModifiers:s})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}flush(){this.previousResult(this.id)}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}},Ay=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}get tokenTypes(){return mI}get tokenModifiers(){return hI}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,r,n=ye.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}async semanticHighlightRange(e,r,n=ye.CancellationToken.None){return this.currentRange=r.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),n),this.currentTokensBuilder.build()}async semanticHighlightDelta(e,r,n=ye.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(r.previousResultId),await 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 V7;return this.tokensBuilders.set(e.uri.toString(),n),n}async computeHighlighting(e,r,n){let i=e.parseResult.value,s=Pi(i,{range:this.currentRange}).iterator(),o;do if(o=s.next(),!o.done){await it(n);let a=o.value;this.highlightElement(a,r)==="prune"&&s.prune()}while(!o.done)}highlightToken(e){var r;let{range:n,type:i}=e,s=e.modifier;if(this.currentRange&&!dm(n,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;let o=this.tokenTypes[i],a=0;if(s!==void 0){typeof s=="string"&&(s=[s]);for(let f of s){let l=this.tokenModifiers[f];a|=l}}let c=n.start.line,u=n.end.line;if(c===u){let f=n.start.character,l=n.end.character-f;this.currentTokensBuilder.push(c,f,l,o,a)}else if(!((r=this.clientCapabilities)===null||r===void 0)&&r.multilineTokenSupport){let f=n.start.character,l=this.currentDocument.textDocument.offsetAt(n.start),p=this.currentDocument.textDocument.offsetAt(n.end);this.currentTokensBuilder.push(c,f,p-l,o,a)}else{let f=n.start,l=this.currentDocument.textDocument.offsetAt({line:c+1,character:0});this.currentTokensBuilder.push(f.line,f.character,l-f.character-1,o,a);for(let p=c+1;p<u;p++){let d=l;l=this.currentDocument.textDocument.offsetAt({line:p+1,character:0}),this.currentTokensBuilder.push(p,0,l-d-1,o,a)}this.currentTokensBuilder.push(u,0,n.end.character,o,a)}}highlightProperty(e){let r=[];if(typeof e.index=="number"){let s=pu(e.node.$cstNode,e.property,e.index);s&&r.push(s)}else r.push(...Om(e.node.$cstNode,e.property));let{type:n,modifier:i}=e;for(let s of r)this.highlightNode({node:s,type:n,modifier:i})}highlightKeyword(e){let{node:r,keyword:n,type:i,index:s,modifier:o}=e,a=[];if(typeof s=="number"){let c=Im(r.$cstNode,n,s);c&&a.push(c)}else a.push(...o6(r.$cstNode,n));for(let c of a)this.highlightNode({node:c,type:i,modifier:o})}highlightNode(e){let{node:r,type:n,modifier:i}=e,s=r.range;this.highlightToken({range:s,type:n,modifier:i})}},pI;(function(t){function e(n,i,s){let o=new Map;Object.entries(i).forEach(([u,f])=>o.set(f,u));let a=0,c=0;return r(n.data,5).map(u=>{a+=u[0],u[0]!==0&&(c=0),c+=u[1];let f=u[2];return{offset:s.textDocument.offsetAt({line:a,character:c}),tokenType:o.get(u[3]),tokenModifiers:u[4],text:s.textDocument.getText({start:{line:a,character:c},end:{line:a,character:c+f}})}})}t.decode=e;function r(n,i){let s=[];for(let o=0;o<n.length;o+=i){let a=n.slice(o,o+i);s.push(a)}return s}})(pI||(pI={}));function yI(t){let e=[],r=[];t.forEach(i=>{i!=null&&i.triggerCharacters&&e.push(...i.triggerCharacters),i!=null&&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}var Ry=class{constructor(e){this.onInitializeEmitter=new Aa.Emitter,this.onInitializedEmitter=new Aa.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.fireInitializeOnDefaultServices(e),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){Bh(this.services),this.services.ServiceRegistry.all.forEach(e=>Bh(e))}hasService(e){return this.services.ServiceRegistry.all.some(n=>e(n)!==void 0)}buildInitializeResult(e){var r,n,i,s;let o=this.services.lsp.DocumentUpdateHandler,a=(r=this.services.lsp.FileOperationHandler)===null||r===void 0?void 0:r.fileOperationOptions,c=this.services.ServiceRegistry.all,u=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.Formatter}),f=c.map(Q=>{var F,Oe;return(Oe=(F=Q.lsp)===null||F===void 0?void 0:F.Formatter)===null||Oe===void 0?void 0:Oe.formatOnTypeOptions}).find(Q=>!!Q),l=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.CodeActionProvider}),p=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.SemanticTokenProvider}),d=gI(c.map(Q=>{var F,Oe;return(Oe=(F=Q.lsp)===null||F===void 0?void 0:F.SemanticTokenProvider)===null||Oe===void 0?void 0:Oe.semanticTokensOptions})),h=(i=(n=this.services.lsp)===null||n===void 0?void 0:n.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,g=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.DocumentLinkProvider}),v=yI(c.map(Q=>{var F,Oe;return(Oe=(F=Q.lsp)===null||F===void 0?void 0:F.SignatureHelp)===null||Oe===void 0?void 0:Oe.signatureHelpOptions})),b=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.TypeProvider}),_=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.ImplementationProvider}),x=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.CompletionProvider}),T=aI(c.map(Q=>{var F,Oe;return(Oe=(F=Q.lsp)===null||F===void 0?void 0:F.CompletionProvider)===null||Oe===void 0?void 0:Oe.completionOptions})),R=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.ReferencesProvider}),V=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.DocumentSymbolProvider}),$=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.DefinitionProvider}),K=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.DocumentHighlightProvider}),z=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.FoldingRangeProvider}),W=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.HoverProvider}),D=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.RenameProvider}),P=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.CallHierarchyProvider}),M=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.TypeHierarchyProvider}),j=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.CodeLensProvider}),J=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.DeclarationProvider}),te=this.hasService(Q=>{var F;return(F=Q.lsp)===null||F===void 0?void 0:F.InlayHintProvider}),re=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:a},executeCommandProvider:h&&{commands:h},textDocumentSync:{change:Aa.TextDocumentSyncKind.Incremental,openClose:!0,save:!!o.didSaveDocument,willSave:!!o.willSaveDocument,willSaveWaitUntil:!!o.willSaveDocumentWaitUntil},completionProvider:x?T:void 0,referencesProvider:R,documentSymbolProvider:V,definitionProvider:$,typeDefinitionProvider:b,documentHighlightProvider:K,codeActionProvider:l,documentFormattingProvider:u,documentRangeFormattingProvider:u,documentOnTypeFormattingProvider:f,foldingRangeProvider:z,hoverProvider:W,renameProvider:D?{prepareProvider:!0}:void 0,semanticTokensProvider:p?d:void 0,signatureHelpProvider:v,implementationProvider:_,callHierarchyProvider:P?{}:void 0,typeHierarchyProvider:M?{}:void 0,documentLinkProvider:g?{resolveProvider:!1}:void 0,codeLensProvider:j?{resolveProvider:!1}:void 0,declarationProvider:J,inlayHintProvider:te?{resolveProvider:!1}:void 0,workspaceSymbolProvider:re?{resolveProvider:!!re.resolveSymbol}:void 0}}}initialized(e){this.fireInitializedOnDefaultServices(e),this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}fireInitializeOnDefaultServices(e){this.services.workspace.ConfigurationProvider.initialize(e),this.services.workspace.WorkspaceManager.initialize(e)}fireInitializedOnDefaultServices(e){let r=this.services.lsp.Connection,n=r?Object.assign(Object.assign({},e),{register:i=>r.client.register(Aa.DidChangeConfigurationNotification.type,i),fetchConfiguration:i=>r.workspace.getConfiguration(i)}):e;this.services.workspace.ConfigurationProvider.initialized(n).catch(i=>console.error("Error in ConfigurationProvider initialization:",i)),this.services.workspace.WorkspaceManager.initialized(e).catch(i=>console.error("Error in WorkspaceManager initialization:",i))}};var Ny=ke(Ui(),1),Py=class{getSymbolKind(e){return Ny.SymbolKind.Field}getCompletionItemKind(e){return Ny.CompletionItemKind.Reference}};var vI=ke(Ui(),1);var Oy=class{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,r,n){let i=e.parseResult.value.$cstNode;if(!i)return[];let s=Ai(i,e.textDocument.offsetAt(r.position),this.grammarConfig.nameRegexp);return s?this.getReferences(s,r,e):[]}getReferences(e,r,n){let i=[],s=this.references.findDeclaration(e);if(s){let o={includeDeclaration:r.context.includeDeclaration};this.references.findReferences(s,o).forEach(a=>{i.push(vI.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}};var Iy=class{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,r,n){let i={},s=e.parseResult.value.$cstNode;if(!s)return;let o=e.textDocument.offsetAt(r.position),a=Ai(s,o,this.grammarConfig.nameRegexp);if(!a)return;let c=this.references.findDeclaration(a);if(!c)return;let u={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(c,u).forEach(l=>{let p=yc.replace(l.segment.range,r.newName),d=l.sourceUri.toString();i[d]?i[d].push(p):i[d]=[p]}),{changes:i}}prepareRename(e,r,n){return this.renameNodeRange(e,r.position)}renameNodeRange(e,r){let n=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(r);if(n&&i){let s=Ai(n,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return(e==null?void 0:e.astNode)&&P2(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}};var Dy=class{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,r=ye.CancellationToken.None){let n=[],i=e.query.toLowerCase();for(let s of this.indexManager.allElements())if(await it(r),this.fuzzyMatcher.match(i,s.name)){let o=this.getWorkspaceSymbol(s);o&&n.push(o)}return n}getWorkspaceSymbol(e){let r=e.nameSegment;if(r)return{kind:this.nodeKindProvider.getSymbolKind(e),name:e.name,location:{range:r.range,uri:e.documentUri.toString()}}}};var Dn=ke(Ui(),1);var P1=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Dn.Emitter,this._onDidOpen=new Dn.Emitter,this._onDidClose=new Dn.Emitter,this._onDidSave=new Dn.Emitter,this._onWillSave=new Dn.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(ee.normalize(e))}set(e){let r=ee.normalize(e.uri),n=!0;this._syncedDocuments.has(r)&&(n=!1),this._syncedDocuments.set(r,e);let i=Object.freeze({document:e});return this._onDidOpen.fire(i),this._onDidChangeContent.fire(i),n}delete(e){let r=ee.normalize(typeof e=="object"&&"uri"in e?e.uri:e),n=this._syncedDocuments.get(r);n!==void 0&&(this._syncedDocuments.delete(r),this._onDidClose.fire(Object.freeze({document:n})))}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Dn.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,s=ee.normalize(i.uri),o=this._configuration.create(s,i.languageId,i.version,i.text);this._syncedDocuments.set(s,o);let a=Object.freeze({document:o});this._onDidOpen.fire(a),this._onDidChangeContent.fire(a)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=ee.normalize(i.uri),c=this._syncedDocuments.get(a);c!==void 0&&(c=this._configuration.update(c,s,o),this._syncedDocuments.set(a,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),r.push(e.onDidCloseTextDocument(n=>{let i=ee.normalize(n.textDocument.uri),s=this._syncedDocuments.get(i);s!==void 0&&(this._syncedDocuments.delete(i),this._onDidClose.fire(Object.freeze({document:s})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(ee.normalize(n.textDocument.uri));i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let s=this._syncedDocuments.get(ee.normalize(n.textDocument.uri));return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(ee.normalize(n.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Dn.Disposable.create(()=>{r.forEach(n=>n.dispose())})}},Ly=class{constructor(e){this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Dn.Emitter,this._onDidSave=new Dn.Emitter,this._onDidChange=new Dn.Emitter,this._onDidClose=new Dn.Emitter,"listen"in e?this._cellTextDocuments=e:this._cellTextDocuments=new P1(e)}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(ee.normalize(e))}getNotebookCell(e){let r=this.notebookCellMap.get(ee.normalize(e));return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"||"scheme"in e?e:e.document,n=this.notebookCellMap.get(ee.normalize(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 $y,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{let s=ee.normalize(i.notebookDocument.uri);this.notebookDocuments.set(s,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 s=ee.normalize(i.notebookDocument.uri),o=this.notebookDocuments.get(s);if(o===void 0)return;o.version=i.notebookDocument.version;let a=o.metadata,c=!1,u=i.change;u.metadata!==void 0&&(c=!0,o.metadata=u.metadata);let f=[],l=[],p=[],d=[];if(u.cells!==void 0){let _=u.cells;if(_.structure!==void 0){let x=_.structure.array;if(o.cells.splice(x.start,x.deleteCount,...x.cells!==void 0?x.cells:[]),_.structure.didOpen!==void 0)for(let T of _.structure.didOpen)r.openTextDocument({textDocument:T}),f.push(T.uri);if(_.structure.didClose)for(let T of _.structure.didClose)r.closeTextDocument({textDocument:T}),l.push(T.uri)}if(_.data!==void 0){let x=new Map(_.data.map(T=>[T.document,T]));for(let T=0;T<=o.cells.length;T++){let R=x.get(o.cells[T].document);if(R!==void 0){let V=o.cells.splice(T,1,R);if(p.push({old:V[0],new:R}),x.delete(R.document),x.size===0)break}}}if(_.textContent!==void 0)for(let x of _.textContent)r.changeTextDocument({textDocument:x.document,contentChanges:x.changes}),d.push(x.document.uri)}this.updateCellMap(o);let h={notebookDocument:o};c&&(h.metadata={old:a,new:o.metadata});let g=[];for(let _ of f)g.push(this.getNotebookCell(_));let v=[];for(let _ of l)v.push(this.getNotebookCell(_));let b=[];for(let _ of d)b.push(this.getNotebookCell(_));(g.length>0||v.length>0||p.length>0||b.length>0)&&(h.cells={added:g,removed:v,changed:{data:p,textContent:b}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.getNotebookDocument(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=ee.normalize(i.notebookDocument.uri),o=this.notebookDocuments.get(s);if(o!==void 0){this._onDidClose.fire(o);for(let a of i.cellTextDocuments)r.closeTextDocument({textDocument:a});this.notebookDocuments.delete(s);for(let a of o.cells)this.notebookCellMap.delete(a.document)}})),Dn.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}},$y=class t{onDidOpenTextDocument(e){return this.openHandler=e,Dn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Dn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Dn.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};$y.NULL_DISPOSE=Object.freeze({dispose:()=>{}});function xI(t){return Ld.merge(Uh(t),Ane(t))}function Ane(t){return{lsp:{CompletionProvider:e=>new by(e),DocumentSymbolProvider:e=>new Ty(e),HoverProvider:e=>new wy(e),FoldingRangeProvider:e=>new Cy(e),ReferencesProvider:e=>new Oy(e),DefinitionProvider:e=>new Sy(e),DocumentHighlightProvider:e=>new Ey(e),RenameProvider:e=>new Iy(e)},shared:()=>t.shared}}function _I(t){return Ld.merge(qh(t),Rne(t))}function Rne(t){return{lsp:{Connection:()=>t.connection,LanguageServer:e=>new Ry(e),DocumentUpdateHandler:e=>new lp(e),WorkspaceSymbolProvider:e=>new Dy(e),NodeKindProvider:()=>new Py,FuzzyMatcher:()=>new ky},workspace:{TextDocuments:()=>new P1(xc),NotebookDocuments:e=>new Ly(e.workspace.TextDocuments)}}}var My,bI=()=>My!=null?My:My=j2(`{"$type":"Grammar","isDeclared":true,"name":"Kumori","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Model","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Package","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"declaration","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PackageDeclaration","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"package"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Imports","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":")"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":")"}]}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Import","inferredType":{"$type":"InferredType","name":"Import"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"Keyword","value":"."}]},"cardinality":"?"},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@1"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"PackageBody","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Artifact","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"artifacts","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}]}},{"$type":"Assignment","feature":"library","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"ArtifactScoped","definition":{"$type":"Assignment","feature":"artifacts","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]}]}},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ServiceArtifact","inferredType":{"$type":"InferredType","name":"ServiceArtifact"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ServiceArtifactScoped","inferredType":{"$type":"InferredType","name":"ServiceArtifact"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArtifactName","definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RootArtifactBody","inferredType":{"$type":"InferredType","name":"ArtifactExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArtifactBody","inferredType":{"$type":"InferredType","name":"ArtifactExpression"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"ArtifactDefinition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"stmt","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},{"$type":"Assignment","feature":"stmt","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArtifactStatement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArtifactVariables","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"var"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"variables","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"variables","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"?"}]},{"$type":"Keyword","value":")"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArtifactVariable","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Expression","parameters":[{"$type":"Parameter","name":"Typed"}],"definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@17/parameters@0"}},"calledByName":false}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"TernaryExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@18/parameters@0"}},"calledByName":false}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"TernaryExpression"},"feature":"condition","operator":"="},{"$type":"Keyword","value":"?"},{"$type":"Assignment","feature":"trueExpr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"falseExpr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"LogicalORExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@19/parameters@0"}},"calledByName":false}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"LogicalORExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"||"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"LogicalANDExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@20/parameters@0"}},"calledByName":false}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"LogicalANDExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&&"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"EqualityComparisonExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@21/parameters@0"}},"calledByName":false}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"EqualityComparisonExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"=="},{"$type":"Keyword","value":"!="}]}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"OrderedComparisonExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@22/parameters@0"}},"calledByName":false}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"OrderedComparisonExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"<"},{"$type":"Keyword","value":">"},{"$type":"Keyword","value":"<="},{"$type":"Keyword","value":">="}]}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"AdditionExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@23/parameters@0"}},"calledByName":false}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"AdditionExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"+"},{"$type":"Keyword","value":"-"}]}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"MultiplicationExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@24/parameters@0"}},"calledByName":false}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"MultiplicationExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"*"},{"$type":"Keyword","value":"/"},{"$type":"Keyword","value":"%"}]}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"FunctionCallExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@25/parameters@0"}},"calledByName":false}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FunctionCallExpression"},"feature":"caller","operator":"="},{"$type":"Keyword","value":"("},{"$type":"Group","elements":[{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"arguments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}],"cardinality":"*"},{"$type":"Keyword","value":",","cardinality":"?"}],"cardinality":"?"},{"$type":"Keyword","value":")"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"IncrementExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@26/parameters@0"}},"calledByName":false}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"IncrementExpression"},"feature":"target","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"++"},{"$type":"Keyword","value":"--"}]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"PrimaryExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"Expression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@27/parameters@0"}},"calledByName":false}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"UnaryExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"+"},{"$type":"Keyword","value":"-"},{"$type":"Keyword","value":"!"}]}},{"$type":"Assignment","feature":"left","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TerminalExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@29/parameters@0"}},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"ListExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[],"cardinality":"?"}],"cardinality":"?"},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberLiteralExpression","definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StringLiteralExpression","definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BooleanLiteralExpression","definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"true"},{"$type":"Keyword","value":"false"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SizeLiteralExpression","definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IdentifierExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@35"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"next","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/"},"fragment":false},{"$type":"TerminalRule","name":"NL","definition":{"$type":"RegexToken","regex":"/[\\\\r\\\\n]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","name":"REGEX","definition":{"$type":"RegexToken","regex":"/\\\\/((?:\\\\\\\\.|[^\\\\\\\\/])*)\\\\//"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"BOOLEAN","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"UINT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(?:\\\\b)\\\\d+(?:\\\\b)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SINT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(?:\\\\b)-\\\\d+(?:\\\\b)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalGroup","elements":[{"$type":"RegexToken","regex":"/(?:\\\\b)-\\\\d+/"},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"."}},{"$type":"RegexToken","regex":"/\\\\d+(?:\\\\b)/"}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"OCTAL","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(?:\\\\b)0o[0-7]+(?:\\\\b)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\])*\\"|'(\\\\\\\\.|[^'\\\\\\\\])*'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"NUMBER","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"INT","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"QualifiedNameSegment","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},{"$type":"Keyword","value":"alias"},{"$type":"Keyword","value":"builtin"},{"$type":"Keyword","value":"component"},{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"false"},{"$type":"Keyword","value":"func"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"library"},{"$type":"Keyword","value":"open"},{"$type":"Keyword","value":"package"},{"$type":"Keyword","value":"self"},{"$type":"Keyword","value":"service"},{"$type":"Keyword","value":"struct"},{"$type":"Keyword","value":"true"},{"$type":"Keyword","value":"type"},{"$type":"Keyword","value":"var"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"SIZED_INT","definition":{"$type":"TerminalGroup","elements":[{"$type":"RegexToken","regex":"/(?:\\\\b)\\\\d+/"},{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"m"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"k"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"M"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"G"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"P"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"E"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"Ki"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"Mi"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"Gi"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"Ti"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"Pi"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"Ei"}}]},{"$type":"RegexToken","regex":"/(?:\\\\b)/"}]},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"ElementSeparator","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"+"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StructExpression","parameters":[{"$type":"Parameter","name":"Typed"}],"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@54/parameters@0"}},"calledByName":false}]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[{"$type":"NamedArgument","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@54/parameters@0"}},"calledByName":false}]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[],"cardinality":"?"}],"cardinality":"?"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"StructEntry","parameters":[{"$type":"Parameter","name":"Typed"}],"inferredType":{"$type":"InferredType","name":"StructEntry"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@55/parameters@0"}}},"elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]}]},{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@55/parameters@0"}},"elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"UntypedStructEntry","inferredType":{"$type":"InferredType","name":"StructEntry"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TypedStructEntry","inferredType":{"$type":"InferredType","name":"StructEntry"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}]}},{"$type":"Assignment","feature":"optional","operator":"?=","terminal":{"$type":"Keyword","value":"?"},"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}},{"$type":"Keyword","value":"=","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}]}},{"$type":"Assignment","feature":"optional","operator":"?=","terminal":{"$type":"Keyword","value":"?"},"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}]}},{"$type":"Keyword","value":"=","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentArtifact","inferredType":{"$type":"InferredType","name":"DeploymentArtifact"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deployment"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentArtifactScoped","inferredType":{"$type":"InferredType","name":"DeploymentArtifact"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deployment"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ComponentArtifact","inferredType":{"$type":"InferredType","name":"ComponentArtifact"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"component"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ComponentArtifactScoped","inferredType":{"$type":"InferredType","name":"ComponentArtifact"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"component"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BuiltinArtifact","inferredType":{"$type":"InferredType","name":"BuiltinArtifact"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"builtin"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BuiltinArtifactScoped","inferredType":{"$type":"InferredType","name":"BuiltinArtifact"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"builtin"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Library","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"library"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LibraryBody","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[],"cardinality":"?"}],"cardinality":"?"},{"$type":"Keyword","value":"}"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[],"cardinality":"?"}],"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LibraryElementSeparator","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LibraryStatement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@68"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TypeDefinitionExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"type"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TypeAliasExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"alias"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FunctionDefinitionExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"func"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"params","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},{"$type":"Assignment","feature":"params","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[],"cardinality":"?"}],"cardinality":"?"},{"$type":"Keyword","value":")"},{"$type":"Assignment","feature":"returns","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FunctionParam","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}},{"$type":"Assignment","feature":"optional","operator":"?=","terminal":{"$type":"Keyword","value":"?"},"cardinality":"?"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TypeDefinition","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"UnionTypeDefinition","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"UnionTypeDefinition"},"feature":"left","operator":"="},{"$type":"Keyword","value":"|"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PrimaryTypeDefinition","inferredType":{"$type":"InferredType","name":"TypeDefinition"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@77"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"UnaryTypeDefinition","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TypeRef","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ListTypeDefinition","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StructTypeDefinition","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"struct"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"StructOpenTypeDefinition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"open","operator":"?=","terminal":{"$type":"Keyword","value":"open"}},{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"restriction","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":"]"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"StructClosedTypeDefinition","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[],"cardinality":"?"}],"cardinality":"?"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StructTypeDefinitionEntry","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}]}},{"$type":"Assignment","feature":"optional","operator":"?=","terminal":{"$type":"Keyword","value":"?"},"cardinality":"?"},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`);var Pne={languageId:"kumori",fileExtensions:[".kumori"],caseInsensitive:!1,mode:"production"},SI={AstReflection:()=>new f1},EI={Grammar:()=>bI(),LanguageMetaData:()=>Pne,parser:{}};var Fs=t=>{let e;return()=>(e===void 0&&(e=t()),e)};var Fy=class extends Du{constructor(r){super(r);this.svcs=r;this._dwd=Fs(()=>new nr(this.svcs))}get docsWithDiagnostics(){return this._dwd()}async validate(r,n){var l,p;let i=this.serviceRegistry.getServices(r.uri).validation.DocumentValidator,s=this.getBuildOptions(r).validation,o=typeof s=="object"?s:void 0,a=await i.validateDocument(r,o,n),c=a.filter(d=>d.document===void 0);r.diagnostics?r.diagnostics.push(...c):r.diagnostics=c,this.docsWithDiagnostics.set(r);let u=a.filter(d=>d.document!==void 0);for(let d of u){if(!d.document)continue;let h=d.document;delete d.document,h.diagnostics=h.diagnostics||[],h.diagnostics.push(d),this.docsWithDiagnostics.set(h)}let f=this.buildState.get(r.uri.toString());if(f){(l=f.result)!=null||(f.result={});let d=(p=o==null?void 0:o.categories)!=null?p:_c.all;f.result.validationChecks?f.result.validationChecks.push(...d):f.result.validationChecks=[...d]}}},Vy=class extends Iu{toDiagnostic(e,r,n){return Y(C({},super.toDiagnostic(e,r,n)),{document:Fe.getDocument(n.node)})}};var jy=class extends Lu{isAffected(e,r){return new Set(Array.from(r.values()).map(s=>De.parse(s)).map(ee.dirname).map(s=>s.toString())).has(ee.dirname(e.uri).toString())?!0:super.isAffected(e,r)}};var j7=Symbol("ref_resolving"),Uy=class{constructor(e){this.svcs=e;this.reflection=this.svcs.shared.AstReflection;this.scopeProvider=this.svcs.references.ScopeProvider;this.astNodeLocator=this.svcs.workspace.AstNodeLocator;this.langiumDocuments=()=>this.svcs.shared.workspace.LangiumDocuments}async link(e,r=ye.CancellationToken.None){for(let n of Fe.streamAst(e.parseResult.value))await it(r),Fe.streamReferences(n).forEach(i=>this.doLink(i,e))}doLink(e,r){var i;let n=e.reference;if(n._ref===void 0){n._ref=j7;try{let s=this.getCandidate(e);if(eo(s))n._ref=s;else if(n._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){let o=this.loadAstNode(s);n._ref=o!=null?o:this.createLinkingError(e,s)}else n._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${n.$refText}':`,s);let o=(i=s.message)!=null?i:String(s);n._ref=Y(C({},e),{message:`An error occurred while resolving reference to '${n.$refText}': ${o}`})}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).getAllElements().filter(a=>a.name===e.reference.$refText).toArray(),i=a=>Fe.getDocument(a).uri.path.endsWith(".h.kumori");G2(e.container)&&(n=n.filter(a=>i(a.node)));let s=n.filter(a=>!i(a.node)).pop();if(s!==void 0)return s;let o=n.filter(a=>i(a.node)).pop();return o!==void 0?o:this.createLinkingError(e)}buildReference(e,r,n,i){let s=this,o={$refNode:n,$refText:i,get ref(){var a;if(It(this._ref))return this._ref;if(um(this._nodeDescription)){let c=s.loadAstNode(this._nodeDescription);this._ref=c!=null?c:s.createLinkingError({reference:o,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=j7;let c=Fe.findRootNode(e).$document,u=s.getLinkedNode({reference:o,container:e,property:r});if(u.error&&c&&c.state<er.ComputedScopes)return this._ref=void 0;this._ref=(a=u.node)!=null?a:u.error,this._nodeDescription=u.descr,c==null||c.references.push(this)}else if(this._ref===j7)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${i}')`);return It(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return eo(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){var r;try{let n=this.getCandidate(e);if(eo(n))return{error:n};let i=this.loadAstNode(n);return i?{node:i,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);let i=(r=n.message)!=null?r:String(n);return{error:Y(C({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;let r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){let n=Fe.findRootNode(e.container).$document;n&&n.state<er.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);let i=this.reflection.getReferenceType(e);return Y(C({},e),{message:`Could not resolve reference to ${i} '${e.reference.$refText}'.`,targetDescription:r})}};function TI(t,e){if(t.scheme!==e.scheme)return!1;let r=ee.relative(t,e);return!!r&&!r.startsWith("..")&&!r.startsWith("/")}function CI(t,e){if(t.scheme!==e.scheme)return!1;let r=ee.relative(t,e);return!!r&&!r.startsWith("..")&&!r.startsWith("/")&&r.split("/").length==1}function qy(t){return t.path.endsWith("/")?t:t.with({path:t.path+"/"})}var Le=t=>({$type:"ok",value:t}),oe=t=>({$type:"err",err:t}),N;(p=>(p.isOk=d=>d.$type==="ok",p.isErr=d=>d.$type==="err",p.is=d=>typeof d!="object"||d===null||!("$type"in d)||typeof d.$type!="string"||!(d.$type==="ok"&&"value"in d)&&!(d.$type==="err"&&"err"in d)?!1:(0,p.isOk)(d)||(0,p.isErr)(d),p.map=(d,h)=>(0,p.isErr)(d)?d:Le(h(d.value)),p.flatMap=(d,h)=>(0,p.isErr)(d)?d:h(d.value),p.mapErr=(d,h)=>(0,p.isOk)(d)?d:oe(h(d.err)),p.flatMapErr=(d,h)=>(0,p.isOk)(d)?d:h(d.err),p.orElse=(d,h)=>(0,p.isOk)(d)?d.value:h(d.err),p.from=d=>{let h=d();return p.is(h)?(p.isErr(h),h):Le(h)},p.fromAsync=async d=>{let h=await d();return p.is(h)?(p.isErr(h),h):Le(h)},p.tryCatch=(d,h)=>{h!=null||(h=g=>g);try{return Le(d())}catch(g){return oe(h(g))}},p.tryCatchAsync=async(d,h)=>{h!=null||(h=g=>g);try{return Le(await d())}catch(g){return oe(h(g))}}))(N||(N={}));var Ut=t=>Le(t),ot=oe(void 0),ue;(c=>(c.isSome=u=>N.isOk(u),c.isNone=u=>N.isErr(u),c.is=u=>{if(typeof u!="object"||u===null)return!1;let f=u;return f.$type==="ok"&&"value"in f||f.$type==="err"},c.map=(u,f)=>(0,c.isSome)(u)?Ut(f(u.value)):ot,c.flatMap=(u,f)=>(0,c.isSome)(u)?f(u.value):ot,c.fromNullable=u=>u?Ut(u):ot,c.from=u=>{let f=u();return f==null?ot:c.is(f)?f:Ut(f)},c.orElse=(u,f)=>(0,c.isSome)(u)?u.value:f()))(ue||(ue={}));var Ln=(t,e)=>`${t}@${e}`;var By=class{constructor(e){this.svcs=e;this.Modules=new Map;this.getModulesCache=new nr(this.svcs);this.resolveCache=new nr(this.svcs);this.DependencyResolutionCache=new Map;this.ResolverCtx=Fs(()=>({svcs:this.svcs,cache:this.DependencyResolutionCache}))}get folders(){return this.svcs.workspace.WorkspaceManager.workspaceFolders}get ready(){return this.svcs.workspace.WorkspaceManager.ready}resolve(e,r){let n=`${e.Root.toString()}:${r}`,i=this.resolveCache.get(n);if(i)return i;let s=(()=>{var f;let o,a=[e.Manifest.module];a=a.concat(e.Manifest.requires.map(l=>{var p;return(p=l.alias)!=null?p:l.target})),e.Manifest.headers!==void 0&&(a=a.concat(e.Manifest.headers.target));for(let l of a)r.startsWith(l)&&(!o||l.length>o.length)&&(o=l);if(o===void 0)return ot;let c=r.slice(o.length);if(o===e.Manifest.module)return N.map(N.mapErr(this.getModule(e.Root),()=>{}),l=>({mod:l,path:c}));let u=e.Manifest.requires.find(l=>{var p;return((p=l.alias)!=null?p:l.target)===o});if(u!==void 0){let l=this.DependencyResolutionCache.get(Ln(u.target,u.version));return l===void 0?ot:ue.isNone(l)&&u.headers!==void 0&&(l=this.DependencyResolutionCache.get(Ln(u.headers.target,u.headers.version)),l===void 0)?ot:N.map(l,p=>({mod:p,path:c}))}if(o===((f=e.Manifest.headers)==null?void 0:f.target)){let l=e.Manifest.headers,p=this.DependencyResolutionCache.get(Ln(l.target,l.version));return p===void 0?ot:N.map(p,d=>({mod:d,path:c}))}return ot})();return this.resolveCache.set(n,s),s}getModule(e){let r=qy(e).toString(),n=this.getModulesCache.get(r);if(n)return this.Modules.get(n);let i;for(let[s]of this.Modules)r.startsWith(s)&&(!i||s.length>i.length)&&(i=s);return i?(this.getModulesCache.set(r,i),this.getModule(e)):oe("module not found")}async registerModule(e){this.Modules.set(e.Root.toString(),Le(e))}invalidateModule(e){let r=this.getModule(e);if(N.isErr(r))return;let n=r.value.Docs.map(s=>this.svcs.workspace.LangiumDocuments.getDocument(s)).filter(s=>s!==void 0),i=this.svcs.workspace.LangiumDocuments;for(let s of n)i.invalidateDocument(s.uri)}};var N1="kumori",Nne="/";function kI(t,e){let r=De.file(t),n=ee.relative(Nne,ee.dirname(r)),i=ee.basename(r).split(".").slice(0,-1).concat(["kumori"]).join(".");return{uri:ee.joinPath(De.parse(`${N1}:///`),n,i),data:e.trimStart()}}var One=()=>oe(void 0),fp=De.parse(`${N1}:///`),Gr={Stdlib:fp,Kumori:ee.joinPath(fp,"kumori"),KumoriBuiltin:ee.joinPath(fp,"kumori","builtin"),Strconv:ee.joinPath(fp,"strconv"),IO:ee.joinPath(fp,"io")},Hy=class{constructor(e){this.svcs=e;this.PackageDocumentsCache=new nr(this.svcs.shared)}ResolveImportedPackage(e,r){let n=(()=>{let i=this.svcs.shared.references.KumoriModules,s=this.GetPackageURI(e),o=i.getModule(s);if(N.isErr(o))return;let a=i.resolve(o.value,r);if(!ue.isNone(a))return ee.joinPath(a.value.mod.Root,a.value.path)})();return n===void 0&&(n=ee.joinPath(fp,r)),this.GetPackage(n)}GetPackage(e){let r;e instanceof De?r=e:r=this.GetPackageURI(e);let n=this.PackageDocumentsCache.get(r.toString());if(n!==void 0)return n;let i=this._PackageDocuments(r);if(!i.length)return One();let o=i.map(this._PackageName).filter(u=>u!==void 0).pop()||this._InferPackageName(r),c=Le({uri:r,docs:i,name:o});return this.PackageDocumentsCache.set(r.toString(),c),c}GetPackageURI(e){return It(e)&&(e=Fe.getDocument(e)),this._BasePackage(e.uri)}_BasePackage(e){return ee.dirname(e)}_PackageDocuments(e){return this.svcs.shared.workspace.LangiumDocuments.all.filter(r=>CI(e,r.uri)).toArray()}_PackageName(e){var n;let r=e.parseResult.value;if(d1(r))return(n=r.declaration)==null?void 0:n.name}_InferPackageName(e){return ee.basename(e)}};var Ra=ke(require("assert"),1);var rl="self",O1="var",nl="interface",zy=class{constructor(e){this.svcs=e;this.nameProvider=this.svcs.references.NameProvider;this.descriptions=this.svcs.workspace.AstNodeDescriptionProvider;this.pkg=this.svcs.references.KumoriPackages}async computeExports(e,r=ye.CancellationToken.None){var o,a;let n=[];(0,Ra.default)(d1(e.parseResult.value));let i=e.parseResult.value;for(let c of((a=(o=i==null?void 0:i.library)==null?void 0:o.body)==null?void 0:a.statements)||[]){if((c==null?void 0:c.name)===void 0)continue;let u=this.descriptions.createDescription(c,c.name,e);n.push(u)}let s=wI();for(let c of(i==null?void 0:i.artifacts)||[]){await it(r);let u=this.descriptions.createDescription(c,s(c),e);n.push(u)}return n}async computeLocalScopes(e,r=ye.CancellationToken.None){var u,f;(0,Ra.default)(d1(e.parseResult.value));let n=e.parseResult.value,i=new On,s=[],o=(l,p)=>this.descriptions.createDescription(l,p,e),a=wI();for(let l of n.artifacts||[])s.push(o(l,a(l))),await it(r),await this.computeArtifactScopes(r,l,i,o);i.addAll(n,s);let c=[];for(let l of((f=(u=n.library)==null?void 0:u.body)==null?void 0:f.statements)||[])l.name&&(c.push(o(l,l.name)),await it(r));i.addAll(n,c);for(let l of n.imports||[])i.addAll(l,[]);return i}async computeArtifactScopes(e,r,n,i){await this.computeArtifactProperties(e,r.body,n,i);let s=C({},r),o=i(s,O1),a=await this.computeArtifactVariables(e,r.body,i);n.addAll(s,a);let u=[i(r.body,rl),o];if(!Bn(r)){let f=i(r.name,nl);u.push(f)}for(let f of Fe.streamAllContents(r.body).filter(ri))n.addAll(f,u)}async computeArtifactVariables(e,r,n){await it(e);let i=[],s=r.stmt.filter(zu).map(o=>o.variables).flat();for(let o of s){let a=n(o,o.key);i.push(a)}return i}async computeArtifactProperties(e,r,n,i){await it(e),await this.computeArtifacBodyScopesInternal(e,r,n,i)}async computeArtifacBodyScopesInternal(e,r,n,i){await it(e);let s=[],o=Md(r)?r.stmt:_i(r)?r.entries:void 0;(0,Ra.default)(o!==void 0);for(let a of o){if(zu(a))continue;let c=i(a,a.key);s.push(c),a.value&&_i(a.value)&&await this.computeArtifacBodyScopesInternal(e,a.value,n,i)}n.addAll(r,s)}};function wI(){let t=0;return e=>Bn(e)?`#deployment#${t++}`:e.name.value.$refText}var Wy=class{constructor(e){this.svcs=e;this.reflection=this.svcs.shared.AstReflection;this.indexManager=this.svcs.shared.workspace.IndexManager;this.documents=this.svcs.shared.workspace.LangiumDocuments;this.descriptions=this.svcs.workspace.AstNodeDescriptionProvider;this.pkg=this.svcs.references.KumoriPackages;this.stdlibScopeCache=new nr(this.svcs.shared);this.packageScopeCache=new nr(this.svcs.shared);this.moduleExportsCache=new nr(this.svcs.shared)}getScope(e){return this.getScopeInternal(e)}getScopeInternal(e){let r=e.container;return jd(r)?this.getImportScope(r):ri(r)?this.getIdentifierExpressionScope(r):this.getGenericScope(r)}getGenericScope(e){let r=us;return r=new Cn(r.getAllElements(),this.getLocalScope(e)),r=new Cn(r.getAllElements(),this.getImportsScope(e)),r=new Cn(r.getAllElements(),this.getPackageScope(e)),r=new Cn(r.getAllElements(),this.getHeaderPackageScope(e)),r=new Cn(r.getAllElements(),this.getStdlibScope()),r}getImportScope(e){let r=this.pkg.ResolveImportedPackage(e,e.target.$refText);if(N.isErr(r))return us;let n=r.value.docs[0].parseResult.value;q9(n)&&n.declaration&&(n=n.declaration);let i=this.descriptions.createDescription(n,e.target.$refText);return new Pu([i])}getIdentifierExpressionScope(e){if(!ri(e.$container))return this.getGenericScope(e);let r=e.$container.value.ref;return G2(r)&&r.value.ref&&(r=r.value.ref,(0,Ra.default)(r===void 0||Ca(r)||Ns(r)||Ta(r)),r=r==null?void 0:r.body),r===void 0?us:jd(r)?new Cn(nt(this.getModuleExports(r))):zr(r)&&r.value?this.getLocalScope(r.value):this.getLocalScope(r)}getLocalScope(e){let r=Fe.getDocument(e).precomputedScopes;return r?new Cn(nt(r.get(e))):us}getImportsScope(e){var i;let r=Fe.getContainerOfType(e,q9);if(!r)return us;let n=[];for(let s of r.imports||[]){let o=this.pkg.ResolveImportedPackage(s,s.target.$refText);if(N.isErr(o))continue;let a=this.descriptions.createDescription(s,(i=s.alias)!=null?i:o.value.name);n.push(a)}return new Cn(nt(n))}getImportedItems(e){let r=e.alias;if(!r){let s=this.pkg.ResolveImportedPackage(e,e.target.$refText);N.isOk(s)&&(r=s.value.name)}r!==""&&(r=r+".");let n=s=>({documentUri:s.documentUri,name:s.name,path:s.path,type:s.type,nameSegment:s.nameSegment,node:s.node,selectionSegment:s.selectionSegment}),i=[];for(let s of this.getModuleExports(e)){let o=n(s);o.name=r+o.name,i.push(o)}return i}getModuleExports(e){if(!e.target.ref)return[];let r=Fe.getDocument(e.target.ref),n=this.pkg.GetPackage(r);if(N.isErr(n))return[];let i=this.moduleExportsCache.get(n.value.uri.toString());if(i!==void 0)return i;let s=n.value.docs.map(a=>a.uri.toString()),o=this.indexManager.allElements(void 0,new Set(s)).toArray();return this.moduleExportsCache.set(n.value.uri.toString(),o),o}getPackageScope(e){let r=this.pkg.GetPackage(e);if(N.isErr(r))return us;let n=r.value.uri.toString();if(this.packageScopeCache.has(n)){let o=this.packageScopeCache.get(n);return(0,Ra.default)(o),o}let i=this.indexManager.allElements(void 0,new Set(r.value.docs.map(o=>o.uri.toString()))),s=new Cn(nt(Array.from(i)));return this.packageScopeCache.set(n,s),s}getHeaderPackageScope(e){let r=this.svcs.shared.references.KumoriModules,n=Fe.getDocument(e),i=r.getModule(n.uri);if(N.isErr(i))return us;let s=i.value.Manifest.headers;if(s===void 0)return us;let o=r.resolve(i.value,s.target);if(ue.isNone(o))return us;let a=n.uri.toString().replace(i.value.Root.toString(),o.value.mod.Root.toString()),c=this.pkg._BasePackage(De.parse(a)),u=this.pkg.GetPackage(c);if(N.isErr(u))return us;let f=u.value.uri.toString();if(this.packageScopeCache.has(f)){let d=this.packageScopeCache.get(f);return(0,Ra.default)(d),d}let l=this.indexManager.allElements(void 0,new Set(u.value.docs.map(d=>d.uri.toString()))),p=new Cn(nt(Array.from(l)));return this.packageScopeCache.set(f,p),p}getStdlibScope(){let e=this.pkg.GetPackage(Gr.Stdlib);(0,Ra.default)(N.isOk(e));let r=us;for(let n of e.value.docs){let i,s=n.uri.toString();if(this.stdlibScopeCache.has(s)){let o=this.stdlibScopeCache.get(s);(0,Ra.default)(o),i=o}else{let o=this.indexManager.allElements(void 0,new Set([n.uri.toString()]));i=new Cn(nt(Array.from(o))),this.stdlibScopeCache.set(s,i)}r=new Cn(r.getAllElements(),i)}return r}};var Jr=ke(Ui(),1);var I1;(e=>e.from=(r,n)=>{let i=ee.dirname(n.documentUri)+"@"+r;return{name:r,id:i,path:n.path}})(I1||(I1={}));var qi;(n=>(n.$type="optional",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(qi||(qi={}));var co;(n=>(n.$type="either",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(co||(co={}));var Dt;(n=>(n.$type="any",n.create=(i={})=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(Dt||(Dt={}));var qt;(n=>(n.$type="bool",n.create=(i={})=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(qt||(qt={}));var yt;(n=>(n.$type="string",n.create=(i={})=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(yt||(yt={}));var _t;(n=>(n.$type="number",n.create=(i={})=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(_t||(_t={}));var ne;(o=>(o.$type="struct",o.create=a=>C({$type:o.$type},a),o.is=a=>a.$type===o.$type,o.define=a=>{let c=Object.fromEntries(Object.entries(a.parameters).map(([u,f])=>[u,Ho.create({value:f,optional:!1})]));return(0,o.create)(Y(C({},a),{parameters:c}))},o.open=(a={},c=Dt)=>(0,o.define)({open:!0,parameters:a,restriction:c}),o.closed=(a={},c=Dt)=>(0,o.define)({open:!1,parameters:a,restriction:c})))(ne||(ne={}));var Ho;(e=>e.create=r=>C({},r))(Ho||(Ho={}));var zn;(n=>(n.$type="list",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(zn||(zn={}));var ir;(n=>(n.$type="function",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(ir||(ir={}));var Ky;(e=>e.create=r=>C({},r))(Ky||(Ky={}));var AI=[qt.$type,yt.$type,_t.$type],Ic;(r=>(r.is=n=>(0,r.eq)(n.$type),r.eq=n=>AI.includes(n)))(Ic||(Ic={}));var Ine=[...AI,Dt.$type],zo;(n=>(n.create=(i,s)=>({node:s,$type:i}),n.is=i=>(0,n.eq)(i.$type),n.eq=i=>Ine.includes(i)))(zo||(zo={}));var Pa;(e=>e.is=r=>ds.is(r)||Dr.is(r))(Pa||(Pa={}));var ds;(n=>(n.$type="type-def-alias",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(ds||(ds={}));var Dr;(n=>(n.$type="type-def-named",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(Dr||(Dr={}));var de;(n=>(n.$type="error",n.create=i=>C({$type:n.$type},i),n.is=i=>typeof i=="object"&&i!==null&&"$type"in i&&i.$type===n.$type&&"message"in i&&typeof i.message=="string"&&"node"in i&&It(i.node)))(de||(de={}));function se(t){if(co.is(t))return t.variations.map(se).join(" | ");if(ir.is(t)){let e=se(t.returns),r=t.params.map(({name:n,value:i})=>`${n}: ${se(i)}`).join(", ");return`func ${t.meta.name}(${r}) => ${e}`}if(ne.is(t))return`struct { ${Array.from(Object.entries(t.parameters)).filter(([,r])=>r!==void 0).map(([r,n])=>`${r}: ${se(n.value)}`).join(", ")} }`;if(zn.is(t))return`[]${se(t.restriction)}`;if(ds.is(t))return`alias ${t.name}: ${se(t.spec)}`;if(Dr.is(t))return`type ${t.meta.id}: ${se(t.spec)}`;if(qi.is(t))return`Optional<${se(t.inner)}>`;if(Ic.is(t)&&t.literal!==void 0)switch(t.$type){case"string":return`"${t.literal}"`;case"number":return`${t.literal}`;case"bool":return`${t.literal}`}return t.$type}function U7(t,e,...r){var i;let n=(i=t.parameters[e])==null?void 0:i.value;return n===void 0?ot:r.length===0?Ut(n):ne.is(n)?U7(n,...r):ot}var Gy=class extends Ay{constructor(r){super(r);this.svcs=r;this.types=this.svcs.validation.KumoriTypeSystem;this.ctx=this.types.NewContext()}highlightElement(r,n){if(ri(r))return RI(this,r,n);if(Ud(r))return n({node:r,property:"value",type:Jr.SemanticTokenTypes.number});if(qd(r))return n({node:r,property:"value",type:Jr.SemanticTokenTypes.number});if(Bd(r))return n({node:r,property:"value",type:Jr.SemanticTokenTypes.string});if(Vd(r))return n({node:r,property:"value",type:Jr.SemanticTokenTypes.keyword});if(VA(r))return n({node:r,property:"name",type:Jr.SemanticTokenTypes.namespace});if(jd(r))return n({node:r,property:"alias",type:Jr.SemanticTokenTypes.namespace});if(MA(r))return n({node:r,property:"name",type:Jr.SemanticTokenTypes.parameter});if(zr(r))return n({node:r,property:"key",type:Jr.SemanticTokenTypes.variable});if(Ku(r))return n({node:r,property:"name",type:Jr.SemanticTokenTypes.type});if(Wu(r))return n({node:r,property:"name",type:Jr.SemanticTokenTypes.type});if(Y2(r)){n({node:r,property:"name",type:Jr.SemanticTokenTypes.function}),RI(this,r.returns,n);return}}};function RI(t,e,r){let n=e.value.ref;if(!n)return r({node:e,property:"value",type:Jr.SemanticTokenTypes.variable});if([rl,O1,nl].includes(e.value.$refText))return r({node:e,property:"value",type:Jr.SemanticTokenTypes.keyword});if(!ri(e.$container)&&zo.eq(e.value.$refText))return r({node:e,property:"value",type:Jr.SemanticTokenTypes.keyword});if(jd(n))return r({node:e,property:"value",type:Jr.SemanticTokenTypes.namespace});if(Fd(n))return r({node:e,property:"value",type:Jr.SemanticTokenTypes.variable});let[i]=t.types.Infer(t.ctx,n);if(i!==void 0)return Pa.is(i)?r({node:e,property:"value",type:Jr.SemanticTokenTypes.type}):ir.is(i)?r({node:e,property:"value",type:Jr.SemanticTokenTypes.function}):ne.is(i)?r({node:e,property:"value",type:Jr.SemanticTokenTypes.struct}):Ku(n)||Wu(n)?r({node:e,property:"value",type:Jr.SemanticTokenTypes.type}):r({node:e,property:"value",type:Jr.SemanticTokenTypes.variable})}var PI=ke(require("assert"),1);function il(t,e){let r=new Set(t);for(let n of t)e.has(n)&&r.delete(n);return r}function Jy(t,e){let r=t,n=e;e.size<t.size&&(r=e,n=t);let i=new Set;for(let s of r)n.has(s)&&i.add(s);return i}function Bi(t,e){return e!==void 0?Y(C({},t),{node:e}):t}var D1=()=>Le(void 0);function ps(t,e,r){let n=t.cache.get(e,r);if(n)return n;t.cache.set(e,r,oe([{from:e,to:r,cause:"recursive expression"}]));let i=Dne(t,e,r);return t.cache.set(e,r,i),i}function Dne(t,e,r){if(Dt.is(e)||Dt.is(r))return D1();if(qi.is(e)&&qi.is(r))return ps(t,e.inner,r.inner);if(qi.is(r))return ps(t,e,r.inner);if(ds.is(e))return ps(t,e.spec,r);if(ds.is(r))return ps(t,e,r.spec);if(ir.is(e))return ps(t,e.returns,r);if(co.is(e)&&e.variations.length){let f=e.variations.map(l=>ps(t,l,r)).filter(N.isErr);return f.length?oe(f.map(({err:l})=>l).flat()):D1()}if(co.is(r)&&r.variations.length){let f=r.variations.map(l=>ps(t,e,l)).filter(N.isErr);return f.length===r.variations.length?oe(f.map(({err:l})=>l).flat()):D1()}let n=qt.is(e)&&qt.is(r)&&(r.literal===void 0||e.literal===r.literal),i=yt.is(e)&&yt.is(r)&&(r.literal===void 0||e.literal===r.literal),s=_t.is(e)&&_t.is(r)&&(r.literal===void 0||e.literal===r.literal),o=Dr.is(e)&&Dr.is(r)&&e.meta.id===r.meta.id;if(n||i||s||o)return D1();if(zn.is(e)&&zn.is(r))return ps(t,e.restriction,r.restriction);if(ne.is(e)&&ne.is(r)){let u=[],f=new Set(Object.keys(e.parameters)),l=new Set(Object.keys(r.parameters)),p=new Set(Object.entries(r.parameters).filter(([,$])=>$==null?void 0:$.optional).map(([$])=>$)),d=Jy(l,f),g=Array.from(d.entries()).map(([$])=>[$,ps(t,Bi(e.parameters[$].value,e.parameters[$].node),r.parameters[$].value)]).map(([,$])=>$).filter($=>N.isErr($)).map($=>$.err).flat(),v=[];if(r.restriction)for(let $ of f){let K=e.parameters[$];(0,PI.default)(K!==void 0);let z=ps(t,Bi(K.value,K.node),r.restriction);N.isErr(z)&&(v=v.concat(z.err))}let b=[];if(e.restriction&&r.restriction){let $=ps(t,Bi(e.restriction,e),r.restriction);N.isErr($)&&(b=$.err)}let _=il(l,d),x=p;_=il(_,x);let T=[];r.open||(T=Array.from(_).map($=>[$,`key '${$}' is missing`]).map(([$,K])=>({from:e,to:Y(C({},r),{node:r.parameters[$].node}),cause:K})));let R="";if(_.size){let $=Array.from(x.keys()).map(W=>W+"?"),K=Array.from(_.keys());R=`: must be one of [${[...$,...K].sort().join(", ")}]`}let V=[];if(!r.open){let $=_.size?R:"",K=il(f,l);K.size>0&&($=`must be one of [${Array.from(l).join(", ")}]`,V=Array.from(K.keys()).map(z=>[z,`key '${z}' not allowed ${$}`]).map(([z,W])=>({from:ne.create(Y(C({},e),{node:e.parameters[z].node})),to:r,cause:W})))}return u=u.concat(g,v,b,T,V),u.length?oe(u):D1()}let c=`cannot assign '${se(e)}' to '${se(r)}'`;return oe([{from:e,to:r,cause:c}])}function Qy(t){let e=[],r=t;for(;ri(r);)e.push(r),r=r.next;return e}function Yy(t){for(;ri(t.next);)t=t.next;return t}var q7=ke(require("assert"),1);function Zy(t,e){(0,q7.default)(e.node);let r=t.references.KumoriPackages.GetPackage(e.node);return(0,q7.default)(N.isOk(r)),dp(r.value.uri,e.meta.name)}var dp=(t,e)=>`${t.toString()}@${e}`,NI=dp(Gr.Strconv,"Format"),OI=dp(Gr.Strconv,"JSON"),II=dp(Gr.Strconv,"Concat"),DI=dp(Gr.Strconv,"Join"),LI=dp(Gr.IO,"Open"),Wn={strconv:{Format:NI,JSON:OI,Concat:II,Join:DI},io:{Open:LI}},ODe={[NI]:Wn.strconv.Format,[OI]:Wn.strconv.JSON,[II]:Wn.strconv.Concat,[DI]:Wn.strconv.Join,[LI]:Wn.io.Open};var k={};ua(k,{BRAND:()=>oie,DIRTY:()=>sl,EMPTY_PATH:()=>Fne,INVALID:()=>Qe,NEVER:()=>Hie,OK:()=>oi,ParseStatus:()=>Kn,Schema:()=>vt,ZodAny:()=>$c,ZodArray:()=>Da,ZodBigInt:()=>al,ZodBoolean:()=>cl,ZodBranded:()=>$1,ZodCatch:()=>xl,ZodDate:()=>ul,ZodDefault:()=>vl,ZodDiscriminatedUnion:()=>t4,ZodEffects:()=>Us,ZodEnum:()=>gl,ZodError:()=>Hi,ZodFirstPartyTypeKind:()=>tt,ZodFunction:()=>n4,ZodIntersection:()=>pl,ZodIssueCode:()=>ae,ZodLazy:()=>ml,ZodLiteral:()=>hl,ZodMap:()=>vp,ZodNaN:()=>_p,ZodNativeEnum:()=>yl,ZodNever:()=>uo,ZodNull:()=>fl,ZodNullable:()=>Go,ZodNumber:()=>ol,ZodObject:()=>zi,ZodOptional:()=>Vs,ZodParsedType:()=>Ae,ZodPipeline:()=>M1,ZodPromise:()=>Mc,ZodReadonly:()=>_l,ZodRecord:()=>r4,ZodSchema:()=>vt,ZodSet:()=>xp,ZodString:()=>Lc,ZodSymbol:()=>gp,ZodTransformer:()=>Us,ZodTuple:()=>Ko,ZodType:()=>vt,ZodUndefined:()=>ll,ZodUnion:()=>dl,ZodUnknown:()=>Ia,ZodVoid:()=>yp,addIssueToContext:()=>Se,any:()=>hie,array:()=>xie,bigint:()=>lie,boolean:()=>WI,coerce:()=>Bie,custom:()=>BI,date:()=>fie,datetimeRegex:()=>UI,defaultErrorMap:()=>Na,discriminatedUnion:()=>Eie,effect:()=>Lie,enum:()=>Oie,function:()=>Rie,getErrorMap:()=>pp,getParsedType:()=>Wo,instanceof:()=>cie,intersection:()=>Tie,isAborted:()=>Xy,isAsync:()=>mp,isDirty:()=>e4,isValid:()=>Dc,late:()=>aie,lazy:()=>Pie,literal:()=>Nie,makeIssue:()=>L1,map:()=>wie,nan:()=>uie,nativeEnum:()=>Iie,never:()=>yie,null:()=>mie,nullable:()=>Mie,number:()=>zI,object:()=>_ie,objectUtil:()=>B7,oboolean:()=>qie,onumber:()=>Uie,optional:()=>$ie,ostring:()=>jie,pipeline:()=>Vie,preprocess:()=>Fie,promise:()=>Die,quotelessJson:()=>Lne,record:()=>kie,set:()=>Aie,setErrorMap:()=>Mne,strictObject:()=>bie,string:()=>HI,symbol:()=>die,transformer:()=>Lie,tuple:()=>Cie,undefined:()=>pie,union:()=>Sie,unknown:()=>gie,util:()=>Et,void:()=>vie});var Et;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Et||(Et={}));var B7;(function(t){t.mergeShapes=(e,r)=>C(C({},e),r)})(B7||(B7={}));var Ae=Et.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wo=t=>{switch(typeof t){case"undefined":return Ae.undefined;case"string":return Ae.string;case"number":return Number.isNaN(t)?Ae.nan:Ae.number;case"boolean":return Ae.boolean;case"function":return Ae.function;case"bigint":return Ae.bigint;case"symbol":return Ae.symbol;case"object":return Array.isArray(t)?Ae.array:t===null?Ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ae.promise:typeof Map!="undefined"&&t instanceof Map?Ae.map:typeof Set!="undefined"&&t instanceof Set?Ae.set:typeof Date!="undefined"&&t instanceof Date?Ae.date:Ae.object;default:return Ae.unknown}};var ae=Et.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Lne=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Hi=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Et.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Hi.create=t=>new Hi(t);var $ne=(t,e)=>{let r;switch(t.code){case ae.invalid_type:t.received===Ae.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ae.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Et.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:r=`Unrecognized key(s) in object: ${Et.joinValues(t.keys,", ")}`;break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Et.joinValues(t.options)}`;break;case ae.invalid_enum_value:r=`Invalid enum value. Expected ${Et.joinValues(t.options)}, received '${t.received}'`;break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Et.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ae.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ae.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ae.not_finite:r="Number must be finite";break;default:r=e.defaultError,Et.assertNever(t)}return{message:r}},Na=$ne;var $I=Na;function Mne(t){$I=t}function pp(){return $I}var L1=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o=Y(C({},i),{path:s});if(i.message!==void 0)return Y(C({},i),{path:s,message:i.message});let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(o,{data:e,defaultError:a}).message;return Y(C({},i),{path:s,message:a})},Fne=[];function Se(t,e){let r=pp(),n=L1({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Na?void 0:Na].filter(i=>!!i)});t.common.issues.push(n)}var Kn=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Qe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let s=await i.key,o=await i.value;n.push({key:s,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Qe;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},Qe=Object.freeze({status:"aborted"}),sl=t=>({status:"dirty",value:t}),oi=t=>({status:"valid",value:t}),Xy=t=>t.status==="aborted",e4=t=>t.status==="dirty",Dc=t=>t.status==="valid",mp=t=>typeof Promise!="undefined"&&t instanceof Promise;var He;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(He||(He={}));var js=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},MI=(t,e)=>{if(Dc(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Hi(t.common.issues);return this._error=r,this._error}}};function ht(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{var u,f;let{message:c}=t;return o.code==="invalid_enum_value"?{message:c!=null?c:a.defaultError}:typeof a.data=="undefined"?{message:(u=c!=null?c:n)!=null?u:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(f=c!=null?c:r)!=null?f:a.defaultError}},description:i}}var vt=class{get description(){return this._def.description}_getType(e){return Wo(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Kn,ctx:{common:e.parent.common,data:e.data,parsedType:Wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(mp(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var s;let n={common:{issues:[],async:(s=r==null?void 0:r.async)!=null?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wo(e)},i=this._parseSync({data:e,path:n.path,parent:n});return MI(n,i)}"~validate"(e){var n,i;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wo(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:r});return Dc(s)?{value:s.value}:{issues:r.common.issues}}catch(s){(i=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(s=>Dc(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wo(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(mp(i)?i:Promise.resolve(i));return MI(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue(C({code:ae.custom},n(i)));return typeof Promise!="undefined"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Us({schema:this,typeName:tt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Vs.create(this,this._def)}nullable(){return Go.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Da.create(this)}promise(){return Mc.create(this,this._def)}or(e){return dl.create([this,e],this._def)}and(e){return pl.create(this,e,this._def)}transform(e){return new Us(Y(C({},ht(this._def)),{schema:this,typeName:tt.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let r=typeof e=="function"?e:()=>e;return new vl(Y(C({},ht(this._def)),{innerType:this,defaultValue:r,typeName:tt.ZodDefault}))}brand(){return new $1(C({typeName:tt.ZodBranded,type:this},ht(this._def)))}catch(e){let r=typeof e=="function"?e:()=>e;return new xl(Y(C({},ht(this._def)),{innerType:this,catchValue:r,typeName:tt.ZodCatch}))}describe(e){let r=this.constructor;return new r(Y(C({},this._def),{description:e}))}pipe(e){return M1.create(this,e)}readonly(){return _l.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Vne=/^c[^\s-]{8,}$/i,jne=/^[0-9a-z]+$/,Une=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qne=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Bne=/^[a-z0-9_-]{21}$/i,Hne=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,zne=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Wne=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kne="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",H7,Gne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Jne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Qne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Yne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zne=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xne=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,VI="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",eie=new RegExp(`^${VI}$`);function jI(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function tie(t){return new RegExp(`^${jI(t)}$`)}function UI(t){let e=`${VI}T${jI(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function rie(t,e){return!!((e==="v4"||!e)&&Gne.test(t)||(e==="v6"||!e)&&Qne.test(t))}function nie(t,e){if(!Hne.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch(r){return!1}}function iie(t,e){return!!((e==="v4"||!e)&&Jne.test(t)||(e==="v6"||!e)&&Yne.test(t))}var Lc=class t extends vt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ae.string){let s=this._getOrReturnCtx(e);return Se(s,{code:ae.invalid_type,expected:Ae.string,received:s.parsedType}),Qe}let n=new Kn,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?Se(i,{code:ae.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Se(i,{code:ae.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Wne.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"email",code:ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")H7||(H7=new RegExp(Kne,"u")),H7.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"emoji",code:ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")qne.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"uuid",code:ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Bne.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"nanoid",code:ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Vne.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"cuid",code:ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")jne.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"cuid2",code:ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Une.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"ulid",code:ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch(o){i=this._getOrReturnCtx(e,i),Se(i,{validation:"url",code:ae.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"regex",code:ae.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?UI(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?eie.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?tie(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?zne.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"duration",code:ae.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?rie(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"ip",code:ae.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?nie(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"jwt",code:ae.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?iie(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"cidr",code:ae.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Zne.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"base64",code:ae.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Xne.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"base64url",code:ae.invalid_string,message:s.message}),n.dirty()):Et.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),C({validation:r,code:ae.invalid_string},He.errToObj(n)))}_addCheck(e){return new t(Y(C({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(C({kind:"email"},He.errToObj(e)))}url(e){return this._addCheck(C({kind:"url"},He.errToObj(e)))}emoji(e){return this._addCheck(C({kind:"emoji"},He.errToObj(e)))}uuid(e){return this._addCheck(C({kind:"uuid"},He.errToObj(e)))}nanoid(e){return this._addCheck(C({kind:"nanoid"},He.errToObj(e)))}cuid(e){return this._addCheck(C({kind:"cuid"},He.errToObj(e)))}cuid2(e){return this._addCheck(C({kind:"cuid2"},He.errToObj(e)))}ulid(e){return this._addCheck(C({kind:"ulid"},He.errToObj(e)))}base64(e){return this._addCheck(C({kind:"base64"},He.errToObj(e)))}base64url(e){return this._addCheck(C({kind:"base64url"},He.errToObj(e)))}jwt(e){return this._addCheck(C({kind:"jwt"},He.errToObj(e)))}ip(e){return this._addCheck(C({kind:"ip"},He.errToObj(e)))}cidr(e){return this._addCheck(C({kind:"cidr"},He.errToObj(e)))}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(C({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!=null?r:!1,local:(n=e==null?void 0:e.local)!=null?n:!1},He.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(C({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision},He.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(C({kind:"duration"},He.errToObj(e)))}regex(e,r){return this._addCheck(C({kind:"regex",regex:e},He.errToObj(r)))}includes(e,r){return this._addCheck(C({kind:"includes",value:e,position:r==null?void 0:r.position},He.errToObj(r==null?void 0:r.message)))}startsWith(e,r){return this._addCheck(C({kind:"startsWith",value:e},He.errToObj(r)))}endsWith(e,r){return this._addCheck(C({kind:"endsWith",value:e},He.errToObj(r)))}min(e,r){return this._addCheck(C({kind:"min",value:e},He.errToObj(r)))}max(e,r){return this._addCheck(C({kind:"max",value:e},He.errToObj(r)))}length(e,r){return this._addCheck(C({kind:"length",value:e},He.errToObj(r)))}nonempty(e){return this.min(1,He.errToObj(e))}trim(){return new t(Y(C({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new t(Y(C({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new t(Y(C({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Lc.create=t=>{var e;return new Lc(C({checks:[],typeName:tt.ZodString,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1},ht(t)))};function sie(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return s%o/10**i}var ol=class t extends vt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ae.number){let s=this._getOrReturnCtx(e);return Se(s,{code:ae.invalid_type,expected:Ae.number,received:s.parsedType}),Qe}let n,i=new Kn;for(let s of this._def.checks)s.kind==="int"?Et.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Se(n,{code:ae.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:ae.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:ae.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?sie(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Se(n,{code:ae.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Se(n,{code:ae.not_finite,message:s.message}),i.dirty()):Et.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,He.toString(r))}gt(e,r){return this.setLimit("min",e,!1,He.toString(r))}lte(e,r){return this.setLimit("max",e,!0,He.toString(r))}lt(e,r){return this.setLimit("max",e,!1,He.toString(r))}setLimit(e,r,n,i){return new t(Y(C({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:He.toString(i)}]}))}_addCheck(e){return new t(Y(C({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:He.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:He.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:He.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:He.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:He.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:He.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:He.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:He.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:He.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Et.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};ol.create=t=>new ol(C({checks:[],typeName:tt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1},ht(t)));var al=class t extends vt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(s){return this._getInvalidInput(e)}if(this._getType(e)!==Ae.bigint)return this._getInvalidInput(e);let n,i=new Kn;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:ae.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:ae.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:ae.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Et.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return Se(r,{code:ae.invalid_type,expected:Ae.bigint,received:r.parsedType}),Qe}gte(e,r){return this.setLimit("min",e,!0,He.toString(r))}gt(e,r){return this.setLimit("min",e,!1,He.toString(r))}lte(e,r){return this.setLimit("max",e,!0,He.toString(r))}lt(e,r){return this.setLimit("max",e,!1,He.toString(r))}setLimit(e,r,n,i){return new t(Y(C({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:He.toString(i)}]}))}_addCheck(e){return new t(Y(C({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:He.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:He.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:He.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:He.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:He.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};al.create=t=>{var e;return new al(C({checks:[],typeName:tt.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1},ht(t)))};var cl=class extends vt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ae.boolean){let n=this._getOrReturnCtx(e);return Se(n,{code:ae.invalid_type,expected:Ae.boolean,received:n.parsedType}),Qe}return oi(e.data)}};cl.create=t=>new cl(C({typeName:tt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1},ht(t)));var ul=class t extends vt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ae.date){let s=this._getOrReturnCtx(e);return Se(s,{code:ae.invalid_type,expected:Ae.date,received:s.parsedType}),Qe}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return Se(s,{code:ae.invalid_date}),Qe}let n=new Kn,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),Se(i,{code:ae.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Et.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t(Y(C({},this._def),{checks:[...this._def.checks,e]}))}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:He.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:He.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ul.create=t=>new ul(C({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:tt.ZodDate},ht(t)));var gp=class extends vt{_parse(e){if(this._getType(e)!==Ae.symbol){let n=this._getOrReturnCtx(e);return Se(n,{code:ae.invalid_type,expected:Ae.symbol,received:n.parsedType}),Qe}return oi(e.data)}};gp.create=t=>new gp(C({typeName:tt.ZodSymbol},ht(t)));var ll=class extends vt{_parse(e){if(this._getType(e)!==Ae.undefined){let n=this._getOrReturnCtx(e);return Se(n,{code:ae.invalid_type,expected:Ae.undefined,received:n.parsedType}),Qe}return oi(e.data)}};ll.create=t=>new ll(C({typeName:tt.ZodUndefined},ht(t)));var fl=class extends vt{_parse(e){if(this._getType(e)!==Ae.null){let n=this._getOrReturnCtx(e);return Se(n,{code:ae.invalid_type,expected:Ae.null,received:n.parsedType}),Qe}return oi(e.data)}};fl.create=t=>new fl(C({typeName:tt.ZodNull},ht(t)));var $c=class extends vt{constructor(){super(...arguments),this._any=!0}_parse(e){return oi(e.data)}};$c.create=t=>new $c(C({typeName:tt.ZodAny},ht(t)));var Ia=class extends vt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return oi(e.data)}};Ia.create=t=>new Ia(C({typeName:tt.ZodUnknown},ht(t)));var uo=class extends vt{_parse(e){let r=this._getOrReturnCtx(e);return Se(r,{code:ae.invalid_type,expected:Ae.never,received:r.parsedType}),Qe}};uo.create=t=>new uo(C({typeName:tt.ZodNever},ht(t)));var yp=class extends vt{_parse(e){if(this._getType(e)!==Ae.undefined){let n=this._getOrReturnCtx(e);return Se(n,{code:ae.invalid_type,expected:Ae.void,received:n.parsedType}),Qe}return oi(e.data)}};yp.create=t=>new yp(C({typeName:tt.ZodVoid},ht(t)));var Da=class t extends vt{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==Ae.array)return Se(r,{code:ae.invalid_type,expected:Ae.array,received:r.parsedType}),Qe;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(Se(r,{code:o?ae.too_big:ae.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Se(r,{code:ae.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Se(r,{code:ae.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new js(r,o,r.path,a)))).then(o=>Kn.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new js(r,o,r.path,a)));return Kn.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t(Y(C({},this._def),{minLength:{value:e,message:He.toString(r)}}))}max(e,r){return new t(Y(C({},this._def),{maxLength:{value:e,message:He.toString(r)}}))}length(e,r){return new t(Y(C({},this._def),{exactLength:{value:e,message:He.toString(r)}}))}nonempty(e){return this.min(1,e)}};Da.create=(t,e)=>new Da(C({type:t,minLength:null,maxLength:null,exactLength:null,typeName:tt.ZodArray},ht(e)));function hp(t){if(t instanceof zi){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Vs.create(hp(n))}return new zi(Y(C({},t._def),{shape:()=>e}))}else return t instanceof Da?new Da(Y(C({},t._def),{type:hp(t.element)})):t instanceof Vs?Vs.create(hp(t.unwrap())):t instanceof Go?Go.create(hp(t.unwrap())):t instanceof Ko?Ko.create(t.items.map(e=>hp(e))):t}var zi=class t extends vt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Et.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==Ae.object){let u=this._getOrReturnCtx(e);return Se(u,{code:ae.invalid_type,expected:Ae.object,received:u.parsedType}),Qe}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof uo&&this._def.unknownKeys==="strip"))for(let u in i.data)o.includes(u)||a.push(u);let c=[];for(let u of o){let f=s[u],l=i.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new js(i,l,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof uo){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")a.length>0&&(Se(i,{code:ae.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of a){let l=i.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new js(i,l,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of c){let l=await f.key,p=await f.value;u.push({key:l,value:p,alwaysSet:f.alwaysSet})}return u}).then(u=>Kn.mergeObjectSync(n,u)):Kn.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return He.errToObj,new t(C(Y(C({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(r,n)=>{var s,o,a,c;let i=(a=(o=(s=this._def).errorMap)==null?void 0:o.call(s,r,n).message)!=null?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(c=He.errToObj(e).message)!=null?c:i}:{message:i}}}:{}))}strip(){return new t(Y(C({},this._def),{unknownKeys:"strip"}))}passthrough(){return new t(Y(C({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new t(Y(C({},this._def),{shape:()=>C(C({},this._def.shape()),e)}))}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>C(C({},this._def.shape()),e._def.shape()),typeName:tt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t(Y(C({},this._def),{catchall:e}))}pick(e){let r={};for(let n of Et.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t(Y(C({},this._def),{shape:()=>r}))}omit(e){let r={};for(let n of Et.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t(Y(C({},this._def),{shape:()=>r}))}deepPartial(){return hp(this)}partial(e){let r={};for(let n of Et.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t(Y(C({},this._def),{shape:()=>r}))}required(e){let r={};for(let n of Et.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Vs;)s=s._def.innerType;r[n]=s}return new t(Y(C({},this._def),{shape:()=>r}))}keyof(){return qI(Et.objectKeys(this.shape))}};zi.create=(t,e)=>new zi(C({shape:()=>t,unknownKeys:"strip",catchall:uo.create(),typeName:tt.ZodObject},ht(e)));zi.strictCreate=(t,e)=>new zi(C({shape:()=>t,unknownKeys:"strict",catchall:uo.create(),typeName:tt.ZodObject},ht(e)));zi.lazycreate=(t,e)=>new zi(C({shape:t,unknownKeys:"strip",catchall:uo.create(),typeName:tt.ZodObject},ht(e)));var dl=class extends vt{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Hi(a.ctx.common.issues));return Se(r,{code:ae.invalid_union,unionErrors:o}),Qe}if(r.common.async)return Promise.all(n.map(async s=>{let o=Y(C({},r),{common:Y(C({},r.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let c of n){let u=Y(C({},r),{common:Y(C({},r.common),{issues:[]}),parent:null}),f=c._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(c=>new Hi(c));return Se(r,{code:ae.invalid_union,unionErrors:a}),Qe}}get options(){return this._def.options}};dl.create=(t,e)=>new dl(C({options:t,typeName:tt.ZodUnion},ht(e)));var Oa=t=>t instanceof ml?Oa(t.schema):t instanceof Us?Oa(t.innerType()):t instanceof hl?[t.value]:t instanceof gl?t.options:t instanceof yl?Et.objectValues(t.enum):t instanceof vl?Oa(t._def.innerType):t instanceof ll?[void 0]:t instanceof fl?[null]:t instanceof Vs?[void 0,...Oa(t.unwrap())]:t instanceof Go?[null,...Oa(t.unwrap())]:t instanceof $1||t instanceof _l?Oa(t.unwrap()):t instanceof xl?Oa(t._def.innerType):[],t4=class t extends vt{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Ae.object)return Se(r,{code:ae.invalid_type,expected:Ae.object,received:r.parsedType}),Qe;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(Se(r,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Qe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=Oa(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new t(C({typeName:tt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i},ht(n)))}};function z7(t,e){let r=Wo(t),n=Wo(e);if(t===e)return{valid:!0,data:t};if(r===Ae.object&&n===Ae.object){let i=Et.objectKeys(e),s=Et.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o=C(C({},t),e);for(let a of s){let c=z7(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===Ae.array&&n===Ae.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],c=z7(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===Ae.date&&n===Ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var pl=class extends vt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(Xy(s)||Xy(o))return Qe;let a=z7(s.value,o.value);return a.valid?((e4(s)||e4(o))&&r.dirty(),{status:r.value,value:a.data}):(Se(n,{code:ae.invalid_intersection_types}),Qe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};pl.create=(t,e,r)=>new pl(C({left:t,right:e,typeName:tt.ZodIntersection},ht(r)));var Ko=class t extends vt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ae.array)return Se(n,{code:ae.invalid_type,expected:Ae.array,received:n.parsedType}),Qe;if(n.data.length<this._def.items.length)return Se(n,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Qe;!this._def.rest&&n.data.length>this._def.items.length&&(Se(n,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new js(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Kn.mergeArray(r,o)):Kn.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t(Y(C({},this._def),{rest:e}))}};Ko.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ko(C({items:t,typeName:tt.ZodTuple,rest:null},ht(e)))};var r4=class t extends vt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ae.object)return Se(n,{code:ae.invalid_type,expected:Ae.object,received:n.parsedType}),Qe;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new js(n,a,n.path,a)),value:o._parse(new js(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Kn.mergeObjectAsync(r,i):Kn.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof vt?new t(C({keyType:e,valueType:r,typeName:tt.ZodRecord},ht(n))):new t(C({keyType:Lc.create(),valueType:e,typeName:tt.ZodRecord},ht(r)))}},vp=class extends vt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ae.map)return Se(n,{code:ae.invalid_type,expected:Ae.map,received:n.parsedType}),Qe;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new js(n,a,n.path,[u,"key"])),value:s._parse(new js(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return Qe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of o){let u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return Qe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}}}};vp.create=(t,e,r)=>new vp(C({valueType:e,keyType:t,typeName:tt.ZodMap},ht(r)));var xp=class t extends vt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ae.set)return Se(n,{code:ae.invalid_type,expected:Ae.set,received:n.parsedType}),Qe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Se(n,{code:ae.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Se(n,{code:ae.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(c){let u=new Set;for(let f of c){if(f.status==="aborted")return Qe;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>s._parse(new js(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new t(Y(C({},this._def),{minSize:{value:e,message:He.toString(r)}}))}max(e,r){return new t(Y(C({},this._def),{maxSize:{value:e,message:He.toString(r)}}))}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};xp.create=(t,e)=>new xp(C({valueType:t,minSize:null,maxSize:null,typeName:tt.ZodSet},ht(e)));var n4=class t extends vt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Ae.function)return Se(r,{code:ae.invalid_type,expected:Ae.function,received:r.parsedType}),Qe;function n(a,c){return L1({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,pp(),Na].filter(u=>!!u),issueData:{code:ae.invalid_arguments,argumentsError:c}})}function i(a,c){return L1({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,pp(),Na].filter(u=>!!u),issueData:{code:ae.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Mc){let a=this;return oi(async function(...c){let u=new Hi([]),f=await a._def.args.parseAsync(c,s).catch(d=>{throw u.addIssue(n(c,d)),u}),l=await Reflect.apply(o,this,f);return await a._def.returns._def.type.parseAsync(l,s).catch(d=>{throw u.addIssue(i(l,d)),u})})}else{let a=this;return oi(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new Hi([n(c,u.error)]);let f=Reflect.apply(o,this,u.data),l=a._def.returns.safeParse(f,s);if(!l.success)throw new Hi([i(f,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t(Y(C({},this._def),{args:Ko.create(e).rest(Ia.create())}))}returns(e){return new t(Y(C({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t(C({args:e||Ko.create([]).rest(Ia.create()),returns:r||Ia.create(),typeName:tt.ZodFunction},ht(n)))}},ml=class extends vt{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ml.create=(t,e)=>new ml(C({getter:t,typeName:tt.ZodLazy},ht(e)));var hl=class extends vt{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Se(r,{received:r.data,code:ae.invalid_literal,expected:this._def.value}),Qe}return{status:"valid",value:e.data}}get value(){return this._def.value}};hl.create=(t,e)=>new hl(C({value:t,typeName:tt.ZodLiteral},ht(e)));function qI(t,e){return new gl(C({values:t,typeName:tt.ZodEnum},ht(e)))}var gl=class t extends vt{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return Se(r,{expected:Et.joinValues(n),received:r.parsedType,code:ae.invalid_type}),Qe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return Se(r,{received:r.data,code:ae.invalid_enum_value,options:n}),Qe}return oi(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,C(C({},this._def),r))}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),C(C({},this._def),r))}};gl.create=qI;var yl=class extends vt{_parse(e){let r=Et.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Ae.string&&n.parsedType!==Ae.number){let i=Et.objectValues(r);return Se(n,{expected:Et.joinValues(i),received:n.parsedType,code:ae.invalid_type}),Qe}if(this._cache||(this._cache=new Set(Et.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=Et.objectValues(r);return Se(n,{received:n.data,code:ae.invalid_enum_value,options:i}),Qe}return oi(e.data)}get enum(){return this._def.values}};yl.create=(t,e)=>new yl(C({values:t,typeName:tt.ZodNativeEnum},ht(e)));var Mc=class extends vt{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Ae.promise&&r.common.async===!1)return Se(r,{code:ae.invalid_type,expected:Ae.promise,received:r.parsedType}),Qe;let n=r.parsedType===Ae.promise?r.data:Promise.resolve(r.data);return oi(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Mc.create=(t,e)=>new Mc(C({type:t,typeName:tt.ZodPromise},ht(e)));var Us=class extends vt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===tt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Se(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return Qe;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Qe:c.status==="dirty"?sl(c.value):r.value==="dirty"?sl(c.value):c});{if(r.value==="aborted")return Qe;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?Qe:a.status==="dirty"?sl(a.value):r.value==="dirty"?sl(a.value):a}}if(i.type==="refinement"){let o=a=>{let c=i.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Qe:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Qe:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Dc(o))return Qe;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Dc(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):Qe);Et.assertNever(i)}};Us.create=(t,e,r)=>new Us(C({schema:t,typeName:tt.ZodEffects,effect:e},ht(r)));Us.createWithPreprocess=(t,e,r)=>new Us(C({schema:e,effect:{type:"preprocess",transform:t},typeName:tt.ZodEffects},ht(r)));var Vs=class extends vt{_parse(e){return this._getType(e)===Ae.undefined?oi(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Vs.create=(t,e)=>new Vs(C({innerType:t,typeName:tt.ZodOptional},ht(e)));var Go=class extends vt{_parse(e){return this._getType(e)===Ae.null?oi(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Go.create=(t,e)=>new Go(C({innerType:t,typeName:tt.ZodNullable},ht(e)));var vl=class extends vt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Ae.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};vl.create=(t,e)=>new vl(C({innerType:t,typeName:tt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},ht(e)));var xl=class extends vt{_parse(e){let{ctx:r}=this._processInputParams(e),n=Y(C({},r),{common:Y(C({},r.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:C({},n)});return mp(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Hi(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Hi(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};xl.create=(t,e)=>new xl(C({innerType:t,typeName:tt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},ht(e)));var _p=class extends vt{_parse(e){if(this._getType(e)!==Ae.nan){let n=this._getOrReturnCtx(e);return Se(n,{code:ae.invalid_type,expected:Ae.nan,received:n.parsedType}),Qe}return{status:"valid",value:e.data}}};_p.create=t=>new _p(C({typeName:tt.ZodNaN},ht(t)));var oie=Symbol("zod_brand"),$1=class extends vt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},M1=class t extends vt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Qe:s.status==="dirty"?(r.dirty(),sl(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Qe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:tt.ZodPipeline})}},_l=class extends vt{_parse(e){let r=this._def.innerType._parse(e),n=i=>(Dc(i)&&(i.value=Object.freeze(i.value)),i);return mp(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};_l.create=(t,e)=>new _l(C({innerType:t,typeName:tt.ZodReadonly},ht(e)));function FI(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function BI(t,e={},r){return t?$c.create().superRefine((n,i)=>{var o,a;let s=t(n);if(s instanceof Promise)return s.then(c=>{var u,f;if(!c){let l=FI(e,n),p=(f=(u=l.fatal)!=null?u:r)!=null?f:!0;i.addIssue(Y(C({code:"custom"},l),{fatal:p}))}});if(!s){let c=FI(e,n),u=(a=(o=c.fatal)!=null?o:r)!=null?a:!0;i.addIssue(Y(C({code:"custom"},c),{fatal:u}))}}):$c.create()}var aie={object:zi.lazycreate},tt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(tt||(tt={}));var cie=(t,e={message:`Input not instance of ${t.name}`})=>BI(r=>r instanceof t,e),HI=Lc.create,zI=ol.create,uie=_p.create,lie=al.create,WI=cl.create,fie=ul.create,die=gp.create,pie=ll.create,mie=fl.create,hie=$c.create,gie=Ia.create,yie=uo.create,vie=yp.create,xie=Da.create,_ie=zi.create,bie=zi.strictCreate,Sie=dl.create,Eie=t4.create,Tie=pl.create,Cie=Ko.create,kie=r4.create,wie=vp.create,Aie=xp.create,Rie=n4.create,Pie=ml.create,Nie=hl.create,Oie=gl.create,Iie=yl.create,Die=Mc.create,Lie=Us.create,$ie=Vs.create,Mie=Go.create,Fie=Us.createWithPreprocess,Vie=M1.create,jie=()=>HI().optional(),Uie=()=>zI().optional(),qie=()=>WI().optional(),Bie={string:t=>Lc.create(Y(C({},t),{coerce:!0})),number:t=>ol.create(Y(C({},t),{coerce:!0})),boolean:t=>cl.create(Y(C({},t),{coerce:!0})),bigint:t=>al.create(Y(C({},t),{coerce:!0})),date:t=>ul.create(Y(C({},t),{coerce:!0}))};var Hie=Qe;var zie=k.union([k.literal("m"),k.literal("k"),k.literal("M"),k.literal("G"),k.literal("T"),k.literal("P"),k.literal("E"),k.literal("Ki"),k.literal("Mi"),k.literal("Gi"),k.literal("Ti"),k.literal("Pi"),k.literal("Ei")]),ai=k.object({size:k.number(),unit:zie});var qs=ke(require("assert"),1);function i4(t,e,r){if(Dr.is(r)){let n=t.assignable(e,r.spec);if(N.isOk(n))return t.listeners.construct(r)}if(Dr.is(e)){let n=t.assignable(e.spec,r);if(N.isOk(n))return t.listeners.extract(e)}return Wie(t,e,r)?t.listeners.noop():t.listeners.fail()}function Wie(t,e,r){if(Dr.is(e)&&Dr.is(r)&&e.meta.id===r.meta.id||zo.is(e)&&zo.is(r)&&e.$type===r.$type)return!0;let n=t.assignable(e,r);return!!N.isOk(n)}var Jo=ke(require("assert"),1);function KI(t,e){let[r,n]=rt(t,e.caller);(0,Jo.default)(!n.length&&ir.is(r));let i=e.arguments.map(s=>rt(t,s));if(i.length<1){let s=r.params[0];n=n.concat([de.create({node:e,message:`missing parameter: ${s.name} ${se(s.value)}}`})])}if(i.length===1){let[s,o]=i[0];n=n.concat([...o]);let a=yt.create(),c=t.assignable(s,a);if(N.isErr(c)){let u=`invalid parameter '${se(s)}' expected ${se(a)}`;n=n.concat([de.create({node:e.arguments[0],message:u})])}}else if(i.length===2){let[s,o]=i[0];n=n.concat([...o]);let a=yt.create(),c=t.assignable(s,a);if(N.isErr(c)){let d=`invalid first parameter '${se(s)}' expected ${se(a)}`;n=n.concat([de.create({node:e.arguments[0],message:d})])}let[u,f]=i[1];n=n.concat([...f]);let l=ne.open(),p=t.assignable(u,l);if(N.isErr(p)){let d=`invalid second parameter '${se(u)}' expected ${se(l)}`;n=n.concat([de.create({node:e.arguments[1],message:d})])}}return e.arguments.length>2&&(n=n.concat([de.create({node:e,message:`too many arguments for ${se(r)}`})])),[r,n]}function GI(t,e){let[r,n]=rt(t,e.caller);(0,Jo.default)(!n.length),(0,Jo.default)(ir.is(r));let i=e.arguments.map(s=>rt(t,s));if(i.length<1){let s=r.params[0];n=n.concat([de.create({node:e,message:`missing parameter: ${s.name} ${se(s.value)}}`})])}if(i.length<2){let s=r.params[1];n=n.concat([de.create({node:e,message:`missing parameter: ${s.name} ${se(s.value)}}`})])}if(i.length>=1){let[s,o]=i[0];n=n.concat([...o]);let a=_t.create(),c=t.assignable(s,a);if(N.isErr(c)){let u=`invalid parameter '${se(s)}' expected ${se(a)}`;n=n.concat([de.create({node:e.arguments[0],message:u})])}}if(i.length>=2){let[s,o]=i[1];n=n.concat([...o]);let a=_t.create(),c=t.assignable(s,a);if(N.isErr(c)){let u=`invalid parameter '${se(s)}' expected ${se(a)}`;n=n.concat([de.create({node:e.arguments[0],message:u})])}}for(let s of e.arguments.slice(2))n=n.concat([de.create({node:s,message:`too many arguments for ${se(r)}`})]);return[r,n]}function JI(t,e){let[r,n]=rt(t,e.caller);(0,Jo.default)(!n.length),(0,Jo.default)(ir.is(r));let i=e.arguments.map(s=>rt(t,s));if(i.length<1){let s=r.params[0];n=n.concat([de.create({node:e,message:`missing parameter: ${s.name} ${se(s.value)}}`})])}if(i.length>=1){let[s,o]=i[0];n=n.concat([...o]);let a=ne.open(),c=t.assignable(s,a);if(N.isErr(c)){let u=`invalid parameter '${se(s)}' expected ${se(a)}`;n=n.concat([de.create({node:e.arguments[0],message:u})])}}for(let s of e.arguments.slice(1))n=n.concat([de.create({node:s,message:`too many arguments for ${se(r)}`})]);return[r,n]}function QI(t,e){let[r,n]=rt(t,e.caller);(0,Jo.default)(!n.length),(0,Jo.default)(ir.is(r));let i=e.arguments.map(s=>rt(t,s));if(i.length<1){let s=r.params[0];n=n.concat([de.create({node:e,message:`missing parameter: ${s.name} ${se(s.value)}}`})])}if(i.length>=1){let[s,o]=i[0];n=n.concat([...o]);let a=zn.create({restriction:yt.create()}),c=t.assignable(s,a);if(N.isErr(c)){let u=`invalid parameter '${se(s)}' expected ${se(a)}`;n=n.concat([de.create({node:e.arguments[0],message:u})])}}for(let s of e.arguments.slice(1))n=n.concat([de.create({node:s,message:`too many arguments for ${se(r)}`})]);return[r,n]}function YI(t,e){let[r,n]=rt(t,e.caller);(0,Jo.default)(!n.length),(0,Jo.default)(ir.is(r));let i=e.arguments.map(s=>rt(t,s));if(i.length<2&&(n=n.concat([de.create({node:e,message:"invalid strconv.Join call: requires two parameters strconv.Join(v []string, sep string)"})])),i.length===2){let[s,o]=i[0];n=n.concat([...o]);let a=zn.create({restriction:yt.create()}),c=t.assignable(s,a);if(N.isErr(c)){let d=`strconv.Join: invalid parameter '${se(s)}' of type '${s.$type}' expected '${se(a)}'`;n=n.concat([de.create({node:e.arguments[0],message:d})])}let[u,f]=i[1];n=n.concat([...f]);let l=yt.create(),p=t.assignable(u,l);if(N.isErr(p)){let d=`strconv.Join: invalid parameter '${se(u)}' of type '${u.$type}' expected ${se(l)}`;n=n.concat([de.create({node:e.arguments[1],message:d})])}}for(let s of e.arguments.slice(2))n=n.concat([de.create({node:s,message:"too many arguments for strconv.Join: accepts two parameters strconv.Join(v []string, sep string)"})]);return[r,n]}function rt(t,e){let r=t.cache.get(e);if(r)return r;t.cache.set(e,Wi(e,"recursive definition"));let n=Kie(t,e);return t.cache.set(e,n),n}var Wi=(t,e,r)=>[Dt.create({node:t}),[de.create({node:r||t,message:e})]];function Kie(t,e){let r=t.svcs.workspace.AstNodeDescriptionProvider,n=(...s)=>r.createDescription(...s);if(Bn(e)){let[s,o]=rt(t,e.body);return[Bi(s,e),o]}if(Ca(e)||Ns(e)||Ta(e)){if(Fe.getDocument(e).uri.path.endsWith(".h.kumori")){let[p,d]=rt(t,e.body);return[Bi(p,e),d]}if(e.name.value.ref===void 0)return Wi(e.name,"missing interface declaration");let[o,a]=rt(t,e.name.value.ref),[c,u]=rt(t,e.body),f=a.concat(u);if(f.length)return[Dt.create({node:e}),f];if(!ne.is(o)){let p=`unexpected interface '${e.name.value.ref.value.$refText}' of type ${se(o)}`;return Wi(e.name.value.ref,p)}if(!ne.is(c)){let p=`unexpected implementation '${e.name.value.$refText}' of type ${se(c)}`;return Wi(e,p)}let l=ZI(c,o);return N.isErr(l)?[Dt.create({node:e}),l.err]:[Bi(l.value,e),[]]}if(Md(e)){let s=e.stmt.filter(zu).map(f=>f.variables).flat(),o=e.stmt.filter(zr),a=[];for(let f of s){let[,l]=rt(t,f);a=a.concat(l)}let c=[];for(let f of o){let[l,p]=rt(t,f),d=f.value!==void 0||f.optional;a=a.concat(p),c=c.concat([[f.key,Ho.create({node:f,value:l,optional:d})]])}let u=Object.fromEntries(c);return[ne.create({node:e,open:!1,parameters:u}),a]}if(_i(e)){let s=[],o=[];for(let c of e.entries){let[u,f]=rt(t,c),l=c.value!==void 0||c.optional;s=s.concat(f),o=o.concat([[c.key,Ho.create({node:c,value:u,optional:l})]])}let a=Object.fromEntries(o);return[ne.create({node:e,open:!1,parameters:a}),s]}if(zr(e)){let s=[],o=ot;if(e.type){let[u,f]=rt(t,e.type);s=s.concat(f),e.optional&&(u=qi.create({node:u.node||e,inner:u})),o=Ut(u)}let a=ot;if(e.value){let[u,f]=rt(t,e.value);s=s.concat(f),a=Ut(u)}if(ue.isNone(o)&&ue.isSome(a))return[a.value,s];if(ue.isSome(o)&&ue.isNone(a))return[o.value,s];if(ue.isNone(o)&&ue.isNone(a))return s=s.concat([de.create({node:e,message:"cannot infer value of undefined struct entry"})]),[Dt.create({node:e}),s];(0,qs.default)(ue.isSome(o)),(0,qs.default)(ue.isSome(a));let c=t.assignable(a.value,o.value);if(N.isErr(c)){let u=`cannot assign type '${se(o.value)}' to type '${se(a.value)}'`;return s=s.concat([de.create({node:e,message:u})]),[Dt.create({node:e}),s]}return[o.value,s]}if(Fd(e)){let[s,o]=rt(t,e.value);return[Bi(s,e),o]}if(X2(e)){let s=[],o=[];for(let c of e.values){if(c===void 0)return Wi(e,"cannot infer value of undefined list item",c);let[u,f]=rt(t,c);s=s.concat(f),o=o.concat(u)}let a=co.create({node:e,variations:o});return o.length||(a=Dt.create({node:e})),[zn.create({node:e,restriction:a}),s]}if(K2(e)||r3(e)){let[s,o]=rt(t,e.left),[a,c]=rt(t,e.right),u=o.concat(c);return _t.is(s)&&_t.is(a)?[_t.create({node:e}),u]:e.operator==="+"&&yt.is(s)&&yt.is(a)?[yt.create({node:e}),u]:Wi(e,`${e.$type}: cannot apply operator '${e.operator}' between operands '${se(s)}' and '${se(a)}'`)}if(J2(e)||n3(e)){let[s,o]=rt(t,e.left),[a,c]=rt(t,e.right),u=o.concat(c),f=[qt.create({node:e}),u];return _t.is(s)&&_t.is(a)||yt.is(s)&&yt.is(a)||qt.is(s)&&qt.is(a)?f:Wi(e,`${e.$type}: cannot apply operator '${e.operator}' between operands '${se(s)}' and '${se(a)}'`)}if(Z2(e)){let[s,o]=rt(t,e.target);return _t.is(s)?[_t.create({node:e}),o]:Wi(e,`${e.$type}: cannot apply operator '${e.operator}' to operand of type '${se(s)}'`)}if(e3(e)||t3(e)){let[s,o]=rt(t,e.left),[a,c]=rt(t,e.right),u=o.concat(c);return qt.is(s)&&qt.is(a)?[qt.create({node:e}),u]:Wi(e,`${e.$type}: cannot apply operator '${e.operator}' between operands '${se(s)}' and '${se(a)}'`)}if(i3(e)){let[s,o]=rt(t,e.condition),[a,c]=rt(t,e.trueExpr),[u,f]=rt(t,e.falseExpr),l=o.concat(c).concat(f);if(qt.is(s)&&(yt.is(a)&&yt.is(u)||_t.is(a)&&_t.is(u)||qt.is(a)&&qt.is(u))){if(yt.is(a))return[yt.create({node:e}),l];if(_t.is(a))return[_t.create({node:e}),l];if(qt.is(a))return[qt.create({node:e}),l]}return Wi(e,`${e.$type}: cannot apply ternary operator with condition of type '${se(s)}', true expression of type '${se(a)}' and false expression of type '${se(u)}'`)}if(s3(e)){let[s,o]=rt(t,e.left),a=e.operator;return _t.is(s)&&(a==="+"||a==="-")?[_t.create({node:e}),o]:qt.is(s)&&a==="!"?[qt.create({node:e}),o]:Wi(e,`${e.$type}: cannot apply operator '${e.operator}' to operand of type '${se(s)}'`)}if(Ud(e)){let s;return s=e.value,[_t.create({node:e,literal:s}),[]]}if(Bd(e)){let s;return s=e.value,[yt.create({node:e,literal:s}),[]]}if(Vd(e)){let s;return s=e.value==="true",[qt.create({node:e,literal:s}),[]]}if(qd(e))return Xie(e);if(ri(e)){let s=Qy(e).map(c=>c.value.$refText).join(".");if(zo.eq(s))return[zo.create(s,e),[]];let a=Yy(e).value.ref;if(a===void 0){let c=de.create({message:"unresolved reference",node:e});return[Dt.create({node:e}),[c]]}return rt(t,a)}if(Ku(e)){let s=e.name,[o,a]=rt(t,e.value);return o=Dr.create({node:e,spec:o,meta:I1.from(s,n(e,s))}),[o,a]}if(Wu(e)){let s=e.name,[o,a]=rt(t,e.value);return o=ds.create({node:e,name:s,spec:o}),[o,a]}if(Y2(e)){let s=[],o=[],[a,c]=rt(t,e.returns);for(let f of e.params){if(f===void 0){o=o.concat([de.create({message:"cannot infer value of undefined item",node:f})]);continue}let[l,p]=rt(t,f.type);o=o.concat(p),s=s.concat([Ky.create({node:f,name:f.name,value:l})])}if(o.length)return[Dt.create({node:e}),o.concat(c)];let u=e.name;return[ir.create({node:e,params:s,returns:a,meta:I1.from(u,n(e,u))}),c]}if(o3(e)){let s=[],o=W7(e).map(a=>rt(t,a)).map(a=>(s=s.concat(a[1]),a[0]));return[co.create({node:e,variations:o}),s]}if(FA(e)){let[s,o]=rt(t,e.value);return[zn.create({node:e,restriction:s}),o]}if(jA(e)){let s=[],o=Dt.create({node:e});e.restriction!==void 0&&([o,s]=rt(t,e.restriction),o=qi.create({node:e,inner:o}));let a={};for(let c of e.entries){let[u,f]=rt(t,c.type);if(s=s.concat(f),u===void 0)continue;let l=c.optional;l&&(u=qi.create({node:c,inner:u})),a[c.key]=Ho.create({node:c,value:u,optional:l})}return[ne.create({node:e,restriction:o,parameters:a,open:e.open}),s]}if(Q2(e))return Gie(t,e);let i=de.create({message:`${e.$type}: could not infer type`,node:e});return[Dt.create({node:e}),[i]]}function Gie(t,e){let[r,n]=rt(t,e.caller);for(let c of e.arguments){let[,u]=rt(t,c);n=n.concat(u)}if(n.length)return[Dt.create({node:e}),n];if(ir.is(r))return Yie(t,e);let i=Pa.is(r),s=Ic.is(r);if(i||s)return Jie(t,e);let o=`${e.$type}: illegal call to ${se(r)}`,a=de.create({message:o,node:e.caller});return[Dt.create({node:e}),[a]]}function Jie(t,e){let[r,n]=rt(t,e.caller);if((0,qs.default)(!n.length),(0,qs.default)(Pa.is(r)||Ic.is(r)),e.arguments.length!==1){let c=`${e.$type}: expected 1 argument on cast to '${se(r)}`,u=de.create({message:c,node:e.caller});return[Dt.create({node:e}),[u]]}let[i,s]=rt(t,e.arguments[0]);(0,qs.default)(!s.length);let[o,a]=[i,r];return i4({assignable:t.assignable,listeners:{construct(){},extract(){},noop(){},fail(){let c=`${e.$type}: cannot convert '${se(o)}' to '${se(a)}'`;n=n.concat([de.create({node:e,message:c})])}}},o,a),[r,n]}var Qie={[Wn.strconv.Format]:GI,[Wn.strconv.JSON]:JI,[Wn.strconv.Concat]:QI,[Wn.strconv.Join]:YI,[Wn.io.Open]:KI};function Yie(t,e){let[r,n]=rt(t,e.caller);if((0,qs.default)(!n.length),(0,qs.default)(ir.is(r)),r.node===void 0){let o=t.svcs.workspace.AstNodeDescriptionProvider.createDescription(e,"source");throw Error(`undefined caller node: ${JSON.stringify(o)}`)}let i=Zy(t.svcs,r),s=Qie[i];if(s===void 0){let o=`not implemented '${i}'`;return n=n.concat([de.create({message:o,node:e.caller})]),[Dt.create({node:e}),n]}return s(t,e)}function W7(t){let e=[];return o3(t.left)?e=e.concat([...W7(t.left)]):e=e.concat([t.left]),o3(t.right)?e=e.concat([...W7(t.right)]):e=e.concat([t.right]),e}var Zie=/(\d+)(\w+)/;function Xie(t){let e=Zie.exec(t.value);if(e===null){let a=`invalid sized literal '${t.value}'`;return Wi(t,a)}let[,r,n]=e,i=Number.parseInt(r,10);if(!Number.isInteger(i)){let a=`incomplete value: invalid sized literal '${t.value}': not an integer (${i})`;return Wi(t,a)}let s=ai.safeParse({size:i,unit:n});if(!s.success){let a=s.error.message;return Wi(t,a)}return[ne.create({node:t,open:!1,parameters:{size:Ho.create({node:t,optional:!1,value:_t.create({node:t,literal:s.data.size})}),unit:Ho.create({node:t,optional:!1,value:yt.create({node:t,literal:s.data.unit})})}}),[]]}function ZI(t,e){let r=ne.create({node:t.node,open:t.open&&e.open,parameters:{}}),n=[],i=new Set(Object.keys(t.parameters)),s=new Set(Object.keys(e.parameters)),o=Jy(i,s);for(let u of o){let f=t.parameters[u],l=e.parameters[u];if((0,qs.default)(f!==void 0),(0,qs.default)(l!==void 0),!ne.is(f.value)||!ne.is(l.value)){(0,qs.default)(f.node);let g=`unable to merge with interface: cannot merge '${se(f.value)}' with '${se(l.value)}'`;n.push(de.create({node:f.node,message:g}));continue}let p=ZI(f.value,l.value);if(N.isErr(p)){n=n.concat(p.err);continue}let d=f==null?void 0:f.node;(0,qs.default)(d!==void 0);let h=f.optional&&l.optional;r.parameters[u]=Ho.create({node:d,optional:h,value:p.value})}if(n.length)return oe(n);let a=il(i,o);for(let u of a)r.parameters[u]=t.parameters[u];let c=il(s,o);for(let u of c)r.parameters[u]=e.parameters[u];return Le(r)}var F1=class{constructor(e){this.map=new Map,this.parent=e}get(e){var n;let r=this.map.get(e);return r!==void 0?r:(n=this.parent)==null?void 0:n.get(e)}set(e,r){this.map.set(e,r)}};var vs=ke(require("assert"),1);var Si;(n=>(n.$type="named",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(Si||(Si={}));var Ne;(n=>(n.$type="none",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(Ne||(Ne={}));var ci;(n=>(n.$type="bool",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(ci||(ci={}));var Ke;(n=>(n.$type="string",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(Ke||(Ke={}));var an;(n=>(n.$type="number",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(an||(an={}));var pe;(n=>(n.$type="struct",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(pe||(pe={}));var ms;(r=>(r.$type="struct-item",r.create=n=>C({$type:r.$type},n)))(ms||(ms={}));var cn;(n=>(n.$type="list",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(cn||(cn={}));var s4;(r=>(r.$type="list-item",r.create=n=>C({$type:r.$type},n)))(s4||(s4={}));var Bs;(n=>(n.$type="function-call",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(Bs||(Bs={}));var XI;(r=>(r.$type="function-parameter",r.create=n=>C({$type:r.$type},n)))(XI||(XI={}));var hs;(n=>(n.$type="type-cast",n.create=i=>C({$type:n.$type},i),n.is=i=>i.$type===n.$type))(hs||(hs={}));var Ki;(o=>{o.$type="reference",o.create=a=>C({$type:o.$type},a),o.is=a=>a.$type===o.$type,o.unwrap=a=>(0,o.unwrapN)(a,-1)[0],o.unwrapN=(a,c)=>s(a,Math.floor(c),0);let s=(a,c,u)=>{let f=[a,u];return c===0?f:(0,o.is)(a)?s(a.ref,c-1,u+1):f}})(Ki||(Ki={}));var ese=[ci.$type,Ke.$type,an.$type],fo;(r=>(r.is=n=>(0,r.eq)(n.$type),r.eq=n=>ese.includes(n)))(fo||(fo={}));var Hs;(n=>(n.$type="error",n.create=i=>C({$type:n.$type},i),n.is=i=>typeof i=="object"&&i!==null&&"$type"in i&&i.$type===n.$type&&"message"in i&&typeof i.message=="string"&&"node"in i&&It(i.node)))(Hs||(Hs={}));function bi(t){if(pe.is(t))return`{ ${Array.from(Object.entries(t.parameters)).filter(([,r])=>r!==void 0).map(([r,n])=>`${r}: ${bi(n.value)}`).join(", ")} }`;if(cn.is(t))return`[${t.items.map(r=>r.value).map(bi).join(", ")}]`;if(Si.is(t))return`(${t.definition.meta.id}) ${bi(t.inner)}`;if(Ki.is(t))return`*${bi(t.ref)}`;if(Bs.is(t)){let e=t.params.map(({name:r,value:n})=>`${r}=${bi(n)}`).join(", ");return`(${se(t.definition)}) with ${e}`}if("literal"in t)switch(t.$type){case"string":return`"${t.literal}"`;case"number":return`${t.literal}`;case"bool":return`${t.literal}`}return t.$type}function lo(t){let e=t.node;switch(t.$type){case"struct":return pe.create({node:e,parameters:Object.fromEntries(Object.entries(t.parameters).filter(([,r])=>r!==void 0).map(([r,n])=>[r,Y(C({},n),{value:lo(n.value)})]))});case"list":return cn.create({node:e,items:t.items.map(r=>Y(C({},r),{value:lo(r.value)}))});case"named":return Si.create({node:e,definition:t.definition,inner:lo(t.inner)});case"reference":return Ki.create({node:e,ref:lo(t.ref)});case"type-cast":return hs.create({node:e,to:t.to,result:lo(t.result),from:lo(t.from)});case"function-call":return Bs.create({node:e,definition:t.definition,params:t.params.map(r=>Y(C({},r),{value:lo(r.value)})),result:lo(t.result)});case"none":case"string":case"number":case"bool":return C({},t)}}var Ti=ke(require("assert"),1),WL=require("fs");var KL=ke(require("path"),1);var eD=ke(require("assert"),1);function Qo(t,e){(0,eD.default)(e.node!==void 0);let r=e.node,n=()=>oe([Hs.create({node:r,message:`incomplete value: ${bi(e)}`})]);return N.from(()=>{var i;if(fo.is(e))return e.literal===void 0?n():e.literal;if(cn.is(e)){let s=[],o=[];for(let a of e.items){let c=Qo(t,a.value);if(N.isErr(c)){o=o.concat(c.err),s.push(null);continue}else s.push(c.value)}return o.length?oe(o):s}if(pe.is(e)){let s={},o=[];for(let[a,c]of Object.entries(e.parameters)){if(c===void 0){s[a]=void 0;continue}if(Ne.is(c.value))continue;let u=Qo(t,c.value);if(N.isErr(u)){o=o.concat(u.err);continue}else s[a]=u.value}return o.length?oe(o):((i=t.nodes)==null||i.set(s,r),s)}if(Ki.is(e))return Qo(t,e.ref);if(Si.is(e)){if(!e.definition.node){let c=`definition not found: ${se(e.definition)}`;return oe([Hs.create({node:r,message:c})])}let o=t.svcs.references.KumoriPackages.GetPackage(e.definition.node);if(N.isErr(o)){let c=`invalid or missing package: ${se(e.definition)}`;return oe([Hs.create({node:r,message:c})])}let a=e.definition.meta.id;return N.map(Qo(t,e.inner),c=>({$type:a,value:c}))}return hs.is(e)||Bs.is(e)?Qo(t,e.result):oe([Hs.create({node:r,message:`cannot convert value to JSON: ${bi(e)}`})])})}var GL=ke(zL(),1);function JL(t,e){let[r,n]=t.infer(e);(0,Ti.default)(ir.is(r)&&n.length===0);let[i,s]=Tt(t,e.arguments[0]);if(!yt.is(i.Type))return n.push(de.create({node:e.arguments[0],message:`expected a string for the file path, got ${se(i.Type)}`})),[{Value:Ye(t,e),Type:r},n];let o=Ve(i.Value);if(Ne.is(o)||!Ke.is(o))return[{Value:Ne.create({node:e}),Type:r},n.concat(s)];let a,c=[];if(e.arguments.length==2){let[l,p]=Tt(t,e.arguments[1]);a=l,c=p}if(n=n.concat(s).concat(c),n.length)return[{Value:Ye(t,e),Type:r},n];function u(l){if(KL.default.isAbsolute(l.literal)){n.push(de.create({node:e,message:"absolute paths are not allowed"}));return}let p=ee.dirname(Fe.getDocument(e).uri),d=ee.joinPath(p,l.literal);if(!TI(p,d)){let g=`cannot access '${d}'`;n.push(de.create({node:e,message:g}));return}let h=N.map(N.tryCatch(()=>(0,WL.readFileSync)(d.fsPath)),g=>g.toString("utf8"));if(N.isErr(h)){let g=`failed to open '${d}': ${h.err}`;n.push(de.create({node:e,message:g}));return}return h.value}let f=Ne.create({node:e});return yt.is(i.Type)&&e.arguments.length==1?f=(()=>{let l=Ve(i.Value);if(Ne.is(l)||!Ke.is(l))return Ne.create({node:e});let p=u(l);return p===void 0?Ne.create({node:e}):Ke.create({node:e,literal:p})})():e.arguments.length==2&&yt.is(i.Type)&&a&&ne.is(a.Type)&&(f=(()=>{let l=Ve(i.Value),p=Ve(a.Value);if(Ne.is(l)||Ne.is(p))return Ne.create({node:e});if(!Ke.is(l)||!pe.is(p))return Ne.create({node:e});let d=u(l);if(d===void 0)return Ne.create({node:e});let h=QL(p,n);if(n.length)return Ne.create({node:e});let v=GL.default.compile(d)(h);return Ke.create({node:e,literal:v})})()),[{Value:f,Type:r},n]}function QL(t,e){let r={};return Object.entries(t.parameters).forEach(([,n])=>{if(n===void 0||!zr(n.node))return;let i=n.node.key,s=Ve(n.value);if(!Ne.is(s))if(fo.is(s))r[i]=s.literal;else if(cn.is(s)){let o=[];s.items.forEach(a=>{let c=Ve(a.value);Ne.is(c)||fo.is(c)&&o.push(c.literal)}),r[i]=o}else pe.is(s)?r[i]=QL(s,e):e.push(de.create({node:n.node,message:`expected a primitive, list, or struct for template parameter '${i}', got '${s.$type}' ${bi(s)}`}))}),r}function YL(t,e){let[r,n]=t.infer(e);(0,Ti.default)(ir.is(r)&&n.length===0);let[i,s]=Tt(t,e.arguments[0]),[o,a]=Tt(t,e.arguments[1]);return n=n.concat(s,a),n.length?[{Value:Ye(t,e),Type:r},n]:((0,Ti.default)(_t.is(i.Type)&&_t.is(o.Type)),[{Value:(()=>{let u=Ve(i.Value),f=Ve(o.Value);return Ne.is(u)||Ne.is(f)?Ne.create({node:e}):!an.is(u)||!an.is(f)?Ne.create({node:e}):Ke.create({node:e,literal:u.literal.toString(f.literal)})})(),Type:r},n])}function ZL(t,e){let[r,n]=t.infer(e);(0,Ti.default)(ir.is(r)&&n.length===0);let[i,s]=Tt(t,e.arguments[0]);return n=n.concat(s),n.length?[{Value:Ye(t,e),Type:r},n]:((0,Ti.default)(ne.is(i.Type)),[{Value:(()=>{let a=Ve(i.Value);if(Ne.is(a))return Ne.create({node:e});if(!pe.is(a))return Ne.create({node:e});if(N.isErr(t.complete(a,e)))return Ne.create({node:e});let c=Qo({svcs:t.svcs},a);if(N.isErr(c))throw new Error(`runtime error: JSON(): argument '${bi(a)}'`);return Ke.create({node:e,literal:JSON.stringify(c.value)})})(),Type:r},n])}function XL(t,e){let[r,n]=t.infer(e);(0,Ti.default)(ir.is(r)&&n.length===0);let[i,s]=Tt(t,e.arguments[0]);return n=n.concat(s),n.length?[{Value:Ye(t,e),Type:r},n]:((0,Ti.default)(zn.is(i.Type)&&t.assignable(i.Type.restriction,yt.create())),[{Value:(()=>{let a=Ve(i.Value);if(Ne.is(a))return Ne.create({node:e});if(!cn.is(a))return Ne.create({node:e});let c=a.items.map(f=>Ve(f.value));if(c.some(f=>Ne.is(f)))return Ne.create({node:e});if(!c.every(f=>Ke.is(f)))return Ne.create({node:e});let u=c.map(f=>((0,Ti.default)(Ke.is(f)),f.literal));return Ke.create({node:e,literal:u.join("")})})(),Type:r},n])}function e$(t,e){let[r,n]=t.infer(e);(0,Ti.default)(ir.is(r)),(0,Ti.default)(n.length===0);let[i,s]=Tt(t,e.arguments[0]),[o,a]=Tt(t,e.arguments[1]);return n=n.concat(s,a),n.length?[{Value:Ye(t,e),Type:r},n]:((0,Ti.default)(zn.is(i.Type)),(0,Ti.default)(t.assignable(i.Type.restriction,yt.create())),(0,Ti.default)(yt.is(o.Type)),[{Value:(()=>{let u=Ve(i.Value),f=Ve(o.Value);if(Ne.is(u)||Ne.is(f))return Ne.create({node:e});if(!cn.is(u)||!Ke.is(f))return Ne.create({node:e});let l=u.items.map(d=>Ve(d.value));if(l.some(d=>Ne.is(d)))return Ne.create({node:e});if(!l.every(d=>Ke.is(d)))return Ne.create({node:e});let p=l.map(d=>((0,Ti.default)(Ke.is(d)),d.literal));return Ke.create({node:e,literal:p.join(f.literal)})})(),Type:r},n])}function q4(t,e){let r=t.cache.get(e);if(r)return r;let n=new Map,i=Tt(Y(C({},t),{cache:n}),e);return t.cache.set(e,i),i}function Tt(t,e){let r=t.cache.get(e);if(r)return r;let n=[{Value:Ye(t,e),Type:Dt.create({node:e})},[de.create({node:e,message:"recursive evaluation aborted"})]];t.cache.set(e,n);let i=Kae(t,e);return t.cache.set(e,i),i}function t$(t,e,r){let n=Wae(t,e,r);return(s,o)=>{var p,d;let a=Qy(s);if(![rl,nl].includes((d=(p=a.shift())==null?void 0:p.value.$refText)!=null?d:"")||!a.length)return o();let u=n;for(;a.length&&typeof u=="object";){let h=a.shift().value.$refText;u=u[h]}if(u===void 0)return o();if(typeof u=="function")return u();let[{Type:f}]=o();return[{Value:r$(t,s,u),Type:f},[]]}}function r$(t,e,r){let n={};for(let[i,s]of Object.entries(r)){if(s===void 0)continue;let o;if(typeof s=="function"){let[{Value:a}]=s(),[c]=Ki.unwrapN(a,1);o=c}else o=r$(t,e,s);n[i]=ms.create({value:o})}return pe.create({node:e,parameters:n})}function Wae(t,e,r){let n={};if(Bn(e)){let i=jc(e,"config");ue.isSome(i)&&zr(i.value)&&_i(i.value.value)&&(n.config=Z1(t,i.value.value));let s=jc(e,"resource");ue.isSome(s)&&zr(s.value)&&_i(s.value.value)&&(n.resource=Z1(t,s.value.value))}if(Ns(e)){let i=Fe.getContainerOfType(r,_i);(0,vs.default)(i!==void 0);let s=jc(i,"config");ue.isSome(s)&&zr(s.value)&&_i(s.value.value)&&(n.config=Z1(t,s.value.value));let o=jc(i,"resource");ue.isSome(o)&&zr(o.value)&&_i(o.value.value)&&(n.resource=Z1(t,o.value.value))}return n}function Z1(t,e){let r={};for(let{key:n,value:i}of e.entries){if(!i)continue;(0,vs.default)(i!==void 0);let s;_i(i)?s=Z1(t,i):s=()=>Tt(t,i),r[n]=s}return r}function Kae(t,e){var n,i;if(Ca(e)||Ns(e)||Ta(e)){let s=(i=(n=e.name)==null?void 0:n.value)==null?void 0:i.ref,[o,a]=Tt(Y(C({},t),{current:e}),e.body);if(s){let[c,u]=Tt(Y(C({},t),{current:s}),s.body);if(pe.is(c.Value)&&pe.is(o.Value)){let f=nce(c.Value,o.Value);return[{Type:o.Type,Value:Bi(f,e)},a.concat(u)]}}return[{Type:o.Type,Value:Bi(o.Value,e)},a]}if(Bn(e)){let[s,o]=Tt(Y(C({},t),{current:e}),e.body);return[{Type:s.Type,Value:Bi(s.Value,e)},o]}if(Md(e)){let s=e.stmt.filter(zu).map(l=>l.variables).flat(),o=e.stmt.filter(zr),[a,c]=t.infer(e.$container);for(let l of s){let[,p]=q4(t,l);c=c.concat(p)}let u=[];for(let l of o){let[p,d]=Tt(t,l);c=c.concat(d),u.push([l.key,p,l])}let f=pe.create({node:e,parameters:Object.fromEntries(u.map(([l,p,d])=>[l,ms.create({node:d,value:p.Value})]))});return[{Type:a,Value:f},c]}if(_i(e)){let[s,o]=t.infer(e),a=[];for(let u of e.entries||[]){let[f,l]=Tt(t,u);o=o.concat(l),a.push([u.key,f,u])}let c=pe.create({node:e,parameters:Object.fromEntries(a.map(([u,f,l])=>[u,ms.create({node:l,value:f.Value})]))});return[{Type:s,Value:c},o]}if(zr(e)){let[s,o]=t.infer(e);if(!e.value){let a=Ne.create({node:e});return[{Type:s,Value:a},o]}return Tt(t,e.value)}if(Fd(e)){let[{Type:s,Value:o},a]=q4(t,e.value);return[{Type:s,Value:Bi(o,e)},a]}if(X2(e)){let[s,o]=t.infer(e),a=[];for(let u of e.values||[]){let[f,l]=Tt(t,u);o=o.concat(l),a.push([f,u])}let c=cn.create({node:e,items:a.map(([u,f])=>s4.create({node:f,value:u.Value}))});return[{Type:s,Value:c},o]}if(K2(e)||r3(e)){let[s,o]=t.infer(e),[a,c]=Tt(t,e.left),[u,f]=Tt(t,e.right);if(o=o.concat(c),o=o.concat(f),_t.is(a.Type)&&_t.is(u.Type)){let p,d=g=>{let v=Ve(a.Value),b=Ve(u.Value);return!an.is(v)||!an.is(b)?Ne.create({node:e}):an.create({node:e,literal:g(v,b)})};switch(e.operator){case"+":p=()=>d((g,v)=>g.literal+v.literal);break;case"-":p=()=>d((g,v)=>g.literal-v.literal);break;case"%":p=()=>d((g,v)=>g.literal%v.literal);break;case"*":p=()=>d((g,v)=>g.literal*v.literal);break;case"/":p=()=>d((g,v)=>g.literal/v.literal);break}let h=p();return[{Type:s,Value:h},o]}if(e.operator==="+"&&yt.is(a.Type)&&yt.is(u.Type)){let p,d=g=>{let v=Ve(a.Value),b=Ve(u.Value);return!Ke.is(v)||!Ke.is(b)?Ne.create({node:e}):Ke.create({node:e,literal:g(v,b)})};p=()=>d((g,v)=>g.literal+v.literal);let h=p();return[{Type:s,Value:h},o]}let l=`${e.$type}: cannot apply operator '${e.operator}' between operands '${se(a.Type)}' and '${se(u.Type)}'`;return[{Value:Ye(t,e),Type:s},o.concat([de.create({node:e,message:l})])]}if(J2(e)||n3(e)){let[s,o]=t.infer(e),[a,c]=Tt(t,e.left),[u,f]=Tt(t,e.right);o=o.concat(c),o=o.concat(f);let l;if(_t.is(a.Type)&&_t.is(u.Type)){let d=h=>{let g=Ve(a.Value),v=Ve(u.Value);return!an.is(g)||!an.is(v)?Ne.create({node:e}):ci.create({node:e,literal:h(g,v)})};switch(e.operator){case"!=":l=()=>d((h,g)=>h.literal!=g.literal);break;case"==":l=()=>d((h,g)=>h.literal==g.literal);break;case"<":l=()=>d((h,g)=>h.literal<g.literal);break;case"<=":l=()=>d((h,g)=>h.literal<=g.literal);break;case">":l=()=>d((h,g)=>h.literal>g.literal);break;case">=":l=()=>d((h,g)=>h.literal>=g.literal);break}}if(yt.is(a.Type)&&yt.is(u.Type)){let d=h=>{let g=Ve(a.Value),v=Ve(u.Value);return!Ke.is(g)||!Ke.is(v)?Ne.create({node:e}):ci.create({node:e,literal:h(g,v)})};switch(e.operator){case"!=":l=()=>d((h,g)=>h.literal!=g.literal);break;case"==":l=()=>d((h,g)=>h.literal==g.literal);break;case"<":l=()=>d((h,g)=>h.literal<g.literal);break;case"<=":l=()=>d((h,g)=>h.literal<=g.literal);break;case">":l=()=>d((h,g)=>h.literal>g.literal);break;case">=":l=()=>d((h,g)=>h.literal>=g.literal);break}}if(qt.is(a.Type)&&qt.is(u.Type)){let d=h=>{let g=Ve(a.Value),v=Ve(u.Value);return!ci.is(g)||!ci.is(v)?Ne.create({node:e}):ci.create({node:e,literal:h(g,v)})};switch(e.operator){case"!=":l=()=>d((h,g)=>h.literal!=g.literal);break;case"==":l=()=>d((h,g)=>h.literal==g.literal);break}}if(l!==void 0){let d=l();return[{Type:s,Value:d},o]}let p=`${e.$type}: cannot apply operator '${e.operator}' between operands '${se(a.Type)}' and '${se(u.Type)}'`;return[{Value:Ye(t,e),Type:s},o.concat([de.create({node:e,message:p})])]}if(e3(e)||t3(e)){let[s,o]=t.infer(e),[a,c]=Tt(t,e.left),[u,f]=Tt(t,e.right);if(o=o.concat(c).concat(f),qt.is(a.Type)&&qt.is(u.Type)){let p,d=g=>{let v=Ve(a.Value),b=Ve(u.Value);return!ci.is(v)||!ci.is(b)?Ne.create({node:e}):ci.create({node:e,literal:g(v,b)})};switch(e.operator){case"&&":p=()=>d((g,v)=>g.literal!=v.literal);break;case"||":p=()=>d((g,v)=>g.literal==v.literal);break}let h=p();return[{Type:s,Value:h},o]}let l=`${e.$type}: cannot apply operator '${e.operator}' between operands '${se(a.Type)}' and '${se(u.Type)}'`;return[{Value:Ye(t,e),Type:s},o.concat([de.create({node:e,message:l})])]}if(i3(e)){let[s,o]=t.infer(e),[a,c]=Tt(t,e.condition),[u,f]=Tt(t,e.trueExpr),[l,p]=Tt(t,e.falseExpr);if(o=o.concat(c).concat(f).concat(p),qt.is(a.Type)&&(yt.is(u.Type)&&yt.is(l.Type)||_t.is(u.Type)&&_t.is(l.Type)||qt.is(u.Type)&&qt.is(l.Type))){let h=Ve(a.Value);if(!ci.is(h))return[{Type:s,Value:Ne.create({node:e})},o];let g=h.literal?Ve(u.Value):Ve(l.Value);return[{Type:s,Value:g},o]}let d=`${e.$type}: cannot apply ternary operator with condition type '${se(a.Type)}' and branch types '${se(u.Type)}' and '${se(l.Type)}'`;return[{Value:Ye(t,e),Type:s},o.concat([de.create({node:e,message:d})])]}if(Z2(e)){let[s,o]=t.infer(e),[a,c]=Tt(t,e.target);if(o=o.concat(c),_t.is(a.Type)){let f,l=d=>{let h=Ve(a.Value);return an.is(h)?an.create({node:e,literal:d(h)}):Ne.create({node:e})};switch(e.operator){case"++":f=()=>l(d=>d.literal+1);break;case"--":f=()=>l(d=>d.literal-1);break}let p=f();return[{Type:s,Value:p},o]}let u=`${e.$type}: cannot apply operator '${e.operator}' to operand of type '${se(a.Type)}'`;return[{Value:Ye(t,e),Type:s},o.concat([de.create({node:e,message:u})])]}if(s3(e)){let[s,o]=t.infer(e),[a,c]=Tt(t,e.left);o=o.concat(c);let u;if(_t.is(a.Type)){let l=p=>{let d=Ve(a.Value);return an.is(d)?an.create({node:e,literal:p(d)}):Ne.create({node:e})};switch(e.operator){case"+":u=()=>l(p=>p.literal);break;case"-":u=()=>l(p=>-p.literal);break}}if(qt.is(a.Type)){let l=p=>{let d=Ve(a.Value);return ci.is(d)?ci.create({node:e,literal:p(d)}):Ne.create({node:e})};switch(e.operator){case"!":u=()=>l(p=>!p.literal);break}}if(u!==void 0){let l=u();return[{Type:s,Value:l},o]}let f=`${e.$type}: cannot apply operator '${e.operator}' to operand of type '${se(a.Type)}'`;return[{Value:Ye(t,e),Type:s},o.concat([de.create({node:e,message:f})])]}if(Ud(e)){let[s,o]=t.infer(e),a=an.create({node:e,literal:e.value});return[{Type:s,Value:a},o]}if(Bd(e)){let[s,o]=t.infer(e),a=Ke.create({node:e,literal:e.value});return[{Type:s,Value:a},o]}if(Vd(e)){let[s,o]=t.infer(e),a=ci.create({node:e,literal:e.value==="true"});return[{Type:s,Value:a},o]}if(qd(e))return Xae(t,e);if(ri(e)){let s=Yy(e).value.ref;if(s===void 0)return[{Value:Ye(t,e),Type:Dt.create({node:e})},[de.create({node:e,message:"unresolved reference"})]];if(Bn(s)||Ca(s)||Ns(s)||Ta(s))return ece(t,e,s);let o=()=>Tt(t,s);if(t.resolver){let[l,p]=[e,o];o=()=>t.resolver(l,p)}let[{Value:a,Type:c},u]=o();return[{Value:Ki.create({node:e,ref:a}),Type:c},u]}if(Q2(e))return Gae(t,e);if(Ku(e)||Wu(e))return[{Value:Ye(t,e),Type:Dt.create({node:e})},[de.create({node:e,message:"illegal expression: using type as value"})]];let r=`${e.$type}: unable to evaluate expression`;return[{Value:Ye(t,e),Type:Dt.create({node:e})},[de.create({node:e,message:r})]]}function Gae(t,e){let[r,n]=t.infer(e);if(ir.is(r))return Qae(t,e);if(Pa.is(r)||Ic.is(r))return Jae(t,e);let i=`${e.$type}: illegal call to ${se(r)}`;return[{Value:Ye(t,e),Type:r},n.concat([de.create({node:e,message:i})])]}function Jae(t,e){let[r,n]=t.infer(e);if(e.arguments.length!==1){let f=`${e.$type}: expected 1 argument on cast to '${se(r)}`;return[{Value:Ye(t,e),Type:r},n.concat([de.create({node:e,message:f})])]}let i=e.arguments[0],s;[s,n]=Tt(t,i);let o=Ve(s.Value);if(Ne.is(o))return[{Value:Ne.create({node:e}),Type:r},n];let[a,c]=[s.Type,r],u;return i4({assignable:t.assignable,listeners:{construct(f){u=hs.create({node:e,to:r,from:o,result:Si.create({node:e,definition:f,inner:o})})},extract(){(0,vs.default)(Si.is(o)),u=hs.create({node:e,to:r,from:o,result:Y(C({},o.inner),{node:e})})},noop(){u=o},fail(){u=Ye(t,e);let f=`${e.$type}: cannot convert '${se(s.Type)}' to '${se(r)}'`;n=n.concat([de.create({node:e,message:f})])}}},a,c),(0,vs.default)(u!==void 0),[{Value:u,Type:r},n]}function Qae(t,e){let[r,n]=t.infer(e);if((0,vs.default)(ir.is(r)),n.length)return[{Value:Ye(t,e),Type:r},n];let i=Zy(t.svcs,r),s=Yae[i];if(s!==void 0)return s(t,e);let o=`${e.$type}: unknown call to ${se(r)}`;return[{Value:Ye(t,e),Type:r},n.concat([de.create({node:e,message:o})])]}var Yae={[Wn.strconv.Format]:YL,[Wn.strconv.JSON]:ZL,[Wn.strconv.Concat]:XL,[Wn.strconv.Join]:e$,[Wn.io.Open]:JL},Zae=/(\d+)(\w+)/;function Xae(t,e){let[r,n]=t.infer(e),i=Zae.exec(e.value);if(i===null){let f=`invalid sized literal '${e.value}'`;return[{Value:Ye(t,e),Type:r},n.concat([de.create({node:e,message:f})])]}let[,s,o]=i,a=Number.parseInt(s,10);if(!Number.isInteger(a)){let f=`invalid sized literal '${e.value}': not an integer (${a})`;return[{Value:Ye(t,e),Type:r},n.concat([de.create({node:e,message:f})])]}let c=ai.safeParse({size:a,unit:o});if(!c.success){let f=c.error.message;return[{Value:Ye(t,e),Type:r},n.concat([de.create({node:e,message:f})])]}let u=pe.create({node:e,parameters:{size:ms.create({node:e,value:an.create({node:e,literal:c.data.size})}),unit:ms.create({node:e,value:Ke.create({node:e,literal:c.data.unit})})}});return[{Type:r,Value:u},n]}function ece(t,e,r){if(!t.current)return[{Value:Ye(t,r),Type:Dt.create({node:e})},[de.create({node:e,message:"unknown artifact in current context"})]];if(Bn(t.current))return tce(t,r);if(Ns(t.current))return rce(t,e,r);let n=`invalid artifact factory source: ${e.$type}`;return[{Value:Ye(t,r),Type:Dt.create({node:e})},[de.create({node:e,message:n})]]}function tce(t,e){var _,x,T,R,V,$,K,z;let r=t.current;(0,vs.default)(r!==void 0),(0,vs.default)(Bn(r));let n=[],i=t$(t,r,e),s=Y(C({},t),{resolver:i,cache:new F1(t.cache)}),[{Value:o,Type:a},c]=Tt(s,e);if(n=n.concat(c),!ne.is(a)){let W=`unexpected artifact type: ${se(a)}`;return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:r,message:W})])]}let u=(x=(_=a.parameters.config)==null?void 0:_.value)!=null?x:ne.closed();if(u===void 0)return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:a.node,message:"missing parameter 'config'"})])];if(!ne.is(u)){let W=`unexpected type: expected struct but found ${se(a)}`;return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:u.node,message:W})])]}let f=(R=(T=a.parameters.resource)==null?void 0:T.value)!=null?R:ne.closed();if(f===void 0)return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:a.node,message:"missing parameter 'resource'"})])];if(!ne.is(f)){let W=`unexpected type: expected struct but found ${se(a)}`;return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:f.node,message:W})])]}let[l,p]=t.infer(r);if(n=n.concat(p),!ne.is(l)){let W=`unexpected artifact type: ${se(l)}`;return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:r,message:W})])]}let d=($=(V=l.parameters.config)==null?void 0:V.value)!=null?$:ne.closed();if(d===void 0)return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:r,message:"missing parameter 'config'"})])];if(!ne.is(d)){let W=`unexpected type: expected struct but found ${se(l)}`;return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:d.node,message:W})])]}let h=(z=(K=l.parameters.resource)==null?void 0:K.value)!=null?z:ne.closed();if(h===void 0)return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:r,message:"missing parameter 'resource'"})])];if(!ne.is(h)){let W=`unexpected type: expected struct but found ${se(l)}`;return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:h.node,message:W})])]}let g=t.assignable(d,u);if(N.isErr(g))return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:d.node||r,message:"TODO: assignability issue message"})])];let v=t.assignable(h,f);if(N.isErr(v)){(0,vs.default)(ne.is(v.err[0].from)&&ne.is(v.err[0].to));let W=Object.keys(v.err[0].to.parameters),D=Object.keys(v.err[0].from.parameters),P=`invalid resource assignment: valid values are [${W.join(", ")}], while provided values are [${D.join(", ")}]`;return[{Value:Ye(t,r),Type:a},n.concat([de.create({node:d.node||r,message:P})])]}return[{Value:(()=>{var re,we,Q,F,Oe,ze;let W=lo(Ve(o));if(Ne.is(W))return Ne.create({node:r});if(!pe.is(W))return Ne.create({node:r});let D=pe.create({node:r,parameters:{}}),P=jc(r,"config");if(ue.isSome(P)){let[{Value:pt}]=Tt(t,P.value);D=Ve(pt)}if(!pe.is(D))return Ne.create({node:r});let M=(we=(re=W.parameters.config)==null?void 0:re.value)!=null?we:pe.create({node:r,parameters:{}});if(M===void 0||!pe.is(M))return Ne.create({node:r});W.parameters.config=ms.create({node:(Q=W.parameters.config)==null?void 0:Q.node,value:X1(D,M)});let j=pe.create({node:r,parameters:{}}),J=jc(r,"resource");if(ue.isSome(J)){let[{Value:pt}]=Tt(t,J.value);j=Ve(pt)}if(!pe.is(j))return Ne.create({node:r});let te=(Oe=(F=W.parameters.resource)==null?void 0:F.value)!=null?Oe:pe.create({node:r,parameters:{}});return te===void 0||!pe.is(te)?Ne.create({node:r}):(W.parameters.resource=ms.create({node:(ze=W.parameters.resource)==null?void 0:ze.node,value:X1(j,te)}),W)})(),Type:a},n]}function rce(t,e,r){var x,T,R,V,$,K,z,W;let n=t.current;(0,vs.default)(n!==void 0),(0,vs.default)(Ns(n));let i=[],s=t$(t,n,e),o=Y(C({},t),{resolver:s,cache:new F1(t.cache)}),[{Value:a,Type:c},u]=Tt(o,r);if(i=i.concat(u),!ne.is(c)){let D=`unexpected artifact type: ${se(c)}`;return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:n,message:D})])]}let f=(T=(x=c.parameters.config)==null?void 0:x.value)!=null?T:ne.closed();if(f===void 0)return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:c.node,message:"missing parameter 'config'"})])];if(!ne.is(f)){let D=`unexpected type: expected struct but found ${se(c)}`;return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:f.node,message:D})])]}let l=(V=(R=c.parameters.resource)==null?void 0:R.value)!=null?V:ne.closed();if(l===void 0)return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:c.node,message:"missing parameter 'resource'"})])];if(!ne.is(l)){let D=`unexpected type: expected struct but found ${se(c)}`;return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:l.node,message:D})])]}n=Fe.getContainerOfType(e,_i),(0,vs.default)(n!==void 0);let[p,d]=t.infer(n);if(i=i.concat(d),!ne.is(p)){let D=`unexpected artifact type: ${se(p)}`;return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:n,message:D})])]}let h=(K=($=p.parameters.config)==null?void 0:$.value)!=null?K:ne.closed();if(h===void 0)return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:n,message:"missing parameter 'config'"})])];if(!ne.is(h)){let D=`unexpected type: expected struct but found ${se(p)}`;return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:h.node,message:D})])]}let g=(W=(z=p.parameters.resource)==null?void 0:z.value)!=null?W:ne.closed();if(g===void 0)return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:n,message:"missing parameter 'resource'"})])];if(!ne.is(g)){let D=`unexpected type: expected struct but found ${se(p)}`;return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:g.node,message:D})])]}let v=t.assignable(h,f);if(N.isErr(v))return[{Value:Ye(t,n),Type:c},i.concat([de.create({node:h.node||n,message:"TODO: assignability issue message"})])];let b=t.assignable(g,l);return N.isErr(b)?[{Value:Ye(t,n),Type:c},i.concat([de.create({node:h.node||n,message:"TODO: assignability issue message"})])]:[{Value:(()=>{var we,Q,F,Oe,ze,pt;let D=lo(Ve(a));if(Ne.is(D))return Ne.create({node:n});if(!pe.is(D))return Ne.create({node:n});let P=pe.create({node:n,parameters:{}}),M=jc(n,"config");if(ue.isSome(M)){let[{Value:qe}]=Tt(t,M.value);P=Ve(qe)}if(!pe.is(P))return Ne.create({node:n});let j=(Q=(we=D.parameters.config)==null?void 0:we.value)!=null?Q:pe.create({node:n,parameters:{}});if(j===void 0||!pe.is(j))return Ne.create({node:n});D.parameters.config=ms.create({node:(F=D.parameters.config)==null?void 0:F.node,value:X1(P,j)});let J=pe.create({node:n,parameters:{}}),te=jc(n,"resource");if(ue.isSome(te)){let[{Value:qe}]=Tt(t,te.value);J=Ve(qe)}if(!pe.is(J))return Ne.create({node:n});let re=(ze=(Oe=D.parameters.resource)==null?void 0:Oe.value)!=null?ze:pe.create({node:n,parameters:{}});return re===void 0||!pe.is(re)?Ne.create({node:n}):(D.parameters.resource=ms.create({node:(pt=D.parameters.resource)==null?void 0:pt.node,value:X1(J,re)}),D)})(),Type:c},i]}function X1(t,e){var n,i;let r=C({},e.parameters);for(let s of Object.keys(r)){let o=(n=r[s])==null?void 0:n.value;(0,vs.default)(o!==void 0);let a=(i=t.parameters[s])==null?void 0:i.value;if(a===void 0)continue;let c;pe.is(o)&&pe.is(a)?c=X1(a,o):c=a,r[s]=ms.create({node:o.node,value:c})}return pe.create({node:e.node,parameters:r})}function jc(t,e){if(_i(t)){let n=t.entries.find(i=>i.key===e);return ue.fromNullable(n)}let r=t.body.stmt.filter(zr).find(n=>n.key===e);return ue.fromNullable(r)}var Ye=(t,e)=>Ne.create({node:e}),Ve=t=>Ki.is(t)?Ve(t.ref):hs.is(t)||Bs.is(t)?Ve(t.result):t;function Lr(t,e,...r){var i;let n=(i=t.parameters[e])==null?void 0:i.value;return n===void 0?ot:r.length===0?Ut(Ve(n)):pe.is(n)?Lr(n,...r):ot}function nce(t,e){return pe.create({node:e.node,parameters:C(C({},t.parameters),e.parameters)})}var B4=()=>Le(void 0);function Uc(t,e){if(e=t.node||e,Si.is(t))return Uc(t.inner,e);if(fo.is(t))return B4();if(pe.is(t)){let n=Object.values(t.parameters).filter(i=>i!==void 0).map(i=>Uc(i.value,e)).filter(i=>N.isErr(i)).map(i=>i.err).flat();return n.length?oe(n):B4()}if(cn.is(t)){let n=Object.values(t.items).map(i=>Uc(i.value,e)).filter(i=>N.isErr(i)).map(i=>i.err).flat();return n.length?oe(n):B4()}if(Bs.is(t)){let n=t.params.map(i=>Uc(i.value,e)).filter(i=>N.isErr(i)).map(i=>i.err).flat();return n.length?oe(n):B4()}if(Ki.is(t))return Uc(t.ref,e);if(hs.is(t))return Uc(t.from,e);let r=Hs.create({node:e,message:`incomplete value: ${bi(t)}`});return oe([r])}var H4=class{constructor(e){this.svcs=e}NewContext(){return{EvalCache:new nr(this.svcs.shared),InferenceCache:new nr(this.svcs.shared),AssignableCache:new nr(this.svcs.shared)}}Infer(e,r){return rt({svcs:this.svcs,cache:e.InferenceCache,assignable:(n,i)=>this.Assignable(e,n,i)},r)}Assignable(e,r,n){return ps({svcs:this.svcs,cache:ice(this.svcs.shared,e.AssignableCache)},r,n)}Eval(e,r){return q4({svcs:this.svcs,cache:e.EvalCache,infer:n=>this.Infer(e,n),assignable:(n,i)=>this.Assignable(e,n,i),complete:(n,i)=>this.Complete(n,i)},r)}Complete(e,r){return Uc(e,r)}};function ice(t,e){return{get:(r,n)=>{let i=e.get(r);return i===void 0&&(i=new nr(t),e.set(r,i)),i.get(n)},set:(r,n,i)=>{let s=e.get(r);s===void 0&&(s=new nr(t),e.set(r,s)),s.set(n,i)}}}var n$=ke(require("assert"),1),z4=()=>Le(void 0);function Va(t,e){var n,i;if(e=t.node||e,ri(e)){(0,n$.default)(zr((n=t.node)==null?void 0:n.$container));let s=Hs.create({node:e,message:`invalid type definition of field \`${(i=t.node)==null?void 0:i.$container.key}\`, did you forget to use ':'?`});return oe([s])}if(Si.is(t))return Va(t.inner,e);if(fo.is(t))return z4();if(pe.is(t)){let s=Object.values(t.parameters).filter(o=>o!==void 0).filter(o=>{let a=o.node;return!a||!zr(a)||a.value!==void 0}).map(o=>Va(o.value,e)).filter(o=>N.isErr(o)).map(o=>o.err).flat();return s.length?oe(s):z4()}if(cn.is(t)){let s=Object.values(t.items).map(o=>Va(o.value,e)).filter(o=>N.isErr(o)).map(o=>o.err).flat();return s.length?oe(s):z4()}if(Bs.is(t)){let s=t.params.map(o=>Va(o.value,e)).filter(o=>N.isErr(o)).map(o=>o.err).flat();return s.length?oe(s):z4()}if(Ki.is(t))return Va(t.ref,e);if(hs.is(t))return Va(t.from,e);let r=Hs.create({node:e,message:`incomplete value: ${bi(t)}`});return oe([r])}var sce=[qr,on,xi],i$=()=>sce.map(t=>[t,oce]);function oce(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{if(!Fe.getDocument(r).uri.path.endsWith(".h.kumori"))return;let o=t.ctx(),[{Value:a}]=e.Eval(o,r);if(!pe.is(a))return;let u=Object.entries(a.parameters).filter(([p])=>!["config","resource"].includes(p));for(let[,p]of u){if(p===void 0)continue;let d=e.Complete(p.value,r);if(N.isErr(d))for(let h of d.err)n("error",`completeness error: ${h.message}`,{node:h.node})}let f=Object.entries(a.parameters).find(([p])=>p==="config");if(f&&f[1]){let p=f[1],d=Va(p.value,r);if(N.isErr(d))for(let h of d.err)n("error",`completeness error: ${h.message}`,{node:h.node})}let l=Object.entries(a.parameters).find(([p])=>p==="resource");if(l&&l[1]){let p=l[1],d=Va(p.value,r);if(N.isErr(d))for(let h of d.err)n("error",`completeness error: ${h.message}`,{node:h.node})}}}var ace=[qr,on,xi],s$=()=>ace.map(t=>[t,cce]);function cce(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{if(!Fe.getDocument(r).uri.path.endsWith(".h.kumori"))return;let o=t.ctx(),[a]=e.Infer(o,r);if(!ne.is(a))return;let c=Object.entries(a.parameters).find(([f])=>f==="resource");if(c===void 0)return;let u=c[1];if(u!==void 0&&ne.is(u.value))for(let f of Object.values(u.value.parameters)){let l=f==null?void 0:f.node;f!==void 0&&l!==void 0&&zr(l)&&l.value!==void 0&&n("error","resources cannot have default values",{node:l})}}}var uce=[qr,on,xi],o$=()=>uce.map(t=>[t,lce]);function lce(){return(t,e)=>{var o,a,c;if(Fe.getDocument(t).uri.path.endsWith(".h.kumori"))return;let i=t.name.value.ref;if(i===void 0)return;let s=u=>{switch(u.$type){case qr:return"component";case on:return"service";case xi:return"builtin";default:return u.$type}};if(i.$type!==t.$type){let u=`invalid implementation: ${s(t)} ${t.name.value.$refText} cannot implement ${s(i)} ${(c=(a=(o=i==null?void 0:i.name)==null?void 0:o.value)==null?void 0:a.$refText)!=null?c:"<unknown>"}`;e("error",u,{node:t.name})}}}var Pp=ke(Ui(),1);function Np(t,e){var s;let r=Fe.getDocument(t).uri,n=((s=t.$cstNode)==null?void 0:s.range)||Pp.Range.create({line:0,character:0},{line:0,character:0}),i=Pp.Location.create(r.toString(),n);return Pp.DiagnosticRelatedInformation.create(i,e)}function xn(t,e){let r={node:t.from.node||e};return t.to.node&&(r.relatedInformation=[Np(t.to.node,"not assignable")]),r}var fce=[Ps],a$=()=>fce.map(t=>[t,dce]);function dce(t){let e=new nr(t.svcs.shared),r=new nr(t.svcs.shared);return(n,i)=>{let s=Fe.getDocument(n),o=s.uri.path.endsWith(".h.kumori"),a;o?a=e:a=r;let c=s.uri,u=ee.dirname(c),f=(n.artifacts||[]).map(l=>Bn(l)?void 0:l).filter(l=>l!==void 0);for(let l of f){let p=l.name.value,d=ee.joinPath(u,"#",p.$refText).toString(),h=a.get(d);h!==void 0?(i("error",`illegal artifact declaration: name '${p}' used multiple times`,{node:l.name,relatedInformation:[Np(h.name,`artifact '${p}' declared here`)]}),i("error",`illegal artifact declaration: name '${p}' used multiple times`,{node:h.name,relatedInformation:[Np(l.name,`artifact '${p}' declared here`)]})):a.set(d,l)}}}var c$=ke(require("assert"),1);var pce=[xi],u$=()=>pce.map(t=>[t,mce]);function mce(t){let e=t.svcs.validation.KumoriTypeSystem,r=t.svcs.references.KumoriPackages;return(n,i)=>{let s=r.GetPackage(Gr.Kumori);(0,c$.default)(N.isOk(s));let o=t.svcs.shared.workspace.IndexManager.allElements(void 0,new Set(s.value.docs.map(d=>d.uri.toString()))).toArray().find(d=>d.name==="builtin");if(!o||!o.node){i("error","builtin type definition not found",{node:n});return}let a=t.ctx(),[c,u]=e.Infer(a,o.node);for(let d of u)i("error",`type error: ${d.message}`,{node:d.node});let[f,l]=e.Infer(a,n);for(let d of l)Fe.getContainerOfType(d.node,h=>h===n)&&i("error",`type error: ${d.message}`,{node:d.node});if(l.length>0||u.length>0)return;let p=e.Assignable(a,f,c);if(N.isErr(p))for(let d of p.err){let h=xn(d,n);i("error",`type error: ${d.cause}`,h)}}}var l$=ke(require("assert"),1);function Ci(t){let r=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/.exec(t);if(!r)throw new Error(`Invalid SemVer string format: ${t}`);let n=parseInt(r[1],10),i=parseInt(r[2],10),s=parseInt(r[3],10),o=r[4]?r[4].split("."):null,a=r[5]?r[5].split("."):null;return{$tag:"semver",major:n,minor:i,patch:s,prerelease:o,buildmetadata:a,toString(){return gce(this)}}}(n=>(n.Compare=yce,n.Parse=i=>N.tryCatch(()=>n(i)),n.Is=i=>hce(i)))(Ci||(Ci={}));function hce(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.$tag==="semver"&&typeof e.major=="number"&&Number.isInteger(e.major)&&e.major>=0&&typeof e.minor=="number"&&Number.isInteger(e.minor)&&e.minor>=0&&typeof e.patch=="number"&&Number.isInteger(e.patch)&&e.patch>=0&&(e.prerelease===null||Array.isArray(e.prerelease)&&e.prerelease.every(r=>typeof r=="string"))&&(e.buildmetadata===null||Array.isArray(e.buildmetadata)&&e.buildmetadata.every(r=>typeof r=="string"))&&typeof e.toString=="function"}function gce(t){let e=`${t.major}.${t.minor}.${t.patch}`;return t.prerelease&&t.prerelease.length>0&&(e+=`-${t.prerelease.join(".")}`),t.buildmetadata&&t.buildmetadata.length>0&&(e+=`+${t.buildmetadata.join(".")}`),e}function yce(t,e){if(t.major!==e.major)return t.major-e.major;if(t.minor!==e.minor)return t.minor-e.minor;if(t.patch!==e.patch)return t.patch-e.patch;if(t.prerelease&&!e.prerelease)return-1;if(!t.prerelease&&e.prerelease)return 1;if(t.prerelease&&e.prerelease){let r=Math.min(t.prerelease.length,e.prerelease.length);for(let n=0;n<r;n++){let i=t.prerelease[n],s=e.prerelease[n],o=/^\d+$/.test(i),a=/^\d+$/.test(s);if(o&&a){let c=parseInt(i,10),u=parseInt(s,10);if(c!==u)return c-u}else{if(o&&!a)return-1;if(!o&&a)return 1;{let c=i.localeCompare(s);if(c!==0)return c}}}return t.prerelease.length-e.prerelease.length}return 0}var vce=[xi],f$=()=>vce.map(t=>[t,xce]);function xce(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{var u,f;let i=t.ctx(),[{Value:s}]=e.Eval(i,r);if(!pe.is(s))return;let o=(u=s.parameters.id)==null?void 0:u.value;if(!o||!pe.is(o))return;let a=(f=o.parameters.version)==null?void 0:f.value;if(!a||(a=Ve(a),!Ke.is(a)))return;let c=Ci.Parse(a.literal);if(N.isErr(c)){(0,l$.default)(a.node);let l=`invalid semantic version string: ${a.literal}`;n("error",l,{node:a.node});return}}}var d$=ke(require("assert"),1);var _ce=[qr],p$=()=>_ce.map(t=>[t,bce]);function bce(t){let e=t.svcs.validation.KumoriTypeSystem,r=t.svcs.references.KumoriPackages;return(n,i)=>{if(Fe.getDocument(n).uri.path.endsWith(".h.kumori"))return;let a=r.GetPackage(Gr.Kumori);(0,d$.default)(N.isOk(a));let c=t.svcs.shared.workspace.IndexManager.allElements(void 0,new Set(a.value.docs.map(g=>g.uri.toString()))).toArray().find(g=>"name"in g&&g.name==="component");if(!c||!c.node){i("error","component type definition not found",{node:n});return}let u=t.ctx(),[f,l]=e.Infer(u,c.node);for(let g of l)i("error",`type error: ${g.message}`,{node:g.node});let[p,d]=e.Infer(u,n);for(let g of d)Fe.getContainerOfType(g.node,v=>v===n)&&i("error",`type error: ${g.message}`,{node:g.node});if(d.length>0||l.length>0)return;let h=e.Assignable(u,p,f);if(N.isErr(h))for(let g of h.err){let v=xn(g,n);i("error",`type error: ${g.cause}`,v)}}}var m$=ke(require("assert"),1);var Sce=[qr],h$=()=>Sce.map(t=>[t,Ece]);function Ece(t){let e=t.svcs.validation.KumoriTypeSystem,r=t.svcs.references.KumoriPackages;return(n,i)=>{if(!Fe.getDocument(n).uri.path.endsWith(".h.kumori"))return;let a=r.GetPackage(Gr.Kumori);(0,m$.default)(N.isOk(a));let c=t.svcs.shared.workspace.IndexManager.allElements(void 0,new Set(a.value.docs.map(g=>g.uri.toString()))).toArray().find(g=>"name"in g&&g.name==="ComponentInterface");if(!c||!c.node){i("error","component interface type definition not found",{node:n});return}let u=t.ctx(),[f,l]=e.Infer(u,c.node);for(let g of l)i("error",`type error: ${g.message}`,{node:g.node});let[p,d]=e.Infer(u,n);for(let g of d)Fe.getContainerOfType(g.node,v=>v===n)&&i("error",`type error: ${g.message}`,{node:g.node});if(d.length>0||l.length>0)return;let h=e.Assignable(u,p,f);if(N.isErr(h))for(let g of h.err){let v=xn(g,n);i("error",`type error: ${g.cause}`,v)}}}var ki=(t,e)=>k.object({$type:k.string(),value:e}),g$=(t,e)=>`${De.parse(t).toString()}@${e}`;function y$(t,...e){return(...r)=>t(...e,...r)}var li=y$(g$,Gr.Kumori.toString());var Fx=li("Ephemeral"),Vx=ki(Fx,ai),jx=li("Persistent"),Ux=ki(jx,k.string()),JFe=k.union([Vx,Ux]),qx=li("Volatile"),Bx=ki(qx,ai),Hx=li("Persisted"),zx=ki(Hx,ai),Wx=li("NonReplicated"),Kx=ki(Wx,ai),Tce=k.union([Bx,zx,Kx]),Gx=li("Registered"),Jx=ki(Gx,k.string()),QFe=li("Volume"),Cce=k.union([Tce,Jx]),eg=li("CA"),Qx=ki(eg,k.string()),tg=li("Certificate"),Yx=ki(tg,k.string()),Op=li("Secret"),Zx=ki(Op,k.string()),rg=li("Domain"),Xx=ki(rg,k.string()),ng=li("Port"),e_=ki(ng,k.string()),ja=k.union([Cce,Qx,Yx,Zx,Xx,e_]);var qc=ke(require("assert"),1),kce=[qr],v$=()=>kce.map(t=>[t,wce]);function wce(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{let i=t.ctx(),[{Value:s,Type:o},a]=e.Eval(i,r);if(a.length||!pe.is(s)||!ne.is(o))return;let c=[],u=U7(o,"resource");if(ue.isSome(u)&&ne.is(u.value))for(let[l,p]of Object.entries(u.value.parameters))p!==void 0&&(!Dr.is(p.value)&&!ds.is(p.value)||c.push([l,p.value]));let f=Lr(s,"code");if(!(ue.isNone(f)||!pe.is(f.value)))for(let l of Object.values(f.value.parameters).filter(p=>p!==void 0)){if(!pe.is(l.value))continue;let p=Lr(l.value,"env");if(ue.isNone(p)||!pe.is(p.value))continue;for(let h of Object.values(p.value.parameters).filter(g=>g!==void 0)){if(!pe.is(h.value))continue;let g=Lr(h.value,"secret");if(ue.isNone(g)||!Ke.is(g.value))continue;let v=g.value.literal;c.filter(([_])=>_===v).filter(([,_])=>Dr.is(_)&&_.meta.id===Op).length===0&&((0,qc.default)(g.value.node),n("error",`undefined secret: '${v}'`,{node:g.value.node}))}let d=Lr(l.value,"fs");if(!(ue.isNone(d)||!pe.is(d.value)))for(let h of Object.values(d.value.parameters).filter(g=>g!==void 0)){if(!pe.is(h.value))continue;let g=Lr(h.value,"volume");if(ue.isSome(g)&&Ke.is(g.value)){let R=g.value.literal;c.filter(([$])=>$===R).length===0&&((0,qc.default)(g.value.node),n("error",`undefined volume: '${R}'`,{node:g.value.node}))}let v=Lr(h.value,"secret");if(ue.isSome(v)&&Ke.is(v.value)){let R=v.value.literal;c.filter(([$])=>$===R).filter(([,$])=>Dr.is($)&&$.meta.id===Op).length===0&&((0,qc.default)(v.value.node),n("error",`undefined secret: '${R}'`,{node:v.value.node}))}let b=Lr(h.value,"certificate");if(ue.isSome(b)&&Ke.is(b.value)){let R=b.value.literal;c.filter(([$])=>$===R).filter(([,$])=>Dr.is($)&&$.meta.id===tg).length===0&&((0,qc.default)(b.value.node),n("error",`undefined certificate: '${R}'`,{node:b.value.node}))}let _=Lr(h.value,"port");if(ue.isSome(_)&&Ke.is(_.value)){let R=_.value.literal;c.filter(([$])=>$===R).filter(([,$])=>Dr.is($)&&$.meta.id===ng).length===0&&((0,qc.default)(_.value.node),n("error",`undefined port: '${R}'`,{node:_.value.node}))}let x=Lr(h.value,"domain");if(ue.isSome(x)&&Ke.is(x.value)){let R=x.value.literal;c.filter(([$])=>$===R).filter(([,$])=>Dr.is($)&&$.meta.id===rg).length===0&&((0,qc.default)(x.value.node),n("error",`undefined domain: '${R}'`,{node:x.value.node}))}let T=Lr(h.value,"ca");if(ue.isSome(T)&&Ke.is(T.value)){let R=T.value.literal;c.filter(([$])=>$===R).filter(([,$])=>Dr.is($)&&$.meta.id===eg).length===0&&((0,qc.default)(T.value.node),n("error",`undefined ca: '${R}'`,{node:T.value.node}))}}}}}var Ace=[qr],x$=()=>Ace.map(t=>[t,Rce]);function Rce(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{let i=t.ctx(),[{Value:s},o]=e.Eval(i,r);if(o.length||!pe.is(s))return;let a=Lr(s,"code");if(ue.isNone(a)||!pe.is(a.value))return;let c=0;for(let p of Object.values(a.value.parameters).filter(d=>d!==void 0)){if(!pe.is(p.value))continue;let d=Lr(p.value,"size");ue.isNone(d)||!an.is(d.value)||(c+=d.value.literal)}let u=Lr(s,"size");if(ue.isNone(u)||!pe.is(u.value))return;let f=Lr(u.value,"mincpu");if(ue.isNone(f)||!pe.is(f.value))return;let l=Lr(f.value,"size");ue.isNone(l)||!an.is(l.value)||l.value.literal<c&&n("error",`Component ${r.name.value.$refText} mincpu (${l.value.literal}) is less than the sum of its containers' mincpu (${c}).`,{node:r})}}function W4(t){let[e,...r]=t.split("/");return r.length===0?oe(`invalid OCI image name: '${t}'`):Le({tag:r.join("/"),hub:e})}var Pce=[qr],_$=()=>Pce.map(t=>[t,Nce]);function Nce(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{let i=t.ctx(),[{Value:s},o]=e.Eval(i,r);if(o.length||!pe.is(s))return;let a=Lr(s,"code");if(!(ue.isNone(a)||!pe.is(a.value)))for(let c of Object.values(a.value.parameters)){if(!c||!pe.is(c.value))continue;let u=Lr(c.value,"image");if(ue.isNone(u))continue;let f=u.value.node||r,l=e.Complete(u.value,f);if(N.isErr(l)){n("error","incomplete image string",{node:f});continue}if(!Ke.is(u.value))continue;let p=W4(u.value.literal);if(N.isErr(p)){n("error",p.err,{node:f}),n("hint",`The expected format of an OCI image string is: "<host>/<name>:<tag>".
213
+ For example, "docker.io/alpine:3"`,{node:f});continue}}}}var Oce=[qr],b$=()=>Oce.map(t=>[t,Ice]);function Ice(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{let i=t.ctx(),[{Value:s},o]=e.Eval(i,r);if(o.length||!pe.is(s))return;let a=Lr(s,"code");if(ue.isNone(a)||!pe.is(a.value))return;let c=Lr(s,"probe");if(ue.isNone(c)||!pe.is(c.value))return;let u=new Set(Object.keys(a.value.parameters)),f=new Set(Object.keys(c.value.parameters));for(let l of f)u.has(l)||n("error",`Probe "${l}" does not refer to any existing container. Existing containers are: ${[...u].map(p=>`"${p}"`).join(", ")}`,{node:r})}}var S$=ke(require("assert"),1);var Dce=[ti],E$=()=>Dce.map(t=>[t,Lce]);function Lce(t){let e=t.svcs.validation.KumoriTypeSystem,r=t.svcs.references.KumoriPackages;return(n,i)=>{let s=r.GetPackage(Gr.Kumori);(0,S$.default)(N.isOk(s));let o=t.svcs.shared.workspace.IndexManager.allElements(void 0,new Set(s.value.docs.map(d=>d.uri.toString()))).toArray().find(d=>"name"in d&&d.name==="deployment");if(!o||!o.node){i("error","deployment type definition not found",{node:n});return}let a=t.ctx(),[c,u]=e.Infer(a,o.node);for(let d of u)i("error",`type error: ${d.message}`,{node:d.node});let[f,l]=e.Infer(a,n);for(let d of l)Fe.getContainerOfType(d.node,h=>h===n)&&i("error",`type error: ${d.message}`,{node:d.node});let p=e.Assignable(a,f,c);if(N.isErr(p)){for(let d of p.err){let h=xn(d,n);i("error",`type error: ${d.cause}`,h)}return}}}var T$=ke(require("assert"),1);var $ce=[ti],C$=()=>$ce.map(t=>[t,Mce]);function Mce(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{let[{Value:i}]=e.Eval(t.ctx(),r);if(pe.is(i))for(let[s,o]of Object.entries(i.parameters)){if((0,T$.default)(o!==void 0),s==="artifact")continue;let a=e.Complete(o.value,r);if(N.isErr(a))for(let c of a.err)n("error",`completeness error: ${c.message}`,{node:c.node})}}}var k$=ke(require("assert"),1);var Fce=[ti],w$=()=>Fce.map(t=>[t,Vce]);function Vce(t){let e=t.svcs.references.KumoriPackages;return(r,n)=>{let i=e.GetPackage(r);(0,k$.default)(N.isOk(i));let s=i.value.docs.flatMap(o=>Fe.streamAst(o.parseResult.value).filter(Bn).filter(a=>a!==r).toArray());if(s.length>0){let o={node:r};o.relatedInformation=s.map(a=>Np(a,"another deployment was found here")),n("error",`error: package ${i.value.name} (${i.value.uri.toString()}) contains too many deployments`,{node:r})}}}var jce=[ti],A$=()=>jce.map(t=>[t,Uce]);function Uce(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{var f,l,p,d;let[i]=e.Infer(t.ctx(),r);if(!ne.is(i))return;let s=(l=(f=i.parameters.artifact)==null?void 0:f.value)==null?void 0:l.node;if(!s)return;let[o]=e.Infer(t.ctx(),s);if(!ne.is(o))return;let a=(p=i.parameters.config)==null?void 0:p.value,c=(d=o.parameters.config)==null?void 0:d.value;if(!a||!c)return;let u=e.Assignable(t.ctx(),a,c);if(!N.isOk(u))for(let h of u.err){let g=xn(h,r);n("error",`type error: ${h.cause}`,g)}}}var qce=[ti],R$=()=>qce.map(t=>[t,Bce]);function Bce(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{var f,l,p,d;let[i]=e.Infer(t.ctx(),r);if(!ne.is(i))return;let s=(l=(f=i.parameters.artifact)==null?void 0:f.value)==null?void 0:l.node;if(!s)return;let[o]=e.Infer(t.ctx(),s);if(!ne.is(o))return;let a=(p=i.parameters.resource)==null?void 0:p.value,c=(d=o.parameters.resource)==null?void 0:d.value;if(!a||!c)return;let u=e.Assignable(t.ctx(),a,c);if(!N.isOk(u))for(let h of u.err){let g=xn(h,r);n("error",`type error: ${h.cause}`,g)}}}var Hce=[Bu,Hu,ju],P$=()=>Hce.map(t=>[t,zce]);function zce(t){let e=t.svcs.validation.KumoriTypeSystem,r=t.ctx();return(n,i)=>{let[,s]=e.Infer(r,n);for(let o of s)i("error",`type error: ${o.message}`,{node:o.node})}}var Wce=[Uu,qu],N$=()=>Wce.map(t=>[t,Kce]);function Kce(){return(t,e)=>{let r=new Map;for(let n of t.entries||[]){let i=r.get(n.key);i||(i=[],r.set(n.key,i)),i.push(n)}for(let[,n]of r.entries())if(n.length>1)for(let i of n)e("error",`illegal struct declaration: repeated parameter '${i.key}'`,{node:i})}}var Gce=[Ps],O$=()=>Gce.map(t=>[t,Jce]);function Jce(t){let e=t.svcs.references.KumoriPackages,r=[rl,O1,nl];return(n,i)=>{let s=e.GetPackage(n);N.isErr(s)||r.includes(s.value.name)&&i("warning","package name collides with reserved keywords",{node:n.declaration||n})}}var Qce=[Ps],I$=()=>Qce.map(t=>[t,Yce]);function Yce(t){let e=new nr(t.svcs.shared);return(r,n)=>{if(!r.declaration)return;let i=Fe.getDocument(r).uri,s=ee.dirname(i),o=r.declaration.name,a=e.get(s.toString());if(a===void 0){let c=s.toString();e.set(c,o);return}a!==o&&n("error",`unexpected package '${o}' - package already defined as '${a}'`,{node:r.declaration})}}var D$=ke(require("assert"),1);var Zce=[on],L$=()=>Zce.map(t=>[t,Xce]);function Xce(t){let e=t.svcs.validation.KumoriTypeSystem,r=t.svcs.references.KumoriPackages;return(n,i)=>{let s=r.GetPackage(Gr.Kumori);(0,D$.default)(N.isOk(s));let o=t.svcs.shared.workspace.IndexManager.allElements(void 0,new Set(s.value.docs.map(d=>d.uri.toString()))).toArray().find(d=>"name"in d&&d.name==="service");if(!o||!o.node){i("error","service type definition not found",{node:n});return}let a=t.ctx(),[c,u]=e.Infer(a,o.node);for(let d of u)i("error",`type error: ${d.message}`,{node:d.node});let[f,l]=e.Infer(a,n);for(let d of l)Fe.getContainerOfType(d.node,h=>h===n)&&i("error",`type error: ${d.message}`,{node:d.node});if(l.length>0||u.length>0)return;let p=e.Assignable(a,f,c);if(N.isErr(p))for(let d of p.err){let h=xn(d,n);i("error",`type error: ${d.cause}`,h)}}}var $e=ke(require("assert"),1);var t_=k.union([k.literal("udp"),k.literal("tcp"),k.literal("http"),k.literal("grpc")]),eue=t_,$$=k.union([t_,k.object({protocol:t_,port:k.number()})]),Ip=k.object({client:k.object({}).catchall(eue).optional(),server:k.object({}).catchall($$).optional(),duplex:k.object({}).catchall($$).optional()});var tue=k.union([k.string(),k.object({data:k.string(),mode:k.number(),format:k.enum(["text","json","yaml"]).optional()}),k.object({secret:k.string(),mode:k.number(),format:k.enum(["text","json","yaml"]).optional()}),k.object({port:k.string(),mode:k.number(),format:k.enum(["text","json","yaml"]).optional()}),k.object({domain:k.string(),mode:k.number(),format:k.enum(["text","json","yaml"]).optional()}),k.object({certificate:k.string(),mode:k.number(),format:k.enum(["text","json","yaml"]).optional()}),k.object({ca:k.string(),mode:k.number(),format:k.enum(["text","json","yaml"]).optional()}),k.object({volume:k.string()})]),rue=k.union([k.string(),k.number(),k.boolean(),k.object({secret:k.string()})]),nue=k.object({hub:k.object({name:k.string(),secret:k.string().optional()}),tag:k.string()}),M$=k.object({cmd:k.array(k.string()).optional(),image:k.union([k.string(),nue]),entrypoint:k.array(k.string()).optional(),size:k.object({memory:ai,cpu:ai,mincpu:ai}),env:k.object({}).catchall(rue).optional(),fs:k.object({}).catchall(tue).optional()}),F$=k.object({port:k.number(),path:k.string()}),iue=k.object({port:k.number()}),sue=k.object({path:k.string()}),V$=k.object({http:F$.optional(),tcp:iue.optional(),exec:sue.optional()}),oue=k.object({http:F$.optional()}),aue=k.object({unit:k.enum(["attempts","ms"]),duration:k.number().int().nonnegative(),probe:k.boolean()}),cue=k.object({protocol:k.object({}).catchall(V$),startupGraceWindow:k.object({}).catchall(aue).optional(),frequency:k.optional(k.any()),timeout:k.optional(k.number().int())}),uue=k.object({protocol:k.object({}).catchall(V$),frequency:k.optional(k.any()),timeout:k.optional(k.number().int())}),lue=k.object({protocol:k.object({}).catchall(oue)}),fue=k.object({liveness:k.object({}).catchall(cue).optional(),readiness:k.object({}).catchall(uue).optional(),pmetrics:k.object({}).catchall(lue).optional()}),K4=k.object({srv:Ip.optional(),config:k.object({}).catchall(k.any()).optional(),resource:k.object({}).catchall(ja).optional(),scale:k.number().optional(),code:k.object({}).catchall(M$).optional(),init:k.array(M$).optional(),size:k.object({bandwidth:ai,minbandwidth:ai,mincpu:ai}),probe:k.object({}).catchall(fue).optional()});var due=k.object({name:k.string(),kind:k.union([k.literal("service"),k.literal("component")]),domain:k.string(),module:k.string(),version:k.string()}),G4=k.object({id:due,srv:Ip,config:k.record(k.string(),k.any()),resource:k.record(k.string(),ja)});var pue=k.object({config:k.record(k.string(),k.any()).optional(),resource:k.record(k.string(),ja).optional()}),mue=pue.extend({artifact:k.lazy(()=>k.union([K4,r_,G4]))}),Dp=li("LoadBalancer"),hue=ki(Dp,k.object({from:k.union([k.object({target:k.string(),channel:k.string()}),k.array(k.object({target:k.string(),channel:k.string()}))]),to:k.union([k.object({target:k.string(),channel:k.string()}),k.array(k.object({target:k.string(),channel:k.string()}))]),meta:k.any().optional()})),gue=k.object({target:k.string(),channel:k.string(),meta:k.any().optional()}),yue=k.object({from:k.union([k.object({target:k.string(),channel:k.string()}),k.array(k.object({target:k.string(),channel:k.string()}))]),to:k.union([k.object({target:k.string(),channel:k.string()}),k.array(k.object({target:k.string(),channel:k.string()}))]),meta:k.any().optional()}),Lp=li("FullConnector"),vue=ki(Lp,k.union([gue,yue])),xue=k.union([hue,vue]),r_=k.object({srv:Ip.optional(),config:k.record(k.string(),k.any()).optional(),resource:k.record(k.string(),ja).optional(),role:k.record(k.string(),mue).optional(),connect:k.record(k.string(),xue).optional()});var _ue=[on],j$=()=>_ue.map(t=>[t,bue]);function bue(t){let e=t.svcs.validation.KumoriTypeSystem,r=t.ctx();return(n,i)=>{var d,h,g,v,b,_,x,T,R,V,$,K,z,W,D,P,M,j,J,te,re,we,Q,F;let[{Value:s,Type:o},a]=e.Eval(r,n);if(a.length)return;(0,$e.default)(pe.is(s)&&ne.is(o));let c=(d=s.parameters.connect)==null?void 0:d.value;if(!c)return;(0,$e.default)(c&&pe.is(c));let u=(h=o.parameters.role)==null?void 0:h.value;(0,$e.default)(u&&ne.is(u));let l=`[${Object.keys(u.parameters).join(", ")}]`,p=[];for(let Oe of Object.values(c.parameters)){let ze=Oe==null?void 0:Oe.value;(0,$e.default)(ze),ze=Ve(ze),(0,$e.default)(Si.is(ze)&&pe.is(ze.inner));let pt=e.Complete(ze,n);if(N.isErr(pt))for(let qe of pt.err)i("error",`completeness error: ${qe.message}`,{node:qe.node});switch(ze.definition.meta.id){case Dp:{let qe=(g=ze.inner.parameters.from)==null?void 0:g.value;if((0,$e.default)(qe),cn.is(qe))for(let Te of qe.items){(0,$e.default)(pe.is(Te.value));let ie=(v=Te.value.parameters.target)==null?void 0:v.value;(0,$e.default)(ie),ie=Ve(ie),(0,$e.default)(Ke.is(ie)&&ie.node);let he=(b=Te.value.parameters.channel)==null?void 0:b.value;if((0,$e.default)(he),he=Ve(he),(0,$e.default)(Ke.is(he)&&he.node),p.find(([Ee,Ce])=>Ee.Target===ie.literal&&Ce.Channel===he.literal&&Ce.type==="client")){i("error",`found duplicate "from" definition: role: ${ie.literal} channel: ${he.literal}`,{node:he.node});return}p.push([{Target:ie.literal,node:ie.node},{Channel:he.literal,type:"client",node:he.node}])}else if(pe.is(qe)){let Te=(_=qe.parameters.target)==null?void 0:_.value;(0,$e.default)(Te),Te=Ve(Te),(0,$e.default)(Ke.is(Te)&&Te.node);let ie=(x=qe.parameters.channel)==null?void 0:x.value;if((0,$e.default)(ie),ie=Ve(ie),(0,$e.default)(Ke.is(ie)&&ie.node),p.find(([he,Ee])=>he.Target===Te.literal&&Ee.Channel===ie.literal&&Ee.type==="client")){i("error",`found duplicate "from" definition: role: ${Te.literal} channel: ${ie.literal}`,{node:ie.node});return}p.push([{Target:Te.literal,node:Te.node},{Channel:ie.literal,type:"client",node:ie.node}])}let Je=(T=ze.inner.parameters.to)==null?void 0:T.value;if((0,$e.default)(Je),cn.is(Je)){for(let Te of Je.items){(0,$e.default)(pe.is(Te.value));let ie=(R=Te.value.parameters.target)==null?void 0:R.value;(0,$e.default)(ie),ie=Ve(ie),(0,$e.default)(Ke.is(ie)&&ie.node);let he=(V=Te.value.parameters.channel)==null?void 0:V.value;if((0,$e.default)(he),he=Ve(he),(0,$e.default)(Ke.is(he)&&he.node),p.find(([Ee,Ce])=>Ee.Target===ie.literal&&Ce.Channel===he.literal&&Ce.type==="server")){i("error",`found duplicated "to" definition: role: ${ie.literal} channel: ${he.literal}`,{node:he.node});return}p.push([{Target:ie.literal,node:ie.node},{Channel:he.literal,type:"server",node:he.node}])}break}else if(pe.is(Je)){let Te=($=Je.parameters.target)==null?void 0:$.value;(0,$e.default)(Te),Te=Ve(Te),(0,$e.default)(Ke.is(Te)&&Te.node);let ie=(K=Je.parameters.channel)==null?void 0:K.value;if((0,$e.default)(ie),ie=Ve(ie),(0,$e.default)(Ke.is(ie)&&ie.node),p.find(([he,Ee])=>he.Target===Te.literal&&Ee.Channel===ie.literal&&Ee.type==="server")){i("error",`found duplicated "to" definition: role: ${Te.literal} channel: ${ie.literal}`,{node:ie.node});return}p.push([{Target:Te.literal,node:Te.node},{Channel:ie.literal,type:"server",node:ie.node}])}break}case Lp:{let qe=ze.inner.parameters.target!==void 0,Je=ze.inner.parameters.channel!==void 0;if(qe&&Je){let Te=(z=ze.inner.parameters.target)==null?void 0:z.value;(0,$e.default)(Te),Te=Ve(Te),(0,$e.default)(Ke.is(Te)&&Te.node);let ie=(W=ze.inner.parameters.channel)==null?void 0:W.value;(0,$e.default)(ie),ie=Ve(ie),(0,$e.default)(Ke.is(ie)&&ie.node),p.push([{Target:Te.literal,node:Te.node},{Channel:ie.literal,type:"server",node:ie.node}])}else{let Te=(D=ze.inner.parameters.from)==null?void 0:D.value;if((0,$e.default)(Te),cn.is(Te))for(let he of Te.items){(0,$e.default)(pe.is(he.value));let Ee=(P=he.value.parameters.target)==null?void 0:P.value;(0,$e.default)(Ee),Ee=Ve(Ee),(0,$e.default)(Ke.is(Ee)&&Ee.node);let Ce=(M=he.value.parameters.channel)==null?void 0:M.value;if((0,$e.default)(Ce),Ce=Ve(Ce),(0,$e.default)(Ke.is(Ce)&&Ce.node),p.find(([We,me])=>We.Target===Ee.literal&&me.Channel===Ce.literal)){i("error",`found duplicate "from" definition: role: ${Ee.literal} channel: ${Ce.literal}`,{node:Ce.node});return}p.push([{Target:Ee.literal,node:Ee.node},{Channel:Ce.literal,type:"client",node:Ce.node}])}else if(pe.is(Te)){let he=(j=Te.parameters.target)==null?void 0:j.value;(0,$e.default)(he),he=Ve(he),(0,$e.default)(Ke.is(he)&&he.node);let Ee=(J=Te.parameters.channel)==null?void 0:J.value;if((0,$e.default)(Ee),Ee=Ve(Ee),(0,$e.default)(Ke.is(Ee)&&Ee.node),p.find(([Ce,We])=>Ce.Target===he.literal&&We.Channel===Ee.literal)){i("error",`found duplicate "from" definition: role: ${he.literal} channel: ${Ee.literal}`,{node:Ee.node});return}p.push([{Target:he.literal,node:he.node},{Channel:Ee.literal,type:"client",node:Ee.node}])}let ie=(te=ze.inner.parameters.to)==null?void 0:te.value;if((0,$e.default)(ie),cn.is(ie))for(let he of ie.items){(0,$e.default)(pe.is(he.value));let Ee=(re=he.value.parameters.target)==null?void 0:re.value;(0,$e.default)(Ee),Ee=Ve(Ee),(0,$e.default)(Ke.is(Ee)&&Ee.node);let Ce=(we=he.value.parameters.channel)==null?void 0:we.value;if((0,$e.default)(Ce),Ce=Ve(Ce),(0,$e.default)(Ke.is(Ce)&&Ce.node),p.find(([We,me])=>We.Target===Ee.literal&&me.Channel===Ce.literal)){i("error",`found duplicate "to" definition: role: ${Ee.literal} channel: ${Ce.literal}`,{node:Ce.node});return}p.push([{Target:Ee.literal,node:Ee.node},{Channel:Ce.literal,type:"server",node:Ce.node}])}else if(pe.is(ie)){let he=(Q=ie.parameters.target)==null?void 0:Q.value;(0,$e.default)(he),he=Ve(he),(0,$e.default)(Ke.is(he)&&he.node);let Ee=(F=ie.parameters.channel)==null?void 0:F.value;if((0,$e.default)(Ee),Ee=Ve(Ee),(0,$e.default)(Ke.is(Ee)&&Ee.node),p.find(([Ce,We])=>Ce.Target===he.literal&&We.Channel===Ee.literal)){i("error",`found duplicate "to" definition: role: ${he.literal} channel: ${Ee.literal}`,{node:Ee.node});return}p.push([{Target:he.literal,node:he.node},{Channel:Ee.literal,type:"server",node:Ee.node}])}}break}default:(0,$e.default)(ze.node),i("error",`unknown connector type: ${ze.definition.meta.id}, valid types are: ${Dp}, ${Lp}`,{node:ze.node});break}}for(let[Oe,ze]of p){let pt=Oe.Target;if(u.parameters[pt]===void 0&&pt!=="self"){i("error",`unknown target '${pt}': must be one of ${l}`,{node:Oe.node});continue}let qe=(()=>{let Te=()=>Tue(u,pt),ie=()=>Cue(u,pt);switch(pt==="self"&&(Te=()=>Eue(o),ie=()=>Sue(o)),ze.type){case"client":return Te();case"server":return ie()}})(),Je=ze.Channel;if(!qe.includes(Je)){i("error",`unknown channel '${Je}' in role '${pt}': must be one of [${qe.join(", ")}]`,{node:ze.node});continue}}}}var Sue=t=>{var i,s,o,a,c,u;let e=(s=(i=t.parameters.srv)==null?void 0:i.value)!=null?s:ne.closed();(0,$e.default)(e&&ne.is(e));let r=(a=(o=e.parameters.client)==null?void 0:o.value)!=null?a:ne.closed();(0,$e.default)(r&&ne.is(r));let n=(u=(c=e.parameters.duplex)==null?void 0:c.value)!=null?u:ne.closed();return(0,$e.default)(n&&ne.is(n)),[...new Set(Object.keys(r.parameters).concat(Object.keys(n.parameters)))]},Eue=t=>{var i,s,o,a,c,u;let e=(s=(i=t.parameters.srv)==null?void 0:i.value)!=null?s:ne.closed();(0,$e.default)(e&&ne.is(e));let r=(a=(o=e.parameters.server)==null?void 0:o.value)!=null?a:ne.closed();(0,$e.default)(r&&ne.is(r));let n=(u=(c=e.parameters.duplex)==null?void 0:c.value)!=null?u:ne.closed();return(0,$e.default)(n&&ne.is(n)),[...new Set(Object.keys(r.parameters).concat(Object.keys(n.parameters)))]},Tue=(t,e)=>{var a,c,u,f,l,p,d,h;let r=(a=t.parameters[e])==null?void 0:a.value;(0,$e.default)(r&&ne.is(r));let n=(c=r.parameters.artifact)==null?void 0:c.value;(0,$e.default)(n&&ne.is(n));let i=(f=(u=n.parameters.srv)==null?void 0:u.value)!=null?f:ne.closed();(0,$e.default)(i&&ne.is(i));let s=(p=(l=i.parameters.client)==null?void 0:l.value)!=null?p:ne.closed();(0,$e.default)(s&&ne.is(s));let o=(h=(d=i.parameters.duplex)==null?void 0:d.value)!=null?h:ne.closed();return(0,$e.default)(o&&ne.is(o)),[...new Set(Object.keys(s.parameters).concat(Object.keys(o.parameters)))]},Cue=(t,e)=>{var a,c,u,f,l,p,d,h;let r=(a=t.parameters[e])==null?void 0:a.value;(0,$e.default)(r&&ne.is(r));let n=(c=r.parameters.artifact)==null?void 0:c.value;(0,$e.default)(n&&ne.is(n));let i=(f=(u=n.parameters.srv)==null?void 0:u.value)!=null?f:ne.closed();(0,$e.default)(i&&ne.is(i));let s=(p=(l=i.parameters.server)==null?void 0:l.value)!=null?p:ne.closed();(0,$e.default)(s&&ne.is(s));let o=(h=(d=i.parameters.duplex)==null?void 0:d.value)!=null?h:ne.closed();return(0,$e.default)(o&&ne.is(o)),[...new Set(Object.keys(s.parameters).concat(Object.keys(o.parameters)))]};var U$=ke(require("assert"),1);var kue=[on],q$=()=>kue.map(t=>[t,wue]);function wue(t){let e=t.svcs.validation.KumoriTypeSystem,r=t.svcs.references.KumoriPackages;return(n,i)=>{if(!Fe.getDocument(n).uri.path.endsWith(".h.kumori"))return;let a=r.GetPackage(Gr.Kumori);(0,U$.default)(N.isOk(a));let c=t.svcs.shared.workspace.IndexManager.allElements(void 0,new Set(a.value.docs.map(g=>g.uri.toString()))).toArray().find(g=>"name"in g&&g.name==="ServiceInterface");if(!c||!c.node){i("error","service interface type definition not found",{node:n});return}let u=t.ctx(),[f,l]=e.Infer(u,c.node);for(let g of l)i("error",`type error: ${g.message}`,{node:g.node});let[p,d]=e.Infer(u,n);for(let g of d)Fe.getContainerOfType(g.node,v=>v===n)&&i("error",`type error: ${g.message}`,{node:g.node});if(d.length>0||l.length>0)return;let h=e.Assignable(u,p,f);if(N.isErr(h))for(let g of h.err){let v=xn(g,n);i("error",`type error: ${g.cause}`,v)}}}var B$=ke(require("assert"),1),Aue=[on],H$=()=>Aue.map(t=>[t,Rue]);function Rue(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{var a,c,u,f;let i=t.ctx(),[s]=e.Infer(i,r);if(!ne.is(s))return;let o=(a=s.parameters.role)==null?void 0:a.value;if(!(!o||!ne.is(o)))for(let l of Object.values(o.parameters)){(0,B$.default)(l);let p=l.value;if(!p||!ne.is(p))continue;let d=(c=p.parameters.artifact)==null?void 0:c.value;if(!d||!ne.is(d))continue;let h=(u=p.parameters.config)==null?void 0:u.value,g=(f=d.parameters.config)==null?void 0:f.value;if(!h||!g)continue;let v=e.Assignable(i,h,g);if(!N.isOk(v))for(let b of v.err){let _=xn(b,r);n("error",`type error: ${b.cause}`,_)}}}}var z$=ke(require("assert"),1),Pue=[on],W$=()=>Pue.map(t=>[t,Nue]);function Nue(t){let e=t.svcs.validation.KumoriTypeSystem;return(r,n)=>{var a,c,u,f;let i=t.ctx(),[s]=e.Infer(i,r);if(!ne.is(s))return;let o=(a=s.parameters.role)==null?void 0:a.value;if(!(!o||!ne.is(o)))for(let l of Object.values(o.parameters)){(0,z$.default)(l);let p=l.value;if(!p||!ne.is(p))continue;let d=(c=p.parameters.artifact)==null?void 0:c.value;if(!d||!ne.is(d))continue;let h=(u=p.parameters.resource)==null?void 0:u.value,g=(f=d.parameters.resource)==null?void 0:f.value;if(!h||!g)continue;let v=e.Assignable(i,h,g);if(!N.isOk(v))for(let b of v.err){let _=xn(b,r);n("error",`type error: ${b.cause}`,_)}}}}var K$=new On,G$=t=>{let e=new On;for(let[r,n]of K$.entriesGroupedByKey()){let i=n.map(s=>s(t));e.addAll(r,i)}return r=>e.get(r)},vr=t=>{let e=t();for(let r of e){let n=r[0],i=r[1];K$.add(n,i)}};vr(i$);vr(s$);vr(o$);vr(a$);vr(u$);vr(f$);vr(p$);vr(h$);vr(v$);vr(x$);vr(_$);vr(b$);vr(E$);vr(C$);vr(w$);vr(A$);vr(R$);vr(P$);vr(N$);vr(O$);vr(I$);vr(L$);vr(j$);vr(q$);vr(H$);vr(W$);var J$=t=>(e,r)=>t.forEach(n=>n(e,r));function Q$(t){let e=t.validation.ValidationRegistry,r=t.validation.KumoriValidations,n=G$(r),i=Object.fromEntries(t.shared.AstReflection.getAllTypes().map(s=>[s,n(s)]).filter(([,s])=>s.length>0).map(([s,o])=>[s,J$(o)]));e.register(i)}var Y$=t=>({svcs:t,ctx:Fs(()=>t.validation.KumoriTypeSystem.NewContext())});var Z$=`package io
214
+
215
+ library
216
+
217
+ func Open(path string, args? struct open[]) string
218
+ `;var X$=`package kumori
219
+
220
+ library
221
+
222
+ alias builtin struct {
223
+ id Ref
224
+ srv Links
225
+ config struct open[]
226
+ resource struct open[Resource]
227
+ }
228
+
229
+ alias Ref struct {
230
+ name string
231
+ kind "service" | "component"
232
+ domain string
233
+ module string
234
+ version string
235
+ }
236
+ `;var eM=`package builtin
237
+
238
+ import "kumori"
239
+
240
+ builtin HTTPInbound {
241
+ id {
242
+ name "inbound"
243
+ kind "service"
244
+ domain "kumori.systems"
245
+ module "builtins/inbound"
246
+ version "1.3.0"
247
+ }
248
+
249
+ srv {
250
+ client { inbound "http" }
251
+ }
252
+
253
+ config {
254
+ type "https"
255
+ }
256
+
257
+ resource {
258
+ servercert: kumori.Certificate
259
+ serverdomain: kumori.Domain
260
+ clientcertca?: kumori.CA
261
+ }
262
+ }`;var tM=`package builtin
263
+
264
+ import "kumori"
265
+
266
+ builtin TCPInbound {
267
+ id {
268
+ name "inbound"
269
+ kind "service"
270
+ domain "kumori.systems"
271
+ module "builtins/inbound"
272
+ version "1.3.0"
273
+ }
274
+
275
+ srv {
276
+ client { inbound "tcp" }
277
+ }
278
+
279
+ config {
280
+ type "tcp"
281
+ }
282
+
283
+ resource {
284
+ port: kumori.Port
285
+ }
286
+ }`;var rM=`package kumori
287
+
288
+ library
289
+
290
+ alias ComponentInterface struct {
291
+ srv? Links
292
+ config? struct open[]
293
+ resource? struct open[Resource]
294
+ }
295
+
296
+ alias component struct {
297
+ srv? Links
298
+ config? struct open[]
299
+ resource? struct open[Resource]
300
+
301
+ scale? number
302
+ code? struct open[Code]
303
+ init? []struct {
304
+ cmd? []string
305
+ image Image
306
+ entrypoint? []string
307
+
308
+ size struct {
309
+ memory RAMSized
310
+ cpu CPUSized
311
+ mincpu? CPUSized
312
+ }
313
+
314
+ env? struct open[Env]
315
+ fs? struct open[File]
316
+ }
317
+ size struct {
318
+ bandwidth BandwidthSized
319
+ minbandwidth? BandwidthSized
320
+ mincpu CPUSized
321
+ }
322
+ probe? struct open[Probes]
323
+ }
324
+
325
+ alias Code struct {
326
+ cmd? []string
327
+ image Image
328
+ entrypoint? []string
329
+
330
+ size struct {
331
+ memory RAMSized
332
+ cpu CPUSized
333
+ mincpu? CPUSized
334
+ }
335
+
336
+ env? struct open[Env]
337
+ fs? struct open[File]
338
+ }
339
+
340
+ alias Image string | struct { hub: struct { name: string, secret?: string }, tag: string }
341
+
342
+ alias File string | FSMap | struct { volume: string }
343
+ alias FSMap FSData | FSSecret | FSPort | FSDomain | FSCertificate | FSCa
344
+
345
+ alias AllowedFormat "text" | "json" | "yaml" | "flatdict"
346
+
347
+ alias FSData struct { data: string, mode?: number, format?: AllowedFormat }
348
+ alias FSSecret struct { secret: string, mode?: number, format?: AllowedFormat }
349
+ alias FSPort struct { port: string, mode?: number, format?: AllowedFormat }
350
+ alias FSDomain struct { domain: string, mode?: number, format?: AllowedFormat }
351
+ alias FSCertificate struct { certificate: string, mode?: number, format?: AllowedFormat }
352
+ alias FSCa struct { ca: string, mode?: number, format?: AllowedFormat }
353
+
354
+ alias Env string | bool | number | struct { secret: string }
355
+
356
+ alias Probes struct {
357
+ liveness? LivenessProbeAttributes
358
+ readiness? ReadinessProbeAttributes
359
+ pmetrics? PrometheusMetricsProbeAttributes
360
+ }
361
+
362
+ alias LivenessProbeAttributes struct {
363
+ protocol ProbeProtocol
364
+ startupGraceWindow? StartupGraceWindow
365
+ frequency? any
366
+ timeout? number
367
+ }
368
+
369
+ alias ReadinessProbeAttributes struct {
370
+ protocol ProbeProtocol
371
+ frequency? any
372
+ timeout? number
373
+ }
374
+
375
+ alias PrometheusMetricsProbeAttributes struct {
376
+ protocol HTTPOnlyProbeProtocol
377
+ }
378
+
379
+ alias ProbeProtocol struct {
380
+ http? HTTPProbeProtocol
381
+ tcp? TCPProbeProtocol
382
+ exec? ExecProbeProtocol
383
+ }
384
+
385
+ alias HTTPOnlyProbeProtocol struct {
386
+ http HTTPProbeProtocol
387
+ }
388
+
389
+ alias HTTPProbeProtocol struct {
390
+ port number
391
+ path string
392
+ }
393
+
394
+ alias TCPProbeProtocol struct {
395
+ port number
396
+ }
397
+
398
+ alias ExecProbeProtocol struct {
399
+ path string
400
+ }
401
+
402
+ alias StartupGraceWindow struct {
403
+ unit "ms" | "attempt"
404
+ duration number
405
+ probe bool
406
+ }
407
+ `;var nM=`package kumori
408
+
409
+ library
410
+
411
+ alias deployment struct {
412
+ name string
413
+ artifact any
414
+ resilience? number
415
+
416
+ config? struct open[]
417
+ resource? struct open[Resource]
418
+ }
419
+ `;var iM=`package kumori
420
+
421
+ library
422
+
423
+ alias Resource Volume | CA | Certificate | Secret | Domain | Port
424
+
425
+ type CA string
426
+ type Certificate string
427
+ type Secret string
428
+ type Domain string
429
+ type Port string
430
+
431
+ alias Volume Registered | InlineVolume | DeprecatedVolume
432
+ alias InlineVolume NonReplicated | Persisted | Volatile
433
+
434
+ type Registered string
435
+ type NonReplicated StorageSized
436
+ type Persisted StorageSized
437
+ type Volatile StorageSized
438
+
439
+ // NOTE: These are here to retain backwards compatibility.
440
+ // **Do not use.** Will be removed in the future.
441
+ alias DeprecatedVolume Ephemeral | Persistent
442
+ type Ephemeral StorageSized
443
+ type Persistent string
444
+ `;var sM=`package kumori
445
+
446
+ library
447
+
448
+ alias ServiceInterface struct {
449
+ srv? Links
450
+ config? struct open[]
451
+ resource? struct open[Resource]
452
+ }
453
+
454
+ alias service struct {
455
+ srv? Links
456
+ config? struct open[]
457
+ resource? struct open[Resource]
458
+
459
+ role? struct open[Role]
460
+ connect? struct open[Connection]
461
+ }
462
+
463
+ alias Role struct {
464
+ artifact any // TODO: service, component or builtin
465
+ config? struct open[]
466
+ resource? struct open[Resource]
467
+ }
468
+
469
+ alias Connection LoadBalancer | FullConnector
470
+
471
+ type LoadBalancer struct {
472
+ from struct { target string, channel string } | []struct { target string, channel string }
473
+ to struct { target string, channel string } | []struct { target string, channel string }
474
+
475
+ meta? any
476
+ }
477
+
478
+ type FullConnector ReducedFullConnector | CompleteFullConnector
479
+
480
+ alias ReducedFullConnector struct {
481
+ target string
482
+ channel string
483
+ meta? any
484
+ }
485
+
486
+ alias CompleteFullConnector struct {
487
+ from struct { target string, channel string } | []struct { target string, channel string }
488
+ to struct { target string, channel string } | []struct { target string, channel string }
489
+
490
+ meta? any
491
+ }`;var oM=`library
492
+
493
+ alias Links struct {
494
+ client? struct open[Client]
495
+ server? struct open[Server]
496
+ duplex? struct open[Server]
497
+ }
498
+
499
+ alias Channel "udp" | "tcp" | "http" | "grpc"
500
+ alias Client Channel
501
+ alias Server Channel | struct { protocol Channel, port number }`;var aM=`library
502
+
503
+ alias StorageUnit "k" | "M" | "G" | "T" | "P" | "E" | "Ki" | "Mi" | "Gi" | "Ti" | "Pi" | "Ei"
504
+ alias StorageSized struct {
505
+ size number
506
+ unit StorageUnit
507
+ }
508
+
509
+ alias CPUUnit "m"
510
+ alias CPUSized struct {
511
+ size number
512
+ unit CPUUnit
513
+ }
514
+
515
+ alias RAMUnit "G" | "M" | "Gi" | "Mi"
516
+ alias RAMSized struct {
517
+ size number
518
+ unit RAMUnit
519
+ }
520
+
521
+ alias BandwidthUnit "G" | "M" | "Gi" | "Mi"
522
+ alias BandwidthSized struct {
523
+ size number
524
+ unit BandwidthUnit
525
+ }
526
+ `;var cM=`library
527
+
528
+ alias Unit "m" | "k" | "M" | "G" | "T" | "P" | "E" | "Ki" | "Mi" | "Gi" | "Ti" | "Pi" | "Ei"
529
+
530
+ alias Sized struct {
531
+ size number
532
+ unit Unit
533
+ }
534
+ `;var uM=`library
535
+
536
+ type bool bool
537
+ type number number
538
+ type string string
539
+ type any any
540
+ alias list []string | []number
541
+ alias struct struct open[]`;var lM=`package strconv
542
+
543
+ library
544
+
545
+ func Format(i number, base number) string
546
+
547
+ func JSON(v any) string
548
+
549
+ func Concat(v []string) string
550
+
551
+ func Join(v []string, sep string) string`;var Gi=[],fM=Gi,xs=(t,e)=>({src:t,data:e});Gi.push(xs("/io/lib.kumori",Z$));Gi.push(xs("/kumori/builtin.kumori",X$));Gi.push(xs("/kumori/builtin/httpinbound.h.kumori",eM));Gi.push(xs("/kumori/builtin/tcpinbound.h.kumori",tM));Gi.push(xs("/kumori/component.kumori",rM));Gi.push(xs("/kumori/deployment.kumori",nM));Gi.push(xs("/kumori/resource.kumori",iM));Gi.push(xs("/kumori/service.kumori",sM));Gi.push(xs("/kumori/shared.kumori",oM));Gi.push(xs("/kumori/sized.kumori",aM));Gi.push(xs("/sized.kumori",cM));Gi.push(xs("/std.kumori",uM));Gi.push(xs("/strconv/lib.kumori",lM));var n_=fM.map(t=>kI(t.src,t.data)),Oue=new Map;for(let t of n_){let e=ee.dirname(t.uri).fsPath.split("/").filter(i=>i!==""),r=Oue,n="";for(let i of e){n=`${n}/${i}`;let s=r.get(i);if(s===void 0&&(s={type:"Dir",contents:new Map},r.set(i,s)),s.type==="File")throw new Error("fs collision on "+n);r=s.contents}r.set(ee.basename(t.uri),{type:"File",data:t.data})}async function J4(t,e,r,n=ye.CancellationToken.None){await dM(t,e,r,n)}async function dM(t,e,r,n=ye.CancellationToken.None){await it(n);let i=await t.readDirectory(e);if(r.Dir){let o=await r.Dir(e,i);if(o!=null&&o.break)return o;if(o!=null&&o.skipDir)return}let s=[];for(let o of i)if(await it(n),o.isDirectory)s.push(o.uri);else if(o.isFile&&r.File){let a=await r.File(o.uri);if(a!=null&&a.break)return a}for(let o of s){await it(n);let a=await dM(t,o,r);if(a!=null&&a.break)return a}}var xr="kumori.mod.json";async function pM(t,e,r=ye.CancellationToken.None){let n=[],i=await Iue(t,De.parse(e.uri),r);for(let s of i){let o=await kr(t,s);N.isOk(o)&&n.push(o.value)}return n}async function Iue(t,e,r=ye.CancellationToken.None){let n=[];return await J4(t,e,{Dir:async i=>{if(e.fsPath===i.fsPath)return;let s=ee.dirname(i);if((await t.readDirectory(s)).map(a=>a.uri).map(ee.basename).includes(xr))return{skipDir:!0}},File:i=>{ee.basename(i)===xr&&n.push(ee.dirname(i))}},r),n}async function wl(t,e){if((await t.readDirectory(e)).map(s=>ee.basename(s.uri)).includes(xr))return Ut(ee.joinPath(e,xr));let i=ee.dirname(e);return e.fsPath===i.fsPath?ot:wl(t,i)}var i_=k.object({target:k.string(),version:k.string()}),mM=i_.extend({headers:k.optional(i_)}),Due=mM.extend({alias:k.optional(k.string())}),Lue=k.object({spec:k.literal("kumori/module/v1"),module:k.string(),kumori:k.string(),version:k.string(),headers:k.optional(i_),cacheLocation:k.optional(k.string().default(".kumori/mod")),requires:k.array(Due),indirect:k.array(mM).optional()}),hM=k.discriminatedUnion("spec",[Lue]);async function Gs(t,e,r=ye.CancellationToken.None){try{await it(r)}catch(o){return oe("error reading module: operation cancelled")}let n=e;if(n.scheme!=="file")return oe(`unexpected URI scheme '${n.scheme}': ${n.toString()}`);ee.basename(n)!==xr&&(n=ee.joinPath(n,xr));let i;try{i=JSON.parse(await t.readFile(n))}catch(o){return oe(`error reading file ${n.fsPath}: ${o}`)}let s=await hM.safeParseAsync(i);return s.success?Le({Root:ee.dirname(n),Manifest:s.data}):oe(`error parsing file ${n.fsPath}: ${JSON.stringify(s.error.format())}`)}function ig(t){return t instanceof De||(t=t.Root),ee.joinPath(t,"vendor")}function Q4(t){if(!(t instanceof De)){let e=t.Manifest,r=t.Root;if(e&&e.cacheLocation){let n=e.cacheLocation;return n.startsWith(".")?ee.joinPath(r,n):n.startsWith("/")?De.parse(n):ee.joinPath(r,n)}t=r}return ee.joinPath(t,".kumori/mod")}var fg=require("fs/promises");var s_=require("crypto"),gM=require("fs"),yM=require("fs/promises"),o_=ke(require("path"),1),vM=require("stream/promises");async function $p(t){let e=[];async function r(i){let s=await(0,yM.readdir)(i,{withFileTypes:!0});for(let o of s){let a=o_.default.join(i,o.name),c=o_.default.relative(i,a).replace(/\\/g,"/");if(o.isDirectory())await r(a);else if(o.isFile()){let u=(0,s_.createHash)("sha256"),f=(0,gM.createReadStream)(a);await(0,vM.pipeline)(f,u),e.push({relativePath:c,hash:u.digest("hex")})}}}await r(t),e.sort((i,s)=>i.relativePath.localeCompare(s.relativePath));let n=(0,s_.createHash)("sha256");for(let i of e)n.update(`${i.relativePath} ${i.hash}
552
+ `);return`h1:${n.digest("hex")}`}var wM=ke(TM(),1);var ea=class{get[Symbol.toStringTag](){return"URLSearchParams"}constructor(e){this.isEncoded=!1,this.params=[],typeof e=="string"?a_(e,e[0]==="?"?1:0,e.length,this,[38],61,[],{encode:!0}):Array.isArray(e)?e.forEach(r=>{this.append(r[0],r[1])}):typeof e=="object"&&Object.keys(e).forEach(r=>{this.append(r,e[r])})}*entries(){for(let e=0;e<this.params.length;e+=1)yield[mo(this.params[e][0]),mo(this.params[e][1])]}append(e,r){this.params.push([Y4(e),Y4(r)])}delete(e){this.params=this.params.filter(([r])=>mo(r)!==e)}forEach(e){this.params.forEach(([r,n])=>{e(mo(n),mo(r),this)})}get(e){let r=this.params.find(([n])=>mo(n)===e);return r?mo(r[1]):null}getAll(e){return this.params.filter(([r])=>mo(r)===e).map(r=>r[1])}has(e){return this.get(e)!==null}*keys(){for(let e=0;e<this.params.length;e+=1)yield mo(this.params[e][0])}set(e,r){let n=this.params.findIndex(([i])=>mo(i)===e);if(n===-1){this.append(e,r);return}this.delete(e),this.params.splice(n,0,[Y4(e),Y4(r)])}sort(){this.params=this.params.sort((e,r)=>e[0].localeCompare(r[0]))}toString(){return this.params.map(([e,r])=>`${e}=${r}`).join("&")}*values(){for(let e=0;e<this.params.length;e+=1)yield mo(this.params[e][1])}[Symbol.iterator](){return this.entries()}get size(){return this.params.length}};function a_(t,e,r,n,i,s,o,{encode:a}={encode:!1}){let c=e,u=c,f=0,l=0,p=a?n.append.bind(n):(d,h)=>n.params.push([d,h]);for(;c<=r;c+=1){let d=t.charCodeAt(c);if(d===s&&f===0)f=c,l=c+1;else if(i.indexOf(d)!==-1)c>u&&p(t.slice(u,f||c),t.slice(l||c,c)),u=c+1,f=0,l=0;else if(o.indexOf(d)!==-1)break}return c!==u&&p(t.slice(u,f||c),t.slice(l||c,c)),c}function mo(t){if(t.indexOf("%")!==-1)try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}else return t}function Y4(t){let e=""+t,r="";for(let n=0;n<e.length;n++)e.charCodeAt(n)===32?r+="+":r+=encodeURIComponent(e[n]);return r}var kM=[47,35,63];function nle(t){return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===45||t===43}var Bc=class{constructor(t){this.parse(t)}get protocol(){return this._protocol}get username(){return this._username}get password(){return this._password}get hostname(){return this._hostname}get host(){return this._host}get port(){return this._port}get pathname(){return this._pathname}get search(){return this._search||this._extractParams(),this._search}get searchParams(){return this.isQueryParsed||this._extractSearchParams(),this._query}get parameters(){return this.isQueryParsed||this._extractSearchParams(),this._parameters}hasParameterString(){return this.parameterStartIndex>0}get hash(){return!this._search&&!this._hash&&this._extractParams(),this._hash}get href(){return this._href}toString(){return this.href}toJSON(){return this.href}get domainInfo(){return this._domainInfo||(this._domainInfo=(0,wM.parse)(this.hostname,{extractHostname:!1})),this._domainInfo}get hostIsIp(){return this.domainInfo.isIp}get domain(){return this.domainInfo.hostname||this.hostname}get generalDomain(){return this.domainInfo.domain||this.hostname}get path(){return this.pathname||"/"}get scheme(){return this.protocol.slice(0,-1)}isValidHost(){return this.hostIsIp||this.generalDomain!==null}extractKeyValues(){if(this.parsedParameters)return this.parsedParameters;if(this.parsedParameters=new ea,this.queryStartIndex===0&&this.parameterStartIndex===0)return this.parsedParameters;let t=this.parameterStartIndex||this.queryStartIndex,e=this.href.length-1,r=t;return this.href.charCodeAt(r)===59&&(r=this._extractParamTuples(r+1,e,this.parsedParameters,[59],61,[63,35])),this.href.charCodeAt(r)===63&&(r=this._extractParamTuples(r+1,e,this.parsedParameters,[38,59],61,[35])),this.parsedParameters}_extractHostname(t,e){let r=0,n=!1,i=t,s=!1,o=!1;if(this._href.charCodeAt(i)===91){for(s=!0;i<=e;i+=1)if(this._href.charCodeAt(i)===93){let u=this._href.charCodeAt(i+1);if(u===58)r=i+1,i+=1,n=!0;else if(u===47)i+=1,n=!0;else if(i!==e)throw new TypeError("expected `:` or `/` after IPv6 address");break}}if(!s)for(;i<=e;i+=1){let c=this._href.charCodeAt(i);if(c===58){r=i,n=!0;break}else if(c===64)return this._username=this._href.slice(t,i),this._password="",this._extractHostname(i+1,e);if(kM.indexOf(c)!==-1){n=!0;break}else{if(c<=32)throw new TypeError(`Invalid character '${this.href[i]}' in hostname`);c>=65&&c<=90&&(o=!0)}}let a=n?i:i+1;if(o&&(this._href=`${this._href.slice(0,t)}${this._href.slice(t,a).toLowerCase()}${this._href.slice(a)}`),this._hostname=this._href.slice(t,a),r>0){i+=1;let c=i,u=!1;for(;i<=e;i+=1){let f=this._href.charCodeAt(i);if(kM.indexOf(f)!==-1){this._port=this._href.slice(c,i);break}else{if(f===64)return this._username=this._href.slice(t,r||i),this._password=this._href.slice(r+1,i),this._extractHostname(i+1,e);(f<48||f>57)&&(u=!0)}}if(this._port||(this._port=this.href.slice(c,i)),u)throw new TypeError("Invalid URL: port contains non numeric character");if(this._port.length>=5&&+this._port>65535)throw new TypeError("Invalid URL: invalid port number")}return this._host=this._href.slice(t,n?i:i+1),this.origin=`${this._protocol}//${this._host}`,n?i:i+1}_extractParams(){if(this.queryStartIndex>0){let t=this.queryStartIndex,e=this.href.length-1;if(this.href.charCodeAt(t)===63){let r=!1;for(;t<=e;t+=1)if(this.href.charCodeAt(t)===35){r=!0;break}this._search=this.href.slice(this.queryStartIndex,r?t:e+1),this._search.length===1&&(this._search="")}this.href.charCodeAt(t)===35&&(this._hash=this.href.slice(t,e+1))}}_extractSearchParams(){if(this.isQueryParsed=!0,this.queryStartIndex===0&&this.parameterStartIndex===0)return;let t=this.parameterStartIndex||this.queryStartIndex,e=this.href.length-1,r=t;if(this.href.charCodeAt(r)===59&&(r=this._extractParamTuples(r+1,e,this._parameters,[59],61,[63,35])),this.href.charCodeAt(r)===63){let n=r;r=this._extractParamTuples(r+1,e,this._query,[38],61,[35]),this._search=this.href.slice(n,r),this._search.length===1&&(this._search="")}this.href.charCodeAt(r)===35&&(this._hash=this.href.slice(r,e+1))}_extractParamTuples(t,e,r,n,i,s){return a_(this.href,t,e,r,n,i,s)}parse(t){if(typeof t!="string"||t.length===0)throw new TypeError(`${t} is not a valid URL`);this._protocol="",this._hostname="",this._host="",this._port="",this._pathname="",this._username="",this._password="",this._search="",this._hash="",this.parameterStartIndex=0,this.queryStartIndex=0,this.isQueryParsed=!1,this._parameters=new ea,this._query=new ea,this._domainInfo=null,this.parsedParameters=null;let e=0,r=t.length-1;for(;t.charCodeAt(e)<=32;)e+=1;for(;t.charCodeAt(r)<=32;)r-=1;this._href=t.slice(e,r+1),r=this._href.length-1;let n=!1;for(;e<=r;e+=1){let i=this._href.charCodeAt(e);if(i===58){this._protocol=this._href.slice(0,e+1),n&&(this._protocol=this._protocol.toLowerCase(),this._href=`${this._protocol}${this._href.slice(e+1)}`);break}else if(nle(i))i>=65&&i<=90&&(n=!0);else throw new TypeError("Invalid URL protocol")}if(e>=r)throw new TypeError("No protocol");for(this.slashes="",e+=1;e<r&&this._href.charCodeAt(e)===47;e+=1)this.slashes+="/";if(this.slashes.length>=2?e=this._extractHostname(e,r):(this._host="",this._hostname="",this.origin="null"),e>=r)this._href.charCodeAt(r)!==47&&(this._href+="/"),this._pathname="/";else{let i=e;for(;e<=r;e+=1){let s=this._href.charCodeAt(e);if(s===59&&!this.parameterStartIndex)this.parameterStartIndex=e;else if(s===63||s===35){this.queryStartIndex=e;break}}this._pathname=this.href.slice(i,this.queryStartIndex!==0?this.queryStartIndex:r+1)||"/"}}};var og=class extends ea{constructor(e,r){super(),this.url=e,this.params=r.params}append(e,r){super.append(e,r),this.url.search=this.toString()}delete(e){super.delete(e),this.url.search=this.toString()}set(e,r){super.set(e,r),this.url.search=this.toString()}sort(){super.sort(),this.url.search=this.toString()}};function Hc(t,e){let r={hash:e.hash!==void 0?e.hash:t.hash,host:e.host!==void 0?e.host:t.host,hostname:e.hostname!==void 0?e.hostname:t.hostname,password:e.password!==void 0?e.password:t.password,pathname:e.pathname!==void 0?e.pathname:t.pathname,port:e.port!==void 0?e.port:t.port,protocol:e.protocol!==void 0?e.protocol:t.protocol,search:e.search!==void 0?e.search:t.search,username:e.username!==void 0?e.username:t.username};(e.hostname||e.port)&&((r.protocol==="https:"&&r.port==="443"||r.protocol==="http:"&&r.port==="80")&&(r.port=""),r.host=`${r.hostname}${r.port?":":""}${r.port}`);let n=r.username?r.password?`${r.username}:${r.password}@`:`${r.username}@`:r.password?`:${r.password}@`:"";return new Bc(`${r.protocol}${t.slashes}${n}${r.host}${r.pathname}${r.search}${r.hash}`)}var Bp=class{get[Symbol.toStringTag](){return"URL"}constructor(t){this.url=new Bc(t)}get protocol(){return this.url.protocol}set protocol(t){let e=this.url.protocol,r=t.endsWith(":")?"":":",n=`${t}${r}${this.href.slice(e.length)}`;this.url=new Bc(n)}get username(){return this.url.username}set username(t){this.url=Hc(this,{username:t||""})}get password(){return this.url.password}set password(t){this.url=Hc(this,{password:t||""})}get hostname(){return this.url.hostname}set hostname(t){this.url=Hc(this,{hostname:t||""})}get host(){return this.url.host}set host(t){this.url=Hc(this,{host:t})}get origin(){return this.url.origin}get port(){return this.url.port}set port(t){this.url=Hc(this,{port:t||""})}get pathname(){return this.url.pathname}set pathname(t){let e=t.charCodeAt(0)===47?t:`/${t}`;this.url=Hc(this,{pathname:e})}get search(){return this.url.search}set search(t){let e=t.charCodeAt(0)===63?t.slice(1):t;this.url=Hc(this,{search:e.length>0?`?${e}`:""})}get searchParams(){return new og(this,this.url.searchParams)}get parameters(){return this.url.parameters}hasParameterString(){return this.url.hasParameterString()}get hash(){return this.url.hash}set hash(t){let e=t.charCodeAt(0)===35?t.slice(1):t;this.url=Hc(this,{hash:e.length>0?`#${e}`:""})}get href(){return this.url.href}set href(t){this.url=new Bc(t)}toString(){return this.href}toJSON(){return this.href}get domainInfo(){return this.url.domainInfo}get hostIsIp(){return this.url.hostIsIp}get domain(){return this.url.domain}get generalDomain(){return this.url.generalDomain}get path(){return this.url.path}get scheme(){return this.url.scheme}get slashes(){return this.url.slashes}isValidHost(){return this.url.isValidHost()}extractKeyValues(){return this.url.extractKeyValues()}};var Ba=class extends Bp{};var Ha=ke(require("fs"),1),cg=ke(require("path"),1),D_=ke(require("os"),1),RV=ke(I_(),1);var AV={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://kumori.systems/kdsl/registry-index.schema.json",title:"KDSL Registry Module Index",description:"Defines the structure of the index.json file hosted in a registry repository.",type:"object",required:["modules"],properties:{modules:{type:"array",minItems:1,uniqueItems:!0,description:"List of modules available in this registry index",items:{type:"object",required:["name","version","repository","checksum"],properties:{name:{type:"string",pattern:"^[a-zA-Z0-9._-]+$",description:"Name of the module"},version:{type:"string",description:"Semantic version of the module"},description:{type:"string",description:"Optional human-readable module description"},location:{type:"string",format:"uri",description:"Location (URL) where the module resides"},checksum:{type:"string",pattern:"^[a-fA-F0-9]{64}$",description:"SHA-256 checksum of the module package"},icon:{type:"string",format:"uri",description:"Optional URL to an icon for this module"}},additionalProperties:!1}}},additionalProperties:!1};var go=class{constructor(){this.registries=[];this.defaultName="kumori.systems";let e=cg.default.join(D_.default.homedir(),".config","kdsl");try{Ha.default.existsSync(e)||Ha.default.mkdirSync(e,{recursive:!0})}catch(r){throw new Error(`Failed to create config directory: ${r}`)}this.filePath=cg.default.join(e,"registries.json"),this.load()}initialize(){this.registries=[{selector:this.defaultName,indexUrl:"https://github.com/jrovira-kumori"}],this.save()}load(){if(Ha.default.existsSync(this.filePath))try{let e=Ha.default.readFileSync(this.filePath,"utf-8"),r=JSON.parse(e);if(!Array.isArray(r.registries))throw new Error("Malformed registry file: 'registries' is not an array");this.registries=r.registries}catch(e){console.warn(`Failed to load registries: ${e}. Reinitializing.`),this.initialize()}else this.initialize()}save(){let e=`${this.filePath}.tmp`;try{Ha.default.writeFileSync(e,JSON.stringify({registries:this.registries},null,2),{encoding:"utf-8"}),Ha.default.renameSync(e,this.filePath)}catch(r){throw new Error(`Failed to save registries: ${r}`)}}list(){return this.registries}async add(e){if(!e.selector||typeof e.selector!="string")throw new Error("Registry must have a valid 'selector'");if(this.registries.some(c=>c.selector===e.selector))throw new Error(`Registry with selector '${e.selector}' already exists`);let r=cg.default.join(D_.default.homedir(),".config","kdsl",".cache",e.selector),n=cg.default.join(r,"index.json");Ha.default.mkdirSync(r,{recursive:!0});let i=`${e.indexUrl}/index.json`,s=await fetch(i);if(!s.ok)throw new Error(`Failed to download index from ${i}: ${s.statusText}`);let o=await s.json();if(!this.validateIndexSchema(o))throw new Error(`Index schema validation failed for ${i}`);Ha.default.writeFileSync(n,JSON.stringify(o,null,2),{encoding:"utf-8"}),this.registries.push(e),this.save()}remove(e){if(e===this.defaultName)throw new Error(`Cannot remove default registry '${this.defaultName}'`);let r=this.registries.length;if(this.registries=this.registries.filter(n=>n.selector!==e),this.registries.length===r)throw new Error(`Registry '${e}' not found`);this.save()}validateIndexSchema(e){let n=new RV.default({validateSchema:!1,allErrors:!0}).compile(AV);return n(e)?!0:(console.warn("Index schema valiVdation errors:",n.errors),!1)}};var ug=ke(require("path"),1),$_=ke(require("os"),1),lg=ke(require("fs"),1),L_;(r=>(r.toString=n=>{let i=`${n.Scheme}://${n.Location}`;return ue.isSome(n.Major)&&(i=`${i}#${n.Major.value}`),ue.isSome(n.Version)&&(i=`${i}@${n.Version.value}`),i},r.toURL=n=>new Ba(`${n.Scheme}://${n.Location}`)))(L_||(L_={}));function Js(t){var u;let e=[t],r="git";if(e=e.pop().split("://"),e.length>2)return ot;e.length===2&&(r=e.shift());let n=ot;if(e=e.pop().split("@"),e.length>2)return ot;e.length===2&&(n=Ut(e.pop()));let i=ot;if(e=e.pop().split("#"),e.length>2)return ot;e.length===2&&(i=Ut(e.pop()));let s=e.pop(),c=new go().list().find(f=>s.startsWith(f.selector));if(c!==void 0){let f=ug.default.join($_.default.homedir(),".config","kdsl",".cache",c.selector),l=ug.default.join(f,"index.json");if(!lg.default.existsSync(l))return console.warn(`Index not found in cache: ${l}`),ot;let p=lg.default.readFileSync(l,{encoding:"utf-8"}),h=JSON.parse(p).modules.find(T=>c.selector+"/"+T.name==s);if(h===void 0)return console.warn(`Module not found in registry index: ${s} (registry: ${c.selector})`),ot;if(ue.isSome(n)&&h.version!==n.value)return console.warn(`Module version not found in registry index: ${s} (requested: ${n.value}, available: ${h.version})`),ot;let g=s.substring(h.location.length),b=((u=h.location.split("://")[1])!=null?u:h.location).replace(/\/+$/,""),_=g.startsWith("/")?g:`/${g}`;s=`${b}${_}`}return Ut({Location:s,Scheme:r,Major:i,Version:n,toString(){return L_.toString(this)}})}function PV(t){let n=new go().list().find(i=>t.startsWith(i.selector));if(n!==void 0){let i=ug.default.join($_.default.homedir(),".config","kdsl",".cache",n.selector),s=ug.default.join(i,"index.json");if(!lg.default.existsSync(s))return console.warn(`Index not found in cache: ${s}`),ot;let o=lg.default.readFileSync(s,{encoding:"utf-8"}),c=JSON.parse(o).modules.find(u=>n.selector+"/"+u.name==t);return c===void 0?(console.warn(`Module not found in registry index: ${t} (registry: ${n.selector})`),ot):Ut(c.checksum)}return ot}var Mfe=k.object({indirect:k.optional(k.boolean()),sum:k.string()}),Ffe=k.object({spec:k.literal("kumori/sumdb/v1"),content:k.record(Mfe)}),za;(c=>(c.Type=k.discriminatedUnion("spec",[Ffe]),c.Parse=c.Type.safeParseAsync,c.Retrieve=Vfe,c.Register=jfe,c.New=()=>({spec:"kumori/sumdb/v1",content:{}}),c.Open=Ufe,c.Read=qfe,c.Write=IV))(za||(za={}));var NV=(t,e)=>{let r=`${t}@v${e}`,n=Js(r);return N.isOk(n)?n.value.toString():r};function Vfe(t,e,r){var n;switch(t.spec){case"kumori/sumdb/v1":return ue.fromNullable((n=t.content[NV(e,r)])==null?void 0:n.sum)}}async function jfe(t,e,r,n,i){switch(t.spec){case"kumori/sumdb/v1":{let s=await $p(e.fsPath);t.content[NV(n,i)]={sum:s};break}}return IV(r.Locations.Checksum(),t)}var M_=t=>ee.joinPath(t.Root,"kumori.sum.json");async function Ufe(t){let e;try{e=(await(0,fg.readFile)(t.fsPath)).toString("utf-8")}catch(r){return Le(za.New())}return N.mapErr(await OV(e),r=>`error parsing sumdb '${t.fsPath}': ${r}`)}async function qfe(t){let e;try{e=(await(0,fg.readFile)(t.fsPath)).toString("utf-8")}catch(r){return oe(`unable to open sumdb: error reading file '${t.fsPath}'`)}return N.mapErr(await OV(e),r=>`error parsing sumdb '${t.fsPath}': ${r}`)}async function OV(t){let e;try{e=JSON.parse(t)}catch(n){return oe("invalid json data")}let r=await za.Parse(e);if(!r.success){let n,i=Bfe(r.error);return i.length===0?n="<unknown error>":n=`
553
+ `+i.join(`
554
+ `),oe(n)}return Le(r.data)}async function IV(t,e){let r;try{r=JSON.stringify(e,void 0,4)}catch(n){return oe("unable to serialize sumdb")}try{await(0,fg.writeFile)(t.fsPath,r)}catch(n){return oe(`error writing to sumdb: error writing file '${t.fsPath}': `+n)}return Le(void 0)}function Bfe(t){return DV("",t.format()).map(([r,n])=>r===""?n:`- [${r}]: ${n}`)}function DV(t,e){let r=[];"_errors"in e&&Array.isArray(e._errors)&&e._errors.every(n=>typeof n=="string")&&(r=r.concat(e._errors.map(n=>[t,n])));for(let[n,i]of Object.entries(e))n!=="_errors"&&(typeof i!="object"||i===null||(r=r.concat(DV(`${t}.${n}`,i))));return r}async function kr(t,e){let r=await wl(t,e);if(N.isErr(r))return oe(`not a module: unable to find ${xr}`);let n=await Gs(t,r.value);if(N.isErr(n))return n;let i=n.value;return Le({Current:i,Root:i,Locations:{Cache:Fs(()=>Q4(i)),Vendor:Fs(()=>ig(i)),Checksum:Fs(()=>M_(i))}})}(e=>{async function t(r,n,i){let s=await e(n,i);if(N.isErr(s))return oe(`move context: ${i.fsPath}: no module in location`);if(s.value.Current.Root.fsPath===r.Current.Root.fsPath)return oe(`move context: ${i.fsPath}: module not moved`);let o=s.value.Current;return Le(Y(C({},r),{Current:o,Locations:Y(C({},r.Locations),{Vendor:Fs(()=>ig(o)),Checksum:Fs(()=>M_(o))})}))}e.Move=t})(kr||(kr={}));var LV=ke(require("assert"),1),$V=require("path");async function yv(t,e,r=ye.CancellationToken.None){let n=t.svcs.workspace.FileSystemProvider,i=await kr(n,e.Root);return(0,LV.default)(N.isOk(i)),await MV(Y(C({},t),{mod:i.value}),r),Array.from(t.cache.values()).filter(ue.isSome).map(s=>s.value)}async function MV(t,e=ye.CancellationToken.None){let r=t.mod.Current;if(r.Manifest.headers!==void 0){let n=r.Manifest.headers;await it(e),await F_(t,n.target,n.version,e)}for(let n of r.Manifest.requires)if(await it(e),await F_(t,n.target,n.version,e),n.headers!==void 0){let i=n.headers;await it(e),await F_(t,i.target,i.version,e)}}async function F_(t,e,r,n=ye.CancellationToken.None){let i=t.svcs.workspace.FileSystemProvider,s=Ln(e,r);if(t.cache.get(s)!==void 0)return;t.cache.set(s,ot);let a=await Hfe(t,e,r);if(N.isErr(a))return;let c=await kr.Move(t.mod,i,a.value);N.isErr(c)||(t.cache.set(s,Le(c.value.Current)),t=Y(C({},t),{mod:c.value}),await MV(t,n))}async function Hfe(t,e,r){let n=t.svcs.workspace.FileSystemProvider,i=Ln(e,r);if((0,$V.isAbsolute)(e)){let a=De.file(e),c=await N.tryCatchAsync(async()=>await n.readDirectory(a));if(N.isOk(c))return Ut(a)}let s=ee.joinPath(t.mod.Locations.Vendor(),i),o=await N.tryCatchAsync(async()=>await n.readDirectory(s));return N.isOk(o)?Ut(s):(s=ee.joinPath(t.mod.Locations.Cache(),i),o=await N.tryCatchAsync(async()=>await n.readDirectory(s)),N.isOk(o)?Ut(s):ot)}async function Hp(t,e,r=ye.CancellationToken.None){await it(r);let n=[],i=t.ServiceRegistry.all.flatMap(a=>a.LanguageMetaData.fileExtensions),s=ig(e).fsPath,o=Q4(e).fsPath;return await J4(t.workspace.FileSystemProvider,e,{Dir:a=>({skipDir:[s,o].includes(a.fsPath)}),File:a=>{let c=ee.extname(a);i.includes(c)&&n.push(a)}},r),n}var vv=class{constructor(e){this.svcs=e;this.initialBuildOptions={};this.folders=[];this.mutex=new Mu;this._ready=new qn}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var r;this.folders=(r=e.workspaceFolders)!=null?r:this.folders}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders,r))}async initializeWorkspace(e,r=ye.CancellationToken.None){e=e.map(zfe);let n=this.svcs.workspace.LangiumDocuments,i=u=>{n.hasDocument(u.uri)||n.addDocument(u)};this.loadStdlib(i);let s=this.svcs.references.KumoriModules.ResolverCtx(),o=this.svcs.workspace.FileSystemProvider,a=(await Promise.all(e.map(async u=>{let f=await pM(o,u,r),l=(await Promise.all(f.map(d=>Gs(o,d.Current.Root)))).filter(N.isOk).map(d=>d.value);return(await Promise.all(l.map(d=>yv(s,d,r)))).flat().concat(l)}))).flat();await Promise.all(a.map(async u=>{let f=await Hp(this.svcs,u.Root),l=Y(C({},u),{Docs:f});await this.svcs.references.KumoriModules.registerModule(l),await this.loadModule(l,i)})),this._ready.resolve(),await it(r);let c=this.svcs.workspace.LangiumDocuments.all.toArray();await this.svcs.workspace.DocumentBuilder.build(c,this.initialBuildOptions,r)}loadStdlib(e){let r=this.svcs.workspace.LangiumDocumentFactory;for(let n of n_)e(r.fromString(n.data,n.uri))}async loadModule(e,r){let n=this.svcs.workspace.LangiumDocumentFactory;for(let i of e.Docs)r(await n.fromUri(i))}};function zfe(t){let e=qy(De.parse(t.uri));return Y(C({},t),{uri:e.toString()})}var FV=ke(Ui(),1);var xv=class extends lp{constructor(r){super(r);this.svcs=r}registerFileWatcher(r){let n=nt(r.ServiceRegistry.all).flatMap(o=>o.LanguageMetaData.fileExtensions).map(o=>o.startsWith(".")?o.substring(1):o).distinct().toArray(),i={watchers:[]};n.length>0&&i.watchers.push({globPattern:n.length===1?`**/*.${n[0]}`:`**/*.{${n.join(",")}}`}),n.includes("kumori")&&i.watchers.push({globPattern:`**/${xr}`});let s=r.lsp.Connection;s==null||s.client.register(FV.DidChangeWatchedFilesNotification.type,i)}fireDocumentUpdate(r,n){(async()=>{let i=this.svcs.references.KumoriModules,s=[...r,...n].filter(c=>ee.basename(c)===xr);if(s.length){let c=i.ResolverCtx(),u=this.svcs.workspace.FileSystemProvider,f=(await Promise.all(s.map(async l=>{let p=await Gs(u,l);return N.isErr(p)?[]:(await yv(c,p.value)).concat(p.value)}))).flat();await Promise.all(f.map(async l=>{let p=await Hp(this.svcs,l.Root),d=Y(C({},l),{Docs:p});await i.registerModule(d)}))}for(let c of s)i.invalidateModule(c);let o=r.filter(c=>ee.basename(c)!==xr),a=n.filter(c=>ee.basename(c)!==xr);super.fireDocumentUpdate(o,a)})()}};var Wfe={workspace:{WorkspaceManager:t=>new vv(t),IndexManager:t=>new jy(t),DocumentBuilder:t=>new Fy(t)},references:{KumoriModules:t=>new By(t)},lsp:{DocumentUpdateHandler:t=>new xv(t)}},Kfe={references:{ScopeComputation:t=>new zy(t),ScopeProvider:t=>new Wy(t),Linker:t=>new Uy(t),KumoriPackages:t=>new Hy(t)},validation:{KumoriValidations:t=>Y$(t),KumoriTypeSystem:t=>new H4(t),DocumentValidator:t=>new Vy(t)},lsp:{SemanticTokenProvider:t=>new Gy(t)}};function Ji(t){let e=Fu(_I(t),SI,Wfe),r=Fu(xI({shared:e}),EI,Kfe);return e.ServiceRegistry.register(r),Q$(r),t.connection||e.workspace.ConfigurationProvider.initialized({}),{shared:e,Kumori:r}}var V_=ke(require("fs"),1),j_=class{constructor(){this.encoding="utf-8"}readFile(e){return V_.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await V_.promises.readdir(e.fsPath,{withFileTypes:!0})).map(n=>({dirent:n,isFile:n.isFile(),isDirectory:n.isDirectory(),uri:ee.joinPath(e,n.name)}))}},wn={fileSystemProvider:()=>new j_};var VV=k.object({name:k.string(),artifact:k.union([r_,K4,G4]),resilience:k.number().nonnegative().optional(),config:k.object({}).catchall(k.any()).optional(),resource:k.object({}).catchall(ja).optional()});var jV={m:.001,k:1e3,M:1e6,G:1e9,T:1e12,P:1e15,E:1e18,Ki:2**10,Mi:2**20,Gi:2**30,Ti:2**40,Pi:2**50,Ei:2**60},UV=(t,e)=>{let r=jV[t.unit],n=jV[e];return{size:t.size*(r/n),unit:e}};function ta(t){if(t.$type===Fx){let e=Vx.parse(t);return{volume:{size:e.value.size,unit:e.value.unit,kind:"storage"}}}if(t.$type===jx)return{volume:Ux.parse(t).value};if(t.$type===Gx)return{volume:Jx.parse(t).value};if(t.$type===qx){let e=Bx.parse(t);return{volume:{size:e.value.size,unit:e.value.unit,kind:"storage",type:"volatile"}}}if(t.$type===Hx){let e=zx.parse(t);return{volume:{size:e.value.size,unit:e.value.unit,kind:"storage",type:"persistent"}}}if(t.$type===Wx){let e=Kx.parse(t);return{volume:{size:e.value.size,unit:e.value.unit,kind:"storage",type:"nonreplicated"}}}if(t.$type===eg)return{ca:Qx.parse(t).value};if(t.$type===tg)return{certificate:Yx.parse(t).value};if(t.$type===Op)return{secret:Zx.parse(t).value};if(t.$type===rg)return{domain:Xx.parse(t).value};if(t.$type===ng)return{port:e_.parse(t).value};throw new Error(`unknown resource type '${t.$type}'`)}var qV=require("path");function BV(t){return typeof t=="string"?N.orElse(N.map(W4(t),e=>{var r,n;return{tag:e.tag,hub:{name:e.hub,secret:typeof t=="string"?"":(n=(r=t.hub)==null?void 0:r.secret)!=null?n:""}}}),e=>{throw new Error(e)}):t}function Nl(t,e){if(!e)return[];let r=Fe.getDocument(e).uri,n=t.getModule(r);if(N.isErr(n))return[];let i=N.tryCatch(()=>new URL(`file://${n.value.Manifest.module}`));if(N.isErr(i))return[];let s=[];return i.value.hostname.length&&s.push(o=>o.domain=i.value.hostname),i.value.pathname.length&&s.push(o=>{o.module=i.value.pathname.replace(/^\//,""),o.name=(0,qV.basename)(o.module)}),s}function HV(t,e){let r={version:[0,0,0],kind:"service",domain:"unknown",module:"unknown",name:"unknown"},n=t.svcs.shared.references.KumoriModules,i=Nl(n,t.nodes.get(e));for(let s of i)s(r);return{spec:[1,0],ref:r,description:{builtin:!1,connector:{},config:{resilience:0,scale:{},parameter:{},resource:{}},role:{component:{name:"component",meta:{},artifact:U_(t,e)}}}}}function U_(t,e){var u,f,l,p,d,h,g,v,b,_,x;let r={version:[0,0,0],kind:"component",domain:"unknown",module:"unknown",name:"unknown"},n=t.svcs.shared.references.KumoriModules,i=Nl(n,t.nodes.get(e));for(let T of i)T(r);function s(T,R=!1){return Object.fromEntries(Object.entries(T!=null?T:{}).map(([V,$])=>{var z,W;return[V,{name:V,init:R,entrypoint:$.entrypoint,image:BV($.image),cmd:$.cmd,size:{memory:Y(C({},$.size.memory),{kind:"ram"}),cpu:Y(C({},$.size.cpu),{kind:"cpu"}),mincpu:$.size.mincpu?$.size.mincpu.size:$.size.cpu.size},mapping:{filesystem:Object.fromEntries(Object.entries((z=$.fs)!=null?z:{}).map(([D,P])=>[D,Gfe(D,P)])),env:Object.fromEntries(Object.entries((W=$.env)!=null?W:{}).map(([D,P])=>{let M=D,j=typeof P=="string"||typeof P=="number"||typeof P=="boolean"?{value:String(P)}:P;return[M,j]}))}}]}))}let o=Object.fromEntries(((u=e.init)!=null?u:[]).map((T,R)=>[`INIT_${R}`,T])),a=s(e.code),c=s(o,!0);return{spec:[1,0],ref:r,description:{builtin:!1,config:{resilience:0,scale:{hsize:(f=e.scale)!=null?f:1},parameter:e.config,resource:Object.fromEntries(Object.entries((l=e.resource)!=null?l:{}).map(([T,R])=>[T,ta(R)]))},size:{bandwidth:Y(C({},e.size.bandwidth),{kind:"bandwidth"}),minbandwidth:Math.ceil(UV((p=e.size.minbandwidth)!=null?p:e.size.bandwidth,e.size.bandwidth.unit).size),mincpu:Y(C({},e.size.mincpu),{kind:"cpu"})},profile:{threadability:"*",iopsintensive:!1},srv:{client:Object.fromEntries(Object.entries((h=(d=e.srv)==null?void 0:d.client)!=null?h:{}).map(([T,R])=>[T,{protocol:R,inherited:!1}])),server:Object.fromEntries(Object.entries((v=(g=e.srv)==null?void 0:g.server)!=null?v:{}).map(([T,R])=>{let V;return typeof R=="string"?V={port:80,portnum:1,inherited:!1,protocol:R}:V=Y(C({},R),{portnum:1,inherited:!1}),[T,V]})),duplex:Object.fromEntries(Object.entries((_=(b=e.srv)==null?void 0:b.duplex)!=null?_:{}).map(([T,R])=>{let V;return typeof R=="string"?V={port:80,portnum:1,inherited:!1,protocol:R}:V=Y(C({},R),{portnum:1,inherited:!1}),[T,V]}))},code:C(C({},c),a),probe:Object.fromEntries(Object.entries((x=e.probe)!=null?x:{}).map(([T,R])=>[T,R]))}}}function Gfe(t,e){var r,n,i,s;if(typeof e=="string")return{path:t,data:{value:e},format:"text"};if(typeof e=="object"){if("volume"in e)return{path:t,volume:e.volume};if("data"in e)return{path:t,data:{value:e.data},format:(r=e.format)!=null?r:"text",mode:(n=e.mode)!=null?n:420};let a=["secret","port","domain","certificate","ca"].find(c=>c in e);if(a){let c=a;return{path:t,data:{[c]:e[c]},format:(i=e.format)!=null?i:"text",mode:(s=e.mode)!=null?s:420}}}throw new Error(`Unknown key '${t}': ${JSON.stringify(e)}`)}function Jfe(t){var r,n,i;let e=Ci(t.id.version);return{spec:[1,0],ref:{version:[e.major,e.minor,e.patch],kind:t.id.kind,domain:t.id.domain,module:t.id.module,name:t.id.name},description:{builtin:!0,srv:{client:Object.fromEntries(Object.entries((r=t.srv.client)!=null?r:{}).map(([s])=>[s,{protocol:"http",inherited:!1}])),server:Object.fromEntries(Object.entries((n=t.srv.server)!=null?n:{}).map(([s,o])=>{let a;return typeof o=="string"?a={port:80,portnum:1,inherited:!1,protocol:o}:a=Y(C({},o),{inherited:!1}),[s,a]})),duplex:Object.fromEntries(Object.entries((i=t.srv.duplex)!=null?i:{}).map(([s,o])=>{let a;return typeof o=="string"?a={port:80,portnum:1,inherited:!1,protocol:o}:a=Y(C({},o),{inherited:!1}),[s,a]}))},config:{resilience:0,scale:{},parameter:t.config,resource:Object.fromEntries(Object.entries(t.resource).map(([s,o])=>[s,ta(o)]))},connector:{},role:{}}}}function zV(t,e){var r,n;return{name:Ol(t),up:zp(t),meta:{},config:{resilience:0,scale:{},parameter:(r=e.config)!=null?r:{},resource:Object.fromEntries(Object.entries((n=e.resource)!=null?n:{}).map(([i,s])=>[i,ta(s)]))},artifact:Jfe(e)}}function _v(t,e,r,n){let i=t.svcs.shared.references.KumoriModules,s=Nl(i,t.nodes.get(e));for(let o of s)o(r);return n&&(r.kind="service"),r}function q_(t,e){return t.some(r=>JSON.stringify(r)===JSON.stringify(e))}function B_(t,e){return{role:t,channel:e}}function bv(t,e,r){return{meta:t,links:[{role:e,channel:r}]}}function WV(t,e,r){var i,s,o,a;let n={version:[0,0,0],kind:"component",domain:"unknown",module:"unknown",name:"unknown"};if(r.$type===Dp){r=r;let c=[],u=[];if("from"in r.value&&Array.isArray(r.value.from)&&"to"in r.value&&Array.isArray(r.value.to))for(let f of r.value.from){u.push(B_(f.target,f.channel));for(let l of r.value.to){let p=e.role[l.target=="self"?f.target:l.target],d=Wa(p.artifact)||l.target=="self";_v(t,p,n,d);let h=(i=r.value.meta)!=null?i:[{auto:{channel:l.target!=="self"?l.target+"."+l.channel:l.channel,compRef:n,roleName:l.target=="self"?f.target:l.target},user:{}}],g=bv(h,l.target,l.channel);q_(c,g)||c.push(g)}}else if("from"in r.value&&!Array.isArray(r.value.from)&&!Array.isArray(r.value.to)){let f=r.value.from,l=r.value.to;u.push(B_(f.target,f.channel));let p=e.role[l.target=="self"?f.target:l.target],d=Wa(p.artifact)||l.target=="self";_v(t,p,n,d);let h=(s=r.value.meta)!=null?s:[{auto:{channel:l.target!=="self"?l.target+"."+l.channel:l.channel,compRef:n,roleName:l.target=="self"?f.target:l.target},user:{}}],g=bv(h,l.target,l.channel);q_(c,g)||c.push(g)}return{kind:"lb",clients:u,servers:c}}if(r.$type===Lp){r=r;let c=[],u=[];if("from"in r.value&&Array.isArray(r.value.from)&&"to"in r.value&&Array.isArray(r.value.to))for(let f of r.value.from){u.push(B_(f.target,f.channel));for(let l of r.value.to){let p=e.role[l.target=="self"?f.target:l.target],d=Wa(p.artifact);_v(t,p,n,d);let h=(o=r.value.meta)!=null?o:[{auto:{channel:l.target!=="self"?l.target+"."+l.channel:l.channel,compRef:n,roleName:l.target=="self"?f.target:l.target},user:{}}],g=bv(h,l.target,l.channel);q_(c,g)||c.push(g)}}else if("target"in r.value&&"channel"in r.value){let f=e.role[r.value.target],l=Wa(f.artifact);_v(t,f,n,l);let p=(a=r.value.meta)!=null?a:[{auto:{channel:r.value.channel,compRef:n,roleName:r.value.target},user:{}}];c.push(bv(p,r.value.target,r.value.channel))}return{kind:"full",clients:u,servers:c}}throw new Error(`unknown connection type '${r.$type}'`)}function H_(t,e){var o,a,c,u,f,l,p,d,h,g,v;let r={version:[0,0,0],kind:"service",domain:"unknown",module:"unknown",name:"unknown"},n=t.svcs.shared.references.KumoriModules,i=Nl(n,t.nodes.get(e));for(let b of i)b(r);let s={spec:[1,0],ref:r,description:{builtin:!1,config:{resilience:0,scale:{detail:Object.fromEntries(Object.entries((o=e.role)!=null?o:{}).filter(([,b])=>Gc(b.artifact)).map(([b,_])=>{var x;return Gc(_.artifact)?[b,{hsize:(x=_.artifact.scale)!=null?x:1}]:[b,{hsize:1}]}))},parameter:(a=e==null?void 0:e.config)!=null?a:{},resource:Object.fromEntries(Object.entries((c=e.resource)!=null?c:{}).map(([b,_])=>[b,ta(_)]))},role:{},connector:Object.fromEntries(Object.entries((u=e.connect)!=null?u:{}).map(([b,_])=>[b,WV(t,e,_)])),srv:{client:Object.fromEntries(Object.entries((l=(f=e.srv)==null?void 0:f.client)!=null?l:{}).map(([b,_])=>[b,{protocol:_,inherited:!1}])),server:Object.fromEntries(Object.entries((d=(p=e.srv)==null?void 0:p.server)!=null?d:{}).map(([b,_])=>{let x;return typeof _=="string"?x={port:80,inherited:!1,protocol:_}:x=Y(C({},_),{inherited:!1}),[b,x]})),duplex:Object.fromEntries(Object.entries((g=(h=e.srv)==null?void 0:h.duplex)!=null?g:{}).map(([b,_])=>{let x;return typeof _=="string"?x={port:80,inherited:!1,protocol:_}:x=Y(C({},_),{inherited:!1}),[b,x]}))}}};return s.description.role=Object.fromEntries(Object.entries((v=e.role)!=null?v:{}).map(([b,_])=>[b,Yfe(t,b,_,s)]).filter(([,b])=>ue.isSome(b)).map(([b,_])=>[b,_.value])),s}function Qfe(t,e){var r,n,i,s,o,a,c;return{name:Ol(t),up:zp(t),meta:{},config:{resilience:0,scale:(i=(r=e.config)==null?void 0:r.scale)!=null?i:{hsize:(n=e.config)==null?void 0:n.scale},parameter:(o=(s=e.config)==null?void 0:s.parameter)!=null?o:{},resource:Object.fromEntries(Object.entries((c=(a=e.config)==null?void 0:a.resource)!=null?c:{}).map(([u,f])=>[u,ta(f)]))},artifact:H_(t,e)}}function Yfe(t,e,r,n){var o,a,c,u,f,l,p,d,h,g,v,b,_,x,T,R,V,$;if(Gc(r.artifact))return Ut({name:e,meta:{},config:{resilience:0,scale:r.artifact.scale?{hsize:r.artifact.scale}:{hsize:1},parameter:(o=r.artifact.config)!=null?o:{},resource:{}},artifact:U_(t,r.artifact)});let i=r.artifact;t=KV(t,e),GV(t,Wa(i)?Qfe(t,i):zV(t,i)),(c=(a=n.description).srv)!=null||(a.srv={}),(f=(u=n.description.srv).server)!=null||(u.server={}),(p=(l=n.description.srv).client)!=null||(l.client={});for(let[,K]of Object.entries((d=n.description.connector)!=null?d:{})){for(let z of K.clients){if(z.role!==e)continue;let W=C({},z),D=`${z.role}.${z.channel}`,P=((g=(h=i==null?void 0:i.srv)==null?void 0:h.client)!=null?g:{})[z.channel];n.description.srv.server[D]={inherited:!0,protocol:z.channel=="inbound"?"http":P},z.role="self",z.channel=D,(b=(v=t.root).links)!=null||(v.links=[]),t.root.links.push({meta:{},s_d:Ol(t),s_c:W.channel,t_d:zp(t),t_c:D})}for(let z of K.servers)for(let W of z.links)if(W.role===e){let D=`${W.role}.${W.channel}`,P=((x=(_=i==null?void 0:i.srv)==null?void 0:_.server)!=null?x:{})[W.channel];P===void 0&&(P=((R=(T=i==null?void 0:i.srv)==null?void 0:T.duplex)!=null?R:{})[W.channel]),n.description.srv.client[D]={inherited:!0,protocol:typeof P=="string"?P:P.protocol,port:typeof P=="object"?P.port:void 0},($=(V=t.root).links)!=null||(V.links=[]),t.root.links.push({meta:{},s_d:zp(t),s_c:D,t_d:Ol(t),t_c:W.channel}),W.role="self",W.channel=D}}return ot}var Ol=t=>t.path.join("."),zp=t=>t.path.slice(0,-1).join("."),KV=(t,e)=>Y(C({},t),{path:[...t.path,e]}),GV=(t,e)=>t.root.deployments[Ol(t)]=e;function JV(t,e,r){var s,o,a;let n={top:r.name,deployments:{},links:[]},i={svcs:t,path:[r.name],root:n,nodes:e};return n.deployments[r.name]={name:r.name,meta:{},config:{parameter:(s=r.config)!=null?s:{},resource:Object.fromEntries(Object.entries((o=r.resource)!=null?o:{}).map(([c,u])=>[c,ta(u)])),resilience:(a=r.resilience)!=null?a:0,scale:{detail:(()=>{var c;return Object.fromEntries(Object.entries(Wa(r.artifact)?(c=r.artifact.role)!=null?c:{}:{}).filter(([,u])=>Gc(u.artifact)).map(([u,f])=>{var l;return Gc(f.artifact)?[u,{hsize:(l=f.artifact.scale)!=null?l:1}]:[u,{hsize:1}]}))})()}},artifact:(()=>{if(Gc(r.artifact))return HV(i,r.artifact);if(Wa(r.artifact))return H_(i,r.artifact);throw QV(r.artifact)?new Error("not implemented: handle builtin"):new Error("unknown artifact")})()},n}function Gc(t){return"size"in t}function Wa(t){return!(Gc(t)||QV(t))}function QV(t){return"id"in t}function YV(t,e,r){var u,f;let n=e.validation.KumoriTypeSystem,[{Value:i},s]=n.Eval(e.validation.KumoriValidations.ctx(),r);if(s.length!==0){for(let l of s){let p=l.node,d=Fe.getDocument(p),h=((u=p.$cstNode)==null?void 0:u.range.start)||{line:0,character:0};t.error(`${d.uri.fsPath}:${h.line}:${h.character}: type error: ${l.message}`)}process.exit(1)}let o=new Map,a=Qo({svcs:e,nodes:o},i);if(N.isErr(a)){for(let l of a.err){let p=l.node,d=Fe.getDocument(p),h=((f=p.$cstNode)==null?void 0:f.range.start)||{line:0,character:0};t.error(`${d.uri.fsPath}:${h.line}:${h.character}: json conversion error: ${l.message}`)}process.exit(1)}let c=VV.safeParse(a.value);if(!c.success){for(let l of c.error.issues)t.error(`${l.code}: ${l.path}: invalid deployment: ${l.message}`);process.exit(1)}return JSON.stringify(JV(e,o,a.value),null,2)}function Sv(t,e=new On){if(t.Manifest.headers!==void 0){let[r,n]=[t.Manifest.headers.target,t.Manifest.headers.version],i=Ln(r,n);e.add(i,{target:r,version:n})}for(let r of t.Manifest.requires){let[n,i]=[r.target,r.version],s={target:n,version:i},o=Ln(n,i);if(e.add(o,s),r.headers!==void 0){let[a,c]=[r.headers.target,r.headers.version],u=Ln(a,c);s.interface={target:a,version:c},e.add(u,s.interface)}}return e}var Kb=ke(require("assert"),1);var ZV=require("path");async function dg(t,e,r){let n=Ln(e,r),i=Js(n);if(ue.isSome(i)&&(e=i.value.Location),(0,ZV.isAbsolute)(e)){let a=De.file(e),c=await Gs(t.FS,a);return N.isOk(c)?c:ot}let s=ee.joinPath(t.Locations.Vendor(),n),o=await Gs(t.FS,s);return N.isOk(o)||(s=ee.joinPath(t.Locations.Cache(),n),o=await Gs(t.FS,s),N.isOk(o))?o:ot}function ra(t,e){if(N.isErr(e)){for(let r of e.err)t.error(r);process.exit(1)}return e.value}var Gb=ke(require("path"),1);var Wb=ke(Ui(),1);var jv=ke(fj(),1),$v=ke(J_(),1),MU=require("child_process"),_q=ke(Y_(),1),Qp=ke(Y_(),1),Wq=require("events"),Fv=Object.defineProperty,kde=Object.defineProperties,wde=Object.getOwnPropertyDescriptor,Ade=Object.getOwnPropertyDescriptors,yb=Object.getOwnPropertyNames,dj=Object.getOwnPropertySymbols,zj=Object.prototype.hasOwnProperty,Rde=Object.prototype.propertyIsEnumerable,pj=(t,e,r)=>e in t?Fv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ys=(t,e)=>{for(var r in e||(e={}))zj.call(e,r)&&pj(t,r,e[r]);if(dj)for(var r of dj(e))Rde.call(e,r)&&pj(t,r,e[r]);return t},hg=(t,e)=>kde(t,Ade(e)),xe=(t,e)=>function(){return t&&(e=(0,t[yb(t)[0]])(t=0)),e},Pde=(t,e)=>function(){return e||(0,t[yb(t)[0]])((e={exports:{}}).exports,e),e.exports},ln=(t,e)=>{for(var r in e)Fv(t,r,{get:e[r],enumerable:!0})},Nde=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yb(e))!zj.call(t,i)&&i!==r&&Fv(t,i,{get:()=>e[i],enumerable:!(n=wde(e,i))||n.enumerable});return t},Zr=t=>Nde(Fv({},"__esModule",{value:!0}),t),mg=(t,e,r)=>new Promise((n,i)=>{var s=c=>{try{a(r.next(c))}catch(u){i(u)}},o=c=>{try{a(r.throw(c))}catch(u){i(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,o);a((r=r.apply(t,e)).next())});function Ode(...t){let e=new String(t);return Vv.set(e,t),e}function Dv(t){return t instanceof String&&Vv.has(t)}function mj(t){return Vv.get(t)||[]}var Vv,xg=xe({"src/lib/args/pathspec.ts"(){"use strict";Vv=new WeakMap}}),Ga,Yc=xe({"src/lib/errors/git-error.ts"(){"use strict";Ga=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),_g,Zp=xe({"src/lib/errors/git-response-error.ts"(){"use strict";Yc(),_g=class extends Ga{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),Wj,Kj=xe({"src/lib/errors/task-configuration-error.ts"(){"use strict";Yc(),Wj=class extends Ga{constructor(t){super(void 0,t)}}}});function Gj(t){return typeof t=="function"?t:Ml}function Jj(t){return typeof t=="function"&&t!==Ml}function Qj(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}function Yj(t,e=0){return Zj(t)&&t.length>e?t[e]:void 0}function $l(t,e=0){if(Zj(t)&&t.length>e)return t[t.length-1-e]}function Zj(t){return!!(t&&typeof t.length=="number")}function bg(t="",e=!0,r=`
555
+ `){return t.split(r).reduce((n,i)=>{let s=e?i.trim():i;return s&&n.push(s),n},[])}function vb(t,e){return bg(t,!0).map(r=>e(r))}function xb(t){return(0,jv.exists)(t,jv.FOLDER)}function Bt(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function Xj(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function Uv(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function na(t){return Array.isArray(t)?t:[t]}function eU(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function tU(t){return na(t).map(String)}function _r(t,e=0){if(t==null)return e;let r=parseInt(t,10);return isNaN(r)?e:r}function gg(t,e){let r=[];for(let n=0,i=t.length;n<i;n++)r.push(e,t[n]);return r}function yg(t){return(Array.isArray(t)?Buffer.concat(t):t).toString("utf-8")}function rU(t,e){return Object.assign({},...e.map(r=>r in t?{[r]:t[r]}:{}))}function ib(t=0){return new Promise(e=>setTimeout(e,t))}function sb(t){if(t!==!1)return t}var Yp,Ml,Sg,qv=xe({"src/lib/utils/util.ts"(){"use strict";Yp="\0",Ml=()=>{},Sg=Object.prototype.toString.call.bind(Object.prototype.toString)}});function ia(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function _b(t,e){let r=Dv(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function bb(t){return!!t&&Sg(t)==="[object Object]"}function nU(t){return typeof t=="function"}var Eg,fi,iU,Lv,Sb,sU=xe({"src/lib/utils/argument-filters.ts"(){"use strict";qv(),xg(),Eg=t=>Array.isArray(t),fi=t=>typeof t=="string",iU=t=>Array.isArray(t)&&t.every(fi),Lv=t=>fi(t)||Array.isArray(t)&&t.every(fi),Sb=t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number"}}),ob,Ide=xe({"src/lib/utils/exit-codes.ts"(){"use strict";ob=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(ob||{})}}),vg,Dde=xe({"src/lib/utils/git-output-streams.ts"(){"use strict";vg=class{constructor(t,e){this.stdOut=t,this.stdErr=e}asStrings(){return new vg(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),dt,Qc,Lde=xe({"src/lib/utils/line-parser.ts"(){"use strict";dt=class{constructor(t,e){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((i,s)=>this.addMatch(i,s,r(s)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}useMatches(t,e){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},Qc=class extends dt{addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function oU(...t){let e=process.cwd(),r=Object.assign(Ys({baseDir:e},aU),...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var aU,$de=xe({"src/lib/utils/simple-git-options.ts"(){"use strict";aU={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Eb(t,e=[]){return bb(t)?Object.keys(t).reduce((r,n)=>{let i=t[n];return Dv(i)?r.push(i):_b(i,["boolean"])?r.push(n+"="+i):r.push(n),r},e):e}function Yi(t,e=0,r=!1){let n=[];for(let i=0,s=e<0?t.length:e;i<s;i++)"string|number".includes(typeof t[i])&&n.push(String(t[i]));return Eb(Tb(t),n),r||n.push(...Mde(t)),n}function Mde(t){let e=typeof $l(t)=="function";return ia($l(t,e?1:0),Eg,[])}function Tb(t){let e=nU($l(t));return ia($l(t,e?1:0),bb)}function Xr(t,e=!0){let r=Gj($l(t));return e||Jj(r)?r:void 0}var Fde=xe({"src/lib/utils/task-options.ts"(){"use strict";sU(),qv(),xg()}});function ab(t,e){return t(e.stdOut,e.stdErr)}function Xi(t,e,r,n=!0){return na(r).forEach(i=>{for(let s=bg(i,n),o=0,a=s.length;o<a;o++){let c=(u=0)=>{if(!(o+u>=a))return s[o+u]};e.some(({parse:u})=>u(c,t))}}),t}var Vde=xe({"src/lib/utils/task-parser.ts"(){"use strict";qv()}}),cU={};ln(cU,{ExitCodes:()=>ob,GitOutputStreams:()=>vg,LineParser:()=>dt,NOOP:()=>Ml,NULL:()=>Yp,RemoteLineParser:()=>Qc,append:()=>Bt,appendTaskOptions:()=>Eb,asArray:()=>na,asCamelCase:()=>eU,asFunction:()=>Gj,asNumber:()=>_r,asStringArray:()=>tU,bufferToString:()=>yg,callTaskParser:()=>ab,createInstanceConfig:()=>oU,delay:()=>ib,filterArray:()=>Eg,filterFunction:()=>nU,filterHasLength:()=>Sb,filterPlainObject:()=>bb,filterPrimitives:()=>_b,filterString:()=>fi,filterStringArray:()=>iU,filterStringOrStringArray:()=>Lv,filterType:()=>ia,first:()=>Yj,folderExists:()=>xb,forEachLineWithContent:()=>vb,getTrailingOptions:()=>Yi,including:()=>Xj,isUserFunction:()=>Jj,last:()=>$l,objectToString:()=>Sg,orVoid:()=>sb,parseStringResponse:()=>Xi,pick:()=>rU,prefixedArray:()=>gg,remove:()=>Uv,splitOn:()=>Qj,toLinesWithContent:()=>bg,trailingFunctionArgument:()=>Xr,trailingOptionsArgument:()=>Tb});var ct=xe({"src/lib/utils/index.ts"(){"use strict";sU(),Ide(),Dde(),Lde(),$de(),Fde(),Vde(),qv()}}),uU={};ln(uU,{CheckRepoActions:()=>cb,checkIsBareRepoTask:()=>fU,checkIsRepoRootTask:()=>lU,checkIsRepoTask:()=>jde});function jde(t){switch(t){case"bare":return fU();case"root":return lU()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Bv,parser:Cb}}function lU(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Bv,parser(e){return/^\.(git)?$/.test(e.trim())}}}function fU(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Bv,parser:Cb}}function Ude(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var cb,Bv,Cb,dU=xe({"src/lib/tasks/check-is-repo.ts"(){"use strict";ct(),cb=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(cb||{}),Bv=({exitCode:t},e,r,n)=>{if(t===128&&Ude(e))return r(Buffer.from("false"));n(e)},Cb=t=>t.trim()==="true"}});function qde(t,e){let r=new pU(t),n=t?hU:mU;return bg(e).forEach(i=>{let s=i.replace(n,"");r.paths.push(s),(gU.test(s)?r.folders:r.files).push(s)}),r}var pU,mU,hU,gU,Bde=xe({"src/lib/responses/CleanSummary.ts"(){"use strict";ct(),pU=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},mU=/^[a-z]+\s*/i,hU=/^[a-z]+\s+[a-z]+\s*/i,gU=/\/$/}}),ub={};ln(ub,{EMPTY_COMMANDS:()=>Hv,adhocExecTask:()=>yU,configurationErrorTask:()=>Zi,isBufferTask:()=>xU,isEmptyTask:()=>_U,straightThroughBufferTask:()=>vU,straightThroughStringTask:()=>wi});function yU(t){return{commands:Hv,format:"empty",parser:t}}function Zi(t){return{commands:Hv,format:"empty",parser(){throw typeof t=="string"?new Wj(t):t}}}function wi(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}function vU(t){return{commands:t,format:"buffer",parser(e){return e}}}function xU(t){return t.format==="buffer"}function _U(t){return t.format==="empty"||!t.commands.length}var Hv,un=xe({"src/lib/tasks/task.ts"(){"use strict";Kj(),Hv=[]}}),bU={};ln(bU,{CONFIG_ERROR_INTERACTIVE_MODE:()=>kb,CONFIG_ERROR_MODE_REQUIRED:()=>wb,CONFIG_ERROR_UNKNOWN_OPTION:()=>Ab,CleanOptions:()=>Pv,cleanTask:()=>SU,cleanWithOptionsTask:()=>Hde,isCleanOptionsArray:()=>zde});function Hde(t,e){let{cleanMode:r,options:n,valid:i}=Wde(t);return r?i.options?(n.push(...e),n.some(Jde)?Zi(kb):SU(r,n)):Zi(Ab+JSON.stringify(t)):Zi(wb)}function SU(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return qde(t==="n",n)}}}function zde(t){return Array.isArray(t)&&t.every(e=>Rb.has(e))}function Wde(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(i=>{Kde(i)?(e=i,n.cleanMode=!0):n.options=n.options&&Gde(r[r.length]=`-${i}`)}),{cleanMode:e,options:r,valid:n}}function Kde(t){return t==="f"||t==="n"}function Gde(t){return/^-[a-z]$/i.test(t)&&Rb.has(t.charAt(1))}function Jde(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var kb,wb,Ab,Pv,Rb,EU=xe({"src/lib/tasks/clean.ts"(){"use strict";Bde(),ct(),un(),kb="Git clean interactive mode is not supported",wb='Git clean mode parameter ("n" or "f") is required',Ab="Git clean unknown option found in: ",Pv=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(Pv||{}),Rb=new Set(["i",...tU(Object.values(Pv))])}});function Qde(t){let e=new CU;for(let r of TU(t))e.addValue(r.file,String(r.key),r.value);return e}function Yde(t,e){let r=null,n=[],i=new Map;for(let s of TU(t,e))s.key===e&&(n.push(r=s.value),i.has(s.file)||i.set(s.file,[]),i.get(s.file).push(r));return{key:e,paths:Array.from(i.keys()),scopes:i,value:r,values:n}}function Zde(t){return t.replace(/^(file):/,"")}function*TU(t,e=null){let r=t.split("\0");for(let n=0,i=r.length-1;n<i;){let s=Zde(r[n++]),o=r[n++],a=e;if(o.includes(`
556
+ `)){let c=Qj(o,`
557
+ `);a=c[0],o=c[1]}yield{file:s,key:a,value:o}}}var CU,Xde=xe({"src/lib/responses/ConfigList.ts"(){"use strict";ct(),CU=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((t,e)=>Object.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=$l(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);n.hasOwnProperty(e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function Z_(t,e){return typeof t=="string"&&lb.hasOwnProperty(t)?t:e}function epe(t,e,r,n){let i=["config",`--${n}`];return r&&i.push("--add"),i.push(t,e),{commands:i,format:"utf-8",parser(s){return s}}}function tpe(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return Yde(n,t)}}}function rpe(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return Qde(r)}}}function npe(){return{addConfig(t,e,...r){return this._runTask(epe(t,e,r[0]===!0,Z_(r[1],"local")),Xr(arguments))},getConfig(t,e){return this._runTask(tpe(t,Z_(e,void 0)),Xr(arguments))},listConfig(...t){return this._runTask(rpe(Z_(t[0],void 0)),Xr(arguments))}}}var lb,kU=xe({"src/lib/tasks/config.ts"(){"use strict";Xde(),ct(),lb=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(lb||{})}});function ipe(t){return wU.has(t)}var X_,wU,AU=xe({"src/lib/tasks/diff-name-status.ts"(){"use strict";X_=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(X_||{}),wU=new Set(Object.values(X_))}});function spe(...t){return new PU().param(...t)}function ope(t){let e=new Set,r={};return vb(t,n=>{let[i,s,o]=n.split(Yp);e.add(i),(r[i]=r[i]||[]).push({line:_r(s),path:i,preview:o})}),{paths:e,results:r}}function ape(){return{grep(t){let e=Xr(arguments),r=Yi(arguments);for(let i of RU)if(r.includes(i))return this._runTask(Zi(`git.grep: use of "${i}" is not supported.`),e);typeof t=="string"&&(t=spe().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(i){return ope(i)}},e)}}}var RU,pg,hj,PU,NU=xe({"src/lib/tasks/grep.ts"(){"use strict";ct(),un(),RU=["-h"],pg=Symbol("grepQuery"),PU=class{constructor(){this[hj]=[]}*[(hj=pg,Symbol.iterator)](){for(let t of this[pg])yield t}and(...t){return t.length&&this[pg].push("--and","(",...gg(t,"-e"),")"),this}param(...t){return this[pg].push(...gg(t,"-e")),this}}}}),OU={};ln(OU,{ResetMode:()=>Nv,getResetMode:()=>upe,resetTask:()=>cpe});function cpe(t,e){let r=["reset"];return IU(t)&&r.push(`--${t}`),r.push(...e),wi(r)}function upe(t){if(IU(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function IU(t){return DU.includes(t)}var Nv,DU,LU=xe({"src/lib/tasks/reset.ts"(){"use strict";un(),Nv=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Nv||{}),DU=Array.from(Object.values(Nv))}});function lpe(){return(0,$v.default)("simple-git")}function gj(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...i)=>{t(n,...i),r(n,...i)}:t:(n,...i)=>{t(`%s ${n}`,e,...i),r&&r(n,...i)}}function fpe(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function Pb(t,e,r,n=lpe()){let i=t&&`[${t}]`||"",s=[],o=typeof e=="string"?n.extend(e):e,a=fpe(ia(e,fi),o,n);return u(r);function c(f,l){return Bt(s,Pb(t,a.replace(/^[^:]+/,f),l,n))}function u(f){let l=f&&`[${f}]`||"",p=o&&gj(o,l)||Ml,d=gj(n,`${i} ${l}`,p);return Object.assign(o?p:d,{label:t,sibling:c,info:d,step:u})}}var $U=xe({"src/lib/git-logger.ts"(){"use strict";ct(),$v.default.formatters.L=t=>String(Sb(t)?t.length:"-"),$v.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Sg(t)}}),Av,fb,dpe=xe({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Yc(),$U(),Av=class{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let e=Av.getName(t.commands[0]),r=Pb(this.logLabel,e);return{task:t,logger:r,name:e}}push(t){let e=this.createProgress(t);return e.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,e),e}fatal(t){for(let[e,{logger:r}]of Array.from(this._queue.entries()))e===t.task?(r.info("Failed %o",t),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message),this.complete(e);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let e=this.withProgress(t);if(!e)throw new Ga(void 0,"TasksPendingQueue: attempt called for an unknown task");return e.logger("Starting task"),e}static getName(t="empty"){return`task:${t}:${++Av.counter}`}},fb=Av,fb.counter=0}});function Ll(t,e){return{method:Yj(t.commands)||"",commands:e}}function ppe(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}function yj(t,e,r,n){return i=>{r("%s received %L bytes",e,i),n("%B",i),t.push(i)}}var db,mpe=xe({"src/lib/runners/git-executor-chain.ts"(){"use strict";Yc(),un(),ct(),dpe(),db=class{constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new fb}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}attemptTask(t){return mg(this,null,function*(){let e=yield this._scheduler.next(),r=()=>this._queue.complete(t);try{let{logger:n}=this._queue.attempt(t);return yield _U(t)?this.attemptEmptyTask(t,n):this.attemptRemoteTask(t,n)}catch(n){throw this.onFatalException(t,n)}finally{r(),e()}})}onFatalException(t,e){let r=e instanceof Ga?Object.assign(e,{task:t}):new Ga(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(t,e){return mg(this,null,function*(){let r=this._plugins.exec("spawn.binary","",Ll(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],Ll(t,t.commands)),i=yield this.gitResponse(t,r,n,this.outputHandler,e.step("SPAWN")),s=yield this.handleTaskData(t,n,i,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),xU(t)?ab(t.parser,s):ab(t.parser,s.asStrings())})}attemptEmptyTask(t,e){return mg(this,null,function*(){return e("empty task bypassing child process to call to task's parser"),t.parser(this)})}handleTaskData(t,e,r,n){let{exitCode:i,rejection:s,stdOut:o,stdErr:a}=r;return new Promise((c,u)=>{n("Preparing to handle process response exitCode=%d stdOut=",i);let{error:f}=this._plugins.exec("task.error",{error:s},Ys(Ys({},Ll(t,e)),r));if(f&&t.onError)return n.info("exitCode=%s handling with custom error handler"),t.onError(r,f,l=>{n.info("custom error handler treated as success"),n("custom error returned a %s",Sg(l)),c(new vg(Array.isArray(l)?Buffer.concat(l):l,Buffer.concat(a)))},u);if(f)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,a.length,s),u(f);n.info("retrieving task output complete"),c(new vg(Buffer.concat(o),Buffer.concat(a)))})}gitResponse(t,e,r,n,i){return mg(this,null,function*(){let s=i.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Ll(t,t.commands));return new Promise(a=>{let c=[],u=[];i.info("%s %o",e,r),i("%O",o);let f=this._beforeSpawn(t,r);if(f)return a({stdOut:c,stdErr:u,exitCode:9901,rejection:f});this._plugins.exec("spawn.before",void 0,hg(Ys({},Ll(t,r)),{kill(p){f=p||f}}));let l=(0,MU.spawn)(e,r,o);l.stdout.on("data",yj(c,"stdOut",i,s.step("stdOut"))),l.stderr.on("data",yj(u,"stdErr",i,s.step("stdErr"))),l.on("error",ppe(u,i)),n&&(i("Passing child process stdOut/stdErr to custom outputHandler"),n(e,l.stdout,l.stderr,[...r])),this._plugins.exec("spawn.after",void 0,hg(Ys({},Ll(t,r)),{spawned:l,close(p,d){a({stdOut:c,stdErr:u,exitCode:p,rejection:f||d})},kill(p){l.killed||(f=p,l.kill("SIGINT"))}}))})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,hg(Ys({},Ll(t,e)),{kill(n){r=n||r}})),r}}}}),FU={};ln(FU,{GitExecutor:()=>VU});var VU,hpe=xe({"src/lib/runners/git-executor.ts"(){"use strict";mpe(),VU=class{constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new db(this,this._scheduler,this._plugins)}chain(){return new db(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function gpe(t,e,r=Ml){let n=s=>{r(null,s)},i=s=>{(s==null?void 0:s.task)===t&&r(s instanceof _g?ype(s):s,void 0)};e.then(n,i)}function ype(t){let e=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),e=Ml};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(n,i){return i in t||(n[i]={enumerable:!1,configurable:!1,get(){return e(i),t.git[i]}}),n}}var vpe=xe({"src/lib/task-callback.ts"(){"use strict";Zp(),ct()}});function vj(t,e){return yU(r=>{if(!xb(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}var xpe=xe({"src/lib/tasks/change-working-directory.ts"(){"use strict";ct(),un()}});function eb(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=Uv(e,"-B")),wi(e)}function _pe(){return{checkout(){return this._runTask(eb(Yi(arguments,1)),Xr(arguments))},checkoutBranch(t,e){return this._runTask(eb(["-b",t,e,...Yi(arguments)]),Xr(arguments))},checkoutLocalBranch(t){return this._runTask(eb(["-b",t,...Yi(arguments)]),Xr(arguments))}}}var bpe=xe({"src/lib/tasks/checkout.ts"(){"use strict";ct(),un()}});function Spe(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Epe(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return Xi(Spe(),[jU],t)}})}}}var jU,Tpe=xe({"src/lib/tasks/count-objects.ts"(){"use strict";ct(),jU=new dt(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=eU(e);t.hasOwnProperty(n)&&(t[n]=_r(r))})}});function Cpe(t){return Xi({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},UU,t)}var UU,kpe=xe({"src/lib/parsers/parse-commit.ts"(){"use strict";ct(),UU=[new dt(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new dt(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),n=r.pop();!n||!n.includes("@")||(t.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new dt(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(n,10)||0}),new dt(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0;let i=parseInt(r,10)||0;n==="-"?t.summary.deletions=i:n==="+"&&(t.summary.insertions=i)})]}});function wpe(t,e,r){return{commands:["-c","core.abbrev=40","commit",...gg(t,"-m"),...e,...r],format:"utf-8",parser:Cpe}}function Ape(){return{commit(e,...r){let n=Xr(arguments),i=t(e)||wpe(na(e),na(ia(r[0],Lv,[])),[...ia(r[1],Eg,[]),...Yi(arguments,0,!0)]);return this._runTask(i,n)}};function t(e){return!Lv(e)&&Zi("git.commit: requires the commit message to be supplied as a string/string[]")}}var Rpe=xe({"src/lib/tasks/commit.ts"(){"use strict";kpe(),ct(),un()}});function Ppe(){return{firstCommit(){return this._runTask(wi(["rev-list","--max-parents=0","HEAD"],!0),Xr(arguments))}}}var Npe=xe({"src/lib/tasks/first-commit.ts"(){"use strict";ct(),un()}});function Ope(t,e){let r=["hash-object",t];return e&&r.push("-w"),wi(r,!0)}var Ipe=xe({"src/lib/tasks/hash-object.ts"(){"use strict";un()}});function Dpe(t,e,r){let n=String(r).trim(),i;if(i=qU.exec(n))return new Ov(t,e,!1,i[1]);if(i=BU.exec(n))return new Ov(t,e,!0,i[1]);let s="",o=n.split(" ");for(;o.length;)if(o.shift()==="in"){s=o.join(" ");break}return new Ov(t,e,/^re/i.test(n),s)}var Ov,qU,BU,Lpe=xe({"src/lib/responses/InitSummary.ts"(){"use strict";Ov=class{constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},qU=/^Init.+ repository in (.+)$/,BU=/^Rein.+ in (.+)$/}});function $pe(t){return t.includes(Nb)}function Mpe(t=!1,e,r){let n=["init",...r];return t&&!$pe(n)&&n.splice(1,0,Nb),{commands:n,format:"utf-8",parser(i){return Dpe(n.includes("--bare"),e,i)}}}var Nb,Fpe=xe({"src/lib/tasks/init.ts"(){"use strict";Lpe(),Nb="--bare"}});function Ob(t){for(let e=0;e<t.length;e++){let r=Ib.exec(t[e]);if(r)return`--${r[1]}`}return""}function Vpe(t){return Ib.test(t)}var Ib,Tg=xe({"src/lib/args/log-format.ts"(){"use strict";Ib=/^--(stat|numstat|name-only|name-status)(=|$)/}}),HU,jpe=xe({"src/lib/responses/DiffSummary.ts"(){"use strict";HU=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function zU(t=""){let e=WU[t];return r=>Xi(new HU,e,r,!1)}var tb,xj,_j,bj,WU,KU=xe({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Tg(),jpe(),AU(),ct(),tb=[new dt(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:_r(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new dt(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:_r(r),after:_r(n),binary:!0})}),new dt(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),i=/(\d+) d/.exec(r);t.changed=_r(e),t.insertions=_r(n==null?void 0:n[1]),t.deletions=_r(i==null?void 0:i[1])})],xj=[new dt(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let i=_r(e),s=_r(r);t.changed++,t.insertions+=i,t.deletions+=s,t.files.push({file:n,changes:i+s,insertions:i,deletions:s,binary:!1})}),new dt(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],_j=[new dt(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],bj=[new dt(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,n,i,s])=>{t.changed++,t.files.push({file:s!=null?s:n,changes:0,insertions:0,deletions:0,binary:!1,status:sb(ipe(e)&&e),from:sb(!!s&&n!==s&&n),similarity:_r(r)})})],WU={"":tb,"--stat":tb,"--numstat":xj,"--name-status":bj,"--name-only":_j}}});function Upe(t,e){return e.reduce((r,n,i)=>(r[n]=t[i]||"",r),Object.create({diff:null}))}function GU(t=$b,e=JU,r=""){let n=zU(r);return function(i){let s=bg(i.trim(),!1,Db).map(function(o){let a=o.split(Lb),c=Upe(a[0].split(t),e);return a.length>1&&a[1].trim()&&(c.diff=n(a[1])),c});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var Db,Lb,$b,JU,QU=xe({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";ct(),KU(),Tg(),Db="\xF2\xF2\xF2\xF2\xF2\xF2 ",Lb=" \xF2\xF2",$b=" \xF2 ",JU=["hash","date","message","refs","author_name","author_email"]}}),YU={};ln(YU,{diffSummaryTask:()=>qpe,validateLogFormatConfig:()=>zv});function qpe(t){let e=Ob(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),zv(r)||{commands:r,format:"utf-8",parser:zU(e)}}function zv(t){let e=t.filter(Vpe);if(e.length>1)return Zi(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return Zi(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}var Mb=xe({"src/lib/tasks/diff.ts"(){"use strict";Tg(),KU(),un()}});function Bpe(t,e){let r=[],n=[];return Object.keys(t).forEach(i=>{r.push(i),n.push(String(t[i]))}),[r,n.join(e)]}function Hpe(t){return Object.keys(t).reduce((e,r)=>(r in pb||(e[r]=t[r]),e),{})}function ZU(t={},e=[]){let r=ia(t.splitter,fi,$b),n=!_b(t.format)&&t.format?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[i,s]=Bpe(n,r),o=[],a=[`--pretty=format:${Db}${s}${Lb}`,...e],c=t.n||t["max-count"]||t.maxCount;if(c&&a.push(`--max-count=${c}`),t.from||t.to){let u=t.symmetric!==!1?"...":"..";o.push(`${t.from||""}${u}${t.to||""}`)}return fi(t.file)&&a.push("--follow",Ode(t.file)),Eb(Hpe(t),a),{fields:i,splitter:r,commands:[...a,...o]}}function zpe(t,e,r){let n=GU(t,e,Ob(r));return{commands:["log",...r],format:"utf-8",parser:n}}function Wpe(){return{log(...r){let n=Xr(arguments),i=ZU(Tb(arguments),ia(arguments[0],Eg)),s=e(...r)||zv(i.commands)||t(i);return this._runTask(s,n)}};function t(r){return zpe(r.splitter,r.fields,r.commands)}function e(r,n){return fi(r)&&fi(n)&&Zi("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var pb,XU=xe({"src/lib/tasks/log.ts"(){"use strict";Tg(),xg(),QU(),ct(),un(),Mb(),pb=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(pb||{})}}),Iv,eq,Kpe=xe({"src/lib/responses/MergeSummary.ts"(){"use strict";Iv=class{constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},eq=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),mb,tq,Gpe=xe({"src/lib/responses/PullSummary.ts"(){"use strict";mb=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},tq=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function rb(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Sj(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:_r(e&&e[1]||"0"),delta:_r(r&&r[1]||"0")}}var rq,Jpe=xe({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";ct(),rq=[new Qc(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),i=rb(t.remoteMessages);Object.assign(i,{[n]:_r(r)})}),new Qc(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),i=rb(t.remoteMessages);Object.assign(i,{[n]:_r(r)})}),new Qc(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let i=rb(t.remoteMessages);i.total=Sj(e),i.reused=Sj(r),i.packReused=_r(n)})]}});function nq(t,e){return Xi({remoteMessages:new sq},iq,e)}var iq,sq,oq=xe({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";ct(),Jpe(),iq=[new Qc(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...rq,new Qc([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Qc([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:_r(e),summary:r,url:n}})],sq=class{constructor(){this.all=[]}}}});function Qpe(t,e){let r=Xi(new tq,aq,[t,e]);return r.message&&r}var Ej,Tj,Cj,kj,aq,wj,Fb,cq=xe({"src/lib/parsers/parse-pull.ts"(){"use strict";Gpe(),ct(),oq(),Ej=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Tj=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Cj=/^(create|delete) mode \d+ (.+)/,kj=[new dt(Ej,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new dt(Tj,(t,[e,,r,,n])=>r!==void 0||n!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+n||0,!0):!1),new dt(Cj,(t,[e,r])=>{Bt(t.files,r),Bt(e==="create"?t.created:t.deleted,r)})],aq=[new dt(/^from\s(.+)$/i,(t,[e])=>void(t.remote=e)),new dt(/^fatal:\s(.+)$/,(t,[e])=>void(t.message=e)),new dt(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,n,i])=>{t.branch.local=n,t.hash.local=e,t.branch.remote=i,t.hash.remote=r})],wj=(t,e)=>Xi(new mb,kj,[t,e]),Fb=(t,e)=>Object.assign(new mb,wj(t,e),nq(t,e))}}),Aj,uq,Rj,Ype=xe({"src/lib/parsers/parse-merge.ts"(){"use strict";Kpe(),ct(),cq(),Aj=[new dt(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new dt(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Iv(e,r))}),new dt(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new Iv(e,r,{deleteRef:n}))}),new dt(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Iv(e,null))}),new dt(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],uq=(t,e)=>Object.assign(Rj(t,e),Fb(t,e)),Rj=t=>Xi(new eq,Aj,t)}});function Pj(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=uq(e,r);if(n.failed)throw new _g(n);return n}}:Zi("Git.merge requires at least one option")}var Zpe=xe({"src/lib/tasks/merge.ts"(){"use strict";Zp(),Ype(),un()}});function Xpe(t,e,r){let n=r.includes("deleted"),i=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:n,tag:i,branch:!i,new:!s,alreadyUpdated:s,local:t,remote:e}}var Nj,lq,Oj,eme=xe({"src/lib/parsers/parse-push.ts"(){"use strict";ct(),oq(),Nj=[new dt(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new dt(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref=hg(Ys({},t.ref||{}),{local:e})}),new dt(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(Xpe(e,r,n))}),new dt(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch=hg(Ys({},t.branch||{}),{local:e,remote:r,remoteName:n})}),new dt(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,n,i])=>{t.update={head:{local:e,remote:r},hash:{from:n,to:i}}})],lq=(t,e)=>{let r=Oj(t,e),n=nq(t,e);return Ys(Ys({},r),n)},Oj=(t,e)=>Xi({pushed:[]},Nj,[t,e])}}),fq={};ln(fq,{pushTagsTask:()=>tme,pushTask:()=>Vb});function tme(t={},e){return Bt(e,"--tags"),Vb(t,e)}function Vb(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),Uv(r,"-v"),Bt(r,"--verbose"),Bt(r,"--porcelain"),{commands:r,format:"utf-8",parser:lq}}var dq=xe({"src/lib/tasks/push.ts"(){"use strict";eme(),ct()}});function rme(){return{showBuffer(){let t=["show",...Yi(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(vU(t),Xr(arguments))},show(){let t=["show",...Yi(arguments,1)];return this._runTask(wi(t),Xr(arguments))}}}var nme=xe({"src/lib/tasks/show.ts"(){"use strict";ct(),un()}}),Ij,pq,ime=xe({"src/lib/responses/FileStatusSummary.ts"(){"use strict";Ij=/^(.+)\0(.+)$/,pq=class{constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let n=Ij.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function Dj(t){let[e,r]=t.split(Yp);return{from:r||e,to:e}}function bs(t,e,r){return[`${t}${e}`,r]}function nb(t,...e){return e.map(r=>bs(t,r,(n,i)=>Bt(n.conflicted,i)))}function sme(t,e){let r=e.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(i,s,o){let a=`${i}${s}`,c=mq.get(a);c&&c(t,o),a!=="##"&&a!=="!!"&&t.files.push(new pq(o,i,s))}}var Lj,mq,hq,ome=xe({"src/lib/responses/StatusSummary.ts"(){"use strict";ct(),ime(),Lj=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},mq=new Map([bs(" ","A",(t,e)=>Bt(t.created,e)),bs(" ","D",(t,e)=>Bt(t.deleted,e)),bs(" ","M",(t,e)=>Bt(t.modified,e)),bs("A"," ",(t,e)=>Bt(t.created,e)&&Bt(t.staged,e)),bs("A","M",(t,e)=>Bt(t.created,e)&&Bt(t.staged,e)&&Bt(t.modified,e)),bs("D"," ",(t,e)=>Bt(t.deleted,e)&&Bt(t.staged,e)),bs("M"," ",(t,e)=>Bt(t.modified,e)&&Bt(t.staged,e)),bs("M","M",(t,e)=>Bt(t.modified,e)&&Bt(t.staged,e)),bs("R"," ",(t,e)=>{Bt(t.renamed,Dj(e))}),bs("R","M",(t,e)=>{let r=Dj(e);Bt(t.renamed,r),Bt(t.modified,r.to)}),bs("!","!",(t,e)=>{Bt(t.ignored=t.ignored||[],e)}),bs("?","?",(t,e)=>Bt(t.not_added,e)),...nb("A","A","U"),...nb("D","D","U"),...nb("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,o=/\son\s([\S]+)$/,a;a=r.exec(e),t.ahead=a&&+a[1]||0,a=n.exec(e),t.behind=a&&+a[1]||0,a=i.exec(e),t.current=a&&a[1],a=s.exec(e),t.tracking=a&&a[1],a=o.exec(e),t.current=a&&a[1]||t.current,t.detached=/\(no branch\)/.test(e)}]]),hq=function(t){let e=t.split(Yp),r=new Lj;for(let n=0,i=e.length;n<i;){let s=e[n++].trim();s&&(s.charAt(0)==="R"&&(s+=Yp+(e[n++]||"")),sme(r,s))}return r}}});function ame(t){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...t.filter(r=>!gq.includes(r))],parser(r){return hq(r)}}}var gq,cme=xe({"src/lib/tasks/status.ts"(){"use strict";ome(),gq=["--null","-z"]}});function Mv(t=0,e=0,r=0,n="",i=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:n,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function ume(){return Mv(0,0,0,"",!1)}function lme(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:fme,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(jb));n(e)}})}}}function fme(t){return t===jb?ume():Xi(Mv(0,0,0,t),yq,t)}var jb,yq,dme=xe({"src/lib/tasks/version.ts"(){"use strict";ct(),jb="installed=false",yq=[new dt(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,i=""])=>{Object.assign(t,Mv(_r(e),_r(r),_r(n),i))}),new dt(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,i=""])=>{Object.assign(t,Mv(_r(e),_r(r),n,i))})]}}),vq={};ln(vq,{SimpleGitApi:()=>hb});var hb,pme=xe({"src/lib/simple-git-api.ts"(){"use strict";vpe(),xpe(),bpe(),Tpe(),Rpe(),kU(),Npe(),NU(),Ipe(),Fpe(),XU(),Zpe(),dq(),nme(),cme(),un(),dme(),ct(),hb=class{constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&gpe(t,n,e),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(t){return this._runTask(wi(["add",...na(t)]),Xr(arguments))}cwd(t){let e=Xr(arguments);return typeof t=="string"?this._runTask(vj(t,this._executor),e):typeof(t==null?void 0:t.path)=="string"?this._runTask(vj(t.path,t.root&&this._executor||void 0),e):this._runTask(Zi("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(Ope(t,e===!0),Xr(arguments))}init(t){return this._runTask(Mpe(t===!0,this._executor.cwd,Yi(arguments)),Xr(arguments))}merge(){return this._runTask(Pj(Yi(arguments)),Xr(arguments))}mergeFromTo(t,e){return fi(t)&&fi(e)?this._runTask(Pj([t,e,...Yi(arguments)]),Xr(arguments,!1)):this._runTask(Zi("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=Vb({remote:ia(arguments[0],fi),branch:ia(arguments[1],fi)},Yi(arguments));return this._runTask(t,Xr(arguments))}stash(){return this._runTask(wi(["stash",...Yi(arguments)]),Xr(arguments))}status(){return this._runTask(ame(Yi(arguments)),Xr(arguments))}},Object.assign(hb.prototype,_pe(),Ape(),npe(),Epe(),Ppe(),ape(),Wpe(),rme(),lme())}}),xq={};ln(xq,{Scheduler:()=>bq});var $j,bq,mme=xe({"src/lib/runners/scheduler.ts"(){"use strict";ct(),$U(),$j=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,_q.createDeferred)();return{promise:e,done:r,id:t}}})(),bq=class{constructor(t=2){this.concurrency=t,this.logger=Pb("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=Bt(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),Uv(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=Bt(this.pending,$j());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),Sq={};ln(Sq,{applyPatchTask:()=>hme});function hme(t,e){return wi(["apply",...e,...t])}var gme=xe({"src/lib/tasks/apply-patch.ts"(){"use strict";un()}});function yme(t,e){return{branch:t,hash:e,success:!0}}function vme(t){return{branch:t,hash:null,success:!1}}var Eq,xme=xe({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Eq=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Tq(t,e){return e===1&&gb.test(t)}var Mj,gb,Fj,Wv,_me=xe({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";xme(),ct(),Mj=/(\S+)\s+\(\S+\s([^)]+)\)/,gb=/^error[^']+'([^']+)'/m,Fj=[new dt(Mj,(t,[e,r])=>{let n=yme(e,r);t.all.push(n),t.branches[e]=n}),new dt(gb,(t,[e])=>{let r=vme(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],Wv=(t,e)=>Xi(new Eq,Fj,[t,e])}}),Cq,bme=xe({"src/lib/responses/BranchSummary.ts"(){"use strict";Cq=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,n,i){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:n,label:i}}}}});function Vj(t){return t?t.charAt(0):""}function kq(t){return Xi(new Cq,wq,t)}var wq,Sme=xe({"src/lib/parsers/parse-branch.ts"(){"use strict";bme(),ct(),wq=[new dt(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,i])=>{t.push(Vj(e),!0,r,n,i)}),new dt(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(t,[e,r,n,i])=>{t.push(Vj(e),!1,r,n,i)})]}}),Aq={};ln(Aq,{branchLocalTask:()=>Tme,branchTask:()=>Eme,containsDeleteBranchCommand:()=>Rq,deleteBranchTask:()=>kme,deleteBranchesTask:()=>Cme});function Rq(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}function Eme(t){let e=Rq(t),r=["branch",...t];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,i){return e?Wv(n,i).all[0]:kq(n)}}}function Tme(){return{format:"utf-8",commands:["branch","-v"],parser:kq}}function Cme(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return Wv(r,n)},onError({exitCode:r,stdOut:n},i,s,o){if(!Tq(String(i),r))return o(i);s(n)}}}function kme(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,i){return Wv(n,i).branches[t]},onError({exitCode:n,stdErr:i,stdOut:s},o,a,c){if(!Tq(String(o),n))return c(o);throw new _g(r.parser(yg(s),yg(i)),String(o))}};return r}var wme=xe({"src/lib/tasks/branch.ts"(){"use strict";Zp(),_me(),Sme(),ct()}}),Pq,Ame=xe({"src/lib/responses/CheckIgnore.ts"(){"use strict";Pq=t=>t.split(/\n/g).map(e=>e.trim()).filter(e=>!!e)}}),Nq={};ln(Nq,{checkIgnoreTask:()=>Rme});function Rme(t){return{commands:["check-ignore",...t],format:"utf-8",parser:Pq}}var Pme=xe({"src/lib/tasks/check-ignore.ts"(){"use strict";Ame()}}),Oq={};ln(Oq,{cloneMirrorTask:()=>Ome,cloneTask:()=>Iq});function Nme(t){return/^--upload-pack(=|$)/.test(t)}function Iq(t,e,r){let n=["clone",...r];return fi(t)&&n.push(t),fi(e)&&n.push(e),n.find(Nme)?Zi("git.fetch: potential exploit argument blocked."):wi(n)}function Ome(t,e,r){return Bt(r,"--mirror"),Iq(t,e,r)}var Ime=xe({"src/lib/tasks/clone.ts"(){"use strict";un(),ct()}});function Dme(t,e){return Xi({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},Dq,[t,e])}var Dq,Lme=xe({"src/lib/parsers/parse-fetch.ts"(){"use strict";ct(),Dq=[new dt(/From (.+)$/,(t,[e])=>{t.remote=e}),new dt(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new dt(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new dt(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new dt(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,i])=>{t.updated.push({name:n,tracking:i,to:r,from:e})})]}}),Lq={};ln(Lq,{fetchTask:()=>Mme});function $me(t){return/^--upload-pack(=|$)/.test(t)}function Mme(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find($me)?Zi("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:Dme}}var Fme=xe({"src/lib/tasks/fetch.ts"(){"use strict";Lme(),un()}});function Vme(t){return Xi({moves:[]},$q,t)}var $q,jme=xe({"src/lib/parsers/parse-move.ts"(){"use strict";ct(),$q=[new dt(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),Mq={};ln(Mq,{moveTask:()=>Ume});function Ume(t,e){return{commands:["mv","-v",...na(t),e],format:"utf-8",parser:Vme}}var qme=xe({"src/lib/tasks/move.ts"(){"use strict";jme(),ct()}}),Fq={};ln(Fq,{pullTask:()=>Bme});function Bme(t,e,r){let n=["pull",...r];return t&&e&&n.splice(1,0,t,e),{commands:n,format:"utf-8",parser(i,s){return Fb(i,s)},onError(i,s,o,a){let c=Qpe(yg(i.stdOut),yg(i.stdErr));if(c)return a(new _g(c));a(s)}}}var Hme=xe({"src/lib/tasks/pull.ts"(){"use strict";Zp(),cq(),ct()}});function zme(t){let e={};return Vq(t,([r])=>e[r]={name:r}),Object.values(e)}function Wme(t){let e={};return Vq(t,([r,n,i])=>{e.hasOwnProperty(r)||(e[r]={name:r,refs:{fetch:"",push:""}}),i&&n&&(e[r].refs[i.replace(/[^a-z]/g,"")]=n)}),Object.values(e)}function Vq(t,e){vb(t,r=>e(r.split(/\s+/)))}var Kme=xe({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";ct()}}),jq={};ln(jq,{addRemoteTask:()=>Gme,getRemotesTask:()=>Jme,listRemotesTask:()=>Qme,remoteTask:()=>Yme,removeRemoteTask:()=>Zme});function Gme(t,e,r){return wi(["remote","add",...r,t,e])}function Jme(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?Wme:zme}}function Qme(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),wi(e)}function Yme(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),wi(e)}function Zme(t){return wi(["remote","remove",t])}var Xme=xe({"src/lib/tasks/remote.ts"(){"use strict";Kme(),un()}}),Uq={};ln(Uq,{stashListTask:()=>ehe});function ehe(t={},e){let r=ZU(t),n=["stash","list",...r.commands,...e],i=GU(r.splitter,r.fields,Ob(n));return zv(n)||{commands:n,format:"utf-8",parser:i}}var the=xe({"src/lib/tasks/stash-list.ts"(){"use strict";Tg(),QU(),Mb(),XU()}}),qq={};ln(qq,{addSubModuleTask:()=>rhe,initSubModuleTask:()=>nhe,subModuleTask:()=>Kv,updateSubModuleTask:()=>ihe});function rhe(t,e){return Kv(["add",t,e])}function nhe(t){return Kv(["init",...t])}function Kv(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),wi(e)}function ihe(t){return Kv(["update",...t])}var she=xe({"src/lib/tasks/sub-module.ts"(){"use strict";un()}});function ohe(t,e){let r=isNaN(t),n=isNaN(e);return r!==n?r?1:-1:r?Bq(t,e):0}function Bq(t,e){return t===e?0:t>e?1:-1}function ahe(t){return t.trim()}function Rv(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var jj,Hq,che=xe({"src/lib/responses/TagList.ts"(){"use strict";jj=class{constructor(t,e){this.all=t,this.latest=e}},Hq=function(t,e=!1){let r=t.split(`
558
+ `).map(ahe).filter(Boolean);e||r.sort(function(i,s){let o=i.split("."),a=s.split(".");if(o.length===1||a.length===1)return ohe(Rv(o[0]),Rv(a[0]));for(let c=0,u=Math.max(o.length,a.length);c<u;c++){let f=Bq(Rv(o[c]),Rv(a[c]));if(f)return f}return 0});let n=e?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new jj(r,n)}}}),zq={};ln(zq,{addAnnotatedTagTask:()=>fhe,addTagTask:()=>lhe,tagListTask:()=>uhe});function uhe(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return Hq(r,e)}}}function lhe(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function fhe(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var dhe=xe({"src/lib/tasks/tag.ts"(){"use strict";che()}}),phe=Pde({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(hpe(),Zr(FU)),{SimpleGitApi:n}=(pme(),Zr(vq)),{Scheduler:i}=(mme(),Zr(xq)),{configurationErrorTask:s}=(un(),Zr(ub)),{asArray:o,filterArray:a,filterPrimitives:c,filterString:u,filterStringOrStringArray:f,filterType:l,getTrailingOptions:p,trailingFunctionArgument:d,trailingOptionsArgument:h}=(ct(),Zr(cU)),{applyPatchTask:g}=(gme(),Zr(Sq)),{branchTask:v,branchLocalTask:b,deleteBranchesTask:_,deleteBranchTask:x}=(wme(),Zr(Aq)),{checkIgnoreTask:T}=(Pme(),Zr(Nq)),{checkIsRepoTask:R}=(dU(),Zr(uU)),{cloneTask:V,cloneMirrorTask:$}=(Ime(),Zr(Oq)),{cleanWithOptionsTask:K,isCleanOptionsArray:z}=(EU(),Zr(bU)),{diffSummaryTask:W}=(Mb(),Zr(YU)),{fetchTask:D}=(Fme(),Zr(Lq)),{moveTask:P}=(qme(),Zr(Mq)),{pullTask:M}=(Hme(),Zr(Fq)),{pushTagsTask:j}=(dq(),Zr(fq)),{addRemoteTask:J,getRemotesTask:te,listRemotesTask:re,remoteTask:we,removeRemoteTask:Q}=(Xme(),Zr(jq)),{getResetMode:F,resetTask:Oe}=(LU(),Zr(OU)),{stashListTask:ze}=(the(),Zr(Uq)),{addSubModuleTask:pt,initSubModuleTask:qe,subModuleTask:Je,updateSubModuleTask:Te}=(she(),Zr(qq)),{addAnnotatedTagTask:ie,addTagTask:he,tagListTask:Ee}=(dhe(),Zr(zq)),{straightThroughBufferTask:Ce,straightThroughStringTask:We}=(un(),Zr(ub));function me(G,ve){this._plugins=ve,this._executor=new r(G.baseDir,new i(G.maxConcurrentProcesses),ve),this._trimmed=G.trimmed}(me.prototype=Object.create(n.prototype)).constructor=me,me.prototype.customBinary=function(G){return this._plugins.reconfigure("binary",G),this},me.prototype.env=function(G,ve){return arguments.length===1&&typeof G=="object"?this._executor.env=G:(this._executor.env=this._executor.env||{})[G]=ve,this},me.prototype.stashList=function(G){return this._runTask(ze(h(arguments)||{},a(G)&&G||[]),d(arguments))};function Nt(G,ve,at,Gt){return typeof at!="string"?s(`git.${G}() requires a string 'repoPath'`):ve(at,l(Gt,u),p(arguments))}me.prototype.clone=function(){return this._runTask(Nt("clone",V,...arguments),d(arguments))},me.prototype.mirror=function(){return this._runTask(Nt("mirror",$,...arguments),d(arguments))},me.prototype.mv=function(G,ve){return this._runTask(P(G,ve),d(arguments))},me.prototype.checkoutLatestTag=function(G){var ve=this;return this.pull(function(){ve.tags(function(at,Gt){ve.checkout(Gt.latest,G)})})},me.prototype.pull=function(G,ve,at,Gt){return this._runTask(M(l(G,u),l(ve,u),p(arguments)),d(arguments))},me.prototype.fetch=function(G,ve){return this._runTask(D(l(G,u),l(ve,u),p(arguments)),d(arguments))},me.prototype.silent=function(G){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},me.prototype.tags=function(G,ve){return this._runTask(Ee(p(arguments)),d(arguments))},me.prototype.rebase=function(){return this._runTask(We(["rebase",...p(arguments)]),d(arguments))},me.prototype.reset=function(G){return this._runTask(Oe(F(G),p(arguments)),d(arguments))},me.prototype.revert=function(G){let ve=d(arguments);return typeof G!="string"?this._runTask(s("Commit must be a string"),ve):this._runTask(We(["revert",...p(arguments,0,!0),G]),ve)},me.prototype.addTag=function(G){let ve=typeof G=="string"?he(G):s("Git.addTag requires a tag name");return this._runTask(ve,d(arguments))},me.prototype.addAnnotatedTag=function(G,ve){return this._runTask(ie(G,ve),d(arguments))},me.prototype.deleteLocalBranch=function(G,ve,at){return this._runTask(x(G,typeof ve=="boolean"?ve:!1),d(arguments))},me.prototype.deleteLocalBranches=function(G,ve,at){return this._runTask(_(G,typeof ve=="boolean"?ve:!1),d(arguments))},me.prototype.branch=function(G,ve){return this._runTask(v(p(arguments)),d(arguments))},me.prototype.branchLocal=function(G){return this._runTask(b(),d(arguments))},me.prototype.raw=function(G){let ve=!Array.isArray(G),at=[].slice.call(ve?arguments:G,0);for(let wr=0;wr<at.length&&ve;wr++)if(!c(at[wr])){at.splice(wr,at.length-wr);break}at.push(...p(arguments,0,!0));var Gt=d(arguments);return at.length?this._runTask(We(at,this._trimmed),Gt):this._runTask(s("Raw: must supply one or more command to execute"),Gt)},me.prototype.submoduleAdd=function(G,ve,at){return this._runTask(pt(G,ve),d(arguments))},me.prototype.submoduleUpdate=function(G,ve){return this._runTask(Te(p(arguments,!0)),d(arguments))},me.prototype.submoduleInit=function(G,ve){return this._runTask(qe(p(arguments,!0)),d(arguments))},me.prototype.subModule=function(G,ve){return this._runTask(Je(p(arguments)),d(arguments))},me.prototype.listRemote=function(){return this._runTask(re(p(arguments)),d(arguments))},me.prototype.addRemote=function(G,ve,at){return this._runTask(J(G,ve,p(arguments)),d(arguments))},me.prototype.removeRemote=function(G,ve){return this._runTask(Q(G),d(arguments))},me.prototype.getRemotes=function(G,ve){return this._runTask(te(G===!0),d(arguments))},me.prototype.remote=function(G,ve){return this._runTask(we(p(arguments)),d(arguments))},me.prototype.tag=function(G,ve){let at=p(arguments);return at[0]!=="tag"&&at.unshift("tag"),this._runTask(We(at),d(arguments))},me.prototype.updateServerInfo=function(G){return this._runTask(We(["update-server-info"]),d(arguments))},me.prototype.pushTags=function(G,ve){let at=j({remote:l(G,u)},p(arguments));return this._runTask(at,d(arguments))},me.prototype.rm=function(G){return this._runTask(We(["rm","-f",...o(G)]),d(arguments))},me.prototype.rmKeepLocal=function(G){return this._runTask(We(["rm","--cached",...o(G)]),d(arguments))},me.prototype.catFile=function(G,ve){return this._catFile("utf-8",arguments)},me.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},me.prototype._catFile=function(G,ve){var at=d(ve),Gt=["cat-file"],wr=ve[0];if(typeof wr=="string")return this._runTask(s("Git.catFile: options must be supplied as an array of strings"),at);Array.isArray(wr)&&Gt.push.apply(Gt,wr);let Ht=G==="buffer"?Ce(Gt):We(Gt);return this._runTask(Ht,at)},me.prototype.diff=function(G,ve){let at=u(G)?s("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):We(["diff",...p(arguments)]);return this._runTask(at,d(arguments))},me.prototype.diffSummary=function(){return this._runTask(W(p(arguments,1)),d(arguments))},me.prototype.applyPatch=function(G){let ve=f(G)?g(o(G),p([].slice.call(arguments,1))):s("git.applyPatch requires one or more string patches as the first argument");return this._runTask(ve,d(arguments))},me.prototype.revparse=function(){let G=["rev-parse",...p(arguments,!0)];return this._runTask(We(G,!0),d(arguments))},me.prototype.clean=function(G,ve,at){let Gt=z(G),wr=Gt&&G.join("")||l(G,u)||"",Ht=p([].slice.call(arguments,Gt?1:0));return this._runTask(K(wr,Ht),d(arguments))},me.prototype.exec=function(G){let ve={commands:[],format:"utf-8",parser(){typeof G=="function"&&G()}};return this._runTask(ve)},me.prototype.clearQueue=function(){return this},me.prototype.checkIgnore=function(G,ve){return this._runTask(T(o(l(G,f,[]))),d(arguments))},me.prototype.checkIsRepo=function(G,ve){return this._runTask(R(l(G,u)),d(arguments))},e.exports=me}});xg();Yc();var mhe=class extends Ga{constructor(t,e){super(void 0,e),this.config=t}};Yc();Yc();var Ka=class extends Ga{constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Zp();Kj();dU();EU();kU();AU();NU();LU();function hhe(t){return t?[{type:"spawn.before",action(n,i){t.aborted&&i.kill(new Ka(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,i){function s(){i.kill(new Ka(void 0,"abort","Abort signal received"))}t.addEventListener("abort",s),i.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}function ghe(t){return typeof t=="string"&&t.trim().toLowerCase()==="-c"}function yhe(t,e){if(ghe(t)&&/^\s*protocol(.[a-z]+)?.allow/.test(e))throw new Ka(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function vhe(t,e){if(/^\s*--(upload|receive)-pack/.test(t))throw new Ka(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(e==="clone"&&/^\s*-u\b/.test(t))throw new Ka(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(e==="push"&&/^\s*--exec\b/.test(t))throw new Ka(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function xhe({allowUnsafeProtocolOverride:t=!1,allowUnsafePack:e=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((i,s)=>{let o=s<r.length?r[s+1]:"";t||yhe(i,o),e||vhe(i,n.method)}),r}}}ct();function _he(t){let e=gg(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}ct();var Uj=(0,Qp.deferred)().promise;function bhe({onClose:t=!0,onExit:e=50}={}){function r(){let i=-1,s={close:(0,Qp.deferred)(),closeTimeout:(0,Qp.deferred)(),exit:(0,Qp.deferred)(),exitTimeout:(0,Qp.deferred)()},o=Promise.race([t===!1?Uj:s.closeTimeout.promise,e===!1?Uj:s.exitTimeout.promise]);return n(t,s.close,s.closeTimeout),n(e,s.exit,s.exitTimeout),{close(a){i=a,s.close.done()},exit(a){i=a,s.exit.done()},get exitCode(){return i},result:o}}function n(i,s,o){i!==!1&&(i===!0?s.promise:s.promise.then(()=>ib(i))).then(o.done)}return{type:"spawn.after",action(i,s){return mg(this,arguments,function*(o,{spawned:a,close:c}){var u,f;let l=r(),p=!0,d=()=>void(p=!1);(u=a.stdout)==null||u.on("data",d),(f=a.stderr)==null||f.on("data",d),a.on("error",d),a.on("close",h=>l.close(h)),a.on("exit",h=>l.exit(h));try{yield l.result,p&&(yield ib(50)),c(l.exitCode)}catch(h){c(l.exitCode,h)}})}}}ct();var She="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",qj="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function Ehe(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(t)}function Bj(t,e){if(t.length<1||t.length>2)throw new Ka(void 0,"binary",She);if(t.some(Ehe))if(e)console.warn(qj);else throw new Ka(void 0,"binary",qj);let[n,i]=t;return{binary:n,prefix:i}}function The(t,e=["git"],r=!1){let n=Bj(na(e),r);t.on("binary",i=>{n=Bj(na(i),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",i=>n.prefix?[n.prefix,...i]:i)}Yc();function Che(t){return!!(t.exitCode&&t.stdErr.length)}function khe(t){return Buffer.concat([...t.stdOut,...t.stdErr])}function whe(t=!1,e=Che,r=khe){return(n,i)=>!t&&n||!e(i)?n:r(i)}function Hj(t){return{type:"task.error",action(e,r){let n=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new Ga(void 0,n.toString("utf-8"))}:{error:n}}}}ct();var Ahe=class{constructor(){this.plugins=new Set,this.events=new Wq.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=Bt(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return na(t).forEach(r=>r&&this.plugins.add(Bt(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let n=e,i=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(n=s.action(n,i));return n}};ct();function Rhe(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,o){return r.includes(o.method)?Xj(s,e):s}},{type:"spawn.after",action(s,o){var a;o.commands.includes(e)&&((a=o.spawned.stderr)==null||a.on("data",c=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));u&&t({method:o.method,stage:Phe(u[1]),progress:_r(u[2]),processed:_r(u[3]),total:_r(u[4])})}))}}]}function Phe(t){return String(t.toLowerCase().split(" ",1))||"unknown"}ct();function Nhe(t){let e=rU(t,["uid","gid"]);return{type:"spawn.options",action(r){return Ys(Ys({},e),r)}}}function Ohe({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(n,i){var s,o;let a;function c(){a&&clearTimeout(a),a=setTimeout(f,t)}function u(){var l,p;(l=i.spawned.stdout)==null||l.off("data",c),(p=i.spawned.stderr)==null||p.off("data",c),i.spawned.off("exit",u),i.spawned.off("close",u),a&&clearTimeout(a)}function f(){u(),i.kill(new Ka(void 0,"timeout","block timeout reached"))}r&&((s=i.spawned.stdout)==null||s.on("data",c)),e&&((o=i.spawned.stderr)==null||o.on("data",c)),i.spawned.on("exit",u),i.spawned.on("close",u),c()}}}xg();function Ihe(){return{type:"spawn.args",action(t){let e=[],r;function n(i){(r=r||[]).push(...i)}for(let i=0;i<t.length;i++){let s=t[i];if(Dv(s)){n(mj(s));continue}if(s==="--"){n(t.slice(i+1).flatMap(o=>Dv(o)&&mj(o)||o));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}ct();var Dhe=phe();function Lhe(t,e){var r;let n=new Ahe,i=oU(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!xb(i.baseDir))throw new mhe(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&n.add(_he(i.config)),n.add(xhe(i.unsafe)),n.add(Ihe()),n.add(bhe(i.completion)),i.abort&&n.add(hhe(i.abort)),i.progress&&n.add(Rhe(i.progress)),i.timeout&&n.add(Ohe(i.timeout)),i.spawnOptions&&n.add(Nhe(i.spawnOptions)),n.add(Hj(whe(!0))),i.errors&&n.add(Hj(i.errors)),The(n,i.binary,(r=i.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new Dhe(i,n)}Zp();var Kq=Lhe;var Fl={git:"git"},Gv;(r=>(r.Git=n=>n===Fl.git,r.Is=n=>(0,r.Git)(n)))(Gv||(Gv={}));var Ub=ke(require("assert"),1);var Jq=ke(require("assert"),1);var Gq=new Map;async function Jv(t,e){(0,Jq.default)(e.scheme===Fl.git);let r=e.toString(),n=Gq.get(r);if(n)return Le(n);let i,s=c=>(Gq.set(r,i),Le(c));i=new Ba(e.toString()),i.protocol="https:";let o=await N.tryCatchAsync(async()=>t.listRemote([i.toString()]),()=>{});if(N.isOk(o))return s(i);i=new Ba(e.toString()),i.protocol="git+ssh:";let a=await N.tryCatchAsync(async()=>t.listRemote([i.toString()]),()=>{});return N.isOk(a)?s(i):oe(void 0)}async function Qq(t,e,r,n){(0,Ub.default)(n.scheme===Fl.git);let i=await Jv(t,n);if(N.isErr(i))return oe(`invalid target '${n}': not a valid git repository`);let s=String(i.value),o=r.get(s);if(o)return Le(o);let a=await $he(t,e,i.value);if(N.isErr(a))return a;let c=a.value.filter(u=>u.startsWith("v")).map(u=>u.slice(1)).map(Ci.Parse).filter(N.isOk).map(u=>u.value).sort(Ci.Compare);return r.set(s,c),Le(c)}async function $he(t,e,r){let n=r.toString(),i=e.get(n);if(i)return Le(i);let s=await N.tryCatchAsync(()=>t.listRemote([n]));if(N.isErr(s)){let a=String(s.err);return a==="[object Object]"&&(a=JSON.stringify(s.err)),oe(`failed to list remote: ${a}`)}let o=s.value.split(`
559
+ `).map(a=>a.split(/\s+/)).filter(a=>a.length==2).map(([,a])=>a).filter(a=>a.startsWith("refs/heads/")||a.startsWith("refs/tags/")).map(a=>a.split("/",3).pop()).map(a=>((0,Ub.default)(a),a));return e.set(n,o),Le(o)}var Yq=ke(require("assert"),1),Zq=require("fs/promises"),Xq=require("path");async function eB(t,e,r,n){(0,Yq.default)(e.scheme===Fl.git);let i=await Jv(t,e);return N.isErr(i)?oe(`invalid target '${e}': not a valid git repository`):N.tryCatchAsync(async()=>{await t.clone(i.value.toString(),n,["-b",r,"--depth","1"]),await(0,Zq.rm)((0,Xq.join)(n,".git"),{recursive:!0,force:!0})},s=>String(s))}var tB=t=>{let e=new Map,r=new Map;return{Get:(...n)=>eB(t,...n),Versions:(...n)=>Qq(t,e,r,...n)}};function Cg(){let t=new Map,e=Kq({}).env("GIT_SSH_COMMAND","ssh -o StrictHostKeyChecking=no");return r=>{let n=t.get(r);if(n!==void 0)return n;let i=(()=>{switch(r){case"git":return tB(e)}})();return t.set(r,i),i}}function rB(t,e){let r=e.scheme;return Gv.Is(r)?Le(t(r)):oe(`unknown protocol '${r}'`)}function yo(t){if(yo.isLatest(t))return Ut(t);if(yo.isPatch(t))return Ut(t);if(yo.isNone(t))return Ut(t);t.startsWith("v")&&(t=t.slice(1));let e=Ci.Parse(t);return N.isOk(e)?Ut(e.value):ot}(i=>(i.isSemVer=s=>Ci.Is(s),i.isLatest=s=>s==="latest",i.isPatch=s=>s==="patch",i.isNone=s=>s==="none"))(yo||(yo={}));var Zv=ke(require("assert"),1);var qb=ke(require("path"),1),nB=require("os"),iB=require("crypto"),kg=require("fs/promises");var sB=(0,nB.tmpdir)();async function Qv(){let t=qb.default.join(sB,"kumori/kdsl/tmp",(0,iB.randomBytes)(32).toString("hex"));return await(0,kg.mkdir)(t,{recursive:!0}),{Path:t,[Symbol.asyncDispose]:()=>(0,kg.rm)(t,{recursive:!0,force:!0})}}async function Yv(){let t=De.file(qb.default.join(sB,"kumori/kdsl/cache"));return await(0,kg.mkdir)(t.fsPath,{recursive:!0}),t}var Mhe=()=>Le(void 0);async function oB(t,e,r,n,i){let s=await $p(e.fsPath),o=za.Retrieve(t,n,i),a=PV(n);if(ue.isSome(a)){let c=a.value;if(s!==c){let u=`integrity verification failed '${n}@${i}': hash mismatch:
560
+ expected ${c}
561
+ fetched ${s}`;return console.error(u),oe(u)}}return ue.isNone(o)?za.Register(t,e,r,n,i):s!==o.value?oe(`integrity verification failed '${n}@${n}': hash mismatch:
562
+ expected ${o.value}
563
+ fetched ${s}`):Mhe()}var Xp=require("fs/promises");async function aB(t){let e=new Map;return await uB(t,e),e}async function cB(t,e){let r=new Map;console.log(e);for(let n of e){let i=Js(n);if(ue.isNone(i)){let c=`invalid download query '${n}': failed to parse`;r.set(n,Y(C({},oe(c)),{required:!0}));continue}if(ue.isSome(i.value.Major)){let c=`invalid download query '${n}': major specifier '#${i.value.Major}' not allowed in download queries`;r.set(n,Y(C({},oe(c)),{required:!0}));continue}if(ue.isNone(i.value.Version)){let c=`invalid download query '${n}': missing version specifier`;r.set(n,Y(C({},oe(c)),{required:!0}));continue}let s=yo(i.value.Version.value);if(ue.isNone(s)){let c=`invalid download query '${n}': invalid version specifier '${i.value.Version.value}': failed to parse`;r.set(n,Y(C({},oe(c)),{required:!0}));continue}if(!yo.isSemVer(s.value)){let c=`invalid download query '${n}': invalid version specifier '${i.value.Version.value}': invalid semver`;r.set(n,Y(C({},oe(c)),{required:!0}));continue}let o=`${i.value.Scheme}://${i.value.Location}`,a=i.value.Version.value;await lB(t,o,a,r)}return r}async function uB(t,e){var n;let r=Sv(t.Current);for(let i of r.keys()){let s=r.get(i);if(s.length<1)continue;let{target:o,version:a}=s[0];await lB(t,o,a,e);let c=s.reduce((f,l)=>f||l.interface===void 0,!1),u=Ln(o,a);(0,Zv.default)(e.has(u)),(n=e.get(u)).required||(n.required=c)}}async function lB(t,e,r,n){let i=Ln(e,r);if(n.has(i))return;let s=await Fhe(t,e,r);if(n.set(i,Y(C({},s),{required:!1})),N.isErr(s))return;let o=await dg(t,e,r);(0,Zv.default)(ue.isSome(o));let a=await kr.Move(t,t.FS,o.value.Root);(0,Zv.default)(N.isOk(a)),t=C(C({},t),a.value),await uB(t,n)}async function Fhe(t,e,r){var u=[];try{let n=await dg(t,e,r);if(N.isOk(n))return Le(ot);let i=jg(u,await Qv(),!0);let s=await Bb(t,e,r,i.Path);if(N.isErr(s))return oe(`failed to fetch ${e}@v${r}: ${s.err}`);let o=await oB(t.SumDB,De.file(i.Path),t,e,s.value);if(N.isErr(o))return o;let a=`${e}@${r}`;let c=ee.joinPath(t.Locations.Cache(),a);await(0,Xp.mkdir)(c.fsPath,{recursive:!0});await(0,Xp.rm)(c.fsPath,{recursive:!0,force:!0});await(0,Xp.rename)(i.Path,c.fsPath);return Le(Ut(a))}catch(f){var l=f,p=!0}finally{var d=Ug(u,l,p);d&&await d}}async function Bb(t,e,r,n){let i=`${e}@${r}`,s=Js(i);if(ue.isNone(s))return oe(`failed to resolve ${i}: invalid download query`);let o=ue.flatMap(s.value.Version,yo);if(ue.isNone(o)||!yo.isSemVer(o.value))return oe(`failed to resolve ${i}: invalid version string '${r}'`);let a=new Ba(`${s.value.Scheme}://${s.value.Location}`),c=rB(t.Remotes,a);if(N.isErr(c))return oe(`failed to resolve ${i}': invalid remote ${a}: ${c.err}`);let u=await c.value.Versions(a);if(N.isErr(u))return oe(`failed to read ${a}: ${u.err}`);let f=o.value,l=u.value.filter(g=>Ci.Compare(g,f)===0);if(l.length===0)return oe(`no remote matches for ${a}@v${o.value}`);if(l.length>1){let g=`[${l.map(String).join(", ")}]`;return oe(`ambiguous match for ${a}@v${o.value}: found ${g}`)}let p=l[0],d="v"+p.toString(),h=await c.value.Get(a,d,n);return N.isErr(h)?oe(`failed to fetch ${a}@v${o.value.toString()}: ${h.err}`):Le(p)}var fB={Register:Vhe};function Vhe(t,e){return t.command("download").alias("dl").summary(jhe).argument("[module...]").option("-q, --quiet","do not log warnings").description(Hb).helpOption(!0).action(Uhe(e))}var jhe="download modules to local cache",Hb=`
564
+ Downloads the specified modules, which can be module patterns selecting depen-
565
+ dencies of the current module or module queries of the form path@version.
566
+
567
+ With no arguments, download applies to the modules needed to build the packages
568
+ in the current module.
569
+
570
+ The kdsl command will automatically download modules as needed during ordinary
571
+ execution. The "kdsl mod download" command is useful mainly for pre-filling the
572
+ local cache.
573
+
574
+ By default, download writes nothing to standard output. It may print progress
575
+ messages and errors to standard error.
576
+ `.trim();function Uhe(t){let e=Ji(wn).Kumori,r=n=>ra(t,n);return async(n,i)=>{r(await zb(t,e,process.cwd(),n,i))}}var zb=async(t,e,r,n,i)=>{let s=e.shared.workspace.FileSystemProvider,o=await kr(s,De.file(r));if(N.isErr(o))return oe([o.err]);let a=await za.Open(o.value.Locations.Checksum());if(N.isErr(a))return N.mapErr(a,l=>[l]);let c;n.length?c=await cB(Y(C({},o.value),{FS:s,Remotes:Cg(),SumDB:a.value}),n):c=await aB(Y(C({},o.value),{FS:s,Remotes:Cg(),SumDB:a.value}));let u=[];for(let[l,p]of c){if(N.isOk(p)){ue.isSome(p.value)&&t.info(l);continue}p.required?u.push(`${l}: ${p.err}`):i.quiet||(t.warn(`${l}: ${p.err}`),t.warn(`${l}: not required - continuing`))}return Array.from(c.entries()).filter(([,l])=>N.isErr(l)&&l.required).length>0?oe(u):Le(void 0)};var dB=ke(require("path"),1);function qhe(t,e){return t.command("check").argument("[directory]","directory containing a Kumori module").description(Hhe).summary(Bhe).action(zhe(e))}var Bhe="typecheck and validate a module",Hhe=`
577
+ `.trim();function zhe(t){return async e=>{let r=Ji(wn).Kumori,n=r.shared.workspace.FileSystemProvider,i=o=>ra(t,o),s=i(N.mapErr(await kr(n,De.file(dB.default.resolve(e!=null?e:"."))),o=>[o]));i(await sa(t,r,s))}}var sa=async(t,e,r)=>{let n=r.Current.Root,i=await zb(t,e,n.fsPath,[],{quiet:!0});if(N.isErr(i))return i;let s=await Whe(e,r);if(N.isErr(s)){let o=s.err.warnings.concat(s.err.errors);return oe(o)}return Le(void 0)},Whe=async(t,e)=>{let r={errors:[],warnings:[]},n=t.shared.workspace.FileSystemProvider,i=e.Current.Root,s=await N.tryCatchAsync(()=>n.readDirectory(i));if(N.isErr(s)){let u=""+s.err;return s.err instanceof Error&&(u=s.err.message),r.errors.push(`failed to read directory '${i.fsPath}': ${u}`),oe(r)}await t.shared.workspace.WorkspaceManager.initializeWorkspace([{name:"root",uri:i.toString()}]);let a=t.shared.workspace.LangiumDocuments;await t.shared.workspace.DocumentBuilder.build(a.all.toArray(),{validation:!0});for(let u of t.shared.workspace.LangiumDocuments.all){for(let f of u.parseResult.lexerErrors)r.errors.push(Khe(u,f));for(let f of u.parseResult.parserErrors)r.errors.push(Ghe(u,f));for(let f of u.diagnostics||[]){let l=Jhe(u,f);f.severity===Wb.DiagnosticSeverity.Error&&r.errors.push(l),f.severity===Wb.DiagnosticSeverity.Warning&&r.warnings.push(l)}}return r.errors.length>0?oe(r):Le(void 0)};function Khe(t,e){return`lexer error: ${ee.relative(process.cwd(),t.uri.fsPath)}:${e.line||1}:${e.column||1}: ${e.message}`}function Ghe(t,e){return`parser error: ${ee.relative(process.cwd(),t.uri.fsPath)}:${e.token.startLine||1}:${e.token.startColumn||1}: ${e.message}`}function Jhe(t,e){return`diagnostic error: ${ee.relative(process.cwd(),t.uri.fsPath)}:${e.range.start.line+1}:${e.range.start.character+1}: ${e.message}`}var pB={Register:qhe};var mB=require("fs");function Qhe(t,e){return t.command("build").argument("<package>","package containing the target deployment").argument("[directory]","directory containing a Kumori module").description(Zhe).summary(Yhe).action(Xhe(e))}var Yhe="produces deployable artifact specifications",Zhe=`
578
+ `.trim();function Xhe(t){return async(e,r)=>{let n=Ji(wn).Kumori,i=n.shared.workspace.FileSystemProvider,s=b=>ra(t,b),o=s(N.mapErr(await kr(i,De.file(Gb.default.resolve(r!=null?r:"."))),b=>[b])),a=C({FS:i},o),c=await hB(a);if(c.size>0){t.error("error: missing modules");for(let b of c)t.error(`+ ${b}`);t.error("unable to build solution.json"),process.exit(1)}s(await sa(t,n,o));let u=ee.joinPath(o.Current.Root,e),f=n.references.KumoriPackages.GetPackage(u);if(N.isErr(f)){t.error(`error: failed to retrieve package: ${u.toString()}`);return}let l=new Set(f.value.docs.map(b=>b.uri.toString())),p=n.shared.workspace.IndexManager.allElements(ti,l).toArray();if(p.length<1){t.error(`error: no deployment defined in ${u.toString()}`);return}if(p.length>1){t.error(`error: too many deployments in ${u.toString()}`);return}let d=p[0],h=d.node;if(!Bn(h)){t.error(`error: invalid target doc=${d.documentUri} location=${d.path}`);return}let g=YV(t,n,h),v=Gb.default.join(u.fsPath,"solution.json");await mB.promises.writeFile(v,g,"utf-8"),t.info(`solution.json written to ${v}`)}}async function hB(t,e=new Set){let r=Sv(t.Current);for(let[,n]of r.entriesGroupedByKey()){(0,Kb.default)(n.length>0);let{target:i,version:s}=n[0],o=await dg(t,i,s);if(ue.isNone(o)){e.add(Ln(i,s));continue}let a=await kr.Move(t,t.FS,o.value.Root);(0,Kb.default)(N.isOk(a));let c=C(C({},t),a.value);await hB(c,e)}return e}var gB={Register:Qhe};var yB=require("fs/promises"),vB={Register:e1e};function e1e(t,e){return t.command("clean").summary(t1e).description(r1e).action(n1e(e))}var t1e=`
579
+ remove cached files
580
+ `.trim(),r1e=`
581
+ The kdsl command builds most artifacts in a temporary directory, so kdsl clean is
582
+ mainly concerned with files left by manual invocations of kdsl commands.
583
+ `.trim();function n1e(t){return async()=>{let e=await Yv();t.info(e.fsPath),await(0,yB.rm)(e.fsPath,{force:!0,recursive:!0})}}var Jb=require("fs/promises");var i1e="Add, update, or remove a dependency from the module declaration",Qb=`
584
+ Manage dependencies within the current module. It can add, update
585
+ or remove dependencies. Optionally, it can attemtp to download the dependency after adding it.
586
+ Dependencies should resolve to a git repository.
587
+
588
+ To add a dependency:
589
+ kdsl mod dep github.com/org/repo@v1.0.0
590
+
591
+ To add a dependency with an alias:
592
+ kdsl mod dep github.com/org/repo@v1.0.0 --alias mydep
593
+
594
+ To update a dependency to a new version:
595
+ kdsl mod dep github.com/org/repo@v1.2.0
596
+
597
+ To remove a dependency:
598
+ kdsl mod dep github.com/org/repo --remove
599
+
600
+ To add a dependency and download it immediately:
601
+ kdsl mod dep github.com/org/repo@v1.0.0 --download
602
+ `.trim(),xB={Register:s1e};function s1e(t,e){return t.command("dependency").alias("dep").argument("<module>","Module URL with @<tag> (e.g. https://github.com/org/repo@v1.2.3)").option("--alias <alias>","Alias for the dependency").option("--headers <module>","Specify a separate location for the headers module").option("--remove","Remove the dependency").option("--download","Download the dependency after adding it").summary(i1e).description(Qb).helpOption(!0).showHelpAfterError(!0).action(o1e(e))}function o1e(t){return async(e,r)=>{await a1e(t,De.file(process.cwd()),e,r)}}var a1e=async(t,e,r,n)=>{let i=Ji(wn).Kumori,s=i.shared.workspace.FileSystemProvider,o=await kr(s,e);if(N.isErr(o))throw new Error(o.err);let a=o.value.Current.Manifest,c=Js(r);if(N.isErr(c))throw new Error(`invalid query '${r}': invalid format`);let u=null;if(n.headers&&(u=Js(n.headers),N.isErr(u)))throw new Error(`invalid query '${n.headers}': invalid format`);let f=c.value,l=u?u.value:null,p=n.alias;if(n.remove){let h=a.requires.findIndex(g=>g.target===f.Location);if(h===-1)throw new Error(`Dependency ${f} not found`);a.requires.splice(h,1),t.info(`Removed dependency ${f}`)}else{if(p&&a.requires.some(g=>g.alias===p&&g.target!==f.Location))throw new Error(`Alias '${p}' is already used by another dependency`);let h=a.requires.find(g=>g.target===f.Location);if(h){if(h.version=N.isOk(f.Version)?f.Version.value:"",p?h.alias=p:delete h.alias,l&&(h.headers={target:l.Location,version:N.isOk(l.Version)?l.Version.value:""}),await(0,Jb.writeFile)(ee.joinPath(o.value.Current.Root,xr).fsPath,JSON.stringify(a,void 0,4)),n.download){let g=await sa(t,i,o.value);if(N.isErr(g))throw new Error(`failed to download dependency: ${g.err.join(", ")}`)}t.info(`Updated dependency ${f} to version ${f.Version}`+(p?` (alias: ${p})`:"")+(l?` (headers: ${l})`:""))}else{let g=N.isOk(f.Version)?f.Version.value:"",v=C(C({target:f.Location,version:g},p?{alias:p}:{}),l?{headers:{target:l.Location,version:N.isOk(l.Version)?l.Version.value:""}}:{});if(a.requires.push(v),await(0,Jb.writeFile)(ee.joinPath(o.value.Current.Root,xr).fsPath,JSON.stringify(a,void 0,4)),n.download){let b=await sa(t,i,o.value);if(N.isErr(b))throw new Error(`failed to download dependency: ${b.err.join(", ")}`)}t.info(`Added dependency ${f}`+(p?` (alias: ${p})`:"")+(l?` (headers: ${l})`:""))}}};var _B=["mod dep",async()=>{console.log(Qb)}];var bB=["mod dl",async()=>{console.log(Hb),console.log(`
603
+ kdsl mod download
604
+ kdsl mod dl
605
+
606
+ Without arguments, downloads all dependencies and validates against the avail-
607
+ able checksums.
608
+
609
+ kdsl mod dl example.com/module
610
+
611
+ Downloads all dependencies that match the particular target (can match multi-
612
+ ple).
613
+
614
+ kdsl mod dl example.com/module@v1.2.3
615
+
616
+ Downloads a specific dependency, whether or not it is registered in the mani-
617
+ fest.
618
+ `.trimEnd())}];var SB=["build",async()=>{console.log("TBD")}];var TB={Register:c1e};function c1e(t){return t.command("help").summary(u1e).description(l1e).argument("[topic...]").option("-a, --all","list all available topics").action(f1e)}var u1e=`
619
+ displays helpful information on various topics
620
+ `.trim(),l1e=`
621
+ Use "kdsl help -a" for a list of available topics.
622
+ `.trim(),Yb=new Map,Zb=(t,e)=>Yb.set(t,e),f1e=async(t,e,r)=>{if(e.all)return EB();if(!t.length){r.outputHelp();return}let n=t.join(" "),i=Yb.get(n);if(!i)return console.error(`unknown topic '${n}'
623
+ `),EB();await i()},EB=()=>{console.log(`Available topics:
624
+ `),console.log(Array.from(Yb.keys()).sort().map(t=>" "+t).join(`
625
+ `))};Zb(..._B);Zb(...bB);Zb(...SB);var e8=require("fs/promises");var Xv=ke(require("path"),1),CB={Register:d1e};function d1e(t,e){return t.command("init").summary(p1e).argument("<name>","module name (e.g., kumori.systems/my-module)").argument("<version>","module version - defaults to 0.0.1").argument("[path]","location to create the module under - defaults to the current directory").argument("[cacheLocation]","location to store cached modules - default to .kumori/mod").description(m1e).helpOption(!0).action(h1e(e))}var p1e="initializes a new kumori module",m1e=`
626
+ Initializes a new Kumori module, which effectively means to create a new
627
+ kumori.mod.json file or overwrite it in case it already exists.
628
+ It is required to provide a name and a version for the module and optionally
629
+ a location path where the new module is going to be initialized.
630
+
631
+ kdsl mod init kumori.systems/my-module
632
+
633
+ You could as well provide a custom location for the module's local cache,
634
+ where all the dependencies will be downloaded. By default, the cache location
635
+ is set to ".kumori/mod" under the module location.
636
+
637
+ kdsl mod init kumori.systems/my-module ./my-module
638
+
639
+ `.trim();function h1e(t){return async(...e)=>{await g1e(t,process.cwd(),...e)}}var g1e=async(t,e,...[r,n,i,s])=>{let o=wn.fileSystemProvider();i=i!=null?i:e,Xv.default.isAbsolute(i)||(i=Xv.default.join(e,i));let a=await wl(o,De.file(i));ue.isSome(a)&&a.value.fsPath===i&&(t.error(`error: module ${i} already exists`),process.exit(1));let c={spec:"kumori/module/v1",kumori:"0.0.1",version:n,module:r,cacheLocation:s,requires:[]},u=Xv.default.join(i,xr);await(0,e8.mkdir)(i,{recursive:!0}),await(0,e8.writeFile)(u,JSON.stringify(c,null,4)),t.info(`creating new ${xr}: module ${r}`)};var AB=ke(I_(),1),RB=require("fs/promises");var wg=ke(require("path"),1);var em=ke(require("assert"),1);function kB(t){var n,i;let e=(i=(n=t.node.$cstNode)==null?void 0:n.range)!=null?i:{start:{line:-1,character:-1},end:{line:-1,character:-1}},r=Fe.getDocument(t.node);return`${ee.relative(process.cwd(),r.uri.fsPath)}:${e.start.line+1}:${e.start.character+1}: ${t.message}`}var wB={Register:y1e};function y1e(t,e){return t.command("get").summary(v1e).argument("<target>",'Unique path of the kmodule where the artifact is defined. Accepts remote targets (e.g., "github.com/MyOrg/component@v1.2.3") or local paths (e.g. "/abs/path/to/module", "../rel/path/to/module").').argument("<package-path>",`Relative path to the package that contains the artifact (e.g., "internal/service"). For artifacts in the module's root package, use ".".`).argument("<artifact-name>",'Name of the target artifact (e.g., "ExampleService").').description(x1e).helpOption(!0).action(_1e(e))}var v1e="extracts jsonschema for a specified module and artifact",x1e=`
640
+ Generates and outputs the JSON Schema that describes a particular Kumori DSL
641
+ artifact. This schema defines the artifact's configurable properties, resource
642
+ requirements, and overall structure, making it valuable for programmatic
643
+ interaction, validation, or documentation purposes.
644
+
645
+ The command allows you to specify artifacts from both remote/external modules
646
+ and local modules.
647
+ `.trim();function _1e(t){return async(e,r,n)=>{let i=Ji(wn).Kumori,s=f=>ra(t,f),o=s(await Xb(e)),a=i.shared.workspace.FileSystemProvider,c=s(N.mapErr(await kr(a,De.file(o.fsPath)),f=>[f]));s(await sa(t,i,c));let u=s(await eS(i,c,r,n));console.log(JSON.stringify(u,null,4))}}async function Xb(t){let e=await Yv(),r=wn.fileSystemProvider(),n=t;if(t[0]==="."||wg.default.isAbsolute(t))return Le({$type:"local",fsPath:t});let s=Js(t);if(ue.isNone(s))return oe([`invalid remote target '${t}': invalid syntax`]);let o=s.value.Version;if(ue.isNone(o))return oe([`invalid remote target '${t}': missing version specifier (e.g., @v1.2.3)`]);let a=`${s.value.Location}@${o.value}`,c=ee.joinPath(e,a),u=await Gs(r,c);if(N.isErr(u)){let f=await Bb({Remotes:Cg()},s.value.Location,o.value,c.fsPath);if(N.isErr(f))return oe([`failed to fetch ${n}: ${f.err}`])}return Le({$type:"remote",fsPath:c.fsPath,query:s.value})}async function eS(t,e,r,n){let i=ee.joinPath(e.Current.Root,wg.default.normalize(r)),s=t.references.KumoriPackages.GetPackage(i);if(N.isErr(s))return oe([`error: failed to retrieve package: ${i.toString()}`]);let o=new Set(s.value.docs.map(g=>g.uri.toString())),a=t.shared.workspace.IndexManager.allElements(void 0,o).toArray().filter(g=>g.name===n);if(a.length<1)return oe([`error: no artifact named defined in ${i.toString()}`]);if(a.length>2)return oe([`error: too many matches in ${i.toString()}`]);let c=a[0].node;if(!(Ca(c)||Ns(c)||Ta(c)))return oe([`invalid reference to node of type: ${c.$type}`]);if(!Fe.getDocument(c).uri.fsPath.endsWith(".h.kumori")){if(!c.name.value.ref)return oe(["no headers found for component"]);c=c.name.value.ref}let f=t.validation.KumoriTypeSystem,l=t.validation.KumoriValidations.ctx(),[p,d]=f.Infer(l,c);if(d.length>0){let g=[];return d.map(v=>g.concat(v.message)),oe([`type inference failed with errors: ${g}`])}let h=await b1e(t,e,p,wg.default.join(e.Current.Manifest.module,r+"@"+n));return N.mapErr(h,g=>g.map(kB))}async function b1e(t,e,r,n){return N.map(await Ja({svcs:t,mod:e},r),i=>C({$schema:"https://json-schema.org/draft/2020-12/schema",$spec:"kumori/schema/v1",$id:n},i))}async function Ja(t,e){if(Dt.is(e))return Le({});if(ir.is(e))return Ja(t,e.returns);if(qi.is(e))return Ja(t,e.inner);if(ds.is(e))return Ja(t,e.spec);if(_t.is(e))return e.literal===void 0?Le({type:"number"}):Le({const:e.literal});if(yt.is(e))return e.literal===void 0?Le({type:"string"}):Le({const:e.literal});if(qt.is(e))return e.literal===void 0?Le({type:"boolean"}):Le({const:e.literal});if(zn.is(e)){let r=await Ja(t,e.restriction);return N.isErr(r)?r:Le({type:"array",items:r.value})}if(co.is(e)){let r=await Promise.all(e.variations.map(s=>Ja(t,s))),n=r.filter(N.isErr).map(s=>s.err).flat();if(n.length>0)return oe(n);let i=r.filter(N.isOk).map(s=>s.value);return(0,em.default)(i.length===r.length),Le({oneOf:i})}if(ne.is(e)){let r=await Promise.all(Object.entries(e.parameters).map(async o=>({key:o[0],value:o[1],schema:await Ja(t,o[1].value)}))),n=r.map(o=>o.schema).filter(o=>N.isErr(o)).map(o=>o.err).flat(),i=ot;if(e.restriction!==void 0&&!Dt.is(e.restriction)){let o=await Ja(t,e.restriction);N.isOk(o)?i=Ut(o.value):n=n.concat(o.err)}if(n.length>0)return oe(n);let s={type:"object",properties:Object.fromEntries(r.map(o=>((0,em.default)(N.isOk(o.schema)),[o.key,o.schema.value]))),required:r.filter(o=>o.value.optional===!1&&!qi.is(o.value.value)).map(o=>o.key)};return ue.isSome(i)&&(s=Y(C({},s),{additionalProperties:i.value})),Le(s)}if(Dr.is(e)){let r=await Ja(t,e.spec);return N.isErr(r)?r:Le({type:"object",properties:{$kdsl:{const:{NamedType:await S1e(t,e)}},inner:r.value},required:["$kdsl","inner"]})}return oe([de.create({node:e,message:`cannot convert definition to JSONSchema: ${se(e)}`})])}var S1e=async(t,e)=>{let r=e.node;(0,em.default)(r);let n=t.svcs.shared.references.KumoriModules,i=Fe.getDocument(r).uri,s=t.svcs.references.KumoriPackages.GetPackage(r),o=t.mod.Current;if((0,em.default)(N.isOk(s)),i.scheme===N1)return{Import:s.value.uri.path.slice(1),Name:e.meta.name};if(!(await Hp(t.svcs.shared,t.mod.Root.Root)).map(p=>p.fsPath).includes(i.fsPath)){let p=n.getModule(i);(0,em.default)(N.isOk(p)),o=p.value}let f=o.Root,l=s.value.uri.fsPath.slice(f.fsPath.length);return{Import:wg.default.join(o.Manifest.module,l),Name:e.meta.name}};var Ag=ke(require("assert"),1),t8=ke(require("path"),1),r8=ke(require("fs/promises"),1);var PB={Register:E1e};function E1e(t,e){return t.command("gen").summary(T1e).description(C1e).argument("<target>",'Unique path of the kmodule where the artifact is defined. Accepts remote targets (e.g., "github.com/MyOrg/component@v1.2.3") or local paths (e.g. "/abs/path/to/module", "../rel/path/to/module").').argument("<package-path>",`Relative path to the package that contains the artifact (e.g., "internal/service"). For artifacts in the module's root package, use ".".`).argument("<artifact-name>",'Name of the target artifact (e.g., "ExampleService").').argument("<output-module-name>",'Name of the generated module (e.g., "example.com/my-org/module").').argument("<json>","Path to JSON file (TODO: use '-' to read from stdin).").helpOption(!0).action(k1e(e))}var T1e="generate deployments from an artifact jsonschema",C1e=`
648
+ Creates a new Kumori DSL module and initializes a deployment definition within
649
+ it, structured according to a provided JSON Schema. This command is designed to
650
+ streamline the creation of new kmodules that consume or instantiate artifacts
651
+ whose configuration and resource requirements are already defined by a schema.
652
+ `.trim();function k1e(t){return async(e,r,n,i,s)=>{var W;var D=[];try{let o=Ji(wn).Kumori;let a=te=>ra(t,te);let c=a(await Xb(e));let u=o.shared.workspace.FileSystemProvider;let f=a(N.mapErr(await kr(u,De.file(c.fsPath)),te=>[te]));a(await sa(t,o,f));let l=a(await eS(o,f,r,n));let p=await(0,RB.readFile)(s);let d=JSON.parse(p.toString("utf8"));let h=new AB.default({validateSchema:!1,allErrors:!0});let g=h.compile(l);let v=g(d);v||(((W=g.errors)!=null?W:[]).sort((re,we)=>{let Q=re.schemaPath.localeCompare(we.schemaPath);return Q!=0?Q:re.dataPath.localeCompare(we.dataPath)}),console.log(JSON.stringify(g.errors,null,4)),process.exit(1));let b=(()=>{switch(c.$type){case"local":return{target:f.Current.Manifest.module,version:"0.0.0"};case"remote":return(0,Ag.default)(ue.isSome(c.query.Version)),{target:f.Current.Manifest.module,version:c.query.Version.value}}})();let _=jg(D,await Qv(),!0);let x={spec:"kumori/module/v1",kumori:"0.0.1",version:"0.0.1",module:i,requires:[b]};let T=t8.default.join(_.Path,xr);await r8.default.writeFile(T,JSON.stringify(x,null,4));let R=[{Alias:"ImportAlias0",Path:t8.default.join(b.target,r)}];let V=[];let $=0;let K=te=>V.push(te);K("deployment {");K(`
653
+ `+Zc);K(`name "${i}"`);K(`
654
+ `+Zc);K(`artifact ImportAlias0.${n}`);K(`
655
+ `+Zc);K("resilience 0");K(`
656
+ `+Zc);K(A1e({imports:R},d,$+1));K(`}
657
+ `);let z=[`import (
658
+ `+R.map(te=>`${Zc}${te.Alias} "${te.Path}"`).join(`
659
+ `)+`
660
+ )
661
+
662
+ `].concat(V).join("");await r8.default.writeFile(t8.default.join(_.Path,"main.kumori"),z);await r8.default.cp(_.Path,".",{recursive:!0})}catch(P){var M=P,j=!0}finally{var J=Ug(D,M,j);J&&await J}}}var w1e=k.object({$kdsl:k.object({NamedType:k.object({Import:k.string(),Name:k.string()})}),inner:k.any()}),Zc=" ";function A1e(t,e,r=0){let n=Y(C({},t),{parts:[],skipScope:!0});return tS(n,e,r),n.parts.join("")}function tS(t,e,r=0){let n=a=>t.parts.push(a);switch(typeof e){case"number":n(e.toString());return;case"string":n(`"${e}"`);return;case"boolean":n(e?"true":"false");return}(0,Ag.default)(typeof e=="object"),(0,Ag.default)(e!==null);let i=Y(C({},t),{skipScope:!1}),s=w1e.safeParse(e);if(s.success){let a=t.imports.find(c=>c.Path===s.data.$kdsl.NamedType.Import);a||t.imports.push({Path:s.data.$kdsl.NamedType.Import,Alias:"ImportAlias"+t.imports.length}),a=t.imports.find(c=>c.Path===s.data.$kdsl.NamedType.Import),(0,Ag.default)(a),n(`${a.Alias}.${s.data.$kdsl.NamedType.Name}(`),tS(i,s.data.inner,r),n(")");return}let o=Object.entries(e);for(t.skipScope||(n("{"),o.length&&n(`
663
+ ${Zc.repeat(r)}`));o.length>0;){let[a,c]=o.pop();n(`${a} `),tS(i,c,r+1),o.length?n(`
664
+ ${Zc.repeat(r)}`):n(`
665
+ ${Zc.repeat(r-1)}`)}t.skipScope||n("}")}var NB={Register:R1e};function R1e(t,e){let r=t.command("schema").alias("s").summary(P1e).description(N1e).helpCommand(!1).helpOption(!1);return PB.Register(r,e),wB.Register(r,e),r}var P1e="jsonschema processing",N1e=`
666
+ The schema command provides utilities for working with JSON Schemas of Kumori DSL artifacts.
667
+ `.trim();var O1e="generate checksum for a module",I1e=`
668
+ Generates and outputs the sha-256 checksum for the current given module.
669
+ `.trim(),OB={Register:D1e};function D1e(t){return t.command("checksum").summary(O1e).description(I1e).helpOption(!0).action(L1e())}function L1e(){return async()=>{let e=Ji(wn).Kumori.shared.workspace.FileSystemProvider,r=await kr(e,De.file(process.cwd()));if(N.isErr(r))throw new Error(r.err);let n=await $p(r.value.Current.Root.fsPath);console.log(n)}}var n8=require("fs/promises");var Rg=ke(require("path"),1),IB={Register:$1e};function $1e(t,e){return t.command("update").summary(M1e).option("-v, --version <version>","new module version").option("-p, --path <location>","location where the module to update is located - defaults to the current directory").option("-c, --cacheLocation <cacheLocation>","new cache location").description(F1e).helpOption(!0).action(V1e(e))}var M1e="updates an existing kumori module's version or cache location",F1e=`
670
+ This command updates an existing Kumori module's version or cache location in the kumori.mod.json file. It is required to provide the new version and optionally
671
+ a new cache location for the module.
672
+
673
+ kdsl mod update -v 1.0.0
674
+
675
+ You could as well provide a new location for the module's local cache,
676
+ where all the dependencies will be downloaded.
677
+
678
+ kdsl mod update -v 1.0.0 -c ./my-mod-cache
679
+
680
+ If the module is not located in the current directory, you can provide a custom location path.
681
+
682
+ kdsl mod update -v 1.0.0 -p ./my-module
683
+ `.trim();function V1e(t){return async e=>{await j1e(t,process.cwd(),e)}}var j1e=async(t,e,r)=>{var f,l,p;let n=wn.fileSystemProvider(),i=(f=r.path)!=null?f:e;Rg.default.isAbsolute(i)||(i=Rg.default.join(e,i));let s=await wl(n,De.file(i));ue.isSome(s)&&s.value.fsPath===i&&(t.error(`error: module ${i} already exists`),process.exit(1));let o=await n.readFile(De.file(Rg.default.join(i,xr))),a=JSON.parse(o),c={spec:"kumori/module/v1",kumori:"0.0.1",version:(l=r.version)!=null?l:a.version,module:a.module,cacheLocation:(p=r.cacheLocation)!=null?p:a.cacheLocation,requires:[]},u=Rg.default.join(i,xr);await(0,n8.mkdir)(i,{recursive:!0}),await(0,n8.writeFile)(u,JSON.stringify(c,null,4)),t.info(`updated ${xr}: module ${c.module}`)};var DB={Register:U1e};function U1e(t,e){let r=t.command("mod").summary(q1e).description(B1e).helpCommand(!1).helpOption(!1);return xB.Register(r,e),fB.Register(r,e),CB.Register(r,e),NB.Register(r,e),OB.Register(r),IB.Register(r,e),r}var q1e="module maintenance",B1e=`
684
+ Provides access to operations on modules.
685
+ `.trim();var LB={name:"@kumori/kdsl",version:"0.0.6",private:!1,files:["bin","out"],type:"module",description:"Kumori DSL command line interface",bin:{kdsl:"bin/cli.js"},scripts:{build:"npm run fix && tsc -b tsconfig.json && node esbuild.mjs --minify",test:"vitest run",clean:"rm -rf dist/ out/ tsconfig.tsbuildinfo",prepublishOnly:"npm run build",lint:"eslint .",prettier:"prettier src/ test/ --write",fix:"npm run lint && npm run prettier"},dependencies:{"@commander-js/extra-typings":"^13.1.0","@kumori/kdsl-lsp":"file:../lsp",ajv:"^6.12.6",chalk:"~5.3.0",commander:"~13.1.0",zod:"^3.24.2"},license:"EUPL",keywords:["cli","tool","automation","kumori","dsl"],gitHead:"89bea74c68de5f90f37ccc0e64b340408c90b76d",devDependencies:{"@eslint/js":"^9.35.0",eslint:"^9.35.0",globals:"^16.4.0",jiti:"^2.5.1",prettier:"3.6.2","typescript-eslint":"^8.44.0"}};var z1e="<unknown>",$B,W1e=($B=LB.version)!=null?$B:z1e,MB=W1e;var FB={Register:K1e};function K1e(t,e){return t.command("add").argument("<selector>","Name selector for matching dependencies").argument("<version>","Version of the registry specification. It is a git tag.").argument("<url>","URL that contains the registry index for resolving modules").summary(G1e).description(J1e).action(Q1e(e))}var G1e=`
686
+ add a new registry
687
+ `.trim(),J1e=`
688
+ Add a registry to the resolver configuration. The selector argument is used to match artifacts.
689
+ For example, a registry with Index URL "https://github.com/kumori" and selector "kumori.systems" will
690
+ resolve dependencies starting with "kumori.systems", such as "kumori.systems/postgresql@1.0.0" to
691
+ "https://github.com/kumori/postregsql@1.0.0" to then download the requested artifacts.
692
+
693
+ In practice, at https://github.com/kumori there will be an index file that contains all the supported
694
+ modules and its versions. Each module entry will then contain the actual route to download the artifacts.
695
+ Since index files are stored in a git repository, versioning is supported via git tags.
696
+
697
+ Selectors do not have to be fully qualified domain names. They could be plain strings like "mycompany" to match.
698
+ The given selector will attempt to match the beginning of the requested dependency name.
699
+
700
+ kdsl registry add myreg https://github.com/mycompany my-selector
701
+ `.trim();function Q1e(t){return async(e,r,n)=>{let i=new go,s={selector:e,version:r,indexUrl:n};try{i.add(s),t.info(`Registry '${e}' added at ${n}`)}catch(o){t.error(`Failed to add registry: ${o}`)}}}var VB={Register:Y1e};function Y1e(t,e){return t.command("list").summary(Z1e).description(X1e).action(ege(e))}var Z1e=`
702
+ list configured registries
703
+ `.trim(),X1e=`
704
+ List all configured registries
705
+ `.trim();function ege(t){return async()=>{let r=new go().list();t.info("Configured Registries:"),console.log(JSON.stringify(r,null,2))}}var jB={Register:tge};function tge(t,e){return t.command("remove").argument("<name>","Name of the registry to remove").summary(rge).description(nge).action(ige(e))}var rge=`
706
+ removes a configured registry
707
+ `.trim(),nge=`
708
+ Removes a configured registry by name
709
+ `.trim();function ige(t){return async e=>{let r=new go;try{r.remove(e),t.info(`Registry '${e}' removed`)}catch(n){t.error(`Failed to remove registry: ${n}`)}}}var UB={Register:sge};function sge(t,e){let r=t.command("registry").summary(oge).description(age);return FB.Register(r,e),VB.Register(r,e),jB.Register(r,e),r}var oge=`
710
+ Manages module resolution registries
711
+ `.trim(),age=`
712
+ Handles operations related to registries used to resolve modules. You can add, remove and list registries.
713
+ `.trim();var Ze=(t=>(t.info="info",t.warn="warn",t.error="error",t.debug="debug",t.trace="trace",t.fatal="fatal",t))(Ze||{}),Pg={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var Jn=(t=>(t.onBeforeDataOut="onBeforeDataOut",t.shouldSendToLogger="shouldSendToLogger",t.onMetadataCalled="onMetadataCalled",t.onBeforeMessageOut="onBeforeMessageOut",t.onContextCalled="onContextCalled",t))(Jn||{});var qB=class BB{constructor(){wt(this,"context",{});wt(this,"hasContext",!1)}setContext(e){if(!e){this.context={},this.hasContext=!1;return}this.context=e,this.hasContext=!0}appendContext(e){this.context=C(C({},this.context),e),this.hasContext=!0}getContext(){return this.context}hasContextData(){return this.hasContext}onChildLoggerCreated({parentContextManager:e,childContextManager:r}){if(e.hasContextData()){let n=e.getContext();r.setContext(C({},n))}}clone(){let e=new BB;return e.setContext(C({},this.context)),e.hasContext=this.hasContext,e}};var i8=class{constructor(t){wt(this,"id");wt(this,"logger");wt(this,"enabled");wt(this,"consoleDebug");var e,r,n;this.id=(e=t.id)!=null?e:Date.now().toString()+Math.random().toString(),this.logger=t.logger,this.enabled=(r=t.enabled)!=null?r:!0,this.consoleDebug=(n=t.consoleDebug)!=null?n:!1}_sendToLogger(t){if(!this.enabled)return;let e=this.shipToLogger(t);if(this.consoleDebug)switch(t.logLevel){case Ze.info:console.info(...e);break;case Ze.warn:console.warn(...e);break;case Ze.error:console.error(...e);break;case Ze.trace:console.debug(...e);break;case Ze.debug:console.debug(...e);break;case Ze.fatal:console.debug(...e);break;default:console.log(...e)}}getLoggerInstance(){return this.logger}};var HB=class{constructor(t){wt(this,"err");wt(this,"metadata");wt(this,"structuredLogger");wt(this,"hasMetadata");wt(this,"pluginManager");this.err=null,this.metadata={},this.structuredLogger=t,this.hasMetadata=!1,this.pluginManager=t.pluginManager}withMetadata(t){let{pluginManager:e,structuredLogger:{_config:{consoleDebug:r}}}=this;if(!t)return r&&console.debug("[LogLayer] withMetadata was called with no metadata; dropping."),this;let n=t;return e.hasPlugins(Jn.onMetadataCalled)&&(n=e.runOnMetadataCalled(t,this.structuredLogger),!n)?(r&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value."),this):(this.metadata=C(C({},this.metadata),n),this.hasMetadata=!0,this)}withError(t){return this.err=t,this}info(...t){this.structuredLogger.isLevelEnabled(Ze.info)&&(this.structuredLogger._formatMessage(t),this.formatLog(Ze.info,t))}warn(...t){this.structuredLogger.isLevelEnabled(Ze.warn)&&(this.structuredLogger._formatMessage(t),this.formatLog(Ze.warn,t))}error(...t){this.structuredLogger.isLevelEnabled(Ze.error)&&(this.structuredLogger._formatMessage(t),this.formatLog(Ze.error,t))}debug(...t){this.structuredLogger.isLevelEnabled(Ze.debug)&&(this.structuredLogger._formatMessage(t),this.formatLog(Ze.debug,t))}trace(...t){this.structuredLogger.isLevelEnabled(Ze.trace)&&(this.structuredLogger._formatMessage(t),this.formatLog(Ze.trace,t))}fatal(...t){this.structuredLogger.isLevelEnabled(Ze.fatal)&&(this.structuredLogger._formatMessage(t),this.formatLog(Ze.fatal,t))}disableLogging(){return this.structuredLogger.disableLogging(),this}enableLogging(){return this.structuredLogger.enableLogging(),this}formatLog(t,e){let{muteMetadata:r}=this.structuredLogger._config,n=r?!1:this.hasMetadata;this.structuredLogger._formatLog({logLevel:t,params:e,metadata:n?this.metadata:null,err:this.err})}},cge=[Jn.onBeforeDataOut,Jn.onMetadataCalled,Jn.shouldSendToLogger,Jn.onBeforeMessageOut,Jn.onContextCalled],zB=class{constructor(t){wt(this,"idToPlugin");wt(this,"onBeforeDataOut",[]);wt(this,"shouldSendToLogger",[]);wt(this,"onMetadataCalled",[]);wt(this,"onBeforeMessageOut",[]);wt(this,"onContextCalled",[]);this.idToPlugin={},this.mapPlugins(t),this.indexPlugins()}mapPlugins(t){for(let e of t){if(e.id||(e.id=Date.now().toString()+Math.random().toString()),this.idToPlugin[e.id])throw new Error(`[LogLayer] Plugin with id ${e.id} already exists.`);e.registeredAt=Date.now(),this.idToPlugin[e.id]=e}}indexPlugins(){this.onBeforeDataOut=[],this.shouldSendToLogger=[],this.onMetadataCalled=[],this.onBeforeMessageOut=[],this.onContextCalled=[];let t=Object.values(this.idToPlugin).sort((e,r)=>e.registeredAt-r.registeredAt);for(let e of t){if(e.disabled)return;for(let r of cge)e[r]&&e.id&&this[r].push(e.id)}}hasPlugins(t){return this[t].length>0}countPlugins(t){return t?this[t].length:Object.keys(this.idToPlugin).length}addPlugins(t){this.mapPlugins(t),this.indexPlugins()}enablePlugin(t){let e=this.idToPlugin[t];e&&(e.disabled=!1),this.indexPlugins()}disablePlugin(t){let e=this.idToPlugin[t];e&&(e.disabled=!0),this.indexPlugins()}removePlugin(t){delete this.idToPlugin[t],this.indexPlugins()}runOnBeforeDataOut(t,e){let r=C({},t);for(let n of this.onBeforeDataOut){let i=this.idToPlugin[n];if(i.onBeforeDataOut){let s=i.onBeforeDataOut({data:r.data,logLevel:r.logLevel},e);s&&(r.data||(r.data={}),Object.assign(r.data,s))}}return r.data}runShouldSendToLogger(t,e){return!this.shouldSendToLogger.some(r=>{var i;let n=this.idToPlugin[r];return!((i=n.shouldSendToLogger)!=null&&i.call(n,t,e))})}runOnMetadataCalled(t,e){var n;let r=C({},t);for(let i of this.onMetadataCalled){let s=this.idToPlugin[i],o=(n=s.onMetadataCalled)==null?void 0:n.call(s,r,e);if(o)r=o;else return null}return r}runOnBeforeMessageOut(t,e){var n;let r=[...t.messages];for(let i of this.onBeforeMessageOut){let s=this.idToPlugin[i],o=(n=s.onBeforeMessageOut)==null?void 0:n.call(s,{messages:r,logLevel:t.logLevel},e);o&&(r=o)}return r}runOnContextCalled(t,e){var n;let r=C({},t);for(let i of this.onContextCalled){let s=this.idToPlugin[i],o=(n=s.onContextCalled)==null?void 0:n.call(s,r,e);if(o)r=o;else return null}return r}},WB=class KB{constructor(e){wt(this,"pluginManager");wt(this,"idToTransport");wt(this,"hasMultipleTransports");wt(this,"singleTransport");wt(this,"contextManager");wt(this,"logLevelEnabledStatus",{info:!0,warn:!0,error:!0,debug:!0,trace:!0,fatal:!0});wt(this,"_config");var r;this._config=Y(C({},e),{enabled:(r=e.enabled)!=null?r:!0}),this._config.enabled||this.disableLogging(),this.contextManager=new qB,this.pluginManager=new zB(e.plugins||[]),this._config.errorFieldName||(this._config.errorFieldName="err"),this._config.copyMsgOnOnlyError||(this._config.copyMsgOnOnlyError=!1),this._initializeTransports(this._config.transport)}withContextManager(e){return this.contextManager&&typeof this.contextManager[Symbol.dispose]=="function"&&this.contextManager[Symbol.dispose](),this.contextManager=e,this}getContextManager(){return this.contextManager}_initializeTransports(e){if(this.idToTransport)for(let r in this.idToTransport)this.idToTransport[r]&&typeof this.idToTransport[r][Symbol.dispose]=="function"&&this.idToTransport[r][Symbol.dispose]();this.hasMultipleTransports=Array.isArray(e)&&e.length>1,this.singleTransport=this.hasMultipleTransports?null:Array.isArray(e)?e[0]:e,Array.isArray(e)?this.idToTransport=e.reduce((r,n)=>(r[n.id]=n,r),{}):this.idToTransport={[e.id]:e}}withPrefix(e){let r=this.child();return r._config.prefix=e,r}withContext(e){let r=e;return e?this.pluginManager.hasPlugins(Jn.onContextCalled)&&(r=this.pluginManager.runOnContextCalled(e,this),!r)?(this._config.consoleDebug&&console.debug("[LogLayer] Context was dropped due to plugin returning falsy value."),this):(this.contextManager.appendContext(r),this):(this._config.consoleDebug&&console.debug("[LogLayer] withContext was called with no context; dropping."),this)}clearContext(){return this.contextManager.setContext(void 0),this}getContext(){return this.contextManager.getContext()}addPlugins(e){this.pluginManager.addPlugins(e)}enablePlugin(e){this.pluginManager.enablePlugin(e)}disablePlugin(e){this.pluginManager.disablePlugin(e)}removePlugin(e){this.pluginManager.removePlugin(e)}withMetadata(e){return new HB(this).withMetadata(e)}withError(e){return new HB(this).withError(e)}child(){let e=Y(C({},this._config),{transport:Array.isArray(this._config.transport)?[...this._config.transport]:this._config.transport}),r=new KB(e).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone());return this.contextManager.onChildLoggerCreated({parentContextManager:this.contextManager,childContextManager:r.contextManager,parentLogger:this,childLogger:r}),r}withFreshTransports(e){return this._config.transport=e,this._initializeTransports(e),this}withFreshPlugins(e){return this._config.plugins=e,this.pluginManager=new zB(e),this}withPluginManager(e){return this.pluginManager=e,this}errorOnly(e,r){let n=(r==null?void 0:r.logLevel)||Ze.error;if(!this.isLevelEnabled(n))return;let{copyMsgOnOnlyError:i}=this._config,s={logLevel:n,err:e};(i&&(r==null?void 0:r.copyMsg)!==!1||(r==null?void 0:r.copyMsg)===!0)&&(e!=null&&e.message)&&(s.params=[e.message]),this._formatLog(s)}metadataOnly(e,r=Ze.info){if(!this.isLevelEnabled(r))return;let{muteMetadata:n,consoleDebug:i}=this._config;if(n)return;if(!e){i&&console.debug("[LogLayer] metadataOnly was called with no metadata; dropping.");return}let s=e;if(this.pluginManager.hasPlugins(Jn.onMetadataCalled)&&(s=this.pluginManager.runOnMetadataCalled(e,this),!s)){i&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return}let o={logLevel:r,metadata:s};this._formatLog(o)}info(...e){this.isLevelEnabled(Ze.info)&&(this._formatMessage(e),this._formatLog({logLevel:Ze.info,params:e}))}warn(...e){this.isLevelEnabled(Ze.warn)&&(this._formatMessage(e),this._formatLog({logLevel:Ze.warn,params:e}))}error(...e){this.isLevelEnabled(Ze.error)&&(this._formatMessage(e),this._formatLog({logLevel:Ze.error,params:e}))}debug(...e){this.isLevelEnabled(Ze.debug)&&(this._formatMessage(e),this._formatLog({logLevel:Ze.debug,params:e}))}trace(...e){this.isLevelEnabled(Ze.trace)&&(this._formatMessage(e),this._formatLog({logLevel:Ze.trace,params:e}))}fatal(...e){this.isLevelEnabled(Ze.fatal)&&(this._formatMessage(e),this._formatLog({logLevel:Ze.fatal,params:e}))}disableLogging(){for(let e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!1;return this}enableLogging(){for(let e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!0;return this}muteContext(){return this._config.muteContext=!0,this}unMuteContext(){return this._config.muteContext=!1,this}muteMetadata(){return this._config.muteMetadata=!0,this}unMuteMetadata(){return this._config.muteMetadata=!1,this}enableIndividualLevel(e){let r=e;return r in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[r]=!0),this}disableIndividualLevel(e){let r=e;return r in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[r]=!1),this}setLevel(e){let r=Pg[e];for(let n of Object.values(Ze)){let i=n,s=Pg[n];this.logLevelEnabledStatus[i]=s>=r}return this}isLevelEnabled(e){let r=e;return this.logLevelEnabledStatus[r]}formatContext(){let{contextFieldName:e,muteContext:r}=this._config,n=this.contextManager.getContext();return this.contextManager.hasContextData()&&!r?e?{[e]:C({},n)}:C({},n):{}}formatMetadata(e=null){let{metadataFieldName:r,muteMetadata:n}=this._config;return e&&!n?r?{[r]:C({},e)}:C({},e):{}}getLoggerInstance(e){let r=this.idToTransport[e];if(r)return r.getLoggerInstance()}_formatMessage(e=[]){let{prefix:r}=this._config;r&&typeof e[0]=="string"&&(e[0]=`${r} ${e[0]}`)}_formatLog({logLevel:e,params:r=[],metadata:n=null,err:i}){var d;let{errorSerializer:s,errorFieldInMetadata:o,muteContext:a,contextFieldName:c,metadataFieldName:u,errorFieldName:f}=this._config,l=!!n||(a?!1:this.contextManager.hasContextData()),p={};if(l)if(c&&c===u){let h=this.formatContext()[c],g=this.formatMetadata(n)[u];p={[c]:C(C({},h),g)}}else p=C(C({},this.formatContext()),this.formatMetadata(n));if(i){let h=s?s(i):i;o&&n?n[f]=h:o&&!n&&u?p=Y(C({},p),{[u]:{[f]:h}}):p=Y(C({},p),{[f]:h}),l=!0}if(this.pluginManager.hasPlugins(Jn.onBeforeDataOut)&&(p=this.pluginManager.runOnBeforeDataOut({data:l?p:void 0,logLevel:e},this),p&&!l&&(l=!0)),this.pluginManager.hasPlugins(Jn.onBeforeMessageOut)&&(r=this.pluginManager.runOnBeforeMessageOut({messages:[...r],logLevel:e},this)),this.hasMultipleTransports){let h=this._config.transport.filter(g=>g.enabled).map(async g=>{if(!(this.pluginManager.hasPlugins(Jn.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...r],data:l?p:void 0,logLevel:e,transportId:g.id},this)))return g._sendToLogger({logLevel:e,messages:[...r],data:l?p:void 0,hasData:l})});Promise.all(h).catch(g=>{this._config.consoleDebug&&console.error("[LogLayer] Error executing transports:",g)})}else{if(!((d=this.singleTransport)!=null&&d.enabled)||this.pluginManager.hasPlugins(Jn.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...r],data:l?p:void 0,logLevel:e,transportId:this.singleTransport.id},this))return;this.singleTransport._sendToLogger({logLevel:e,messages:[...r],data:l?p:void 0,hasData:l})}}};var GB=class extends i8{shipToLogger({logLevel:t,messages:e,data:r,hasData:n}){switch(r&&n&&e.push(r),t){case Ze.info:this.logger.info(...e);break;case Ze.warn:this.logger.warn(...e);break;case Ze.error:this.logger.error(...e);break;case Ze.trace:this.logger.trace(...e);break;case Ze.debug:this.logger.debug(...e);break;case Ze.fatal:this.logger.fatal(...e);break}return e}};var rS={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],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],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[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],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function Ng(t,e,r,n=!1){let i=String(e),s=(c,u)=>`\x1B[${u[0]}m${c}\x1B[${u[1]}m`,o=(c,u)=>u!=null&&typeof u=="string"?s(c,rS[u]):u!=null&&Array.isArray(u)?u.reduce((f,l)=>o(f,l),c):u!=null&&u[c.trim()]!=null?o(c,u[c.trim()]):u!=null&&u["*"]!=null?o(c,u["*"]):c,a=null;return i.replace(/{{(.+?)}}/g,(c,u)=>{var l,p;let f=r[u]!=null?String(r[u]):n?"":c;return t.stylePrettyLogs?o(f,(p=(l=t==null?void 0:t.prettyLogStyles)==null?void 0:l[u])!=null?p:a)+s("",rS.reset):f})}function Ss(t,e=2,r=0){return t!=null&&isNaN(t)?"":(t=t!=null?t+r:t,e===2?t==null?"--":t<10?"0"+t:t.toString():t==null?"---":t<10?"00"+t:t<100?"0"+t:t.toString())}function JB(t){return{href:t.href,protocol:t.protocol,username:t.username,password:t.password,host:t.host,hostname:t.hostname,port:t.port,pathname:t.pathname,search:t.search,searchParams:[...t.searchParams].map(([e,r])=>({key:e,value:r})),hash:t.hash,origin:t.origin}}var nS=require("os"),QB=require("path"),Og=require("util");var YB={getCallerStackFrame:ZB,getErrorTrace:XB,getMeta:lge,transportJSON:pge,transportFormatted:dge,isBuffer:mge,isError:tH,prettyFormatLogObj:fge,prettyFormatErrorObj:rH},uge={runtime:"Nodejs",runtimeVersion:process==null?void 0:process.version,hostname:nS.hostname?(0,nS.hostname)():void 0};function lge(t,e,r,n,i,s){return Object.assign({},uge,{name:i,parentNames:s,date:new Date,logLevelId:t,logLevelName:e,path:n?void 0:ZB(r)})}function ZB(t,e=Error()){var r,n,i;return eH((i=(n=(r=e==null?void 0:e.stack)==null?void 0:r.split(`
714
+ `))==null?void 0:n.filter(s=>s.includes(" at ")))==null?void 0:i[t])}function XB(t){var e,r;return(r=(e=t==null?void 0:t.stack)==null?void 0:e.split(`
715
+ `))==null?void 0:r.reduce((n,i)=>(i.includes(" at ")&&n.push(eH(i)),n),[])}function eH(t){var r,n,i,s;let e={fullFilePath:void 0,fileName:void 0,fileNameWithLine:void 0,fileColumn:void 0,fileLine:void 0,filePath:void 0,filePathWithLine:void 0,method:void 0};if(t!=null&&t.includes(" at ")){t=t.replace(/^\s+at\s+/gm,"");let o=t.split(" ("),a=(t==null?void 0:t.slice(-1))===")"?(r=t==null?void 0:t.match(/\(([^)]+)\)/))==null?void 0:r[1]:t,c=a!=null&&a.includes(":")?(i=(n=a==null?void 0:a.replace("file://",""))==null?void 0:n.replace(process.cwd(),""))==null?void 0:i.split(":"):void 0,u=c==null?void 0:c.pop(),f=c==null?void 0:c.pop(),l=c==null?void 0:c.pop(),p=(0,QB.normalize)(`${l}:${f}`),d=(s=l==null?void 0:l.split("/"))==null?void 0:s.pop(),h=`${d}:${f}`;l!=null&&l.length>0&&(e.fullFilePath=a,e.fileName=d,e.fileNameWithLine=h,e.fileColumn=u,e.fileLine=f,e.filePath=l,e.filePathWithLine=p,e.method=(o==null?void 0:o[1])!=null?o==null?void 0:o[0]:void 0)}return e}function tH(t){var e;return((e=Og.types)==null?void 0:e.isNativeError)!=null?Og.types.isNativeError(t):t instanceof Error}function fge(t,e){return t.reduce((r,n)=>(tH(n)?r.errors.push(rH(n,e)):r.args.push(n),r),{args:[],errors:[]})}function rH(t,e){let r=XB(t).map(i=>Ng(e,e.prettyErrorStackTemplate,C({},i),!0)),n={errorName:` ${t.name} `,errorMessage:Object.getOwnPropertyNames(t).reduce((i,s)=>(s!=="stack"&&i.push(t[s]),i),[]).join(", "),errorStack:r.join(`
716
+ `)};return Ng(e,e.prettyErrorTemplate,n)}function dge(t,e,r,n){let i=(r.length>0&&e.length>0?`
717
+ `:"")+r.join(`
718
+ `);n.prettyInspectOptions.colors=n.stylePrettyLogs,console.log(t+(0,Og.formatWithOptions)(n.prettyInspectOptions,...e)+i)}function pge(t){console.log(e(t));function e(r){let n=new Set;return JSON.stringify(r,(i,s)=>{if(typeof s=="object"&&s!==null){if(n.has(s))return"[Circular]";n.add(s)}return typeof s=="bigint"?`${s}`:typeof s=="undefined"?"[undefined]":s})}}function mge(t){return Buffer.isBuffer(t)}var s8=class{constructor(e,r,n=4){var i,s,o,a,c,u,f,l,p,d,h,g,v,b,_,x,T,R,V,$,K,z,W,D,P,M;this.logObj=r,this.stackDepthLevel=n,this.runtime=YB,this.settings={type:(i=e==null?void 0:e.type)!=null?i:"pretty",name:e==null?void 0:e.name,parentNames:e==null?void 0:e.parentNames,minLevel:(s=e==null?void 0:e.minLevel)!=null?s:0,argumentsArrayName:e==null?void 0:e.argumentsArrayName,hideLogPositionForProduction:(o=e==null?void 0:e.hideLogPositionForProduction)!=null?o:!1,prettyLogTemplate:(a=e==null?void 0:e.prettyLogTemplate)!=null?a:"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} {{filePathWithLine}}{{nameWithDelimiterPrefix}} ",prettyErrorTemplate:(c=e==null?void 0:e.prettyErrorTemplate)!=null?c:`
719
+ {{errorName}} {{errorMessage}}
720
+ error stack:
721
+ {{errorStack}}`,prettyErrorStackTemplate:(u=e==null?void 0:e.prettyErrorStackTemplate)!=null?u:` \u2022 {{fileName}} {{method}}
722
+ {{filePathWithLine}}`,prettyErrorParentNamesSeparator:(f=e==null?void 0:e.prettyErrorParentNamesSeparator)!=null?f:":",prettyErrorLoggerNameDelimiter:(l=e==null?void 0:e.prettyErrorLoggerNameDelimiter)!=null?l:" ",stylePrettyLogs:(p=e==null?void 0:e.stylePrettyLogs)!=null?p:!0,prettyLogTimeZone:(d=e==null?void 0:e.prettyLogTimeZone)!=null?d:"UTC",prettyLogStyles:(h=e==null?void 0:e.prettyLogStyles)!=null?h:{logLevelName:{"*":["bold","black","bgWhiteBright","dim"],SILLY:["bold","white"],TRACE:["bold","whiteBright"],DEBUG:["bold","green"],INFO:["bold","blue"],WARN:["bold","yellow"],ERROR:["bold","red"],FATAL:["bold","redBright"]},dateIsoStr:"white",filePathWithLine:"white",name:["white","bold"],nameWithDelimiterPrefix:["white","bold"],nameWithDelimiterSuffix:["white","bold"],errorName:["bold","bgRedBright","whiteBright"],fileName:["yellow"],fileNameWithLine:"white"},prettyInspectOptions:(g=e==null?void 0:e.prettyInspectOptions)!=null?g:{colors:!0,compact:!1,depth:1/0},metaProperty:(v=e==null?void 0:e.metaProperty)!=null?v:"_meta",maskPlaceholder:(b=e==null?void 0:e.maskPlaceholder)!=null?b:"[***]",maskValuesOfKeys:(_=e==null?void 0:e.maskValuesOfKeys)!=null?_:["password"],maskValuesOfKeysCaseInsensitive:(x=e==null?void 0:e.maskValuesOfKeysCaseInsensitive)!=null?x:!1,maskValuesRegEx:e==null?void 0:e.maskValuesRegEx,prefix:[...(T=e==null?void 0:e.prefix)!=null?T:[]],attachedTransports:[...(R=e==null?void 0:e.attachedTransports)!=null?R:[]],overwrite:{mask:(V=e==null?void 0:e.overwrite)==null?void 0:V.mask,toLogObj:($=e==null?void 0:e.overwrite)==null?void 0:$.toLogObj,addMeta:(K=e==null?void 0:e.overwrite)==null?void 0:K.addMeta,addPlaceholders:(z=e==null?void 0:e.overwrite)==null?void 0:z.addPlaceholders,formatMeta:(W=e==null?void 0:e.overwrite)==null?void 0:W.formatMeta,formatLogObj:(D=e==null?void 0:e.overwrite)==null?void 0:D.formatLogObj,transportFormatted:(P=e==null?void 0:e.overwrite)==null?void 0:P.transportFormatted,transportJSON:(M=e==null?void 0:e.overwrite)==null?void 0:M.transportJSON}}}log(e,r,...n){var l,p,d,h,g,v,b,_,x,T,R,V,$,K;if(e<this.settings.minLevel)return;let i=[...this.settings.prefix,...n],s=((l=this.settings.overwrite)==null?void 0:l.mask)!=null?(p=this.settings.overwrite)==null?void 0:p.mask(i):this.settings.maskValuesOfKeys!=null&&this.settings.maskValuesOfKeys.length>0?this._mask(i):i,o=this.logObj!=null?this._recursiveCloneAndExecuteFunctions(this.logObj):void 0,a=((d=this.settings.overwrite)==null?void 0:d.toLogObj)!=null?(h=this.settings.overwrite)==null?void 0:h.toLogObj(s,o):this._toLogObj(s,o),c=((g=this.settings.overwrite)==null?void 0:g.addMeta)!=null?(v=this.settings.overwrite)==null?void 0:v.addMeta(a,e,r):this._addMetaToLogObj(a,e,r),u,f;return((b=this.settings.overwrite)==null?void 0:b.formatMeta)!=null&&(u=(_=this.settings.overwrite)==null?void 0:_.formatMeta(c==null?void 0:c[this.settings.metaProperty])),((x=this.settings.overwrite)==null?void 0:x.formatLogObj)!=null&&(f=(T=this.settings.overwrite)==null?void 0:T.formatLogObj(s,this.settings)),this.settings.type==="pretty"&&(u=u!=null?u:this._prettyFormatLogObjMeta(c==null?void 0:c[this.settings.metaProperty]),f=f!=null?f:this.runtime.prettyFormatLogObj(s,this.settings)),u!=null&&f!=null?((R=this.settings.overwrite)==null?void 0:R.transportFormatted)!=null?(V=this.settings.overwrite)==null||V.transportFormatted(u,f.args,f.errors,this.settings):this.runtime.transportFormatted(u,f.args,f.errors,this.settings):(($=this.settings.overwrite)==null?void 0:$.transportJSON)!=null?(K=this.settings.overwrite)==null||K.transportJSON(c):this.settings.type!=="hidden"&&this.runtime.transportJSON(c),this.settings.attachedTransports!=null&&this.settings.attachedTransports.length>0&&this.settings.attachedTransports.forEach(z=>{z(c)}),c}attachTransport(e){this.settings.attachedTransports.push(e)}getSubLogger(e,r){var s,o,a,c;let n=Y(C(C({},this.settings),e),{parentNames:((s=this.settings)==null?void 0:s.parentNames)!=null&&((o=this.settings)==null?void 0:o.name)!=null?[...this.settings.parentNames,this.settings.name]:((a=this.settings)==null?void 0:a.name)!=null?[this.settings.name]:void 0,prefix:[...this.settings.prefix,...(c=e==null?void 0:e.prefix)!=null?c:[]]});return new this.constructor(n,r!=null?r:this.logObj,this.stackDepthLevel)}_mask(e){let r=this.settings.maskValuesOfKeysCaseInsensitive!==!0?this.settings.maskValuesOfKeys:this.settings.maskValuesOfKeys.map(n=>n.toLowerCase());return e==null?void 0:e.map(n=>this._recursiveCloneAndMaskValuesOfKeys(n,r))}_recursiveCloneAndMaskValuesOfKeys(e,r,n=[]){var i,s;if(n.includes(e))return C({},e);if(typeof e=="object"&&e!==null&&n.push(e),this.runtime.isError(e)||this.runtime.isBuffer(e))return e;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(Array.isArray(e))return e.map(o=>this._recursiveCloneAndMaskValuesOfKeys(o,r,n));if(e instanceof Date)return new Date(e.getTime());if(e instanceof URL)return JB(e);if(e!==null&&typeof e=="object"){let o=this.runtime.isError(e)?this._cloneError(e):Object.create(Object.getPrototypeOf(e));return Object.getOwnPropertyNames(e).reduce((a,c)=>{var u;return a[c]=r.includes(((u=this.settings)==null?void 0:u.maskValuesOfKeysCaseInsensitive)!==!0?c:c.toLowerCase())?this.settings.maskPlaceholder:(()=>{try{return this._recursiveCloneAndMaskValuesOfKeys(e[c],r,n)}catch(f){return null}})(),a},o)}else{if(typeof e=="string"){let o=e;for(let a of((i=this.settings)==null?void 0:i.maskValuesRegEx)||[])o=o.replace(a,((s=this.settings)==null?void 0:s.maskPlaceholder)||"");return o}return e}}_recursiveCloneAndExecuteFunctions(e,r=[]){return this.isObjectOrArray(e)&&r.includes(e)?this.shallowCopy(e):(this.isObjectOrArray(e)&&r.push(e),Array.isArray(e)?e.map(n=>this._recursiveCloneAndExecuteFunctions(n,r)):e instanceof Date?new Date(e.getTime()):this.isObject(e)?Object.getOwnPropertyNames(e).reduce((n,i)=>{let s=Object.getOwnPropertyDescriptor(e,i);if(s){Object.defineProperty(n,i,s);let o=e[i];n[i]=typeof o=="function"?o():this._recursiveCloneAndExecuteFunctions(o,r)}return n},Object.create(Object.getPrototypeOf(e))):e)}isObjectOrArray(e){return typeof e=="object"&&e!==null}isObject(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}shallowCopy(e){return Array.isArray(e)?[...e]:C({},e)}_toLogObj(e,r={}){return e=e==null?void 0:e.map(n=>this.runtime.isError(n)?this._toErrorObject(n):n),this.settings.argumentsArrayName==null?e.length===1&&!Array.isArray(e[0])&&this.runtime.isBuffer(e[0])!==!0&&!(e[0]instanceof Date)?r=typeof e[0]=="object"&&e[0]!=null?C(C({},e[0]),r):C({0:e[0]},r):r=C(C({},r),e):r=Y(C({},r),{[this.settings.argumentsArrayName]:e}),r}_cloneError(e){let r=new e.constructor;return Object.getOwnPropertyNames(e).forEach(n=>{r[n]=e[n]}),r}_toErrorObject(e){var r;return{nativeError:e,name:(r=e.name)!=null?r:"Error",message:e.message,stack:this.runtime.getErrorTrace(e)}}_addMetaToLogObj(e,r,n){return Y(C({},e),{[this.settings.metaProperty]:this.runtime.getMeta(r,n,this.stackDepthLevel,this.settings.hideLogPositionForProduction,this.settings.name,this.settings.parentNames)})}_prettyFormatLogObjMeta(e){var o,a,c,u,f,l,p,d,h,g,v,b,_,x,T,R,V,$,K,z,W,D,P,M,j,J,te;if(e==null)return"";let r=this.settings.prettyLogTemplate,n={};r.includes("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}")?r=r.replace("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}","{{dateIsoStr}}"):this.settings.prettyLogTimeZone==="UTC"?(n.yyyy=(a=(o=e==null?void 0:e.date)==null?void 0:o.getUTCFullYear())!=null?a:"----",n.mm=Ss((c=e==null?void 0:e.date)==null?void 0:c.getUTCMonth(),2,1),n.dd=Ss((u=e==null?void 0:e.date)==null?void 0:u.getUTCDate(),2),n.hh=Ss((f=e==null?void 0:e.date)==null?void 0:f.getUTCHours(),2),n.MM=Ss((l=e==null?void 0:e.date)==null?void 0:l.getUTCMinutes(),2),n.ss=Ss((p=e==null?void 0:e.date)==null?void 0:p.getUTCSeconds(),2),n.ms=Ss((d=e==null?void 0:e.date)==null?void 0:d.getUTCMilliseconds(),3)):(n.yyyy=(g=(h=e==null?void 0:e.date)==null?void 0:h.getFullYear())!=null?g:"----",n.mm=Ss((v=e==null?void 0:e.date)==null?void 0:v.getMonth(),2,1),n.dd=Ss((b=e==null?void 0:e.date)==null?void 0:b.getDate(),2),n.hh=Ss((_=e==null?void 0:e.date)==null?void 0:_.getHours(),2),n.MM=Ss((x=e==null?void 0:e.date)==null?void 0:x.getMinutes(),2),n.ss=Ss((T=e==null?void 0:e.date)==null?void 0:T.getSeconds(),2),n.ms=Ss((R=e==null?void 0:e.date)==null?void 0:R.getMilliseconds(),3));let i=this.settings.prettyLogTimeZone==="UTC"?e==null?void 0:e.date:new Date(((V=e==null?void 0:e.date)==null?void 0:V.getTime())-(($=e==null?void 0:e.date)==null?void 0:$.getTimezoneOffset())*6e4);n.rawIsoStr=i==null?void 0:i.toISOString(),n.dateIsoStr=i==null?void 0:i.toISOString().replace("T"," ").replace("Z",""),n.logLevelName=e==null?void 0:e.logLevelName,n.fileNameWithLine=(z=(K=e==null?void 0:e.path)==null?void 0:K.fileNameWithLine)!=null?z:"",n.filePathWithLine=(D=(W=e==null?void 0:e.path)==null?void 0:W.filePathWithLine)!=null?D:"",n.fullFilePath=(M=(P=e==null?void 0:e.path)==null?void 0:P.fullFilePath)!=null?M:"";let s=(j=this.settings.parentNames)==null?void 0:j.join(this.settings.prettyErrorParentNamesSeparator);return s=s!=null&&(e==null?void 0:e.name)!=null?s+this.settings.prettyErrorParentNamesSeparator:void 0,n.name=(e==null?void 0:e.name)!=null||s!=null?(s!=null?s:"")+(e==null?void 0:e.name):"",n.nameWithDelimiterPrefix=n.name.length>0?this.settings.prettyErrorLoggerNameDelimiter+n.name:"",n.nameWithDelimiterSuffix=n.name.length>0?n.name+this.settings.prettyErrorLoggerNameDelimiter:"",((J=this.settings.overwrite)==null?void 0:J.addPlaceholders)!=null&&((te=this.settings.overwrite)==null||te.addPlaceholders(e,n)),Ng(this.settings,r,n)}};var o8=class extends s8{constructor(e,r){let n=typeof window!="undefined"&&typeof document!="undefined",i=n?window.chrome!==void 0&&window.CSS!==void 0&&window.CSS.supports("color","green"):!1,s=n?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1;e=e||{},e.stylePrettyLogs=e.stylePrettyLogs&&n&&!i?!1:e.stylePrettyLogs,super(e,r,s?4:5)}log(e,r,...n){return super.log(e,r,...n)}silly(...e){return super.log(0,"SILLY",...e)}trace(...e){return super.log(1,"TRACE",...e)}debug(...e){return super.log(2,"DEBUG",...e)}info(...e){return super.log(3,"INFO",...e)}warn(...e){return super.log(4,"WARN",...e)}error(...e){return super.log(5,"ERROR",...e)}fatal(...e){return super.log(6,"FATAL",...e)}getSubLogger(e,r){return super.getSubLogger(e,r)}};async function hge(){let t=new o8({type:"pretty",hideLogPositionForProduction:!0,overwrite:{transportFormatted:(n,i,s)=>console.error(n,...i,...s)}}),e=new WB({transport:new GB({logger:t})}),r=new kS("kdsl").version(MB);gB.Register(r,e),pB.Register(r,e),vB.Register(r,e),TB.Register(r),DB.Register(r,e),UB.Register(r,e),await new Promise(n=>{r.hook("postAction",()=>n()),r.parse()})}0&&(module.exports={main});
723
+ /*! Bundled license information:
724
+
725
+ uri-js/dist/es5/uri.all.js:
726
+ (** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
727
+
728
+ lodash-es/lodash.js:
729
+ (**
730
+ * @license
731
+ * Lodash (Custom Build) <https://lodash.com/>
732
+ * Build: `lodash modularize exports="es" -o ./`
733
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
734
+ * Released under MIT license <https://lodash.com/license>
735
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
736
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
737
+ *)
738
+ */