@turbo/workspaces 1.10.16 → 1.10.17-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2POTZKDN.mjs +8 -0
- package/dist/cli.js +6 -107
- package/dist/cli.mjs +1 -1
- package/dist/index.js +6 -107
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-QMJZMIKB.mjs +0 -109
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var Qc=Object.create;var Hs=Object.defineProperty;var el=Object.getOwnPropertyDescriptor;var tl=Object.getOwnPropertyNames;var rl=Object.getPrototypeOf,sl=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 il=(r,e)=>()=>(r&&(e=r(r=0)),e);var y=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),nl=(r,e)=>{for(var t in e)Hs(r,t,{get:e[t],enumerable:!0})},ol=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tl(e))!sl.call(r,i)&&i!==t&&Hs(r,i,{get:()=>e[i],enumerable:!(s=el(e,i))||s.enumerable});return r};var _r=(r,e,t)=>(t=r!=null?Qc(rl(r)):{},ol(e||!r||!r.__esModule?Hs(t,"default",{value:r,enumerable:!0}):t,r));var u=il(()=>{});var ao=y((Bm,we)=>{u();function Js(r){return we.exports=Js=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},we.exports.__esModule=!0,we.exports.default=we.exports,Js(r)}we.exports=Js,we.exports.__esModule=!0,we.exports.default=we.exports});var lo=y((vm,Fe)=>{u();var El=ao().default;function co(){"use strict";Fe.exports=co=function(){return r},Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports;var r={},e=Object.prototype,t=e.hasOwnProperty,s=Object.defineProperty||function(E,f,D){E[f]=D.value},i=typeof Symbol=="function"?Symbol:{},n=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function l(E,f,D){return Object.defineProperty(E,f,{value:D,enumerable:!0,configurable:!0,writable:!0}),E[f]}try{l({},"")}catch{l=function(D,w,S){return D[w]=S}}function c(E,f,D,w){var S=f&&f.prototype instanceof g?f:g,F=Object.create(S.prototype),P=new Ws(w||[]);return s(F,"_invoke",{value:Zc(E,D,P)}),F}function h(E,f,D){try{return{type:"normal",arg:E.call(f,D)}}catch(w){return{type:"throw",arg:w}}}r.wrap=c;var d={};function g(){}function C(){}function b(){}var N={};l(N,n,function(){return this});var x=Object.getPrototypeOf,v=x&&x(x(Gs([])));v&&v!==e&&t.call(v,n)&&(N=v);var Ce=b.prototype=g.prototype=Object.create(N);function tr(E){["next","throw","return"].forEach(function(f){l(E,f,function(D){return this._invoke(f,D)})})}function kr(E,f){function D(S,F,P,H){var J=h(E[S],E,F);if(J.type!=="throw"){var nt=J.arg,qe=nt.value;return qe&&El(qe)=="object"&&t.call(qe,"__await")?f.resolve(qe.__await).then(function(ot){D("next",ot,P,H)},function(ot){D("throw",ot,P,H)}):f.resolve(qe).then(function(ot){nt.value=ot,P(nt)},function(ot){return D("throw",ot,P,H)})}H(J.arg)}var w;s(this,"_invoke",{value:function(F,P){function H(){return new f(function(J,nt){D(F,P,J,nt)})}return w=w?w.then(H,H):H()}})}function Zc(E,f,D){var w="suspendedStart";return function(S,F){if(w==="executing")throw new Error("Generator is already running");if(w==="completed"){if(S==="throw")throw F;return eo()}for(D.method=S,D.arg=F;;){var P=D.delegate;if(P){var H=Qn(P,D);if(H){if(H===d)continue;return H}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(w==="suspendedStart")throw w="completed",D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);w="executing";var J=h(E,f,D);if(J.type==="normal"){if(w=D.done?"completed":"suspendedYield",J.arg===d)continue;return{value:J.arg,done:D.done}}J.type==="throw"&&(w="completed",D.method="throw",D.arg=J.arg)}}}function Qn(E,f){var D=f.method,w=E.iterator[D];if(w===void 0)return f.delegate=null,D==="throw"&&E.iterator.return&&(f.method="return",f.arg=void 0,Qn(E,f),f.method==="throw")||D!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+D+"' method")),d;var S=h(w,E.iterator,f.arg);if(S.type==="throw")return f.method="throw",f.arg=S.arg,f.delegate=null,d;var F=S.arg;return F?F.done?(f[E.resultName]=F.value,f.next=E.nextLoc,f.method!=="return"&&(f.method="next",f.arg=void 0),f.delegate=null,d):F:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,d)}function Xc(E){var f={tryLoc:E[0]};1 in E&&(f.catchLoc=E[1]),2 in E&&(f.finallyLoc=E[2],f.afterLoc=E[3]),this.tryEntries.push(f)}function zs(E){var f=E.completion||{};f.type="normal",delete f.arg,E.completion=f}function Ws(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(Xc,this),this.reset(!0)}function Gs(E){if(E){var f=E[n];if(f)return f.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var D=-1,w=function S(){for(;++D<E.length;)if(t.call(E,D))return S.value=E[D],S.done=!1,S;return S.value=void 0,S.done=!0,S};return w.next=w}}return{next:eo}}function eo(){return{value:void 0,done:!0}}return C.prototype=b,s(Ce,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:C,configurable:!0}),C.displayName=l(b,a,"GeneratorFunction"),r.isGeneratorFunction=function(E){var f=typeof E=="function"&&E.constructor;return!!f&&(f===C||(f.displayName||f.name)==="GeneratorFunction")},r.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,b):(E.__proto__=b,l(E,a,"GeneratorFunction")),E.prototype=Object.create(Ce),E},r.awrap=function(E){return{__await:E}},tr(kr.prototype),l(kr.prototype,o,function(){return this}),r.AsyncIterator=kr,r.async=function(E,f,D,w,S){S===void 0&&(S=Promise);var F=new kr(c(E,f,D,w),S);return r.isGeneratorFunction(f)?F:F.next().then(function(P){return P.done?P.value:F.next()})},tr(Ce),l(Ce,a,"Generator"),l(Ce,n,function(){return this}),l(Ce,"toString",function(){return"[object Generator]"}),r.keys=function(E){var f=Object(E),D=[];for(var w in f)D.push(w);return D.reverse(),function S(){for(;D.length;){var F=D.pop();if(F in f)return S.value=F,S.done=!1,S}return S.done=!0,S}},r.values=Gs,Ws.prototype={constructor:Ws,reset:function(f){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(zs),!f)for(var D in this)D.charAt(0)==="t"&&t.call(this,D)&&!isNaN(+D.slice(1))&&(this[D]=void 0)},stop:function(){this.done=!0;var f=this.tryEntries[0].completion;if(f.type==="throw")throw f.arg;return this.rval},dispatchException:function(f){if(this.done)throw f;var D=this;function w(nt,qe){return P.type="throw",P.arg=f,D.next=nt,qe&&(D.method="next",D.arg=void 0),!!qe}for(var S=this.tryEntries.length-1;S>=0;--S){var F=this.tryEntries[S],P=F.completion;if(F.tryLoc==="root")return w("end");if(F.tryLoc<=this.prev){var H=t.call(F,"catchLoc"),J=t.call(F,"finallyLoc");if(H&&J){if(this.prev<F.catchLoc)return w(F.catchLoc,!0);if(this.prev<F.finallyLoc)return w(F.finallyLoc)}else if(H){if(this.prev<F.catchLoc)return w(F.catchLoc,!0)}else{if(!J)throw new Error("try statement without catch or finally");if(this.prev<F.finallyLoc)return w(F.finallyLoc)}}}},abrupt:function(f,D){for(var w=this.tryEntries.length-1;w>=0;--w){var S=this.tryEntries[w];if(S.tryLoc<=this.prev&&t.call(S,"finallyLoc")&&this.prev<S.finallyLoc){var F=S;break}}F&&(f==="break"||f==="continue")&&F.tryLoc<=D&&D<=F.finallyLoc&&(F=null);var P=F?F.completion:{};return P.type=f,P.arg=D,F?(this.method="next",this.next=F.finallyLoc,d):this.complete(P)},complete:function(f,D){if(f.type==="throw")throw f.arg;return f.type==="break"||f.type==="continue"?this.next=f.arg:f.type==="return"?(this.rval=this.arg=f.arg,this.method="return",this.next="end"):f.type==="normal"&&D&&(this.next=D),d},finish:function(f){for(var D=this.tryEntries.length-1;D>=0;--D){var w=this.tryEntries[D];if(w.finallyLoc===f)return this.complete(w.completion,w.afterLoc),zs(w),d}},catch:function(f){for(var D=this.tryEntries.length-1;D>=0;--D){var w=this.tryEntries[D];if(w.tryLoc===f){var S=w.completion;if(S.type==="throw"){var F=S.arg;zs(w)}return F}}throw new Error("illegal catch attempt")},delegateYield:function(f,D,w){return this.delegate={iterator:Gs(f),resultName:D,nextLoc:w},this.method==="next"&&(this.arg=void 0),d}},r}Fe.exports=co,Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports});var fo=y((Om,ho)=>{u();var vr=lo()();ho.exports=vr;try{regeneratorRuntime=vr}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=vr:Function("r","regeneratorRuntime = r")(vr)}});var mo=y((Qm,ei)=>{"use strict";u();var po=(r,...e)=>new Promise(t=>{t(r(...e))});ei.exports=po;ei.exports.default=po});var go=y((ed,ti)=>{"use strict";u();var yl=mo(),Do=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=yl(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};ti.exports=Do;ti.exports.default=Do});var Ao=y((td,ri)=>{"use strict";u();var Eo=go(),Or=class extends Error{constructor(e){super(),this.value=e}},Al=async(r,e)=>e(await r),Cl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new Or(e[0]);return!1},yo=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=Eo(t.concurrency),i=[...r].map(o=>[o,s(Al,o,e)]),n=Eo(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(Cl,o)))}catch(o){if(o instanceof Or)return o.value;throw o}};ri.exports=yo;ri.exports.default=yo});var ko=y((rd,si)=>{"use strict";u();var Co=A("path"),xr=A("fs"),{promisify:wo}=A("util"),wl=Ao(),Fl=wo(xr.stat),bl=wo(xr.lstat),Fo={directory:"isDirectory",file:"isFile"};function bo({type:r}){if(!(r in Fo))throw new Error(`Invalid type specified: ${r}`)}var So=(r,e)=>r===void 0||e[Fo[r]]();si.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},bo(e);let t=e.allowSymlinks?Fl:bl;return wl(r,async s=>{try{let i=await t(Co.resolve(e.cwd,s));return So(e.type,i)}catch{return!1}},e)};si.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},bo(e);let t=e.allowSymlinks?xr.statSync:xr.lstatSync;for(let s of r)try{let i=t(Co.resolve(e.cwd,s));if(So(e.type,i))return s}catch{}}});var Ro=y((sd,ii)=>{"use strict";u();var _o=A("fs"),{promisify:Sl}=A("util"),kl=Sl(_o.access);ii.exports=async r=>{try{return await kl(r),!0}catch{return!1}};ii.exports.sync=r=>{try{return _o.accessSync(r),!0}catch{return!1}}});var vo=y((id,kt)=>{"use strict";u();var Ue=A("path"),Tr=ko(),Bo=Ro(),ni=Symbol("findUp.stop");kt.exports=async(r,e={})=>{let t=Ue.resolve(e.cwd||""),{root:s}=Ue.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Tr(i,o);let a=await r(o.cwd);return typeof a=="string"?Tr([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===ni)return;if(o)return Ue.resolve(t,o);if(t===s)return;t=Ue.dirname(t)}};kt.exports.sync=(r,e={})=>{let t=Ue.resolve(e.cwd||""),{root:s}=Ue.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Tr.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Tr.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===ni)return;if(o)return Ue.resolve(t,o);if(t===s)return;t=Ue.dirname(t)}};kt.exports.exists=Bo;kt.exports.sync.exists=Bo.sync;kt.exports.stop=ni});var _t=y((qd,Po)=>{"use strict";u();var To=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"]]);Po.exports=r=>r?Object.keys(r).map(e=>[To.has(e)?To.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var qr=y((Ud,zo)=>{"use strict";u();var Lo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ol=A("events"),No=A("stream"),Io=A("string_decoder").StringDecoder,Se=Symbol("EOF"),ke=Symbol("maybeEmitEnd"),$e=Symbol("emittedEnd"),Pr=Symbol("emittingEnd"),nr=Symbol("emittedError"),Lr=Symbol("closed"),Mo=Symbol("read"),Nr=Symbol("flush"),qo=Symbol("flushChunk"),Y=Symbol("encoding"),_e=Symbol("decoder"),Ir=Symbol("flowing"),or=Symbol("paused"),Rt=Symbol("resume"),L=Symbol("buffer"),me=Symbol("pipes"),q=Symbol("bufferLength"),oi=Symbol("bufferPush"),ui=Symbol("bufferShift"),$=Symbol("objectMode"),j=Symbol("destroyed"),ai=Symbol("emitData"),Uo=Symbol("emitEnd"),ci=Symbol("emitEnd2"),Re=Symbol("async"),ur=r=>Promise.resolve().then(r),$o=global._MP_NO_ITERATOR_SYMBOLS_!=="1",xl=$o&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Tl=$o&&Symbol.iterator||Symbol("iterator not implemented"),Pl=r=>r==="end"||r==="finish"||r==="prefinish",Ll=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Nl=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Mr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Rt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},li=class extends Mr{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)}};zo.exports=class jo extends No{constructor(e){super(),this[Ir]=!1,this[or]=!1,this[me]=[],this[L]=[],this[$]=e&&e.objectMode||!1,this[$]?this[Y]=null:this[Y]=e&&e.encoding||null,this[Y]==="buffer"&&(this[Y]=null),this[Re]=e&&!!e.async||!1,this[_e]=this[Y]?new Io(this[Y]):null,this[Se]=!1,this[$e]=!1,this[Pr]=!1,this[Lr]=!1,this[nr]=null,this.writable=!0,this.readable=!0,this[q]=0,this[j]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[me]})}get bufferLength(){return this[q]}get encoding(){return this[Y]}set encoding(e){if(this[$])throw new Error("cannot set encoding in objectMode");if(this[Y]&&e!==this[Y]&&(this[_e]&&this[_e].lastNeed||this[q]))throw new Error("cannot change encoding");this[Y]!==e&&(this[_e]=e?new Io(e):null,this[L].length&&(this[L]=this[L].map(t=>this[_e].write(t)))),this[Y]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[$]}set objectMode(e){this[$]=this[$]||!!e}get async(){return this[Re]}set async(e){this[Re]=this[Re]||!!e}write(e,t,s){if(this[Se])throw new Error("write after end");if(this[j])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[Re]?ur:n=>n();return!this[$]&&!Buffer.isBuffer(e)&&(Nl(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Ll(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[$]?(this.flowing&&this[q]!==0&&this[Nr](!0),this.flowing?this.emit("data",e):this[oi](e),this[q]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[Y]&&!this[_e].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Y]&&(e=this[_e].write(e)),this.flowing&&this[q]!==0&&this[Nr](!0),this.flowing?this.emit("data",e):this[oi](e),this[q]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[q]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[j])return null;if(this[q]===0||e===0||e>this[q])return this[ke](),null;this[$]&&(e=null),this[L].length>1&&!this[$]&&(this.encoding?this[L]=[this[L].join("")]:this[L]=[Buffer.concat(this[L],this[q])]);let t=this[Mo](e||null,this[L][0]);return this[ke](),t}[Mo](e,t){return e===t.length||e===null?this[ui]():(this[L][0]=t.slice(e),t=t.slice(0,e),this[q]-=e),this.emit("data",t),!this[L].length&&!this[Se]&&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[Se]=!0,this.writable=!1,(this.flowing||!this[or])&&this[ke](),this}[Rt](){this[j]||(this[or]=!1,this[Ir]=!0,this.emit("resume"),this[L].length?this[Nr]():this[Se]?this[ke]():this.emit("drain"))}resume(){return this[Rt]()}pause(){this[Ir]=!1,this[or]=!0}get destroyed(){return this[j]}get flowing(){return this[Ir]}get paused(){return this[or]}[oi](e){this[$]?this[q]+=1:this[q]+=e.length,this[L].push(e)}[ui](){return this[L].length&&(this[$]?this[q]-=1:this[q]-=this[L][0].length),this[L].shift()}[Nr](e){do;while(this[qo](this[ui]()));!e&&!this[L].length&&!this[Se]&&this.emit("drain")}[qo](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[j])return;let s=this[$e];return t=t||{},e===Lo.stdout||e===Lo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[me].push(t.proxyErrors?new li(this,e,t):new Mr(this,e,t)),this[Re]?ur(()=>this[Rt]()):this[Rt]()),e}unpipe(e){let t=this[me].find(s=>s.dest===e);t&&(this[me].splice(this[me].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[me].length&&!this.flowing?this[Rt]():e==="readable"&&this[q]!==0?super.emit("readable"):Pl(e)&&this[$e]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[nr]&&(this[Re]?ur(()=>t.call(this,this[nr])):t.call(this,this[nr])),s}get emittedEnd(){return this[$e]}[ke](){!this[Pr]&&!this[$e]&&!this[j]&&this[L].length===0&&this[Se]&&(this[Pr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Lr]&&this.emit("close"),this[Pr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==j&&this[j])return;if(e==="data")return t?this[Re]?ur(()=>this[ai](t)):this[ai](t):!1;if(e==="end")return this[Uo]();if(e==="close"){if(this[Lr]=!0,!this[$e]&&!this[j])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[nr]=t;let n=super.emit("error",t);return this[ke](),n}else if(e==="resume"){let n=super.emit("resume");return this[ke](),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[ke](),i}[ai](e){for(let s of this[me])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[ke](),t}[Uo](){this[$e]||(this[$e]=!0,this.readable=!1,this[Re]?ur(()=>this[ci]()):this[ci]())}[ci](){if(this[_e]){let t=this[_e].end();if(t){for(let s of this[me])s.dest.write(t);super.emit("data",t)}}for(let t of this[me])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[$]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[$]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[$]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[$]?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(j,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[xl](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Se])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[Se]})},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(j,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[Tl](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[j]?(e?this.emit("error",e):this.emit(j),this):(this[j]=!0,this[L].length=0,this[q]=0,typeof this.close=="function"&&!this[Lr]&&this.close(),e?this.emit("error",e):this.emit(j),this)}static isStream(e){return!!e&&(e instanceof jo||e instanceof No||e instanceof Ol&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Go=y(($d,Wo)=>{u();var Il=A("zlib").constants||{ZLIB_VERNUM:4736};Wo.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},Il))});var Di=y((jd,eu)=>{"use strict";u();var Ho=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ml=A("events"),Jo=A("stream"),Yo=A("string_decoder").StringDecoder,Be=Symbol("EOF"),ve=Symbol("maybeEmitEnd"),je=Symbol("emittedEnd"),Ur=Symbol("emittingEnd"),ar=Symbol("emittedError"),$r=Symbol("closed"),Vo=Symbol("read"),jr=Symbol("flush"),Ko=Symbol("flushChunk"),V=Symbol("encoding"),Oe=Symbol("decoder"),zr=Symbol("flowing"),cr=Symbol("paused"),Bt=Symbol("resume"),U=Symbol("bufferLength"),hi=Symbol("bufferPush"),fi=Symbol("bufferShift"),z=Symbol("objectMode"),W=Symbol("destroyed"),pi=Symbol("emitData"),Zo=Symbol("emitEnd"),mi=Symbol("emitEnd2"),xe=Symbol("async"),lr=r=>Promise.resolve().then(r),Xo=global._MP_NO_ITERATOR_SYMBOLS_!=="1",ql=Xo&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Ul=Xo&&Symbol.iterator||Symbol("iterator not implemented"),$l=r=>r==="end"||r==="finish"||r==="prefinish",jl=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,zl=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Wr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Bt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},di=class extends Wr{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)}};eu.exports=class Qo extends Jo{constructor(e){super(),this[zr]=!1,this[cr]=!1,this.pipes=[],this.buffer=[],this[z]=e&&e.objectMode||!1,this[z]?this[V]=null:this[V]=e&&e.encoding||null,this[V]==="buffer"&&(this[V]=null),this[xe]=e&&!!e.async||!1,this[Oe]=this[V]?new Yo(this[V]):null,this[Be]=!1,this[je]=!1,this[Ur]=!1,this[$r]=!1,this[ar]=null,this.writable=!0,this.readable=!0,this[U]=0,this[W]=!1}get bufferLength(){return this[U]}get encoding(){return this[V]}set encoding(e){if(this[z])throw new Error("cannot set encoding in objectMode");if(this[V]&&e!==this[V]&&(this[Oe]&&this[Oe].lastNeed||this[U]))throw new Error("cannot change encoding");this[V]!==e&&(this[Oe]=e?new Yo(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Oe].write(t)))),this[V]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[z]}set objectMode(e){this[z]=this[z]||!!e}get async(){return this[xe]}set async(e){this[xe]=this[xe]||!!e}write(e,t,s){if(this[Be])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[xe]?lr:n=>n();return!this[z]&&!Buffer.isBuffer(e)&&(zl(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):jl(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[z]?(this.flowing&&this[U]!==0&&this[jr](!0),this.flowing?this.emit("data",e):this[hi](e),this[U]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[V]&&!this[Oe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[V]&&(e=this[Oe].write(e)),this.flowing&&this[U]!==0&&this[jr](!0),this.flowing?this.emit("data",e):this[hi](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[ve](),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[Vo](e||null,this.buffer[0]);return this[ve](),t}[Vo](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[Be]&&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[Be]=!0,this.writable=!1,(this.flowing||!this[cr])&&this[ve](),this}[Bt](){this[W]||(this[cr]=!1,this[zr]=!0,this.emit("resume"),this.buffer.length?this[jr]():this[Be]?this[ve]():this.emit("drain"))}resume(){return this[Bt]()}pause(){this[zr]=!1,this[cr]=!0}get destroyed(){return this[W]}get flowing(){return this[zr]}get paused(){return this[cr]}[hi](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()}[jr](e){do;while(this[Ko](this[fi]()));!e&&!this.buffer.length&&!this[Be]&&this.emit("drain")}[Ko](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[je];return t=t||{},e===Ho.stdout||e===Ho.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new di(this,e,t):new Wr(this,e,t)),this[xe]?lr(()=>this[Bt]()):this[Bt]()),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[Bt]():e==="readable"&&this[U]!==0?super.emit("readable"):$l(e)&&this[je]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[ar]&&(this[xe]?lr(()=>t.call(this,this[ar])):t.call(this,this[ar])),s}get emittedEnd(){return this[je]}[ve](){!this[Ur]&&!this[je]&&!this[W]&&this.buffer.length===0&&this[Be]&&(this[Ur]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[$r]&&this.emit("close"),this[Ur]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[xe]?lr(()=>this[pi](t)):this[pi](t):!1;if(e==="end")return this[Zo]();if(e==="close"){if(this[$r]=!0,!this[je]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[ar]=t;let n=super.emit("error",t);return this[ve](),n}else if(e==="resume"){let n=super.emit("resume");return this[ve](),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[ve](),i}[pi](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[ve](),t}[Zo](){this[je]||(this[je]=!0,this.readable=!1,this[xe]?lr(()=>this[mi]()):this[mi]())}[mi](){if(this[Oe]){let t=this[Oe].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[V]?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[Be])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[Be]})},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)})}}}[Ul](){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[$r]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof Qo||e instanceof Jo||e instanceof Ml&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var xi=y(X=>{"use strict";u();var Ci=A("assert"),ze=A("buffer").Buffer,su=A("zlib"),at=X.constants=Go(),Wl=Di(),tu=ze.concat,ct=Symbol("_superWrite"),Ot=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"}},Gl=Symbol("opts"),hr=Symbol("flushFlag"),ru=Symbol("finishFlushFlag"),Oi=Symbol("fullFlushFlag"),O=Symbol("handle"),Gr=Symbol("onError"),vt=Symbol("sawError"),gi=Symbol("level"),Ei=Symbol("strategy"),yi=Symbol("ended"),zd=Symbol("_defaultFullFlush"),Hr=class extends Wl{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[vt]=!1,this[yi]=!1,this[Gl]=e,this[hr]=e.flush,this[ru]=e.finishFlush;try{this[O]=new su[t](e)}catch(s){throw new Ot(s)}this[Gr]=s=>{this[vt]||(this[vt]=!0,this.close(),this.emit("error",s))},this[O].on("error",s=>this[Gr](new Ot(s))),this.once("end",()=>this.close)}close(){this[O]&&(this[O].close(),this[O]=null,this.emit("close"))}reset(){if(!this[vt])return Ci(this[O],"zlib binding closed"),this[O].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[Oi]),this.write(Object.assign(ze.alloc(0),{[hr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[ru]),this[yi]=!0,super.end(null,null,s)}get ended(){return this[yi]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=ze.from(e,t)),this[vt])return;Ci(this[O],"zlib binding closed");let i=this[O]._handle,n=i.close;i.close=()=>{};let o=this[O].close;this[O].close=()=>{},ze.concat=c=>c;let a;try{let c=typeof e[hr]=="number"?e[hr]:this[hr];a=this[O]._processChunk(e,c),ze.concat=tu}catch(c){ze.concat=tu,this[Gr](new Ot(c))}finally{this[O]&&(this[O]._handle=i,i.close=n,this[O].close=o,this[O].removeAllListeners("error"))}this[O]&&this[O].on("error",c=>this[Gr](new Ot(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[ct](ze.from(a[0]));for(let c=1;c<a.length;c++)l=this[ct](a[c])}else l=this[ct](ze.from(a));return s&&s(),l}[ct](e){return super.write(e)}},Te=class extends Hr{constructor(e,t){e=e||{},e.flush=e.flush||at.Z_NO_FLUSH,e.finishFlush=e.finishFlush||at.Z_FINISH,super(e,t),this[Oi]=at.Z_FULL_FLUSH,this[gi]=e.level,this[Ei]=e.strategy}params(e,t){if(!this[vt]){if(!this[O])throw new Error("cannot switch params when binding is closed");if(!this[O].params)throw new Error("not supported in this implementation");if(this[gi]!==e||this[Ei]!==t){this.flush(at.Z_SYNC_FLUSH),Ci(this[O],"zlib binding closed");let s=this[O].flush;this[O].flush=(i,n)=>{this.flush(i),n()};try{this[O].params(e,t)}finally{this[O].flush=s}this[O]&&(this[gi]=e,this[Ei]=t)}}}},wi=class extends Te{constructor(e){super(e,"Deflate")}},Fi=class extends Te{constructor(e){super(e,"Inflate")}},Ai=Symbol("_portable"),bi=class extends Te{constructor(e){super(e,"Gzip"),this[Ai]=e&&!!e.portable}[ct](e){return this[Ai]?(this[Ai]=!1,e[9]=255,super[ct](e)):super[ct](e)}},Si=class extends Te{constructor(e){super(e,"Gunzip")}},ki=class extends Te{constructor(e){super(e,"DeflateRaw")}},_i=class extends Te{constructor(e){super(e,"InflateRaw")}},Ri=class extends Te{constructor(e){super(e,"Unzip")}},Jr=class extends Hr{constructor(e,t){e=e||{},e.flush=e.flush||at.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||at.BROTLI_OPERATION_FINISH,super(e,t),this[Oi]=at.BROTLI_OPERATION_FLUSH}},Bi=class extends Jr{constructor(e){super(e,"BrotliCompress")}},vi=class extends Jr{constructor(e){super(e,"BrotliDecompress")}};X.Deflate=wi;X.Inflate=Fi;X.Gzip=bi;X.Gunzip=Si;X.DeflateRaw=ki;X.InflateRaw=_i;X.Unzip=Ri;typeof su.BrotliCompress=="function"?(X.BrotliCompress=Bi,X.BrotliDecompress=vi):X.BrotliCompress=X.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var xt=y((Hd,iu)=>{u();var Hl=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;iu.exports=Hl!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var Yr=y((Yd,nu)=>{"use strict";u();var Jl=qr(),Ti=xt(),Pi=Symbol("slurp");nu.exports=class extends Jl{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=Ti(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=Ti(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[Pi](t),s&&this[Pi](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))}[Pi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?Ti(e[s]):e[s])}}});var Li=y(Vr=>{"use strict";u();Vr.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"]]);Vr.code=new Map(Array.from(Vr.name).map(r=>[r[1],r[0]]))});var cu=y((Kd,au)=>{"use strict";u();var Yl=(r,e)=>{if(Number.isSafeInteger(r))r<0?Kl(r,e):Vl(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Vl=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Kl=(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]=ou(i):i===0?e[s-1]=0:(t=!0,e[s-1]=uu(i))}},Zl=r=>{let e=r[0],t=e===128?Ql(r.slice(1,r.length)):e===255?Xl(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},Xl=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=ou(n):n===0?o=n:(s=!0,o=uu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},Ql=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},ou=r=>(255^r)&255,uu=r=>(255^r)+1&255;au.exports={encode:Yl,parse:Zl}});var Pt=y((Zd,hu)=>{"use strict";u();var Ni=Li(),Tt=A("path").posix,lu=cu(),Ii=Symbol("slurp"),Q=Symbol("type"),Ui=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[Q]="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=lt(e,t,100),this.mode=We(e,t+100,8),this.uid=We(e,t+108,8),this.gid=We(e,t+116,8),this.size=We(e,t+124,12),this.mtime=Mi(e,t+136,12),this.cksum=We(e,t+148,12),this[Ii](s),this[Ii](i,!0),this[Q]=lt(e,t+156,1),this[Q]===""&&(this[Q]="0"),this[Q]==="0"&&this.path.slice(-1)==="/"&&(this[Q]="5"),this[Q]==="5"&&(this.size=0),this.linkpath=lt(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=lt(e,t+265,32),this.gname=lt(e,t+297,32),this.devmaj=We(e,t+329,8),this.devmin=We(e,t+337,8),e[t+475]!==0){let o=lt(e,t+345,155);this.path=o+"/"+this.path}else{let o=lt(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Mi(e,t+476,12),this.ctime=Mi(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)}[Ii](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=eh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=ht(e,t,100,n)||this.needPax,this.needPax=Ge(e,t+100,8,this.mode)||this.needPax,this.needPax=Ge(e,t+108,8,this.uid)||this.needPax,this.needPax=Ge(e,t+116,8,this.gid)||this.needPax,this.needPax=Ge(e,t+124,12,this.size)||this.needPax,this.needPax=qi(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[Q].charCodeAt(0),this.needPax=ht(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=ht(e,t+265,32,this.uname)||this.needPax,this.needPax=ht(e,t+297,32,this.gname)||this.needPax,this.needPax=Ge(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ge(e,t+337,8,this.devmin)||this.needPax,this.needPax=ht(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=ht(e,t+345,155,o)||this.needPax:(this.needPax=ht(e,t+345,130,o)||this.needPax,this.needPax=qi(e,t+476,12,this.atime)||this.needPax,this.needPax=qi(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,Ge(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 Ni.name.get(this[Q])||this[Q]}get typeKey(){return this[Q]}set type(e){Ni.code.has(e)?this[Q]=Ni.code.get(e):this[Q]=e}},eh=(r,e)=>{let s=r,i="",n,o=Tt.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=Tt.dirname(s),s=Tt.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=Tt.join(Tt.basename(i),s),i=Tt.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},lt=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Mi=(r,e,t)=>th(We(r,e,t)),th=r=>r===null?null:new Date(r*1e3),We=(r,e,t)=>r[e]&128?lu.parse(r.slice(e,e+t)):sh(r,e,t),rh=r=>isNaN(r)?null:r,sh=(r,e,t)=>rh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),ih={12:8589934591,8:2097151},Ge=(r,e,t,s)=>s===null?!1:s>ih[t]||s<0?(lu.encode(s,r.slice(e,e+t)),!0):(nh(r,e,t,s),!1),nh=(r,e,t,s)=>r.write(oh(s,t),e,t,"ascii"),oh=(r,e)=>uh(Math.floor(r).toString(8),e),uh=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",qi=(r,e,t,s)=>s===null?!1:Ge(r,e,t,s.getTime()/1e3),ah=new Array(156).join("\0"),ht=(r,e,t,s)=>s===null?!1:(r.write(s+ah,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);hu.exports=Ui});var Kr=y((Xd,fu)=>{"use strict";u();var ch=Pt(),lh=A("path"),fr=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 ch({path:("PaxHeader/"+lh.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}};fr.parse=(r,e,t)=>new fr(hh(fh(r),e),t);var hh=(r,e)=>e?Object.keys(r).reduce((t,s)=>(t[s]=r[s],t),e):r,fh=r=>r.replace(/\n$/,"").split(`
|
|
3
|
+
`).reduce(ph,Object.create(null)),ph=(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};fu.exports=fr});var Lt=y((Qd,pu)=>{u();pu.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 Zr=y((e0,mu)=>{"use strict";u();mu.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 ji=y((r0,du)=>{"use strict";u();var Xr=["|","<",">","?",":"],$i=Xr.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),mh=new Map(Xr.map((r,e)=>[r,$i[e]])),dh=new Map($i.map((r,e)=>[r,Xr[e]]));du.exports={encode:r=>Xr.reduce((e,t)=>e.split(t).join(mh.get(t)),r),decode:r=>$i.reduce((e,t)=>e.split(t).join(dh.get(t)),r)}});var zi=y((s0,gu)=>{u();var{isAbsolute:Dh,parse:Du}=A("path").win32;gu.exports=r=>{let e="",t=Du(r);for(;Dh(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=Du(r)}return[e,r]}});var yu=y((i0,Eu)=>{"use strict";u();Eu.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 Qi=y((u0,Tu)=>{"use strict";u();var ku=qr(),_u=Kr(),Ru=Pt(),De=A("fs"),Au=A("path"),de=xt(),gh=Lt(),Bu=(r,e)=>e?(r=de(r).replace(/^\.(\/|$)/,""),gh(e)+"/"+r):de(r),Eh=16*1024*1024,Cu=Symbol("process"),wu=Symbol("file"),Fu=Symbol("directory"),Gi=Symbol("symlink"),bu=Symbol("hardlink"),pr=Symbol("header"),Qr=Symbol("read"),Hi=Symbol("lstat"),es=Symbol("onlstat"),Ji=Symbol("onread"),Yi=Symbol("onreadlink"),Vi=Symbol("openfile"),Ki=Symbol("onopenfile"),He=Symbol("close"),ts=Symbol("mode"),Zi=Symbol("awaitDrain"),Wi=Symbol("ondrain"),ge=Symbol("prefix"),Su=Symbol("hadError"),vu=Zr(),yh=ji(),Ou=zi(),xu=yu(),rs=vu(class extends ku{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=de(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||Eh,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=de(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?de(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]=Ou(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=yh.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=de(t.absolute||Au.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[es](this.statCache.get(this.absolute)):this[Hi]()}emit(e,...t){return e==="error"&&(this[Su]=!0),super.emit(e,...t)}[Hi](){De.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[es](t)})}[es](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Ch(e),this.emit("stat",e),this[Cu]()}[Cu](){switch(this.type){case"File":return this[wu]();case"Directory":return this[Fu]();case"SymbolicLink":return this[Gi]();default:return this.end()}}[ts](e){return xu(e,this.type==="Directory",this.portable)}[ge](e){return Bu(e,this.prefix)}[pr](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Ru({path:this[ge](this.path),linkpath:this.type==="Link"?this[ge](this.linkpath):this.linkpath,mode:this[ts](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 _u({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[ge](this.path),linkpath:this.type==="Link"?this[ge](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)}[Fu](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[pr](),this.end()}[Gi](){De.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Yi](t)})}[Yi](e){this.linkpath=de(e),this[pr](),this.end()}[bu](e){this.type="Link",this.linkpath=de(Au.relative(this.cwd,e)),this.stat.size=0,this[pr](),this.end()}[wu](){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[pr](),this.stat.size===0)return this.end();this[Vi]()}[Vi](){De.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[Ki](t)})}[Ki](e){if(this.fd=e,this[Su])return this[He]();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[Qr]()}[Qr](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;De.read(e,t,s,i,n,(o,a)=>{if(o)return this[He](()=>this.emit("error",o));this[Ji](a)})}[He](e){De.close(this.fd,e)}[Ji](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[He](()=>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[He](()=>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[Wi]():this[Zi](()=>this[Wi]())}[Zi](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)}[Wi](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[He](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[Qr]()}}),Xi=class extends rs{[Hi](){this[es](De.lstatSync(this.absolute))}[Gi](){this[Yi](De.readlinkSync(this.absolute))}[Vi](){this[Ki](De.openSync(this.absolute,"r"))}[Qr](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=De.readSync(t,s,i,n,o);this[Ji](a),e=!1}finally{if(e)try{this[He](()=>{})}catch{}}}[Zi](e){e()}[He](e){De.closeSync(this.fd),e()}},Ah=vu(class extends ku{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=de(e.path),this.mode=this[ts](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=de(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Ou(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Ru({path:this[ge](this.path),linkpath:this.type==="Link"?this[ge](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 _u({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[ge](this.path),linkpath:this.type==="Link"?this[ge](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)}[ge](e){return Bu(e,this.prefix)}[ts](e){return xu(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()}});rs.Sync=Xi;rs.Tar=Ah;var Ch=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Tu.exports=rs});var Lu=y((a0,Pu)=>{"use strict";u();Pu.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var en=y((c0,Nu)=>{"use strict";u();Nu.exports=k;k.Node=ft;k.create=k;function k(r){var e=this;if(e instanceof k||(e=new k),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}k.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};k.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++}};k.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++}};k.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)Fh(this,arguments[r]);return this.length};k.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)bh(this,arguments[r]);return this.length};k.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}};k.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}};k.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};k.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};k.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};k.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};k.prototype.map=function(r,e){e=e||this;for(var t=new k,s=this.head;s!==null;)t.push(r.call(e,s.value,this)),s=s.next;return t};k.prototype.mapReverse=function(r,e){e=e||this;for(var t=new k,s=this.tail;s!==null;)t.push(r.call(e,s.value,this)),s=s.prev;return t};k.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};k.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};k.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};k.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};k.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 k;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};k.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 k;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};k.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=wh(this,i,t[s]);return n};k.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 wh(r,e,t){var s=e===r.head?new ft(t,null,e,r):new ft(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function Fh(r,e){r.tail=new ft(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function bh(r,e){r.head=new ft(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function ft(r,e,t,s){if(!(this instanceof ft))return new ft(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{Lu()(k)}catch{}});var hs=y((h0,zu)=>{"use strict";u();var cs=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}},Sh=qr(),kh=xi(),_h=Yr(),ln=Qi(),Rh=ln.Sync,Bh=ln.Tar,vh=en(),Iu=Buffer.alloc(1024),ns=Symbol("onStat"),ss=Symbol("ended"),Ee=Symbol("queue"),Nt=Symbol("current"),pt=Symbol("process"),is=Symbol("processing"),Mu=Symbol("processJob"),ye=Symbol("jobs"),tn=Symbol("jobDone"),os=Symbol("addFSEntry"),qu=Symbol("addTarEntry"),on=Symbol("stat"),un=Symbol("readdir"),us=Symbol("onreaddir"),as=Symbol("pipe"),Uu=Symbol("entry"),rn=Symbol("entryOpt"),an=Symbol("writeEntryClass"),ju=Symbol("write"),sn=Symbol("ondrain"),ls=A("fs"),$u=A("path"),Oh=Zr(),nn=xt(),hn=Oh(class extends Sh{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=nn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[an]=ln,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 kh.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[sn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[sn]),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[Ee]=new vh,this[ye]=0,this.jobs=+e.jobs||4,this[is]=!1,this[ss]=!1}[ju](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ss]=!0,this[pt](),this}write(e){if(this[ss])throw new Error("write after end");return e instanceof _h?this[qu](e):this[os](e),this.flowing}[qu](e){let t=nn($u.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new cs(e.path,t,!1);s.entry=new Bh(e,this[rn](s)),s.entry.on("end",i=>this[tn](s)),this[ye]+=1,this[Ee].push(s)}this[pt]()}[os](e){let t=nn($u.resolve(this.cwd,e));this[Ee].push(new cs(e,t)),this[pt]()}[on](e){e.pending=!0,this[ye]+=1;let t=this.follow?"stat":"lstat";ls[t](e.absolute,(s,i)=>{e.pending=!1,this[ye]-=1,s?this.emit("error",s):this[ns](e,i)})}[ns](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[pt]()}[un](e){e.pending=!0,this[ye]+=1,ls.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[ye]-=1,t)return this.emit("error",t);this[us](e,s)})}[us](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[pt]()}[pt](){if(!this[is]){this[is]=!0;for(let e=this[Ee].head;e!==null&&this[ye]<this.jobs;e=e.next)if(this[Mu](e.value),e.value.ignore){let t=e.next;this[Ee].removeNode(e),e.next=t}this[is]=!1,this[ss]&&!this[Ee].length&&this[ye]===0&&(this.zip?this.zip.end(Iu):(super.write(Iu),super.end()))}}get[Nt](){return this[Ee]&&this[Ee].head&&this[Ee].head.value}[tn](e){this[Ee].shift(),this[ye]-=1,this[pt]()}[Mu](e){if(!e.pending){if(e.entry){e===this[Nt]&&!e.piped&&this[as](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[ns](e,this.statCache.get(e.absolute)):this[on](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[us](e,this.readdirCache.get(e.absolute)):this[un](e),!e.readdir))){if(e.entry=this[Uu](e),!e.entry){e.ignore=!0;return}e===this[Nt]&&!e.piped&&this[as](e)}}}[rn](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}}[Uu](e){this[ye]+=1;try{return new this[an](e.path,this[rn](e)).on("end",()=>this[tn](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[sn](){this[Nt]&&this[Nt].entry&&this[Nt].entry.resume()}[as](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[os](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 hn{constructor(e){super(e),this[an]=Rh}pause(){}resume(){}[on](e){let t=this.follow?"statSync":"lstatSync";this[ns](e,ls[t](e.absolute))}[un](e,t){this[us](e,ls.readdirSync(e.absolute))}[as](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[os](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[ju](i)})}};hn.Sync=cn;zu.exports=hn});var Wt=y(dr=>{"use strict";u();var xh=Di(),Th=A("events").EventEmitter,K=A("fs"),mn=K.writev;if(!mn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;mn=(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 jt=Symbol("_autoClose"),fe=Symbol("_close"),mr=Symbol("_ended"),B=Symbol("_fd"),Wu=Symbol("_finished"),Ye=Symbol("_flags"),fn=Symbol("_flush"),dn=Symbol("_handleChunk"),Dn=Symbol("_makeBuf"),Ds=Symbol("_mode"),fs=Symbol("_needDrain"),Ut=Symbol("_onerror"),zt=Symbol("_onopen"),pn=Symbol("_onread"),Mt=Symbol("_onwrite"),Ve=Symbol("_open"),Pe=Symbol("_path"),mt=Symbol("_pos"),Ae=Symbol("_queue"),qt=Symbol("_read"),Gu=Symbol("_readSize"),Je=Symbol("_reading"),ps=Symbol("_remain"),Hu=Symbol("_size"),ms=Symbol("_write"),It=Symbol("_writing"),ds=Symbol("_defaultFlag"),$t=Symbol("_errored"),gs=class extends xh{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[$t]=!1,this[B]=typeof t.fd=="number"?t.fd:null,this[Pe]=e,this[Gu]=t.readSize||16*1024*1024,this[Je]=!1,this[Hu]=typeof t.size=="number"?t.size:1/0,this[ps]=this[Hu],this[jt]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[B]=="number"?this[qt]():this[Ve]()}get fd(){return this[B]}get path(){return this[Pe]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ve](){K.open(this[Pe],"r",(e,t)=>this[zt](e,t))}[zt](e,t){e?this[Ut](e):(this[B]=t,this.emit("open",t),this[qt]())}[Dn](){return Buffer.allocUnsafe(Math.min(this[Gu],this[ps]))}[qt](){if(!this[Je]){this[Je]=!0;let e=this[Dn]();if(e.length===0)return process.nextTick(()=>this[pn](null,0,e));K.read(this[B],e,0,e.length,null,(t,s,i)=>this[pn](t,s,i))}}[pn](e,t,s){this[Je]=!1,e?this[Ut](e):this[dn](t,s)&&this[qt]()}[fe](){if(this[jt]&&typeof this[B]=="number"){let e=this[B];this[B]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ut](e){this[Je]=!0,this[fe](),this.emit("error",e)}[dn](e,t){let s=!1;return this[ps]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[ps]<=0)&&(s=!1,this[fe](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[B]=="number"&&this[qt]();break;case"error":return this[$t]?void 0:(this[$t]=!0,super.emit(e,t));default:return super.emit(e,t)}}},gn=class extends gs{[Ve](){let e=!0;try{this[zt](null,K.openSync(this[Pe],"r")),e=!1}finally{e&&this[fe]()}}[qt](){let e=!0;try{if(!this[Je]){this[Je]=!0;do{let t=this[Dn](),s=t.length===0?0:K.readSync(this[B],t,0,t.length,null);if(!this[dn](s,t))break}while(!0);this[Je]=!1}e=!1}finally{e&&this[fe]()}}[fe](){if(this[jt]&&typeof this[B]=="number"){let e=this[B];this[B]=null,K.closeSync(e),this.emit("close")}}},Es=class extends Th{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[$t]=!1,this[It]=!1,this[mr]=!1,this[fs]=!1,this[Ae]=[],this[Pe]=e,this[B]=typeof t.fd=="number"?t.fd:null,this[Ds]=t.mode===void 0?438:t.mode,this[mt]=typeof t.start=="number"?t.start:null,this[jt]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[mt]!==null?"r+":"w";this[ds]=t.flags===void 0,this[Ye]=this[ds]?s:t.flags,this[B]===null&&this[Ve]()}emit(e,t){if(e==="error"){if(this[$t])return;this[$t]=!0}return super.emit(e,t)}get fd(){return this[B]}get path(){return this[Pe]}[Ut](e){this[fe](),this[It]=!0,this.emit("error",e)}[Ve](){K.open(this[Pe],this[Ye],this[Ds],(e,t)=>this[zt](e,t))}[zt](e,t){this[ds]&&this[Ye]==="r+"&&e&&e.code==="ENOENT"?(this[Ye]="w",this[Ve]()):e?this[Ut](e):(this[B]=t,this.emit("open",t),this[fn]())}end(e,t){return e&&this.write(e,t),this[mr]=!0,!this[It]&&!this[Ae].length&&typeof this[B]=="number"&&this[Mt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[mr]?(this.emit("error",new Error("write() after end()")),!1):this[B]===null||this[It]||this[Ae].length?(this[Ae].push(e),this[fs]=!0,!1):(this[It]=!0,this[ms](e),!0)}[ms](e){K.write(this[B],e,0,e.length,this[mt],(t,s)=>this[Mt](t,s))}[Mt](e,t){e?this[Ut](e):(this[mt]!==null&&(this[mt]+=t),this[Ae].length?this[fn]():(this[It]=!1,this[mr]&&!this[Wu]?(this[Wu]=!0,this[fe](),this.emit("finish")):this[fs]&&(this[fs]=!1,this.emit("drain"))))}[fn](){if(this[Ae].length===0)this[mr]&&this[Mt](null,0);else if(this[Ae].length===1)this[ms](this[Ae].pop());else{let e=this[Ae];this[Ae]=[],mn(this[B],e,this[mt],(t,s)=>this[Mt](t,s))}}[fe](){if(this[jt]&&typeof this[B]=="number"){let e=this[B];this[B]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},En=class extends Es{[Ve](){let e;if(this[ds]&&this[Ye]==="r+")try{e=K.openSync(this[Pe],this[Ye],this[Ds])}catch(t){if(t.code==="ENOENT")return this[Ye]="w",this[Ve]();throw t}else e=K.openSync(this[Pe],this[Ye],this[Ds]);this[zt](null,e)}[fe](){if(this[jt]&&typeof this[B]=="number"){let e=this[B];this[B]=null,K.closeSync(e),this.emit("close")}}[ms](e){let t=!0;try{this[Mt](null,K.writeSync(this[B],e,0,e.length,this[mt])),t=!1}finally{if(t)try{this[fe]()}catch{}}}};dr.ReadStream=gs;dr.ReadStreamSync=gn;dr.WriteStream=Es;dr.WriteStreamSync=En});var Ss=y((m0,ea)=>{"use strict";u();var Ph=Zr(),Lh=Pt(),Nh=A("events"),Ih=en(),Mh=1024*1024,qh=Yr(),Ju=Kr(),Uh=xi(),{nextTick:$h}=A("process"),yn=Buffer.from([31,139]),se=Symbol("state"),dt=Symbol("writeEntry"),Le=Symbol("readEntry"),An=Symbol("nextEntry"),Yu=Symbol("processEntry"),ie=Symbol("extendedHeader"),Dr=Symbol("globalExtendedHeader"),Ke=Symbol("meta"),Vu=Symbol("emitMeta"),T=Symbol("buffer"),Ne=Symbol("queue"),Dt=Symbol("ended"),Ku=Symbol("emittedEnd"),gt=Symbol("emit"),Z=Symbol("unzip"),ys=Symbol("consumeChunk"),As=Symbol("consumeChunkSub"),Cn=Symbol("consumeBody"),Zu=Symbol("consumeMeta"),Xu=Symbol("consumeHeader"),Cs=Symbol("consuming"),wn=Symbol("bufferConcat"),Fn=Symbol("maybeEnd"),gr=Symbol("writing"),Ze=Symbol("aborted"),ws=Symbol("onDone"),Et=Symbol("sawValidEntry"),Fs=Symbol("sawNullBlock"),bs=Symbol("sawEOF"),Qu=Symbol("closeStream"),jh=r=>!0;ea.exports=Ph(class extends Nh{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Et]=null,this.on(ws,t=>{(this[se]==="begin"||this[Et]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(ws,e.ondone):this.on(ws,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Mh,this.filter=typeof e.filter=="function"?e.filter:jh,this.writable=!0,this.readable=!1,this[Ne]=new Ih,this[T]=null,this[Le]=null,this[dt]=null,this[se]="begin",this[Ke]="",this[ie]=null,this[Dr]=null,this[Dt]=!1,this[Z]=null,this[Ze]=!1,this[Fs]=!1,this[bs]=!1,this.on("end",()=>this[Qu]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[Xu](e,t){this[Et]===null&&(this[Et]=!1);let s;try{s=new Lh(e,t,this[ie],this[Dr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Fs]?(this[bs]=!0,this[se]==="begin"&&(this[se]="header"),this[gt]("eof")):(this[Fs]=!0,this[gt]("nullBlock"));else if(this[Fs]=!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[dt]=new qh(s,this[ie],this[Dr]);if(!this[Et])if(n.remain){let o=()=>{n.invalid||(this[Et]=!0)};n.on("end",o)}else this[Et]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[gt]("ignoredEntry",n),this[se]="ignore",n.resume()):n.size>0&&(this[Ke]="",n.on("data",o=>this[Ke]+=o),this[se]="meta"):(this[ie]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[gt]("ignoredEntry",n),this[se]=n.remain?"ignore":"header",n.resume()):(n.remain?this[se]="body":(this[se]="header",n.end()),this[Le]?this[Ne].push(n):(this[Ne].push(n),this[An]())))}}}[Qu](){$h(()=>this.emit("close"))}[Yu](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Le]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[An]()),t=!1)):(this[Le]=null,t=!1),t}[An](){do;while(this[Yu](this[Ne].shift()));if(!this[Ne].length){let e=this[Le];!e||e.flowing||e.size===e.remain?this[gr]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[Cn](e,t){let s=this[dt],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[se]="header",this[dt]=null,s.end()),n.length}[Zu](e,t){let s=this[dt],i=this[Cn](e,t);return this[dt]||this[Vu](s),i}[gt](e,t,s){!this[Ne].length&&!this[Le]?this.emit(e,t,s):this[Ne].push([e,t,s])}[Vu](e){switch(this[gt]("meta",this[Ke]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ie]=Ju.parse(this[Ke],this[ie],!1);break;case"GlobalExtendedHeader":this[Dr]=Ju.parse(this[Ke],this[Dr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ie]=this[ie]||Object.create(null),this[ie].path=this[Ke].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ie]=this[ie]||Object.create(null),this[ie].linkpath=this[Ke].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Ze]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[Ze])return;if(this[Z]===null&&e){if(this[T]&&(e=Buffer.concat([this[T],e]),this[T]=null),e.length<yn.length)return this[T]=e,!0;for(let s=0;this[Z]===null&&s<yn.length;s++)e[s]!==yn[s]&&(this[Z]=!1);if(this[Z]===null){let s=this[Dt];this[Dt]=!1,this[Z]=new Uh.Unzip,this[Z].on("data",n=>this[ys](n)),this[Z].on("error",n=>this.abort(n)),this[Z].on("end",n=>{this[Dt]=!0,this[ys]()}),this[gr]=!0;let i=this[Z][s?"end":"write"](e);return this[gr]=!1,i}}this[gr]=!0,this[Z]?this[Z].write(e):this[ys](e),this[gr]=!1;let t=this[Ne].length?!1:this[Le]?this[Le].flowing:!0;return!t&&!this[Ne].length&&this[Le].once("drain",s=>this.emit("drain")),t}[wn](e){e&&!this[Ze]&&(this[T]=this[T]?Buffer.concat([this[T],e]):e)}[Fn](){if(this[Dt]&&!this[Ku]&&!this[Ze]&&!this[Cs]){this[Ku]=!0;let e=this[dt];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[gt](ws)}}[ys](e){if(this[Cs])this[wn](e);else if(!e&&!this[T])this[Fn]();else{if(this[Cs]=!0,this[T]){this[wn](e);let t=this[T];this[T]=null,this[As](t)}else this[As](e);for(;this[T]&&this[T].length>=512&&!this[Ze]&&!this[bs];){let t=this[T];this[T]=null,this[As](t)}this[Cs]=!1}(!this[T]||this[Dt])&&this[Fn]()}[As](e){let t=0,s=e.length;for(;t+512<=s&&!this[Ze]&&!this[bs];)switch(this[se]){case"begin":case"header":this[Xu](e,t),t+=512;break;case"ignore":case"body":t+=this[Cn](e,t);break;case"meta":t+=this[Zu](e,t);break;default:throw new Error("invalid state: "+this[se])}t<s&&(this[T]?this[T]=Buffer.concat([e.slice(t),this[T]]):this[T]=e.slice(t))}end(e){this[Ze]||(this[Z]?this[Z].end(e):(this[Dt]=!0,this.write(e)))}})});var ks=y((d0,ia)=>{"use strict";u();var zh=_t(),ra=Ss(),Gt=A("fs"),Wh=Wt(),ta=A("path"),bn=Lt();ia.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=zh(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&&Hh(s,e),s.noResume||Gh(s),s.file&&s.sync?Jh(s):s.file?Yh(s,t):sa(s)};var Gh=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},Hh=(r,e)=>{let t=new Map(e.map(n=>[bn(n),!0])),s=r.filter,i=(n,o)=>{let a=o||ta.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(ta.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(bn(n)):n=>i(bn(n))},Jh=r=>{let e=sa(r),t=r.file,s=!0,i;try{let n=Gt.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(Gt.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=Gt.openSync(t,"r");a<n.size;){let c=Gt.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{Gt.closeSync(i)}catch{}}},Yh=(r,e)=>{let t=new ra(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Gt.stat(i,(l,c)=>{if(l)a(l);else{let h=new Wh.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},sa=r=>new ra(r)});var la=y((D0,ca)=>{"use strict";u();var Vh=_t(),_s=hs(),na=Wt(),oa=ks(),ua=A("path");ca.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=Vh(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?Kh(s,e):s.file?Zh(s,e,t):s.sync?Xh(s,e):Qh(s,e)};var Kh=(r,e)=>{let t=new _s.Sync(r),s=new na.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),aa(t,e)},Zh=(r,e,t)=>{let s=new _s(r),i=new na.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 Sn(s,e),t?n.then(t,t):n},aa=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?oa({file:ua.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Sn=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return oa({file:ua.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Sn(r,e));r.add(t)}r.end()},Xh=(r,e)=>{let t=new _s.Sync(r);return aa(t,e),t},Qh=(r,e)=>{let t=new _s(r);return Sn(t,e),t}});var kn=y((g0,ga)=>{"use strict";u();var ef=_t(),ha=hs(),ee=A("fs"),fa=Wt(),pa=ks(),ma=A("path"),da=Pt();ga.exports=(r,e,t)=>{let s=ef(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?tf(s,e):sf(s,e,t)};var tf=(r,e)=>{let t=new ha.Sync(r),s=!0,i,n;try{try{i=ee.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=ee.openSync(r.file,"w+");else throw l}let o=ee.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=ee.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 da(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,rf(r,t,n,i,e)}finally{if(s)try{ee.closeSync(i)}catch{}}},rf=(r,e,t,s,i)=>{let n=new fa.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),nf(e,i)},sf=(r,e,t)=>{e=Array.from(e);let s=new ha(r),i=(o,a,l)=>{let c=(b,N)=>{b?ee.close(o,x=>l(b)):l(null,N)},h=0;if(a===0)return c(null,0);let d=0,g=Buffer.alloc(512),C=(b,N)=>{if(b)return c(b);if(d+=N,d<512&&N)return ee.read(o,g,d,g.length-d,h+d,C);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 x=new da(g);if(!x.cksumValid)return c(null,h);let v=512*Math.ceil(x.size/512);if(h+v+512>a||(h+=v+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(x.path,x.mtime),d=0,ee.read(o,g,0,512,h,C)};ee.read(o,g,0,512,h,C)},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+",ee.open(r.file,l,c);if(h)return a(h);ee.fstat(d,(g,C)=>{if(g)return ee.close(d,()=>a(g));i(d,C.size,(b,N)=>{if(b)return a(b);let x=new fa.WriteStream(r.file,{fd:d,start:N});s.pipe(x),x.on("error",a),x.on("close",o),Da(s,e)})})};ee.open(r.file,l,c)});return t?n.then(t,t):n},nf=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?pa({file:ma.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Da=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return pa({file:ma.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Da(r,e));r.add(t)}r.end()}});var ya=y((E0,Ea)=>{"use strict";u();var of=_t(),uf=kn();Ea.exports=(r,e,t)=>{let s=of(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),af(s),uf(s,e,t)};var af=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 wa=y((y0,Ca)=>{u();var{promisify:Aa}=A("util"),Xe=A("fs"),cf=r=>{if(!r)r={mode:511,fs:Xe};else if(typeof r=="object")r={mode:511,fs:Xe,...r};else if(typeof r=="number")r={mode:r,fs:Xe};else if(typeof r=="string")r={mode:parseInt(r,8),fs:Xe};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||Xe.mkdir,r.mkdirAsync=Aa(r.mkdir),r.stat=r.stat||r.fs.stat||Xe.stat,r.statAsync=Aa(r.stat),r.statSync=r.statSync||r.fs.statSync||Xe.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||Xe.mkdirSync,r};Ca.exports=cf});var ba=y((A0,Fa)=>{u();var lf=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:hf,parse:ff}=A("path"),pf=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=hf(r),lf==="win32"){let e=/[*|"<>?:]/,{root:t}=ff(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Fa.exports=pf});var Ba=y((C0,Ra)=>{u();var{dirname:Sa}=A("path"),ka=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?ka(r,Sa(e),e):void 0),_a=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?_a(r,Sa(e),e):void 0}};Ra.exports={findMade:ka,findMadeSync:_a}});var Bn=y((w0,Oa)=>{u();var{dirname:va}=A("path"),_n=(r,e,t)=>{e.recursive=!1;let s=va(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 _n(s,e).then(n=>_n(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})})},Rn=(r,e,t)=>{let s=va(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 Rn(r,e,Rn(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};Oa.exports={mkdirpManual:_n,mkdirpManualSync:Rn}});var Pa=y((F0,Ta)=>{u();var{dirname:xa}=A("path"),{findMade:mf,findMadeSync:df}=Ba(),{mkdirpManual:Df,mkdirpManualSync:gf}=Bn(),Ef=(r,e)=>(e.recursive=!0,xa(r)===r?e.mkdirAsync(r,e):mf(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return Df(r,e);throw i}))),yf=(r,e)=>{if(e.recursive=!0,xa(r)===r)return e.mkdirSync(r,e);let s=df(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return gf(r,e);throw i}};Ta.exports={mkdirpNative:Ef,mkdirpNativeSync:yf}});var Ma=y((b0,Ia)=>{u();var La=A("fs"),Af=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,vn=Af.replace(/^v/,"").split("."),Na=+vn[0]>10||+vn[0]==10&&+vn[1]>=12,Cf=Na?r=>r.mkdir===La.mkdir:()=>!1,wf=Na?r=>r.mkdirSync===La.mkdirSync:()=>!1;Ia.exports={useNative:Cf,useNativeSync:wf}});var Wa=y((S0,za)=>{u();var Ht=wa(),Jt=ba(),{mkdirpNative:qa,mkdirpNativeSync:Ua}=Pa(),{mkdirpManual:$a,mkdirpManualSync:ja}=Bn(),{useNative:Ff,useNativeSync:bf}=Ma(),Yt=(r,e)=>(r=Jt(r),e=Ht(e),Ff(e)?qa(r,e):$a(r,e)),Sf=(r,e)=>(r=Jt(r),e=Ht(e),bf(e)?Ua(r,e):ja(r,e));Yt.sync=Sf;Yt.native=(r,e)=>qa(Jt(r),Ht(e));Yt.manual=(r,e)=>$a(Jt(r),Ht(e));Yt.nativeSync=(r,e)=>Ua(Jt(r),Ht(e));Yt.manualSync=(r,e)=>ja(Jt(r),Ht(e));za.exports=Yt});var Za=y((k0,Ka)=>{"use strict";u();var ne=A("fs"),yt=A("path"),kf=ne.lchown?"lchown":"chown",_f=ne.lchownSync?"lchownSync":"chownSync",Ha=ne.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Ga=(r,e,t)=>{try{return ne[_f](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Rf=(r,e,t)=>{try{return ne.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Bf=Ha?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):ne.chown(r,e,t,s)}:(r,e,t,s)=>s,On=Ha?(r,e,t)=>{try{return Ga(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Rf(r,e,t)}}:(r,e,t)=>Ga(r,e,t),vf=process.version,Ja=(r,e,t)=>ne.readdir(r,e,t),Of=(r,e)=>ne.readdirSync(r,e);/^v4\./.test(vf)&&(Ja=(r,e,t)=>ne.readdir(r,t));var Rs=(r,e,t,s)=>{ne[kf](r,e,t,Bf(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},Ya=(r,e,t,s,i)=>{if(typeof e=="string")return ne.lstat(yt.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,Ya(r,o,t,s,i)});if(e.isDirectory())xn(yt.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=yt.resolve(r,e.name);Rs(o,t,s,i)});else{let n=yt.resolve(r,e.name);Rs(n,t,s,i)}},xn=(r,e,t,s)=>{Ja(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 Rs(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Rs(r,e,t,s)}};n.forEach(c=>Ya(r,c,e,t,l))})},xf=(r,e,t,s)=>{if(typeof e=="string")try{let i=ne.lstatSync(yt.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&Va(yt.resolve(r,e.name),t,s),On(yt.resolve(r,e.name),t,s)},Va=(r,e,t)=>{let s;try{s=Of(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return On(r,e,t);throw i}return s&&s.length&&s.forEach(i=>xf(r,i,e,t)),On(r,e,t)};Ka.exports=xn;xn.sync=Va});var tc=y((_0,Tn)=>{"use strict";u();var Xa=Wa(),oe=A("fs"),Bs=A("path"),Qa=Za(),pe=xt(),vs=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Os=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},xs=(r,e)=>r.get(pe(e)),Er=(r,e,t)=>r.set(pe(e),t),Tf=(r,e)=>{oe.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Os(r,t&&t.code||"ENOTDIR")),e(t)})};Tn.exports=(r,e,t)=>{r=pe(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=pe(e.cwd),C=(x,v)=>{x?t(x):(Er(d,r,!0),v&&l?Qa(v,o,a,Ce=>C(Ce)):n?oe.chmod(r,i,t):t())};if(d&&xs(d,r)===!0)return C();if(r===g)return Tf(r,C);if(c)return Xa(r,{mode:i}).then(x=>C(null,x),C);let N=pe(Bs.relative(g,r)).split("/");Ts(g,N,i,d,h,g,null,C)};var Ts=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=pe(Bs.resolve(r+"/"+l));if(xs(s,c))return Ts(c,e,t,s,i,n,o,a);oe.mkdir(c,t,ec(c,e,t,s,i,n,o,a))},ec=(r,e,t,s,i,n,o,a)=>l=>{l?oe.lstat(r,(c,h)=>{if(c)c.path=c.path&&pe(c.path),a(c);else if(h.isDirectory())Ts(r,e,t,s,i,n,o,a);else if(i)oe.unlink(r,d=>{if(d)return a(d);oe.mkdir(r,t,ec(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new vs(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,Ts(r,e,t,s,i,n,o,a))},Pf=r=>{let e=!1,t="ENOTDIR";try{e=oe.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Os(r,t)}};Tn.exports.sync=(r,e)=>{r=pe(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=pe(e.cwd),g=x=>{Er(h,r,!0),x&&a&&Qa.sync(x,n,o),i&&oe.chmodSync(r,s)};if(h&&xs(h,r)===!0)return g();if(r===d)return Pf(d),g();if(l)return g(Xa.sync(r,s));let b=pe(Bs.relative(d,r)).split("/"),N=null;for(let x=b.shift(),v=d;x&&(v+="/"+x);x=b.shift())if(v=pe(Bs.resolve(v)),!xs(h,v))try{oe.mkdirSync(v,s),N=N||v,Er(h,v,!0)}catch{let tr=oe.lstatSync(v);if(tr.isDirectory()){Er(h,v,!0);continue}else if(c){oe.unlinkSync(v),oe.mkdirSync(v,s),N=N||v,Er(h,v,!0);continue}else if(tr.isSymbolicLink())return new vs(v,v+"/"+b.join("/"))}return g(N)}});var Ln=y((R0,rc)=>{u();var Pn=Object.create(null),{hasOwnProperty:Lf}=Object.prototype;rc.exports=r=>(Lf.call(Pn,r)||(Pn[r]=r.normalize("NFKD")),Pn[r])});var oc=y((B0,nc)=>{u();var sc=A("assert"),Nf=Ln(),If=Lt(),{join:ic}=A("path"),Mf=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,qf=Mf==="win32";nc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((d,g)=>(d.length&&(g=ic(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(C=>{let b=r.get(C);sc.equal(b[0],c),b.length===1?r.delete(C):(b.shift(),typeof b[0]=="function"?g.add(b[0]):b[0].forEach(N=>g.add(N)))}),d.forEach(C=>{let b=r.get(C);sc(b[0]instanceof Set),b[0].size===1&&b.length===1?r.delete(C):b[0].size===1?(b.shift(),g.add(b[0])):b[0].delete(c)}),s.delete(c),g.forEach(C=>o(C)),!0};return{check:n,reserve:(c,h)=>{c=qf?["win32 parallelization disabled"]:c.map(g=>Nf(If(ic(g))).toLowerCase());let d=new Set(c.map(g=>t(g)).reduce((g,C)=>g.concat(C)));return e.set(h,{dirs:d,paths:c}),c.forEach(g=>{let C=r.get(g);C?C.push(h):r.set(g,[h])}),d.forEach(g=>{let C=r.get(g);C?C[C.length-1]instanceof Set?C[C.length-1].add(h):C.push(new Set([h])):r.set(g,[new Set([h])])}),o(h)}}}});var cc=y((v0,ac)=>{u();var Uf=process.env.__FAKE_PLATFORM__||process.platform,$f=Uf==="win32",jf=global.__FAKE_TESTING_FS__||A("fs"),{O_CREAT:zf,O_TRUNC:Wf,O_WRONLY:Gf,UV_FS_O_FILEMAP:uc=0}=jf.constants,Hf=$f&&!!uc,Jf=512*1024,Yf=uc|Wf|zf|Gf;ac.exports=Hf?r=>r<Jf?Yf:"w":()=>"w"});var Wn=y((O0,Fc)=>{"use strict";u();var Vf=A("assert"),Kf=Ss(),_=A("fs"),Zf=Wt(),Ie=A("path"),Ac=tc(),lc=ji(),Xf=oc(),Qf=zi(),te=xt(),ep=Lt(),tp=Ln(),hc=Symbol("onEntry"),Mn=Symbol("checkFs"),fc=Symbol("checkFs2"),Ns=Symbol("pruneCache"),qn=Symbol("isReusable"),ue=Symbol("makeFs"),Un=Symbol("file"),$n=Symbol("directory"),Is=Symbol("link"),pc=Symbol("symlink"),mc=Symbol("hardlink"),dc=Symbol("unsupported"),Dc=Symbol("checkPath"),Qe=Symbol("mkdir"),G=Symbol("onError"),Ps=Symbol("pending"),gc=Symbol("pend"),Vt=Symbol("unpend"),Nn=Symbol("ended"),In=Symbol("maybeClose"),jn=Symbol("skip"),yr=Symbol("doChown"),Ar=Symbol("uid"),Cr=Symbol("gid"),wr=Symbol("checkedCwd"),Cc=A("crypto"),wc=cc(),rp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Fr=rp==="win32",sp=(r,e)=>{if(!Fr)return _.unlink(r,e);let t=r+".DELETE."+Cc.randomBytes(16).toString("hex");_.rename(r,t,s=>{if(s)return e(s);_.unlink(t,e)})},ip=r=>{if(!Fr)return _.unlinkSync(r);let e=r+".DELETE."+Cc.randomBytes(16).toString("hex");_.renameSync(r,e),_.unlinkSync(e)},Ec=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,yc=r=>tp(ep(te(r))).toLowerCase(),np=(r,e)=>{e=yc(e);for(let t of r.keys()){let s=yc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},op=r=>{for(let e of r.keys())r.delete(e)},br=class extends Kf{constructor(e){if(e||(e={}),e.ondone=t=>{this[Nn]=!0,this[In]()},super(e),this[wr]=!1,this.reservations=Xf(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[Ps]=0,this[Nn]=!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||Fr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=te(Ie.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[hc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[In](){this[Nn]&&this[Ps]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Dc](e){if(this.strip){let t=te(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=te(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=te(e.path),s=t.split("/");if(s.includes("..")||Fr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=Qf(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(Ie.isAbsolute(e.path)?e.absolute=te(Ie.resolve(e.path)):e.absolute=te(Ie.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:te(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}=Ie.win32.parse(e.absolute);e.absolute=t+lc.encode(e.absolute.slice(t.length));let{root:s}=Ie.win32.parse(e.path);e.path=s+lc.encode(e.path.slice(s.length))}return!0}[hc](e){if(!this[Dc](e))return e.resume();switch(Vf.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[Mn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[dc](e)}}[G](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[Vt](),t.resume())}[Qe](e,t,s){Ac(te(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)}[yr](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}[Ar](e){return Ec(this.uid,e.uid,this.processUid)}[Cr](e){return Ec(this.gid,e.gid,this.processGid)}[Un](e,t){let s=e.mode&4095||this.fmode,i=new Zf.WriteStream(e.absolute,{flags:wc(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&_.close(i.fd,()=>{}),i.write=()=>!0,this[G](l,e),t()});let n=1,o=l=>{if(l){i.fd&&_.close(i.fd,()=>{}),this[G](l,e),t();return}--n===0&&_.close(i.fd,c=>{c?this[G](c,e):this[Vt](),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;_.futimes(h,d,g,C=>C?_.utimes(c,d,g,b=>o(b&&C)):o())}if(this[yr](e)){n++;let d=this[Ar](e),g=this[Cr](e);_.fchown(h,d,g,C=>C?_.chown(c,d,g,b=>o(b&&C)):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)}[$n](e,t){let s=e.mode&4095||this.dmode;this[Qe](e.absolute,s,i=>{if(i){this[G](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[Vt](),e.resume())};e.mtime&&!this.noMtime&&(n++,_.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[yr](e)&&(n++,_.chown(e.absolute,this[Ar](e),this[Cr](e),o)),o()})}[dc](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[pc](e,t){this[Is](e,e.linkpath,"symlink",t)}[mc](e,t){let s=te(Ie.resolve(this.cwd,e.linkpath));this[Is](e,s,"link",t)}[gc](){this[Ps]++}[Vt](){this[Ps]--,this[In]()}[jn](e){this[Vt](),e.resume()}[qn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Fr}[Mn](e){this[gc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[fc](e,s))}[Ns](e){e.type==="SymbolicLink"?op(this.dirCache):e.type!=="Directory"&&np(this.dirCache,e.absolute)}[fc](e,t){this[Ns](e);let s=a=>{this[Ns](e),t(a)},i=()=>{this[Qe](this.cwd,this.dmode,a=>{if(a){this[G](a,e),s();return}this[wr]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=te(Ie.dirname(e.absolute));if(a!==this.cwd)return this[Qe](a,this.dmode,l=>{if(l){this[G](l,e),s();return}o()})}o()},o=()=>{_.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[jn](e),s();return}if(a||this[qn](e,l))return this[ue](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=d=>this[ue](d,e,s);return c?_.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return _.rmdir(e.absolute,c=>this[ue](c,e,s))}if(e.absolute===this.cwd)return this[ue](null,e,s);sp(e.absolute,c=>this[ue](c,e,s))})};this[wr]?n():i()}[ue](e,t,s){if(e){this[G](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Un](t,s);case"Link":return this[mc](t,s);case"SymbolicLink":return this[pc](t,s);case"Directory":case"GNUDumpDir":return this[$n](t,s)}}[Is](e,t,s,i){_[s](t,e.absolute,n=>{n?this[G](n,e):(this[Vt](),e.resume()),i()})}},Ls=r=>{try{return[null,r()]}catch(e){return[e,null]}},zn=class extends br{[ue](e,t){return super[ue](e,t,()=>{})}[Mn](e){if(this[Ns](e),!this[wr]){let n=this[Qe](this.cwd,this.dmode);if(n)return this[G](n,e);this[wr]=!0}if(e.absolute!==this.cwd){let n=te(Ie.dirname(e.absolute));if(n!==this.cwd){let o=this[Qe](n,this.dmode);if(o)return this[G](o,e)}}let[t,s]=Ls(()=>_.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[jn](e);if(t||this[qn](e,s))return this[ue](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?Ls(()=>{_.chmodSync(e.absolute,e.mode)}):[];return this[ue](a,e)}let[n]=Ls(()=>_.rmdirSync(e.absolute));this[ue](n,e)}let[i]=e.absolute===this.cwd?[]:Ls(()=>ip(e.absolute));this[ue](i,e)}[Un](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{_.closeSync(n)}catch(c){l=c}(a||l)&&this[G](a||l,e),t()},n;try{n=_.openSync(e.absolute,wc(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{_.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{_.futimesSync(n,c,h)}catch(d){try{_.utimesSync(e.absolute,c,h)}catch{l=d}}}if(this[yr](e)){let c=this[Ar](e),h=this[Cr](e);try{_.fchownSync(n,c,h)}catch(d){try{_.chownSync(e.absolute,c,h)}catch{l=l||d}}}i(l)})}[$n](e,t){let s=e.mode&4095||this.dmode,i=this[Qe](e.absolute,s);if(i){this[G](i,e),t();return}if(e.mtime&&!this.noMtime)try{_.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[yr](e))try{_.chownSync(e.absolute,this[Ar](e),this[Cr](e))}catch{}t(),e.resume()}[Qe](e,t){try{return Ac.sync(te(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}}[Is](e,t,s,i){try{_[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[G](n,e)}}};br.Sync=zn;Fc.exports=br});var Rc=y((x0,_c)=>{"use strict";u();var up=_t(),Ms=Wn(),Sc=A("fs"),kc=Wt(),bc=A("path"),Gn=Lt();_c.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=up(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&&ap(s,e),s.file&&s.sync?cp(s):s.file?lp(s,t):s.sync?hp(s):fp(s)};var ap=(r,e)=>{let t=new Map(e.map(n=>[Gn(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(Gn(n)):n=>i(Gn(n))},cp=r=>{let e=new Ms.Sync(r),t=r.file,s=Sc.statSync(t),i=r.maxReadSize||16*1024*1024;new kc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},lp=(r,e)=>{let t=new Ms(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),Sc.stat(i,(l,c)=>{if(l)a(l);else{let h=new kc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},hp=r=>new Ms.Sync(r),fp=r=>new Ms(r)});var Bc=y(I=>{"use strict";u();I.c=I.create=la();I.r=I.replace=kn();I.t=I.list=ks();I.u=I.update=ya();I.x=I.extract=Rc();I.Pack=hs();I.Unpack=Wn();I.Parse=Ss();I.ReadEntry=Yr();I.WriteEntry=Qi();I.Header=Pt();I.Pax=Kr();I.types=Li()});var Oc=y((j0,vc)=>{u();function ae(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))}vc.exports=ae;ae.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};ae.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};ae.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};ae.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)};ae.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};ae.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};ae.prototype.start=ae.prototype.try;ae.prototype.errors=function(){return this._errors};ae.prototype.attempts=function(){return this._attempts};ae.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 xc=y(At=>{u();var Dp=Oc();At.operation=function(r){var e=At.timeouts(r);return new Dp(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};At.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};At.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};At.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=At.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 Pc=y((W0,Tc)=>{u();Tc.exports=xc()});var Nc=y((G0,Lc)=>{u();var gp=Pc();function Ep(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=gp.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(C){l(C,h)})}o.attempt(c)}return new Promise(t)}Lc.exports=Ep});var Rr={};nl(Rr,{bold:()=>fl,dimmed:()=>pl,error:()=>uo,info:()=>hl,item:()=>ml,log:()=>bt,turboBlue:()=>Ft,turboGradient:()=>ll,turboLoader:()=>no,turboRed:()=>so,warn:()=>oo,yellow:()=>io});u();import rr from"chalk";import ul from"ora";import al from"gradient-string";var to="#0099F7",ro="#F11712",cl="#FFFF00",ll=al(to,ro),Ft=rr.hex(to),so=rr.hex(ro),io=rr.hex(cl),no=r=>ul({text:r,spinner:{frames:[" ",Ft("> "),Ft(">> "),Ft(">>>")]}}),hl=(...r)=>{bt(Ft.bold(">>>"),...r)},fl=(...r)=>{bt(rr.bold(...r))},pl=(...r)=>{bt(rr.dim(...r))},ml=(...r)=>{bt(Ft.bold(" \u2022"),...r)},bt=(...r)=>{console.log(...r)},oo=(...r)=>{console.error(io.bold(">>>"),...r)},uo=(...r)=>{console.error(so.bold(">>>"),...r)};u();import dl from"os";import Dl from"execa";async function Br(r,e=[],t){let s={cwd:dl.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...t};try{let{stdout:i}=await Dl(r,e,s);return i.trim()}catch{return}}async function gl(){let[r,e,t,s]=await Promise.all([Br("yarnpkg",["--version"]),Br("npm",["--version"]),Br("pnpm",["--version"]),Br("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();u();u();var _l=_r(fo());u();u();function Ys(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function sr(r){return sr=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},sr(r)}u();function Vs(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Ks(r,e){if(e&&(sr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vs(r)}u();function ut(r){return ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ut(r)}u();u();function be(r,e){return be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},be(r,e)}function Zs(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&&be(r,e)}u();u();function Xs(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function Qs(){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 St(r,e,t){return Qs()?St=Reflect.construct.bind():St=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&be(c,o.prototype),c},St.apply(null,arguments)}function ir(r){var e=typeof Map=="function"?new Map:void 0;return ir=function(s){if(s===null||!Xs(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 St(s,arguments,ut(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),be(i,s)},ir(r)}var Oo=_r(vo());import pd from"fs-extra";var md=function(r){Zs(e,r);function e(t){var s;return Ys(this,e),s=Ks(this,ut(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(ir(Error));u();u();u();import bd from"js-yaml";import{sync as kd}from"fast-glob";u();import Od from"fs-extra";u();import Pd from"fs-extra";import Nd from"chalk";u();import{Stream as pp}from"stream";import{promisify as mp}from"util";var dp=_r(Bc());var N0=mp(pp.pipeline);u();import{access as q0,constants as U0}from"fs-extra";u();var Sp=_r(Nc());import J0 from"chalk";import{mkdir as V0,readJsonSync as K0,existsSync as Z0}from"fs-extra";u();u();u();var R=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,R)}};u();u();import Zt from"path";import{writeJSONSync as Uc,writeFileSync as Ip,existsSync as Yn,rmSync as Vn,rm as Mp}from"fs-extra";import qp from"execa";u();import Tp from"path";import{writeJSONSync as Pp}from"fs-extra";import Lp from"chalk";u();import et from"path";import kp from"execa";import{readJsonSync as _p,existsSync as Hn,readFileSync as Rp,rmSync as Ic,writeFile as Bp}from"fs-extra";import{sync as vp}from"fast-glob";import Op from"js-yaml";var xp=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=et.join(r,"package.json");try{return _p(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new R(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new R(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function tt({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=xp.exec(e);if(t){let[s,i]=t;return i}}catch{}}function Me({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=et.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function Jn({workspaceRoot:r}){let e=et.join(r,"pnpm-workspace.yaml");if(Hn(e))try{let t=Op.load(Rp(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new R(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function rt({root:r,lockFile:e,workspaceConfig:t}){let s=n=>et.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 Kt({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function st({workspaceRoot:r,workspaceGlobs:e}){return e?e.flatMap(t=>{let s=[`${t}/package.json`];return vp(s,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**"]})}).map(t=>{let s=et.dirname(t),{name:i,description:n}=Me({workspaceRoot:s});return{name:i,description:n,paths:{root:s,packageJson:t,nodeModules:et.join(s,"node_modules")}}}):[]}function Mc({directory:r}){let e=et.resolve(process.cwd(),r);return{exists:Hn(e),absolute:e}}function ce({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 qc({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 re({project:r,options:e}){e!=null&&e.dry||Ic(r.paths.lockfile,{force:!0})}async function qs({project:r,options:e}){if(!(e!=null&&e.dry)&&Hn(r.paths.lockfile))try{let{stdout:t}=await kp("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root});await Bp(et.join(r.paths.root,"yarn.lock"),t)}catch{}finally{Ic(r.paths.lockfile,{force:!0})}}function Np({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 le({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:C,dependencyList:b}=Np({dependencyList:g,project:r,to:t});n[d]=b,o[d]=C}});let l=d=>{let g=o[d].length;if(g>0)return`${Lp.green(g.toString())} ${d}`},c=a.map(l).filter(Boolean),h=`./${Tp.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let d="updating";c.forEach((g,C)=>{c.length===1?d+=` ${g} in ${h}`:C===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||Pp(e.paths.packageJson,n,{spaces:2})}var it={name:"pnpm",lock:"pnpm-lock.yaml"};async function $c(r){let e=Zt.join(r.workspaceRoot,it.lock),t=Zt.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=tt({workspaceRoot:r.workspaceRoot});return Yn(e)||Yn(t)||s===it.name}async function Up(r){if(!await $c(r))throw new R("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=Me(r);return{name:t,description:s,packageManager:it.name,paths:rt({root:r.workspaceRoot,lockFile:it.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:Jn(r),workspaces:st({workspaceGlobs:Jn(r),...r})}}}async function $p(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(ce({action:"create",packageManager:it.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||(Uc(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),Ip(Zt.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
|
4
|
+
${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
|
|
5
|
+
`)}`))),n&&(le({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{le({workspace:a,project:e,to:t,logger:s,options:i})}))}async function jp(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(ce({action:"remove",packageManager:it.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||Vn(e.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){Uc(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=>Mp(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function zp(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Zt.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Vn(e.paths.lockfile,{force:!0})}async function Wp(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${Zt.relative(e.paths.root,e.paths.lockfile)} to ${it.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&Yn(e.paths.lockfile))try{await qp(it.name,["import"],{stdio:"ignore",cwd:e.paths.root})}catch{}finally{re({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await qs({project:e,options:t}),await n(),Vn(Zt.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var jc={detect:$c,read:Up,create:$p,remove:jp,clean:zp,convertLock:Wp};u();import Us from"path";import{writeJSONSync as Kn,existsSync as Gp,rmSync as Hp,rm as Jp}from"fs-extra";var Xt={name:"npm",lock:"package-lock.json"};async function zc(r){let e=Us.join(r.workspaceRoot,Xt.lock),t=tt({workspaceRoot:r.workspaceRoot});return Gp(e)||t===Xt.name}async function Yp(r){if(!await zc(r))throw new R("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Me(r),n=Kt({workspaces:t.workspaces});return{name:s,description:i,packageManager:Xt.name,paths:rt({root:r.workspaceRoot,lockFile:Xt.lock}),workspaceData:{globs:n,workspaces:st({workspaceGlobs:n,...r})}}}async function Vp(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(ce({packageManager:Xt.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Us.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Us.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||Kn(e.paths.packageJson,o,{spaces:2}),le({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{le({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||Kn(e.paths.packageJson,o,{spaces:2})}async function Kp(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(ce({packageManager:Xt.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)){Kn(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=>Jp(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Zp(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Us.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Hp(e.paths.lockfile,{force:!0})}async function Xp(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":re({project:e,options:t});break;case"npm":break;case"yarn":re({project:e,options:t});break}}var Wc={detect:zc,read:Yp,create:Vp,remove:Kp,clean:Zp,convertLock:Xp};u();import Sr from"path";import{existsSync as Qp,writeJSONSync as Zn,rmSync as em,rm as tm}from"fs-extra";var Ct={name:"yarn",lock:"yarn.lock"};async function Gc(r){let e=Sr.join(r.workspaceRoot,Ct.lock),t=tt({workspaceRoot:r.workspaceRoot});return Qp(e)||t===Ct.name}async function rm(r){if(!await Gc(r))throw new R("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Me(r),n=Kt({workspaces:t.workspaces});return{name:s,description:i,packageManager:Ct.name,paths:rt({root:r.workspaceRoot,lockFile:Ct.lock}),workspaceData:{globs:n,workspaces:st({workspaceGlobs:n,...r})}}}async function sm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(ce({packageManager:Ct.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${Sr.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${Sr.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Zn(e.paths.packageJson,o,{spaces:2}),le({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{le({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||Zn(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(ce({packageManager:Ct.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)){Zn(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=>tm(a,{recursive:!0,force:!0})))}catch{throw new R("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 ${Sr.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||em(e.paths.lockfile,{force:!0})}async function om(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${Sr.relative(e.paths.root,e.paths.lockfile)} to ${Ct.lock}`)};switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":i(),await qs({project:e,options:t});break;case"npm":re({project:e,options:t});break;case"yarn":break}}var Hc={detect:Gc,read:rm,create:sm,remove:im,clean:nm,convertLock:om};u();import $s from"path";import{existsSync as um,writeJSONSync as Xn,rmSync as am,rm as cm}from"fs-extra";var Qt={name:"bun",lock:"bun.lockb"};async function Jc(r){let e=$s.join(r.workspaceRoot,Qt.lock),t=tt({workspaceRoot:r.workspaceRoot});return um(e)||t===Qt.name}async function lm(r){if(!await Jc(r))throw new R("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Me(r),n=Kt({workspaces:t.workspaces});return{name:s,description:i,packageManager:Qt.name,paths:rt({root:r.workspaceRoot,lockFile:Qt.lock}),workspaceData:{globs:n,workspaces:st({workspaceGlobs:n,...r})}}}async function hm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!qc({project:e}))throw new R("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(ce({packageManager:Qt.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${$s.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${$s.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Xn(e.paths.packageJson,o,{spaces:2}),le({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{le({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||Xn(e.paths.packageJson,o,{spaces:2})}async function fm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(ce({packageManager:Qt.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)){Xn(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=>cm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function pm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${$s.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||am(e.paths.lockfile,{force:!0})}async function mm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":break;case"npm":re({project:e,options:t});break;case"yarn":re({project:e,options:t});break}}var Yc={detect:Jc,read:lm,create:hm,remove:fm,clean:pm,convertLock:mm};var wt={pnpm:jc,yarn:Hc,npm:Wc,bun:Yc};u();async function dg({root:r}){let{exists:e,absolute:t}=Mc({directory:r});if(!e)throw new R(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(wt))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new R("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}u();import he from"chalk";import dm from"gradient-string";var er=2,js=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(er*e),...t)}header(e){this.blankLine(),this.logger(he.bold(e))}installerFrames(){let e=`${" ".repeat(er)} - ${this.dry?he.yellow("SKIPPED | "):he.green("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return dm("#0099F7","#F11712")(e.toString())}hero(){this.logger(he.bold(this.gradient(`
|
|
6
|
+
>>> TURBOREPO
|
|
7
|
+
`)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${he.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(er),"-",this.dry?he.yellow("SKIPPED |"):he.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(er),"-",he.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(er*3),"-",this.dry?he.yellow("SKIPPED |"):he.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(er*3),"-",this.dry?he.yellow("SKIPPED |"):he.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};u();import Dm from"execa";import gm from"ora";import{satisfies as Em}from"semver";var Vc={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 ym(r){let{version:e,name:t}=r;return e?Vc[t].find(s=>Em(e,s.semver)):Vc[t].find(s=>s.default)}async function Kc(r){let{to:e,logger:t,options:s}=r,i=t!=null?t:new js(s),n=ym(e);if(!n)throw new R("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=gm({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await Dm(n.command,n.installArgs,{cwd:r.project.paths.root}),o&&o.stop(),i.subStep("dependencies installed")}catch(a){throw i.subStepFailure("failed to install dependencies"),a}}}u();import Am from"chalk";async function vg({project:r,convertTo:e,logger:t,options:s}){if(t.header(`Converting project from ${r.packageManager} to ${e.name}.`),r.packageManager===e.name)throw new R("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new R(`${e.name} is not installed, or could not be located`,{type:"package_manager-could_not_be_found"});let i=e;await wt[r.packageManager].remove({project:r,to:i,logger:t,options:s}),await wt[i.name].create({project:r,to:i,logger:t,options:s}),t.mainStep("Installing dependencies"),s!=null&&s.skipInstall?t.subStep(Am.yellow("Skipping install")):(await wt[i.name].convertLock({project:r,to:i,logger:t,options:s}),await Kc({project:r,to:i,logger:t,options:s})),t.mainStep(`Cleaning up ${r.packageManager} workspaces`),await wt[r.packageManager].clean({project:r,logger:t})}export{u as a,Rr as b,gl as c,R as d,Mc as e,wt as f,dg as g,js as h,ym as i,Kc as j,vg as k};
|
|
8
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|