clerc 0.27.1 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -234,6 +234,29 @@ type TypeFlag<Schemas extends Flags$1> = ParsedFlags<{
234
234
  [flag in keyof Schemas]: InferFlagType<Schemas[flag]>;
235
235
  }>;
236
236
 
237
+ type StripBrackets<Parameter extends string> = (Parameter extends `<${infer ParameterName}>` | `[${infer ParameterName}]` ? (ParameterName extends `${infer SpreadName}...` ? SpreadName : ParameterName) : never);
238
+ type ParameterType<Parameter extends string> = (Parameter extends `<${infer _ParameterName}...>` | `[${infer _ParameterName}...]` ? string[] : Parameter extends `<${infer _ParameterName}>` ? string : Parameter extends `[${infer _ParameterName}]` ? string | undefined : never);
239
+ type NonNullableParameters<T extends string[] | undefined> = T extends undefined ? [] : NonNullable<T>;
240
+ type TransformParameters<C extends Command> = {
241
+ [Parameter in NonNullableParameters<C["parameters"]>[number] as CamelCase<StripBrackets<Parameter>>]: ParameterType<Parameter>;
242
+ };
243
+ type MakeEventMap<T extends CommandRecord> = {
244
+ [K in keyof T]: [InspectorContext];
245
+ };
246
+ type FallbackFlags<C extends Command> = Equals<NonNullableFlag<C>["flags"], {}> extends true ? Dict<any> : NonNullableFlag<C>["flags"];
247
+ type NonNullableFlag<C extends Command> = TypeFlag<NonNullable<C["flags"]>>;
248
+ type ParseFlag<C extends CommandRecord, N extends keyof C> = N extends keyof C ? OmitIndexSignature<NonNullableFlag<C[N]>["flags"]> : FallbackFlags<C[N]>["flags"];
249
+ type ParseRaw<C extends Command> = NonNullableFlag<C> & {
250
+ flags: FallbackFlags<C>;
251
+ parameters: string[];
252
+ mergedFlags: FallbackFlags<C> & NonNullableFlag<C>["unknownFlags"];
253
+ };
254
+ type ParseParameters<C extends CommandRecord = CommandRecord, N extends keyof C = keyof C> = Equals<TransformParameters<C[N]>, {}> extends true ? N extends keyof C ? TransformParameters<C[N]> : Dict<string | string[] | undefined> : TransformParameters<C[N]>;
255
+
256
+ interface Plugin<T extends Clerc = Clerc, U extends Clerc = Clerc> {
257
+ setup: (cli: T) => U;
258
+ }
259
+
237
260
  type CommandType = RootType | string;
