@turbo/workspaces 2.3.4-canary.2 → 2.3.4-canary.4
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-RIIPC7UD.mjs → chunk-WVVC4IHO.mjs} +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.mjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var yl=Object.create;var Pr=Object.defineProperty;var Al=Object.getOwnPropertyDescriptor;var Cl=Object.getOwnPropertyNames;var wl=Object.getPrototypeOf,Fl=Object.prototype.hasOwnProperty;var bl=(r,e)=>()=>(r&&(e=r(r=0)),e);var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Sl=(r,e)=>{for(var t in e)Pr(r,t,{get:e[t],enumerable:!0})},oo=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Cl(e))!Fl.call(r,i)&&i!==t&&Pr(r,i,{get:()=>e[i],enumerable:!(s=Al(e,i))||s.enumerable});return r};var R=(r,e,t)=>(t=r!=null?yl(wl(r)):{},oo(e||!r||!r.__esModule?Pr(t,"default",{value:r,enumerable:!0}):t,r)),kl=r=>oo(Pr({},"__esModule",{value:!0}),r);var u=bl(()=>{});var uo=E((Cm,ke)=>{u();function Xs(r){return ke.exports=Xs=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},ke.exports.__esModule=!0,ke.exports.default=ke.exports,Xs(r)}ke.exports=Xs,ke.exports.__esModule=!0,ke.exports.default=ke.exports});var lo=E((wm,_e)=>{u();var ao=uo().default;function co(){"use strict";_e.exports=co=function(){return e},_e.exports.__esModule=!0,_e.exports.default=_e.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(g,p,d){g[p]=d.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(g,p,d){return Object.defineProperty(g,p,{value:d,enumerable:!0,configurable:!0,writable:!0}),g[p]}try{c({},"")}catch{c=function(d,y,w){return d[y]=w}}function h(g,p,d,y){var w=p&&p.prototype instanceof x?p:x,C=Object.create(w.prototype),P=new Ks(y||[]);return i(C,"_invoke",{value:gl(g,d,P)}),C}function m(g,p,d){try{return{type:"normal",arg:g.call(p,d)}}catch(y){return{type:"throw",arg:y}}}e.wrap=h;var D="suspendedStart",A="suspendedYield",F="executing",T="completed",b={};function x(){}function lt(){}function de(){}var Js={};c(Js,o,function(){return this});var Vs=Object.getPrototypeOf,Or=Vs&&Vs(Vs(Zs([])));Or&&Or!==t&&s.call(Or,o)&&(Js=Or);var vt=de.prototype=x.prototype=Object.create(Js);function io(g){["next","throw","return"].forEach(function(p){c(g,p,function(d){return this._invoke(p,d)})})}function Tr(g,p){function d(w,C,P,H){var V=m(g[w],g,C);if(V.type!=="throw"){var ht=V.arg,Ge=ht.value;return Ge&&ao(Ge)=="object"&&s.call(Ge,"__await")?p.resolve(Ge.__await).then(function(ft){d("next",ft,P,H)},function(ft){d("throw",ft,P,H)}):p.resolve(Ge).then(function(ft){ht.value=ft,P(ht)},function(ft){return d("throw",ft,P,H)})}H(V.arg)}var y;i(this,"_invoke",{value:function(C,P){function H(){return new p(function(V,ht){d(C,P,V,ht)})}return y=y?y.then(H,H):H()}})}function gl(g,p,d){var y=D;return function(w,C){if(y===F)throw new Error("Generator is already running");if(y===T){if(w==="throw")throw C;return{value:r,done:!0}}for(d.method=w,d.arg=C;;){var P=d.delegate;if(P){var H=no(P,d);if(H){if(H===b)continue;return H}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(y===D)throw y=T,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);y=F;var V=m(g,p,d);if(V.type==="normal"){if(y=d.done?T:A,V.arg===b)continue;return{value:V.arg,done:d.done}}V.type==="throw"&&(y=T,d.method="throw",d.arg=V.arg)}}}function no(g,p){var d=p.method,y=g.iterator[d];if(y===r)return p.delegate=null,d==="throw"&&g.iterator.return&&(p.method="return",p.arg=r,no(g,p),p.method==="throw")||d!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+d+"' method")),b;var w=m(y,g.iterator,p.arg);if(w.type==="throw")return p.method="throw",p.arg=w.arg,p.delegate=null,b;var C=w.arg;return C?C.done?(p[g.resultName]=C.value,p.next=g.nextLoc,p.method!=="return"&&(p.method="next",p.arg=r),p.delegate=null,b):C:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,b)}function El(g){var p={tryLoc:g[0]};1 in g&&(p.catchLoc=g[1]),2 in g&&(p.finallyLoc=g[2],p.afterLoc=g[3]),this.tryEntries.push(p)}function Ys(g){var p=g.completion||{};p.type="normal",delete p.arg,g.completion=p}function Ks(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(El,this),this.reset(!0)}function Zs(g){if(g||g===""){var p=g[o];if(p)return p.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var d=-1,y=function w(){for(;++d<g.length;)if(s.call(g,d))return w.value=g[d],w.done=!1,w;return w.value=r,w.done=!0,w};return y.next=y}}throw new TypeError(ao(g)+" is not iterable")}return lt.prototype=de,i(vt,"constructor",{value:de,configurable:!0}),i(de,"constructor",{value:lt,configurable:!0}),lt.displayName=c(de,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var p=typeof g=="function"&&g.constructor;return!!p&&(p===lt||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,de):(g.__proto__=de,c(g,l,"GeneratorFunction")),g.prototype=Object.create(vt),g},e.awrap=function(g){return{__await:g}},io(Tr.prototype),c(Tr.prototype,a,function(){return this}),e.AsyncIterator=Tr,e.async=function(g,p,d,y,w){w===void 0&&(w=Promise);var C=new Tr(h(g,p,d,y),w);return e.isGeneratorFunction(p)?C:C.next().then(function(P){return P.done?P.value:C.next()})},io(vt),c(vt,l,"Generator"),c(vt,o,function(){return this}),c(vt,"toString",function(){return"[object Generator]"}),e.keys=function(g){var p=Object(g),d=[];for(var y in p)d.push(y);return d.reverse(),function w(){for(;d.length;){var C=d.pop();if(C in p)return w.value=C,w.done=!1,w}return w.done=!0,w}},e.values=Zs,Ks.prototype={constructor:Ks,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Ys),!p)for(var d in this)d.charAt(0)==="t"&&s.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=r)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function y(ht,Ge){return P.type="throw",P.arg=p,d.next=ht,Ge&&(d.method="next",d.arg=r),!!Ge}for(var w=this.tryEntries.length-1;w>=0;--w){var C=this.tryEntries[w],P=C.completion;if(C.tryLoc==="root")return y("end");if(C.tryLoc<=this.prev){var H=s.call(C,"catchLoc"),V=s.call(C,"finallyLoc");if(H&&V){if(this.prev<C.catchLoc)return y(C.catchLoc,!0);if(this.prev<C.finallyLoc)return y(C.finallyLoc)}else if(H){if(this.prev<C.catchLoc)return y(C.catchLoc,!0)}else{if(!V)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return y(C.finallyLoc)}}}},abrupt:function(p,d){for(var y=this.tryEntries.length-1;y>=0;--y){var w=this.tryEntries[y];if(w.tryLoc<=this.prev&&s.call(w,"finallyLoc")&&this.prev<w.finallyLoc){var C=w;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=d&&d<=C.finallyLoc&&(C=null);var P=C?C.completion:{};return P.type=p,P.arg=d,C?(this.method="next",this.next=C.finallyLoc,b):this.complete(P)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),b},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.finallyLoc===p)return this.complete(y.completion,y.afterLoc),Ys(y),b}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.tryLoc===p){var w=y.completion;if(w.type==="throw"){var C=w.arg;Ys(y)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,y){return this.delegate={iterator:Zs(p),resultName:d,nextLoc:y},this.method==="next"&&(this.arg=r),b}},e}_e.exports=co,_e.exports.__esModule=!0,_e.exports.default=_e.exports});var fo=E((Fm,ho)=>{u();var Lr=lo()();ho.exports=Lr;try{regeneratorRuntime=Lr}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Lr:Function("r","regeneratorRuntime = r")(Lr)}});var mo=E((Gm,ni)=>{"use strict";u();var po=(r,...e)=>new Promise(t=>{t(r(...e))});ni.exports=po;ni.exports.default=po});var go=E((Hm,oi)=>{"use strict";u();var _l=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=_l(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};oi.exports=Do;oi.exports.default=Do});var Ao=E((Jm,ui)=>{"use strict";u();var Eo=go(),Nr=class extends Error{constructor(e){super(),this.value=e}},Rl=async(r,e)=>e(await r),vl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new Nr(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(Rl,o,e)]),n=Eo(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(vl,o)))}catch(o){if(o instanceof Nr)return o.value;throw o}};ui.exports=yo;ui.exports.default=yo});var ko=E((Vm,ai)=>{"use strict";u();var Co=require("path"),Mr=require("fs"),{promisify:wo}=require("util"),Bl=Ao(),xl=wo(Mr.stat),Ol=wo(Mr.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]]();ai.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},bo(e);let t=e.allowSymlinks?xl:Ol;return Bl(r,async s=>{try{let i=await t(Co.resolve(e.cwd,s));return So(e.type,i)}catch{return!1}},e)};ai.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},bo(e);let t=e.allowSymlinks?Mr.statSync:Mr.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=E((Ym,ci)=>{"use strict";u();var _o=require("fs"),{promisify:Tl}=require("util"),Pl=Tl(_o.access);ci.exports=async r=>{try{return await Pl(r),!0}catch{return!1}};ci.exports.sync=r=>{try{return _o.accessSync(r),!0}catch{return!1}}});var Bo=E((Km,xt)=>{"use strict";u();var He=require("path"),Ir=ko(),vo=Ro(),li=Symbol("findUp.stop");xt.exports=async(r,e={})=>{let t=He.resolve(e.cwd||""),{root:s}=He.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Ir(i,o);let a=await r(o.cwd);return typeof a=="string"?Ir([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===li)return;if(o)return He.resolve(t,o);if(t===s)return;t=He.dirname(t)}};xt.exports.sync=(r,e={})=>{let t=He.resolve(e.cwd||""),{root:s}=He.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Ir.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Ir.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===li)return;if(o)return He.resolve(t,o);if(t===s)return;t=He.dirname(t)}};xt.exports.exists=vo;xt.exports.sync.exists=vo.sync;xt.exports.stop=li});var Tt=E((Sd,qo)=>{"use strict";u();var Io=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"]]);qo.exports=r=>r?Object.keys(r).map(e=>[Io.has(e)?Io.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Gr=E((kd,Vo)=>{"use strict";u();var jo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ql=require("events"),Uo=require("stream"),$o=require("string_decoder").StringDecoder,ve=Symbol("EOF"),Be=Symbol("maybeEmitEnd"),Je=Symbol("emittedEnd"),jr=Symbol("emittingEnd"),lr=Symbol("emittedError"),Ur=Symbol("closed"),zo=Symbol("read"),$r=Symbol("flush"),Wo=Symbol("flushChunk"),Y=Symbol("encoding"),xe=Symbol("decoder"),zr=Symbol("flowing"),hr=Symbol("paused"),Pt=Symbol("resume"),L=Symbol("buffer"),De=Symbol("pipes"),I=Symbol("bufferLength"),mi=Symbol("bufferPush"),di=Symbol("bufferShift"),U=Symbol("objectMode"),$=Symbol("destroyed"),Di=Symbol("emitData"),Go=Symbol("emitEnd"),gi=Symbol("emitEnd2"),Oe=Symbol("async"),fr=r=>Promise.resolve().then(r),Ho=global._MP_NO_ITERATOR_SYMBOLS_!=="1",eh=Ho&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),th=Ho&&Symbol.iterator||Symbol("iterator not implemented"),rh=r=>r==="end"||r==="finish"||r==="prefinish",sh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ih=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Wr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Pt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ei=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)}};Vo.exports=class Jo extends Uo{constructor(e){super(),this[zr]=!1,this[hr]=!1,this[De]=[],this[L]=[],this[U]=e&&e.objectMode||!1,this[U]?this[Y]=null:this[Y]=e&&e.encoding||null,this[Y]==="buffer"&&(this[Y]=null),this[Oe]=e&&!!e.async||!1,this[xe]=this[Y]?new $o(this[Y]):null,this[ve]=!1,this[Je]=!1,this[jr]=!1,this[Ur]=!1,this[lr]=null,this.writable=!0,this.readable=!0,this[I]=0,this[$]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[De]})}get bufferLength(){return this[I]}get encoding(){return this[Y]}set encoding(e){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[Y]&&e!==this[Y]&&(this[xe]&&this[xe].lastNeed||this[I]))throw new Error("cannot change encoding");this[Y]!==e&&(this[xe]=e?new $o(e):null,this[L].length&&(this[L]=this[L].map(t=>this[xe].write(t)))),this[Y]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[U]}set objectMode(e){this[U]=this[U]||!!e}get async(){return this[Oe]}set async(e){this[Oe]=this[Oe]||!!e}write(e,t,s){if(this[ve])throw new Error("write after end");if(this[$])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Oe]?fr:n=>n();return!this[U]&&!Buffer.isBuffer(e)&&(ih(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):sh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[I]!==0&&this[$r](!0),this.flowing?this.emit("data",e):this[mi](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[Y]&&!this[xe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Y]&&(e=this[xe].write(e)),this.flowing&&this[I]!==0&&this[$r](!0),this.flowing?this.emit("data",e):this[mi](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[$])return null;if(this[I]===0||e===0||e>this[I])return this[Be](),null;this[U]&&(e=null),this[L].length>1&&!this[U]&&(this.encoding?this[L]=[this[L].join("")]:this[L]=[Buffer.concat(this[L],this[I])]);let t=this[zo](e||null,this[L][0]);return this[Be](),t}[zo](e,t){return e===t.length||e===null?this[di]():(this[L][0]=t.slice(e),t=t.slice(0,e),this[I]-=e),this.emit("data",t),!this[L].length&&!this[ve]&&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[ve]=!0,this.writable=!1,(this.flowing||!this[hr])&&this[Be](),this}[Pt](){this[$]||(this[hr]=!1,this[zr]=!0,this.emit("resume"),this[L].length?this[$r]():this[ve]?this[Be]():this.emit("drain"))}resume(){return this[Pt]()}pause(){this[zr]=!1,this[hr]=!0}get destroyed(){return this[$]}get flowing(){return this[zr]}get paused(){return this[hr]}[mi](e){this[U]?this[I]+=1:this[I]+=e.length,this[L].push(e)}[di](){return this[L].length&&(this[U]?this[I]-=1:this[I]-=this[L][0].length),this[L].shift()}[$r](e){do;while(this[Wo](this[di]()));!e&&!this[L].length&&!this[ve]&&this.emit("drain")}[Wo](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[$])return;let s=this[Je];return t=t||{},e===jo.stdout||e===jo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[De].push(t.proxyErrors?new Ei(this,e,t):new Wr(this,e,t)),this[Oe]?fr(()=>this[Pt]()):this[Pt]()),e}unpipe(e){let t=this[De].find(s=>s.dest===e);t&&(this[De].splice(this[De].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this[De].length&&!this.flowing?this[Pt]():e==="readable"&&this[I]!==0?super.emit("readable"):rh(e)&&this[Je]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[lr]&&(this[Oe]?fr(()=>t.call(this,this[lr])):t.call(this,this[lr])),s}get emittedEnd(){return this[Je]}[Be](){!this[jr]&&!this[Je]&&!this[$]&&this[L].length===0&&this[ve]&&(this[jr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ur]&&this.emit("close"),this[jr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==$&&this[$])return;if(e==="data")return t?this[Oe]?fr(()=>this[Di](t)):this[Di](t):!1;if(e==="end")return this[Go]();if(e==="close"){if(this[Ur]=!0,!this[Je]&&!this[$])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[lr]=t;let n=super.emit("error",t);return this[Be](),n}else if(e==="resume"){let n=super.emit("resume");return this[Be](),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[Be](),i}[Di](e){for(let s of this[De])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Be](),t}[Go](){this[Je]||(this[Je]=!0,this.readable=!1,this[Oe]?fr(()=>this[gi]()):this[gi]())}[gi](){if(this[xe]){let t=this[xe].end();if(t){for(let s of this[De])s.dest.write(t);super.emit("data",t)}}for(let t of this[De])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[U]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[U]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[U]?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($,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[eh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ve])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[ve]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once($,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[th](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[$]?(e?this.emit("error",e):this.emit($),this):(this[$]=!0,this[L].length=0,this[I]=0,typeof this.close=="function"&&!this[Ur]&&this.close(),e?this.emit("error",e):this.emit($),this)}static isStream(e){return!!e&&(e instanceof Jo||e instanceof Uo||e instanceof Ql&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Ko=E((_d,Yo)=>{u();var nh=require("zlib").constants||{ZLIB_VERNUM:4736};Yo.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},nh))});var bi=E((Rd,nu)=>{"use strict";u();var Zo=typeof process=="object"&&process?process:{stdout:null,stderr:null},oh=require("events"),Xo=require("stream"),Qo=require("string_decoder").StringDecoder,Te=Symbol("EOF"),Pe=Symbol("maybeEmitEnd"),Ve=Symbol("emittedEnd"),Hr=Symbol("emittingEnd"),pr=Symbol("emittedError"),Jr=Symbol("closed"),eu=Symbol("read"),Vr=Symbol("flush"),tu=Symbol("flushChunk"),K=Symbol("encoding"),Le=Symbol("decoder"),Yr=Symbol("flowing"),mr=Symbol("paused"),Lt=Symbol("resume"),q=Symbol("bufferLength"),yi=Symbol("bufferPush"),Ai=Symbol("bufferShift"),z=Symbol("objectMode"),W=Symbol("destroyed"),Ci=Symbol("emitData"),ru=Symbol("emitEnd"),wi=Symbol("emitEnd2"),Ne=Symbol("async"),dr=r=>Promise.resolve().then(r),su=global._MP_NO_ITERATOR_SYMBOLS_!=="1",uh=su&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),ah=su&&Symbol.iterator||Symbol("iterator not implemented"),ch=r=>r==="end"||r==="finish"||r==="prefinish",lh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,hh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Kr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Lt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Fi=class extends Kr{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)}};nu.exports=class iu extends Xo{constructor(e){super(),this[Yr]=!1,this[mr]=!1,this.pipes=[],this.buffer=[],this[z]=e&&e.objectMode||!1,this[z]?this[K]=null:this[K]=e&&e.encoding||null,this[K]==="buffer"&&(this[K]=null),this[Ne]=e&&!!e.async||!1,this[Le]=this[K]?new Qo(this[K]):null,this[Te]=!1,this[Ve]=!1,this[Hr]=!1,this[Jr]=!1,this[pr]=null,this.writable=!0,this.readable=!0,this[q]=0,this[W]=!1}get bufferLength(){return this[q]}get encoding(){return this[K]}set encoding(e){if(this[z])throw new Error("cannot set encoding in objectMode");if(this[K]&&e!==this[K]&&(this[Le]&&this[Le].lastNeed||this[q]))throw new Error("cannot change encoding");this[K]!==e&&(this[Le]=e?new Qo(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Le].write(t)))),this[K]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[z]}set objectMode(e){this[z]=this[z]||!!e}get async(){return this[Ne]}set async(e){this[Ne]=this[Ne]||!!e}write(e,t,s){if(this[Te])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[Ne]?dr:n=>n();return!this[z]&&!Buffer.isBuffer(e)&&(hh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):lh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[z]?(this.flowing&&this[q]!==0&&this[Vr](!0),this.flowing?this.emit("data",e):this[yi](e),this[q]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[K]&&!this[Le].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[K]&&(e=this[Le].write(e)),this.flowing&&this[q]!==0&&this[Vr](!0),this.flowing?this.emit("data",e):this[yi](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[W])return null;if(this[q]===0||e===0||e>this[q])return this[Pe](),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[q])]);let t=this[eu](e||null,this.buffer[0]);return this[Pe](),t}[eu](e,t){return e===t.length||e===null?this[Ai]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[q]-=e),this.emit("data",t),!this.buffer.length&&!this[Te]&&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[Te]=!0,this.writable=!1,(this.flowing||!this[mr])&&this[Pe](),this}[Lt](){this[W]||(this[mr]=!1,this[Yr]=!0,this.emit("resume"),this.buffer.length?this[Vr]():this[Te]?this[Pe]():this.emit("drain"))}resume(){return this[Lt]()}pause(){this[Yr]=!1,this[mr]=!0}get destroyed(){return this[W]}get flowing(){return this[Yr]}get paused(){return this[mr]}[yi](e){this[z]?this[q]+=1:this[q]+=e.length,this.buffer.push(e)}[Ai](){return this.buffer.length&&(this[z]?this[q]-=1:this[q]-=this.buffer[0].length),this.buffer.shift()}[Vr](e){do;while(this[tu](this[Ai]()));!e&&!this.buffer.length&&!this[Te]&&this.emit("drain")}[tu](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[Ve];return t=t||{},e===Zo.stdout||e===Zo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new Fi(this,e,t):new Kr(this,e,t)),this[Ne]?dr(()=>this[Lt]()):this[Lt]()),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[Lt]():e==="readable"&&this[q]!==0?super.emit("readable"):ch(e)&&this[Ve]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[pr]&&(this[Ne]?dr(()=>t.call(this,this[pr])):t.call(this,this[pr])),s}get emittedEnd(){return this[Ve]}[Pe](){!this[Hr]&&!this[Ve]&&!this[W]&&this.buffer.length===0&&this[Te]&&(this[Hr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Jr]&&this.emit("close"),this[Hr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[Ne]?dr(()=>this[Ci](t)):this[Ci](t):!1;if(e==="end")return this[ru]();if(e==="close"){if(this[Jr]=!0,!this[Ve]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[pr]=t;let n=super.emit("error",t);return this[Pe](),n}else if(e==="resume"){let n=super.emit("resume");return this[Pe](),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[Pe](),i}[Ci](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Pe](),t}[ru](){this[Ve]||(this[Ve]=!0,this.readable=!1,this[Ne]?dr(()=>this[wi]()):this[wi]())}[wi](){if(this[Le]){let t=this[Le].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[K]?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())})}[uh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Te])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[Te]})},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)})}}}[ah](){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[q]=0,typeof this.close=="function"&&!this[Jr]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof iu||e instanceof Xo||e instanceof oh&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var ji=E(Q=>{"use strict";u();var vi=require("assert"),Ye=require("buffer").Buffer,au=require("zlib"),mt=Q.constants=Ko(),fh=bi(),ou=Ye.concat,dt=Symbol("_superWrite"),Mt=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"}},ph=Symbol("opts"),Dr=Symbol("flushFlag"),uu=Symbol("finishFlushFlag"),qi=Symbol("fullFlushFlag"),B=Symbol("handle"),Zr=Symbol("onError"),Nt=Symbol("sawError"),Si=Symbol("level"),ki=Symbol("strategy"),_i=Symbol("ended"),vd=Symbol("_defaultFullFlush"),Xr=class extends fh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Nt]=!1,this[_i]=!1,this[ph]=e,this[Dr]=e.flush,this[uu]=e.finishFlush;try{this[B]=new au[t](e)}catch(s){throw new Mt(s)}this[Zr]=s=>{this[Nt]||(this[Nt]=!0,this.close(),this.emit("error",s))},this[B].on("error",s=>this[Zr](new Mt(s))),this.once("end",()=>this.close)}close(){this[B]&&(this[B].close(),this[B]=null,this.emit("close"))}reset(){if(!this[Nt])return vi(this[B],"zlib binding closed"),this[B].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[qi]),this.write(Object.assign(Ye.alloc(0),{[Dr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[uu]),this[_i]=!0,super.end(null,null,s)}get ended(){return this[_i]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=Ye.from(e,t)),this[Nt])return;vi(this[B],"zlib binding closed");let i=this[B]._handle,n=i.close;i.close=()=>{};let o=this[B].close;this[B].close=()=>{},Ye.concat=c=>c;let a;try{let c=typeof e[Dr]=="number"?e[Dr]:this[Dr];a=this[B]._processChunk(e,c),Ye.concat=ou}catch(c){Ye.concat=ou,this[Zr](new Mt(c))}finally{this[B]&&(this[B]._handle=i,i.close=n,this[B].close=o,this[B].removeAllListeners("error"))}this[B]&&this[B].on("error",c=>this[Zr](new Mt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[dt](Ye.from(a[0]));for(let c=1;c<a.length;c++)l=this[dt](a[c])}else l=this[dt](Ye.from(a));return s&&s(),l}[dt](e){return super.write(e)}},Me=class extends Xr{constructor(e,t){e=e||{},e.flush=e.flush||mt.Z_NO_FLUSH,e.finishFlush=e.finishFlush||mt.Z_FINISH,super(e,t),this[qi]=mt.Z_FULL_FLUSH,this[Si]=e.level,this[ki]=e.strategy}params(e,t){if(!this[Nt]){if(!this[B])throw new Error("cannot switch params when binding is closed");if(!this[B].params)throw new Error("not supported in this implementation");if(this[Si]!==e||this[ki]!==t){this.flush(mt.Z_SYNC_FLUSH),vi(this[B],"zlib binding closed");let s=this[B].flush;this[B].flush=(i,n)=>{this.flush(i),n()};try{this[B].params(e,t)}finally{this[B].flush=s}this[B]&&(this[Si]=e,this[ki]=t)}}}},Bi=class extends Me{constructor(e){super(e,"Deflate")}},xi=class extends Me{constructor(e){super(e,"Inflate")}},Ri=Symbol("_portable"),Oi=class extends Me{constructor(e){super(e,"Gzip"),this[Ri]=e&&!!e.portable}[dt](e){return this[Ri]?(this[Ri]=!1,e[9]=255,super[dt](e)):super[dt](e)}},Ti=class extends Me{constructor(e){super(e,"Gunzip")}},Pi=class extends Me{constructor(e){super(e,"DeflateRaw")}},Li=class extends Me{constructor(e){super(e,"InflateRaw")}},Ni=class extends Me{constructor(e){super(e,"Unzip")}},Qr=class extends Xr{constructor(e,t){e=e||{},e.flush=e.flush||mt.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||mt.BROTLI_OPERATION_FINISH,super(e,t),this[qi]=mt.BROTLI_OPERATION_FLUSH}},Mi=class extends Qr{constructor(e){super(e,"BrotliCompress")}},Ii=class extends Qr{constructor(e){super(e,"BrotliDecompress")}};Q.Deflate=Bi;Q.Inflate=xi;Q.Gzip=Oi;Q.Gunzip=Ti;Q.DeflateRaw=Pi;Q.InflateRaw=Li;Q.Unzip=Ni;typeof au.BrotliCompress=="function"?(Q.BrotliCompress=Mi,Q.BrotliDecompress=Ii):Q.BrotliCompress=Q.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var It=E((Od,cu)=>{u();var mh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;cu.exports=mh!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var es=E((Pd,lu)=>{"use strict";u();var dh=Gr(),Ui=It(),$i=Symbol("slurp");lu.exports=class extends dh{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=Ui(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=Ui(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[$i](t),s&&this[$i](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))}[$i](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?Ui(e[s]):e[s])}}});var zi=E(ts=>{"use strict";u();ts.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"]]);ts.code=new Map(Array.from(ts.name).map(r=>[r[1],r[0]]))});var mu=E((Nd,pu)=>{"use strict";u();var Dh=(r,e)=>{if(Number.isSafeInteger(r))r<0?Eh(r,e):gh(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},gh=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Eh=(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]=hu(i):i===0?e[s-1]=0:(t=!0,e[s-1]=fu(i))}},yh=r=>{let e=r[0],t=e===128?Ch(r.slice(1,r.length)):e===255?Ah(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},Ah=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=hu(n):n===0?o=n:(s=!0,o=fu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},Ch=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},hu=r=>(255^r)&255,fu=r=>(255^r)+1&255;pu.exports={encode:Dh,parse:yh}});var jt=E((Md,Du)=>{"use strict";u();var Wi=zi(),qt=require("path").posix,du=mu(),Gi=Symbol("slurp"),ee=Symbol("type"),Vi=class{constructor(e,t,s,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[ee]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,s,i):e&&this.set(e)}decode(e,t,s,i){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=Dt(e,t,100),this.mode=Ke(e,t+100,8),this.uid=Ke(e,t+108,8),this.gid=Ke(e,t+116,8),this.size=Ke(e,t+124,12),this.mtime=Hi(e,t+136,12),this.cksum=Ke(e,t+148,12),this[Gi](s),this[Gi](i,!0),this[ee]=Dt(e,t+156,1),this[ee]===""&&(this[ee]="0"),this[ee]==="0"&&this.path.slice(-1)==="/"&&(this[ee]="5"),this[ee]==="5"&&(this.size=0),this.linkpath=Dt(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=Dt(e,t+265,32),this.gname=Dt(e,t+297,32),this.devmaj=Ke(e,t+329,8),this.devmin=Ke(e,t+337,8),e[t+475]!==0){let o=Dt(e,t+345,155);this.path=o+"/"+this.path}else{let o=Dt(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Hi(e,t+476,12),this.ctime=Hi(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)}[Gi](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=wh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=gt(e,t,100,n)||this.needPax,this.needPax=Ze(e,t+100,8,this.mode)||this.needPax,this.needPax=Ze(e,t+108,8,this.uid)||this.needPax,this.needPax=Ze(e,t+116,8,this.gid)||this.needPax,this.needPax=Ze(e,t+124,12,this.size)||this.needPax,this.needPax=Ji(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[ee].charCodeAt(0),this.needPax=gt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=gt(e,t+265,32,this.uname)||this.needPax,this.needPax=gt(e,t+297,32,this.gname)||this.needPax,this.needPax=Ze(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ze(e,t+337,8,this.devmin)||this.needPax,this.needPax=gt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=gt(e,t+345,155,o)||this.needPax:(this.needPax=gt(e,t+345,130,o)||this.needPax,this.needPax=Ji(e,t+476,12,this.atime)||this.needPax,this.needPax=Ji(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,Ze(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 Wi.name.get(this[ee])||this[ee]}get typeKey(){return this[ee]}set type(e){Wi.code.has(e)?this[ee]=Wi.code.get(e):this[ee]=e}},wh=(r,e)=>{let s=r,i="",n,o=qt.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=qt.dirname(s),s=qt.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=qt.join(qt.basename(i),s),i=qt.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},Dt=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Hi=(r,e,t)=>Fh(Ke(r,e,t)),Fh=r=>r===null?null:new Date(r*1e3),Ke=(r,e,t)=>r[e]&128?du.parse(r.slice(e,e+t)):Sh(r,e,t),bh=r=>isNaN(r)?null:r,Sh=(r,e,t)=>bh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),kh={12:8589934591,8:2097151},Ze=(r,e,t,s)=>s===null?!1:s>kh[t]||s<0?(du.encode(s,r.slice(e,e+t)),!0):(_h(r,e,t,s),!1),_h=(r,e,t,s)=>r.write(Rh(s,t),e,t,"ascii"),Rh=(r,e)=>vh(Math.floor(r).toString(8),e),vh=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",Ji=(r,e,t,s)=>s===null?!1:Ze(r,e,t,s.getTime()/1e3),Bh=new Array(156).join("\0"),gt=(r,e,t,s)=>s===null?!1:(r.write(s+Bh,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);Du.exports=Vi});var rs=E((Id,gu)=>{"use strict";u();var xh=jt(),Oh=require("path"),gr=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 xh({path:("PaxHeader/"+Oh.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+`
|
|
1
|
+
"use strict";var yl=Object.create;var Pr=Object.defineProperty;var Al=Object.getOwnPropertyDescriptor;var Cl=Object.getOwnPropertyNames;var wl=Object.getPrototypeOf,Fl=Object.prototype.hasOwnProperty;var bl=(r,e)=>()=>(r&&(e=r(r=0)),e);var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Sl=(r,e)=>{for(var t in e)Pr(r,t,{get:e[t],enumerable:!0})},oo=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Cl(e))!Fl.call(r,i)&&i!==t&&Pr(r,i,{get:()=>e[i],enumerable:!(s=Al(e,i))||s.enumerable});return r};var R=(r,e,t)=>(t=r!=null?yl(wl(r)):{},oo(e||!r||!r.__esModule?Pr(t,"default",{value:r,enumerable:!0}):t,r)),kl=r=>oo(Pr({},"__esModule",{value:!0}),r);var u=bl(()=>{});var uo=E((Cm,ke)=>{u();function Xs(r){return ke.exports=Xs=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},ke.exports.__esModule=!0,ke.exports.default=ke.exports,Xs(r)}ke.exports=Xs,ke.exports.__esModule=!0,ke.exports.default=ke.exports});var lo=E((wm,_e)=>{u();var ao=uo().default;function co(){"use strict";_e.exports=co=function(){return e},_e.exports.__esModule=!0,_e.exports.default=_e.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(g,p,d){g[p]=d.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(g,p,d){return Object.defineProperty(g,p,{value:d,enumerable:!0,configurable:!0,writable:!0}),g[p]}try{c({},"")}catch{c=function(d,y,w){return d[y]=w}}function h(g,p,d,y){var w=p&&p.prototype instanceof x?p:x,C=Object.create(w.prototype),P=new Ks(y||[]);return i(C,"_invoke",{value:gl(g,d,P)}),C}function m(g,p,d){try{return{type:"normal",arg:g.call(p,d)}}catch(y){return{type:"throw",arg:y}}}e.wrap=h;var D="suspendedStart",A="suspendedYield",F="executing",T="completed",b={};function x(){}function lt(){}function de(){}var Js={};c(Js,o,function(){return this});var Vs=Object.getPrototypeOf,Or=Vs&&Vs(Vs(Zs([])));Or&&Or!==t&&s.call(Or,o)&&(Js=Or);var Bt=de.prototype=x.prototype=Object.create(Js);function io(g){["next","throw","return"].forEach(function(p){c(g,p,function(d){return this._invoke(p,d)})})}function Tr(g,p){function d(w,C,P,H){var V=m(g[w],g,C);if(V.type!=="throw"){var ht=V.arg,Ge=ht.value;return Ge&&ao(Ge)=="object"&&s.call(Ge,"__await")?p.resolve(Ge.__await).then(function(ft){d("next",ft,P,H)},function(ft){d("throw",ft,P,H)}):p.resolve(Ge).then(function(ft){ht.value=ft,P(ht)},function(ft){return d("throw",ft,P,H)})}H(V.arg)}var y;i(this,"_invoke",{value:function(C,P){function H(){return new p(function(V,ht){d(C,P,V,ht)})}return y=y?y.then(H,H):H()}})}function gl(g,p,d){var y=D;return function(w,C){if(y===F)throw new Error("Generator is already running");if(y===T){if(w==="throw")throw C;return{value:r,done:!0}}for(d.method=w,d.arg=C;;){var P=d.delegate;if(P){var H=no(P,d);if(H){if(H===b)continue;return H}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(y===D)throw y=T,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);y=F;var V=m(g,p,d);if(V.type==="normal"){if(y=d.done?T:A,V.arg===b)continue;return{value:V.arg,done:d.done}}V.type==="throw"&&(y=T,d.method="throw",d.arg=V.arg)}}}function no(g,p){var d=p.method,y=g.iterator[d];if(y===r)return p.delegate=null,d==="throw"&&g.iterator.return&&(p.method="return",p.arg=r,no(g,p),p.method==="throw")||d!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+d+"' method")),b;var w=m(y,g.iterator,p.arg);if(w.type==="throw")return p.method="throw",p.arg=w.arg,p.delegate=null,b;var C=w.arg;return C?C.done?(p[g.resultName]=C.value,p.next=g.nextLoc,p.method!=="return"&&(p.method="next",p.arg=r),p.delegate=null,b):C:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,b)}function El(g){var p={tryLoc:g[0]};1 in g&&(p.catchLoc=g[1]),2 in g&&(p.finallyLoc=g[2],p.afterLoc=g[3]),this.tryEntries.push(p)}function Ys(g){var p=g.completion||{};p.type="normal",delete p.arg,g.completion=p}function Ks(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(El,this),this.reset(!0)}function Zs(g){if(g||g===""){var p=g[o];if(p)return p.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var d=-1,y=function w(){for(;++d<g.length;)if(s.call(g,d))return w.value=g[d],w.done=!1,w;return w.value=r,w.done=!0,w};return y.next=y}}throw new TypeError(ao(g)+" is not iterable")}return lt.prototype=de,i(Bt,"constructor",{value:de,configurable:!0}),i(de,"constructor",{value:lt,configurable:!0}),lt.displayName=c(de,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var p=typeof g=="function"&&g.constructor;return!!p&&(p===lt||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,de):(g.__proto__=de,c(g,l,"GeneratorFunction")),g.prototype=Object.create(Bt),g},e.awrap=function(g){return{__await:g}},io(Tr.prototype),c(Tr.prototype,a,function(){return this}),e.AsyncIterator=Tr,e.async=function(g,p,d,y,w){w===void 0&&(w=Promise);var C=new Tr(h(g,p,d,y),w);return e.isGeneratorFunction(p)?C:C.next().then(function(P){return P.done?P.value:C.next()})},io(Bt),c(Bt,l,"Generator"),c(Bt,o,function(){return this}),c(Bt,"toString",function(){return"[object Generator]"}),e.keys=function(g){var p=Object(g),d=[];for(var y in p)d.push(y);return d.reverse(),function w(){for(;d.length;){var C=d.pop();if(C in p)return w.value=C,w.done=!1,w}return w.done=!0,w}},e.values=Zs,Ks.prototype={constructor:Ks,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Ys),!p)for(var d in this)d.charAt(0)==="t"&&s.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=r)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function y(ht,Ge){return P.type="throw",P.arg=p,d.next=ht,Ge&&(d.method="next",d.arg=r),!!Ge}for(var w=this.tryEntries.length-1;w>=0;--w){var C=this.tryEntries[w],P=C.completion;if(C.tryLoc==="root")return y("end");if(C.tryLoc<=this.prev){var H=s.call(C,"catchLoc"),V=s.call(C,"finallyLoc");if(H&&V){if(this.prev<C.catchLoc)return y(C.catchLoc,!0);if(this.prev<C.finallyLoc)return y(C.finallyLoc)}else if(H){if(this.prev<C.catchLoc)return y(C.catchLoc,!0)}else{if(!V)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return y(C.finallyLoc)}}}},abrupt:function(p,d){for(var y=this.tryEntries.length-1;y>=0;--y){var w=this.tryEntries[y];if(w.tryLoc<=this.prev&&s.call(w,"finallyLoc")&&this.prev<w.finallyLoc){var C=w;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=d&&d<=C.finallyLoc&&(C=null);var P=C?C.completion:{};return P.type=p,P.arg=d,C?(this.method="next",this.next=C.finallyLoc,b):this.complete(P)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),b},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.finallyLoc===p)return this.complete(y.completion,y.afterLoc),Ys(y),b}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.tryLoc===p){var w=y.completion;if(w.type==="throw"){var C=w.arg;Ys(y)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,y){return this.delegate={iterator:Zs(p),resultName:d,nextLoc:y},this.method==="next"&&(this.arg=r),b}},e}_e.exports=co,_e.exports.__esModule=!0,_e.exports.default=_e.exports});var fo=E((Fm,ho)=>{u();var Lr=lo()();ho.exports=Lr;try{regeneratorRuntime=Lr}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Lr:Function("r","regeneratorRuntime = r")(Lr)}});var mo=E((Gm,ni)=>{"use strict";u();var po=(r,...e)=>new Promise(t=>{t(r(...e))});ni.exports=po;ni.exports.default=po});var go=E((Hm,oi)=>{"use strict";u();var _l=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=_l(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};oi.exports=Do;oi.exports.default=Do});var Ao=E((Jm,ui)=>{"use strict";u();var Eo=go(),Nr=class extends Error{constructor(e){super(),this.value=e}},Rl=async(r,e)=>e(await r),Bl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new Nr(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(Rl,o,e)]),n=Eo(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(Bl,o)))}catch(o){if(o instanceof Nr)return o.value;throw o}};ui.exports=yo;ui.exports.default=yo});var ko=E((Vm,ai)=>{"use strict";u();var Co=require("path"),Mr=require("fs"),{promisify:wo}=require("util"),vl=Ao(),xl=wo(Mr.stat),Ol=wo(Mr.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]]();ai.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},bo(e);let t=e.allowSymlinks?xl:Ol;return vl(r,async s=>{try{let i=await t(Co.resolve(e.cwd,s));return So(e.type,i)}catch{return!1}},e)};ai.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},bo(e);let t=e.allowSymlinks?Mr.statSync:Mr.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=E((Ym,ci)=>{"use strict";u();var _o=require("fs"),{promisify:Tl}=require("util"),Pl=Tl(_o.access);ci.exports=async r=>{try{return await Pl(r),!0}catch{return!1}};ci.exports.sync=r=>{try{return _o.accessSync(r),!0}catch{return!1}}});var vo=E((Km,xt)=>{"use strict";u();var He=require("path"),Ir=ko(),Bo=Ro(),li=Symbol("findUp.stop");xt.exports=async(r,e={})=>{let t=He.resolve(e.cwd||""),{root:s}=He.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Ir(i,o);let a=await r(o.cwd);return typeof a=="string"?Ir([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===li)return;if(o)return He.resolve(t,o);if(t===s)return;t=He.dirname(t)}};xt.exports.sync=(r,e={})=>{let t=He.resolve(e.cwd||""),{root:s}=He.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Ir.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Ir.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===li)return;if(o)return He.resolve(t,o);if(t===s)return;t=He.dirname(t)}};xt.exports.exists=Bo;xt.exports.sync.exists=Bo.sync;xt.exports.stop=li});var Tt=E((Sd,qo)=>{"use strict";u();var Io=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"]]);qo.exports=r=>r?Object.keys(r).map(e=>[Io.has(e)?Io.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Gr=E((kd,Vo)=>{"use strict";u();var Uo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ql=require("events"),jo=require("stream"),$o=require("string_decoder").StringDecoder,Be=Symbol("EOF"),ve=Symbol("maybeEmitEnd"),Je=Symbol("emittedEnd"),Ur=Symbol("emittingEnd"),lr=Symbol("emittedError"),jr=Symbol("closed"),zo=Symbol("read"),$r=Symbol("flush"),Wo=Symbol("flushChunk"),Y=Symbol("encoding"),xe=Symbol("decoder"),zr=Symbol("flowing"),hr=Symbol("paused"),Pt=Symbol("resume"),L=Symbol("buffer"),De=Symbol("pipes"),I=Symbol("bufferLength"),mi=Symbol("bufferPush"),di=Symbol("bufferShift"),j=Symbol("objectMode"),$=Symbol("destroyed"),Di=Symbol("emitData"),Go=Symbol("emitEnd"),gi=Symbol("emitEnd2"),Oe=Symbol("async"),fr=r=>Promise.resolve().then(r),Ho=global._MP_NO_ITERATOR_SYMBOLS_!=="1",eh=Ho&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),th=Ho&&Symbol.iterator||Symbol("iterator not implemented"),rh=r=>r==="end"||r==="finish"||r==="prefinish",sh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ih=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Wr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Pt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ei=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)}};Vo.exports=class Jo extends jo{constructor(e){super(),this[zr]=!1,this[hr]=!1,this[De]=[],this[L]=[],this[j]=e&&e.objectMode||!1,this[j]?this[Y]=null:this[Y]=e&&e.encoding||null,this[Y]==="buffer"&&(this[Y]=null),this[Oe]=e&&!!e.async||!1,this[xe]=this[Y]?new $o(this[Y]):null,this[Be]=!1,this[Je]=!1,this[Ur]=!1,this[jr]=!1,this[lr]=null,this.writable=!0,this.readable=!0,this[I]=0,this[$]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[De]})}get bufferLength(){return this[I]}get encoding(){return this[Y]}set encoding(e){if(this[j])throw new Error("cannot set encoding in objectMode");if(this[Y]&&e!==this[Y]&&(this[xe]&&this[xe].lastNeed||this[I]))throw new Error("cannot change encoding");this[Y]!==e&&(this[xe]=e?new $o(e):null,this[L].length&&(this[L]=this[L].map(t=>this[xe].write(t)))),this[Y]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[j]}set objectMode(e){this[j]=this[j]||!!e}get async(){return this[Oe]}set async(e){this[Oe]=this[Oe]||!!e}write(e,t,s){if(this[Be])throw new Error("write after end");if(this[$])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Oe]?fr:n=>n();return!this[j]&&!Buffer.isBuffer(e)&&(ih(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):sh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[j]?(this.flowing&&this[I]!==0&&this[$r](!0),this.flowing?this.emit("data",e):this[mi](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[Y]&&!this[xe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Y]&&(e=this[xe].write(e)),this.flowing&&this[I]!==0&&this[$r](!0),this.flowing?this.emit("data",e):this[mi](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[$])return null;if(this[I]===0||e===0||e>this[I])return this[ve](),null;this[j]&&(e=null),this[L].length>1&&!this[j]&&(this.encoding?this[L]=[this[L].join("")]:this[L]=[Buffer.concat(this[L],this[I])]);let t=this[zo](e||null,this[L][0]);return this[ve](),t}[zo](e,t){return e===t.length||e===null?this[di]():(this[L][0]=t.slice(e),t=t.slice(0,e),this[I]-=e),this.emit("data",t),!this[L].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[hr])&&this[ve](),this}[Pt](){this[$]||(this[hr]=!1,this[zr]=!0,this.emit("resume"),this[L].length?this[$r]():this[Be]?this[ve]():this.emit("drain"))}resume(){return this[Pt]()}pause(){this[zr]=!1,this[hr]=!0}get destroyed(){return this[$]}get flowing(){return this[zr]}get paused(){return this[hr]}[mi](e){this[j]?this[I]+=1:this[I]+=e.length,this[L].push(e)}[di](){return this[L].length&&(this[j]?this[I]-=1:this[I]-=this[L][0].length),this[L].shift()}[$r](e){do;while(this[Wo](this[di]()));!e&&!this[L].length&&!this[Be]&&this.emit("drain")}[Wo](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[$])return;let s=this[Je];return t=t||{},e===Uo.stdout||e===Uo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[De].push(t.proxyErrors?new Ei(this,e,t):new Wr(this,e,t)),this[Oe]?fr(()=>this[Pt]()):this[Pt]()),e}unpipe(e){let t=this[De].find(s=>s.dest===e);t&&(this[De].splice(this[De].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this[De].length&&!this.flowing?this[Pt]():e==="readable"&&this[I]!==0?super.emit("readable"):rh(e)&&this[Je]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[lr]&&(this[Oe]?fr(()=>t.call(this,this[lr])):t.call(this,this[lr])),s}get emittedEnd(){return this[Je]}[ve](){!this[Ur]&&!this[Je]&&!this[$]&&this[L].length===0&&this[Be]&&(this[Ur]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[jr]&&this.emit("close"),this[Ur]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==$&&this[$])return;if(e==="data")return t?this[Oe]?fr(()=>this[Di](t)):this[Di](t):!1;if(e==="end")return this[Go]();if(e==="close"){if(this[jr]=!0,!this[Je]&&!this[$])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[lr]=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}[Di](e){for(let s of this[De])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[ve](),t}[Go](){this[Je]||(this[Je]=!0,this.readable=!1,this[Oe]?fr(()=>this[gi]()):this[gi]())}[gi](){if(this[xe]){let t=this[xe].end();if(t){for(let s of this[De])s.dest.write(t);super.emit("data",t)}}for(let t of this[De])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[j]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[j]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[j]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[j]?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($,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[eh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[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($,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[th](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[$]?(e?this.emit("error",e):this.emit($),this):(this[$]=!0,this[L].length=0,this[I]=0,typeof this.close=="function"&&!this[jr]&&this.close(),e?this.emit("error",e):this.emit($),this)}static isStream(e){return!!e&&(e instanceof Jo||e instanceof jo||e instanceof Ql&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Ko=E((_d,Yo)=>{u();var nh=require("zlib").constants||{ZLIB_VERNUM:4736};Yo.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},nh))});var bi=E((Rd,nu)=>{"use strict";u();var Zo=typeof process=="object"&&process?process:{stdout:null,stderr:null},oh=require("events"),Xo=require("stream"),Qo=require("string_decoder").StringDecoder,Te=Symbol("EOF"),Pe=Symbol("maybeEmitEnd"),Ve=Symbol("emittedEnd"),Hr=Symbol("emittingEnd"),pr=Symbol("emittedError"),Jr=Symbol("closed"),eu=Symbol("read"),Vr=Symbol("flush"),tu=Symbol("flushChunk"),K=Symbol("encoding"),Le=Symbol("decoder"),Yr=Symbol("flowing"),mr=Symbol("paused"),Lt=Symbol("resume"),q=Symbol("bufferLength"),yi=Symbol("bufferPush"),Ai=Symbol("bufferShift"),z=Symbol("objectMode"),W=Symbol("destroyed"),Ci=Symbol("emitData"),ru=Symbol("emitEnd"),wi=Symbol("emitEnd2"),Ne=Symbol("async"),dr=r=>Promise.resolve().then(r),su=global._MP_NO_ITERATOR_SYMBOLS_!=="1",uh=su&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),ah=su&&Symbol.iterator||Symbol("iterator not implemented"),ch=r=>r==="end"||r==="finish"||r==="prefinish",lh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,hh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Kr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Lt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Fi=class extends Kr{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)}};nu.exports=class iu extends Xo{constructor(e){super(),this[Yr]=!1,this[mr]=!1,this.pipes=[],this.buffer=[],this[z]=e&&e.objectMode||!1,this[z]?this[K]=null:this[K]=e&&e.encoding||null,this[K]==="buffer"&&(this[K]=null),this[Ne]=e&&!!e.async||!1,this[Le]=this[K]?new Qo(this[K]):null,this[Te]=!1,this[Ve]=!1,this[Hr]=!1,this[Jr]=!1,this[pr]=null,this.writable=!0,this.readable=!0,this[q]=0,this[W]=!1}get bufferLength(){return this[q]}get encoding(){return this[K]}set encoding(e){if(this[z])throw new Error("cannot set encoding in objectMode");if(this[K]&&e!==this[K]&&(this[Le]&&this[Le].lastNeed||this[q]))throw new Error("cannot change encoding");this[K]!==e&&(this[Le]=e?new Qo(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Le].write(t)))),this[K]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[z]}set objectMode(e){this[z]=this[z]||!!e}get async(){return this[Ne]}set async(e){this[Ne]=this[Ne]||!!e}write(e,t,s){if(this[Te])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[Ne]?dr:n=>n();return!this[z]&&!Buffer.isBuffer(e)&&(hh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):lh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[z]?(this.flowing&&this[q]!==0&&this[Vr](!0),this.flowing?this.emit("data",e):this[yi](e),this[q]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[K]&&!this[Le].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[K]&&(e=this[Le].write(e)),this.flowing&&this[q]!==0&&this[Vr](!0),this.flowing?this.emit("data",e):this[yi](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[W])return null;if(this[q]===0||e===0||e>this[q])return this[Pe](),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[q])]);let t=this[eu](e||null,this.buffer[0]);return this[Pe](),t}[eu](e,t){return e===t.length||e===null?this[Ai]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[q]-=e),this.emit("data",t),!this.buffer.length&&!this[Te]&&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[Te]=!0,this.writable=!1,(this.flowing||!this[mr])&&this[Pe](),this}[Lt](){this[W]||(this[mr]=!1,this[Yr]=!0,this.emit("resume"),this.buffer.length?this[Vr]():this[Te]?this[Pe]():this.emit("drain"))}resume(){return this[Lt]()}pause(){this[Yr]=!1,this[mr]=!0}get destroyed(){return this[W]}get flowing(){return this[Yr]}get paused(){return this[mr]}[yi](e){this[z]?this[q]+=1:this[q]+=e.length,this.buffer.push(e)}[Ai](){return this.buffer.length&&(this[z]?this[q]-=1:this[q]-=this.buffer[0].length),this.buffer.shift()}[Vr](e){do;while(this[tu](this[Ai]()));!e&&!this.buffer.length&&!this[Te]&&this.emit("drain")}[tu](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[Ve];return t=t||{},e===Zo.stdout||e===Zo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new Fi(this,e,t):new Kr(this,e,t)),this[Ne]?dr(()=>this[Lt]()):this[Lt]()),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[Lt]():e==="readable"&&this[q]!==0?super.emit("readable"):ch(e)&&this[Ve]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[pr]&&(this[Ne]?dr(()=>t.call(this,this[pr])):t.call(this,this[pr])),s}get emittedEnd(){return this[Ve]}[Pe](){!this[Hr]&&!this[Ve]&&!this[W]&&this.buffer.length===0&&this[Te]&&(this[Hr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Jr]&&this.emit("close"),this[Hr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[Ne]?dr(()=>this[Ci](t)):this[Ci](t):!1;if(e==="end")return this[ru]();if(e==="close"){if(this[Jr]=!0,!this[Ve]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[pr]=t;let n=super.emit("error",t);return this[Pe](),n}else if(e==="resume"){let n=super.emit("resume");return this[Pe](),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[Pe](),i}[Ci](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Pe](),t}[ru](){this[Ve]||(this[Ve]=!0,this.readable=!1,this[Ne]?dr(()=>this[wi]()):this[wi]())}[wi](){if(this[Le]){let t=this[Le].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[K]?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())})}[uh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Te])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[Te]})},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)})}}}[ah](){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[q]=0,typeof this.close=="function"&&!this[Jr]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof iu||e instanceof Xo||e instanceof oh&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Ui=E(Q=>{"use strict";u();var Bi=require("assert"),Ye=require("buffer").Buffer,au=require("zlib"),mt=Q.constants=Ko(),fh=bi(),ou=Ye.concat,dt=Symbol("_superWrite"),Mt=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"}},ph=Symbol("opts"),Dr=Symbol("flushFlag"),uu=Symbol("finishFlushFlag"),qi=Symbol("fullFlushFlag"),v=Symbol("handle"),Zr=Symbol("onError"),Nt=Symbol("sawError"),Si=Symbol("level"),ki=Symbol("strategy"),_i=Symbol("ended"),Bd=Symbol("_defaultFullFlush"),Xr=class extends fh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Nt]=!1,this[_i]=!1,this[ph]=e,this[Dr]=e.flush,this[uu]=e.finishFlush;try{this[v]=new au[t](e)}catch(s){throw new Mt(s)}this[Zr]=s=>{this[Nt]||(this[Nt]=!0,this.close(),this.emit("error",s))},this[v].on("error",s=>this[Zr](new Mt(s))),this.once("end",()=>this.close)}close(){this[v]&&(this[v].close(),this[v]=null,this.emit("close"))}reset(){if(!this[Nt])return Bi(this[v],"zlib binding closed"),this[v].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[qi]),this.write(Object.assign(Ye.alloc(0),{[Dr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[uu]),this[_i]=!0,super.end(null,null,s)}get ended(){return this[_i]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=Ye.from(e,t)),this[Nt])return;Bi(this[v],"zlib binding closed");let i=this[v]._handle,n=i.close;i.close=()=>{};let o=this[v].close;this[v].close=()=>{},Ye.concat=c=>c;let a;try{let c=typeof e[Dr]=="number"?e[Dr]:this[Dr];a=this[v]._processChunk(e,c),Ye.concat=ou}catch(c){Ye.concat=ou,this[Zr](new Mt(c))}finally{this[v]&&(this[v]._handle=i,i.close=n,this[v].close=o,this[v].removeAllListeners("error"))}this[v]&&this[v].on("error",c=>this[Zr](new Mt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[dt](Ye.from(a[0]));for(let c=1;c<a.length;c++)l=this[dt](a[c])}else l=this[dt](Ye.from(a));return s&&s(),l}[dt](e){return super.write(e)}},Me=class extends Xr{constructor(e,t){e=e||{},e.flush=e.flush||mt.Z_NO_FLUSH,e.finishFlush=e.finishFlush||mt.Z_FINISH,super(e,t),this[qi]=mt.Z_FULL_FLUSH,this[Si]=e.level,this[ki]=e.strategy}params(e,t){if(!this[Nt]){if(!this[v])throw new Error("cannot switch params when binding is closed");if(!this[v].params)throw new Error("not supported in this implementation");if(this[Si]!==e||this[ki]!==t){this.flush(mt.Z_SYNC_FLUSH),Bi(this[v],"zlib binding closed");let s=this[v].flush;this[v].flush=(i,n)=>{this.flush(i),n()};try{this[v].params(e,t)}finally{this[v].flush=s}this[v]&&(this[Si]=e,this[ki]=t)}}}},vi=class extends Me{constructor(e){super(e,"Deflate")}},xi=class extends Me{constructor(e){super(e,"Inflate")}},Ri=Symbol("_portable"),Oi=class extends Me{constructor(e){super(e,"Gzip"),this[Ri]=e&&!!e.portable}[dt](e){return this[Ri]?(this[Ri]=!1,e[9]=255,super[dt](e)):super[dt](e)}},Ti=class extends Me{constructor(e){super(e,"Gunzip")}},Pi=class extends Me{constructor(e){super(e,"DeflateRaw")}},Li=class extends Me{constructor(e){super(e,"InflateRaw")}},Ni=class extends Me{constructor(e){super(e,"Unzip")}},Qr=class extends Xr{constructor(e,t){e=e||{},e.flush=e.flush||mt.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||mt.BROTLI_OPERATION_FINISH,super(e,t),this[qi]=mt.BROTLI_OPERATION_FLUSH}},Mi=class extends Qr{constructor(e){super(e,"BrotliCompress")}},Ii=class extends Qr{constructor(e){super(e,"BrotliDecompress")}};Q.Deflate=vi;Q.Inflate=xi;Q.Gzip=Oi;Q.Gunzip=Ti;Q.DeflateRaw=Pi;Q.InflateRaw=Li;Q.Unzip=Ni;typeof au.BrotliCompress=="function"?(Q.BrotliCompress=Mi,Q.BrotliDecompress=Ii):Q.BrotliCompress=Q.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var It=E((Od,cu)=>{u();var mh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;cu.exports=mh!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var es=E((Pd,lu)=>{"use strict";u();var dh=Gr(),ji=It(),$i=Symbol("slurp");lu.exports=class extends dh{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=ji(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=ji(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[$i](t),s&&this[$i](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))}[$i](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?ji(e[s]):e[s])}}});var zi=E(ts=>{"use strict";u();ts.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"]]);ts.code=new Map(Array.from(ts.name).map(r=>[r[1],r[0]]))});var mu=E((Nd,pu)=>{"use strict";u();var Dh=(r,e)=>{if(Number.isSafeInteger(r))r<0?Eh(r,e):gh(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},gh=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Eh=(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]=hu(i):i===0?e[s-1]=0:(t=!0,e[s-1]=fu(i))}},yh=r=>{let e=r[0],t=e===128?Ch(r.slice(1,r.length)):e===255?Ah(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},Ah=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=hu(n):n===0?o=n:(s=!0,o=fu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},Ch=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},hu=r=>(255^r)&255,fu=r=>(255^r)+1&255;pu.exports={encode:Dh,parse:yh}});var Ut=E((Md,Du)=>{"use strict";u();var Wi=zi(),qt=require("path").posix,du=mu(),Gi=Symbol("slurp"),ee=Symbol("type"),Vi=class{constructor(e,t,s,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[ee]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,s,i):e&&this.set(e)}decode(e,t,s,i){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=Dt(e,t,100),this.mode=Ke(e,t+100,8),this.uid=Ke(e,t+108,8),this.gid=Ke(e,t+116,8),this.size=Ke(e,t+124,12),this.mtime=Hi(e,t+136,12),this.cksum=Ke(e,t+148,12),this[Gi](s),this[Gi](i,!0),this[ee]=Dt(e,t+156,1),this[ee]===""&&(this[ee]="0"),this[ee]==="0"&&this.path.slice(-1)==="/"&&(this[ee]="5"),this[ee]==="5"&&(this.size=0),this.linkpath=Dt(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=Dt(e,t+265,32),this.gname=Dt(e,t+297,32),this.devmaj=Ke(e,t+329,8),this.devmin=Ke(e,t+337,8),e[t+475]!==0){let o=Dt(e,t+345,155);this.path=o+"/"+this.path}else{let o=Dt(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Hi(e,t+476,12),this.ctime=Hi(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)}[Gi](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=wh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=gt(e,t,100,n)||this.needPax,this.needPax=Ze(e,t+100,8,this.mode)||this.needPax,this.needPax=Ze(e,t+108,8,this.uid)||this.needPax,this.needPax=Ze(e,t+116,8,this.gid)||this.needPax,this.needPax=Ze(e,t+124,12,this.size)||this.needPax,this.needPax=Ji(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[ee].charCodeAt(0),this.needPax=gt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=gt(e,t+265,32,this.uname)||this.needPax,this.needPax=gt(e,t+297,32,this.gname)||this.needPax,this.needPax=Ze(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ze(e,t+337,8,this.devmin)||this.needPax,this.needPax=gt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=gt(e,t+345,155,o)||this.needPax:(this.needPax=gt(e,t+345,130,o)||this.needPax,this.needPax=Ji(e,t+476,12,this.atime)||this.needPax,this.needPax=Ji(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,Ze(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 Wi.name.get(this[ee])||this[ee]}get typeKey(){return this[ee]}set type(e){Wi.code.has(e)?this[ee]=Wi.code.get(e):this[ee]=e}},wh=(r,e)=>{let s=r,i="",n,o=qt.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=qt.dirname(s),s=qt.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=qt.join(qt.basename(i),s),i=qt.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},Dt=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Hi=(r,e,t)=>Fh(Ke(r,e,t)),Fh=r=>r===null?null:new Date(r*1e3),Ke=(r,e,t)=>r[e]&128?du.parse(r.slice(e,e+t)):Sh(r,e,t),bh=r=>isNaN(r)?null:r,Sh=(r,e,t)=>bh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),kh={12:8589934591,8:2097151},Ze=(r,e,t,s)=>s===null?!1:s>kh[t]||s<0?(du.encode(s,r.slice(e,e+t)),!0):(_h(r,e,t,s),!1),_h=(r,e,t,s)=>r.write(Rh(s,t),e,t,"ascii"),Rh=(r,e)=>Bh(Math.floor(r).toString(8),e),Bh=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",Ji=(r,e,t,s)=>s===null?!1:Ze(r,e,t,s.getTime()/1e3),vh=new Array(156).join("\0"),gt=(r,e,t,s)=>s===null?!1:(r.write(s+vh,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);Du.exports=Vi});var rs=E((Id,gu)=>{"use strict";u();var xh=Ut(),Oh=require("path"),gr=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 xh({path:("PaxHeader/"+Oh.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
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}};gr.parse=(r,e,t)=>new gr(Th(Ph(r),e),t);var Th=(r,e)=>e?Object.keys(r).reduce((t,s)=>(t[s]=r[s],t),e):r,Ph=r=>r.replace(/\n$/,"").split(`
|
|
3
|
-
`).reduce(Lh,Object.create(null)),Lh=(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};gu.exports=gr});var Ut=E((qd,Eu)=>{u();Eu.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 ss=E((jd,yu)=>{"use strict";u();yu.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 Ki=E(($d,Au)=>{"use strict";u();var is=["|","<",">","?",":"],Yi=is.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),Nh=new Map(is.map((r,e)=>[r,Yi[e]])),Mh=new Map(Yi.map((r,e)=>[r,is[e]]));Au.exports={encode:r=>is.reduce((e,t)=>e.split(t).join(Nh.get(t)),r),decode:r=>Yi.reduce((e,t)=>e.split(t).join(Mh.get(t)),r)}});var Zi=E((zd,wu)=>{u();var{isAbsolute:Ih,parse:Cu}=require("path").win32;wu.exports=r=>{let e="",t=Cu(r);for(;Ih(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=Cu(r)}return[e,r]}});var bu=E((Wd,Fu)=>{"use strict";u();Fu.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 an=E((Jd,Iu)=>{"use strict";u();var xu=Gr(),Ou=rs(),Tu=jt(),Ee=require("fs"),Su=require("path"),ge=It(),qh=Ut(),Pu=(r,e)=>e?(r=ge(r).replace(/^\.(\/|$)/,""),qh(e)+"/"+r):ge(r),jh=16*1024*1024,ku=Symbol("process"),_u=Symbol("file"),Ru=Symbol("directory"),Qi=Symbol("symlink"),vu=Symbol("hardlink"),Er=Symbol("header"),ns=Symbol("read"),en=Symbol("lstat"),os=Symbol("onlstat"),tn=Symbol("onread"),rn=Symbol("onreadlink"),sn=Symbol("openfile"),nn=Symbol("onopenfile"),Xe=Symbol("close"),us=Symbol("mode"),on=Symbol("awaitDrain"),Xi=Symbol("ondrain"),ye=Symbol("prefix"),Bu=Symbol("hadError"),Lu=ss(),Uh=Ki(),Nu=Zi(),Mu=bu(),as=Lu(class extends xu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=ge(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||jh,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=ge(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?ge(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Nu(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=Uh.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=ge(t.absolute||Su.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[os](this.statCache.get(this.absolute)):this[en]()}emit(e,...t){return e==="error"&&(this[Bu]=!0),super.emit(e,...t)}[en](){Ee.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[os](t)})}[os](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=zh(e),this.emit("stat",e),this[ku]()}[ku](){switch(this.type){case"File":return this[_u]();case"Directory":return this[Ru]();case"SymbolicLink":return this[Qi]();default:return this.end()}}[us](e){return Mu(e,this.type==="Directory",this.portable)}[ye](e){return Pu(e,this.prefix)}[Er](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Tu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this[us](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 Ou({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[Ru](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Er](),this.end()}[Qi](){Ee.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[rn](t)})}[rn](e){this.linkpath=ge(e),this[Er](),this.end()}[vu](e){this.type="Link",this.linkpath=ge(Su.relative(this.cwd,e)),this.stat.size=0,this[Er](),this.end()}[_u](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[vu](t)}this.linkCache.set(e,this.absolute)}if(this[Er](),this.stat.size===0)return this.end();this[sn]()}[sn](){Ee.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[nn](t)})}[nn](e){if(this.fd=e,this[Bu])return this[Xe]();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[ns]()}[ns](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ee.read(e,t,s,i,n,(o,a)=>{if(o)return this[Xe](()=>this.emit("error",o));this[tn](a)})}[Xe](e){Ee.close(this.fd,e)}[tn](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[Xe](()=>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[Xe](()=>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[Xi]():this[on](()=>this[Xi]())}[on](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)}[Xi](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Xe](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[ns]()}}),un=class extends as{[en](){this[os](Ee.lstatSync(this.absolute))}[Qi](){this[rn](Ee.readlinkSync(this.absolute))}[sn](){this[nn](Ee.openSync(this.absolute,"r"))}[ns](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ee.readSync(t,s,i,n,o);this[tn](a),e=!1}finally{if(e)try{this[Xe](()=>{})}catch{}}}[on](e){e()}[Xe](e){Ee.closeSync(this.fd),e()}},$h=Lu(class extends xu{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=t.prefix||null,this.path=ge(e.path),this.mode=this[us](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=ge(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Nu(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Tu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Ou({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[ye](e){return Pu(e,this.prefix)}[us](e){return Mu(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});as.Sync=un;as.Tar=$h;var zh=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Iu.exports=as});var ju=E((Vd,qu)=>{"use strict";u();qu.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var cn=E((Yd,Uu)=>{"use strict";u();Uu.exports=S;S.Node=Et;S.create=S;function S(r){var e=this;if(e instanceof S||(e=new S),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}S.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};S.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++}};S.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++}};S.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)Gh(this,arguments[r]);return this.length};S.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Hh(this,arguments[r]);return this.length};S.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}};S.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}};S.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};S.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};S.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};S.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};S.prototype.map=function(r,e){e=e||this;for(var t=new S,s=this.head;s!==null;)t.push(r.call(e,s.value,this)),s=s.next;return t};S.prototype.mapReverse=function(r,e){e=e||this;for(var t=new S,s=this.tail;s!==null;)t.push(r.call(e,s.value,this)),s=s.prev;return t};S.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};S.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};S.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};S.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};S.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 S;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};S.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 S;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};S.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};S.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 Et(t,null,e,r):new Et(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function Gh(r,e){r.tail=new Et(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Hh(r,e){r.head=new Et(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function Et(r,e,t,s){if(!(this instanceof Et))return new Et(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{ju()(S)}catch{}});var gs=E((Zd,Vu)=>{"use strict";u();var ds=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},Jh=Gr(),Vh=ji(),Yh=es(),En=an(),Kh=En.Sync,Zh=En.Tar,Xh=cn(),$u=Buffer.alloc(1024),hs=Symbol("onStat"),cs=Symbol("ended"),Ae=Symbol("queue"),$t=Symbol("current"),yt=Symbol("process"),ls=Symbol("processing"),zu=Symbol("processJob"),Ce=Symbol("jobs"),ln=Symbol("jobDone"),fs=Symbol("addFSEntry"),Wu=Symbol("addTarEntry"),mn=Symbol("stat"),dn=Symbol("readdir"),ps=Symbol("onreaddir"),ms=Symbol("pipe"),Gu=Symbol("entry"),hn=Symbol("entryOpt"),Dn=Symbol("writeEntryClass"),Ju=Symbol("write"),fn=Symbol("ondrain"),Ds=require("fs"),Hu=require("path"),Qh=ss(),pn=It(),yn=Qh(class extends Jh{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=pn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[Dn]=En,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 Vh.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[fn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[fn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[Ae]=new Xh,this[Ce]=0,this.jobs=+e.jobs||4,this[ls]=!1,this[cs]=!1}[Ju](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[cs]=!0,this[yt](),this}write(e){if(this[cs])throw new Error("write after end");return e instanceof Yh?this[Wu](e):this[fs](e),this.flowing}[Wu](e){let t=pn(Hu.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new ds(e.path,t,!1);s.entry=new Zh(e,this[hn](s)),s.entry.on("end",i=>this[ln](s)),this[Ce]+=1,this[Ae].push(s)}this[yt]()}[fs](e){let t=pn(Hu.resolve(this.cwd,e));this[Ae].push(new ds(e,t)),this[yt]()}[mn](e){e.pending=!0,this[Ce]+=1;let t=this.follow?"stat":"lstat";Ds[t](e.absolute,(s,i)=>{e.pending=!1,this[Ce]-=1,s?this.emit("error",s):this[hs](e,i)})}[hs](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[yt]()}[dn](e){e.pending=!0,this[Ce]+=1,Ds.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[Ce]-=1,t)return this.emit("error",t);this[ps](e,s)})}[ps](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[yt]()}[yt](){if(!this[ls]){this[ls]=!0;for(let e=this[Ae].head;e!==null&&this[Ce]<this.jobs;e=e.next)if(this[zu](e.value),e.value.ignore){let t=e.next;this[Ae].removeNode(e),e.next=t}this[ls]=!1,this[cs]&&!this[Ae].length&&this[Ce]===0&&(this.zip?this.zip.end($u):(super.write($u),super.end()))}}get[$t](){return this[Ae]&&this[Ae].head&&this[Ae].head.value}[ln](e){this[Ae].shift(),this[Ce]-=1,this[yt]()}[zu](e){if(!e.pending){if(e.entry){e===this[$t]&&!e.piped&&this[ms](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[hs](e,this.statCache.get(e.absolute)):this[mn](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[ps](e,this.readdirCache.get(e.absolute)):this[dn](e),!e.readdir))){if(e.entry=this[Gu](e),!e.entry){e.ignore=!0;return}e===this[$t]&&!e.piped&&this[ms](e)}}}[hn](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}}[Gu](e){this[Ce]+=1;try{return new this[Dn](e.path,this[hn](e)).on("end",()=>this[ln](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[fn](){this[$t]&&this[$t].entry&&this[$t].entry.resume()}[ms](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[fs](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()}}),gn=class extends yn{constructor(e){super(e),this[Dn]=Kh}pause(){}resume(){}[mn](e){let t=this.follow?"statSync":"lstatSync";this[hs](e,Ds[t](e.absolute))}[dn](e,t){this[ps](e,Ds.readdirSync(e.absolute))}[ms](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[fs](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[Ju](i)})}};yn.Sync=gn;Vu.exports=yn});var Kt=E(Ar=>{"use strict";u();var ef=bi(),tf=require("events").EventEmitter,Z=require("fs"),wn=Z.writev;if(!wn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;wn=(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 Vt=Symbol("_autoClose"),pe=Symbol("_close"),yr=Symbol("_ended"),v=Symbol("_fd"),Yu=Symbol("_finished"),et=Symbol("_flags"),An=Symbol("_flush"),Fn=Symbol("_handleChunk"),bn=Symbol("_makeBuf"),ws=Symbol("_mode"),Es=Symbol("_needDrain"),Ht=Symbol("_onerror"),Yt=Symbol("_onopen"),Cn=Symbol("_onread"),Wt=Symbol("_onwrite"),tt=Symbol("_open"),Ie=Symbol("_path"),At=Symbol("_pos"),we=Symbol("_queue"),Gt=Symbol("_read"),Ku=Symbol("_readSize"),Qe=Symbol("_reading"),ys=Symbol("_remain"),Zu=Symbol("_size"),As=Symbol("_write"),zt=Symbol("_writing"),Cs=Symbol("_defaultFlag"),Jt=Symbol("_errored"),Fs=class extends ef{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[Jt]=!1,this[v]=typeof t.fd=="number"?t.fd:null,this[Ie]=e,this[Ku]=t.readSize||16*1024*1024,this[Qe]=!1,this[Zu]=typeof t.size=="number"?t.size:1/0,this[ys]=this[Zu],this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[v]=="number"?this[Gt]():this[tt]()}get fd(){return this[v]}get path(){return this[Ie]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[tt](){Z.open(this[Ie],"r",(e,t)=>this[Yt](e,t))}[Yt](e,t){e?this[Ht](e):(this[v]=t,this.emit("open",t),this[Gt]())}[bn](){return Buffer.allocUnsafe(Math.min(this[Ku],this[ys]))}[Gt](){if(!this[Qe]){this[Qe]=!0;let e=this[bn]();if(e.length===0)return process.nextTick(()=>this[Cn](null,0,e));Z.read(this[v],e,0,e.length,null,(t,s,i)=>this[Cn](t,s,i))}}[Cn](e,t,s){this[Qe]=!1,e?this[Ht](e):this[Fn](t,s)&&this[Gt]()}[pe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Z.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ht](e){this[Qe]=!0,this[pe](),this.emit("error",e)}[Fn](e,t){let s=!1;return this[ys]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[ys]<=0)&&(s=!1,this[pe](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[v]=="number"&&this[Gt]();break;case"error":return this[Jt]?void 0:(this[Jt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Sn=class extends Fs{[tt](){let e=!0;try{this[Yt](null,Z.openSync(this[Ie],"r")),e=!1}finally{e&&this[pe]()}}[Gt](){let e=!0;try{if(!this[Qe]){this[Qe]=!0;do{let t=this[bn](),s=t.length===0?0:Z.readSync(this[v],t,0,t.length,null);if(!this[Fn](s,t))break}while(!0);this[Qe]=!1}e=!1}finally{e&&this[pe]()}}[pe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Z.closeSync(e),this.emit("close")}}},bs=class extends tf{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Jt]=!1,this[zt]=!1,this[yr]=!1,this[Es]=!1,this[we]=[],this[Ie]=e,this[v]=typeof t.fd=="number"?t.fd:null,this[ws]=t.mode===void 0?438:t.mode,this[At]=typeof t.start=="number"?t.start:null,this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[At]!==null?"r+":"w";this[Cs]=t.flags===void 0,this[et]=this[Cs]?s:t.flags,this[v]===null&&this[tt]()}emit(e,t){if(e==="error"){if(this[Jt])return;this[Jt]=!0}return super.emit(e,t)}get fd(){return this[v]}get path(){return this[Ie]}[Ht](e){this[pe](),this[zt]=!0,this.emit("error",e)}[tt](){Z.open(this[Ie],this[et],this[ws],(e,t)=>this[Yt](e,t))}[Yt](e,t){this[Cs]&&this[et]==="r+"&&e&&e.code==="ENOENT"?(this[et]="w",this[tt]()):e?this[Ht](e):(this[v]=t,this.emit("open",t),this[An]())}end(e,t){return e&&this.write(e,t),this[yr]=!0,!this[zt]&&!this[we].length&&typeof this[v]=="number"&&this[Wt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[yr]?(this.emit("error",new Error("write() after end()")),!1):this[v]===null||this[zt]||this[we].length?(this[we].push(e),this[Es]=!0,!1):(this[zt]=!0,this[As](e),!0)}[As](e){Z.write(this[v],e,0,e.length,this[At],(t,s)=>this[Wt](t,s))}[Wt](e,t){e?this[Ht](e):(this[At]!==null&&(this[At]+=t),this[we].length?this[An]():(this[zt]=!1,this[yr]&&!this[Yu]?(this[Yu]=!0,this[pe](),this.emit("finish")):this[Es]&&(this[Es]=!1,this.emit("drain"))))}[An](){if(this[we].length===0)this[yr]&&this[Wt](null,0);else if(this[we].length===1)this[As](this[we].pop());else{let e=this[we];this[we]=[],wn(this[v],e,this[At],(t,s)=>this[Wt](t,s))}}[pe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Z.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},kn=class extends bs{[tt](){let e;if(this[Cs]&&this[et]==="r+")try{e=Z.openSync(this[Ie],this[et],this[ws])}catch(t){if(t.code==="ENOENT")return this[et]="w",this[tt]();throw t}else e=Z.openSync(this[Ie],this[et],this[ws]);this[Yt](null,e)}[pe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Z.closeSync(e),this.emit("close")}}[As](e){let t=!0;try{this[Wt](null,Z.writeSync(this[v],e,0,e.length,this[At])),t=!1}finally{if(t)try{this[pe]()}catch{}}}};Ar.ReadStream=Fs;Ar.ReadStreamSync=Sn;Ar.WriteStream=bs;Ar.WriteStreamSync=kn});var xs=E((e0,na)=>{"use strict";u();var rf=ss(),sf=jt(),nf=require("events"),of=cn(),uf=1024*1024,af=es(),Xu=rs(),cf=ji(),{nextTick:lf}=require("process"),_n=Buffer.from([31,139]),ne=Symbol("state"),Ct=Symbol("writeEntry"),qe=Symbol("readEntry"),Rn=Symbol("nextEntry"),Qu=Symbol("processEntry"),oe=Symbol("extendedHeader"),Cr=Symbol("globalExtendedHeader"),rt=Symbol("meta"),ea=Symbol("emitMeta"),O=Symbol("buffer"),je=Symbol("queue"),wt=Symbol("ended"),ta=Symbol("emittedEnd"),Ft=Symbol("emit"),X=Symbol("unzip"),Ss=Symbol("consumeChunk"),ks=Symbol("consumeChunkSub"),vn=Symbol("consumeBody"),ra=Symbol("consumeMeta"),sa=Symbol("consumeHeader"),_s=Symbol("consuming"),Bn=Symbol("bufferConcat"),xn=Symbol("maybeEnd"),wr=Symbol("writing"),st=Symbol("aborted"),Rs=Symbol("onDone"),bt=Symbol("sawValidEntry"),vs=Symbol("sawNullBlock"),Bs=Symbol("sawEOF"),ia=Symbol("closeStream"),hf=r=>!0;na.exports=rf(class extends nf{constructor(e){e=e||{},super(e),this.file=e.file||"",this[bt]=null,this.on(Rs,t=>{(this[ne]==="begin"||this[bt]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Rs,e.ondone):this.on(Rs,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||uf,this.filter=typeof e.filter=="function"?e.filter:hf,this.writable=!0,this.readable=!1,this[je]=new of,this[O]=null,this[qe]=null,this[Ct]=null,this[ne]="begin",this[rt]="",this[oe]=null,this[Cr]=null,this[wt]=!1,this[X]=null,this[st]=!1,this[vs]=!1,this[Bs]=!1,this.on("end",()=>this[ia]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[sa](e,t){this[bt]===null&&(this[bt]=!1);let s;try{s=new sf(e,t,this[oe],this[Cr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[vs]?(this[Bs]=!0,this[ne]==="begin"&&(this[ne]="header"),this[Ft]("eof")):(this[vs]=!0,this[Ft]("nullBlock"));else if(this[vs]=!1,!s.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:s});else if(!s.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:s});else{let i=s.type;if(/^(Symbolic)?Link$/.test(i)&&!s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:s});else if(!/^(Symbolic)?Link$/.test(i)&&s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:s});else{let n=this[Ct]=new af(s,this[oe],this[Cr]);if(!this[bt])if(n.remain){let o=()=>{n.invalid||(this[bt]=!0)};n.on("end",o)}else this[bt]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Ft]("ignoredEntry",n),this[ne]="ignore",n.resume()):n.size>0&&(this[rt]="",n.on("data",o=>this[rt]+=o),this[ne]="meta"):(this[oe]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Ft]("ignoredEntry",n),this[ne]=n.remain?"ignore":"header",n.resume()):(n.remain?this[ne]="body":(this[ne]="header",n.end()),this[qe]?this[je].push(n):(this[je].push(n),this[Rn]())))}}}[ia](){lf(()=>this.emit("close"))}[Qu](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[qe]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[Rn]()),t=!1)):(this[qe]=null,t=!1),t}[Rn](){do;while(this[Qu](this[je].shift()));if(!this[je].length){let e=this[qe];!e||e.flowing||e.size===e.remain?this[wr]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[vn](e,t){let s=this[Ct],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[ne]="header",this[Ct]=null,s.end()),n.length}[ra](e,t){let s=this[Ct],i=this[vn](e,t);return this[Ct]||this[ea](s),i}[Ft](e,t,s){!this[je].length&&!this[qe]?this.emit(e,t,s):this[je].push([e,t,s])}[ea](e){switch(this[Ft]("meta",this[rt]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[oe]=Xu.parse(this[rt],this[oe],!1);break;case"GlobalExtendedHeader":this[Cr]=Xu.parse(this[rt],this[Cr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[oe]=this[oe]||Object.create(null),this[oe].path=this[rt].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[oe]=this[oe]||Object.create(null),this[oe].linkpath=this[rt].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[st]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[st])return;if(this[X]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<_n.length)return this[O]=e,!0;for(let s=0;this[X]===null&&s<_n.length;s++)e[s]!==_n[s]&&(this[X]=!1);if(this[X]===null){let s=this[wt];this[wt]=!1,this[X]=new cf.Unzip,this[X].on("data",n=>this[Ss](n)),this[X].on("error",n=>this.abort(n)),this[X].on("end",n=>{this[wt]=!0,this[Ss]()}),this[wr]=!0;let i=this[X][s?"end":"write"](e);return this[wr]=!1,i}}this[wr]=!0,this[X]?this[X].write(e):this[Ss](e),this[wr]=!1;let t=this[je].length?!1:this[qe]?this[qe].flowing:!0;return!t&&!this[je].length&&this[qe].once("drain",s=>this.emit("drain")),t}[Bn](e){e&&!this[st]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[xn](){if(this[wt]&&!this[ta]&&!this[st]&&!this[_s]){this[ta]=!0;let e=this[Ct];if(e&&e.blockRemain){let t=this[O]?this[O].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[O]&&e.write(this[O]),e.end()}this[Ft](Rs)}}[Ss](e){if(this[_s])this[Bn](e);else if(!e&&!this[O])this[xn]();else{if(this[_s]=!0,this[O]){this[Bn](e);let t=this[O];this[O]=null,this[ks](t)}else this[ks](e);for(;this[O]&&this[O].length>=512&&!this[st]&&!this[Bs];){let t=this[O];this[O]=null,this[ks](t)}this[_s]=!1}(!this[O]||this[wt])&&this[xn]()}[ks](e){let t=0,s=e.length;for(;t+512<=s&&!this[st]&&!this[Bs];)switch(this[ne]){case"begin":case"header":this[sa](e,t),t+=512;break;case"ignore":case"body":t+=this[vn](e,t);break;case"meta":t+=this[ra](e,t);break;default:throw new Error("invalid state: "+this[ne])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[st]||(this[X]?this[X].end(e):(this[wt]=!0,this.write(e)))}})});var Os=E((t0,ca)=>{"use strict";u();var ff=Tt(),ua=xs(),Zt=require("fs"),pf=Kt(),oa=require("path"),On=Ut();ca.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=ff(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&&df(s,e),s.noResume||mf(s),s.file&&s.sync?Df(s):s.file?gf(s,t):aa(s)};var mf=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},df=(r,e)=>{let t=new Map(e.map(n=>[On(n),!0])),s=r.filter,i=(n,o)=>{let a=o||oa.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(oa.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(On(n)):n=>i(On(n))},Df=r=>{let e=aa(r),t=r.file,s=!0,i;try{let n=Zt.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(Zt.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=Zt.openSync(t,"r");a<n.size;){let c=Zt.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{Zt.closeSync(i)}catch{}}},gf=(r,e)=>{let t=new ua(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Zt.stat(i,(l,c)=>{if(l)a(l);else{let h=new pf.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},aa=r=>new ua(r)});var da=E((r0,ma)=>{"use strict";u();var Ef=Tt(),Ts=gs(),la=Kt(),ha=Os(),fa=require("path");ma.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=Ef(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?yf(s,e):s.file?Af(s,e,t):s.sync?Cf(s,e):wf(s,e)};var yf=(r,e)=>{let t=new Ts.Sync(r),s=new la.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),pa(t,e)},Af=(r,e,t)=>{let s=new Ts(r),i=new la.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 Tn(s,e),t?n.then(t,t):n},pa=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?ha({file:fa.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Tn=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return ha({file:fa.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Tn(r,e));r.add(t)}r.end()},Cf=(r,e)=>{let t=new Ts.Sync(r);return pa(t,e),t},wf=(r,e)=>{let t=new Ts(r);return Tn(t,e),t}});var Pn=E((s0,wa)=>{"use strict";u();var Ff=Tt(),Da=gs(),te=require("fs"),ga=Kt(),Ea=Os(),ya=require("path"),Aa=jt();wa.exports=(r,e,t)=>{let s=Ff(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?bf(s,e):kf(s,e,t)};var bf=(r,e)=>{let t=new Da.Sync(r),s=!0,i,n;try{try{i=te.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=te.openSync(r.file,"w+");else throw l}let o=te.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,m=0;h<512;h+=m){if(m=te.readSync(i,a,h,a.length-h,n+h),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!m)break e}let l=new Aa(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,Sf(r,t,n,i,e)}finally{if(s)try{te.closeSync(i)}catch{}}},Sf=(r,e,t,s,i)=>{let n=new ga.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),_f(e,i)},kf=(r,e,t)=>{e=Array.from(e);let s=new Da(r),i=(o,a,l)=>{let c=(F,T)=>{F?te.close(o,b=>l(F)):l(null,T)},h=0;if(a===0)return c(null,0);let m=0,D=Buffer.alloc(512),A=(F,T)=>{if(F)return c(F);if(m+=T,m<512&&T)return te.read(o,D,m,D.length-m,h+m,A);if(h===0&&D[0]===31&&D[1]===139)return c(new Error("cannot append to compressed archives"));if(m<512)return c(null,h);let b=new Aa(D);if(!b.cksumValid)return c(null,h);let x=512*Math.ceil(b.size/512);if(h+x+512>a||(h+=x+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(b.path,b.mtime),m=0,te.read(o,D,0,512,h,A)};te.read(o,D,0,512,h,A)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,m)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",te.open(r.file,l,c);if(h)return a(h);te.fstat(m,(D,A)=>{if(D)return te.close(m,()=>a(D));i(m,A.size,(F,T)=>{if(F)return a(F);let b=new ga.WriteStream(r.file,{fd:m,start:T});s.pipe(b),b.on("error",a),b.on("close",o),Ca(s,e)})})};te.open(r.file,l,c)});return t?n.then(t,t):n},_f=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Ea({file:ya.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Ca=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Ea({file:ya.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Ca(r,e));r.add(t)}r.end()}});var ba=E((i0,Fa)=>{"use strict";u();var Rf=Tt(),vf=Pn();Fa.exports=(r,e,t)=>{let s=Rf(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),Bf(s),vf(s,e,t)};var Bf=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 _a=E((n0,ka)=>{u();var{promisify:Sa}=require("util"),it=require("fs"),xf=r=>{if(!r)r={mode:511,fs:it};else if(typeof r=="object")r={mode:511,fs:it,...r};else if(typeof r=="number")r={mode:r,fs:it};else if(typeof r=="string")r={mode:parseInt(r,8),fs:it};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||it.mkdir,r.mkdirAsync=Sa(r.mkdir),r.stat=r.stat||r.fs.stat||it.stat,r.statAsync=Sa(r.stat),r.statSync=r.statSync||r.fs.statSync||it.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||it.mkdirSync,r};ka.exports=xf});var va=E((o0,Ra)=>{u();var Of=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Tf,parse:Pf}=require("path"),Lf=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=Tf(r),Of==="win32"){let e=/[*|"<>?:]/,{root:t}=Pf(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Ra.exports=Lf});var Pa=E((u0,Ta)=>{u();var{dirname:Ba}=require("path"),xa=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?xa(r,Ba(e),e):void 0),Oa=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Oa(r,Ba(e),e):void 0}};Ta.exports={findMade:xa,findMadeSync:Oa}});var Mn=E((a0,Na)=>{u();var{dirname:La}=require("path"),Ln=(r,e,t)=>{e.recursive=!1;let s=La(r);return s===r?e.mkdirAsync(r,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(r,e).then(()=>t||r,i=>{if(i.code==="ENOENT")return Ln(s,e).then(n=>Ln(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})})},Nn=(r,e,t)=>{let s=La(r);if(e.recursive=!1,s===r)try{return e.mkdirSync(r,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(r,e),t||r}catch(i){if(i.code==="ENOENT")return Nn(r,e,Nn(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};Na.exports={mkdirpManual:Ln,mkdirpManualSync:Nn}});var qa=E((c0,Ia)=>{u();var{dirname:Ma}=require("path"),{findMade:Nf,findMadeSync:Mf}=Pa(),{mkdirpManual:If,mkdirpManualSync:qf}=Mn(),jf=(r,e)=>(e.recursive=!0,Ma(r)===r?e.mkdirAsync(r,e):Nf(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return If(r,e);throw i}))),Uf=(r,e)=>{if(e.recursive=!0,Ma(r)===r)return e.mkdirSync(r,e);let s=Mf(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return qf(r,e);throw i}};Ia.exports={mkdirpNative:jf,mkdirpNativeSync:Uf}});var za=E((l0,$a)=>{u();var ja=require("fs"),$f=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,In=$f.replace(/^v/,"").split("."),Ua=+In[0]>10||+In[0]==10&&+In[1]>=12,zf=Ua?r=>r.mkdir===ja.mkdir:()=>!1,Wf=Ua?r=>r.mkdirSync===ja.mkdirSync:()=>!1;$a.exports={useNative:zf,useNativeSync:Wf}});var Ya=E((h0,Va)=>{u();var Xt=_a(),Qt=va(),{mkdirpNative:Wa,mkdirpNativeSync:Ga}=qa(),{mkdirpManual:Ha,mkdirpManualSync:Ja}=Mn(),{useNative:Gf,useNativeSync:Hf}=za(),er=(r,e)=>(r=Qt(r),e=Xt(e),Gf(e)?Wa(r,e):Ha(r,e)),Jf=(r,e)=>(r=Qt(r),e=Xt(e),Hf(e)?Ga(r,e):Ja(r,e));er.sync=Jf;er.native=(r,e)=>Wa(Qt(r),Xt(e));er.manual=(r,e)=>Ha(Qt(r),Xt(e));er.nativeSync=(r,e)=>Ga(Qt(r),Xt(e));er.manualSync=(r,e)=>Ja(Qt(r),Xt(e));Va.exports=er});var rc=E((f0,tc)=>{"use strict";u();var ue=require("fs"),St=require("path"),Vf=ue.lchown?"lchown":"chown",Yf=ue.lchownSync?"lchownSync":"chownSync",Za=ue.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Ka=(r,e,t)=>{try{return ue[Yf](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Kf=(r,e,t)=>{try{return ue.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Zf=Za?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):ue.chown(r,e,t,s)}:(r,e,t,s)=>s,qn=Za?(r,e,t)=>{try{return Ka(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Kf(r,e,t)}}:(r,e,t)=>Ka(r,e,t),Xf=process.version,Xa=(r,e,t)=>ue.readdir(r,e,t),Qf=(r,e)=>ue.readdirSync(r,e);/^v4\./.test(Xf)&&(Xa=(r,e,t)=>ue.readdir(r,t));var Ps=(r,e,t,s)=>{ue[Vf](r,e,t,Zf(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},Qa=(r,e,t,s,i)=>{if(typeof e=="string")return ue.lstat(St.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,Qa(r,o,t,s,i)});if(e.isDirectory())jn(St.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=St.resolve(r,e.name);Ps(o,t,s,i)});else{let n=St.resolve(r,e.name);Ps(n,t,s,i)}},jn=(r,e,t,s)=>{Xa(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 Ps(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Ps(r,e,t,s)}};n.forEach(c=>Qa(r,c,e,t,l))})},ep=(r,e,t,s)=>{if(typeof e=="string")try{let i=ue.lstatSync(St.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&ec(St.resolve(r,e.name),t,s),qn(St.resolve(r,e.name),t,s)},ec=(r,e,t)=>{let s;try{s=Qf(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return qn(r,e,t);throw i}return s&&s.length&&s.forEach(i=>ep(r,i,e,t)),qn(r,e,t)};tc.exports=jn;jn.sync=ec});var oc=E((p0,Un)=>{"use strict";u();var sc=Ya(),ae=require("fs"),Ls=require("path"),ic=rc(),me=It(),Ns=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Ms=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},Is=(r,e)=>r.get(me(e)),Fr=(r,e,t)=>r.set(me(e),t),tp=(r,e)=>{ae.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Ms(r,t&&t.code||"ENOTDIR")),e(t)})};Un.exports=(r,e,t)=>{r=me(r);let s=e.umask,i=e.mode|448,n=(i&s)!==0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,h=e.unlink,m=e.cache,D=me(e.cwd),A=(b,x)=>{b?t(b):(Fr(m,r,!0),x&&l?ic(x,o,a,lt=>A(lt)):n?ae.chmod(r,i,t):t())};if(m&&Is(m,r)===!0)return A();if(r===D)return tp(r,A);if(c)return sc(r,{mode:i}).then(b=>A(null,b),A);let T=me(Ls.relative(D,r)).split("/");qs(D,T,i,m,h,D,null,A)};var qs=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=me(Ls.resolve(r+"/"+l));if(Is(s,c))return qs(c,e,t,s,i,n,o,a);ae.mkdir(c,t,nc(c,e,t,s,i,n,o,a))},nc=(r,e,t,s,i,n,o,a)=>l=>{l?ae.lstat(r,(c,h)=>{if(c)c.path=c.path&&me(c.path),a(c);else if(h.isDirectory())qs(r,e,t,s,i,n,o,a);else if(i)ae.unlink(r,m=>{if(m)return a(m);ae.mkdir(r,t,nc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new Ns(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,qs(r,e,t,s,i,n,o,a))},rp=r=>{let e=!1,t="ENOTDIR";try{e=ae.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Ms(r,t)}};Un.exports.sync=(r,e)=>{r=me(r);let t=e.umask,s=e.mode|448,i=(s&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,h=e.cache,m=me(e.cwd),D=b=>{Fr(h,r,!0),b&&a&&ic.sync(b,n,o),i&&ae.chmodSync(r,s)};if(h&&Is(h,r)===!0)return D();if(r===m)return rp(m),D();if(l)return D(sc.sync(r,s));let F=me(Ls.relative(m,r)).split("/"),T=null;for(let b=F.shift(),x=m;b&&(x+="/"+b);b=F.shift())if(x=me(Ls.resolve(x)),!Is(h,x))try{ae.mkdirSync(x,s),T=T||x,Fr(h,x,!0)}catch{let de=ae.lstatSync(x);if(de.isDirectory()){Fr(h,x,!0);continue}else if(c){ae.unlinkSync(x),ae.mkdirSync(x,s),T=T||x,Fr(h,x,!0);continue}else if(de.isSymbolicLink())return new Ns(x,x+"/"+F.join("/"))}return D(T)}});var zn=E((m0,uc)=>{u();var $n=Object.create(null),{hasOwnProperty:sp}=Object.prototype;uc.exports=r=>(sp.call($n,r)||($n[r]=r.normalize("NFKD")),$n[r])});var hc=E((d0,lc)=>{u();var ac=require("assert"),ip=zn(),np=Ut(),{join:cc}=require("path"),op=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,up=op==="win32";lc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((m,D)=>(m.length&&(D=cc(m[m.length-1],D)),m.push(D||"/"),m),[]),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(m=>r.get(m)),dirs:[...h.dirs].map(m=>r.get(m))}},n=c=>{let{paths:h,dirs:m}=i(c);return h.every(D=>D[0]===c)&&m.every(D=>D[0]instanceof Set&&D[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:m}=e.get(c),D=new Set;return h.forEach(A=>{let F=r.get(A);ac.equal(F[0],c),F.length===1?r.delete(A):(F.shift(),typeof F[0]=="function"?D.add(F[0]):F[0].forEach(T=>D.add(T)))}),m.forEach(A=>{let F=r.get(A);ac(F[0]instanceof Set),F[0].size===1&&F.length===1?r.delete(A):F[0].size===1?(F.shift(),D.add(F[0])):F[0].delete(c)}),s.delete(c),D.forEach(A=>o(A)),!0};return{check:n,reserve:(c,h)=>{c=up?["win32 parallelization disabled"]:c.map(D=>ip(np(cc(D))).toLowerCase());let m=new Set(c.map(D=>t(D)).reduce((D,A)=>D.concat(A)));return e.set(h,{dirs:m,paths:c}),c.forEach(D=>{let A=r.get(D);A?A.push(h):r.set(D,[h])}),m.forEach(D=>{let A=r.get(D);A?A[A.length-1]instanceof Set?A[A.length-1].add(h):A.push(new Set([h])):r.set(D,[new Set([h])])}),o(h)}}}});var mc=E((D0,pc)=>{u();var ap=process.env.__FAKE_PLATFORM__||process.platform,cp=ap==="win32",lp=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:hp,O_TRUNC:fp,O_WRONLY:pp,UV_FS_O_FILEMAP:fc=0}=lp.constants,mp=cp&&!!fc,dp=512*1024,Dp=fc|fp|hp|pp;pc.exports=mp?r=>r<dp?Dp:"w":()=>"w"});var Xn=E((g0,Rc)=>{"use strict";u();var gp=require("assert"),Ep=xs(),k=require("fs"),yp=Kt(),Ue=require("path"),Sc=oc(),dc=Ki(),Ap=hc(),Cp=Zi(),re=It(),wp=Ut(),Fp=zn(),Dc=Symbol("onEntry"),Hn=Symbol("checkFs"),gc=Symbol("checkFs2"),$s=Symbol("pruneCache"),Jn=Symbol("isReusable"),ce=Symbol("makeFs"),Vn=Symbol("file"),Yn=Symbol("directory"),zs=Symbol("link"),Ec=Symbol("symlink"),yc=Symbol("hardlink"),Ac=Symbol("unsupported"),Cc=Symbol("checkPath"),nt=Symbol("mkdir"),G=Symbol("onError"),js=Symbol("pending"),wc=Symbol("pend"),tr=Symbol("unpend"),Wn=Symbol("ended"),Gn=Symbol("maybeClose"),Kn=Symbol("skip"),br=Symbol("doChown"),Sr=Symbol("uid"),kr=Symbol("gid"),_r=Symbol("checkedCwd"),kc=require("crypto"),_c=mc(),bp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Rr=bp==="win32",Sp=(r,e)=>{if(!Rr)return k.unlink(r,e);let t=r+".DELETE."+kc.randomBytes(16).toString("hex");k.rename(r,t,s=>{if(s)return e(s);k.unlink(t,e)})},kp=r=>{if(!Rr)return k.unlinkSync(r);let e=r+".DELETE."+kc.randomBytes(16).toString("hex");k.renameSync(r,e),k.unlinkSync(e)},Fc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,bc=r=>Fp(wp(re(r))).toLowerCase(),_p=(r,e)=>{e=bc(e);for(let t of r.keys()){let s=bc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},Rp=r=>{for(let e of r.keys())r.delete(e)},vr=class extends Ep{constructor(e){if(e||(e={}),e.ondone=t=>{this[Wn]=!0,this[Gn]()},super(e),this[_r]=!1,this.reservations=Ap(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[js]=0,this[Wn]=!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||Rr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=re(Ue.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Dc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Gn](){this[Wn]&&this[js]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Cc](e){if(this.strip){let t=re(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=re(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=re(e.path),s=t.split("/");if(s.includes("..")||Rr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=Cp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(Ue.isAbsolute(e.path)?e.absolute=re(Ue.resolve(e.path)):e.absolute=re(Ue.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:re(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:t}=Ue.win32.parse(e.absolute);e.absolute=t+dc.encode(e.absolute.slice(t.length));let{root:s}=Ue.win32.parse(e.path);e.path=s+dc.encode(e.path.slice(s.length))}return!0}[Dc](e){if(!this[Cc](e))return e.resume();switch(gp.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[Hn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Ac](e)}}[G](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[tr](),t.resume())}[nt](e,t,s){Sc(re(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},s)}[br](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}[Sr](e){return Fc(this.uid,e.uid,this.processUid)}[kr](e){return Fc(this.gid,e.gid,this.processGid)}[Vn](e,t){let s=e.mode&4095||this.fmode,i=new yp.WriteStream(e.absolute,{flags:_c(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&k.close(i.fd,()=>{}),i.write=()=>!0,this[G](l,e),t()});let n=1,o=l=>{if(l){i.fd&&k.close(i.fd,()=>{}),this[G](l,e),t();return}--n===0&&k.close(i.fd,c=>{c?this[G](c,e):this[tr](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let m=e.atime||new Date,D=e.mtime;k.futimes(h,m,D,A=>A?k.utimes(c,m,D,F=>o(F&&A)):o())}if(this[br](e)){n++;let m=this[Sr](e),D=this[kr](e);k.fchown(h,m,D,A=>A?k.chown(c,m,D,F=>o(F&&A)):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)}[Yn](e,t){let s=e.mode&4095||this.dmode;this[nt](e.absolute,s,i=>{if(i){this[G](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[tr](),e.resume())};e.mtime&&!this.noMtime&&(n++,k.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[br](e)&&(n++,k.chown(e.absolute,this[Sr](e),this[kr](e),o)),o()})}[Ac](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Ec](e,t){this[zs](e,e.linkpath,"symlink",t)}[yc](e,t){let s=re(Ue.resolve(this.cwd,e.linkpath));this[zs](e,s,"link",t)}[wc](){this[js]++}[tr](){this[js]--,this[Gn]()}[Kn](e){this[tr](),e.resume()}[Jn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Rr}[Hn](e){this[wc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[gc](e,s))}[$s](e){e.type==="SymbolicLink"?Rp(this.dirCache):e.type!=="Directory"&&_p(this.dirCache,e.absolute)}[gc](e,t){this[$s](e);let s=a=>{this[$s](e),t(a)},i=()=>{this[nt](this.cwd,this.dmode,a=>{if(a){this[G](a,e),s();return}this[_r]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=re(Ue.dirname(e.absolute));if(a!==this.cwd)return this[nt](a,this.dmode,l=>{if(l){this[G](l,e),s();return}o()})}o()},o=()=>{k.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[Kn](e),s();return}if(a||this[Jn](e,l))return this[ce](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=m=>this[ce](m,e,s);return c?k.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return k.rmdir(e.absolute,c=>this[ce](c,e,s))}if(e.absolute===this.cwd)return this[ce](null,e,s);Sp(e.absolute,c=>this[ce](c,e,s))})};this[_r]?n():i()}[ce](e,t,s){if(e){this[G](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Vn](t,s);case"Link":return this[yc](t,s);case"SymbolicLink":return this[Ec](t,s);case"Directory":case"GNUDumpDir":return this[Yn](t,s)}}[zs](e,t,s,i){k[s](t,e.absolute,n=>{n?this[G](n,e):(this[tr](),e.resume()),i()})}},Us=r=>{try{return[null,r()]}catch(e){return[e,null]}},Zn=class extends vr{[ce](e,t){return super[ce](e,t,()=>{})}[Hn](e){if(this[$s](e),!this[_r]){let n=this[nt](this.cwd,this.dmode);if(n)return this[G](n,e);this[_r]=!0}if(e.absolute!==this.cwd){let n=re(Ue.dirname(e.absolute));if(n!==this.cwd){let o=this[nt](n,this.dmode);if(o)return this[G](o,e)}}let[t,s]=Us(()=>k.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[Kn](e);if(t||this[Jn](e,s))return this[ce](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?Us(()=>{k.chmodSync(e.absolute,e.mode)}):[];return this[ce](a,e)}let[n]=Us(()=>k.rmdirSync(e.absolute));this[ce](n,e)}let[i]=e.absolute===this.cwd?[]:Us(()=>kp(e.absolute));this[ce](i,e)}[Vn](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{k.closeSync(n)}catch(c){l=c}(a||l)&&this[G](a||l,e),t()},n;try{n=k.openSync(e.absolute,_c(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{k.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{k.futimesSync(n,c,h)}catch(m){try{k.utimesSync(e.absolute,c,h)}catch{l=m}}}if(this[br](e)){let c=this[Sr](e),h=this[kr](e);try{k.fchownSync(n,c,h)}catch(m){try{k.chownSync(e.absolute,c,h)}catch{l=l||m}}}i(l)})}[Yn](e,t){let s=e.mode&4095||this.dmode,i=this[nt](e.absolute,s);if(i){this[G](i,e),t();return}if(e.mtime&&!this.noMtime)try{k.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[br](e))try{k.chownSync(e.absolute,this[Sr](e),this[kr](e))}catch{}t(),e.resume()}[nt](e,t){try{return Sc.sync(re(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(s){return s}}[zs](e,t,s,i){try{k[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[G](n,e)}}};vr.Sync=Zn;Rc.exports=vr});var Tc=E((E0,Oc)=>{"use strict";u();var vp=Tt(),Ws=Xn(),Bc=require("fs"),xc=Kt(),vc=require("path"),Qn=Ut();Oc.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=vp(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&&Bp(s,e),s.file&&s.sync?xp(s):s.file?Op(s,t):s.sync?Tp(s):Pp(s)};var Bp=(r,e)=>{let t=new Map(e.map(n=>[Qn(n),!0])),s=r.filter,i=(n,o)=>{let a=o||vc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(vc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(Qn(n)):n=>i(Qn(n))},xp=r=>{let e=new Ws.Sync(r),t=r.file,s=Bc.statSync(t),i=r.maxReadSize||16*1024*1024;new xc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},Op=(r,e)=>{let t=new Ws(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),Bc.stat(i,(l,c)=>{if(l)a(l);else{let h=new xc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},Tp=r=>new Ws.Sync(r),Pp=r=>new Ws(r)});var Pc=E(N=>{"use strict";u();N.c=N.create=da();N.r=N.replace=Pn();N.t=N.list=Os();N.u=N.update=ba();N.x=N.extract=Tc();N.Pack=gs();N.Unpack=Xn();N.Parse=xs();N.ReadEntry=es();N.WriteEntry=an();N.Header=jt();N.Pax=rs();N.types=zi()});var jc=E((F0,qc)=>{u();function le(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))}qc.exports=le;le.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};le.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};le.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};le.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)};le.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};le.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};le.prototype.start=le.prototype.try;le.prototype.errors=function(){return this._errors};le.prototype.attempts=function(){return this._attempts};le.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 Uc=E(kt=>{u();var Ip=jc();kt.operation=function(r){var e=kt.timeouts(r);return new Ip(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};kt.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};kt.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};kt.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=kt.operation(e),h=Array.prototype.slice.call(arguments,1),m=h.pop();h.push(function(D){c.retry(D)||(D&&(arguments[0]=c.mainError()),m.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var zc=E((S0,$c)=>{u();$c.exports=Uc()});var Gc=E((k0,Wc)=>{u();var qp=zc();function jp(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=qp.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,m){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,m):i(o.mainError())}function c(h){var m;try{m=r(a,h)}catch(D){l(D,h);return}Promise.resolve(m).then(s).catch(function(A){l(A,h)})}o.attempt(c)}return new Promise(t)}Wc.exports=jp});var Em={};Sl(Em,{ConvertError:()=>_,MANAGERS:()=>We,convert:()=>gm,getPackageManagerMeta:()=>so,getWorkspaceDetails:()=>ro,install:()=>Hs});module.exports=kl(Em);u();u();u();u();var Ll=R(fo());u();u();function Qs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function ar(r){return ar=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},ar(r)}u();function ei(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ti(r,e){if(e&&(ar(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ei(r)}u();function pt(r){return pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pt(r)}u();u();function Re(r,e){return Re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},Re(r,e)}function ri(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&&Re(r,e)}u();u();function si(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function ii(){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 Bt(r,e,t){return ii()?Bt=Reflect.construct.bind():Bt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&Re(c,o.prototype),c},Bt.apply(null,arguments)}function cr(r){var e=typeof Map=="function"?new Map:void 0;return cr=function(s){if(s===null||!si(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 Bt(s,arguments,pt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Re(i,s)},cr(r)}var xo=R(Bo());var Nl=R(require("fs-extra")),id=function(r){ri(e,r);function e(t){var s;return Qs(this,e),s=ti(this,pt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(cr(Error));u();u();var Ml=R(require("fs")),Il=R(require("path"));u();var Gl=R(require("fs")),Hl=R(require("path")),Jl=R(require("js-yaml")),Vl=require("fast-glob");u();var Ot=require("picocolors"),Ul=R(require("ora")),Oo=R(require("gradient-string")),To="#0099F7",Po="#F11712",$l="#FFFF00",hi=r=>{let e=zl(r);return t=>`\x1B[38;5;${e}m${t}${(0,Ot.reset)("")}`},pd=(0,Oo.default)(To,Po),md=hi(To),dd=hi(Po),Dd=hi($l);function zl(r){let e=parseInt(r.slice(1),16),t=Math.floor(e/(256*256))%256,s=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(i/255*5)}u();var Lo=R(require("os")),No=R(require("execa"));async function qr(r,e=[],t){let s={cwd:Lo.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...t};try{let{stdout:i}=await(0,No.default)(r,e,s);return i.trim()}catch{return}}async function pi(){let[r,e,t,s]=await Promise.all([qr("yarnpkg",["--version"]),qr("npm",["--version"]),qr("pnpm",["--version"]),qr("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Yl=R(require("fs-extra"));u();var Kl=R(require("path")),Zl=R(require("fs-extra")),Xl=require("picocolors");u();var Lc=require("stream"),Nc=require("util"),Lp=require("path"),Np=require("os"),Mc=require("fs"),Mp=R(Pc());var A0=(0,Nc.promisify)(Lc.Stream.pipeline);u();var Ic=require("fs-extra");u();var Jp=R(require("path")),Vp=R(Gc()),Hc=require("picocolors"),eo=require("fs-extra");u();u();u();u();var _=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,_)}};u();u();var _t=R(require("path")),J=require("fs-extra"),tl=R(require("execa"));u();var Xc=R(require("path")),Qc=require("fs-extra"),el=require("picocolors");u();var $e=R(require("path")),Jc=R(require("execa")),se=require("fs-extra"),Vc=require("fast-glob"),Yc=R(require("js-yaml"));var Yp=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=$e.default.join(r,"package.json");try{return(0,se.readJsonSync)(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new _(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new _(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function ot({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=Yp.exec(e);if(t){let[s,i]=t;return i}}catch{}}function ze({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=$e.default.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function to({workspaceRoot:r}){let e=$e.default.join(r,"pnpm-workspace.yaml");if((0,se.existsSync)(e))try{let t=Yc.default.load((0,se.readFileSync)(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new _(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function ut({root:r,lockFile:e,workspaceConfig:t}){let s=n=>$e.default.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 rr({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function at({workspaceRoot:r,workspaceGlobs:e}){if(!e)return[];let t=e.filter(s=>s.startsWith("!")).map(s=>s.slice(1));return e.filter(s=>!s.startsWith("!")).flatMap(s=>{let i=[`${s}/package.json`];return(0,Vc.sync)(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=$e.default.dirname(s),{name:n,description:o}=ze({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:$e.default.join(i,"node_modules")}}})}function Kc({directory:r}){let e=$e.default.resolve(process.cwd(),r);return{exists:(0,se.existsSync)(e),absolute:e}}function he({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 Zc({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 ie({project:r,options:e}){e!=null&&e.dry||(0,se.rmSync)(r.paths.lockfile,{force:!0})}async function Gs({project:r,options:e}){if(!(e!=null&&e.dry)&&(0,se.existsSync)(r.paths.lockfile))try{let{stdout:t}=await(0,Jc.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root});await(0,se.writeFile)($e.default.join(r.paths.root,"yarn.lock"),t)}catch{}finally{(0,se.rmSync)(r.paths.lockfile,{force:!0})}}function Kp({dependencyList:r,project:e,to:t}){let s=[];return e.workspaceData.workspaces.forEach(i=>{let{name:n}=i;if(r[n]){let o=r[n],a=o.startsWith("workspace:")?o.slice(10):o;r[n]=t.name==="pnpm"?`workspace:${a}`:a,s.push(n)}}),{dependencyList:r,updated:s}}function fe({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(m=>{let D=n[m];if(D){let{updated:A,dependencyList:F}=Kp({dependencyList:D,project:r,to:t});n[m]=F,o[m]=A}});let l=m=>{let D=o[m].length;if(D>0)return`${(0,el.green)(D.toString())} ${m}`},c=a.map(l).filter(Boolean),h=`./${Xc.default.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let m="updating";c.forEach((D,A)=>{c.length===1?m+=` ${D} in ${h}`:A===c.length-1?m+=`and ${D} in ${h}`:m+=` ${D}, `}),s.workspaceStep(m)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||(0,Qc.writeJSONSync)(e.paths.packageJson,n,{spaces:2})}var ct={name:"pnpm",lock:"pnpm-lock.yaml"};async function rl(r){let e=_t.default.join(r.workspaceRoot,ct.lock),t=_t.default.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=ot({workspaceRoot:r.workspaceRoot});return(0,J.existsSync)(e)||(0,J.existsSync)(t)||s===ct.name}async function Zp(r){if(!await rl(r))throw new _("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=ze(r);return{name:t,description:s,packageManager:ct.name,paths:ut({root:r.workspaceRoot,lockFile:ct.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:to(r),workspaces:at({workspaceGlobs:to(r),...r})}}}async function Xp(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(he({action:"create",packageManager:ct.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||((0,J.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),(0,J.writeFileSync)(_t.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
|
3
|
+
`).reduce(Lh,Object.create(null)),Lh=(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};gu.exports=gr});var jt=E((qd,Eu)=>{u();Eu.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 ss=E((Ud,yu)=>{"use strict";u();yu.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 Ki=E(($d,Au)=>{"use strict";u();var is=["|","<",">","?",":"],Yi=is.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),Nh=new Map(is.map((r,e)=>[r,Yi[e]])),Mh=new Map(Yi.map((r,e)=>[r,is[e]]));Au.exports={encode:r=>is.reduce((e,t)=>e.split(t).join(Nh.get(t)),r),decode:r=>Yi.reduce((e,t)=>e.split(t).join(Mh.get(t)),r)}});var Zi=E((zd,wu)=>{u();var{isAbsolute:Ih,parse:Cu}=require("path").win32;wu.exports=r=>{let e="",t=Cu(r);for(;Ih(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=Cu(r)}return[e,r]}});var bu=E((Wd,Fu)=>{"use strict";u();Fu.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 an=E((Jd,Iu)=>{"use strict";u();var xu=Gr(),Ou=rs(),Tu=Ut(),Ee=require("fs"),Su=require("path"),ge=It(),qh=jt(),Pu=(r,e)=>e?(r=ge(r).replace(/^\.(\/|$)/,""),qh(e)+"/"+r):ge(r),Uh=16*1024*1024,ku=Symbol("process"),_u=Symbol("file"),Ru=Symbol("directory"),Qi=Symbol("symlink"),Bu=Symbol("hardlink"),Er=Symbol("header"),ns=Symbol("read"),en=Symbol("lstat"),os=Symbol("onlstat"),tn=Symbol("onread"),rn=Symbol("onreadlink"),sn=Symbol("openfile"),nn=Symbol("onopenfile"),Xe=Symbol("close"),us=Symbol("mode"),on=Symbol("awaitDrain"),Xi=Symbol("ondrain"),ye=Symbol("prefix"),vu=Symbol("hadError"),Lu=ss(),jh=Ki(),Nu=Zi(),Mu=bu(),as=Lu(class extends xu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=ge(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||Uh,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=ge(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?ge(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Nu(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=jh.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=ge(t.absolute||Su.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[os](this.statCache.get(this.absolute)):this[en]()}emit(e,...t){return e==="error"&&(this[vu]=!0),super.emit(e,...t)}[en](){Ee.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[os](t)})}[os](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=zh(e),this.emit("stat",e),this[ku]()}[ku](){switch(this.type){case"File":return this[_u]();case"Directory":return this[Ru]();case"SymbolicLink":return this[Qi]();default:return this.end()}}[us](e){return Mu(e,this.type==="Directory",this.portable)}[ye](e){return Pu(e,this.prefix)}[Er](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Tu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this[us](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 Ou({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[Ru](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Er](),this.end()}[Qi](){Ee.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[rn](t)})}[rn](e){this.linkpath=ge(e),this[Er](),this.end()}[Bu](e){this.type="Link",this.linkpath=ge(Su.relative(this.cwd,e)),this.stat.size=0,this[Er](),this.end()}[_u](){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[Er](),this.stat.size===0)return this.end();this[sn]()}[sn](){Ee.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[nn](t)})}[nn](e){if(this.fd=e,this[vu])return this[Xe]();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[ns]()}[ns](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ee.read(e,t,s,i,n,(o,a)=>{if(o)return this[Xe](()=>this.emit("error",o));this[tn](a)})}[Xe](e){Ee.close(this.fd,e)}[tn](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[Xe](()=>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[Xe](()=>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[Xi]():this[on](()=>this[Xi]())}[on](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)}[Xi](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Xe](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[ns]()}}),un=class extends as{[en](){this[os](Ee.lstatSync(this.absolute))}[Qi](){this[rn](Ee.readlinkSync(this.absolute))}[sn](){this[nn](Ee.openSync(this.absolute,"r"))}[ns](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ee.readSync(t,s,i,n,o);this[tn](a),e=!1}finally{if(e)try{this[Xe](()=>{})}catch{}}}[on](e){e()}[Xe](e){Ee.closeSync(this.fd),e()}},$h=Lu(class extends xu{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=t.prefix||null,this.path=ge(e.path),this.mode=this[us](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=ge(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Nu(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Tu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Ou({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[ye](e){return Pu(e,this.prefix)}[us](e){return Mu(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});as.Sync=un;as.Tar=$h;var zh=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Iu.exports=as});var Uu=E((Vd,qu)=>{"use strict";u();qu.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var cn=E((Yd,ju)=>{"use strict";u();ju.exports=S;S.Node=Et;S.create=S;function S(r){var e=this;if(e instanceof S||(e=new S),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}S.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};S.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++}};S.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++}};S.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)Gh(this,arguments[r]);return this.length};S.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Hh(this,arguments[r]);return this.length};S.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}};S.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}};S.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};S.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};S.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};S.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};S.prototype.map=function(r,e){e=e||this;for(var t=new S,s=this.head;s!==null;)t.push(r.call(e,s.value,this)),s=s.next;return t};S.prototype.mapReverse=function(r,e){e=e||this;for(var t=new S,s=this.tail;s!==null;)t.push(r.call(e,s.value,this)),s=s.prev;return t};S.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};S.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};S.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};S.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};S.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 S;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};S.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 S;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};S.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};S.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 Et(t,null,e,r):new Et(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function Gh(r,e){r.tail=new Et(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Hh(r,e){r.head=new Et(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function Et(r,e,t,s){if(!(this instanceof Et))return new Et(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{Uu()(S)}catch{}});var gs=E((Zd,Vu)=>{"use strict";u();var ds=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},Jh=Gr(),Vh=Ui(),Yh=es(),En=an(),Kh=En.Sync,Zh=En.Tar,Xh=cn(),$u=Buffer.alloc(1024),hs=Symbol("onStat"),cs=Symbol("ended"),Ae=Symbol("queue"),$t=Symbol("current"),yt=Symbol("process"),ls=Symbol("processing"),zu=Symbol("processJob"),Ce=Symbol("jobs"),ln=Symbol("jobDone"),fs=Symbol("addFSEntry"),Wu=Symbol("addTarEntry"),mn=Symbol("stat"),dn=Symbol("readdir"),ps=Symbol("onreaddir"),ms=Symbol("pipe"),Gu=Symbol("entry"),hn=Symbol("entryOpt"),Dn=Symbol("writeEntryClass"),Ju=Symbol("write"),fn=Symbol("ondrain"),Ds=require("fs"),Hu=require("path"),Qh=ss(),pn=It(),yn=Qh(class extends Jh{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=pn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[Dn]=En,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 Vh.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[fn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[fn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[Ae]=new Xh,this[Ce]=0,this.jobs=+e.jobs||4,this[ls]=!1,this[cs]=!1}[Ju](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[cs]=!0,this[yt](),this}write(e){if(this[cs])throw new Error("write after end");return e instanceof Yh?this[Wu](e):this[fs](e),this.flowing}[Wu](e){let t=pn(Hu.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new ds(e.path,t,!1);s.entry=new Zh(e,this[hn](s)),s.entry.on("end",i=>this[ln](s)),this[Ce]+=1,this[Ae].push(s)}this[yt]()}[fs](e){let t=pn(Hu.resolve(this.cwd,e));this[Ae].push(new ds(e,t)),this[yt]()}[mn](e){e.pending=!0,this[Ce]+=1;let t=this.follow?"stat":"lstat";Ds[t](e.absolute,(s,i)=>{e.pending=!1,this[Ce]-=1,s?this.emit("error",s):this[hs](e,i)})}[hs](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[yt]()}[dn](e){e.pending=!0,this[Ce]+=1,Ds.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[Ce]-=1,t)return this.emit("error",t);this[ps](e,s)})}[ps](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[yt]()}[yt](){if(!this[ls]){this[ls]=!0;for(let e=this[Ae].head;e!==null&&this[Ce]<this.jobs;e=e.next)if(this[zu](e.value),e.value.ignore){let t=e.next;this[Ae].removeNode(e),e.next=t}this[ls]=!1,this[cs]&&!this[Ae].length&&this[Ce]===0&&(this.zip?this.zip.end($u):(super.write($u),super.end()))}}get[$t](){return this[Ae]&&this[Ae].head&&this[Ae].head.value}[ln](e){this[Ae].shift(),this[Ce]-=1,this[yt]()}[zu](e){if(!e.pending){if(e.entry){e===this[$t]&&!e.piped&&this[ms](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[hs](e,this.statCache.get(e.absolute)):this[mn](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[ps](e,this.readdirCache.get(e.absolute)):this[dn](e),!e.readdir))){if(e.entry=this[Gu](e),!e.entry){e.ignore=!0;return}e===this[$t]&&!e.piped&&this[ms](e)}}}[hn](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}}[Gu](e){this[Ce]+=1;try{return new this[Dn](e.path,this[hn](e)).on("end",()=>this[ln](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[fn](){this[$t]&&this[$t].entry&&this[$t].entry.resume()}[ms](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[fs](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()}}),gn=class extends yn{constructor(e){super(e),this[Dn]=Kh}pause(){}resume(){}[mn](e){let t=this.follow?"statSync":"lstatSync";this[hs](e,Ds[t](e.absolute))}[dn](e,t){this[ps](e,Ds.readdirSync(e.absolute))}[ms](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[fs](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[Ju](i)})}};yn.Sync=gn;Vu.exports=yn});var Kt=E(Ar=>{"use strict";u();var ef=bi(),tf=require("events").EventEmitter,Z=require("fs"),wn=Z.writev;if(!wn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;wn=(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 Vt=Symbol("_autoClose"),pe=Symbol("_close"),yr=Symbol("_ended"),B=Symbol("_fd"),Yu=Symbol("_finished"),et=Symbol("_flags"),An=Symbol("_flush"),Fn=Symbol("_handleChunk"),bn=Symbol("_makeBuf"),ws=Symbol("_mode"),Es=Symbol("_needDrain"),Ht=Symbol("_onerror"),Yt=Symbol("_onopen"),Cn=Symbol("_onread"),Wt=Symbol("_onwrite"),tt=Symbol("_open"),Ie=Symbol("_path"),At=Symbol("_pos"),we=Symbol("_queue"),Gt=Symbol("_read"),Ku=Symbol("_readSize"),Qe=Symbol("_reading"),ys=Symbol("_remain"),Zu=Symbol("_size"),As=Symbol("_write"),zt=Symbol("_writing"),Cs=Symbol("_defaultFlag"),Jt=Symbol("_errored"),Fs=class extends ef{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[Jt]=!1,this[B]=typeof t.fd=="number"?t.fd:null,this[Ie]=e,this[Ku]=t.readSize||16*1024*1024,this[Qe]=!1,this[Zu]=typeof t.size=="number"?t.size:1/0,this[ys]=this[Zu],this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[B]=="number"?this[Gt]():this[tt]()}get fd(){return this[B]}get path(){return this[Ie]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[tt](){Z.open(this[Ie],"r",(e,t)=>this[Yt](e,t))}[Yt](e,t){e?this[Ht](e):(this[B]=t,this.emit("open",t),this[Gt]())}[bn](){return Buffer.allocUnsafe(Math.min(this[Ku],this[ys]))}[Gt](){if(!this[Qe]){this[Qe]=!0;let e=this[bn]();if(e.length===0)return process.nextTick(()=>this[Cn](null,0,e));Z.read(this[B],e,0,e.length,null,(t,s,i)=>this[Cn](t,s,i))}}[Cn](e,t,s){this[Qe]=!1,e?this[Ht](e):this[Fn](t,s)&&this[Gt]()}[pe](){if(this[Vt]&&typeof this[B]=="number"){let e=this[B];this[B]=null,Z.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ht](e){this[Qe]=!0,this[pe](),this.emit("error",e)}[Fn](e,t){let s=!1;return this[ys]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[ys]<=0)&&(s=!1,this[pe](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[B]=="number"&&this[Gt]();break;case"error":return this[Jt]?void 0:(this[Jt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Sn=class extends Fs{[tt](){let e=!0;try{this[Yt](null,Z.openSync(this[Ie],"r")),e=!1}finally{e&&this[pe]()}}[Gt](){let e=!0;try{if(!this[Qe]){this[Qe]=!0;do{let t=this[bn](),s=t.length===0?0:Z.readSync(this[B],t,0,t.length,null);if(!this[Fn](s,t))break}while(!0);this[Qe]=!1}e=!1}finally{e&&this[pe]()}}[pe](){if(this[Vt]&&typeof this[B]=="number"){let e=this[B];this[B]=null,Z.closeSync(e),this.emit("close")}}},bs=class extends tf{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Jt]=!1,this[zt]=!1,this[yr]=!1,this[Es]=!1,this[we]=[],this[Ie]=e,this[B]=typeof t.fd=="number"?t.fd:null,this[ws]=t.mode===void 0?438:t.mode,this[At]=typeof t.start=="number"?t.start:null,this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[At]!==null?"r+":"w";this[Cs]=t.flags===void 0,this[et]=this[Cs]?s:t.flags,this[B]===null&&this[tt]()}emit(e,t){if(e==="error"){if(this[Jt])return;this[Jt]=!0}return super.emit(e,t)}get fd(){return this[B]}get path(){return this[Ie]}[Ht](e){this[pe](),this[zt]=!0,this.emit("error",e)}[tt](){Z.open(this[Ie],this[et],this[ws],(e,t)=>this[Yt](e,t))}[Yt](e,t){this[Cs]&&this[et]==="r+"&&e&&e.code==="ENOENT"?(this[et]="w",this[tt]()):e?this[Ht](e):(this[B]=t,this.emit("open",t),this[An]())}end(e,t){return e&&this.write(e,t),this[yr]=!0,!this[zt]&&!this[we].length&&typeof this[B]=="number"&&this[Wt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[yr]?(this.emit("error",new Error("write() after end()")),!1):this[B]===null||this[zt]||this[we].length?(this[we].push(e),this[Es]=!0,!1):(this[zt]=!0,this[As](e),!0)}[As](e){Z.write(this[B],e,0,e.length,this[At],(t,s)=>this[Wt](t,s))}[Wt](e,t){e?this[Ht](e):(this[At]!==null&&(this[At]+=t),this[we].length?this[An]():(this[zt]=!1,this[yr]&&!this[Yu]?(this[Yu]=!0,this[pe](),this.emit("finish")):this[Es]&&(this[Es]=!1,this.emit("drain"))))}[An](){if(this[we].length===0)this[yr]&&this[Wt](null,0);else if(this[we].length===1)this[As](this[we].pop());else{let e=this[we];this[we]=[],wn(this[B],e,this[At],(t,s)=>this[Wt](t,s))}}[pe](){if(this[Vt]&&typeof this[B]=="number"){let e=this[B];this[B]=null,Z.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},kn=class extends bs{[tt](){let e;if(this[Cs]&&this[et]==="r+")try{e=Z.openSync(this[Ie],this[et],this[ws])}catch(t){if(t.code==="ENOENT")return this[et]="w",this[tt]();throw t}else e=Z.openSync(this[Ie],this[et],this[ws]);this[Yt](null,e)}[pe](){if(this[Vt]&&typeof this[B]=="number"){let e=this[B];this[B]=null,Z.closeSync(e),this.emit("close")}}[As](e){let t=!0;try{this[Wt](null,Z.writeSync(this[B],e,0,e.length,this[At])),t=!1}finally{if(t)try{this[pe]()}catch{}}}};Ar.ReadStream=Fs;Ar.ReadStreamSync=Sn;Ar.WriteStream=bs;Ar.WriteStreamSync=kn});var xs=E((e0,na)=>{"use strict";u();var rf=ss(),sf=Ut(),nf=require("events"),of=cn(),uf=1024*1024,af=es(),Xu=rs(),cf=Ui(),{nextTick:lf}=require("process"),_n=Buffer.from([31,139]),ne=Symbol("state"),Ct=Symbol("writeEntry"),qe=Symbol("readEntry"),Rn=Symbol("nextEntry"),Qu=Symbol("processEntry"),oe=Symbol("extendedHeader"),Cr=Symbol("globalExtendedHeader"),rt=Symbol("meta"),ea=Symbol("emitMeta"),O=Symbol("buffer"),Ue=Symbol("queue"),wt=Symbol("ended"),ta=Symbol("emittedEnd"),Ft=Symbol("emit"),X=Symbol("unzip"),Ss=Symbol("consumeChunk"),ks=Symbol("consumeChunkSub"),Bn=Symbol("consumeBody"),ra=Symbol("consumeMeta"),sa=Symbol("consumeHeader"),_s=Symbol("consuming"),vn=Symbol("bufferConcat"),xn=Symbol("maybeEnd"),wr=Symbol("writing"),st=Symbol("aborted"),Rs=Symbol("onDone"),bt=Symbol("sawValidEntry"),Bs=Symbol("sawNullBlock"),vs=Symbol("sawEOF"),ia=Symbol("closeStream"),hf=r=>!0;na.exports=rf(class extends nf{constructor(e){e=e||{},super(e),this.file=e.file||"",this[bt]=null,this.on(Rs,t=>{(this[ne]==="begin"||this[bt]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Rs,e.ondone):this.on(Rs,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||uf,this.filter=typeof e.filter=="function"?e.filter:hf,this.writable=!0,this.readable=!1,this[Ue]=new of,this[O]=null,this[qe]=null,this[Ct]=null,this[ne]="begin",this[rt]="",this[oe]=null,this[Cr]=null,this[wt]=!1,this[X]=null,this[st]=!1,this[Bs]=!1,this[vs]=!1,this.on("end",()=>this[ia]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[sa](e,t){this[bt]===null&&(this[bt]=!1);let s;try{s=new sf(e,t,this[oe],this[Cr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Bs]?(this[vs]=!0,this[ne]==="begin"&&(this[ne]="header"),this[Ft]("eof")):(this[Bs]=!0,this[Ft]("nullBlock"));else if(this[Bs]=!1,!s.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:s});else if(!s.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:s});else{let i=s.type;if(/^(Symbolic)?Link$/.test(i)&&!s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:s});else if(!/^(Symbolic)?Link$/.test(i)&&s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:s});else{let n=this[Ct]=new af(s,this[oe],this[Cr]);if(!this[bt])if(n.remain){let o=()=>{n.invalid||(this[bt]=!0)};n.on("end",o)}else this[bt]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Ft]("ignoredEntry",n),this[ne]="ignore",n.resume()):n.size>0&&(this[rt]="",n.on("data",o=>this[rt]+=o),this[ne]="meta"):(this[oe]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Ft]("ignoredEntry",n),this[ne]=n.remain?"ignore":"header",n.resume()):(n.remain?this[ne]="body":(this[ne]="header",n.end()),this[qe]?this[Ue].push(n):(this[Ue].push(n),this[Rn]())))}}}[ia](){lf(()=>this.emit("close"))}[Qu](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[qe]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[Rn]()),t=!1)):(this[qe]=null,t=!1),t}[Rn](){do;while(this[Qu](this[Ue].shift()));if(!this[Ue].length){let e=this[qe];!e||e.flowing||e.size===e.remain?this[wr]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[Bn](e,t){let s=this[Ct],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[ne]="header",this[Ct]=null,s.end()),n.length}[ra](e,t){let s=this[Ct],i=this[Bn](e,t);return this[Ct]||this[ea](s),i}[Ft](e,t,s){!this[Ue].length&&!this[qe]?this.emit(e,t,s):this[Ue].push([e,t,s])}[ea](e){switch(this[Ft]("meta",this[rt]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[oe]=Xu.parse(this[rt],this[oe],!1);break;case"GlobalExtendedHeader":this[Cr]=Xu.parse(this[rt],this[Cr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[oe]=this[oe]||Object.create(null),this[oe].path=this[rt].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[oe]=this[oe]||Object.create(null),this[oe].linkpath=this[rt].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[st]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[st])return;if(this[X]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<_n.length)return this[O]=e,!0;for(let s=0;this[X]===null&&s<_n.length;s++)e[s]!==_n[s]&&(this[X]=!1);if(this[X]===null){let s=this[wt];this[wt]=!1,this[X]=new cf.Unzip,this[X].on("data",n=>this[Ss](n)),this[X].on("error",n=>this.abort(n)),this[X].on("end",n=>{this[wt]=!0,this[Ss]()}),this[wr]=!0;let i=this[X][s?"end":"write"](e);return this[wr]=!1,i}}this[wr]=!0,this[X]?this[X].write(e):this[Ss](e),this[wr]=!1;let t=this[Ue].length?!1:this[qe]?this[qe].flowing:!0;return!t&&!this[Ue].length&&this[qe].once("drain",s=>this.emit("drain")),t}[vn](e){e&&!this[st]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[xn](){if(this[wt]&&!this[ta]&&!this[st]&&!this[_s]){this[ta]=!0;let e=this[Ct];if(e&&e.blockRemain){let t=this[O]?this[O].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[O]&&e.write(this[O]),e.end()}this[Ft](Rs)}}[Ss](e){if(this[_s])this[vn](e);else if(!e&&!this[O])this[xn]();else{if(this[_s]=!0,this[O]){this[vn](e);let t=this[O];this[O]=null,this[ks](t)}else this[ks](e);for(;this[O]&&this[O].length>=512&&!this[st]&&!this[vs];){let t=this[O];this[O]=null,this[ks](t)}this[_s]=!1}(!this[O]||this[wt])&&this[xn]()}[ks](e){let t=0,s=e.length;for(;t+512<=s&&!this[st]&&!this[vs];)switch(this[ne]){case"begin":case"header":this[sa](e,t),t+=512;break;case"ignore":case"body":t+=this[Bn](e,t);break;case"meta":t+=this[ra](e,t);break;default:throw new Error("invalid state: "+this[ne])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[st]||(this[X]?this[X].end(e):(this[wt]=!0,this.write(e)))}})});var Os=E((t0,ca)=>{"use strict";u();var ff=Tt(),ua=xs(),Zt=require("fs"),pf=Kt(),oa=require("path"),On=jt();ca.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=ff(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&&df(s,e),s.noResume||mf(s),s.file&&s.sync?Df(s):s.file?gf(s,t):aa(s)};var mf=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},df=(r,e)=>{let t=new Map(e.map(n=>[On(n),!0])),s=r.filter,i=(n,o)=>{let a=o||oa.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(oa.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(On(n)):n=>i(On(n))},Df=r=>{let e=aa(r),t=r.file,s=!0,i;try{let n=Zt.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(Zt.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=Zt.openSync(t,"r");a<n.size;){let c=Zt.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{Zt.closeSync(i)}catch{}}},gf=(r,e)=>{let t=new ua(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Zt.stat(i,(l,c)=>{if(l)a(l);else{let h=new pf.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},aa=r=>new ua(r)});var da=E((r0,ma)=>{"use strict";u();var Ef=Tt(),Ts=gs(),la=Kt(),ha=Os(),fa=require("path");ma.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=Ef(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?yf(s,e):s.file?Af(s,e,t):s.sync?Cf(s,e):wf(s,e)};var yf=(r,e)=>{let t=new Ts.Sync(r),s=new la.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),pa(t,e)},Af=(r,e,t)=>{let s=new Ts(r),i=new la.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 Tn(s,e),t?n.then(t,t):n},pa=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?ha({file:fa.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Tn=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return ha({file:fa.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Tn(r,e));r.add(t)}r.end()},Cf=(r,e)=>{let t=new Ts.Sync(r);return pa(t,e),t},wf=(r,e)=>{let t=new Ts(r);return Tn(t,e),t}});var Pn=E((s0,wa)=>{"use strict";u();var Ff=Tt(),Da=gs(),te=require("fs"),ga=Kt(),Ea=Os(),ya=require("path"),Aa=Ut();wa.exports=(r,e,t)=>{let s=Ff(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?bf(s,e):kf(s,e,t)};var bf=(r,e)=>{let t=new Da.Sync(r),s=!0,i,n;try{try{i=te.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=te.openSync(r.file,"w+");else throw l}let o=te.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,m=0;h<512;h+=m){if(m=te.readSync(i,a,h,a.length-h,n+h),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!m)break e}let l=new Aa(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,Sf(r,t,n,i,e)}finally{if(s)try{te.closeSync(i)}catch{}}},Sf=(r,e,t,s,i)=>{let n=new ga.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),_f(e,i)},kf=(r,e,t)=>{e=Array.from(e);let s=new Da(r),i=(o,a,l)=>{let c=(F,T)=>{F?te.close(o,b=>l(F)):l(null,T)},h=0;if(a===0)return c(null,0);let m=0,D=Buffer.alloc(512),A=(F,T)=>{if(F)return c(F);if(m+=T,m<512&&T)return te.read(o,D,m,D.length-m,h+m,A);if(h===0&&D[0]===31&&D[1]===139)return c(new Error("cannot append to compressed archives"));if(m<512)return c(null,h);let b=new Aa(D);if(!b.cksumValid)return c(null,h);let x=512*Math.ceil(b.size/512);if(h+x+512>a||(h+=x+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(b.path,b.mtime),m=0,te.read(o,D,0,512,h,A)};te.read(o,D,0,512,h,A)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,m)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",te.open(r.file,l,c);if(h)return a(h);te.fstat(m,(D,A)=>{if(D)return te.close(m,()=>a(D));i(m,A.size,(F,T)=>{if(F)return a(F);let b=new ga.WriteStream(r.file,{fd:m,start:T});s.pipe(b),b.on("error",a),b.on("close",o),Ca(s,e)})})};te.open(r.file,l,c)});return t?n.then(t,t):n},_f=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Ea({file:ya.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Ca=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Ea({file:ya.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Ca(r,e));r.add(t)}r.end()}});var ba=E((i0,Fa)=>{"use strict";u();var Rf=Tt(),Bf=Pn();Fa.exports=(r,e,t)=>{let s=Rf(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),vf(s),Bf(s,e,t)};var vf=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 _a=E((n0,ka)=>{u();var{promisify:Sa}=require("util"),it=require("fs"),xf=r=>{if(!r)r={mode:511,fs:it};else if(typeof r=="object")r={mode:511,fs:it,...r};else if(typeof r=="number")r={mode:r,fs:it};else if(typeof r=="string")r={mode:parseInt(r,8),fs:it};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||it.mkdir,r.mkdirAsync=Sa(r.mkdir),r.stat=r.stat||r.fs.stat||it.stat,r.statAsync=Sa(r.stat),r.statSync=r.statSync||r.fs.statSync||it.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||it.mkdirSync,r};ka.exports=xf});var Ba=E((o0,Ra)=>{u();var Of=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Tf,parse:Pf}=require("path"),Lf=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=Tf(r),Of==="win32"){let e=/[*|"<>?:]/,{root:t}=Pf(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Ra.exports=Lf});var Pa=E((u0,Ta)=>{u();var{dirname:va}=require("path"),xa=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?xa(r,va(e),e):void 0),Oa=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Oa(r,va(e),e):void 0}};Ta.exports={findMade:xa,findMadeSync:Oa}});var Mn=E((a0,Na)=>{u();var{dirname:La}=require("path"),Ln=(r,e,t)=>{e.recursive=!1;let s=La(r);return s===r?e.mkdirAsync(r,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(r,e).then(()=>t||r,i=>{if(i.code==="ENOENT")return Ln(s,e).then(n=>Ln(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})})},Nn=(r,e,t)=>{let s=La(r);if(e.recursive=!1,s===r)try{return e.mkdirSync(r,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(r,e),t||r}catch(i){if(i.code==="ENOENT")return Nn(r,e,Nn(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};Na.exports={mkdirpManual:Ln,mkdirpManualSync:Nn}});var qa=E((c0,Ia)=>{u();var{dirname:Ma}=require("path"),{findMade:Nf,findMadeSync:Mf}=Pa(),{mkdirpManual:If,mkdirpManualSync:qf}=Mn(),Uf=(r,e)=>(e.recursive=!0,Ma(r)===r?e.mkdirAsync(r,e):Nf(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return If(r,e);throw i}))),jf=(r,e)=>{if(e.recursive=!0,Ma(r)===r)return e.mkdirSync(r,e);let s=Mf(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return qf(r,e);throw i}};Ia.exports={mkdirpNative:Uf,mkdirpNativeSync:jf}});var za=E((l0,$a)=>{u();var Ua=require("fs"),$f=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,In=$f.replace(/^v/,"").split("."),ja=+In[0]>10||+In[0]==10&&+In[1]>=12,zf=ja?r=>r.mkdir===Ua.mkdir:()=>!1,Wf=ja?r=>r.mkdirSync===Ua.mkdirSync:()=>!1;$a.exports={useNative:zf,useNativeSync:Wf}});var Ya=E((h0,Va)=>{u();var Xt=_a(),Qt=Ba(),{mkdirpNative:Wa,mkdirpNativeSync:Ga}=qa(),{mkdirpManual:Ha,mkdirpManualSync:Ja}=Mn(),{useNative:Gf,useNativeSync:Hf}=za(),er=(r,e)=>(r=Qt(r),e=Xt(e),Gf(e)?Wa(r,e):Ha(r,e)),Jf=(r,e)=>(r=Qt(r),e=Xt(e),Hf(e)?Ga(r,e):Ja(r,e));er.sync=Jf;er.native=(r,e)=>Wa(Qt(r),Xt(e));er.manual=(r,e)=>Ha(Qt(r),Xt(e));er.nativeSync=(r,e)=>Ga(Qt(r),Xt(e));er.manualSync=(r,e)=>Ja(Qt(r),Xt(e));Va.exports=er});var rc=E((f0,tc)=>{"use strict";u();var ue=require("fs"),St=require("path"),Vf=ue.lchown?"lchown":"chown",Yf=ue.lchownSync?"lchownSync":"chownSync",Za=ue.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Ka=(r,e,t)=>{try{return ue[Yf](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Kf=(r,e,t)=>{try{return ue.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Zf=Za?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):ue.chown(r,e,t,s)}:(r,e,t,s)=>s,qn=Za?(r,e,t)=>{try{return Ka(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Kf(r,e,t)}}:(r,e,t)=>Ka(r,e,t),Xf=process.version,Xa=(r,e,t)=>ue.readdir(r,e,t),Qf=(r,e)=>ue.readdirSync(r,e);/^v4\./.test(Xf)&&(Xa=(r,e,t)=>ue.readdir(r,t));var Ps=(r,e,t,s)=>{ue[Vf](r,e,t,Zf(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},Qa=(r,e,t,s,i)=>{if(typeof e=="string")return ue.lstat(St.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,Qa(r,o,t,s,i)});if(e.isDirectory())Un(St.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=St.resolve(r,e.name);Ps(o,t,s,i)});else{let n=St.resolve(r,e.name);Ps(n,t,s,i)}},Un=(r,e,t,s)=>{Xa(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 Ps(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Ps(r,e,t,s)}};n.forEach(c=>Qa(r,c,e,t,l))})},ep=(r,e,t,s)=>{if(typeof e=="string")try{let i=ue.lstatSync(St.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&ec(St.resolve(r,e.name),t,s),qn(St.resolve(r,e.name),t,s)},ec=(r,e,t)=>{let s;try{s=Qf(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return qn(r,e,t);throw i}return s&&s.length&&s.forEach(i=>ep(r,i,e,t)),qn(r,e,t)};tc.exports=Un;Un.sync=ec});var oc=E((p0,jn)=>{"use strict";u();var sc=Ya(),ae=require("fs"),Ls=require("path"),ic=rc(),me=It(),Ns=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Ms=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},Is=(r,e)=>r.get(me(e)),Fr=(r,e,t)=>r.set(me(e),t),tp=(r,e)=>{ae.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Ms(r,t&&t.code||"ENOTDIR")),e(t)})};jn.exports=(r,e,t)=>{r=me(r);let s=e.umask,i=e.mode|448,n=(i&s)!==0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,h=e.unlink,m=e.cache,D=me(e.cwd),A=(b,x)=>{b?t(b):(Fr(m,r,!0),x&&l?ic(x,o,a,lt=>A(lt)):n?ae.chmod(r,i,t):t())};if(m&&Is(m,r)===!0)return A();if(r===D)return tp(r,A);if(c)return sc(r,{mode:i}).then(b=>A(null,b),A);let T=me(Ls.relative(D,r)).split("/");qs(D,T,i,m,h,D,null,A)};var qs=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=me(Ls.resolve(r+"/"+l));if(Is(s,c))return qs(c,e,t,s,i,n,o,a);ae.mkdir(c,t,nc(c,e,t,s,i,n,o,a))},nc=(r,e,t,s,i,n,o,a)=>l=>{l?ae.lstat(r,(c,h)=>{if(c)c.path=c.path&&me(c.path),a(c);else if(h.isDirectory())qs(r,e,t,s,i,n,o,a);else if(i)ae.unlink(r,m=>{if(m)return a(m);ae.mkdir(r,t,nc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new Ns(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,qs(r,e,t,s,i,n,o,a))},rp=r=>{let e=!1,t="ENOTDIR";try{e=ae.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Ms(r,t)}};jn.exports.sync=(r,e)=>{r=me(r);let t=e.umask,s=e.mode|448,i=(s&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,h=e.cache,m=me(e.cwd),D=b=>{Fr(h,r,!0),b&&a&&ic.sync(b,n,o),i&&ae.chmodSync(r,s)};if(h&&Is(h,r)===!0)return D();if(r===m)return rp(m),D();if(l)return D(sc.sync(r,s));let F=me(Ls.relative(m,r)).split("/"),T=null;for(let b=F.shift(),x=m;b&&(x+="/"+b);b=F.shift())if(x=me(Ls.resolve(x)),!Is(h,x))try{ae.mkdirSync(x,s),T=T||x,Fr(h,x,!0)}catch{let de=ae.lstatSync(x);if(de.isDirectory()){Fr(h,x,!0);continue}else if(c){ae.unlinkSync(x),ae.mkdirSync(x,s),T=T||x,Fr(h,x,!0);continue}else if(de.isSymbolicLink())return new Ns(x,x+"/"+F.join("/"))}return D(T)}});var zn=E((m0,uc)=>{u();var $n=Object.create(null),{hasOwnProperty:sp}=Object.prototype;uc.exports=r=>(sp.call($n,r)||($n[r]=r.normalize("NFKD")),$n[r])});var hc=E((d0,lc)=>{u();var ac=require("assert"),ip=zn(),np=jt(),{join:cc}=require("path"),op=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,up=op==="win32";lc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((m,D)=>(m.length&&(D=cc(m[m.length-1],D)),m.push(D||"/"),m),[]),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(m=>r.get(m)),dirs:[...h.dirs].map(m=>r.get(m))}},n=c=>{let{paths:h,dirs:m}=i(c);return h.every(D=>D[0]===c)&&m.every(D=>D[0]instanceof Set&&D[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:m}=e.get(c),D=new Set;return h.forEach(A=>{let F=r.get(A);ac.equal(F[0],c),F.length===1?r.delete(A):(F.shift(),typeof F[0]=="function"?D.add(F[0]):F[0].forEach(T=>D.add(T)))}),m.forEach(A=>{let F=r.get(A);ac(F[0]instanceof Set),F[0].size===1&&F.length===1?r.delete(A):F[0].size===1?(F.shift(),D.add(F[0])):F[0].delete(c)}),s.delete(c),D.forEach(A=>o(A)),!0};return{check:n,reserve:(c,h)=>{c=up?["win32 parallelization disabled"]:c.map(D=>ip(np(cc(D))).toLowerCase());let m=new Set(c.map(D=>t(D)).reduce((D,A)=>D.concat(A)));return e.set(h,{dirs:m,paths:c}),c.forEach(D=>{let A=r.get(D);A?A.push(h):r.set(D,[h])}),m.forEach(D=>{let A=r.get(D);A?A[A.length-1]instanceof Set?A[A.length-1].add(h):A.push(new Set([h])):r.set(D,[new Set([h])])}),o(h)}}}});var mc=E((D0,pc)=>{u();var ap=process.env.__FAKE_PLATFORM__||process.platform,cp=ap==="win32",lp=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:hp,O_TRUNC:fp,O_WRONLY:pp,UV_FS_O_FILEMAP:fc=0}=lp.constants,mp=cp&&!!fc,dp=512*1024,Dp=fc|fp|hp|pp;pc.exports=mp?r=>r<dp?Dp:"w":()=>"w"});var Xn=E((g0,Rc)=>{"use strict";u();var gp=require("assert"),Ep=xs(),k=require("fs"),yp=Kt(),je=require("path"),Sc=oc(),dc=Ki(),Ap=hc(),Cp=Zi(),re=It(),wp=jt(),Fp=zn(),Dc=Symbol("onEntry"),Hn=Symbol("checkFs"),gc=Symbol("checkFs2"),$s=Symbol("pruneCache"),Jn=Symbol("isReusable"),ce=Symbol("makeFs"),Vn=Symbol("file"),Yn=Symbol("directory"),zs=Symbol("link"),Ec=Symbol("symlink"),yc=Symbol("hardlink"),Ac=Symbol("unsupported"),Cc=Symbol("checkPath"),nt=Symbol("mkdir"),G=Symbol("onError"),Us=Symbol("pending"),wc=Symbol("pend"),tr=Symbol("unpend"),Wn=Symbol("ended"),Gn=Symbol("maybeClose"),Kn=Symbol("skip"),br=Symbol("doChown"),Sr=Symbol("uid"),kr=Symbol("gid"),_r=Symbol("checkedCwd"),kc=require("crypto"),_c=mc(),bp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Rr=bp==="win32",Sp=(r,e)=>{if(!Rr)return k.unlink(r,e);let t=r+".DELETE."+kc.randomBytes(16).toString("hex");k.rename(r,t,s=>{if(s)return e(s);k.unlink(t,e)})},kp=r=>{if(!Rr)return k.unlinkSync(r);let e=r+".DELETE."+kc.randomBytes(16).toString("hex");k.renameSync(r,e),k.unlinkSync(e)},Fc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,bc=r=>Fp(wp(re(r))).toLowerCase(),_p=(r,e)=>{e=bc(e);for(let t of r.keys()){let s=bc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},Rp=r=>{for(let e of r.keys())r.delete(e)},Br=class extends Ep{constructor(e){if(e||(e={}),e.ondone=t=>{this[Wn]=!0,this[Gn]()},super(e),this[_r]=!1,this.reservations=Ap(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[Us]=0,this[Wn]=!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||Rr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=re(je.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Dc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Gn](){this[Wn]&&this[Us]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Cc](e){if(this.strip){let t=re(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=re(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=re(e.path),s=t.split("/");if(s.includes("..")||Rr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=Cp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(je.isAbsolute(e.path)?e.absolute=re(je.resolve(e.path)):e.absolute=re(je.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:re(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:t}=je.win32.parse(e.absolute);e.absolute=t+dc.encode(e.absolute.slice(t.length));let{root:s}=je.win32.parse(e.path);e.path=s+dc.encode(e.path.slice(s.length))}return!0}[Dc](e){if(!this[Cc](e))return e.resume();switch(gp.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[Hn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Ac](e)}}[G](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[tr](),t.resume())}[nt](e,t,s){Sc(re(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},s)}[br](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}[Sr](e){return Fc(this.uid,e.uid,this.processUid)}[kr](e){return Fc(this.gid,e.gid,this.processGid)}[Vn](e,t){let s=e.mode&4095||this.fmode,i=new yp.WriteStream(e.absolute,{flags:_c(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&k.close(i.fd,()=>{}),i.write=()=>!0,this[G](l,e),t()});let n=1,o=l=>{if(l){i.fd&&k.close(i.fd,()=>{}),this[G](l,e),t();return}--n===0&&k.close(i.fd,c=>{c?this[G](c,e):this[tr](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let m=e.atime||new Date,D=e.mtime;k.futimes(h,m,D,A=>A?k.utimes(c,m,D,F=>o(F&&A)):o())}if(this[br](e)){n++;let m=this[Sr](e),D=this[kr](e);k.fchown(h,m,D,A=>A?k.chown(c,m,D,F=>o(F&&A)):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)}[Yn](e,t){let s=e.mode&4095||this.dmode;this[nt](e.absolute,s,i=>{if(i){this[G](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[tr](),e.resume())};e.mtime&&!this.noMtime&&(n++,k.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[br](e)&&(n++,k.chown(e.absolute,this[Sr](e),this[kr](e),o)),o()})}[Ac](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Ec](e,t){this[zs](e,e.linkpath,"symlink",t)}[yc](e,t){let s=re(je.resolve(this.cwd,e.linkpath));this[zs](e,s,"link",t)}[wc](){this[Us]++}[tr](){this[Us]--,this[Gn]()}[Kn](e){this[tr](),e.resume()}[Jn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Rr}[Hn](e){this[wc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[gc](e,s))}[$s](e){e.type==="SymbolicLink"?Rp(this.dirCache):e.type!=="Directory"&&_p(this.dirCache,e.absolute)}[gc](e,t){this[$s](e);let s=a=>{this[$s](e),t(a)},i=()=>{this[nt](this.cwd,this.dmode,a=>{if(a){this[G](a,e),s();return}this[_r]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=re(je.dirname(e.absolute));if(a!==this.cwd)return this[nt](a,this.dmode,l=>{if(l){this[G](l,e),s();return}o()})}o()},o=()=>{k.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[Kn](e),s();return}if(a||this[Jn](e,l))return this[ce](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=m=>this[ce](m,e,s);return c?k.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return k.rmdir(e.absolute,c=>this[ce](c,e,s))}if(e.absolute===this.cwd)return this[ce](null,e,s);Sp(e.absolute,c=>this[ce](c,e,s))})};this[_r]?n():i()}[ce](e,t,s){if(e){this[G](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Vn](t,s);case"Link":return this[yc](t,s);case"SymbolicLink":return this[Ec](t,s);case"Directory":case"GNUDumpDir":return this[Yn](t,s)}}[zs](e,t,s,i){k[s](t,e.absolute,n=>{n?this[G](n,e):(this[tr](),e.resume()),i()})}},js=r=>{try{return[null,r()]}catch(e){return[e,null]}},Zn=class extends Br{[ce](e,t){return super[ce](e,t,()=>{})}[Hn](e){if(this[$s](e),!this[_r]){let n=this[nt](this.cwd,this.dmode);if(n)return this[G](n,e);this[_r]=!0}if(e.absolute!==this.cwd){let n=re(je.dirname(e.absolute));if(n!==this.cwd){let o=this[nt](n,this.dmode);if(o)return this[G](o,e)}}let[t,s]=js(()=>k.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[Kn](e);if(t||this[Jn](e,s))return this[ce](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?js(()=>{k.chmodSync(e.absolute,e.mode)}):[];return this[ce](a,e)}let[n]=js(()=>k.rmdirSync(e.absolute));this[ce](n,e)}let[i]=e.absolute===this.cwd?[]:js(()=>kp(e.absolute));this[ce](i,e)}[Vn](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{k.closeSync(n)}catch(c){l=c}(a||l)&&this[G](a||l,e),t()},n;try{n=k.openSync(e.absolute,_c(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{k.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{k.futimesSync(n,c,h)}catch(m){try{k.utimesSync(e.absolute,c,h)}catch{l=m}}}if(this[br](e)){let c=this[Sr](e),h=this[kr](e);try{k.fchownSync(n,c,h)}catch(m){try{k.chownSync(e.absolute,c,h)}catch{l=l||m}}}i(l)})}[Yn](e,t){let s=e.mode&4095||this.dmode,i=this[nt](e.absolute,s);if(i){this[G](i,e),t();return}if(e.mtime&&!this.noMtime)try{k.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[br](e))try{k.chownSync(e.absolute,this[Sr](e),this[kr](e))}catch{}t(),e.resume()}[nt](e,t){try{return Sc.sync(re(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(s){return s}}[zs](e,t,s,i){try{k[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[G](n,e)}}};Br.Sync=Zn;Rc.exports=Br});var Tc=E((E0,Oc)=>{"use strict";u();var Bp=Tt(),Ws=Xn(),vc=require("fs"),xc=Kt(),Bc=require("path"),Qn=jt();Oc.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=Bp(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&&vp(s,e),s.file&&s.sync?xp(s):s.file?Op(s,t):s.sync?Tp(s):Pp(s)};var vp=(r,e)=>{let t=new Map(e.map(n=>[Qn(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(Qn(n)):n=>i(Qn(n))},xp=r=>{let e=new Ws.Sync(r),t=r.file,s=vc.statSync(t),i=r.maxReadSize||16*1024*1024;new xc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},Op=(r,e)=>{let t=new Ws(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),vc.stat(i,(l,c)=>{if(l)a(l);else{let h=new xc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},Tp=r=>new Ws.Sync(r),Pp=r=>new Ws(r)});var Pc=E(N=>{"use strict";u();N.c=N.create=da();N.r=N.replace=Pn();N.t=N.list=Os();N.u=N.update=ba();N.x=N.extract=Tc();N.Pack=gs();N.Unpack=Xn();N.Parse=xs();N.ReadEntry=es();N.WriteEntry=an();N.Header=Ut();N.Pax=rs();N.types=zi()});var Uc=E((F0,qc)=>{u();function le(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))}qc.exports=le;le.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};le.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};le.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};le.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)};le.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};le.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};le.prototype.start=le.prototype.try;le.prototype.errors=function(){return this._errors};le.prototype.attempts=function(){return this._attempts};le.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 jc=E(kt=>{u();var Ip=Uc();kt.operation=function(r){var e=kt.timeouts(r);return new Ip(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};kt.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};kt.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};kt.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=kt.operation(e),h=Array.prototype.slice.call(arguments,1),m=h.pop();h.push(function(D){c.retry(D)||(D&&(arguments[0]=c.mainError()),m.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var zc=E((S0,$c)=>{u();$c.exports=jc()});var Gc=E((k0,Wc)=>{u();var qp=zc();function Up(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=qp.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,m){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,m):i(o.mainError())}function c(h){var m;try{m=r(a,h)}catch(D){l(D,h);return}Promise.resolve(m).then(s).catch(function(A){l(A,h)})}o.attempt(c)}return new Promise(t)}Wc.exports=Up});var Em={};Sl(Em,{ConvertError:()=>_,MANAGERS:()=>We,convert:()=>gm,getPackageManagerMeta:()=>so,getWorkspaceDetails:()=>ro,install:()=>Hs});module.exports=kl(Em);u();u();u();u();var Ll=R(fo());u();u();function Qs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function ar(r){return ar=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},ar(r)}u();function ei(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ti(r,e){if(e&&(ar(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ei(r)}u();function pt(r){return pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pt(r)}u();u();function Re(r,e){return Re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},Re(r,e)}function ri(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&&Re(r,e)}u();u();function si(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function ii(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vt(r,e,t){return ii()?vt=Reflect.construct.bind():vt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&Re(c,o.prototype),c},vt.apply(null,arguments)}function cr(r){var e=typeof Map=="function"?new Map:void 0;return cr=function(s){if(s===null||!si(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(s))return e.get(s);e.set(s,i)}function i(){return vt(s,arguments,pt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Re(i,s)},cr(r)}var xo=R(vo());var Nl=R(require("fs-extra")),id=function(r){ri(e,r);function e(t){var s;return Qs(this,e),s=ti(this,pt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(cr(Error));u();u();var Ml=R(require("fs")),Il=R(require("path"));u();var Gl=R(require("fs")),Hl=R(require("path")),Jl=R(require("js-yaml")),Vl=require("fast-glob");u();var Ot=require("picocolors"),jl=R(require("ora")),Oo=R(require("gradient-string")),To="#0099F7",Po="#F11712",$l="#FFFF00",hi=r=>{let e=zl(r);return t=>`\x1B[38;5;${e}m${t}${(0,Ot.reset)("")}`},pd=(0,Oo.default)(To,Po),md=hi(To),dd=hi(Po),Dd=hi($l);function zl(r){let e=parseInt(r.slice(1),16),t=Math.floor(e/(256*256))%256,s=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(i/255*5)}u();var Lo=R(require("os")),No=R(require("execa"));async function qr(r,e=[],t){let s={cwd:Lo.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...t};try{let{stdout:i}=await(0,No.default)(r,e,s);return i.trim()}catch{return}}async function pi(){let[r,e,t,s]=await Promise.all([qr("yarnpkg",["--version"]),qr("npm",["--version"]),qr("pnpm",["--version"]),qr("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Yl=R(require("fs-extra"));u();var Kl=R(require("path")),Zl=R(require("fs-extra")),Xl=require("picocolors");u();var Lc=require("stream"),Nc=require("util"),Lp=require("path"),Np=require("os"),Mc=require("fs"),Mp=R(Pc());var A0=(0,Nc.promisify)(Lc.Stream.pipeline);u();var Ic=require("fs-extra");u();var Jp=R(require("path")),Vp=R(Gc()),Hc=require("picocolors"),eo=require("fs-extra");u();u();u();u();var _=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,_)}};u();u();var _t=R(require("path")),J=require("fs-extra"),tl=R(require("execa"));u();var Xc=R(require("path")),Qc=require("fs-extra"),el=require("picocolors");u();var $e=R(require("path")),Jc=R(require("execa")),se=require("fs-extra"),Vc=require("fast-glob"),Yc=R(require("js-yaml"));var Yp=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=$e.default.join(r,"package.json");try{return(0,se.readJsonSync)(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new _(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new _(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function ot({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=Yp.exec(e);if(t){let[s,i]=t;return i}}catch{}}function ze({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=$e.default.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function to({workspaceRoot:r}){let e=$e.default.join(r,"pnpm-workspace.yaml");if((0,se.existsSync)(e))try{let t=Yc.default.load((0,se.readFileSync)(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new _(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function ut({root:r,lockFile:e,workspaceConfig:t}){let s=n=>$e.default.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 rr({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function at({workspaceRoot:r,workspaceGlobs:e}){if(!e)return[];let t=e.filter(s=>s.startsWith("!")).map(s=>s.slice(1));return e.filter(s=>!s.startsWith("!")).flatMap(s=>{let i=[`${s}/package.json`];return(0,Vc.sync)(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=$e.default.dirname(s),{name:n,description:o}=ze({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:$e.default.join(i,"node_modules")}}})}function Kc({directory:r}){let e=$e.default.resolve(process.cwd(),r);return{exists:(0,se.existsSync)(e),absolute:e}}function he({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 Zc({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 ie({project:r,options:e}){e!=null&&e.dry||(0,se.rmSync)(r.paths.lockfile,{force:!0})}async function Gs({project:r,options:e}){if(!(e!=null&&e.dry)&&(0,se.existsSync)(r.paths.lockfile))try{let{stdout:t}=await(0,Jc.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root});await(0,se.writeFile)($e.default.join(r.paths.root,"yarn.lock"),t)}catch{}finally{(0,se.rmSync)(r.paths.lockfile,{force:!0})}}function Kp({dependencyList:r,project:e,to:t}){let s=[];return e.workspaceData.workspaces.forEach(i=>{let{name:n}=i;if(r[n]){let o=r[n],a=o.startsWith("workspace:")?o.slice(10):o;r[n]=t.name==="pnpm"?`workspace:${a}`:a,s.push(n)}}),{dependencyList:r,updated:s}}function fe({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(m=>{let D=n[m];if(D){let{updated:A,dependencyList:F}=Kp({dependencyList:D,project:r,to:t});n[m]=F,o[m]=A}});let l=m=>{let D=o[m].length;if(D>0)return`${(0,el.green)(D.toString())} ${m}`},c=a.map(l).filter(Boolean),h=`./${Xc.default.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let m="updating";c.forEach((D,A)=>{c.length===1?m+=` ${D} in ${h}`:A===c.length-1?m+=`and ${D} in ${h}`:m+=` ${D}, `}),s.workspaceStep(m)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||(0,Qc.writeJSONSync)(e.paths.packageJson,n,{spaces:2})}var ct={name:"pnpm",lock:"pnpm-lock.yaml"};async function rl(r){let e=_t.default.join(r.workspaceRoot,ct.lock),t=_t.default.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=ot({workspaceRoot:r.workspaceRoot});return(0,J.existsSync)(e)||(0,J.existsSync)(t)||s===ct.name}async function Zp(r){if(!await rl(r))throw new _("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=ze(r);return{name:t,description:s,packageManager:ct.name,paths:ut({root:r.workspaceRoot,lockFile:ct.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:to(r),workspaces:at({workspaceGlobs:to(r),...r})}}}async function Xp(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(he({action:"create",packageManager:ct.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||((0,J.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),(0,J.writeFileSync)(_t.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
|
4
4
|
${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
|
|
5
|
-
`)}`))),n&&(fe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{fe({workspace:a,project:e,to:t,logger:s,options:i})}))}async function Qp(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(he({action:"remove",packageManager:ct.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||(0,J.rmSync)(e.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){(0,J.writeJSONSync)(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,J.rm)(a,{recursive:!0,force:!0})))}catch{throw new _("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function em(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${_t.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||(0,J.rmSync)(e.paths.lockfile,{force:!0})}async function tm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${_t.default.relative(e.paths.root,e.paths.lockfile)} to ${ct.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&(0,J.existsSync)(e.paths.lockfile))try{await(0,tl.default)(ct.name,["import"],{stdio:"ignore",cwd:e.paths.root})}catch{}finally{ie({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Gs({project:e,options:t}),await n(),(0,J.rmSync)(_t.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var sl={detect:rl,read:Zp,create:Xp,remove:Qp,clean:em,convertLock:tm};u();var Br=R(require("path")),Fe=require("fs-extra");var sr={name:"npm",lock:"package-lock.json"};async function il(r){let e=Br.default.join(r.workspaceRoot,sr.lock),t=ot({workspaceRoot:r.workspaceRoot});return(0,Fe.existsSync)(e)||t===sr.name}async function rm(r){if(!await il(r))throw new _("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=ze(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:sr.name,paths:ut({root:r.workspaceRoot,lockFile:sr.lock}),workspaceData:{globs:n,workspaces:at({workspaceGlobs:n,...r})}}}async function sm(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(he({packageManager:sr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||(0,Fe.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),fe({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{fe({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||(0,Fe.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function im(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(he({packageManager:sr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){(0,Fe.writeJSONSync)(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Fe.rm)(a,{recursive:!0,force:!0})))}catch{throw new _("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 ${Br.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||(0,Fe.rmSync)(e.paths.lockfile,{force:!0})}async function om(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":ie({project:e,options:t});break;case"bun":ie({project:e,options:t});break;case"npm":break;case"yarn":ie({project:e,options:t});break}}var nl={detect:il,read:rm,create:sm,remove:im,clean:nm,convertLock:om};u();var ir=R(require("path")),be=require("fs-extra");var Rt={name:"yarn",lock:"yarn.lock"};async function ol(r){let e=ir.default.join(r.workspaceRoot,Rt.lock),t=ot({workspaceRoot:r.workspaceRoot});return(0,be.existsSync)(e)||t===Rt.name}async function um(r){if(!await ol(r))throw new _("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=ze(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:Rt.name,paths:ut({root:r.workspaceRoot,lockFile:Rt.lock}),workspaceData:{globs:n,workspaces:at({workspaceGlobs:n,...r})}}}async function am(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(he({packageManager:Rt.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||(0,be.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),fe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{fe({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||(0,be.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function cm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(he({packageManager:Rt.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)){(0,be.writeJSONSync)(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,be.rm)(a,{recursive:!0,force:!0})))}catch{throw new _("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function lm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${ir.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||(0,be.rmSync)(e.paths.lockfile,{force:!0})}async function hm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${ir.default.relative(e.paths.root,e.paths.lockfile)} to ${Rt.lock}`)};switch(e.packageManager){case"pnpm":ie({project:e,options:t});break;case"bun":i(),await Gs({project:e,options:t});break;case"npm":ie({project:e,options:t});break;case"yarn":break}}var ul={detect:ol,read:um,create:am,remove:cm,clean:lm,convertLock:hm};u();var xr=R(require("path")),Se=require("fs-extra");var nr={name:"bun",lock:"bun.lockb"};async function al(r){let e=xr.default.join(r.workspaceRoot,nr.lock),t=ot({workspaceRoot:r.workspaceRoot});return(0,Se.existsSync)(e)||t===nr.name}async function fm(r){if(!await al(r))throw new _("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=ze(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:nr.name,paths:ut({root:r.workspaceRoot,lockFile:nr.lock}),workspaceData:{globs:n,workspaces:at({workspaceGlobs:n,...r})}}}async function pm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!Zc({project:e}))throw new _("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(he({packageManager:nr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||(0,Se.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),fe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{fe({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||(0,Se.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function mm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(he({packageManager:nr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){(0,Se.writeJSONSync)(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Se.rm)(a,{recursive:!0,force:!0})))}catch{throw new _("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function dm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${xr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||(0,Se.rmSync)(e.paths.lockfile,{force:!0})}async function Dm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":ie({project:e,options:t});break;case"bun":break;case"npm":ie({project:e,options:t});break;case"yarn":ie({project:e,options:t});break}}var cl={detect:al,read:fm,create:pm,remove:mm,clean:dm,convertLock:Dm};var We={pnpm:sl,yarn:ul,npm:nl,bun:cl};async function ro({root:r}){let{exists:e,absolute:t}=Kc({directory:r});if(!e)throw new _(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(We))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new _("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}u();var dl=require("picocolors");u();var fl=R(require("execa")),pl=R(require("ora")),ml=require("semver");u();var j=require("picocolors"),ll=R(require("gradient-string")),or=2,ur=class{constructor({interactive:e,dry:t}={}){this.interactive=e!=null?e:!0,this.dry=t!=null?t:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...t){this.logger(" ".repeat(or*e),...t)}header(e){this.blankLine(),this.logger((0,j.bold)(e))}installerFrames(){let e=`${" ".repeat(or)} - ${this.dry?(0,j.yellow)("SKIPPED | "):(0,j.green)("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,ll.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger((0,j.bold)(this.gradient(`
|
|
5
|
+
`)}`))),n&&(fe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{fe({workspace:a,project:e,to:t,logger:s,options:i})}))}async function Qp(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(he({action:"remove",packageManager:ct.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||(0,J.rmSync)(e.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){(0,J.writeJSONSync)(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,J.rm)(a,{recursive:!0,force:!0})))}catch{throw new _("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function em(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${_t.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||(0,J.rmSync)(e.paths.lockfile,{force:!0})}async function tm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${_t.default.relative(e.paths.root,e.paths.lockfile)} to ${ct.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&(0,J.existsSync)(e.paths.lockfile))try{await(0,tl.default)(ct.name,["import"],{stdio:"ignore",cwd:e.paths.root})}catch{}finally{ie({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Gs({project:e,options:t}),await n(),(0,J.rmSync)(_t.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var sl={detect:rl,read:Zp,create:Xp,remove:Qp,clean:em,convertLock:tm};u();var vr=R(require("path")),Fe=require("fs-extra");var sr={name:"npm",lock:"package-lock.json"};async function il(r){let e=vr.default.join(r.workspaceRoot,sr.lock),t=ot({workspaceRoot:r.workspaceRoot});return(0,Fe.existsSync)(e)||t===sr.name}async function rm(r){if(!await il(r))throw new _("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=ze(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:sr.name,paths:ut({root:r.workspaceRoot,lockFile:sr.lock}),workspaceData:{globs:n,workspaces:at({workspaceGlobs:n,...r})}}}async function sm(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(he({packageManager:sr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${vr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${vr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||(0,Fe.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),fe({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{fe({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||(0,Fe.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function im(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(he({packageManager:sr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){(0,Fe.writeJSONSync)(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Fe.rm)(a,{recursive:!0,force:!0})))}catch{throw new _("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 ${vr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||(0,Fe.rmSync)(e.paths.lockfile,{force:!0})}async function om(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":ie({project:e,options:t});break;case"bun":ie({project:e,options:t});break;case"npm":break;case"yarn":ie({project:e,options:t});break}}var nl={detect:il,read:rm,create:sm,remove:im,clean:nm,convertLock:om};u();var ir=R(require("path")),be=require("fs-extra");var Rt={name:"yarn",lock:"yarn.lock"};async function ol(r){let e=ir.default.join(r.workspaceRoot,Rt.lock),t=ot({workspaceRoot:r.workspaceRoot});return(0,be.existsSync)(e)||t===Rt.name}async function um(r){if(!await ol(r))throw new _("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=ze(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:Rt.name,paths:ut({root:r.workspaceRoot,lockFile:Rt.lock}),workspaceData:{globs:n,workspaces:at({workspaceGlobs:n,...r})}}}async function am(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(he({packageManager:Rt.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||(0,be.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),fe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{fe({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||(0,be.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function cm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(he({packageManager:Rt.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)){(0,be.writeJSONSync)(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,be.rm)(a,{recursive:!0,force:!0})))}catch{throw new _("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function lm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${ir.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||(0,be.rmSync)(e.paths.lockfile,{force:!0})}async function hm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${ir.default.relative(e.paths.root,e.paths.lockfile)} to ${Rt.lock}`)};switch(e.packageManager){case"pnpm":ie({project:e,options:t});break;case"bun":i(),await Gs({project:e,options:t});break;case"npm":ie({project:e,options:t});break;case"yarn":break}}var ul={detect:ol,read:um,create:am,remove:cm,clean:lm,convertLock:hm};u();var xr=R(require("path")),Se=require("fs-extra");var nr={name:"bun",lock:"bun.lockb"};async function al(r){let e=xr.default.join(r.workspaceRoot,nr.lock),t=ot({workspaceRoot:r.workspaceRoot});return(0,Se.existsSync)(e)||t===nr.name}async function fm(r){if(!await al(r))throw new _("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=ze(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:nr.name,paths:ut({root:r.workspaceRoot,lockFile:nr.lock}),workspaceData:{globs:n,workspaces:at({workspaceGlobs:n,...r})}}}async function pm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!Zc({project:e}))throw new _("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(he({packageManager:nr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||(0,Se.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),fe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{fe({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||(0,Se.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function mm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(he({packageManager:nr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){(0,Se.writeJSONSync)(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Se.rm)(a,{recursive:!0,force:!0})))}catch{throw new _("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function dm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${xr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||(0,Se.rmSync)(e.paths.lockfile,{force:!0})}async function Dm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":ie({project:e,options:t});break;case"bun":break;case"npm":ie({project:e,options:t});break;case"yarn":ie({project:e,options:t});break}}var cl={detect:al,read:fm,create:pm,remove:mm,clean:dm,convertLock:Dm};var We={pnpm:sl,yarn:ul,npm:nl,bun:cl};async function ro({root:r}){let{exists:e,absolute:t}=Kc({directory:r});if(!e)throw new _(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(We))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new _("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}u();var dl=require("picocolors");u();var fl=R(require("execa")),pl=R(require("ora")),ml=require("semver");u();var U=require("picocolors"),ll=R(require("gradient-string")),or=2,ur=class{constructor({interactive:e,dry:t}={}){this.interactive=e!=null?e:!0,this.dry=t!=null?t:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...t){this.logger(" ".repeat(or*e),...t)}header(e){this.blankLine(),this.logger((0,U.bold)(e))}installerFrames(){let e=`${" ".repeat(or)} - ${this.dry?(0,U.yellow)("SKIPPED | "):(0,U.green)("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,ll.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger((0,U.bold)(this.gradient(`
|
|
6
6
|
>>> TURBOREPO
|
|
7
|
-
`)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${(0,
|
|
7
|
+
`)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${(0,U.underline)(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(or),"-",this.dry?(0,U.yellow)("SKIPPED |"):(0,U.green)("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(or),"-",(0,U.red)("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?(0,U.yellow)("SKIPPED |"):(0,U.green)("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?(0,U.yellow)("SKIPPED |"):(0,U.green)("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};var hl={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 so(r){let{version:e,name:t}=r;return e?hl[t].find(s=>(0,ml.satisfies)(e,s.semver)):hl[t].find(s=>s.default)}async function Hs(r){let{to:e,logger:t,options:s}=r,i=t!=null?t:new ur(s),n=so(e);if(!n)throw new _("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=(0,pl.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,fl.default)(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}}}async function Dl({project:r,convertTo:e,logger:t,options:s}){if(t.header(`Converting project from ${r.packageManager} to ${e.name}.`),!(s!=null&&s.ignoreUnchangedPackageManager)){if(r.packageManager===e.name)throw new _("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new _(`${e.name} is not installed, or could not be located`,{type:"package_manager-could_not_be_found"})}let i=e;s!=null&&s.ignoreUnchangedPackageManager||await We[r.packageManager].remove({project:r,to:i,logger:t,options:s}),await We[i.name].create({project:r,to:i,logger:t,options:s}),t.mainStep("Installing dependencies"),s!=null&&s.skipInstall?t.subStep((0,dl.yellow)("Skipping install")):(await We[i.name].convertLock({project:r,to:i,logger:t,options:s}),await Hs({project:r,to:i,logger:t,options:s})),t.mainStep(`Cleaning up ${r.packageManager} workspaces`),r.packageManager!==e.name&&await We[r.packageManager].clean({project:r,logger:t})}async function gm({root:r,to:e,options:t}){let s=new ur({...t,interactive:!1}),[i,n]=await Promise.all([ro({root:r}),pi()]);await Dl({project:i,convertTo:{name:e,version:n[e]},logger:s,options:t})}0&&(module.exports={ConvertError,MANAGERS,convert,getPackageManagerMeta,getWorkspaceDetails,install});
|
|
8
8
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|