derived-cli 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bundle.js +51 -51
  2. package/package.json +2 -1
package/dist/bundle.js CHANGED
@@ -1,76 +1,76 @@
1
1
  #!/usr/bin/env bun
2
- "use strict";var je=Object.create;var Wt=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var x=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var Le=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Re(t))!qe.call(n,s)&&s!==e&&Wt(n,s,{get:()=>t[s],enumerable:!(i=Ge(t,s))||i.enumerable});return n};var w=(n,t,e)=>(e=n!=null?je(Ne(n)):{},Le(t||!n||!n.__esModule?Wt(e,"default",{value:n,enumerable:!0}):e,n));var P=x(st=>{var j=class extends Error{constructor(t,e,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}},it=class extends j{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};st.CommanderError=j;st.InvalidArgumentError=it});var G=x(nt=>{var{InvalidArgumentError:Ue}=P(),rt=class{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,e){return e===this.defaultValue||!Array.isArray(e)?[t]:(e.push(t),e)}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(e,i)=>{if(!this.argChoices.includes(e))throw new Ue(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(e,i):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Je(n){let t=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+t+">":"["+t+"]"}nt.Argument=rt;nt.humanReadableArgName=Je});var at=x(Dt=>{var{humanReadableArgName:Ke}=G(),ot=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let e=t.commands.filter(s=>!s._hidden),i=t._getHelpCommand();return i&&!i._hidden&&e.push(i),this.sortSubcommands&&e.sort((s,r)=>s.name().localeCompare(r.name())),e}compareOptions(t,e){let i=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return i(t).localeCompare(i(e))}visibleOptions(t){let e=t.options.filter(s=>!s.hidden),i=t._getHelpOption();if(i&&!i.hidden){let s=i.short&&t._findOption(i.short),r=i.long&&t._findOption(i.long);!s&&!r?e.push(i):i.long&&!r?e.push(t.createOption(i.long,i.description)):i.short&&!s&&e.push(t.createOption(i.short,i.description))}return this.sortOptions&&e.sort(this.compareOptions),e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let e=[];for(let i=t.parent;i;i=i.parent){let s=i.options.filter(r=>!r.hidden);e.push(...s)}return this.sortOptions&&e.sort(this.compareOptions),e}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(e=>{e.description=e.description||t._argsDescription[e.name()]||""}),t.registeredArguments.find(e=>e.description)?t.registeredArguments:[]}subcommandTerm(t){let e=t.registeredArguments.map(i=>Ke(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce((i,s)=>Math.max(i,this.displayWidth(e.styleSubcommandTerm(e.subcommandTerm(s)))),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce((i,s)=>Math.max(i,this.displayWidth(e.styleOptionTerm(e.optionTerm(s)))),0)}longestGlobalOptionTermLength(t,e){return e.visibleGlobalOptions(t).reduce((i,s)=>Math.max(i,this.displayWidth(e.styleOptionTerm(e.optionTerm(s)))),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce((i,s)=>Math.max(i,this.displayWidth(e.styleArgumentTerm(e.argumentTerm(s)))),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let i="";for(let s=t.parent;s;s=s.parent)i=s.name()+" "+i;return i+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&e.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&e.push(`env: ${t.envVar}`),e.length>0){let i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}argumentDescription(t){let e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){let i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,e,i){return e.length===0?[]:[i.styleTitle(t),...e,""]}groupItems(t,e,i){let s=new Map;return t.forEach(r=>{let u=i(r);s.has(u)||s.set(u,[])}),e.forEach(r=>{let u=i(r);s.has(u)||s.set(u,[]),s.get(u).push(r)}),s}formatHelp(t,e){let i=e.padWidth(t,e),s=e.helpWidth??80;function r(D,p){return e.formatItem(D,i,p,e)}let u=[`${e.styleTitle("Usage:")} ${e.styleUsage(e.commandUsage(t))}`,""],o=e.commandDescription(t);o.length>0&&(u=u.concat([e.boxWrap(e.styleCommandDescription(o),s),""]));let l=e.visibleArguments(t).map(D=>r(e.styleArgumentTerm(e.argumentTerm(D)),e.styleArgumentDescription(e.argumentDescription(D))));if(u=u.concat(this.formatItemList("Arguments:",l,e)),this.groupItems(t.options,e.visibleOptions(t),D=>D.helpGroupHeading??"Options:").forEach((D,p)=>{let g=D.map(v=>r(e.styleOptionTerm(e.optionTerm(v)),e.styleOptionDescription(e.optionDescription(v))));u=u.concat(this.formatItemList(p,g,e))}),e.showGlobalOptions){let D=e.visibleGlobalOptions(t).map(p=>r(e.styleOptionTerm(e.optionTerm(p)),e.styleOptionDescription(e.optionDescription(p))));u=u.concat(this.formatItemList("Global Options:",D,e))}return this.groupItems(t.commands,e.visibleCommands(t),D=>D.helpGroup()||"Commands:").forEach((D,p)=>{let g=D.map(v=>r(e.styleSubcommandTerm(e.subcommandTerm(v)),e.styleSubcommandDescription(e.subcommandDescription(v))));u=u.concat(this.formatItemList(p,g,e))}),u.join(`
3
- `)}displayWidth(t){return jt(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(e=>e==="[options]"?this.styleOptionText(e):e==="[command]"?this.styleSubcommandText(e):e[0]==="["||e[0]==="<"?this.styleArgumentText(e):this.styleCommandText(e)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(e=>e==="[options]"?this.styleOptionText(e):e[0]==="["||e[0]==="<"?this.styleArgumentText(e):this.styleSubcommandText(e)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestGlobalOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,e,i,s){let u=" ".repeat(2);if(!i)return u+t;let o=t.padEnd(e+t.length-s.displayWidth(t)),l=2,a=(this.helpWidth??80)-e-l-2,D;return a<this.minWidthToWrap||s.preformatted(i)?D=i:D=s.boxWrap(i,a).replace(/\n/g,`
4
- `+" ".repeat(e+l)),u+o+" ".repeat(l)+D.replace(/\n/g,`
5
- ${u}`)}boxWrap(t,e){if(e<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,r=[];return i.forEach(u=>{let o=u.match(s);if(o===null){r.push("");return}let l=[o.shift()],h=this.displayWidth(l[0]);o.forEach(a=>{let D=this.displayWidth(a);if(h+D<=e){l.push(a),h+=D;return}r.push(l.join(""));let p=a.trimStart();l=[p],h=this.displayWidth(p)}),r.push(l.join(""))}),r.join(`
6
- `)}};function jt(n){let t=/\x1b\[\d*(;\d*)*m/g;return n.replace(t,"")}Dt.Help=ot;Dt.stripColor=jt});var pt=x(ct=>{var{InvalidArgumentError:ze}=P(),lt=class{constructor(t,e){this.flags=t,this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let i=Ye(t);this.short=i.shortFlag,this.long=i.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,this.helpGroupHeading=void 0}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let e=t;return typeof t=="string"&&(e={[t]:!0}),this.implied=Object.assign(this.implied||{},e),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,e){return e===this.defaultValue||!Array.isArray(e)?[t]:(e.push(t),e)}choices(t){return this.argChoices=t.slice(),this.parseArg=(e,i)=>{if(!this.argChoices.includes(e))throw new ze(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(e,i):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Gt(this.name().replace(/^no-/,"")):Gt(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ht=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(t,e){let i=e.attributeName();if(!this.dualOptions.has(i))return!0;let s=this.negativeOptions.get(i).presetArg,r=s!==void 0?s:!1;return e.negate===(r===t)}};function Gt(n){return n.split("-").reduce((t,e)=>t+e[0].toUpperCase()+e.slice(1))}function Ye(n){let t,e,i=/^-[^-]$/,s=/^--[^-]/,r=n.split(/[ |,]+/).concat("guard");if(i.test(r[0])&&(t=r.shift()),s.test(r[0])&&(e=r.shift()),!t&&i.test(r[0])&&(t=r.shift()),!t&&s.test(r[0])&&(t=e,e=r.shift()),r[0].startsWith("-")){let u=r[0],o=`option creation failed due to '${u}' in option flags '${n}'`;throw/^-[^-][^-]/.test(u)?new Error(`${o}
2
+ "use strict";var Nt=Object.create;var Ge=Object.defineProperty;var Rt=Object.getOwnPropertyDescriptor;var qt=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Jt=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of qt(e))!Ut.call(r,s)&&s!==t&&Ge(r,s,{get:()=>e[s],enumerable:!(i=Rt(e,s))||i.enumerable});return r};var y=(r,e,t)=>(t=r!=null?Nt(Lt(r)):{},Jt(e||!r||!r.__esModule?Ge(t,"default",{value:r,enumerable:!0}):t,r));var H=O(ie=>{var j=class extends Error{constructor(e,t,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},ue=class extends j{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};ie.CommanderError=j;ie.InvalidArgumentError=ue});var G=O(re=>{var{InvalidArgumentError:Kt}=H(),se=class{constructor(e,t){switch(this.description=t||"",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.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new Kt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,i):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function zt(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}re.Argument=se;re.humanReadableArgName=zt});var De=O(oe=>{var{humanReadableArgName:Yt}=G(),ne=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(s=>!s._hidden),i=e._getHelpCommand();return i&&!i._hidden&&t.push(i),this.sortSubcommands&&t.sort((s,n)=>s.name().localeCompare(n.name())),t}compareOptions(e,t){let i=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return i(e).localeCompare(i(t))}visibleOptions(e){let t=e.options.filter(s=>!s.hidden),i=e._getHelpOption();if(i&&!i.hidden){let s=i.short&&e._findOption(i.short),n=i.long&&e._findOption(i.long);!s&&!n?t.push(i):i.long&&!n?t.push(e.createOption(i.long,i.description)):i.short&&!s&&t.push(e.createOption(i.short,i.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let i=e.parent;i;i=i.parent){let s=i.options.filter(n=>!n.hidden);t.push(...s)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(i=>Yt(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((i,s)=>Math.max(i,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(s)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((i,s)=>Math.max(i,this.displayWidth(t.styleOptionTerm(t.optionTerm(s)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((i,s)=>Math.max(i,this.displayWidth(t.styleOptionTerm(t.optionTerm(s)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((i,s)=>Math.max(i,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(s)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let i="";for(let s=e.parent;s;s=s.parent)i=s.name()+" "+i;return i+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let i=`(${t.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let i=`(${t.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,t,i){return t.length===0?[]:[i.styleTitle(e),...t,""]}groupItems(e,t,i){let s=new Map;return e.forEach(n=>{let u=i(n);s.has(u)||s.set(u,[])}),t.forEach(n=>{let u=i(n);s.has(u)||s.set(u,[]),s.get(u).push(n)}),s}formatHelp(e,t){let i=t.padWidth(e,t),s=t.helpWidth??80;function n(D,p){return t.formatItem(D,i,p,t)}let u=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],o=t.commandDescription(e);o.length>0&&(u=u.concat([t.boxWrap(t.styleCommandDescription(o),s),""]));let l=t.visibleArguments(e).map(D=>n(t.styleArgumentTerm(t.argumentTerm(D)),t.styleArgumentDescription(t.argumentDescription(D))));if(u=u.concat(this.formatItemList("Arguments:",l,t)),this.groupItems(e.options,t.visibleOptions(e),D=>D.helpGroupHeading??"Options:").forEach((D,p)=>{let g=D.map(v=>n(t.styleOptionTerm(t.optionTerm(v)),t.styleOptionDescription(t.optionDescription(v))));u=u.concat(this.formatItemList(p,g,t))}),t.showGlobalOptions){let D=t.visibleGlobalOptions(e).map(p=>n(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));u=u.concat(this.formatItemList("Global Options:",D,t))}return this.groupItems(e.commands,t.visibleCommands(e),D=>D.helpGroup()||"Commands:").forEach((D,p)=>{let g=D.map(v=>n(t.styleSubcommandTerm(t.subcommandTerm(v)),t.styleSubcommandDescription(t.subcommandDescription(v))));u=u.concat(this.formatItemList(p,g,t))}),u.join(`
3
+ `)}displayWidth(e){return Ne(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).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(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).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,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,i,s){let u=" ".repeat(2);if(!i)return u+e;let o=e.padEnd(t+e.length-s.displayWidth(e)),l=2,a=(this.helpWidth??80)-t-l-2,D;return a<this.minWidthToWrap||s.preformatted(i)?D=i:D=s.boxWrap(i,a).replace(/\n/g,`
4
+ `+" ".repeat(t+l)),u+o+" ".repeat(l)+D.replace(/\n/g,`
5
+ ${u}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,n=[];return i.forEach(u=>{let o=u.match(s);if(o===null){n.push("");return}let l=[o.shift()],h=this.displayWidth(l[0]);o.forEach(a=>{let D=this.displayWidth(a);if(h+D<=t){l.push(a),h+=D;return}n.push(l.join(""));let p=a.trimStart();l=[p],h=this.displayWidth(p)}),n.push(l.join(""))}),n.join(`
6
+ `)}};function Ne(r){let e=/\x1b\[\d*(;\d*)*m/g;return r.replace(e,"")}oe.Help=ne;oe.stripColor=Ne});var ce=O(he=>{var{InvalidArgumentError:Zt}=H(),ae=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=Qt(e);this.short=i.shortFlag,this.long=i.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,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),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}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new Zt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,i):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Re(this.name().replace(/^no-/,"")):Re(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},le=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,t){let i=t.attributeName();if(!this.dualOptions.has(i))return!0;let s=this.negativeOptions.get(i).presetArg,n=s!==void 0?s:!1;return t.negate===(n===e)}};function Re(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Qt(r){let e,t,i=/^-[^-]$/,s=/^--[^-]/,n=r.split(/[ |,]+/).concat("guard");if(i.test(n[0])&&(e=n.shift()),s.test(n[0])&&(t=n.shift()),!e&&i.test(n[0])&&(e=n.shift()),!e&&s.test(n[0])&&(e=t,t=n.shift()),n[0].startsWith("-")){let u=n[0],o=`option creation failed due to '${u}' in option flags '${r}'`;throw/^-[^-][^-]/.test(u)?new Error(`${o}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(u)?new Error(`${o}
10
10
  - too many short flags`):s.test(u)?new Error(`${o}
11
11
  - too many long flags`):new Error(`${o}
12
- - unrecognised flag format`)}if(t===void 0&&e===void 0)throw new Error(`option creation failed due to no flags found in '${n}'.`);return{shortFlag:t,longFlag:e}}ct.Option=lt;ct.DualOptions=ht});var Nt=x(Rt=>{function Ze(n,t){if(Math.abs(n.length-t.length)>3)return Math.max(n.length,t.length);let e=[];for(let i=0;i<=n.length;i++)e[i]=[i];for(let i=0;i<=t.length;i++)e[0][i]=i;for(let i=1;i<=t.length;i++)for(let s=1;s<=n.length;s++){let r=1;n[s-1]===t[i-1]?r=0:r=1,e[s][i]=Math.min(e[s-1][i]+1,e[s][i-1]+1,e[s-1][i-1]+r),s>1&&i>1&&n[s-1]===t[i-2]&&n[s-2]===t[i-1]&&(e[s][i]=Math.min(e[s][i],e[s-2][i-2]+1))}return e[n.length][t.length]}function Qe(n,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let e=n.startsWith("--");e&&(n=n.slice(2),t=t.map(u=>u.slice(2)));let i=[],s=3,r=.4;return t.forEach(u=>{if(u.length<=1)return;let o=Ze(n,u),l=Math.max(n.length,u.length);(l-o)/l>r&&(o<s?(s=o,i=[u]):o===s&&i.push(u))}),i.sort((u,o)=>u.localeCompare(o)),e&&(i=i.map(u=>`--${u}`)),i.length>1?`
12
+ - unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${r}'.`);return{shortFlag:e,longFlag:t}}he.Option=ae;he.DualOptions=le});var Le=O(qe=>{function Xt(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let i=0;i<=r.length;i++)t[i]=[i];for(let i=0;i<=e.length;i++)t[0][i]=i;for(let i=1;i<=e.length;i++)for(let s=1;s<=r.length;s++){let n=1;r[s-1]===e[i-1]?n=0:n=1,t[s][i]=Math.min(t[s-1][i]+1,t[s][i-1]+1,t[s-1][i-1]+n),s>1&&i>1&&r[s-1]===e[i-2]&&r[s-2]===e[i-1]&&(t[s][i]=Math.min(t[s][i],t[s-2][i-2]+1))}return t[r.length][e.length]}function eu(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(u=>u.slice(2)));let i=[],s=3,n=.4;return e.forEach(u=>{if(u.length<=1)return;let o=Xt(r,u),l=Math.max(r.length,u.length);(l-o)/l>n&&(o<s?(s=o,i=[u]):o===s&&i.push(u))}),i.sort((u,o)=>u.localeCompare(o)),t&&(i=i.map(u=>`--${u}`)),i.length>1?`
13
13
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
14
- (Did you mean ${i[0]}?)`:""}Rt.suggestSimilar=Qe});var Jt=x(Ft=>{var Xe=require("node:events").EventEmitter,mt=require("node:child_process"),O=require("node:path"),R=require("node:fs"),m=require("node:process"),{Argument:tu,humanReadableArgName:eu}=G(),{CommanderError:dt}=P(),{Help:uu,stripColor:iu}=at(),{Option:qt,DualOptions:su}=pt(),{suggestSimilar:Lt}=Nt(),ft=class n extends Xe{constructor(t){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=t||"",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:e=>m.stdout.write(e),writeErr:e=>m.stderr.write(e),outputError:(e,i)=>i(e),getOutHelpWidth:()=>m.stdout.isTTY?m.stdout.columns:void 0,getErrHelpWidth:()=>m.stderr.isTTY?m.stderr.columns:void 0,getOutHasColors:()=>Ct()??(m.stdout.isTTY&&m.stdout.hasColors?.()),getErrHasColors:()=>Ct()??(m.stderr.isTTY&&m.stderr.hasColors?.()),stripColor:e=>iu(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let e=this;e;e=e.parent)t.push(e);return t}command(t,e,i){let s=e,r=i;typeof s=="object"&&s!==null&&(r=s,s=null),r=r||{};let[,u,o]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(u);return s&&(l.description(s),l._executableHandler=!0),r.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(r.noHelp||r.hidden),l._executableFile=r.executableFile||null,o&&l.arguments(o),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),s?this:l}createCommand(t){return new n(t)}createHelp(){return Object.assign(new uu,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);return e=e||{},e.isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,e){return new tu(t,e)}argument(t,e,i,s){let r=this.createArgument(t,e);return typeof i=="function"?r.default(s).argParser(i):r.default(i),this.addArgument(r),this}arguments(t){return t.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(t){let e=this.registeredArguments.slice(-1)[0];if(e?.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,e){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=t??"help [command]",[,s,r]=i.match(/([^ ]+) *(.*)/),u=e??"display help for command",o=this.createCommand(s);return o.helpOption(!1),r&&o.arguments(r),u&&o.description(u),this._addImplicitHelpCommand=!0,this._helpCommand=o,(t||e)&&this._initCommandGroup(o),this}addHelpCommand(t,e){return typeof t!="object"?(this.helpCommand(t,e),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,e){let i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=e=>{if(e.code!=="commander.executeSubCommandAsync")throw e},this}_exit(t,e,i){this._exitCallback&&this._exitCallback(new dt(t,e,i)),m.exit(t)}action(t){let e=i=>{let s=this.registeredArguments.length,r=i.slice(0,s);return this._storeOptionsAsProperties?r[s]=this:r[s]=this.opts(),r.push(this),t.apply(this,r)};return this._actionHandler=e,this}createOption(t,e){return new qt(t,e)}_callParseArg(t,e,i,s){try{return t.parseArg(e,i)}catch(r){if(r.code==="commander.invalidArgument"){let u=`${s} ${r.message}`;this.error(u,{exitCode:r.exitCode,code:r.code})}throw r}}_registerOption(t){let e=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(e){let i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
17
- - already used by option '${e.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let e=s=>[s.name()].concat(s.aliases()),i=e(t).find(s=>this._findCommand(s));if(i){let s=e(this._findCommand(i)).join("|"),r=e(t).join("|");throw new Error(`cannot add command '${r}' as already have command '${s}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let e=t.name(),i=t.attributeName();if(t.negate){let r=t.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let s=(r,u,o)=>{r==null&&t.presetArg!==void 0&&(r=t.presetArg);let l=this.getOptionValue(i);r!==null&&t.parseArg?r=this._callParseArg(t,r,l,u):r!==null&&t.variadic&&(r=t._collectValue(r,l)),r==null&&(t.negate?r=!1:t.isBoolean()||t.optional?r=!0:r=""),this.setOptionValueWithSource(i,r,o)};return this.on("option:"+e,r=>{let u=`error: option '${t.flags}' argument '${r}' is invalid.`;s(r,u,"cli")}),t.envVar&&this.on("optionEnv:"+e,r=>{let u=`error: option '${t.flags}' value '${r}' from env '${t.envVar}' is invalid.`;s(r,u,"env")}),this}_optionEx(t,e,i,s,r){if(typeof e=="object"&&e instanceof qt)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let u=this.createOption(e,i);if(u.makeOptionMandatory(!!t.mandatory),typeof s=="function")u.default(r).argParser(s);else if(s instanceof RegExp){let o=s;s=(l,h)=>{let a=o.exec(l);return a?a[0]:h},u.default(r).argParser(s)}else u.default(s);return this.addOption(u)}option(t,e,i,s){return this._optionEx({},t,e,i,s)}requiredOption(t,e,i,s){return this._optionEx({mandatory:!0},t,e,i,s)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,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(t=!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=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,e){return this.setOptionValueWithSource(t,e,void 0)}setOptionValueWithSource(t,e,i){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let e;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(t)!==void 0&&(e=i.getOptionValueSource(t))}),e}_prepareUserArgs(t,e){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(e=e||{},t===void 0&&e.from===void 0){m.versions?.electron&&(e.from="electron");let s=m.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(e.from="eval")}t===void 0&&(t=m.argv),this.rawArgs=t.slice();let i;switch(e.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":m.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,e){this._prepareForParse();let i=this._prepareUserArgs(t,e);return this._parseCommand([],i),this}async parseAsync(t,e){this._prepareForParse();let i=this._prepareUserArgs(t,e);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
- - 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={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,e,i){if(R.existsSync(t))return;let s=e?`searched for local subcommand relative to directory '${e}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",r=`'${t}' does not exist
14
+ (Did you mean ${i[0]}?)`:""}qe.suggestSimilar=eu});var ze=O(Ce=>{var tu=require("node:events").EventEmitter,pe=require("node:child_process"),x=require("node:path"),N=require("node:fs"),m=require("node:process"),{Argument:uu,humanReadableArgName:iu}=G(),{CommanderError:me}=H(),{Help:su,stripColor:ru}=De(),{Option:Ue,DualOptions:nu}=ce(),{suggestSimilar:Je}=Le(),de=class r extends tu{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:t=>m.stdout.write(t),writeErr:t=>m.stderr.write(t),outputError:(t,i)=>i(t),getOutHelpWidth:()=>m.stdout.isTTY?m.stdout.columns:void 0,getErrHelpWidth:()=>m.stderr.isTTY?m.stderr.columns:void 0,getOutHasColors:()=>fe()??(m.stdout.isTTY&&m.stdout.hasColors?.()),getErrHasColors:()=>fe()??(m.stderr.isTTY&&m.stderr.hasColors?.()),stripColor:t=>ru(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}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 t=this;t;t=t.parent)e.push(t);return e}command(e,t,i){let s=t,n=i;typeof s=="object"&&s!==null&&(n=s,s=null),n=n||{};let[,u,o]=e.match(/([^ ]+) *(.*)/),l=this.createCommand(u);return s&&(l.description(s),l._executableHandler=!0),n.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(n.noHelp||n.hidden),l._executableFile=n.executableFile||null,o&&l.arguments(o),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),s?this:l}createCommand(e){return new r(e)}createHelp(){return Object.assign(new su,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...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,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new uu(e,t)}argument(e,t,i,s){let n=this.createArgument(e,t);return typeof i=="function"?n.default(s).argParser(i):n.default(i),this.addArgument(n),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw new Error(`only the last argument can be variadic '${t.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,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,s,n]=i.match(/([^ ]+) *(.*)/),u=t??"display help for command",o=this.createCommand(s);return o.helpOption(!1),n&&o.arguments(n),u&&o.description(u),this._addImplicitHelpCommand=!0,this._helpCommand=o,(e||t)&&this._initCommandGroup(o),this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
16
+ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,i){this._exitCallback&&this._exitCallback(new me(e,t,i)),m.exit(e)}action(e){let t=i=>{let s=this.registeredArguments.length,n=i.slice(0,s);return this._storeOptionsAsProperties?n[s]=this:n[s]=this.opts(),n.push(this),e.apply(this,n)};return this._actionHandler=t,this}createOption(e,t){return new Ue(e,t)}_callParseArg(e,t,i,s){try{return e.parseArg(t,i)}catch(n){if(n.code==="commander.invalidArgument"){let u=`${s} ${n.message}`;this.error(u,{exitCode:n.exitCode,code:n.code})}throw n}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let i=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 '${i}'
17
+ - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=s=>[s.name()].concat(s.aliases()),i=t(e).find(s=>this._findCommand(s));if(i){let s=t(this._findCommand(i)).join("|"),n=t(e).join("|");throw new Error(`cannot add command '${n}' as already have command '${s}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),i=e.attributeName();if(e.negate){let n=e.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(i,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let s=(n,u,o)=>{n==null&&e.presetArg!==void 0&&(n=e.presetArg);let l=this.getOptionValue(i);n!==null&&e.parseArg?n=this._callParseArg(e,n,l,u):n!==null&&e.variadic&&(n=e._collectValue(n,l)),n==null&&(e.negate?n=!1:e.isBoolean()||e.optional?n=!0:n=""),this.setOptionValueWithSource(i,n,o)};return this.on("option:"+t,n=>{let u=`error: option '${e.flags}' argument '${n}' is invalid.`;s(n,u,"cli")}),e.envVar&&this.on("optionEnv:"+t,n=>{let u=`error: option '${e.flags}' value '${n}' from env '${e.envVar}' is invalid.`;s(n,u,"env")}),this}_optionEx(e,t,i,s,n){if(typeof t=="object"&&t instanceof Ue)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let u=this.createOption(t,i);if(u.makeOptionMandatory(!!e.mandatory),typeof s=="function")u.default(n).argParser(s);else if(s instanceof RegExp){let o=s;s=(l,h)=>{let a=o.exec(l);return a?a[0]:h},u.default(n).argParser(s)}else u.default(s);return this.addOption(u)}option(e,t,i,s){return this._optionEx({},e,t,i,s)}requiredOption(e,t,i,s){return this._optionEx({mandatory:!0},e,t,i,s)}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,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,i){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(t=i.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){m.versions?.electron&&(t.from="electron");let s=m.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(t.from="eval")}e===void 0&&(e=m.argv),this.rawArgs=e.slice();let i;switch(t.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":m.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;case"eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,t){this._prepareForParse();let i=this._prepareUserArgs(e,t);return this._parseCommand([],i),this}async parseAsync(e,t){this._prepareForParse();let i=this._prepareUserArgs(e,t);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - 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={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,i){if(N.existsSync(e))return;let s=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${e}' does not exist
19
19
  - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${s}`;throw new Error(r)}_executeSubCommand(t,e){e=e.slice();let i=!1,s=[".js",".ts",".tsx",".mjs",".cjs"];function r(a,D){let p=O.resolve(a,D);if(R.existsSync(p))return p;if(s.includes(O.extname(D)))return;let g=s.find(v=>R.existsSync(`${p}${v}`));if(g)return`${p}${g}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=t._executableFile||`${this._name}-${t._name}`,o=this._executableDir||"";if(this._scriptPath){let a;try{a=R.realpathSync(this._scriptPath)}catch{a=this._scriptPath}o=O.resolve(O.dirname(a),o)}if(o){let a=r(o,u);if(!a&&!t._executableFile&&this._scriptPath){let D=O.basename(this._scriptPath,O.extname(this._scriptPath));D!==this._name&&(a=r(o,`${D}-${t._name}`))}u=a||u}i=s.includes(O.extname(u));let l;m.platform!=="win32"?i?(e.unshift(u),e=Ut(m.execArgv).concat(e),l=mt.spawn(m.argv[0],e,{stdio:"inherit"})):l=mt.spawn(u,e,{stdio:"inherit"}):(this._checkForMissingExecutable(u,o,t._name),e.unshift(u),e=Ut(m.execArgv).concat(e),l=mt.spawn(m.execPath,e,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(D=>{m.on(D,()=>{l.killed===!1&&l.exitCode===null&&l.kill(D)})});let h=this._exitCallback;l.on("close",a=>{a=a??1,h?h(new dt(a,"commander.executeSubCommandAsync","(close)")):m.exit(a)}),l.on("error",a=>{if(a.code==="ENOENT")this._checkForMissingExecutable(u,o,t._name);else if(a.code==="EACCES")throw new Error(`'${u}' not executable`);if(!h)m.exit(1);else{let D=new dt(1,"commander.executeSubCommandAsync","(error)");D.nestedError=a,h(D)}}),this.runningCommand=l}_dispatchSubcommand(t,e,i){let s=this._findCommand(t);s||this.help({error:!0}),s._prepareForParse();let r;return r=this._chainOrCallSubCommandHook(r,s,"preSubcommand"),r=this._chainOrCall(r,()=>{if(s._executableHandler)this._executeSubCommand(s,e.concat(i));else return s._parseCommand(e,i)}),r}_dispatchHelpCommand(t){t||this.help();let e=this._findCommand(t);return e&&!e._executableHandler&&e.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,e)=>{t.required&&this.args[e]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(i,s,r)=>{let u=s;if(s!==null&&i.parseArg){let o=`error: command-argument value '${s}' is invalid for argument '${i.name()}'.`;u=this._callParseArg(i,s,r,o)}return u};this._checkNumberOfArguments();let e=[];this.registeredArguments.forEach((i,s)=>{let r=i.defaultValue;i.variadic?s<this.args.length?(r=this.args.slice(s),i.parseArg&&(r=r.reduce((u,o)=>t(i,o,u),i.defaultValue))):r===void 0&&(r=[]):s<this.args.length&&(r=this.args[s],i.parseArg&&(r=t(i,r,i.defaultValue))),e[s]=r}),this.processedArgs=e}_chainOrCall(t,e){return t?.then&&typeof t.then=="function"?t.then(()=>e()):e()}_chainOrCallHooks(t,e){let i=t,s=[];return this._getCommandAndAncestors().reverse().filter(r=>r._lifeCycleHooks[e]!==void 0).forEach(r=>{r._lifeCycleHooks[e].forEach(u=>{s.push({hookedCommand:r,callback:u})})}),e==="postAction"&&s.reverse(),s.forEach(r=>{i=this._chainOrCall(i,()=>r.callback(r.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,e,i){let s=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(r=>{s=this._chainOrCall(s,()=>r(this,e))}),s}_parseCommand(t,e){let i=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),e=i.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(e),this._dispatchSubcommand(this._defaultCommandName,t,e);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},r=`command:${this.name()}`;if(this._actionHandler){s(),this._processArguments();let u;return u=this._chainOrCallHooks(u,"preAction"),u=this._chainOrCall(u,()=>this._actionHandler(this.processedArgs)),this.parent&&(u=this._chainOrCall(u,()=>{this.parent.emit(r,t,e)})),u=this._chainOrCallHooks(u,"postAction"),u}if(this.parent?.listenerCount(r))s(),this._processArguments(),this.parent.emit(r,t,e);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e);this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(s(),this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(e=>e._name===t||e._aliases.includes(t))}_findOption(t){return this.options.find(e=>e.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(e=>{e.mandatory&&t.getOptionValue(e.attributeName())===void 0&&t.missingMandatoryOptionValue(e)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(i=>{let s=i.attributeName();return this.getOptionValue(s)===void 0?!1:this.getOptionValueSource(s)!=="default"});t.filter(i=>i.conflictsWith.length>0).forEach(i=>{let s=t.find(r=>i.conflictsWith.includes(r.attributeName()));s&&this._conflictingOption(i,s)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let e=[],i=[],s=e;function r(a){return a.length>1&&a[0]==="-"}let u=a=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(a)?!this._getCommandAndAncestors().some(D=>D.options.map(p=>p.short).some(p=>/^-\d$/.test(p))):!1,o=null,l=null,h=0;for(;h<t.length||l;){let a=l??t[h++];if(l=null,a==="--"){s===i&&s.push(a),s.push(...t.slice(h));break}if(o&&(!r(a)||u(a))){this.emit(`option:${o.name()}`,a);continue}if(o=null,r(a)){let D=this._findOption(a);if(D){if(D.required){let p=t[h++];p===void 0&&this.optionMissingArgument(D),this.emit(`option:${D.name()}`,p)}else if(D.optional){let p=null;h<t.length&&(!r(t[h])||u(t[h]))&&(p=t[h++]),this.emit(`option:${D.name()}`,p)}else this.emit(`option:${D.name()}`);o=D.variadic?D:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let D=this._findOption(`-${a[1]}`);if(D){D.required||D.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${D.name()}`,a.slice(2)):(this.emit(`option:${D.name()}`),l=`-${a.slice(2)}`);continue}}if(/^--[^=]+=/.test(a)){let D=a.indexOf("="),p=this._findOption(a.slice(0,D));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,a.slice(D+1));continue}}if(s===e&&r(a)&&!(this.commands.length===0&&u(a))&&(s=i),(this._enablePositionalOptions||this._passThroughOptions)&&e.length===0&&i.length===0){if(this._findCommand(a)){e.push(a),i.push(...t.slice(h));break}else if(this._getHelpCommand()&&a===this._getHelpCommand().name()){e.push(a,...t.slice(h));break}else if(this._defaultCommandName){i.push(a,...t.slice(h));break}}if(this._passThroughOptions){s.push(a,...t.slice(h));break}s.push(a)}return{operands:e,unknown:i}}opts(){if(this._storeOptionsAsProperties){let t={},e=this.options.length;for(let i=0;i<e;i++){let s=this.options[i].attributeName();t[s]=s===this._versionOptionName?this._version:this[s]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,e)=>Object.assign(t,e.opts()),{})}error(t,e){this._outputConfiguration.outputError(`${t}
21
+ - ${s}`;throw new Error(n)}_executeSubCommand(e,t){t=t.slice();let i=!1,s=[".js",".ts",".tsx",".mjs",".cjs"];function n(a,D){let p=x.resolve(a,D);if(N.existsSync(p))return p;if(s.includes(x.extname(D)))return;let g=s.find(v=>N.existsSync(`${p}${v}`));if(g)return`${p}${g}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,o=this._executableDir||"";if(this._scriptPath){let a;try{a=N.realpathSync(this._scriptPath)}catch{a=this._scriptPath}o=x.resolve(x.dirname(a),o)}if(o){let a=n(o,u);if(!a&&!e._executableFile&&this._scriptPath){let D=x.basename(this._scriptPath,x.extname(this._scriptPath));D!==this._name&&(a=n(o,`${D}-${e._name}`))}u=a||u}i=s.includes(x.extname(u));let l;m.platform!=="win32"?i?(t.unshift(u),t=Ke(m.execArgv).concat(t),l=pe.spawn(m.argv[0],t,{stdio:"inherit"})):l=pe.spawn(u,t,{stdio:"inherit"}):(this._checkForMissingExecutable(u,o,e._name),t.unshift(u),t=Ke(m.execArgv).concat(t),l=pe.spawn(m.execPath,t,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(D=>{m.on(D,()=>{l.killed===!1&&l.exitCode===null&&l.kill(D)})});let h=this._exitCallback;l.on("close",a=>{a=a??1,h?h(new me(a,"commander.executeSubCommandAsync","(close)")):m.exit(a)}),l.on("error",a=>{if(a.code==="ENOENT")this._checkForMissingExecutable(u,o,e._name);else if(a.code==="EACCES")throw new Error(`'${u}' not executable`);if(!h)m.exit(1);else{let D=new me(1,"commander.executeSubCommandAsync","(error)");D.nestedError=a,h(D)}}),this.runningCommand=l}_dispatchSubcommand(e,t,i){let s=this._findCommand(e);s||this.help({error:!0}),s._prepareForParse();let n;return n=this._chainOrCallSubCommandHook(n,s,"preSubcommand"),n=this._chainOrCall(n,()=>{if(s._executableHandler)this._executeSubCommand(s,t.concat(i));else return s._parseCommand(t,i)}),n}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==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=(i,s,n)=>{let u=s;if(s!==null&&i.parseArg){let o=`error: command-argument value '${s}' is invalid for argument '${i.name()}'.`;u=this._callParseArg(i,s,n,o)}return u};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((i,s)=>{let n=i.defaultValue;i.variadic?s<this.args.length?(n=this.args.slice(s),i.parseArg&&(n=n.reduce((u,o)=>e(i,o,u),i.defaultValue))):n===void 0&&(n=[]):s<this.args.length&&(n=this.args[s],i.parseArg&&(n=e(i,n,i.defaultValue))),t[s]=n}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let i=e,s=[];return this._getCommandAndAncestors().reverse().filter(n=>n._lifeCycleHooks[t]!==void 0).forEach(n=>{n._lifeCycleHooks[t].forEach(u=>{s.push({hookedCommand:n,callback:u})})}),t==="postAction"&&s.reverse(),s.forEach(n=>{i=this._chainOrCall(i,()=>n.callback(n.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,t,i){let s=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(n=>{s=this._chainOrCall(s,()=>n(this,t))}),s}_parseCommand(e,t){let i=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),t=i.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},n=`command:${this.name()}`;if(this._actionHandler){s(),this._processArguments();let u;return u=this._chainOrCallHooks(u,"preAction"),u=this._chainOrCall(u,()=>this._actionHandler(this.processedArgs)),this.parent&&(u=this._chainOrCall(u,()=>{this.parent.emit(n,e,t)})),u=this._chainOrCallHooks(u,"postAction"),u}if(this.parent?.listenerCount(n))s(),this._processArguments(),this.parent.emit(n,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(s(),this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let s=i.attributeName();return this.getOptionValue(s)===void 0?!1:this.getOptionValueSource(s)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let s=e.find(n=>i.conflictsWith.includes(n.attributeName()));s&&this._conflictingOption(i,s)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],i=[],s=t;function n(a){return a.length>1&&a[0]==="-"}let u=a=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(a)?!this._getCommandAndAncestors().some(D=>D.options.map(p=>p.short).some(p=>/^-\d$/.test(p))):!1,o=null,l=null,h=0;for(;h<e.length||l;){let a=l??e[h++];if(l=null,a==="--"){s===i&&s.push(a),s.push(...e.slice(h));break}if(o&&(!n(a)||u(a))){this.emit(`option:${o.name()}`,a);continue}if(o=null,n(a)){let D=this._findOption(a);if(D){if(D.required){let p=e[h++];p===void 0&&this.optionMissingArgument(D),this.emit(`option:${D.name()}`,p)}else if(D.optional){let p=null;h<e.length&&(!n(e[h])||u(e[h]))&&(p=e[h++]),this.emit(`option:${D.name()}`,p)}else this.emit(`option:${D.name()}`);o=D.variadic?D:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let D=this._findOption(`-${a[1]}`);if(D){D.required||D.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${D.name()}`,a.slice(2)):(this.emit(`option:${D.name()}`),l=`-${a.slice(2)}`);continue}}if(/^--[^=]+=/.test(a)){let D=a.indexOf("="),p=this._findOption(a.slice(0,D));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,a.slice(D+1));continue}}if(s===t&&n(a)&&!(this.commands.length===0&&u(a))&&(s=i),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&i.length===0){if(this._findCommand(a)){t.push(a),i.push(...e.slice(h));break}else if(this._getHelpCommand()&&a===this._getHelpCommand().name()){t.push(a,...e.slice(h));break}else if(this._defaultCommandName){i.push(a,...e.slice(h));break}}if(this._passThroughOptions){s.push(a,...e.slice(h));break}s.push(a)}return{operands:t,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let i=0;i<t;i++){let s=this.options[i].attributeName();e[s]=s===this._versionOptionName?this._version:this[s]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0}));let i=e||{},s=i.exitCode||1,r=i.code||"commander.error";this._exit(s,r,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in m.env){let e=t.attributeName();(this.getOptionValue(e)===void 0||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,m.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new su(this.options),e=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&e(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(s=>!e(s)).forEach(s=>{this.setOptionValueWithSource(s,i.implied[s],"implied")})})}missingArgument(t){let e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){let e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){let i=u=>{let o=u.attributeName(),l=this.getOptionValue(o),h=this.options.find(D=>D.negate&&o===D.attributeName()),a=this.options.find(D=>!D.negate&&o===D.attributeName());return h&&(h.presetArg===void 0&&l===!1||h.presetArg!==void 0&&l===h.presetArg)?h:a||u},s=u=>{let o=i(u),l=o.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${o.envVar}'`:`option '${o.flags}'`},r=`error: ${s(t)} cannot be used with ${s(e)}`;this.error(r,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let s=[],r=this;do{let u=r.createHelp().visibleOptions(r).filter(o=>o.long).map(o=>o.long);s=s.concat(u),r=r.parent}while(r&&!r._enablePositionalOptions);e=Lt(t,s)}let i=`error: unknown option '${t}'${e}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let e=this.registeredArguments.length,i=e===1?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${i} but got ${t.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],e="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(r=>{s.push(r.name()),r.alias()&&s.push(r.alias())}),e=Lt(t,s)}let i=`error: unknown command '${t}'${e}`;this.error(i,{code:"commander.unknownCommand"})}version(t,e,i){if(t===void 0)return this._version;this._version=t,e=e||"-V, --version",i=i||"output the version number";let s=this.createOption(e,i);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
- `),this._exit(0,"commander.version",t)}),this}description(t,e){return t===void 0&&e===void 0?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let e=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),t===e._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let s=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${s}'`)}return e._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(e=>this.alias(e)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(i=>eu(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=O.basename(t,O.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let e=this.createHelp(),i=this._getOutputContext(t);e.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let s=e.formatHelp(this,e);return i.hasColors?s:this._outputConfiguration.stripColor(s)}_getOutputContext(t){t=t||{};let e=!!t.error,i,s,r;return e?(i=o=>this._outputConfiguration.writeErr(o),s=this._outputConfiguration.getErrHasColors(),r=this._outputConfiguration.getErrHelpWidth()):(i=o=>this._outputConfiguration.writeOut(o),s=this._outputConfiguration.getOutHasColors(),r=this._outputConfiguration.getOutHelpWidth()),{error:e,write:o=>(s||(o=this._outputConfiguration.stripColor(o)),i(o)),hasColors:s,helpWidth:r}}outputHelp(t){let e;typeof t=="function"&&(e=t,t=void 0);let i=this._getOutputContext(t),s={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(u=>u.emit("beforeAllHelp",s)),this.emit("beforeHelp",s);let r=this.helpInformation({error:i.error});if(e&&(r=e(r),typeof r!="string"&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(r),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",s),this._getCommandAndAncestors().forEach(u=>u.emit("afterAllHelp",s))}helpOption(t,e){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",e??"display help for command"),(t||e)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let e=Number(m.exitCode??0);e===0&&t&&typeof t!="function"&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
- Expecting one of '${i.join("', '")}'`);let s=`${t}Help`;return this.on(s,r=>{let u;typeof e=="function"?u=e({error:r.error,command:r.command}):u=e,u&&r.write(`${u}
27
- `)}),this}_outputHelpIfRequested(t){let e=this._getHelpOption();e&&t.find(s=>e.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ut(n){return n.map(t=>{if(!t.startsWith("--inspect"))return t;let e,i="127.0.0.1",s="9229",r;return(r=t.match(/^(--inspect(-brk)?)$/))!==null?e=r[1]:(r=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(e=r[1],/^\d+$/.test(r[3])?s=r[3]:i=r[3]):(r=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(e=r[1],i=r[3],s=r[4]),e&&s!=="0"?`${e}=${i}:${parseInt(s)+1}`:t})}function Ct(){if(m.env.NO_COLOR||m.env.FORCE_COLOR==="0"||m.env.FORCE_COLOR==="false")return!1;if(m.env.FORCE_COLOR||m.env.CLICOLOR_FORCE!==void 0)return!0}Ft.Command=ft;Ft.useColor=Ct});var Zt=x(A=>{var{Argument:Kt}=G(),{Command:gt}=Jt(),{CommanderError:ru,InvalidArgumentError:zt}=P(),{Help:nu}=at(),{Option:Yt}=pt();A.program=new gt;A.createCommand=n=>new gt(n);A.createOption=(n,t)=>new Yt(n,t);A.createArgument=(n,t)=>new Kt(n,t);A.Command=gt;A.Option=Yt;A.Argument=Kt;A.Help=nu;A.CommanderError=ru;A.InvalidArgumentError=zt;A.InvalidOptionArgumentError=zt});var $t=x((mi,te)=>{"use strict";var Et="\x1B",f=`${Et}[`,ou="\x07",bt={to(n,t){return t?`${f}${t+1};${n+1}H`:`${f}${n+1}G`},move(n,t){let e="";return n<0?e+=`${f}${-n}D`:n>0&&(e+=`${f}${n}C`),t<0?e+=`${f}${-t}A`:t>0&&(e+=`${f}${t}B`),e},up:(n=1)=>`${f}${n}A`,down:(n=1)=>`${f}${n}B`,forward:(n=1)=>`${f}${n}C`,backward:(n=1)=>`${f}${n}D`,nextLine:(n=1)=>`${f}E`.repeat(n),prevLine:(n=1)=>`${f}F`.repeat(n),left:`${f}G`,hide:`${f}?25l`,show:`${f}?25h`,save:`${Et}7`,restore:`${Et}8`},Du={up:(n=1)=>`${f}S`.repeat(n),down:(n=1)=>`${f}T`.repeat(n)},au={screen:`${f}2J`,up:(n=1)=>`${f}1J`.repeat(n),down:(n=1)=>`${f}J`.repeat(n),line:`${f}2K`,lineEnd:`${f}K`,lineStart:`${f}1K`,lines(n){let t="";for(let e=0;e<n;e++)t+=this.line+(e<n-1?bt.up():"");return n&&(t+=bt.left),t}};te.exports={cursor:bt,scroll:Du,erase:au,beep:ou}});var At=x((di,_t)=>{var q=process||{},ee=q.argv||[],N=q.env||{},lu=!(N.NO_COLOR||ee.includes("--no-color"))&&(!!N.FORCE_COLOR||ee.includes("--color")||q.platform==="win32"||(q.stdout||{}).isTTY&&N.TERM!=="dumb"||!!N.CI),hu=(n,t,e=n)=>i=>{let s=""+i,r=s.indexOf(t,n.length);return~r?n+cu(s,t,e,r)+t:n+s+t},cu=(n,t,e,i)=>{let s="",r=0;do s+=n.substring(r,i)+e,r=i+t.length,i=n.indexOf(t,r);while(~i);return s+n.substring(r)},ue=(n=lu)=>{let t=n?hu:()=>String;return{isColorSupported:n,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};_t.exports=ue();_t.exports.createColors=ue});var Qt=w(Zt(),1),{program:ii,createCommand:si,createArgument:ri,createOption:ni,CommanderError:oi,InvalidArgumentError:Di,InvalidOptionArgumentError:ai,Command:Xt,Argument:li,Option:hi,Help:ci}=Qt.default;var Q=require("node:util");var b=w($t(),1),V=require("node:process"),S=w(require("node:readline"),1),yt=w(require("node:readline"),1),le=require("node:stream"),he=w(At(),1);function pu({onlyFirst:n=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,n?void 0:"g")}var mu=pu();function ce(n){if(typeof n!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof n}\``);return n.replace(mu,"")}function pe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var me={exports:{}};(function(n){var t={};n.exports=t,t.eastAsianWidth=function(i){var s=i.charCodeAt(0),r=i.length==2?i.charCodeAt(1):0,u=s;return 55296<=s&&s<=56319&&56320<=r&&r<=57343&&(s&=1023,r&=1023,u=s<<10|r,u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},t.characterLength=function(i){var s=this.eastAsianWidth(i);return s=="F"||s=="W"||s=="A"?2:1};function e(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(i){for(var s=e(i),r=0,u=0;u<s.length;u++)r=r+this.characterLength(s[u]);return r},t.slice=function(i,s,r){textLen=t.length(i),s=s||0,r=r||1,s<0&&(s=textLen+s),r<0&&(r=textLen+r);for(var u="",o=0,l=e(i),h=0;h<l.length;h++){var a=l[h],D=t.length(a);if(o>=s-(D==2?1:0))if(o+D<=r)u+=a;else break;o+=D}return u}})(me);var du=me.exports,fu=pe(du),Cu=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},Fu=pe(Cu);function I(n,t={}){if(typeof n!="string"||n.length===0||(t={ambiguousIsNarrow:!0,...t},n=ce(n),n.length===0))return 0;n=n.replace(Fu()," ");let e=t.ambiguousIsNarrow?1:2,i=0;for(let s of n){let r=s.codePointAt(0);if(!(r<=31||r>=127&&r<=159||r>=768&&r<=879))switch(fu.eastAsianWidth(s)){case"F":case"W":i+=2;break;case"A":i+=e;break;default:i+=1}}return i}var Bt=10,ie=(n=0)=>t=>`\x1B[${t+n}m`,se=(n=0)=>t=>`\x1B[${38+n};5;${t}m`,re=(n=0)=>(t,e,i)=>`\x1B[${38+n};2;${t};${e};${i}m`,d={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(d.modifier);var gu=Object.keys(d.color),Eu=Object.keys(d.bgColor);[...gu,...Eu];function bu(){let n=new Map;for(let[t,e]of Object.entries(d)){for(let[i,s]of Object.entries(e))d[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},e[i]=d[i],n.set(s[0],s[1]);Object.defineProperty(d,t,{value:e,enumerable:!1})}return Object.defineProperty(d,"codes",{value:n,enumerable:!1}),d.color.close="\x1B[39m",d.bgColor.close="\x1B[49m",d.color.ansi=ie(),d.color.ansi256=se(),d.color.ansi16m=re(),d.bgColor.ansi=ie(Bt),d.bgColor.ansi256=se(Bt),d.bgColor.ansi16m=re(Bt),Object.defineProperties(d,{rgbToAnsi256:{value:(t,e,i)=>t===e&&e===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:t=>{let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e)return[0,0,0];let[i]=e;i.length===3&&(i=[...i].map(r=>r+r).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>d.rgbToAnsi256(...d.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let e,i,s;if(t>=232)e=((t-232)*10+8)/255,i=e,s=e;else{t-=16;let o=t%36;e=Math.floor(t/36)/5,i=Math.floor(o/6)/5,s=o%6/5}let r=Math.max(e,i,s)*2;if(r===0)return 30;let u=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(e));return r===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(t,e,i)=>d.ansi256ToAnsi(d.rgbToAnsi256(t,e,i)),enumerable:!1},hexToAnsi:{value:t=>d.ansi256ToAnsi(d.hexToAnsi256(t)),enumerable:!1}}),d}var $u=bu(),Y=new Set(["\x1B","\x9B"]),_u=39,xt="\x07",de="[",Au="]",fe="m",Ot=`${Au}8;;`,ne=n=>`${Y.values().next().value}${de}${n}${fe}`,oe=n=>`${Y.values().next().value}${Ot}${n}${xt}`,Bu=n=>n.split(" ").map(t=>I(t)),vt=(n,t,e)=>{let i=[...t],s=!1,r=!1,u=I(ce(n[n.length-1]));for(let[o,l]of i.entries()){let h=I(l);if(u+h<=e?n[n.length-1]+=l:(n.push(l),u=0),Y.has(l)&&(s=!0,r=i.slice(o+1).join("").startsWith(Ot)),s){r?l===xt&&(s=!1,r=!1):l===fe&&(s=!1);continue}u+=h,u===e&&o<i.length-1&&(n.push(""),u=0)}!u&&n[n.length-1].length>0&&n.length>1&&(n[n.length-2]+=n.pop())},vu=n=>{let t=n.split(" "),e=t.length;for(;e>0&&!(I(t[e-1])>0);)e--;return e===t.length?n:t.slice(0,e).join(" ")+t.slice(e).join("")},yu=(n,t,e={})=>{if(e.trim!==!1&&n.trim()==="")return"";let i="",s,r,u=Bu(n),o=[""];for(let[h,a]of n.split(" ").entries()){e.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let D=I(o[o.length-1]);if(h!==0&&(D>=t&&(e.wordWrap===!1||e.trim===!1)&&(o.push(""),D=0),(D>0||e.trim===!1)&&(o[o.length-1]+=" ",D++)),e.hard&&u[h]>t){let p=t-D,g=1+Math.floor((u[h]-p-1)/t);Math.floor((u[h]-1)/t)<g&&o.push(""),vt(o,a,t);continue}if(D+u[h]>t&&D>0&&u[h]>0){if(e.wordWrap===!1&&D<t){vt(o,a,t);continue}o.push("")}if(D+u[h]>t&&e.wordWrap===!1){vt(o,a,t);continue}o[o.length-1]+=a}e.trim!==!1&&(o=o.map(h=>vu(h)));let l=[...o.join(`
28
- `)];for(let[h,a]of l.entries()){if(i+=a,Y.has(a)){let{groups:p}=new RegExp(`(?:\\${de}(?<code>\\d+)m|\\${Ot}(?<uri>.*)${xt})`).exec(l.slice(h).join(""))||{groups:{}};if(p.code!==void 0){let g=Number.parseFloat(p.code);s=g===_u?void 0:g}else p.uri!==void 0&&(r=p.uri.length===0?void 0:p.uri)}let D=$u.codes.get(Number(s));l[h+1]===`
29
- `?(r&&(i+=oe("")),s&&D&&(i+=ne(D))):a===`
30
- `&&(s&&D&&(i+=ne(s)),r&&(i+=oe(r)))}return i};function De(n,t,e){return String(n).normalize().replace(/\r\n/g,`
24
+ `),this.outputHelp({error:!0}));let i=t||{},s=i.exitCode||1,n=i.code||"commander.error";this._exit(s,n,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in m.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,m.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new nu(this.options),t=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&t(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(s=>!t(s)).forEach(s=>{this.setOptionValueWithSource(s,i.implied[s],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let i=u=>{let o=u.attributeName(),l=this.getOptionValue(o),h=this.options.find(D=>D.negate&&o===D.attributeName()),a=this.options.find(D=>!D.negate&&o===D.attributeName());return h&&(h.presetArg===void 0&&l===!1||h.presetArg!==void 0&&l===h.presetArg)?h:a||u},s=u=>{let o=i(u),l=o.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${o.envVar}'`:`option '${o.flags}'`},n=`error: ${s(e)} cannot be used with ${s(t)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let s=[],n=this;do{let u=n.createHelp().visibleOptions(n).filter(o=>o.long).map(o=>o.long);s=s.concat(u),n=n.parent}while(n&&!n._enablePositionalOptions);t=Je(e,s)}let i=`error: unknown option '${e}'${t}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,i=t===1?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${i} but got ${e.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(n=>{s.push(n.name()),n.alias()&&s.push(n.alias())}),t=Je(e,s)}let i=`error: unknown command '${e}'${t}`;this.error(i,{code:"commander.unknownCommand"})}version(e,t,i){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",i=i||"output the version number";let s=this.createOption(t,i);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${e}
25
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let s=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(i=>iu(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=x.basename(e,x.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),i=this._getOutputContext(e);t.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let s=t.formatHelp(this,t);return i.hasColors?s:this._outputConfiguration.stripColor(s)}_getOutputContext(e){e=e||{};let t=!!e.error,i,s,n;return t?(i=o=>this._outputConfiguration.writeErr(o),s=this._outputConfiguration.getErrHasColors(),n=this._outputConfiguration.getErrHelpWidth()):(i=o=>this._outputConfiguration.writeOut(o),s=this._outputConfiguration.getOutHasColors(),n=this._outputConfiguration.getOutHelpWidth()),{error:t,write:o=>(s||(o=this._outputConfiguration.stripColor(o)),i(o)),hasColors:s,helpWidth:n}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let i=this._getOutputContext(e),s={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(u=>u.emit("beforeAllHelp",s)),this.emit("beforeHelp",s);let n=this.helpInformation({error:i.error});if(t&&(n=t(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",s),this._getCommandAndAncestors().forEach(u=>u.emit("afterAllHelp",s))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(m.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${i.join("', '")}'`);let s=`${e}Help`;return this.on(s,n=>{let u;typeof t=="function"?u=t({error:n.error,command:n.command}):u=t,u&&n.write(`${u}
27
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(s=>t.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ke(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,i="127.0.0.1",s="9229",n;return(n=e.match(/^(--inspect(-brk)?)$/))!==null?t=n[1]:(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=n[1],/^\d+$/.test(n[3])?s=n[3]:i=n[3]):(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=n[1],i=n[3],s=n[4]),t&&s!=="0"?`${t}=${i}:${parseInt(s)+1}`:e})}function fe(){if(m.env.NO_COLOR||m.env.FORCE_COLOR==="0"||m.env.FORCE_COLOR==="false")return!1;if(m.env.FORCE_COLOR||m.env.CLICOLOR_FORCE!==void 0)return!0}Ce.Command=de;Ce.useColor=fe});var Xe=O(A=>{var{Argument:Ye}=G(),{Command:Fe}=ze(),{CommanderError:ou,InvalidArgumentError:Ze}=H(),{Help:Du}=De(),{Option:Qe}=ce();A.program=new Fe;A.createCommand=r=>new Fe(r);A.createOption=(r,e)=>new Qe(r,e);A.createArgument=(r,e)=>new Ye(r,e);A.Command=Fe;A.Option=Qe;A.Argument=Ye;A.Help=Du;A.CommanderError=ou;A.InvalidArgumentError=Ze;A.InvalidOptionArgumentError=Ze});var be=O((Bi,ut)=>{"use strict";var ge="\x1B",f=`${ge}[`,au="\x07",Ee={to(r,e){return e?`${f}${e+1};${r+1}H`:`${f}${r+1}G`},move(r,e){let t="";return r<0?t+=`${f}${-r}D`:r>0&&(t+=`${f}${r}C`),e<0?t+=`${f}${-e}A`:e>0&&(t+=`${f}${e}B`),t},up:(r=1)=>`${f}${r}A`,down:(r=1)=>`${f}${r}B`,forward:(r=1)=>`${f}${r}C`,backward:(r=1)=>`${f}${r}D`,nextLine:(r=1)=>`${f}E`.repeat(r),prevLine:(r=1)=>`${f}F`.repeat(r),left:`${f}G`,hide:`${f}?25l`,show:`${f}?25h`,save:`${ge}7`,restore:`${ge}8`},lu={up:(r=1)=>`${f}S`.repeat(r),down:(r=1)=>`${f}T`.repeat(r)},hu={screen:`${f}2J`,up:(r=1)=>`${f}1J`.repeat(r),down:(r=1)=>`${f}J`.repeat(r),line:`${f}2K`,lineEnd:`${f}K`,lineStart:`${f}1K`,lines(r){let e="";for(let t=0;t<r;t++)e+=this.line+(t<r-1?Ee.up():"");return r&&(e+=Ee.left),e}};ut.exports={cursor:Ee,scroll:lu,erase:hu,beep:au}});var _e=O((vi,$e)=>{var q=process||{},it=q.argv||[],R=q.env||{},cu=!(R.NO_COLOR||it.includes("--no-color"))&&(!!R.FORCE_COLOR||it.includes("--color")||q.platform==="win32"||(q.stdout||{}).isTTY&&R.TERM!=="dumb"||!!R.CI),pu=(r,e,t=r)=>i=>{let s=""+i,n=s.indexOf(e,r.length);return~n?r+mu(s,e,t,n)+e:r+s+e},mu=(r,e,t,i)=>{let s="",n=0;do s+=r.substring(n,i)+t,n=i+e.length,i=r.indexOf(e,n);while(~i);return s+r.substring(n)},st=(r=cu)=>{let e=r?pu:()=>String;return{isColorSupported:r,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};$e.exports=st();$e.exports.createColors=st});var Tt=O((Ui,kt)=>{"use strict";var Pe=Object.defineProperty,Ku=Object.getOwnPropertyDescriptor,zu=Object.getOwnPropertyNames,Yu=Object.prototype.hasOwnProperty,Zu=(r,e)=>{for(var t in e)Pe(r,t,{get:e[t],enumerable:!0})},Qu=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of zu(e))!Yu.call(r,s)&&s!==t&&Pe(r,s,{get:()=>e[s],enumerable:!(i=Ku(e,s))||i.enumerable});return r},Xu=r=>Qu(Pe({},"__esModule",{value:!0}),r),St={};Zu(St,{default:()=>ui});kt.exports=Xu(St);var ei=class{baseUrl;defaultHeaders;constructor(r,e={}){this.baseUrl=r,this.defaultHeaders=e}buildUrl(r){return`${this.baseUrl.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}async request(r,e,t,i={}){let s=this.buildUrl(e),n=await fetch(s,{method:r,headers:{"Content-Type":"application/json",...this.defaultHeaders,...i},body:t?JSON.stringify(t):void 0});if(!n.ok){let o=await n.text().catch(()=>"");throw new Error(`HTTP ${n.status} ${n.statusText}: ${o||"Request failed"}`)}let u=await n.text();try{return JSON.parse(u)}catch{return u}}get(r,e){return this.request("GET",r,void 0,e)}post(r,e,t){return this.request("POST",r,e,t)}put(r,e,t){return this.request("PUT",r,e,t)}delete(r,e){return this.request("DELETE",r,void 0,e)}},Ve=new ei("http://127.0.0.1:8080/api/public"),ti=class{constructor(){}fetchBlock=async r=>Ve.get(`/v1/template-group/code/${r}`);getBlockInputFromUserQuery=async(r,e)=>Ve.post("/v1/template-group/get-block-input-from-user-query",{blockInput:r,query:e});resolveMultipleTemplates=async(r,e)=>Ve.post("/v1/template-group/resolve-multiple-templates-by-block-code",{blockCode:r,data:e})},ui=ti});var et=y(Xe(),1),{program:mi,createCommand:di,createArgument:fi,createOption:Ci,CommanderError:Fi,InvalidArgumentError:gi,InvalidOptionArgumentError:Ei,Command:tt,Argument:bi,Option:$i,Help:_i}=et.default;var Q=require("node:util");var b=y(be(),1),V=require("node:process"),S=y(require("node:readline"),1),ve=y(require("node:readline"),1),ct=require("node:stream"),pt=y(_e(),1);function du({onlyFirst:r=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,r?void 0:"g")}var fu=du();function mt(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(fu,"")}function dt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ft={exports:{}};(function(r){var e={};r.exports=e,e.eastAsianWidth=function(i){var s=i.charCodeAt(0),n=i.length==2?i.charCodeAt(1):0,u=s;return 55296<=s&&s<=56319&&56320<=n&&n<=57343&&(s&=1023,n&=1023,u=s<<10|n,u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},e.characterLength=function(i){var s=this.eastAsianWidth(i);return s=="F"||s=="W"||s=="A"?2:1};function t(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(i){for(var s=t(i),n=0,u=0;u<s.length;u++)n=n+this.characterLength(s[u]);return n},e.slice=function(i,s,n){textLen=e.length(i),s=s||0,n=n||1,s<0&&(s=textLen+s),n<0&&(n=textLen+n);for(var u="",o=0,l=t(i),h=0;h<l.length;h++){var a=l[h],D=e.length(a);if(o>=s-(D==2?1:0))if(o+D<=n)u+=a;else break;o+=D}return u}})(ft);var Cu=ft.exports,Fu=dt(Cu),gu=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},Eu=dt(gu);function I(r,e={}){if(typeof r!="string"||r.length===0||(e={ambiguousIsNarrow:!0,...e},r=mt(r),r.length===0))return 0;r=r.replace(Eu()," ");let t=e.ambiguousIsNarrow?1:2,i=0;for(let s of r){let n=s.codePointAt(0);if(!(n<=31||n>=127&&n<=159||n>=768&&n<=879))switch(Fu.eastAsianWidth(s)){case"F":case"W":i+=2;break;case"A":i+=t;break;default:i+=1}}return i}var Ae=10,rt=(r=0)=>e=>`\x1B[${e+r}m`,nt=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,ot=(r=0)=>(e,t,i)=>`\x1B[${38+r};2;${e};${t};${i}m`,d={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(d.modifier);var bu=Object.keys(d.color),$u=Object.keys(d.bgColor);[...bu,...$u];function _u(){let r=new Map;for(let[e,t]of Object.entries(d)){for(let[i,s]of Object.entries(t))d[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},t[i]=d[i],r.set(s[0],s[1]);Object.defineProperty(d,e,{value:t,enumerable:!1})}return Object.defineProperty(d,"codes",{value:r,enumerable:!1}),d.color.close="\x1B[39m",d.bgColor.close="\x1B[49m",d.color.ansi=rt(),d.color.ansi256=nt(),d.color.ansi16m=ot(),d.bgColor.ansi=rt(Ae),d.bgColor.ansi256=nt(Ae),d.bgColor.ansi16m=ot(Ae),Object.defineProperties(d,{rgbToAnsi256:{value:(e,t,i)=>e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[i]=t;i.length===3&&(i=[...i].map(n=>n+n).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>d.rgbToAnsi256(...d.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,i,s;if(e>=232)t=((e-232)*10+8)/255,i=t,s=t;else{e-=16;let o=e%36;t=Math.floor(e/36)/5,i=Math.floor(o/6)/5,s=o%6/5}let n=Math.max(t,i,s)*2;if(n===0)return 30;let u=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(t));return n===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(e,t,i)=>d.ansi256ToAnsi(d.rgbToAnsi256(e,t,i)),enumerable:!1},hexToAnsi:{value:e=>d.ansi256ToAnsi(d.hexToAnsi256(e)),enumerable:!1}}),d}var Au=_u(),Y=new Set(["\x1B","\x9B"]),Bu=39,we="\x07",Ct="[",vu="]",Ft="m",Oe=`${vu}8;;`,Dt=r=>`${Y.values().next().value}${Ct}${r}${Ft}`,at=r=>`${Y.values().next().value}${Oe}${r}${we}`,yu=r=>r.split(" ").map(e=>I(e)),Be=(r,e,t)=>{let i=[...e],s=!1,n=!1,u=I(mt(r[r.length-1]));for(let[o,l]of i.entries()){let h=I(l);if(u+h<=t?r[r.length-1]+=l:(r.push(l),u=0),Y.has(l)&&(s=!0,n=i.slice(o+1).join("").startsWith(Oe)),s){n?l===we&&(s=!1,n=!1):l===Ft&&(s=!1);continue}u+=h,u===t&&o<i.length-1&&(r.push(""),u=0)}!u&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},wu=r=>{let e=r.split(" "),t=e.length;for(;t>0&&!(I(e[t-1])>0);)t--;return t===e.length?r:e.slice(0,t).join(" ")+e.slice(t).join("")},Ou=(r,e,t={})=>{if(t.trim!==!1&&r.trim()==="")return"";let i="",s,n,u=yu(r),o=[""];for(let[h,a]of r.split(" ").entries()){t.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let D=I(o[o.length-1]);if(h!==0&&(D>=e&&(t.wordWrap===!1||t.trim===!1)&&(o.push(""),D=0),(D>0||t.trim===!1)&&(o[o.length-1]+=" ",D++)),t.hard&&u[h]>e){let p=e-D,g=1+Math.floor((u[h]-p-1)/e);Math.floor((u[h]-1)/e)<g&&o.push(""),Be(o,a,e);continue}if(D+u[h]>e&&D>0&&u[h]>0){if(t.wordWrap===!1&&D<e){Be(o,a,e);continue}o.push("")}if(D+u[h]>e&&t.wordWrap===!1){Be(o,a,e);continue}o[o.length-1]+=a}t.trim!==!1&&(o=o.map(h=>wu(h)));let l=[...o.join(`
28
+ `)];for(let[h,a]of l.entries()){if(i+=a,Y.has(a)){let{groups:p}=new RegExp(`(?:\\${Ct}(?<code>\\d+)m|\\${Oe}(?<uri>.*)${we})`).exec(l.slice(h).join(""))||{groups:{}};if(p.code!==void 0){let g=Number.parseFloat(p.code);s=g===Bu?void 0:g}else p.uri!==void 0&&(n=p.uri.length===0?void 0:p.uri)}let D=Au.codes.get(Number(s));l[h+1]===`
29
+ `?(n&&(i+=at("")),s&&D&&(i+=Dt(D))):a===`
30
+ `&&(s&&D&&(i+=Dt(s)),n&&(i+=at(n)))}return i};function lt(r,e,t){return String(r).normalize().replace(/\r\n/g,`
31
31
  `).split(`
32
- `).map(i=>yu(i,t,e)).join(`
33
- `)}var wu=["up","down","left","right","space","enter","cancel"],U={actions:new Set(wu),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function St(n,t){if(typeof n=="string")return U.aliases.get(n)===t;for(let e of n)if(e!==void 0&&St(e,t))return!0;return!1}function xu(n,t){if(n===t)return;let e=n.split(`
34
- `),i=t.split(`
35
- `),s=[];for(let r=0;r<Math.max(e.length,i.length);r++)e[r]!==i[r]&&s.push(r);return s}var Ou=globalThis.process.platform.startsWith("win"),wt=Symbol("clack:cancel");function Z(n){return n===wt}function L(n,t){let e=n;e.isTTY&&e.setRawMode(t)}function Ce({input:n=V.stdin,output:t=V.stdout,overwrite:e=!0,hideCursor:i=!0}={}){let s=S.createInterface({input:n,output:t,prompt:"",tabSize:1});S.emitKeypressEvents(n,s),n.isTTY&&n.setRawMode(!0);let r=(u,{name:o,sequence:l})=>{let h=String(u);if(St([h,o,l],"cancel")){i&&t.write(b.cursor.show),process.exit(0);return}if(!e)return;S.moveCursor(t,o==="return"?0:-1,o==="return"?-1:0,()=>{S.clearLine(t,1,()=>{n.once("keypress",r)})})};return i&&t.write(b.cursor.hide),n.once("keypress",r),()=>{n.off("keypress",r),i&&t.write(b.cursor.show),n.isTTY&&!Ou&&n.setRawMode(!1),s.terminal=!1,s.close()}}var Su=Object.defineProperty,ku=(n,t,e)=>t in n?Su(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,$=(n,t,e)=>(ku(n,typeof t!="symbol"?t+"":t,e),e),J=class{constructor(t,e=!0){$(this,"input"),$(this,"output"),$(this,"_abortSignal"),$(this,"rl"),$(this,"opts"),$(this,"_render"),$(this,"_track",!1),$(this,"_prevFrame",""),$(this,"_subscribers",new Map),$(this,"_cursor",0),$(this,"state","initial"),$(this,"error",""),$(this,"value");let{input:i=V.stdin,output:s=V.stdout,render:r,signal:u,...o}=t;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=r.bind(this),this._track=e,this._abortSignal=u,this.input=i,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(t,e){let i=this._subscribers.get(t)??[];i.push(e),this._subscribers.set(t,i)}on(t,e){this.setSubscriber(t,{cb:e})}once(t,e){this.setSubscriber(t,{cb:e,once:!0})}emit(t,...e){let i=this._subscribers.get(t)??[],s=[];for(let r of i)r.cb(...e),r.once&&s.push(()=>i.splice(i.indexOf(r),1));for(let r of s)r()}prompt(){return new Promise((t,e)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(wt);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let i=new le.Writable;i._write=(s,r,u)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),u()},this.input.pipe(i),this.rl=yt.default.createInterface({input:this.input,output:i,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),yt.default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),L(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(b.cursor.show),this.output.off("resize",this.render),L(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(b.cursor.show),this.output.off("resize",this.render),L(this.input,!1),t(wt)})})}onKeypress(t,e){if(this.state==="error"&&(this.state="active"),e?.name&&(!this._track&&U.aliases.has(e.name)&&this.emit("cursor",U.aliases.get(e.name)),U.actions.has(e.name)&&this.emit("cursor",e.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),e?.name==="return"){if(this.opts.validate){let i=this.opts.validate(this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}St([t,e?.name,e?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
36
- `),L(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=De(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
37
- `).length-1;this.output.write(b.cursor.move(-999,t*-1))}render(){let t=De(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(b.cursor.hide);else{let e=xu(this._prevFrame,t);if(this.restoreCursor(),e&&e?.length===1){let i=e[0];this.output.write(b.cursor.move(0,i)),this.output.write(b.erase.lines(1));let s=t.split(`
38
- `);this.output.write(s[i]),this._prevFrame=t,this.output.write(b.cursor.move(0,s.length-i-1));return}if(e&&e?.length>1){let i=e[0];this.output.write(b.cursor.move(0,i)),this.output.write(b.erase.down());let s=t.split(`
32
+ `).map(i=>Ou(i,e,t)).join(`
33
+ `)}var xu=["up","down","left","right","space","enter","cancel"],U={actions:new Set(xu),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function xe(r,e){if(typeof r=="string")return U.aliases.get(r)===e;for(let t of r)if(t!==void 0&&xe(t,e))return!0;return!1}function Su(r,e){if(r===e)return;let t=r.split(`
34
+ `),i=e.split(`
35
+ `),s=[];for(let n=0;n<Math.max(t.length,i.length);n++)t[n]!==i[n]&&s.push(n);return s}var ku=globalThis.process.platform.startsWith("win"),ye=Symbol("clack:cancel");function Z(r){return r===ye}function L(r,e){let t=r;t.isTTY&&t.setRawMode(e)}function gt({input:r=V.stdin,output:e=V.stdout,overwrite:t=!0,hideCursor:i=!0}={}){let s=S.createInterface({input:r,output:e,prompt:"",tabSize:1});S.emitKeypressEvents(r,s),r.isTTY&&r.setRawMode(!0);let n=(u,{name:o,sequence:l})=>{let h=String(u);if(xe([h,o,l],"cancel")){i&&e.write(b.cursor.show),process.exit(0);return}if(!t)return;S.moveCursor(e,o==="return"?0:-1,o==="return"?-1:0,()=>{S.clearLine(e,1,()=>{r.once("keypress",n)})})};return i&&e.write(b.cursor.hide),r.once("keypress",n),()=>{r.off("keypress",n),i&&e.write(b.cursor.show),r.isTTY&&!ku&&r.setRawMode(!1),s.terminal=!1,s.close()}}var Tu=Object.defineProperty,Vu=(r,e,t)=>e in r?Tu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$=(r,e,t)=>(Vu(r,typeof e!="symbol"?e+"":e,t),t),J=class{constructor(e,t=!0){$(this,"input"),$(this,"output"),$(this,"_abortSignal"),$(this,"rl"),$(this,"opts"),$(this,"_render"),$(this,"_track",!1),$(this,"_prevFrame",""),$(this,"_subscribers",new Map),$(this,"_cursor",0),$(this,"state","initial"),$(this,"error",""),$(this,"value");let{input:i=V.stdin,output:s=V.stdout,render:n,signal:u,...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=t,this._abortSignal=u,this.input=i,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let i=this._subscribers.get(e)??[];i.push(t),this._subscribers.set(e,i)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let i=this._subscribers.get(e)??[],s=[];for(let n of i)n.cb(...t),n.once&&s.push(()=>i.splice(i.indexOf(n),1));for(let n of s)n()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(ye);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let i=new ct.Writable;i._write=(s,n,u)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),u()},this.input.pipe(i),this.rl=ve.default.createInterface({input:this.input,output:i,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),ve.default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),L(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(b.cursor.show),this.output.off("resize",this.render),L(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(b.cursor.show),this.output.off("resize",this.render),L(this.input,!1),e(ye)})})}onKeypress(e,t){if(this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&U.aliases.has(t.name)&&this.emit("cursor",U.aliases.get(t.name)),U.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),t?.name==="return"){if(this.opts.validate){let i=this.opts.validate(this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}xe([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
36
+ `),L(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=lt(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
37
+ `).length-1;this.output.write(b.cursor.move(-999,e*-1))}render(){let e=lt(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(b.cursor.hide);else{let t=Su(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let i=t[0];this.output.write(b.cursor.move(0,i)),this.output.write(b.erase.lines(1));let s=e.split(`
38
+ `);this.output.write(s[i]),this._prevFrame=e,this.output.write(b.cursor.move(0,s.length-i-1));return}if(t&&t?.length>1){let i=t[0];this.output.write(b.cursor.move(0,i)),this.output.write(b.erase.down());let s=e.split(`
39
39
  `).slice(i);this.output.write(s.join(`
40
- `)),this._prevFrame=t;return}this.output.write(b.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var Tu;Tu=new WeakMap;var Vu=Object.defineProperty,Hu=(n,t,e)=>t in n?Vu(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ae=(n,t,e)=>(Hu(n,typeof t!="symbol"?t+"":t,e),e),K=class extends J{constructor(t){super(t,!1),ae(this,"options"),ae(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:e})=>e===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var z=class extends J{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let t=this.value.slice(0,this.cursor),[e,...i]=this.value.slice(this.cursor);return`${t}${he.default.inverse(e)}${i.join("")}`}get cursor(){return this._cursor}constructor(t){super(t),this.on("finalize",()=>{this.value||(this.value=t.defaultValue)})}};var B=w(require("node:process"),1),c=w(At(),1),X=w($t(),1);function Pu(){return B.default.platform!=="win32"?B.default.env.TERM!=="linux":!!B.default.env.CI||!!B.default.env.WT_SESSION||!!B.default.env.TERMINUS_SUBLIME||B.default.env.ConEmuTask==="{cmd::Cmder}"||B.default.env.TERM_PROGRAM==="Terminus-Sublime"||B.default.env.TERM_PROGRAM==="vscode"||B.default.env.TERM==="xterm-256color"||B.default.env.TERM==="alacritty"||B.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var kt=Pu(),C=(n,t)=>kt?n:t,Iu=C("\u25C6","*"),ge=C("\u25A0","x"),Ee=C("\u25B2","x"),Tt=C("\u25C7","o"),Mu=C("\u250C","T"),F=C("\u2502","|"),M=C("\u2514","\u2014"),Wu=C("\u25CF",">"),ju=C("\u25CB"," "),Ai=C("\u25FB","[\u2022]"),Bi=C("\u25FC","[+]"),vi=C("\u25FB","[ ]"),yi=C("\u25AA","\u2022"),Fe=C("\u2500","-"),Gu=C("\u256E","+"),Ru=C("\u251C","+"),Nu=C("\u256F","+"),wi=C("\u25CF","\u2022"),xi=C("\u25C6","*"),Oi=C("\u25B2","!"),Si=C("\u25A0","x"),be=n=>{switch(n){case"initial":case"active":return c.default.cyan(Iu);case"cancel":return c.default.red(ge);case"error":return c.default.yellow(Ee);case"submit":return c.default.green(Tt)}},qu=n=>{let{cursor:t,options:e,style:i}=n,s=n.maxItems??Number.POSITIVE_INFINITY,r=Math.max(process.stdout.rows-4,0),u=Math.min(r,Math.max(s,5)),o=0;t>=o+u-3?o=Math.max(Math.min(t-u+3,e.length-u),0):t<o+2&&(o=Math.max(t-2,0));let l=u<e.length&&o>0,h=u<e.length&&o+u<e.length;return e.slice(o,o+u).map((a,D,p)=>{let g=D===0&&l,v=D===p.length-1&&h;return g||v?c.default.dim("..."):i(a,D+o===t)})},$e=n=>new z({validate:n.validate,placeholder:n.placeholder,defaultValue:n.defaultValue,initialValue:n.initialValue,render(){let t=`${c.default.gray(F)}
41
- ${be(this.state)} ${n.message}
42
- `,e=n.placeholder?c.default.inverse(n.placeholder[0])+c.default.dim(n.placeholder.slice(1)):c.default.inverse(c.default.hidden("_")),i=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${t.trim()}
40
+ `)),this._prevFrame=e;return}this.output.write(b.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var Pu;Pu=new WeakMap;var Hu=Object.defineProperty,Iu=(r,e,t)=>e in r?Hu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ht=(r,e,t)=>(Iu(r,typeof e!="symbol"?e+"":e,t),t),K=class extends J{constructor(e){super(e,!1),ht(this,"options"),ht(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var z=class extends J{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...i]=this.value.slice(this.cursor);return`${e}${pt.default.inverse(t)}${i.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};var B=y(require("node:process"),1),c=y(_e(),1),X=y(be(),1);function Mu(){return B.default.platform!=="win32"?B.default.env.TERM!=="linux":!!B.default.env.CI||!!B.default.env.WT_SESSION||!!B.default.env.TERMINUS_SUBLIME||B.default.env.ConEmuTask==="{cmd::Cmder}"||B.default.env.TERM_PROGRAM==="Terminus-Sublime"||B.default.env.TERM_PROGRAM==="vscode"||B.default.env.TERM==="xterm-256color"||B.default.env.TERM==="alacritty"||B.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Se=Mu(),C=(r,e)=>Se?r:e,Wu=C("\u25C6","*"),bt=C("\u25A0","x"),$t=C("\u25B2","x"),ke=C("\u25C7","o"),ju=C("\u250C","T"),F=C("\u2502","|"),M=C("\u2514","\u2014"),Gu=C("\u25CF",">"),Nu=C("\u25CB"," "),Pi=C("\u25FB","[\u2022]"),Hi=C("\u25FC","[+]"),Ii=C("\u25FB","[ ]"),Mi=C("\u25AA","\u2022"),Et=C("\u2500","-"),Ru=C("\u256E","+"),qu=C("\u251C","+"),Lu=C("\u256F","+"),Wi=C("\u25CF","\u2022"),ji=C("\u25C6","*"),Gi=C("\u25B2","!"),Ni=C("\u25A0","x"),_t=r=>{switch(r){case"initial":case"active":return c.default.cyan(Wu);case"cancel":return c.default.red(bt);case"error":return c.default.yellow($t);case"submit":return c.default.green(ke)}},Uu=r=>{let{cursor:e,options:t,style:i}=r,s=r.maxItems??Number.POSITIVE_INFINITY,n=Math.max(process.stdout.rows-4,0),u=Math.min(n,Math.max(s,5)),o=0;e>=o+u-3?o=Math.max(Math.min(e-u+3,t.length-u),0):e<o+2&&(o=Math.max(e-2,0));let l=u<t.length&&o>0,h=u<t.length&&o+u<t.length;return t.slice(o,o+u).map((a,D,p)=>{let g=D===0&&l,v=D===p.length-1&&h;return g||v?c.default.dim("..."):i(a,D+o===e)})},At=r=>new z({validate:r.validate,placeholder:r.placeholder,defaultValue:r.defaultValue,initialValue:r.initialValue,render(){let e=`${c.default.gray(F)}
41
+ ${_t(this.state)} ${r.message}
42
+ `,t=r.placeholder?c.default.inverse(r.placeholder[0])+c.default.dim(r.placeholder.slice(1)):c.default.inverse(c.default.hidden("_")),i=this.value?this.valueWithCursor:t;switch(this.state){case"error":return`${e.trim()}
43
43
  ${c.default.yellow(F)} ${i}
44
44
  ${c.default.yellow(M)} ${c.default.yellow(this.error)}
45
- `;case"submit":return`${t}${c.default.gray(F)} ${c.default.dim(this.value||n.placeholder)}`;case"cancel":return`${t}${c.default.gray(F)} ${c.default.strikethrough(c.default.dim(this.value??""))}${this.value?.trim()?`
46
- ${c.default.gray(F)}`:""}`;default:return`${t}${c.default.cyan(F)} ${i}
45
+ `;case"submit":return`${e}${c.default.gray(F)} ${c.default.dim(this.value||r.placeholder)}`;case"cancel":return`${e}${c.default.gray(F)} ${c.default.strikethrough(c.default.dim(this.value??""))}${this.value?.trim()?`
46
+ ${c.default.gray(F)}`:""}`;default:return`${e}${c.default.cyan(F)} ${i}
47
47
  ${c.default.cyan(M)}
48
- `}}}).prompt();var _e=n=>{let t=(e,i)=>{let s=e.label??String(e.value);switch(i){case"selected":return`${c.default.dim(s)}`;case"active":return`${c.default.green(Wu)} ${s} ${e.hint?c.default.dim(`(${e.hint})`):""}`;case"cancelled":return`${c.default.strikethrough(c.default.dim(s))}`;default:return`${c.default.dim(ju)} ${c.default.dim(s)}`}};return new K({options:n.options,initialValue:n.initialValue,render(){let e=`${c.default.gray(F)}
49
- ${be(this.state)} ${n.message}
50
- `;switch(this.state){case"submit":return`${e}${c.default.gray(F)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${e}${c.default.gray(F)} ${t(this.options[this.cursor],"cancelled")}
51
- ${c.default.gray(F)}`;default:return`${e}${c.default.cyan(F)} ${qu({cursor:this.cursor,options:this.options,maxItems:n.maxItems,style:(i,s)=>t(i,s?"active":"inactive")}).join(`
48
+ `}}}).prompt();var Bt=r=>{let e=(t,i)=>{let s=t.label??String(t.value);switch(i){case"selected":return`${c.default.dim(s)}`;case"active":return`${c.default.green(Gu)} ${s} ${t.hint?c.default.dim(`(${t.hint})`):""}`;case"cancelled":return`${c.default.strikethrough(c.default.dim(s))}`;default:return`${c.default.dim(Nu)} ${c.default.dim(s)}`}};return new K({options:r.options,initialValue:r.initialValue,render(){let t=`${c.default.gray(F)}
49
+ ${_t(this.state)} ${r.message}
50
+ `;switch(this.state){case"submit":return`${t}${c.default.gray(F)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${c.default.gray(F)} ${e(this.options[this.cursor],"cancelled")}
51
+ ${c.default.gray(F)}`;default:return`${t}${c.default.cyan(F)} ${Uu({cursor:this.cursor,options:this.options,maxItems:r.maxItems,style:(i,s)=>e(i,s?"active":"inactive")}).join(`
52
52
  ${c.default.cyan(F)} `)}
53
53
  ${c.default.cyan(M)}
54
- `}}}).prompt()};var Ae=(n="",t="")=>{let e=`
55
- ${n}
54
+ `}}}).prompt()};var vt=(r="",e="")=>{let t=`
55
+ ${r}
56
56
  `.split(`
57
- `),i=(0,Q.stripVTControlCharacters)(t).length,s=Math.max(e.reduce((u,o)=>{let l=(0,Q.stripVTControlCharacters)(o);return l.length>u?l.length:u},0),i)+2,r=e.map(u=>`${c.default.gray(F)} ${c.default.dim(u)}${" ".repeat(s-(0,Q.stripVTControlCharacters)(u).length)}${c.default.gray(F)}`).join(`
57
+ `),i=(0,Q.stripVTControlCharacters)(e).length,s=Math.max(t.reduce((u,o)=>{let l=(0,Q.stripVTControlCharacters)(o);return l.length>u?l.length:u},0),i)+2,n=t.map(u=>`${c.default.gray(F)} ${c.default.dim(u)}${" ".repeat(s-(0,Q.stripVTControlCharacters)(u).length)}${c.default.gray(F)}`).join(`
58
58
  `);process.stdout.write(`${c.default.gray(F)}
59
- ${c.default.green(Tt)} ${c.default.reset(t)} ${c.default.gray(Fe.repeat(Math.max(s-i-1,1))+Gu)}
60
- ${r}
61
- ${c.default.gray(Ru+Fe.repeat(s+2)+Nu)}
62
- `)},Be=(n="")=>{process.stdout.write(`${c.default.gray(M)} ${c.default.red(n)}
59
+ ${c.default.green(ke)} ${c.default.reset(e)} ${c.default.gray(Et.repeat(Math.max(s-i-1,1))+Ru)}
60
+ ${n}
61
+ ${c.default.gray(qu+Et.repeat(s+2)+Lu)}
62
+ `)},yt=(r="")=>{process.stdout.write(`${c.default.gray(M)} ${c.default.red(r)}
63
63
 
64
- `)},ve=(n="")=>{process.stdout.write(`${c.default.gray(Mu)} ${n}
65
- `)},ye=(n="")=>{process.stdout.write(`${c.default.gray(F)}
66
- ${c.default.gray(M)} ${n}
64
+ `)},wt=(r="")=>{process.stdout.write(`${c.default.gray(ju)} ${r}
65
+ `)},Ot=(r="")=>{process.stdout.write(`${c.default.gray(F)}
66
+ ${c.default.gray(M)} ${r}
67
67
 
68
- `)};var ki=`${c.default.gray(F)} `;var W=({indicator:n="dots"}={})=>{let t=kt?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=kt?80:120,i=process.env.CI==="true",s,r,u=!1,o="",l,h=performance.now(),a=E=>{let _=E>1?"Something went wrong":"Canceled";u&&Mt(_,E)},D=()=>a(2),p=()=>a(1),g=()=>{process.on("uncaughtExceptionMonitor",D),process.on("unhandledRejection",D),process.on("SIGINT",p),process.on("SIGTERM",p),process.on("exit",a)},v=()=>{process.removeListener("uncaughtExceptionMonitor",D),process.removeListener("unhandledRejection",D),process.removeListener("SIGINT",p),process.removeListener("SIGTERM",p),process.removeListener("exit",a)},Pt=()=>{if(l===void 0)return;i&&process.stdout.write(`
68
+ `)};var Ri=`${c.default.gray(F)} `;var W=({indicator:r="dots"}={})=>{let e=Se?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=Se?80:120,i=process.env.CI==="true",s,n,u=!1,o="",l,h=performance.now(),a=E=>{let _=E>1?"Something went wrong":"Canceled";u&&je(_,E)},D=()=>a(2),p=()=>a(1),g=()=>{process.on("uncaughtExceptionMonitor",D),process.on("unhandledRejection",D),process.on("SIGINT",p),process.on("SIGTERM",p),process.on("exit",a)},v=()=>{process.removeListener("uncaughtExceptionMonitor",D),process.removeListener("unhandledRejection",D),process.removeListener("SIGINT",p),process.removeListener("SIGTERM",p),process.removeListener("exit",a)},Me=()=>{if(l===void 0)return;i&&process.stdout.write(`
69
69
  `);let E=l.split(`
70
- `);process.stdout.write(X.cursor.move(-999,E.length-1)),process.stdout.write(X.erase.down(E.length))},ut=E=>E.replace(/\.+$/,""),It=E=>{let _=(performance.now()-E)/1e3,y=Math.floor(_/60),T=Math.floor(_%60);return y>0?`[${y}m ${T}s]`:`[${T}s]`},Me=(E="")=>{u=!0,s=Ce(),o=ut(E),h=performance.now(),process.stdout.write(`${c.default.gray(F)}
71
- `);let _=0,y=0;g(),r=setInterval(()=>{if(i&&o===l)return;Pt(),l=o;let T=c.default.magenta(t[_]);if(i)process.stdout.write(`${T} ${o}...`);else if(n==="timer")process.stdout.write(`${T} ${o} ${It(h)}`);else{let We=".".repeat(Math.floor(y)).slice(0,3);process.stdout.write(`${T} ${o}${We}`)}_=_+1<t.length?_+1:0,y=y<t.length?y+.125:0},e)},Mt=(E="",_=0)=>{u=!1,clearInterval(r),Pt();let y=_===0?c.default.green(Tt):_===1?c.default.red(ge):c.default.red(Ee);o=ut(E??o),n==="timer"?process.stdout.write(`${y} ${o} ${It(h)}
72
- `):process.stdout.write(`${y} ${o}
73
- `),v(),s()};return{start:Me,stop:Mt,message:(E="")=>{o=ut(E??o)}}};var Ve=require("child_process"),k=require("fs"),He=require("os"),Pe=require("path");var tt=class{baseUrl;defaultHeaders;constructor(t,e={}){this.baseUrl=t,this.defaultHeaders=e}buildUrl(t){return`${this.baseUrl.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}async request(t,e,i,s={}){let r=this.buildUrl(e),u=await fetch(r,{method:t,headers:{"Content-Type":"application/json",...this.defaultHeaders,...s},body:i?JSON.stringify(i):void 0});if(!u.ok){let l=await u.text().catch(()=>"");throw new Error(`HTTP ${u.status} ${u.statusText}: ${l||"Request failed"}`)}let o=await u.text();try{return JSON.parse(o)}catch{return o}}get(t,e){return this.request("GET",t,void 0,e)}post(t,e,i){return this.request("POST",t,e,i)}put(t,e,i){return this.request("PUT",t,e,i)}delete(t,e){return this.request("DELETE",t,void 0,e)}};var Vt=new tt("http://127.0.0.1:8080/api/public"),we=async n=>await Vt.get(`/v1/template-group/code/${n}`),xe=async(n,t)=>await Vt.post("/v1/template-group/get-block-input-from-user-query",{blockInput:n,query:t}),Oe=async(n,t)=>await Vt.post("/v1/template-group/resolve-multiple-templates-by-block-code",{blockCode:n,data:t});var H=w(require("fs")),Ht=w(require("path")),Se=n=>{let t=[],e=[],i=[];for(let s of n){let r=Ht.default.join(process.cwd(),s.resolvedPath);if(!s.isNotEnabled)try{if(H.default.mkdirSync(Ht.default.dirname(r),{recursive:!0}),s.templateType==="add")if(H.default.existsSync(r)&&H.default.lstatSync(r).isFile()){i.push(`File already exists: ${r}`);continue}else{if(s.pathError||s.templateError){i.push(`Failed to create file: ${r} because of error: ${s.templateError}`);continue}H.default.writeFileSync(r,s.resolvedTemplate),t.push(r)}else s.templateType==="modify"&&(s.modifiedFileContent?(H.default.writeFileSync(r,s.modifiedFileContent),e.push(r)):i.push(`Failed to modify file: ${r} because of error: ${s.templateError}`))}catch(u){i.push(u instanceof Error?u.message:String(u))}}return{addResults:t,modifyResults:e,errors:i}};var et=new Xt;async function Uu(n){let t=(0,Pe.join)((0,He.tmpdir)(),`cli-edit-${Date.now()}.json`);(0,k.writeFileSync)(t,JSON.stringify(n,null,2));let e=process.env.VISUAL||process.env.EDITOR||"nano";return new Promise((i,s)=>{(0,Ve.spawn)(e,[t],{stdio:"inherit"}).on("exit",u=>{if(u===0)try{let o=(0,k.readFileSync)(t,"utf-8"),l=JSON.parse(o);(0,k.unlinkSync)(t),i(l)}catch{(0,k.unlinkSync)(t),s(new Error("Invalid JSON format"))}else(0,k.unlinkSync)(t),s(new Error("Editor closed without saving"))})})}async function ke(n,t){let e=W();e.start(`Modifying block input for ${t}`);let i=await xe(JSON.stringify(n),t);return e.stop("Block input modified"),Ie(i.result,"Refined Block Input"),i.result}function Ie(n,t="Block Input"){Ae(JSON.stringify(n,null,2),t)}async function Te(n,t){let e=W();e.start("Resolving Files..."),console.log(n,typeof t,"check me");let i=await Oe(n,t),s=Se(i.result.files);e.stop(`${s.addResults.length} files added, ${s.modifyResults.length} files modified, ${s.errors.length} errors`)}async function Ju(n,t,e){ve(`Add block: ${n}`);let i=!1,s=!1,r=W();r.start("Fetching block...");let u=await we(n);if(u?.result?.id)r.stop("Block Found");else{r.stop("Block Not Found");return}let o=e||u.result.input;for(e&&(Te(n,e),i=!0),o&&t&&!e&&(o=ke(o,t),s=!0);!i&&o&&!t;){let h=await _e({message:"What would you like to do?",options:[{value:"refine",label:"Edit (AI)"},{value:"edit",label:"Edit (Editor)"},{value:"restart",label:"Start over"},{value:"preview",label:"Preview Block Input"},{value:"done",label:"Accept"}]});if(Z(h)&&(Be("Operation cancelled."),process.exit(0)),h==="refine"){let a=await $e({message:"Describe what to refine:"});o=await ke(o,a),s=!0}h==="edit"&&(o=await Uu(o)),h==="done"&&(await Te(n,o),ye("Done! \u{1F389}"),i=!0),h==="preview"&&Ie(o),h==="restart"&&(i=!1,s=!1,o=u.result.input)}}et.command("help").description("List all commands and usage").action(()=>{console.log(`
70
+ `);process.stdout.write(X.cursor.move(-999,E.length-1)),process.stdout.write(X.erase.down(E.length))},te=E=>E.replace(/\.+$/,""),We=E=>{let _=(performance.now()-E)/1e3,w=Math.floor(_/60),T=Math.floor(_%60);return w>0?`[${w}m ${T}s]`:`[${T}s]`},jt=(E="")=>{u=!0,s=gt(),o=te(E),h=performance.now(),process.stdout.write(`${c.default.gray(F)}
71
+ `);let _=0,w=0;g(),n=setInterval(()=>{if(i&&o===l)return;Me(),l=o;let T=c.default.magenta(e[_]);if(i)process.stdout.write(`${T} ${o}...`);else if(r==="timer")process.stdout.write(`${T} ${o} ${We(h)}`);else{let Gt=".".repeat(Math.floor(w)).slice(0,3);process.stdout.write(`${T} ${o}${Gt}`)}_=_+1<e.length?_+1:0,w=w<e.length?w+.125:0},t)},je=(E="",_=0)=>{u=!1,clearInterval(n),Me();let w=_===0?c.default.green(ke):_===1?c.default.red(bt):c.default.red($t);o=te(E??o),r==="timer"?process.stdout.write(`${w} ${o} ${We(h)}
72
+ `):process.stdout.write(`${w} ${o}
73
+ `),v(),s()};return{start:jt,stop:je,message:(E="")=>{o=te(E??o)}}};var Ht=require("child_process"),k=require("fs"),It=require("os"),Mt=require("path");var P=y(require("fs")),Te=y(require("path")),xt=r=>{let e=[],t=[],i=[];for(let s of r){let n=Te.default.join(process.cwd(),s.resolvedPath);if(!s.isNotEnabled)try{if(P.default.mkdirSync(Te.default.dirname(n),{recursive:!0}),s.templateType==="add")if(P.default.existsSync(n)&&P.default.lstatSync(n).isFile()){i.push(`File already exists: ${n}`);continue}else{if(s.pathError||s.templateError){i.push(`Failed to create file: ${n} because of error: ${s.templateError}`);continue}P.default.writeFileSync(n,s.resolvedTemplate),e.push(n)}else s.templateType==="modify"&&(s.modifiedFileContent?(P.default.writeFileSync(n,s.modifiedFileContent),t.push(n)):i.push(`Failed to modify file: ${n} because of error: ${s.templateError}`))}catch(u){i.push(u instanceof Error?u.message:String(u))}}return{addResults:e,modifyResults:t,errors:i}};var Wt=y(Tt()),ee=new tt,Ie=new Wt.default;async function ii(r){let e=(0,Mt.join)((0,It.tmpdir)(),`cli-edit-${Date.now()}.json`);(0,k.writeFileSync)(e,JSON.stringify(r,null,2));let t=process.env.VISUAL||process.env.EDITOR||"nano";return new Promise((i,s)=>{(0,Ht.spawn)(t,[e],{stdio:"inherit"}).on("exit",u=>{if(u===0)try{let o=(0,k.readFileSync)(e,"utf-8"),l=JSON.parse(o);(0,k.unlinkSync)(e),i(l)}catch{(0,k.unlinkSync)(e),s(new Error("Invalid JSON format"))}else(0,k.unlinkSync)(e),s(new Error("Editor closed without saving"))})})}async function Vt(r,e){let t=W();t.start(`Modifying block input for ${e}`);let i=await Ie.getBlockInputFromUserQuery(JSON.stringify(r),e);return t.stop("Block input modified"),He(i.result,"Refined Block Input"),i.result}function He(r,e="Block Input"){vt(JSON.stringify(r,null,2),e)}async function Pt(r,e){let t=W();t.start("Resolving Files...");let i=await Ie.resolveMultipleTemplates(r,e),s=xt(i.result.files);t.stop(`${s.addResults.length} files added, ${s.modifyResults.length} files modified, ${s.errors.length} errors`)}async function si(r,e,t){wt(`Add block: ${r}`);let i=!1,s=!1,n=W();n.start("Fetching block...");let u=await Ie.fetchBlock(r);if(u?.result?.id)n.stop(`Block Found ${u.result.input?"with input":""}`);else{n.stop("Block Not Found");return}let o=t||u.result.input;for(t&&(Pt(r,t),i=!0),o&&e&&!t&&(o=Vt(o,e),s=!0);!i&&o&&!e;){He(o);let h=await Bt({message:"What would you like to do?",options:[{value:"refine",label:"Edit (AI)"},{value:"edit",label:"Edit (Editor)"},{value:"restart",label:"Start over"},{value:"preview",label:"Preview Block Input"},{value:"done",label:"Accept"}]});if(Z(h)&&(yt("Operation cancelled."),process.exit(0)),h==="refine"){let a=await At({message:"Describe what to refine:"});o=await Vt(o,a),s=!0}h==="edit"&&(o=await ii(o)),h==="done"&&(await Pt(r,o),Ot("Done! \u{1F389}"),i=!0),h==="preview"&&He(o),h==="restart"&&(i=!1,s=!1,o=u.result.input)}}ee.command("help").description("List all commands and usage").action(()=>{console.log(`
74
74
  Available commands:
75
75
 
76
76
  add <block-id>
@@ -79,4 +79,4 @@ Available commands:
79
79
 
80
80
  help
81
81
  Show this help text.
82
- `)});var Ku=n=>{let t=W();try{t.start("Decoding base64...");let e=Buffer.from(n,"base64").toString("utf8"),i=JSON.parse(e);for(;typeof i!="object";)i=JSON.parse(i);return t.stop("Decoded input successfully"),i}catch{return t.stop("Failed to decode input"),null}};et.command("add <blockCode>").description("Generate and refine a JSON block interactively").option("-q, --query <value>","Optional user input").option("-i, --block-input <value>","Optional block input json schema in base 64").action(async(n,t)=>{let e=t.blockInput?Ku(t.blockInput):null;console.log(typeof e,e,"parsed block input"),await Ju(n,t.query,e)});et.command("init <project-id>").description("Initialize a project (no interactive prompts)").action(async n=>{console.log(`\u{1F680} Initializing project: ${n}`),console.log("Creating project folder..."),console.log("Setting up config..."),console.log("Done!")});et.parse();
82
+ `)});var ri=r=>{let e=W();try{e.start("Decoding base64...");let t=Buffer.from(r,"base64").toString("utf8"),i=JSON.parse(t);for(;typeof i!="object";)i=JSON.parse(i);return e.stop("Decoded input successfully"),i}catch{return e.stop("Failed to decode input"),null}};ee.command("add <blockCode>").description("Generate and refine a JSON block interactively").option("-q, --query <value>","Optional user input").option("-i, --block-input <value>","Optional block input json schema in base 64").action(async(r,e)=>{let t=e.blockInput?ri(e.blockInput):null;console.log(typeof t,t,"parsed block input"),await si(r,e.query,t)});ee.command("init <project-id>").description("Initialize a project (no interactive prompts)").action(async r=>{console.log(`\u{1F680} Initializing project: ${r}`),console.log("Creating project folder..."),console.log("Setting up config..."),console.log("Done!")});ee.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "derived-cli",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "CLI for Derived",
5
5
  "author": "Derived",
6
6
  "license": "MIT",
@@ -24,6 +24,7 @@
24
24
  "dependencies": {
25
25
  "@clack/prompts": "^0.11.0",
26
26
  "commander": "^14.0.2",
27
+ "derived-sdk": "^0.0.4",
27
28
  "dotenv": "16.4.5",
28
29
  "inquirer": "^12.6.0",
29
30
  "keytar": "^7.9.0",