UNPKG

npm-check-updates

Version:

Find newer versions of dependencies than what your package.json allows

37 lines 126 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("node:process"),nr=require("node:child_process"),Se=require("node:url"),T=require("node:path"),W=require("node:util"),ce=require("node:os"),J=require("./index.js"),N=require("node:fs"),qt=require("node:constants"),vu=require("node:stream"),kt=require("node:assert"),Z=require("./index-vtankfkr.js"),Dr=require("node:events"),ir=require("node:http"),Mt=require("./index-BnIU43YD.js");var ge=typeof document<"u"?document.currentScript:null,Je,Ru;function or(){if(Ru)return Je;Ru=1;var e=qt,u=process.cwd,t=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return t||(t=u.call(process)),t};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var s=process.chdir;process.chdir=function(r){t=null,s.call(process,r)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s)}Je=o;function o(r){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&D(r),r.lutimes||a(r),r.chown=E(r.chown),r.fchown=E(r.fchown),r.lchown=E(r.lchown),r.chmod=c(r.chmod),r.fchmod=c(r.fchmod),r.lchmod=c(r.lchmod),r.chownSync=h(r.chownSync),r.fchownSync=h(r.fchownSync),r.lchownSync=h(r.lchownSync),r.chmodSync=l(r.chmodSync),r.fchmodSync=l(r.fchmodSync),r.lchmodSync=l(r.lchmodSync),r.stat=F(r.stat),r.fstat=F(r.fstat),r.lstat=F(r.lstat),r.statSync=d(r.statSync),r.fstatSync=d(r.fstatSync),r.lstatSync=d(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(n,f,C){C&&process.nextTick(C)},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(n,f,C,g){g&&process.nextTick(g)},r.lchownSync=function(){}),i==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:function(n){function f(C,g,m){var v=Date.now(),B=0;n(C,g,function A(_){if(_&&(_.code==="EACCES"||_.code==="EPERM"||_.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){r.stat(g,function(k,$){k&&k.code==="ENOENT"?n(C,g,A):m(_)})},B),B<100&&(B+=10);return}m&&m(_)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,n),f}(r.rename)),r.read=typeof r.read!="function"?r.read:function(n){function f(C,g,m,v,B,A){var _;if(A&&typeof A=="function"){var k=0;_=function($,ee,Y){if($&&$.code==="EAGAIN"&&k<10)return k++,n.call(r,C,g,m,v,B,_);A.apply(this,arguments)}}return n.call(r,C,g,m,v,B,_)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,n),f}(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:function(n){return function(f,C,g,m,v){for(var B=0;;)try{return n.call(r,f,C,g,m,v)}catch(A){if(A.code==="EAGAIN"&&B<10){B++;continue}throw A}}}(r.readSync);function D(n){n.lchmod=function(f,C,g){n.open(f,e.O_WRONLY|e.O_SYMLINK,C,function(m,v){if(m){g&&g(m);return}n.fchmod(v,C,function(B){n.close(v,function(A){g&&g(B||A)})})})},n.lchmodSync=function(f,C){var g=n.openSync(f,e.O_WRONLY|e.O_SYMLINK,C),m=!0,v;try{v=n.fchmodSync(g,C),m=!1}finally{if(m)try{n.closeSync(g)}catch{}else n.closeSync(g)}return v}}function a(n){e.hasOwnProperty("O_SYMLINK")&&n.futimes?(n.lutimes=function(f,C,g,m){n.open(f,e.O_SYMLINK,function(v,B){if(v){m&&m(v);return}n.futimes(B,C,g,function(A){n.close(B,function(_){m&&m(A||_)})})})},n.lutimesSync=function(f,C,g){var m=n.openSync(f,e.O_SYMLINK),v,B=!0;try{v=n.futimesSync(m,C,g),B=!1}finally{if(B)try{n.closeSync(m)}catch{}else n.closeSync(m)}return v}):n.futimes&&(n.lutimes=function(f,C,g,m){m&&process.nextTick(m)},n.lutimesSync=function(){})}function c(n){return n&&function(f,C,g){return n.call(r,f,C,function(m){p(m)&&(m=null),g&&g.apply(this,arguments)})}}function l(n){return n&&function(f,C){try{return n.call(r,f,C)}catch(g){if(!p(g))throw g}}}function E(n){return n&&function(f,C,g,m){return n.call(r,f,C,g,function(v){p(v)&&(v=null),m&&m.apply(this,arguments)})}}function h(n){return n&&function(f,C,g){try{return n.call(r,f,C,g)}catch(m){if(!p(m))throw m}}}function F(n){return n&&function(f,C,g){typeof C=="function"&&(g=C,C=null);function m(v,B){B&&(B.uid<0&&(B.uid+=4294967296),B.gid<0&&(B.gid+=4294967296)),g&&g.apply(this,arguments)}return C?n.call(r,f,C,m):n.call(r,f,m)}}function d(n){return n&&function(f,C){var g=C?n.call(r,f,C):n.call(r,f);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}function p(n){if(!n||n.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(n.code==="EINVAL"||n.code==="EPERM"))}}return Je}var He,Iu;function sr(){if(Iu)return He;Iu=1;var e=vu.Stream;He=u;function u(t){return{ReadStream:i,WriteStream:s};function i(o,r){if(!(this instanceof i))return new i(o,r);e.call(this);var D=this;this.path=o,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var a=Object.keys(r),c=0,l=a.length;c<l;c++){var E=a[c];this[E]=r[E]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){D._read()});return}t.open(this.path,this.flags,this.mode,function(h,F){if(h){D.emit("error",h),D.readable=!1;return}D.fd=F,D.emit("open",F),D._read()})}function s(o,r){if(!(this instanceof s))return new s(o,r);e.call(this),this.path=o,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var D=Object.keys(r),a=0,c=D.length;a<c;a++){var l=D[a];this[l]=r[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}return He}var Ke,Nu;function ar(){if(Nu)return Ke;Nu=1,Ke=u;var e=Object.getPrototypeOf||function(t){return t.__proto__};function u(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var i={__proto__:e(t)};else var i=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))}),i}return Ke}var xe,Tu;function cr(){if(Tu)return xe;Tu=1;var e=N,u=or(),t=sr(),i=ar(),s=W,o,r;typeof Symbol=="function"&&typeof Symbol.for=="function"?(o=Symbol.for("graceful-fs.queue"),r=Symbol.for("graceful-fs.previous")):(o="___graceful-fs.queue",r="___graceful-fs.previous");function D(){}function a(n,f){Object.defineProperty(n,o,{get:function(){return f}})}var c=D;if(s.debuglog?c=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(c=function(){var n=s.format.apply(s,arguments);n="GFS4: "+n.split(/\n/).join(` GFS4: `),console.error(n)}),!e[o]){var l=J.commonjsGlobal[o]||[];a(e,l),e.close=function(n){function f(C,g){return n.call(e,C,function(m){m||d(),typeof g=="function"&&g.apply(this,arguments)})}return Object.defineProperty(f,r,{value:n}),f}(e.close),e.closeSync=function(n){function f(C){n.apply(e,arguments),d()}return Object.defineProperty(f,r,{value:n}),f}(e.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){c(e[o]),kt.equal(e[o].length,0)})}J.commonjsGlobal[o]||a(J.commonjsGlobal,e[o]),xe=E(i(e)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!e.__patched&&(xe=E(e),e.__patched=!0);function E(n){u(n),n.gracefulify=E,n.createReadStream=Ge,n.createWriteStream=Ve;var f=n.readFile;n.readFile=C;function C(y,w,b){return typeof w=="function"&&(b=w,w=null),L(y,w,b);function L(j,P,R,I){return f(j,P,function(S){S&&(S.code==="EMFILE"||S.code==="ENFILE")?h([L,[j,P,R],S,I||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments)})}}var g=n.writeFile;n.writeFile=m;function m(y,w,b,L){return typeof b=="function"&&(L=b,b=null),j(y,w,b,L);function j(P,R,I,S,q){return g(P,R,I,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?h([j,[P,R,I,S],O,q||Date.now(),Date.now()]):typeof S=="function"&&S.apply(this,arguments)})}}var v=n.appendFile;v&&(n.appendFile=B);function B(y,w,b,L){return typeof b=="function"&&(L=b,b=null),j(y,w,b,L);function j(P,R,I,S,q){return v(P,R,I,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?h([j,[P,R,I,S],O,q||Date.now(),Date.now()]):typeof S=="function"&&S.apply(this,arguments)})}}var A=n.copyFile;A&&(n.copyFile=_);function _(y,w,b,L){return typeof b=="function"&&(L=b,b=0),j(y,w,b,L);function j(P,R,I,S,q){return A(P,R,I,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?h([j,[P,R,I,S],O,q||Date.now(),Date.now()]):typeof S=="function"&&S.apply(this,arguments)})}}var k=n.readdir;n.readdir=ee;var $=/^v[0-5]\./;function ee(y,w,b){typeof w=="function"&&(b=w,w=null);var L=$.test(process.version)?function(R,I,S,q){return k(R,j(R,I,S,q))}:function(R,I,S,q){return k(R,I,j(R,I,S,q))};return L(y,w,b);function j(P,R,I,S){return function(q,O){q&&(q.code==="EMFILE"||q.code==="ENFILE")?h([L,[P,R,I],q,S||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof I=="function"&&I.call(this,q,O))}}}if(process.version.substr(0,4)==="v0.8"){var Y=t(n);G=Y.ReadStream,V=Y.WriteStream}var H=n.ReadStream;H&&(G.prototype=Object.create(H.prototype),G.prototype.open=Ue);var fe=n.WriteStream;fe&&(V.prototype=Object.create(fe.prototype),V.prototype.open=We),Object.defineProperty(n,"ReadStream",{get:function(){return G},set:function(y){G=y},enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:function(){return V},set:function(y){V=y},enumerable:!0,configurable:!0});var me=G;Object.defineProperty(n,"FileReadStream",{get:function(){return me},set:function(y){me=y},enumerable:!0,configurable:!0});var ye=V;Object.defineProperty(n,"FileWriteStream",{get:function(){return ye},set:function(y){ye=y},enumerable:!0,configurable:!0});function G(y,w){return this instanceof G?(H.apply(this,arguments),this):G.apply(Object.create(G.prototype),arguments)}function Ue(){var y=this;Fe(y.path,y.flags,y.mode,function(w,b){w?(y.autoClose&&y.destroy(),y.emit("error",w)):(y.fd=b,y.emit("open",b),y.read())})}function V(y,w){return this instanceof V?(fe.apply(this,arguments),this):V.apply(Object.create(V.prototype),arguments)}function We(){var y=this;Fe(y.path,y.flags,y.mode,function(w,b){w?(y.destroy(),y.emit("error",w)):(y.fd=b,y.emit("open",b))})}function Ge(y,w){return new n.ReadStream(y,w)}function Ve(y,w){return new n.WriteStream(y,w)}var Ye=n.open;n.open=Fe;function Fe(y,w,b,L){return typeof b=="function"&&(L=b,b=null),j(y,w,b,L);function j(P,R,I,S,q){return Ye(P,R,I,function(O,rr){O&&(O.code==="EMFILE"||O.code==="ENFILE")?h([j,[P,R,I,S],O,q||Date.now(),Date.now()]):typeof S=="function"&&S.apply(this,arguments)})}}return n}function h(n){c("ENQUEUE",n[0].name,n[1]),e[o].push(n),p()}var F;function d(){for(var n=Date.now(),f=0;f<e[o].length;++f)e[o][f].length>2&&(e[o][f][3]=n,e[o][f][4]=n);p()}function p(){if(clearTimeout(F),F=void 0,e[o].length!==0){var n=e[o].shift(),f=n[0],C=n[1],g=n[2],m=n[3],v=n[4];if(m===void 0)c("RETRY",f.name,C),f.apply(null,C);else if(Date.now()-m>=6e4){c("TIMEOUT",f.name,C);var B=C.pop();typeof B=="function"&&B.call(null,g)}else{var A=Date.now()-v,_=Math.max(v-m,1),k=Math.min(_*1.2,100);A>=k?(c("RETRY",f.name,C),f.apply(null,C.concat([m]))):e[o].push(n)}F===void 0&&(F=setTimeout(p,0))}}return xe}var lr=cr();const $e=J.getDefaultExportFromCjs(lr),le=ce.homedir(),{env:Ce}=process,$u=Ce.XDG_DATA_HOME||(le?T.join(le,".local","share"):void 0),Pe=Ce.XDG_CONFIG_HOME||(le?T.join(le,".config"):void 0);Ce.XDG_STATE_HOME||le&&T.join(le,".local","state");Ce.XDG_CACHE_HOME||le&&T.join(le,".cache");Ce.XDG_RUNTIME_DIR;const fr=(Ce.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");$u&&fr.unshift($u);const Fr=(Ce.XDG_CONFIG_DIRS||"/etc/xdg").split(":");Pe&&Fr.unshift(Pe);const ne=(e,u)=>function(...i){return e.apply(void 0,i).catch(u)},re=(e,u)=>function(...i){try{return e.apply(void 0,i)}catch(s){return u(s)}},hr=x.getuid?!x.getuid():!1,dr=1e4,z=()=>{},U={isChangeErrorOk:e=>{if(!U.isNodeError(e))return!1;const{code:u}=e;return u==="ENOSYS"||!hr&&(u==="EINVAL"||u==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!U.isNodeError(e))return!1;const{code:u}=e;return u==="EMFILE"||u==="ENFILE"||u==="EAGAIN"||u==="EBUSY"||u==="EACCESS"||u==="EACCES"||u==="EACCS"||u==="EPERM"},onChangeError:e=>{if(!U.isNodeError(e))throw e;if(!U.isChangeErrorOk(e))throw e}};class pr{constructor(){this.interval=25,this.intervalId=void 0,this.limit=dr,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=u=>{this.queueWaiting.add(u),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=u=>{this.queueWaiting.delete(u),this.queueActive.delete(u)},this.schedule=()=>new Promise(u=>{const t=()=>this.remove(i),i=()=>u(t);this.add(i)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const u of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(u),this.queueActive.add(u),u()}}}}}const Er=new pr,De=(e,u)=>function(i){return function s(...o){return Er.schedule().then(r=>{const D=c=>(r(),c),a=c=>{if(r(),Date.now()>=i)throw c;if(u(c)){const l=Math.round(100*Math.random());return new Promise(h=>setTimeout(h,l)).then(()=>s.apply(void 0,o))}throw c};return e.apply(void 0,o).then(D,a)})}},ie=(e,u)=>function(i){return function s(...o){try{return e.apply(void 0,o)}catch(r){if(Date.now()>i)throw r;if(u(r))return s.apply(void 0,o);throw r}}},K={attempt:{chmod:ne(W.promisify(N.chmod),U.onChangeError),chown:ne(W.promisify(N.chown),U.onChangeError),close:ne(W.promisify(N.close),z),fsync:ne(W.promisify(N.fsync),z),mkdir:ne(W.promisify(N.mkdir),z),realpath:ne(W.promisify(N.realpath),z),stat:ne(W.promisify(N.stat),z),unlink:ne(W.promisify(N.unlink),z),chmodSync:re(N.chmodSync,U.onChangeError),chownSync:re(N.chownSync,U.onChangeError),closeSync:re(N.closeSync,z),existsSync:re(N.existsSync,z),fsyncSync:re(N.fsync,z),mkdirSync:re(N.mkdirSync,z),realpathSync:re(N.realpathSync,z),statSync:re(N.statSync,z),unlinkSync:re(N.unlinkSync,z)},retry:{close:De(W.promisify(N.close),U.isRetriableError),fsync:De(W.promisify(N.fsync),U.isRetriableError),open:De(W.promisify(N.open),U.isRetriableError),readFile:De(W.promisify(N.readFile),U.isRetriableError),rename:De(W.promisify(N.rename),U.isRetriableError),stat:De(W.promisify(N.stat),U.isRetriableError),write:De(W.promisify(N.write),U.isRetriableError),writeFile:De(W.promisify(N.writeFile),U.isRetriableError),closeSync:ie(N.closeSync,U.isRetriableError),fsyncSync:ie(N.fsyncSync,U.isRetriableError),openSync:ie(N.openSync,U.isRetriableError),readFileSync:ie(N.readFileSync,U.isRetriableError),renameSync:ie(N.renameSync,U.isRetriableError),statSync:ie(N.statSync,U.isRetriableError),writeSync:ie(N.writeSync,U.isRetriableError),writeFileSync:ie(N.writeFileSync,U.isRetriableError)}},Cr="utf8",Pu=438,gr=511,mr={},yr=ce.userInfo().uid,Br=ce.userInfo().gid,Ar=1e3,vr=!!x.getuid;x.getuid&&x.getuid();const Lu=128,br=e=>e instanceof Error&&"code"in e,ju=e=>typeof e=="string",Xe=e=>e===void 0,wr=x.platform==="linux",Ut=x.platform==="win32",bu=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];Ut||bu.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");wr&&bu.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class Sr{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=u=>{if(!this.exited){this.exited=!0;for(const t of this.callbacks)t();u&&(Ut&&u!=="SIGINT"&&u!=="SIGTERM"&&u!=="SIGKILL"?x.kill(x.pid,"SIGTERM"):x.kill(x.pid,u))}},this.hook=()=>{x.once("exit",()=>this.exit());for(const u of bu)try{x.once(u,()=>this.exit(u))}catch{}},this.register=u=>(this.callbacks.add(u),()=>{this.callbacks.delete(u)}),this.hook()}}const _r=new Sr,xr=_r.register,X={store:{},create:e=>{const u=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),s=`.tmp-${Date.now().toString().slice(-10)}${u}`;return`${e}${s}`},get:(e,u,t=!0)=>{const i=X.truncate(u(e));return i in X.store?X.get(e,u,t):(X.store[i]=t,[i,()=>delete X.store[i]])},purge:e=>{X.store[e]&&(delete X.store[e],K.attempt.unlink(e))},purgeSync:e=>{X.store[e]&&(delete X.store[e],K.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(const e in X.store)X.purgeSync(e)},truncate:e=>{const u=T.basename(e);if(u.length<=Lu)return e;const t=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(u);if(!t)return e;const i=u.length-Lu;return`${e.slice(0,-u.length)}${t[1]}${t[2].slice(0,-i)}${t[3]}`}};xr(X.purgeSyncAll);function Bu(e,u,t=mr){if(ju(t))return Bu(e,u,{encoding:t});const i=Date.now()+((t.timeout??Ar)||-1);let s=null,o=null,r=null;try{const D=K.attempt.realpathSync(e),a=!!D;e=D||e,[o,s]=X.get(e,t.tmpCreate||X.create,t.tmpPurge!==!1);const c=vr&&Xe(t.chown),l=Xe(t.mode);if(a&&(c||l)){const E=K.attempt.statSync(e);E&&(t={...t},c&&(t.chown={uid:E.uid,gid:E.gid}),l&&(t.mode=E.mode))}if(!a){const E=T.dirname(e);K.attempt.mkdirSync(E,{mode:gr,recursive:!0})}r=K.retry.openSync(i)(o,"w",t.mode||Pu),t.tmpCreated&&t.tmpCreated(o),ju(u)?K.retry.writeSync(i)(r,u,0,t.encoding||Cr):Xe(u)||K.retry.writeSync(i)(r,u,0,u.length,0),t.fsync!==!1&&(t.fsyncWait!==!1?K.retry.fsyncSync(i)(r):K.attempt.fsync(r)),K.retry.closeSync(i)(r),r=null,t.chown&&(t.chown.uid!==yr||t.chown.gid!==Br)&&K.attempt.chownSync(o,t.chown.uid,t.chown.gid),t.mode&&t.mode!==Pu&&K.attempt.chmodSync(o,t.mode);try{K.retry.renameSync(i)(o,e)}catch(E){if(!br(E)||E.code!=="ENAMETOOLONG")throw E;K.retry.renameSync(i)(o,X.truncate(e))}s(),o=null}finally{r&&K.attempt.closeSync(r),o&&X.purge(o)}}const Ee=e=>{const u=typeof e;return e!==null&&(u==="object"||u==="function")},ze=new Set(["__proto__","prototype","constructor"]),Or=new Set("0123456789");function ke(e){const u=[];let t="",i="start",s=!1;for(const o of e)switch(o){case"\\":{if(i==="index")throw new Error("Invalid character in an index");if(i==="indexEnd")throw new Error("Invalid character after an index");s&&(t+=o),i="property",s=!s;break}case".":{if(i==="index")throw new Error("Invalid character in an index");if(i==="indexEnd"){i="property";break}if(s){s=!1,t+=o;break}if(ze.has(t))return[];u.push(t),t="",i="property";break}case"[":{if(i==="index")throw new Error("Invalid character in an index");if(i==="indexEnd"){i="index";break}if(s){s=!1,t+=o;break}if(i==="property"){if(ze.has(t))return[];u.push(t),t=""}i="index";break}case"]":{if(i==="index"){u.push(Number.parseInt(t,10)),t="",i="indexEnd";break}if(i==="indexEnd")throw new Error("Invalid character after an index")}default:{if(i==="index"&&!Or.has(o))throw new Error("Invalid character in an index");if(i==="indexEnd")throw new Error("Invalid character after an index");i==="start"&&(i="property"),s&&(s=!1,t+="\\"),t+=o}}switch(s&&(t+="\\"),i){case"property":{if(ze.has(t))return[];u.push(t);break}case"index":throw new Error("Index was not closed");case"start":{u.push("");break}}return u}function wu(e,u){if(typeof u!="number"&&Array.isArray(e)){const t=Number.parseInt(u,10);return Number.isInteger(t)&&e[t]===e[u]}return!1}function Wt(e,u){if(wu(e,u))throw new Error("Cannot use string index")}function Rr(e,u,t){if(!Ee(e)||typeof u!="string")return t===void 0?e:t;const i=ke(u);if(i.length===0)return t;for(let s=0;s<i.length;s++){const o=i[s];if(wu(e,o)?e=s===i.length-1?void 0:null:e=e[o],e==null){if(s!==i.length-1)return t;break}}return e===void 0?t:e}function qu(e,u,t){if(!Ee(e)||typeof u!="string")return e;const i=e,s=ke(u);for(let o=0;o<s.length;o++){const r=s[o];Wt(e,r),o===s.length-1?e[r]=t:Ee(e[r])||(e[r]=typeof s[o+1]=="number"?[]:{}),e=e[r]}return i}function Ir(e,u){if(!Ee(e)||typeof u!="string")return!1;const t=ke(u);for(let i=0;i<t.length;i++){const s=t[i];if(Wt(e,s),i===t.length-1)return delete e[s],!0;if(e=e[s],!Ee(e))return!1}}function Nr(e,u){if(!Ee(e)||typeof u!="string")return!1;const t=ke(u);if(t.length===0)return!1;for(const i of t){if(!Ee(e)||!(i in e)||wu(e,i))return!1;e=e[i]}return!0}function Tr(e,u){const t=u?T.join(e,"config.json"):T.join("configstore",`${e}.json`),i=Pe??$e.mkdtempSync($e.realpathSync(ce.tmpdir())+T.sep);return T.join(i,t)}const ku="You don't have access to this file.",$r={mode:448,recursive:!0},Mu={mode:384};class Pr{constructor(u,t,i={}){this._path=i.configPath??Tr(u,i.globalConfigPath),t&&(this.all={...t,...this.all})}get all(){try{return JSON.parse($e.readFileSync(this._path,"utf8"))}catch(u){if(u.code==="ENOENT")return{};if(u.code==="EACCES"&&(u.message=`${u.message} ${ku} `),u.name==="SyntaxError")return Bu(this._path,"",Mu),{};throw u}}set all(u){try{$e.mkdirSync(T.dirname(this._path),$r),Bu(this._path,JSON.stringify(u,void 0," "),Mu)}catch(t){throw t.code==="EACCES"&&(t.message=`${t.message} ${ku} `),t}}get size(){return Object.keys(this.all||{}).length}get(u){return Rr(this.all,u)}set(u,t){const i=this.all;if(arguments.length===1)for(const s of Object.keys(u))qu(i,s,u[s]);else qu(i,u,t);this.all=i}has(u){return Nr(this.all,u)}delete(u){const t=this.all;Ir(t,u),this.all=t}clear(){this.all={}}get path(){return this._path}}var Lr=J.requireDiff();const jr=J.getDefaultExportFromCjs(Lr);var qr=J.requireGt();const kr=J.getDefaultExportFromCjs(qr);class Uu extends Error{constructor(u,t,i){const s=u.status||u.status===0?u.status:"",o=u.statusText||"",r=`${s} ${o}`.trim(),D=r?`status code ${r}`:"an unknown error";super(`Request failed with ${D}: ${t.method} ${t.url}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=u,this.request=t,this.options=i}}class Gt extends Error{constructor(u){super(`Request timed out: ${u.method} ${u.url}`),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=u}}const Te=e=>e!==null&&typeof e=="object",Oe=(...e)=>{for(const u of e)if((!Te(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Su({},...e)},Vt=(e={},u={})=>{const t=new globalThis.Headers(e),i=u instanceof globalThis.Headers,s=new globalThis.Headers(u);for(const[o,r]of s.entries())i&&r==="undefined"||r===void 0?t.delete(o):t.set(o,r);return t},Su=(...e)=>{let u={},t={};for(const i of e)if(Array.isArray(i))Array.isArray(u)||(u=[]),u=[...u,...i];else if(Te(i)){for(let[s,o]of Object.entries(i))Te(o)&&s in u&&(o=Su(u[s],o)),u={...u,[s]:o};Te(i.headers)&&(t=Vt(t,i.headers),u.headers=t)}return u},Mr=(()=>{let e=!1,u=!1;const t=typeof globalThis.ReadableStream=="function",i=typeof globalThis.Request=="function";if(t&&i)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(s){if(s instanceof Error&&s.message==="unsupported BodyInit type")return!1;throw s}return e&&!u})(),Ur=typeof globalThis.AbortController=="function",Wr=typeof globalThis.ReadableStream=="function",Gr=typeof globalThis.FormData=="function",Yt=["get","post","put","patch","head","delete"],Vr={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Qe=2147483647,Jt=Symbol("stop"),Yr={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},Jr={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},Hr=e=>Yt.includes(e)?e.toUpperCase():e,Kr=["get","put","head","delete","options","trace"],Xr=[408,413,429,500,502,503,504],Ht=[413,429,503],Wu={limit:2,methods:Kr,statusCodes:Xr,afterStatusCodes:Ht,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},zr=(e={})=>{if(typeof e=="number")return{...Wu,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Wu,...e,afterStatusCodes:Ht}};async function Qr(e,u,t,i){return new Promise((s,o)=>{const r=setTimeout(()=>{t&&t.abort(),o(new Gt(e))},i.timeout);i.fetch(e,u).then(s).catch(o).then(()=>{clearTimeout(r)})})}async function Zr(e,{signal:u}){return new Promise((t,i)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",s,{once:!0}));function s(){clearTimeout(o),i(u.reason)}const o=setTimeout(()=>{u?.removeEventListener("abort",s),t()},e)})}const en=(e,u)=>{const t={};for(const i in u)!(i in Jr)&&!(i in Yr)&&!(i in e)&&(t[i]=u[i]);return t};class Le{static create(u,t){const i=new Le(u,t),s=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>Qe)throw new RangeError(`The \`timeout\` option cannot be greater than ${Qe}`);await Promise.resolve();let D=await i._fetch();for(const a of i._options.hooks.afterResponse){const c=await a(i.request,i._options,i._decorateResponse(D.clone()));c instanceof globalThis.Response&&(D=c)}if(i._decorateResponse(D),!D.ok&&i._options.throwHttpErrors){let a=new Uu(D,i.request,i._options);for(const c of i._options.hooks.beforeError)a=await c(a);throw a}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Wr)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return i._stream(D.clone(),i._options.onDownloadProgress)}return D},r=i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(s):s();for(const[D,a]of Object.entries(Vr))r[D]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||a);const l=(await r).clone();if(D==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(t.parseJson)return t.parseJson(await l.text())}return l[D]()};return r}constructor(u,t={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=u;const i=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...i&&{credentials:i},...t,headers:Vt(this._input.headers,t.headers),hooks:Su({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},t.hooks),method:Hr(t.method??this._input.method),prefixUrl:String(t.prefixUrl||""),retry:zr(t.retry),throwHttpErrors:t.throwHttpErrors!==!1,timeout:t.timeout??1e4,fetch:t.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Ur){if(this.abortController=new globalThis.AbortController,this._options.signal){const s=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(s.reason)})}this._options.signal=this.abortController.signal}if(Mr&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const o="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,o);(Gr&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(r,{...this.request}),this._options)}}_calculateRetryDelay(u){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(u instanceof Gt)){if(u instanceof Uu){if(!this._options.retry.statusCodes.includes(u.response.status))return 0;const i=u.response.headers.get("Retry-After");if(i&&this._options.retry.afterStatusCodes.includes(u.response.status)){let s=Number(i)*1e3;Number.isNaN(s)&&(s=Date.parse(i)-Date.now());const o=this._options.retry.maxRetryAfter??s;return s<o?s:o}if(u.response.status===413)return 0}const t=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,t)}return 0}_decorateResponse(u){return this._options.parseJson&&(u.json=async()=>this._options.parseJson(await u.text())),u}async _retry(u){try{return await u()}catch(t){const i=Math.min(this._calculateRetryDelay(t),Qe);if(i!==0&&this._retryCount>0){await Zr(i,{signal:this._options.signal});for(const s of this._options.hooks.beforeRetry)if(await s({request:this.request,options:this._options,error:t,retryCount:this._retryCount})===Jt)return;return this._retry(u)}throw t}}async _fetch(){for(const i of this._options.hooks.beforeRequest){const s=await i(this.request,this._options);if(s instanceof Request){this.request=s;break}if(s instanceof Response)return s}const u=en(this.request,this._options),t=this.request;return this.request=t.clone(),this._options.timeout===!1?this._options.fetch(t,u):Qr(t,u,this.abortController,this._options)}_stream(u,t){const i=Number(u.headers.get("content-length"))||0;let s=0;return u.status===204?(t&&t({percent:1,totalBytes:i,transferredBytes:s},new Uint8Array),new globalThis.Response(null,{status:u.status,statusText:u.statusText,headers:u.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){const r=u.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:i},new Uint8Array);async function D(){const{done:a,value:c}=await r.read();if(a){o.close();return}if(t){s+=c.byteLength;const l=i===0?0:s/i;t({percent:l,transferredBytes:s,totalBytes:i},c)}o.enqueue(c),await D()}await D()}}),{status:u.status,statusText:u.statusText,headers:u.headers})}}/*! MIT License © Sindre Sorhus */const Au=e=>{const u=(t,i)=>Le.create(t,Oe(e,i));for(const t of Yt)u[t]=(i,s)=>Le.create(i,Oe(e,s,{method:t}));return u.create=t=>Au(Oe(t)),u.extend=t=>Au(Oe(e,t)),u.stop=Jt,u},un=Au();var he={},oe={},Gu;function tn(){if(Gu)return oe;Gu=1,oe.parse=oe.decode=i,oe.stringify=oe.encode=u,oe.safe=o,oe.unsafe=r;var e=typeof process<"u"&&process.platform==="win32"?`\r `:` `;function u(D,a){var c=[],l="";typeof a=="string"?a={section:a,whitespace:!1}:(a=a||{},a.whitespace=a.whitespace===!0);var E=a.whitespace?" = ":"=";return Object.keys(D).forEach(function(h,F,d){var p=D[h];p&&Array.isArray(p)?p.forEach(function(n){l+=o(h+"[]")+E+o(n)+` `}):p&&typeof p=="object"?c.push(h):l+=o(h)+E+o(p)+e}),a.section&&l.length&&(l="["+o(a.section)+"]"+e+l),c.forEach(function(h,F,d){var p=t(h).join("\\."),n=(a.section?a.section+".":"")+p,f=u(D[h],{section:n,whitespace:a.whitespace});l.length&&f.length&&(l+=e),l+=f}),l}function t(D){return D.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(a){return a.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function i(D){var a={},c=a,l=null,E=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,h=D.split(/[\r\n]+/g);return h.forEach(function(F,d,p){if(!(!F||F.match(/^\s*[;#]/))){var n=F.match(E);if(n){if(n[1]!==void 0){if(l=r(n[1]),l==="__proto__"){c={};return}c=a[l]=a[l]||{};return}var f=r(n[2]);if(f!=="__proto__"){var C=n[3]?r(n[4]):!0;switch(C){case"true":case"false":case"null":C=JSON.parse(C)}if(f.length>2&&f.slice(-2)==="[]"){if(f=f.substring(0,f.length-2),f==="__proto__")return;c[f]?Array.isArray(c[f])||(c[f]=[c[f]]):c[f]=[]}Array.isArray(c[f])?c[f].push(C):c[f]=C}}}}),Object.keys(a).filter(function(F,d,p){if(!a[F]||typeof a[F]!="object"||Array.isArray(a[F]))return!1;var n=t(F),f=a,C=n.pop(),g=C.replace(/\\\./g,".");return n.forEach(function(m,v,B){m!=="__proto__"&&((!f[m]||typeof f[m]!="object")&&(f[m]={}),f=f[m])}),f===a&&g===C?!1:(f[g]=a[F],!0)}).forEach(function(F,d,p){delete a[F]}),a}function s(D){return D.charAt(0)==='"'&&D.slice(-1)==='"'||D.charAt(0)==="'"&&D.slice(-1)==="'"}function o(D){return typeof D!="string"||D.match(/[=\r\n]/)||D.match(/^\[/)||D.length>1&&s(D)||D!==D.trim()?JSON.stringify(D):D.replace(/;/g,"\\;").replace(/#/g,"\\#")}function r(D,a){if(D=(D||"").trim(),s(D)){D.charAt(0)==="'"&&(D=D.substr(1,D.length-2));try{D=JSON.parse(D)}catch{}}else{for(var c=!1,l="",E=0,h=D.length;E<h;E++){var F=D.charAt(E);if(c)"\\;#".indexOf(F)!==-1?l+=F:l+="\\"+F,c=!1;else{if(";#".indexOf(F)!==-1)break;F==="\\"?c=!0:l+=F}}return c&&(l+="\\"),l.trim()}return D}return oe}var Ze,Vu;function rn(){if(Vu)return Ze;Vu=1;var e=1,u=2;function t(){return""}function i(s,o,r){return s.slice(o,r).replace(/\S/g," ")}return Ze=function(s,o){o=o||{};for(var r,D,a=!1,c=!1,l=0,E="",h=o.whitespace===!1?t:i,F=0;F<s.length;F++){if(r=s[F],D=s[F+1],!c&&r==='"'){var d=s[F-1]==="\\"&&s[F-2]!=="\\";d||(a=!a)}if(!a){if(!c&&r+D==="//")E+=s.slice(l,F),l=F,c=e,F++;else if(c===e&&r+D===`\r `){F++,c=!1,E+=h(s,l,F),l=F;continue}else if(c===e&&r===` `)c=!1,E+=h(s,l,F),l=F;else if(!c&&r+D==="/*"){E+=s.slice(l,F),l=F,c=u,F++;continue}else if(c===u&&r+D==="*/"){F++,c=!1,E+=h(s,l,F+1),l=F+1;continue}}}return E+(c?h(s.substr(l)):s.substr(l))},Ze}var Yu;function nn(){if(Yu)return he;Yu=1;var e=N,u=tn(),t=T,i=rn(),s=he.parse=function(r){return/^\s*{/.test(r)?JSON.parse(i(r)):u.parse(r)},o=he.file=function(){var r=[].slice.call(arguments).filter(function(c){return c!=null});for(var D in r)if(typeof r[D]!="string")return;var a=t.join.apply(null,r);try{return e.readFileSync(a,"utf-8")}catch{return}};return he.json=function(){var r=o.apply(null,arguments);return r?s(r):null},he.env=function(r,D){D=D||process.env;var a={},c=r.length;for(var l in D)if(l.toLowerCase().indexOf(r.toLowerCase())===0){for(var E=l.substring(c).split("__"),h;(h=E.indexOf(""))>-1;)E.splice(h,1);var F=a;E.forEach(function(p,n){!p||typeof F!="object"||(n===E.length-1&&(F[p]=D[l]),F[p]===void 0&&(F[p]={}),F=F[p])})}return a},he.find=function(){var r=t.join.apply(null,[].slice.call(arguments));function D(a,c){var l=t.join(a,c);try{return e.statSync(l),l}catch{if(t.dirname(a)!==a)return D(t.dirname(a),c)}}return D(process.cwd(),r)},he}var eu={exports:{}};/*! * @description Recursive object extending * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com> * @license MIT * * The MIT License (MIT) * * Copyright (c) 2013-2018 Viacheslav Lotsmanov * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */var Ju;function Dn(){if(Ju)return eu.exports;Ju=1;function e(o){return o instanceof Buffer||o instanceof Date||o instanceof RegExp}function u(o){if(o instanceof Buffer){var r=Buffer.alloc?Buffer.alloc(o.length):new Buffer(o.length);return o.copy(r),r}else{if(o instanceof Date)return new Date(o.getTime());if(o instanceof RegExp)return new RegExp(o);throw new Error("Unexpected situation")}}function t(o){var r=[];return o.forEach(function(D,a){typeof D=="object"&&D!==null?Array.isArray(D)?r[a]=t(D):e(D)?r[a]=u(D):r[a]=s({},D):r[a]=D}),r}function i(o,r){return r==="__proto__"?void 0:o[r]}var s=eu.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var o=arguments[0],r=Array.prototype.slice.call(arguments,1),D,a;return r.forEach(function(c){typeof c!="object"||c===null||Array.isArray(c)||Object.keys(c).forEach(function(l){if(a=i(o,l),D=i(c,l),D!==o)if(typeof D!="object"||D===null){o[l]=D;return}else if(Array.isArray(D)){o[l]=t(D);return}else if(e(D)){o[l]=u(D);return}else if(typeof a!="object"||a===null||Array.isArray(a)){o[l]=s({},D);return}else{o[l]=s(a,D);return}})}),o};return eu.exports}var uu,Hu;function on(){if(Hu)return uu;Hu=1;function e(i,s){var o=i;s.slice(0,-1).forEach(function(D){o=o[D]||{}});var r=s[s.length-1];return r in o}function u(i){return typeof i=="number"||/^0x[0-9a-f]+$/i.test(i)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(i)}function t(i,s){return s==="constructor"&&typeof i[s]=="function"||s==="__proto__"}return uu=function(i,s){s||(s={});var o={bools:{},strings:{},unknownFn:null};typeof s.unknown=="function"&&(o.unknownFn=s.unknown),typeof s.boolean=="boolean"&&s.boolean?o.allBools=!0:[].concat(s.boolean).filter(Boolean).forEach(function(A){o.bools[A]=!0});var r={};function D(A){return r[A].some(function(_){return o.bools[_]})}Object.keys(s.alias||{}).forEach(function(A){r[A]=[].concat(s.alias[A]),r[A].forEach(function(_){r[_]=[A].concat(r[A].filter(function(k){return _!==k}))})}),[].concat(s.string).filter(Boolean).forEach(function(A){o.strings[A]=!0,r[A]&&[].concat(r[A]).forEach(function(_){o.strings[_]=!0})});var a=s.default||{},c={_:[]};function l(A,_){return o.allBools&&/^--[^=]+$/.test(_)||o.strings[A]||o.bools[A]||r[A]}function E(A,_,k){for(var $=A,ee=0;ee<_.length-1;ee++){var Y=_[ee];if(t($,Y))return;$[Y]===void 0&&($[Y]={}),($[Y]===Object.prototype||$[Y]===Number.prototype||$[Y]===String.prototype)&&($[Y]={}),$[Y]===Array.prototype&&($[Y]=[]),$=$[Y]}var H=_[_.length-1];t($,H)||(($===Object.prototype||$===Number.prototype||$===String.prototype)&&($={}),$===Array.prototype&&($=[]),$[H]===void 0||o.bools[H]||typeof $[H]=="boolean"?$[H]=k:Array.isArray($[H])?$[H].push(k):$[H]=[$[H],k])}function h(A,_,k){if(!(k&&o.unknownFn&&!l(A,k)&&o.unknownFn(k)===!1)){var $=!o.strings[A]&&u(_)?Number(_):_;E(c,A.split("."),$),(r[A]||[]).forEach(function(ee){E(c,ee.split("."),$)})}}Object.keys(o.bools).forEach(function(A){h(A,a[A]===void 0?!1:a[A])});var F=[];i.indexOf("--")!==-1&&(F=i.slice(i.indexOf("--")+1),i=i.slice(0,i.indexOf("--")));for(var d=0;d<i.length;d++){var p=i[d],n,f;if(/^--.+=/.test(p)){var C=p.match(/^--([^=]+)=([\s\S]*)$/);n=C[1];var g=C[2];o.bools[n]&&(g=g!=="false"),h(n,g,p)}else if(/^--no-.+/.test(p))n=p.match(/^--no-(.+)/)[1],h(n,!1,p);else if(/^--.+/.test(p))n=p.match(/^--(.+)/)[1],f=i[d+1],f!==void 0&&!/^(-|--)[^-]/.test(f)&&!o.bools[n]&&!o.allBools&&(!r[n]||!D(n))?(h(n,f,p),d+=1):/^(true|false)$/.test(f)?(h(n,f==="true",p),d+=1):h(n,o.strings[n]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var m=p.slice(1,-1).split(""),v=!1,B=0;B<m.length;B++){if(f=p.slice(B+2),f==="-"){h(m[B],f,p);continue}if(/[A-Za-z]/.test(m[B])&&f[0]==="="){h(m[B],f.slice(1),p),v=!0;break}if(/[A-Za-z]/.test(m[B])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(f)){h(m[B],f,p),v=!0;break}if(m[B+1]&&m[B+1].match(/\W/)){h(m[B],p.slice(B+2),p),v=!0;break}else h(m[B],o.strings[m[B]]?"":!0,p)}n=p.slice(-1)[0],!v&&n!=="-"&&(i[d+1]&&!/^(-|--)[^-]/.test(i[d+1])&&!o.bools[n]&&(!r[n]||!D(n))?(h(n,i[d+1],p),d+=1):i[d+1]&&/^(true|false)$/.test(i[d+1])?(h(n,i[d+1]==="true",p),d+=1):h(n,o.strings[n]?"":!0,p))}else if((!o.unknownFn||o.unknownFn(p)!==!1)&&c._.push(o.strings._||!u(p)?p:Number(p)),s.stopEarly){c._.push.apply(c._,i.slice(d+1));break}}return Object.keys(a).forEach(function(A){e(c,A.split("."))||(E(c,A.split("."),a[A]),(r[A]||[]).forEach(function(_){E(c,_.split("."),a[A])}))}),s["--"]?c["--"]=F.slice():F.forEach(function(A){c._.push(A)}),c},uu}var tu,Ku;function sn(){if(Ku)return tu;Ku=1;var e=nn(),u=T.join,t=Dn(),i="/etc",s=process.platform==="win32",o=s?process.env.USERPROFILE:process.env.HOME;return tu=function(r,D,a,c){if(typeof r!="string")throw new Error("rc(name): name *must* be string");a||(a=on()(process.argv.slice(2))),D=(typeof D=="string"?e.json(D):D)||{},c=c||e.parse;var l=e.env(r+"_"),E=[D],h=[];function F(d){if(!(h.indexOf(d)>=0)){var p=e.file(d);p&&(E.push(c(p)),h.push(d))}}return s||[u(i,r,"config"),u(i,r+"rc")].forEach(F),o&&[u(o,".config",r,"config"),u(o,".config",r),u(o,"."+r,"config"),u(o,"."+r+"rc")].forEach(F),F(e.find("."+r+"rc")),l.config&&F(l.config),a.config&&F(a.config),t.apply(null,E.concat([l,a,h.length?{configs:h,config:h[h.length-1]}:void 0]))},tu}var an=sn();const cn=J.getDefaultExportFromCjs(an);function ln(e){const u=cn("npm",{registry:"https://registry.npmjs.org/"}),t=u[`${e}:registry`]||u.config_registry||u.registry;return t.slice(-1)==="/"?t:`${t}/`}var ru={exports:{}},de={},pe={},nu,Xu;function fn(){if(Xu)return nu;Xu=1;var e=qt,u=process.cwd,t=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return t||(t=u.call(process)),t};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var s=process.chdir;process.chdir=function(r){t=null,s.call(process,r)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s)}nu=o;function o(r){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&D(r),r.lutimes||a(r),r.chown=E(r.chown),r.fchown=E(r.fchown),r.lchown=E(r.lchown),r.chmod=c(r.chmod),r.fchmod=c(r.fchmod),r.lchmod=c(r.lchmod),r.chownSync=h(r.chownSync),r.fchownSync=h(r.fchownSync),r.lchownSync=h(r.lchownSync),r.chmodSync=l(r.chmodSync),r.fchmodSync=l(r.fchmodSync),r.lchmodSync=l(r.lchmodSync),r.stat=F(r.stat),r.fstat=F(r.fstat),r.lstat=F(r.lstat),r.statSync=d(r.statSync),r.fstatSync=d(r.fstatSync),r.lstatSync=d(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(n,f,C){C&&process.nextTick(C)},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(n,f,C,g){g&&process.nextTick(g)},r.lchownSync=function(){}),i==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:function(n){function f(C,g,m){var v=Date.now(),B=0;n(C,g,function A(_){if(_&&(_.code==="EACCES"||_.code==="EPERM")&&Date.now()-v<6e4){setTimeout(function(){r.stat(g,function(k,$){k&&k.code==="ENOENT"?n(C,g,A):m(_)})},B),B<100&&(B+=10);return}m&&m(_)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,n),f}(r.rename)),r.read=typeof r.read!="function"?r.read:function(n){function f(C,g,m,v,B,A){var _;if(A&&typeof A=="function"){var k=0;_=function($,ee,Y){if($&&$.code==="EAGAIN"&&k<10)return k++,n.call(r,C,g,m,v,B,_);A.apply(this,arguments)}}return n.call(r,C,g,m,v,B,_)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,n),f}(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:function(n){return function(f,C,g,m,v){for(var B=0;;)try{return n.call(r,f,C,g,m,v)}catch(A){if(A.code==="EAGAIN"&&B<10){B++;continue}throw A}}}(r.readSync);function D(n){n.lchmod=function(f,C,g){n.open(f,e.O_WRONLY|e.O_SYMLINK,C,function(m,v){if(m){g&&g(m);return}n.fchmod(v,C,function(B){n.close(v,function(A){g&&g(B||A)})})})},n.lchmodSync=function(f,C){var g=n.openSync(f,e.O_WRONLY|e.O_SYMLINK,C),m=!0,v;try{v=n.fchmodSync(g,C),m=!1}finally{if(m)try{n.closeSync(g)}catch{}else n.closeSync(g)}return v}}function a(n){e.hasOwnProperty("O_SYMLINK")&&n.futimes?(n.lutimes=function(f,C,g,m){n.open(f,e.O_SYMLINK,function(v,B){if(v){m&&m(v);return}n.futimes(B,C,g,function(A){n.close(B,function(_){m&&m(A||_)})})})},n.lutimesSync=function(f,C,g){var m=n.openSync(f,e.O_SYMLINK),v,B=!0;try{v=n.futimesSync(m,C,g),B=!1}finally{if(B)try{n.closeSync(m)}catch{}else n.closeSync(m)}return v}):n.futimes&&(n.lutimes=function(f,C,g,m){m&&process.nextTick(m)},n.lutimesSync=function(){})}function c(n){return n&&function(f,C,g){return n.call(r,f,C,function(m){p(m)&&(m=null),g&&g.apply(this,arguments)})}}function l(n){return n&&function(f,C){try{return n.call(r,f,C)}catch(g){if(!p(g))throw g}}}function E(n){return n&&function(f,C,g,m){return n.call(r,f,C,g,function(v){p(v)&&(v=null),m&&m.apply(this,arguments)})}}function h(n){return n&&function(f,C,g){try{return n.call(r,f,C,g)}catch(m){if(!p(m))throw m}}}function F(n){return n&&function(f,C,g){typeof C=="function"&&(g=C,C=null);function m(v,B){B&&(B.uid<0&&(B.uid+=4294967296),B.gid<0&&(B.gid+=4294967296)),g&&g.apply(this,arguments)}return C?n.call(r,f,C,m):n.call(r,f,m)}}function d(n){return n&&function(f,C){var g=C?n.call(r,f,C):n.call(r,f);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}function p(n){if(!n||n.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(n.code==="EINVAL"||n.code==="EPERM"))}}return nu}var Du,zu;function Fn(){if(zu)return Du;zu=1;var e=vu.Stream;Du=u;function u(t){return{ReadStream:i,WriteStream:s};function i(o,r){if(!(this instanceof i))return new i(o,r);e.call(this);var D=this;this.path=o,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var a=Object.keys(r),c=0,l=a.length;c<l;c++){var E=a[c];this[E]=r[E]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){D._read()});return}t.open(this.path,this.flags,this.mode,function(h,F){if(h){D.emit("error",h),D.readable=!1;return}D.fd=F,D.emit("open",F),D._read()})}function s(o,r){if(!(this instanceof s))return new s(o,r);e.call(this),this.path=o,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var D=Object.keys(r),a=0,c=D.length;a<c;a++){var l=D[a];this[l]=r[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}return Du}var iu,Qu;function hn(){if(Qu)return iu;Qu=1,iu=u;var e=Object.getPrototypeOf||function(t){return t.__proto__};function u(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var i={__proto__:e(t)};else var i=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))}),i}return iu}var Re,Zu;function dn(){if(Zu)return Re;Zu=1;var e=N,u=fn(),t=Fn(),i=hn(),s=W,o,r;typeof Symbol=="function"&&typeof Symbol.for=="function"?(o=Symbol.for("graceful-fs.queue"),r=Symbol.for("graceful-fs.previous")):(o="___graceful-fs.queue",r="___graceful-fs.previous");function D(){}function a(n,f){Object.defineProperty(n,o,{get:function(){return f}})}var c=D;if(s.debuglog?c=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(c=function(){var n=s.format.apply(s,arguments);n="GFS4: "+n.split(/\n/).join(` GFS4: `),console.error(n)}),!e[o]){var l=J.commonjsGlobal[o]||[];a(e,l),e.close=function(n){function f(C,g){return n.call(e,C,function(m){m||d(),typeof g=="function"&&g.apply(this,arguments)})}return Object.defineProperty(f,r,{value:n}),f}(e.close),e.closeSync=function(n){function f(C){n.apply(e,arguments),d()}return Object.defineProperty(f,r,{value:n}),f}(e.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){c(e[o]),kt.equal(e[o].length,0)})}J.commonjsGlobal[o]||a(J.commonjsGlobal,e[o]),Re=E(i(e)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!e.__patched&&(Re=E(e),e.__patched=!0);function E(n){u(n),n.gracefulify=E,n.createReadStream=Ge,n.createWriteStream=Ve;var f=n.readFile;n.readFile=C;function C(y,w,b){return typeof w=="function"&&(b=w,w=null),L(y,w,b);function L(j,P,R,I){return f(j,P,function(S){S&&(S.code==="EMFILE"||S.code==="ENFILE")?h([L,[j,P,R],S,I||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments)})}}var g=n.writeFile;n.writeFile=m;function m(y,w,b,L){return typeof b=="function"&&(L=b,b=null),j(y,w,b,L);function j(P,R,I,S,q){return g(P,R,I,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?h([j,[P,R,I,S],O,q||Date.now(),Date.now()]):typeof S=="function"&&S.apply(this,arguments)})}}var v=n.appendFile;v&&(n.appendFile=B);function B(y,w,b,L){return typeof b=="function"&&(L=b,b=null),j(y,w,b,L);function j(P,R,I,S,q){return v(P,R,I,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?h([j,[P,R,I,S],O,q||Date.now(),Date.now()]):typeof S=="function"&&S.apply(this,arguments)})}}var A=n.copyFile;A&&(n.copyFile=_);function _(y,w,b,L){return typeof b=="function"&&(L=b,b=0),j(y,w,b,L);function j(P,R,I,S,q){return A(P,R,I,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?h([j,[P,R,I,S],O,q||Date.now(),Date.now()]):typeof S=="function"&&S.apply(this,arguments)})}}var k=n.readdir;n.readdir=ee;var $=/^v[