238
261
  type FlagOptions = FlagSchema & {
239
262
  description?: string;
@@ -268,25 +291,7 @@ interface ParseOptions {
268
291
  argv?: string[];
269
292
  run?: boolean;
270
293
  }
271
- type StripBrackets<Parameter extends string> = (Parameter extends `<${infer ParameterName}>` | `[${infer ParameterName}]` ? (ParameterName extends `${infer SpreadName}...` ? SpreadName : ParameterName) : never);
272
- type ParameterType<Parameter extends string> = (Parameter extends `<${infer _ParameterName}...>` | `[${infer _ParameterName}...]` ? string[] : Parameter extends `<${infer _ParameterName}>` ? string : Parameter extends `[${infer _ParameterName}]` ? string | undefined : never);
273
- type MakeEventMap<T extends CommandRecord> = {
274
- [K in keyof T]: [InspectorContext];
275
- };
276
294
  type PossibleInputKind = string | number | boolean | Dict<any>;
277
- type NonNullableParameters<T extends string[] | undefined> = T extends undefined ? [] : NonNullable<T>;
278
- type TransformParameters<C extends Command> = {
279
- [Parameter in NonNullableParameters<C["parameters"]>[number] as CamelCase<StripBrackets<Parameter>>]: ParameterType<Parameter>;
280
- };
281
- type FallbackFlags<C extends Command> = Equals<NonNullableFlag<C>["flags"], {}> extends true ? Dict<any> : NonNullableFlag<C>["flags"];
282
- type NonNullableFlag<C extends Command> = TypeFlag<NonNullable<C["flags"]>>;
283
- type ParseFlag<C extends CommandRecord, N extends keyof C> = N extends keyof C ? OmitIndexSignature<NonNullableFlag<C[N]>["flags"]> : FallbackFlags<C[N]>["flags"];
284
- type ParseRaw<C extends Command> = NonNullableFlag<C> & {
285
- flags: FallbackFlags<C>;
286
- parameters: string[];
287
- mergedFlags: FallbackFlags<C> & NonNullableFlag<C>["unknownFlags"];
288
- };
289
- type ParseParameters<C extends CommandRecord = CommandRecord, N extends keyof C = keyof C> = Equals<TransformParameters<C[N]>, {}> extends true ? N extends keyof C ? TransformParameters<C[N]> : Dict<string | string[] | undefined> : TransformParameters<C[N]>;
290
295
  interface HandlerContext<C extends CommandRecord = CommandRecord, N extends keyof C = keyof C> {
291
296
  name?: LiteralUnion<N, string>;
292
297
  called?: string | RootType;
@@ -319,8 +324,8 @@ interface InspectorObject<C extends CommandRecord = CommandRecord> {
319
324
  enforce?: "pre" | "post";
320
325
  fn: InspectorFn<C>;
321
326
  }
322
- interface Plugin<T extends Clerc = Clerc, U extends Clerc = Clerc> {
323
- setup: (cli: T) => U;
327
+ interface I18N {
328
+ add: () => void;
324
329
  }
325
330
 
326
331
  declare const Root: unique symbol;
@@ -556,4 +561,4 @@ declare const versionPlugin: ({ alias, command, }?: VersionPluginOptions) => Plu
556
561
 
557
562
  declare const friendlyErrorPlugin: () => Plugin<Clerc<{}>, Clerc<{}>>;
558
563
 
559
- export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandType, CommandWithHandler, CompletionsPluginOptions, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Flags, Handler, HandlerContext, HandlerInCommand, HelpPluginOptions, Inspector, InspectorContext, InspectorFn, InspectorObject, InvalidCommandNameError, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParseOptions, Plugin, PossibleInputKind, Root, RootType, VersionNotSetError, completionsPlugin, compose, defineCommand, defineHandler, defineInspector, definePlugin, formatCommandName, friendlyErrorPlugin, helpPlugin, isInvalidName, notFoundPlugin, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent, strictFlagsPlugin, versionPlugin, withBrackets };
564
+ export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandType, CommandWithHandler, CompletionsPluginOptions, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Flags, Handler, HandlerContext, HandlerInCommand, HelpPluginOptions, I18N, Inspector, InspectorContext, InspectorFn, InspectorObject, InvalidCommandNameError, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParseOptions, Plugin, PossibleInputKind, Root, RootType, VersionNotSetError, completionsPlugin, compose, defineCommand, defineHandler, defineInspector, definePlugin, formatCommandName, friendlyErrorPlugin, helpPlugin, isInvalidName, notFoundPlugin, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent, strictFlagsPlugin, versionPlugin, withBrackets };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import fu from"tty";import ct from"util";import ht from"os";class pt{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(e,t){return e==="*"?(this.wildcardListeners.add(t),this):(this.listenerMap[e]||(this.listenerMap[e]=new Set),this.listenerMap[e].add(t),this)}emit(e,...t){return this.listenerMap[e]&&(this.wildcardListeners.forEach(D=>D(e,...t)),this.listenerMap[e].forEach(D=>D(...t))),this}off(e,t){var D,n;return e==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):e==="*"?(t?this.wildcardListeners.delete(t):this.wildcardListeners.clear(),this):(t?(D=this.listenerMap[e])==null||D.delete(t):(n=this.listenerMap[e])==null||n.clear(),this)}}const mt="known-flag",ft="unknown-flag",dt="argument",{stringify:q}=JSON,Ft=/\B([A-Z])/g,Ct=u=>u.replace(Ft,"-$1").toLowerCase(),{hasOwnProperty:gt}=Object.prototype,Z=(u,e)=>gt.call(u,e),Et=u=>Array.isArray(u),Wu=u=>typeof u=="function"?[u,!1]:Et(u)?[u[0],!0]:Wu(u.type),Bt=(u,e)=>u===Boolean?e!=="false":e,xt=(u,e)=>typeof e=="boolean"?e:u===Number&&e===""?Number.NaN:u(e),bt=/[\s.:=]/,At=u=>{const e=`Flag name ${q(u)}`;if(u.length===0)throw new Error(`${e} cannot be empty`);if(u.length===1)throw new Error(`${e} must be longer than a character`);const t=u.match(bt);if(t)throw new Error(`${e} cannot contain ${q(t==null?void 0:t[0])}`)},yt=u=>{const e={},t=(D,n)=>{if(Z(e,D))throw new Error(`Duplicate flags named ${q(D)}`);e[D]=n};for(const D in u){if(!Z(u,D))continue;At(D);const n=u[D],r=[[],...Wu(n),n];t(D,r);const o=Ct(D);if(D!==o&&t(o,r),"alias"in n&&typeof n.alias=="string"){const{alias:l}=n,a=`Flag alias ${q(l)} for flag ${q(D)}`;if(l.length===0)throw new Error(`${a} cannot be empty`);if(l.length>1)throw new Error(`${a} must be a single character`);t(l,r)}}return e},wt=(u,e)=>{const t={};for(const D in u){if(!Z(u,D))continue;const[n,,r,o]=e[D];if(n.length===0&&"default"in o){let{default:l}=o;typeof l=="function"&&(l=l()),t[D]=l}else t[D]=r?n:n.pop()}return t},ru="--",St=/[.:=]/,$t=/^-{1,2}\w/,vt=u=>{if(!$t.test(u))return;const e=!u.startsWith(ru);let t=u.slice(e?1:2),D;const n=t.match(St);if(n){const{index:r}=n;D=t.slice(r+1),t=t.slice(0,r)}return[t,D,e]},Ot=(u,{onFlag:e,onArgument:t})=>{let D;const n=(r,o)=>{if(typeof D!="function")return!0;D(r,o),D=void 0};for(let r=0;r<u.length;r+=1){const o=u[r];if(o===ru){n();const a=u.slice(r+1);t==null||t(a,[r],!0);break}const l=vt(o);if(l){if(n(),!e)continue;const[a,s,d]=l;if(d)for(let C=0;C<a.length;C+=1){n();const m=C===a.length-1;D=e(a[C],m?s:void 0,[r,C+1,m])}else D=e(a,s,[r])}else n(o,[r])&&(t==null||t([o],[r]))}n()},Tt=(u,e)=>{for(const[t,D,n]of e.reverse()){if(D){const r=u[t];let o=r.slice(0,D);if(n||(o+=r.slice(D+1)),o!=="-"){u[t]=o;continue}}u.splice(t,1)}},Rt=(u,e=process.argv.slice(2),{ignore:t}={})=>{const D=[],n=yt(u),r={},o=[];return o[ru]=[],Ot(e,{onFlag(l,a,s){const d=Z(n,l);if(!(t!=null&&t(d?mt:ft,l,a))){if(d){const[C,m]=n[l],h=Bt(m,a),i=(c,p)=>{D.push(s),p&&D.push(p),C.push(xt(m,c||""))};return h===void 0?i:i(h)}Z(r,l)||(r[l]=[]),r[l].push(a===void 0?!0:a),D.push(s)}},onArgument(l,a,s){t!=null&&t(dt,e[a[0]])||(o.push(...l),s?(o[ru]=l,e.splice(a[0])):D.push(a))}}),Tt(e,D),{flags:wt(u,n),unknownFlags:r,_:o}},du=u=>Array.isArray(u)?u:[u],Mt=u=>u.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),_t=(u,e)=>e.length!==u.length?!1:u.every((t,D)=>t===e[D]),Nu=(u,e)=>e.length>u.length?!1:_t(u.slice(0,e.length),e);class Pu extends Error{constructor(e){super(`Command "${e}" exists.`),this.commandName=e}}class ou extends Error{constructor(e){super(`No such command: ${e}`),this.commandName=e}}class su extends Error{constructor(){super("No command given.")}}class Hu extends Error{constructor(e,t){super(`Command name ${e} conflicts with ${t}. Maybe caused by alias.`),this.n1=e,this.n2=t}}class Gu extends Error{constructor(){super("Name not set.")}}class Yu extends Error{constructor(){super("Description not set.")}}class zu extends Error{constructor(){super("Version not set.")}}class Uu extends Error{constructor(e){super(`Bad name format: ${e}`),this.commandName=e}}const Vu=typeof Deno!="undefined",kt=typeof process!="undefined"&&!Vu,Lt=process.versions.electron&&!process.defaultApp;function qu(u,e,t){if(t.alias){const D=du(t.alias);for(const n of D){if(n in e)throw new Hu(e[n].name,t.name);u.set(typeof n=="symbol"?n:n.split(" "),{...t,__isAlias:!0})}}}function Zu(u){const e=new Map;u[w]&&(e.set(w,u[w]),qu(e,u,u[w]));for(const t of Object.values(u))qu(e,u,t),e.set(t.name.split(" "),t);return e}function Fu(u,e){if(e===w)return u[w];const t=du(e),D=Zu(u);let n,r;return D.forEach((o,l)=>{if(l===w){n=D.get(w),r=w;return}Nu(t,l)&&(!r||r===w||l.length>r.length)&&(n=o,r=l)}),n}function Ju(u,e,t=1/0){const D=e===""?[]:Array.isArray(e)?e:e.split(" ");return Object.values(u).filter(n=>{const r=n.name.split(" ");return Nu(r,D)&&r.length-D.length<=t})}const It=u=>Ju(u,"",1);function Ku(u){const e=[];for(const t of u){if(t.startsWith("-"))break;e.push(t)}return e}const Cu=()=>kt?process.argv.slice(Lt?1:2):Vu?Deno.args:[];function Qu(u){const e={pre:[],normal:[],post:[]};for(const D of u){const n=typeof D=="object"?D:{fn:D},{enforce:r,fn:o}=n;r==="post"||r==="pre"?e[r].push(o):e.normal.push(o)}const t=[...e.pre,...e.normal,...e.post];return D=>{return n(0);function n(r){const o=t[r];return o(D(),n.bind(null,r+1))}}}const Xu=u=>typeof u=="string"&&(u.startsWith(" ")||u.endsWith(" ")),ue=(u,e)=>e?`[${u}]`:`<${u}>`,jt="<Root>",G=u=>Array.isArray(u)?u.join(" "):typeof u=="string"?u:jt,{stringify:Y}=JSON;function gu(u){const e=[];let t,D;for(const n of u){if(D)throw new Error(`Invalid parameter: Spread parameter ${Y(D)} must be last`);const r=n[0],o=n[n.length-1];let l;if(r==="<"&&o===">"&&(l=!0,t))throw new Error(`Invalid parameter: Required parameter ${Y(n)} cannot come after optional parameter ${Y(t)}`);if(r==="["&&o==="]"&&(l=!1,t=n),l===void 0)throw new Error(`Invalid parameter: ${Y(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=n.slice(1,-1);const s=a.slice(-3)==="...";s&&(D=n,a=a.slice(0,-3)),e.push({name:a,required:l,spread:s})}return e}function Eu(u,e,t){for(let D=0;D<e.length;D+=1){const{name:n,required:r,spread:o}=e[D],l=Mt(n);if(l in u)return new Error(`Invalid parameter: ${Y(n)} is used more than once.`);const a=o?t.slice(D):t[D];if(o&&(D=e.length),r&&(!a||o&&a.length===0))return new Error(`Error: Missing required parameter ${Y(n)}`);u[l]=a}}var Bu=(u,e,t)=>{if(!e.has(u))throw TypeError("Cannot "+t)},B=(u,e,t)=>(Bu(u,e,"read from private field"),t?t.call(u):e.get(u)),T=(u,e,t)=>{if(e.has(u))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(u):e.set(u,t)},j=(u,e,t,D)=>(Bu(u,e,"write to private field"),D?D.call(u,t):e.set(u,t),t),Wt=(u,e,t)=>(Bu(u,e,"access private method"),t),W,N,P,J,K,iu,z,au,xu,ee,bu,te,Au,De;const w=Symbol("Root"),ne=class{constructor(u,e,t){T(this,xu),T(this,bu),T(this,Au),T(this,W,""),T(this,N,""),T(this,P,""),T(this,J,[]),T(this,K,{}),T(this,iu,new pt),T(this,z,new Set),T(this,au,void 0),j(this,W,u||B(this,W)),j(this,N,e||B(this,N)),j(this,P,t||B(this,P))}get _name(){return B(this,W)}get _description(){return B(this,N)}get _version(){return B(this,P)}get _inspectors(){return B(this,J)}get _commands(){return B(this,K)}static create(u,e,t){return new ne(u,e,t)}name(u){return j(this,W,u),this}description(u){return j(this,N,u),this}version(u){return j(this,P,u),this}command(u,e,t={}){const D=(s=>!(typeof s=="string"||s===w))(u),n=D?u.name:u;if(Xu(n))throw new Uu(n);const{handler:r=void 0,...o}=D?u:{name:n,description:e,...t},l=[o.name],a=o.alias?du(o.alias):[];o.alias&&l.push(...a);for(const s of l)if(B(this,z).has(s))throw new Pu(G(s));return B(this,K)[n]=o,B(this,z).add(o.name),a.forEach(s=>B(this,z).add(s)),D&&r&&this.on(u.name,r),this}on(u,e){return B(this,iu).on(u,e),this}use(u){return u.setup(this)}inspector(u){return B(this,J).push(u),this}parse(u=Cu()){const{argv:e,run:t}=Array.isArray(u)?{argv:u,run:!0}:{argv:Cu(),...u};return j(this,au,e),Wt(this,Au,De).call(this),t&&this.runMatchedCommand(),this}runMatchedCommand(){const u=B(this,au);if(!u)throw new Error("cli.parse() must be called.");const e=Ku(u),t=e.join(" "),D=()=>Fu(B(this,K),e),n=[],r=()=>{n.length=0;const a=D(),s=!!a,d=Rt((a==null?void 0:a.flags)||{},[...u]),{_:C,flags:m,unknownFlags:h}=d;let i=!s||a.name===w?C:C.slice(a.name.split(" ").length),c=(a==null?void 0:a.parameters)||[];const p=c.indexOf("--"),F=c.slice(p+1)||[],f=Object.create(null);if(p>-1&&F.length>0){c=c.slice(0,p);const g=C["--"];i=i.slice(0,-g.length||void 0),n.push(Eu(f,gu(c),i)),n.push(Eu(f,gu(F),g))}else n.push(Eu(f,gu(c),i));const E={...m,...h};return{name:a==null?void 0:a.name,called:e.length===0&&(a==null?void 0:a.name)?w:t,resolved:s,hasRootOrAlias:B(this,xu,ee),hasRoot:B(this,bu,te),raw:{...d,parameters:i,mergedFlags:E},parameters:f,flags:m,unknownFlags:h,cli:this}},o={enforce:"post",fn:()=>{const a=D(),s=r(),d=n.filter(Boolean);if(d.length>0)throw d[0];if(!a)throw t?new ou(t):new su;B(this,iu).emit(a.name,s)}},l=[...B(this,J),o];return Qu(l)(r),this}};let Nt=ne;W=new WeakMap,N=new WeakMap,P=new WeakMap,J=new WeakMap,K=new WeakMap,iu=new WeakMap,z=new WeakMap,au=new WeakMap,xu=new WeakSet,ee=function(){return B(this,z).has(w)},bu=new WeakSet,te=function(){return Object.prototype.hasOwnProperty.call(this._commands,w)},Au=new WeakSet,De=function(){if(!B(this,W))throw new Gu;if(!B(this,N))throw new Yu;if(!B(this,P))throw new zu};const H=u=>u,Pt=(u,e,t)=>t,Ht=(u,e)=>e,Gt=(u,e)=>({...u,handler:e}),Yt=u=>`
2
- ${u})
3
- cmd+="__${u}"
4
- ;;`,zt=u=>{const{cli:e}=u,{_name:t,_commands:D}=e;return`_${t}() {
1
+ import oe from"tty";class pt{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(t,n){return t==="*"?(this.wildcardListeners.add(n),this):(this.listenerMap[t]||(this.listenerMap[t]=new Set),this.listenerMap[t].add(n),this)}emit(t,...n){return this.listenerMap[t]&&(this.wildcardListeners.forEach(r=>r(t,...n)),this.listenerMap[t].forEach(r=>r(...n))),this}off(t,n){var r,o;return t==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):t==="*"?(n?this.wildcardListeners.delete(n):this.wildcardListeners.clear(),this):(n?(r=this.listenerMap[t])==null||r.delete(n):(o=this.listenerMap[t])==null||o.clear(),this)}}const gt="known-flag",dt="unknown-flag",ft="argument",{stringify:U}=JSON,xt=/\B([A-Z])/g,$t=e=>e.replace(xt,"-$1").toLowerCase(),{hasOwnProperty:Bt}=Object.prototype,Y=(e,t)=>Bt.call(e,t),St=e=>Array.isArray(e),Be=e=>typeof e=="function"?[e,!1]:St(e)?[e[0],!0]:Be(e.type),wt=(e,t)=>e===Boolean?t!=="false":t,yt=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),Ct=/[\s.:=]/,bt=e=>{const t=`Flag name ${U(e)}`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const n=e.match(Ct);if(n)throw new Error(`${t} cannot contain ${U(n==null?void 0:n[0])}`)},Et=e=>{const t={},n=(r,o)=>{if(Y(t,r))throw new Error(`Duplicate flags named ${U(r)}`);t[r]=o};for(const r in e){if(!Y(e,r))continue;bt(r);const o=e[r],s=[[],...Be(o),o];n(r,s);const i=$t(r);if(r!==i&&n(i,s),"alias"in o&&typeof o.alias=="string"){const{alias:u}=o,a=`Flag alias ${U(u)} for flag ${U(r)}`;if(u.length===0)throw new Error(`${a} cannot be empty`);if(u.length>1)throw new Error(`${a} must be a single character`);n(u,s)}}return t},vt=(e,t)=>{const n={};for(const r in e){if(!Y(e,r))continue;const[o,,s,i]=t[r];if(o.length===0&&"default"in i){let{default:u}=i;typeof u=="function"&&(u=u()),n[r]=u}else n[r]=s?o:o.pop()}return n},J="--",At=/[.:=]/,Ot=/^-{1,2}\w/,_t=e=>{if(!Ot.test(e))return;const t=!e.startsWith(J);let n=e.slice(t?1:2),r;const o=n.match(At);if(o){const{index:s}=o;r=n.slice(s+1),n=n.slice(0,s)}return[n,r,t]},Tt=(e,{onFlag:t,onArgument:n})=>{let r;const o=(s,i)=>{if(typeof r!="function")return!0;r(s,i),r=void 0};for(let s=0;s<e.length;s+=1){const i=e[s];if(i===J){o();const a=e.slice(s+1);n==null||n(a,[s],!0);break}const u=_t(i);if(u){if(o(),!t)continue;const[a,l,p]=u;if(p)for(let g=0;g<a.length;g+=1){o();const c=g===a.length-1;r=t(a[g],c?l:void 0,[s,g+1,c])}else r=t(a,l,[s])}else o(i,[s])&&(n==null||n([i],[s]))}o()},Mt=(e,t)=>{for(const[n,r,o]of t.reverse()){if(r){const s=e[n];let i=s.slice(0,r);if(o||(i+=s.slice(r+1)),i!=="-"){e[n]=i;continue}}e.splice(n,1)}},It=(e,t=process.argv.slice(2),{ignore:n}={})=>{const r=[],o=Et(e),s={},i=[];return i[J]=[],Tt(t,{onFlag(u,a,l){const p=Y(o,u);if(!(n!=null&&n(p?gt:dt,u,a))){if(p){const[g,c]=o[u],h=wt(c,a),m=(d,x)=>{r.push(l),x&&r.push(x),g.push(yt(c,d||""))};return h===void 0?m:m(h)}Y(s,u)||(s[u]=[]),s[u].push(a===void 0?!0:a),r.push(l)}},onArgument(u,a,l){n!=null&&n(ft,t[a[0]])||(i.push(...u),l?(i[J]=u,t.splice(a[0])):r.push(a))}}),Mt(t,r),{flags:vt(e,o),unknownFlags:s,_:i}},se=e=>Array.isArray(e)?e:[e],kt=e=>e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase()),Ft=(e,t)=>t.length!==e.length?!1:e.every((n,r)=>n===t[r]),Se=(e,t)=>t.length>e.length?!1:Ft(e.slice(0,t.length),t);class we extends Error{constructor(t){super(`Command "${t}" exists.`),this.commandName=t}}class z extends Error{constructor(t){super(`No such command: ${t}`),this.commandName=t}}class K extends Error{constructor(){super("No command given.")}}class ye extends Error{constructor(t,n){super(`Command name ${t} conflicts with ${n}. Maybe caused by alias.`),this.n1=t,this.n2=n}}class Ce extends Error{constructor(){super("Name not set.")}}class be extends Error{constructor(){super("Description not set.")}}class Ee extends Error{constructor(){super("Version not set.")}}class ve extends Error{constructor(t){super(`Bad name format: ${t}`),this.commandName=t}}const Ae=typeof Deno!="undefined",Lt=typeof process!="undefined"&&!Ae,Rt=process.versions.electron&&!process.defaultApp;function Oe(e,t,n){if(n.alias){const r=se(n.alias);for(const o of r){if(o in t)throw new ye(t[o].name,n.name);e.set(typeof o=="symbol"?o:o.split(" "),{...n,__isAlias:!0})}}}function _e(e){const t=new Map;e[y]&&(t.set(y,e[y]),Oe(t,e,e[y]));for(const n of Object.values(e))Oe(t,e,n),t.set(n.name.split(" "),n);return t}function ie(e,t){if(t===y)return e[y];const n=se(t),r=_e(e);let o,s;return r.forEach((i,u)=>{if(u===y){o=r.get(y),s=y;return}Se(n,u)&&(!s||s===y||u.length>s.length)&&(o=i,s=u)}),o}function Te(e,t,n=1/0){const r=t===""?[]:Array.isArray(t)?t:t.split(" ");return Object.values(e).filter(o=>{const s=o.name.split(" ");return Se(s,r)&&s.length-r.length<=n})}const Dt=e=>Te(e,"",1);function Me(e){const t=[];for(const n of e){if(n.startsWith("-"))break;t.push(n)}return t}const ae=()=>Lt?process.argv.slice(Rt?1:2):Ae?Deno.args:[];function Ie(e){const t={pre:[],normal:[],post:[]};for(const r of e){const o=typeof r=="object"?r:{fn:r},{enforce:s,fn:i}=o;s==="post"||s==="pre"?t[s].push(i):t.normal.push(i)}const n=[...t.pre,...t.normal,...t.post];return r=>{return o(0);function o(s){const i=n[s];return i(r(),o.bind(null,s+1))}}}const ke=e=>typeof e=="string"&&(e.startsWith(" ")||e.endsWith(" ")),Fe=(e,t)=>t?`[${e}]`:`<${e}>`,jt="<Root>",j=e=>Array.isArray(e)?e.join(" "):typeof e=="string"?e:jt,{stringify:N}=JSON;function le(e){const t=[];let n,r;for(const o of e){if(r)throw new Error(`Invalid parameter: Spread parameter ${N(r)} must be last`);const s=o[0],i=o[o.length-1];let u;if(s==="<"&&i===">"&&(u=!0,n))throw new Error(`Invalid parameter: Required parameter ${N(o)} cannot come after optional parameter ${N(n)}`);if(s==="["&&i==="]"&&(u=!1,n=o),u===void 0)throw new Error(`Invalid parameter: ${N(o)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=o.slice(1,-1);const l=a.slice(-3)==="...";l&&(r=o,a=a.slice(0,-3)),t.push({name:a,required:u,spread:l})}return t}function ue(e,t,n){for(let r=0;r<t.length;r+=1){const{name:o,required:s,spread:i}=t[r],u=kt(o);if(u in e)return new Error(`Invalid parameter: ${N(o)} is used more than once.`);const a=i?n.slice(r):n[r];if(i&&(r=t.length),s&&(!a||i&&a.length===0))return new Error(`Error: Missing required parameter ${N(o)}`);e[u]=a}}var ce=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},$=(e,t,n)=>(ce(e,t,"read from private field"),n?n.call(e):t.get(e)),v=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},k=(e,t,n,r)=>(ce(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Nt=(e,t,n)=>(ce(e,t,"access private method"),n),F,L,R,V,G,Q,W,X,me,Le,he,Re,pe,De;const y=Symbol("Root"),je=class{constructor(e,t,n){v(this,me),v(this,he),v(this,pe),v(this,F,""),v(this,L,""),v(this,R,""),v(this,V,[]),v(this,G,{}),v(this,Q,new pt),v(this,W,new Set),v(this,X,void 0),k(this,F,e||$(this,F)),k(this,L,t||$(this,L)),k(this,R,n||$(this,R))}get _name(){return $(this,F)}get _description(){return $(this,L)}get _version(){return $(this,R)}get _inspectors(){return $(this,V)}get _commands(){return $(this,G)}static create(e,t,n){return new je(e,t,n)}name(e){return k(this,F,e),this}description(e){return k(this,L,e),this}version(e){return k(this,R,e),this}command(e,t,n={}){const r=(l=>!(typeof l=="string"||l===y))(e),o=r?e.name:e;if(ke(o))throw new ve(o);const{handler:s=void 0,...i}=r?e:{name:o,description:t,...n},u=[i.name],a=i.alias?se(i.alias):[];i.alias&&u.push(...a);for(const l of u)if($(this,W).has(l))throw new we(j(l));return $(this,G)[o]=i,$(this,W).add(i.name),a.forEach(l=>$(this,W).add(l)),r&&s&&this.on(e.name,s),this}on(e,t){return $(this,Q).on(e,t),this}use(e){return e.setup(this)}inspector(e){return $(this,V).push(e),this}parse(e=ae()){const{argv:t,run:n}=Array.isArray(e)?{argv:e,run:!0}:{argv:ae(),...e};return k(this,X,t),Nt(this,pe,De).call(this),n&&this.runMatchedCommand(),this}runMatchedCommand(){const e=$(this,X);if(!e)throw new Error("cli.parse() must be called.");const t=Me(e),n=t.join(" "),r=()=>ie($(this,G),t),o=[],s=()=>{o.length=0;const a=r(),l=!!a,p=It((a==null?void 0:a.flags)||{},[...e]),{_:g,flags:c,unknownFlags:h}=p;let m=!l||a.name===y?g:g.slice(a.name.split(" ").length),d=(a==null?void 0:a.parameters)||[];const x=d.indexOf("--"),O=d.slice(x+1)||[],f=Object.create(null);if(x>-1&&O.length>0){d=d.slice(0,x);const E=g["--"];m=m.slice(0,-E.length||void 0),o.push(ue(f,le(d),m)),o.push(ue(f,le(O),E))}else o.push(ue(f,le(d),m));const I={...c,...h};return{name:a==null?void 0:a.name,called:t.length===0&&(a==null?void 0:a.name)?y:n,resolved:l,hasRootOrAlias:$(this,me,Le),hasRoot:$(this,he,Re),raw:{...p,parameters:m,mergedFlags:I},parameters:f,flags:c,unknownFlags:h,cli:this}},i={enforce:"post",fn:()=>{const a=r(),l=s(),p=o.filter(Boolean);if(p.length>0)throw p[0];if(!a)throw n?new z(n):new K;$(this,Q).emit(a.name,l)}},u=[...$(this,V),i];return Ie(u)(s),this}};let Wt=je;F=new WeakMap,L=new WeakMap,R=new WeakMap,V=new WeakMap,G=new WeakMap,Q=new WeakMap,W=new WeakMap,X=new WeakMap,me=new WeakSet,Le=function(){return $(this,W).has(y)},he=new WeakSet,Re=function(){return Object.prototype.hasOwnProperty.call(this._commands,y)},pe=new WeakSet,De=function(){if(!$(this,F))throw new Ce;if(!$(this,L))throw new be;if(!$(this,R))throw new Ee};const D=e=>e,Pt=(e,t,n)=>n,Ht=(e,t)=>t,Ut=(e,t)=>({...e,handler:t}),Yt=e=>`
2
+ ${e})
3
+ cmd+="__${e}"
4
+ ;;`,Vt=e=>{const{cli:t}=e,{_name:n,_commands:r}=t;return`_${n}() {
5
5
  local i cur prev opts cmds
6
6
  COMPREPLY=()
7
7
  cur="\${COMP_WORDS[COMP_CWORD]}"
@@ -13,27 +13,27 @@ import fu from"tty";import ct from"util";import ht from"os";class pt{constructor
13
13
  do
14
14
  case "\${i}" in
15
15
  "$1")
16
- cmd="${t}"
16
+ cmd="${n}"
17
17
  ;;
18
- ${Object.keys(D).map(Yt).join("")}
18
+ ${Object.keys(r).map(Yt).join("")}
19
19
  *)
20
20
  ;;
21
21
  esac
22
22
  done
23
23
  }
24
24
 
25
- complete -F _${t} -o bashdefault -o default ${t}
26
- `},re=u=>u.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),oe=u=>u.length<=1?`-${u}`:`--${re(u)}`,se="(No Description)",Ut=u=>`[CompletionResult]::new('${u.name}', '${u.name}', [CompletionResultType]::ParameterValue, '${u.description}')`,Vt=u=>Object.entries(u.flags||{}).map(([e,t])=>{const D=[`[CompletionResult]::new('${oe(e)}', '${re(e)}', [CompletionResultType]::ParameterName, '${u.flags[e].description||se}')`];return t!=null&&t.alias&&D.push(`[CompletionResult]::new('${oe(t.alias)}', '${t.alias}', [CompletionResultType]::ParameterName, '${u.flags[e].description||se}')`),D.join(`
25
+ complete -F _${n} -o bashdefault -o default ${n}
26
+ `},Ne=e=>e.replace(/([A-Z])/g,(t,n)=>`-${n.toLowerCase()}`),We=e=>e.length<=1?`-${e}`:`--${Ne(e)}`,Pe="(No Description)",Gt=e=>`[CompletionResult]::new('${e.name}', '${e.name}', [CompletionResultType]::ParameterValue, '${e.description}')`,qt=e=>Object.entries(e.flags||{}).map(([t,n])=>{const r=[`[CompletionResult]::new('${We(t)}', '${Ne(t)}', [CompletionResultType]::ParameterName, '${e.flags[t].description||Pe}')`];return n!=null&&n.alias&&r.push(`[CompletionResult]::new('${We(n.alias)}', '${n.alias}', [CompletionResultType]::ParameterName, '${e.flags[t].description||Pe}')`),r.join(`
27
27
  `)}).join(`
28
- `),qt=u=>{const{cli:e}=u,{_name:t,_commands:D}=e;return`using namespace System.Management.Automation
28
+ `),Zt=e=>{const{cli:t}=e,{_name:n,_commands:r}=t;return`using namespace System.Management.Automation
29
29
  using namespace System.Management.Automation.Language
30
30
 
31
- Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
31
+ Register-ArgumentCompleter -Native -CommandName '${n}' -ScriptBlock {
32
32
  param($wordToComplete, $commandAst, $cursorPosition)
33
33
 
34
34
  $commandElements = $commandAst.CommandElements
35
35
  $command = @(
36
- '${t}'
36
+ '${n}'
37
37
  for ($i = 1; $i -lt $commandElements.Count; $i++) {
38
38
  $element = $commandElements[$i]
39
39
  if ($element -isnot [StringConstantExpressionAst] -or
@@ -46,13 +46,13 @@ Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
46
46
  }) -join ';'
47
47
 
48
48
  $completions = @(switch ($command) {
49
- '${t}' {
50
- ${Object.entries(D).map(([n,r])=>Ut(r)).join(`
49
+ '${n}' {
50
+ ${Object.entries(r).map(([o,s])=>Gt(s)).join(`
51
51
  `)}
52
52
  break
53
53
  }
54
- ${Object.entries(D).map(([n,r])=>`'${t};${n.split(" ").join(";")}' {
55
- ${Vt(r)}
54
+ ${Object.entries(r).map(([o,s])=>`'${n};${o.split(" ").join(";")}' {
55
+ ${qt(s)}
56
56
  break
57
57
  }`).join(`
58
58
  `)}
@@ -60,23 +60,18 @@ Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
60
60
 
61
61
  $completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
62
62
  Sort-Object -Property ListItemText
63
- }`},ie={bash:zt,pwsh:qt},Zt=(u={})=>H({setup:e=>{const{command:t=!0}=u;return t&&(e=e.command("completions","Print shell completions to stdout",{flags:{shell:{description:"Shell type",type:String,default:""}},parameters:["[shell]"]}).on("completions",D=>{if(!e._name)throw new Error("CLI name is not defined!");const n=String(D.parameters.shell||D.flags.shell);if(!n)throw new Error("Missing shell name");if(n in ie)process.stdout.write(ie[n](D));else throw new Error(`No such shell: ${n}`)})),e}}),Jt=u=>Array.isArray(u)?u:[u],Kt=u=>u.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),ae=u=>u.length<=1?`-${u}`:`--${Kt(u)}`;function Qt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var $={exports:{}};let Xt=fu,uD=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Xt.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),x=(u,e,t=u)=>D=>{let n=""+D,r=n.indexOf(e,u.length);return~r?u+le(n,e,t,r)+e:u+n+e},le=(u,e,t,D)=>{let n=u.substring(0,D)+t,r=u.substring(D+e.length),o=r.indexOf(e);return~o?n+le(r,e,t,o):n+r},ce=(u=uD)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?x("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?x("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?x("\x1B[3m","\x1B[23m"):String,underline:u?x("\x1B[4m","\x1B[24m"):String,inverse:u?x("\x1B[7m","\x1B[27m"):String,hidden:u?x("\x1B[8m","\x1B[28m"):String,strikethrough:u?x("\x1B[9m","\x1B[29m"):String,black:u?x("\x1B[30m","\x1B[39m"):String,red:u?x("\x1B[31m","\x1B[39m"):String,green:u?x("\x1B[32m","\x1B[39m"):String,yellow:u?x("\x1B[33m","\x1B[39m"):String,blue:u?x("\x1B[34m","\x1B[39m"):String,magenta:u?x("\x1B[35m","\x1B[39m"):String,cyan:u?x("\x1B[36m","\x1B[39m"):String,white:u?x("\x1B[37m","\x1B[39m"):String,gray:u?x("\x1B[90m","\x1B[39m"):String,bgBlack:u?x("\x1B[40m","\x1B[49m"):String,bgRed:u?x("\x1B[41m","\x1B[49m"):String,bgGreen:u?x("\x1B[42m","\x1B[49m"):String,bgYellow:u?x("\x1B[43m","\x1B[49m"):String,bgBlue:u?x("\x1B[44m","\x1B[49m"):String,bgMagenta:u?x("\x1B[45m","\x1B[49m"):String,bgCyan:u?x("\x1B[46m","\x1B[49m"):String,bgWhite:u?x("\x1B[47m","\x1B[49m"):String});$.exports=ce(),$.exports.createColors=ce;var eD=Function.prototype.toString,tD=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function DD(u){if(typeof u!="function")return null;var e="";if(typeof Function.prototype.name=="undefined"&&typeof u.name=="undefined"){var t=eD.call(u).match(tD);t&&(e=t[1])}else e=u.name;return e}var he=DD,pe={exports:{}};let yu=[],me=0;const S=(u,e)=>{me>=e&&yu.push(u)};S.WARN=1,S.INFO=2,S.DEBUG=3,S.reset=()=>{yu=[]},S.setDebugLevel=u=>{me=u},S.warn=u=>S(u,S.WARN),S.info=u=>S(u,S.INFO),S.debug=u=>S(u,S.DEBUG),S.debugMessages=()=>yu;var wu=S,Su={exports:{}},nD=({onlyFirst:u=!1}={})=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,u?void 0:"g")};const rD=nD;var oD=u=>typeof u=="string"?u.replace(rD(),""):u,$u={exports:{}};const fe=u=>Number.isNaN(u)?!1:u>=4352&&(u<=4447||u===9001||u===9002||11904<=u&&u<=12871&&u!==12351||12880<=u&&u<=19903||19968<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65131||65281<=u&&u<=65376||65504<=u&&u<=65510||110592<=u&&u<=110593||127488<=u&&u<=127569||131072<=u&&u<=262141);$u.exports=fe,$u.exports.default=fe;var sD=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};const iD=oD,aD=$u.exports,lD=sD,de=u=>{if(typeof u!="string"||u.length===0||(u=iD(u),u.length===0))return 0;u=u.replace(lD()," ");let e=0;for(let t=0;t<u.length;t++){const D=u.codePointAt(t);D<=31||D>=127&&D<=159||D>=768&&D<=879||(D>65535&&t++,e+=aD(D)?2:1)}return e};Su.exports=de,Su.exports.default=de;const Fe=Su.exports;function lu(u){return u?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function M(u){let e=lu();return(""+u).replace(e,"").split(`
64
- `).reduce(function(t,D){return Fe(D)>t?Fe(D):t},0)}function Q(u,e){return Array(e+1).join(u)}function cD(u,e,t,D){let n=M(u);if(e+1>=n){let r=e-n;switch(D){case"right":{u=Q(t,r)+u;break}case"center":{let o=Math.ceil(r/2),l=r-o;u=Q(t,l)+u+Q(t,o);break}default:{u=u+Q(t,r);break}}}return u}let U={};function X(u,e,t){e="\x1B["+e+"m",t="\x1B["+t+"m",U[e]={set:u,to:!0},U[t]={set:u,to:!1},U[u]={on:e,off:t}}X("bold",1,22),X("italics",3,23),X("underline",4,24),X("inverse",7,27),X("strikethrough",9,29);function Ce(u,e){let t=e[1]?parseInt(e[1].split(";")[0]):0;if(t>=30&&t<=39||t>=90&&t<=97){u.lastForegroundAdded=e[0];return}if(t>=40&&t<=49||t>=100&&t<=107){u.lastBackgroundAdded=e[0];return}if(t===0){for(let n in u)Object.prototype.hasOwnProperty.call(u,n)&&delete u[n];return}let D=U[e[0]];D&&(u[D.set]=D.to)}function hD(u){let e=lu(!0),t=e.exec(u),D={};for(;t!==null;)Ce(D,t),t=e.exec(u);return D}function ge(u,e){let t=u.lastBackgroundAdded,D=u.lastForegroundAdded;return delete u.lastBackgroundAdded,delete u.lastForegroundAdded,Object.keys(u).forEach(function(n){u[n]&&(e+=U[n].off)}),t&&t!="\x1B[49m"&&(e+="\x1B[49m"),D&&D!="\x1B[39m"&&(e+="\x1B[39m"),e}function pD(u,e){let t=u.lastBackgroundAdded,D=u.lastForegroundAdded;return delete u.lastBackgroundAdded,delete u.lastForegroundAdded,Object.keys(u).forEach(function(n){u[n]&&(e=U[n].on+e)}),t&&t!="\x1B[49m"&&(e=t+e),D&&D!="\x1B[39m"&&(e=D+e),e}function mD(u,e){if(u.length===M(u))return u.substr(0,e);for(;M(u)>e;)u=u.slice(0,-1);return u}function fD(u,e){let t=lu(!0),D=u.split(lu()),n=0,r=0,o="",l,a={};for(;r<e;){l=t.exec(u);let s=D[n];if(n++,r+M(s)>e&&(s=mD(s,e-r)),o+=s,r+=M(s),r<e){if(!l)break;o+=l[0],Ce(a,l)}}return ge(a,o)}function dD(u,e,t){return t=t||"\u2026",M(u)<=e?u:(e-=M(t),fD(u,e)+t)}function FD(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function CD(u,e){u=u||{},e=e||FD();let t=Object.assign({},e,u);return t.chars=Object.assign({},e.chars,u.chars),t.style=Object.assign({},e.style,u.style),t}function gD(u,e){let t=[],D=e.split(/(\s+)/g),n=[],r=0,o;for(let l=0;l<D.length;l+=2){let a=D[l],s=r+M(a);r>0&&o&&(s+=o.length),s>u?(r!==0&&t.push(n.join("")),n=[a],r=M(a)):(n.push(o||"",a),r=s),o=D[l+1]}return r&&t.push(n.join("")),t}function ED(u,e){let t=[],D="";function n(o,l){for(D.length&&l&&(D+=l),D+=o;D.length>u;)t.push(D.slice(0,u)),D=D.slice(u)}let r=e.split(/(\s+)/g);for(let o=0;o<r.length;o+=2)n(r[o],o&&r[o-1]);return D.length&&t.push(D),t}function BD(u,e,t=!0){let D=[];e=e.split(`
65
- `);const n=t?gD:ED;for(let r=0;r<e.length;r++)D.push.apply(D,n(u,e[r]));return D}function xD(u){let e={},t=[];for(let D=0;D<u.length;D++){let n=pD(e,u[D]);e=hD(n);let r=Object.assign({},e);t.push(ge(r,n))}return t}function bD(u,e){const t="\x1B]",D="\x07",n=";";return[t,"8",n,n,u||e,D,e,t,"8",n,n,D].join("")}var Ee={strlen:M,repeat:Q,pad:cD,truncate:dD,mergeOptions:CD,wordWrap:BD,colorizeLines:xD,hyperlink:bD},Be={exports:{}},cu={exports:{}},xe={exports:{}},be={exports:{}},Ae={exports:{}},ye;function AD(){return ye||(ye=1,function(u){var e={};u.exports=e;var t={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(t).forEach(function(D){var n=t[D],r=e[D]=[];r.open="\x1B["+n[0]+"m",r.close="\x1B["+n[1]+"m"})}(Ae)),Ae.exports}var we,Se;function yD(){return Se||(Se=1,we=function(u,e){e=e||process.argv;var t=e.indexOf("--"),D=/^-{1,2}/.test(u)?"":"--",n=e.indexOf(D+u);return n!==-1&&(t===-1?!0:n<t)}),we}var vu,$e;function wD(){if($e)return vu;$e=1;var u=ht,e=yD(),t=process.env,D=void 0;e("no-color")||e("no-colors")||e("color=false")?D=!1:(e("color")||e("colors")||e("color=true")||e("color=always"))&&(D=!0),"FORCE_COLOR"in t&&(D=t.FORCE_COLOR.length===0||parseInt(t.FORCE_COLOR,10)!==0);function n(l){return l===0?!1:{level:l,hasBasic:!0,has256:l>=2,has16m:l>=3}}function r(l){if(D===!1)return 0;if(e("color=16m")||e("color=full")||e("color=truecolor"))return 3;if(e("color=256"))return 2;if(l&&!l.isTTY&&D!==!0)return 0;var a=D?1:0;if(process.platform==="win32"){var s=u.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(C){return C in t})||t.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(t.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in t){var d=parseInt((t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(t.TERM_PROGRAM){case"iTerm.app":return d>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(t.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(t.TERM)||"COLORTERM"in t?1:(t.TERM,a)}function o(l){var a=r(l);return n(a)}return vu={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)},vu}var ve={exports:{}},Oe;function SD(){return Oe||(Oe=1,function(u){u.exports=function(e,t){var D="";e=e||"Run the trap, drop the bass",e=e.split("");var n={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(r){r=r.toLowerCase();var o=n[r]||[" "],l=Math.floor(Math.random()*o.length);typeof n[r]!="undefined"?D+=n[r][l]:D+=r}),D}}(ve)),ve.exports}var Te={exports:{}},Re;function $D(){return Re||(Re=1,function(u){u.exports=function(e,t){e=e||" he is here ";var D={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},n=[].concat(D.up,D.down,D.mid);function r(a){var s=Math.floor(Math.random()*a);return s}function o(a){var s=!1;return n.filter(function(d){s=d===a}),s}function l(a,s){var d="",C,m;s=s||{},s.up=typeof s.up!="undefined"?s.up:!0,s.mid=typeof s.mid!="undefined"?s.mid:!0,s.down=typeof s.down!="undefined"?s.down:!0,s.size=typeof s.size!="undefined"?s.size:"maxi",a=a.split("");for(m in a)if(!o(m)){switch(d=d+a[m],C={up:0,down:0,mid:0},s.size){case"mini":C.up=r(8),C.mid=r(2),C.down=r(8);break;case"maxi":C.up=r(16)+3,C.mid=r(4)+1,C.down=r(64)+3;break;default:C.up=r(8)+1,C.mid=r(6)/2,C.down=r(8)+1;break}var h=["up","mid","down"];for(var i in h)for(var c=h[i],p=0;p<=C[c];p++)s[c]&&(d=d+D[c][r(D[c].length)])}return d}return l(e,t)}}(Te)),Te.exports}var Me={exports:{}},_e;function vD(){return _e||(_e=1,function(u){u.exports=function(e){return function(t,D,n){if(t===" ")return t;switch(D%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}}(Me)),Me.exports}var ke={exports:{}},Le;function OD(){return Le||(Le=1,function(u){u.exports=function(e){return function(t,D,n){return D%2===0?t:e.inverse(t)}}}(ke)),ke.exports}var Ie={exports:{}},je;function TD(){return je||(je=1,function(u){u.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(D,n,r){return D===" "?D:e[t[n++%t.length]](D)}}}(Ie)),Ie.exports}var We={exports:{}},Ne;function RD(){return Ne||(Ne=1,function(u){u.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(D,n,r){return D===" "?D:e[t[Math.round(Math.random()*(t.length-2))]](D)}}}(We)),We.exports}var Pe;function MD(){return Pe||(Pe=1,function(u){var e={};u.exports=e,e.themes={};var t=ct,D=e.styles=AD(),n=Object.defineProperties,r=new RegExp(/[\r\n]+/g);e.supportsColor=wD().supportsColor,typeof e.enabled=="undefined"&&(e.enabled=e.supportsColor()!==!1),e.enable=function(){e.enabled=!0},e.disable=function(){e.enabled=!1},e.stripColors=e.strip=function(c){return(""+c).replace(/\x1B\[\d+m/g,"")},e.stylize=function(c,p){if(!e.enabled)return c+"";var F=D[p];return!F&&p in e?e[p](c):F.open+c+F.close};var o=/[|\\{}()[\]^$+*?.]/g,l=function(c){if(typeof c!="string")throw new TypeError("Expected a string");return c.replace(o,"\\$&")};function a(c){var p=function F(){return C.apply(F,arguments)};return p._styles=c,p.__proto__=d,p}var s=function(){var c={};return D.grey=D.gray,Object.keys(D).forEach(function(p){D[p].closeRe=new RegExp(l(D[p].close),"g"),c[p]={get:function(){return a(this._styles.concat(p))}}}),c}(),d=n(function(){},s);function C(){var c=Array.prototype.slice.call(arguments),p=c.map(function(y){return y!=null&&y.constructor===String?y:t.inspect(y)}).join(" ");if(!e.enabled||!p)return p;for(var F=p.indexOf(`
66
- `)!=-1,f=this._styles,E=f.length;E--;){var g=D[f[E]];p=g.open+p.replace(g.closeRe,g.open)+g.close,F&&(p=p.replace(r,function(y){return g.close+y+g.open}))}return p}e.setTheme=function(c){if(typeof c=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var p in c)(function(F){e[F]=function(f){if(typeof c[F]=="object"){var E=f;for(var g in c[F])E=e[c[F][g]](E);return E}return e[c[F]](f)}})(p)};function m(){var c={};return Object.keys(s).forEach(function(p){c[p]={get:function(){return a([p])}}}),c}var h=function(c,p){var F=p.split("");return F=F.map(c),F.join("")};e.trap=SD(),e.zalgo=$D(),e.maps={},e.maps.america=vD()(e),e.maps.zebra=OD()(e),e.maps.rainbow=TD()(e),e.maps.random=RD()(e);for(var i in e.maps)(function(c){e[c]=function(p){return h(e.maps[c],p)}})(i);n(e,m())}(be)),be.exports}var He;function _D(){return He||(He=1,function(u){var e=MD();u.exports=e}(xe)),xe.exports}const{info:kD,debug:Ge}=wu,v=Ee;class eu{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){["boolean","number","string"].indexOf(typeof e)!==-1&&(e={content:""+e}),e=e||{},this.options=e;let t=e.content;if(["boolean","number","string"].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof t);this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let D=this.options.chars||{},n=e.chars,r=this.chars={};ID.forEach(function(a){Ru(D,n,a,r)}),this.truncate=this.options.truncate||e.truncate;let o=this.options.style=this.options.style||{},l=e.style;Ru(o,l,"padding-left",this),Ru(o,l,"padding-right",this),this.head=o.head||l.head,this.border=o.border||l.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=v.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){const t=e.wordWrap||e.textWrap,{wordWrap:D=t}=this.options;if(this.fixedWidth&&D){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let o=1;for(;o<this.colSpan;)this.fixedWidth+=e.colWidths[this.x+o],o++}const{wrapOnWordBoundary:n=!0}=e,{wrapOnWordBoundary:r=n}=this.options;return this.wrapLines(v.wordWrap(this.fixedWidth,this.content,r))}return this.wrapLines(this.content.split(`
67
- `))}wrapLines(e){const t=v.colorizeLines(e);return this.href?t.map(D=>v.hyperlink(this.href,D)):t}init(e){let t=this.x,D=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(D,D+this.rowSpan),this.width=this.widths.reduce(ze,-1),this.height=this.heights.reduce(ze,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[D],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let D=v.truncate(this.content,10,this.truncate);e||kD(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${D}`);let n=Math.max(this.height-this.lines.length,0),r;switch(this.vAlign){case"center":r=Math.ceil(n/2);break;case"bottom":r=n;break;default:r=0}if(e<r||e>=r+this.lines.length)return this.drawEmpty(this.drawRight,t);let o=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-r,this.drawRight,o,t)}drawTop(e){let t=[];return this.cells?this.widths.forEach(function(D,n){t.push(this._topLeftChar(n)),t.push(v.repeat(this.chars[this.y==0?"top":"mid"],D))},this):(t.push(this._topLeftChar(0)),t.push(v.repeat(this.chars[this.y==0?"top":"mid"],this.width))),e&&t.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,D;if(this.y==0)D=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)D="leftMid";else if(D=e==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][t]instanceof eu.ColSpanCell&&(D=e==0?"topMid":"mid"),e==0)){let n=1;for(;this.cells[this.y][t-n]instanceof eu.ColSpanCell;)n++;this.cells[this.y][t-n]instanceof eu.RowSpanCell&&(D="leftMid")}return this.chars[D]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let D=_D();for(let n=this[e].length-1;n>=0;n--)D=D[this[e][n]];return D(t)}catch(D){return t}else return t}drawLine(e,t,D,n){let r=this.chars[this.x==0?"left":"middle"];if(this.x&&n&&this.cells){let m=this.cells[this.y+n][this.x-1];for(;m instanceof Ou;)m=this.cells[m.y][m.x-1];m instanceof Tu||(r=this.chars.rightMid)}let o=v.repeat(" ",this.paddingLeft),l=t?this.chars.right:"",a=v.repeat(" ",this.paddingRight),s=this.lines[e],d=this.width-(this.paddingLeft+this.paddingRight);D&&(s+=this.truncate||"\u2026");let C=v.truncate(s,d,this.truncate);return C=v.pad(C,d," ",this.hAlign),C=o+C+a,this.stylizeLine(r,C,l)}stylizeLine(e,t,D){return e=this.wrapWithStyleColors("border",e),D=this.wrapWithStyleColors("border",D),this.y===0&&(t=this.wrapWithStyleColors("head",t)),e+t+D}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],D=v.repeat(this.chars.bottom,this.width),n=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+D+n)}drawEmpty(e,t){let D=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let o=this.cells[this.y+t][this.x-1];for(;o instanceof Ou;)o=this.cells[o.y][o.x-1];o instanceof Tu||(D=this.chars.rightMid)}let n=e?this.chars.right:"",r=v.repeat(" ",this.width);return this.stylizeLine(D,r,n)}}class Ou{constructor(){}draw(e){return typeof e=="number"&&Ge(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}}class Tu{constructor(e){this.originalCell=e}init(e){let t=this.y,D=this.originalCell.y;this.cellOffset=t-D,this.offset=LD(e.rowHeights,D,this.cellOffset)}draw(e){return e=="top"?this.originalCell.draw(this.offset,this.cellOffset):e=="bottom"?this.originalCell.draw("bottom"):(Ge(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e))}mergeTableOptions(){}}function Ye(...u){return u.filter(e=>e!=null).shift()}function Ru(u,e,t,D){let n=t.split("-");n.length>1?(n[1]=n[1].charAt(0).toUpperCase()+n[1].substr(1),n=n.join(""),D[n]=Ye(u[n],u[t],e[n],e[t])):D[t]=Ye(u[t],e[t])}function LD(u,e,t){let D=u[e];for(let n=1;n<t;n++)D+=1+u[e+n];return D}function ze(u,e){return u+e+1}let ID=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];cu.exports=eu,cu.exports.ColSpanCell=Ou,cu.exports.RowSpanCell=Tu;const{warn:jD,debug:WD}=wu,Mu=cu.exports,{ColSpanCell:ND,RowSpanCell:PD}=Mu;(function(){function u(h,i){return h[i]>0?u(h,i+1):i}function e(h){let i={};h.forEach(function(c,p){let F=0;c.forEach(function(f){f.y=p,f.x=p?u(i,F):F;const E=f.rowSpan||1,g=f.colSpan||1;if(E>1)for(let y=0;y<g;y++)i[f.x+y]=E;F=f.x+g}),Object.keys(i).forEach(f=>{i[f]--,i[f]<1&&delete i[f]})})}function t(h){let i=0;return h.forEach(function(c){c.forEach(function(p){i=Math.max(i,p.x+(p.colSpan||1))})}),i}function D(h){return h.length}function n(h,i){let c=h.y,p=h.y-1+(h.rowSpan||1),F=i.y,f=i.y-1+(i.rowSpan||1),E=!(c>f||F>p),g=h.x,y=h.x-1+(h.colSpan||1),tu=i.x,Du=i.x-1+(i.colSpan||1),I=!(g>Du||tu>y);return E&&I}function r(h,i,c){let p=Math.min(h.length-1,c),F={x:i,y:c};for(let f=0;f<=p;f++){let E=h[f];for(let g=0;g<E.length;g++)if(n(F,E[g]))return!0}return!1}function o(h,i,c,p){for(let F=c;F<p;F++)if(r(h,F,i))return!1;return!0}function l(h){h.forEach(function(i,c){i.forEach(function(p){for(let F=1;F<p.rowSpan;F++){let f=new PD(p);f.x=p.x,f.y=p.y+F,f.colSpan=p.colSpan,s(f,h[c+F])}})})}function a(h){for(let i=h.length-1;i>=0;i--){let c=h[i];for(let p=0;p<c.length;p++){let F=c[p];for(let f=1;f<F.colSpan;f++){let E=new ND;E.x=F.x+f,E.y=F.y,c.splice(p+1,0,E)}}}}function s(h,i){let c=0;for(;c<i.length&&i[c].x<h.x;)c++;i.splice(c,0,h)}function d(h){let i=D(h),c=t(h);WD(`Max rows: ${i}; Max cols: ${c}`);for(let p=0;p<i;p++)for(let F=0;F<c;F++)if(!r(h,F,p)){let f={x:F,y:p,colSpan:1,rowSpan:1};for(F++;F<c&&!r(h,F,p);)f.colSpan++,F++;let E=p+1;for(;E<i&&o(h,E,f.x,f.x+f.colSpan);)f.rowSpan++,E++;let g=new Mu(f);g.x=f.x,g.y=f.y,jD(`Missing cell at ${g.y}-${g.x}.`),s(g,h[p])}}function C(h){return h.map(function(i){if(!Array.isArray(i)){let c=Object.keys(i)[0];i=i[c],Array.isArray(i)?(i=i.slice(),i.unshift(c)):i=[c,i]}return i.map(function(c){return new Mu(c)})})}function m(h){let i=C(h);return e(i),d(i),l(i),a(i),i}Be.exports={makeTableLayout:m,layoutTable:e,addRowSpanCells:l,maxWidth:t,fillInTable:d,computeWidths:Ue("colSpan","desiredWidth","x",1),computeHeights:Ue("rowSpan","desiredHeight","y",1)}})();function Ue(u,e,t,D){return function(n,r){let o=[],l=[],a={};r.forEach(function(s){s.forEach(function(d){(d[u]||1)>1?l.push(d):o[d[t]]=Math.max(o[d[t]]||0,d[e]||0,D)})}),n.forEach(function(s,d){typeof s=="number"&&(o[d]=s)});for(let s=l.length-1;s>=0;s--){let d=l[s],C=d[u],m=d[t],h=o[m],i=typeof n[m]=="number"?0:1;if(typeof h=="number")for(let c=1;c<C;c++)h+=1+o[m+c],typeof n[m+c]!="number"&&i++;else h=e==="desiredWidth"?d.desiredWidth-1:1,(!a[m]||a[m]<h)&&(a[m]=h);if(d[e]>h){let c=0;for(;i>0&&d[e]>h;){if(typeof n[m+c]!="number"){let p=Math.round((d[e]-h)/i);h+=p,o[m+c]+=p,i--}c++}}}Object.assign(n,o,a);for(let s=0;s<n.length;s++)n[s]=Math.max(D,n[s]||0)}}const _=wu,HD=Ee,_u=Be.exports;class Ve extends Array{constructor(e){super();const t=HD.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":_.setDebugLevel(_.WARN);break;case"number":_.setDebugLevel(t.debug);break;case"string":_.setDebugLevel(parseInt(t.debug,10));break;default:_.setDebugLevel(_.WARN),_.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return _.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;t?(e=[this.options.head],this.length&&e.push.apply(e,this)):this.options.style.head=[];let D=_u.makeTableLayout(e);D.forEach(function(r){r.forEach(function(o){o.mergeTableOptions(this.options,D)},this)},this),_u.computeWidths(this.options.colWidths,D),_u.computeHeights(this.options.rowHeights,D),D.forEach(function(r){r.forEach(function(o){o.init(this.options)},this)},this);let n=[];for(let r=0;r<D.length;r++){let o=D[r],l=this.options.rowHeights[r];(r===0||!this.options.style.compact||r==1&&t)&&ku(o,"top",n);for(let a=0;a<l;a++)ku(o,a,n);r+1==D.length&&ku(o,"bottom",n)}return n.join(`
68
- `)}get width(){return this.toString().split(`
69
- `)[0].length}}Ve.reset=()=>_.reset();function ku(u,e,t){let D=[];u.forEach(function(r){D.push(r.draw(e))});let n=D.join("");n.length&&t.push(n)}var GD=Ve;(function(u){u.exports=GD})(pe);var YD=Qt(pe.exports);const Lu=(...u)=>{const e=new YD({chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:" "},style:{"padding-left":0,"padding-right":0}});return e.push(...u),e},Iu=(...u)=>Lu(...u).toString().split(`
70
- `),zD=u=>Array.isArray(u)?`Array<${he(u[0])}>`:he(u),UD=u=>{const e=[];for(const t of u){if(t.type==="block"||!t.type){const D=" ",n=t.body.map(o=>D+o);n.unshift("");const r=n.join(`
71
- `);e.push(Lu([$.exports.bold(`${t.title}:`)],[r]).toString())}else if(t.type==="inline"){const D=t.items.map(r=>[$.exports.bold(`${r.title}:`),r.body]),n=Lu(...D);e.push(n.toString())}e.push("")}return e.join(`
72
- `)},ju=$.exports.yellow("-"),VD="(No description)",qD="Name",ZD="Version",JD="Subcommand",KD="Commands",QD="Flags",XD="Description",qe="Usage",un="Examples",Ze="Notes",Je=u=>{process.stdout.write(u)},Ke=(u,e,t)=>{const D=[{title:qD,body:$.exports.red(e._name)},{title:ZD,body:$.exports.yellow(e._version)}];t&&D.push({title:JD,body:$.exports.green(`${e._name} ${G(t.name)}`)}),u.push({type:"inline",items:D}),u.push({title:XD,body:[(t==null?void 0:t.description)||e._description]})},Qe=(u,e)=>{const t=e.map(([D,n])=>[D,ju,n]);u.push({title:un,body:Iu(...t)})},hu=(u,e,t,D)=>{const{cli:n}=e,r=[];Ke(r,n),r.push({title:qe,body:[$.exports.magenta(`$ ${n._name} ${ue("command",e.hasRootOrAlias)} [flags]`)]});const o=[...e.hasRoot?[n._commands[w]]:[],...Object.values(n._commands)].map(l=>{const a=[typeof l.name=="symbol"?"":l.name,...Jt(l.alias||[])].sort((s,d)=>s===w?-1:d===w?1:s.length-d.length).map(s=>s===""||typeof s=="symbol"?`${n._name}`:`${n._name} ${s}`).join(", ");return[$.exports.cyan(a),ju,l.description]});return r.push({title:KD,body:Iu(...o)}),t&&r.push({title:Ze,body:t}),D&&Qe(r,D),u(r)},Xe=(u,e,t)=>{var D;const{cli:n}=e,r=Fu(n._commands,t);if(!r)throw new ou(G(t));const o=[];Ke(o,n,{...r,name:G(t)});const l=((D=r.parameters)==null?void 0:D.join(" "))||void 0,a=` ${G(t)}`,s=l?` ${l}`:"",d=r.flags?" [flags]":"";return o.push({title:qe,body:[$.exports.magenta(`$ ${n._name}${a}${s}${d}`)]}),r.flags&&o.push({title:QD,body:Iu(...Object.entries(r.flags).map(([C,m])=>{const h=[ae(C)];m.alias&&h.push(ae(m.alias));const i=[$.exports.blue(h.join(", "))];if(i.push(ju,m.description||VD),m.type){const c=zD(m.type);i.push($.exports.gray(`(${c})`))}return i}))}),r.notes&&o.push({title:Ze,body:r.notes}),r.examples&&Qe(o,r.examples),u(o)},en=({command:u=!0,showHelpWhenNoCommand:e=!0,notes:t,examples:D,banner:n,renderer:r="cliffy"}={})=>H({setup:o=>{const l=r==="cliffy"?UD:()=>"",a=s=>{n&&Je(`${n}
73
- `),Je(s)};return u&&(o=o.command("help","Show help",{parameters:["[command...]"],notes:["If no command is specified, show help for the CLI.","If a command is specified, show help for the command.","-h is an alias for --help."],examples:[[`$ ${o._name} help`,"Show help"],[`$ ${o._name} help <command>`,"Show help for a specific command"],[`$ ${o._name} <command> --help`,"Show help for a specific command"]]}).on("help",s=>{s.parameters.command.length?a(Xe(l,s,s.parameters.command)):a(hu(l,s,t,D))})),o.inspector((s,d)=>{const C=s.raw.mergedFlags.h||s.raw.mergedFlags.help;if(!s.hasRootOrAlias&&!s.raw._.length&&e&&!C){let m=`No command given.
63
+ }`},He={bash:Vt,pwsh:Zt},Jt=(e={})=>D({setup:t=>{const{command:n=!0}=e;return n&&(t=t.command("completions","Print shell completions to stdout",{flags:{shell:{description:"Shell type",type:String,default:""}},parameters:["[shell]"]}).on("completions",r=>{if(!t._name)throw new Error("CLI name is not defined!");const o=String(r.parameters.shell||r.flags.shell);if(!o)throw new Error("Missing shell name");if(o in He)process.stdout.write(He[o](r));else throw new Error(`No such shell: ${o}`)})),t}}),zt=e=>Array.isArray(e)?e:[e],Kt=e=>e.replace(/([A-Z])/g,(t,n)=>`-${n.toLowerCase()}`),Ue=e=>e.length<=1?`-${e}`:`--${Kt(e)}`;var C={exports:{}};let Qt=oe,Xt=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Qt.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),B=(e,t,n=e)=>r=>{let o=""+r,s=o.indexOf(t,e.length);return~s?e+Ye(o,t,n,s)+t:e+o+t},Ye=(e,t,n,r)=>{let o=e.substring(0,r)+n,s=e.substring(r+t.length),i=s.indexOf(t);return~i?o+Ye(s,t,n,i):o+s},Ve=(e=Xt)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?B("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?B("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?B("\x1B[3m","\x1B[23m"):String,underline:e?B("\x1B[4m","\x1B[24m"):String,inverse:e?B("\x1B[7m","\x1B[27m"):String,hidden:e?B("\x1B[8m","\x1B[28m"):String,strikethrough:e?B("\x1B[9m","\x1B[29m"):String,black:e?B("\x1B[30m","\x1B[39m"):String,red:e?B("\x1B[31m","\x1B[39m"):String,green:e?B("\x1B[32m","\x1B[39m"):String,yellow:e?B("\x1B[33m","\x1B[39m"):String,blue:e?B("\x1B[34m","\x1B[39m"):String,magenta:e?B("\x1B[35m","\x1B[39m"):String,cyan:e?B("\x1B[36m","\x1B[39m"):String,white:e?B("\x1B[37m","\x1B[39m"):String,gray:e?B("\x1B[90m","\x1B[39m"):String,bgBlack:e?B("\x1B[40m","\x1B[49m"):String,bgRed:e?B("\x1B[41m","\x1B[49m"):String,bgGreen:e?B("\x1B[42m","\x1B[49m"):String,bgYellow:e?B("\x1B[43m","\x1B[49m"):String,bgBlue:e?B("\x1B[44m","\x1B[49m"):String,bgMagenta:e?B("\x1B[45m","\x1B[49m"):String,bgCyan:e?B("\x1B[46m","\x1B[49m"):String,bgWhite:e?B("\x1B[47m","\x1B[49m"):String});C.exports=Ve(),C.exports.createColors=Ve;var en=Function.prototype.toString,tn=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function nn(e){if(typeof e!="function")return null;var t="";if(typeof Function.prototype.name=="undefined"&&typeof e.name=="undefined"){var n=en.call(e).match(tn);n&&(t=n[1])}else t=e.name;return t}var Ge=nn,rn=function(e,t){t||(t={});var n=t.hsep===void 0?" ":t.hsep,r=t.align||[],o=t.stringLength||function(a){return String(a).length},s=Ze(e,function(a,l){return Je(l,function(p,g){var c=qe(p);(!a[g]||c>a[g])&&(a[g]=c)}),a},[]),i=ee(e,function(a){return ee(a,function(l,p){var g=String(l);if(r[p]==="."){var c=qe(g),h=s[p]+(/\./.test(g)?1:2)-(o(g)-c);return g+Array(h).join(" ")}else return g})}),u=Ze(i,function(a,l){return Je(l,function(p,g){var c=o(p);(!a[g]||c>a[g])&&(a[g]=c)}),a},[]);return ee(i,function(a){return ee(a,function(l,p){var g=u[p]-o(l)||0,c=Array(Math.max(g+1,1)).join(" ");return r[p]==="r"||r[p]==="."?c+l:r[p]==="c"?Array(Math.ceil(g/2+1)).join(" ")+l+Array(Math.floor(g/2+1)).join(" "):l+c}).join(n).replace(/\s+$/,"")}).join(`
64
+ `)};function qe(e){var t=/\.[^.]*$/.exec(e);return t?t.index+1:e.length}function Ze(e,t,n){if(e.reduce)return e.reduce(t,n);for(var r=0,o=arguments.length>=3?n:e[r++];r<e.length;r++)t(o,e[r],r);return o}function Je(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t.call(e,e[n],n)}function ee(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t.call(e,e[r],r));return n}const ge=(...e)=>rn(e),de=(...e)=>ge(...e).toString().split(`
65
+ `),on=e=>Array.isArray(e)?`Array<${Ge(e[0])}>`:Ge(e),sn=e=>{const t=[];for(const n of e){if(n.type==="block"||!n.type){const r=" ",o=n.body.map(i=>r+i);o.unshift("");const s=o.join(`
66
+ `);t.push(ge([C.exports.bold(`${n.title}:`)],[s]).toString())}else if(n.type==="inline"){const r=n.items.map(s=>[C.exports.bold(`${s.title}:`),s.body]),o=ge(...r);t.push(o.toString())}t.push("")}return t.join(`
67
+ `)},fe=C.exports.yellow("-"),an="(No description)",ln="Name",un="Version",cn="Subcommand",mn="Commands",hn="Flags",pn="Description",ze="Usage",gn="Examples",Ke="Notes",Qe=e=>{process.stdout.write(e)},Xe=(e,t,n)=>{const r=[{title:ln,body:C.exports.red(t._name)},{title:un,body:C.exports.yellow(t._version)}];n&&r.push({title:cn,body:C.exports.green(`${t._name} ${j(n.name)}`)}),e.push({type:"inline",items:r}),e.push({title:pn,body:[(n==null?void 0:n.description)||t._description]})},et=(e,t)=>{const n=t.map(([r,o])=>[r,fe,o]);e.push({title:gn,body:de(...n)})},te=(e,t,n,r)=>{const{cli:o}=t,s=[];Xe(s,o),s.push({title:ze,body:[C.exports.magenta(`$ ${o._name} ${Fe("command",t.hasRootOrAlias)} [flags]`)]});const i=[...t.hasRoot?[o._commands[y]]:[],...Object.values(o._commands)].map(u=>{const a=[typeof u.name=="symbol"?"":u.name,...zt(u.alias||[])].sort((l,p)=>l===y?-1:p===y?1:l.length-p.length).map(l=>l===""||typeof l=="symbol"?`${o._name}`:`${o._name} ${l}`).join(", ");return[C.exports.cyan(a),fe,u.description]});return s.push({title:mn,body:de(...i)}),n&&s.push({title:Ke,body:n}),r&&et(s,r),e(s)},tt=(e,t,n)=>{var r;const{cli:o}=t,s=ie(o._commands,n);if(!s)throw new z(j(n));const i=[];Xe(i,o,{...s,name:j(n)});const u=((r=s.parameters)==null?void 0:r.join(" "))||void 0,a=` ${j(n)}`,l=u?` ${u}`:"",p=s.flags?" [flags]":"";return i.push({title:ze,body:[C.exports.magenta(`$ ${o._name}${a}${l}${p}`)]}),s.flags&&i.push({title:hn,body:de(...Object.entries(s.flags).map(([g,c])=>{const h=[Ue(g)];c.alias&&h.push(Ue(c.alias));const m=[C.exports.blue(h.join(", "))];if(m.push(fe,c.description||an),c.type){const d=on(c.type);m.push(C.exports.gray(`(${d})`))}return m}))}),s.notes&&i.push({title:Ke,body:s.notes}),s.examples&&et(i,s.examples),e(i)},dn=({command:e=!0,showHelpWhenNoCommand:t=!0,notes:n,examples:r,banner:o,renderer:s="cliffy"}={})=>D({setup:i=>{const u=s==="cliffy"?sn:()=>"",a=l=>{o&&Qe(`${o}
68
+ `),Qe(l)};return e&&(i=i.command("help","Show help",{parameters:["[command...]"],notes:["If no command is specified, show help for the CLI.","If a command is specified, show help for the command.","-h is an alias for --help."],examples:[[`$ ${i._name} help`,"Show help"],[`$ ${i._name} help <command>`,"Show help for a specific command"],[`$ ${i._name} <command> --help`,"Show help for a specific command"]]}).on("help",l=>{l.parameters.command.length?a(tt(u,l,l.parameters.command)):a(te(u,l,n,r))})),i.inspector((l,p)=>{const g=l.raw.mergedFlags.h||l.raw.mergedFlags.help;if(!l.hasRootOrAlias&&!l.raw._.length&&t&&!g){let c=`No command given.
74
69
 
75
- `;m+=hu(l,s,t,D),m+=`
76
- `,a(m),process.exit(1)}else C?s.raw._.length?s.called!==w&&s.name===w?a(hu(l,s,t,D)):a(Xe(l,s,s.raw._)):a(hu(l,s,t,D)):d()}),o}}),k=new Uint32Array(65536),tn=(u,e)=>{const t=u.length,D=e.length,n=1<<t-1;let r=-1,o=0,l=t,a=t;for(;a--;)k[u.charCodeAt(a)]|=1<<a;for(a=0;a<D;a++){let s=k[e.charCodeAt(a)];const d=s|o;s|=(s&r)+r^r,o|=~(s|r),r&=s,o&n&&l++,r&n&&l--,o=o<<1|1,r=r<<1|~(d|o),o&=d}for(a=t;a--;)k[u.charCodeAt(a)]=0;return l},Dn=(u,e)=>{const t=e.length,D=u.length,n=[],r=[],o=Math.ceil(t/32),l=Math.ceil(D/32);for(let i=0;i<o;i++)r[i]=-1,n[i]=0;let a=0;for(;a<l-1;a++){let i=0,c=-1;const p=a*32,F=Math.min(32,D)+p;for(let f=p;f<F;f++)k[u.charCodeAt(f)]|=1<<f;for(let f=0;f<t;f++){const E=k[e.charCodeAt(f)],g=r[f/32|0]>>>f&1,y=n[f/32|0]>>>f&1,tu=E|i,Du=((E|y)&c)+c^c|E|y;let I=i|~(Du|c),nu=c&Du;I>>>31^g&&(r[f/32|0]^=1<<f),nu>>>31^y&&(n[f/32|0]^=1<<f),I=I<<1|g,nu=nu<<1|y,c=nu|~(tu|I),i=I&tu}for(let f=p;f<F;f++)k[u.charCodeAt(f)]=0}let s=0,d=-1;const C=a*32,m=Math.min(32,D-C)+C;for(let i=C;i<m;i++)k[u.charCodeAt(i)]|=1<<i;let h=D;for(let i=0;i<t;i++){const c=k[e.charCodeAt(i)],p=r[i/32|0]>>>i&1,F=n[i/32|0]>>>i&1,f=c|s,E=((c|F)&d)+d^d|c|F;let g=s|~(E|d),y=d&E;h+=g>>>D-1&1,h-=y>>>D-1&1,g>>>31^p&&(r[i/32|0]^=1<<i),y>>>31^F&&(n[i/32|0]^=1<<i),g=g<<1|p,y=y<<1|F,d=y|~(f|g),s=g&f}for(let i=C;i<m;i++)k[u.charCodeAt(i)]=0;return h},ut=(u,e)=>{if(u.length<e.length){const t=e;e=u,u=t}return e.length===0?u.length:u.length<=32?tn(u,e):Dn(u,e)};var pu=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},nn=1/0,rn="[object Symbol]",on=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sn="\\u0300-\\u036f\\ufe20-\\ufe23",an="\\u20d0-\\u20f0",ln="["+sn+an+"]",cn=RegExp(ln,"g"),hn={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},pn=typeof pu=="object"&&pu&&pu.Object===Object&&pu,mn=typeof self=="object"&&self&&self.Object===Object&&self,fn=pn||mn||Function("return this")();function dn(u){return function(e){return u==null?void 0:u[e]}}var Fn=dn(hn),Cn=Object.prototype,gn=Cn.toString,et=fn.Symbol,tt=et?et.prototype:void 0,Dt=tt?tt.toString:void 0;function En(u){if(typeof u=="string")return u;if(xn(u))return Dt?Dt.call(u):"";var e=u+"";return e=="0"&&1/u==-nn?"-0":e}function Bn(u){return!!u&&typeof u=="object"}function xn(u){return typeof u=="symbol"||Bn(u)&&gn.call(u)==rn}function bn(u){return u==null?"":En(u)}function An(u){return u=bn(u),u&&u.replace(on,Fn).replace(cn,"")}var yn=An;let O,R;(function(u){u.ALL_CLOSEST_MATCHES="all-closest-matches",u.ALL_MATCHES="all-matches",u.ALL_SORTED_MATCHES="all-sorted-matches",u.FIRST_CLOSEST_MATCH="first-closest-match",u.FIRST_MATCH="first-match"})(O||(O={})),function(u){u.EDIT_DISTANCE="edit-distance",u.SIMILARITY="similarity"}(R||(R={}));const nt=new Error("unknown returnType"),mu=new Error("unknown thresholdType"),rt=(u,e)=>{let t=u;return e.trimSpaces&&(t=t.trim().replace(/\s+/g," ")),e.deburr&&(t=yn(t)),e.caseSensitive||(t=t.toLowerCase()),t},ot=(u,e)=>{const{matchPath:t}=e,D=((n,r)=>{const o=r.length>0?r.reduce((l,a)=>l==null?void 0:l[a],n):n;return typeof o!="string"?"":o})(u,t);return rt(D,e)};function wn(u,e,t){const D=(m=>{const h={caseSensitive:!1,deburr:!0,matchPath:[],returnType:O.FIRST_CLOSEST_MATCH,thresholdType:R.SIMILARITY,trimSpaces:!0,...m};switch(h.thresholdType){case R.EDIT_DISTANCE:return{threshold:20,...h};case R.SIMILARITY:return{threshold:.4,...h};default:throw mu}})(t),{returnType:n,threshold:r,thresholdType:o}=D,l=rt(u,D);let a,s;switch(o){case R.EDIT_DISTANCE:a=m=>m<=r,s=m=>ut(l,ot(m,D));break;case R.SIMILARITY:a=m=>m>=r,s=m=>((h,i)=>{if(!h||!i)return 0;if(h===i)return 1;const c=ut(h,i),p=Math.max(h.length,i.length);return(p-c)/p})(l,ot(m,D));break;default:throw mu}const d=[],C=e.length;switch(n){case O.ALL_CLOSEST_MATCHES:case O.FIRST_CLOSEST_MATCH:{const m=[];let h;switch(o){case R.EDIT_DISTANCE:h=1/0;for(let c=0;c<C;c+=1){const p=s(e[c]);h>p&&(h=p),m.push(p)}break;case R.SIMILARITY:h=0;for(let c=0;c<C;c+=1){const p=s(e[c]);h<p&&(h=p),m.push(p)}break;default:throw mu}const i=m.length;for(let c=0;c<i;c+=1){const p=m[c];a(p)&&p===h&&d.push(c)}break}case O.ALL_MATCHES:for(let m=0;m<C;m+=1)a(s(e[m]))&&d.push(m);break;case O.ALL_SORTED_MATCHES:{const m=[];for(let h=0;h<C;h+=1){const i=s(e[h]);a(i)&&m.push({score:i,index:h})}switch(o){case R.EDIT_DISTANCE:m.sort((h,i)=>h.score-i.score);break;case R.SIMILARITY:m.sort((h,i)=>i.score-h.score);break;default:throw mu}for(const h of m)d.push(h.index);break}case O.FIRST_MATCH:for(let m=0;m<C;m+=1)if(a(s(e[m]))){d.push(m);break}break;default:throw nt}return((m,h,i)=>{switch(i){case O.ALL_CLOSEST_MATCHES:case O.ALL_MATCHES:case O.ALL_SORTED_MATCHES:return h.map(c=>m[c]);case O.FIRST_CLOSEST_MATCH:case O.FIRST_MATCH:return h.length?m[h[0]]:null;default:throw nt}})(e,d,n)}var V={exports:{}};let Sn=fu,$n=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Sn.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),b=(u,e,t=u)=>D=>{let n=""+D,r=n.indexOf(e,u.length);return~r?u+st(n,e,t,r)+e:u+n+e},st=(u,e,t,D)=>{let n=u.substring(0,D)+t,r=u.substring(D+e.length),o=r.indexOf(e);return~o?n+st(r,e,t,o):n+r},it=(u=$n)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?b("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?b("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?b("\x1B[3m","\x1B[23m"):String,underline:u?b("\x1B[4m","\x1B[24m"):String,inverse:u?b("\x1B[7m","\x1B[27m"):String,hidden:u?b("\x1B[8m","\x1B[28m"):String,strikethrough:u?b("\x1B[9m","\x1B[29m"):String,black:u?b("\x1B[30m","\x1B[39m"):String,red:u?b("\x1B[31m","\x1B[39m"):String,green:u?b("\x1B[32m","\x1B[39m"):String,yellow:u?b("\x1B[33m","\x1B[39m"):String,blue:u?b("\x1B[34m","\x1B[39m"):String,magenta:u?b("\x1B[35m","\x1B[39m"):String,cyan:u?b("\x1B[36m","\x1B[39m"):String,white:u?b("\x1B[37m","\x1B[39m"):String,gray:u?b("\x1B[90m","\x1B[39m"):String,bgBlack:u?b("\x1B[40m","\x1B[49m"):String,bgRed:u?b("\x1B[41m","\x1B[49m"):String,bgGreen:u?b("\x1B[42m","\x1B[49m"):String,bgYellow:u?b("\x1B[43m","\x1B[49m"):String,bgBlue:u?b("\x1B[44m","\x1B[49m"):String,bgMagenta:u?b("\x1B[45m","\x1B[49m"):String,bgCyan:u?b("\x1B[46m","\x1B[49m"):String,bgWhite:u?b("\x1B[47m","\x1B[49m"):String});V.exports=it(),V.exports.createColors=it;const vn=u=>u.length<=1?u[0]:`${u.slice(0,-1).map(V.exports.bold).join(", ")} and ${V.exports.bold(u[u.length-1])}`,On=()=>H({setup:u=>u.inspector({enforce:"pre",fn:(e,t)=>{const D=Object.keys(u._commands),n=!!D.length;try{t()}catch(r){if(!(r instanceof ou||r instanceof su))throw r;if(e.raw._.length===0||r instanceof su){console.error("No command given."),n&&console.error(`Possible commands: ${vn(D)}.`);return}const o=r.commandName,l=wn(o,D);console.error(`Command "${V.exports.strikethrough(o)}" not found.`),n&&l?console.error(`Did you mean "${V.exports.bold(l)}"?`):n||console.error("NOTE: You haven't register any command yet."),process.stderr.write(`
77
- `),process.exit(2)}}})}),Tn=u=>u.length<=1?u[0]:`${u.slice(0,-1).join(", ")} and ${u[u.length-1]}`,Rn=()=>H({setup:u=>u.inspector((e,t)=>{const D=Object.keys(e.unknownFlags);if(!e.resolved||D.length===0)t();else throw new Error(`Unexpected flag${D.length>1?"s":""}: ${Tn(D)}`)})}),Mn=u=>u.length===0?"":u.startsWith("v")?u:`v${u}`,_n=({alias:u=["V"],command:e=!0}={})=>H({setup:t=>{const D=Mn(t._version);return e&&(t=t.command("version","Show version",{notes:['The version string begins with a "v".']}).on("version",()=>{process.stdout.write(D)})),t.inspector({enforce:"pre",fn:(n,r)=>{let o=!1;const l=["version",...u];for(const a of Object.keys(n.raw.mergedFlags))if(l.includes(a)){o=!0;break}o?process.stdout.write(D):r()}})}});var L={exports:{}};let kn=fu,Ln=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||kn.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),A=(u,e,t=u)=>D=>{let n=""+D,r=n.indexOf(e,u.length);return~r?u+at(n,e,t,r)+e:u+n+e},at=(u,e,t,D)=>{let n=u.substring(0,D)+t,r=u.substring(D+e.length),o=r.indexOf(e);return~o?n+at(r,e,t,o):n+r},lt=(u=Ln)=>({isColorSupported:u,reset:u?e=>`\x1B[0m${e}\x1B[0m`:String,bold:u?A("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?A("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?A("\x1B[3m","\x1B[23m"):String,underline:u?A("\x1B[4m","\x1B[24m"):String,inverse:u?A("\x1B[7m","\x1B[27m"):String,hidden:u?A("\x1B[8m","\x1B[28m"):String,strikethrough:u?A("\x1B[9m","\x1B[29m"):String,black:u?A("\x1B[30m","\x1B[39m"):String,red:u?A("\x1B[31m","\x1B[39m"):String,green:u?A("\x1B[32m","\x1B[39m"):String,yellow:u?A("\x1B[33m","\x1B[39m"):String,blue:u?A("\x1B[34m","\x1B[39m"):String,magenta:u?A("\x1B[35m","\x1B[39m"):String,cyan:u?A("\x1B[36m","\x1B[39m"):String,white:u?A("\x1B[37m","\x1B[39m"):String,gray:u?A("\x1B[90m","\x1B[39m"):String,bgBlack:u?A("\x1B[40m","\x1B[49m"):String,bgRed:u?A("\x1B[41m","\x1B[49m"):String,bgGreen:u?A("\x1B[42m","\x1B[49m"):String,bgYellow:u?A("\x1B[43m","\x1B[49m"):String,bgBlue:u?A("\x1B[44m","\x1B[49m"):String,bgMagenta:u?A("\x1B[45m","\x1B[49m"):String,bgCyan:u?A("\x1B[46m","\x1B[49m"):String,bgWhite:u?A("\x1B[47m","\x1B[49m"):String});L.exports=lt(),L.exports.createColors=lt;function In(u){return u.split(`
78
- `).splice(1).map(e=>e.trim().replace("file://",""))}function jn(u){return`
79
- ${In(u).map(e=>` ${e.replace(/^at ([\s\S]+) \((.+)\)/,(t,D,n)=>L.exports.gray(`at ${D} (${L.exports.cyan(n)})`))}`).join(`
80
- `)}`}function Wn(u){return u.map(e=>typeof(e==null?void 0:e.stack)=="string"?`${e.message}
81
- ${jn(e.stack)}`:e)}function Nn(u,e){const t=u.toUpperCase(),D=L.exports[e];return L.exports.bold(L.exports.inverse(D(` ${t} `)))}function uu(u,e,t){const D=L.exports[e],n=t!=null&&t.textColor?L.exports[t.textColor]:D,r=(t==null?void 0:t.target)||console.log;return(...o)=>{const l=Wn(o);r(`${Nn(u,e)} ${n(l.join(" "))}
82
- `)}}uu("log","gray"),uu("info","blue",{target:console.info}),uu("warn","yellow",{target:console.warn}),uu("success","green");const Pn=uu("error","red",{target:console.error}),Hn=()=>H({setup:u=>u.inspector({enforce:"pre",fn:(e,t)=>{try{t()}catch(D){Pn(D.message),process.exit(1)}}})});export{Nt as Clerc,Pu as CommandExistsError,Hu as CommandNameConflictError,Yu as DescriptionNotSetError,Uu as InvalidCommandNameError,Gu as NameNotSetError,su as NoCommandGivenError,ou as NoSuchCommandError,w as Root,zu as VersionNotSetError,Zt as completionsPlugin,Qu as compose,Gt as defineCommand,Pt as defineHandler,Ht as defineInspector,H as definePlugin,G as formatCommandName,Hn as friendlyErrorPlugin,en as helpPlugin,Xu as isInvalidName,On as notFoundPlugin,Cu as resolveArgv,Fu as resolveCommand,Zu as resolveFlattenCommands,Ku as resolveParametersBeforeFlag,It as resolveRootCommands,Ju as resolveSubcommandsByParent,Rn as strictFlagsPlugin,_n as versionPlugin,ue as withBrackets};
70
+ `;c+=te(u,l,n,r),c+=`
71
+ `,a(c),process.exit(1)}else g?l.raw._.length?l.called!==y&&l.name===y?a(te(u,l,n,r)):a(tt(u,l,l.raw._)):a(te(u,l,n,r)):p()}),i}}),T=new Uint32Array(65536),fn=(e,t)=>{const n=e.length,r=t.length,o=1<<n-1;let s=-1,i=0,u=n,a=n;for(;a--;)T[e.charCodeAt(a)]|=1<<a;for(a=0;a<r;a++){let l=T[t.charCodeAt(a)];const p=l|i;l|=(l&s)+s^s,i|=~(l|s),s&=l,i&o&&u++,s&o&&u--,i=i<<1|1,s=s<<1|~(p|i),i&=p}for(a=n;a--;)T[e.charCodeAt(a)]=0;return u},xn=(e,t)=>{const n=t.length,r=e.length,o=[],s=[],i=Math.ceil(n/32),u=Math.ceil(r/32);for(let m=0;m<i;m++)s[m]=-1,o[m]=0;let a=0;for(;a<u-1;a++){let m=0,d=-1;const x=a*32,O=Math.min(32,r)+x;for(let f=x;f<O;f++)T[e.charCodeAt(f)]|=1<<f;for(let f=0;f<n;f++){const I=T[t.charCodeAt(f)],E=s[f/32|0]>>>f&1,_=o[f/32|0]>>>f&1,xe=I|m,$e=((I|_)&d)+d^d|I|_;let H=m|~($e|d),Z=d&$e;H>>>31^E&&(s[f/32|0]^=1<<f),Z>>>31^_&&(o[f/32|0]^=1<<f),H=H<<1|E,Z=Z<<1|_,d=Z|~(xe|H),m=H&xe}for(let f=x;f<O;f++)T[e.charCodeAt(f)]=0}let l=0,p=-1;const g=a*32,c=Math.min(32,r-g)+g;for(let m=g;m<c;m++)T[e.charCodeAt(m)]|=1<<m;let h=r;for(let m=0;m<n;m++){const d=T[t.charCodeAt(m)],x=s[m/32|0]>>>m&1,O=o[m/32|0]>>>m&1,f=d|l,I=((d|O)&p)+p^p|d|O;let E=l|~(I|p),_=p&I;h+=E>>>r-1&1,h-=_>>>r-1&1,E>>>31^x&&(s[m/32|0]^=1<<m),_>>>31^O&&(o[m/32|0]^=1<<m),E=E<<1|x,_=_<<1|O,p=_|~(f|E),l=E&f}for(let m=g;m<c;m++)T[e.charCodeAt(m)]=0;return h},nt=(e,t)=>{if(e.length<t.length){const n=t;t=e,e=n}return t.length===0?e.length:e.length<=32?fn(e,t):xn(e,t)};var ne=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},$n=1/0,Bn="[object Symbol]",Sn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wn="\\u0300-\\u036f\\ufe20-\\ufe23",yn="\\u20d0-\\u20f0",Cn="["+wn+yn+"]",bn=RegExp(Cn,"g"),En={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},vn=typeof ne=="object"&&ne&&ne.Object===Object&&ne,An=typeof self=="object"&&self&&self.Object===Object&&self,On=vn||An||Function("return this")();function _n(e){return function(t){return e==null?void 0:e[t]}}var Tn=_n(En),Mn=Object.prototype,In=Mn.toString,rt=On.Symbol,ot=rt?rt.prototype:void 0,st=ot?ot.toString:void 0;function kn(e){if(typeof e=="string")return e;if(Ln(e))return st?st.call(e):"";var t=e+"";return t=="0"&&1/e==-$n?"-0":t}function Fn(e){return!!e&&typeof e=="object"}function Ln(e){return typeof e=="symbol"||Fn(e)&&In.call(e)==Bn}function Rn(e){return e==null?"":kn(e)}function Dn(e){return e=Rn(e),e&&e.replace(Sn,Tn).replace(bn,"")}var jn=Dn;let b,A;(function(e){e.ALL_CLOSEST_MATCHES="all-closest-matches",e.ALL_MATCHES="all-matches",e.ALL_SORTED_MATCHES="all-sorted-matches",e.FIRST_CLOSEST_MATCH="first-closest-match",e.FIRST_MATCH="first-match"})(b||(b={})),function(e){e.EDIT_DISTANCE="edit-distance",e.SIMILARITY="similarity"}(A||(A={}));const it=new Error("unknown returnType"),re=new Error("unknown thresholdType"),at=(e,t)=>{let n=e;return t.trimSpaces&&(n=n.trim().replace(/\s+/g," ")),t.deburr&&(n=jn(n)),t.caseSensitive||(n=n.toLowerCase()),n},lt=(e,t)=>{const{matchPath:n}=t,r=((o,s)=>{const i=s.length>0?s.reduce((u,a)=>u==null?void 0:u[a],o):o;return typeof i!="string"?"":i})(e,n);return at(r,t)};function Nn(e,t,n){const r=(c=>{const h={caseSensitive:!1,deburr:!0,matchPath:[],returnType:b.FIRST_CLOSEST_MATCH,thresholdType:A.SIMILARITY,trimSpaces:!0,...c};switch(h.thresholdType){case A.EDIT_DISTANCE:return{threshold:20,...h};case A.SIMILARITY:return{threshold:.4,...h};default:throw re}})(n),{returnType:o,threshold:s,thresholdType:i}=r,u=at(e,r);let a,l;switch(i){case A.EDIT_DISTANCE:a=c=>c<=s,l=c=>nt(u,lt(c,r));break;case A.SIMILARITY:a=c=>c>=s,l=c=>((h,m)=>{if(!h||!m)return 0;if(h===m)return 1;const d=nt(h,m),x=Math.max(h.length,m.length);return(x-d)/x})(u,lt(c,r));break;default:throw re}const p=[],g=t.length;switch(o){case b.ALL_CLOSEST_MATCHES:case b.FIRST_CLOSEST_MATCH:{const c=[];let h;switch(i){case A.EDIT_DISTANCE:h=1/0;for(let d=0;d<g;d+=1){const x=l(t[d]);h>x&&(h=x),c.push(x)}break;case A.SIMILARITY:h=0;for(let d=0;d<g;d+=1){const x=l(t[d]);h<x&&(h=x),c.push(x)}break;default:throw re}const m=c.length;for(let d=0;d<m;d+=1){const x=c[d];a(x)&&x===h&&p.push(d)}break}case b.ALL_MATCHES:for(let c=0;c<g;c+=1)a(l(t[c]))&&p.push(c);break;case b.ALL_SORTED_MATCHES:{const c=[];for(let h=0;h<g;h+=1){const m=l(t[h]);a(m)&&c.push({score:m,index:h})}switch(i){case A.EDIT_DISTANCE:c.sort((h,m)=>h.score-m.score);break;case A.SIMILARITY:c.sort((h,m)=>m.score-h.score);break;default:throw re}for(const h of c)p.push(h.index);break}case b.FIRST_MATCH:for(let c=0;c<g;c+=1)if(a(l(t[c]))){p.push(c);break}break;default:throw it}return((c,h,m)=>{switch(m){case b.ALL_CLOSEST_MATCHES:case b.ALL_MATCHES:case b.ALL_SORTED_MATCHES:return h.map(d=>c[d]);case b.FIRST_CLOSEST_MATCH:case b.FIRST_MATCH:return h.length?c[h[0]]:null;default:throw it}})(t,p,o)}var P={exports:{}};let Wn=oe,Pn=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Wn.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),S=(e,t,n=e)=>r=>{let o=""+r,s=o.indexOf(t,e.length);return~s?e+ut(o,t,n,s)+t:e+o+t},ut=(e,t,n,r)=>{let o=e.substring(0,r)+n,s=e.substring(r+t.length),i=s.indexOf(t);return~i?o+ut(s,t,n,i):o+s},ct=(e=Pn)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?S("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?S("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?S("\x1B[3m","\x1B[23m"):String,underline:e?S("\x1B[4m","\x1B[24m"):String,inverse:e?S("\x1B[7m","\x1B[27m"):String,hidden:e?S("\x1B[8m","\x1B[28m"):String,strikethrough:e?S("\x1B[9m","\x1B[29m"):String,black:e?S("\x1B[30m","\x1B[39m"):String,red:e?S("\x1B[31m","\x1B[39m"):String,green:e?S("\x1B[32m","\x1B[39m"):String,yellow:e?S("\x1B[33m","\x1B[39m"):String,blue:e?S("\x1B[34m","\x1B[39m"):String,magenta:e?S("\x1B[35m","\x1B[39m"):String,cyan:e?S("\x1B[36m","\x1B[39m"):String,white:e?S("\x1B[37m","\x1B[39m"):String,gray:e?S("\x1B[90m","\x1B[39m"):String,bgBlack:e?S("\x1B[40m","\x1B[49m"):String,bgRed:e?S("\x1B[41m","\x1B[49m"):String,bgGreen:e?S("\x1B[42m","\x1B[49m"):String,bgYellow:e?S("\x1B[43m","\x1B[49m"):String,bgBlue:e?S("\x1B[44m","\x1B[49m"):String,bgMagenta:e?S("\x1B[45m","\x1B[49m"):String,bgCyan:e?S("\x1B[46m","\x1B[49m"):String,bgWhite:e?S("\x1B[47m","\x1B[49m"):String});P.exports=ct(),P.exports.createColors=ct;const Hn=e=>e.length<=1?e[0]:`${e.slice(0,-1).map(P.exports.bold).join(", ")} and ${P.exports.bold(e[e.length-1])}`,Un=()=>D({setup:e=>e.inspector({enforce:"pre",fn:(t,n)=>{const r=Object.keys(e._commands),o=!!r.length;try{n()}catch(s){if(!(s instanceof z||s instanceof K))throw s;if(t.raw._.length===0||s instanceof K){console.error("No command given."),o&&console.error(`Possible commands: ${Hn(r)}.`);return}const i=s.commandName,u=Nn(i,r);console.error(`Command "${P.exports.strikethrough(i)}" not found.`),o&&u?console.error(`Did you mean "${P.exports.bold(u)}"?`):o||console.error("NOTE: You haven't register any command yet."),process.stderr.write(`
72
+ `),process.exit(2)}}})}),Yn=e=>e.length<=1?e[0]:`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`,Vn=()=>D({setup:e=>e.inspector((t,n)=>{const r=Object.keys(t.unknownFlags);if(!t.resolved||r.length===0)n();else throw new Error(`Unexpected flag${r.length>1?"s":""}: ${Yn(r)}`)})}),Gn=e=>e.length===0?"":e.startsWith("v")?e:`v${e}`,qn=({alias:e=["V"],command:t=!0}={})=>D({setup:n=>{const r=Gn(n._version);return t&&(n=n.command("version","Show version",{notes:['The version string begins with a "v".']}).on("version",()=>{process.stdout.write(r)})),n.inspector({enforce:"pre",fn:(o,s)=>{let i=!1;const u=["version",...e];for(const a of Object.keys(o.raw.mergedFlags))if(u.includes(a)){i=!0;break}i?process.stdout.write(r):s()}})}});var M={exports:{}};let Zn=oe,Jn=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Zn.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),w=(e,t,n=e)=>r=>{let o=""+r,s=o.indexOf(t,e.length);return~s?e+mt(o,t,n,s)+t:e+o+t},mt=(e,t,n,r)=>{let o=e.substring(0,r)+n,s=e.substring(r+t.length),i=s.indexOf(t);return~i?o+mt(s,t,n,i):o+s},ht=(e=Jn)=>({isColorSupported:e,reset:e?t=>`\x1B[0m${t}\x1B[0m`:String,bold:e?w("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?w("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?w("\x1B[3m","\x1B[23m"):String,underline:e?w("\x1B[4m","\x1B[24m"):String,inverse:e?w("\x1B[7m","\x1B[27m"):String,hidden:e?w("\x1B[8m","\x1B[28m"):String,strikethrough:e?w("\x1B[9m","\x1B[29m"):String,black:e?w("\x1B[30m","\x1B[39m"):String,red:e?w("\x1B[31m","\x1B[39m"):String,green:e?w("\x1B[32m","\x1B[39m"):String,yellow:e?w("\x1B[33m","\x1B[39m"):String,blue:e?w("\x1B[34m","\x1B[39m"):String,magenta:e?w("\x1B[35m","\x1B[39m"):String,cyan:e?w("\x1B[36m","\x1B[39m"):String,white:e?w("\x1B[37m","\x1B[39m"):String,gray:e?w("\x1B[90m","\x1B[39m"):String,bgBlack:e?w("\x1B[40m","\x1B[49m"):String,bgRed:e?w("\x1B[41m","\x1B[49m"):String,bgGreen:e?w("\x1B[42m","\x1B[49m"):String,bgYellow:e?w("\x1B[43m","\x1B[49m"):String,bgBlue:e?w("\x1B[44m","\x1B[49m"):String,bgMagenta:e?w("\x1B[45m","\x1B[49m"):String,bgCyan:e?w("\x1B[46m","\x1B[49m"):String,bgWhite:e?w("\x1B[47m","\x1B[49m"):String});M.exports=ht(),M.exports.createColors=ht;function zn(e){return e.split(`
73
+ `).splice(1).map(t=>t.trim().replace("file://",""))}function Kn(e){return`
74
+ ${zn(e).map(t=>` ${t.replace(/^at ([\s\S]+) \((.+)\)/,(n,r,o)=>M.exports.gray(`at ${r} (${M.exports.cyan(o)})`))}`).join(`
75
+ `)}`}function Qn(e){return e.map(t=>typeof(t==null?void 0:t.stack)=="string"?`${t.message}
76
+ ${Kn(t.stack)}`:t)}function Xn(e,t){const n=e.toUpperCase(),r=M.exports[t];return M.exports.bold(M.exports.inverse(r(` ${n} `)))}function q(e,t,n){const r=M.exports[t],o=n!=null&&n.textColor?M.exports[n.textColor]:r,s=(n==null?void 0:n.target)||console.log;return(...i)=>{const u=Qn(i);s(`${Xn(e,t)} ${o(u.join(" "))}
77
+ `)}}q("log","gray"),q("info","blue",{target:console.info}),q("warn","yellow",{target:console.warn}),q("success","green");const er=q("error","red",{target:console.error}),tr=()=>D({setup:e=>e.inspector({enforce:"pre",fn:(t,n)=>{try{n()}catch(r){er(r.message),process.exit(1)}}})});export{Wt as Clerc,we as CommandExistsError,ye as CommandNameConflictError,be as DescriptionNotSetError,ve as InvalidCommandNameError,Ce as NameNotSetError,K as NoCommandGivenError,z as NoSuchCommandError,y as Root,Ee as VersionNotSetError,Jt as completionsPlugin,Ie as compose,Ut as defineCommand,Pt as defineHandler,Ht as defineInspector,D as definePlugin,j as formatCommandName,tr as friendlyErrorPlugin,dn as helpPlugin,ke as isInvalidName,Un as notFoundPlugin,ae as resolveArgv,ie as resolveCommand,_e as resolveFlattenCommands,Me as resolveParametersBeforeFlag,Dt as resolveRootCommands,Te as resolveSubcommandsByParent,Vn as strictFlagsPlugin,qn as versionPlugin,Fe as withBrackets};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clerc",
3
- "version": "0.27.1",
3
+ "version": "0.28.0",
4
4
  "author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
5
5
  "description": "Clerc: The full-featured cli framework.",
6
6
  "keywords": [
@@ -47,13 +47,13 @@
47
47
  "access": "public"
48
48
  },
49
49
  "devDependencies": {
50
- "@clerc/plugin-not-found": "0.27.1",
51
- "@clerc/core": "0.27.1",
52
- "@clerc/plugin-completions": "0.27.1",
53
- "@clerc/plugin-version": "0.27.1",
54
- "@clerc/plugin-help": "0.27.1",
55
- "@clerc/plugin-strict-flags": "0.27.1",
56
- "@clerc/plugin-friendly-error": "0.27.1"
50
+ "@clerc/plugin-completions": "0.28.0",
51
+ "@clerc/plugin-friendly-error": "0.28.0",
52
+ "@clerc/core": "0.28.0",
53
+ "@clerc/plugin-not-found": "0.28.0",
54
+ "@clerc/plugin-strict-flags": "0.28.0",
55
+ "@clerc/plugin-help": "0.28.0",
56
+ "@clerc/plugin-version": "0.28.0"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "puild --minify",