cf-to-dynamodb-schema
Version:
For DynamoDBLocal, Generate create-table json from aws cdk
28 lines (27 loc) • 72.9 kB
JavaScript
#!/usr/bin/env node
var un=Object.create,oe=Object.defineProperty;var cn=Object.getOwnPropertyDescriptor;var fn=Object.getOwnPropertyNames;var hn=Object.getPrototypeOf,pn=Object.prototype.hasOwnProperty;var dn=e=>oe(e,"__esModule",{value:!0});var L=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports);var mn=(e,i,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of fn(i))!pn.call(e,r)&&r!=="default"&&oe(e,r,{get:()=>i[r],enumerable:!(n=cn(i,r))||n.enumerable});return e},$=e=>mn(dn(oe(e!=null?un(hn(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var B=L(se=>{var le=class extends Error{constructor(i,n,r){super(r);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=i,this.nestedError=void 0}},Ie=class extends le{constructor(i){super(1,"commander.invalidArgument",i);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};se.CommanderError=le;se.InvalidArgumentError=Ie});var J=L(ae=>{var{InvalidArgumentError:gn}=B(),Ne=class{constructor(i,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,i[0]){case"<":this.required=!0,this._name=i.slice(1,-1);break;case"[":this.required=!1,this._name=i.slice(1,-1);break;default:this.required=!0,this._name=i;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(i,n){return n===this.defaultValue||!Array.isArray(n)?[i]:n.concat(i)}default(i,n){return this.defaultValue=i,this.defaultValueDescription=n,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(n,r)=>{if(!this.argChoices.includes(n))throw new gn(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,r):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function _n(e){let i=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+i+">":"["+i+"]"}ae.Argument=Ne;ae.humanReadableArgName=_n});var ue=L(De=>{var{humanReadableArgName:xn}=J(),Le=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(i){let n=i.commands.filter(r=>!r._hidden);if(i._hasImplicitHelpCommand()){let[,r,t]=i._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=i.createCommand(r).helpOption(!1);o.description(i._helpCommandDescription),t&&o.arguments(t),n.push(o)}return this.sortSubcommands&&n.sort((r,t)=>r.name().localeCompare(t.name())),n}visibleOptions(i){let n=i.options.filter(o=>!o.hidden),r=i._hasHelpOption&&i._helpShortFlag&&!i._findOption(i._helpShortFlag),t=i._hasHelpOption&&!i._findOption(i._helpLongFlag);if(r||t){let o;r?t?o=i.createOption(i._helpFlags,i._helpDescription):o=i.createOption(i._helpShortFlag,i._helpDescription):o=i.createOption(i._helpLongFlag,i._helpDescription),n.push(o)}if(this.sortOptions){let o=l=>l.short?l.short.replace(/^-/,""):l.long.replace(/^--/,"");n.sort((l,s)=>o(l).localeCompare(o(s)))}return n}visibleArguments(i){return i._argsDescription&&i._args.forEach(n=>{n.description=n.description||i._argsDescription[n.name()]||""}),i._args.find(n=>n.description)?i._args:[]}subcommandTerm(i){let n=i._args.map(r=>xn(r)).join(" ");return i._name+(i._aliases[0]?"|"+i._aliases[0]:"")+(i.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(i){return i.flags}argumentTerm(i){return i.name()}longestSubcommandTermLength(i,n){return n.visibleCommands(i).reduce((r,t)=>Math.max(r,n.subcommandTerm(t).length),0)}longestOptionTermLength(i,n){return n.visibleOptions(i).reduce((r,t)=>Math.max(r,n.optionTerm(t).length),0)}longestArgumentTermLength(i,n){return n.visibleArguments(i).reduce((r,t)=>Math.max(r,n.argumentTerm(t).length),0)}commandUsage(i){let n=i._name;i._aliases[0]&&(n=n+"|"+i._aliases[0]);let r="";for(let t=i.parent;t;t=t.parent)r=t.name()+" "+r;return r+n+" "+i.usage()}commandDescription(i){return i.description()}subcommandDescription(i){return i.description()}optionDescription(i){let n=[];return i.argChoices&&n.push(`choices: ${i.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),i.defaultValue!==void 0&&(i.required||i.optional||i.isBoolean()&&typeof i.defaultValue=="boolean")&&n.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),i.presetArg!==void 0&&i.optional&&n.push(`preset: ${JSON.stringify(i.presetArg)}`),i.envVar!==void 0&&n.push(`env: ${i.envVar}`),n.length>0?`${i.description} (${n.join(", ")})`:i.description}argumentDescription(i){let n=[];if(i.argChoices&&n.push(`choices: ${i.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),i.defaultValue!==void 0&&n.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),n.length>0){let r=`(${n.join(", ")})`;return i.description?`${i.description} ${r}`:r}return i.description}formatHelp(i,n){let r=n.padWidth(i,n),t=n.helpWidth||80,o=2,l=2;function s(m,_){if(_){let A=`${m.padEnd(r+l)}${_}`;return n.wrap(A,t-o,r+l)}return m}function a(m){return m.join(`
`).replace(/^/gm," ".repeat(o))}let u=[`Usage: ${n.commandUsage(i)}`,""],f=n.commandDescription(i);f.length>0&&(u=u.concat([f,""]));let c=n.visibleArguments(i).map(m=>s(n.argumentTerm(m),n.argumentDescription(m)));c.length>0&&(u=u.concat(["Arguments:",a(c),""]));let h=n.visibleOptions(i).map(m=>s(n.optionTerm(m),n.optionDescription(m)));h.length>0&&(u=u.concat(["Options:",a(h),""]));let d=n.visibleCommands(i).map(m=>s(n.subcommandTerm(m),n.subcommandDescription(m)));return d.length>0&&(u=u.concat(["Commands:",a(d),""])),u.join(`
`)}padWidth(i,n){return Math.max(n.longestOptionTermLength(i,n),n.longestSubcommandTermLength(i,n),n.longestArgumentTermLength(i,n))}wrap(i,n,r,t=40){if(i.match(/[\n]\s+/))return i;let o=n-r;if(o<t)return i;let l=i.substr(0,r),s=i.substr(r),a=" ".repeat(r),u=new RegExp(".{1,"+(o-1)+"}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)","g"),f=s.match(u)||[];return l+f.map((c,h)=>(c.slice(-1)===`
`&&(c=c.slice(0,c.length-1)),(h>0?a:"")+c.trimRight())).join(`
`)}};De.Help=Le});var fe=L(ce=>{var{InvalidArgumentError:An}=B(),He=class{constructor(i,n){this.flags=i,this.description=n||"",this.required=i.includes("<"),this.optional=i.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(i),this.mandatory=!1;let r=$e(i);this.short=r.shortFlag,this.long=r.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=[]}default(i,n){return this.defaultValue=i,this.defaultValueDescription=n,this}preset(i){return this.presetArg=i,this}conflicts(i){return this.conflictsWith=this.conflictsWith.concat(i),this}env(i){return this.envVar=i,this}argParser(i){return this.parseArg=i,this}makeOptionMandatory(i=!0){return this.mandatory=!!i,this}hideHelp(i=!0){return this.hidden=!!i,this}_concatValue(i,n){return n===this.defaultValue||!Array.isArray(n)?[i]:n.concat(i)}choices(i){return this.argChoices=i.slice(),this.parseArg=(n,r)=>{if(!this.argChoices.includes(n))throw new An(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,r):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return vn(this.name().replace(/^no-/,""))}is(i){return this.short===i||this.long===i}isBoolean(){return!this.required&&!this.optional&&!this.negate}};function vn(e){return e.split("-").reduce((i,n)=>i+n[0].toUpperCase()+n.slice(1))}function $e(e){let i,n,r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(i=r.shift()),n=r.shift(),!i&&/^-[^-]$/.test(n)&&(i=n,n=void 0),{shortFlag:i,longFlag:n}}ce.Option=He;ce.splitOptionFlags=$e});var Re=L(Pe=>{var Me=3;function Cn(e,i){if(Math.abs(e.length-i.length)>Me)return Math.max(e.length,i.length);let n=[];for(let r=0;r<=e.length;r++)n[r]=[r];for(let r=0;r<=i.length;r++)n[0][r]=r;for(let r=1;r<=i.length;r++)for(let t=1;t<=e.length;t++){let o=1;e[t-1]===i[r-1]?o=0:o=1,n[t][r]=Math.min(n[t-1][r]+1,n[t][r-1]+1,n[t-1][r-1]+o),t>1&&r>1&&e[t-1]===i[r-2]&&e[t-2]===i[r-1]&&(n[t][r]=Math.min(n[t][r],n[t-2][r-2]+1))}return n[e.length][i.length]}function yn(e,i){if(!i||i.length===0)return"";i=Array.from(new Set(i));let n=e.startsWith("--");n&&(e=e.slice(2),i=i.map(l=>l.slice(2)));let r=[],t=Me,o=.4;return i.forEach(l=>{if(l.length<=1)return;let s=Cn(e,l),a=Math.max(e.length,l.length);(a-s)/a>o&&(s<t?(t=s,r=[l]):s===t&&r.push(l))}),r.sort((l,s)=>l.localeCompare(s)),n&&(r=r.map(l=>`--${l}`)),r.length>1?`
(Did you mean one of ${r.join(", ")}?)`:r.length===1?`
(Did you mean ${r[0]}?)`:""}Pe.suggestSimilar=yn});var Ue=L(Ye=>{var bn=require("events").EventEmitter,he=require("child_process"),T=require("path"),pe=require("fs"),x=require("process"),{Argument:wn,humanReadableArgName:On}=J(),{CommanderError:de}=B(),{Help:En}=ue(),{Option:je,splitOptionFlags:Sn}=fe(),{suggestSimilar:Ve}=Re(),Q=class extends bn{constructor(i){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=i||"",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._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:n=>x.stdout.write(n),writeErr:n=>x.stderr.write(n),getOutHelpWidth:()=>x.stdout.isTTY?x.stdout.columns:void 0,getErrHelpWidth:()=>x.stderr.isTTY?x.stderr.columns:void 0,outputError:(n,r)=>r(n)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(i){return this._outputConfiguration=i._outputConfiguration,this._hasHelpOption=i._hasHelpOption,this._helpFlags=i._helpFlags,this._helpDescription=i._helpDescription,this._helpShortFlag=i._helpShortFlag,this._helpLongFlag=i._helpLongFlag,this._helpCommandName=i._helpCommandName,this._helpCommandnameAndArgs=i._helpCommandnameAndArgs,this._helpCommandDescription=i._helpCommandDescription,this._helpConfiguration=i._helpConfiguration,this._exitCallback=i._exitCallback,this._storeOptionsAsProperties=i._storeOptionsAsProperties,this._combineFlagAndOptionalValue=i._combineFlagAndOptionalValue,this._allowExcessArguments=i._allowExcessArguments,this._enablePositionalOptions=i._enablePositionalOptions,this._showHelpAfterError=i._showHelpAfterError,this._showSuggestionAfterError=i._showSuggestionAfterError,this}command(i,n,r){let t=n,o=r;typeof t=="object"&&t!==null&&(o=t,t=null),o=o||{};let[,l,s]=i.match(/([^ ]+) *(.*)/),a=this.createCommand(l);return t&&(a.description(t),a._executableHandler=!0),o.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(o.noHelp||o.hidden),a._executableFile=o.executableFile||null,s&&a.arguments(s),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),t?this:a}createCommand(i){return new Q(i)}createHelp(){return Object.assign(new En,this.configureHelp())}configureHelp(i){return i===void 0?this._helpConfiguration:(this._helpConfiguration=i,this)}configureOutput(i){return i===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,i),this)}showHelpAfterError(i=!0){return typeof i!="string"&&(i=!!i),this._showHelpAfterError=i,this}showSuggestionAfterError(i=!0){return this._showSuggestionAfterError=!!i,this}addCommand(i,n){if(!i._name)throw new Error(`Command passed to .addCommand() must have a name
- specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=i._name),(n.noHelp||n.hidden)&&(i._hidden=!0),this.commands.push(i),i.parent=this,this}createArgument(i,n){return new wn(i,n)}argument(i,n,r,t){let o=this.createArgument(i,n);return typeof r=="function"?o.default(t).argParser(r):o.default(r),this.addArgument(o),this}arguments(i){return i.split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(i){let n=this._args.slice(-1)[0];if(n&&n.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(i.required&&i.defaultValue!==void 0&&i.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${i.name()}'`);return this._args.push(i),this}addHelpCommand(i,n){return i===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof i=="string"&&(this._helpCommandName=i.split(" ")[0],this._helpCommandnameAndArgs=i),this._helpCommandDescription=n||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(i,n){let r=["preAction","postAction"];if(!r.includes(i))throw new Error(`Unexpected value for event passed to hook : '${i}'.
Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[i]?this._lifeCycleHooks[i].push(n):this._lifeCycleHooks[i]=[n],this}exitOverride(i){return i?this._exitCallback=i:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(i,n,r){this._exitCallback&&this._exitCallback(new de(i,n,r)),x.exit(i)}action(i){let n=r=>{let t=this._args.length,o=r.slice(0,t);return this._storeOptionsAsProperties?o[t]=this:o[t]=this.opts(),o.push(this),i.apply(this,o)};return this._actionHandler=n,this}createOption(i,n){return new je(i,n)}addOption(i){let n=i.name(),r=i.attributeName();if(i.negate){let o=i.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(r,i.defaultValue===void 0?!0:i.defaultValue,"default")}else i.defaultValue!==void 0&&this.setOptionValueWithSource(r,i.defaultValue,"default");this.options.push(i);let t=(o,l,s)=>{o==null&&i.presetArg!==void 0&&(o=i.presetArg);let a=this.getOptionValue(r);if(o!==null&&i.parseArg)try{o=i.parseArg(o,a)}catch(u){if(u.code==="commander.invalidArgument"){let f=`${l} ${u.message}`;this.error(f,{exitCode:u.exitCode,code:u.code})}throw u}else o!==null&&i.variadic&&(o=i._concatValue(o,a));o==null&&(i.negate?o=!1:i.isBoolean()||i.optional?o=!0:o=""),this.setOptionValueWithSource(r,o,s)};return this.on("option:"+n,o=>{let l=`error: option '${i.flags}' argument '${o}' is invalid.`;t(o,l,"cli")}),i.envVar&&this.on("optionEnv:"+n,o=>{let l=`error: option '${i.flags}' value '${o}' from env '${i.envVar}' is invalid.`;t(o,l,"env")}),this}_optionEx(i,n,r,t,o){if(typeof n=="object"&&n instanceof je)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let l=this.createOption(n,r);if(l.makeOptionMandatory(!!i.mandatory),typeof t=="function")l.default(o).argParser(t);else if(t instanceof RegExp){let s=t;t=(a,u)=>{let f=s.exec(a);return f?f[0]:u},l.default(o).argParser(t)}else l.default(t);return this.addOption(l)}option(i,n,r,t){return this._optionEx({},i,n,r,t)}requiredOption(i,n,r,t){return this._optionEx({mandatory:!0},i,n,r,t)}combineFlagAndOptionalValue(i=!0){return this._combineFlagAndOptionalValue=!!i,this}allowUnknownOption(i=!0){return this._allowUnknownOption=!!i,this}allowExcessArguments(i=!0){return this._allowExcessArguments=!!i,this}enablePositionalOptions(i=!0){return this._enablePositionalOptions=!!i,this}passThroughOptions(i=!0){if(this._passThroughOptions=!!i,!!this.parent&&i&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(i=!0){if(this._storeOptionsAsProperties=!!i,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(i){return this._storeOptionsAsProperties?this[i]:this._optionValues[i]}setOptionValue(i,n){return this._storeOptionsAsProperties?this[i]=n:this._optionValues[i]=n,this}setOptionValueWithSource(i,n,r){return this.setOptionValue(i,n),this._optionValueSources[i]=r,this}getOptionValueSource(i){return this._optionValueSources[i]}_prepareUserArgs(i,n){if(i!==void 0&&!Array.isArray(i))throw new Error("first parameter to parse must be array or undefined");n=n||{},i===void 0&&(i=x.argv,x.versions&&x.versions.electron&&(n.from="electron")),this.rawArgs=i.slice();let r;switch(n.from){case void 0:case"node":this._scriptPath=i[1],r=i.slice(2);break;case"electron":x.defaultApp?(this._scriptPath=i[1],r=i.slice(2)):r=i.slice(1);break;case"user":r=i.slice(0);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(i,n){let r=this._prepareUserArgs(i,n);return this._parseCommand([],r),this}async parseAsync(i,n){let r=this._prepareUserArgs(i,n);return await this._parseCommand([],r),this}_executeSubCommand(i,n){n=n.slice();let r=!1,t=[".js",".ts",".tsx",".mjs",".cjs"];function o(f,c){let h=T.resolve(f,c);if(pe.existsSync(h))return h;if(t.includes(T.extname(c)))return;let d=t.find(m=>pe.existsSync(`${h}${m}`));if(d)return`${h}${d}`}this._checkForMissingMandatoryOptions();let l=i._executableFile||`${this._name}-${i._name}`,s=this._executableDir||"";if(this._scriptPath){let f;try{f=pe.realpathSync(this._scriptPath)}catch(c){f=this._scriptPath}s=T.resolve(T.dirname(f),s)}if(s){let f=o(s,l);if(!f&&!i._executableFile&&this._scriptPath){let c=T.basename(this._scriptPath,T.extname(this._scriptPath));c!==this._name&&(f=o(s,`${c}-${i._name}`))}l=f||l}r=t.includes(T.extname(l));let a;x.platform!=="win32"?r?(n.unshift(l),n=qe(x.execArgv).concat(n),a=he.spawn(x.argv[0],n,{stdio:"inherit"})):a=he.spawn(l,n,{stdio:"inherit"}):(n.unshift(l),n=qe(x.execArgv).concat(n),a=he.spawn(x.execPath,n,{stdio:"inherit"})),a.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{x.on(c,()=>{a.killed===!1&&a.exitCode===null&&a.kill(c)})});let u=this._exitCallback;u?a.on("close",()=>{u(new de(x.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):a.on("close",x.exit.bind(x)),a.on("error",f=>{if(f.code==="ENOENT"){let c=s?`searched for local subcommand relative to directory '${s}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",h=`'${l}' does not exist
- if '${i._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
- ${c}`;throw new Error(h)}else if(f.code==="EACCES")throw new Error(`'${l}' not executable`);if(!u)x.exit(1);else{let c=new de(1,"commander.executeSubCommandAsync","(error)");c.nestedError=f,u(c)}}),this.runningCommand=a}_dispatchSubcommand(i,n,r){let t=this._findCommand(i);if(t||this.help({error:!0}),t._executableHandler)this._executeSubCommand(t,n.concat(r));else return t._parseCommand(n,r)}_checkNumberOfArguments(){this._args.forEach((i,n)=>{i.required&&this.args[n]==null&&this.missingArgument(i.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){let i=(r,t,o)=>{let l=t;if(t!==null&&r.parseArg)try{l=r.parseArg(t,o)}catch(s){if(s.code==="commander.invalidArgument"){let a=`error: command-argument value '${t}' is invalid for argument '${r.name()}'. ${s.message}`;this.error(a,{exitCode:s.exitCode,code:s.code})}throw s}return l};this._checkNumberOfArguments();let n=[];this._args.forEach((r,t)=>{let o=r.defaultValue;r.variadic?t<this.args.length?(o=this.args.slice(t),r.parseArg&&(o=o.reduce((l,s)=>i(r,s,l),r.defaultValue))):o===void 0&&(o=[]):t<this.args.length&&(o=this.args[t],r.parseArg&&(o=i(r,o,r.defaultValue))),n[t]=o}),this.processedArgs=n}_chainOrCall(i,n){return i&&i.then&&typeof i.then=="function"?i.then(()=>n()):n()}_chainOrCallHooks(i,n){let r=i,t=[];return X(this).reverse().filter(o=>o._lifeCycleHooks[n]!==void 0).forEach(o=>{o._lifeCycleHooks[n].forEach(l=>{t.push({hookedCommand:o,callback:l})})}),n==="postAction"&&t.reverse(),t.forEach(o=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_parseCommand(i,n){let r=this.parseOptions(n);if(this._parseOptionsEnv(),i=i.concat(r.operands),n=r.unknown,this.args=i.concat(n),i&&this._findCommand(i[0]))return this._dispatchSubcommand(i[0],i.slice(1),n);if(this._hasImplicitHelpCommand()&&i[0]===this._helpCommandName)return i.length===1&&this.help(),this._dispatchSubcommand(i[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return Be(this,n),this._dispatchSubcommand(this._defaultCommandName,i,n);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),Be(this,r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let t=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){t(),this._processArguments();let l;return l=this._chainOrCallHooks(l,"preAction"),l=this._chainOrCall(l,()=>this._actionHandler(this.processedArgs)),this.parent&&(l=this._chainOrCall(l,()=>{this.parent.emit(o,i,n)})),l=this._chainOrCallHooks(l,"postAction"),l}if(this.parent&&this.parent.listenerCount(o))t(),this._processArguments(),this.parent.emit(o,i,n);else if(i.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",i,n);this.listenerCount("command:*")?this.emit("command:*",i,n):this.commands.length?this.unknownCommand():(t(),this._processArguments())}else this.commands.length?(t(),this.help({error:!0})):(t(),this._processArguments())}_findCommand(i){if(!!i)return this.commands.find(n=>n._name===i||n._aliases.includes(i))}_findOption(i){return this.options.find(n=>n.is(i))}_checkForMissingMandatoryOptions(){for(let i=this;i;i=i.parent)i.options.forEach(n=>{n.mandatory&&i.getOptionValue(n.attributeName())===void 0&&i.missingMandatoryOptionValue(n)})}_checkForConflictingOptions(){let i=this.options.filter(r=>{let t=r.attributeName();return this.getOptionValue(t)===void 0?!1:this.getOptionValueSource(t)!=="default"});i.filter(r=>r.conflictsWith.length>0).forEach(r=>{let t=i.find(o=>r.conflictsWith.includes(o.attributeName()));t&&this._conflictingOption(r,t)})}parseOptions(i){let n=[],r=[],t=n,o=i.slice();function l(a){return a.length>1&&a[0]==="-"}let s=null;for(;o.length;){let a=o.shift();if(a==="--"){t===r&&t.push(a),t.push(...o);break}if(s&&!l(a)){this.emit(`option:${s.name()}`,a);continue}if(s=null,l(a)){let u=this._findOption(a);if(u){if(u.required){let f=o.shift();f===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,f)}else if(u.optional){let f=null;o.length>0&&!l(o[0])&&(f=o.shift()),this.emit(`option:${u.name()}`,f)}else this.emit(`option:${u.name()}`);s=u.variadic?u:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let u=this._findOption(`-${a[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,a.slice(2)):(this.emit(`option:${u.name()}`),o.unshift(`-${a.slice(2)}`));continue}}if(/^--[^=]+=/.test(a)){let u=a.indexOf("="),f=this._findOption(a.slice(0,u));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,a.slice(u+1));continue}}if(l(a)&&(t=r),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&r.length===0){if(this._findCommand(a)){n.push(a),o.length>0&&r.push(...o);break}else if(a===this._helpCommandName&&this._hasImplicitHelpCommand()){n.push(a),o.length>0&&n.push(...o);break}else if(this._defaultCommandName){r.push(a),o.length>0&&r.push(...o);break}}if(this._passThroughOptions){t.push(a),o.length>0&&t.push(...o);break}t.push(a)}return{operands:n,unknown:r}}opts(){if(this._storeOptionsAsProperties){let i={},n=this.options.length;for(let r=0;r<n;r++){let t=this.options[r].attributeName();i[t]=t===this._versionOptionName?this._version:this[t]}return i}return this._optionValues}optsWithGlobals(){return X(this).reduce((i,n)=>Object.assign(i,n.opts()),{})}error(i,n){this._outputConfiguration.outputError(`${i}
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
`),this.outputHelp({error:!0}));let r=n||{},t=r.exitCode||1,o=r.code||"commander.error";this._exit(t,o,i)}_parseOptionsEnv(){this.options.forEach(i=>{if(i.envVar&&i.envVar in x.env){let n=i.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(i.required||i.optional?this.emit(`optionEnv:${i.name()}`,x.env[i.envVar]):this.emit(`optionEnv:${i.name()}`))}})}missingArgument(i){let n=`error: missing required argument '${i}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(i){let n=`error: option '${i.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(i){let n=`error: required option '${i.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(i,n){let r=l=>{let s=l.attributeName(),a=this.getOptionValue(s),u=this.options.find(c=>c.negate&&s===c.attributeName()),f=this.options.find(c=>!c.negate&&s===c.attributeName());return u&&(u.presetArg===void 0&&a===!1||u.presetArg!==void 0&&a===u.presetArg)?u:f||l},t=l=>{let s=r(l),a=s.attributeName();return this.getOptionValueSource(a)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},o=`error: ${t(i)} cannot be used with ${t(n)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(i){if(this._allowUnknownOption)return;let n="";if(i.startsWith("--")&&this._showSuggestionAfterError){let t=[],o=this;do{let l=o.createHelp().visibleOptions(o).filter(s=>s.long).map(s=>s.long);t=t.concat(l),o=o.parent}while(o&&!o._enablePositionalOptions);n=Ve(i,t)}let r=`error: unknown option '${i}'${n}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(i){if(this._allowExcessArguments)return;let n=this._args.length,r=n===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${n} argument${r} but got ${i.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let i=this.args[0],n="";if(this._showSuggestionAfterError){let t=[];this.createHelp().visibleCommands(this).forEach(o=>{t.push(o.name()),o.alias()&&t.push(o.alias())}),n=Ve(i,t)}let r=`error: unknown command '${i}'${n}`;this.error(r,{code:"commander.unknownCommand"})}version(i,n,r){if(i===void 0)return this._version;this._version=i,n=n||"-V, --version",r=r||"output the version number";let t=this.createOption(n,r);return this._versionOptionName=t.attributeName(),this.options.push(t),this.on("option:"+t.name(),()=>{this._outputConfiguration.writeOut(`${i}
`),this._exit(0,"commander.version",i)}),this}description(i,n){return i===void 0&&n===void 0?this._description:(this._description=i,n&&(this._argsDescription=n),this)}alias(i){if(i===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),i===n._name)throw new Error("Command alias can't be the same as its name");return n._aliases.push(i),this}aliases(i){return i===void 0?this._aliases:(i.forEach(n=>this.alias(n)),this)}usage(i){if(i===void 0){if(this._usage)return this._usage;let n=this._args.map(r=>On(r));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?n:[]).join(" ")}return this._usage=i,this}name(i){return i===void 0?this._name:(this._name=i,this)}nameFromFilename(i){return this._name=T.basename(i,T.extname(i)),this}executableDir(i){return i===void 0?this._executableDir:(this._executableDir=i,this)}helpInformation(i){let n=this.createHelp();return n.helpWidth===void 0&&(n.helpWidth=i&&i.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),n.formatHelp(this,n)}_getHelpContext(i){i=i||{};let n={error:!!i.error},r;return n.error?r=t=>this._outputConfiguration.writeErr(t):r=t=>this._outputConfiguration.writeOut(t),n.write=i.write||r,n.command=this,n}outputHelp(i){let n;typeof i=="function"&&(n=i,i=void 0);let r=this._getHelpContext(i);X(this).reverse().forEach(o=>o.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let t=this.helpInformation(r);if(n&&(t=n(t),typeof t!="string"&&!Buffer.isBuffer(t)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(t),this.emit(this._helpLongFlag),this.emit("afterHelp",r),X(this).forEach(o=>o.emit("afterAllHelp",r))}helpOption(i,n){if(typeof i=="boolean")return this._hasHelpOption=i,this;this._helpFlags=i||this._helpFlags,this._helpDescription=n||this._helpDescription;let r=Sn(this._helpFlags);return this._helpShortFlag=r.shortFlag,this._helpLongFlag=r.longFlag,this}help(i){this.outputHelp(i);let n=x.exitCode||0;n===0&&i&&typeof i!="function"&&i.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(i,n){let r=["beforeAll","before","after","afterAll"];if(!r.includes(i))throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${r.join("', '")}'`);let t=`${i}Help`;return this.on(t,o=>{let l;typeof n=="function"?l=n({error:o.error,command:o.command}):l=n,l&&o.write(`${l}
`)}),this}};function Be(e,i){e._hasHelpOption&&i.find(r=>r===e._helpLongFlag||r===e._helpShortFlag)&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function qe(e){return e.map(i=>{if(!i.startsWith("--inspect"))return i;let n,r="127.0.0.1",t="9229",o;return(o=i.match(/^(--inspect(-brk)?)$/))!==null?n=o[1]:(o=i.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=o[1],/^\d+$/.test(o[3])?t=o[3]:r=o[3]):(o=i.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=o[1],r=o[3],t=o[4]),n&&t!=="0"?`${n}=${r}:${parseInt(t)+1}`:i})}function X(e){let i=[];for(let n=e;n;n=n.parent)i.push(n);return i}Ye.Command=Q});var Je=L((S,Ge)=>{var{Argument:Fn}=J(),{Command:We}=Ue(),{CommanderError:Tn,InvalidArgumentError:Ke}=B(),{Help:kn}=ue(),{Option:In}=fe();S=Ge.exports=new We;S.program=S;S.Argument=Fn;S.Command=We;S.CommanderError=Tn;S.Help=kn;S.InvalidArgumentError=Ke;S.InvalidOptionArgumentError=Ke;S.Option=In});var sn=$(require("fs"));var Qe=$(Je()),{program:oo,createCommand:lo,createArgument:so,createOption:ao,CommanderError:uo,InvalidArgumentError:co,Command:Xe,Argument:fo,Option:ho,Help:po}=Qe.default;var tn=$(require("child_process")),on=$(require("crypto")),G=$(require("fs"));var nn=$(require("fs"));function Ze(e){return typeof e=="undefined"||e===null}function Nn(e){return typeof e=="object"&&e!==null}function Ln(e){return Array.isArray(e)?e:Ze(e)?[]:[e]}function Dn(e,i){var n,r,t,o;if(i)for(o=Object.keys(i),n=0,r=o.length;n<r;n+=1)t=o[n],e[t]=i[t];return e}function Hn(e,i){var n="",r;for(r=0;r<i;r+=1)n+=e;return n}function $n(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Mn=Ze,Pn=Nn,Rn=Ln,jn=Hn,Vn=$n,Bn=Dn,C={isNothing:Mn,isObject:Pn,toArray:Rn,repeat:jn,isNegativeZero:Vn,extend:Bn};function ze(e,i){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!i&&e.mark.snippet&&(n+=`
`+e.mark.snippet),r+" "+n):r}function q(e,i){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=i,this.message=ze(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}q.prototype=Object.create(Error.prototype);q.prototype.constructor=q;q.prototype.toString=function(i){return this.name+": "+ze(this,i)};var w=q;function me(e,i,n,r,t){var o="",l="",s=Math.floor(t/2)-1;return r-i>s&&(o=" ... ",i=r-s+o.length),n-r>s&&(l=" ...",n=r+s-l.length),{str:o+e.slice(i,n).replace(/\t/g,"\u2192")+l,pos:r-i+o.length}}function ge(e,i){return C.repeat(" ",i-e.length)+e}function qn(e,i){if(i=Object.create(i||null),!e.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!="number"&&(i.indent=1),typeof i.linesBefore!="number"&&(i.linesBefore=3),typeof i.linesAfter!="number"&&(i.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],t=[],o,l=-1;o=n.exec(e.buffer);)t.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&l<0&&(l=r.length-2);l<0&&(l=r.length-1);var s="",a,u,f=Math.min(e.line+i.linesAfter,t.length).toString().length,c=i.maxLength-(i.indent+f+3);for(a=1;a<=i.linesBefore&&!(l-a<0);a++)u=me(e.buffer,r[l-a],t[l-a],e.position-(r[l]-r[l-a]),c),s=C.repeat(" ",i.indent)+ge((e.line-a+1).toString(),f)+" | "+u.str+`
`+s;for(u=me(e.buffer,r[l],t[l],e.position,c),s+=C.repeat(" ",i.indent)+ge((e.line+1).toString(),f)+" | "+u.str+`
`,s+=C.repeat("-",i.indent+f+3+u.pos)+`^
`,a=1;a<=i.linesAfter&&!(l+a>=t.length);a++)u=me(e.buffer,r[l+a],t[l+a],e.position-(r[l]-r[l+a]),c),s+=C.repeat(" ",i.indent)+ge((e.line+a+1).toString(),f)+" | "+u.str+`
`;return s.replace(/\n$/,"")}var Yn=qn,Un=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Wn=["scalar","sequence","mapping"];function Kn(e){var i={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){i[String(r)]=n})}),i}function Gn(e,i){if(i=i||{},Object.keys(i).forEach(function(n){if(Un.indexOf(n)===-1)throw new w('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=i,this.tag=e,this.kind=i.kind||null,this.resolve=i.resolve||function(){return!0},this.construct=i.construct||function(n){return n},this.instanceOf=i.instanceOf||null,this.predicate=i.predicate||null,this.represent=i.represent||null,this.representName=i.representName||null,this.defaultStyle=i.defaultStyle||null,this.multi=i.multi||!1,this.styleAliases=Kn(i.styleAliases||null),Wn.indexOf(this.kind)===-1)throw new w('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var y=Gn;function ei(e,i){var n=[];return e[i].forEach(function(r){var t=n.length;n.forEach(function(o,l){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(t=l)}),n[t]=r}),n}function Jn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},i,n;function r(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(i=0,n=arguments.length;i<n;i+=1)arguments[i].forEach(r);return e}function _e(e){return this.extend(e)}_e.prototype.extend=function(i){var n=[],r=[];if(i instanceof y)r.push(i);else if(Array.isArray(i))r=r.concat(i);else if(i&&(Array.isArray(i.implicit)||Array.isArray(i.explicit)))i.implicit&&(n=n.concat(i.implicit)),i.explicit&&(r=r.concat(i.explicit));else throw new w("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof y))throw new w("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new w("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new w("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof y))throw new w("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var t=Object.create(_e.prototype);return t.implicit=(this.implicit||[]).concat(n),t.explicit=(this.explicit||[]).concat(r),t.compiledImplicit=ei(t,"implicit"),t.compiledExplicit=ei(t,"explicit"),t.compiledTypeMap=Jn(t.compiledImplicit,t.compiledExplicit),t};var ii=_e,ni=new y("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),ri=new y("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),ti=new y("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),oi=new ii({explicit:[ni,ri,ti]});function Qn(e){if(e===null)return!0;var i=e.length;return i===1&&e==="~"||i===4&&(e==="null"||e==="Null"||e==="NULL")}function Xn(){return null}function Zn(e){return e===null}var li=new y("tag:yaml.org,2002:null",{kind:"scalar",resolve:Qn,construct:Xn,predicate:Zn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function zn(e){if(e===null)return!1;var i=e.length;return i===4&&(e==="true"||e==="True"||e==="TRUE")||i===5&&(e==="false"||e==="False"||e==="FALSE")}function er(e){return e==="true"||e==="True"||e==="TRUE"}function ir(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var si=new y("tag:yaml.org,2002:bool",{kind:"scalar",resolve:zn,construct:er,predicate:ir,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function nr(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function rr(e){return 48<=e&&e<=55}function tr(e){return 48<=e&&e<=57}function or(e){if(e===null)return!1;var i=e.length,n=0,r=!1,t;if(!i)return!1;if(t=e[n],(t==="-"||t==="+")&&(t=e[++n]),t==="0"){if(n+1===i)return!0;if(t=e[++n],t==="b"){for(n++;n<i;n++)if(t=e[n],t!=="_"){if(t!=="0"&&t!=="1")return!1;r=!0}return r&&t!=="_"}if(t==="x"){for(n++;n<i;n++)if(t=e[n],t!=="_"){if(!nr(e.charCodeAt(n)))return!1;r=!0}return r&&t!=="_"}if(t==="o"){for(n++;n<i;n++)if(t=e[n],t!=="_"){if(!rr(e.charCodeAt(n)))return!1;r=!0}return r&&t!=="_"}}if(t==="_")return!1;for(;n<i;n++)if(t=e[n],t!=="_"){if(!tr(e.charCodeAt(n)))return!1;r=!0}return!(!r||t==="_")}function lr(e){var i=e,n=1,r;if(i.indexOf("_")!==-1&&(i=i.replace(/_/g,"")),r=i[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),i=i.slice(1),r=i[0]),i==="0")return 0;if(r==="0"){if(i[1]==="b")return n*parseInt(i.slice(2),2);if(i[1]==="x")return n*parseInt(i.slice(2),16);if(i[1]==="o")return n*parseInt(i.slice(2),8)}return n*parseInt(i,10)}function sr(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1==0&&!C.isNegativeZero(e)}var ai=new y("tag:yaml.org,2002:int",{kind:"scalar",resolve:or,construct:lr,predicate:sr,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ar=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ur(e){return!(e===null||!ar.test(e)||e[e.length-1]==="_")}function cr(e){var i,n;return i=e.replace(/_/g,"").toLowerCase(),n=i[0]==="-"?-1:1,"+-".indexOf(i[0])>=0&&(i=i.slice(1)),i===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:i===".nan"?NaN:n*parseFloat(i,10)}var fr=/^[-+]?[0-9]+e/;function hr(e,i){var n;if(isNaN(e))switch(i){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(i){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(i){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(C.isNegativeZero(e))return"-0.0";return n=e.toString(10),fr.test(n)?n.replace("e",".e"):n}function pr(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!=0||C.isNegativeZero(e))}var ui=new y("tag:yaml.org,2002:float",{kind:"scalar",resolve:ur,construct:cr,predicate:pr,represent:hr,defaultStyle:"lowercase"}),ci=oi.extend({implicit:[li,si,ai,ui]}),fi=ci,hi=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),pi=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function dr(e){return e===null?!1:hi.exec(e)!==null||pi.exec(e)!==null}function mr(e){var i,n,r,t,o,l,s,a=0,u=null,f,c,h;if(i=hi.exec(e),i===null&&(i=pi.exec(e)),i===null)throw new Error("Date resolve error");if(n=+i[1],r=+i[2]-1,t=+i[3],!i[4])return new Date(Date.UTC(n,r,t));if(o=+i[4],l=+i[5],s=+i[6],i[7]){for(a=i[7].slice(0,3);a.length<3;)a+="0";a=+a}return i[9]&&(f=+i[10],c=+(i[11]||0),u=(f*60+c)*6e4,i[9]==="-"&&(u=-u)),h=new Date(Date.UTC(n,r,t,o,l,s,a)),u&&h.setTime(h.getTime()-u),h}function gr(e){return e.toISOString()}var di=new y("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:dr,construct:mr,instanceOf:Date,represent:gr});function _r(e){return e==="<<"||e===null}var mi=new y("tag:yaml.org,2002:merge",{kind:"scalar",resolve:_r}),xe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function xr(e){if(e===null)return!1;var i,n,r=0,t=e.length,o=xe;for(n=0;n<t;n++)if(i=o.indexOf(e.charAt(n)),!(i>64)){if(i<0)return!1;r+=6}return r%8==0}function Ar(e){var i,n,r=e.replace(/[\r\n=]/g,""),t=r.length,o=xe,l=0,s=[];for(i=0;i<t;i++)i%4==0&&i&&(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)),l=l<<6|o.indexOf(r.charAt(i));return n=t%4*6,n===0?(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)):n===18?(s.push(l>>10&255),s.push(l>>2&255)):n===12&&s.push(l>>4&255),new Uint8Array(s)}function vr(e){var i="",n=0,r,t,o=e.length,l=xe;for(r=0;r<o;r++)r%3==0&&r&&(i+=l[n>>18&63],i+=l[n>>12&63],i+=l[n>>6&63],i+=l[n&63]),n=(n<<8)+e[r];return t=o%3,t===0?(i+=l[n>>18&63],i+=l[n>>12&63],i+=l[n>>6&63],i+=l[n&63]):t===2?(i+=l[n>>10&63],i+=l[n>>4&63],i+=l[n<<2&63],i+=l[64]):t===1&&(i+=l[n>>2&63],i+=l[n<<4&63],i+=l[64],i+=l[64]),i}function Cr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var gi=new y("tag:yaml.org,2002:binary",{kind:"scalar",resolve:xr,construct:Ar,predicate:Cr,represent:vr}),yr=Object.prototype.hasOwnProperty,br=Object.prototype.toString;function wr(e){if(e===null)return!0;var i=[],n,r,t,o,l,s=e;for(n=0,r=s.length;n<r;n+=1){if(t=s[n],l=!1,br.call(t)!=="[object Object]")return!1;for(o in t)if(yr.call(t,o))if(!l)l=!0;else return!1;if(!l)return!1;if(i.indexOf(o)===-1)i.push(o);else return!1}return!0}function Or(e){return e!==null?e:[]}var _i=new y("tag:yaml.org,2002:omap",{kind:"sequence",resolve:wr,construct:Or}),Er=Object.prototype.toString;function Sr(e){if(e===null)return!0;var i,n,r,t,o,l=e;for(o=new Array(l.length),i=0,n=l.length;i<n;i+=1){if(r=l[i],Er.call(r)!=="[object Object]"||(t=Object.keys(r),t.length!==1))return!1;o[i]=[t[0],r[t[0]]]}return!0}function Fr(e){if(e===null)return[];var i,n,r,t,o,l=e;for(o=new Array(l.length),i=0,n=l.length;i<n;i+=1)r=l[i],t=Object.keys(r),o[i]=[t[0],r[t[0]]];return o}var xi=new y("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Sr,construct:Fr}),Tr=Object.prototype.hasOwnProperty;function kr(e){if(e===null)return!0;var i,n=e;for(i in n)if(Tr.call(n,i)&&n[i]!==null)return!1;return!0}function Ir(e){return e!==null?e:{}}var Ai=new y("tag:yaml.org,2002:set",{kind:"mapping",resolve:kr,construct:Ir}),Ae=fi.extend({implicit:[di,mi],explicit:[gi,_i,xi,Ai]}),I=Object.prototype.hasOwnProperty,Z=1,vi=2,Ci=3,z=4,ve=1,Nr=2,yi=3,Lr=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Dr=/[\x85\u2028\u2029]/,Hr=/[,\[\]\{\}]/,bi=/^(?:!|!!|![a-z\-]+!)$/i,wi=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Oi(e){return Object.prototype.toString.call(e)}function F(e){return e===10||e===13}function D(e){return e===9||e===32}function O(e){return e===9||e===32||e===10||e===13}function M(e){return e===44||e===91||e===93||e===123||e===125}function $r(e){var i;return 48<=e&&e<=57?e-48:(i=e|32,97<=i&&i<=102?i-97+10:-1)}function Mr(e){return e===120?2:e===117?4:e===85?8:0}function Pr(e){return 48<=e&&e<=57?e-48:-1}function Ei(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Rr(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Si=new Array(256),Fi=new Array(256);for(var P=0;P<256;P++)Si[P]=Ei(P)?1:0,Fi[P]=Ei(P);function jr(e,i){this.input=e,this.filename=i.filename||null,this.schema=i.schema||Ae,this.onWarning=i.onWarning||null,this.legacy=i.legacy||!1,this.json=i.json||!1,this.listener=i.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ti(e,i){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Yn(n),new w(i,n)}function p(e,i){throw Ti(e,i)}function ee(e,i){e.onWarning&&e.onWarning.call(null,Ti(e,i))}var ki={YAML:function(i,n,r){var t,o,l;i.version!==null&&p(i,"duplication of %YAML directive"),r.length!==1&&p(i,"YAML directive accepts exactly one argument"),t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),t===null&&p(i,"ill-formed argument of the YAML directive"),o=parseInt(t[1],10),l=parseInt(t[2],10),o!==1&&p(i,"unacceptable YAML version of the document"),i.version=r[0],i.checkLineBreaks=l<2,l!==1&&l!==2&&ee(i,"unsupported YAML version of the document")},TAG:function(i,n,r){var t,o;r.length!==2&&p(i,"TAG directive accepts exactly two arguments"),t=r[0],o=r[1],bi.test(t)||p(i,"ill-formed tag handle (first argument) of the TAG directive"),I.call(i.tagMap,t)&&p(i,'there is a previously declared suffix for "'+t+'" tag handle'),wi.test(o)||p(i,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch(l){p(i,"tag prefix is malformed: "+o)}i.tagMap[t]=o}};function N(e,i,n,r){var t,o,l,s;if(i<n){if(s=e.input.slice(i,n),r)for(t=0,o=s.length;t<o;t+=1)l=s.charCodeAt(t),l===9||32<=l&&l<=1114111||p(e,"expected valid JSON character");else Lr.test(s)&&p(e,"the stream contains non-printable characters");e.result+=s}}function Ii(e,i,n,r){var t,o,l,s;for(C.isObject(n)||p(e,"cannot merge mappings; the provided source object is unacceptable"),t=Object.keys(n),l=0,s=t.length;l<s;l+=1)o=t[l],I.call(i,o)||(i[o]=n[o],r[o]=!0)}function R(e,i,n,r,t,o,l,s,a){var u,f;if(Array.isArray(t))for(t=Array.prototype.slice.call(t),u=0,f=t.length;u<f;u+=1)Array.isArray(t[u])&&p(e,"nested arrays are not supported inside keys"),typeof t=="object"&&Oi(t[u])==="[object Object]"&&(t[u]="[object Object]");if(typeof t=="object"&&Oi(t)==="[object Object]"&&(t="[object Object]"),t=String(t),i===null&&(i={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(u=0,f=o.length;u<f;u+=1)Ii(e,i,o[u],n);else Ii(e,i,o,n);else!e.json&&!I.call(n,t)&&I.call(i,t)&&(e.line=l||e.line,e.lineStart=s||e.lineStart,e.position=a||e.position,p(e,"duplicated mapping key")),t==="__proto__"?Object.defineProperty(i,t,{configurable:!0,enumerable:!0,writable:!0,value:o}):i[t]=o,delete n[t];return i}function Ce(e){var i;i=e.input.charCodeAt(e.position),i===10?e.position++:i===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):p(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function v(e,i,n){for(var r=0,t=e.input.charCodeAt(e.position);t!==0;){for(;D(t);)t===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),t=e.input.charCodeAt(++e.position);if(i&&t===35)do t=e.input.charCodeAt(++e.position);while(t!==10&&t!==13&&t!==0);if(F(t))for(Ce(e),t=e.input.charCodeAt(e.position),r++,e.lineIndent=0;t===32;)e.lineIndent++,t=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&ee(e,"deficient indentation"),r}function ie(e){var i=e.position,n;return n=e.input.charCodeAt(i),!!((n===45||n===46)&&n===e.input.charCodeAt(i+1)&&n===e.input.charCodeAt(i+2)&&(i+=3,n=e.input.charCodeAt(i),n===0||O(n)))}function ye(e,i){i===1?e.result+=" ":i>1&&(e.result+=C.repeat(`
`,i-1))}function Vr(e,i,n){var r,t,o,l,s,a,u,f,c=e.kind,h=e.result,d;if(d=e.input.charCodeAt(e.position),O(d)||M(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(t=e.input.charCodeAt(e.position+1),O(t)||n&&M(t)))return!1;for(e.kind="scalar",e.result="",o=l=e.position,s=!1;d!==0;){if(d===58){if(t=e.input.charCodeAt(e.position+1),O(t)||n&&M(t))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),O(r))break}else{if(e.position===e.lineStart&&ie(e)||n&&M(d))break;if(F(d))if(a=e.line,u=e.lineStart,f=e.lineIndent,v(e,!1,-1),e.lineIndent>=i){s=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=a,e.lineStart=u,e.lineIndent=f;break}}s&&(N(e,o,l,!1),ye(e,e.line-a),o=l=e.position,s=!1),D(d)||(l=e.position+1),d=e.input.charCodeAt(++e.position)}return N(e,o,l,!1),e.result?!0:(e.kind=c,e.result=h,!1)}function Br(e,i){var n,r,t;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=t=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(N(e,r,e.position,!0),n=e.input.charCodeAt(++e.position