@libp2p/daemon 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.min.js +14 -14
  2. package/package.json +2 -2
package/dist/index.min.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #! /usr/bin/env node
2
2
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PDaemon = factory()}(typeof self !== 'undefined' ? self : this, function () {
3
- "use strict";var Libp2PDaemon=(()=>{var js=Object.create;var Le=Object.defineProperty;var vs=Object.getOwnPropertyDescriptor;var Ms=Object.getOwnPropertyNames;var Ns=Object.getPrototypeOf,$s=Object.prototype.hasOwnProperty;var G=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Fs=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),bt=(r,t)=>{for(var e in t)Le(r,e,{get:t[e],enumerable:!0})},Nr=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ms(t))!$s.call(r,i)&&i!==e&&Le(r,i,{get:()=>t[i],enumerable:!(n=vs(t,i))||n.enumerable});return r};var ze=(r,t,e)=>(e=r!=null?js(Ns(r)):{},Nr(t||!r||!r.__esModule?Le(e,"default",{value:r,enumerable:!0}):e,r)),Us=r=>Nr(Le({},"__esModule",{value:!0}),r);var _s=Fs((hh,Cs)=>{var jr=class{constructor(t,e){this.ctx=e||{},this.yargs=t,this.parse=this.parse.bind(this),this.command=this.yargs.command,this.commandDir=this.yargs.commandDir}parse(t){let e=this.yargs,n;return new Promise((i,s)=>{let o=Object.assign({},this.ctx,{resolve:i,reject:s});e.parse(t,o,function(c,p,b){return n=p,c?p.reject(c):p.resolve(b)})}).then(i=>Promise.resolve(i)).then(i=>i&&i.argv?i:{data:i,argv:n}).catch(i=>Promise.resolve(i).then(s=>s&&s.argv?Promise.reject(s):Promise.reject({error:s,argv:n})))}};Cs.exports=jr});var Qa={};bt(Qa,{createLibp2pServer:()=>Ps,default:()=>Mr});var Re=class extends Error{code;props;constructor(t,e,n){super(t),this.code=e,this.name=n?.name??"CodeError",this.props=n??{}}};var En={};bt(En,{base58btc:()=>mt,base58flickr:()=>Ws});var tc=new Uint8Array(0);function $r(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}function Ot(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function Fr(r){return new TextEncoder().encode(r)}function Ur(r){return new TextDecoder().decode(r)}function Ts(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var s=r.charAt(i),o=s.charCodeAt(0);if(e[o]!==255)throw new TypeError(s+" is ambiguous");e[o]=i}var c=r.length,p=r.charAt(0),b=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function h(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var E=0,m=0,N=0,F=x.length;N!==F&&x[N]===0;)N++,E++;for(var R=(F-N)*d+1>>>0,D=new Uint8Array(R);N!==F;){for(var W=x[N],ft=0,Z=R-1;(W!==0||ft<m)&&Z!==-1;Z--,ft++)W+=256*D[Z]>>>0,D[Z]=W%c>>>0,W=W/c>>>0;if(W!==0)throw new Error("Non-zero carry");m=ft,N++}for(var ut=R-m;ut!==R&&D[ut]===0;)ut++;for(var At=p.repeat(E);ut<R;++ut)At+=r.charAt(D[ut]);return At}function g(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var E=0;if(x[E]!==" "){for(var m=0,N=0;x[E]===p;)m++,E++;for(var F=(x.length-E)*b+1>>>0,R=new Uint8Array(F);x[E];){var D=e[x.charCodeAt(E)];if(D===255)return;for(var W=0,ft=F-1;(D!==0||W<N)&&ft!==-1;ft--,W++)D+=c*R[ft]>>>0,R[ft]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");N=W,E++}if(x[E]!==" "){for(var Z=F-N;Z!==F&&R[Z]===0;)Z++;for(var ut=new Uint8Array(m+(F-Z)),At=m;Z!==F;)ut[At++]=R[Z++];return ut}}}function y(x){var E=g(x);if(E)return E;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:g,decode:y}}var Ds=Ts,Ls=Ds,Dr=Ls;var bn=class{name;prefix;baseEncode;constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},wn=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Lr(this,t)}},yn=class{decoders;constructor(t){this.decoders=t}or(t){return Lr(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n!=null)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Lr(r,t){return new yn({...r.decoders??{[r.prefix]:r},...t.decoders??{[t.prefix]:t}})}var xn=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new bn(t,e,n),this.decoder=new wn(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function pe({name:r,prefix:t,encode:e,decode:n}){return new xn(r,t,e,n)}function Wt({name:r,prefix:t,alphabet:e}){let{encode:n,decode:i}=Dr(e,r);return pe({prefix:t,name:r,encode:n,decode:s=>Ot(i(s))})}function zs(r,t,e,n){let i={};for(let d=0;d<t.length;++d)i[t[d]]=d;let s=r.length;for(;r[s-1]==="=";)--s;let o=new Uint8Array(s*e/8|0),c=0,p=0,b=0;for(let d=0;d<s;++d){let h=i[r[d]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);p=p<<e|h,c+=e,c>=8&&(c-=8,o[b++]=255&p>>c)}if(c>=e||255&p<<8-c)throw new SyntaxError("Unexpected end of data");return o}function Rs(r,t,e){let n=t[t.length-1]==="=",i=(1<<e)-1,s="",o=0,c=0;for(let p=0;p<r.length;++p)for(c=c<<8|r[p],o+=8;o>e;)o-=e,s+=t[i&c>>o];if(o!==0&&(s+=t[i&c<<e-o]),n)for(;s.length*e&7;)s+="=";return s}function nt({name:r,prefix:t,bitsPerChar:e,alphabet:n}){return pe({prefix:t,name:r,encode(i){return Rs(i,n,e)},decode(i){return zs(i,n,e,r)}})}var mt=Wt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ws=Wt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var An={};bt(An,{base32:()=>Lt,base32hex:()=>qs,base32hexpad:()=>Ys,base32hexpadupper:()=>Ks,base32hexupper:()=>Gs,base32pad:()=>Vs,base32padupper:()=>Hs,base32upper:()=>Bs,base32z:()=>Js});var Lt=nt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Bs=nt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vs=nt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Hs=nt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),qs=nt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Gs=nt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ys=nt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ks=nt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Js=nt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Qs=Wr,zr=128,Xs=127,Zs=~Xs,ks=Math.pow(2,31);function Wr(r,t,e){t=t||[],e=e||0;for(var n=e;r>=ks;)t[e++]=r&255|zr,r/=128;for(;r&Zs;)t[e++]=r&255|zr,r>>>=7;return t[e]=r|0,Wr.bytes=e-n+1,t}var to=On,eo=128,Rr=127;function On(r,n){var e=0,n=n||0,i=0,s=n,o,c=r.length;do{if(s>=c)throw On.bytes=0,new RangeError("Could not decode varint");o=r[s++],e+=i<28?(o&Rr)<<i:(o&Rr)*Math.pow(2,i),i+=7}while(o>=eo);return On.bytes=s-n,e}var no=Math.pow(2,7),ro=Math.pow(2,14),io=Math.pow(2,21),so=Math.pow(2,28),oo=Math.pow(2,35),ao=Math.pow(2,42),co=Math.pow(2,49),lo=Math.pow(2,56),fo=Math.pow(2,63),uo=function(r){return r<no?1:r<ro?2:r<io?3:r<so?4:r<oo?5:r<ao?6:r<co?7:r<lo?8:r<fo?9:10},ho={encode:Qs,decode:to,encodingLength:uo},po=ho,Pe=po;function je(r,t=0){return[Pe.decode(r,t),Pe.decode.bytes]}function me(r,t,e=0){return Pe.encode(r,t,e),t}function ge(r){return Pe.encodingLength(r)}function Zt(r,t){let e=t.byteLength,n=ge(r),i=n+ge(e),s=new Uint8Array(i+e);return me(r,s,0),me(e,s,n),s.set(t,i),new be(r,e,t,s)}function Be(r){let t=Ot(r),[e,n]=je(t),[i,s]=je(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new be(e,i,o,t)}function Br(r,t){if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&$r(r.bytes,e.bytes)}}var be=class{code;size;digest;bytes;constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};function Vr(r,t){let{bytes:e,version:n}=r;switch(n){case 0:return go(e,Cn(r),t??mt.encoder);default:return bo(e,Cn(r),t??Lt.encoder)}}var Hr=new WeakMap;function Cn(r){let t=Hr.get(r);if(t==null){let e=new Map;return Hr.set(r,e),e}return t}var Bt=class r{code;version;multihash;bytes;"/";constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:e}=this;if(t!==ve)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==wo)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,n=Zt(t,e);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return r.equals(this,t)}static equals(t,e){let n=e;return n!=null&&t.code===n.code&&t.version===n.version&&Br(t.multihash,n.multihash)}toString(t){return Vr(this,t)}toJSON(){return{"/":Vr(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof r)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:s,bytes:o}=e;return new r(n,i,s,o??qr(n,i,s.bytes))}else if(e[yo]===!0){let{version:n,multihash:i,code:s}=e,o=Be(i);return r.create(n,s,o)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==ve)throw new Error(`Version 0 CID must use dag-pb (code: ${ve}) block encoding`);return new r(t,e,n,n.bytes)}case 1:{let i=qr(t,e,n.bytes);return new r(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return r.create(0,ve,t)}static createV1(t,e){return r.create(1,t,e)}static decode(t){let[e,n]=r.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=r.inspectBytes(t),n=e.size-e.multihashSize,i=Ot(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let s=i.subarray(e.multihashSize-e.digestSize),o=new be(e.multihashCode,e.digestSize,s,i);return[e.version===0?r.createV0(o):r.createV1(e.codec,o),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[h,g]=je(t.subarray(e));return e+=g,h},i=n(),s=ve;if(i===18?(i=0,e=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=e,c=n(),p=n(),b=e+p,d=b-o;return{version:i,codec:s,multihashCode:c,digestSize:p,multihashSize:d,size:b}}static parse(t,e){let[n,i]=mo(t,e),s=r.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Cn(s).set(n,t),s}};function mo(r,t){switch(r[0]){case"Q":{let e=t??mt;return[mt.prefix,e.decode(`${mt.prefix}${r}`)]}case mt.prefix:{let e=t??mt;return[mt.prefix,e.decode(r)]}case Lt.prefix:{let e=t??Lt;return[Lt.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}}function go(r,t,e){let{prefix:n}=e;if(n!==mt.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(n);if(i==null){let s=e.encode(r).slice(1);return t.set(n,s),s}else return i}function bo(r,t,e){let{prefix:n}=e,i=t.get(n);if(i==null){let s=e.encode(r);return t.set(n,s),s}else return i}var ve=112,wo=18;function qr(r,t,e){let n=ge(r),i=n+ge(t),s=new Uint8Array(i+e.byteLength);return me(r,s,0),me(t,s,n),s.set(e,i),s}var yo=Symbol.for("@ipld/js-cid/CID");function Gr(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}var _n={};bt(_n,{base10:()=>xo});var xo=Wt({prefix:"9",name:"base10",alphabet:"0123456789"});var Sn={};bt(Sn,{base16:()=>Eo,base16upper:()=>Ao});var Eo=nt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ao=nt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var In={};bt(In,{base2:()=>Oo});var Oo=nt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Pn={};bt(Pn,{base256emoji:()=>Po});var Yr=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Co=Yr.reduce((r,t,e)=>(r[e]=t,r),[]),_o=Yr.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function So(r){return r.reduce((t,e)=>(t+=Co[e],t),"")}function Io(r){let t=[];for(let e of r){let n=_o[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var Po=pe({prefix:"\u{1F680}",name:"base256emoji",encode:So,decode:Io});var jn={};bt(jn,{base36:()=>jo,base36upper:()=>vo});var jo=Wt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),vo=Wt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var vn={};bt(vn,{base64:()=>Mo,base64pad:()=>No,base64url:()=>$o,base64urlpad:()=>Fo});var Mo=nt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),No=nt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),$o=nt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Fo=nt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Mn={};bt(Mn,{base8:()=>Uo});var Uo=nt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Nn={};bt(Nn,{identity:()=>To});var To=pe({prefix:"\0",name:"identity",encode:r=>Ur(r),decode:r=>Fr(r)});var _c=new TextEncoder,Sc=new TextDecoder;var $n={};bt($n,{identity:()=>Wo});var Kr=0,zo="identity",Jr=Ot;function Ro(r){return Zt(Kr,Jr(r))}var Wo={code:Kr,name:zo,encode:Jr,digest:Ro};var Dn={};bt(Dn,{sha256:()=>Bo,sha512:()=>Vo});var Tn=ze(G("crypto"),1);function Un({name:r,code:t,encode:e}){return new Fn(r,t,e)}var Fn=class{name;code;encode;constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?Zt(this.code,e):e.then(n=>Zt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Bo=Un({name:"sha2-256",code:18,encode:r=>Ot(Tn.default.createHash("sha256").update(r).digest())}),Vo=Un({name:"sha2-512",code:19,encode:r=>Ot(Tn.default.createHash("sha512").update(r).digest())});var Me={...Nn,...In,...Mn,..._n,...Sn,...An,...jn,...En,...vn,...Pn},Rc={...Dn,...$n};function kt(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function Ve(r=0){return globalThis.Buffer?.allocUnsafe!=null?kt(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Zr(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Xr=Zr("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Ln=Zr("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=Ve(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),Ho={utf8:Xr,"utf-8":Xr,hex:Me.base16,latin1:Ln,ascii:Ln,binary:Ln,...Me},He=Ho;function gt(r,t="utf8"){let e=He[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):e.encoder.encode(r).substring(1)}function kr(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function ti(r=0){return globalThis.Buffer?.allocUnsafe!=null?kr(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}var qo=Math.pow(2,7),Go=Math.pow(2,14),Yo=Math.pow(2,21),zn=Math.pow(2,28),Rn=Math.pow(2,35),Wn=Math.pow(2,42),Bn=Math.pow(2,49),q=128,ht=127;function $t(r){if(r<qo)return 1;if(r<Go)return 2;if(r<Yo)return 3;if(r<zn)return 4;if(r<Rn)return 5;if(r<Wn)return 6;if(r<Bn)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Ko(r,t,e=0){switch($t(r)){case 8:t[e++]=r&255|q,r/=128;case 7:t[e++]=r&255|q,r/=128;case 6:t[e++]=r&255|q,r/=128;case 5:t[e++]=r&255|q,r/=128;case 4:t[e++]=r&255|q,r>>>=7;case 3:t[e++]=r&255|q,r>>>=7;case 2:t[e++]=r&255|q,r>>>=7;case 1:{t[e++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return t}function Jo(r,t,e=0){switch($t(r)){case 8:t.set(e++,r&255|q),r/=128;case 7:t.set(e++,r&255|q),r/=128;case 6:t.set(e++,r&255|q),r/=128;case 5:t.set(e++,r&255|q),r/=128;case 4:t.set(e++,r&255|q),r>>>=7;case 3:t.set(e++,r&255|q),r>>>=7;case 2:t.set(e++,r&255|q),r>>>=7;case 1:{t.set(e++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return t}function Qo(r,t){let e=r[t],n=0;if(n+=e&ht,e<q||(e=r[t+1],n+=(e&ht)<<7,e<q)||(e=r[t+2],n+=(e&ht)<<14,e<q)||(e=r[t+3],n+=(e&ht)<<21,e<q)||(e=r[t+4],n+=(e&ht)*zn,e<q)||(e=r[t+5],n+=(e&ht)*Rn,e<q)||(e=r[t+6],n+=(e&ht)*Wn,e<q)||(e=r[t+7],n+=(e&ht)*Bn,e<q))return n;throw new RangeError("Could not decode varint")}function Xo(r,t){let e=r.get(t),n=0;if(n+=e&ht,e<q||(e=r.get(t+1),n+=(e&ht)<<7,e<q)||(e=r.get(t+2),n+=(e&ht)<<14,e<q)||(e=r.get(t+3),n+=(e&ht)<<21,e<q)||(e=r.get(t+4),n+=(e&ht)*zn,e<q)||(e=r.get(t+5),n+=(e&ht)*Rn,e<q)||(e=r.get(t+6),n+=(e&ht)*Wn,e<q)||(e=r.get(t+7),n+=(e&ht)*Bn,e<q))return n;throw new RangeError("Could not decode varint")}function ye(r,t,e=0){return t==null&&(t=ti($t(r))),t instanceof Uint8Array?Ko(r,t,e):Jo(r,t,e)}function te(r,t=0){return r instanceof Uint8Array?Qo(r,t):Xo(r,t)}function zt(r,t){if(globalThis.Buffer!=null)return kt(globalThis.Buffer.concat(r,t));t==null&&(t=r.reduce((i,s)=>i+s.length,0));let e=Ve(t),n=0;for(let i of r)e.set(i,n),n+=i.length;return kt(e)}var qe=class{index=0;input="";new(t){return this.index=0,this.input=t,this}readAtomically(t){let e=this.index,n=t();return n===void 0&&(this.index=e),n}parseWith(t){let e=t();if(this.index===this.input.length)return e}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(t){return this.readAtomically(()=>{let e=this.readChar();if(e===t)return e})}readSeparator(t,e,n){return this.readAtomically(()=>{if(!(e>0&&this.readGivenChar(t)===void 0))return n()})}readNumber(t,e,n,i){return this.readAtomically(()=>{let s=0,o=0,c=this.peekChar();if(c===void 0)return;let p=c==="0",b=2**(8*i)-1;for(;;){let d=this.readAtomically(()=>{let h=this.readChar();if(h===void 0)return;let g=Number.parseInt(h,t);if(!Number.isNaN(g))return g});if(d===void 0)break;if(s*=t,s+=d,s>b||(o+=1,e!==void 0&&o>e))return}if(o!==0)return!n&&p&&o>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let t=new Uint8Array(4);for(let e=0;e<t.length;e++){let n=this.readSeparator(".",e,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;t[e]=n}return t})}readIPv6Addr(){let t=e=>{for(let n=0;n<e.length/2;n++){let i=n*2;if(n<e.length-3){let o=this.readSeparator(":",n,()=>this.readIPv4Addr());if(o!==void 0)return e[i]=o[0],e[i+1]=o[1],e[i+2]=o[2],e[i+3]=o[3],[i+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[i,!1];e[i]=s>>8,e[i+1]=s&255}return[e.length,!1]};return this.readAtomically(()=>{let e=new Uint8Array(16),[n,i]=t(e);if(n===16)return e;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),o=16-(n+2),[c]=t(s.subarray(0,o));return e.set(s.subarray(0,c),16-c),e})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var sl=new qe;var dl=parseInt("0xFFFF",16),pl=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function Vn(r,t="utf8"){let e=He[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?kt(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}var Vt=G("node:net");function Ge(r){return!!(0,Vt.isIP)(r)}var ii=Vt.isIPv4,ra=Vt.isIPv6,Hn=function(r){let t=0;if(r=r.toString().trim(),ii(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(ra(r)){let e=r.split(":",8),n;for(n=0;n<e.length;n++){let s=ii(e[n]),o;s&&(o=Hn(e[n]),e[n]=gt(o.slice(0,2),"base16")),o!=null&&++n<8&&e.splice(n,0,gt(o.slice(2,4),"base16"))}if(e[0]==="")for(;e.length<8;)e.unshift("0");else if(e[e.length-1]==="")for(;e.length<8;)e.push("0");else if(e.length<8){for(n=0;n<e.length&&e[n]!=="";n++);let s=[n,1];for(n=9-e.length;n>0;n--)s.push("0");e.splice.apply(e,s)}let i=new Uint8Array(t+16);for(n=0;n<e.length;n++){let s=parseInt(e[n],16);i[t++]=s>>8&255,i[t++]=s&255}return i}throw new Error("invalid ip address")},si=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let i=[];for(let s=0;s<e;s++)i.push(r[t+s]);return i.join(".")}if(e===16){let i=[];for(let s=0;s<e;s+=2)i.push(n.getUint16(t+s).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var xe={},qn={},sa=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];sa.forEach(r=>{let t=oa(...r);qn[t.code]=t,xe[t.name]=t});function oa(r,t,e,n,i){return{code:r,size:t,name:e,resolvable:!!n,path:!!i}}function K(r){if(typeof r=="number"){if(qn[r]!=null)return qn[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(xe[r]!=null)return xe[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var ef=K("ip4"),nf=K("ip6"),rf=K("ipcidr");function Yn(r,t){switch(K(r).code){case 4:case 41:return ca(t);case 42:return ci(t);case 6:case 273:case 33:case 132:return fi(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return ci(t);case 421:return ha(t);case 444:return li(t);case 445:return li(t);case 466:return ua(t);default:return gt(t,"base16")}}function Kn(r,t){switch(K(r).code){case 4:return oi(t);case 41:return oi(t);case 42:return ai(t);case 6:case 273:case 33:case 132:return Jn(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return ai(t);case 421:return la(t);case 444:return da(t);case 445:return pa(t);case 466:return fa(t);default:return Vn(t,"base16")}}var Gn=Object.values(Me).map(r=>r.decoder),aa=function(){let r=Gn[0].or(Gn[1]);return Gn.slice(2).forEach(t=>r=r.or(t)),r}();function oi(r){if(!Ge(r))throw new Error("invalid ip address");return Hn(r)}function ca(r){let t=si(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!Ge(t))throw new Error("invalid ip address");return t}function Jn(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function fi(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function ai(r){let t=Vn(r),e=Uint8Array.from(ye(t.length));return zt([e,t],e.length+t.length)}function ci(r){let t=te(r);if(r=r.slice($t(t)),r.length!==t)throw new Error("inconsistent lengths");return gt(r)}function la(r){let t;r[0]==="Q"||r[0]==="1"?t=Be(mt.decode(`z${r}`)).bytes:t=Bt.parse(r).multihash.bytes;let e=Uint8Array.from(ye(t.length));return zt([e,t],e.length+t.length)}function fa(r){let t=aa.decode(r),e=Uint8Array.from(ye(t.length));return zt([e,t],e.length+t.length)}function ua(r){let t=te(r),e=r.slice($t(t));if(e.length!==t)throw new Error("inconsistent lengths");return"u"+gt(e,"base64url")}function ha(r){let t=te(r),e=r.slice($t(t));if(e.length!==t)throw new Error("inconsistent lengths");return gt(e,"base58btc")}function da(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=Lt.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Jn(n);return zt([e,i],e.length+i.length)}function pa(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=Lt.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Jn(n);return zt([e,i],e.length+i.length)}function li(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=gt(t,"base32"),i=fi(e);return`${n}:${i}`}function ui(r){r=Qn(r);let t=[],e=[],n=null,i=r.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let s=0;s<i.length;s++){let o=i[s],c=K(o);if(c.size===0){t.push([c.code]),e.push([c.code]);continue}if(s++,s>=i.length)throw di("invalid address: "+r);if(c.path===!0){n=Qn(i.slice(s).join("/")),t.push([c.code,Kn(c.code,n)]),e.push([c.code,n]);break}let p=Kn(c.code,i[s]);t.push([c.code,p]),e.push([c.code,Yn(c.code,p)])}return{string:hi(e),bytes:Zn(t),tuples:t,stringTuples:e,path:n}}function Xn(r){let t=[],e=[],n=null,i=0;for(;i<r.length;){let s=te(r,i),o=$t(s),c=K(s),p=ma(c,r.slice(i+o));if(p===0){t.push([s]),e.push([s]),i+=o;continue}let b=r.slice(i+o,i+o+p);if(i+=p+o,i>r.length)throw di("Invalid address Uint8Array: "+gt(r,"base16"));t.push([s,b]);let d=Yn(s,b);if(e.push([s,d]),c.path===!0){n=d;break}}return{bytes:Uint8Array.from(r),string:hi(e),tuples:t,stringTuples:e,path:n}}function hi(r){let t=[];return r.map(e=>{let n=K(e[0]);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),Qn(t.join("/"))}function Zn(r){return zt(r.map(t=>{let e=K(t[0]),n=Uint8Array.from(ye(e.code));return t.length>1&&t[1]!=null&&(n=zt([n,t[1]])),n}))}function ma(r,t){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let e=te(t instanceof Uint8Array?t:Uint8Array.from(t));return e+$t(e)}}function Qn(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function di(r){return new Error("Error parsing address: "+r)}var ga=Symbol.for("nodejs.util.inspect.custom"),kn=Symbol.for("@multiformats/js-multiaddr/multiaddr"),ba=[K("dns").code,K("dns4").code,K("dns6").code,K("dnsaddr").code],Ye=class r{bytes;#e;#t;#n;#r;[kn]=!0;constructor(t){t==null&&(t="");let e;if(t instanceof Uint8Array)e=Xn(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);e=ui(t)}else if(mi(t))e=Xn(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=e.bytes,this.#e=e.string,this.#t=e.tuples,this.#n=e.stringTuples,this.#r=e.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let t,e,n,i,s="",o=K("tcp"),c=K("udp"),p=K("ip4"),b=K("ip6"),d=K("dns6"),h=K("ip6zone");for(let[y,x]of this.stringTuples())y===h.code&&(s=`%${x??""}`),ba.includes(y)&&(e=o.name,i=443,n=`${x??""}${s}`,t=y===d.code?6:4),(y===o.code||y===c.code)&&(e=K(y).name,i=parseInt(x??"")),(y===p.code||y===b.code)&&(e=K(y).name,n=`${x??""}${s}`,t=y===b.code?6:4);if(t==null||e==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:i}}protos(){return this.#t.map(([t])=>Object.assign({},K(t)))}protoCodes(){return this.#t.map(([t])=>t)}protoNames(){return this.#t.map(([t])=>K(t).name)}tuples(){return this.#t}stringTuples(){return this.#n}encapsulate(t){return t=new r(t),new r(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),i=n.lastIndexOf(e);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new r(n.slice(0,i))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new r(Zn(e.slice(0,n)));return this}getPeerId(){try{let t=[];this.stringTuples().forEach(([n,i])=>{n===xe.p2p.code&&t.push([n,i]),n===xe["p2p-circuit"].code&&(t=[])});let e=t.pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?gt(mt.decode(`z${n}`),"base58btc"):gt(Bt.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#r}equals(t){return Gr(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(s=>s.resolvable);if(e==null)return[this];let n=pi.get(e.name);if(n==null)throw new Re(`no available resolver for ${e.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(s=>new r(s))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[ga](){return`Multiaddr(${this.#e})`}};var pi=new Map;function mi(r){return!!r?.[kn]}function tr(r){return new Ye(r)}var nr=ze(G("path"),1),er=ze(G("process"),1),gi=G("module"),bi=G("url");function wa(r){let t=nr.default.extname(r);return t?r.slice(0,-t.length):r}function rr(r){if(!r||!er.default.argv[1])return!1;let e=(0,gi.createRequire)(r.url).resolve(er.default.argv[1]),n=(0,bi.fileURLToPath)(r.url);return nr.default.extname(e)?n===e:wa(n)===e}var en=G("assert");var ya={right:Ca,center:_a},xa=0,Ke=1,Ea=2,Je=3,ir=class{constructor(t){var e;this.width=t.width,this.wrap=(e=t.wrap)!==null&&e!==void 0?e:!0,this.rows=[]}span(...t){let e=this.div(...t);e.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let e=t.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let e=t.split(`
3
+ "use strict";var Libp2PDaemon=(()=>{var Ms=Object.create;var Le=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var $s=Object.getOwnPropertyNames;var Fs=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var B=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Us=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),bt=(r,t)=>{for(var e in t)Le(r,e,{get:t[e],enumerable:!0})},Fr=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $s(t))!Ds.call(r,i)&&i!==e&&Le(r,i,{get:()=>t[i],enumerable:!(n=Ns(t,i))||n.enumerable});return r};var Re=(r,t,e)=>(e=r!=null?Ms(Fs(r)):{},Fr(t||!r||!r.__esModule?Le(e,"default",{value:r,enumerable:!0}):e,r)),Ts=r=>Fr(Le({},"__esModule",{value:!0}),r);var Is=Us((fu,Ss)=>{var Mr=class{constructor(t,e){this.ctx=e||{},this.yargs=t,this.parse=this.parse.bind(this),this.command=this.yargs.command,this.commandDir=this.yargs.commandDir}parse(t){let e=this.yargs,n;return new Promise((i,s)=>{let o=Object.assign({},this.ctx,{resolve:i,reject:s});e.parse(t,o,function(c,p,b){return n=p,c?p.reject(c):p.resolve(b)})}).then(i=>Promise.resolve(i)).then(i=>i&&i.argv?i:{data:i,argv:n}).catch(i=>Promise.resolve(i).then(s=>s&&s.argv?Promise.reject(s):Promise.reject({error:s,argv:n})))}};Ss.exports=Mr});var Za={};bt(Za,{createLibp2pServer:()=>vs,default:()=>$r});var We=class extends Error{code;props;constructor(t,e,n){super(t),this.code=e,this.name=n?.name??"CodeError",this.props=n??{}}};var An={};bt(An,{base58btc:()=>mt,base58flickr:()=>Bs});var nc=new Uint8Array(0);function Dr(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}function Ot(r){if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")}function Ur(r){return new TextEncoder().encode(r)}function Tr(r){return new TextDecoder().decode(r)}function zs(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var s=r.charAt(i),o=s.charCodeAt(0);if(e[o]!==255)throw new TypeError(s+" is ambiguous");e[o]=i}var c=r.length,p=r.charAt(0),b=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function u(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var E=0,m=0,N=0,F=x.length;N!==F&&x[N]===0;)N++,E++;for(var R=(F-N)*d+1>>>0,T=new Uint8Array(R);N!==F;){for(var W=x[N],ft=0,Z=R-1;(W!==0||ft<m)&&Z!==-1;Z--,ft++)W+=256*T[Z]>>>0,T[Z]=W%c>>>0,W=W/c>>>0;if(W!==0)throw new Error("Non-zero carry");m=ft,N++}for(var ht=R-m;ht!==R&&T[ht]===0;)ht++;for(var At=p.repeat(E);ht<R;++ht)At+=r.charAt(T[ht]);return At}function g(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var E=0;if(x[E]!==" "){for(var m=0,N=0;x[E]===p;)m++,E++;for(var F=(x.length-E)*b+1>>>0,R=new Uint8Array(F);x[E];){var T=e[x.charCodeAt(E)];if(T===255)return;for(var W=0,ft=F-1;(T!==0||W<N)&&ft!==-1;ft--,W++)T+=c*R[ft]>>>0,R[ft]=T%256>>>0,T=T/256>>>0;if(T!==0)throw new Error("Non-zero carry");N=W,E++}if(x[E]!==" "){for(var Z=F-N;Z!==F&&R[Z]===0;)Z++;for(var ht=new Uint8Array(m+(F-Z)),At=m;Z!==F;)ht[At++]=R[Z++];return ht}}}function y(x){var E=g(x);if(E)return E;throw new Error(`Non-${t} character`)}return{encode:u,decodeUnsafe:g,decode:y}}var Ls=zs,Rs=Ls,Lr=Rs;var wn=class{name;prefix;baseEncode;constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},yn=class{name;prefix;baseDecode;prefixCodePoint;constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Rr(this,t)}},xn=class{decoders;constructor(t){this.decoders=t}or(t){return Rr(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n!=null)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Rr(r,t){return new xn({...r.decoders??{[r.prefix]:r},...t.decoders??{[t.prefix]:t}})}var En=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new wn(t,e,n),this.decoder=new yn(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};function de({name:r,prefix:t,encode:e,decode:n}){return new En(r,t,e,n)}function Wt({name:r,prefix:t,alphabet:e}){let{encode:n,decode:i}=Lr(e,r);return de({prefix:t,name:r,encode:n,decode:s=>Ot(i(s))})}function Ws(r,t,e,n){let i={};for(let d=0;d<t.length;++d)i[t[d]]=d;let s=r.length;for(;r[s-1]==="=";)--s;let o=new Uint8Array(s*e/8|0),c=0,p=0,b=0;for(let d=0;d<s;++d){let u=i[r[d]];if(u===void 0)throw new SyntaxError(`Non-${n} character`);p=p<<e|u,c+=e,c>=8&&(c-=8,o[b++]=255&p>>c)}if(c>=e||255&p<<8-c)throw new SyntaxError("Unexpected end of data");return o}function Vs(r,t,e){let n=t[t.length-1]==="=",i=(1<<e)-1,s="",o=0,c=0;for(let p=0;p<r.length;++p)for(c=c<<8|r[p],o+=8;o>e;)o-=e,s+=t[i&c>>o];if(o!==0&&(s+=t[i&c<<e-o]),n)for(;s.length*e&7;)s+="=";return s}function nt({name:r,prefix:t,bitsPerChar:e,alphabet:n}){return de({prefix:t,name:r,encode(i){return Vs(i,n,e)},decode(i){return Ws(i,n,e,r)}})}var mt=Wt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Bs=Wt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var On={};bt(On,{base32:()=>zt,base32hex:()=>Ys,base32hexpad:()=>Js,base32hexpadupper:()=>Qs,base32hexupper:()=>Ks,base32pad:()=>qs,base32padupper:()=>Gs,base32upper:()=>Hs,base32z:()=>Xs});var zt=nt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hs=nt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qs=nt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Gs=nt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ys=nt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ks=nt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Js=nt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qs=nt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Xs=nt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Zs=Br,Wr=128,ks=127,to=~ks,eo=Math.pow(2,31);function Br(r,t,e){t=t||[],e=e||0;for(var n=e;r>=eo;)t[e++]=r&255|Wr,r/=128;for(;r&to;)t[e++]=r&255|Wr,r>>>=7;return t[e]=r|0,Br.bytes=e-n+1,t}var no=Cn,ro=128,Vr=127;function Cn(r,n){var e=0,n=n||0,i=0,s=n,o,c=r.length;do{if(s>=c)throw Cn.bytes=0,new RangeError("Could not decode varint");o=r[s++],e+=i<28?(o&Vr)<<i:(o&Vr)*Math.pow(2,i),i+=7}while(o>=ro);return Cn.bytes=s-n,e}var io=Math.pow(2,7),so=Math.pow(2,14),oo=Math.pow(2,21),ao=Math.pow(2,28),co=Math.pow(2,35),lo=Math.pow(2,42),fo=Math.pow(2,49),ho=Math.pow(2,56),uo=Math.pow(2,63),po=function(r){return r<io?1:r<so?2:r<oo?3:r<ao?4:r<co?5:r<lo?6:r<fo?7:r<ho?8:r<uo?9:10},mo={encode:Zs,decode:no,encodingLength:po},go=mo,Pe=go;function je(r,t=0){return[Pe.decode(r,t),Pe.decode.bytes]}function pe(r,t,e=0){return Pe.encode(r,t,e),t}function me(r){return Pe.encodingLength(r)}function Zt(r,t){let e=t.byteLength,n=me(r),i=n+me(e),s=new Uint8Array(i+e);return pe(r,s,0),pe(e,s,n),s.set(t,i),new ge(r,e,t,s)}function Be(r){let t=Ot(r),[e,n]=je(t),[i,s]=je(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new ge(e,i,o,t)}function Hr(r,t){if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&Dr(r.bytes,e.bytes)}}var ge=class{code;size;digest;bytes;constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};function qr(r,t){let{bytes:e,version:n}=r;switch(n){case 0:return wo(e,_n(r),t??mt.encoder);default:return yo(e,_n(r),t??zt.encoder)}}var Gr=new WeakMap;function _n(r){let t=Gr.get(r);if(t==null){let e=new Map;return Gr.set(r,e),e}return t}var Vt=class r{code;version;multihash;bytes;"/";constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:e}=this;if(t!==ve)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==xo)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:e}=this.multihash,n=Zt(t,e);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return r.equals(this,t)}static equals(t,e){let n=e;return n!=null&&t.code===n.code&&t.version===n.version&&Hr(t.multihash,n.multihash)}toString(t){return qr(this,t)}toJSON(){return{"/":qr(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof r)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:s,bytes:o}=e;return new r(n,i,s,o??Yr(n,i,s.bytes))}else if(e[Eo]===!0){let{version:n,multihash:i,code:s}=e,o=Be(i);return r.create(n,s,o)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==ve)throw new Error(`Version 0 CID must use dag-pb (code: ${ve}) block encoding`);return new r(t,e,n,n.bytes)}case 1:{let i=Yr(t,e,n.bytes);return new r(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return r.create(0,ve,t)}static createV1(t,e){return r.create(1,t,e)}static decode(t){let[e,n]=r.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=r.inspectBytes(t),n=e.size-e.multihashSize,i=Ot(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let s=i.subarray(e.multihashSize-e.digestSize),o=new ge(e.multihashCode,e.digestSize,s,i);return[e.version===0?r.createV0(o):r.createV1(e.codec,o),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[u,g]=je(t.subarray(e));return e+=g,u},i=n(),s=ve;if(i===18?(i=0,e=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=e,c=n(),p=n(),b=e+p,d=b-o;return{version:i,codec:s,multihashCode:c,digestSize:p,multihashSize:d,size:b}}static parse(t,e){let[n,i]=bo(t,e),s=r.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return _n(s).set(n,t),s}};function bo(r,t){switch(r[0]){case"Q":{let e=t??mt;return[mt.prefix,e.decode(`${mt.prefix}${r}`)]}case mt.prefix:{let e=t??mt;return[mt.prefix,e.decode(r)]}case zt.prefix:{let e=t??zt;return[zt.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}}function wo(r,t,e){let{prefix:n}=e;if(n!==mt.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(n);if(i==null){let s=e.encode(r).slice(1);return t.set(n,s),s}else return i}function yo(r,t,e){let{prefix:n}=e,i=t.get(n);if(i==null){let s=e.encode(r);return t.set(n,s),s}else return i}var ve=112,xo=18;function Yr(r,t,e){let n=me(r),i=n+me(t),s=new Uint8Array(i+e.byteLength);return pe(r,s,0),pe(t,s,n),s.set(e,i),s}var Eo=Symbol.for("@ipld/js-cid/CID");function Kr(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}var ni=B("node:buffer");var Sn={};bt(Sn,{base10:()=>Ao});var Ao=Wt({prefix:"9",name:"base10",alphabet:"0123456789"});var In={};bt(In,{base16:()=>Oo,base16upper:()=>Co});var Oo=nt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Co=nt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Pn={};bt(Pn,{base2:()=>_o});var _o=nt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var jn={};bt(jn,{base256emoji:()=>vo});var Jr=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),So=Jr.reduce((r,t,e)=>(r[e]=t,r),[]),Io=Jr.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function Po(r){return r.reduce((t,e)=>(t+=So[e],t),"")}function jo(r){let t=[];for(let e of r){let n=Io[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var vo=de({prefix:"\u{1F680}",name:"base256emoji",encode:Po,decode:jo});var vn={};bt(vn,{base36:()=>Mo,base36upper:()=>No});var Mo=Wt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),No=Wt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Mn={};bt(Mn,{base64:()=>$o,base64pad:()=>Fo,base64url:()=>Do,base64urlpad:()=>Uo});var $o=nt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Fo=nt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Do=nt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Uo=nt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Nn={};bt(Nn,{base8:()=>To});var To=nt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var $n={};bt($n,{identity:()=>zo});var zo=de({prefix:"\0",name:"identity",encode:r=>Tr(r),decode:r=>Ur(r)});var Ic=new TextEncoder,Pc=new TextDecoder;var Fn={};bt(Fn,{identity:()=>Bo});var Qr=0,Wo="identity",Xr=Ot;function Vo(r){return Zt(Qr,Xr(r))}var Bo={code:Qr,name:Wo,encode:Xr,digest:Vo};var zn={};bt(zn,{sha256:()=>Ho,sha512:()=>qo});var Tn=Re(B("crypto"),1);function Un({name:r,code:t,encode:e}){return new Dn(r,t,e)}var Dn=class{name;code;encode;constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?Zt(this.code,e):e.then(n=>Zt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Ho=Un({name:"sha2-256",code:18,encode:r=>Ot(Tn.default.createHash("sha256").update(r).digest())}),qo=Un({name:"sha2-512",code:19,encode:r=>Ot(Tn.default.createHash("sha512").update(r).digest())});var Me={...$n,...Pn,...Nn,...Sn,...In,...On,...vn,...An,...Mn,...jn},Vc={...zn,...Fn};var kr=B("node:buffer");function we(r){return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}function He(r=0){return we(kr.Buffer.allocUnsafe(r))}function ei(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var ti=ei("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Ln=ei("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=He(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),Go={utf8:ti,"utf-8":ti,hex:Me.base16,latin1:Ln,ascii:Ln,binary:Ln,...Me},qe=Go;function gt(r,t="utf8"){let e=qe[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return t==="utf8"||t==="utf-8"?ni.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):e.encoder.encode(r).substring(1)}var Yo=Math.pow(2,7),Ko=Math.pow(2,14),Jo=Math.pow(2,21),Rn=Math.pow(2,28),Wn=Math.pow(2,35),Vn=Math.pow(2,42),Bn=Math.pow(2,49),G=128,ut=127;function $t(r){if(r<Yo)return 1;if(r<Ko)return 2;if(r<Jo)return 3;if(r<Rn)return 4;if(r<Wn)return 5;if(r<Vn)return 6;if(r<Bn)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Qo(r,t,e=0){switch($t(r)){case 8:t[e++]=r&255|G,r/=128;case 7:t[e++]=r&255|G,r/=128;case 6:t[e++]=r&255|G,r/=128;case 5:t[e++]=r&255|G,r/=128;case 4:t[e++]=r&255|G,r>>>=7;case 3:t[e++]=r&255|G,r>>>=7;case 2:t[e++]=r&255|G,r>>>=7;case 1:{t[e++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return t}function Xo(r,t,e=0){switch($t(r)){case 8:t.set(e++,r&255|G),r/=128;case 7:t.set(e++,r&255|G),r/=128;case 6:t.set(e++,r&255|G),r/=128;case 5:t.set(e++,r&255|G),r/=128;case 4:t.set(e++,r&255|G),r>>>=7;case 3:t.set(e++,r&255|G),r>>>=7;case 2:t.set(e++,r&255|G),r>>>=7;case 1:{t.set(e++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return t}function Zo(r,t){let e=r[t],n=0;if(n+=e&ut,e<G||(e=r[t+1],n+=(e&ut)<<7,e<G)||(e=r[t+2],n+=(e&ut)<<14,e<G)||(e=r[t+3],n+=(e&ut)<<21,e<G)||(e=r[t+4],n+=(e&ut)*Rn,e<G)||(e=r[t+5],n+=(e&ut)*Wn,e<G)||(e=r[t+6],n+=(e&ut)*Vn,e<G)||(e=r[t+7],n+=(e&ut)*Bn,e<G))return n;throw new RangeError("Could not decode varint")}function ko(r,t){let e=r.get(t),n=0;if(n+=e&ut,e<G||(e=r.get(t+1),n+=(e&ut)<<7,e<G)||(e=r.get(t+2),n+=(e&ut)<<14,e<G)||(e=r.get(t+3),n+=(e&ut)<<21,e<G)||(e=r.get(t+4),n+=(e&ut)*Rn,e<G)||(e=r.get(t+5),n+=(e&ut)*Wn,e<G)||(e=r.get(t+6),n+=(e&ut)*Vn,e<G)||(e=r.get(t+7),n+=(e&ut)*Bn,e<G))return n;throw new RangeError("Could not decode varint")}function ye(r,t,e=0){return t==null&&(t=He($t(r))),t instanceof Uint8Array?Qo(r,t,e):Xo(r,t,e)}function kt(r,t=0){return r instanceof Uint8Array?Zo(r,t):ko(r,t)}var ii=B("node:buffer");function Lt(r,t){return we(ii.Buffer.concat(r,t))}var Ge=class{index=0;input="";new(t){return this.index=0,this.input=t,this}readAtomically(t){let e=this.index,n=t();return n===void 0&&(this.index=e),n}parseWith(t){let e=t();if(this.index===this.input.length)return e}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(t){return this.readAtomically(()=>{let e=this.readChar();if(e===t)return e})}readSeparator(t,e,n){return this.readAtomically(()=>{if(!(e>0&&this.readGivenChar(t)===void 0))return n()})}readNumber(t,e,n,i){return this.readAtomically(()=>{let s=0,o=0,c=this.peekChar();if(c===void 0)return;let p=c==="0",b=2**(8*i)-1;for(;;){let d=this.readAtomically(()=>{let u=this.readChar();if(u===void 0)return;let g=Number.parseInt(u,t);if(!Number.isNaN(g))return g});if(d===void 0)break;if(s*=t,s+=d,s>b||(o+=1,e!==void 0&&o>e))return}if(o!==0)return!n&&p&&o>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let t=new Uint8Array(4);for(let e=0;e<t.length;e++){let n=this.readSeparator(".",e,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;t[e]=n}return t})}readIPv6Addr(){let t=e=>{for(let n=0;n<e.length/2;n++){let i=n*2;if(n<e.length-3){let o=this.readSeparator(":",n,()=>this.readIPv4Addr());if(o!==void 0)return e[i]=o[0],e[i+1]=o[1],e[i+2]=o[2],e[i+3]=o[3],[i+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[i,!1];e[i]=s>>8,e[i+1]=s&255}return[e.length,!1]};return this.readAtomically(()=>{let e=new Uint8Array(16),[n,i]=t(e);if(n===16)return e;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),o=16-(n+2),[c]=t(s.subarray(0,o));return e.set(s.subarray(0,c),16-c),e})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var rl=new Ge;var hl=parseInt("0xFFFF",16),ul=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);var ai=B("node:buffer");function Hn(r,t="utf8"){let e=qe[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return t==="utf8"||t==="utf-8"?we(ai.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}var Bt=B("node:net");function Ye(r){return!!(0,Bt.isIP)(r)}var ci=Bt.isIPv4,sa=Bt.isIPv6,qn=function(r){let t=0;if(r=r.toString().trim(),ci(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(sa(r)){let e=r.split(":",8),n;for(n=0;n<e.length;n++){let s=ci(e[n]),o;s&&(o=qn(e[n]),e[n]=gt(o.slice(0,2),"base16")),o!=null&&++n<8&&e.splice(n,0,gt(o.slice(2,4),"base16"))}if(e[0]==="")for(;e.length<8;)e.unshift("0");else if(e[e.length-1]==="")for(;e.length<8;)e.push("0");else if(e.length<8){for(n=0;n<e.length&&e[n]!=="";n++);let s=[n,1];for(n=9-e.length;n>0;n--)s.push("0");e.splice.apply(e,s)}let i=new Uint8Array(t+16);for(n=0;n<e.length;n++){let s=parseInt(e[n],16);i[t++]=s>>8&255,i[t++]=s&255}return i}throw new Error("invalid ip address")},li=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let i=[];for(let s=0;s<e;s++)i.push(r[t+s]);return i.join(".")}if(e===16){let i=[];for(let s=0;s<e;s+=2)i.push(n.getUint16(t+s).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var xe={},Gn={},aa=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[481,-1,"http-path"],[777,-1,"memory"]];aa.forEach(r=>{let t=ca(...r);Gn[t.code]=t,xe[t.name]=t});function ca(r,t,e,n,i){return{code:r,size:t,name:e,resolvable:!!n,path:!!i}}function K(r){if(typeof r=="number"){if(Gn[r]!=null)return Gn[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(xe[r]!=null)return xe[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var kl=K("ip4"),tf=K("ip6"),ef=K("ipcidr");function Qn(r,t){switch(K(r).code){case 4:case 41:return fa(t);case 42:return Jn(t);case 6:case 273:case 33:case 132:return ui(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Jn(t);case 421:return pa(t);case 444:return hi(t);case 445:return hi(t);case 466:return da(t);case 481:return globalThis.encodeURIComponent(Jn(t));default:return gt(t,"base16")}}function Xn(r,t){switch(K(r).code){case 4:return fi(t);case 41:return fi(t);case 42:return Kn(t);case 6:case 273:case 33:case 132:return Zn(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Kn(t);case 421:return ha(t);case 444:return ma(t);case 445:return ga(t);case 466:return ua(t);case 481:return Kn(globalThis.decodeURIComponent(t));default:return Hn(t,"base16")}}var Yn=Object.values(Me).map(r=>r.decoder),la=function(){let r=Yn[0].or(Yn[1]);return Yn.slice(2).forEach(t=>r=r.or(t)),r}();function fi(r){if(!Ye(r))throw new Error("invalid ip address");return qn(r)}function fa(r){let t=li(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!Ye(t))throw new Error("invalid ip address");return t}function Zn(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function ui(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Kn(r){let t=Hn(r),e=Uint8Array.from(ye(t.length));return Lt([e,t],e.length+t.length)}function Jn(r){let t=kt(r);if(r=r.slice($t(t)),r.length!==t)throw new Error("inconsistent lengths");return gt(r)}function ha(r){let t;r[0]==="Q"||r[0]==="1"?t=Be(mt.decode(`z${r}`)).bytes:t=Vt.parse(r).multihash.bytes;let e=Uint8Array.from(ye(t.length));return Lt([e,t],e.length+t.length)}function ua(r){let t=la.decode(r),e=Uint8Array.from(ye(t.length));return Lt([e,t],e.length+t.length)}function da(r){let t=kt(r),e=r.slice($t(t));if(e.length!==t)throw new Error("inconsistent lengths");return"u"+gt(e,"base64url")}function pa(r){let t=kt(r),e=r.slice($t(t));if(e.length!==t)throw new Error("inconsistent lengths");return gt(e,"base58btc")}function ma(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=zt.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Zn(n);return Lt([e,i],e.length+i.length)}function ga(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=zt.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Zn(n);return Lt([e,i],e.length+i.length)}function hi(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=gt(t,"base32"),i=ui(e);return`${n}:${i}`}function di(r){r=kn(r);let t=[],e=[],n=null,i=r.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let s=0;s<i.length;s++){let o=i[s],c=K(o);if(c.size===0){t.push([c.code]),e.push([c.code]);continue}if(s++,s>=i.length)throw mi("invalid address: "+r);if(c.path===!0){n=kn(i.slice(s).join("/")),t.push([c.code,Xn(c.code,n)]),e.push([c.code,n]);break}let p=Xn(c.code,i[s]);t.push([c.code,p]),e.push([c.code,Qn(c.code,p)])}return{string:pi(e),bytes:er(t),tuples:t,stringTuples:e,path:n}}function tr(r){let t=[],e=[],n=null,i=0;for(;i<r.length;){let s=kt(r,i),o=$t(s),c=K(s),p=ba(c,r.slice(i+o));if(p===0){t.push([s]),e.push([s]),i+=o;continue}let b=r.slice(i+o,i+o+p);if(i+=p+o,i>r.length)throw mi("Invalid address Uint8Array: "+gt(r,"base16"));t.push([s,b]);let d=Qn(s,b);if(e.push([s,d]),c.path===!0){n=d;break}}return{bytes:Uint8Array.from(r),string:pi(e),tuples:t,stringTuples:e,path:n}}function pi(r){let t=[];return r.map(e=>{let n=K(e[0]);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),kn(t.join("/"))}function er(r){return Lt(r.map(t=>{let e=K(t[0]),n=Uint8Array.from(ye(e.code));return t.length>1&&t[1]!=null&&(n=Lt([n,t[1]])),n}))}function ba(r,t){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let e=kt(t instanceof Uint8Array?t:Uint8Array.from(t));return e+$t(e)}}function kn(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function mi(r){return new Error("Error parsing address: "+r)}var wa=Symbol.for("nodejs.util.inspect.custom"),nr=Symbol.for("@multiformats/js-multiaddr/multiaddr"),ya=[K("dns").code,K("dns4").code,K("dns6").code,K("dnsaddr").code],Ke=class r{bytes;#e;#t;#n;#r;[nr]=!0;constructor(t){t==null&&(t="");let e;if(t instanceof Uint8Array)e=tr(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);e=di(t)}else if(bi(t))e=tr(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=e.bytes,this.#e=e.string,this.#t=e.tuples,this.#n=e.stringTuples,this.#r=e.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let t,e,n,i,s="",o=K("tcp"),c=K("udp"),p=K("ip4"),b=K("ip6"),d=K("dns6"),u=K("ip6zone");for(let[y,x]of this.stringTuples())y===u.code&&(s=`%${x??""}`),ya.includes(y)&&(e=o.name,i=443,n=`${x??""}${s}`,t=y===d.code?6:4),(y===o.code||y===c.code)&&(e=K(y).name,i=parseInt(x??"")),(y===p.code||y===b.code)&&(e=K(y).name,n=`${x??""}${s}`,t=y===b.code?6:4);if(t==null||e==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:i}}protos(){return this.#t.map(([t])=>Object.assign({},K(t)))}protoCodes(){return this.#t.map(([t])=>t)}protoNames(){return this.#t.map(([t])=>K(t).name)}tuples(){return this.#t}stringTuples(){return this.#n}encapsulate(t){return t=new r(t),new r(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),i=n.lastIndexOf(e);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new r(n.slice(0,i))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new r(er(e.slice(0,n)));return this}getPeerId(){try{let t=[];this.stringTuples().forEach(([n,i])=>{n===xe.p2p.code&&t.push([n,i]),n===xe["p2p-circuit"].code&&(t=[])});let e=t.pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?gt(mt.decode(`z${n}`),"base58btc"):gt(Vt.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#r}equals(t){return Kr(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(s=>s.resolvable);if(e==null)return[this];let n=gi.get(e.name);if(n==null)throw new We(`no available resolver for ${e.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(s=>Ne(s))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[wa](){return`Multiaddr(${this.#e})`}};var gi=new Map;function bi(r){return!!r?.[nr]}function Ne(r){return new Ke(r)}var ir=Re(B("path"),1),rr=Re(B("process"),1),wi=B("module"),yi=B("url");function xa(r){let t=ir.default.extname(r);return t?r.slice(0,-t.length):r}function sr(r){if(!r||!rr.default.argv[1])return!1;let e=(0,wi.createRequire)(r.url).resolve(rr.default.argv[1]),n=(0,yi.fileURLToPath)(r.url);return ir.default.extname(e)?n===e:xa(n)===e}var nn=B("assert");var Ea={right:Sa,center:Ia},Aa=0,Je=1,Oa=2,Qe=3,or=class{constructor(t){var e;this.width=t.width,this.wrap=(e=t.wrap)!==null&&e!==void 0?e:!0,this.rows=[]}span(...t){let e=this.div(...t);e.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let e=t.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let e=t.split(`
4
4
  `).map(i=>i.split(" ")),n=0;return e.forEach(i=>{i.length>1&&wt.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),wt.stringWidth(i[0])))}),e.forEach(i=>{this.div(...i.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let e=wt.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){let t=[];return this.rows.forEach(e=>{this.rowToString(e,t)}),t.filter(e=>!e.hidden).map(e=>e.text).join(`
5
- `)}rowToString(t,e){return this.rasterize(t).forEach((n,i)=>{let s="";n.forEach((o,c)=>{let{width:p}=t[c],b=this.negatePadding(t[c]),d=o;if(b>wt.stringWidth(o)&&(d+=" ".repeat(b-wt.stringWidth(o))),t[c].align&&t[c].align!=="left"&&this.wrap){let g=ya[t[c].align];d=g(d,b),wt.stringWidth(d)<b&&(d+=" ".repeat((p||0)-wt.stringWidth(d)-1))}let h=t[c].padding||[0,0,0,0];h[Je]&&(s+=" ".repeat(h[Je])),s+=wi(t[c],d,"| "),s+=d,s+=wi(t[c],d," |"),h[Ke]&&(s+=" ".repeat(h[Ke])),i===0&&e.length>0&&(s=this.renderInline(s,e[e.length-1]))}),e.push({text:s.replace(/ +$/,""),span:t.span})}),e}renderInline(t,e){let n=t.match(/^ */),i=n?n[0].length:0,s=e.text,o=wt.stringWidth(s.trimRight());return e.span?this.wrap?i<o?t:(e.hidden=!0,s.trimRight()+" ".repeat(i-o)+t.trimLeft()):(e.hidden=!0,s+t):t}rasterize(t){let e=[],n=this.columnWidths(t),i;return t.forEach((s,o)=>{s.width=n[o],this.wrap?i=wt.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
5
+ `)}rowToString(t,e){return this.rasterize(t).forEach((n,i)=>{let s="";n.forEach((o,c)=>{let{width:p}=t[c],b=this.negatePadding(t[c]),d=o;if(b>wt.stringWidth(o)&&(d+=" ".repeat(b-wt.stringWidth(o))),t[c].align&&t[c].align!=="left"&&this.wrap){let g=Ea[t[c].align];d=g(d,b),wt.stringWidth(d)<b&&(d+=" ".repeat((p||0)-wt.stringWidth(d)-1))}let u=t[c].padding||[0,0,0,0];u[Qe]&&(s+=" ".repeat(u[Qe])),s+=xi(t[c],d,"| "),s+=d,s+=xi(t[c],d," |"),u[Je]&&(s+=" ".repeat(u[Je])),i===0&&e.length>0&&(s=this.renderInline(s,e[e.length-1]))}),e.push({text:s.replace(/ +$/,""),span:t.span})}),e}renderInline(t,e){let n=t.match(/^ */),i=n?n[0].length:0,s=e.text,o=wt.stringWidth(s.trimRight());return e.span?this.wrap?i<o?t:(e.hidden=!0,s.trimRight()+" ".repeat(i-o)+t.trimLeft()):(e.hidden=!0,s+t):t}rasterize(t){let e=[],n=this.columnWidths(t),i;return t.forEach((s,o)=>{s.width=n[o],this.wrap?i=wt.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
6
6
  `):i=s.text.split(`
7
- `),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[xa]||0).fill("")),i.push(...new Array(s.padding[Ea]||0).fill(""))),i.forEach((c,p)=>{e[p]||e.push([]);let b=e[p];for(let d=0;d<o;d++)b[d]===void 0&&b.push("");b.push(c)})}),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[Je]||0)+(t.padding[Ke]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||wt.stringWidth(o.text));let e=t.length,n=this.width,i=t.map(o=>{if(o.width)return e--,n-=o.width,o.width}),s=e?Math.floor(n/e):0;return i.map((o,c)=>o===void 0?Math.max(s,Aa(t[c])):o)}};function wi(r,t,e){return r.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?e:" ":""}function Aa(r){let t=r.padding||[],e=1+(t[Je]||0)+(t[Ke]||0);return r.border?e+4:e}function Oa(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Ca(r,t){r=r.trim();let e=wt.stringWidth(r);return e<t?" ".repeat(t-e)+r:r}function _a(r,t){r=r.trim();let e=wt.stringWidth(r);return e>=t?r:" ".repeat(t-e>>1)+r}var wt;function yi(r,t){return wt=t,new ir({width:r?.width||Oa(),wrap:r?.wrap})}var xi=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function sr(r){return r.replace(xi,"")}function Ei(r,t){let[e,n]=r.match(xi)||["",""];r=sr(r);let i="";for(let s=0;s<r.length;s++)s!==0&&s%t===0&&(i+=`
8
- `),i+=r.charAt(s);return e&&n&&(i=`${e}${i}${n}`),i}function or(r){return yi(r,{stringWidth:t=>[...t].length,stripAnsi:sr,wrap:Ei})}var Ee=G("path"),Qe=G("fs");function Ai(r,t){let e=(0,Ee.resolve)(".",r),n;for((0,Qe.statSync)(e).isDirectory()||(e=(0,Ee.dirname)(e));;){if(n=t(e,(0,Qe.readdirSync)(e)),n)return(0,Ee.resolve)(e,n);if(e=(0,Ee.dirname)(n=e),n===e)break}}var Li=G("util"),zi=G("fs"),Ri=G("url");var Ii=G("util"),tn=G("path");function ee(r){if(r!==r.toLowerCase()&&r!==r.toUpperCase()||(r=r.toLowerCase()),r.indexOf("-")===-1&&r.indexOf("_")===-1)return r;{let e="",n=!1,i=r.match(/^-+/);for(let s=i?i[0].length:0;s<r.length;s++){let o=r.charAt(s);n&&(n=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(e+=o)}return e}}function Xe(r,t){let e=r.toLowerCase();t=t||"-";let n="";for(let i=0;i<r.length;i++){let s=e.charAt(i),o=r.charAt(i);s!==o&&i>0?n+=`${t}${e.charAt(i)}`:n+=o}return n}function Ze(r){return r==null?!1:typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^0[^.]/.test(r)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function Oi(r){if(Array.isArray(r))return r.map(o=>typeof o!="string"?o+"":o);r=r.trim();let t=0,e=null,n=null,i=null,s=[];for(let o=0;o<r.length;o++){if(e=n,n=r.charAt(o),n===" "&&!i){e!==" "&&t++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[t]||(s[t]=""),s[t]+=n}return s}var Ct;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Ct||(Ct={}));var Rt,ke=class{constructor(t){Rt=t}parse(t,e){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),i=Oi(t),s=typeof t=="string",o=Sa(Object.assign(Object.create(null),n.alias)),c=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),p=Object.assign(Object.create(null),n.default),b=n.configObjects||[],d=n.envPrefix,h=c["populate--"],g=h?"--":"_",y=Object.create(null),x=Object.create(null),E=n.__||Rt.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},N=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,F=new RegExp("^--"+c["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(l){let u=typeof l=="object"?l.key:l,A=Object.keys(l).map(function(w){return{boolean:"bools",string:"strings",number:"numbers"}[w]}).filter(Boolean).pop();A&&(m[A][u]=!0),m.arrays[u]=!0,m.keys.push(u)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(l){m.bools[l]=!0,m.keys.push(l)}),[].concat(n.string||[]).filter(Boolean).forEach(function(l){m.strings[l]=!0,m.keys.push(l)}),[].concat(n.number||[]).filter(Boolean).forEach(function(l){m.numbers[l]=!0,m.keys.push(l)}),[].concat(n.count||[]).filter(Boolean).forEach(function(l){m.counts[l]=!0,m.keys.push(l)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(l){m.normalize[l]=!0,m.keys.push(l)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([l,u])=>{typeof u=="number"&&(m.nargs[l]=u,m.keys.push(l))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([l,u])=>{typeof u=="function"&&(m.coercions[l]=u,m.keys.push(l))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(l){m.configs[l]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([l,u])=>{(typeof u=="boolean"||typeof u=="function")&&(m.configs[l]=u)})),Xt(n.key,o,n.default,m.arrays),Object.keys(p).forEach(function(l){(m.aliases[l]||[]).forEach(function(u){p[u]=p[l]})});let R=null;De();let D=[],W=Object.assign(Object.create(null),{_:[]}),ft={};for(let l=0;l<i.length;l++){let u=i[l],A=u.replace(/^-{3,}/,"---"),w,f,P,C,M,ct;if(u!=="--"&&/^-/.test(u)&&tt(u))Z(u);else if(A.match(/^---+(=|$)/)){Z(u);continue}else if(u.match(/^--.+=/)||!c["short-option-groups"]&&u.match(/^-.+=/))C=u.match(/^--?([^=]+)=([\s\S]*)$/),C!==null&&Array.isArray(C)&&C.length>=3&&(U(C[1],m.arrays)?l=At(l,C[1],i,C[2]):U(C[1],m.nargs)!==!1?l=ut(l,C[1],i,C[2]):Y(C[1],C[2],!0));else if(u.match(F)&&c["boolean-negation"])C=u.match(F),C!==null&&Array.isArray(C)&&C.length>=2&&(f=C[1],Y(f,U(f,m.arrays)?[!1]:!1));else if(u.match(/^--.+/)||!c["short-option-groups"]&&u.match(/^-[^-]+/))C=u.match(/^--?(.+)/),C!==null&&Array.isArray(C)&&C.length>=2&&(f=C[1],U(f,m.arrays)?l=At(l,f,i):U(f,m.nargs)!==!1?l=ut(l,f,i):(M=i[l+1],M!==void 0&&(!M.match(/^-/)||M.match(N))&&!U(f,m.bools)&&!U(f,m.counts)||/^(true|false)$/.test(M)?(Y(f,M),l++):Y(f,et(f))));else if(u.match(/^-.\..+=/))C=u.match(/^-([^=]+)=([\s\S]*)$/),C!==null&&Array.isArray(C)&&C.length>=3&&Y(C[1],C[2]);else if(u.match(/^-.\..+/)&&!u.match(N))M=i[l+1],C=u.match(/^-(.\..+)/),C!==null&&Array.isArray(C)&&C.length>=2&&(f=C[1],M!==void 0&&!M.match(/^-/)&&!U(f,m.bools)&&!U(f,m.counts)?(Y(f,M),l++):Y(f,et(f)));else if(u.match(/^-[^-]+/)&&!u.match(N)){P=u.slice(1,-1).split(""),w=!1;for(let dt=0;dt<P.length;dt++){if(M=u.slice(dt+2),P[dt+1]&&P[dt+1]==="="){ct=u.slice(dt+3),f=P[dt],U(f,m.arrays)?l=At(l,f,i,ct):U(f,m.nargs)!==!1?l=ut(l,f,i,ct):Y(f,ct),w=!0;break}if(M==="-"){Y(P[dt],M);continue}if(/[A-Za-z]/.test(P[dt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(M)&&U(M,m.bools)===!1){Y(P[dt],M),w=!0;break}if(P[dt+1]&&P[dt+1].match(/\W/)){Y(P[dt],M),w=!0;break}else Y(P[dt],et(P[dt]))}f=u.slice(-1)[0],!w&&f!=="-"&&(U(f,m.arrays)?l=At(l,f,i):U(f,m.nargs)!==!1?l=ut(l,f,i):(M=i[l+1],M!==void 0&&(!/^(-|--)[^-]/.test(M)||M.match(N))&&!U(f,m.bools)&&!U(f,m.counts)||/^(true|false)$/.test(M)?(Y(f,M),l++):Y(f,et(f))))}else if(u.match(/^-[0-9]$/)&&u.match(N)&&U(u.slice(1),m.bools))f=u.slice(1),Y(f,et(f));else if(u==="--"){D=i.slice(l+1);break}else if(c["halt-at-non-option"]){D=i.slice(l);break}else Z(u)}V(W,!0),V(W,!1),z(W),ot(),k(W,m.aliases,p,!0),at(W),c["set-placeholder-key"]&&Qt(W),Object.keys(m.counts).forEach(function(l){Tt(W,l.split("."))||Y(l,0)}),h&&D.length&&(W[g]=[]),D.forEach(function(l){W[g].push(l)}),c["camel-case-expansion"]&&c["strip-dashed"]&&Object.keys(W).filter(l=>l!=="--"&&l.includes("-")).forEach(l=>{delete W[l]}),c["strip-aliased"]&&[].concat(...Object.keys(o).map(l=>o[l])).forEach(l=>{c["camel-case-expansion"]&&l.includes("-")&&delete W[l.split(".").map(u=>ee(u)).join(".")],delete W[l]});function Z(l){let u=I("_",l);(typeof u=="string"||typeof u=="number")&&W._.push(u)}function ut(l,u,A,w){let f,P=U(u,m.nargs);if(P=typeof P!="number"||isNaN(P)?1:P,P===0)return vt(w)||(R=Error(E("Argument unexpected for: %s",u))),Y(u,et(u)),l;let C=vt(w)?0:1;if(c["nargs-eats-options"])A.length-(l+1)+C<P&&(R=Error(E("Not enough arguments following: %s",u))),C=P;else{for(f=l+1;f<A.length&&(!A[f].match(/^-[^0-9]/)||A[f].match(N)||tt(A[f]));f++)C++;C<P&&(R=Error(E("Not enough arguments following: %s",u)))}let M=Math.min(C,P);for(!vt(w)&&M>0&&(Y(u,w),M--),f=l+1;f<M+l+1;f++)Y(u,A[f]);return l+M}function At(l,u,A,w){let f=[],P=w||A[l+1],C=U(u,m.nargs);if(U(u,m.bools)&&!/^(true|false)$/.test(P))f.push(!0);else if(vt(P)||vt(w)&&/^-/.test(P)&&!N.test(P)&&!tt(P)){if(p[u]!==void 0){let M=p[u];f=Array.isArray(M)?M:[M]}}else{vt(w)||f.push(O(u,w,!0));for(let M=l+1;M<A.length&&!(!c["greedy-arrays"]&&f.length>0||C&&typeof C=="number"&&f.length>=C||(P=A[M],/^-/.test(P)&&!N.test(P)&&!tt(P)));M++)l=M,f.push(O(u,P,s))}return typeof C=="number"&&(C&&f.length<C||isNaN(C)&&f.length===0)&&(R=Error(E("Not enough arguments following: %s",u))),Y(u,f),l}function Y(l,u,A=s){if(/-/.test(l)&&c["camel-case-expansion"]){let P=l.split(".").map(function(C){return ee(C)}).join(".");j(l,P)}let w=O(l,u,A),f=l.split(".");Dt(W,f,w),m.aliases[l]&&m.aliases[l].forEach(function(P){let C=P.split(".");Dt(W,C,w)}),f.length>1&&c["dot-notation"]&&(m.aliases[f[0]]||[]).forEach(function(P){let C=P.split("."),M=[].concat(f);M.shift(),C=C.concat(M),(m.aliases[l]||[]).includes(C.join("."))||Dt(W,C,w)}),U(l,m.normalize)&&!U(l,m.arrays)&&[l].concat(m.aliases[l]||[]).forEach(function(C){Object.defineProperty(ft,C,{enumerable:!0,get(){return u},set(M){u=typeof M=="string"?Rt.normalize(M):M}})})}function j(l,u){m.aliases[l]&&m.aliases[l].length||(m.aliases[l]=[u],y[u]=!0),m.aliases[u]&&m.aliases[u].length||j(u,l)}function O(l,u,A){A&&(u=Ia(u)),(U(l,m.bools)||U(l,m.counts))&&typeof u=="string"&&(u=u==="true");let w=Array.isArray(u)?u.map(function(f){return I(l,f)}):I(l,u);return U(l,m.counts)&&(vt(w)||typeof w=="boolean")&&(w=ar()),U(l,m.normalize)&&U(l,m.arrays)&&(Array.isArray(u)?w=u.map(f=>Rt.normalize(f)):w=Rt.normalize(u)),w}function I(l,u){return!c["parse-positional-numbers"]&&l==="_"||!U(l,m.strings)&&!U(l,m.bools)&&!Array.isArray(u)&&(Ze(u)&&c["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${u}`)))||!vt(u)&&U(l,m.numbers))&&(u=Number(u)),u}function z(l){let u=Object.create(null);k(u,m.aliases,p),Object.keys(m.configs).forEach(function(A){let w=l[A]||u[A];if(w)try{let f=null,P=Rt.resolve(Rt.cwd(),w),C=m.configs[A];if(typeof C=="function"){try{f=C(P)}catch(M){f=M}if(f instanceof Error){R=f;return}}else f=Rt.require(P);H(f)}catch(f){f.name==="PermissionDenied"?R=f:l[A]&&(R=Error(E("Invalid JSON config file: %s",w)))}})}function H(l,u){Object.keys(l).forEach(function(A){let w=l[A],f=u?u+"."+A:A;typeof w=="object"&&w!==null&&!Array.isArray(w)&&c["dot-notation"]?H(w,f):(!Tt(W,f.split("."))||U(f,m.arrays)&&c["combine-arrays"])&&Y(f,w)})}function ot(){typeof b<"u"&&b.forEach(function(l){H(l)})}function V(l,u){if(typeof d>"u")return;let A=typeof d=="string"?d:"",w=Rt.env();Object.keys(w).forEach(function(f){if(A===""||f.lastIndexOf(A,0)===0){let P=f.split("__").map(function(C,M){return M===0&&(C=C.substring(A.length)),ee(C)});(u&&m.configs[P.join(".")]||!u)&&!Tt(l,P)&&Y(P.join("."),w[f])}})}function at(l){let u,A=new Set;Object.keys(l).forEach(function(w){if(!A.has(w)&&(u=U(w,m.coercions),typeof u=="function"))try{let f=I(w,u(l[w]));[].concat(m.aliases[w]||[],w).forEach(P=>{A.add(P),l[P]=f})}catch(f){R=f}})}function Qt(l){return m.keys.forEach(u=>{~u.indexOf(".")||typeof l[u]>"u"&&(l[u]=void 0)}),l}function k(l,u,A,w=!1){Object.keys(A).forEach(function(f){Tt(l,f.split("."))||(Dt(l,f.split("."),A[f]),w&&(x[f]=!0),(u[f]||[]).forEach(function(P){Tt(l,P.split("."))||Dt(l,P.split("."),A[f])}))})}function Tt(l,u){let A=l;c["dot-notation"]||(u=[u.join(".")]),u.slice(0,-1).forEach(function(f){A=A[f]||{}});let w=u[u.length-1];return typeof A!="object"?!1:w in A}function Dt(l,u,A){let w=l;c["dot-notation"]||(u=[u.join(".")]),u.slice(0,-1).forEach(function(ct){ct=Ci(ct),typeof w=="object"&&w[ct]===void 0&&(w[ct]={}),typeof w[ct]!="object"||Array.isArray(w[ct])?(Array.isArray(w[ct])?w[ct].push({}):w[ct]=[w[ct],{}],w=w[ct][w[ct].length-1]):w=w[ct]});let f=Ci(u[u.length-1]),P=U(u.join("."),m.arrays),C=Array.isArray(A),M=c["duplicate-arguments-array"];!M&&U(f,m.nargs)&&(M=!0,(!vt(w[f])&&m.nargs[f]===1||Array.isArray(w[f])&&w[f].length===m.nargs[f])&&(w[f]=void 0)),A===ar()?w[f]=ar(w[f]):Array.isArray(w[f])?M&&P&&C?w[f]=c["flatten-duplicate-arrays"]?w[f].concat(A):(Array.isArray(w[f][0])?w[f]:[w[f]]).concat([A]):!M&&!!P==!!C?w[f]=A:w[f]=w[f].concat([A]):w[f]===void 0&&P?w[f]=C?A:[A]:M&&!(w[f]===void 0||U(f,m.counts)||U(f,m.bools))?w[f]=[w[f],A]:w[f]=A}function Xt(...l){l.forEach(function(u){Object.keys(u||{}).forEach(function(A){m.aliases[A]||(m.aliases[A]=[].concat(o[A]||[]),m.aliases[A].concat(A).forEach(function(w){if(/-/.test(w)&&c["camel-case-expansion"]){let f=ee(w);f!==A&&m.aliases[A].indexOf(f)===-1&&(m.aliases[A].push(f),y[f]=!0)}}),m.aliases[A].concat(A).forEach(function(w){if(w.length>1&&/[A-Z]/.test(w)&&c["camel-case-expansion"]){let f=Xe(w,"-");f!==A&&m.aliases[A].indexOf(f)===-1&&(m.aliases[A].push(f),y[f]=!0)}}),m.aliases[A].forEach(function(w){m.aliases[w]=[A].concat(m.aliases[A].filter(function(f){return w!==f}))}))})})}function U(l,u){let A=[].concat(m.aliases[l]||[],l),w=Object.keys(u),f=A.find(P=>w.includes(P));return f?u[f]:!1}function gn(l){let u=Object.keys(m);return[].concat(u.map(w=>m[w])).some(function(w){return Array.isArray(w)?w.includes(l):w[l]})}function $(l,...u){return[].concat(...u).some(function(w){let f=l.match(w);return f&&gn(f[1])})}function X(l){if(l.match(N)||!l.match(/^-[^-]+/))return!1;let u=!0,A,w=l.slice(1).split("");for(let f=0;f<w.length;f++){if(A=l.slice(f+2),!gn(w[f])){u=!1;break}if(w[f+1]&&w[f+1]==="="||A==="-"||/[A-Za-z]/.test(w[f])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(A)||w[f+1]&&w[f+1].match(/\W/))break}return u}function tt(l){return c["unknown-options-as-args"]&&B(l)}function B(l){return l=l.replace(/^-{3,}/,"--"),l.match(N)||X(l)?!1:!$(l,/^-+([^=]+?)=[\s\S]*$/,F,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function et(l){return!U(l,m.bools)&&!U(l,m.counts)&&`${l}`in p?p[l]:it(jt(l))}function it(l){return{[Ct.BOOLEAN]:!0,[Ct.STRING]:"",[Ct.NUMBER]:void 0,[Ct.ARRAY]:[]}[l]}function jt(l){let u=Ct.BOOLEAN;return U(l,m.strings)?u=Ct.STRING:U(l,m.numbers)?u=Ct.NUMBER:U(l,m.bools)?u=Ct.BOOLEAN:U(l,m.arrays)&&(u=Ct.ARRAY),u}function vt(l){return l===void 0}function De(){Object.keys(m.counts).find(l=>U(l,m.arrays)?(R=Error(E("Invalid configuration: %s, opts.count excludes opts.array.",l)),!0):U(l,m.nargs)?(R=Error(E("Invalid configuration: %s, opts.count excludes opts.narg.",l)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(ft,W),configuration:c,defaulted:Object.assign({},x),error:R,newAliases:Object.assign({},y)}}};function Sa(r){let t=[],e=Object.create(null),n=!0;for(Object.keys(r).forEach(function(i){t.push([].concat(r[i],i))});n;){n=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(t[i].filter(function(c){return t[s].indexOf(c)!==-1}).length){t[i]=t[i].concat(t[s]),t.splice(s,1),n=!0;break}}return t.forEach(function(i){i=i.filter(function(o,c,p){return p.indexOf(o)===c});let s=i.pop();s!==void 0&&typeof s=="string"&&(e[s]=i)}),e}function ar(r){return r!==void 0?r+1:1}function Ci(r){return r==="__proto__"?"___proto___":r}function Ia(r){return typeof r=="string"&&(r[0]==="'"||r[0]==='"')&&r[r.length-1]===r[0]?r.substring(1,r.length-1):r}var Pi=G("fs");var cr,lr,fr,_i=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Si=(lr=(cr=process==null?void 0:process.versions)===null||cr===void 0?void 0:cr.node)!==null&&lr!==void 0?lr:(fr=process==null?void 0:process.version)===null||fr===void 0?void 0:fr.slice(1);if(Si&&Number(Si.match(/^([^.]+)/)[1])<_i)throw Error(`yargs parser supports a minimum Node.js version of ${_i}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Pa=process?process.env:{},ji=new ke({cwd:process.cwd,env:()=>Pa,format:Ii.format,normalize:tn.normalize,resolve:tn.resolve,require:r=>{if(typeof G<"u")return G(r);if(r.match(/\.json$/))return JSON.parse((0,Pi.readFileSync)(r,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ne=function(t,e){return ji.parse(t.slice(),e).argv};Ne.detailed=function(r,t){return ji.parse(r.slice(),t)};Ne.camelCase=ee;Ne.decamelize=Xe;Ne.looksLikeNumber=Ze;var vi=Ne;var Nt=G("path");function ja(){return va()?0:1}function va(){return Ma()&&!process.defaultApp}function Ma(){return!!process.versions.electron}function Mi(){return process.argv[ja()]}var J=class r extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,r)}};var Ae=G("fs"),Ni=G("util"),$i=G("path"),Fi={fs:{readFileSync:Ae.readFileSync,writeFile:Ae.writeFile},format:Ni.format,resolve:$i.resolve,exists:r=>{try{return(0,Ae.statSync)(r).isFile()}catch{return!1}}};var Mt,ur=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let e=t.shift(),n=function(){};return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Mt.format.apply(Mt.format,[this.cache[this.locale][e]||e].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),i=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?e:n;this.cache[this.locale][e]&&(o=this.cache[this.locale][e][i===1?"one":"other"]),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let c=[o];return~o.indexOf("%d")&&c.push(i),Mt.format.apply(Mt.format,c.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach(function(i,s){let o=e[s+1];n+=i,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,e=this.writeQueue[0],n=e.directory,i=e.locale,s=e.cb,o=this._resolveLocaleFile(n,i),c=JSON.stringify(this.cache[i],null,2);Mt.fs.writeFile(o,c,"utf-8",function(p){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(p)})}_readLocaleFile(){let t={},e=this._resolveLocaleFile(this.directory,this.locale);try{Mt.fs.readFileSync&&(t=JSON.parse(Mt.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=Mt.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){let i=Mt.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(t){return Mt.exists(t)}};function Ui(r,t){Mt=t;let e=new ur(r);return{__:e.__.bind(e),__n:e.__n.bind(e),setLocale:e.setLocale.bind(e),getLocale:e.getLocale.bind(e),updateLocale:e.updateLocale.bind(e),locale:e.locale}}var Na=r=>Ui(r,Fi),Ti=Na;var Ua={},$a="require is not supported by ESM",Di="loading a directory of commands is not supported yet for ESM",$e;try{$e=(0,Ri.fileURLToPath)(Ua.url)}catch{$e=process.cwd()}var Fa=$e.substring(0,$e.lastIndexOf("node_modules")),Wi={assert:{notStrictEqual:en.notStrictEqual,strictEqual:en.strictEqual},cliui:or,findUp:Ai,getEnv:r=>process.env[r],inspect:Li.inspect,getCallerFile:()=>{throw new J(Di)},getProcessArgvBin:Mi,mainFilename:Fa||process.cwd(),Parser:vi,path:{basename:Nt.basename,dirname:Nt.dirname,extname:Nt.extname,relative:Nt.relative,resolve:Nt.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(r,t)=>process.emitWarning(r,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:zi.readFileSync,require:()=>{throw new J($a)},requireDirectory:()=>{throw new J(Di)},stringWidth:r=>[...r].length,y18n:Ti({directory:(0,Nt.resolve)($e,"../../../locales"),updateFiles:!1})};function pt(r,t,e,n){e.assert.notStrictEqual(r,t,n)}function hr(r,t){t.assert.strictEqual(typeof r,"string")}function Oe(r){return Object.keys(r)}function Q(r){return!!r&&!!r.then&&typeof r.then=="function"}function Ht(r){let e=r.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${r}`);let s={cmd:i.replace(n,""),demanded:[],optional:[]};return e.forEach((o,c)=>{let p=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&c===e.length-1&&(p=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(n,"").split("|"),variadic:p}):s.demanded.push({cmd:o.replace(n,"").split("|"),variadic:p})}),s}var Ta=["first","second","third","fourth","fifth","sixth"];function _(r,t,e){function n(){return typeof r=="object"?[{demanded:[],optional:[]},r,t]:[Ht(`cmd ${r}`),t,e]}try{let i=0,[s,o,c]=n(),p=[].slice.call(o);for(;p.length&&p[p.length-1]===void 0;)p.pop();let b=c||p.length;if(b<s.demanded.length)throw new J(`Not enough arguments provided. Expected ${s.demanded.length} but received ${p.length}.`);let d=s.demanded.length+s.optional.length;if(b>d)throw new J(`Too many arguments provided. Expected max ${d} but received ${b}.`);s.demanded.forEach(h=>{let g=p.shift(),y=Bi(g);h.cmd.filter(E=>E===y||E==="*").length===0&&Vi(y,h.cmd,i),i+=1}),s.optional.forEach(h=>{if(p.length===0)return;let g=p.shift(),y=Bi(g);h.cmd.filter(E=>E===y||E==="*").length===0&&Vi(y,h.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Bi(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function Vi(r,t,e){throw new J(`Invalid ${Ta[e]||"manyith"} argument. Expected ${t.join(" or ")} but received ${r}.`)}var nn=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,i=!1){if(_("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=e,o.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=e,s.global=n,s.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...n[e]||[],e];return i.option?!s.includes(i.option):!0}),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function Hi(r){return r?r.map(t=>(t.applyBeforeValidation=!1,t)):[]}function ne(r,t,e,n){return e.reduce((i,s)=>{if(s.applyBeforeValidation!==n)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(Q(i))return i.then(o=>Promise.all([o,s(o,t)])).then(([o,c])=>Object.assign(o,c));{let o=s(i,t);return Q(o)?o.then(c=>Object.assign(i,c)):Object.assign(i,o)}},r)}function re(r,t,e=n=>{throw n}){try{let n=Da(r)?r():r;return Q(n)?n.then(i=>t(i)):t(n)}catch(n){return e(n)}}function Da(r){return typeof r=="function"}function dr(r){if(typeof G>"u")return null;for(let t=0,e=Object.keys(G.cache),n;t<e.length;t++)if(n=G.cache[e[t]],n.exports===r)return n;return null}var Ce=/(^\*)|(^\$0)/,pr=class{constructor(t,e,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:o=>o;i.visit=(o,c,p)=>{let b=s(o,c,p);if(b){if(this.requireCache.has(c))return b;this.requireCache.add(c),this.addHandler(b)}return b},this.shim.requireDirectory({require:e,filename:n},t,i)}addHandler(t,e,n,i,s,o){let c=[],p=Hi(s);if(i=i||(()=>{}),Array.isArray(t))if(La(t))[t,...c]=t;else for(let b of t)this.addHandler(b);else if(Ra(t)){let b=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(b=[].concat(b).concat(t.aliases)),this.addHandler(b,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(qi(n)){this.addHandler([t].concat(c),e,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){let b=Ht(t);c=c.map(g=>Ht(g).cmd);let d=!1,h=[b.cmd].concat(c).filter(g=>Ce.test(g)?(d=!0,!1):!0);h.length===0&&d&&h.push("$0"),d&&(b.cmd=h[0],c=h.slice(1),t=t.replace(Ce,b.cmd)),c.forEach(g=>{this.aliasMap[g]=b.cmd}),e!==!1&&this.usage.command(t,e,d,c,o),this.handlers[b.cmd]={original:t,description:e,handler:i,builder:n||{},middlewares:p,deprecated:o,demanded:b.demanded,optional:b.optional},d&&(this.defaultCommand=this.handlers[b.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,i,s,o){let c=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,p=e.getInternalMethods().getContext(),b=p.commands.slice(),d=!t;t&&(p.commands.push(t),p.fullCommands.push(c.original));let h=this.applyBuilderUpdateUsageAndParse(d,c,e,n.aliases,b,i,s,o);return Q(h)?h.then(g=>this.applyMiddlewareAndGetResult(d,c,g.innerArgv,p,s,g.aliases,e)):this.applyMiddlewareAndGetResult(d,c,h.innerArgv,p,s,h.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,i,s,o,c,p){let b=e.builder,d=n;if(rn(b)){n.getInternalMethods().getUsageInstance().freeze();let h=b(n.getInternalMethods().reset(i),p);if(Q(h))return h.then(g=>(d=Yi(g)?g:n,this.parseAndUpdateUsage(t,e,d,s,o,c)))}else za(b)&&(n.getInternalMethods().getUsageInstance().freeze(),d=n.getInternalMethods().reset(i),Object.keys(e.builder).forEach(h=>{d.option(h,b[h])}));return this.parseAndUpdateUsage(t,e,d,s,o,c)}parseAndUpdateUsage(t,e,n,i,s,o){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);let c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return Q(c)?c.then(p=>({aliases:n.parsed.aliases,innerArgv:p})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,e){let n=Ce.test(e.original)?e.original.replace(Ce,"").trim():e.original,i=t.filter(s=>!Ce.test(s));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,e,n,i,s,o,c,p){if(!o.getInternalMethods().getHasOutput()){let b=o.getInternalMethods().runValidation(s,p,o.parsed.error,t);n=re(n,d=>(b(d),d))}if(e.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let b=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(n,b,!1,!1),n=ne(n,o,c,!1),n=re(n,d=>{let h=e.handler(d);return Q(h)?h.then(()=>d):d}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Q(n)&&!o.getInternalMethods().hasParseCallback()&&n.catch(d=>{try{o.getInternalMethods().getUsageInstance().fail(null,d)}catch{}})}return t||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,i,s,o,c){let p={};if(s)return n;c.getInternalMethods().getHasOutput()||(p=this.populatePositionals(e,n,i,c));let b=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),d=ne(n,c,b,!0);return Q(d)?d.then(h=>this.handleValidationAndGetResult(t,e,h,i,o,c,b,p)):this.handleValidationAndGetResult(t,e,d,i,o,c,b,p)}populatePositionals(t,e,n,i){e._=e._.slice(n.commands.length);let s=t.demanded.slice(0),o=t.optional.slice(0),c={};for(this.validation.positionalCount(s.length,e._.length);s.length;){let p=s.shift();this.populatePositional(p,e,c)}for(;o.length;){let p=o.shift();this.populatePositional(p,e,c)}return e._=n.commands.concat(e._.map(p=>""+p)),this.postProcessPositionals(e,c,this.cmdToParseOptions(t.original),i),c}populatePositional(t,e,n){let i=t.cmd[0];t.variadic?n[i]=e._.splice(0).map(String):e._.length&&(n[i]=[String(e._.shift())])}cmdToParseOptions(t){let e={array:[],default:{},alias:{},demand:{}},n=Ht(t);return n.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=o,e.demand[s]=!0}),n.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=o}),e}postProcessPositionals(t,e,n,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(let b of Object.keys(n.alias))s.alias[b]=(s.alias[b]||[]).concat(n.alias[b]);s.array=s.array.concat(n.array),s.config={};let o=[];if(Object.keys(e).forEach(b=>{e[b].map(d=>{s.configuration["unknown-options-as-args"]&&(s.key[b]=!0),o.push(`--${b}`),o.push(d)})}),!o.length)return;let c=Object.assign({},s.configuration,{"populate--":!1}),p=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:c}));if(p.error)i.getInternalMethods().getUsageInstance().fail(p.error.message,p.error);else{let b=Object.keys(e);Object.keys(e).forEach(d=>{b.push(...p.aliases[d])}),Object.keys(p.argv).forEach(d=>{b.includes(d)&&(e[d]||(e[d]=p.argv[d]),!this.isInConfigs(i,d)&&!this.isDefaulted(i,d)&&Object.prototype.hasOwnProperty.call(t,d)&&Object.prototype.hasOwnProperty.call(p.argv,d)&&(Array.isArray(t[d])||Array.isArray(p.argv[d]))?t[d]=[].concat(t[d],p.argv[d]):t[d]=p.argv[d])})}}isDefaulted(t,e){let{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){let{configObjects:n}=t.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,e))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(e)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let n=Ce.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let e=this.defaultCommand.builder;if(rn(e))return e(t,!0);qi(e)||Object.keys(e).forEach(n=>{t.option(n,e[n])})}moduleName(t){let e=dr(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(let i of[t,e,n]){if(typeof i=="string"||i===!1)return i;pt(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();pt(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Gi(r,t,e,n){return new pr(r,t,e,n)}function qi(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function La(r){return r.every(t=>typeof t=="string")}function rn(r){return typeof r=="function"}function za(r){return typeof r=="object"}function Ra(r){return typeof r=="object"&&!Array.isArray(r)}function qt(r={},t=()=>!0){let e={};return Oe(r).forEach(n=>{t(n,r[n])&&(e[n]=r[n])}),e}function Gt(r){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let e=t;e._handle&&e.isTTY&&typeof e._handle.setBlocking=="function"&&e._handle.setBlocking(r)})}function Wa(r){return typeof r=="boolean"}function Ji(r,t){let e=t.y18n.__,n={},i=[];n.failFn=function(O){i.push(O)};let s=null,o=null,c=!0;n.showHelpOnFail=function(O=!0,I){let[z,H]=typeof O=="string"?[!0,O]:[O,I];return r.getInternalMethods().isGlobalContext()&&(o=H),s=H,c=z,n};let p=!1;n.fail=function(O,I){let z=r.getInternalMethods().getLoggerInstance();if(i.length)for(let H=i.length-1;H>=0;--H){let ot=i[H];if(Wa(ot)){if(I)throw I;if(O)throw Error(O)}else ot(O,I,n)}else{if(r.getExitProcess()&&Gt(!0),!p){p=!0,c&&(r.showHelp("error"),z.error()),(O||I)&&z.error(O||I);let H=s||o;H&&((O||I)&&z.error(""),z.error(H))}if(I=I||new J(O),r.getExitProcess())return r.exit(1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,I);throw I}};let b=[],d=!1;n.usage=(j,O)=>j===null?(d=!0,b=[],n):(d=!1,b.push([j,O||""]),n),n.getUsage=()=>b,n.getUsageDisabled=()=>d,n.getPositionalGroupName=()=>e("Positionals:");let h=[];n.example=(j,O)=>{h.push([j,O||""])};let g=[];n.command=function(O,I,z,H,ot=!1){z&&(g=g.map(V=>(V[2]=!1,V))),g.push([O,I||"",z,H,ot])},n.getCommands=()=>g;let y={};n.describe=function(O,I){Array.isArray(O)?O.forEach(z=>{n.describe(z,I)}):typeof O=="object"?Object.keys(O).forEach(z=>{n.describe(z,O[z])}):y[O]=I},n.getDescriptions=()=>y;let x=[];n.epilog=j=>{x.push(j)};let E=!1,m;n.wrap=j=>{E=!0,m=j},n.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(E||(m=ut(),E=!0),m);let N="__yargsString__:";n.deferY18nLookup=j=>N+j,n.help=function(){if(D)return D;R();let O=r.customScriptName?r.$0:t.path.basename(r.$0),I=r.getDemandedOptions(),z=r.getDemandedCommands(),H=r.getDeprecatedOptions(),ot=r.getGroups(),V=r.getOptions(),at=[];at=at.concat(Object.keys(y)),at=at.concat(Object.keys(I)),at=at.concat(Object.keys(z)),at=at.concat(Object.keys(V.default)),at=at.filter(ft),at=Object.keys(at.reduce(($,X)=>(X!=="_"&&($[X]=!0),$),{}));let Qt=n.getWrap(),k=t.cliui({width:Qt,wrap:!!Qt});if(!d){if(b.length)b.forEach($=>{k.div({text:`${$[0].replace(/\$0/g,O)}`}),$[1]&&k.div({text:`${$[1]}`,padding:[1,0,0,0]})}),k.div();else if(g.length){let $=null;z._?$=`${O} <${e("command")}>
7
+ `),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[Aa]||0).fill("")),i.push(...new Array(s.padding[Oa]||0).fill(""))),i.forEach((c,p)=>{e[p]||e.push([]);let b=e[p];for(let d=0;d<o;d++)b[d]===void 0&&b.push("");b.push(c)})}),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[Qe]||0)+(t.padding[Je]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||wt.stringWidth(o.text));let e=t.length,n=this.width,i=t.map(o=>{if(o.width)return e--,n-=o.width,o.width}),s=e?Math.floor(n/e):0;return i.map((o,c)=>o===void 0?Math.max(s,Ca(t[c])):o)}};function xi(r,t,e){return r.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?e:" ":""}function Ca(r){let t=r.padding||[],e=1+(t[Qe]||0)+(t[Je]||0);return r.border?e+4:e}function _a(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Sa(r,t){r=r.trim();let e=wt.stringWidth(r);return e<t?" ".repeat(t-e)+r:r}function Ia(r,t){r=r.trim();let e=wt.stringWidth(r);return e>=t?r:" ".repeat(t-e>>1)+r}var wt;function Ei(r,t){return wt=t,new or({width:r?.width||_a(),wrap:r?.wrap})}var Ai=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function ar(r){return r.replace(Ai,"")}function Oi(r,t){let[e,n]=r.match(Ai)||["",""];r=ar(r);let i="";for(let s=0;s<r.length;s++)s!==0&&s%t===0&&(i+=`
8
+ `),i+=r.charAt(s);return e&&n&&(i=`${e}${i}${n}`),i}function cr(r){return Ei(r,{stringWidth:t=>[...t].length,stripAnsi:ar,wrap:Oi})}var Ee=B("path"),Xe=B("fs");function Ci(r,t){let e=(0,Ee.resolve)(".",r),n;for((0,Xe.statSync)(e).isDirectory()||(e=(0,Ee.dirname)(e));;){if(n=t(e,(0,Xe.readdirSync)(e)),n)return(0,Ee.resolve)(e,n);if(e=(0,Ee.dirname)(n=e),n===e)break}}var Ri=B("util"),Wi=B("fs"),Vi=B("url");var ji=B("util"),en=B("path");function te(r){if(r!==r.toLowerCase()&&r!==r.toUpperCase()||(r=r.toLowerCase()),r.indexOf("-")===-1&&r.indexOf("_")===-1)return r;{let e="",n=!1,i=r.match(/^-+/);for(let s=i?i[0].length:0;s<r.length;s++){let o=r.charAt(s);n&&(n=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(e+=o)}return e}}function Ze(r,t){let e=r.toLowerCase();t=t||"-";let n="";for(let i=0;i<r.length;i++){let s=e.charAt(i),o=r.charAt(i);s!==o&&i>0?n+=`${t}${e.charAt(i)}`:n+=o}return n}function ke(r){return r==null?!1:typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^0[^.]/.test(r)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function _i(r){if(Array.isArray(r))return r.map(o=>typeof o!="string"?o+"":o);r=r.trim();let t=0,e=null,n=null,i=null,s=[];for(let o=0;o<r.length;o++){if(e=n,n=r.charAt(o),n===" "&&!i){e!==" "&&t++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[t]||(s[t]=""),s[t]+=n}return s}var Ct;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Ct||(Ct={}));var Rt,tn=class{constructor(t){Rt=t}parse(t,e){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),i=_i(t),s=typeof t=="string",o=Pa(Object.assign(Object.create(null),n.alias)),c=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),p=Object.assign(Object.create(null),n.default),b=n.configObjects||[],d=n.envPrefix,u=c["populate--"],g=u?"--":"_",y=Object.create(null),x=Object.create(null),E=n.__||Rt.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},N=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,F=new RegExp("^--"+c["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(l){let h=typeof l=="object"?l.key:l,A=Object.keys(l).map(function(w){return{boolean:"bools",string:"strings",number:"numbers"}[w]}).filter(Boolean).pop();A&&(m[A][h]=!0),m.arrays[h]=!0,m.keys.push(h)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(l){m.bools[l]=!0,m.keys.push(l)}),[].concat(n.string||[]).filter(Boolean).forEach(function(l){m.strings[l]=!0,m.keys.push(l)}),[].concat(n.number||[]).filter(Boolean).forEach(function(l){m.numbers[l]=!0,m.keys.push(l)}),[].concat(n.count||[]).filter(Boolean).forEach(function(l){m.counts[l]=!0,m.keys.push(l)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(l){m.normalize[l]=!0,m.keys.push(l)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([l,h])=>{typeof h=="number"&&(m.nargs[l]=h,m.keys.push(l))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([l,h])=>{typeof h=="function"&&(m.coercions[l]=h,m.keys.push(l))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(l){m.configs[l]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([l,h])=>{(typeof h=="boolean"||typeof h=="function")&&(m.configs[l]=h)})),Xt(n.key,o,n.default,m.arrays),Object.keys(p).forEach(function(l){(m.aliases[l]||[]).forEach(function(h){p[h]=p[l]})});let R=null;ze();let T=[],W=Object.assign(Object.create(null),{_:[]}),ft={};for(let l=0;l<i.length;l++){let h=i[l],A=h.replace(/^-{3,}/,"---"),w,f,P,C,M,ct;if(h!=="--"&&/^-/.test(h)&&tt(h))Z(h);else if(A.match(/^---+(=|$)/)){Z(h);continue}else if(h.match(/^--.+=/)||!c["short-option-groups"]&&h.match(/^-.+=/))C=h.match(/^--?([^=]+)=([\s\S]*)$/),C!==null&&Array.isArray(C)&&C.length>=3&&(D(C[1],m.arrays)?l=At(l,C[1],i,C[2]):D(C[1],m.nargs)!==!1?l=ht(l,C[1],i,C[2]):Y(C[1],C[2],!0));else if(h.match(F)&&c["boolean-negation"])C=h.match(F),C!==null&&Array.isArray(C)&&C.length>=2&&(f=C[1],Y(f,D(f,m.arrays)?[!1]:!1));else if(h.match(/^--.+/)||!c["short-option-groups"]&&h.match(/^-[^-]+/))C=h.match(/^--?(.+)/),C!==null&&Array.isArray(C)&&C.length>=2&&(f=C[1],D(f,m.arrays)?l=At(l,f,i):D(f,m.nargs)!==!1?l=ht(l,f,i):(M=i[l+1],M!==void 0&&(!M.match(/^-/)||M.match(N))&&!D(f,m.bools)&&!D(f,m.counts)||/^(true|false)$/.test(M)?(Y(f,M),l++):Y(f,et(f))));else if(h.match(/^-.\..+=/))C=h.match(/^-([^=]+)=([\s\S]*)$/),C!==null&&Array.isArray(C)&&C.length>=3&&Y(C[1],C[2]);else if(h.match(/^-.\..+/)&&!h.match(N))M=i[l+1],C=h.match(/^-(.\..+)/),C!==null&&Array.isArray(C)&&C.length>=2&&(f=C[1],M!==void 0&&!M.match(/^-/)&&!D(f,m.bools)&&!D(f,m.counts)?(Y(f,M),l++):Y(f,et(f)));else if(h.match(/^-[^-]+/)&&!h.match(N)){P=h.slice(1,-1).split(""),w=!1;for(let dt=0;dt<P.length;dt++){if(M=h.slice(dt+2),P[dt+1]&&P[dt+1]==="="){ct=h.slice(dt+3),f=P[dt],D(f,m.arrays)?l=At(l,f,i,ct):D(f,m.nargs)!==!1?l=ht(l,f,i,ct):Y(f,ct),w=!0;break}if(M==="-"){Y(P[dt],M);continue}if(/[A-Za-z]/.test(P[dt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(M)&&D(M,m.bools)===!1){Y(P[dt],M),w=!0;break}if(P[dt+1]&&P[dt+1].match(/\W/)){Y(P[dt],M),w=!0;break}else Y(P[dt],et(P[dt]))}f=h.slice(-1)[0],!w&&f!=="-"&&(D(f,m.arrays)?l=At(l,f,i):D(f,m.nargs)!==!1?l=ht(l,f,i):(M=i[l+1],M!==void 0&&(!/^(-|--)[^-]/.test(M)||M.match(N))&&!D(f,m.bools)&&!D(f,m.counts)||/^(true|false)$/.test(M)?(Y(f,M),l++):Y(f,et(f))))}else if(h.match(/^-[0-9]$/)&&h.match(N)&&D(h.slice(1),m.bools))f=h.slice(1),Y(f,et(f));else if(h==="--"){T=i.slice(l+1);break}else if(c["halt-at-non-option"]){T=i.slice(l);break}else Z(h)}H(W,!0),H(W,!1),L(W),ot(),k(W,m.aliases,p,!0),at(W),c["set-placeholder-key"]&&Qt(W),Object.keys(m.counts).forEach(function(l){Ut(W,l.split("."))||Y(l,0)}),u&&T.length&&(W[g]=[]),T.forEach(function(l){W[g].push(l)}),c["camel-case-expansion"]&&c["strip-dashed"]&&Object.keys(W).filter(l=>l!=="--"&&l.includes("-")).forEach(l=>{delete W[l]}),c["strip-aliased"]&&[].concat(...Object.keys(o).map(l=>o[l])).forEach(l=>{c["camel-case-expansion"]&&l.includes("-")&&delete W[l.split(".").map(h=>te(h)).join(".")],delete W[l]});function Z(l){let h=I("_",l);(typeof h=="string"||typeof h=="number")&&W._.push(h)}function ht(l,h,A,w){let f,P=D(h,m.nargs);if(P=typeof P!="number"||isNaN(P)?1:P,P===0)return vt(w)||(R=Error(E("Argument unexpected for: %s",h))),Y(h,et(h)),l;let C=vt(w)?0:1;if(c["nargs-eats-options"])A.length-(l+1)+C<P&&(R=Error(E("Not enough arguments following: %s",h))),C=P;else{for(f=l+1;f<A.length&&(!A[f].match(/^-[^0-9]/)||A[f].match(N)||tt(A[f]));f++)C++;C<P&&(R=Error(E("Not enough arguments following: %s",h)))}let M=Math.min(C,P);for(!vt(w)&&M>0&&(Y(h,w),M--),f=l+1;f<M+l+1;f++)Y(h,A[f]);return l+M}function At(l,h,A,w){let f=[],P=w||A[l+1],C=D(h,m.nargs);if(D(h,m.bools)&&!/^(true|false)$/.test(P))f.push(!0);else if(vt(P)||vt(w)&&/^-/.test(P)&&!N.test(P)&&!tt(P)){if(p[h]!==void 0){let M=p[h];f=Array.isArray(M)?M:[M]}}else{vt(w)||f.push(O(h,w,!0));for(let M=l+1;M<A.length&&!(!c["greedy-arrays"]&&f.length>0||C&&typeof C=="number"&&f.length>=C||(P=A[M],/^-/.test(P)&&!N.test(P)&&!tt(P)));M++)l=M,f.push(O(h,P,s))}return typeof C=="number"&&(C&&f.length<C||isNaN(C)&&f.length===0)&&(R=Error(E("Not enough arguments following: %s",h))),Y(h,f),l}function Y(l,h,A=s){if(/-/.test(l)&&c["camel-case-expansion"]){let P=l.split(".").map(function(C){return te(C)}).join(".");j(l,P)}let w=O(l,h,A),f=l.split(".");Tt(W,f,w),m.aliases[l]&&m.aliases[l].forEach(function(P){let C=P.split(".");Tt(W,C,w)}),f.length>1&&c["dot-notation"]&&(m.aliases[f[0]]||[]).forEach(function(P){let C=P.split("."),M=[].concat(f);M.shift(),C=C.concat(M),(m.aliases[l]||[]).includes(C.join("."))||Tt(W,C,w)}),D(l,m.normalize)&&!D(l,m.arrays)&&[l].concat(m.aliases[l]||[]).forEach(function(C){Object.defineProperty(ft,C,{enumerable:!0,get(){return h},set(M){h=typeof M=="string"?Rt.normalize(M):M}})})}function j(l,h){m.aliases[l]&&m.aliases[l].length||(m.aliases[l]=[h],y[h]=!0),m.aliases[h]&&m.aliases[h].length||j(h,l)}function O(l,h,A){A&&(h=ja(h)),(D(l,m.bools)||D(l,m.counts))&&typeof h=="string"&&(h=h==="true");let w=Array.isArray(h)?h.map(function(f){return I(l,f)}):I(l,h);return D(l,m.counts)&&(vt(w)||typeof w=="boolean")&&(w=lr()),D(l,m.normalize)&&D(l,m.arrays)&&(Array.isArray(h)?w=h.map(f=>Rt.normalize(f)):w=Rt.normalize(h)),w}function I(l,h){return!c["parse-positional-numbers"]&&l==="_"||!D(l,m.strings)&&!D(l,m.bools)&&!Array.isArray(h)&&(ke(h)&&c["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${h}`)))||!vt(h)&&D(l,m.numbers))&&(h=Number(h)),h}function L(l){let h=Object.create(null);k(h,m.aliases,p),Object.keys(m.configs).forEach(function(A){let w=l[A]||h[A];if(w)try{let f=null,P=Rt.resolve(Rt.cwd(),w),C=m.configs[A];if(typeof C=="function"){try{f=C(P)}catch(M){f=M}if(f instanceof Error){R=f;return}}else f=Rt.require(P);q(f)}catch(f){f.name==="PermissionDenied"?R=f:l[A]&&(R=Error(E("Invalid JSON config file: %s",w)))}})}function q(l,h){Object.keys(l).forEach(function(A){let w=l[A],f=h?h+"."+A:A;typeof w=="object"&&w!==null&&!Array.isArray(w)&&c["dot-notation"]?q(w,f):(!Ut(W,f.split("."))||D(f,m.arrays)&&c["combine-arrays"])&&Y(f,w)})}function ot(){typeof b<"u"&&b.forEach(function(l){q(l)})}function H(l,h){if(typeof d>"u")return;let A=typeof d=="string"?d:"",w=Rt.env();Object.keys(w).forEach(function(f){if(A===""||f.lastIndexOf(A,0)===0){let P=f.split("__").map(function(C,M){return M===0&&(C=C.substring(A.length)),te(C)});(h&&m.configs[P.join(".")]||!h)&&!Ut(l,P)&&Y(P.join("."),w[f])}})}function at(l){let h,A=new Set;Object.keys(l).forEach(function(w){if(!A.has(w)&&(h=D(w,m.coercions),typeof h=="function"))try{let f=I(w,h(l[w]));[].concat(m.aliases[w]||[],w).forEach(P=>{A.add(P),l[P]=f})}catch(f){R=f}})}function Qt(l){return m.keys.forEach(h=>{~h.indexOf(".")||typeof l[h]>"u"&&(l[h]=void 0)}),l}function k(l,h,A,w=!1){Object.keys(A).forEach(function(f){Ut(l,f.split("."))||(Tt(l,f.split("."),A[f]),w&&(x[f]=!0),(h[f]||[]).forEach(function(P){Ut(l,P.split("."))||Tt(l,P.split("."),A[f])}))})}function Ut(l,h){let A=l;c["dot-notation"]||(h=[h.join(".")]),h.slice(0,-1).forEach(function(f){A=A[f]||{}});let w=h[h.length-1];return typeof A!="object"?!1:w in A}function Tt(l,h,A){let w=l;c["dot-notation"]||(h=[h.join(".")]),h.slice(0,-1).forEach(function(ct){ct=Si(ct),typeof w=="object"&&w[ct]===void 0&&(w[ct]={}),typeof w[ct]!="object"||Array.isArray(w[ct])?(Array.isArray(w[ct])?w[ct].push({}):w[ct]=[w[ct],{}],w=w[ct][w[ct].length-1]):w=w[ct]});let f=Si(h[h.length-1]),P=D(h.join("."),m.arrays),C=Array.isArray(A),M=c["duplicate-arguments-array"];!M&&D(f,m.nargs)&&(M=!0,(!vt(w[f])&&m.nargs[f]===1||Array.isArray(w[f])&&w[f].length===m.nargs[f])&&(w[f]=void 0)),A===lr()?w[f]=lr(w[f]):Array.isArray(w[f])?M&&P&&C?w[f]=c["flatten-duplicate-arrays"]?w[f].concat(A):(Array.isArray(w[f][0])?w[f]:[w[f]]).concat([A]):!M&&!!P==!!C?w[f]=A:w[f]=w[f].concat([A]):w[f]===void 0&&P?w[f]=C?A:[A]:M&&!(w[f]===void 0||D(f,m.counts)||D(f,m.bools))?w[f]=[w[f],A]:w[f]=A}function Xt(...l){l.forEach(function(h){Object.keys(h||{}).forEach(function(A){m.aliases[A]||(m.aliases[A]=[].concat(o[A]||[]),m.aliases[A].concat(A).forEach(function(w){if(/-/.test(w)&&c["camel-case-expansion"]){let f=te(w);f!==A&&m.aliases[A].indexOf(f)===-1&&(m.aliases[A].push(f),y[f]=!0)}}),m.aliases[A].concat(A).forEach(function(w){if(w.length>1&&/[A-Z]/.test(w)&&c["camel-case-expansion"]){let f=Ze(w,"-");f!==A&&m.aliases[A].indexOf(f)===-1&&(m.aliases[A].push(f),y[f]=!0)}}),m.aliases[A].forEach(function(w){m.aliases[w]=[A].concat(m.aliases[A].filter(function(f){return w!==f}))}))})})}function D(l,h){let A=[].concat(m.aliases[l]||[],l),w=Object.keys(h),f=A.find(P=>w.includes(P));return f?h[f]:!1}function bn(l){let h=Object.keys(m);return[].concat(h.map(w=>m[w])).some(function(w){return Array.isArray(w)?w.includes(l):w[l]})}function $(l,...h){return[].concat(...h).some(function(w){let f=l.match(w);return f&&bn(f[1])})}function X(l){if(l.match(N)||!l.match(/^-[^-]+/))return!1;let h=!0,A,w=l.slice(1).split("");for(let f=0;f<w.length;f++){if(A=l.slice(f+2),!bn(w[f])){h=!1;break}if(w[f+1]&&w[f+1]==="="||A==="-"||/[A-Za-z]/.test(w[f])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(A)||w[f+1]&&w[f+1].match(/\W/))break}return h}function tt(l){return c["unknown-options-as-args"]&&V(l)}function V(l){return l=l.replace(/^-{3,}/,"--"),l.match(N)||X(l)?!1:!$(l,/^-+([^=]+?)=[\s\S]*$/,F,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function et(l){return!D(l,m.bools)&&!D(l,m.counts)&&`${l}`in p?p[l]:it(jt(l))}function it(l){return{[Ct.BOOLEAN]:!0,[Ct.STRING]:"",[Ct.NUMBER]:void 0,[Ct.ARRAY]:[]}[l]}function jt(l){let h=Ct.BOOLEAN;return D(l,m.strings)?h=Ct.STRING:D(l,m.numbers)?h=Ct.NUMBER:D(l,m.bools)?h=Ct.BOOLEAN:D(l,m.arrays)&&(h=Ct.ARRAY),h}function vt(l){return l===void 0}function ze(){Object.keys(m.counts).find(l=>D(l,m.arrays)?(R=Error(E("Invalid configuration: %s, opts.count excludes opts.array.",l)),!0):D(l,m.nargs)?(R=Error(E("Invalid configuration: %s, opts.count excludes opts.narg.",l)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(ft,W),configuration:c,defaulted:Object.assign({},x),error:R,newAliases:Object.assign({},y)}}};function Pa(r){let t=[],e=Object.create(null),n=!0;for(Object.keys(r).forEach(function(i){t.push([].concat(r[i],i))});n;){n=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(t[i].filter(function(c){return t[s].indexOf(c)!==-1}).length){t[i]=t[i].concat(t[s]),t.splice(s,1),n=!0;break}}return t.forEach(function(i){i=i.filter(function(o,c,p){return p.indexOf(o)===c});let s=i.pop();s!==void 0&&typeof s=="string"&&(e[s]=i)}),e}function lr(r){return r!==void 0?r+1:1}function Si(r){return r==="__proto__"?"___proto___":r}function ja(r){return typeof r=="string"&&(r[0]==="'"||r[0]==='"')&&r[r.length-1]===r[0]?r.substring(1,r.length-1):r}var vi=B("fs");var fr,hr,ur,Ii=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Pi=(hr=(fr=process==null?void 0:process.versions)===null||fr===void 0?void 0:fr.node)!==null&&hr!==void 0?hr:(ur=process==null?void 0:process.version)===null||ur===void 0?void 0:ur.slice(1);if(Pi&&Number(Pi.match(/^([^.]+)/)[1])<Ii)throw Error(`yargs parser supports a minimum Node.js version of ${Ii}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var va=process?process.env:{},Mi=new tn({cwd:process.cwd,env:()=>va,format:ji.format,normalize:en.normalize,resolve:en.resolve,require:r=>{if(typeof B<"u")return B(r);if(r.match(/\.json$/))return JSON.parse((0,vi.readFileSync)(r,"utf8"));throw Error("only .json config files are supported in ESM")}}),$e=function(t,e){return Mi.parse(t.slice(),e).argv};$e.detailed=function(r,t){return Mi.parse(r.slice(),t)};$e.camelCase=te;$e.decamelize=Ze;$e.looksLikeNumber=ke;var Ni=$e;var Nt=B("path");function Ma(){return Na()?0:1}function Na(){return $a()&&!process.defaultApp}function $a(){return!!process.versions.electron}function $i(){return process.argv[Ma()]}var J=class r extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,r)}};var Ae=B("fs"),Fi=B("util"),Di=B("path"),Ui={fs:{readFileSync:Ae.readFileSync,writeFile:Ae.writeFile},format:Fi.format,resolve:Di.resolve,exists:r=>{try{return(0,Ae.statSync)(r).isFile()}catch{return!1}}};var Mt,dr=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let e=t.shift(),n=function(){};return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Mt.format.apply(Mt.format,[this.cache[this.locale][e]||e].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),i=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?e:n;this.cache[this.locale][e]&&(o=this.cache[this.locale][e][i===1?"one":"other"]),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let c=[o];return~o.indexOf("%d")&&c.push(i),Mt.format.apply(Mt.format,c.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach(function(i,s){let o=e[s+1];n+=i,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,e=this.writeQueue[0],n=e.directory,i=e.locale,s=e.cb,o=this._resolveLocaleFile(n,i),c=JSON.stringify(this.cache[i],null,2);Mt.fs.writeFile(o,c,"utf-8",function(p){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(p)})}_readLocaleFile(){let t={},e=this._resolveLocaleFile(this.directory,this.locale);try{Mt.fs.readFileSync&&(t=JSON.parse(Mt.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=Mt.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){let i=Mt.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(t){return Mt.exists(t)}};function Ti(r,t){Mt=t;let e=new dr(r);return{__:e.__.bind(e),__n:e.__n.bind(e),setLocale:e.setLocale.bind(e),getLocale:e.getLocale.bind(e),updateLocale:e.updateLocale.bind(e),locale:e.locale}}var Fa=r=>Ti(r,Ui),zi=Fa;var Ta={},Da="require is not supported by ESM",Li="loading a directory of commands is not supported yet for ESM",Fe;try{Fe=(0,Vi.fileURLToPath)(Ta.url)}catch{Fe=process.cwd()}var Ua=Fe.substring(0,Fe.lastIndexOf("node_modules")),Bi={assert:{notStrictEqual:nn.notStrictEqual,strictEqual:nn.strictEqual},cliui:cr,findUp:Ci,getEnv:r=>process.env[r],inspect:Ri.inspect,getCallerFile:()=>{throw new J(Li)},getProcessArgvBin:$i,mainFilename:Ua||process.cwd(),Parser:Ni,path:{basename:Nt.basename,dirname:Nt.dirname,extname:Nt.extname,relative:Nt.relative,resolve:Nt.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(r,t)=>process.emitWarning(r,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Wi.readFileSync,require:()=>{throw new J(Da)},requireDirectory:()=>{throw new J(Li)},stringWidth:r=>[...r].length,y18n:zi({directory:(0,Nt.resolve)(Fe,"../../../locales"),updateFiles:!1})};function pt(r,t,e,n){e.assert.notStrictEqual(r,t,n)}function pr(r,t){t.assert.strictEqual(typeof r,"string")}function Oe(r){return Object.keys(r)}function Q(r){return!!r&&!!r.then&&typeof r.then=="function"}function Ht(r){let e=r.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${r}`);let s={cmd:i.replace(n,""),demanded:[],optional:[]};return e.forEach((o,c)=>{let p=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&c===e.length-1&&(p=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(n,"").split("|"),variadic:p}):s.demanded.push({cmd:o.replace(n,"").split("|"),variadic:p})}),s}var za=["first","second","third","fourth","fifth","sixth"];function _(r,t,e){function n(){return typeof r=="object"?[{demanded:[],optional:[]},r,t]:[Ht(`cmd ${r}`),t,e]}try{let i=0,[s,o,c]=n(),p=[].slice.call(o);for(;p.length&&p[p.length-1]===void 0;)p.pop();let b=c||p.length;if(b<s.demanded.length)throw new J(`Not enough arguments provided. Expected ${s.demanded.length} but received ${p.length}.`);let d=s.demanded.length+s.optional.length;if(b>d)throw new J(`Too many arguments provided. Expected max ${d} but received ${b}.`);s.demanded.forEach(u=>{let g=p.shift(),y=Hi(g);u.cmd.filter(E=>E===y||E==="*").length===0&&qi(y,u.cmd,i),i+=1}),s.optional.forEach(u=>{if(p.length===0)return;let g=p.shift(),y=Hi(g);u.cmd.filter(E=>E===y||E==="*").length===0&&qi(y,u.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Hi(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function qi(r,t,e){throw new J(`Invalid ${za[e]||"manyith"} argument. Expected ${t.join(" or ")} but received ${r}.`)}var rn=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,i=!1){if(_("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=e,o.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=e,s.global=n,s.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...n[e]||[],e];return i.option?!s.includes(i.option):!0}),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function Gi(r){return r?r.map(t=>(t.applyBeforeValidation=!1,t)):[]}function ee(r,t,e,n){return e.reduce((i,s)=>{if(s.applyBeforeValidation!==n)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(Q(i))return i.then(o=>Promise.all([o,s(o,t)])).then(([o,c])=>Object.assign(o,c));{let o=s(i,t);return Q(o)?o.then(c=>Object.assign(i,c)):Object.assign(i,o)}},r)}function ne(r,t,e=n=>{throw n}){try{let n=La(r)?r():r;return Q(n)?n.then(i=>t(i)):t(n)}catch(n){return e(n)}}function La(r){return typeof r=="function"}function mr(r){if(typeof B>"u")return null;for(let t=0,e=Object.keys(B.cache),n;t<e.length;t++)if(n=B.cache[e[t]],n.exports===r)return n;return null}var Ce=/(^\*)|(^\$0)/,gr=class{constructor(t,e,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:o=>o;i.visit=(o,c,p)=>{let b=s(o,c,p);if(b){if(this.requireCache.has(c))return b;this.requireCache.add(c),this.addHandler(b)}return b},this.shim.requireDirectory({require:e,filename:n},t,i)}addHandler(t,e,n,i,s,o){let c=[],p=Gi(s);if(i=i||(()=>{}),Array.isArray(t))if(Ra(t))[t,...c]=t;else for(let b of t)this.addHandler(b);else if(Va(t)){let b=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(b=[].concat(b).concat(t.aliases)),this.addHandler(b,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(Yi(n)){this.addHandler([t].concat(c),e,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){let b=Ht(t);c=c.map(g=>Ht(g).cmd);let d=!1,u=[b.cmd].concat(c).filter(g=>Ce.test(g)?(d=!0,!1):!0);u.length===0&&d&&u.push("$0"),d&&(b.cmd=u[0],c=u.slice(1),t=t.replace(Ce,b.cmd)),c.forEach(g=>{this.aliasMap[g]=b.cmd}),e!==!1&&this.usage.command(t,e,d,c,o),this.handlers[b.cmd]={original:t,description:e,handler:i,builder:n||{},middlewares:p,deprecated:o,demanded:b.demanded,optional:b.optional},d&&(this.defaultCommand=this.handlers[b.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,i,s,o){let c=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,p=e.getInternalMethods().getContext(),b=p.commands.slice(),d=!t;t&&(p.commands.push(t),p.fullCommands.push(c.original));let u=this.applyBuilderUpdateUsageAndParse(d,c,e,n.aliases,b,i,s,o);return Q(u)?u.then(g=>this.applyMiddlewareAndGetResult(d,c,g.innerArgv,p,s,g.aliases,e)):this.applyMiddlewareAndGetResult(d,c,u.innerArgv,p,s,u.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,i,s,o,c,p){let b=e.builder,d=n;if(sn(b)){n.getInternalMethods().getUsageInstance().freeze();let u=b(n.getInternalMethods().reset(i),p);if(Q(u))return u.then(g=>(d=Ji(g)?g:n,this.parseAndUpdateUsage(t,e,d,s,o,c)))}else Wa(b)&&(n.getInternalMethods().getUsageInstance().freeze(),d=n.getInternalMethods().reset(i),Object.keys(e.builder).forEach(u=>{d.option(u,b[u])}));return this.parseAndUpdateUsage(t,e,d,s,o,c)}parseAndUpdateUsage(t,e,n,i,s,o){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);let c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return Q(c)?c.then(p=>({aliases:n.parsed.aliases,innerArgv:p})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,e){let n=Ce.test(e.original)?e.original.replace(Ce,"").trim():e.original,i=t.filter(s=>!Ce.test(s));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,e,n,i,s,o,c,p){if(!o.getInternalMethods().getHasOutput()){let b=o.getInternalMethods().runValidation(s,p,o.parsed.error,t);n=ne(n,d=>(b(d),d))}if(e.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let b=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(n,b,!1,!1),n=ee(n,o,c,!1),n=ne(n,d=>{let u=e.handler(d);return Q(u)?u.then(()=>d):d}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Q(n)&&!o.getInternalMethods().hasParseCallback()&&n.catch(d=>{try{o.getInternalMethods().getUsageInstance().fail(null,d)}catch{}})}return t||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,i,s,o,c){let p={};if(s)return n;c.getInternalMethods().getHasOutput()||(p=this.populatePositionals(e,n,i,c));let b=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),d=ee(n,c,b,!0);return Q(d)?d.then(u=>this.handleValidationAndGetResult(t,e,u,i,o,c,b,p)):this.handleValidationAndGetResult(t,e,d,i,o,c,b,p)}populatePositionals(t,e,n,i){e._=e._.slice(n.commands.length);let s=t.demanded.slice(0),o=t.optional.slice(0),c={};for(this.validation.positionalCount(s.length,e._.length);s.length;){let p=s.shift();this.populatePositional(p,e,c)}for(;o.length;){let p=o.shift();this.populatePositional(p,e,c)}return e._=n.commands.concat(e._.map(p=>""+p)),this.postProcessPositionals(e,c,this.cmdToParseOptions(t.original),i),c}populatePositional(t,e,n){let i=t.cmd[0];t.variadic?n[i]=e._.splice(0).map(String):e._.length&&(n[i]=[String(e._.shift())])}cmdToParseOptions(t){let e={array:[],default:{},alias:{},demand:{}},n=Ht(t);return n.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=o,e.demand[s]=!0}),n.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=o}),e}postProcessPositionals(t,e,n,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(let b of Object.keys(n.alias))s.alias[b]=(s.alias[b]||[]).concat(n.alias[b]);s.array=s.array.concat(n.array),s.config={};let o=[];if(Object.keys(e).forEach(b=>{e[b].map(d=>{s.configuration["unknown-options-as-args"]&&(s.key[b]=!0),o.push(`--${b}`),o.push(d)})}),!o.length)return;let c=Object.assign({},s.configuration,{"populate--":!1}),p=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:c}));if(p.error)i.getInternalMethods().getUsageInstance().fail(p.error.message,p.error);else{let b=Object.keys(e);Object.keys(e).forEach(d=>{b.push(...p.aliases[d])}),Object.keys(p.argv).forEach(d=>{b.includes(d)&&(e[d]||(e[d]=p.argv[d]),!this.isInConfigs(i,d)&&!this.isDefaulted(i,d)&&Object.prototype.hasOwnProperty.call(t,d)&&Object.prototype.hasOwnProperty.call(p.argv,d)&&(Array.isArray(t[d])||Array.isArray(p.argv[d]))?t[d]=[].concat(t[d],p.argv[d]):t[d]=p.argv[d])})}}isDefaulted(t,e){let{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){let{configObjects:n}=t.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,e))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(e)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let n=Ce.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let e=this.defaultCommand.builder;if(sn(e))return e(t,!0);Yi(e)||Object.keys(e).forEach(n=>{t.option(n,e[n])})}moduleName(t){let e=mr(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(let i of[t,e,n]){if(typeof i=="string"||i===!1)return i;pt(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();pt(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Ki(r,t,e,n){return new gr(r,t,e,n)}function Yi(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function Ra(r){return r.every(t=>typeof t=="string")}function sn(r){return typeof r=="function"}function Wa(r){return typeof r=="object"}function Va(r){return typeof r=="object"&&!Array.isArray(r)}function qt(r={},t=()=>!0){let e={};return Oe(r).forEach(n=>{t(n,r[n])&&(e[n]=r[n])}),e}function Gt(r){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let e=t;e._handle&&e.isTTY&&typeof e._handle.setBlocking=="function"&&e._handle.setBlocking(r)})}function Ba(r){return typeof r=="boolean"}function Xi(r,t){let e=t.y18n.__,n={},i=[];n.failFn=function(O){i.push(O)};let s=null,o=null,c=!0;n.showHelpOnFail=function(O=!0,I){let[L,q]=typeof O=="string"?[!0,O]:[O,I];return r.getInternalMethods().isGlobalContext()&&(o=q),s=q,c=L,n};let p=!1;n.fail=function(O,I){let L=r.getInternalMethods().getLoggerInstance();if(i.length)for(let q=i.length-1;q>=0;--q){let ot=i[q];if(Ba(ot)){if(I)throw I;if(O)throw Error(O)}else ot(O,I,n)}else{if(r.getExitProcess()&&Gt(!0),!p){p=!0,c&&(r.showHelp("error"),L.error()),(O||I)&&L.error(O||I);let q=s||o;q&&((O||I)&&L.error(""),L.error(q))}if(I=I||new J(O),r.getExitProcess())return r.exit(1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,I);throw I}};let b=[],d=!1;n.usage=(j,O)=>j===null?(d=!0,b=[],n):(d=!1,b.push([j,O||""]),n),n.getUsage=()=>b,n.getUsageDisabled=()=>d,n.getPositionalGroupName=()=>e("Positionals:");let u=[];n.example=(j,O)=>{u.push([j,O||""])};let g=[];n.command=function(O,I,L,q,ot=!1){L&&(g=g.map(H=>(H[2]=!1,H))),g.push([O,I||"",L,q,ot])},n.getCommands=()=>g;let y={};n.describe=function(O,I){Array.isArray(O)?O.forEach(L=>{n.describe(L,I)}):typeof O=="object"?Object.keys(O).forEach(L=>{n.describe(L,O[L])}):y[O]=I},n.getDescriptions=()=>y;let x=[];n.epilog=j=>{x.push(j)};let E=!1,m;n.wrap=j=>{E=!0,m=j},n.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(E||(m=ht(),E=!0),m);let N="__yargsString__:";n.deferY18nLookup=j=>N+j,n.help=function(){if(T)return T;R();let O=r.customScriptName?r.$0:t.path.basename(r.$0),I=r.getDemandedOptions(),L=r.getDemandedCommands(),q=r.getDeprecatedOptions(),ot=r.getGroups(),H=r.getOptions(),at=[];at=at.concat(Object.keys(y)),at=at.concat(Object.keys(I)),at=at.concat(Object.keys(L)),at=at.concat(Object.keys(H.default)),at=at.filter(ft),at=Object.keys(at.reduce(($,X)=>(X!=="_"&&($[X]=!0),$),{}));let Qt=n.getWrap(),k=t.cliui({width:Qt,wrap:!!Qt});if(!d){if(b.length)b.forEach($=>{k.div({text:`${$[0].replace(/\$0/g,O)}`}),$[1]&&k.div({text:`${$[1]}`,padding:[1,0,0,0]})}),k.div();else if(g.length){let $=null;L._?$=`${O} <${e("command")}>
9
9
  `:$=`${O} [${e("command")}]
10
- `,k.div(`${$}`)}}if(g.length>1||g.length===1&&!g[0][2]){k.div(e("Commands:"));let $=r.getInternalMethods().getContext(),X=$.commands.length?`${$.commands.join(" ")} `:"";r.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(g=g.sort((B,et)=>B[0].localeCompare(et[0])));let tt=O?`${O} `:"";g.forEach(B=>{let et=`${tt}${X}${B[0].replace(/^\$0 ?/,"")}`;k.span({text:et,padding:[0,2,0,2],width:F(g,Qt,`${O}${X}`)+4},{text:B[1]});let it=[];B[2]&&it.push(`[${e("default")}]`),B[3]&&B[3].length&&it.push(`[${e("aliases:")} ${B[3].join(", ")}]`),B[4]&&(typeof B[4]=="string"?it.push(`[${e("deprecated: %s",B[4])}]`):it.push(`[${e("deprecated")}]`)),it.length?k.div({text:it.join(" "),padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}let Tt=(Object.keys(V.alias)||[]).concat(Object.keys(r.parsed.newAliases)||[]);at=at.filter($=>!r.parsed.newAliases[$]&&Tt.every(X=>(V.alias[X]||[]).indexOf($)===-1));let Dt=e("Options:");ot[Dt]||(ot[Dt]=[]),W(at,V.alias,ot,Dt);let Xt=$=>/^--/.test(sn($)),U=Object.keys(ot).filter($=>ot[$].length>0).map($=>{let X=ot[$].filter(ft).map(tt=>{if(Tt.includes(tt))return tt;for(let B=0,et;(et=Tt[B])!==void 0;B++)if((V.alias[et]||[]).includes(tt))return et;return tt});return{groupName:$,normalizedKeys:X}}).filter(({normalizedKeys:$})=>$.length>0).map(({groupName:$,normalizedKeys:X})=>{let tt=X.reduce((B,et)=>(B[et]=[et].concat(V.alias[et]||[]).map(it=>$===n.getPositionalGroupName()?it:(/^[0-9]$/.test(it)?V.boolean.includes(et)?"-":"--":it.length>1?"--":"-")+it).sort((it,jt)=>Xt(it)===Xt(jt)?0:Xt(it)?1:-1).join(", "),B),{});return{groupName:$,normalizedKeys:X,switches:tt}});if(U.filter(({groupName:$})=>$!==n.getPositionalGroupName()).some(({normalizedKeys:$,switches:X})=>!$.every(tt=>Xt(X[tt])))&&U.filter(({groupName:$})=>$!==n.getPositionalGroupName()).forEach(({normalizedKeys:$,switches:X})=>{$.forEach(tt=>{Xt(X[tt])&&(X[tt]=Ba(X[tt],4))})}),U.forEach(({groupName:$,normalizedKeys:X,switches:tt})=>{k.div($),X.forEach(B=>{let et=tt[B],it=y[B]||"",jt=null;it.includes(N)&&(it=e(it.substring(N.length))),V.boolean.includes(B)&&(jt=`[${e("boolean")}]`),V.count.includes(B)&&(jt=`[${e("count")}]`),V.string.includes(B)&&(jt=`[${e("string")}]`),V.normalize.includes(B)&&(jt=`[${e("string")}]`),V.array.includes(B)&&(jt=`[${e("array")}]`),V.number.includes(B)&&(jt=`[${e("number")}]`);let vt=u=>typeof u=="string"?`[${e("deprecated: %s",u)}]`:`[${e("deprecated")}]`,De=[B in H?vt(H[B]):null,jt,B in I?`[${e("required")}]`:null,V.choices&&V.choices[B]?`[${e("choices:")} ${n.stringifiedValues(V.choices[B])}]`:null,Z(V.default[B],V.defaultDescription[B])].filter(Boolean).join(" ");k.span({text:sn(et),padding:[0,2,0,2+Ki(et)],width:F(tt,Qt)+4},it);let l=r.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;De&&!l?k.div({text:De,padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}),h.length&&(k.div(e("Examples:")),h.forEach($=>{$[0]=$[0].replace(/\$0/g,O)}),h.forEach($=>{$[1]===""?k.div({text:$[0],padding:[0,2,0,2]}):k.div({text:$[0],padding:[0,2,0,2],width:F(h,Qt)+4},{text:$[1]})}),k.div()),x.length>0){let $=x.map(X=>X.replace(/\$0/g,O)).join(`
10
+ `,k.div(`${$}`)}}if(g.length>1||g.length===1&&!g[0][2]){k.div(e("Commands:"));let $=r.getInternalMethods().getContext(),X=$.commands.length?`${$.commands.join(" ")} `:"";r.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(g=g.sort((V,et)=>V[0].localeCompare(et[0])));let tt=O?`${O} `:"";g.forEach(V=>{let et=`${tt}${X}${V[0].replace(/^\$0 ?/,"")}`;k.span({text:et,padding:[0,2,0,2],width:F(g,Qt,`${O}${X}`)+4},{text:V[1]});let it=[];V[2]&&it.push(`[${e("default")}]`),V[3]&&V[3].length&&it.push(`[${e("aliases:")} ${V[3].join(", ")}]`),V[4]&&(typeof V[4]=="string"?it.push(`[${e("deprecated: %s",V[4])}]`):it.push(`[${e("deprecated")}]`)),it.length?k.div({text:it.join(" "),padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}let Ut=(Object.keys(H.alias)||[]).concat(Object.keys(r.parsed.newAliases)||[]);at=at.filter($=>!r.parsed.newAliases[$]&&Ut.every(X=>(H.alias[X]||[]).indexOf($)===-1));let Tt=e("Options:");ot[Tt]||(ot[Tt]=[]),W(at,H.alias,ot,Tt);let Xt=$=>/^--/.test(on($)),D=Object.keys(ot).filter($=>ot[$].length>0).map($=>{let X=ot[$].filter(ft).map(tt=>{if(Ut.includes(tt))return tt;for(let V=0,et;(et=Ut[V])!==void 0;V++)if((H.alias[et]||[]).includes(tt))return et;return tt});return{groupName:$,normalizedKeys:X}}).filter(({normalizedKeys:$})=>$.length>0).map(({groupName:$,normalizedKeys:X})=>{let tt=X.reduce((V,et)=>(V[et]=[et].concat(H.alias[et]||[]).map(it=>$===n.getPositionalGroupName()?it:(/^[0-9]$/.test(it)?H.boolean.includes(et)?"-":"--":it.length>1?"--":"-")+it).sort((it,jt)=>Xt(it)===Xt(jt)?0:Xt(it)?1:-1).join(", "),V),{});return{groupName:$,normalizedKeys:X,switches:tt}});if(D.filter(({groupName:$})=>$!==n.getPositionalGroupName()).some(({normalizedKeys:$,switches:X})=>!$.every(tt=>Xt(X[tt])))&&D.filter(({groupName:$})=>$!==n.getPositionalGroupName()).forEach(({normalizedKeys:$,switches:X})=>{$.forEach(tt=>{Xt(X[tt])&&(X[tt]=Ha(X[tt],4))})}),D.forEach(({groupName:$,normalizedKeys:X,switches:tt})=>{k.div($),X.forEach(V=>{let et=tt[V],it=y[V]||"",jt=null;it.includes(N)&&(it=e(it.substring(N.length))),H.boolean.includes(V)&&(jt=`[${e("boolean")}]`),H.count.includes(V)&&(jt=`[${e("count")}]`),H.string.includes(V)&&(jt=`[${e("string")}]`),H.normalize.includes(V)&&(jt=`[${e("string")}]`),H.array.includes(V)&&(jt=`[${e("array")}]`),H.number.includes(V)&&(jt=`[${e("number")}]`);let vt=h=>typeof h=="string"?`[${e("deprecated: %s",h)}]`:`[${e("deprecated")}]`,ze=[V in q?vt(q[V]):null,jt,V in I?`[${e("required")}]`:null,H.choices&&H.choices[V]?`[${e("choices:")} ${n.stringifiedValues(H.choices[V])}]`:null,Z(H.default[V],H.defaultDescription[V])].filter(Boolean).join(" ");k.span({text:on(et),padding:[0,2,0,2+Qi(et)],width:F(tt,Qt)+4},it);let l=r.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;ze&&!l?k.div({text:ze,padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}),u.length&&(k.div(e("Examples:")),u.forEach($=>{$[0]=$[0].replace(/\$0/g,O)}),u.forEach($=>{$[1]===""?k.div({text:$[0],padding:[0,2,0,2]}):k.div({text:$[0],padding:[0,2,0,2],width:F(u,Qt)+4},{text:$[1]})}),k.div()),x.length>0){let $=x.map(X=>X.replace(/\$0/g,O)).join(`
11
11
  `);k.div(`${$}
12
- `)}return k.toString().replace(/\s*$/,"")};function F(j,O,I){let z=0;return Array.isArray(j)||(j=Object.values(j).map(H=>[H])),j.forEach(H=>{z=Math.max(t.stringWidth(I?`${I} ${sn(H[0])}`:sn(H[0]))+Ki(H[0]),z)}),O&&(z=Math.min(z,parseInt((O*.5).toString(),10))),z}function R(){let j=r.getDemandedOptions(),O=r.getOptions();(Object.keys(O.alias)||[]).forEach(I=>{O.alias[I].forEach(z=>{y[z]&&n.describe(I,y[z]),z in j&&r.demandOption(I,j[z]),O.boolean.includes(z)&&r.boolean(I),O.count.includes(z)&&r.count(I),O.string.includes(z)&&r.string(I),O.normalize.includes(z)&&r.normalize(I),O.array.includes(z)&&r.array(I),O.number.includes(z)&&r.number(I)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function W(j,O,I,z){let H=[],ot=null;return Object.keys(I).forEach(V=>{H=H.concat(I[V])}),j.forEach(V=>{ot=[V].concat(O[V]),ot.some(at=>H.indexOf(at)!==-1)||I[z].push(V)}),H}function ft(j){return r.getOptions().hiddenOptions.indexOf(j)<0||r.parsed.argv[r.getOptions().showHiddenOpt]}n.showHelp=j=>{let O=r.getInternalMethods().getLoggerInstance();j||(j="error"),(typeof j=="function"?j:O[j])(n.help())},n.functionDescription=j=>["(",j.name?t.Parser.decamelize(j.name,"-"):e("generated-value"),")"].join(""),n.stringifiedValues=function(O,I){let z="",H=I||", ",ot=[].concat(O);return!O||!ot.length||ot.forEach(V=>{z.length&&(z+=H),z+=JSON.stringify(V)}),z};function Z(j,O){let I=`[${e("default:")} `;if(j===void 0&&!O)return null;if(O)I+=O;else switch(typeof j){case"string":I+=`"${j}"`;break;case"object":I+=JSON.stringify(j);break;default:I+=j}return`${I}]`}function ut(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let At=null;n.version=j=>{At=j},n.showVersion=j=>{let O=r.getInternalMethods().getLoggerInstance();j||(j="error"),(typeof j=="function"?j:O[j])(At)},n.reset=function(O){return s=null,p=!1,b=[],d=!1,x=[],h=[],g=[],y=qt(y,I=>!O[I]),n};let Y=[];return n.freeze=function(){Y.push({failMessage:s,failureOutput:p,usages:b,usageDisabled:d,epilogs:x,examples:h,commands:g,descriptions:y})},n.unfreeze=function(O=!1){let I=Y.pop();I&&(O?(y={...I.descriptions,...y},g=[...I.commands,...g],b=[...I.usages,...b],h=[...I.examples,...h],x=[...I.epilogs,...x]):{failMessage:s,failureOutput:p,usages:b,usageDisabled:d,epilogs:x,examples:h,commands:g,descriptions:y}=I)},n}function mr(r){return typeof r=="object"}function Ba(r,t){return mr(r)?{text:r.text,indentation:r.indentation+t}:{text:r,indentation:t}}function Ki(r){return mr(r)?r.indentation:0}function sn(r){return mr(r)?r.text:r}var Qi=`###-begin-{{app_name}}-completions-###
12
+ `)}return k.toString().replace(/\s*$/,"")};function F(j,O,I){let L=0;return Array.isArray(j)||(j=Object.values(j).map(q=>[q])),j.forEach(q=>{L=Math.max(t.stringWidth(I?`${I} ${on(q[0])}`:on(q[0]))+Qi(q[0]),L)}),O&&(L=Math.min(L,parseInt((O*.5).toString(),10))),L}function R(){let j=r.getDemandedOptions(),O=r.getOptions();(Object.keys(O.alias)||[]).forEach(I=>{O.alias[I].forEach(L=>{y[L]&&n.describe(I,y[L]),L in j&&r.demandOption(I,j[L]),O.boolean.includes(L)&&r.boolean(I),O.count.includes(L)&&r.count(I),O.string.includes(L)&&r.string(I),O.normalize.includes(L)&&r.normalize(I),O.array.includes(L)&&r.array(I),O.number.includes(L)&&r.number(I)})})}let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function W(j,O,I,L){let q=[],ot=null;return Object.keys(I).forEach(H=>{q=q.concat(I[H])}),j.forEach(H=>{ot=[H].concat(O[H]),ot.some(at=>q.indexOf(at)!==-1)||I[L].push(H)}),q}function ft(j){return r.getOptions().hiddenOptions.indexOf(j)<0||r.parsed.argv[r.getOptions().showHiddenOpt]}n.showHelp=j=>{let O=r.getInternalMethods().getLoggerInstance();j||(j="error"),(typeof j=="function"?j:O[j])(n.help())},n.functionDescription=j=>["(",j.name?t.Parser.decamelize(j.name,"-"):e("generated-value"),")"].join(""),n.stringifiedValues=function(O,I){let L="",q=I||", ",ot=[].concat(O);return!O||!ot.length||ot.forEach(H=>{L.length&&(L+=q),L+=JSON.stringify(H)}),L};function Z(j,O){let I=`[${e("default:")} `;if(j===void 0&&!O)return null;if(O)I+=O;else switch(typeof j){case"string":I+=`"${j}"`;break;case"object":I+=JSON.stringify(j);break;default:I+=j}return`${I}]`}function ht(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let At=null;n.version=j=>{At=j},n.showVersion=j=>{let O=r.getInternalMethods().getLoggerInstance();j||(j="error"),(typeof j=="function"?j:O[j])(At)},n.reset=function(O){return s=null,p=!1,b=[],d=!1,x=[],u=[],g=[],y=qt(y,I=>!O[I]),n};let Y=[];return n.freeze=function(){Y.push({failMessage:s,failureOutput:p,usages:b,usageDisabled:d,epilogs:x,examples:u,commands:g,descriptions:y})},n.unfreeze=function(O=!1){let I=Y.pop();I&&(O?(y={...I.descriptions,...y},g=[...I.commands,...g],b=[...I.usages,...b],u=[...I.examples,...u],x=[...I.epilogs,...x]):{failMessage:s,failureOutput:p,usages:b,usageDisabled:d,epilogs:x,examples:u,commands:g,descriptions:y}=I)},n}function br(r){return typeof r=="object"}function Ha(r,t){return br(r)?{text:r.text,indentation:r.indentation+t}:{text:r,indentation:t}}function Qi(r){return br(r)?r.indentation:0}function on(r){return br(r)?r.text:r}var Zi=`###-begin-{{app_name}}-completions-###
13
13
  #
14
14
  # yargs command completion script
15
15
  #
@@ -37,7 +37,7 @@ _{{app_name}}_yargs_completions()
37
37
  }
38
38
  complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
39
39
  ###-end-{{app_name}}-completions-###
40
- `,Xi=`#compdef {{app_name}}
40
+ `,ki=`#compdef {{app_name}}
41
41
  ###-begin-{{app_name}}-completions-###
42
42
  #
43
43
  # yargs command completion script
@@ -56,14 +56,14 @@ _{{app_name}}_yargs_completions()
56
56
  }
57
57
  compdef _{{app_name}}_yargs_completions {{app_name}}
58
58
  ###-end-{{app_name}}-completions-###
59
- `;var gr=class{constructor(t,e,n,i){var s,o,c;this.yargs=t,this.usage=e,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(c=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&c!==void 0?c:!1}defaultCompletion(t,e,n,i){let s=this.command.getCommandHandlers();for(let c=0,p=t.length;c<p;++c)if(s[t[c]]&&s[t[c]].builder){let b=s[t[c]].builder;if(rn(b)){this.indexAfterLastReset=c+1;let d=this.yargs.getInternalMethods().reset();return b(d,!0),d.argv}}let o=[];this.commandCompletions(o,t,n),this.optionCompletions(o,t,e,n),this.choicesFromOptionsCompletions(o,t,e,n),this.choicesFromPositionalsCompletions(o,t,e,n),i(null,o)}commandCompletions(t,e,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&!this.previousArgHasChoices(e)&&this.usage.getCommands().forEach(s=>{let o=Ht(s[0]).cmd;if(e.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let c=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+c)}})}optionCompletions(t,e,n,i){if((i.match(/^-/)||i===""&&t.length===0)&&!this.previousArgHasChoices(e)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(c=>{let p=!!s.configuration["boolean-negation"]&&s.boolean.includes(c);!o.includes(c)&&!s.hiddenOptions.includes(c)&&!this.argsContainKey(e,c,p)&&this.completeOptionKey(c,t,i,p&&!!s.default[c])})}}choicesFromOptionsCompletions(t,e,n,i){if(this.previousArgHasChoices(e)){let s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,e,n,i){if(i===""&&t.length>0&&this.previousArgHasChoices(e))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),c=s[n._.length-o-1];if(!c)return;let p=this.yargs.getOptions().choices[c]||[];for(let b of p)b.startsWith(i)&&t.push(b.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("-")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("-"))return;let i=e.replace(/^-+/,""),s=this.yargs.getOptions(),o=[i,...this.yargs.getAliases()[i]||[]],c;for(let p of o)if(Object.prototype.hasOwnProperty.call(s.key,p)&&Array.isArray(s.choices[p])){c=s.choices[p];break}if(c)return c.filter(p=>!n||p.startsWith(n))}previousArgHasChoices(t){let e=this.getPreviousArgChoices(t);return e!==void 0&&e.length>0}argsContainKey(t,e,n){let i=s=>t.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(e)||n&&i(`no-${e}`))return!0;if(this.aliases){for(let s of this.aliases[e])if(i(s))return!0}return!1}completeOptionKey(t,e,n,i){var s,o,c,p;let b=t;if(this.zshShell){let y=this.usage.getDescriptions(),x=(o=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[t])===null||o===void 0?void 0:o.find(N=>{let F=y[N];return typeof F=="string"&&F.length>0}),E=x?y[x]:void 0,m=(p=(c=y[t])!==null&&c!==void 0?c:E)!==null&&p!==void 0?p:"";b=`${t.replace(/:/g,"\\:")}:${m.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let d=y=>/^--/.test(y),h=y=>/^[^0-9]$/.test(y),g=!d(n)&&h(t)?"-":"--";e.push(g+b),i&&e.push(g+"no-"+b)}customCompletion(t,e,n,i){if(pt(this.customCompletionFunction,null,this.shim),Ha(this.customCompletionFunction)){let s=this.customCompletionFunction(n,e);return Q(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return qa(this.customCompletionFunction)?this.customCompletionFunction(n,e,(s=i)=>this.defaultCompletion(t,e,n,s),s=>{i(null,s)}):this.customCompletionFunction(n,e,s=>{i(null,s)})}getCompletion(t,e){let n=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),s=this.customCompletionFunction?o=>this.customCompletion(t,o,n,e):o=>this.defaultCompletion(t,o,n,e);return Q(i)?i.then(s):s(i)}generateCompletionScript(t,e){let n=this.zshShell?Xi:Qi,i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function Zi(r,t,e,n){return new gr(r,t,e,n)}function Ha(r){return r.length<3}function qa(r){return r.length>3}function ki(r,t){if(r.length===0)return t.length;if(t.length===0)return r.length;let e=[],n;for(n=0;n<=t.length;n++)e[n]=[n];let i;for(i=0;i<=r.length;i++)e[0][i]=i;for(n=1;n<=t.length;n++)for(i=1;i<=r.length;i++)t.charAt(n-1)===r.charAt(i-1)?e[n][i]=e[n-1][i-1]:n>1&&i>1&&t.charAt(n-2)===r.charAt(i-1)&&t.charAt(n-1)===r.charAt(i-2)?e[n][i]=e[n-2][i-2]+1:e[n][i]=Math.min(e[n-1][i-1]+1,Math.min(e[n][i-1]+1,e[n-1][i]+1));return e[t.length][r.length]}var ts=["$0","--","_"];function es(r,t,e){let n=e.y18n.__,i=e.y18n.__n,s={};s.nonOptionCount=function(h){let g=r.getDemandedCommands(),x=h._.length+(h["--"]?h["--"].length:0)-r.getInternalMethods().getContext().commands.length;g._&&(x<g._.min||x>g._.max)&&(x<g._.min?g._.minMsg!==void 0?t.fail(g._.minMsg?g._.minMsg.replace(/\$0/g,x.toString()).replace(/\$1/,g._.min.toString()):null):t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",x,x.toString(),g._.min.toString())):x>g._.max&&(g._.maxMsg!==void 0?t.fail(g._.maxMsg?g._.maxMsg.replace(/\$0/g,x.toString()).replace(/\$1/,g._.max.toString()):null):t.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",x,x.toString(),g._.max.toString()))))},s.positionalCount=function(h,g){g<h&&t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",g,g+"",h+""))},s.requiredArguments=function(h,g){let y=null;for(let x of Object.keys(g))(!Object.prototype.hasOwnProperty.call(h,x)||typeof h[x]>"u")&&(y=y||{},y[x]=g[x]);if(y){let x=[];for(let m of Object.keys(y)){let N=y[m];N&&x.indexOf(N)<0&&x.push(N)}let E=x.length?`
59
+ `;var wr=class{constructor(t,e,n,i){var s,o,c;this.yargs=t,this.usage=e,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(c=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&c!==void 0?c:!1}defaultCompletion(t,e,n,i){let s=this.command.getCommandHandlers();for(let c=0,p=t.length;c<p;++c)if(s[t[c]]&&s[t[c]].builder){let b=s[t[c]].builder;if(sn(b)){this.indexAfterLastReset=c+1;let d=this.yargs.getInternalMethods().reset();return b(d,!0),d.argv}}let o=[];this.commandCompletions(o,t,n),this.optionCompletions(o,t,e,n),this.choicesFromOptionsCompletions(o,t,e,n),this.choicesFromPositionalsCompletions(o,t,e,n),i(null,o)}commandCompletions(t,e,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&!this.previousArgHasChoices(e)&&this.usage.getCommands().forEach(s=>{let o=Ht(s[0]).cmd;if(e.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let c=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+c)}})}optionCompletions(t,e,n,i){if((i.match(/^-/)||i===""&&t.length===0)&&!this.previousArgHasChoices(e)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(c=>{let p=!!s.configuration["boolean-negation"]&&s.boolean.includes(c);!o.includes(c)&&!s.hiddenOptions.includes(c)&&!this.argsContainKey(e,c,p)&&this.completeOptionKey(c,t,i,p&&!!s.default[c])})}}choicesFromOptionsCompletions(t,e,n,i){if(this.previousArgHasChoices(e)){let s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,e,n,i){if(i===""&&t.length>0&&this.previousArgHasChoices(e))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),c=s[n._.length-o-1];if(!c)return;let p=this.yargs.getOptions().choices[c]||[];for(let b of p)b.startsWith(i)&&t.push(b.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("-")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("-"))return;let i=e.replace(/^-+/,""),s=this.yargs.getOptions(),o=[i,...this.yargs.getAliases()[i]||[]],c;for(let p of o)if(Object.prototype.hasOwnProperty.call(s.key,p)&&Array.isArray(s.choices[p])){c=s.choices[p];break}if(c)return c.filter(p=>!n||p.startsWith(n))}previousArgHasChoices(t){let e=this.getPreviousArgChoices(t);return e!==void 0&&e.length>0}argsContainKey(t,e,n){let i=s=>t.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(e)||n&&i(`no-${e}`))return!0;if(this.aliases){for(let s of this.aliases[e])if(i(s))return!0}return!1}completeOptionKey(t,e,n,i){var s,o,c,p;let b=t;if(this.zshShell){let y=this.usage.getDescriptions(),x=(o=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[t])===null||o===void 0?void 0:o.find(N=>{let F=y[N];return typeof F=="string"&&F.length>0}),E=x?y[x]:void 0,m=(p=(c=y[t])!==null&&c!==void 0?c:E)!==null&&p!==void 0?p:"";b=`${t.replace(/:/g,"\\:")}:${m.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let d=y=>/^--/.test(y),u=y=>/^[^0-9]$/.test(y),g=!d(n)&&u(t)?"-":"--";e.push(g+b),i&&e.push(g+"no-"+b)}customCompletion(t,e,n,i){if(pt(this.customCompletionFunction,null,this.shim),Ga(this.customCompletionFunction)){let s=this.customCompletionFunction(n,e);return Q(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return Ya(this.customCompletionFunction)?this.customCompletionFunction(n,e,(s=i)=>this.defaultCompletion(t,e,n,s),s=>{i(null,s)}):this.customCompletionFunction(n,e,s=>{i(null,s)})}getCompletion(t,e){let n=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),s=this.customCompletionFunction?o=>this.customCompletion(t,o,n,e):o=>this.defaultCompletion(t,o,n,e);return Q(i)?i.then(s):s(i)}generateCompletionScript(t,e){let n=this.zshShell?ki:Zi,i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function ts(r,t,e,n){return new wr(r,t,e,n)}function Ga(r){return r.length<3}function Ya(r){return r.length>3}function es(r,t){if(r.length===0)return t.length;if(t.length===0)return r.length;let e=[],n;for(n=0;n<=t.length;n++)e[n]=[n];let i;for(i=0;i<=r.length;i++)e[0][i]=i;for(n=1;n<=t.length;n++)for(i=1;i<=r.length;i++)t.charAt(n-1)===r.charAt(i-1)?e[n][i]=e[n-1][i-1]:n>1&&i>1&&t.charAt(n-2)===r.charAt(i-1)&&t.charAt(n-1)===r.charAt(i-2)?e[n][i]=e[n-2][i-2]+1:e[n][i]=Math.min(e[n-1][i-1]+1,Math.min(e[n][i-1]+1,e[n-1][i]+1));return e[t.length][r.length]}var ns=["$0","--","_"];function rs(r,t,e){let n=e.y18n.__,i=e.y18n.__n,s={};s.nonOptionCount=function(u){let g=r.getDemandedCommands(),x=u._.length+(u["--"]?u["--"].length:0)-r.getInternalMethods().getContext().commands.length;g._&&(x<g._.min||x>g._.max)&&(x<g._.min?g._.minMsg!==void 0?t.fail(g._.minMsg?g._.minMsg.replace(/\$0/g,x.toString()).replace(/\$1/,g._.min.toString()):null):t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",x,x.toString(),g._.min.toString())):x>g._.max&&(g._.maxMsg!==void 0?t.fail(g._.maxMsg?g._.maxMsg.replace(/\$0/g,x.toString()).replace(/\$1/,g._.max.toString()):null):t.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",x,x.toString(),g._.max.toString()))))},s.positionalCount=function(u,g){g<u&&t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",g,g+"",u+""))},s.requiredArguments=function(u,g){let y=null;for(let x of Object.keys(g))(!Object.prototype.hasOwnProperty.call(u,x)||typeof u[x]>"u")&&(y=y||{},y[x]=g[x]);if(y){let x=[];for(let m of Object.keys(y)){let N=y[m];N&&x.indexOf(N)<0&&x.push(N)}let E=x.length?`
60
60
  ${x.join(`
61
- `)}`:"";t.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(y).length,Object.keys(y).join(", ")+E))}},s.unknownArguments=function(h,g,y,x,E=!0){var m;let N=r.getInternalMethods().getCommandInstance().getCommands(),F=[],R=r.getInternalMethods().getContext();if(Object.keys(h).forEach(D=>{!ts.includes(D)&&!Object.prototype.hasOwnProperty.call(y,D)&&!Object.prototype.hasOwnProperty.call(r.getInternalMethods().getParseContext(),D)&&!s.isValidAndSomeAliasIsNotNew(D,g)&&F.push(D)}),E&&(R.commands.length>0||N.length>0||x)&&h._.slice(R.commands.length).forEach(D=>{N.includes(""+D)||F.push(""+D)}),E){let W=((m=r.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,ft=R.commands.length+W;ft<h._.length&&h._.slice(ft).forEach(Z=>{Z=String(Z),!R.commands.includes(Z)&&!F.includes(Z)&&F.push(Z)})}F.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",F.length,F.map(D=>D.trim()?D:`"${D}"`).join(", ")))},s.unknownCommands=function(h){let g=r.getInternalMethods().getCommandInstance().getCommands(),y=[],x=r.getInternalMethods().getContext();return(x.commands.length>0||g.length>0)&&h._.slice(x.commands.length).forEach(E=>{g.includes(""+E)||y.push(""+E)}),y.length>0?(t.fail(i("Unknown command: %s","Unknown commands: %s",y.length,y.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(h,g){if(!Object.prototype.hasOwnProperty.call(g,h))return!1;let y=r.parsed.newAliases;return[h,...g[h]].some(x=>!Object.prototype.hasOwnProperty.call(y,x)||!y[h])},s.limitedChoices=function(h){let g=r.getOptions(),y={};if(!Object.keys(g.choices).length)return;Object.keys(h).forEach(m=>{ts.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(g.choices,m)&&[].concat(h[m]).forEach(N=>{g.choices[m].indexOf(N)===-1&&N!==void 0&&(y[m]=(y[m]||[]).concat(N))})});let x=Object.keys(y);if(!x.length)return;let E=n("Invalid values:");x.forEach(m=>{E+=`
62
- ${n("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(y[m]),t.stringifiedValues(g.choices[m]))}`}),t.fail(E)};let o={};s.implies=function(h,g){_("<string|object> [array|number|string]",[h,g],arguments.length),typeof h=="object"?Object.keys(h).forEach(y=>{s.implies(y,h[y])}):(r.global(h),o[h]||(o[h]=[]),Array.isArray(g)?g.forEach(y=>s.implies(h,y)):(pt(g,void 0,e),o[h].push(g)))},s.getImplied=function(){return o};function c(d,h){let g=Number(h);return h=isNaN(g)?h:g,typeof h=="number"?h=d._.length>=h:h.match(/^--no-.+/)?(h=h.match(/^--no-(.+)/)[1],h=!Object.prototype.hasOwnProperty.call(d,h)):h=Object.prototype.hasOwnProperty.call(d,h),h}s.implications=function(h){let g=[];if(Object.keys(o).forEach(y=>{let x=y;(o[y]||[]).forEach(E=>{let m=x,N=E;m=c(h,m),E=c(h,E),m&&!E&&g.push(` ${x} -> ${N}`)})}),g.length){let y=`${n("Implications failed:")}
63
- `;g.forEach(x=>{y+=x}),t.fail(y)}};let p={};s.conflicts=function(h,g){_("<string|object> [array|string]",[h,g],arguments.length),typeof h=="object"?Object.keys(h).forEach(y=>{s.conflicts(y,h[y])}):(r.global(h),p[h]||(p[h]=[]),Array.isArray(g)?g.forEach(y=>s.conflicts(h,y)):p[h].push(g))},s.getConflicting=()=>p,s.conflicting=function(h){Object.keys(h).forEach(g=>{p[g]&&p[g].forEach(y=>{y&&h[g]!==void 0&&h[y]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",g,y))})}),r.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(p).forEach(g=>{p[g].forEach(y=>{y&&h[e.Parser.camelCase(g)]!==void 0&&h[e.Parser.camelCase(y)]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",g,y))})})},s.recommendCommands=function(h,g){g=g.sort((m,N)=>N.length-m.length);let x=null,E=1/0;for(let m=0,N;(N=g[m])!==void 0;m++){let F=ki(h,N);F<=3&&F<E&&(E=F,x=N)}x&&t.fail(n("Did you mean %s?",x))},s.reset=function(h){return o=qt(o,g=>!h[g]),p=qt(p,g=>!h[g]),s};let b=[];return s.freeze=function(){b.push({implied:o,conflicting:p})},s.unfreeze=function(){let h=b.pop();pt(h,void 0,e),{implied:o,conflicting:p}=h},s}var br=[],Fe;function on(r,t,e,n){Fe=n;let i={};if(Object.prototype.hasOwnProperty.call(r,"extends")){if(typeof r.extends!="string")return i;let s=/\.json|\..*rc$/.test(r.extends),o=null;if(s)o=Ya(t,r.extends);else try{o=G.resolve(r.extends)}catch{return r}Ga(o),br.push(o),i=s?JSON.parse(Fe.readFileSync(o,"utf8")):G(r.extends),delete r.extends,i=on(i,Fe.path.dirname(o),e,Fe)}return br=[],e?ns(i,r):Object.assign({},i,r)}function Ga(r){if(br.indexOf(r)>-1)throw new J(`Circular extended configurations: '${r}'.`)}function Ya(r,t){return Fe.path.resolve(r,t)}function ns(r,t){let e={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(e,r);for(let i of Object.keys(t))n(t[i])&&n(e[i])?e[i]=ns(r[i],t[i]):e[i]=t[i];return e}var S=function(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e},a=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},st,ie,Ue,_t,yt,an,Yt,se,cn,St,ln,It,Ft,xt,Pt,fn,_e,lt,v,un,hn,Et,oe,Se,ae,Kt,dn,T,ce,le,fe,L,pn,Ut,rt;function As(r){return(t=[],e=r.process.cwd(),n)=>{let i=new Pr(t,e,n,r);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var rs=Symbol("copyDoubleDash"),is=Symbol("copyDoubleDash"),wr=Symbol("deleteFromParserHintObject"),ss=Symbol("emitWarning"),os=Symbol("freeze"),as=Symbol("getDollarZero"),ue=Symbol("getParserConfiguration"),cs=Symbol("getUsageConfiguration"),yr=Symbol("guessLocale"),ls=Symbol("guessVersion"),fs=Symbol("parsePositionalNumbers"),xr=Symbol("pkgUp"),Jt=Symbol("populateParserHintArray"),Ie=Symbol("populateParserHintSingleValueDictionary"),Er=Symbol("populateParserHintArrayDictionary"),Ar=Symbol("populateParserHintDictionary"),Or=Symbol("sanitizeKey"),Cr=Symbol("setKey"),_r=Symbol("unfreeze"),us=Symbol("validateAsync"),hs=Symbol("getCommandInstance"),ds=Symbol("getContext"),ps=Symbol("getHasOutput"),ms=Symbol("getLoggerInstance"),gs=Symbol("getParseContext"),bs=Symbol("getUsageInstance"),ws=Symbol("getValidationInstance"),mn=Symbol("hasParseCallback"),ys=Symbol("isGlobalContext"),he=Symbol("postProcess"),xs=Symbol("rebase"),Sr=Symbol("reset"),Te=Symbol("runYargsParserAndExecuteCommands"),Ir=Symbol("runValidation"),Es=Symbol("setHasOutput"),de=Symbol("kTrackManuallySetKeys"),Pr=class{constructor(t=[],e,n,i){this.customScriptName=!1,this.parsed=!1,st.set(this,void 0),ie.set(this,void 0),Ue.set(this,{commands:[],fullCommands:[]}),_t.set(this,null),yt.set(this,null),an.set(this,"show-hidden"),Yt.set(this,null),se.set(this,!0),cn.set(this,{}),St.set(this,!0),ln.set(this,[]),It.set(this,void 0),Ft.set(this,{}),xt.set(this,!1),Pt.set(this,null),fn.set(this,!0),_e.set(this,void 0),lt.set(this,""),v.set(this,void 0),un.set(this,void 0),hn.set(this,{}),Et.set(this,null),oe.set(this,null),Se.set(this,{}),ae.set(this,{}),Kt.set(this,void 0),dn.set(this,!1),T.set(this,void 0),ce.set(this,!1),le.set(this,!1),fe.set(this,!1),L.set(this,void 0),pn.set(this,{}),Ut.set(this,null),rt.set(this,void 0),S(this,T,i,"f"),S(this,Kt,t,"f"),S(this,ie,e,"f"),S(this,un,n,"f"),S(this,It,new nn(this),"f"),this.$0=this[as](),this[Sr](),S(this,st,a(this,st,"f"),"f"),S(this,L,a(this,L,"f"),"f"),S(this,rt,a(this,rt,"f"),"f"),S(this,v,a(this,v,"f"),"f"),a(this,v,"f").showHiddenOpt=a(this,an,"f"),S(this,_e,this[is](),"f")}addHelpOpt(t,e){let n="help";return _("[string|boolean] [string]",[t,e],arguments.length),a(this,Pt,"f")&&(this[wr](a(this,Pt,"f")),S(this,Pt,null,"f")),t===!1&&e===void 0?this:(S(this,Pt,typeof t=="string"?t:n,"f"),this.boolean(a(this,Pt,"f")),this.describe(a(this,Pt,"f"),e||a(this,L,"f").deferY18nLookup("Show help")),this)}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(_("[string|boolean] [string]",[t,e],arguments.length),t===!1&&e===void 0)return this;let n=typeof t=="string"?t:a(this,an,"f");return this.boolean(n),this.describe(n,e||a(this,L,"f").deferY18nLookup("Show hidden options")),a(this,v,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return _("<object|string|array> [string|array]",[t,e],arguments.length),this[Er](this.alias.bind(this),"alias",t,e),this}array(t){return _("<array|string>",[t],arguments.length),this[Jt]("array",t),this[de](t),this}boolean(t){return _("<array|string>",[t],arguments.length),this[Jt]("boolean",t),this[de](t),this}check(t,e){return _("<function> [boolean]",[t,e],arguments.length),this.middleware((n,i)=>re(()=>t(n,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&a(this,L,"f").fail(s.toString(),s):a(this,L,"f").fail(a(this,T,"f").y18n.__("Argument check failed: %s",t.toString())),n),s=>(a(this,L,"f").fail(s.message?s.message:s.toString(),s),n)),!1,e),this}choices(t,e){return _("<object|string|array> [string|array]",[t,e],arguments.length),this[Er](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(_("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new J("coerce callback must be provided");for(let n of t)this.coerce(n,e);return this}else if(typeof t=="object"){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!e)throw new J("coerce callback must be provided");return a(this,v,"f").key[t]=!0,a(this,It,"f").addCoerceMiddleware((n,i)=>{let s;return Object.prototype.hasOwnProperty.call(n,t)?re(()=>(s=i.getAliases(),e(n[t])),c=>{n[t]=c;let p=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&p!==!0)for(let b of s[t])n[b]=c;return n},c=>{throw new J(c.message)}):n},t),this}conflicts(t,e){return _("<string|object> [string|array]",[t,e],arguments.length),a(this,rt,"f").conflicts(t,e),this}config(t="config",e,n){return _("[object|string] [string|function] [function]",[t,e,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=on(t,a(this,ie,"f"),this[ue]()["deep-merge-config"]||!1,a(this,T,"f")),a(this,v,"f").configObjects=(a(this,v,"f").configObjects||[]).concat(t),this):(typeof e=="function"&&(n=e,e=void 0),this.describe(t,e||a(this,L,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{a(this,v,"f").config[i]=n||!0}),this)}completion(t,e,n){return _("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),typeof e=="function"&&(n=e,e=void 0),S(this,yt,t||a(this,yt,"f")||"completion","f"),!e&&e!==!1&&(e="generate completion script"),this.command(a(this,yt,"f"),e),n&&a(this,_t,"f").registerFunction(n),this}command(t,e,n,i,s,o){return _("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,i,s,o],arguments.length),a(this,st,"f").addHandler(t,e,n,i,s,o),this}commands(t,e,n,i,s,o){return this.command(t,e,n,i,s,o)}commandDir(t,e){_("<string> [object]",[t,e],arguments.length);let n=a(this,un,"f")||a(this,T,"f").require;return a(this,st,"f").addDirectory(t,n,a(this,T,"f").getCallerFile(),e),this}count(t){return _("<array|string>",[t],arguments.length),this[Jt]("count",t),this[de](t),this}default(t,e,n){return _("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(hr(t,a(this,T,"f")),a(this,v,"f").defaultDescription[t]=n),typeof e=="function"&&(hr(t,a(this,T,"f")),a(this,v,"f").defaultDescription[t]||(a(this,v,"f").defaultDescription[t]=a(this,L,"f").functionDescription(e)),e=e.call()),this[Ie](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,i){return _("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,i],arguments.length),typeof e!="number"&&(n=e,e=1/0),this.global("_",!1),a(this,v,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:i},this}demand(t,e,n){return Array.isArray(e)?(e.forEach(i=>{pt(n,!0,a(this,T,"f")),this.demandOption(i,n)}),e=1/0):typeof e!="number"&&(n=e,e=1/0),typeof t=="number"?(pt(n,!0,a(this,T,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach(i=>{pt(n,!0,a(this,T,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(t,n):(n===!0||typeof n>"u")&&this.demandOption(t),this}demandOption(t,e){return _("<object|string|array> [string]",[t,e],arguments.length),this[Ie](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return _("<string> [string|boolean]",[t,e],arguments.length),a(this,v,"f").deprecatedOptions[t]=e,this}describe(t,e){return _("<object|string|array> [string]",[t,e],arguments.length),this[Cr](t,!0),a(this,L,"f").describe(t,e),this}detectLocale(t){return _("<boolean>",[t],arguments.length),S(this,se,t,"f"),this}env(t){return _("[string|boolean]",[t],arguments.length),t===!1?delete a(this,v,"f").envPrefix:a(this,v,"f").envPrefix=t||"",this}epilogue(t){return _("<string>",[t],arguments.length),a(this,L,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return _("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):a(this,L,"f").example(t,e),this}exit(t,e){S(this,xt,!0,"f"),S(this,Yt,e,"f"),a(this,St,"f")&&a(this,T,"f").process.exit(t)}exitProcess(t=!0){return _("[boolean]",[t],arguments.length),S(this,St,t,"f"),this}fail(t){if(_("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new J("Invalid first argument. Expected function or boolean 'false'");return a(this,L,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return _("<array> [function]",[t,e],arguments.length),e?a(this,_t,"f").getCompletion(t,e):new Promise((n,i)=>{a(this,_t,"f").getCompletion(t,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return _([],0),a(this,v,"f").demandedOptions}getDemandedCommands(){return _([],0),a(this,v,"f").demandedCommands}getDeprecatedOptions(){return _([],0),a(this,v,"f").deprecatedOptions}getDetectLocale(){return a(this,se,"f")}getExitProcess(){return a(this,St,"f")}getGroups(){return Object.assign({},a(this,Ft,"f"),a(this,ae,"f"))}getHelp(){if(S(this,xt,!0,"f"),!a(this,L,"f").hasCachedHelpMessage()){if(!this.parsed){let e=this[Te](a(this,Kt,"f"),void 0,void 0,0,!0);if(Q(e))return e.then(()=>a(this,L,"f").help())}let t=a(this,st,"f").runDefaultBuilderOn(this);if(Q(t))return t.then(()=>a(this,L,"f").help())}return Promise.resolve(a(this,L,"f").help())}getOptions(){return a(this,v,"f")}getStrict(){return a(this,ce,"f")}getStrictCommands(){return a(this,le,"f")}getStrictOptions(){return a(this,fe,"f")}global(t,e){return _("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),e!==!1?a(this,v,"f").local=a(this,v,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{a(this,v,"f").local.includes(n)||a(this,v,"f").local.push(n)}),this}group(t,e){_("<string|array> <string>",[t,e],arguments.length);let n=a(this,ae,"f")[e]||a(this,Ft,"f")[e];a(this,ae,"f")[e]&&delete a(this,ae,"f")[e];let i={};return a(this,Ft,"f")[e]=(n||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return _("<string>",[t],arguments.length),a(this,v,"f").hiddenOptions.push(t),this}implies(t,e){return _("<string|object> [number|string|array]",[t,e],arguments.length),a(this,rt,"f").implies(t,e),this}locale(t){return _("[string]",[t],arguments.length),t===void 0?(this[yr](),a(this,T,"f").y18n.getLocale()):(S(this,se,!1,"f"),a(this,T,"f").y18n.setLocale(t),this)}middleware(t,e,n){return a(this,It,"f").addMiddleware(t,!!e,n)}nargs(t,e){return _("<string|object|array> [number]",[t,e],arguments.length),this[Ie](this.nargs.bind(this),"narg",t,e),this}normalize(t){return _("<array|string>",[t],arguments.length),this[Jt]("normalize",t),this}number(t){return _("<array|string>",[t],arguments.length),this[Jt]("number",t),this[de](t),this}option(t,e){if(_("<string|object> [object]",[t,e],arguments.length),typeof t=="object")Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof e!="object"&&(e={}),this[de](t),a(this,Ut,"f")&&(t==="version"||e?.alias==="version")&&this[ss](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
64
- `),void 0,"versionWarning"),a(this,v,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);let n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);let i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,typeof e.demandOption=="string"?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),e.implies!==void 0&&this.implies(t,e.implies),e.nargs!==void 0&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||e.type==="boolean")&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||e.type==="array")&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||e.type==="number")&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||e.type==="string")&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||e.type==="count")&&this.count(t),typeof e.global=="boolean"&&this.global(t,e.global),e.defaultDescription&&(a(this,v,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);let s=e.describe||e.description||e.desc,o=a(this,L,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,t)||typeof s=="string")&&this.describe(t,s),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){_("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[os](),typeof t>"u"&&(t=a(this,Kt,"f")),typeof e=="object"&&(S(this,oe,e,"f"),e=n),typeof e=="function"&&(S(this,Et,e,"f"),e=!1),e||S(this,Kt,t,"f"),a(this,Et,"f")&&S(this,St,!1,"f");let i=this[Te](t,!!e),s=this.parsed;return a(this,_t,"f").setParsed(this.parsed),Q(i)?i.then(o=>(a(this,Et,"f")&&a(this,Et,"f").call(this,a(this,Yt,"f"),o,a(this,lt,"f")),o)).catch(o=>{throw a(this,Et,"f")&&a(this,Et,"f")(o,this.parsed.argv,a(this,lt,"f")),o}).finally(()=>{this[_r](),this.parsed=s}):(a(this,Et,"f")&&a(this,Et,"f").call(this,a(this,Yt,"f"),i,a(this,lt,"f")),this[_r](),this.parsed=s,i)}parseAsync(t,e,n){let i=this.parse(t,e,n);return Q(i)?i:Promise.resolve(i)}parseSync(t,e,n){let i=this.parse(t,e,n);if(Q(i))throw new J(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return _("<object>",[t],arguments.length),S(this,hn,t,"f"),this}pkgConf(t,e){_("<string> [string]",[t,e],arguments.length);let n=null,i=this[xr](e||a(this,ie,"f"));return i[t]&&typeof i[t]=="object"&&(n=on(i[t],e||a(this,ie,"f"),this[ue]()["deep-merge-config"]||!1,a(this,T,"f")),a(this,v,"f").configObjects=(a(this,v,"f").configObjects||[]).concat(n)),this}positional(t,e){_("<string> <object>",[t,e],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=qt(e,(o,c)=>o==="type"&&!["string","number","boolean"].includes(c)?!1:n.includes(o));let i=a(this,Ue,"f").fullCommands[a(this,Ue,"f").fullCommands.length-1],s=i?a(this,st,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Oe(s).forEach(o=>{let c=s[o];Array.isArray(c)?c.indexOf(t)!==-1&&(e[o]=!0):c[t]&&!(o in e)&&(e[o]=c[t])}),this.group(t,a(this,L,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return _("[boolean]",[t],arguments.length),S(this,dn,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return _("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&a(this,v,"f").narg[t]?this:(this[Ie](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,e){return _("[string] [string]",[t,e],arguments.length),t=t||this.$0,a(this,_e,"f").log(a(this,_t,"f").generateCompletionScript(t,e||a(this,yt,"f")||"completion")),this}showHelp(t){if(_("[string|function]",[t],arguments.length),S(this,xt,!0,"f"),!a(this,L,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[Te](a(this,Kt,"f"),void 0,void 0,0,!0);if(Q(n))return n.then(()=>{a(this,L,"f").showHelp(t)}),this}let e=a(this,st,"f").runDefaultBuilderOn(this);if(Q(e))return e.then(()=>{a(this,L,"f").showHelp(t)}),this}return a(this,L,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return _("[boolean|string] [string]",[t,e],arguments.length),a(this,L,"f").showHelpOnFail(t,e),this}showVersion(t){return _("[string|function]",[t],arguments.length),a(this,L,"f").showVersion(t),this}skipValidation(t){return _("<array|string>",[t],arguments.length),this[Jt]("skipValidation",t),this}strict(t){return _("[boolean]",[t],arguments.length),S(this,ce,t!==!1,"f"),this}strictCommands(t){return _("[boolean]",[t],arguments.length),S(this,le,t!==!1,"f"),this}strictOptions(t){return _("[boolean]",[t],arguments.length),S(this,fe,t!==!1,"f"),this}string(t){return _("<array|string>",[t],arguments.length),this[Jt]("string",t),this[de](t),this}terminalWidth(){return _([],0),a(this,T,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return _("<object>",[t],arguments.length),S(this,se,!1,"f"),a(this,T,"f").y18n.updateLocale(t),this}usage(t,e,n,i){if(_("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,i],arguments.length),e!==void 0){if(pt(t,null,a(this,T,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,i);throw new J(".usage() description must start with $0 if being used as alias for .command()")}else return a(this,L,"f").usage(t),this}usageConfiguration(t){return _("<object>",[t],arguments.length),S(this,pn,t,"f"),this}version(t,e,n){let i="version";if(_("[boolean|string] [string] [string]",[t,e,n],arguments.length),a(this,Ut,"f")&&(this[wr](a(this,Ut,"f")),a(this,L,"f").version(void 0),S(this,Ut,null,"f")),arguments.length===0)n=this[ls](),t=i;else if(arguments.length===1){if(t===!1)return this;n=t,t=i}else arguments.length===2&&(n=e,e=void 0);return S(this,Ut,typeof t=="string"?t:i,"f"),e=e||a(this,L,"f").deferY18nLookup("Show version number"),a(this,L,"f").version(n||void 0),this.boolean(a(this,Ut,"f")),this.describe(a(this,Ut,"f"),e),this}wrap(t){return _("<number|null|undefined>",[t],arguments.length),a(this,L,"f").wrap(t),this}[(st=new WeakMap,ie=new WeakMap,Ue=new WeakMap,_t=new WeakMap,yt=new WeakMap,an=new WeakMap,Yt=new WeakMap,se=new WeakMap,cn=new WeakMap,St=new WeakMap,ln=new WeakMap,It=new WeakMap,Ft=new WeakMap,xt=new WeakMap,Pt=new WeakMap,fn=new WeakMap,_e=new WeakMap,lt=new WeakMap,v=new WeakMap,un=new WeakMap,hn=new WeakMap,Et=new WeakMap,oe=new WeakMap,Se=new WeakMap,ae=new WeakMap,Kt=new WeakMap,dn=new WeakMap,T=new WeakMap,ce=new WeakMap,le=new WeakMap,fe=new WeakMap,L=new WeakMap,pn=new WeakMap,Ut=new WeakMap,rt=new WeakMap,rs)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[is](){return{log:(...t)=>{this[mn]()||console.log(...t),S(this,xt,!0,"f"),a(this,lt,"f").length&&S(this,lt,a(this,lt,"f")+`
65
- `,"f"),S(this,lt,a(this,lt,"f")+t.join(" "),"f")},error:(...t)=>{this[mn]()||console.error(...t),S(this,xt,!0,"f"),a(this,lt,"f").length&&S(this,lt,a(this,lt,"f")+`
66
- `,"f"),S(this,lt,a(this,lt,"f")+t.join(" "),"f")}}}[wr](t){Oe(a(this,v,"f")).forEach(e=>{if((i=>i==="configObjects")(e))return;let n=a(this,v,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete a(this,L,"f").getDescriptions()[t]}[ss](t,e,n){a(this,cn,"f")[n]||(a(this,T,"f").process.emitWarning(t,e),a(this,cn,"f")[n]=!0)}[os](){a(this,ln,"f").push({options:a(this,v,"f"),configObjects:a(this,v,"f").configObjects.slice(0),exitProcess:a(this,St,"f"),groups:a(this,Ft,"f"),strict:a(this,ce,"f"),strictCommands:a(this,le,"f"),strictOptions:a(this,fe,"f"),completionCommand:a(this,yt,"f"),output:a(this,lt,"f"),exitError:a(this,Yt,"f"),hasOutput:a(this,xt,"f"),parsed:this.parsed,parseFn:a(this,Et,"f"),parseContext:a(this,oe,"f")}),a(this,L,"f").freeze(),a(this,rt,"f").freeze(),a(this,st,"f").freeze(),a(this,It,"f").freeze()}[as](){let t="",e;return/\b(node|iojs|electron)(\.exe)?$/.test(a(this,T,"f").process.argv()[0])?e=a(this,T,"f").process.argv().slice(1,2):e=a(this,T,"f").process.argv().slice(0,1),t=e.map(n=>{let i=this[xs](a(this,ie,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),a(this,T,"f").getEnv("_")&&a(this,T,"f").getProcessArgvBin()===a(this,T,"f").getEnv("_")&&(t=a(this,T,"f").getEnv("_").replace(`${a(this,T,"f").path.dirname(a(this,T,"f").process.execPath())}/`,"")),t}[ue](){return a(this,hn,"f")}[cs](){return a(this,pn,"f")}[yr](){if(!a(this,se,"f"))return;let t=a(this,T,"f").getEnv("LC_ALL")||a(this,T,"f").getEnv("LC_MESSAGES")||a(this,T,"f").getEnv("LANG")||a(this,T,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[ls](){return this[xr]().version||"unknown"}[fs](t){let e=t["--"]?t["--"]:t._;for(let n=0,i;(i=e[n])!==void 0;n++)a(this,T,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(e[n]=Number(i));return t}[xr](t){let e=t||"*";if(a(this,Se,"f")[e])return a(this,Se,"f")[e];let n={};try{let i=t||a(this,T,"f").mainFilename;!t&&a(this,T,"f").path.extname(i)&&(i=a(this,T,"f").path.dirname(i));let s=a(this,T,"f").findUp(i,(o,c)=>{if(c.includes("package.json"))return"package.json"});pt(s,void 0,a(this,T,"f")),n=JSON.parse(a(this,T,"f").readFileSync(s,"utf8"))}catch{}return a(this,Se,"f")[e]=n||{},a(this,Se,"f")[e]}[Jt](t,e){e=[].concat(e),e.forEach(n=>{n=this[Or](n),a(this,v,"f")[t].push(n)})}[Ie](t,e,n,i){this[Ar](t,e,n,i,(s,o,c)=>{a(this,v,"f")[s][o]=c})}[Er](t,e,n,i){this[Ar](t,e,n,i,(s,o,c)=>{a(this,v,"f")[s][o]=(a(this,v,"f")[s][o]||[]).concat(c)})}[Ar](t,e,n,i,s){if(Array.isArray(n))n.forEach(o=>{t(o,i)});else if((o=>typeof o=="object")(n))for(let o of Oe(n))t(o,n[o]);else s(e,this[Or](n),i)}[Or](t){return t==="__proto__"?"___proto___":t}[Cr](t,e){return this[Ie](this[Cr].bind(this),"key",t,e),this}[_r](){var t,e,n,i,s,o,c,p,b,d,h,g;let y=a(this,ln,"f").pop();pt(y,void 0,a(this,T,"f"));let x;t=this,e=this,n=this,i=this,s=this,o=this,c=this,p=this,b=this,d=this,h=this,g=this,{options:{set value(E){S(t,v,E,"f")}}.value,configObjects:x,exitProcess:{set value(E){S(e,St,E,"f")}}.value,groups:{set value(E){S(n,Ft,E,"f")}}.value,output:{set value(E){S(i,lt,E,"f")}}.value,exitError:{set value(E){S(s,Yt,E,"f")}}.value,hasOutput:{set value(E){S(o,xt,E,"f")}}.value,parsed:this.parsed,strict:{set value(E){S(c,ce,E,"f")}}.value,strictCommands:{set value(E){S(p,le,E,"f")}}.value,strictOptions:{set value(E){S(b,fe,E,"f")}}.value,completionCommand:{set value(E){S(d,yt,E,"f")}}.value,parseFn:{set value(E){S(h,Et,E,"f")}}.value,parseContext:{set value(E){S(g,oe,E,"f")}}.value}=y,a(this,v,"f").configObjects=x,a(this,L,"f").unfreeze(),a(this,rt,"f").unfreeze(),a(this,st,"f").unfreeze(),a(this,It,"f").unfreeze()}[us](t,e){return re(e,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[hs].bind(this),getContext:this[ds].bind(this),getHasOutput:this[ps].bind(this),getLoggerInstance:this[ms].bind(this),getParseContext:this[gs].bind(this),getParserConfiguration:this[ue].bind(this),getUsageConfiguration:this[cs].bind(this),getUsageInstance:this[bs].bind(this),getValidationInstance:this[ws].bind(this),hasParseCallback:this[mn].bind(this),isGlobalContext:this[ys].bind(this),postProcess:this[he].bind(this),reset:this[Sr].bind(this),runValidation:this[Ir].bind(this),runYargsParserAndExecuteCommands:this[Te].bind(this),setHasOutput:this[Es].bind(this)}}[hs](){return a(this,st,"f")}[ds](){return a(this,Ue,"f")}[ps](){return a(this,xt,"f")}[ms](){return a(this,_e,"f")}[gs](){return a(this,oe,"f")||{}}[bs](){return a(this,L,"f")}[ws](){return a(this,rt,"f")}[mn](){return!!a(this,Et,"f")}[ys](){return a(this,fn,"f")}[he](t,e,n,i){return n||Q(t)||(e||(t=this[rs](t)),(this[ue]()["parse-positional-numbers"]||this[ue]()["parse-positional-numbers"]===void 0)&&(t=this[fs](t)),i&&(t=ne(t,this,a(this,It,"f").getMiddleware(),!1))),t}[Sr](t={}){S(this,v,a(this,v,"f")||{},"f");let e={};e.local=a(this,v,"f").local||[],e.configObjects=a(this,v,"f").configObjects||[];let n={};e.local.forEach(o=>{n[o]=!0,(t[o]||[]).forEach(c=>{n[c]=!0})}),Object.assign(a(this,ae,"f"),Object.keys(a(this,Ft,"f")).reduce((o,c)=>{let p=a(this,Ft,"f")[c].filter(b=>!(b in n));return p.length>0&&(o[c]=p),o},{})),S(this,Ft,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{e[o]=(a(this,v,"f")[o]||[]).filter(c=>!n[c])}),s.forEach(o=>{e[o]=qt(a(this,v,"f")[o],c=>!n[c])}),e.envPrefix=a(this,v,"f").envPrefix,S(this,v,e,"f"),S(this,L,a(this,L,"f")?a(this,L,"f").reset(n):Ji(this,a(this,T,"f")),"f"),S(this,rt,a(this,rt,"f")?a(this,rt,"f").reset(n):es(this,a(this,L,"f"),a(this,T,"f")),"f"),S(this,st,a(this,st,"f")?a(this,st,"f").reset():Gi(a(this,L,"f"),a(this,rt,"f"),a(this,It,"f"),a(this,T,"f")),"f"),a(this,_t,"f")||S(this,_t,Zi(this,a(this,L,"f"),a(this,st,"f"),a(this,T,"f")),"f"),a(this,It,"f").reset(),S(this,yt,null,"f"),S(this,lt,"","f"),S(this,Yt,null,"f"),S(this,xt,!1,"f"),this.parsed=!1,this}[xs](t,e){return a(this,T,"f").path.relative(t,e)}[Te](t,e,n,i=0,s=!1){let o=!!n||s;t=t||a(this,Kt,"f"),a(this,v,"f").__=a(this,T,"f").y18n.__,a(this,v,"f").configuration=this[ue]();let c=!!a(this,v,"f").configuration["populate--"],p=Object.assign({},a(this,v,"f").configuration,{"populate--":!0}),b=a(this,T,"f").Parser.detailed(t,Object.assign({},a(this,v,"f"),{configuration:{"parse-positional-numbers":!1,...p}})),d=Object.assign(b.argv,a(this,oe,"f")),h,g=b.aliases,y=!1,x=!1;Object.keys(d).forEach(E=>{E===a(this,Pt,"f")&&d[E]?y=!0:E===a(this,Ut,"f")&&d[E]&&(x=!0)}),d.$0=this.$0,this.parsed=b,i===0&&a(this,L,"f").clearCachedHelpMessage();try{if(this[yr](),e)return this[he](d,c,!!n,!1);a(this,Pt,"f")&&[a(this,Pt,"f")].concat(g[a(this,Pt,"f")]||[]).filter(R=>R.length>1).includes(""+d._[d._.length-1])&&(d._.pop(),y=!0),S(this,fn,!1,"f");let E=a(this,st,"f").getCommands(),m=a(this,_t,"f").completionKey in d,N=y||m||s;if(d._.length){if(E.length){let F;for(let R=i||0,D;d._[R]!==void 0;R++)if(D=String(d._[R]),E.includes(D)&&D!==a(this,yt,"f")){let W=a(this,st,"f").runCommand(D,this,b,R+1,s,y||x||s);return this[he](W,c,!!n,!1)}else if(!F&&D!==a(this,yt,"f")){F=D;break}!a(this,st,"f").hasDefaultCommand()&&a(this,dn,"f")&&F&&!N&&a(this,rt,"f").recommendCommands(F,E)}a(this,yt,"f")&&d._.includes(a(this,yt,"f"))&&!m&&(a(this,St,"f")&&Gt(!0),this.showCompletionScript(),this.exit(0))}if(a(this,st,"f").hasDefaultCommand()&&!N){let F=a(this,st,"f").runCommand(null,this,b,0,s,y||x||s);return this[he](F,c,!!n,!1)}if(m){a(this,St,"f")&&Gt(!0),t=[].concat(t);let F=t.slice(t.indexOf(`--${a(this,_t,"f").completionKey}`)+1);return a(this,_t,"f").getCompletion(F,(R,D)=>{if(R)throw new J(R.message);(D||[]).forEach(W=>{a(this,_e,"f").log(W)}),this.exit(0)}),this[he](d,!c,!!n,!1)}if(a(this,xt,"f")||(y?(a(this,St,"f")&&Gt(!0),o=!0,this.showHelp("log"),this.exit(0)):x&&(a(this,St,"f")&&Gt(!0),o=!0,a(this,L,"f").showVersion("log"),this.exit(0))),!o&&a(this,v,"f").skipValidation.length>0&&(o=Object.keys(d).some(F=>a(this,v,"f").skipValidation.indexOf(F)>=0&&d[F]===!0)),!o){if(b.error)throw new J(b.error.message);if(!m){let F=this[Ir](g,{},b.error);n||(h=ne(d,this,a(this,It,"f").getMiddleware(),!0)),h=this[us](F,h??d),Q(h)&&!n&&(h=h.then(()=>ne(d,this,a(this,It,"f").getMiddleware(),!1)))}}}catch(E){if(E instanceof J)a(this,L,"f").fail(E.message,E);else throw E}return this[he](h??d,c,!!n,!0)}[Ir](t,e,n,i){let s={...this.getDemandedOptions()};return o=>{if(n)throw new J(n.message);a(this,rt,"f").nonOptionCount(o),a(this,rt,"f").requiredArguments(o,s);let c=!1;a(this,le,"f")&&(c=a(this,rt,"f").unknownCommands(o)),a(this,ce,"f")&&!c?a(this,rt,"f").unknownArguments(o,t,e,!!i):a(this,fe,"f")&&a(this,rt,"f").unknownArguments(o,t,{},!1,!1),a(this,rt,"f").limitedChoices(o),a(this,rt,"f").implications(o),a(this,rt,"f").conflicting(o)}}[Es](){S(this,xt,!0,"f")}[de](t){if(typeof t=="string")a(this,v,"f").key[t]=!0;else for(let e of t)a(this,v,"f").key[e]=!0}};function Yi(r){return!!r&&typeof r.getInternalMethods=="function"}var Ka=As(Wi),Os=Ka;var Is=ze(_s(),1),Xa={},Ja=process.argv.slice(2),Ss=new Is.default(Os),vr=console.log;async function Mr(r){Ss.yargs.option("listen",{desc:"daemon control listen multiaddr",type:"string",default:"/unix/tmp/p2pd.sock"}).option("quiet",{alias:"q",desc:"be quiet",type:"boolean",default:!1}).option("id",{desc:"peer identity; private key file",type:"string",default:""}).option("hostAddrs",{desc:"Comma separated list of multiaddrs the host should listen on",type:"string",default:""}).option("announceAddrs",{desc:"Comma separated list of multiaddrs the host should announce to the network",type:"string",default:""}).option("bootstrap",{alias:"b",desc:"Connects to bootstrap peers and bootstraps the dht if enabled",type:"boolean",default:!1}).option("bootstrapPeers",{desc:"Comma separated list of bootstrap peers; defaults to the IPFS DHT peers",type:"string",default:""}).option("dht",{desc:"Enables the DHT in full node mode",type:"boolean",default:!1}).option("dhtClient",{desc:"(Not yet supported) Enables the DHT in client mode",type:"boolean",default:!1}).option("nat",{desc:"Enables UPnP NAT hole punching",type:"boolean",default:!1}).option("connMgr",{desc:"(Not yet supported) Enables the Connection Manager",type:"boolean",default:!1}).option("connMgrLo",{desc:"Number identifying the number of peers below which this node will not activate preemptive disconnections",type:"number"}).option("connMgrHi",{desc:"Number identifying the maximum number of peers the current peer is willing to be connected to before is starts disconnecting",type:"number"}).option("pubsub",{desc:"Enables pubsub",type:"boolean",default:!1}).option("pubsubRouter",{desc:"Specifies the pubsub router implementation",type:"string",default:"gossipsub"}).fail((i,s,o)=>{if(s!=null)throw s;Ja.length>0&&vr(i),o.showHelp()});let{data:t,argv:e}=await Ss.parse(r);t!=null&&(vr(t),process.exit(0)),await(await Ps(tr(e.listen),e)).start(),e.quiet!==!0&&vr("daemon has started")}async function Ps(r,t){throw new Error("Not implemented yet")}rr(Xa)&&Mr(process.argv).catch(r=>{console.error(r),process.exit(1)});return Us(Qa);})();
61
+ `)}`:"";t.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(y).length,Object.keys(y).join(", ")+E))}},s.unknownArguments=function(u,g,y,x,E=!0){var m;let N=r.getInternalMethods().getCommandInstance().getCommands(),F=[],R=r.getInternalMethods().getContext();if(Object.keys(u).forEach(T=>{!ns.includes(T)&&!Object.prototype.hasOwnProperty.call(y,T)&&!Object.prototype.hasOwnProperty.call(r.getInternalMethods().getParseContext(),T)&&!s.isValidAndSomeAliasIsNotNew(T,g)&&F.push(T)}),E&&(R.commands.length>0||N.length>0||x)&&u._.slice(R.commands.length).forEach(T=>{N.includes(""+T)||F.push(""+T)}),E){let W=((m=r.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,ft=R.commands.length+W;ft<u._.length&&u._.slice(ft).forEach(Z=>{Z=String(Z),!R.commands.includes(Z)&&!F.includes(Z)&&F.push(Z)})}F.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",F.length,F.map(T=>T.trim()?T:`"${T}"`).join(", ")))},s.unknownCommands=function(u){let g=r.getInternalMethods().getCommandInstance().getCommands(),y=[],x=r.getInternalMethods().getContext();return(x.commands.length>0||g.length>0)&&u._.slice(x.commands.length).forEach(E=>{g.includes(""+E)||y.push(""+E)}),y.length>0?(t.fail(i("Unknown command: %s","Unknown commands: %s",y.length,y.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(u,g){if(!Object.prototype.hasOwnProperty.call(g,u))return!1;let y=r.parsed.newAliases;return[u,...g[u]].some(x=>!Object.prototype.hasOwnProperty.call(y,x)||!y[u])},s.limitedChoices=function(u){let g=r.getOptions(),y={};if(!Object.keys(g.choices).length)return;Object.keys(u).forEach(m=>{ns.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(g.choices,m)&&[].concat(u[m]).forEach(N=>{g.choices[m].indexOf(N)===-1&&N!==void 0&&(y[m]=(y[m]||[]).concat(N))})});let x=Object.keys(y);if(!x.length)return;let E=n("Invalid values:");x.forEach(m=>{E+=`
62
+ ${n("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(y[m]),t.stringifiedValues(g.choices[m]))}`}),t.fail(E)};let o={};s.implies=function(u,g){_("<string|object> [array|number|string]",[u,g],arguments.length),typeof u=="object"?Object.keys(u).forEach(y=>{s.implies(y,u[y])}):(r.global(u),o[u]||(o[u]=[]),Array.isArray(g)?g.forEach(y=>s.implies(u,y)):(pt(g,void 0,e),o[u].push(g)))},s.getImplied=function(){return o};function c(d,u){let g=Number(u);return u=isNaN(g)?u:g,typeof u=="number"?u=d._.length>=u:u.match(/^--no-.+/)?(u=u.match(/^--no-(.+)/)[1],u=!Object.prototype.hasOwnProperty.call(d,u)):u=Object.prototype.hasOwnProperty.call(d,u),u}s.implications=function(u){let g=[];if(Object.keys(o).forEach(y=>{let x=y;(o[y]||[]).forEach(E=>{let m=x,N=E;m=c(u,m),E=c(u,E),m&&!E&&g.push(` ${x} -> ${N}`)})}),g.length){let y=`${n("Implications failed:")}
63
+ `;g.forEach(x=>{y+=x}),t.fail(y)}};let p={};s.conflicts=function(u,g){_("<string|object> [array|string]",[u,g],arguments.length),typeof u=="object"?Object.keys(u).forEach(y=>{s.conflicts(y,u[y])}):(r.global(u),p[u]||(p[u]=[]),Array.isArray(g)?g.forEach(y=>s.conflicts(u,y)):p[u].push(g))},s.getConflicting=()=>p,s.conflicting=function(u){Object.keys(u).forEach(g=>{p[g]&&p[g].forEach(y=>{y&&u[g]!==void 0&&u[y]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",g,y))})}),r.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(p).forEach(g=>{p[g].forEach(y=>{y&&u[e.Parser.camelCase(g)]!==void 0&&u[e.Parser.camelCase(y)]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",g,y))})})},s.recommendCommands=function(u,g){g=g.sort((m,N)=>N.length-m.length);let x=null,E=1/0;for(let m=0,N;(N=g[m])!==void 0;m++){let F=es(u,N);F<=3&&F<E&&(E=F,x=N)}x&&t.fail(n("Did you mean %s?",x))},s.reset=function(u){return o=qt(o,g=>!u[g]),p=qt(p,g=>!u[g]),s};let b=[];return s.freeze=function(){b.push({implied:o,conflicting:p})},s.unfreeze=function(){let u=b.pop();pt(u,void 0,e),{implied:o,conflicting:p}=u},s}var yr=[],De;function an(r,t,e,n){De=n;let i={};if(Object.prototype.hasOwnProperty.call(r,"extends")){if(typeof r.extends!="string")return i;let s=/\.json|\..*rc$/.test(r.extends),o=null;if(s)o=Ja(t,r.extends);else try{o=B.resolve(r.extends)}catch{return r}Ka(o),yr.push(o),i=s?JSON.parse(De.readFileSync(o,"utf8")):B(r.extends),delete r.extends,i=an(i,De.path.dirname(o),e,De)}return yr=[],e?is(i,r):Object.assign({},i,r)}function Ka(r){if(yr.indexOf(r)>-1)throw new J(`Circular extended configurations: '${r}'.`)}function Ja(r,t){return De.path.resolve(r,t)}function is(r,t){let e={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(e,r);for(let i of Object.keys(t))n(t[i])&&n(e[i])?e[i]=is(r[i],t[i]):e[i]=t[i];return e}var S=function(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e},a=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},st,re,Ue,_t,yt,cn,Yt,ie,ln,St,fn,It,Ft,xt,Pt,hn,_e,lt,v,un,dn,Et,se,Se,oe,Kt,pn,U,ae,ce,le,z,mn,Dt,rt;function Cs(r){return(t=[],e=r.process.cwd(),n)=>{let i=new vr(t,e,n,r);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var ss=Symbol("copyDoubleDash"),os=Symbol("copyDoubleDash"),xr=Symbol("deleteFromParserHintObject"),as=Symbol("emitWarning"),cs=Symbol("freeze"),ls=Symbol("getDollarZero"),fe=Symbol("getParserConfiguration"),fs=Symbol("getUsageConfiguration"),Er=Symbol("guessLocale"),hs=Symbol("guessVersion"),us=Symbol("parsePositionalNumbers"),Ar=Symbol("pkgUp"),Jt=Symbol("populateParserHintArray"),Ie=Symbol("populateParserHintSingleValueDictionary"),Or=Symbol("populateParserHintArrayDictionary"),Cr=Symbol("populateParserHintDictionary"),_r=Symbol("sanitizeKey"),Sr=Symbol("setKey"),Ir=Symbol("unfreeze"),ds=Symbol("validateAsync"),ps=Symbol("getCommandInstance"),ms=Symbol("getContext"),gs=Symbol("getHasOutput"),bs=Symbol("getLoggerInstance"),ws=Symbol("getParseContext"),ys=Symbol("getUsageInstance"),xs=Symbol("getValidationInstance"),gn=Symbol("hasParseCallback"),Es=Symbol("isGlobalContext"),he=Symbol("postProcess"),As=Symbol("rebase"),Pr=Symbol("reset"),Te=Symbol("runYargsParserAndExecuteCommands"),jr=Symbol("runValidation"),Os=Symbol("setHasOutput"),ue=Symbol("kTrackManuallySetKeys"),vr=class{constructor(t=[],e,n,i){this.customScriptName=!1,this.parsed=!1,st.set(this,void 0),re.set(this,void 0),Ue.set(this,{commands:[],fullCommands:[]}),_t.set(this,null),yt.set(this,null),cn.set(this,"show-hidden"),Yt.set(this,null),ie.set(this,!0),ln.set(this,{}),St.set(this,!0),fn.set(this,[]),It.set(this,void 0),Ft.set(this,{}),xt.set(this,!1),Pt.set(this,null),hn.set(this,!0),_e.set(this,void 0),lt.set(this,""),v.set(this,void 0),un.set(this,void 0),dn.set(this,{}),Et.set(this,null),se.set(this,null),Se.set(this,{}),oe.set(this,{}),Kt.set(this,void 0),pn.set(this,!1),U.set(this,void 0),ae.set(this,!1),ce.set(this,!1),le.set(this,!1),z.set(this,void 0),mn.set(this,{}),Dt.set(this,null),rt.set(this,void 0),S(this,U,i,"f"),S(this,Kt,t,"f"),S(this,re,e,"f"),S(this,un,n,"f"),S(this,It,new rn(this),"f"),this.$0=this[ls](),this[Pr](),S(this,st,a(this,st,"f"),"f"),S(this,z,a(this,z,"f"),"f"),S(this,rt,a(this,rt,"f"),"f"),S(this,v,a(this,v,"f"),"f"),a(this,v,"f").showHiddenOpt=a(this,cn,"f"),S(this,_e,this[os](),"f")}addHelpOpt(t,e){let n="help";return _("[string|boolean] [string]",[t,e],arguments.length),a(this,Pt,"f")&&(this[xr](a(this,Pt,"f")),S(this,Pt,null,"f")),t===!1&&e===void 0?this:(S(this,Pt,typeof t=="string"?t:n,"f"),this.boolean(a(this,Pt,"f")),this.describe(a(this,Pt,"f"),e||a(this,z,"f").deferY18nLookup("Show help")),this)}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(_("[string|boolean] [string]",[t,e],arguments.length),t===!1&&e===void 0)return this;let n=typeof t=="string"?t:a(this,cn,"f");return this.boolean(n),this.describe(n,e||a(this,z,"f").deferY18nLookup("Show hidden options")),a(this,v,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return _("<object|string|array> [string|array]",[t,e],arguments.length),this[Or](this.alias.bind(this),"alias",t,e),this}array(t){return _("<array|string>",[t],arguments.length),this[Jt]("array",t),this[ue](t),this}boolean(t){return _("<array|string>",[t],arguments.length),this[Jt]("boolean",t),this[ue](t),this}check(t,e){return _("<function> [boolean]",[t,e],arguments.length),this.middleware((n,i)=>ne(()=>t(n,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&a(this,z,"f").fail(s.toString(),s):a(this,z,"f").fail(a(this,U,"f").y18n.__("Argument check failed: %s",t.toString())),n),s=>(a(this,z,"f").fail(s.message?s.message:s.toString(),s),n)),!1,e),this}choices(t,e){return _("<object|string|array> [string|array]",[t,e],arguments.length),this[Or](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(_("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new J("coerce callback must be provided");for(let n of t)this.coerce(n,e);return this}else if(typeof t=="object"){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!e)throw new J("coerce callback must be provided");return a(this,v,"f").key[t]=!0,a(this,It,"f").addCoerceMiddleware((n,i)=>{let s;return Object.prototype.hasOwnProperty.call(n,t)?ne(()=>(s=i.getAliases(),e(n[t])),c=>{n[t]=c;let p=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&p!==!0)for(let b of s[t])n[b]=c;return n},c=>{throw new J(c.message)}):n},t),this}conflicts(t,e){return _("<string|object> [string|array]",[t,e],arguments.length),a(this,rt,"f").conflicts(t,e),this}config(t="config",e,n){return _("[object|string] [string|function] [function]",[t,e,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=an(t,a(this,re,"f"),this[fe]()["deep-merge-config"]||!1,a(this,U,"f")),a(this,v,"f").configObjects=(a(this,v,"f").configObjects||[]).concat(t),this):(typeof e=="function"&&(n=e,e=void 0),this.describe(t,e||a(this,z,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{a(this,v,"f").config[i]=n||!0}),this)}completion(t,e,n){return _("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),typeof e=="function"&&(n=e,e=void 0),S(this,yt,t||a(this,yt,"f")||"completion","f"),!e&&e!==!1&&(e="generate completion script"),this.command(a(this,yt,"f"),e),n&&a(this,_t,"f").registerFunction(n),this}command(t,e,n,i,s,o){return _("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,i,s,o],arguments.length),a(this,st,"f").addHandler(t,e,n,i,s,o),this}commands(t,e,n,i,s,o){return this.command(t,e,n,i,s,o)}commandDir(t,e){_("<string> [object]",[t,e],arguments.length);let n=a(this,un,"f")||a(this,U,"f").require;return a(this,st,"f").addDirectory(t,n,a(this,U,"f").getCallerFile(),e),this}count(t){return _("<array|string>",[t],arguments.length),this[Jt]("count",t),this[ue](t),this}default(t,e,n){return _("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(pr(t,a(this,U,"f")),a(this,v,"f").defaultDescription[t]=n),typeof e=="function"&&(pr(t,a(this,U,"f")),a(this,v,"f").defaultDescription[t]||(a(this,v,"f").defaultDescription[t]=a(this,z,"f").functionDescription(e)),e=e.call()),this[Ie](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,i){return _("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,i],arguments.length),typeof e!="number"&&(n=e,e=1/0),this.global("_",!1),a(this,v,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:i},this}demand(t,e,n){return Array.isArray(e)?(e.forEach(i=>{pt(n,!0,a(this,U,"f")),this.demandOption(i,n)}),e=1/0):typeof e!="number"&&(n=e,e=1/0),typeof t=="number"?(pt(n,!0,a(this,U,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach(i=>{pt(n,!0,a(this,U,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(t,n):(n===!0||typeof n>"u")&&this.demandOption(t),this}demandOption(t,e){return _("<object|string|array> [string]",[t,e],arguments.length),this[Ie](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return _("<string> [string|boolean]",[t,e],arguments.length),a(this,v,"f").deprecatedOptions[t]=e,this}describe(t,e){return _("<object|string|array> [string]",[t,e],arguments.length),this[Sr](t,!0),a(this,z,"f").describe(t,e),this}detectLocale(t){return _("<boolean>",[t],arguments.length),S(this,ie,t,"f"),this}env(t){return _("[string|boolean]",[t],arguments.length),t===!1?delete a(this,v,"f").envPrefix:a(this,v,"f").envPrefix=t||"",this}epilogue(t){return _("<string>",[t],arguments.length),a(this,z,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return _("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):a(this,z,"f").example(t,e),this}exit(t,e){S(this,xt,!0,"f"),S(this,Yt,e,"f"),a(this,St,"f")&&a(this,U,"f").process.exit(t)}exitProcess(t=!0){return _("[boolean]",[t],arguments.length),S(this,St,t,"f"),this}fail(t){if(_("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new J("Invalid first argument. Expected function or boolean 'false'");return a(this,z,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return _("<array> [function]",[t,e],arguments.length),e?a(this,_t,"f").getCompletion(t,e):new Promise((n,i)=>{a(this,_t,"f").getCompletion(t,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return _([],0),a(this,v,"f").demandedOptions}getDemandedCommands(){return _([],0),a(this,v,"f").demandedCommands}getDeprecatedOptions(){return _([],0),a(this,v,"f").deprecatedOptions}getDetectLocale(){return a(this,ie,"f")}getExitProcess(){return a(this,St,"f")}getGroups(){return Object.assign({},a(this,Ft,"f"),a(this,oe,"f"))}getHelp(){if(S(this,xt,!0,"f"),!a(this,z,"f").hasCachedHelpMessage()){if(!this.parsed){let e=this[Te](a(this,Kt,"f"),void 0,void 0,0,!0);if(Q(e))return e.then(()=>a(this,z,"f").help())}let t=a(this,st,"f").runDefaultBuilderOn(this);if(Q(t))return t.then(()=>a(this,z,"f").help())}return Promise.resolve(a(this,z,"f").help())}getOptions(){return a(this,v,"f")}getStrict(){return a(this,ae,"f")}getStrictCommands(){return a(this,ce,"f")}getStrictOptions(){return a(this,le,"f")}global(t,e){return _("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),e!==!1?a(this,v,"f").local=a(this,v,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{a(this,v,"f").local.includes(n)||a(this,v,"f").local.push(n)}),this}group(t,e){_("<string|array> <string>",[t,e],arguments.length);let n=a(this,oe,"f")[e]||a(this,Ft,"f")[e];a(this,oe,"f")[e]&&delete a(this,oe,"f")[e];let i={};return a(this,Ft,"f")[e]=(n||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return _("<string>",[t],arguments.length),a(this,v,"f").hiddenOptions.push(t),this}implies(t,e){return _("<string|object> [number|string|array]",[t,e],arguments.length),a(this,rt,"f").implies(t,e),this}locale(t){return _("[string]",[t],arguments.length),t===void 0?(this[Er](),a(this,U,"f").y18n.getLocale()):(S(this,ie,!1,"f"),a(this,U,"f").y18n.setLocale(t),this)}middleware(t,e,n){return a(this,It,"f").addMiddleware(t,!!e,n)}nargs(t,e){return _("<string|object|array> [number]",[t,e],arguments.length),this[Ie](this.nargs.bind(this),"narg",t,e),this}normalize(t){return _("<array|string>",[t],arguments.length),this[Jt]("normalize",t),this}number(t){return _("<array|string>",[t],arguments.length),this[Jt]("number",t),this[ue](t),this}option(t,e){if(_("<string|object> [object]",[t,e],arguments.length),typeof t=="object")Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof e!="object"&&(e={}),this[ue](t),a(this,Dt,"f")&&(t==="version"||e?.alias==="version")&&this[as](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
64
+ `),void 0,"versionWarning"),a(this,v,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);let n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);let i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,typeof e.demandOption=="string"?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),e.implies!==void 0&&this.implies(t,e.implies),e.nargs!==void 0&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||e.type==="boolean")&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||e.type==="array")&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||e.type==="number")&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||e.type==="string")&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||e.type==="count")&&this.count(t),typeof e.global=="boolean"&&this.global(t,e.global),e.defaultDescription&&(a(this,v,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);let s=e.describe||e.description||e.desc,o=a(this,z,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,t)||typeof s=="string")&&this.describe(t,s),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){_("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[cs](),typeof t>"u"&&(t=a(this,Kt,"f")),typeof e=="object"&&(S(this,se,e,"f"),e=n),typeof e=="function"&&(S(this,Et,e,"f"),e=!1),e||S(this,Kt,t,"f"),a(this,Et,"f")&&S(this,St,!1,"f");let i=this[Te](t,!!e),s=this.parsed;return a(this,_t,"f").setParsed(this.parsed),Q(i)?i.then(o=>(a(this,Et,"f")&&a(this,Et,"f").call(this,a(this,Yt,"f"),o,a(this,lt,"f")),o)).catch(o=>{throw a(this,Et,"f")&&a(this,Et,"f")(o,this.parsed.argv,a(this,lt,"f")),o}).finally(()=>{this[Ir](),this.parsed=s}):(a(this,Et,"f")&&a(this,Et,"f").call(this,a(this,Yt,"f"),i,a(this,lt,"f")),this[Ir](),this.parsed=s,i)}parseAsync(t,e,n){let i=this.parse(t,e,n);return Q(i)?i:Promise.resolve(i)}parseSync(t,e,n){let i=this.parse(t,e,n);if(Q(i))throw new J(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return _("<object>",[t],arguments.length),S(this,dn,t,"f"),this}pkgConf(t,e){_("<string> [string]",[t,e],arguments.length);let n=null,i=this[Ar](e||a(this,re,"f"));return i[t]&&typeof i[t]=="object"&&(n=an(i[t],e||a(this,re,"f"),this[fe]()["deep-merge-config"]||!1,a(this,U,"f")),a(this,v,"f").configObjects=(a(this,v,"f").configObjects||[]).concat(n)),this}positional(t,e){_("<string> <object>",[t,e],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=qt(e,(o,c)=>o==="type"&&!["string","number","boolean"].includes(c)?!1:n.includes(o));let i=a(this,Ue,"f").fullCommands[a(this,Ue,"f").fullCommands.length-1],s=i?a(this,st,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Oe(s).forEach(o=>{let c=s[o];Array.isArray(c)?c.indexOf(t)!==-1&&(e[o]=!0):c[t]&&!(o in e)&&(e[o]=c[t])}),this.group(t,a(this,z,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return _("[boolean]",[t],arguments.length),S(this,pn,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return _("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&a(this,v,"f").narg[t]?this:(this[Ie](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,e){return _("[string] [string]",[t,e],arguments.length),t=t||this.$0,a(this,_e,"f").log(a(this,_t,"f").generateCompletionScript(t,e||a(this,yt,"f")||"completion")),this}showHelp(t){if(_("[string|function]",[t],arguments.length),S(this,xt,!0,"f"),!a(this,z,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[Te](a(this,Kt,"f"),void 0,void 0,0,!0);if(Q(n))return n.then(()=>{a(this,z,"f").showHelp(t)}),this}let e=a(this,st,"f").runDefaultBuilderOn(this);if(Q(e))return e.then(()=>{a(this,z,"f").showHelp(t)}),this}return a(this,z,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return _("[boolean|string] [string]",[t,e],arguments.length),a(this,z,"f").showHelpOnFail(t,e),this}showVersion(t){return _("[string|function]",[t],arguments.length),a(this,z,"f").showVersion(t),this}skipValidation(t){return _("<array|string>",[t],arguments.length),this[Jt]("skipValidation",t),this}strict(t){return _("[boolean]",[t],arguments.length),S(this,ae,t!==!1,"f"),this}strictCommands(t){return _("[boolean]",[t],arguments.length),S(this,ce,t!==!1,"f"),this}strictOptions(t){return _("[boolean]",[t],arguments.length),S(this,le,t!==!1,"f"),this}string(t){return _("<array|string>",[t],arguments.length),this[Jt]("string",t),this[ue](t),this}terminalWidth(){return _([],0),a(this,U,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return _("<object>",[t],arguments.length),S(this,ie,!1,"f"),a(this,U,"f").y18n.updateLocale(t),this}usage(t,e,n,i){if(_("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,i],arguments.length),e!==void 0){if(pt(t,null,a(this,U,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,i);throw new J(".usage() description must start with $0 if being used as alias for .command()")}else return a(this,z,"f").usage(t),this}usageConfiguration(t){return _("<object>",[t],arguments.length),S(this,mn,t,"f"),this}version(t,e,n){let i="version";if(_("[boolean|string] [string] [string]",[t,e,n],arguments.length),a(this,Dt,"f")&&(this[xr](a(this,Dt,"f")),a(this,z,"f").version(void 0),S(this,Dt,null,"f")),arguments.length===0)n=this[hs](),t=i;else if(arguments.length===1){if(t===!1)return this;n=t,t=i}else arguments.length===2&&(n=e,e=void 0);return S(this,Dt,typeof t=="string"?t:i,"f"),e=e||a(this,z,"f").deferY18nLookup("Show version number"),a(this,z,"f").version(n||void 0),this.boolean(a(this,Dt,"f")),this.describe(a(this,Dt,"f"),e),this}wrap(t){return _("<number|null|undefined>",[t],arguments.length),a(this,z,"f").wrap(t),this}[(st=new WeakMap,re=new WeakMap,Ue=new WeakMap,_t=new WeakMap,yt=new WeakMap,cn=new WeakMap,Yt=new WeakMap,ie=new WeakMap,ln=new WeakMap,St=new WeakMap,fn=new WeakMap,It=new WeakMap,Ft=new WeakMap,xt=new WeakMap,Pt=new WeakMap,hn=new WeakMap,_e=new WeakMap,lt=new WeakMap,v=new WeakMap,un=new WeakMap,dn=new WeakMap,Et=new WeakMap,se=new WeakMap,Se=new WeakMap,oe=new WeakMap,Kt=new WeakMap,pn=new WeakMap,U=new WeakMap,ae=new WeakMap,ce=new WeakMap,le=new WeakMap,z=new WeakMap,mn=new WeakMap,Dt=new WeakMap,rt=new WeakMap,ss)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[os](){return{log:(...t)=>{this[gn]()||console.log(...t),S(this,xt,!0,"f"),a(this,lt,"f").length&&S(this,lt,a(this,lt,"f")+`
65
+ `,"f"),S(this,lt,a(this,lt,"f")+t.join(" "),"f")},error:(...t)=>{this[gn]()||console.error(...t),S(this,xt,!0,"f"),a(this,lt,"f").length&&S(this,lt,a(this,lt,"f")+`
66
+ `,"f"),S(this,lt,a(this,lt,"f")+t.join(" "),"f")}}}[xr](t){Oe(a(this,v,"f")).forEach(e=>{if((i=>i==="configObjects")(e))return;let n=a(this,v,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete a(this,z,"f").getDescriptions()[t]}[as](t,e,n){a(this,ln,"f")[n]||(a(this,U,"f").process.emitWarning(t,e),a(this,ln,"f")[n]=!0)}[cs](){a(this,fn,"f").push({options:a(this,v,"f"),configObjects:a(this,v,"f").configObjects.slice(0),exitProcess:a(this,St,"f"),groups:a(this,Ft,"f"),strict:a(this,ae,"f"),strictCommands:a(this,ce,"f"),strictOptions:a(this,le,"f"),completionCommand:a(this,yt,"f"),output:a(this,lt,"f"),exitError:a(this,Yt,"f"),hasOutput:a(this,xt,"f"),parsed:this.parsed,parseFn:a(this,Et,"f"),parseContext:a(this,se,"f")}),a(this,z,"f").freeze(),a(this,rt,"f").freeze(),a(this,st,"f").freeze(),a(this,It,"f").freeze()}[ls](){let t="",e;return/\b(node|iojs|electron)(\.exe)?$/.test(a(this,U,"f").process.argv()[0])?e=a(this,U,"f").process.argv().slice(1,2):e=a(this,U,"f").process.argv().slice(0,1),t=e.map(n=>{let i=this[As](a(this,re,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),a(this,U,"f").getEnv("_")&&a(this,U,"f").getProcessArgvBin()===a(this,U,"f").getEnv("_")&&(t=a(this,U,"f").getEnv("_").replace(`${a(this,U,"f").path.dirname(a(this,U,"f").process.execPath())}/`,"")),t}[fe](){return a(this,dn,"f")}[fs](){return a(this,mn,"f")}[Er](){if(!a(this,ie,"f"))return;let t=a(this,U,"f").getEnv("LC_ALL")||a(this,U,"f").getEnv("LC_MESSAGES")||a(this,U,"f").getEnv("LANG")||a(this,U,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[hs](){return this[Ar]().version||"unknown"}[us](t){let e=t["--"]?t["--"]:t._;for(let n=0,i;(i=e[n])!==void 0;n++)a(this,U,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(e[n]=Number(i));return t}[Ar](t){let e=t||"*";if(a(this,Se,"f")[e])return a(this,Se,"f")[e];let n={};try{let i=t||a(this,U,"f").mainFilename;!t&&a(this,U,"f").path.extname(i)&&(i=a(this,U,"f").path.dirname(i));let s=a(this,U,"f").findUp(i,(o,c)=>{if(c.includes("package.json"))return"package.json"});pt(s,void 0,a(this,U,"f")),n=JSON.parse(a(this,U,"f").readFileSync(s,"utf8"))}catch{}return a(this,Se,"f")[e]=n||{},a(this,Se,"f")[e]}[Jt](t,e){e=[].concat(e),e.forEach(n=>{n=this[_r](n),a(this,v,"f")[t].push(n)})}[Ie](t,e,n,i){this[Cr](t,e,n,i,(s,o,c)=>{a(this,v,"f")[s][o]=c})}[Or](t,e,n,i){this[Cr](t,e,n,i,(s,o,c)=>{a(this,v,"f")[s][o]=(a(this,v,"f")[s][o]||[]).concat(c)})}[Cr](t,e,n,i,s){if(Array.isArray(n))n.forEach(o=>{t(o,i)});else if((o=>typeof o=="object")(n))for(let o of Oe(n))t(o,n[o]);else s(e,this[_r](n),i)}[_r](t){return t==="__proto__"?"___proto___":t}[Sr](t,e){return this[Ie](this[Sr].bind(this),"key",t,e),this}[Ir](){var t,e,n,i,s,o,c,p,b,d,u,g;let y=a(this,fn,"f").pop();pt(y,void 0,a(this,U,"f"));let x;t=this,e=this,n=this,i=this,s=this,o=this,c=this,p=this,b=this,d=this,u=this,g=this,{options:{set value(E){S(t,v,E,"f")}}.value,configObjects:x,exitProcess:{set value(E){S(e,St,E,"f")}}.value,groups:{set value(E){S(n,Ft,E,"f")}}.value,output:{set value(E){S(i,lt,E,"f")}}.value,exitError:{set value(E){S(s,Yt,E,"f")}}.value,hasOutput:{set value(E){S(o,xt,E,"f")}}.value,parsed:this.parsed,strict:{set value(E){S(c,ae,E,"f")}}.value,strictCommands:{set value(E){S(p,ce,E,"f")}}.value,strictOptions:{set value(E){S(b,le,E,"f")}}.value,completionCommand:{set value(E){S(d,yt,E,"f")}}.value,parseFn:{set value(E){S(u,Et,E,"f")}}.value,parseContext:{set value(E){S(g,se,E,"f")}}.value}=y,a(this,v,"f").configObjects=x,a(this,z,"f").unfreeze(),a(this,rt,"f").unfreeze(),a(this,st,"f").unfreeze(),a(this,It,"f").unfreeze()}[ds](t,e){return ne(e,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[ps].bind(this),getContext:this[ms].bind(this),getHasOutput:this[gs].bind(this),getLoggerInstance:this[bs].bind(this),getParseContext:this[ws].bind(this),getParserConfiguration:this[fe].bind(this),getUsageConfiguration:this[fs].bind(this),getUsageInstance:this[ys].bind(this),getValidationInstance:this[xs].bind(this),hasParseCallback:this[gn].bind(this),isGlobalContext:this[Es].bind(this),postProcess:this[he].bind(this),reset:this[Pr].bind(this),runValidation:this[jr].bind(this),runYargsParserAndExecuteCommands:this[Te].bind(this),setHasOutput:this[Os].bind(this)}}[ps](){return a(this,st,"f")}[ms](){return a(this,Ue,"f")}[gs](){return a(this,xt,"f")}[bs](){return a(this,_e,"f")}[ws](){return a(this,se,"f")||{}}[ys](){return a(this,z,"f")}[xs](){return a(this,rt,"f")}[gn](){return!!a(this,Et,"f")}[Es](){return a(this,hn,"f")}[he](t,e,n,i){return n||Q(t)||(e||(t=this[ss](t)),(this[fe]()["parse-positional-numbers"]||this[fe]()["parse-positional-numbers"]===void 0)&&(t=this[us](t)),i&&(t=ee(t,this,a(this,It,"f").getMiddleware(),!1))),t}[Pr](t={}){S(this,v,a(this,v,"f")||{},"f");let e={};e.local=a(this,v,"f").local||[],e.configObjects=a(this,v,"f").configObjects||[];let n={};e.local.forEach(o=>{n[o]=!0,(t[o]||[]).forEach(c=>{n[c]=!0})}),Object.assign(a(this,oe,"f"),Object.keys(a(this,Ft,"f")).reduce((o,c)=>{let p=a(this,Ft,"f")[c].filter(b=>!(b in n));return p.length>0&&(o[c]=p),o},{})),S(this,Ft,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{e[o]=(a(this,v,"f")[o]||[]).filter(c=>!n[c])}),s.forEach(o=>{e[o]=qt(a(this,v,"f")[o],c=>!n[c])}),e.envPrefix=a(this,v,"f").envPrefix,S(this,v,e,"f"),S(this,z,a(this,z,"f")?a(this,z,"f").reset(n):Xi(this,a(this,U,"f")),"f"),S(this,rt,a(this,rt,"f")?a(this,rt,"f").reset(n):rs(this,a(this,z,"f"),a(this,U,"f")),"f"),S(this,st,a(this,st,"f")?a(this,st,"f").reset():Ki(a(this,z,"f"),a(this,rt,"f"),a(this,It,"f"),a(this,U,"f")),"f"),a(this,_t,"f")||S(this,_t,ts(this,a(this,z,"f"),a(this,st,"f"),a(this,U,"f")),"f"),a(this,It,"f").reset(),S(this,yt,null,"f"),S(this,lt,"","f"),S(this,Yt,null,"f"),S(this,xt,!1,"f"),this.parsed=!1,this}[As](t,e){return a(this,U,"f").path.relative(t,e)}[Te](t,e,n,i=0,s=!1){let o=!!n||s;t=t||a(this,Kt,"f"),a(this,v,"f").__=a(this,U,"f").y18n.__,a(this,v,"f").configuration=this[fe]();let c=!!a(this,v,"f").configuration["populate--"],p=Object.assign({},a(this,v,"f").configuration,{"populate--":!0}),b=a(this,U,"f").Parser.detailed(t,Object.assign({},a(this,v,"f"),{configuration:{"parse-positional-numbers":!1,...p}})),d=Object.assign(b.argv,a(this,se,"f")),u,g=b.aliases,y=!1,x=!1;Object.keys(d).forEach(E=>{E===a(this,Pt,"f")&&d[E]?y=!0:E===a(this,Dt,"f")&&d[E]&&(x=!0)}),d.$0=this.$0,this.parsed=b,i===0&&a(this,z,"f").clearCachedHelpMessage();try{if(this[Er](),e)return this[he](d,c,!!n,!1);a(this,Pt,"f")&&[a(this,Pt,"f")].concat(g[a(this,Pt,"f")]||[]).filter(R=>R.length>1).includes(""+d._[d._.length-1])&&(d._.pop(),y=!0),S(this,hn,!1,"f");let E=a(this,st,"f").getCommands(),m=a(this,_t,"f").completionKey in d,N=y||m||s;if(d._.length){if(E.length){let F;for(let R=i||0,T;d._[R]!==void 0;R++)if(T=String(d._[R]),E.includes(T)&&T!==a(this,yt,"f")){let W=a(this,st,"f").runCommand(T,this,b,R+1,s,y||x||s);return this[he](W,c,!!n,!1)}else if(!F&&T!==a(this,yt,"f")){F=T;break}!a(this,st,"f").hasDefaultCommand()&&a(this,pn,"f")&&F&&!N&&a(this,rt,"f").recommendCommands(F,E)}a(this,yt,"f")&&d._.includes(a(this,yt,"f"))&&!m&&(a(this,St,"f")&&Gt(!0),this.showCompletionScript(),this.exit(0))}if(a(this,st,"f").hasDefaultCommand()&&!N){let F=a(this,st,"f").runCommand(null,this,b,0,s,y||x||s);return this[he](F,c,!!n,!1)}if(m){a(this,St,"f")&&Gt(!0),t=[].concat(t);let F=t.slice(t.indexOf(`--${a(this,_t,"f").completionKey}`)+1);return a(this,_t,"f").getCompletion(F,(R,T)=>{if(R)throw new J(R.message);(T||[]).forEach(W=>{a(this,_e,"f").log(W)}),this.exit(0)}),this[he](d,!c,!!n,!1)}if(a(this,xt,"f")||(y?(a(this,St,"f")&&Gt(!0),o=!0,this.showHelp("log"),this.exit(0)):x&&(a(this,St,"f")&&Gt(!0),o=!0,a(this,z,"f").showVersion("log"),this.exit(0))),!o&&a(this,v,"f").skipValidation.length>0&&(o=Object.keys(d).some(F=>a(this,v,"f").skipValidation.indexOf(F)>=0&&d[F]===!0)),!o){if(b.error)throw new J(b.error.message);if(!m){let F=this[jr](g,{},b.error);n||(u=ee(d,this,a(this,It,"f").getMiddleware(),!0)),u=this[ds](F,u??d),Q(u)&&!n&&(u=u.then(()=>ee(d,this,a(this,It,"f").getMiddleware(),!1)))}}}catch(E){if(E instanceof J)a(this,z,"f").fail(E.message,E);else throw E}return this[he](u??d,c,!!n,!0)}[jr](t,e,n,i){let s={...this.getDemandedOptions()};return o=>{if(n)throw new J(n.message);a(this,rt,"f").nonOptionCount(o),a(this,rt,"f").requiredArguments(o,s);let c=!1;a(this,ce,"f")&&(c=a(this,rt,"f").unknownCommands(o)),a(this,ae,"f")&&!c?a(this,rt,"f").unknownArguments(o,t,e,!!i):a(this,le,"f")&&a(this,rt,"f").unknownArguments(o,t,{},!1,!1),a(this,rt,"f").limitedChoices(o),a(this,rt,"f").implications(o),a(this,rt,"f").conflicting(o)}}[Os](){S(this,xt,!0,"f")}[ue](t){if(typeof t=="string")a(this,v,"f").key[t]=!0;else for(let e of t)a(this,v,"f").key[e]=!0}};function Ji(r){return!!r&&typeof r.getInternalMethods=="function"}var Qa=Cs(Bi),_s=Qa;var js=Re(Is(),1),ka={},Xa=process.argv.slice(2),Ps=new js.default(_s),Nr=console.log;async function $r(r){Ps.yargs.option("listen",{desc:"daemon control listen multiaddr",type:"string",default:"/unix/tmp/p2pd.sock"}).option("quiet",{alias:"q",desc:"be quiet",type:"boolean",default:!1}).option("id",{desc:"peer identity; private key file",type:"string",default:""}).option("hostAddrs",{desc:"Comma separated list of multiaddrs the host should listen on",type:"string",default:""}).option("announceAddrs",{desc:"Comma separated list of multiaddrs the host should announce to the network",type:"string",default:""}).option("bootstrap",{alias:"b",desc:"Connects to bootstrap peers and bootstraps the dht if enabled",type:"boolean",default:!1}).option("bootstrapPeers",{desc:"Comma separated list of bootstrap peers; defaults to the IPFS DHT peers",type:"string",default:""}).option("dht",{desc:"Enables the DHT in full node mode",type:"boolean",default:!1}).option("dhtClient",{desc:"(Not yet supported) Enables the DHT in client mode",type:"boolean",default:!1}).option("nat",{desc:"Enables UPnP NAT hole punching",type:"boolean",default:!1}).option("connMgr",{desc:"(Not yet supported) Enables the Connection Manager",type:"boolean",default:!1}).option("connMgrLo",{desc:"Number identifying the number of peers below which this node will not activate preemptive disconnections",type:"number"}).option("connMgrHi",{desc:"Number identifying the maximum number of peers the current peer is willing to be connected to before is starts disconnecting",type:"number"}).option("pubsub",{desc:"Enables pubsub",type:"boolean",default:!1}).option("pubsubRouter",{desc:"Specifies the pubsub router implementation",type:"string",default:"gossipsub"}).fail((i,s,o)=>{if(s!=null)throw s;Xa.length>0&&Nr(i),o.showHelp()});let{data:t,argv:e}=await Ps.parse(r);t!=null&&(Nr(t),process.exit(0)),await(await vs(Ne(e.listen),e)).start(),e.quiet!==!0&&Nr("daemon has started")}async function vs(r,t){throw new Error("Not implemented yet")}sr(ka)&&$r(process.argv).catch(r=>{console.error(r),process.exit(1)});return Ts(Za);})();
67
67
  /*! Bundled license information:
68
68
 
69
69
  yargs-parser/build/lib/string-utils.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/daemon",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "libp2p-daemon JavaScript implementation",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p-daemon/tree/main/packages/libp2p-daemon#readme",
@@ -59,6 +59,6 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "aegir": "^42.2.3",
62
- "sinon": "^17.0.1"
62
+ "sinon": "^18.0.0"
63
63
  }
64
64
  }