@turbo/workspaces 2.3.4-canary.9 → 2.3.5-canary.0

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