clerc 0.30.0 → 0.30.1
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 +2 -3
- package/dist/index.js +29 -29
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -298,7 +298,6 @@ interface ParseOptions {
|
|
|
298
298
|
argv?: string[];
|
|
299
299
|
run?: boolean;
|
|
300
300
|
}
|
|
301
|
-
type PossibleInputKind = string | number | boolean | Dict<any>;
|
|
302
301
|
interface HandlerContext<C extends CommandRecord = CommandRecord, N extends keyof C = keyof C> {
|
|
303
302
|
name?: LiteralUnion<N, string>;
|
|
304
303
|
called?: string | RootType;
|
|
@@ -568,7 +567,7 @@ declare const resolveRootCommands: (commands: CommandRecord) => Command<string,
|
|
|
568
567
|
declare function resolveParametersBeforeFlag(argv: string[]): string[];
|
|
569
568
|
declare const resolveArgv: () => string[];
|
|
570
569
|
declare function compose(inspectors: Inspector[]): (getCtx: () => InspectorContext) => void;
|
|
571
|
-
declare const
|
|
570
|
+
declare const isValidName: (name: CommandType) => boolean;
|
|
572
571
|
declare const withBrackets: (s: string, isOptional?: boolean) => string;
|
|
573
572
|
declare const formatCommandName: (name: string | string[] | RootType) => string;
|
|
574
573
|
declare const detectLocale: () => string;
|
|
@@ -641,4 +640,4 @@ declare const versionPlugin: ({ alias, command, }?: VersionPluginOptions) => Plu
|
|
|
641
640
|
|
|
642
641
|
declare const friendlyErrorPlugin: () => Plugin<Clerc<{}>, Clerc<{}>>;
|
|
643
642
|
|
|
644
|
-
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, LocaleNotCalledFirstError, Locales, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParseOptions, Plugin,
|
|
643
|
+
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, LocaleNotCalledFirstError, Locales, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParseOptions, Plugin, Root, RootType, TranslateFn, VersionNotSetError, completionsPlugin, compose, defineCommand, defineHandler, defineInspector, definePlugin, detectLocale, formatCommandName, friendlyErrorPlugin, helpPlugin, isValidName, notFoundPlugin, resolveArgv, resolveCommand, resolveCommandStrict, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent, strictFlagsPlugin, versionPlugin, withBrackets };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{format as Ru}from"node:util";import mu from"tty";class RD{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(D,e){return D==="*"?(this.wildcardListeners.add(e),this):(this.listenerMap[D]||(this.listenerMap[D]=new Set),this.listenerMap[D].add(e),this)}emit(D,...e){return this.listenerMap[D]&&(this.wildcardListeners.forEach(t=>t(D,...e)),this.listenerMap[D].forEach(t=>t(...e))),this}off(D,e){var t,r;return D==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):D==="*"?(e?this.wildcardListeners.delete(e):this.wildcardListeners.clear(),this):(e?(t=this.listenerMap[D])==null||t.delete(e):(r=this.listenerMap[D])==null||r.clear(),this)}}const jD="known-flag",WD="unknown-flag",PD="argument",{stringify:Z}=JSON,HD=/\B([A-Z])/g,UD=u=>u.replace(HD,"-$1").toLowerCase(),{hasOwnProperty:YD}=Object.prototype,V=(u,D)=>YD.call(u,D),zD=u=>Array.isArray(u),ju=u=>typeof u=="function"?[u,!1]:zD(u)?[u[0],!0]:ju(u.type),GD=(u,D)=>u===Boolean?D!=="false":D,ZD=(u,D)=>typeof D=="boolean"?D:u===Number&&D===""?Number.NaN:u(D),VD=/[\s.:=]/,qD=u=>{const D=`Flag name ${Z(u)}`;if(u.length===0)throw new Error(`${D} cannot be empty`);if(u.length===1)throw new Error(`${D} must be longer than a character`);const e=u.match(VD);if(e)throw new Error(`${D} cannot contain ${Z(e==null?void 0:e[0])}`)},JD=u=>{const D={},e=(t,r)=>{if(V(D,t))throw new Error(`Duplicate flags named ${Z(t)}`);D[t]=r};for(const t in u){if(!V(u,t))continue;qD(t);const r=u[t],n=[[],...ju(r),r];e(t,n);const o=UD(t);if(t!==o&&e(o,n),"alias"in r&&typeof r.alias=="string"){const{alias:i}=r,s=`Flag alias ${Z(i)} for flag ${Z(t)}`;if(i.length===0)throw new Error(`${s} cannot be empty`);if(i.length>1)throw new Error(`${s} must be a single character`);e(i,n)}}return D},KD=(u,D)=>{const e={};for(const t in u){if(!V(u,t))continue;const[r,,n,o]=D[t];if(r.length===0&&"default"in o){let{default:i}=o;typeof i=="function"&&(i=i()),e[t]=i}else e[t]=n?r:r.pop()}return e},nu="--",QD=/[.:=]/,XD=/^-{1,2}\w/,ue=u=>{if(!XD.test(u))return;const D=!u.startsWith(nu);let e=u.slice(D?1:2),t;const r=e.match(QD);if(r){const{index:n}=r;t=e.slice(n+1),e=e.slice(0,n)}return[e,t,D]},De=(u,{onFlag:D,onArgument:e})=>{let t;const r=(n,o)=>{if(typeof t!="function")return!0;t(n,o),t=void 0};for(let n=0;n<u.length;n+=1){const o=u[n];if(o===nu){r();const s=u.slice(n+1);e==null||e(s,[n],!0);break}const i=ue(o);if(i){if(r(),!D)continue;const[s,a,c]=i;if(c)for(let C=0;C<s.length;C+=1){r();const l=C===s.length-1;t=D(s[C],l?a:void 0,[n,C+1,l])}else t=D(s,a,[n])}else r(o,[n])&&(e==null||e([o],[n]))}r()},ee=(u,D)=>{for(const[e,t,r]of D.reverse()){if(t){const n=u[e];let o=n.slice(0,t);if(r||(o+=n.slice(t+1)),o!=="-"){u[e]=o;continue}}u.splice(e,1)}},te=(u,D=process.argv.slice(2),{ignore:e}={})=>{const t=[],r=JD(u),n={},o=[];return o[nu]=[],De(D,{onFlag(i,s,a){const c=V(r,i);if(!(e!=null&&e(c?jD:WD,i,s))){if(c){const[C,l]=r[i],m=GD(l,s),F=(h,d)=>{t.push(a),d&&t.push(d),C.push(ZD(l,h||""))};return m===void 0?F:F(m)}V(n,i)||(n[i]=[]),n[i].push(s===void 0?!0:s),t.push(a)}},onArgument(i,s,a){e!=null&&e(PD,D[s[0]])||(o.push(...i),a?(o[nu]=i,D.splice(s[0])):t.push(s))}}),ee(D,t),{flags:KD(u,r),unknownFlags:n,_:o}};function Eu(u){return u!==null&&typeof u=="object"}function hu(u,D,e=".",t){if(!Eu(D))return hu(u,{},e,t);const r=Object.assign({},D);for(const n in u){if(n==="__proto__"||n==="constructor")continue;const o=u[n];o!=null&&(t&&t(r,n,o,e)||(Array.isArray(o)&&Array.isArray(r[n])?r[n]=[...o,...r[n]]:Eu(o)&&Eu(r[n])?r[n]=hu(o,r[n],(e?`${e}.`:"")+n.toString(),t):r[n]=o))}return r}function ne(u){return(...D)=>D.reduce((e,t)=>hu(e,t,"",u),{})}const re=ne(),ru=u=>Array.isArray(u)?u:[u],oe=u=>u.replace(/[-_ ](\w)/g,(D,e)=>e.toUpperCase()),Wu=(u,D)=>D.length!==u.length?!1:u.every((e,t)=>e===D[t]),Pu=(u,D)=>D.length>u.length?!1:Wu(u.slice(0,D.length),D);class Hu extends Error{constructor(D,e){super(e("core.commandExists",D)),this.commandName=D}}class ou extends Error{constructor(D,e){super(e("core.noSuchCommand",D)),this.commandName=D}}class su extends Error{constructor(D){super(D("core.noCommandGiven"))}}class Uu extends Error{constructor(D,e,t){super(t("core.commandNameConflict",D,e)),this.n1=D,this.n2=e}}class Yu extends Error{constructor(D){super(D("core.nameNotSet"))}}class zu extends Error{constructor(D){super(D("core.descriptionNotSet"))}}class Gu extends Error{constructor(D){super(D("core.versionNotSet"))}}class Zu extends Error{constructor(D,e){super(e("core.badNameFormat",D)),this.commandName=D}}class pu extends Error{constructor(D){super(D("core.localeMustBeCalledFirst"))}}const Vu=typeof Deno!="undefined",se=typeof process!="undefined"&&!Vu,ie=process.versions.electron&&!process.defaultApp;function qu(u,D,e,t){if(e.alias){const r=ru(e.alias);for(const n of r){if(n in D)throw new Uu(D[n].name,e.name,t);u.set(typeof n=="symbol"?n:n.split(" "),{...e,__isAlias:!0})}}}function du(u,D){const e=new Map;u[p]&&(e.set(p,u[p]),qu(e,u,u[p],D));for(const t of Object.values(u))qu(e,u,t,D),e.set(t.name.split(" "),t);return e}function Ju(u,D,e){if(D===p)return[u[p],p];const t=ru(D),r=du(u,e);let n,o;return r.forEach((i,s)=>{if(s===p){n=u[p],o=p;return}Pu(t,s)&&(!o||o===p||s.length>o.length)&&(n=i,o=s)}),[n,o]}function Ku(u,D,e){if(D===p)return[u[p],p];const t=ru(D),r=du(u,e);let n,o;return r.forEach((i,s)=>{s===p||o===p||Wu(t,s)&&(n=i,o=s)}),[n,o]}function Qu(u,D,e=1/0){const t=D===""?[]:Array.isArray(D)?D:D.split(" ");return Object.values(u).filter(r=>{const n=r.name.split(" ");return Pu(n,t)&&n.length-t.length<=e})}const ae=u=>Qu(u,"",1);function Xu(u){const D=[];for(const e of u){if(e.startsWith("-"))break;D.push(e)}return D}const Bu=()=>se?process.argv.slice(ie?1:2):Vu?Deno.args:[];function uD(u){const D={pre:[],normal:[],post:[]};for(const t of u){const r=typeof t=="object"?t:{fn:t},{enforce:n,fn:o}=r;n==="post"||n==="pre"?D[n].push(o):D.normal.push(o)}const e=[...D.pre,...D.normal,...D.post];return t=>{return r(0);function r(n){const o=e[n];return o(t(),r.bind(null,n+1))}}}const DD=u=>typeof u=="string"&&(u.startsWith(" ")||u.endsWith(" ")),eD=(u,D)=>D?`[${u}]`:`<${u}>`,le="<Root>",U=u=>Array.isArray(u)?u.join(" "):typeof u=="string"?u:le,tD=()=>process.env.CLERC_LOCALE?process.env.CLERC_LOCALE:Intl.DateTimeFormat().resolvedOptions().locale,{stringify:Y}=JSON;function gu(u){const D=[];let e,t;for(const r of u){if(t)throw new Error(`Invalid parameter: Spread parameter ${Y(t)} must be last`);const n=r[0],o=r[r.length-1];let i;if(n==="<"&&o===">"&&(i=!0,e))throw new Error(`Invalid parameter: Required parameter ${Y(r)} cannot come after optional parameter ${Y(e)}`);if(n==="["&&o==="]"&&(i=!1,e=r),i===void 0)throw new Error(`Invalid parameter: ${Y(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=r.slice(1,-1);const a=s.slice(-3)==="...";a&&(t=r,s=s.slice(0,-3)),D.push({name:s,required:i,spread:a})}return D}function fu(u,D,e){for(let t=0;t<D.length;t+=1){const{name:r,required:n,spread:o}=D[t],i=oe(r);if(i in u)throw new Error(`Invalid parameter: ${Y(r)} is used more than once.`);const s=o?e.slice(t):e[t];if(o&&(t=D.length),n&&(!s||o&&s.length===0))throw new Error(`Missing required parameter ${Y(r)}`);u[i]=s}}const ce={en:{"core.commandExists":'Command "%s" exists.',"core.noSuchCommand":"No such command: %s.","core.noCommandGiven":"No command given.","core.commandNameConflict":"Command name %s conflicts with %s. Maybe caused by alias.","core.nameNotSet":"Name not set.","core.descriptionNotSet":"Description not set.","core.versionNotSet":"Version not set.","core.badNameFormat":"Bad name format: %s.","core.localeMustBeCalledFirst":"locale() or fallbackLocale() must be called at first.","core.cliParseMustBeCalled":"cli.parse() must be called."},"zh-CN":{"core.commandExists":'\u547D\u4EE4 "%s" \u5DF2\u5B58\u5728\u3002',"core.noSuchCommand":"\u627E\u4E0D\u5230\u547D\u4EE4: %s\u3002","core.noCommandGiven":"\u6CA1\u6709\u8F93\u5165\u547D\u4EE4\u3002","core.commandNameConflict":"\u547D\u4EE4\u540D\u79F0 %s \u548C %s \u51B2\u7A81\u3002 \u53EF\u80FD\u662F\u7531\u4E8E\u522B\u540D\u5BFC\u81F4\u7684\u3002","core.nameNotSet":"\u672A\u8BBE\u7F6ECLI\u540D\u79F0\u3002","core.descriptionNotSet":"\u672A\u8BBE\u7F6ECLI\u63CF\u8FF0\u3002","core.versionNotSet":"\u672A\u8BBE\u7F6ECLI\u7248\u672C\u3002","core.badNameFormat":"\u9519\u8BEF\u7684\u547D\u4EE4\u540D\u5B57\u683C\u5F0F: %s\u3002","core.localeMustBeCalledFirst":"locale() \u6216 fallbackLocale() \u5FC5\u987B\u5728\u6700\u5F00\u59CB\u8C03\u7528\u3002","core.cliParseMustBeCalled":"cli.parse() \u5FC5\u987B\u88AB\u8C03\u7528\u3002"}};var Au=(u,D,e)=>{if(!D.has(u))throw TypeError("Cannot "+e)},E=(u,D,e)=>(Au(u,D,"read from private field"),e?e.call(u):D.get(u)),x=(u,D,e)=>{if(D.has(u))throw TypeError("Cannot add the same private member more than once");D instanceof WeakSet?D.add(u):D.set(u,e)},S=(u,D,e,t)=>(Au(u,D,"write to private field"),t?t.call(u,e):D.set(u,e),e),w=(u,D,e)=>(Au(u,D,"access private method"),e),k,I,R,q,J,iu,z,K,Q,X,uu,Du,j,xu,nD,$u,rD,Su,oD,_,T,wu,sD,bu,iD,yu,aD;const p=Symbol.for("Clerc.Root"),lD=class{constructor(u,D,e){x(this,xu),x(this,$u),x(this,Su),x(this,_),x(this,wu),x(this,bu),x(this,yu),x(this,k,""),x(this,I,""),x(this,R,""),x(this,q,[]),x(this,J,{}),x(this,iu,new RD),x(this,z,new Set),x(this,K,void 0),x(this,Q,[]),x(this,X,!1),x(this,uu,"en"),x(this,Du,"en"),x(this,j,{}),this.i18n={add:t=>{S(this,j,re(E(this,j),t))},t:(t,...r)=>{const n=E(this,j)[E(this,Du)]||E(this,j)[E(this,uu)],o=E(this,j)[E(this,uu)];return n[t]?Ru(n[t],...r):o[t]?Ru(o[t],...r):void 0}},S(this,k,u||E(this,k)),S(this,I,D||E(this,I)),S(this,R,e||E(this,R)),S(this,Du,tD()),w(this,Su,oD).call(this)}get _name(){return E(this,k)}get _description(){return E(this,I)}get _version(){return E(this,R)}get _inspectors(){return E(this,q)}get _commands(){return E(this,J)}static create(u,D,e){return new lD(u,D,e)}name(u){return w(this,_,T).call(this),S(this,k,u),this}description(u){return w(this,_,T).call(this),S(this,I,u),this}version(u){return w(this,_,T).call(this),S(this,R,u),this}locale(u){if(E(this,X))throw new pu(this.i18n.t);return S(this,Du,u),this}fallbackLocale(u){if(E(this,X))throw new pu(this.i18n.t);return S(this,uu,u),this}errorHandler(u){return E(this,Q).push(u),this}command(u,D,e={}){w(this,_,T).call(this);const{t}=this.i18n,r=(c=>!(typeof c=="string"||c===p))(u),n=r?u.name:u;if(DD(n))throw new Zu(n,t);const{handler:o=void 0,...i}=r?u:{name:n,description:D,...e},s=[i.name],a=i.alias?ru(i.alias):[];i.alias&&s.push(...a);for(const c of s)if(E(this,z).has(c))throw new Hu(U(c),t);return E(this,J)[n]=i,E(this,z).add(i.name),a.forEach(c=>E(this,z).add(c)),r&&o&&this.on(u.name,o),this}on(u,D){return E(this,iu).on(u,D),this}use(u){return w(this,_,T).call(this),u.setup(this)}inspector(u){return w(this,_,T).call(this),E(this,q).push(u),this}parse(u=Bu()){w(this,_,T).call(this);const{argv:D,run:e}=Array.isArray(u)?{argv:u,run:!0}:{argv:Bu(),...u};return S(this,K,D),w(this,wu,sD).call(this),e&&this.runMatchedCommand(),this}runMatchedCommand(){try{w(this,yu,aD).call(this)}catch(u){if(E(this,Q).length>0)E(this,Q).forEach(D=>D(u));else throw u}return this}};let Fe=lD;k=new WeakMap,I=new WeakMap,R=new WeakMap,q=new WeakMap,J=new WeakMap,iu=new WeakMap,z=new WeakMap,K=new WeakMap,Q=new WeakMap,X=new WeakMap,uu=new WeakMap,Du=new WeakMap,j=new WeakMap,xu=new WeakSet,nD=function(){return E(this,z).has(p)},$u=new WeakSet,rD=function(){return Object.prototype.hasOwnProperty.call(this._commands,p)},Su=new WeakSet,oD=function(){this.i18n.add(ce)},_=new WeakSet,T=function(){S(this,X,!0)},wu=new WeakSet,sD=function(){const{t:u}=this.i18n;if(!E(this,k))throw new Yu(u);if(!E(this,I))throw new zu(u);if(!E(this,R))throw new Gu(u)},bu=new WeakSet,iD=function(u){const D=E(this,K),[e,t]=u(),r=!!e,n=te((e==null?void 0:e.flags)||{},[...D]),{_:o,flags:i,unknownFlags:s}=n;let a=!r||e.name===p?o:o.slice(e.name.split(" ").length),c=(e==null?void 0:e.parameters)||[];const C=c.indexOf("--"),l=c.slice(C+1)||[],m=Object.create(null);if(C>-1&&l.length>0){c=c.slice(0,C);const h=o["--"];a=a.slice(0,-h.length||void 0),fu(m,gu(c),a),fu(m,gu(l),h)}else fu(m,gu(c),a);const F={...i,...s};return{name:e==null?void 0:e.name,called:Array.isArray(t)?t.join(" "):t,resolved:r,hasRootOrAlias:E(this,xu,nD),hasRoot:E(this,$u,rD),raw:{...n,parameters:a,mergedFlags:F},parameters:m,flags:i,unknownFlags:s,cli:this}},yu=new WeakSet,aD=function(){w(this,_,T).call(this);const{t:u}=this.i18n,D=E(this,K);if(!D)throw new Error(u("core.cliParseMustBeCalled"));const e=Xu(D),t=e.join(" "),r=()=>Ju(E(this,J),e,u),n=()=>w(this,bu,iD).call(this,r),o={enforce:"post",fn:()=>{const[s]=r(),a=n();if(!s)throw t?new ou(t,u):new su(u);E(this,iu).emit(s.name,a)}},i=[...E(this,q),o];uD(i)(n)};const W=u=>u,Ce=(u,D,e)=>e,me=(u,D)=>D,Ee=(u,D)=>({...u,handler:D}),he=u=>`
|
|
2
|
-
${
|
|
3
|
-
cmd+="__${
|
|
4
|
-
;;`,
|
|
1
|
+
import{format as Wu}from"node:util";import hu from"tty";class WD{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(n=>n(e,...t)),this.listenerMap[e].forEach(n=>n(...t))),this}off(e,t){var n,o;return e==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):e==="*"?(t?this.wildcardListeners.delete(t):this.wildcardListeners.clear(),this):(t?(n=this.listenerMap[e])==null||n.delete(t):(o=this.listenerMap[e])==null||o.clear(),this)}}const PD="known-flag",HD="unknown-flag",UD="argument",{stringify:V}=JSON,YD=/\B([A-Z])/g,GD=D=>D.replace(YD,"-$1").toLowerCase(),{hasOwnProperty:zD}=Object.prototype,Z=(D,e)=>zD.call(D,e),VD=D=>Array.isArray(D),Pu=D=>typeof D=="function"?[D,!1]:VD(D)?[D[0],!0]:Pu(D.type),ZD=(D,e)=>D===Boolean?e!=="false":e,qD=(D,e)=>typeof e=="boolean"?e:D===Number&&e===""?Number.NaN:D(e),JD=/[\s.:=]/,KD=D=>{const e=`Flag name ${V(D)}`;if(D.length===0)throw new Error(`${e} cannot be empty`);if(D.length===1)throw new Error(`${e} must be longer than a character`);const t=D.match(JD);if(t)throw new Error(`${e} cannot contain ${V(t==null?void 0:t[0])}`)},QD=D=>{const e={},t=(n,o)=>{if(Z(e,n))throw new Error(`Duplicate flags named ${V(n)}`);e[n]=o};for(const n in D){if(!Z(D,n))continue;KD(n);const o=D[n],r=[[],...Pu(o),o];t(n,r);const u=GD(n);if(n!==u&&t(u,r),"alias"in o&&typeof o.alias=="string"){const{alias:i}=o,s=`Flag alias ${V(i)} for flag ${V(n)}`;if(i.length===0)throw new Error(`${s} cannot be empty`);if(i.length>1)throw new Error(`${s} must be a single character`);t(i,r)}}return e},XD=(D,e)=>{const t={};for(const n in D){if(!Z(D,n))continue;const[o,,r,u]=e[n];if(o.length===0&&"default"in u){let{default:i}=u;typeof i=="function"&&(i=i()),t[n]=i}else t[n]=r?o:o.pop()}return t},ru="--",ue=/[.:=]/,De=/^-{1,2}\w/,ee=D=>{if(!De.test(D))return;const e=!D.startsWith(ru);let t=D.slice(e?1:2),n;const o=t.match(ue);if(o){const{index:r}=o;n=t.slice(r+1),t=t.slice(0,r)}return[t,n,e]},te=(D,{onFlag:e,onArgument:t})=>{let n;const o=(r,u)=>{if(typeof n!="function")return!0;n(r,u),n=void 0};for(let r=0;r<D.length;r+=1){const u=D[r];if(u===ru){o();const s=D.slice(r+1);t==null||t(s,[r],!0);break}const i=ee(u);if(i){if(o(),!e)continue;const[s,F,a]=i;if(a)for(let c=0;c<s.length;c+=1){o();const C=c===s.length-1;n=e(s[c],C?F:void 0,[r,c+1,C])}else n=e(s,F,[r])}else o(u,[r])&&(t==null||t([u],[r]))}o()},ne=(D,e)=>{for(const[t,n,o]of e.reverse()){if(n){const r=D[t];let u=r.slice(0,n);if(o||(u+=r.slice(n+1)),u!=="-"){D[t]=u;continue}}D.splice(t,1)}},re=(D,e=process.argv.slice(2),{ignore:t}={})=>{const n=[],o=QD(D),r={},u=[];return u[ru]=[],te(e,{onFlag(i,s,F){const a=Z(o,i);if(!(t!=null&&t(a?PD:HD,i,s))){if(a){const[c,C]=o[i],E=ZD(C,s),l=(h,p)=>{n.push(F),p&&n.push(p),c.push(qD(C,h||""))};return E===void 0?l:l(E)}Z(r,i)||(r[i]=[]),r[i].push(s===void 0?!0:s),n.push(F)}},onArgument(i,s,F){t!=null&&t(UD,e[s[0]])||(u.push(...i),F?(u[ru]=i,e.splice(s[0])):n.push(s))}}),ne(e,n),{flags:XD(D,o),unknownFlags:r,_:u}};function Bu(D){return D!==null&&typeof D=="object"}function pu(D,e,t=".",n){if(!Bu(e))return pu(D,{},t,n);const o=Object.assign({},e);for(const r in D){if(r==="__proto__"||r==="constructor")continue;const u=D[r];u!=null&&(n&&n(o,r,u,t)||(Array.isArray(u)&&Array.isArray(o[r])?o[r]=[...u,...o[r]]:Bu(u)&&Bu(o[r])?o[r]=pu(u,o[r],(t?`${t}.`:"")+r.toString(),n):o[r]=u))}return o}function oe(D){return(...e)=>e.reduce((t,n)=>pu(t,n,"",D),{})}const se=oe(),ou=D=>Array.isArray(D)?D:[D],ie=D=>D.replace(/[-_ ](\w)/g,(e,t)=>t.toUpperCase()),Hu=(D,e)=>e.length!==D.length?!1:D.every((t,n)=>t===e[n]),Uu=(D,e)=>e.length>D.length?!1:Hu(D.slice(0,e.length),e),q=JSON.stringify;class Yu extends Error{constructor(e,t){super(t("core.commandExists",q(e))),this.commandName=e}}class su extends Error{constructor(e,t){super(t("core.noSuchCommand",q(e))),this.commandName=e}}class iu extends Error{constructor(e){super(e("core.noCommandGiven"))}}class Gu extends Error{constructor(e,t,n){super(n("core.commandNameConflict",q(e),q(t))),this.n1=e,this.n2=t}}class zu extends Error{constructor(e){super(e("core.nameNotSet"))}}class Vu extends Error{constructor(e){super(e("core.descriptionNotSet"))}}class Zu extends Error{constructor(e){super(e("core.versionNotSet"))}}class qu extends Error{constructor(e,t){super(t("core.badNameFormat",q(e))),this.commandName=e}}class du extends Error{constructor(e){super(e("core.localeMustBeCalledFirst"))}}const Ju=typeof Deno!="undefined",Fe=typeof process!="undefined"&&!Ju,ae=process.versions.electron&&!process.defaultApp;function Ku(D,e,t,n){if(t.alias){const o=ou(t.alias);for(const r of o){if(r in e)throw new Gu(e[r].name,t.name,n);D.set(typeof r=="symbol"?r:r.split(" "),{...t,__isAlias:!0})}}}function gu(D,e){const t=new Map;D[B]&&(t.set(B,D[B]),Ku(t,D,D[B],e));for(const n of Object.values(D))Ku(t,D,n,e),t.set(n.name.split(" "),n);return t}function Qu(D,e,t){if(e===B)return[D[B],B];const n=ou(e),o=gu(D,t);let r,u;return o.forEach((i,s)=>{if(s===B){r=D[B],u=B;return}Uu(n,s)&&(!u||u===B||s.length>u.length)&&(r=i,u=s)}),[r,u]}function Xu(D,e,t){if(e===B)return[D[B],B];const n=ou(e),o=gu(D,t);let r,u;return o.forEach((i,s)=>{s===B||u===B||Hu(n,s)&&(r=i,u=s)}),[r,u]}function uD(D,e,t=1/0){const n=e===""?[]:Array.isArray(e)?e:e.split(" ");return Object.values(D).filter(o=>{const r=o.name.split(" ");return Uu(r,n)&&r.length-n.length<=t})}const Ce=D=>uD(D,"",1);function DD(D){const e=[];for(const t of D){if(t.startsWith("-"))break;e.push(t)}return e}const fu=()=>Fe?process.argv.slice(ae?1:2):Ju?Deno.args:[];function eD(D){const e={pre:[],normal:[],post:[]};for(const n of D){const o=typeof n=="object"?n:{fn:n},{enforce:r,fn:u}=o;r==="post"||r==="pre"?e[r].push(u):e.normal.push(u)}const t=[...e.pre,...e.normal,...e.post];return n=>{return o(0);function o(r){const u=t[r];return u(n(),o.bind(null,r+1))}}}const le=/\s\s+/,tD=D=>D===B?!0:!(D.startsWith(" ")||D.endsWith(" "))&&!le.test(D),nD=(D,e)=>e?`[${D}]`:`<${D}>`,ce="<Root>",U=D=>Array.isArray(D)?D.join(" "):typeof D=="string"?D:ce,rD=()=>process.env.CLERC_LOCALE?process.env.CLERC_LOCALE:Intl.DateTimeFormat().resolvedOptions().locale,{stringify:Y}=JSON;function Au(D){const e=[];let t,n;for(const o of D){if(n)throw new Error(`Invalid parameter: Spread parameter ${Y(n)} must be last`);const r=o[0],u=o[o.length-1];let i;if(r==="<"&&u===">"&&(i=!0,t))throw new Error(`Invalid parameter: Required parameter ${Y(o)} cannot come after optional parameter ${Y(t)}`);if(r==="["&&u==="]"&&(i=!1,t=o),i===void 0)throw new Error(`Invalid parameter: ${Y(o)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=o.slice(1,-1);const F=s.slice(-3)==="...";F&&(n=o,s=s.slice(0,-3)),e.push({name:s,required:i,spread:F})}return e}function xu(D,e,t){for(let n=0;n<e.length;n+=1){const{name:o,required:r,spread:u}=e[n],i=ie(o);if(i in D)throw new Error(`Invalid parameter: ${Y(o)} is used more than once.`);const s=u?t.slice(n):t[n];if(u&&(n=e.length),r&&(!s||u&&s.length===0))throw new Error(`Missing required parameter ${Y(o)}`);D[i]=s}}const Ee={en:{"core.commandExists":'Command "%s" exists.',"core.noSuchCommand":"No such command: %s.","core.noCommandGiven":"No command given.","core.commandNameConflict":"Command name %s conflicts with %s. Maybe caused by alias.","core.nameNotSet":"Name not set.","core.descriptionNotSet":"Description not set.","core.versionNotSet":"Version not set.","core.badNameFormat":"Bad name format: %s.","core.localeMustBeCalledFirst":"locale() or fallbackLocale() must be called at first.","core.cliParseMustBeCalled":"cli.parse() must be called."},"zh-CN":{"core.commandExists":'\u547D\u4EE4 "%s" \u5DF2\u5B58\u5728\u3002',"core.noSuchCommand":"\u627E\u4E0D\u5230\u547D\u4EE4: %s\u3002","core.noCommandGiven":"\u6CA1\u6709\u8F93\u5165\u547D\u4EE4\u3002","core.commandNameConflict":"\u547D\u4EE4\u540D\u79F0 %s \u548C %s \u51B2\u7A81\u3002 \u53EF\u80FD\u662F\u7531\u4E8E\u522B\u540D\u5BFC\u81F4\u7684\u3002","core.nameNotSet":"\u672A\u8BBE\u7F6ECLI\u540D\u79F0\u3002","core.descriptionNotSet":"\u672A\u8BBE\u7F6ECLI\u63CF\u8FF0\u3002","core.versionNotSet":"\u672A\u8BBE\u7F6ECLI\u7248\u672C\u3002","core.badNameFormat":"\u9519\u8BEF\u7684\u547D\u4EE4\u540D\u5B57\u683C\u5F0F: %s\u3002","core.localeMustBeCalledFirst":"locale() \u6216 fallbackLocale() \u5FC5\u987B\u5728\u6700\u5F00\u59CB\u8C03\u7528\u3002","core.cliParseMustBeCalled":"cli.parse() \u5FC5\u987B\u88AB\u8C03\u7528\u3002"}};var $u=(D,e,t)=>{if(!e.has(D))throw TypeError("Cannot "+t)},m=(D,e,t)=>($u(D,e,"read from private field"),t?t.call(D):e.get(D)),x=(D,e,t)=>{if(e.has(D))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(D):e.set(D,t)},w=(D,e,t,n)=>($u(D,e,"write to private field"),n?n.call(D,t):e.set(D,t),t),$=(D,e,t)=>($u(D,e,"access private method"),t),k,I,R,J,K,Fu,G,Q,X,uu,Du,eu,j,Su,oD,wu,sD,bu,iD,_,T,yu,FD,vu,aD,Ou,CD,au,_u,Nu,lD;const B=Symbol.for("Clerc.Root"),cD=class{constructor(D,e,t){x(this,Su),x(this,wu),x(this,bu),x(this,_),x(this,yu),x(this,vu),x(this,Ou),x(this,au),x(this,Nu),x(this,k,""),x(this,I,""),x(this,R,""),x(this,J,[]),x(this,K,{}),x(this,Fu,new WD),x(this,G,new Set),x(this,Q,void 0),x(this,X,[]),x(this,uu,!1),x(this,Du,"en"),x(this,eu,"en"),x(this,j,{}),this.i18n={add:n=>{w(this,j,se(m(this,j),n))},t:(n,...o)=>{const r=m(this,j)[m(this,eu)]||m(this,j)[m(this,Du)],u=m(this,j)[m(this,Du)];return r[n]?Wu(r[n],...o):u[n]?Wu(u[n],...o):void 0}},w(this,k,D||m(this,k)),w(this,I,e||m(this,I)),w(this,R,t||m(this,R)),w(this,eu,rD()),$(this,bu,iD).call(this)}get _name(){return m(this,k)}get _description(){return m(this,I)}get _version(){return m(this,R)}get _inspectors(){return m(this,J)}get _commands(){return m(this,K)}static create(D,e,t){return new cD(D,e,t)}name(D){return $(this,_,T).call(this),w(this,k,D),this}description(D){return $(this,_,T).call(this),w(this,I,D),this}version(D){return $(this,_,T).call(this),w(this,R,D),this}locale(D){if(m(this,uu))throw new du(this.i18n.t);return w(this,eu,D),this}fallbackLocale(D){if(m(this,uu))throw new du(this.i18n.t);return w(this,Du,D),this}errorHandler(D){return m(this,X).push(D),this}command(D,e,t={}){return $(this,au,_u).call(this,()=>$(this,yu,FD).call(this,D,e,t)),this}on(D,e){return m(this,Fu).on(D,e),this}use(D){return $(this,_,T).call(this),D.setup(this)}inspector(D){return $(this,_,T).call(this),m(this,J).push(D),this}parse(D=fu()){$(this,_,T).call(this);const{argv:e,run:t}=Array.isArray(D)?{argv:D,run:!0}:{argv:fu(),...D};return w(this,Q,e),$(this,vu,aD).call(this),t&&this.runMatchedCommand(),this}runMatchedCommand(){return $(this,au,_u).call(this,()=>$(this,Nu,lD).call(this)),this}};let me=cD;k=new WeakMap,I=new WeakMap,R=new WeakMap,J=new WeakMap,K=new WeakMap,Fu=new WeakMap,G=new WeakMap,Q=new WeakMap,X=new WeakMap,uu=new WeakMap,Du=new WeakMap,eu=new WeakMap,j=new WeakMap,Su=new WeakSet,oD=function(){return m(this,G).has(B)},wu=new WeakSet,sD=function(){return Object.prototype.hasOwnProperty.call(this._commands,B)},bu=new WeakSet,iD=function(){this.i18n.add(Ee)},_=new WeakSet,T=function(){w(this,uu,!0)},yu=new WeakSet,FD=function(D,e,t={}){$(this,_,T).call(this);const{t:n}=this.i18n,o=(a=>!(typeof a=="string"||a===B))(D),r=o?D.name:D;if(!tD(r))throw new qu(r,n);const{handler:u=void 0,...i}=o?D:{name:r,description:e,...t},s=[i.name],F=i.alias?ou(i.alias):[];i.alias&&s.push(...F);for(const a of s)if(m(this,G).has(a))throw new Yu(U(a),n);return m(this,K)[r]=i,m(this,G).add(i.name),F.forEach(a=>m(this,G).add(a)),o&&u&&this.on(D.name,u),this},vu=new WeakSet,aD=function(){const{t:D}=this.i18n;if(!m(this,k))throw new zu(D);if(!m(this,I))throw new Vu(D);if(!m(this,R))throw new Zu(D)},Ou=new WeakSet,CD=function(D){const e=m(this,Q),[t,n]=D(),o=!!t,r=re((t==null?void 0:t.flags)||{},[...e]),{_:u,flags:i,unknownFlags:s}=r;let F=!o||t.name===B?u:u.slice(t.name.split(" ").length),a=(t==null?void 0:t.parameters)||[];const c=a.indexOf("--"),C=a.slice(c+1)||[],E=Object.create(null);if(c>-1&&C.length>0){a=a.slice(0,c);const h=u["--"];F=F.slice(0,-h.length||void 0),xu(E,Au(a),F),xu(E,Au(C),h)}else xu(E,Au(a),F);const l={...i,...s};return{name:t==null?void 0:t.name,called:Array.isArray(n)?n.join(" "):n,resolved:o,hasRootOrAlias:m(this,Su,oD),hasRoot:m(this,wu,sD),raw:{...r,parameters:F,mergedFlags:l},parameters:E,flags:i,unknownFlags:s,cli:this}},au=new WeakSet,_u=function(D){try{D()}catch(e){if(m(this,X).length>0)m(this,X).forEach(t=>t(e));else throw e}},Nu=new WeakSet,lD=function(){$(this,_,T).call(this);const{t:D}=this.i18n,e=m(this,Q);if(!e)throw new Error(D("core.cliParseMustBeCalled"));const t=DD(e),n=t.join(" "),o=()=>Qu(m(this,K),t,D),r=()=>$(this,Ou,CD).call(this,o),u={enforce:"post",fn:()=>{const[s]=o(),F=r();if(!s)throw n?new su(n,D):new iu(D);m(this,Fu).emit(s.name,F)}},i=[...m(this,J),u];eD(i)(r)};const W=D=>D,he=(D,e,t)=>t,Be=(D,e)=>e,pe=(D,e)=>({...D,handler:e}),de=D=>`
|
|
2
|
+
${D})
|
|
3
|
+
cmd+="__${D}"
|
|
4
|
+
;;`,ge=D=>{const{cli:e}=D,{_name:t,_commands:n}=e;return`_${t}() {
|
|
5
5
|
local i cur prev opts cmds
|
|
6
6
|
COMPREPLY=()
|
|
7
7
|
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
@@ -13,27 +13,27 @@ import{format as Ru}from"node:util";import mu from"tty";class RD{constructor(){t
|
|
|
13
13
|
do
|
|
14
14
|
case "\${i}" in
|
|
15
15
|
"$1")
|
|
16
|
-
cmd="${
|
|
16
|
+
cmd="${t}"
|
|
17
17
|
;;
|
|
18
|
-
${Object.keys(
|
|
18
|
+
${Object.keys(n).map(de).join("")}
|
|
19
19
|
*)
|
|
20
20
|
;;
|
|
21
21
|
esac
|
|
22
22
|
done
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
complete -F _${
|
|
26
|
-
`},
|
|
25
|
+
complete -F _${t} -o bashdefault -o default ${t}
|
|
26
|
+
`},ED=D=>D.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),mD=D=>D.length<=1?`-${D}`:`--${ED(D)}`,hD="(No Description)",fe=D=>`[CompletionResult]::new('${D.name}', '${D.name}', [CompletionResultType]::ParameterValue, '${D.description}')`,Ae=D=>Object.entries(D.flags||{}).map(([e,t])=>{const n=[`[CompletionResult]::new('${mD(e)}', '${ED(e)}', [CompletionResultType]::ParameterName, '${D.flags[e].description||hD}')`];return t!=null&&t.alias&&n.push(`[CompletionResult]::new('${mD(t.alias)}', '${t.alias}', [CompletionResultType]::ParameterName, '${D.flags[e].description||hD}')`),n.join(`
|
|
27
27
|
`)}).join(`
|
|
28
|
-
`),
|
|
28
|
+
`),xe=D=>{const{cli:e}=D,{_name:t,_commands:n}=e;return`using namespace System.Management.Automation
|
|
29
29
|
using namespace System.Management.Automation.Language
|
|
30
30
|
|
|
31
|
-
Register-ArgumentCompleter -Native -CommandName '${
|
|
31
|
+
Register-ArgumentCompleter -Native -CommandName '${t}' -ScriptBlock {
|
|
32
32
|
param($wordToComplete, $commandAst, $cursorPosition)
|
|
33
33
|
|
|
34
34
|
$commandElements = $commandAst.CommandElements
|
|
35
35
|
$command = @(
|
|
36
|
-
'${
|
|
36
|
+
'${t}'
|
|
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 '${e}' -ScriptBlock {
|
|
|
46
46
|
}) -join ';'
|
|
47
47
|
|
|
48
48
|
$completions = @(switch ($command) {
|
|
49
|
-
'${
|
|
50
|
-
${Object.entries(
|
|
49
|
+
'${t}' {
|
|
50
|
+
${Object.entries(n).map(([o,r])=>fe(r)).join(`
|
|
51
51
|
`)}
|
|
52
52
|
break
|
|
53
53
|
}
|
|
54
|
-
${Object.entries(
|
|
55
|
-
${
|
|
54
|
+
${Object.entries(n).map(([o,r])=>`'${t};${o.split(" ").join(";")}' {
|
|
55
|
+
${Ae(r)}
|
|
56
56
|
break
|
|
57
57
|
}`).join(`
|
|
58
58
|
`)}
|
|
@@ -60,18 +60,18 @@ Register-ArgumentCompleter -Native -CommandName '${e}' -ScriptBlock {
|
|
|
60
60
|
|
|
61
61
|
$completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
|
|
62
62
|
Sort-Object -Property ListItemText
|
|
63
|
-
}`},
|
|
64
|
-
`)};function dD(u){var D=/\.[^.]*$/.exec(u);return D?D.index+1:u.length}function BD(u,D,e){if(u.reduce)return u.reduce(D,e);for(var t=0,r=arguments.length>=3?e:u[t++];t<u.length;t++)D(r,u[t],t);return r}function gD(u,D){if(u.forEach)return u.forEach(D);for(var e=0;e<u.length;e++)D.call(u,u[e],e)}function au(u,D){if(u.map)return u.map(D);for(var e=[],t=0;t<u.length;t++)e.push(D.call(u,u[t],t));return e}var vu={exports:{}},be=({onlyFirst:u=!1}={})=>{const D=["[\\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(D,u?void 0:"g")};const ye=be;var ve=u=>typeof u=="string"?u.replace(ye(),""):u,Ou={exports:{}};const fD=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);Ou.exports=fD,Ou.exports.default=fD;var Oe=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 _e=ve,Ne=Ou.exports,Te=Oe,AD=u=>{if(typeof u!="string"||u.length===0||(u=_e(u),u.length===0))return 0;u=u.replace(Te()," ");let D=0;for(let e=0;e<u.length;e++){const t=u.codePointAt(e);t<=31||t>=127&&t<=159||t>=768&&t<=879||(t>65535&&e++,D+=Ne(t)?2:1)}return D};vu.exports=AD,vu.exports.default=AD;const _u=u=>we(u,{stringLength:vu.exports}),Nu=u=>_u(u).split(`
|
|
65
|
-
`),
|
|
66
|
-
`);
|
|
67
|
-
`)},
|
|
68
|
-
`)
|
|
63
|
+
}`},BD={bash:ge,pwsh:xe},$e=(D={})=>W({setup:e=>{const{command:t=!0}=D;return t&&(e=e.command("completions","Print shell completions to stdout",{flags:{shell:{description:"Shell type",type:String,default:""}},parameters:["[shell]"]}).on("completions",n=>{if(!e._name)throw new Error("CLI name is not defined!");const o=String(n.parameters.shell||n.flags.shell);if(!o)throw new Error("Missing shell name");if(o in BD)process.stdout.write(BD[o](n));else throw new Error(`No such shell: ${o}`)})),e}}),Se=D=>Array.isArray(D)?D:[D],we=D=>D.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`),pD=D=>D.length<=1?`-${D}`:`--${we(D)}`;var b={exports:{}};let be=hu,ye=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||be.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),d=(D,e,t=D)=>n=>{let o=""+n,r=o.indexOf(e,D.length);return~r?D+dD(o,e,t,r)+e:D+o+e},dD=(D,e,t,n)=>{let o=D.substring(0,n)+t,r=D.substring(n+e.length),u=r.indexOf(e);return~u?o+dD(r,e,t,u):o+r},gD=(D=ye)=>({isColorSupported:D,reset:D?e=>`\x1B[0m${e}\x1B[0m`:String,bold:D?d("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:D?d("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:D?d("\x1B[3m","\x1B[23m"):String,underline:D?d("\x1B[4m","\x1B[24m"):String,inverse:D?d("\x1B[7m","\x1B[27m"):String,hidden:D?d("\x1B[8m","\x1B[28m"):String,strikethrough:D?d("\x1B[9m","\x1B[29m"):String,black:D?d("\x1B[30m","\x1B[39m"):String,red:D?d("\x1B[31m","\x1B[39m"):String,green:D?d("\x1B[32m","\x1B[39m"):String,yellow:D?d("\x1B[33m","\x1B[39m"):String,blue:D?d("\x1B[34m","\x1B[39m"):String,magenta:D?d("\x1B[35m","\x1B[39m"):String,cyan:D?d("\x1B[36m","\x1B[39m"):String,white:D?d("\x1B[37m","\x1B[39m"):String,gray:D?d("\x1B[90m","\x1B[39m"):String,bgBlack:D?d("\x1B[40m","\x1B[49m"):String,bgRed:D?d("\x1B[41m","\x1B[49m"):String,bgGreen:D?d("\x1B[42m","\x1B[49m"):String,bgYellow:D?d("\x1B[43m","\x1B[49m"):String,bgBlue:D?d("\x1B[44m","\x1B[49m"):String,bgMagenta:D?d("\x1B[45m","\x1B[49m"):String,bgCyan:D?d("\x1B[46m","\x1B[49m"):String,bgWhite:D?d("\x1B[47m","\x1B[49m"):String});b.exports=gD(),b.exports.createColors=gD;var ve=function(D,e){e||(e={});var t=e.hsep===void 0?" ":e.hsep,n=e.align||[],o=e.stringLength||function(s){return String(s).length},r=AD(D,function(s,F){return xD(F,function(a,c){var C=fD(a);(!s[c]||C>s[c])&&(s[c]=C)}),s},[]),u=Cu(D,function(s){return Cu(s,function(F,a){var c=String(F);if(n[a]==="."){var C=fD(c),E=r[a]+(/\./.test(c)?1:2)-(o(c)-C);return c+Array(E).join(" ")}else return c})}),i=AD(u,function(s,F){return xD(F,function(a,c){var C=o(a);(!s[c]||C>s[c])&&(s[c]=C)}),s},[]);return Cu(u,function(s){return Cu(s,function(F,a){var c=i[a]-o(F)||0,C=Array(Math.max(c+1,1)).join(" ");return n[a]==="r"||n[a]==="."?C+F:n[a]==="c"?Array(Math.ceil(c/2+1)).join(" ")+F+Array(Math.floor(c/2+1)).join(" "):F+C}).join(t).replace(/\s+$/,"")}).join(`
|
|
64
|
+
`)};function fD(D){var e=/\.[^.]*$/.exec(D);return e?e.index+1:D.length}function AD(D,e,t){if(D.reduce)return D.reduce(e,t);for(var n=0,o=arguments.length>=3?t:D[n++];n<D.length;n++)e(o,D[n],n);return o}function xD(D,e){if(D.forEach)return D.forEach(e);for(var t=0;t<D.length;t++)e.call(D,D[t],t)}function Cu(D,e){if(D.map)return D.map(e);for(var t=[],n=0;n<D.length;n++)t.push(e.call(D,D[n],n));return t}function Oe({onlyFirst:D=!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,D?void 0:"g")}function _e(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(Oe(),"")}var $D={exports:{}};(function(D){var e={};D.exports=e,e.eastAsianWidth=function(n){var o=n.charCodeAt(0),r=n.length==2?n.charCodeAt(1):0,u=o;return 55296<=o&&o<=56319&&56320<=r&&r<=57343&&(o&=1023,r&=1023,u=o<<10|r,u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},e.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function t(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var o=t(n),r=0,u=0;u<o.length;u++)r=r+this.characterLength(o[u]);return r},e.slice=function(n,o,r){textLen=e.length(n),o=o||0,r=r||1,o<0&&(o=textLen+o),r<0&&(r=textLen+r);for(var u="",i=0,s=t(n),F=0;F<s.length;F++){var a=s[F],c=e.length(a);if(i>=o-(c==2?1:0))if(i+c<=r)u+=a;else break;i+=c}return u}})($D);var Ne=$D.exports,Te=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};function Le(D,e={}){if(typeof D!="string"||D.length===0||(e={ambiguousIsNarrow:!0,...e},D=_e(D),D.length===0))return 0;D=D.replace(Te()," ");const t=e.ambiguousIsNarrow?1:2;let n=0;for(const o of D){const r=o.codePointAt(0);if(!(r<=31||r>=127&&r<=159||r>=768&&r<=879))switch(Ne.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=t;break;default:n+=1}}return n}const Tu=D=>ve(D,{stringLength:Le}),Lu=D=>Tu(D).split(`
|
|
65
|
+
`),SD=new Map([[Boolean,""],[String,"string"],[Number,"number"]]),Me=(D,e=!1)=>{const t=SD.has(D)?SD.get(D):"value";return e?`[${t}]`:`<${t}>`},P=D=>{const e=[];for(const t of D){if(t.type==="block"||!t.type){const n=" ",o=t.body.map(u=>n+u);o.unshift("");const r=o.join(`
|
|
66
|
+
`);e.push(Tu([[b.exports.bold(`${t.title}:`)],[r]]).toString())}else if(t.type==="inline"){const n=t.items.map(r=>[b.exports.bold(`${r.title}:`),r.body]),o=Tu(n);e.push(o.toString())}e.push("")}return e.join(`
|
|
67
|
+
`)},ke={renderFlagName:D=>D,renderSections:D=>D,renderType:(D,e)=>Me(D,e),renderDefault:D=>JSON.stringify(D)},Ie={en:{"help.name":"Name","help.version":"Version","help.subcommand":"Subcommand","help.commands":"Commands","help.flags":"Flags","help.description":"Description","help.usage":"Usage","help.examples":"Examples","help.notes":"Notes","help.noDescription":"(No description)","help.notes.1":"If no command is specified, show help for the CLI.","help.notes.2":"If a command is specified, show help for the command.","help.notes.3":"-h is an alias for --help.","help.examples.1":"Show help","help.examples.2":"Show help for a specific command","help.commandDescription":"Show help","help.default":"Default: "},"zh-CN":{"help.name":"\u540D\u79F0","help.version":"\u7248\u672C","help.subcommand":"\u5B50\u547D\u4EE4","help.commands":"\u547D\u4EE4","help.flags":"\u6807\u5FD7","help.description":"\u63CF\u8FF0","help.usage":"\u4F7F\u7528","help.examples":"\u793A\u4F8B","help.notes":"\u5907\u6CE8","help.noDescription":"(\u65E0\u63CF\u8FF0)","help.notes.1":"\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u5C55\u793A\u54EA\u4E2A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F\uFF0C\u9ED8\u8BA4\u5C55\u793ACLI\u7684\u3002","help.notes.2":"\u5982\u679C\u6307\u5B9A\u4E86\u5219\u5C55\u793A\u8BE5\u547D\u4EE4\u5E2E\u52A9\u4FE1\u606F\u3002","help.notes.3":"-h \u662F --help \u7684\u4E00\u4E2A\u522B\u540D\u3002","help.examples.1":"\u5C55\u793A CLI \u7684\u5E2E\u52A9\u4FE1\u606F","help.examples.2":"\u5C55\u793A\u6307\u5B9A\u547D\u4EE4\u7684\u5E2E\u52A9\u4FE1\u606F","help.commandDescription":"\u5C55\u793A\u5E2E\u52A9\u4FE1\u606F","help.default":"\u9ED8\u8BA4\u503C: %s"}},Mu=b.exports.yellow("-"),wD=D=>{process.stdout.write(D)},ku=(D,e,t)=>{const{t:n}=e.i18n,o=[{title:n("help.name"),body:b.exports.red(e._name)},{title:n("help.version"),body:b.exports.yellow(e._version)}];t&&o.push({title:n("help.subcommand"),body:b.exports.green(`${e._name} ${U(t.name)}`)}),D.push({type:"inline",items:o}),D.push({title:n("help.description"),body:[(t==null?void 0:t.description)||e._description]})},bD=(D,e,t)=>{const n=e.map(([o,r])=>[o,Mu,r]);D.push({title:t("help.examples"),body:Lu(n)})},lu=(D,e,t,n)=>{const{cli:o}=e,{t:r}=o.i18n,u=[];ku(u,o),u.push({title:r("help.usage"),body:[b.exports.magenta(`$ ${o._name} ${nD("command",e.hasRootOrAlias)} [flags]`)]});const i=[...e.hasRoot?[o._commands[B]]:[],...Object.values(o._commands)].map(s=>{const F=[typeof s.name=="symbol"?"":s.name,...Se(s.alias||[])].sort((a,c)=>a===B?-1:c===B?1:a.length-c.length).map(a=>a===""||typeof a=="symbol"?`${o._name}`:`${o._name} ${a}`).join(", ");return[b.exports.cyan(F),Mu,s.description]});return u.push({title:r("help.commands"),body:Lu(i)}),t&&u.push({title:r("help.notes"),body:t}),n&&bD(u,n,r),D(u)},Iu=(D,e,t)=>{var n;const{cli:o}=e,{t:r}=o.i18n,[u]=Xu(o._commands,t,r);if(!u)throw new su(U(t),r);const i=Object.assign({},ke,u.help);let s=[];t===B?ku(s,o):ku(s,o,{...u,name:U(t)});const F=((n=u.parameters)==null?void 0:n.join(" "))||void 0,a=t===B?"":` ${U(t)}`,c=F?` ${F}`:"",C=u.flags?" [flags]":"";return s.push({title:r("help.usage"),body:[b.exports.magenta(`$ ${o._name}${a}${c}${C}`)]}),u.flags&&s.push({title:r("help.flags"),body:Lu(Object.entries(u.flags).map(([E,l])=>{const h=l.default!==void 0;let p=[pD(E)];l.alias&&p.push(pD(l.alias)),p=p.map(i.renderFlagName);const y=[b.exports.blue(p.join(", ")),i.renderType(l.type,h)];return y.push(Mu,l.description||r("help.noDescription")),h&&y.push(`(${r("help.default",i.renderDefault(l.default))})`),y}))}),u.notes&&s.push({title:r("help.notes"),body:u.notes}),u.examples&&bD(s,u.examples,r),s=i.renderSections(s),D(s)},Re=({command:D=!0,showHelpWhenNoCommand:e=!0,notes:t,examples:n,banner:o}={})=>W({setup:r=>{const{add:u,t:i}=r.i18n;u(Ie);const s=F=>{o&&wD(`${o}
|
|
68
|
+
`),wD(F)};return D&&(r=r.command("help",i("help.commandDescription"),{parameters:["[command...]"],notes:[i("help.notes.1"),i("help.notes.2"),i("help.notes.3")],examples:[[`$ ${r._name} help`,i("help.examples.1")],[`$ ${r._name} help <command>`,i("help.examples.2")],[`$ ${r._name} <command> --help`,i("help.examples.2")]]}).on("help",F=>{F.parameters.command.length?s(Iu(P,F,F.parameters.command)):s(lu(P,F,t,n))})),r.inspector((F,a)=>{const c=F.raw.mergedFlags.h||F.raw.mergedFlags.help;if(!F.hasRootOrAlias&&!F.raw._.length&&e&&!c){let C=`${i("core.noCommandGiven")}
|
|
69
69
|
|
|
70
|
-
`;
|
|
71
|
-
`,s(
|
|
72
|
-
`),process.exit(2)}}})}}),mt={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},
|
|
73
|
-
`).splice(1).map(
|
|
74
|
-
${
|
|
75
|
-
`)}`}function
|
|
76
|
-
${
|
|
77
|
-
`)}}
|
|
70
|
+
`;C+=lu(P,F,t,n),C+=`
|
|
71
|
+
`,s(C),process.exit(1)}else c?F.raw._.length?F.called!==B&&F.name===B?s(lu(P,F,t,n)):s(Iu(P,F,F.raw._)):F.hasRootOrAlias?s(Iu(P,F,B)):s(lu(P,F,t,n)):a()}),r}}),je={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},We=(D,{add:e,t})=>(e(je),D.length<=1?D[0]:t("utils.and",D.slice(0,-1).join(", "),D[D.length-1])),L=new Uint32Array(65536),Pe=(D,e)=>{const t=D.length,n=e.length,o=1<<t-1;let r=-1,u=0,i=t,s=t;for(;s--;)L[D.charCodeAt(s)]|=1<<s;for(s=0;s<n;s++){let F=L[e.charCodeAt(s)];const a=F|u;F|=(F&r)+r^r,u|=~(F|r),r&=F,u&o&&i++,r&o&&i--,u=u<<1|1,r=r<<1|~(a|u),u&=a}for(s=t;s--;)L[D.charCodeAt(s)]=0;return i},He=(D,e)=>{const t=e.length,n=D.length,o=[],r=[],u=Math.ceil(t/32),i=Math.ceil(n/32);for(let l=0;l<u;l++)r[l]=-1,o[l]=0;let s=0;for(;s<i-1;s++){let l=0,h=-1;const p=s*32,y=Math.min(32,n)+p;for(let A=p;A<y;A++)L[D.charCodeAt(A)]|=1<<A;for(let A=0;A<t;A++){const H=L[e.charCodeAt(A)],N=r[A/32|0]>>>A&1,O=o[A/32|0]>>>A&1,Ru=H|l,ju=((H|O)&h)+h^h|H|O;let z=l|~(ju|h),nu=h&ju;z>>>31^N&&(r[A/32|0]^=1<<A),nu>>>31^O&&(o[A/32|0]^=1<<A),z=z<<1|N,nu=nu<<1|O,h=nu|~(Ru|z),l=z&Ru}for(let A=p;A<y;A++)L[D.charCodeAt(A)]=0}let F=0,a=-1;const c=s*32,C=Math.min(32,n-c)+c;for(let l=c;l<C;l++)L[D.charCodeAt(l)]|=1<<l;let E=n;for(let l=0;l<t;l++){const h=L[e.charCodeAt(l)],p=r[l/32|0]>>>l&1,y=o[l/32|0]>>>l&1,A=h|F,H=((h|y)&a)+a^a|h|y;let N=F|~(H|a),O=a&H;E+=N>>>n-1&1,E-=O>>>n-1&1,N>>>31^p&&(r[l/32|0]^=1<<l),O>>>31^y&&(o[l/32|0]^=1<<l),N=N<<1|p,O=O<<1|y,a=O|~(A|N),F=N&A}for(let l=c;l<C;l++)L[D.charCodeAt(l)]=0;return E},yD=(D,e)=>{if(D.length<e.length){const t=e;e=D,D=t}return e.length===0?D.length:D.length<=32?Pe(D,e):He(D,e)};var cu=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Ue=1/0,Ye="[object Symbol]",Ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ze="\\u0300-\\u036f\\ufe20-\\ufe23",Ve="\\u20d0-\\u20f0",Ze="["+ze+Ve+"]",qe=RegExp(Ze,"g"),Je={\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"},Ke=typeof cu=="object"&&cu&&cu.Object===Object&&cu,Qe=typeof self=="object"&&self&&self.Object===Object&&self,Xe=Ke||Qe||Function("return this")();function ut(D){return function(e){return D==null?void 0:D[e]}}var Dt=ut(Je),et=Object.prototype,tt=et.toString,vD=Xe.Symbol,OD=vD?vD.prototype:void 0,_D=OD?OD.toString:void 0;function nt(D){if(typeof D=="string")return D;if(ot(D))return _D?_D.call(D):"";var e=D+"";return e=="0"&&1/D==-Ue?"-0":e}function rt(D){return!!D&&typeof D=="object"}function ot(D){return typeof D=="symbol"||rt(D)&&tt.call(D)==Ye}function st(D){return D==null?"":nt(D)}function it(D){return D=st(D),D&&D.replace(Ge,Dt).replace(qe,"")}var Ft=it;let S,v;(function(D){D.ALL_CLOSEST_MATCHES="all-closest-matches",D.ALL_MATCHES="all-matches",D.ALL_SORTED_MATCHES="all-sorted-matches",D.FIRST_CLOSEST_MATCH="first-closest-match",D.FIRST_MATCH="first-match"})(S||(S={})),function(D){D.EDIT_DISTANCE="edit-distance",D.SIMILARITY="similarity"}(v||(v={}));const ND=new Error("unknown returnType"),Eu=new Error("unknown thresholdType"),TD=(D,e)=>{let t=D;return e.trimSpaces&&(t=t.trim().replace(/\s+/g," ")),e.deburr&&(t=Ft(t)),e.caseSensitive||(t=t.toLowerCase()),t},LD=(D,e)=>{const{matchPath:t}=e,n=((o,r)=>{const u=r.length>0?r.reduce((i,s)=>i==null?void 0:i[s],o):o;return typeof u!="string"?"":u})(D,t);return TD(n,e)};function at(D,e,t){const n=(C=>{const E={caseSensitive:!1,deburr:!0,matchPath:[],returnType:S.FIRST_CLOSEST_MATCH,thresholdType:v.SIMILARITY,trimSpaces:!0,...C};switch(E.thresholdType){case v.EDIT_DISTANCE:return{threshold:20,...E};case v.SIMILARITY:return{threshold:.4,...E};default:throw Eu}})(t),{returnType:o,threshold:r,thresholdType:u}=n,i=TD(D,n);let s,F;switch(u){case v.EDIT_DISTANCE:s=C=>C<=r,F=C=>yD(i,LD(C,n));break;case v.SIMILARITY:s=C=>C>=r,F=C=>((E,l)=>{if(!E||!l)return 0;if(E===l)return 1;const h=yD(E,l),p=Math.max(E.length,l.length);return(p-h)/p})(i,LD(C,n));break;default:throw Eu}const a=[],c=e.length;switch(o){case S.ALL_CLOSEST_MATCHES:case S.FIRST_CLOSEST_MATCH:{const C=[];let E;switch(u){case v.EDIT_DISTANCE:E=1/0;for(let h=0;h<c;h+=1){const p=F(e[h]);E>p&&(E=p),C.push(p)}break;case v.SIMILARITY:E=0;for(let h=0;h<c;h+=1){const p=F(e[h]);E<p&&(E=p),C.push(p)}break;default:throw Eu}const l=C.length;for(let h=0;h<l;h+=1){const p=C[h];s(p)&&p===E&&a.push(h)}break}case S.ALL_MATCHES:for(let C=0;C<c;C+=1)s(F(e[C]))&&a.push(C);break;case S.ALL_SORTED_MATCHES:{const C=[];for(let E=0;E<c;E+=1){const l=F(e[E]);s(l)&&C.push({score:l,index:E})}switch(u){case v.EDIT_DISTANCE:C.sort((E,l)=>E.score-l.score);break;case v.SIMILARITY:C.sort((E,l)=>l.score-E.score);break;default:throw Eu}for(const E of C)a.push(E.index);break}case S.FIRST_MATCH:for(let C=0;C<c;C+=1)if(s(F(e[C]))){a.push(C);break}break;default:throw ND}return((C,E,l)=>{switch(l){case S.ALL_CLOSEST_MATCHES:case S.ALL_MATCHES:case S.ALL_SORTED_MATCHES:return E.map(h=>C[h]);case S.FIRST_CLOSEST_MATCH:case S.FIRST_MATCH:return E.length?C[E[0]]:null;default:throw ND}})(e,a,o)}var mu={exports:{}};let Ct=hu,lt=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||Ct.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),g=(D,e,t=D)=>n=>{let o=""+n,r=o.indexOf(e,D.length);return~r?D+MD(o,e,t,r)+e:D+o+e},MD=(D,e,t,n)=>{let o=D.substring(0,n)+t,r=D.substring(n+e.length),u=r.indexOf(e);return~u?o+MD(r,e,t,u):o+r},kD=(D=lt)=>({isColorSupported:D,reset:D?e=>`\x1B[0m${e}\x1B[0m`:String,bold:D?g("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:D?g("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:D?g("\x1B[3m","\x1B[23m"):String,underline:D?g("\x1B[4m","\x1B[24m"):String,inverse:D?g("\x1B[7m","\x1B[27m"):String,hidden:D?g("\x1B[8m","\x1B[28m"):String,strikethrough:D?g("\x1B[9m","\x1B[29m"):String,black:D?g("\x1B[30m","\x1B[39m"):String,red:D?g("\x1B[31m","\x1B[39m"):String,green:D?g("\x1B[32m","\x1B[39m"):String,yellow:D?g("\x1B[33m","\x1B[39m"):String,blue:D?g("\x1B[34m","\x1B[39m"):String,magenta:D?g("\x1B[35m","\x1B[39m"):String,cyan:D?g("\x1B[36m","\x1B[39m"):String,white:D?g("\x1B[37m","\x1B[39m"):String,gray:D?g("\x1B[90m","\x1B[39m"):String,bgBlack:D?g("\x1B[40m","\x1B[49m"):String,bgRed:D?g("\x1B[41m","\x1B[49m"):String,bgGreen:D?g("\x1B[42m","\x1B[49m"):String,bgYellow:D?g("\x1B[43m","\x1B[49m"):String,bgBlue:D?g("\x1B[44m","\x1B[49m"):String,bgMagenta:D?g("\x1B[45m","\x1B[49m"):String,bgCyan:D?g("\x1B[46m","\x1B[49m"):String,bgWhite:D?g("\x1B[47m","\x1B[49m"):String});mu.exports=kD(),mu.exports.createColors=kD;const ct={en:{"notFound.possibleCommands":"Possible commands: %s.","notFound.commandNotFound":'Command "%s" not found.',"notFound.didyoumean":'Did you mean "%s"?',"notFound.commandNotRegisteredNote":"NOTE: You haven't register any command yet."},"zh-CN":{"notFound.possibleCommands":"\u53EF\u80FD\u7684\u547D\u4EE4: %s\u3002","notFound.commandNotFound":'\u672A\u627E\u5230\u547D\u4EE4 "%s"\u3002',"notFound.didyoumean":'\u4F60\u662F\u4E0D\u662F\u6307 "%s"\uFF1F',"notFound.commandNotRegisteredNote":"\u63D0\u793A: \u4F60\u8FD8\u6CA1\u6709\u6CE8\u518C\u4EFB\u4F55\u547D\u4EE4\u3002"}},Et=()=>W({setup:D=>{const{t:e,add:t}=D.i18n;return t(ct),D.inspector({enforce:"pre",fn:(n,o)=>{const r=Object.keys(D._commands),u=!!r.length;try{o()}catch(i){if(!(i instanceof su||i instanceof iu))throw i;if(n.raw._.length===0||i instanceof iu){console.error(e("core.noCommandGiven")),u&&console.error(e("notFound.possibleCommands",We(r,D.i18n)));return}const s=i.commandName,F=at(s,r);console.error(e("notFound.commandNotFound",mu.exports.strikethrough(s))),u&&F?console.error(e("notFound.didyoumean",mu.exports.bold(F))):u||console.error(e("notFound.commandNotRegisteredNote")),process.stderr.write(`
|
|
72
|
+
`),process.exit(2)}}})}}),mt={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},ID=(D,{add:e,t})=>(e(mt),D.length<=1?D[0]:t("utils.and",D.slice(0,-1).join(", "),D[D.length-1])),ht={en:{"strictFlags.unexpectedSingle":"Unexpected flag: %s.","strictFlags.unexpectedMore":"Unexpected flags: %s.","strictFlags.and":"%s and %s"},"zh-CN":{"strictFlags.unexpectedSingle":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.unexpectedMore":"\u9884\u671F\u4E4B\u5916\u7684\u6807\u5FD7: %s\u3002","strictFlags.and":"%s \u548C %s"}},Bt=()=>W({setup:D=>{const{add:e,t}=D.i18n;return e(ht),D.inspector((n,o)=>{const r=Object.keys(n.unknownFlags);if(!n.resolved||r.length===0)o();else throw r.length>1?new Error(t("strictFlags.unexpectedMore",ID(r,D.i18n))):new Error(t("strictFlags.unexpectedSingle",ID(r,D.i18n)))})}}),pt=D=>D.length===0?"":D.startsWith("v")?D:`v${D}`,dt={en:{"version.commandDescription":"Show CLI version","version.notes.1":'The version string begins with a "v".'},"zh-CN":{"version.commandDescription":"\u5C55\u793A CLI \u7248\u672C","version.notes.1":'\u7248\u672C\u53F7\u5F00\u5934\u5E26\u6709 "v"\u3002'}},gt=({alias:D=["V"],command:e=!0}={})=>W({setup:t=>{const{add:n,t:o}=t.i18n;n(dt);const r=pt(t._version);return e&&(t=t.command("version",o("version.commandDescription"),{notes:[o("version.notes.1")]}).on("version",()=>{process.stdout.write(r)})),t.inspector({enforce:"pre",fn:(u,i)=>{let s=!1;const F=["version",...D];for(const a of Object.keys(u.raw.mergedFlags))if(F.includes(a)){s=!0;break}s?process.stdout.write(r):i()}})}});var M={exports:{}};let ft=hu,At=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||ft.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),f=(D,e,t=D)=>n=>{let o=""+n,r=o.indexOf(e,D.length);return~r?D+RD(o,e,t,r)+e:D+o+e},RD=(D,e,t,n)=>{let o=D.substring(0,n)+t,r=D.substring(n+e.length),u=r.indexOf(e);return~u?o+RD(r,e,t,u):o+r},jD=(D=At)=>({isColorSupported:D,reset:D?e=>`\x1B[0m${e}\x1B[0m`:String,bold:D?f("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:D?f("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:D?f("\x1B[3m","\x1B[23m"):String,underline:D?f("\x1B[4m","\x1B[24m"):String,inverse:D?f("\x1B[7m","\x1B[27m"):String,hidden:D?f("\x1B[8m","\x1B[28m"):String,strikethrough:D?f("\x1B[9m","\x1B[29m"):String,black:D?f("\x1B[30m","\x1B[39m"):String,red:D?f("\x1B[31m","\x1B[39m"):String,green:D?f("\x1B[32m","\x1B[39m"):String,yellow:D?f("\x1B[33m","\x1B[39m"):String,blue:D?f("\x1B[34m","\x1B[39m"):String,magenta:D?f("\x1B[35m","\x1B[39m"):String,cyan:D?f("\x1B[36m","\x1B[39m"):String,white:D?f("\x1B[37m","\x1B[39m"):String,gray:D?f("\x1B[90m","\x1B[39m"):String,bgBlack:D?f("\x1B[40m","\x1B[49m"):String,bgRed:D?f("\x1B[41m","\x1B[49m"):String,bgGreen:D?f("\x1B[42m","\x1B[49m"):String,bgYellow:D?f("\x1B[43m","\x1B[49m"):String,bgBlue:D?f("\x1B[44m","\x1B[49m"):String,bgMagenta:D?f("\x1B[45m","\x1B[49m"):String,bgCyan:D?f("\x1B[46m","\x1B[49m"):String,bgWhite:D?f("\x1B[47m","\x1B[49m"):String});M.exports=jD(),M.exports.createColors=jD;function xt(D){return D.split(`
|
|
73
|
+
`).splice(1).map(e=>e.trim().replace("file://",""))}function $t(D){return`
|
|
74
|
+
${xt(D).map(e=>` ${e.replace(/^at ([\s\S]+) \((.+)\)/,(t,n,o)=>M.exports.gray(`at ${n} (${M.exports.cyan(o)})`))}`).join(`
|
|
75
|
+
`)}`}function St(D){return D.map(e=>typeof(e==null?void 0:e.stack)=="string"?`${e.message}
|
|
76
|
+
${$t(e.stack)}`:e)}function wt(D,e){const t=D.toUpperCase(),n=M.exports[e];return M.exports.bold(M.exports.inverse(n(` ${t} `)))}function tu(D,e,t){const n=M.exports[e],o=t!=null&&t.textColor?M.exports[t.textColor]:n,r=(t==null?void 0:t.target)||console.log;return(...u)=>{const i=St(u);r(`${wt(D,e)} ${o(i.join(" "))}
|
|
77
|
+
`)}}tu("log","gray"),tu("info","blue",{target:console.info}),tu("warn","yellow",{target:console.warn}),tu("success","green");const bt=tu("error","red",{target:console.error}),yt=()=>W({setup:D=>D.errorHandler(e=>{bt(e.message),process.exit(1)})});export{me as Clerc,Yu as CommandExistsError,Gu as CommandNameConflictError,Vu as DescriptionNotSetError,qu as InvalidCommandNameError,du as LocaleNotCalledFirstError,zu as NameNotSetError,iu as NoCommandGivenError,su as NoSuchCommandError,B as Root,Zu as VersionNotSetError,$e as completionsPlugin,eD as compose,pe as defineCommand,he as defineHandler,Be as defineInspector,W as definePlugin,rD as detectLocale,U as formatCommandName,yt as friendlyErrorPlugin,Re as helpPlugin,tD as isValidName,Et as notFoundPlugin,fu as resolveArgv,Qu as resolveCommand,Xu as resolveCommandStrict,gu as resolveFlattenCommands,DD as resolveParametersBeforeFlag,Ce as resolveRootCommands,uD as resolveSubcommandsByParent,Bt as strictFlagsPlugin,gt as versionPlugin,nD as withBrackets};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clerc",
|
|
3
|
-
"version": "0.30.
|
|
4
|
-
"author": "Ray <
|
|
3
|
+
"version": "0.30.1",
|
|
4
|
+
"author": "Ray <i@mk1.io> (https://github.com/so1ve)",
|
|
5
5
|
"description": "Clerc: The full-featured cli framework.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@clerc/core": "0.30.
|
|
51
|
-
"@clerc/plugin-
|
|
52
|
-
"@clerc/plugin-
|
|
53
|
-
"@clerc/plugin-
|
|
54
|
-
"@clerc/plugin-
|
|
55
|
-
"@clerc/plugin-
|
|
56
|
-
"@clerc/plugin-version": "0.30.
|
|
50
|
+
"@clerc/core": "0.30.1",
|
|
51
|
+
"@clerc/plugin-completions": "0.30.1",
|
|
52
|
+
"@clerc/plugin-friendly-error": "0.30.1",
|
|
53
|
+
"@clerc/plugin-not-found": "0.30.1",
|
|
54
|
+
"@clerc/plugin-help": "0.30.1",
|
|
55
|
+
"@clerc/plugin-strict-flags": "0.30.1",
|
|
56
|
+
"@clerc/plugin-version": "0.30.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "puild --minify",
|