@turbo/workspaces 2.7.1-canary.0 → 2.7.2-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-Y2BQYEVF.mjs → chunk-7IDDFLAH.mjs} +5 -5
- package/dist/cli.js +4 -4
- package/dist/cli.mjs +1 -1
- package/dist/index.js +5 -5
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var il=Object.create;var ti=Object.defineProperty;var nl=Object.getOwnPropertyDescriptor;var ol=Object.getOwnPropertyNames;var ul=Object.getPrototypeOf,al=Object.prototype.hasOwnProperty;var A=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var cl=(r,e)=>()=>(r&&(e=r(r=0)),e);var y=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ll=(r,e)=>{for(var t in e)ti(r,t,{get:e[t],enumerable:!0})},hl=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ol(e))!al.call(r,i)&&i!==t&&ti(r,i,{get:()=>e[i],enumerable:!(s=nl(e,i))||s.enumerable});return r};var Nr=(r,e,t)=>(t=r!=null?il(ul(r)):{},hl(e||!r||!r.__esModule?ti(t,"default",{value:r,enumerable:!0}):t,r));var u=cl(()=>{});var po=y((Nm,be)=>{u();function ii(r){return be.exports=ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be.exports.__esModule=!0,be.exports.default=be.exports,ii(r)}be.exports=ii,be.exports.__esModule=!0,be.exports.default=be.exports});var go=y((Lm,Se)=>{u();var mo=po().default;function Do(){"use strict";Se.exports=Do=function(){return e},Se.exports.__esModule=!0,Se.exports.default=Se.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(E,m,D){E[m]=D.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(E,m,D){return Object.defineProperty(E,m,{value:D,enumerable:!0,configurable:!0,writable:!0}),E[m]}try{c({},"")}catch{c=function(D,C,b){return D[C]=b}}function h(E,m,D,C){var b=m&&m.prototype instanceof O?m:O,F=Object.create(b.prototype),N=new Qs(C||[]);return i(F,"_invoke",{value:rl(E,D,N)}),F}function d(E,m,D){try{return{type:"normal",arg:E.call(m,D)}}catch(C){return{type:"throw",arg:C}}}e.wrap=h;var g="suspendedStart",w="suspendedYield",S="executing",P="completed",k={};function O(){}function ut(){}function de(){}var Ks={};c(Ks,o,function(){return this});var Zs=Object.getPrototypeOf,Tr=Zs&&Zs(Zs(ei([])));Tr&&Tr!==t&&s.call(Tr,o)&&(Ks=Tr);var kt=de.prototype=O.prototype=Object.create(Ks);function no(E){["next","throw","return"].forEach(function(m){c(E,m,function(D){return this._invoke(m,D)})})}function Pr(E,m){function D(b,F,N,H){var J=d(E[b],E,F);if(J.type!=="throw"){var at=J.arg,qe=at.value;return qe&&mo(qe)=="object"&&s.call(qe,"__await")?m.resolve(qe.__await).then(function(ct){D("next",ct,N,H)},function(ct){D("throw",ct,N,H)}):m.resolve(qe).then(function(ct){at.value=ct,N(at)},function(ct){return D("throw",ct,N,H)})}H(J.arg)}var C;i(this,"_invoke",{value:function(F,N){function H(){return new m(function(J,at){D(F,N,J,at)})}return C=C?C.then(H,H):H()}})}function rl(E,m,D){var C=g;return function(b,F){if(C===S)throw new Error("Generator is already running");if(C===P){if(b==="throw")throw F;return{value:r,done:!0}}for(D.method=b,D.arg=F;;){var N=D.delegate;if(N){var H=oo(N,D);if(H){if(H===k)continue;return H}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(C===g)throw C=P,D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);C=S;var J=d(E,m,D);if(J.type==="normal"){if(C=D.done?P:w,J.arg===k)continue;return{value:J.arg,done:D.done}}J.type==="throw"&&(C=P,D.method="throw",D.arg=J.arg)}}}function oo(E,m){var D=m.method,C=E.iterator[D];if(C===r)return m.delegate=null,D==="throw"&&E.iterator.return&&(m.method="return",m.arg=r,oo(E,m),m.method==="throw")||D!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+D+"' method")),k;var b=d(C,E.iterator,m.arg);if(b.type==="throw")return m.method="throw",m.arg=b.arg,m.delegate=null,k;var F=b.arg;return F?F.done?(m[E.resultName]=F.value,m.next=E.nextLoc,m.method!=="return"&&(m.method="next",m.arg=r),m.delegate=null,k):F:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,k)}function sl(E){var m={tryLoc:E[0]};1 in E&&(m.catchLoc=E[1]),2 in E&&(m.finallyLoc=E[2],m.afterLoc=E[3]),this.tryEntries.push(m)}function Xs(E){var m=E.completion||{};m.type="normal",delete m.arg,E.completion=m}function Qs(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(sl,this),this.reset(!0)}function ei(E){if(E||E===""){var m=E[o];if(m)return m.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var D=-1,C=function b(){for(;++D<E.length;)if(s.call(E,D))return b.value=E[D],b.done=!1,b;return b.value=r,b.done=!0,b};return C.next=C}}throw new TypeError(mo(E)+" is not iterable")}return ut.prototype=de,i(kt,"constructor",{value:de,configurable:!0}),i(de,"constructor",{value:ut,configurable:!0}),ut.displayName=c(de,l,"GeneratorFunction"),e.isGeneratorFunction=function(E){var m=typeof E=="function"&&E.constructor;return!!m&&(m===ut||(m.displayName||m.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,de):(E.__proto__=de,c(E,l,"GeneratorFunction")),E.prototype=Object.create(kt),E},e.awrap=function(E){return{__await:E}},no(Pr.prototype),c(Pr.prototype,a,function(){return this}),e.AsyncIterator=Pr,e.async=function(E,m,D,C,b){b===void 0&&(b=Promise);var F=new Pr(h(E,m,D,C),b);return e.isGeneratorFunction(m)?F:F.next().then(function(N){return N.done?N.value:F.next()})},no(kt),c(kt,l,"Generator"),c(kt,o,function(){return this}),c(kt,"toString",function(){return"[object Generator]"}),e.keys=function(E){var m=Object(E),D=[];for(var C in m)D.push(C);return D.reverse(),function b(){for(;D.length;){var F=D.pop();if(F in m)return b.value=F,b.done=!1,b}return b.done=!0,b}},e.values=ei,Qs.prototype={constructor:Qs,reset:function(m){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Xs),!m)for(var D in this)D.charAt(0)==="t"&&s.call(this,D)&&!isNaN(+D.slice(1))&&(this[D]=r)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var D=this;function C(at,qe){return N.type="throw",N.arg=m,D.next=at,qe&&(D.method="next",D.arg=r),!!qe}for(var b=this.tryEntries.length-1;b>=0;--b){var F=this.tryEntries[b],N=F.completion;if(F.tryLoc==="root")return C("end");if(F.tryLoc<=this.prev){var H=s.call(F,"catchLoc"),J=s.call(F,"finallyLoc");if(H&&J){if(this.prev<F.catchLoc)return C(F.catchLoc,!0);if(this.prev<F.finallyLoc)return C(F.finallyLoc)}else if(H){if(this.prev<F.catchLoc)return C(F.catchLoc,!0)}else{if(!J)throw new Error("try statement without catch or finally");if(this.prev<F.finallyLoc)return C(F.finallyLoc)}}}},abrupt:function(m,D){for(var C=this.tryEntries.length-1;C>=0;--C){var b=this.tryEntries[C];if(b.tryLoc<=this.prev&&s.call(b,"finallyLoc")&&this.prev<b.finallyLoc){var F=b;break}}F&&(m==="break"||m==="continue")&&F.tryLoc<=D&&D<=F.finallyLoc&&(F=null);var N=F?F.completion:{};return N.type=m,N.arg=D,F?(this.method="next",this.next=F.finallyLoc,k):this.complete(N)},complete:function(m,D){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&D&&(this.next=D),k},finish:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var C=this.tryEntries[D];if(C.finallyLoc===m)return this.complete(C.completion,C.afterLoc),Xs(C),k}},catch:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var C=this.tryEntries[D];if(C.tryLoc===m){var b=C.completion;if(b.type==="throw"){var F=b.arg;Xs(C)}return F}}throw new Error("illegal catch attempt")},delegateYield:function(m,D,C){return this.delegate={iterator:ei(m),resultName:D,nextLoc:C},this.method==="next"&&(this.arg=r),k}},e}Se.exports=Do,Se.exports.__esModule=!0,Se.exports.default=Se.exports});var yo=y((Im,Eo)=>{u();var Ir=go()();Eo.exports=Ir;try{regeneratorRuntime=Ir}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Ir:Function("r","regeneratorRuntime = r")(Ir)}});var Co=y((nd,hi)=>{"use strict";u();var Ao=(r,...e)=>new Promise(t=>{t(r(...e))});hi.exports=Ao;hi.exports.default=Ao});var Fo=y((od,fi)=>{"use strict";u();var Ol=Co(),wo=r=>{if(!((Number.isInteger(r)||r===1/0)&&r>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let e=[],t=0,s=()=>{t--,e.length>0&&e.shift()()},i=(a,l,...c)=>{t++;let h=Ol(a,...c);l(h),h.then(s,s)},n=(a,l,...c)=>{t<r?i(a,l,...c):e.push(i.bind(null,a,l,...c))},o=(a,...l)=>new Promise(c=>n(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length},clearQueue:{value:()=>{e.length=0}}}),o};fi.exports=wo;fi.exports.default=wo});var ko=y((ud,pi)=>{"use strict";u();var bo=Fo(),Mr=class extends Error{constructor(e){super(),this.value=e}},Tl=async(r,e)=>e(await r),Pl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new Mr(e[0]);return!1},So=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=bo(t.concurrency),i=[...r].map(o=>[o,s(Tl,o,e)]),n=bo(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(Pl,o)))}catch(o){if(o instanceof Mr)return o.value;throw o}};pi.exports=So;pi.exports.default=So});var Oo=y((ad,mi)=>{"use strict";u();var _o=A("path"),jr=A("fs"),{promisify:Ro}=A("util"),Nl=ko(),Ll=Ro(jr.stat),Il=Ro(jr.lstat),Bo={directory:"isDirectory",file:"isFile"};function vo({type:r}){if(!(r in Bo))throw new Error(`Invalid type specified: ${r}`)}var xo=(r,e)=>r===void 0||e[Bo[r]]();mi.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},vo(e);let t=e.allowSymlinks?Ll:Il;return Nl(r,async s=>{try{let i=await t(_o.resolve(e.cwd,s));return xo(e.type,i)}catch{return!1}},e)};mi.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},vo(e);let t=e.allowSymlinks?jr.statSync:jr.lstatSync;for(let s of r)try{let i=t(_o.resolve(e.cwd,s));if(xo(e.type,i))return s}catch{}}});var Po=y((cd,di)=>{"use strict";u();var To=A("fs"),{promisify:Ml}=A("util"),jl=Ml(To.access);di.exports=async r=>{try{return await jl(r),!0}catch{return!1}};di.exports.sync=r=>{try{return To.accessSync(r),!0}catch{return!1}}});var Lo=y((ld,Bt)=>{"use strict";u();var $e=A("path"),Ur=Oo(),No=Po(),Di=Symbol("findUp.stop");Bt.exports=async(r,e={})=>{let t=$e.resolve(e.cwd||""),{root:s}=$e.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Ur(i,o);let a=await r(o.cwd);return typeof a=="string"?Ur([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===Di)return;if(o)return $e.resolve(t,o);if(t===s)return;t=$e.dirname(t)}};Bt.exports.sync=(r,e={})=>{let t=$e.resolve(e.cwd||""),{root:s}=$e.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Ur.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Ur.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===Di)return;if(o)return $e.resolve(t,o);if(t===s)return;t=$e.dirname(t)}};Bt.exports.exists=No;Bt.exports.sync.exists=No.sync;Bt.exports.stop=Di});var vt=y((Gd,Uo)=>{"use strict";u();var jo=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);Uo.exports=r=>r?Object.keys(r).map(e=>[jo.has(e)?jo.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Hr=y((Hd,Yo)=>{"use strict";u();var qo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Gl=A("events"),$o=A("stream"),zo=A("string_decoder").StringDecoder,_e=Symbol("EOF"),Re=Symbol("maybeEmitEnd"),ze=Symbol("emittedEnd"),qr=Symbol("emittingEnd"),fr=Symbol("emittedError"),$r=Symbol("closed"),Wo=Symbol("read"),zr=Symbol("flush"),Go=Symbol("flushChunk"),V=Symbol("encoding"),Be=Symbol("decoder"),Wr=Symbol("flowing"),pr=Symbol("paused"),xt=Symbol("resume"),L=Symbol("buffer"),De=Symbol("pipes"),j=Symbol("bufferLength"),gi=Symbol("bufferPush"),Ei=Symbol("bufferShift"),q=Symbol("objectMode"),$=Symbol("destroyed"),yi=Symbol("emitData"),Ho=Symbol("emitEnd"),Ai=Symbol("emitEnd2"),ve=Symbol("async"),mr=r=>Promise.resolve().then(r),Jo=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Hl=Jo&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Jl=Jo&&Symbol.iterator||Symbol("iterator not implemented"),Vl=r=>r==="end"||r==="finish"||r==="prefinish",Yl=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Kl=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Gr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[xt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ci=class extends Gr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};Yo.exports=class Vo extends $o{constructor(e){super(),this[Wr]=!1,this[pr]=!1,this[De]=[],this[L]=[],this[q]=e&&e.objectMode||!1,this[q]?this[V]=null:this[V]=e&&e.encoding||null,this[V]==="buffer"&&(this[V]=null),this[ve]=e&&!!e.async||!1,this[Be]=this[V]?new zo(this[V]):null,this[_e]=!1,this[ze]=!1,this[qr]=!1,this[$r]=!1,this[fr]=null,this.writable=!0,this.readable=!0,this[j]=0,this[$]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[De]})}get bufferLength(){return this[j]}get encoding(){return this[V]}set encoding(e){if(this[q])throw new Error("cannot set encoding in objectMode");if(this[V]&&e!==this[V]&&(this[Be]&&this[Be].lastNeed||this[j]))throw new Error("cannot change encoding");this[V]!==e&&(this[Be]=e?new zo(e):null,this[L].length&&(this[L]=this[L].map(t=>this[Be].write(t)))),this[V]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[q]}set objectMode(e){this[q]=this[q]||!!e}get async(){return this[ve]}set async(e){this[ve]=this[ve]||!!e}write(e,t,s){if(this[_e])throw new Error("write after end");if(this[$])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[ve]?mr:n=>n();return!this[q]&&!Buffer.isBuffer(e)&&(Kl(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Yl(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[q]?(this.flowing&&this[j]!==0&&this[zr](!0),this.flowing?this.emit("data",e):this[gi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[V]&&!this[Be].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[V]&&(e=this[Be].write(e)),this.flowing&&this[j]!==0&&this[zr](!0),this.flowing?this.emit("data",e):this[gi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[$])return null;if(this[j]===0||e===0||e>this[j])return this[Re](),null;this[q]&&(e=null),this[L].length>1&&!this[q]&&(this.encoding?this[L]=[this[L].join("")]:this[L]=[Buffer.concat(this[L],this[j])]);let t=this[Wo](e||null,this[L][0]);return this[Re](),t}[Wo](e,t){return e===t.length||e===null?this[Ei]():(this[L][0]=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit("data",t),!this[L].length&&!this[_e]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[_e]=!0,this.writable=!1,(this.flowing||!this[pr])&&this[Re](),this}[xt](){this[$]||(this[pr]=!1,this[Wr]=!0,this.emit("resume"),this[L].length?this[zr]():this[_e]?this[Re]():this.emit("drain"))}resume(){return this[xt]()}pause(){this[Wr]=!1,this[pr]=!0}get destroyed(){return this[$]}get flowing(){return this[Wr]}get paused(){return this[pr]}[gi](e){this[q]?this[j]+=1:this[j]+=e.length,this[L].push(e)}[Ei](){return this[L].length&&(this[q]?this[j]-=1:this[j]-=this[L][0].length),this[L].shift()}[zr](e){do;while(this[Go](this[Ei]()));!e&&!this[L].length&&!this[_e]&&this.emit("drain")}[Go](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[$])return;let s=this[ze];return t=t||{},e===qo.stdout||e===qo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[De].push(t.proxyErrors?new Ci(this,e,t):new Gr(this,e,t)),this[ve]?mr(()=>this[xt]()):this[xt]()),e}unpipe(e){let t=this[De].find(s=>s.dest===e);t&&(this[De].splice(this[De].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this[De].length&&!this.flowing?this[xt]():e==="readable"&&this[j]!==0?super.emit("readable"):Vl(e)&&this[ze]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[fr]&&(this[ve]?mr(()=>t.call(this,this[fr])):t.call(this,this[fr])),s}get emittedEnd(){return this[ze]}[Re](){!this[qr]&&!this[ze]&&!this[$]&&this[L].length===0&&this[_e]&&(this[qr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[$r]&&this.emit("close"),this[qr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==$&&this[$])return;if(e==="data")return t?this[ve]?mr(()=>this[yi](t)):this[yi](t):!1;if(e==="end")return this[Ho]();if(e==="close"){if(this[$r]=!0,!this[ze]&&!this[$])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[fr]=t;let n=super.emit("error",t);return this[Re](),n}else if(e==="resume"){let n=super.emit("resume");return this[Re](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[Re](),i}[yi](e){for(let s of this[De])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Re](),t}[Ho](){this[ze]||(this[ze]=!0,this.readable=!1,this[ve]?mr(()=>this[Ai]()):this[Ai]())}[Ai](){if(this[Be]){let t=this[Be].end();if(t){for(let s of this[De])s.dest.write(t);super.emit("data",t)}}for(let t of this[De])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[q]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[q]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[q]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[q]?Promise.reject(new Error("cannot concat in objectMode")):this[V]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on($,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Hl](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[_e])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[_e]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once($,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[Jl](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[$]?(e?this.emit("error",e):this.emit($),this):(this[$]=!0,this[L].length=0,this[j]=0,typeof this.close=="function"&&!this[$r]&&this.close(),e?this.emit("error",e):this.emit($),this)}static isStream(e){return!!e&&(e instanceof Vo||e instanceof $o||e instanceof Gl&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Zo=y((Jd,Ko)=>{u();var Zl=A("zlib").constants||{ZLIB_VERNUM:4736};Ko.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Zl))});var _i=y((Vd,ou)=>{"use strict";u();var Xo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Xl=A("events"),Qo=A("stream"),eu=A("string_decoder").StringDecoder,xe=Symbol("EOF"),Oe=Symbol("maybeEmitEnd"),We=Symbol("emittedEnd"),Jr=Symbol("emittingEnd"),dr=Symbol("emittedError"),Vr=Symbol("closed"),tu=Symbol("read"),Yr=Symbol("flush"),ru=Symbol("flushChunk"),Y=Symbol("encoding"),Te=Symbol("decoder"),Kr=Symbol("flowing"),Dr=Symbol("paused"),Ot=Symbol("resume"),U=Symbol("bufferLength"),wi=Symbol("bufferPush"),Fi=Symbol("bufferShift"),z=Symbol("objectMode"),W=Symbol("destroyed"),bi=Symbol("emitData"),su=Symbol("emitEnd"),Si=Symbol("emitEnd2"),Pe=Symbol("async"),gr=r=>Promise.resolve().then(r),iu=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Ql=iu&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),eh=iu&&Symbol.iterator||Symbol("iterator not implemented"),th=r=>r==="end"||r==="finish"||r==="prefinish",rh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,sh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Zr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Ot](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ki=class extends Zr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};ou.exports=class nu extends Qo{constructor(e){super(),this[Kr]=!1,this[Dr]=!1,this.pipes=[],this.buffer=[],this[z]=e&&e.objectMode||!1,this[z]?this[Y]=null:this[Y]=e&&e.encoding||null,this[Y]==="buffer"&&(this[Y]=null),this[Pe]=e&&!!e.async||!1,this[Te]=this[Y]?new eu(this[Y]):null,this[xe]=!1,this[We]=!1,this[Jr]=!1,this[Vr]=!1,this[dr]=null,this.writable=!0,this.readable=!0,this[U]=0,this[W]=!1}get bufferLength(){return this[U]}get encoding(){return this[Y]}set encoding(e){if(this[z])throw new Error("cannot set encoding in objectMode");if(this[Y]&&e!==this[Y]&&(this[Te]&&this[Te].lastNeed||this[U]))throw new Error("cannot change encoding");this[Y]!==e&&(this[Te]=e?new eu(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Te].write(t)))),this[Y]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[z]}set objectMode(e){this[z]=this[z]||!!e}get async(){return this[Pe]}set async(e){this[Pe]=this[Pe]||!!e}write(e,t,s){if(this[xe])throw new Error("write after end");if(this[W])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Pe]?gr:n=>n();return!this[z]&&!Buffer.isBuffer(e)&&(sh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):rh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[z]?(this.flowing&&this[U]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[wi](e),this[U]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[Y]&&!this[Te].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Y]&&(e=this[Te].write(e)),this.flowing&&this[U]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[wi](e),this[U]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[U]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[W])return null;if(this[U]===0||e===0||e>this[U])return this[Oe](),null;this[z]&&(e=null),this.buffer.length>1&&!this[z]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[U])]);let t=this[tu](e||null,this.buffer[0]);return this[Oe](),t}[tu](e,t){return e===t.length||e===null?this[Fi]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[U]-=e),this.emit("data",t),!this.buffer.length&&!this[xe]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[xe]=!0,this.writable=!1,(this.flowing||!this[Dr])&&this[Oe](),this}[Ot](){this[W]||(this[Dr]=!1,this[Kr]=!0,this.emit("resume"),this.buffer.length?this[Yr]():this[xe]?this[Oe]():this.emit("drain"))}resume(){return this[Ot]()}pause(){this[Kr]=!1,this[Dr]=!0}get destroyed(){return this[W]}get flowing(){return this[Kr]}get paused(){return this[Dr]}[wi](e){this[z]?this[U]+=1:this[U]+=e.length,this.buffer.push(e)}[Fi](){return this.buffer.length&&(this[z]?this[U]-=1:this[U]-=this.buffer[0].length),this.buffer.shift()}[Yr](e){do;while(this[ru](this[Fi]()));!e&&!this.buffer.length&&!this[xe]&&this.emit("drain")}[ru](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[We];return t=t||{},e===Xo.stdout||e===Xo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new ki(this,e,t):new Zr(this,e,t)),this[Pe]?gr(()=>this[Ot]()):this[Ot]()),e}unpipe(e){let t=this.pipes.find(s=>s.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[Ot]():e==="readable"&&this[U]!==0?super.emit("readable"):th(e)&&this[We]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[dr]&&(this[Pe]?gr(()=>t.call(this,this[dr])):t.call(this,this[dr])),s}get emittedEnd(){return this[We]}[Oe](){!this[Jr]&&!this[We]&&!this[W]&&this.buffer.length===0&&this[xe]&&(this[Jr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vr]&&this.emit("close"),this[Jr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[Pe]?gr(()=>this[bi](t)):this[bi](t):!1;if(e==="end")return this[su]();if(e==="close"){if(this[Vr]=!0,!this[We]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[dr]=t;let n=super.emit("error",t);return this[Oe](),n}else if(e==="resume"){let n=super.emit("resume");return this[Oe](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[Oe](),i}[bi](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Oe](),t}[su](){this[We]||(this[We]=!0,this.readable=!1,this[Pe]?gr(()=>this[Si]()):this[Si]())}[Si](){if(this[Te]){let t=this[Te].end();if(t){for(let s of this.pipes)s.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[z]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[z]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[z]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[z]?Promise.reject(new Error("cannot concat in objectMode")):this[Y]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(W,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Ql](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[xe])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[xe]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once(W,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[eh](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[W]?(e?this.emit("error",e):this.emit(W),this):(this[W]=!0,this.buffer.length=0,this[U]=0,typeof this.close=="function"&&!this[Vr]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof nu||e instanceof Qo||e instanceof Xl&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var zi=y(Q=>{"use strict";u();var Oi=A("assert"),Ge=A("buffer").Buffer,cu=A("zlib"),ht=Q.constants=Zo(),ih=_i(),uu=Ge.concat,ft=Symbol("_superWrite"),Pt=class extends Error{constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},nh=Symbol("opts"),Er=Symbol("flushFlag"),au=Symbol("finishFlushFlag"),$i=Symbol("fullFlushFlag"),x=Symbol("handle"),Xr=Symbol("onError"),Tt=Symbol("sawError"),Ri=Symbol("level"),Bi=Symbol("strategy"),vi=Symbol("ended"),Yd=Symbol("_defaultFullFlush"),Qr=class extends ih{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Tt]=!1,this[vi]=!1,this[nh]=e,this[Er]=e.flush,this[au]=e.finishFlush;try{this[x]=new cu[t](e)}catch(s){throw new Pt(s)}this[Xr]=s=>{this[Tt]||(this[Tt]=!0,this.close(),this.emit("error",s))},this[x].on("error",s=>this[Xr](new Pt(s))),this.once("end",()=>this.close)}close(){this[x]&&(this[x].close(),this[x]=null,this.emit("close"))}reset(){if(!this[Tt])return Oi(this[x],"zlib binding closed"),this[x].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[$i]),this.write(Object.assign(Ge.alloc(0),{[Er]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[au]),this[vi]=!0,super.end(null,null,s)}get ended(){return this[vi]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=Ge.from(e,t)),this[Tt])return;Oi(this[x],"zlib binding closed");let i=this[x]._handle,n=i.close;i.close=()=>{};let o=this[x].close;this[x].close=()=>{},Ge.concat=c=>c;let a;try{let c=typeof e[Er]=="number"?e[Er]:this[Er];a=this[x]._processChunk(e,c),Ge.concat=uu}catch(c){Ge.concat=uu,this[Xr](new Pt(c))}finally{this[x]&&(this[x]._handle=i,i.close=n,this[x].close=o,this[x].removeAllListeners("error"))}this[x]&&this[x].on("error",c=>this[Xr](new Pt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[ft](Ge.from(a[0]));for(let c=1;c<a.length;c++)l=this[ft](a[c])}else l=this[ft](Ge.from(a));return s&&s(),l}[ft](e){return super.write(e)}},Ne=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ht.Z_FINISH,super(e,t),this[$i]=ht.Z_FULL_FLUSH,this[Ri]=e.level,this[Bi]=e.strategy}params(e,t){if(!this[Tt]){if(!this[x])throw new Error("cannot switch params when binding is closed");if(!this[x].params)throw new Error("not supported in this implementation");if(this[Ri]!==e||this[Bi]!==t){this.flush(ht.Z_SYNC_FLUSH),Oi(this[x],"zlib binding closed");let s=this[x].flush;this[x].flush=(i,n)=>{this.flush(i),n()};try{this[x].params(e,t)}finally{this[x].flush=s}this[x]&&(this[Ri]=e,this[Bi]=t)}}}},Ti=class extends Ne{constructor(e){super(e,"Deflate")}},Pi=class extends Ne{constructor(e){super(e,"Inflate")}},xi=Symbol("_portable"),Ni=class extends Ne{constructor(e){super(e,"Gzip"),this[xi]=e&&!!e.portable}[ft](e){return this[xi]?(this[xi]=!1,e[9]=255,super[ft](e)):super[ft](e)}},Li=class extends Ne{constructor(e){super(e,"Gunzip")}},Ii=class extends Ne{constructor(e){super(e,"DeflateRaw")}},Mi=class extends Ne{constructor(e){super(e,"InflateRaw")}},ji=class extends Ne{constructor(e){super(e,"Unzip")}},es=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ht.BROTLI_OPERATION_FINISH,super(e,t),this[$i]=ht.BROTLI_OPERATION_FLUSH}},Ui=class extends es{constructor(e){super(e,"BrotliCompress")}},qi=class extends es{constructor(e){super(e,"BrotliDecompress")}};Q.Deflate=Ti;Q.Inflate=Pi;Q.Gzip=Ni;Q.Gunzip=Li;Q.DeflateRaw=Ii;Q.InflateRaw=Mi;Q.Unzip=ji;typeof cu.BrotliCompress=="function"?(Q.BrotliCompress=Ui,Q.BrotliDecompress=qi):Q.BrotliCompress=Q.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var Nt=y((Xd,lu)=>{u();var oh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;lu.exports=oh!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var ts=y((e0,hu)=>{"use strict";u();var uh=Hr(),Wi=Nt(),Gi=Symbol("slurp");hu.exports=class extends uh{constructor(e,t,s){switch(super(),this.pause(),this.extended=t,this.globalExtended=s,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=Wi(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=Wi(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[Gi](t),s&&this[Gi](s,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let s=this.remain,i=this.blockRemain;return this.remain=Math.max(0,s-t),this.blockRemain=Math.max(0,i-t),this.ignore?!0:s>=t?super.write(e):super.write(e.slice(0,s))}[Gi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?Wi(e[s]):e[s])}}});var Hi=y(rs=>{"use strict";u();rs.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);rs.code=new Map(Array.from(rs.name).map(r=>[r[1],r[0]]))});var du=y((r0,mu)=>{"use strict";u();var ah=(r,e)=>{if(Number.isSafeInteger(r))r<0?lh(r,e):ch(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},ch=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},lh=(r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var s=e.length;s>1;s--){var i=r&255;r=Math.floor(r/256),t?e[s-1]=fu(i):i===0?e[s-1]=0:(t=!0,e[s-1]=pu(i))}},hh=r=>{let e=r[0],t=e===128?ph(r.slice(1,r.length)):e===255?fh(r):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},fh=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=fu(n):n===0?o=n:(s=!0,o=pu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},ph=r=>{for(var e=r.length,t=0,s=e-1;s>-1;s--){var i=r[s];i!==0&&(t+=i*Math.pow(256,e-s-1))}return t},fu=r=>(255^r)&255,pu=r=>(255^r)+1&255;mu.exports={encode:ah,parse:hh}});var It=y((s0,gu)=>{"use strict";u();var Ji=Hi(),Lt=A("path").posix,Du=du(),Vi=Symbol("slurp"),ee=Symbol("type"),Zi=class{constructor(e,t,s,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[ee]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,s,i):e&&this.set(e)}decode(e,t,s,i){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=pt(e,t,100),this.mode=He(e,t+100,8),this.uid=He(e,t+108,8),this.gid=He(e,t+116,8),this.size=He(e,t+124,12),this.mtime=Yi(e,t+136,12),this.cksum=He(e,t+148,12),this[Vi](s),this[Vi](i,!0),this[ee]=pt(e,t+156,1),this[ee]===""&&(this[ee]="0"),this[ee]==="0"&&this.path.slice(-1)==="/"&&(this[ee]="5"),this[ee]==="5"&&(this.size=0),this.linkpath=pt(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=pt(e,t+265,32),this.gname=pt(e,t+297,32),this.devmaj=He(e,t+329,8),this.devmin=He(e,t+337,8),e[t+475]!==0){let o=pt(e,t+345,155);this.path=o+"/"+this.path}else{let o=pt(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Yi(e,t+476,12),this.ctime=Yi(e,t+488,12)}let n=8*32;for(let o=t;o<t+148;o++)n+=e[o];for(let o=t+156;o<t+512;o++)n+=e[o];this.cksumValid=n===this.cksum,this.cksum===null&&n===8*32&&(this.nullBlock=!0)}[Vi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=e[s])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||(t=0),!(e.length>=t+512))throw new Error("need 512 bytes for header");let s=this.ctime||this.atime?130:155,i=mh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=mt(e,t,100,n)||this.needPax,this.needPax=Je(e,t+100,8,this.mode)||this.needPax,this.needPax=Je(e,t+108,8,this.uid)||this.needPax,this.needPax=Je(e,t+116,8,this.gid)||this.needPax,this.needPax=Je(e,t+124,12,this.size)||this.needPax,this.needPax=Ki(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[ee].charCodeAt(0),this.needPax=mt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=mt(e,t+265,32,this.uname)||this.needPax,this.needPax=mt(e,t+297,32,this.gname)||this.needPax,this.needPax=Je(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Je(e,t+337,8,this.devmin)||this.needPax,this.needPax=mt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=mt(e,t+345,155,o)||this.needPax:(this.needPax=mt(e,t+345,130,o)||this.needPax,this.needPax=Ki(e,t+476,12,this.atime)||this.needPax,this.needPax=Ki(e,t+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];return this.cksum=a,Je(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return Ji.name.get(this[ee])||this[ee]}get typeKey(){return this[ee]}set type(e){Ji.code.has(e)?this[ee]=Ji.code.get(e):this[ee]=e}},mh=(r,e)=>{let s=r,i="",n,o=Lt.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=Lt.dirname(s),s=Lt.basename(s);do Buffer.byteLength(s)<=100&&Buffer.byteLength(i)<=e?n=[s,i,!1]:Buffer.byteLength(s)>100&&Buffer.byteLength(i)<=e?n=[s.slice(0,100-1),i,!0]:(s=Lt.join(Lt.basename(i),s),i=Lt.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},pt=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Yi=(r,e,t)=>dh(He(r,e,t)),dh=r=>r===null?null:new Date(r*1e3),He=(r,e,t)=>r[e]&128?Du.parse(r.slice(e,e+t)):gh(r,e,t),Dh=r=>isNaN(r)?null:r,gh=(r,e,t)=>Dh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),Eh={12:8589934591,8:2097151},Je=(r,e,t,s)=>s===null?!1:s>Eh[t]||s<0?(Du.encode(s,r.slice(e,e+t)),!0):(yh(r,e,t,s),!1),yh=(r,e,t,s)=>r.write(Ah(s,t),e,t,"ascii"),Ah=(r,e)=>Ch(Math.floor(r).toString(8),e),Ch=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",Ki=(r,e,t,s)=>s===null?!1:Je(r,e,t,s.getTime()/1e3),wh=new Array(156).join("\0"),mt=(r,e,t,s)=>s===null?!1:(r.write(s+wh,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);gu.exports=Zi});var ss=y((i0,Eu)=>{"use strict";u();var Fh=It(),bh=A("path"),yr=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e==="")return null;let t=Buffer.byteLength(e),s=512*Math.ceil(1+t/512),i=Buffer.allocUnsafe(s);for(let n=0;n<512;n++)i[n]=0;new Fh({path:("PaxHeader/"+bh.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(i),i.write(e,512,t,"utf8");for(let n=t+512;n<i.length;n++)i[n]=0;return i}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===void 0)return"";let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+`
|
|
2
|
-
`,i=Buffer.byteLength(s),n=Math.floor(Math.log(i)/Math.log(10))+1;return i+n>=Math.pow(10,n)&&(n+=1),n+i+s}};yr.parse=(r,e,t)=>new yr(
|
|
3
|
-
`).reduce(_h,Object.create(null)),_h=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.slice((t+" ").length);let s=e.split("="),i=s.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return r;let n=s.join("=");return r[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,r};Eu.exports=yr});var Mt=y((n0,yu)=>{u();yu.exports=r=>{let e=r.length-1,t=-1;for(;e>-1&&r.charAt(e)==="/";)t=e,e--;return t===-1?r:r.slice(0,t)}});var is=y((o0,Au)=>{"use strict";u();Au.exports=r=>class extends r{warn(e,t,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=t instanceof Error&&t.code||e,s.tarCode=e,!this.strict&&s.recoverable!==!1?(t instanceof Error&&(s=Object.assign(t,s),t=t.message),this.emit("warn",s.tarCode,t,s)):t instanceof Error?this.emit("error",Object.assign(t,s)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),s))}}});var Qi=y((a0,Cu)=>{"use strict";u();var ns=["|","<",">","?",":"],Xi=ns.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),Rh=new Map(ns.map((r,e)=>[r,Xi[e]])),Bh=new Map(Xi.map((r,e)=>[r,ns[e]]));Cu.exports={encode:r=>ns.reduce((e,t)=>e.split(t).join(Rh.get(t)),r),decode:r=>Xi.reduce((e,t)=>e.split(t).join(Bh.get(t)),r)}});var en=y((c0,Fu)=>{u();var{isAbsolute:vh,parse:wu}=A("path").win32;Fu.exports=r=>{let e="",t=wu(r);for(;vh(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=wu(r)}return[e,r]}});var Su=y((l0,bu)=>{"use strict";u();bu.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&-19),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var hn=y((p0,ju)=>{"use strict";u();var Ou=Hr(),Tu=ss(),Pu=It(),Ee=A("fs"),ku=A("path"),ge=Nt(),xh=Mt(),Nu=(r,e)=>e?(r=ge(r).replace(/^\.(\/|$)/,""),xh(e)+"/"+r):ge(r),Oh=16*1024*1024,_u=Symbol("process"),Ru=Symbol("file"),Bu=Symbol("directory"),rn=Symbol("symlink"),vu=Symbol("hardlink"),Ar=Symbol("header"),os=Symbol("read"),sn=Symbol("lstat"),us=Symbol("onlstat"),nn=Symbol("onread"),on=Symbol("onreadlink"),un=Symbol("openfile"),an=Symbol("onopenfile"),Ve=Symbol("close"),as=Symbol("mode"),cn=Symbol("awaitDrain"),tn=Symbol("ondrain"),ye=Symbol("prefix"),xu=Symbol("hadError"),Lu=is(),Th=Qi(),Iu=en(),Mu=Su(),cs=Lu(class extends Ou{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=ge(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||Oh,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=ge(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?ge(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Iu(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=Th.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=ge(t.absolute||ku.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[us](this.statCache.get(this.absolute)):this[sn]()}emit(e,...t){return e==="error"&&(this[xu]=!0),super.emit(e,...t)}[sn](){Ee.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[us](t)})}[us](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Nh(e),this.emit("stat",e),this[_u]()}[_u](){switch(this.type){case"File":return this[Ru]();case"Directory":return this[Bu]();case"SymbolicLink":return this[rn]();default:return this.end()}}[as](e){return Mu(e,this.type==="Directory",this.portable)}[ye](e){return Nu(e,this.prefix)}[Ar](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Pu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this[as](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Tu({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[Bu](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Ar](),this.end()}[rn](){Ee.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[on](t)})}[on](e){this.linkpath=ge(e),this[Ar](),this.end()}[vu](e){this.type="Link",this.linkpath=ge(ku.relative(this.cwd,e)),this.stat.size=0,this[Ar](),this.end()}[Ru](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[vu](t)}this.linkCache.set(e,this.absolute)}if(this[Ar](),this.stat.size===0)return this.end();this[un]()}[un](){Ee.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[an](t)})}[an](e){if(this.fd=e,this[xu])return this[Ve]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[os]()}[os](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ee.read(e,t,s,i,n,(o,a)=>{if(o)return this[Ve](()=>this.emit("error",o));this[nn](a)})}[Ve](e){Ee.close(this.fd,e)}[nn](e){if(e<=0&&this.remain>0){let i=new Error("encountered unexpected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Ve](()=>this.emit("error",i))}if(e>this.remain){let i=new Error("did not encounter expected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Ve](()=>this.emit("error",i))}if(e===this.remain)for(let i=e;i<this.length&&e<this.blockRemain;i++)this.buf[i+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(t)?this[tn]():this[cn](()=>this[tn]())}[cn](e){this.once("drain",e)}write(e){if(this.blockRemain<e.length){let t=new Error("writing more data than expected");return t.path=this.absolute,this.emit("error",t)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[tn](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Ve](e=>e?this.emit("error",e):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[os]()}}),ln=class extends cs{[sn](){this[us](Ee.lstatSync(this.absolute))}[rn](){this[on](Ee.readlinkSync(this.absolute))}[un](){this[an](Ee.openSync(this.absolute,"r"))}[os](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ee.readSync(t,s,i,n,o);this[nn](a),e=!1}finally{if(e)try{this[Ve](()=>{})}catch{}}}[cn](e){e()}[Ve](e){Ee.closeSync(this.fd),e()}},Ph=Lu(class extends Ou{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=t.prefix||null,this.path=ge(e.path),this.mode=this[as](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=ge(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Iu(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Pu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Tu({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[ye](e){return Nu(e,this.prefix)}[as](e){return Mu(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});cs.Sync=ln;cs.Tar=Ph;var Nh=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";ju.exports=cs});var qu=y((m0,Uu)=>{"use strict";u();Uu.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var fn=y((d0,$u)=>{"use strict";u();$u.exports=_;_.Node=dt;_.create=_;function _(r){var e=this;if(e instanceof _||(e=new _),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var t=0,s=arguments.length;t<s;t++)e.push(arguments[t]);return e}_.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var e=r.next,t=r.prev;return e&&(e.prev=t),t&&(t.next=e),r===this.head&&(this.head=e),r===this.tail&&(this.tail=t),r.list.length--,r.next=null,r.prev=null,r.list=null,e};_.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var e=this.head;r.list=this,r.next=e,e&&(e.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};_.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var e=this.tail;r.list=this,r.prev=e,e&&(e.next=r),this.tail=r,this.head||(this.head=r),this.length++}};_.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)Ih(this,arguments[r]);return this.length};_.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Mh(this,arguments[r]);return this.length};_.prototype.pop=function(){if(!!this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};_.prototype.shift=function(){if(!!this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};_.prototype.forEach=function(r,e){e=e||this;for(var t=this.head,s=0;t!==null;s++)r.call(e,t.value,s,this),t=t.next};_.prototype.forEachReverse=function(r,e){e=e||this;for(var t=this.tail,s=this.length-1;t!==null;s--)r.call(e,t.value,s,this),t=t.prev};_.prototype.get=function(r){for(var e=0,t=this.head;t!==null&&e<r;e++)t=t.next;if(e===r&&t!==null)return t.value};_.prototype.getReverse=function(r){for(var e=0,t=this.tail;t!==null&&e<r;e++)t=t.prev;if(e===r&&t!==null)return t.value};_.prototype.map=function(r,e){e=e||this;for(var t=new _,s=this.head;s!==null;)t.push(r.call(e,s.value,this)),s=s.next;return t};_.prototype.mapReverse=function(r,e){e=e||this;for(var t=new _,s=this.tail;s!==null;)t.push(r.call(e,s.value,this)),s=s.prev;return t};_.prototype.reduce=function(r,e){var t,s=this.head;if(arguments.length>1)t=e;else if(this.head)s=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;s!==null;i++)t=r(t,s.value,i),s=s.next;return t};_.prototype.reduceReverse=function(r,e){var t,s=this.tail;if(arguments.length>1)t=e;else if(this.tail)s=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;s!==null;i--)t=r(t,s.value,i),s=s.prev;return t};_.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};_.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};_.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new _;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(;i!==null&&s<e;s++,i=i.next)t.push(i.value);return t};_.prototype.sliceReverse=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new _;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=this.length,i=this.tail;i!==null&&s>e;s--)i=i.prev;for(;i!==null&&s>r;s--,i=i.prev)t.push(i.value);return t};_.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(var n=[],s=0;i&&s<e;s++)n.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var s=0;s<t.length;s++)i=Lh(this,i,t[s]);return n};_.prototype.reverse=function(){for(var r=this.head,e=this.tail,t=r;t!==null;t=t.prev){var s=t.prev;t.prev=t.next,t.next=s}return this.head=e,this.tail=r,this};function Lh(r,e,t){var s=e===r.head?new dt(t,null,e,r):new dt(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function Ih(r,e){r.tail=new dt(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Mh(r,e){r.head=new dt(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function dt(r,e,t,s){if(!(this instanceof dt))return new dt(r,e,t,s);this.list=s,this.value=r,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{qu()(_)}catch{}});var Es=y((g0,Yu)=>{"use strict";u();var Ds=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},jh=Hr(),Uh=zi(),qh=ts(),Cn=hn(),$h=Cn.Sync,zh=Cn.Tar,Wh=fn(),zu=Buffer.alloc(1024),fs=Symbol("onStat"),ls=Symbol("ended"),Ae=Symbol("queue"),jt=Symbol("current"),Dt=Symbol("process"),hs=Symbol("processing"),Wu=Symbol("processJob"),Ce=Symbol("jobs"),pn=Symbol("jobDone"),ps=Symbol("addFSEntry"),Gu=Symbol("addTarEntry"),gn=Symbol("stat"),En=Symbol("readdir"),ms=Symbol("onreaddir"),ds=Symbol("pipe"),Hu=Symbol("entry"),mn=Symbol("entryOpt"),yn=Symbol("writeEntryClass"),Vu=Symbol("write"),dn=Symbol("ondrain"),gs=A("fs"),Ju=A("path"),Gh=is(),Dn=Nt(),wn=Gh(class extends jh{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=Dn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[yn]=Cn,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Uh.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[dn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[dn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[Ae]=new Wh,this[Ce]=0,this.jobs=+e.jobs||4,this[hs]=!1,this[ls]=!1}[Vu](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ls]=!0,this[Dt](),this}write(e){if(this[ls])throw new Error("write after end");return e instanceof qh?this[Gu](e):this[ps](e),this.flowing}[Gu](e){let t=Dn(Ju.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new Ds(e.path,t,!1);s.entry=new zh(e,this[mn](s)),s.entry.on("end",i=>this[pn](s)),this[Ce]+=1,this[Ae].push(s)}this[Dt]()}[ps](e){let t=Dn(Ju.resolve(this.cwd,e));this[Ae].push(new Ds(e,t)),this[Dt]()}[gn](e){e.pending=!0,this[Ce]+=1;let t=this.follow?"stat":"lstat";gs[t](e.absolute,(s,i)=>{e.pending=!1,this[Ce]-=1,s?this.emit("error",s):this[fs](e,i)})}[fs](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Dt]()}[En](e){e.pending=!0,this[Ce]+=1,gs.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[Ce]-=1,t)return this.emit("error",t);this[ms](e,s)})}[ms](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Dt]()}[Dt](){if(!this[hs]){this[hs]=!0;for(let e=this[Ae].head;e!==null&&this[Ce]<this.jobs;e=e.next)if(this[Wu](e.value),e.value.ignore){let t=e.next;this[Ae].removeNode(e),e.next=t}this[hs]=!1,this[ls]&&!this[Ae].length&&this[Ce]===0&&(this.zip?this.zip.end(zu):(super.write(zu),super.end()))}}get[jt](){return this[Ae]&&this[Ae].head&&this[Ae].head.value}[pn](e){this[Ae].shift(),this[Ce]-=1,this[Dt]()}[Wu](e){if(!e.pending){if(e.entry){e===this[jt]&&!e.piped&&this[ds](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[fs](e,this.statCache.get(e.absolute)):this[gn](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[ms](e,this.readdirCache.get(e.absolute)):this[En](e),!e.readdir))){if(e.entry=this[Hu](e),!e.entry){e.ignore=!0;return}e===this[jt]&&!e.piped&&this[ds](e)}}}[mn](e){return{onwarn:(t,s,i)=>this.warn(t,s,i),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[Hu](e){this[Ce]+=1;try{return new this[yn](e.path,this[mn](e)).on("end",()=>this[pn](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[dn](){this[jt]&&this[jt].entry&&this[jt].entry.resume()}[ds](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)});let t=e.entry,s=this.zip;s?t.on("data",i=>{s.write(i)||t.pause()}):t.on("data",i=>{super.write(i)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),An=class extends wn{constructor(e){super(e),this[yn]=$h}pause(){}resume(){}[gn](e){let t=this.follow?"statSync":"lstatSync";this[fs](e,gs[t](e.absolute))}[En](e,t){this[ms](e,gs.readdirSync(e.absolute))}[ds](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[Vu](i)})}};wn.Sync=An;Yu.exports=wn});var Jt=y(wr=>{"use strict";u();var Hh=_i(),Jh=A("events").EventEmitter,K=A("fs"),Sn=K.writev;if(!Sn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;Sn=(t,s,i,n)=>{let o=(l,c)=>n(l,c,s),a=new e;a.oncomplete=o,r.writeBuffers(t,s,i,a)}}var Gt=Symbol("_autoClose"),pe=Symbol("_close"),Cr=Symbol("_ended"),v=Symbol("_fd"),Ku=Symbol("_finished"),Ke=Symbol("_flags"),Fn=Symbol("_flush"),kn=Symbol("_handleChunk"),_n=Symbol("_makeBuf"),Fs=Symbol("_mode"),ys=Symbol("_needDrain"),zt=Symbol("_onerror"),Ht=Symbol("_onopen"),bn=Symbol("_onread"),qt=Symbol("_onwrite"),Ze=Symbol("_open"),Le=Symbol("_path"),gt=Symbol("_pos"),we=Symbol("_queue"),$t=Symbol("_read"),Zu=Symbol("_readSize"),Ye=Symbol("_reading"),As=Symbol("_remain"),Xu=Symbol("_size"),Cs=Symbol("_write"),Ut=Symbol("_writing"),ws=Symbol("_defaultFlag"),Wt=Symbol("_errored"),bs=class extends Hh{constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Wt]=!1,this[v]=typeof t.fd=="number"?t.fd:null,this[Le]=e,this[Zu]=t.readSize||16*1024*1024,this[Ye]=!1,this[Xu]=typeof t.size=="number"?t.size:1/0,this[As]=this[Xu],this[Gt]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[v]=="number"?this[$t]():this[Ze]()}get fd(){return this[v]}get path(){return this[Le]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ze](){K.open(this[Le],"r",(e,t)=>this[Ht](e,t))}[Ht](e,t){e?this[zt](e):(this[v]=t,this.emit("open",t),this[$t]())}[_n](){return Buffer.allocUnsafe(Math.min(this[Zu],this[As]))}[$t](){if(!this[Ye]){this[Ye]=!0;let e=this[_n]();if(e.length===0)return process.nextTick(()=>this[bn](null,0,e));K.read(this[v],e,0,e.length,null,(t,s,i)=>this[bn](t,s,i))}}[bn](e,t,s){this[Ye]=!1,e?this[zt](e):this[kn](t,s)&&this[$t]()}[pe](){if(this[Gt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[zt](e){this[Ye]=!0,this[pe](),this.emit("error",e)}[kn](e,t){let s=!1;return this[As]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[As]<=0)&&(s=!1,this[pe](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[v]=="number"&&this[$t]();break;case"error":return this[Wt]?void 0:(this[Wt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Rn=class extends bs{[Ze](){let e=!0;try{this[Ht](null,K.openSync(this[Le],"r")),e=!1}finally{e&&this[pe]()}}[$t](){let e=!0;try{if(!this[Ye]){this[Ye]=!0;do{let t=this[_n](),s=t.length===0?0:K.readSync(this[v],t,0,t.length,null);if(!this[kn](s,t))break}while(!0);this[Ye]=!1}e=!1}finally{e&&this[pe]()}}[pe](){if(this[Gt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,K.closeSync(e),this.emit("close")}}},Ss=class extends Jh{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Wt]=!1,this[Ut]=!1,this[Cr]=!1,this[ys]=!1,this[we]=[],this[Le]=e,this[v]=typeof t.fd=="number"?t.fd:null,this[Fs]=t.mode===void 0?438:t.mode,this[gt]=typeof t.start=="number"?t.start:null,this[Gt]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[gt]!==null?"r+":"w";this[ws]=t.flags===void 0,this[Ke]=this[ws]?s:t.flags,this[v]===null&&this[Ze]()}emit(e,t){if(e==="error"){if(this[Wt])return;this[Wt]=!0}return super.emit(e,t)}get fd(){return this[v]}get path(){return this[Le]}[zt](e){this[pe](),this[Ut]=!0,this.emit("error",e)}[Ze](){K.open(this[Le],this[Ke],this[Fs],(e,t)=>this[Ht](e,t))}[Ht](e,t){this[ws]&&this[Ke]==="r+"&&e&&e.code==="ENOENT"?(this[Ke]="w",this[Ze]()):e?this[zt](e):(this[v]=t,this.emit("open",t),this[Fn]())}end(e,t){return e&&this.write(e,t),this[Cr]=!0,!this[Ut]&&!this[we].length&&typeof this[v]=="number"&&this[qt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Cr]?(this.emit("error",new Error("write() after end()")),!1):this[v]===null||this[Ut]||this[we].length?(this[we].push(e),this[ys]=!0,!1):(this[Ut]=!0,this[Cs](e),!0)}[Cs](e){K.write(this[v],e,0,e.length,this[gt],(t,s)=>this[qt](t,s))}[qt](e,t){e?this[zt](e):(this[gt]!==null&&(this[gt]+=t),this[we].length?this[Fn]():(this[Ut]=!1,this[Cr]&&!this[Ku]?(this[Ku]=!0,this[pe](),this.emit("finish")):this[ys]&&(this[ys]=!1,this.emit("drain"))))}[Fn](){if(this[we].length===0)this[Cr]&&this[qt](null,0);else if(this[we].length===1)this[Cs](this[we].pop());else{let e=this[we];this[we]=[],Sn(this[v],e,this[gt],(t,s)=>this[qt](t,s))}}[pe](){if(this[Gt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Bn=class extends Ss{[Ze](){let e;if(this[ws]&&this[Ke]==="r+")try{e=K.openSync(this[Le],this[Ke],this[Fs])}catch(t){if(t.code==="ENOENT")return this[Ke]="w",this[Ze]();throw t}else e=K.openSync(this[Le],this[Ke],this[Fs]);this[Ht](null,e)}[pe](){if(this[Gt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,K.closeSync(e),this.emit("close")}}[Cs](e){let t=!0;try{this[qt](null,K.writeSync(this[v],e,0,e.length,this[gt])),t=!1}finally{if(t)try{this[pe]()}catch{}}}};wr.ReadStream=bs;wr.ReadStreamSync=Rn;wr.WriteStream=Ss;wr.WriteStreamSync=Bn});var Os=y((A0,oa)=>{"use strict";u();var Vh=is(),Yh=It(),Kh=A("events"),Zh=fn(),Xh=1024*1024,Qh=ts(),Qu=ss(),ef=zi(),{nextTick:tf}=A("process"),vn=Buffer.from([31,139]),ie=Symbol("state"),Et=Symbol("writeEntry"),Ie=Symbol("readEntry"),xn=Symbol("nextEntry"),ea=Symbol("processEntry"),ne=Symbol("extendedHeader"),Fr=Symbol("globalExtendedHeader"),Xe=Symbol("meta"),ta=Symbol("emitMeta"),T=Symbol("buffer"),Me=Symbol("queue"),yt=Symbol("ended"),ra=Symbol("emittedEnd"),At=Symbol("emit"),Z=Symbol("unzip"),ks=Symbol("consumeChunk"),_s=Symbol("consumeChunkSub"),On=Symbol("consumeBody"),sa=Symbol("consumeMeta"),ia=Symbol("consumeHeader"),Rs=Symbol("consuming"),Tn=Symbol("bufferConcat"),Pn=Symbol("maybeEnd"),br=Symbol("writing"),Qe=Symbol("aborted"),Bs=Symbol("onDone"),Ct=Symbol("sawValidEntry"),vs=Symbol("sawNullBlock"),xs=Symbol("sawEOF"),na=Symbol("closeStream"),rf=r=>!0;oa.exports=Vh(class extends Kh{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Ct]=null,this.on(Bs,t=>{(this[ie]==="begin"||this[Ct]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Bs,e.ondone):this.on(Bs,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Xh,this.filter=typeof e.filter=="function"?e.filter:rf,this.writable=!0,this.readable=!1,this[Me]=new Zh,this[T]=null,this[Ie]=null,this[Et]=null,this[ie]="begin",this[Xe]="",this[ne]=null,this[Fr]=null,this[yt]=!1,this[Z]=null,this[Qe]=!1,this[vs]=!1,this[xs]=!1,this.on("end",()=>this[na]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[ia](e,t){this[Ct]===null&&(this[Ct]=!1);let s;try{s=new Yh(e,t,this[ne],this[Fr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[vs]?(this[xs]=!0,this[ie]==="begin"&&(this[ie]="header"),this[At]("eof")):(this[vs]=!0,this[At]("nullBlock"));else if(this[vs]=!1,!s.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:s});else if(!s.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:s});else{let i=s.type;if(/^(Symbolic)?Link$/.test(i)&&!s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:s});else if(!/^(Symbolic)?Link$/.test(i)&&s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:s});else{let n=this[Et]=new Qh(s,this[ne],this[Fr]);if(!this[Ct])if(n.remain){let o=()=>{n.invalid||(this[Ct]=!0)};n.on("end",o)}else this[Ct]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[At]("ignoredEntry",n),this[ie]="ignore",n.resume()):n.size>0&&(this[Xe]="",n.on("data",o=>this[Xe]+=o),this[ie]="meta"):(this[ne]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[At]("ignoredEntry",n),this[ie]=n.remain?"ignore":"header",n.resume()):(n.remain?this[ie]="body":(this[ie]="header",n.end()),this[Ie]?this[Me].push(n):(this[Me].push(n),this[xn]())))}}}[na](){tf(()=>this.emit("close"))}[ea](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Ie]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[xn]()),t=!1)):(this[Ie]=null,t=!1),t}[xn](){do;while(this[ea](this[Me].shift()));if(!this[Me].length){let e=this[Ie];!e||e.flowing||e.size===e.remain?this[br]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[On](e,t){let s=this[Et],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[ie]="header",this[Et]=null,s.end()),n.length}[sa](e,t){let s=this[Et],i=this[On](e,t);return this[Et]||this[ta](s),i}[At](e,t,s){!this[Me].length&&!this[Ie]?this.emit(e,t,s):this[Me].push([e,t,s])}[ta](e){switch(this[At]("meta",this[Xe]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ne]=Qu.parse(this[Xe],this[ne],!1);break;case"GlobalExtendedHeader":this[Fr]=Qu.parse(this[Xe],this[Fr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ne]=this[ne]||Object.create(null),this[ne].path=this[Xe].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ne]=this[ne]||Object.create(null),this[ne].linkpath=this[Xe].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Qe]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[Qe])return;if(this[Z]===null&&e){if(this[T]&&(e=Buffer.concat([this[T],e]),this[T]=null),e.length<vn.length)return this[T]=e,!0;for(let s=0;this[Z]===null&&s<vn.length;s++)e[s]!==vn[s]&&(this[Z]=!1);if(this[Z]===null){let s=this[yt];this[yt]=!1,this[Z]=new ef.Unzip,this[Z].on("data",n=>this[ks](n)),this[Z].on("error",n=>this.abort(n)),this[Z].on("end",n=>{this[yt]=!0,this[ks]()}),this[br]=!0;let i=this[Z][s?"end":"write"](e);return this[br]=!1,i}}this[br]=!0,this[Z]?this[Z].write(e):this[ks](e),this[br]=!1;let t=this[Me].length?!1:this[Ie]?this[Ie].flowing:!0;return!t&&!this[Me].length&&this[Ie].once("drain",s=>this.emit("drain")),t}[Tn](e){e&&!this[Qe]&&(this[T]=this[T]?Buffer.concat([this[T],e]):e)}[Pn](){if(this[yt]&&!this[ra]&&!this[Qe]&&!this[Rs]){this[ra]=!0;let e=this[Et];if(e&&e.blockRemain){let t=this[T]?this[T].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[T]&&e.write(this[T]),e.end()}this[At](Bs)}}[ks](e){if(this[Rs])this[Tn](e);else if(!e&&!this[T])this[Pn]();else{if(this[Rs]=!0,this[T]){this[Tn](e);let t=this[T];this[T]=null,this[_s](t)}else this[_s](e);for(;this[T]&&this[T].length>=512&&!this[Qe]&&!this[xs];){let t=this[T];this[T]=null,this[_s](t)}this[Rs]=!1}(!this[T]||this[yt])&&this[Pn]()}[_s](e){let t=0,s=e.length;for(;t+512<=s&&!this[Qe]&&!this[xs];)switch(this[ie]){case"begin":case"header":this[ia](e,t),t+=512;break;case"ignore":case"body":t+=this[On](e,t);break;case"meta":t+=this[sa](e,t);break;default:throw new Error("invalid state: "+this[ie])}t<s&&(this[T]?this[T]=Buffer.concat([e.slice(t),this[T]]):this[T]=e.slice(t))}end(e){this[Qe]||(this[Z]?this[Z].end(e):(this[yt]=!0,this.write(e)))}})});var Ts=y((C0,la)=>{"use strict";u();var sf=vt(),aa=Os(),Vt=A("fs"),nf=Jt(),ua=A("path"),Nn=Mt();la.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=sf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&uf(s,e),s.noResume||of(s),s.file&&s.sync?af(s):s.file?cf(s,t):ca(s)};var of=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},uf=(r,e)=>{let t=new Map(e.map(n=>[Nn(n),!0])),s=r.filter,i=(n,o)=>{let a=o||ua.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(ua.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(Nn(n)):n=>i(Nn(n))},af=r=>{let e=ca(r),t=r.file,s=!0,i;try{let n=Vt.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(Vt.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=Vt.openSync(t,"r");a<n.size;){let c=Vt.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{Vt.closeSync(i)}catch{}}},cf=(r,e)=>{let t=new aa(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Vt.stat(i,(l,c)=>{if(l)a(l);else{let h=new nf.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},ca=r=>new aa(r)});var Da=y((w0,da)=>{"use strict";u();var lf=vt(),Ps=Es(),ha=Jt(),fa=Ts(),pa=A("path");da.exports=(r,e,t)=>{if(typeof e=="function"&&(t=e),Array.isArray(r)&&(e=r,r={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let s=lf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return s.file&&s.sync?hf(s,e):s.file?ff(s,e,t):s.sync?pf(s,e):mf(s,e)};var hf=(r,e)=>{let t=new Ps.Sync(r),s=new ha.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),ma(t,e)},ff=(r,e,t)=>{let s=new Ps(r),i=new ha.WriteStream(r.file,{mode:r.mode||438});s.pipe(i);let n=new Promise((o,a)=>{i.on("error",a),i.on("close",o),s.on("error",a)});return Ln(s,e),t?n.then(t,t):n},ma=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?fa({file:pa.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Ln=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return fa({file:pa.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Ln(r,e));r.add(t)}r.end()},pf=(r,e)=>{let t=new Ps.Sync(r);return ma(t,e),t},mf=(r,e)=>{let t=new Ps(r);return Ln(t,e),t}});var In=y((F0,Fa)=>{"use strict";u();var df=vt(),ga=Es(),te=A("fs"),Ea=Jt(),ya=Ts(),Aa=A("path"),Ca=It();Fa.exports=(r,e,t)=>{let s=df(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),s.sync?Df(s,e):Ef(s,e,t)};var Df=(r,e)=>{let t=new ga.Sync(r),s=!0,i,n;try{try{i=te.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=te.openSync(r.file,"w+");else throw l}let o=te.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,d=0;h<512;h+=d){if(d=te.readSync(i,a,h,a.length-h,n+h),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!d)break e}let l=new Ca(a);if(!l.cksumValid)break;let c=512*Math.ceil(l.size/512);if(n+c+512>o.size)break;n+=c,r.mtimeCache&&r.mtimeCache.set(l.path,l.mtime)}s=!1,gf(r,t,n,i,e)}finally{if(s)try{te.closeSync(i)}catch{}}},gf=(r,e,t,s,i)=>{let n=new Ea.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),yf(e,i)},Ef=(r,e,t)=>{e=Array.from(e);let s=new ga(r),i=(o,a,l)=>{let c=(S,P)=>{S?te.close(o,k=>l(S)):l(null,P)},h=0;if(a===0)return c(null,0);let d=0,g=Buffer.alloc(512),w=(S,P)=>{if(S)return c(S);if(d+=P,d<512&&P)return te.read(o,g,d,g.length-d,h+d,w);if(h===0&&g[0]===31&&g[1]===139)return c(new Error("cannot append to compressed archives"));if(d<512)return c(null,h);let k=new Ca(g);if(!k.cksumValid)return c(null,h);let O=512*Math.ceil(k.size/512);if(h+O+512>a||(h+=O+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(k.path,k.mtime),d=0,te.read(o,g,0,512,h,w)};te.read(o,g,0,512,h,w)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,d)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",te.open(r.file,l,c);if(h)return a(h);te.fstat(d,(g,w)=>{if(g)return te.close(d,()=>a(g));i(d,w.size,(S,P)=>{if(S)return a(S);let k=new Ea.WriteStream(r.file,{fd:d,start:P});s.pipe(k),k.on("error",a),k.on("close",o),wa(s,e)})})};te.open(r.file,l,c)});return t?n.then(t,t):n},yf=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?ya({file:Aa.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},wa=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return ya({file:Aa.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>wa(r,e));r.add(t)}r.end()}});var Sa=y((b0,ba)=>{"use strict";u();var Af=vt(),Cf=In();ba.exports=(r,e,t)=>{let s=Af(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),wf(s),Cf(s,e,t)};var wf=r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,s)=>e(t,s)&&!(r.mtimeCache.get(t)>s.mtime):(t,s)=>!(r.mtimeCache.get(t)>s.mtime)}});var Ra=y((S0,_a)=>{u();var{promisify:ka}=A("util"),et=A("fs"),Ff=r=>{if(!r)r={mode:511,fs:et};else if(typeof r=="object")r={mode:511,fs:et,...r};else if(typeof r=="number")r={mode:r,fs:et};else if(typeof r=="string")r={mode:parseInt(r,8),fs:et};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||et.mkdir,r.mkdirAsync=ka(r.mkdir),r.stat=r.stat||r.fs.stat||et.stat,r.statAsync=ka(r.stat),r.statSync=r.statSync||r.fs.statSync||et.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||et.mkdirSync,r};_a.exports=Ff});var va=y((k0,Ba)=>{u();var bf=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Sf,parse:kf}=A("path"),_f=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=Sf(r),bf==="win32"){let e=/[*|"<>?:]/,{root:t}=kf(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Ba.exports=_f});var Na=y((_0,Pa)=>{u();var{dirname:xa}=A("path"),Oa=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?Oa(r,xa(e),e):void 0),Ta=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Ta(r,xa(e),e):void 0}};Pa.exports={findMade:Oa,findMadeSync:Ta}});var Un=y((R0,Ia)=>{u();var{dirname:La}=A("path"),Mn=(r,e,t)=>{e.recursive=!1;let s=La(r);return s===r?e.mkdirAsync(r,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(r,e).then(()=>t||r,i=>{if(i.code==="ENOENT")return Mn(s,e).then(n=>Mn(r,e,n));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;return e.statAsync(r).then(n=>{if(n.isDirectory())return t;throw i},()=>{throw i})})},jn=(r,e,t)=>{let s=La(r);if(e.recursive=!1,s===r)try{return e.mkdirSync(r,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(r,e),t||r}catch(i){if(i.code==="ENOENT")return jn(r,e,jn(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};Ia.exports={mkdirpManual:Mn,mkdirpManualSync:jn}});var Ua=y((B0,ja)=>{u();var{dirname:Ma}=A("path"),{findMade:Rf,findMadeSync:Bf}=Na(),{mkdirpManual:vf,mkdirpManualSync:xf}=Un(),Of=(r,e)=>(e.recursive=!0,Ma(r)===r?e.mkdirAsync(r,e):Rf(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return vf(r,e);throw i}))),Tf=(r,e)=>{if(e.recursive=!0,Ma(r)===r)return e.mkdirSync(r,e);let s=Bf(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return xf(r,e);throw i}};ja.exports={mkdirpNative:Of,mkdirpNativeSync:Tf}});var Wa=y((v0,za)=>{u();var qa=A("fs"),Pf=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,qn=Pf.replace(/^v/,"").split("."),$a=+qn[0]>10||+qn[0]==10&&+qn[1]>=12,Nf=$a?r=>r.mkdir===qa.mkdir:()=>!1,Lf=$a?r=>r.mkdirSync===qa.mkdirSync:()=>!1;za.exports={useNative:Nf,useNativeSync:Lf}});var Ka=y((x0,Ya)=>{u();var Yt=Ra(),Kt=va(),{mkdirpNative:Ga,mkdirpNativeSync:Ha}=Ua(),{mkdirpManual:Ja,mkdirpManualSync:Va}=Un(),{useNative:If,useNativeSync:Mf}=Wa(),Zt=(r,e)=>(r=Kt(r),e=Yt(e),If(e)?Ga(r,e):Ja(r,e)),jf=(r,e)=>(r=Kt(r),e=Yt(e),Mf(e)?Ha(r,e):Va(r,e));Zt.sync=jf;Zt.native=(r,e)=>Ga(Kt(r),Yt(e));Zt.manual=(r,e)=>Ja(Kt(r),Yt(e));Zt.nativeSync=(r,e)=>Ha(Kt(r),Yt(e));Zt.manualSync=(r,e)=>Va(Kt(r),Yt(e));Ya.exports=Zt});var sc=y((O0,rc)=>{"use strict";u();var oe=A("fs"),wt=A("path"),Uf=oe.lchown?"lchown":"chown",qf=oe.lchownSync?"lchownSync":"chownSync",Xa=oe.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Za=(r,e,t)=>{try{return oe[qf](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},$f=(r,e,t)=>{try{return oe.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},zf=Xa?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):oe.chown(r,e,t,s)}:(r,e,t,s)=>s,$n=Xa?(r,e,t)=>{try{return Za(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;$f(r,e,t)}}:(r,e,t)=>Za(r,e,t),Wf=process.version,Qa=(r,e,t)=>oe.readdir(r,e,t),Gf=(r,e)=>oe.readdirSync(r,e);/^v4\./.test(Wf)&&(Qa=(r,e,t)=>oe.readdir(r,t));var Ns=(r,e,t,s)=>{oe[Uf](r,e,t,zf(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},ec=(r,e,t,s,i)=>{if(typeof e=="string")return oe.lstat(wt.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,ec(r,o,t,s,i)});if(e.isDirectory())zn(wt.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=wt.resolve(r,e.name);Ns(o,t,s,i)});else{let n=wt.resolve(r,e.name);Ns(n,t,s,i)}},zn=(r,e,t,s)=>{Qa(r,{withFileTypes:!0},(i,n)=>{if(i){if(i.code==="ENOENT")return s();if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return s(i)}if(i||!n.length)return Ns(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Ns(r,e,t,s)}};n.forEach(c=>ec(r,c,e,t,l))})},Hf=(r,e,t,s)=>{if(typeof e=="string")try{let i=oe.lstatSync(wt.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&tc(wt.resolve(r,e.name),t,s),$n(wt.resolve(r,e.name),t,s)},tc=(r,e,t)=>{let s;try{s=Gf(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return $n(r,e,t);throw i}return s&&s.length&&s.forEach(i=>Hf(r,i,e,t)),$n(r,e,t)};rc.exports=zn;zn.sync=tc});var uc=y((T0,Wn)=>{"use strict";u();var ic=Ka(),ue=A("fs"),Ls=A("path"),nc=sc(),me=Nt(),Is=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Ms=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},js=(r,e)=>r.get(me(e)),Sr=(r,e,t)=>r.set(me(e),t),Jf=(r,e)=>{ue.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Ms(r,t&&t.code||"ENOTDIR")),e(t)})};Wn.exports=(r,e,t)=>{r=me(r);let s=e.umask,i=e.mode|448,n=(i&s)!==0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,h=e.unlink,d=e.cache,g=me(e.cwd),w=(k,O)=>{k?t(k):(Sr(d,r,!0),O&&l?nc(O,o,a,ut=>w(ut)):n?ue.chmod(r,i,t):t())};if(d&&js(d,r)===!0)return w();if(r===g)return Jf(r,w);if(c)return ic(r,{mode:i}).then(k=>w(null,k),w);let P=me(Ls.relative(g,r)).split("/");Us(g,P,i,d,h,g,null,w)};var Us=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=me(Ls.resolve(r+"/"+l));if(js(s,c))return Us(c,e,t,s,i,n,o,a);ue.mkdir(c,t,oc(c,e,t,s,i,n,o,a))},oc=(r,e,t,s,i,n,o,a)=>l=>{l?ue.lstat(r,(c,h)=>{if(c)c.path=c.path&&me(c.path),a(c);else if(h.isDirectory())Us(r,e,t,s,i,n,o,a);else if(i)ue.unlink(r,d=>{if(d)return a(d);ue.mkdir(r,t,oc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new Is(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,Us(r,e,t,s,i,n,o,a))},Vf=r=>{let e=!1,t="ENOTDIR";try{e=ue.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Ms(r,t)}};Wn.exports.sync=(r,e)=>{r=me(r);let t=e.umask,s=e.mode|448,i=(s&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,h=e.cache,d=me(e.cwd),g=k=>{Sr(h,r,!0),k&&a&&nc.sync(k,n,o),i&&ue.chmodSync(r,s)};if(h&&js(h,r)===!0)return g();if(r===d)return Vf(d),g();if(l)return g(ic.sync(r,s));let S=me(Ls.relative(d,r)).split("/"),P=null;for(let k=S.shift(),O=d;k&&(O+="/"+k);k=S.shift())if(O=me(Ls.resolve(O)),!js(h,O))try{ue.mkdirSync(O,s),P=P||O,Sr(h,O,!0)}catch{let de=ue.lstatSync(O);if(de.isDirectory()){Sr(h,O,!0);continue}else if(c){ue.unlinkSync(O),ue.mkdirSync(O,s),P=P||O,Sr(h,O,!0);continue}else if(de.isSymbolicLink())return new Is(O,O+"/"+S.join("/"))}return g(P)}});var Hn=y((P0,ac)=>{u();var Gn=Object.create(null),{hasOwnProperty:Yf}=Object.prototype;ac.exports=r=>(Yf.call(Gn,r)||(Gn[r]=r.normalize("NFKD")),Gn[r])});var fc=y((N0,hc)=>{u();var cc=A("assert"),Kf=Hn(),Zf=Mt(),{join:lc}=A("path"),Xf=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Qf=Xf==="win32";hc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((d,g)=>(d.length&&(g=lc(d[d.length-1],g)),d.push(g||"/"),d),[]),s=new Set,i=c=>{let h=e.get(c);if(!h)throw new Error("function does not have any path reservations");return{paths:h.paths.map(d=>r.get(d)),dirs:[...h.dirs].map(d=>r.get(d))}},n=c=>{let{paths:h,dirs:d}=i(c);return h.every(g=>g[0]===c)&&d.every(g=>g[0]instanceof Set&&g[0].has(c))},o=c=>s.has(c)||!n(c)?!1:(s.add(c),c(()=>a(c)),!0),a=c=>{if(!s.has(c))return!1;let{paths:h,dirs:d}=e.get(c),g=new Set;return h.forEach(w=>{let S=r.get(w);cc.equal(S[0],c),S.length===1?r.delete(w):(S.shift(),typeof S[0]=="function"?g.add(S[0]):S[0].forEach(P=>g.add(P)))}),d.forEach(w=>{let S=r.get(w);cc(S[0]instanceof Set),S[0].size===1&&S.length===1?r.delete(w):S[0].size===1?(S.shift(),g.add(S[0])):S[0].delete(c)}),s.delete(c),g.forEach(w=>o(w)),!0};return{check:n,reserve:(c,h)=>{c=Qf?["win32 parallelization disabled"]:c.map(g=>Kf(Zf(lc(g))).toLowerCase());let d=new Set(c.map(g=>t(g)).reduce((g,w)=>g.concat(w)));return e.set(h,{dirs:d,paths:c}),c.forEach(g=>{let w=r.get(g);w?w.push(h):r.set(g,[h])}),d.forEach(g=>{let w=r.get(g);w?w[w.length-1]instanceof Set?w[w.length-1].add(h):w.push(new Set([h])):r.set(g,[new Set([h])])}),o(h)}}}});var dc=y((L0,mc)=>{u();var ep=process.env.__FAKE_PLATFORM__||process.platform,tp=ep==="win32",rp=global.__FAKE_TESTING_FS__||A("fs"),{O_CREAT:sp,O_TRUNC:ip,O_WRONLY:np,UV_FS_O_FILEMAP:pc=0}=rp.constants,op=tp&&!!pc,up=512*1024,ap=pc|ip|sp|np;mc.exports=op?r=>r<up?ap:"w":()=>"w"});var to=y((I0,Bc)=>{"use strict";u();var cp=A("assert"),lp=Os(),R=A("fs"),hp=Jt(),je=A("path"),kc=uc(),Dc=Qi(),fp=fc(),pp=en(),re=Nt(),mp=Mt(),dp=Hn(),gc=Symbol("onEntry"),Yn=Symbol("checkFs"),Ec=Symbol("checkFs2"),zs=Symbol("pruneCache"),Kn=Symbol("isReusable"),ae=Symbol("makeFs"),Zn=Symbol("file"),Xn=Symbol("directory"),Ws=Symbol("link"),yc=Symbol("symlink"),Ac=Symbol("hardlink"),Cc=Symbol("unsupported"),wc=Symbol("checkPath"),tt=Symbol("mkdir"),G=Symbol("onError"),qs=Symbol("pending"),Fc=Symbol("pend"),Xt=Symbol("unpend"),Jn=Symbol("ended"),Vn=Symbol("maybeClose"),Qn=Symbol("skip"),kr=Symbol("doChown"),_r=Symbol("uid"),Rr=Symbol("gid"),Br=Symbol("checkedCwd"),_c=A("crypto"),Rc=dc(),Dp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,vr=Dp==="win32",gp=(r,e)=>{if(!vr)return R.unlink(r,e);let t=r+".DELETE."+_c.randomBytes(16).toString("hex");R.rename(r,t,s=>{if(s)return e(s);R.unlink(t,e)})},Ep=r=>{if(!vr)return R.unlinkSync(r);let e=r+".DELETE."+_c.randomBytes(16).toString("hex");R.renameSync(r,e),R.unlinkSync(e)},bc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,Sc=r=>dp(mp(re(r))).toLowerCase(),yp=(r,e)=>{e=Sc(e);for(let t of r.keys()){let s=Sc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},Ap=r=>{for(let e of r.keys())r.delete(e)},xr=class extends lp{constructor(e){if(e||(e={}),e.ondone=t=>{this[Jn]=!0,this[Vn]()},super(e),this[Br]=!1,this.reservations=fp(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[qs]=0,this[Jn]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||vr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=re(je.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[gc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Vn](){this[Jn]&&this[qs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[wc](e){if(this.strip){let t=re(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=re(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=re(e.path),s=t.split("/");if(s.includes("..")||vr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=pp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(je.isAbsolute(e.path)?e.absolute=re(je.resolve(e.path)):e.absolute=re(je.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:re(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:t}=je.win32.parse(e.absolute);e.absolute=t+Dc.encode(e.absolute.slice(t.length));let{root:s}=je.win32.parse(e.path);e.path=s+Dc.encode(e.path.slice(s.length))}return!0}[gc](e){if(!this[wc](e))return e.resume();switch(cp.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Yn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Cc](e)}}[G](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[Xt](),t.resume())}[tt](e,t,s){kc(re(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},s)}[kr](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[_r](e){return bc(this.uid,e.uid,this.processUid)}[Rr](e){return bc(this.gid,e.gid,this.processGid)}[Zn](e,t){let s=e.mode&4095||this.fmode,i=new hp.WriteStream(e.absolute,{flags:Rc(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&R.close(i.fd,()=>{}),i.write=()=>!0,this[G](l,e),t()});let n=1,o=l=>{if(l){i.fd&&R.close(i.fd,()=>{}),this[G](l,e),t();return}--n===0&&R.close(i.fd,c=>{c?this[G](c,e):this[Xt](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let d=e.atime||new Date,g=e.mtime;R.futimes(h,d,g,w=>w?R.utimes(c,d,g,S=>o(S&&w)):o())}if(this[kr](e)){n++;let d=this[_r](e),g=this[Rr](e);R.fchown(h,d,g,w=>w?R.chown(c,d,g,S=>o(S&&w)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>{this[G](l,e),t()}),e.pipe(a)),a.pipe(i)}[Xn](e,t){let s=e.mode&4095||this.dmode;this[tt](e.absolute,s,i=>{if(i){this[G](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[Xt](),e.resume())};e.mtime&&!this.noMtime&&(n++,R.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[kr](e)&&(n++,R.chown(e.absolute,this[_r](e),this[Rr](e),o)),o()})}[Cc](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[yc](e,t){this[Ws](e,e.linkpath,"symlink",t)}[Ac](e,t){let s=re(je.resolve(this.cwd,e.linkpath));this[Ws](e,s,"link",t)}[Fc](){this[qs]++}[Xt](){this[qs]--,this[Vn]()}[Qn](e){this[Xt](),e.resume()}[Kn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!vr}[Yn](e){this[Fc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[Ec](e,s))}[zs](e){e.type==="SymbolicLink"?Ap(this.dirCache):e.type!=="Directory"&&yp(this.dirCache,e.absolute)}[Ec](e,t){this[zs](e);let s=a=>{this[zs](e),t(a)},i=()=>{this[tt](this.cwd,this.dmode,a=>{if(a){this[G](a,e),s();return}this[Br]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=re(je.dirname(e.absolute));if(a!==this.cwd)return this[tt](a,this.dmode,l=>{if(l){this[G](l,e),s();return}o()})}o()},o=()=>{R.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[Qn](e),s();return}if(a||this[Kn](e,l))return this[ae](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=d=>this[ae](d,e,s);return c?R.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return R.rmdir(e.absolute,c=>this[ae](c,e,s))}if(e.absolute===this.cwd)return this[ae](null,e,s);gp(e.absolute,c=>this[ae](c,e,s))})};this[Br]?n():i()}[ae](e,t,s){if(e){this[G](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Zn](t,s);case"Link":return this[Ac](t,s);case"SymbolicLink":return this[yc](t,s);case"Directory":case"GNUDumpDir":return this[Xn](t,s)}}[Ws](e,t,s,i){R[s](t,e.absolute,n=>{n?this[G](n,e):(this[Xt](),e.resume()),i()})}},$s=r=>{try{return[null,r()]}catch(e){return[e,null]}},eo=class extends xr{[ae](e,t){return super[ae](e,t,()=>{})}[Yn](e){if(this[zs](e),!this[Br]){let n=this[tt](this.cwd,this.dmode);if(n)return this[G](n,e);this[Br]=!0}if(e.absolute!==this.cwd){let n=re(je.dirname(e.absolute));if(n!==this.cwd){let o=this[tt](n,this.dmode);if(o)return this[G](o,e)}}let[t,s]=$s(()=>R.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[Qn](e);if(t||this[Kn](e,s))return this[ae](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?$s(()=>{R.chmodSync(e.absolute,e.mode)}):[];return this[ae](a,e)}let[n]=$s(()=>R.rmdirSync(e.absolute));this[ae](n,e)}let[i]=e.absolute===this.cwd?[]:$s(()=>Ep(e.absolute));this[ae](i,e)}[Zn](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{R.closeSync(n)}catch(c){l=c}(a||l)&&this[G](a||l,e),t()},n;try{n=R.openSync(e.absolute,Rc(e.size),s)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[G](a,e)),e.pipe(o)),o.on("data",a=>{try{R.writeSync(n,a,0,a.length)}catch(l){i(l)}}),o.on("end",a=>{let l=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,h=e.mtime;try{R.futimesSync(n,c,h)}catch(d){try{R.utimesSync(e.absolute,c,h)}catch{l=d}}}if(this[kr](e)){let c=this[_r](e),h=this[Rr](e);try{R.fchownSync(n,c,h)}catch(d){try{R.chownSync(e.absolute,c,h)}catch{l=l||d}}}i(l)})}[Xn](e,t){let s=e.mode&4095||this.dmode,i=this[tt](e.absolute,s);if(i){this[G](i,e),t();return}if(e.mtime&&!this.noMtime)try{R.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[kr](e))try{R.chownSync(e.absolute,this[_r](e),this[Rr](e))}catch{}t(),e.resume()}[tt](e,t){try{return kc.sync(re(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(s){return s}}[Ws](e,t,s,i){try{R[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[G](n,e)}}};xr.Sync=eo;Bc.exports=xr});var Pc=y((M0,Tc)=>{"use strict";u();var Cp=vt(),Gs=to(),xc=A("fs"),Oc=Jt(),vc=A("path"),ro=Mt();Tc.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=Cp(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&wp(s,e),s.file&&s.sync?Fp(s):s.file?bp(s,t):s.sync?Sp(s):kp(s)};var wp=(r,e)=>{let t=new Map(e.map(n=>[ro(n),!0])),s=r.filter,i=(n,o)=>{let a=o||vc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(vc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(ro(n)):n=>i(ro(n))},Fp=r=>{let e=new Gs.Sync(r),t=r.file,s=xc.statSync(t),i=r.maxReadSize||16*1024*1024;new Oc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},bp=(r,e)=>{let t=new Gs(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),xc.stat(i,(l,c)=>{if(l)a(l);else{let h=new Oc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},Sp=r=>new Gs.Sync(r),kp=r=>new Gs(r)});var Nc=y(I=>{"use strict";u();I.c=I.create=Da();I.r=I.replace=In();I.t=I.list=Ts();I.u=I.update=Sa();I.x=I.extract=Pc();I.Pack=Es();I.Unpack=to();I.Parse=Os();I.ReadEntry=ts();I.WriteEntry=hn();I.Header=It();I.Pax=ss();I.types=Hi()});var Ic=y((J0,Lc)=>{u();function ce(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Lc.exports=ce;ce.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};ce.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};ce.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},t),this._options.unref&&this._timer.unref(),!0};ce.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};ce.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};ce.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};ce.prototype.start=ce.prototype.try;ce.prototype.errors=function(){return this._errors};ce.prototype.attempts=function(){return this._attempts};ce.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,s=0;s<this._errors.length;s++){var i=this._errors[s],n=i.message,o=(r[n]||0)+1;r[n]=o,o>=t&&(e=i,t=o)}return e}});var Mc=y(Ft=>{u();var vp=Ic();Ft.operation=function(r){var e=Ft.timeouts(r);return new vp(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};Ft.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],i=0;i<e.retries;i++)s.push(this.createTimeout(i,e));return r&&r.forever&&!s.length&&s.push(this.createTimeout(i,e)),s.sort(function(n,o){return n-o}),s};Ft.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,s=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return s=Math.min(s,e.maxTimeout),s};Ft.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var s in r)typeof r[s]=="function"&&t.push(s)}for(var i=0;i<t.length;i++){var n=t[i],o=r[n];r[n]=function(l){var c=Ft.operation(e),h=Array.prototype.slice.call(arguments,1),d=h.pop();h.push(function(g){c.retry(g)||(g&&(arguments[0]=c.mainError()),d.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var Uc=y((Y0,jc)=>{u();jc.exports=Mc()});var $c=y((K0,qc)=>{u();var xp=Uc();function Op(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=xp.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,d){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,d):i(o.mainError())}function c(h){var d;try{d=r(a,h)}catch(g){l(g,h);return}Promise.resolve(d).then(s).catch(function(w){l(w,h)})}o.attempt(c)}return new Promise(t)}qc.exports=Op});var cr={};ll(cr,{bold:()=>Cl,dimmed:()=>Fl,error:()=>ar,grey:()=>bl,info:()=>Al,item:()=>Sl,log:()=>X,turboBlue:()=>_t,turboGradient:()=>yl,turboLoader:()=>ho,turboRed:()=>co,underline:()=>wl,warn:()=>fo,yellow:()=>lo});u();import{reset as fl,bold as ur,underline as pl,gray as ml,dim as dl}from"picocolors";import Dl from"ora";import gl from"gradient-string";var uo="#0099F7",ao="#F11712",El="#FFFF00",ri=r=>{let e=kl(r);return t=>`\x1B[38;5;${e}m${t}${fl("")}`},yl=gl(uo,ao),_t=ri(uo),co=ri(ao),lo=ri(El),ho=r=>Dl({text:r,spinner:{frames:[" ",_t("> "),_t(">> "),_t(">>>")]}}),Al=(...r)=>{X(_t(ur(">>>")),r.join(" "))},Cl=(...r)=>{X(ur(r.join(" ")))},wl=(...r)=>{X(pl(r.join(" ")))},Fl=(...r)=>{X(dl(r.join(" ")))},bl=(...r)=>{X(ml(r.join(" ")))},Sl=(...r)=>{X(_t(ur(" \u2022")),r.join(" "))},X=(...r)=>{console.log(...r)},fo=(...r)=>{console.error(lo(ur(">>>")),r.join(" "))},ar=(...r)=>{console.error(co(ur(">>>")),r.join(" "))};function kl(r){let e=parseInt(r.slice(1),16),t=Math.floor(e/(256*256))%256,s=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(i/255*5)}u();import _l from"os";import Rl from"execa";async function Lr(r,e=[],t){let s={cwd:_l.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...t};try{let{stdout:i}=await Rl(r,e,s);return i.trim()}catch{return}}async function Bl(){let[r,e,t,s]=await Promise.all([Lr("yarnpkg",["--version"],{cwd:"."}),Lr("npm",["--version"]),Lr("pnpm",["--version"]),Lr("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();import si from"picocolors";import vl from"update-check";function xl(r){let{packageInfo:e,upgradeCommand:t}=r,s=vl(e).catch(()=>null);return async function(n=0){try{let o=await s;if(o!=null&&o.latest){X(),X(si.yellow(si.bold(`A new version of \`${e.name}\` is available!`)));let a=typeof t=="function"?await t():t;a&&X(`You can update by running: ${si.cyan(a)}`),X()}process.exit(n)}catch(o){process.env.DEBUG&&ar("Update check failed:",o),process.exit(n)}}}u();u();u();var Ul=Nr(yo());u();u();function ni(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function lr(r){return lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lr(r)}u();function oi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ui(r,e){if(e&&(lr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oi(r)}u();function lt(r){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lt(r)}u();u();function ke(r,e){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},ke(r,e)}function ai(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&ke(r,e)}u();u();function ci(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function li(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rt(r,e,t){return li()?Rt=Reflect.construct.bind():Rt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&ke(c,o.prototype),c},Rt.apply(null,arguments)}function hr(r){var e=typeof Map=="function"?new Map:void 0;return hr=function(s){if(s===null||!ci(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(s))return e.get(s);e.set(s,i)}function i(){return Rt(s,arguments,lt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ke(i,s)},hr(r)}var Io=Nr(Lo());import yd from"fs-extra";var Ad=function(r){ai(e,r);function e(t){var s;return ni(this,e),s=ui(this,lt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(hr(Error));u();u();u();import vd from"js-yaml";import{sync as Od}from"fast-glob";u();import Id from"fs-extra";u();import Ud from"fs-extra";import $d from"picocolors";u();import{Stream as _p}from"stream";import{promisify as Rp}from"util";var Bp=Nr(Nc());var $0=Rp(_p.pipeline);u();import G0 from"fs-extra";u();var jp=Nr($c());import X0 from"picocolors";import eD from"fs-extra";u();u();u();var B=class extends Error{constructor(t,s){var i;super(t);this.name="ConvertError",this.type=(i=s==null?void 0:s.type)!=null?i:"unknown",Error.captureStackTrace(this,B)}};u();u();import er from"path";import Fe from"fs-extra";import Zp from"execa";u();import Jp from"path";import Vp from"fs-extra";import Yp from"picocolors";u();import rt from"path";import Up from"execa";import{readJsonSync as qp,existsSync as so,readFileSync as $p,rmSync as zc,writeFile as zp}from"fs-extra";import{sync as Wp}from"fast-glob";import Gp from"js-yaml";var Hp=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=rt.join(r,"package.json");try{return qp(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new B(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new B(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function st({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=Hp.exec(e);if(t){let[s,i]=t;return i}}catch{}}function Ue({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=rt.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function io({workspaceRoot:r}){let e=rt.join(r,"pnpm-workspace.yaml");if(so(e))try{let t=Gp.load($p(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new B(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function it({root:r,lockFile:e,workspaceConfig:t}){let s=n=>rt.join(r,n),i={root:r,lockfile:s(e),packageJson:s("package.json"),nodeModules:s("node_modules")};return t&&(i.workspaceConfig=s(t)),i}function Qt({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function nt({workspaceRoot:r,workspaceGlobs:e}){if(!e)return[];let t=e.filter(s=>s.startsWith("!")).map(s=>s.slice(1));return e.filter(s=>!s.startsWith("!")).flatMap(s=>{let i=[`${s}/package.json`];return Wp(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=rt.dirname(s),{name:n,description:o}=Ue({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:rt.join(i,"node_modules")}}})}function Wc({directory:r}){let e=rt.resolve(process.cwd(),r);return{exists:so(e),absolute:e}}function le({packageManager:r,action:e,project:t}){let s=t.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${r} ${s?"workspaces":""} ${e==="remove"?"from":"to"} ${t.name}`}function Gc({project:r}){let e=t=>!(t.includes("*")&&(t.includes("**")||t.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(s=>t.includes(s)));return r.workspaceData.globs.every(e)}function se({project:r,options:e}){e!=null&&e.dry||zc(r.paths.lockfile,{force:!0})}async function Hs({project:r,options:e}){if(!(e!=null&&e.dry)&&so(r.paths.lockfile))try{let{stdout:t}=await Up("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root,preferLocal:!0,shell:process.platform==="win32"});await zp(rt.join(r.paths.root,"yarn.lock"),t)}catch{}finally{zc(r.paths.lockfile,{force:!0})}}function Kp({dependencyList:r,project:e,to:t}){let s=[];return e.workspaceData.workspaces.forEach(i=>{let{name:n}=i;if(r[n]){let o=r[n],a=o.startsWith("workspace:")?o.slice(10):o;r[n]=t.name==="pnpm"?`workspace:${a}`:a,s.push(n)}}),{dependencyList:r,updated:s}}function he({project:r,workspace:e,to:t,logger:s,options:i}){if(["yarn","npm","bun"].includes(t.name)&&["yarn","npm","bun"].includes(r.packageManager))return;let n=M({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(d=>{let g=n[d];if(g){let{updated:w,dependencyList:S}=Kp({dependencyList:g,project:r,to:t});n[d]=S,o[d]=w}});let l=d=>{let g=o[d].length;if(g>0)return`${Yp.green(g.toString())} ${d}`},c=a.map(l).filter(Boolean),h=`./${Jp.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let d="updating";c.forEach((g,w)=>{c.length===1?d+=` ${g} in ${h}`:w===c.length-1?d+=`and ${g} in ${h}`:d+=` ${g}, `}),s.workspaceStep(d)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||Vp.writeJSONSync(e.paths.packageJson,n,{spaces:2})}var ot={name:"pnpm",lock:"pnpm-lock.yaml"};async function Hc(r){let e=er.join(r.workspaceRoot,ot.lock),t=er.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=st({workspaceRoot:r.workspaceRoot});return Fe.existsSync(e)||Fe.existsSync(t)||s===ot.name}async function Xp(r){if(!await Hc(r))throw new B("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=Ue(r);return{name:t,description:s,packageManager:ot.name,paths:it({root:r.workspaceRoot,lockFile:ot.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:io(r),workspaces:nt({workspaceGlobs:io(r),...r})}}}async function Qp(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({action:"create",packageManager:ot.name,project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),o.packageManager=`${t.name}@${t.version}`,s.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),i!=null&&i.dry||(Fe.writeJSONSync(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),Fe.writeFileSync(er.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
|
1
|
+
var il=Object.create;var ti=Object.defineProperty;var nl=Object.getOwnPropertyDescriptor;var ol=Object.getOwnPropertyNames;var ul=Object.getPrototypeOf,al=Object.prototype.hasOwnProperty;var A=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var cl=(r,e)=>()=>(r&&(e=r(r=0)),e);var y=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ll=(r,e)=>{for(var t in e)ti(r,t,{get:e[t],enumerable:!0})},hl=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ol(e))!al.call(r,i)&&i!==t&&ti(r,i,{get:()=>e[i],enumerable:!(s=nl(e,i))||s.enumerable});return r};var Nr=(r,e,t)=>(t=r!=null?il(ul(r)):{},hl(e||!r||!r.__esModule?ti(t,"default",{value:r,enumerable:!0}):t,r));var u=cl(()=>{});var po=y((Pm,be)=>{u();function ni(r){return be.exports=ni=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be.exports.__esModule=!0,be.exports.default=be.exports,ni(r)}be.exports=ni,be.exports.__esModule=!0,be.exports.default=be.exports});var go=y((Nm,Se)=>{u();var mo=po().default;function Do(){"use strict";Se.exports=Do=function(){return e},Se.exports.__esModule=!0,Se.exports.default=Se.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(E,m,D){E[m]=D.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(E,m,D){return Object.defineProperty(E,m,{value:D,enumerable:!0,configurable:!0,writable:!0}),E[m]}try{c({},"")}catch{c=function(D,C,b){return D[C]=b}}function h(E,m,D,C){var b=m&&m.prototype instanceof O?m:O,F=Object.create(b.prototype),N=new Qs(C||[]);return i(F,"_invoke",{value:rl(E,D,N)}),F}function d(E,m,D){try{return{type:"normal",arg:E.call(m,D)}}catch(C){return{type:"throw",arg:C}}}e.wrap=h;var g="suspendedStart",w="suspendedYield",S="executing",P="completed",k={};function O(){}function ut(){}function de(){}var Ks={};c(Ks,o,function(){return this});var Zs=Object.getPrototypeOf,Tr=Zs&&Zs(Zs(ei([])));Tr&&Tr!==t&&s.call(Tr,o)&&(Ks=Tr);var kt=de.prototype=O.prototype=Object.create(Ks);function oo(E){["next","throw","return"].forEach(function(m){c(E,m,function(D){return this._invoke(m,D)})})}function Pr(E,m){function D(b,F,N,H){var J=d(E[b],E,F);if(J.type!=="throw"){var at=J.arg,qe=at.value;return qe&&mo(qe)=="object"&&s.call(qe,"__await")?m.resolve(qe.__await).then(function(ct){D("next",ct,N,H)},function(ct){D("throw",ct,N,H)}):m.resolve(qe).then(function(ct){at.value=ct,N(at)},function(ct){return D("throw",ct,N,H)})}H(J.arg)}var C;i(this,"_invoke",{value:function(F,N){function H(){return new m(function(J,at){D(F,N,J,at)})}return C=C?C.then(H,H):H()}})}function rl(E,m,D){var C=g;return function(b,F){if(C===S)throw new Error("Generator is already running");if(C===P){if(b==="throw")throw F;return{value:r,done:!0}}for(D.method=b,D.arg=F;;){var N=D.delegate;if(N){var H=uo(N,D);if(H){if(H===k)continue;return H}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(C===g)throw C=P,D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);C=S;var J=d(E,m,D);if(J.type==="normal"){if(C=D.done?P:w,J.arg===k)continue;return{value:J.arg,done:D.done}}J.type==="throw"&&(C=P,D.method="throw",D.arg=J.arg)}}}function uo(E,m){var D=m.method,C=E.iterator[D];if(C===r)return m.delegate=null,D==="throw"&&E.iterator.return&&(m.method="return",m.arg=r,uo(E,m),m.method==="throw")||D!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+D+"' method")),k;var b=d(C,E.iterator,m.arg);if(b.type==="throw")return m.method="throw",m.arg=b.arg,m.delegate=null,k;var F=b.arg;return F?F.done?(m[E.resultName]=F.value,m.next=E.nextLoc,m.method!=="return"&&(m.method="next",m.arg=r),m.delegate=null,k):F:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,k)}function sl(E){var m={tryLoc:E[0]};1 in E&&(m.catchLoc=E[1]),2 in E&&(m.finallyLoc=E[2],m.afterLoc=E[3]),this.tryEntries.push(m)}function Xs(E){var m=E.completion||{};m.type="normal",delete m.arg,E.completion=m}function Qs(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(sl,this),this.reset(!0)}function ei(E){if(E||E===""){var m=E[o];if(m)return m.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var D=-1,C=function b(){for(;++D<E.length;)if(s.call(E,D))return b.value=E[D],b.done=!1,b;return b.value=r,b.done=!0,b};return C.next=C}}throw new TypeError(mo(E)+" is not iterable")}return ut.prototype=de,i(kt,"constructor",{value:de,configurable:!0}),i(de,"constructor",{value:ut,configurable:!0}),ut.displayName=c(de,l,"GeneratorFunction"),e.isGeneratorFunction=function(E){var m=typeof E=="function"&&E.constructor;return!!m&&(m===ut||(m.displayName||m.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,de):(E.__proto__=de,c(E,l,"GeneratorFunction")),E.prototype=Object.create(kt),E},e.awrap=function(E){return{__await:E}},oo(Pr.prototype),c(Pr.prototype,a,function(){return this}),e.AsyncIterator=Pr,e.async=function(E,m,D,C,b){b===void 0&&(b=Promise);var F=new Pr(h(E,m,D,C),b);return e.isGeneratorFunction(m)?F:F.next().then(function(N){return N.done?N.value:F.next()})},oo(kt),c(kt,l,"Generator"),c(kt,o,function(){return this}),c(kt,"toString",function(){return"[object Generator]"}),e.keys=function(E){var m=Object(E),D=[];for(var C in m)D.push(C);return D.reverse(),function b(){for(;D.length;){var F=D.pop();if(F in m)return b.value=F,b.done=!1,b}return b.done=!0,b}},e.values=ei,Qs.prototype={constructor:Qs,reset:function(m){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Xs),!m)for(var D in this)D.charAt(0)==="t"&&s.call(this,D)&&!isNaN(+D.slice(1))&&(this[D]=r)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var D=this;function C(at,qe){return N.type="throw",N.arg=m,D.next=at,qe&&(D.method="next",D.arg=r),!!qe}for(var b=this.tryEntries.length-1;b>=0;--b){var F=this.tryEntries[b],N=F.completion;if(F.tryLoc==="root")return C("end");if(F.tryLoc<=this.prev){var H=s.call(F,"catchLoc"),J=s.call(F,"finallyLoc");if(H&&J){if(this.prev<F.catchLoc)return C(F.catchLoc,!0);if(this.prev<F.finallyLoc)return C(F.finallyLoc)}else if(H){if(this.prev<F.catchLoc)return C(F.catchLoc,!0)}else{if(!J)throw new Error("try statement without catch or finally");if(this.prev<F.finallyLoc)return C(F.finallyLoc)}}}},abrupt:function(m,D){for(var C=this.tryEntries.length-1;C>=0;--C){var b=this.tryEntries[C];if(b.tryLoc<=this.prev&&s.call(b,"finallyLoc")&&this.prev<b.finallyLoc){var F=b;break}}F&&(m==="break"||m==="continue")&&F.tryLoc<=D&&D<=F.finallyLoc&&(F=null);var N=F?F.completion:{};return N.type=m,N.arg=D,F?(this.method="next",this.next=F.finallyLoc,k):this.complete(N)},complete:function(m,D){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&D&&(this.next=D),k},finish:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var C=this.tryEntries[D];if(C.finallyLoc===m)return this.complete(C.completion,C.afterLoc),Xs(C),k}},catch:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var C=this.tryEntries[D];if(C.tryLoc===m){var b=C.completion;if(b.type==="throw"){var F=b.arg;Xs(C)}return F}}throw new Error("illegal catch attempt")},delegateYield:function(m,D,C){return this.delegate={iterator:ei(m),resultName:D,nextLoc:C},this.method==="next"&&(this.arg=r),k}},e}Se.exports=Do,Se.exports.__esModule=!0,Se.exports.default=Se.exports});var yo=y((Lm,Eo)=>{u();var Ir=go()();Eo.exports=Ir;try{regeneratorRuntime=Ir}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Ir:Function("r","regeneratorRuntime = r")(Ir)}});var Co=y((id,fi)=>{"use strict";u();var Ao=(r,...e)=>new Promise(t=>{t(r(...e))});fi.exports=Ao;fi.exports.default=Ao});var Fo=y((nd,pi)=>{"use strict";u();var Tl=Co(),wo=r=>{if(!((Number.isInteger(r)||r===1/0)&&r>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let e=[],t=0,s=()=>{t--,e.length>0&&e.shift()()},i=(a,l,...c)=>{t++;let h=Tl(a,...c);l(h),h.then(s,s)},n=(a,l,...c)=>{t<r?i(a,l,...c):e.push(i.bind(null,a,l,...c))},o=(a,...l)=>new Promise(c=>n(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length},clearQueue:{value:()=>{e.length=0}}}),o};pi.exports=wo;pi.exports.default=wo});var ko=y((od,mi)=>{"use strict";u();var bo=Fo(),Mr=class extends Error{constructor(e){super(),this.value=e}},Pl=async(r,e)=>e(await r),Nl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new Mr(e[0]);return!1},So=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=bo(t.concurrency),i=[...r].map(o=>[o,s(Pl,o,e)]),n=bo(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(Nl,o)))}catch(o){if(o instanceof Mr)return o.value;throw o}};mi.exports=So;mi.exports.default=So});var Oo=y((ud,di)=>{"use strict";u();var _o=A("path"),Ur=A("fs"),{promisify:Ro}=A("util"),Ll=ko(),Il=Ro(Ur.stat),Ml=Ro(Ur.lstat),vo={directory:"isDirectory",file:"isFile"};function Bo({type:r}){if(!(r in vo))throw new Error(`Invalid type specified: ${r}`)}var xo=(r,e)=>r===void 0||e[vo[r]]();di.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},Bo(e);let t=e.allowSymlinks?Il:Ml;return Ll(r,async s=>{try{let i=await t(_o.resolve(e.cwd,s));return xo(e.type,i)}catch{return!1}},e)};di.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},Bo(e);let t=e.allowSymlinks?Ur.statSync:Ur.lstatSync;for(let s of r)try{let i=t(_o.resolve(e.cwd,s));if(xo(e.type,i))return s}catch{}}});var Po=y((ad,Di)=>{"use strict";u();var To=A("fs"),{promisify:Ul}=A("util"),jl=Ul(To.access);Di.exports=async r=>{try{return await jl(r),!0}catch{return!1}};Di.exports.sync=r=>{try{return To.accessSync(r),!0}catch{return!1}}});var Lo=y((cd,Bt)=>{"use strict";u();var $e=A("path"),jr=Oo(),No=Po(),gi=Symbol("findUp.stop");Bt.exports=async(r,e={})=>{let t=$e.resolve(e.cwd||""),{root:s}=$e.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return jr(i,o);let a=await r(o.cwd);return typeof a=="string"?jr([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===gi)return;if(o)return $e.resolve(t,o);if(t===s)return;t=$e.dirname(t)}};Bt.exports.sync=(r,e={})=>{let t=$e.resolve(e.cwd||""),{root:s}=$e.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return jr.sync(i,o);let a=r(o.cwd);return typeof a=="string"?jr.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===gi)return;if(o)return $e.resolve(t,o);if(t===s)return;t=$e.dirname(t)}};Bt.exports.exists=No;Bt.exports.sync.exists=No.sync;Bt.exports.stop=gi});var xt=y((zd,jo)=>{"use strict";u();var Uo=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);jo.exports=r=>r?Object.keys(r).map(e=>[Uo.has(e)?Uo.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Hr=y((Gd,Yo)=>{"use strict";u();var qo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Hl=A("events"),$o=A("stream"),Wo=A("string_decoder").StringDecoder,_e=Symbol("EOF"),Re=Symbol("maybeEmitEnd"),We=Symbol("emittedEnd"),qr=Symbol("emittingEnd"),fr=Symbol("emittedError"),$r=Symbol("closed"),zo=Symbol("read"),Wr=Symbol("flush"),Go=Symbol("flushChunk"),V=Symbol("encoding"),ve=Symbol("decoder"),zr=Symbol("flowing"),pr=Symbol("paused"),Ot=Symbol("resume"),L=Symbol("buffer"),De=Symbol("pipes"),U=Symbol("bufferLength"),Ei=Symbol("bufferPush"),yi=Symbol("bufferShift"),q=Symbol("objectMode"),$=Symbol("destroyed"),Ai=Symbol("emitData"),Ho=Symbol("emitEnd"),Ci=Symbol("emitEnd2"),Be=Symbol("async"),mr=r=>Promise.resolve().then(r),Jo=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Jl=Jo&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Vl=Jo&&Symbol.iterator||Symbol("iterator not implemented"),Yl=r=>r==="end"||r==="finish"||r==="prefinish",Kl=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Zl=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Gr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Ot](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},wi=class extends Gr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};Yo.exports=class Vo extends $o{constructor(e){super(),this[zr]=!1,this[pr]=!1,this[De]=[],this[L]=[],this[q]=e&&e.objectMode||!1,this[q]?this[V]=null:this[V]=e&&e.encoding||null,this[V]==="buffer"&&(this[V]=null),this[Be]=e&&!!e.async||!1,this[ve]=this[V]?new Wo(this[V]):null,this[_e]=!1,this[We]=!1,this[qr]=!1,this[$r]=!1,this[fr]=null,this.writable=!0,this.readable=!0,this[U]=0,this[$]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[De]})}get bufferLength(){return this[U]}get encoding(){return this[V]}set encoding(e){if(this[q])throw new Error("cannot set encoding in objectMode");if(this[V]&&e!==this[V]&&(this[ve]&&this[ve].lastNeed||this[U]))throw new Error("cannot change encoding");this[V]!==e&&(this[ve]=e?new Wo(e):null,this[L].length&&(this[L]=this[L].map(t=>this[ve].write(t)))),this[V]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[q]}set objectMode(e){this[q]=this[q]||!!e}get async(){return this[Be]}set async(e){this[Be]=this[Be]||!!e}write(e,t,s){if(this[_e])throw new Error("write after end");if(this[$])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Be]?mr:n=>n();return!this[q]&&!Buffer.isBuffer(e)&&(Zl(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Kl(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[q]?(this.flowing&&this[U]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[Ei](e),this[U]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[V]&&!this[ve].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[V]&&(e=this[ve].write(e)),this.flowing&&this[U]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[Ei](e),this[U]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[U]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[$])return null;if(this[U]===0||e===0||e>this[U])return this[Re](),null;this[q]&&(e=null),this[L].length>1&&!this[q]&&(this.encoding?this[L]=[this[L].join("")]:this[L]=[Buffer.concat(this[L],this[U])]);let t=this[zo](e||null,this[L][0]);return this[Re](),t}[zo](e,t){return e===t.length||e===null?this[yi]():(this[L][0]=t.slice(e),t=t.slice(0,e),this[U]-=e),this.emit("data",t),!this[L].length&&!this[_e]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[_e]=!0,this.writable=!1,(this.flowing||!this[pr])&&this[Re](),this}[Ot](){this[$]||(this[pr]=!1,this[zr]=!0,this.emit("resume"),this[L].length?this[Wr]():this[_e]?this[Re]():this.emit("drain"))}resume(){return this[Ot]()}pause(){this[zr]=!1,this[pr]=!0}get destroyed(){return this[$]}get flowing(){return this[zr]}get paused(){return this[pr]}[Ei](e){this[q]?this[U]+=1:this[U]+=e.length,this[L].push(e)}[yi](){return this[L].length&&(this[q]?this[U]-=1:this[U]-=this[L][0].length),this[L].shift()}[Wr](e){do;while(this[Go](this[yi]()));!e&&!this[L].length&&!this[_e]&&this.emit("drain")}[Go](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[$])return;let s=this[We];return t=t||{},e===qo.stdout||e===qo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[De].push(t.proxyErrors?new wi(this,e,t):new Gr(this,e,t)),this[Be]?mr(()=>this[Ot]()):this[Ot]()),e}unpipe(e){let t=this[De].find(s=>s.dest===e);t&&(this[De].splice(this[De].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this[De].length&&!this.flowing?this[Ot]():e==="readable"&&this[U]!==0?super.emit("readable"):Yl(e)&&this[We]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[fr]&&(this[Be]?mr(()=>t.call(this,this[fr])):t.call(this,this[fr])),s}get emittedEnd(){return this[We]}[Re](){!this[qr]&&!this[We]&&!this[$]&&this[L].length===0&&this[_e]&&(this[qr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[$r]&&this.emit("close"),this[qr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==$&&this[$])return;if(e==="data")return t?this[Be]?mr(()=>this[Ai](t)):this[Ai](t):!1;if(e==="end")return this[Ho]();if(e==="close"){if(this[$r]=!0,!this[We]&&!this[$])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[fr]=t;let n=super.emit("error",t);return this[Re](),n}else if(e==="resume"){let n=super.emit("resume");return this[Re](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[Re](),i}[Ai](e){for(let s of this[De])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Re](),t}[Ho](){this[We]||(this[We]=!0,this.readable=!1,this[Be]?mr(()=>this[Ci]()):this[Ci]())}[Ci](){if(this[ve]){let t=this[ve].end();if(t){for(let s of this[De])s.dest.write(t);super.emit("data",t)}}for(let t of this[De])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[q]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[q]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[q]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[q]?Promise.reject(new Error("cannot concat in objectMode")):this[V]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on($,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Jl](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[_e])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[_e]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once($,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[Vl](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[$]?(e?this.emit("error",e):this.emit($),this):(this[$]=!0,this[L].length=0,this[U]=0,typeof this.close=="function"&&!this[$r]&&this.close(),e?this.emit("error",e):this.emit($),this)}static isStream(e){return!!e&&(e instanceof Vo||e instanceof $o||e instanceof Hl&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Zo=y((Hd,Ko)=>{u();var Xl=A("zlib").constants||{ZLIB_VERNUM:4736};Ko.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Xl))});var Ri=y((Jd,ou)=>{"use strict";u();var Xo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ql=A("events"),Qo=A("stream"),eu=A("string_decoder").StringDecoder,xe=Symbol("EOF"),Oe=Symbol("maybeEmitEnd"),ze=Symbol("emittedEnd"),Jr=Symbol("emittingEnd"),dr=Symbol("emittedError"),Vr=Symbol("closed"),tu=Symbol("read"),Yr=Symbol("flush"),ru=Symbol("flushChunk"),Y=Symbol("encoding"),Te=Symbol("decoder"),Kr=Symbol("flowing"),Dr=Symbol("paused"),Tt=Symbol("resume"),j=Symbol("bufferLength"),Fi=Symbol("bufferPush"),bi=Symbol("bufferShift"),W=Symbol("objectMode"),z=Symbol("destroyed"),Si=Symbol("emitData"),su=Symbol("emitEnd"),ki=Symbol("emitEnd2"),Pe=Symbol("async"),gr=r=>Promise.resolve().then(r),iu=global._MP_NO_ITERATOR_SYMBOLS_!=="1",eh=iu&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),th=iu&&Symbol.iterator||Symbol("iterator not implemented"),rh=r=>r==="end"||r==="finish"||r==="prefinish",sh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ih=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Zr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Tt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},_i=class extends Zr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};ou.exports=class nu extends Qo{constructor(e){super(),this[Kr]=!1,this[Dr]=!1,this.pipes=[],this.buffer=[],this[W]=e&&e.objectMode||!1,this[W]?this[Y]=null:this[Y]=e&&e.encoding||null,this[Y]==="buffer"&&(this[Y]=null),this[Pe]=e&&!!e.async||!1,this[Te]=this[Y]?new eu(this[Y]):null,this[xe]=!1,this[ze]=!1,this[Jr]=!1,this[Vr]=!1,this[dr]=null,this.writable=!0,this.readable=!0,this[j]=0,this[z]=!1}get bufferLength(){return this[j]}get encoding(){return this[Y]}set encoding(e){if(this[W])throw new Error("cannot set encoding in objectMode");if(this[Y]&&e!==this[Y]&&(this[Te]&&this[Te].lastNeed||this[j]))throw new Error("cannot change encoding");this[Y]!==e&&(this[Te]=e?new eu(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Te].write(t)))),this[Y]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[W]}set objectMode(e){this[W]=this[W]||!!e}get async(){return this[Pe]}set async(e){this[Pe]=this[Pe]||!!e}write(e,t,s){if(this[xe])throw new Error("write after end");if(this[z])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Pe]?gr:n=>n();return!this[W]&&!Buffer.isBuffer(e)&&(ih(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):sh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[W]?(this.flowing&&this[j]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[Fi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[Y]&&!this[Te].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Y]&&(e=this[Te].write(e)),this.flowing&&this[j]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[Fi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[z])return null;if(this[j]===0||e===0||e>this[j])return this[Oe](),null;this[W]&&(e=null),this.buffer.length>1&&!this[W]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[j])]);let t=this[tu](e||null,this.buffer[0]);return this[Oe](),t}[tu](e,t){return e===t.length||e===null?this[bi]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit("data",t),!this.buffer.length&&!this[xe]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[xe]=!0,this.writable=!1,(this.flowing||!this[Dr])&&this[Oe](),this}[Tt](){this[z]||(this[Dr]=!1,this[Kr]=!0,this.emit("resume"),this.buffer.length?this[Yr]():this[xe]?this[Oe]():this.emit("drain"))}resume(){return this[Tt]()}pause(){this[Kr]=!1,this[Dr]=!0}get destroyed(){return this[z]}get flowing(){return this[Kr]}get paused(){return this[Dr]}[Fi](e){this[W]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[bi](){return this.buffer.length&&(this[W]?this[j]-=1:this[j]-=this.buffer[0].length),this.buffer.shift()}[Yr](e){do;while(this[ru](this[bi]()));!e&&!this.buffer.length&&!this[xe]&&this.emit("drain")}[ru](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[z])return;let s=this[ze];return t=t||{},e===Xo.stdout||e===Xo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new _i(this,e,t):new Zr(this,e,t)),this[Pe]?gr(()=>this[Tt]()):this[Tt]()),e}unpipe(e){let t=this.pipes.find(s=>s.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[Tt]():e==="readable"&&this[j]!==0?super.emit("readable"):rh(e)&&this[ze]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[dr]&&(this[Pe]?gr(()=>t.call(this,this[dr])):t.call(this,this[dr])),s}get emittedEnd(){return this[ze]}[Oe](){!this[Jr]&&!this[ze]&&!this[z]&&this.buffer.length===0&&this[xe]&&(this[Jr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vr]&&this.emit("close"),this[Jr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==z&&this[z])return;if(e==="data")return t?this[Pe]?gr(()=>this[Si](t)):this[Si](t):!1;if(e==="end")return this[su]();if(e==="close"){if(this[Vr]=!0,!this[ze]&&!this[z])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[dr]=t;let n=super.emit("error",t);return this[Oe](),n}else if(e==="resume"){let n=super.emit("resume");return this[Oe](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[Oe](),i}[Si](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Oe](),t}[su](){this[ze]||(this[ze]=!0,this.readable=!1,this[Pe]?gr(()=>this[ki]()):this[ki]())}[ki](){if(this[Te]){let t=this[Te].end();if(t){for(let s of this.pipes)s.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[W]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[W]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[W]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[W]?Promise.reject(new Error("cannot concat in objectMode")):this[Y]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(z,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[eh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[xe])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[xe]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once(z,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[th](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[z]?(e?this.emit("error",e):this.emit(z),this):(this[z]=!0,this.buffer.length=0,this[j]=0,typeof this.close=="function"&&!this[Vr]&&this.close(),e?this.emit("error",e):this.emit(z),this)}static isStream(e){return!!e&&(e instanceof nu||e instanceof Qo||e instanceof Ql&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var zi=y(Q=>{"use strict";u();var Ti=A("assert"),Ge=A("buffer").Buffer,cu=A("zlib"),ht=Q.constants=Zo(),nh=Ri(),uu=Ge.concat,ft=Symbol("_superWrite"),Nt=class extends Error{constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},oh=Symbol("opts"),Er=Symbol("flushFlag"),au=Symbol("finishFlushFlag"),Wi=Symbol("fullFlushFlag"),x=Symbol("handle"),Xr=Symbol("onError"),Pt=Symbol("sawError"),vi=Symbol("level"),Bi=Symbol("strategy"),xi=Symbol("ended"),Vd=Symbol("_defaultFullFlush"),Qr=class extends nh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Pt]=!1,this[xi]=!1,this[oh]=e,this[Er]=e.flush,this[au]=e.finishFlush;try{this[x]=new cu[t](e)}catch(s){throw new Nt(s)}this[Xr]=s=>{this[Pt]||(this[Pt]=!0,this.close(),this.emit("error",s))},this[x].on("error",s=>this[Xr](new Nt(s))),this.once("end",()=>this.close)}close(){this[x]&&(this[x].close(),this[x]=null,this.emit("close"))}reset(){if(!this[Pt])return Ti(this[x],"zlib binding closed"),this[x].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[Wi]),this.write(Object.assign(Ge.alloc(0),{[Er]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[au]),this[xi]=!0,super.end(null,null,s)}get ended(){return this[xi]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=Ge.from(e,t)),this[Pt])return;Ti(this[x],"zlib binding closed");let i=this[x]._handle,n=i.close;i.close=()=>{};let o=this[x].close;this[x].close=()=>{},Ge.concat=c=>c;let a;try{let c=typeof e[Er]=="number"?e[Er]:this[Er];a=this[x]._processChunk(e,c),Ge.concat=uu}catch(c){Ge.concat=uu,this[Xr](new Nt(c))}finally{this[x]&&(this[x]._handle=i,i.close=n,this[x].close=o,this[x].removeAllListeners("error"))}this[x]&&this[x].on("error",c=>this[Xr](new Nt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[ft](Ge.from(a[0]));for(let c=1;c<a.length;c++)l=this[ft](a[c])}else l=this[ft](Ge.from(a));return s&&s(),l}[ft](e){return super.write(e)}},Ne=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ht.Z_FINISH,super(e,t),this[Wi]=ht.Z_FULL_FLUSH,this[vi]=e.level,this[Bi]=e.strategy}params(e,t){if(!this[Pt]){if(!this[x])throw new Error("cannot switch params when binding is closed");if(!this[x].params)throw new Error("not supported in this implementation");if(this[vi]!==e||this[Bi]!==t){this.flush(ht.Z_SYNC_FLUSH),Ti(this[x],"zlib binding closed");let s=this[x].flush;this[x].flush=(i,n)=>{this.flush(i),n()};try{this[x].params(e,t)}finally{this[x].flush=s}this[x]&&(this[vi]=e,this[Bi]=t)}}}},Pi=class extends Ne{constructor(e){super(e,"Deflate")}},Ni=class extends Ne{constructor(e){super(e,"Inflate")}},Oi=Symbol("_portable"),Li=class extends Ne{constructor(e){super(e,"Gzip"),this[Oi]=e&&!!e.portable}[ft](e){return this[Oi]?(this[Oi]=!1,e[9]=255,super[ft](e)):super[ft](e)}},Ii=class extends Ne{constructor(e){super(e,"Gunzip")}},Mi=class extends Ne{constructor(e){super(e,"DeflateRaw")}},Ui=class extends Ne{constructor(e){super(e,"InflateRaw")}},ji=class extends Ne{constructor(e){super(e,"Unzip")}},es=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ht.BROTLI_OPERATION_FINISH,super(e,t),this[Wi]=ht.BROTLI_OPERATION_FLUSH}},qi=class extends es{constructor(e){super(e,"BrotliCompress")}},$i=class extends es{constructor(e){super(e,"BrotliDecompress")}};Q.Deflate=Pi;Q.Inflate=Ni;Q.Gzip=Li;Q.Gunzip=Ii;Q.DeflateRaw=Mi;Q.InflateRaw=Ui;Q.Unzip=ji;typeof cu.BrotliCompress=="function"?(Q.BrotliCompress=qi,Q.BrotliDecompress=$i):Q.BrotliCompress=Q.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var Lt=y((Zd,lu)=>{u();var uh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;lu.exports=uh!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var ts=y((Qd,hu)=>{"use strict";u();var ah=Hr(),Gi=Lt(),Hi=Symbol("slurp");hu.exports=class extends ah{constructor(e,t,s){switch(super(),this.pause(),this.extended=t,this.globalExtended=s,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=Gi(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=Gi(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[Hi](t),s&&this[Hi](s,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let s=this.remain,i=this.blockRemain;return this.remain=Math.max(0,s-t),this.blockRemain=Math.max(0,i-t),this.ignore?!0:s>=t?super.write(e):super.write(e.slice(0,s))}[Hi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?Gi(e[s]):e[s])}}});var Ji=y(rs=>{"use strict";u();rs.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);rs.code=new Map(Array.from(rs.name).map(r=>[r[1],r[0]]))});var du=y((t0,mu)=>{"use strict";u();var ch=(r,e)=>{if(Number.isSafeInteger(r))r<0?hh(r,e):lh(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},lh=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},hh=(r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var s=e.length;s>1;s--){var i=r&255;r=Math.floor(r/256),t?e[s-1]=fu(i):i===0?e[s-1]=0:(t=!0,e[s-1]=pu(i))}},fh=r=>{let e=r[0],t=e===128?mh(r.slice(1,r.length)):e===255?ph(r):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},ph=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=fu(n):n===0?o=n:(s=!0,o=pu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},mh=r=>{for(var e=r.length,t=0,s=e-1;s>-1;s--){var i=r[s];i!==0&&(t+=i*Math.pow(256,e-s-1))}return t},fu=r=>(255^r)&255,pu=r=>(255^r)+1&255;mu.exports={encode:ch,parse:fh}});var Mt=y((r0,gu)=>{"use strict";u();var Vi=Ji(),It=A("path").posix,Du=du(),Yi=Symbol("slurp"),ee=Symbol("type"),Xi=class{constructor(e,t,s,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[ee]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,s,i):e&&this.set(e)}decode(e,t,s,i){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=pt(e,t,100),this.mode=He(e,t+100,8),this.uid=He(e,t+108,8),this.gid=He(e,t+116,8),this.size=He(e,t+124,12),this.mtime=Ki(e,t+136,12),this.cksum=He(e,t+148,12),this[Yi](s),this[Yi](i,!0),this[ee]=pt(e,t+156,1),this[ee]===""&&(this[ee]="0"),this[ee]==="0"&&this.path.slice(-1)==="/"&&(this[ee]="5"),this[ee]==="5"&&(this.size=0),this.linkpath=pt(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=pt(e,t+265,32),this.gname=pt(e,t+297,32),this.devmaj=He(e,t+329,8),this.devmin=He(e,t+337,8),e[t+475]!==0){let o=pt(e,t+345,155);this.path=o+"/"+this.path}else{let o=pt(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Ki(e,t+476,12),this.ctime=Ki(e,t+488,12)}let n=8*32;for(let o=t;o<t+148;o++)n+=e[o];for(let o=t+156;o<t+512;o++)n+=e[o];this.cksumValid=n===this.cksum,this.cksum===null&&n===8*32&&(this.nullBlock=!0)}[Yi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=e[s])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||(t=0),!(e.length>=t+512))throw new Error("need 512 bytes for header");let s=this.ctime||this.atime?130:155,i=dh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=mt(e,t,100,n)||this.needPax,this.needPax=Je(e,t+100,8,this.mode)||this.needPax,this.needPax=Je(e,t+108,8,this.uid)||this.needPax,this.needPax=Je(e,t+116,8,this.gid)||this.needPax,this.needPax=Je(e,t+124,12,this.size)||this.needPax,this.needPax=Zi(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[ee].charCodeAt(0),this.needPax=mt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=mt(e,t+265,32,this.uname)||this.needPax,this.needPax=mt(e,t+297,32,this.gname)||this.needPax,this.needPax=Je(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Je(e,t+337,8,this.devmin)||this.needPax,this.needPax=mt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=mt(e,t+345,155,o)||this.needPax:(this.needPax=mt(e,t+345,130,o)||this.needPax,this.needPax=Zi(e,t+476,12,this.atime)||this.needPax,this.needPax=Zi(e,t+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];return this.cksum=a,Je(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return Vi.name.get(this[ee])||this[ee]}get typeKey(){return this[ee]}set type(e){Vi.code.has(e)?this[ee]=Vi.code.get(e):this[ee]=e}},dh=(r,e)=>{let s=r,i="",n,o=It.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=It.dirname(s),s=It.basename(s);do Buffer.byteLength(s)<=100&&Buffer.byteLength(i)<=e?n=[s,i,!1]:Buffer.byteLength(s)>100&&Buffer.byteLength(i)<=e?n=[s.slice(0,100-1),i,!0]:(s=It.join(It.basename(i),s),i=It.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},pt=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Ki=(r,e,t)=>Dh(He(r,e,t)),Dh=r=>r===null?null:new Date(r*1e3),He=(r,e,t)=>r[e]&128?Du.parse(r.slice(e,e+t)):Eh(r,e,t),gh=r=>isNaN(r)?null:r,Eh=(r,e,t)=>gh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),yh={12:8589934591,8:2097151},Je=(r,e,t,s)=>s===null?!1:s>yh[t]||s<0?(Du.encode(s,r.slice(e,e+t)),!0):(Ah(r,e,t,s),!1),Ah=(r,e,t,s)=>r.write(Ch(s,t),e,t,"ascii"),Ch=(r,e)=>wh(Math.floor(r).toString(8),e),wh=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",Zi=(r,e,t,s)=>s===null?!1:Je(r,e,t,s.getTime()/1e3),Fh=new Array(156).join("\0"),mt=(r,e,t,s)=>s===null?!1:(r.write(s+Fh,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);gu.exports=Xi});var ss=y((s0,Eu)=>{"use strict";u();var bh=Mt(),Sh=A("path"),yr=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e==="")return null;let t=Buffer.byteLength(e),s=512*Math.ceil(1+t/512),i=Buffer.allocUnsafe(s);for(let n=0;n<512;n++)i[n]=0;new bh({path:("PaxHeader/"+Sh.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(i),i.write(e,512,t,"utf8");for(let n=t+512;n<i.length;n++)i[n]=0;return i}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===void 0)return"";let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+`
|
|
2
|
+
`,i=Buffer.byteLength(s),n=Math.floor(Math.log(i)/Math.log(10))+1;return i+n>=Math.pow(10,n)&&(n+=1),n+i+s}};yr.parse=(r,e,t)=>new yr(kh(_h(r),e),t);var kh=(r,e)=>e?Object.keys(r).reduce((t,s)=>(t[s]=r[s],t),e):r,_h=r=>r.replace(/\n$/,"").split(`
|
|
3
|
+
`).reduce(Rh,Object.create(null)),Rh=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.slice((t+" ").length);let s=e.split("="),i=s.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return r;let n=s.join("=");return r[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,r};Eu.exports=yr});var Ut=y((i0,yu)=>{u();yu.exports=r=>{let e=r.length-1,t=-1;for(;e>-1&&r.charAt(e)==="/";)t=e,e--;return t===-1?r:r.slice(0,t)}});var is=y((n0,Au)=>{"use strict";u();Au.exports=r=>class extends r{warn(e,t,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=t instanceof Error&&t.code||e,s.tarCode=e,!this.strict&&s.recoverable!==!1?(t instanceof Error&&(s=Object.assign(t,s),t=t.message),this.emit("warn",s.tarCode,t,s)):t instanceof Error?this.emit("error",Object.assign(t,s)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),s))}}});var en=y((u0,Cu)=>{"use strict";u();var ns=["|","<",">","?",":"],Qi=ns.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),vh=new Map(ns.map((r,e)=>[r,Qi[e]])),Bh=new Map(Qi.map((r,e)=>[r,ns[e]]));Cu.exports={encode:r=>ns.reduce((e,t)=>e.split(t).join(vh.get(t)),r),decode:r=>Qi.reduce((e,t)=>e.split(t).join(Bh.get(t)),r)}});var tn=y((a0,Fu)=>{u();var{isAbsolute:xh,parse:wu}=A("path").win32;Fu.exports=r=>{let e="",t=wu(r);for(;xh(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=wu(r)}return[e,r]}});var Su=y((c0,bu)=>{"use strict";u();bu.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&-19),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var fn=y((f0,Uu)=>{"use strict";u();var Ou=Hr(),Tu=ss(),Pu=Mt(),Ee=A("fs"),ku=A("path"),ge=Lt(),Oh=Ut(),Nu=(r,e)=>e?(r=ge(r).replace(/^\.(\/|$)/,""),Oh(e)+"/"+r):ge(r),Th=16*1024*1024,_u=Symbol("process"),Ru=Symbol("file"),vu=Symbol("directory"),sn=Symbol("symlink"),Bu=Symbol("hardlink"),Ar=Symbol("header"),os=Symbol("read"),nn=Symbol("lstat"),us=Symbol("onlstat"),on=Symbol("onread"),un=Symbol("onreadlink"),an=Symbol("openfile"),cn=Symbol("onopenfile"),Ve=Symbol("close"),as=Symbol("mode"),ln=Symbol("awaitDrain"),rn=Symbol("ondrain"),ye=Symbol("prefix"),xu=Symbol("hadError"),Lu=is(),Ph=en(),Iu=tn(),Mu=Su(),cs=Lu(class extends Ou{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=ge(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||Th,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=ge(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?ge(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Iu(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=Ph.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=ge(t.absolute||ku.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[us](this.statCache.get(this.absolute)):this[nn]()}emit(e,...t){return e==="error"&&(this[xu]=!0),super.emit(e,...t)}[nn](){Ee.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[us](t)})}[us](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Lh(e),this.emit("stat",e),this[_u]()}[_u](){switch(this.type){case"File":return this[Ru]();case"Directory":return this[vu]();case"SymbolicLink":return this[sn]();default:return this.end()}}[as](e){return Mu(e,this.type==="Directory",this.portable)}[ye](e){return Nu(e,this.prefix)}[Ar](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Pu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this[as](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Tu({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[vu](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Ar](),this.end()}[sn](){Ee.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[un](t)})}[un](e){this.linkpath=ge(e),this[Ar](),this.end()}[Bu](e){this.type="Link",this.linkpath=ge(ku.relative(this.cwd,e)),this.stat.size=0,this[Ar](),this.end()}[Ru](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[Bu](t)}this.linkCache.set(e,this.absolute)}if(this[Ar](),this.stat.size===0)return this.end();this[an]()}[an](){Ee.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[cn](t)})}[cn](e){if(this.fd=e,this[xu])return this[Ve]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[os]()}[os](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ee.read(e,t,s,i,n,(o,a)=>{if(o)return this[Ve](()=>this.emit("error",o));this[on](a)})}[Ve](e){Ee.close(this.fd,e)}[on](e){if(e<=0&&this.remain>0){let i=new Error("encountered unexpected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Ve](()=>this.emit("error",i))}if(e>this.remain){let i=new Error("did not encounter expected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Ve](()=>this.emit("error",i))}if(e===this.remain)for(let i=e;i<this.length&&e<this.blockRemain;i++)this.buf[i+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(t)?this[rn]():this[ln](()=>this[rn]())}[ln](e){this.once("drain",e)}write(e){if(this.blockRemain<e.length){let t=new Error("writing more data than expected");return t.path=this.absolute,this.emit("error",t)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[rn](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Ve](e=>e?this.emit("error",e):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[os]()}}),hn=class extends cs{[nn](){this[us](Ee.lstatSync(this.absolute))}[sn](){this[un](Ee.readlinkSync(this.absolute))}[an](){this[cn](Ee.openSync(this.absolute,"r"))}[os](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ee.readSync(t,s,i,n,o);this[on](a),e=!1}finally{if(e)try{this[Ve](()=>{})}catch{}}}[ln](e){e()}[Ve](e){Ee.closeSync(this.fd),e()}},Nh=Lu(class extends Ou{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=t.prefix||null,this.path=ge(e.path),this.mode=this[as](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=ge(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Iu(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Pu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Tu({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[ye](e){return Nu(e,this.prefix)}[as](e){return Mu(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});cs.Sync=hn;cs.Tar=Nh;var Lh=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Uu.exports=cs});var qu=y((p0,ju)=>{"use strict";u();ju.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var pn=y((m0,$u)=>{"use strict";u();$u.exports=_;_.Node=dt;_.create=_;function _(r){var e=this;if(e instanceof _||(e=new _),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var t=0,s=arguments.length;t<s;t++)e.push(arguments[t]);return e}_.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var e=r.next,t=r.prev;return e&&(e.prev=t),t&&(t.next=e),r===this.head&&(this.head=e),r===this.tail&&(this.tail=t),r.list.length--,r.next=null,r.prev=null,r.list=null,e};_.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var e=this.head;r.list=this,r.next=e,e&&(e.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};_.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var e=this.tail;r.list=this,r.prev=e,e&&(e.next=r),this.tail=r,this.head||(this.head=r),this.length++}};_.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)Mh(this,arguments[r]);return this.length};_.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Uh(this,arguments[r]);return this.length};_.prototype.pop=function(){if(!!this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};_.prototype.shift=function(){if(!!this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};_.prototype.forEach=function(r,e){e=e||this;for(var t=this.head,s=0;t!==null;s++)r.call(e,t.value,s,this),t=t.next};_.prototype.forEachReverse=function(r,e){e=e||this;for(var t=this.tail,s=this.length-1;t!==null;s--)r.call(e,t.value,s,this),t=t.prev};_.prototype.get=function(r){for(var e=0,t=this.head;t!==null&&e<r;e++)t=t.next;if(e===r&&t!==null)return t.value};_.prototype.getReverse=function(r){for(var e=0,t=this.tail;t!==null&&e<r;e++)t=t.prev;if(e===r&&t!==null)return t.value};_.prototype.map=function(r,e){e=e||this;for(var t=new _,s=this.head;s!==null;)t.push(r.call(e,s.value,this)),s=s.next;return t};_.prototype.mapReverse=function(r,e){e=e||this;for(var t=new _,s=this.tail;s!==null;)t.push(r.call(e,s.value,this)),s=s.prev;return t};_.prototype.reduce=function(r,e){var t,s=this.head;if(arguments.length>1)t=e;else if(this.head)s=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;s!==null;i++)t=r(t,s.value,i),s=s.next;return t};_.prototype.reduceReverse=function(r,e){var t,s=this.tail;if(arguments.length>1)t=e;else if(this.tail)s=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;s!==null;i--)t=r(t,s.value,i),s=s.prev;return t};_.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};_.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};_.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new _;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(;i!==null&&s<e;s++,i=i.next)t.push(i.value);return t};_.prototype.sliceReverse=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new _;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=this.length,i=this.tail;i!==null&&s>e;s--)i=i.prev;for(;i!==null&&s>r;s--,i=i.prev)t.push(i.value);return t};_.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(var n=[],s=0;i&&s<e;s++)n.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var s=0;s<t.length;s++)i=Ih(this,i,t[s]);return n};_.prototype.reverse=function(){for(var r=this.head,e=this.tail,t=r;t!==null;t=t.prev){var s=t.prev;t.prev=t.next,t.next=s}return this.head=e,this.tail=r,this};function Ih(r,e,t){var s=e===r.head?new dt(t,null,e,r):new dt(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function Mh(r,e){r.tail=new dt(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Uh(r,e){r.head=new dt(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function dt(r,e,t,s){if(!(this instanceof dt))return new dt(r,e,t,s);this.list=s,this.value=r,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{qu()(_)}catch{}});var Es=y((D0,Yu)=>{"use strict";u();var Ds=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},jh=Hr(),qh=zi(),$h=ts(),wn=fn(),Wh=wn.Sync,zh=wn.Tar,Gh=pn(),Wu=Buffer.alloc(1024),fs=Symbol("onStat"),ls=Symbol("ended"),Ae=Symbol("queue"),jt=Symbol("current"),Dt=Symbol("process"),hs=Symbol("processing"),zu=Symbol("processJob"),Ce=Symbol("jobs"),mn=Symbol("jobDone"),ps=Symbol("addFSEntry"),Gu=Symbol("addTarEntry"),En=Symbol("stat"),yn=Symbol("readdir"),ms=Symbol("onreaddir"),ds=Symbol("pipe"),Hu=Symbol("entry"),dn=Symbol("entryOpt"),An=Symbol("writeEntryClass"),Vu=Symbol("write"),Dn=Symbol("ondrain"),gs=A("fs"),Ju=A("path"),Hh=is(),gn=Lt(),Fn=Hh(class extends jh{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=gn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[An]=wn,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new qh.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[Dn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[Dn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[Ae]=new Gh,this[Ce]=0,this.jobs=+e.jobs||4,this[hs]=!1,this[ls]=!1}[Vu](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ls]=!0,this[Dt](),this}write(e){if(this[ls])throw new Error("write after end");return e instanceof $h?this[Gu](e):this[ps](e),this.flowing}[Gu](e){let t=gn(Ju.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new Ds(e.path,t,!1);s.entry=new zh(e,this[dn](s)),s.entry.on("end",i=>this[mn](s)),this[Ce]+=1,this[Ae].push(s)}this[Dt]()}[ps](e){let t=gn(Ju.resolve(this.cwd,e));this[Ae].push(new Ds(e,t)),this[Dt]()}[En](e){e.pending=!0,this[Ce]+=1;let t=this.follow?"stat":"lstat";gs[t](e.absolute,(s,i)=>{e.pending=!1,this[Ce]-=1,s?this.emit("error",s):this[fs](e,i)})}[fs](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Dt]()}[yn](e){e.pending=!0,this[Ce]+=1,gs.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[Ce]-=1,t)return this.emit("error",t);this[ms](e,s)})}[ms](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Dt]()}[Dt](){if(!this[hs]){this[hs]=!0;for(let e=this[Ae].head;e!==null&&this[Ce]<this.jobs;e=e.next)if(this[zu](e.value),e.value.ignore){let t=e.next;this[Ae].removeNode(e),e.next=t}this[hs]=!1,this[ls]&&!this[Ae].length&&this[Ce]===0&&(this.zip?this.zip.end(Wu):(super.write(Wu),super.end()))}}get[jt](){return this[Ae]&&this[Ae].head&&this[Ae].head.value}[mn](e){this[Ae].shift(),this[Ce]-=1,this[Dt]()}[zu](e){if(!e.pending){if(e.entry){e===this[jt]&&!e.piped&&this[ds](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[fs](e,this.statCache.get(e.absolute)):this[En](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[ms](e,this.readdirCache.get(e.absolute)):this[yn](e),!e.readdir))){if(e.entry=this[Hu](e),!e.entry){e.ignore=!0;return}e===this[jt]&&!e.piped&&this[ds](e)}}}[dn](e){return{onwarn:(t,s,i)=>this.warn(t,s,i),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[Hu](e){this[Ce]+=1;try{return new this[An](e.path,this[dn](e)).on("end",()=>this[mn](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[Dn](){this[jt]&&this[jt].entry&&this[jt].entry.resume()}[ds](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)});let t=e.entry,s=this.zip;s?t.on("data",i=>{s.write(i)||t.pause()}):t.on("data",i=>{super.write(i)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),Cn=class extends Fn{constructor(e){super(e),this[An]=Wh}pause(){}resume(){}[En](e){let t=this.follow?"statSync":"lstatSync";this[fs](e,gs[t](e.absolute))}[yn](e,t){this[ms](e,gs.readdirSync(e.absolute))}[ds](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[Vu](i)})}};Fn.Sync=Cn;Yu.exports=Fn});var Vt=y(wr=>{"use strict";u();var Jh=Ri(),Vh=A("events").EventEmitter,K=A("fs"),kn=K.writev;if(!kn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;kn=(t,s,i,n)=>{let o=(l,c)=>n(l,c,s),a=new e;a.oncomplete=o,r.writeBuffers(t,s,i,a)}}var Ht=Symbol("_autoClose"),pe=Symbol("_close"),Cr=Symbol("_ended"),B=Symbol("_fd"),Ku=Symbol("_finished"),Ke=Symbol("_flags"),bn=Symbol("_flush"),_n=Symbol("_handleChunk"),Rn=Symbol("_makeBuf"),Fs=Symbol("_mode"),ys=Symbol("_needDrain"),zt=Symbol("_onerror"),Jt=Symbol("_onopen"),Sn=Symbol("_onread"),$t=Symbol("_onwrite"),Ze=Symbol("_open"),Le=Symbol("_path"),gt=Symbol("_pos"),we=Symbol("_queue"),Wt=Symbol("_read"),Zu=Symbol("_readSize"),Ye=Symbol("_reading"),As=Symbol("_remain"),Xu=Symbol("_size"),Cs=Symbol("_write"),qt=Symbol("_writing"),ws=Symbol("_defaultFlag"),Gt=Symbol("_errored"),bs=class extends Jh{constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Gt]=!1,this[B]=typeof t.fd=="number"?t.fd:null,this[Le]=e,this[Zu]=t.readSize||16*1024*1024,this[Ye]=!1,this[Xu]=typeof t.size=="number"?t.size:1/0,this[As]=this[Xu],this[Ht]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[B]=="number"?this[Wt]():this[Ze]()}get fd(){return this[B]}get path(){return this[Le]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ze](){K.open(this[Le],"r",(e,t)=>this[Jt](e,t))}[Jt](e,t){e?this[zt](e):(this[B]=t,this.emit("open",t),this[Wt]())}[Rn](){return Buffer.allocUnsafe(Math.min(this[Zu],this[As]))}[Wt](){if(!this[Ye]){this[Ye]=!0;let e=this[Rn]();if(e.length===0)return process.nextTick(()=>this[Sn](null,0,e));K.read(this[B],e,0,e.length,null,(t,s,i)=>this[Sn](t,s,i))}}[Sn](e,t,s){this[Ye]=!1,e?this[zt](e):this[_n](t,s)&&this[Wt]()}[pe](){if(this[Ht]&&typeof this[B]=="number"){let e=this[B];this[B]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[zt](e){this[Ye]=!0,this[pe](),this.emit("error",e)}[_n](e,t){let s=!1;return this[As]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[As]<=0)&&(s=!1,this[pe](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[B]=="number"&&this[Wt]();break;case"error":return this[Gt]?void 0:(this[Gt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},vn=class extends bs{[Ze](){let e=!0;try{this[Jt](null,K.openSync(this[Le],"r")),e=!1}finally{e&&this[pe]()}}[Wt](){let e=!0;try{if(!this[Ye]){this[Ye]=!0;do{let t=this[Rn](),s=t.length===0?0:K.readSync(this[B],t,0,t.length,null);if(!this[_n](s,t))break}while(!0);this[Ye]=!1}e=!1}finally{e&&this[pe]()}}[pe](){if(this[Ht]&&typeof this[B]=="number"){let e=this[B];this[B]=null,K.closeSync(e),this.emit("close")}}},Ss=class extends Vh{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Gt]=!1,this[qt]=!1,this[Cr]=!1,this[ys]=!1,this[we]=[],this[Le]=e,this[B]=typeof t.fd=="number"?t.fd:null,this[Fs]=t.mode===void 0?438:t.mode,this[gt]=typeof t.start=="number"?t.start:null,this[Ht]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[gt]!==null?"r+":"w";this[ws]=t.flags===void 0,this[Ke]=this[ws]?s:t.flags,this[B]===null&&this[Ze]()}emit(e,t){if(e==="error"){if(this[Gt])return;this[Gt]=!0}return super.emit(e,t)}get fd(){return this[B]}get path(){return this[Le]}[zt](e){this[pe](),this[qt]=!0,this.emit("error",e)}[Ze](){K.open(this[Le],this[Ke],this[Fs],(e,t)=>this[Jt](e,t))}[Jt](e,t){this[ws]&&this[Ke]==="r+"&&e&&e.code==="ENOENT"?(this[Ke]="w",this[Ze]()):e?this[zt](e):(this[B]=t,this.emit("open",t),this[bn]())}end(e,t){return e&&this.write(e,t),this[Cr]=!0,!this[qt]&&!this[we].length&&typeof this[B]=="number"&&this[$t](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Cr]?(this.emit("error",new Error("write() after end()")),!1):this[B]===null||this[qt]||this[we].length?(this[we].push(e),this[ys]=!0,!1):(this[qt]=!0,this[Cs](e),!0)}[Cs](e){K.write(this[B],e,0,e.length,this[gt],(t,s)=>this[$t](t,s))}[$t](e,t){e?this[zt](e):(this[gt]!==null&&(this[gt]+=t),this[we].length?this[bn]():(this[qt]=!1,this[Cr]&&!this[Ku]?(this[Ku]=!0,this[pe](),this.emit("finish")):this[ys]&&(this[ys]=!1,this.emit("drain"))))}[bn](){if(this[we].length===0)this[Cr]&&this[$t](null,0);else if(this[we].length===1)this[Cs](this[we].pop());else{let e=this[we];this[we]=[],kn(this[B],e,this[gt],(t,s)=>this[$t](t,s))}}[pe](){if(this[Ht]&&typeof this[B]=="number"){let e=this[B];this[B]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Bn=class extends Ss{[Ze](){let e;if(this[ws]&&this[Ke]==="r+")try{e=K.openSync(this[Le],this[Ke],this[Fs])}catch(t){if(t.code==="ENOENT")return this[Ke]="w",this[Ze]();throw t}else e=K.openSync(this[Le],this[Ke],this[Fs]);this[Jt](null,e)}[pe](){if(this[Ht]&&typeof this[B]=="number"){let e=this[B];this[B]=null,K.closeSync(e),this.emit("close")}}[Cs](e){let t=!0;try{this[$t](null,K.writeSync(this[B],e,0,e.length,this[gt])),t=!1}finally{if(t)try{this[pe]()}catch{}}}};wr.ReadStream=bs;wr.ReadStreamSync=vn;wr.WriteStream=Ss;wr.WriteStreamSync=Bn});var Os=y((y0,oa)=>{"use strict";u();var Yh=is(),Kh=Mt(),Zh=A("events"),Xh=pn(),Qh=1024*1024,ef=ts(),Qu=ss(),tf=zi(),{nextTick:rf}=A("process"),xn=Buffer.from([31,139]),ie=Symbol("state"),Et=Symbol("writeEntry"),Ie=Symbol("readEntry"),On=Symbol("nextEntry"),ea=Symbol("processEntry"),ne=Symbol("extendedHeader"),Fr=Symbol("globalExtendedHeader"),Xe=Symbol("meta"),ta=Symbol("emitMeta"),T=Symbol("buffer"),Me=Symbol("queue"),yt=Symbol("ended"),ra=Symbol("emittedEnd"),At=Symbol("emit"),Z=Symbol("unzip"),ks=Symbol("consumeChunk"),_s=Symbol("consumeChunkSub"),Tn=Symbol("consumeBody"),sa=Symbol("consumeMeta"),ia=Symbol("consumeHeader"),Rs=Symbol("consuming"),Pn=Symbol("bufferConcat"),Nn=Symbol("maybeEnd"),br=Symbol("writing"),Qe=Symbol("aborted"),vs=Symbol("onDone"),Ct=Symbol("sawValidEntry"),Bs=Symbol("sawNullBlock"),xs=Symbol("sawEOF"),na=Symbol("closeStream"),sf=r=>!0;oa.exports=Yh(class extends Zh{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Ct]=null,this.on(vs,t=>{(this[ie]==="begin"||this[Ct]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(vs,e.ondone):this.on(vs,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Qh,this.filter=typeof e.filter=="function"?e.filter:sf,this.writable=!0,this.readable=!1,this[Me]=new Xh,this[T]=null,this[Ie]=null,this[Et]=null,this[ie]="begin",this[Xe]="",this[ne]=null,this[Fr]=null,this[yt]=!1,this[Z]=null,this[Qe]=!1,this[Bs]=!1,this[xs]=!1,this.on("end",()=>this[na]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[ia](e,t){this[Ct]===null&&(this[Ct]=!1);let s;try{s=new Kh(e,t,this[ne],this[Fr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Bs]?(this[xs]=!0,this[ie]==="begin"&&(this[ie]="header"),this[At]("eof")):(this[Bs]=!0,this[At]("nullBlock"));else if(this[Bs]=!1,!s.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:s});else if(!s.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:s});else{let i=s.type;if(/^(Symbolic)?Link$/.test(i)&&!s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:s});else if(!/^(Symbolic)?Link$/.test(i)&&s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:s});else{let n=this[Et]=new ef(s,this[ne],this[Fr]);if(!this[Ct])if(n.remain){let o=()=>{n.invalid||(this[Ct]=!0)};n.on("end",o)}else this[Ct]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[At]("ignoredEntry",n),this[ie]="ignore",n.resume()):n.size>0&&(this[Xe]="",n.on("data",o=>this[Xe]+=o),this[ie]="meta"):(this[ne]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[At]("ignoredEntry",n),this[ie]=n.remain?"ignore":"header",n.resume()):(n.remain?this[ie]="body":(this[ie]="header",n.end()),this[Ie]?this[Me].push(n):(this[Me].push(n),this[On]())))}}}[na](){rf(()=>this.emit("close"))}[ea](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Ie]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[On]()),t=!1)):(this[Ie]=null,t=!1),t}[On](){do;while(this[ea](this[Me].shift()));if(!this[Me].length){let e=this[Ie];!e||e.flowing||e.size===e.remain?this[br]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[Tn](e,t){let s=this[Et],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[ie]="header",this[Et]=null,s.end()),n.length}[sa](e,t){let s=this[Et],i=this[Tn](e,t);return this[Et]||this[ta](s),i}[At](e,t,s){!this[Me].length&&!this[Ie]?this.emit(e,t,s):this[Me].push([e,t,s])}[ta](e){switch(this[At]("meta",this[Xe]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ne]=Qu.parse(this[Xe],this[ne],!1);break;case"GlobalExtendedHeader":this[Fr]=Qu.parse(this[Xe],this[Fr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ne]=this[ne]||Object.create(null),this[ne].path=this[Xe].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ne]=this[ne]||Object.create(null),this[ne].linkpath=this[Xe].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Qe]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[Qe])return;if(this[Z]===null&&e){if(this[T]&&(e=Buffer.concat([this[T],e]),this[T]=null),e.length<xn.length)return this[T]=e,!0;for(let s=0;this[Z]===null&&s<xn.length;s++)e[s]!==xn[s]&&(this[Z]=!1);if(this[Z]===null){let s=this[yt];this[yt]=!1,this[Z]=new tf.Unzip,this[Z].on("data",n=>this[ks](n)),this[Z].on("error",n=>this.abort(n)),this[Z].on("end",n=>{this[yt]=!0,this[ks]()}),this[br]=!0;let i=this[Z][s?"end":"write"](e);return this[br]=!1,i}}this[br]=!0,this[Z]?this[Z].write(e):this[ks](e),this[br]=!1;let t=this[Me].length?!1:this[Ie]?this[Ie].flowing:!0;return!t&&!this[Me].length&&this[Ie].once("drain",s=>this.emit("drain")),t}[Pn](e){e&&!this[Qe]&&(this[T]=this[T]?Buffer.concat([this[T],e]):e)}[Nn](){if(this[yt]&&!this[ra]&&!this[Qe]&&!this[Rs]){this[ra]=!0;let e=this[Et];if(e&&e.blockRemain){let t=this[T]?this[T].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[T]&&e.write(this[T]),e.end()}this[At](vs)}}[ks](e){if(this[Rs])this[Pn](e);else if(!e&&!this[T])this[Nn]();else{if(this[Rs]=!0,this[T]){this[Pn](e);let t=this[T];this[T]=null,this[_s](t)}else this[_s](e);for(;this[T]&&this[T].length>=512&&!this[Qe]&&!this[xs];){let t=this[T];this[T]=null,this[_s](t)}this[Rs]=!1}(!this[T]||this[yt])&&this[Nn]()}[_s](e){let t=0,s=e.length;for(;t+512<=s&&!this[Qe]&&!this[xs];)switch(this[ie]){case"begin":case"header":this[ia](e,t),t+=512;break;case"ignore":case"body":t+=this[Tn](e,t);break;case"meta":t+=this[sa](e,t);break;default:throw new Error("invalid state: "+this[ie])}t<s&&(this[T]?this[T]=Buffer.concat([e.slice(t),this[T]]):this[T]=e.slice(t))}end(e){this[Qe]||(this[Z]?this[Z].end(e):(this[yt]=!0,this.write(e)))}})});var Ts=y((A0,la)=>{"use strict";u();var nf=xt(),aa=Os(),Yt=A("fs"),of=Vt(),ua=A("path"),Ln=Ut();la.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=nf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&af(s,e),s.noResume||uf(s),s.file&&s.sync?cf(s):s.file?lf(s,t):ca(s)};var uf=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},af=(r,e)=>{let t=new Map(e.map(n=>[Ln(n),!0])),s=r.filter,i=(n,o)=>{let a=o||ua.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(ua.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(Ln(n)):n=>i(Ln(n))},cf=r=>{let e=ca(r),t=r.file,s=!0,i;try{let n=Yt.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(Yt.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=Yt.openSync(t,"r");a<n.size;){let c=Yt.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{Yt.closeSync(i)}catch{}}},lf=(r,e)=>{let t=new aa(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Yt.stat(i,(l,c)=>{if(l)a(l);else{let h=new of.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},ca=r=>new aa(r)});var Da=y((C0,da)=>{"use strict";u();var hf=xt(),Ps=Es(),ha=Vt(),fa=Ts(),pa=A("path");da.exports=(r,e,t)=>{if(typeof e=="function"&&(t=e),Array.isArray(r)&&(e=r,r={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let s=hf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return s.file&&s.sync?ff(s,e):s.file?pf(s,e,t):s.sync?mf(s,e):df(s,e)};var ff=(r,e)=>{let t=new Ps.Sync(r),s=new ha.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),ma(t,e)},pf=(r,e,t)=>{let s=new Ps(r),i=new ha.WriteStream(r.file,{mode:r.mode||438});s.pipe(i);let n=new Promise((o,a)=>{i.on("error",a),i.on("close",o),s.on("error",a)});return In(s,e),t?n.then(t,t):n},ma=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?fa({file:pa.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},In=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return fa({file:pa.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>In(r,e));r.add(t)}r.end()},mf=(r,e)=>{let t=new Ps.Sync(r);return ma(t,e),t},df=(r,e)=>{let t=new Ps(r);return In(t,e),t}});var Mn=y((w0,Fa)=>{"use strict";u();var Df=xt(),ga=Es(),te=A("fs"),Ea=Vt(),ya=Ts(),Aa=A("path"),Ca=Mt();Fa.exports=(r,e,t)=>{let s=Df(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),s.sync?gf(s,e):yf(s,e,t)};var gf=(r,e)=>{let t=new ga.Sync(r),s=!0,i,n;try{try{i=te.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=te.openSync(r.file,"w+");else throw l}let o=te.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,d=0;h<512;h+=d){if(d=te.readSync(i,a,h,a.length-h,n+h),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!d)break e}let l=new Ca(a);if(!l.cksumValid)break;let c=512*Math.ceil(l.size/512);if(n+c+512>o.size)break;n+=c,r.mtimeCache&&r.mtimeCache.set(l.path,l.mtime)}s=!1,Ef(r,t,n,i,e)}finally{if(s)try{te.closeSync(i)}catch{}}},Ef=(r,e,t,s,i)=>{let n=new Ea.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),Af(e,i)},yf=(r,e,t)=>{e=Array.from(e);let s=new ga(r),i=(o,a,l)=>{let c=(S,P)=>{S?te.close(o,k=>l(S)):l(null,P)},h=0;if(a===0)return c(null,0);let d=0,g=Buffer.alloc(512),w=(S,P)=>{if(S)return c(S);if(d+=P,d<512&&P)return te.read(o,g,d,g.length-d,h+d,w);if(h===0&&g[0]===31&&g[1]===139)return c(new Error("cannot append to compressed archives"));if(d<512)return c(null,h);let k=new Ca(g);if(!k.cksumValid)return c(null,h);let O=512*Math.ceil(k.size/512);if(h+O+512>a||(h+=O+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(k.path,k.mtime),d=0,te.read(o,g,0,512,h,w)};te.read(o,g,0,512,h,w)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,d)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",te.open(r.file,l,c);if(h)return a(h);te.fstat(d,(g,w)=>{if(g)return te.close(d,()=>a(g));i(d,w.size,(S,P)=>{if(S)return a(S);let k=new Ea.WriteStream(r.file,{fd:d,start:P});s.pipe(k),k.on("error",a),k.on("close",o),wa(s,e)})})};te.open(r.file,l,c)});return t?n.then(t,t):n},Af=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?ya({file:Aa.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},wa=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return ya({file:Aa.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>wa(r,e));r.add(t)}r.end()}});var Sa=y((F0,ba)=>{"use strict";u();var Cf=xt(),wf=Mn();ba.exports=(r,e,t)=>{let s=Cf(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),Ff(s),wf(s,e,t)};var Ff=r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,s)=>e(t,s)&&!(r.mtimeCache.get(t)>s.mtime):(t,s)=>!(r.mtimeCache.get(t)>s.mtime)}});var Ra=y((b0,_a)=>{u();var{promisify:ka}=A("util"),et=A("fs"),bf=r=>{if(!r)r={mode:511,fs:et};else if(typeof r=="object")r={mode:511,fs:et,...r};else if(typeof r=="number")r={mode:r,fs:et};else if(typeof r=="string")r={mode:parseInt(r,8),fs:et};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||et.mkdir,r.mkdirAsync=ka(r.mkdir),r.stat=r.stat||r.fs.stat||et.stat,r.statAsync=ka(r.stat),r.statSync=r.statSync||r.fs.statSync||et.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||et.mkdirSync,r};_a.exports=bf});var Ba=y((S0,va)=>{u();var Sf=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:kf,parse:_f}=A("path"),Rf=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=kf(r),Sf==="win32"){let e=/[*|"<>?:]/,{root:t}=_f(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};va.exports=Rf});var Na=y((k0,Pa)=>{u();var{dirname:xa}=A("path"),Oa=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?Oa(r,xa(e),e):void 0),Ta=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Ta(r,xa(e),e):void 0}};Pa.exports={findMade:Oa,findMadeSync:Ta}});var qn=y((_0,Ia)=>{u();var{dirname:La}=A("path"),Un=(r,e,t)=>{e.recursive=!1;let s=La(r);return s===r?e.mkdirAsync(r,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(r,e).then(()=>t||r,i=>{if(i.code==="ENOENT")return Un(s,e).then(n=>Un(r,e,n));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;return e.statAsync(r).then(n=>{if(n.isDirectory())return t;throw i},()=>{throw i})})},jn=(r,e,t)=>{let s=La(r);if(e.recursive=!1,s===r)try{return e.mkdirSync(r,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(r,e),t||r}catch(i){if(i.code==="ENOENT")return jn(r,e,jn(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};Ia.exports={mkdirpManual:Un,mkdirpManualSync:jn}});var ja=y((R0,Ua)=>{u();var{dirname:Ma}=A("path"),{findMade:vf,findMadeSync:Bf}=Na(),{mkdirpManual:xf,mkdirpManualSync:Of}=qn(),Tf=(r,e)=>(e.recursive=!0,Ma(r)===r?e.mkdirAsync(r,e):vf(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return xf(r,e);throw i}))),Pf=(r,e)=>{if(e.recursive=!0,Ma(r)===r)return e.mkdirSync(r,e);let s=Bf(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return Of(r,e);throw i}};Ua.exports={mkdirpNative:Tf,mkdirpNativeSync:Pf}});var za=y((v0,Wa)=>{u();var qa=A("fs"),Nf=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,$n=Nf.replace(/^v/,"").split("."),$a=+$n[0]>10||+$n[0]==10&&+$n[1]>=12,Lf=$a?r=>r.mkdir===qa.mkdir:()=>!1,If=$a?r=>r.mkdirSync===qa.mkdirSync:()=>!1;Wa.exports={useNative:Lf,useNativeSync:If}});var Ka=y((B0,Ya)=>{u();var Kt=Ra(),Zt=Ba(),{mkdirpNative:Ga,mkdirpNativeSync:Ha}=ja(),{mkdirpManual:Ja,mkdirpManualSync:Va}=qn(),{useNative:Mf,useNativeSync:Uf}=za(),Xt=(r,e)=>(r=Zt(r),e=Kt(e),Mf(e)?Ga(r,e):Ja(r,e)),jf=(r,e)=>(r=Zt(r),e=Kt(e),Uf(e)?Ha(r,e):Va(r,e));Xt.sync=jf;Xt.native=(r,e)=>Ga(Zt(r),Kt(e));Xt.manual=(r,e)=>Ja(Zt(r),Kt(e));Xt.nativeSync=(r,e)=>Ha(Zt(r),Kt(e));Xt.manualSync=(r,e)=>Va(Zt(r),Kt(e));Ya.exports=Xt});var sc=y((x0,rc)=>{"use strict";u();var oe=A("fs"),wt=A("path"),qf=oe.lchown?"lchown":"chown",$f=oe.lchownSync?"lchownSync":"chownSync",Xa=oe.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Za=(r,e,t)=>{try{return oe[$f](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Wf=(r,e,t)=>{try{return oe.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},zf=Xa?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):oe.chown(r,e,t,s)}:(r,e,t,s)=>s,Wn=Xa?(r,e,t)=>{try{return Za(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Wf(r,e,t)}}:(r,e,t)=>Za(r,e,t),Gf=process.version,Qa=(r,e,t)=>oe.readdir(r,e,t),Hf=(r,e)=>oe.readdirSync(r,e);/^v4\./.test(Gf)&&(Qa=(r,e,t)=>oe.readdir(r,t));var Ns=(r,e,t,s)=>{oe[qf](r,e,t,zf(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},ec=(r,e,t,s,i)=>{if(typeof e=="string")return oe.lstat(wt.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,ec(r,o,t,s,i)});if(e.isDirectory())zn(wt.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=wt.resolve(r,e.name);Ns(o,t,s,i)});else{let n=wt.resolve(r,e.name);Ns(n,t,s,i)}},zn=(r,e,t,s)=>{Qa(r,{withFileTypes:!0},(i,n)=>{if(i){if(i.code==="ENOENT")return s();if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return s(i)}if(i||!n.length)return Ns(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Ns(r,e,t,s)}};n.forEach(c=>ec(r,c,e,t,l))})},Jf=(r,e,t,s)=>{if(typeof e=="string")try{let i=oe.lstatSync(wt.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&tc(wt.resolve(r,e.name),t,s),Wn(wt.resolve(r,e.name),t,s)},tc=(r,e,t)=>{let s;try{s=Hf(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return Wn(r,e,t);throw i}return s&&s.length&&s.forEach(i=>Jf(r,i,e,t)),Wn(r,e,t)};rc.exports=zn;zn.sync=tc});var uc=y((O0,Gn)=>{"use strict";u();var ic=Ka(),ue=A("fs"),Ls=A("path"),nc=sc(),me=Lt(),Is=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Ms=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},Us=(r,e)=>r.get(me(e)),Sr=(r,e,t)=>r.set(me(e),t),Vf=(r,e)=>{ue.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Ms(r,t&&t.code||"ENOTDIR")),e(t)})};Gn.exports=(r,e,t)=>{r=me(r);let s=e.umask,i=e.mode|448,n=(i&s)!==0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,h=e.unlink,d=e.cache,g=me(e.cwd),w=(k,O)=>{k?t(k):(Sr(d,r,!0),O&&l?nc(O,o,a,ut=>w(ut)):n?ue.chmod(r,i,t):t())};if(d&&Us(d,r)===!0)return w();if(r===g)return Vf(r,w);if(c)return ic(r,{mode:i}).then(k=>w(null,k),w);let P=me(Ls.relative(g,r)).split("/");js(g,P,i,d,h,g,null,w)};var js=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=me(Ls.resolve(r+"/"+l));if(Us(s,c))return js(c,e,t,s,i,n,o,a);ue.mkdir(c,t,oc(c,e,t,s,i,n,o,a))},oc=(r,e,t,s,i,n,o,a)=>l=>{l?ue.lstat(r,(c,h)=>{if(c)c.path=c.path&&me(c.path),a(c);else if(h.isDirectory())js(r,e,t,s,i,n,o,a);else if(i)ue.unlink(r,d=>{if(d)return a(d);ue.mkdir(r,t,oc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new Is(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,js(r,e,t,s,i,n,o,a))},Yf=r=>{let e=!1,t="ENOTDIR";try{e=ue.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Ms(r,t)}};Gn.exports.sync=(r,e)=>{r=me(r);let t=e.umask,s=e.mode|448,i=(s&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,h=e.cache,d=me(e.cwd),g=k=>{Sr(h,r,!0),k&&a&&nc.sync(k,n,o),i&&ue.chmodSync(r,s)};if(h&&Us(h,r)===!0)return g();if(r===d)return Yf(d),g();if(l)return g(ic.sync(r,s));let S=me(Ls.relative(d,r)).split("/"),P=null;for(let k=S.shift(),O=d;k&&(O+="/"+k);k=S.shift())if(O=me(Ls.resolve(O)),!Us(h,O))try{ue.mkdirSync(O,s),P=P||O,Sr(h,O,!0)}catch{let de=ue.lstatSync(O);if(de.isDirectory()){Sr(h,O,!0);continue}else if(c){ue.unlinkSync(O),ue.mkdirSync(O,s),P=P||O,Sr(h,O,!0);continue}else if(de.isSymbolicLink())return new Is(O,O+"/"+S.join("/"))}return g(P)}});var Jn=y((T0,ac)=>{u();var Hn=Object.create(null),{hasOwnProperty:Kf}=Object.prototype;ac.exports=r=>(Kf.call(Hn,r)||(Hn[r]=r.normalize("NFKD")),Hn[r])});var fc=y((P0,hc)=>{u();var cc=A("assert"),Zf=Jn(),Xf=Ut(),{join:lc}=A("path"),Qf=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,ep=Qf==="win32";hc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((d,g)=>(d.length&&(g=lc(d[d.length-1],g)),d.push(g||"/"),d),[]),s=new Set,i=c=>{let h=e.get(c);if(!h)throw new Error("function does not have any path reservations");return{paths:h.paths.map(d=>r.get(d)),dirs:[...h.dirs].map(d=>r.get(d))}},n=c=>{let{paths:h,dirs:d}=i(c);return h.every(g=>g[0]===c)&&d.every(g=>g[0]instanceof Set&&g[0].has(c))},o=c=>s.has(c)||!n(c)?!1:(s.add(c),c(()=>a(c)),!0),a=c=>{if(!s.has(c))return!1;let{paths:h,dirs:d}=e.get(c),g=new Set;return h.forEach(w=>{let S=r.get(w);cc.equal(S[0],c),S.length===1?r.delete(w):(S.shift(),typeof S[0]=="function"?g.add(S[0]):S[0].forEach(P=>g.add(P)))}),d.forEach(w=>{let S=r.get(w);cc(S[0]instanceof Set),S[0].size===1&&S.length===1?r.delete(w):S[0].size===1?(S.shift(),g.add(S[0])):S[0].delete(c)}),s.delete(c),g.forEach(w=>o(w)),!0};return{check:n,reserve:(c,h)=>{c=ep?["win32 parallelization disabled"]:c.map(g=>Zf(Xf(lc(g))).toLowerCase());let d=new Set(c.map(g=>t(g)).reduce((g,w)=>g.concat(w)));return e.set(h,{dirs:d,paths:c}),c.forEach(g=>{let w=r.get(g);w?w.push(h):r.set(g,[h])}),d.forEach(g=>{let w=r.get(g);w?w[w.length-1]instanceof Set?w[w.length-1].add(h):w.push(new Set([h])):r.set(g,[new Set([h])])}),o(h)}}}});var dc=y((N0,mc)=>{u();var tp=process.env.__FAKE_PLATFORM__||process.platform,rp=tp==="win32",sp=global.__FAKE_TESTING_FS__||A("fs"),{O_CREAT:ip,O_TRUNC:np,O_WRONLY:op,UV_FS_O_FILEMAP:pc=0}=sp.constants,up=rp&&!!pc,ap=512*1024,cp=pc|np|ip|op;mc.exports=up?r=>r<ap?cp:"w":()=>"w"});var ro=y((L0,vc)=>{"use strict";u();var lp=A("assert"),hp=Os(),R=A("fs"),fp=Vt(),Ue=A("path"),kc=uc(),Dc=en(),pp=fc(),mp=tn(),re=Lt(),dp=Ut(),Dp=Jn(),gc=Symbol("onEntry"),Kn=Symbol("checkFs"),Ec=Symbol("checkFs2"),Ws=Symbol("pruneCache"),Zn=Symbol("isReusable"),ae=Symbol("makeFs"),Xn=Symbol("file"),Qn=Symbol("directory"),zs=Symbol("link"),yc=Symbol("symlink"),Ac=Symbol("hardlink"),Cc=Symbol("unsupported"),wc=Symbol("checkPath"),tt=Symbol("mkdir"),G=Symbol("onError"),qs=Symbol("pending"),Fc=Symbol("pend"),Qt=Symbol("unpend"),Vn=Symbol("ended"),Yn=Symbol("maybeClose"),eo=Symbol("skip"),kr=Symbol("doChown"),_r=Symbol("uid"),Rr=Symbol("gid"),vr=Symbol("checkedCwd"),_c=A("crypto"),Rc=dc(),gp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Br=gp==="win32",Ep=(r,e)=>{if(!Br)return R.unlink(r,e);let t=r+".DELETE."+_c.randomBytes(16).toString("hex");R.rename(r,t,s=>{if(s)return e(s);R.unlink(t,e)})},yp=r=>{if(!Br)return R.unlinkSync(r);let e=r+".DELETE."+_c.randomBytes(16).toString("hex");R.renameSync(r,e),R.unlinkSync(e)},bc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,Sc=r=>Dp(dp(re(r))).toLowerCase(),Ap=(r,e)=>{e=Sc(e);for(let t of r.keys()){let s=Sc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},Cp=r=>{for(let e of r.keys())r.delete(e)},xr=class extends hp{constructor(e){if(e||(e={}),e.ondone=t=>{this[Vn]=!0,this[Yn]()},super(e),this[vr]=!1,this.reservations=pp(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[qs]=0,this[Vn]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Br,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=re(Ue.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[gc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Yn](){this[Vn]&&this[qs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[wc](e){if(this.strip){let t=re(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=re(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=re(e.path),s=t.split("/");if(s.includes("..")||Br&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=mp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(Ue.isAbsolute(e.path)?e.absolute=re(Ue.resolve(e.path)):e.absolute=re(Ue.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:re(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:t}=Ue.win32.parse(e.absolute);e.absolute=t+Dc.encode(e.absolute.slice(t.length));let{root:s}=Ue.win32.parse(e.path);e.path=s+Dc.encode(e.path.slice(s.length))}return!0}[gc](e){if(!this[wc](e))return e.resume();switch(lp.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Kn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Cc](e)}}[G](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[Qt](),t.resume())}[tt](e,t,s){kc(re(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},s)}[kr](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[_r](e){return bc(this.uid,e.uid,this.processUid)}[Rr](e){return bc(this.gid,e.gid,this.processGid)}[Xn](e,t){let s=e.mode&4095||this.fmode,i=new fp.WriteStream(e.absolute,{flags:Rc(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&R.close(i.fd,()=>{}),i.write=()=>!0,this[G](l,e),t()});let n=1,o=l=>{if(l){i.fd&&R.close(i.fd,()=>{}),this[G](l,e),t();return}--n===0&&R.close(i.fd,c=>{c?this[G](c,e):this[Qt](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let d=e.atime||new Date,g=e.mtime;R.futimes(h,d,g,w=>w?R.utimes(c,d,g,S=>o(S&&w)):o())}if(this[kr](e)){n++;let d=this[_r](e),g=this[Rr](e);R.fchown(h,d,g,w=>w?R.chown(c,d,g,S=>o(S&&w)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>{this[G](l,e),t()}),e.pipe(a)),a.pipe(i)}[Qn](e,t){let s=e.mode&4095||this.dmode;this[tt](e.absolute,s,i=>{if(i){this[G](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[Qt](),e.resume())};e.mtime&&!this.noMtime&&(n++,R.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[kr](e)&&(n++,R.chown(e.absolute,this[_r](e),this[Rr](e),o)),o()})}[Cc](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[yc](e,t){this[zs](e,e.linkpath,"symlink",t)}[Ac](e,t){let s=re(Ue.resolve(this.cwd,e.linkpath));this[zs](e,s,"link",t)}[Fc](){this[qs]++}[Qt](){this[qs]--,this[Yn]()}[eo](e){this[Qt](),e.resume()}[Zn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Br}[Kn](e){this[Fc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[Ec](e,s))}[Ws](e){e.type==="SymbolicLink"?Cp(this.dirCache):e.type!=="Directory"&&Ap(this.dirCache,e.absolute)}[Ec](e,t){this[Ws](e);let s=a=>{this[Ws](e),t(a)},i=()=>{this[tt](this.cwd,this.dmode,a=>{if(a){this[G](a,e),s();return}this[vr]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=re(Ue.dirname(e.absolute));if(a!==this.cwd)return this[tt](a,this.dmode,l=>{if(l){this[G](l,e),s();return}o()})}o()},o=()=>{R.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[eo](e),s();return}if(a||this[Zn](e,l))return this[ae](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=d=>this[ae](d,e,s);return c?R.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return R.rmdir(e.absolute,c=>this[ae](c,e,s))}if(e.absolute===this.cwd)return this[ae](null,e,s);Ep(e.absolute,c=>this[ae](c,e,s))})};this[vr]?n():i()}[ae](e,t,s){if(e){this[G](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Xn](t,s);case"Link":return this[Ac](t,s);case"SymbolicLink":return this[yc](t,s);case"Directory":case"GNUDumpDir":return this[Qn](t,s)}}[zs](e,t,s,i){R[s](t,e.absolute,n=>{n?this[G](n,e):(this[Qt](),e.resume()),i()})}},$s=r=>{try{return[null,r()]}catch(e){return[e,null]}},to=class extends xr{[ae](e,t){return super[ae](e,t,()=>{})}[Kn](e){if(this[Ws](e),!this[vr]){let n=this[tt](this.cwd,this.dmode);if(n)return this[G](n,e);this[vr]=!0}if(e.absolute!==this.cwd){let n=re(Ue.dirname(e.absolute));if(n!==this.cwd){let o=this[tt](n,this.dmode);if(o)return this[G](o,e)}}let[t,s]=$s(()=>R.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[eo](e);if(t||this[Zn](e,s))return this[ae](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?$s(()=>{R.chmodSync(e.absolute,e.mode)}):[];return this[ae](a,e)}let[n]=$s(()=>R.rmdirSync(e.absolute));this[ae](n,e)}let[i]=e.absolute===this.cwd?[]:$s(()=>yp(e.absolute));this[ae](i,e)}[Xn](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{R.closeSync(n)}catch(c){l=c}(a||l)&&this[G](a||l,e),t()},n;try{n=R.openSync(e.absolute,Rc(e.size),s)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[G](a,e)),e.pipe(o)),o.on("data",a=>{try{R.writeSync(n,a,0,a.length)}catch(l){i(l)}}),o.on("end",a=>{let l=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,h=e.mtime;try{R.futimesSync(n,c,h)}catch(d){try{R.utimesSync(e.absolute,c,h)}catch{l=d}}}if(this[kr](e)){let c=this[_r](e),h=this[Rr](e);try{R.fchownSync(n,c,h)}catch(d){try{R.chownSync(e.absolute,c,h)}catch{l=l||d}}}i(l)})}[Qn](e,t){let s=e.mode&4095||this.dmode,i=this[tt](e.absolute,s);if(i){this[G](i,e),t();return}if(e.mtime&&!this.noMtime)try{R.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[kr](e))try{R.chownSync(e.absolute,this[_r](e),this[Rr](e))}catch{}t(),e.resume()}[tt](e,t){try{return kc.sync(re(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(s){return s}}[zs](e,t,s,i){try{R[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[G](n,e)}}};xr.Sync=to;vc.exports=xr});var Pc=y((I0,Tc)=>{"use strict";u();var wp=xt(),Gs=ro(),xc=A("fs"),Oc=Vt(),Bc=A("path"),so=Ut();Tc.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=wp(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&Fp(s,e),s.file&&s.sync?bp(s):s.file?Sp(s,t):s.sync?kp(s):_p(s)};var Fp=(r,e)=>{let t=new Map(e.map(n=>[so(n),!0])),s=r.filter,i=(n,o)=>{let a=o||Bc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(Bc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(so(n)):n=>i(so(n))},bp=r=>{let e=new Gs.Sync(r),t=r.file,s=xc.statSync(t),i=r.maxReadSize||16*1024*1024;new Oc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},Sp=(r,e)=>{let t=new Gs(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),xc.stat(i,(l,c)=>{if(l)a(l);else{let h=new Oc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},kp=r=>new Gs.Sync(r),_p=r=>new Gs(r)});var Nc=y(I=>{"use strict";u();I.c=I.create=Da();I.r=I.replace=Mn();I.t=I.list=Ts();I.u=I.update=Sa();I.x=I.extract=Pc();I.Pack=Es();I.Unpack=ro();I.Parse=Os();I.ReadEntry=ts();I.WriteEntry=fn();I.Header=Mt();I.Pax=ss();I.types=Ji()});var Ic=y((z0,Lc)=>{u();function ce(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Lc.exports=ce;ce.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};ce.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};ce.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},t),this._options.unref&&this._timer.unref(),!0};ce.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};ce.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};ce.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};ce.prototype.start=ce.prototype.try;ce.prototype.errors=function(){return this._errors};ce.prototype.attempts=function(){return this._attempts};ce.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,s=0;s<this._errors.length;s++){var i=this._errors[s],n=i.message,o=(r[n]||0)+1;r[n]=o,o>=t&&(e=i,t=o)}return e}});var Mc=y(Ft=>{u();var vp=Ic();Ft.operation=function(r){var e=Ft.timeouts(r);return new vp(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};Ft.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],i=0;i<e.retries;i++)s.push(this.createTimeout(i,e));return r&&r.forever&&!s.length&&s.push(this.createTimeout(i,e)),s.sort(function(n,o){return n-o}),s};Ft.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,s=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return s=Math.min(s,e.maxTimeout),s};Ft.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var s in r)typeof r[s]=="function"&&t.push(s)}for(var i=0;i<t.length;i++){var n=t[i],o=r[n];r[n]=function(l){var c=Ft.operation(e),h=Array.prototype.slice.call(arguments,1),d=h.pop();h.push(function(g){c.retry(g)||(g&&(arguments[0]=c.mainError()),d.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var jc=y((H0,Uc)=>{u();Uc.exports=Mc()});var $c=y((J0,qc)=>{u();var Bp=jc();function xp(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=Bp.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,d){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,d):i(o.mainError())}function c(h){var d;try{d=r(a,h)}catch(g){l(g,h);return}Promise.resolve(d).then(s).catch(function(w){l(w,h)})}o.attempt(c)}return new Promise(t)}qc.exports=xp});var cr={};ll(cr,{bold:()=>Cl,dimmed:()=>Fl,error:()=>Rt,grey:()=>bl,info:()=>Al,item:()=>Sl,log:()=>X,turboBlue:()=>_t,turboGradient:()=>yl,turboLoader:()=>fo,turboRed:()=>lo,underline:()=>wl,warn:()=>si,yellow:()=>ho});u();import{reset as fl,bold as ar,underline as pl,gray as ml,dim as dl}from"picocolors";import Dl from"ora";import gl from"gradient-string";var ao="#0099F7",co="#F11712",El="#FFFF00",ri=r=>{let e=kl(r);return t=>`\x1B[38;5;${e}m${t}${fl("")}`},yl=gl(ao,co),_t=ri(ao),lo=ri(co),ho=ri(El),fo=r=>Dl({text:r,spinner:{frames:[" ",_t("> "),_t(">> "),_t(">>>")]}}),Al=(...r)=>{X(_t(ar(">>>")),r.join(" "))},Cl=(...r)=>{X(ar(r.join(" ")))},wl=(...r)=>{X(pl(r.join(" ")))},Fl=(...r)=>{X(dl(r.join(" ")))},bl=(...r)=>{X(ml(r.join(" ")))},Sl=(...r)=>{X(_t(ar(" \u2022")),r.join(" "))},X=(...r)=>{console.log(...r)},si=(...r)=>{console.error(ho(ar(">>>")),r.join(" "))},Rt=(...r)=>{console.error(lo(ar(">>>")),r.join(" "))};function kl(r){let e=parseInt(r.slice(1),16),t=Math.floor(e/(256*256))%256,s=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(i/255*5)}u();import _l from"os";import Rl from"execa";var vl=5e3;async function Lr(r,e=[],t){let s={cwd:_l.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},timeout:vl,...t};try{let{stdout:i}=await Rl(r,e,s);return i.trim()}catch{return}}async function Bl(){let[r,e,t,s]=await Promise.all([Lr("yarnpkg",["--version"],{cwd:"."}),Lr("npm",["--version"]),Lr("pnpm",["--version"]),Lr("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();import ii from"picocolors";import xl from"update-check";function Ol(r){let{packageInfo:e,upgradeCommand:t}=r,s=xl(e).catch(()=>null);return async function(n=0){try{let o=await s;if(o!=null&&o.latest){X(),X(ii.yellow(ii.bold(`A new version of \`${e.name}\` is available!`)));let a=typeof t=="function"?await t():t;a&&X(`You can update by running: ${ii.cyan(a)}`),X()}process.exit(n)}catch(o){process.env.DEBUG&&Rt("Update check failed:",o),process.exit(n)}}}u();u();u();var ql=Nr(yo());u();u();function oi(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function lr(r){return lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lr(r)}u();function ui(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ai(r,e){if(e&&(lr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ui(r)}u();function lt(r){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lt(r)}u();u();function ke(r,e){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},ke(r,e)}function ci(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&ke(r,e)}u();u();function li(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function hi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vt(r,e,t){return hi()?vt=Reflect.construct.bind():vt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&ke(c,o.prototype),c},vt.apply(null,arguments)}function hr(r){var e=typeof Map=="function"?new Map:void 0;return hr=function(s){if(s===null||!li(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(s))return e.get(s);e.set(s,i)}function i(){return vt(s,arguments,lt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ke(i,s)},hr(r)}var Io=Nr(Lo());import Ed from"fs-extra";var yd=function(r){ci(e,r);function e(t){var s;return oi(this,e),s=ai(this,lt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(hr(Error));u();u();u();import vd from"js-yaml";import{sync as xd}from"fast-glob";u();import Ld from"fs-extra";u();import Ud from"fs-extra";import qd from"picocolors";u();var Rp=Nr(Nc());u();import $0 from"fs-extra";u();var Mp=Nr($c());import Y0 from"picocolors";import Z0 from"fs-extra";u();u();u();var v=class extends Error{constructor(t,s){var i;super(t);this.name="ConvertError",this.type=(i=s==null?void 0:s.type)!=null?i:"unknown",Error.captureStackTrace(this,v)}};u();u();import tr from"path";import Fe from"fs-extra";import Kp from"execa";u();import Hp from"path";import Jp from"fs-extra";import Vp from"picocolors";u();import rt from"path";import Up from"execa";import{readJsonSync as jp,existsSync as io,readFileSync as qp,rmSync as Wc,writeFile as $p}from"fs-extra";import{sync as Wp}from"fast-glob";import zp from"js-yaml";var Gp=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=rt.join(r,"package.json");try{return jp(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new v(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new v(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function st({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=Gp.exec(e);if(t){let[s,i]=t;return i}}catch{}}function je({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=rt.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function no({workspaceRoot:r}){let e=rt.join(r,"pnpm-workspace.yaml");if(io(e))try{let t=zp.load(qp(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new v(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function it({root:r,lockFile:e,workspaceConfig:t}){let s=n=>rt.join(r,n),i={root:r,lockfile:s(e),packageJson:s("package.json"),nodeModules:s("node_modules")};return t&&(i.workspaceConfig=s(t)),i}function er({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function nt({workspaceRoot:r,workspaceGlobs:e}){if(!e)return[];let t=e.filter(s=>s.startsWith("!")).map(s=>s.slice(1));return e.filter(s=>!s.startsWith("!")).flatMap(s=>{let i=[`${s}/package.json`];return Wp(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=rt.dirname(s),{name:n,description:o}=je({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:rt.join(i,"node_modules")}}})}function zc({directory:r}){let e=rt.resolve(process.cwd(),r);return{exists:io(e),absolute:e}}function le({packageManager:r,action:e,project:t}){let s=t.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${r} ${s?"workspaces":""} ${e==="remove"?"from":"to"} ${t.name}`}function Gc({project:r}){let e=t=>!(t.includes("*")&&(t.includes("**")||t.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(s=>t.includes(s)));return r.workspaceData.globs.every(e)}function se({project:r,options:e}){e!=null&&e.dry||Wc(r.paths.lockfile,{force:!0})}async function Hs({project:r,options:e}){if(!(e!=null&&e.dry)&&io(r.paths.lockfile))try{let{stdout:t}=await Up("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root,preferLocal:!0,shell:process.platform==="win32"});await $p(rt.join(r.paths.root,"yarn.lock"),t)}catch{}finally{Wc(r.paths.lockfile,{force:!0})}}function Yp({dependencyList:r,project:e,to:t}){let s=[];return e.workspaceData.workspaces.forEach(i=>{let{name:n}=i;if(r[n]){let o=r[n],a=o.startsWith("workspace:")?o.slice(10):o;r[n]=t.name==="pnpm"?`workspace:${a}`:a,s.push(n)}}),{dependencyList:r,updated:s}}function he({project:r,workspace:e,to:t,logger:s,options:i}){if(["yarn","npm","bun"].includes(t.name)&&["yarn","npm","bun"].includes(r.packageManager))return;let n=M({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(d=>{let g=n[d];if(g){let{updated:w,dependencyList:S}=Yp({dependencyList:g,project:r,to:t});n[d]=S,o[d]=w}});let l=d=>{let g=o[d].length;if(g>0)return`${Vp.green(g.toString())} ${d}`},c=a.map(l).filter(Boolean),h=`./${Hp.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let d="updating";c.forEach((g,w)=>{c.length===1?d+=` ${g} in ${h}`:w===c.length-1?d+=`and ${g} in ${h}`:d+=` ${g}, `}),s.workspaceStep(d)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||Jp.writeJSONSync(e.paths.packageJson,n,{spaces:2})}var ot={name:"pnpm",lock:"pnpm-lock.yaml"};async function Hc(r){let e=tr.join(r.workspaceRoot,ot.lock),t=tr.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=st({workspaceRoot:r.workspaceRoot});return Fe.existsSync(e)||Fe.existsSync(t)||s===ot.name}async function Zp(r){if(!await Hc(r))throw new v("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=je(r);return{name:t,description:s,packageManager:ot.name,paths:it({root:r.workspaceRoot,lockFile:ot.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:no(r),workspaces:nt({workspaceGlobs:no(r),...r})}}}async function Xp(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({action:"create",packageManager:ot.name,project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),o.packageManager=`${t.name}@${t.version}`,s.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),i!=null&&i.dry||(Fe.writeJSONSync(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),Fe.writeFileSync(tr.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
|
4
4
|
${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
|
|
5
|
-
`)}`))),n&&(he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})}))}async function em(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({action:"remove",packageManager:ot.name,project:e}));let n=M({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&i&&(t.subStep('removing "pnpm-workspace.yaml"'),s!=null&&s.dry||Fe.rmSync(e.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){Fe.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>Fe.rm(a,{recursive:!0,force:!0})))}catch{throw new B("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function tm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${er.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Fe.rmSync(e.paths.lockfile,{force:!0})}async function rm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${er.relative(e.paths.root,e.paths.lockfile)} to ${ot.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&Fe.existsSync(e.paths.lockfile))try{await Zp(ot.name,["import"],{stdio:"ignore",cwd:e.paths.root,preferLocal:!0,shell:process.platform==="win32"})}catch{}finally{se({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Hs({project:e,options:t}),await n(),Fe.rmSync(er.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var Jc={detect:Hc,read:Xp,create:Qp,remove:em,clean:tm,convertLock:rm};u();import Js from"path";import tr from"fs-extra";var rr={name:"npm",lock:"package-lock.json"};async function Vc(r){let e=Js.join(r.workspaceRoot,rr.lock),t=st({workspaceRoot:r.workspaceRoot});return tr.existsSync(e)||t===rr.name}async function sm(r){if(!await Vc(r))throw new B("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=Qt({workspaces:t.workspaces});return{name:s,description:i,packageManager:rr.name,paths:it({root:r.workspaceRoot,lockFile:rr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function im(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(le({packageManager:rr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Js.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Js.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||tr.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||tr.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function nm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:rr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){tr.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>tr.rm(a,{recursive:!0,force:!0})))}catch{throw new B("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function om(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Js.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||tr.rmSync(e.paths.lockfile,{force:!0})}async function um(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":se({project:e,options:t});break;case"bun":se({project:e,options:t});break;case"npm":break;case"yarn":se({project:e,options:t});break}}var Yc={detect:Vc,read:sm,create:im,remove:nm,clean:om,convertLock:um};u();import Or from"path";import sr from"fs-extra";var bt={name:"yarn",lock:"yarn.lock"};async function Kc(r){let e=Or.join(r.workspaceRoot,bt.lock),t=st({workspaceRoot:r.workspaceRoot});return sr.existsSync(e)||t===bt.name}async function am(r){if(!await Kc(r))throw new B("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=Qt({workspaces:t.workspaces});return{name:s,description:i,packageManager:bt.name,paths:it({root:r.workspaceRoot,lockFile:bt.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function cm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({packageManager:bt.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${Or.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${Or.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||sr.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||sr.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function lm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:bt.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){sr.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>sr.rm(a,{recursive:!0,force:!0})))}catch{throw new B("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function hm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Or.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||sr.rmSync(e.paths.lockfile,{force:!0})}async function fm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${Or.relative(e.paths.root,e.paths.lockfile)} to ${bt.lock}`)};switch(e.packageManager){case"pnpm":se({project:e,options:t});break;case"bun":i(),await Hs({project:e,options:t});break;case"npm":se({project:e,options:t});break;case"yarn":break}}var Zc={detect:Kc,read:am,create:cm,remove:lm,clean:hm,convertLock:fm};u();import Vs from"path";import ir from"fs-extra";var nr={name:"bun",lock:"bun.lockb"};async function Xc(r){let e=Vs.join(r.workspaceRoot,nr.lock),t=st({workspaceRoot:r.workspaceRoot});return ir.existsSync(e)||t===nr.name}async function pm(r){if(!await Xc(r))throw new B("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=Qt({workspaces:t.workspaces});return{name:s,description:i,packageManager:nr.name,paths:it({root:r.workspaceRoot,lockFile:nr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function mm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!Gc({project:e}))throw new B("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(le({packageManager:nr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${Vs.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${Vs.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||ir.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||ir.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function dm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:nr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){ir.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>ir.rm(a,{recursive:!0,force:!0})))}catch{throw new B("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Dm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Vs.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||ir.rmSync(e.paths.lockfile,{force:!0})}async function gm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":se({project:e,options:t});break;case"bun":break;case"npm":se({project:e,options:t});break;case"yarn":se({project:e,options:t});break}}var Qc={detect:Xc,read:pm,create:mm,remove:dm,clean:Dm,convertLock:gm};var St={pnpm:Jc,yarn:Zc,npm:Yc,bun:Qc};u();async function Cg({root:r}){let{exists:e,absolute:t}=Wc({directory:r});if(!e)throw new B(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(St))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new B("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}u();import fe from"picocolors";import Em from"gradient-string";var or=2,Ys=class{constructor({interactive:e,dry:t}={}){this.interactive=e!=null?e:!0,this.dry=t!=null?t:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...t){this.logger(" ".repeat(or*e),...t)}header(e){this.blankLine(),this.logger(fe.bold(e))}installerFrames(){let e=`${" ".repeat(or)} - ${this.dry?fe.yellow("SKIPPED | "):fe.green("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return Em("#0099F7","#F11712")(e.toString())}hero(){this.logger(fe.bold(this.gradient(`
|
|
5
|
+
`)}`))),n&&(he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})}))}async function Qp(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({action:"remove",packageManager:ot.name,project:e}));let n=M({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&i&&(t.subStep('removing "pnpm-workspace.yaml"'),s!=null&&s.dry||Fe.rmSync(e.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){Fe.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>Fe.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function em(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${tr.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Fe.rmSync(e.paths.lockfile,{force:!0})}async function tm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${tr.relative(e.paths.root,e.paths.lockfile)} to ${ot.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&Fe.existsSync(e.paths.lockfile))try{await Kp(ot.name,["import"],{stdio:"ignore",cwd:e.paths.root,preferLocal:!0,shell:process.platform==="win32"})}catch{}finally{se({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Hs({project:e,options:t}),await n(),Fe.rmSync(tr.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var Jc={detect:Hc,read:Zp,create:Xp,remove:Qp,clean:em,convertLock:tm};u();import Js from"path";import rr from"fs-extra";var sr={name:"npm",lock:"package-lock.json"};async function Vc(r){let e=Js.join(r.workspaceRoot,sr.lock),t=st({workspaceRoot:r.workspaceRoot});return rr.existsSync(e)||t===sr.name}async function rm(r){if(!await Vc(r))throw new v("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=je(r),n=er({workspaces:t.workspaces});return{name:s,description:i,packageManager:sr.name,paths:it({root:r.workspaceRoot,lockFile:sr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function sm(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(le({packageManager:sr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Js.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Js.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||rr.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||rr.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function im(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:sr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){rr.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>rr.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function nm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Js.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||rr.rmSync(e.paths.lockfile,{force:!0})}async function om(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":se({project:e,options:t});break;case"bun":se({project:e,options:t});break;case"npm":break;case"yarn":se({project:e,options:t});break}}var Yc={detect:Vc,read:rm,create:sm,remove:im,clean:nm,convertLock:om};u();import Or from"path";import ir from"fs-extra";var bt={name:"yarn",lock:"yarn.lock"};async function Kc(r){let e=Or.join(r.workspaceRoot,bt.lock),t=st({workspaceRoot:r.workspaceRoot});return ir.existsSync(e)||t===bt.name}async function um(r){if(!await Kc(r))throw new v("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=je(r),n=er({workspaces:t.workspaces});return{name:s,description:i,packageManager:bt.name,paths:it({root:r.workspaceRoot,lockFile:bt.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function am(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({packageManager:bt.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${Or.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${Or.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||ir.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||ir.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function cm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:bt.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){ir.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>ir.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function lm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Or.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||ir.rmSync(e.paths.lockfile,{force:!0})}async function hm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${Or.relative(e.paths.root,e.paths.lockfile)} to ${bt.lock}`)};switch(e.packageManager){case"pnpm":se({project:e,options:t});break;case"bun":i(),await Hs({project:e,options:t});break;case"npm":se({project:e,options:t});break;case"yarn":break}}var Zc={detect:Kc,read:um,create:am,remove:cm,clean:lm,convertLock:hm};u();import Vs from"path";import nr from"fs-extra";var or={name:"bun",lock:"bun.lockb"};async function Xc(r){let e=Vs.join(r.workspaceRoot,or.lock),t=st({workspaceRoot:r.workspaceRoot});return nr.existsSync(e)||t===or.name}async function fm(r){if(!await Xc(r))throw new v("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=je(r),n=er({workspaces:t.workspaces});return{name:s,description:i,packageManager:or.name,paths:it({root:r.workspaceRoot,lockFile:or.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function pm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!Gc({project:e}))throw new v("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(le({packageManager:or.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${Vs.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${Vs.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||nr.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||nr.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function mm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:or.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){nr.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>nr.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function dm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Vs.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||nr.rmSync(e.paths.lockfile,{force:!0})}async function Dm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":se({project:e,options:t});break;case"bun":break;case"npm":se({project:e,options:t});break;case"yarn":se({project:e,options:t});break}}var Qc={detect:Xc,read:fm,create:pm,remove:mm,clean:dm,convertLock:Dm};var St={pnpm:Jc,yarn:Zc,npm:Yc,bun:Qc};u();async function Eg({root:r}){let{exists:e,absolute:t}=zc({directory:r});if(!e)throw new v(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(St))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new v("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}u();import fe from"picocolors";import gm from"gradient-string";var ur=2,Ys=class{constructor({interactive:e,dry:t}={}){this.interactive=e!=null?e:!0,this.dry=t!=null?t:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...t){this.logger(" ".repeat(ur*e),...t)}header(e){this.blankLine(),this.logger(fe.bold(e))}installerFrames(){let e=`${" ".repeat(ur)} - ${this.dry?fe.yellow("SKIPPED | "):fe.green("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return gm("#0099F7","#F11712")(e.toString())}hero(){this.logger(fe.bold(this.gradient(`
|
|
6
6
|
>>> TURBOREPO
|
|
7
|
-
`)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${fe.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(
|
|
7
|
+
`)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${fe.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(ur),"-",this.dry?fe.yellow("SKIPPED |"):fe.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(ur),"-",fe.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(ur*3),"-",this.dry?fe.yellow("SKIPPED |"):fe.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(ur*3),"-",this.dry?fe.yellow("SKIPPED |"):fe.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};u();import Em from"execa";import ym from"ora";import{satisfies as Am}from"semver";var el={npm:[{name:"npm",template:"npm",command:"npm",installArgs:["install"],version:"latest",executable:"npx",semver:"*",default:!0}],pnpm:[{name:"pnpm6",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest-6",executable:"pnpx",semver:"6.x"},{name:"pnpm",template:"pnpm",command:"pnpm",installArgs:["install","--fix-lockfile"],version:"latest",executable:"pnpm dlx",semver:">=7",default:!0}],yarn:[{name:"yarn",template:"yarn",command:"yarn",installArgs:["install"],version:"1.x",executable:"npx",semver:"<2",default:!0},{name:"berry",template:"berry",command:"yarn",installArgs:["install","--no-immutable"],version:"stable",executable:"yarn dlx",semver:">=2"}],bun:[{name:"bun",template:"bun",command:"bun",installArgs:["install"],version:"latest",executable:"bunx",semver:"^1.0.1",default:!0}]};function Cm(r){let{version:e,name:t}=r;return e?el[t].find(s=>Am(e,s.semver)):el[t].find(s=>s.default)}async function tl(r){let{to:e,logger:t,options:s}=r,i=t!=null?t:new Ys(s),n=Cm(e);if(!n)throw new v("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${n.command} ${n.installArgs.join(" ")}"`),!(s!=null&&s.dry)){let o;i.interactive&&(o=ym({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await Em(n.command,n.installArgs,{cwd:r.project.paths.root,preferLocal:!0,shell:process.platform==="win32"}),o&&o.stop(),i.subStep("dependencies installed")}catch(a){throw i.subStepFailure("failed to install dependencies"),a}}}u();import wm from"picocolors";async function Tg({project:r,convertTo:e,logger:t,options:s}){if(t.header(`Converting project from ${r.packageManager} to ${e.name}.`),!(s!=null&&s.ignoreUnchangedPackageManager)){if(r.packageManager===e.name)throw new v("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new v(`${e.name} is not installed, or could not be located`,{type:"package_manager-could_not_be_found"})}let i=e;s!=null&&s.ignoreUnchangedPackageManager||await St[r.packageManager].remove({project:r,to:i,logger:t,options:s}),await St[i.name].create({project:r,to:i,logger:t,options:s}),t.mainStep("Installing dependencies"),s!=null&&s.skipInstall?t.subStep(wm.yellow("Skipping install")):(await St[i.name].convertLock({project:r,to:i,logger:t,options:s}),await tl({project:r,to:i,logger:t,options:s})),t.mainStep(`Cleaning up ${r.packageManager} workspaces`),r.packageManager!==e.name&&await St[r.packageManager].clean({project:r,logger:t})}export{u as a,cr as b,Bl as c,Ol as d,v as e,zc as f,St as g,Eg as h,Ys as i,Cm as j,tl as k,Tg as l};
|
|
8
8
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|