create-turbo 2.6.4-canary.4 → 2.6.4-canary.6
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/cli.js +5 -5
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
`:`
|
|
21
21
|
`.charCodeAt(),r=typeof t=="string"?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,t.length-1)),t[t.length-1]===r&&(t=t.slice(0,t.length-1)),t}});var Yx=A((aW,Go)=>{"use strict";var $o=require("path"),Vx=gp(),Wx=t=>{t={cwd:process.cwd(),path:process.env[Vx()],execPath:process.execPath,...t};let e,r=$o.resolve(t.cwd),n=[];for(;e!==r;)n.push($o.join(r,"node_modules/.bin")),e=r,r=$o.resolve(r,"..");let i=$o.resolve(t.cwd,t.execPath,"..");return n.push(i),n.concat(t.path).join($o.delimiter)};Go.exports=Wx;Go.exports.default=Wx;Go.exports.env=t=>{t={env:process.env,...t};let e={...t.env},r=Vx({env:e});return t.path=e[r],e[r]=Go.exports(t),e}});var Kx=A(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.SIGNALS=void 0;var hM=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];uc.SIGNALS=hM});var Ap=A(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.SIGRTMAX=ms.getRealtimeSignals=void 0;var fM=function(){let t=Jx-Zx+1;return Array.from({length:t},dM)};ms.getRealtimeSignals=fM;var dM=function(t,e){return{name:`SIGRT${e+1}`,number:Zx+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},Zx=34,Jx=64;ms.SIGRTMAX=Jx});var Xx=A(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.getSignals=void 0;var pM=require("os"),mM=Kx(),yM=Ap(),gM=function(){let t=(0,yM.getRealtimeSignals)();return[...mM.SIGNALS,...t].map(_M)};cc.getSignals=gM;var _M=function({name:t,number:e,description:r,action:n,forced:i=!1,standard:s}){let{signals:{[t]:o}}=pM.constants,a=o!==void 0;return{name:t,number:a?o:e,description:r,supported:a,action:n,forced:i,standard:s}}});var eS=A(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.signalsByNumber=ys.signalsByName=void 0;var bM=require("os"),Qx=Xx(),vM=Ap(),EM=function(){return(0,Qx.getSignals)().reduce(wM,{})},wM=function(t,{name:e,number:r,description:n,supported:i,action:s,forced:o,standard:a}){return{...t,[e]:{name:e,number:r,description:n,supported:i,action:s,forced:o,standard:a}}},xM=EM();ys.signalsByName=xM;var SM=function(){let t=(0,Qx.getSignals)(),e=vM.SIGRTMAX+1,r=Array.from({length:e},(n,i)=>AM(i,t));return Object.assign({},...r)},AM=function(t,e){let r=DM(t,e);if(r===void 0)return{};let{name:n,description:i,supported:s,action:o,forced:a,standard:u}=r;return{[t]:{name:n,number:t,description:i,supported:s,action:o,forced:a,standard:u}}},DM=function(t,e){let r=e.find(({name:n})=>bM.constants.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},CM=SM();ys.signalsByNumber=CM});var rS=A((fW,tS)=>{"use strict";var{signalsByName:RM}=eS(),kM=({timedOut:t,timeout:e,errorCode:r,signal:n,signalDescription:i,exitCode:s,isCanceled:o})=>t?`timed out after ${e} milliseconds`:o?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${i})`:s!==void 0?`failed with exit code ${s}`:"failed",TM=({stdout:t,stderr:e,all:r,error:n,signal:i,exitCode:s,command:o,escapedCommand:a,timedOut:u,isCanceled:c,killed:l,parsed:{options:{timeout:h}}})=>{s=s===null?void 0:s,i=i===null?void 0:i;let f=i===void 0?void 0:RM[i].description,d=n&&n.code,y=`Command ${kM({timedOut:u,timeout:h,errorCode:d,signal:i,signalDescription:f,exitCode:s,isCanceled:c})}: ${o}`,p=Object.prototype.toString.call(n)==="[object Error]",w=p?`${y}
|
|
22
22
|
${n.message}`:y,O=[w,e,t].filter(Boolean).join(`
|
|
23
|
-
`);return p?(n.originalMessage=n.message,n.message=O):n=new Error(O),n.shortMessage=w,n.command=o,n.escapedCommand=a,n.exitCode=s,n.signal=i,n.signalDescription=f,n.stdout=t,n.stderr=e,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!u,n.isCanceled=c,n.killed=l&&!u,n};tS.exports=TM});var iS=A((dW,Dp)=>{"use strict";var lc=["stdin","stdout","stderr"],OM=t=>lc.some(e=>t[e]!==void 0),nS=t=>{if(!t)return;let{stdio:e}=t;if(e===void 0)return lc.map(n=>t[n]);if(OM(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${lc.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,lc.length);return Array.from({length:r},(n,i)=>e[i])};Dp.exports=nS;Dp.exports.node=t=>{let e=nS(t);return e==="ipc"?"ipc":e===void 0||typeof e=="string"?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}});var oS=A((pW,sS)=>{"use strict";var FM=require("os"),PM=Vd(),IM=1e3*5,LM=(t,e="SIGTERM",r={})=>{let n=t(e);return BM(t,e,r,n),n},BM=(t,e,r,n)=>{if(!NM(e,r,n))return;let i=jM(r),s=setTimeout(()=>{t("SIGKILL")},i);s.unref&&s.unref()},NM=(t,{forceKillAfterTimeout:e},r)=>MM(t)&&e!==!1&&r,MM=t=>t===FM.constants.signals.SIGTERM||typeof t=="string"&&t.toUpperCase()==="SIGTERM",jM=({forceKillAfterTimeout:t=!0})=>{if(t===!0)return IM;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},qM=(t,e)=>{t.kill()&&(e.isCanceled=!0)},UM=(t,e,r)=>{t.kill(e),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},HM=(t,{timeout:e,killSignal:r="SIGTERM"},n)=>{if(e===0||e===void 0)return n;let i,s=new Promise((a,u)=>{i=setTimeout(()=>{UM(t,r,u)},e)}),o=n.finally(()=>{clearTimeout(i)});return Promise.race([s,o])},$M=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},GM=async(t,{cleanup:e,detached:r},n)=>{if(!e||r)return n;let i=PM(()=>{t.kill()});return n.finally(()=>{i()})};sS.exports={spawnedKill:LM,spawnedCancel:qM,setupTimeout:HM,validateTimeout:$M,setExitHandler:GM}});var uS=A((mW,aS)=>{"use strict";var vr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";vr.writable=t=>vr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";vr.readable=t=>vr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";vr.duplex=t=>vr.writable(t)&&vr.readable(t);vr.transform=t=>vr.duplex(t)&&typeof t._transform=="function";aS.exports=vr});var lS=A((yW,cS)=>{"use strict";var{PassThrough:zM}=require("stream");cS.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,n=r==="buffer",i=!1;e?i=!(r||n):r=r||"utf8",n&&(r=null);let s=new zM({objectMode:i});r&&s.setEncoding(r);let o=0,a=[];return s.on("data",u=>{a.push(u),i?o=a.length:o+=u.length}),s.getBufferedValue=()=>e?a:n?Buffer.concat(a,o):a.join(""),s.getBufferedLength=()=>o,s}});var hS=A((gW,zo)=>{"use strict";var{constants:VM}=require("buffer"),WM=require("stream"),{promisify:YM}=require("util"),KM=lS(),ZM=YM(WM.pipeline),hc=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Cp(t,e){if(!t)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,n=KM(e);return await new Promise((i,s)=>{let o=a=>{a&&n.getBufferedLength()<=VM.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),s(a)};(async()=>{try{await ZM(t,n),i()}catch(a){o(a)}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(new hc)})}),n.getBufferedValue()}zo.exports=Cp;zo.exports.buffer=(t,e)=>Cp(t,{...e,encoding:"buffer"});zo.exports.array=(t,e)=>Cp(t,{...e,array:!0});zo.exports.MaxBufferError=hc});var dS=A((_W,fS)=>{"use strict";var{PassThrough:JM}=require("stream");fS.exports=function(){var t=[],e=new JM({objectMode:!0});return e.setMaxListeners(0),e.add=r,e.isEmpty=n,e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(r),e;function r(s){return Array.isArray(s)?(s.forEach(r),this):(t.push(s),s.once("end",i.bind(null,s)),s.once("error",e.emit.bind(e,"error")),s.pipe(e,{end:!1}),this)}function n(){return t.length==0}function i(s){t=t.filter(function(o){return o!==s}),!t.length&&e.readable&&e.end()}}});var gS=A((bW,yS)=>{"use strict";var mS=uS(),pS=hS(),XM=dS(),QM=(t,e)=>{e===void 0||t.stdin===void 0||(mS(e)?e.pipe(t.stdin):t.stdin.end(e))},e8=(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;let r=XM();return t.stdout&&r.add(t.stdout),t.stderr&&r.add(t.stderr),r},Rp=async(t,e)=>{if(t){t.destroy();try{return await e}catch(r){return r.bufferedData}}},kp=(t,{encoding:e,buffer:r,maxBuffer:n})=>{if(!(!t||!r))return e?pS(t,{encoding:e,maxBuffer:n}):pS.buffer(t,{maxBuffer:n})},t8=async({stdout:t,stderr:e,all:r},{encoding:n,buffer:i,maxBuffer:s},o)=>{let a=kp(t,{encoding:n,buffer:i,maxBuffer:s}),u=kp(e,{encoding:n,buffer:i,maxBuffer:s}),c=kp(r,{encoding:n,buffer:i,maxBuffer:s*2});try{return await Promise.all([o,a,u,c])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},Rp(t,a),Rp(e,u),Rp(r,c)])}},r8=({input:t})=>{if(mS(t))throw new TypeError("The `input` option cannot be a stream in sync mode")};yS.exports={handleInput:QM,makeAllStream:e8,getSpawnedResult:t8,validateInputSync:r8}});var bS=A((vW,_S)=>{"use strict";var n8=(async()=>{})().constructor.prototype,i8=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(n8,t)]),s8=(t,e)=>{for(let[r,n]of i8){let i=typeof e=="function"?(...s)=>Reflect.apply(n.value,e(),s):n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}return t},o8=t=>new Promise((e,r)=>{t.on("exit",(n,i)=>{e({exitCode:n,signal:i})}),t.on("error",n=>{r(n)}),t.stdin&&t.stdin.on("error",n=>{r(n)})});_S.exports={mergePromise:s8,getSpawnedPromise:o8}});var wS=A((EW,ES)=>{"use strict";var vS=(t,e=[])=>Array.isArray(e)?[t,...e]:[t],a8=/^[\w.-]+$/,u8=/"/g,c8=t=>typeof t!="string"||a8.test(t)?t:`"${t.replace(u8,'\\"')}"`,l8=(t,e)=>vS(t,e).join(" "),h8=(t,e)=>vS(t,e).map(r=>c8(r)).join(" "),f8=/ +/g,d8=t=>{let e=[];for(let r of t.trim().split(f8)){let n=e[e.length-1];n&&n.endsWith("\\")?e[e.length-1]=`${n.slice(0,-1)} ${r}`:e.push(r)}return e};ES.exports={joinCommand:l8,getEscapedCommand:h8,parseCommand:d8}});var _s=A((wW,gs)=>{"use strict";var p8=require("path"),Tp=require("child_process"),m8=$x(),y8=zx(),g8=Yx(),_8=$d(),fc=rS(),SS=iS(),{spawnedKill:b8,spawnedCancel:v8,setupTimeout:E8,validateTimeout:w8,setExitHandler:x8}=oS(),{handleInput:S8,getSpawnedResult:A8,makeAllStream:D8,validateInputSync:C8}=gS(),{mergePromise:xS,getSpawnedPromise:R8}=bS(),{joinCommand:AS,parseCommand:DS,getEscapedCommand:CS}=wS(),k8=1e3*1e3*100,T8=({env:t,extendEnv:e,preferLocal:r,localDir:n,execPath:i})=>{let s=e?{...process.env,...t}:t;return r?g8.env({env:s,cwd:n,execPath:i}):s},RS=(t,e,r={})=>{let n=m8._parse(t,e,r);return t=n.command,e=n.args,r=n.options,r={maxBuffer:k8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r},r.env=T8(r),r.stdio=SS(r),process.platform==="win32"&&p8.basename(t,".exe")==="cmd"&&e.unshift("/q"),{file:t,args:e,options:r,parsed:n}},Vo=(t,e,r)=>typeof e!="string"&&!Buffer.isBuffer(e)?r===void 0?void 0:"":t.stripFinalNewline?y8(e):e,dc=(t,e,r)=>{let n=RS(t,e,r),i=AS(t,e),s=CS(t,e);w8(n.options);let o;try{o=Tp.spawn(n.file,n.args,n.options)}catch(d){let m=new Tp.ChildProcess,y=Promise.reject(fc({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return xS(m,y)}let a=R8(o),u=E8(o,n.options,a),c=x8(o,n.options,u),l={isCanceled:!1};o.kill=b8.bind(null,o.kill.bind(o)),o.cancel=v8.bind(null,o,l);let f=_8(async()=>{let[{error:d,exitCode:m,signal:y,timedOut:p},w,O,P]=await A8(o,n.options,c),I=Vo(n.options,w),k=Vo(n.options,O),M=Vo(n.options,P);if(d||m!==0||y!==null){let x=fc({error:d,exitCode:m,signal:y,stdout:I,stderr:k,all:M,command:i,escapedCommand:s,parsed:n,timedOut:p,isCanceled:l.isCanceled,killed:o.killed});if(!n.options.reject)return x;throw x}return{command:i,escapedCommand:s,exitCode:0,stdout:I,stderr:k,all:M,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return S8(o,n.options.input),o.all=D8(o,n.options),xS(o,f)};gs.exports=dc;gs.exports.sync=(t,e,r)=>{let n=RS(t,e,r),i=AS(t,e),s=CS(t,e);C8(n.options);let o;try{o=Tp.spawnSync(n.file,n.args,n.options)}catch(c){throw fc({error:c,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let a=Vo(n.options,o.stdout,o.error),u=Vo(n.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){let c=fc({stdout:a,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:s,parsed:n,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!n.options.reject)return c;throw c}return{command:i,escapedCommand:s,exitCode:0,stdout:a,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};gs.exports.command=(t,e)=>{let[r,...n]=DS(t);return dc(r,n,e)};gs.exports.commandSync=(t,e)=>{let[r,...n]=DS(t);return dc.sync(r,n,e)};gs.exports.node=(t,e,r={})=>{e&&!Array.isArray(e)&&typeof e=="object"&&(r=e,e=[]);let n=SS.node(r),i=process.execArgv.filter(a=>!a.startsWith("--inspect")),{nodePath:s=process.execPath,nodeOptions:o=i}=r;return dc(s,[...o,t,...Array.isArray(e)?e:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:n,shell:!1})}});var bs=A((CW,PS)=>{"use strict";var FS=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"]]);PS.exports=t=>t?Object.keys(t).map(e=>[FS.has(e)?FS.get(e):e,t[e]]).reduce((e,r)=>(e[r[0]]=r[1],e),Object.create(null)):{}});var Ec=A((RW,HS)=>{"use strict";var IS=typeof process=="object"&&process?process:{stdout:null,stderr:null},F8=require("events"),LS=require("stream"),BS=require("string_decoder").StringDecoder,qr=Symbol("EOF"),Ur=Symbol("maybeEmitEnd"),vn=Symbol("emittedEnd"),yc=Symbol("emittingEnd"),Ko=Symbol("emittedError"),gc=Symbol("closed"),NS=Symbol("read"),_c=Symbol("flush"),MS=Symbol("flushChunk"),xt=Symbol("encoding"),Hr=Symbol("decoder"),bc=Symbol("flowing"),Zo=Symbol("paused"),vs=Symbol("resume"),qe=Symbol("buffer"),Er=Symbol("pipes"),Xe=Symbol("bufferLength"),Ip=Symbol("bufferPush"),Lp=Symbol("bufferShift"),ut=Symbol("objectMode"),ct=Symbol("destroyed"),Bp=Symbol("emitData"),jS=Symbol("emitEnd"),Np=Symbol("emitEnd2"),$r=Symbol("async"),Jo=t=>Promise.resolve().then(t),qS=global._MP_NO_ITERATOR_SYMBOLS_!=="1",P8=qS&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),I8=qS&&Symbol.iterator||Symbol("iterator not implemented"),L8=t=>t==="end"||t==="finish"||t==="prefinish",B8=t=>t instanceof ArrayBuffer||typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,N8=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),vc=class{constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[vs](),r.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Mp=class extends vc{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}};HS.exports=class US extends LS{constructor(e){super(),this[bc]=!1,this[Zo]=!1,this[Er]=[],this[qe]=[],this[ut]=e&&e.objectMode||!1,this[ut]?this[xt]=null:this[xt]=e&&e.encoding||null,this[xt]==="buffer"&&(this[xt]=null),this[$r]=e&&!!e.async||!1,this[Hr]=this[xt]?new BS(this[xt]):null,this[qr]=!1,this[vn]=!1,this[yc]=!1,this[gc]=!1,this[Ko]=null,this.writable=!0,this.readable=!0,this[Xe]=0,this[ct]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[qe]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Er]})}get bufferLength(){return this[Xe]}get encoding(){return this[xt]}set encoding(e){if(this[ut])throw new Error("cannot set encoding in objectMode");if(this[xt]&&e!==this[xt]&&(this[Hr]&&this[Hr].lastNeed||this[Xe]))throw new Error("cannot change encoding");this[xt]!==e&&(this[Hr]=e?new BS(e):null,this[qe].length&&(this[qe]=this[qe].map(r=>this[Hr].write(r)))),this[xt]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[ut]}set objectMode(e){this[ut]=this[ut]||!!e}get async(){return this[$r]}set async(e){this[$r]=this[$r]||!!e}write(e,r,n){if(this[qr])throw new Error("write after end");if(this[ct])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[$r]?Jo:s=>s();return!this[ut]&&!Buffer.isBuffer(e)&&(N8(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):B8(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[ut]?(this.flowing&&this[Xe]!==0&&this[_c](!0),this.flowing?this.emit("data",e):this[Ip](e),this[Xe]!==0&&this.emit("readable"),n&&i(n),this.flowing):e.length?(typeof e=="string"&&!(r===this[xt]&&!this[Hr].lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[xt]&&(e=this[Hr].write(e)),this.flowing&&this[Xe]!==0&&this[_c](!0),this.flowing?this.emit("data",e):this[Ip](e),this[Xe]!==0&&this.emit("readable"),n&&i(n),this.flowing):(this[Xe]!==0&&this.emit("readable"),n&&i(n),this.flowing)}read(e){if(this[ct])return null;if(this[Xe]===0||e===0||e>this[Xe])return this[Ur](),null;this[ut]&&(e=null),this[qe].length>1&&!this[ut]&&(this.encoding?this[qe]=[this[qe].join("")]:this[qe]=[Buffer.concat(this[qe],this[Xe])]);let r=this[NS](e||null,this[qe][0]);return this[Ur](),r}[NS](e,r){return e===r.length||e===null?this[Lp]():(this[qe][0]=r.slice(e),r=r.slice(0,e),this[Xe]-=e),this.emit("data",r),!this[qe].length&&!this[qr]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=null),typeof r=="function"&&(n=r,r="utf8"),e&&this.write(e,r),n&&this.once("end",n),this[qr]=!0,this.writable=!1,(this.flowing||!this[Zo])&&this[Ur](),this}[vs](){this[ct]||(this[Zo]=!1,this[bc]=!0,this.emit("resume"),this[qe].length?this[_c]():this[qr]?this[Ur]():this.emit("drain"))}resume(){return this[vs]()}pause(){this[bc]=!1,this[Zo]=!0}get destroyed(){return this[ct]}get flowing(){return this[bc]}get paused(){return this[Zo]}[Ip](e){this[ut]?this[Xe]+=1:this[Xe]+=e.length,this[qe].push(e)}[Lp](){return this[qe].length&&(this[ut]?this[Xe]-=1:this[Xe]-=this[qe][0].length),this[qe].shift()}[_c](e){do;while(this[MS](this[Lp]()));!e&&!this[qe].length&&!this[qr]&&this.emit("drain")}[MS](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,r){if(this[ct])return;let n=this[vn];return r=r||{},e===IS.stdout||e===IS.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[Er].push(r.proxyErrors?new Mp(this,e,r):new vc(this,e,r)),this[$r]?Jo(()=>this[vs]()):this[vs]()),e}unpipe(e){let r=this[Er].find(n=>n.dest===e);r&&(this[Er].splice(this[Er].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);return e==="data"&&!this[Er].length&&!this.flowing?this[vs]():e==="readable"&&this[Xe]!==0?super.emit("readable"):L8(e)&&this[vn]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Ko]&&(this[$r]?Jo(()=>r.call(this,this[Ko])):r.call(this,this[Ko])),n}get emittedEnd(){return this[vn]}[Ur](){!this[yc]&&!this[vn]&&!this[ct]&&this[qe].length===0&&this[qr]&&(this[yc]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[gc]&&this.emit("close"),this[yc]=!1)}emit(e,r,...n){if(e!=="error"&&e!=="close"&&e!==ct&&this[ct])return;if(e==="data")return r?this[$r]?Jo(()=>this[Bp](r)):this[Bp](r):!1;if(e==="end")return this[jS]();if(e==="close"){if(this[gc]=!0,!this[vn]&&!this[ct])return;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Ko]=r;let s=super.emit("error",r);return this[Ur](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ur](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,r,...n);return this[Ur](),i}[Bp](e){for(let n of this[Er])n.dest.write(e)===!1&&this.pause();let r=super.emit("data",e);return this[Ur](),r}[jS](){this[vn]||(this[vn]=!0,this.readable=!1,this[$r]?Jo(()=>this[Np]()):this[Np]())}[Np](){if(this[Hr]){let r=this[Hr].end();if(r){for(let n of this[Er])n.dest.write(r);super.emit("data",r)}}for(let r of this[Er])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[ut]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[ut]||(e.dataLength+=n.length)}),r.then(()=>e)}concat(){return this[ut]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[ut]?Promise.reject(new Error("cannot concat in objectMode")):this[xt]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,r)=>{this.on(ct,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[P8](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[qr])return Promise.resolve({done:!0});let n=null,i=null,s=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",s),this.removeListener("end",a),this.pause(),n({value:c,done:!!this[qr]})},a=()=>{this.removeListener("error",s),this.removeListener("data",o),n({done:!0})},u=()=>s(new Error("stream destroyed"));return new Promise((c,l)=>{i=l,n=c,this.once(ct,u),this.once("error",s),this.once("end",a),this.once("data",o)})}}}[I8](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(e){return this[ct]?(e?this.emit("error",e):this.emit(ct),this):(this[ct]=!0,this[qe].length=0,this[Xe]=0,typeof this.close=="function"&&!this[gc]&&this.close(),e?this.emit("error",e):this.emit(ct),this)}static isStream(e){return!!e&&(e instanceof US||e instanceof LS||e instanceof F8&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var GS=A((kW,$S)=>{var M8=require("zlib").constants||{ZLIB_VERNUM:4736};$S.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},M8))});var Gp=A((TW,QS)=>{"use strict";var zS=typeof process=="object"&&process?process:{stdout:null,stderr:null},j8=require("events"),VS=require("stream"),WS=require("string_decoder").StringDecoder,Gr=Symbol("EOF"),zr=Symbol("maybeEmitEnd"),En=Symbol("emittedEnd"),wc=Symbol("emittingEnd"),Xo=Symbol("emittedError"),xc=Symbol("closed"),YS=Symbol("read"),Sc=Symbol("flush"),KS=Symbol("flushChunk"),St=Symbol("encoding"),Vr=Symbol("decoder"),Ac=Symbol("flowing"),Qo=Symbol("paused"),Es=Symbol("resume"),Qe=Symbol("bufferLength"),jp=Symbol("bufferPush"),qp=Symbol("bufferShift"),lt=Symbol("objectMode"),ht=Symbol("destroyed"),Up=Symbol("emitData"),ZS=Symbol("emitEnd"),Hp=Symbol("emitEnd2"),Wr=Symbol("async"),ea=t=>Promise.resolve().then(t),JS=global._MP_NO_ITERATOR_SYMBOLS_!=="1",q8=JS&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),U8=JS&&Symbol.iterator||Symbol("iterator not implemented"),H8=t=>t==="end"||t==="finish"||t==="prefinish",$8=t=>t instanceof ArrayBuffer||typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,G8=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Dc=class{constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[Es](),r.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},$p=class extends Dc{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}};QS.exports=class XS extends VS{constructor(e){super(),this[Ac]=!1,this[Qo]=!1,this.pipes=[],this.buffer=[],this[lt]=e&&e.objectMode||!1,this[lt]?this[St]=null:this[St]=e&&e.encoding||null,this[St]==="buffer"&&(this[St]=null),this[Wr]=e&&!!e.async||!1,this[Vr]=this[St]?new WS(this[St]):null,this[Gr]=!1,this[En]=!1,this[wc]=!1,this[xc]=!1,this[Xo]=null,this.writable=!0,this.readable=!0,this[Qe]=0,this[ht]=!1}get bufferLength(){return this[Qe]}get encoding(){return this[St]}set encoding(e){if(this[lt])throw new Error("cannot set encoding in objectMode");if(this[St]&&e!==this[St]&&(this[Vr]&&this[Vr].lastNeed||this[Qe]))throw new Error("cannot change encoding");this[St]!==e&&(this[Vr]=e?new WS(e):null,this.buffer.length&&(this.buffer=this.buffer.map(r=>this[Vr].write(r)))),this[St]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[lt]}set objectMode(e){this[lt]=this[lt]||!!e}get async(){return this[Wr]}set async(e){this[Wr]=this[Wr]||!!e}write(e,r,n){if(this[Gr])throw new Error("write after end");if(this[ht])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[Wr]?ea:s=>s();return!this[lt]&&!Buffer.isBuffer(e)&&(G8(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):$8(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[lt]?(this.flowing&&this[Qe]!==0&&this[Sc](!0),this.flowing?this.emit("data",e):this[jp](e),this[Qe]!==0&&this.emit("readable"),n&&i(n),this.flowing):e.length?(typeof e=="string"&&!(r===this[St]&&!this[Vr].lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[St]&&(e=this[Vr].write(e)),this.flowing&&this[Qe]!==0&&this[Sc](!0),this.flowing?this.emit("data",e):this[jp](e),this[Qe]!==0&&this.emit("readable"),n&&i(n),this.flowing):(this[Qe]!==0&&this.emit("readable"),n&&i(n),this.flowing)}read(e){if(this[ht])return null;if(this[Qe]===0||e===0||e>this[Qe])return this[zr](),null;this[lt]&&(e=null),this.buffer.length>1&&!this[lt]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Qe])]);let r=this[YS](e||null,this.buffer[0]);return this[zr](),r}[YS](e,r){return e===r.length||e===null?this[qp]():(this.buffer[0]=r.slice(e),r=r.slice(0,e),this[Qe]-=e),this.emit("data",r),!this.buffer.length&&!this[Gr]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=null),typeof r=="function"&&(n=r,r="utf8"),e&&this.write(e,r),n&&this.once("end",n),this[Gr]=!0,this.writable=!1,(this.flowing||!this[Qo])&&this[zr](),this}[Es](){this[ht]||(this[Qo]=!1,this[Ac]=!0,this.emit("resume"),this.buffer.length?this[Sc]():this[Gr]?this[zr]():this.emit("drain"))}resume(){return this[Es]()}pause(){this[Ac]=!1,this[Qo]=!0}get destroyed(){return this[ht]}get flowing(){return this[Ac]}get paused(){return this[Qo]}[jp](e){this[lt]?this[Qe]+=1:this[Qe]+=e.length,this.buffer.push(e)}[qp](){return this.buffer.length&&(this[lt]?this[Qe]-=1:this[Qe]-=this.buffer[0].length),this.buffer.shift()}[Sc](e){do;while(this[KS](this[qp]()));!e&&!this.buffer.length&&!this[Gr]&&this.emit("drain")}[KS](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,r){if(this[ht])return;let n=this[En];return r=r||{},e===zS.stdout||e===zS.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this.pipes.push(r.proxyErrors?new $p(this,e,r):new Dc(this,e,r)),this[Wr]?ea(()=>this[Es]()):this[Es]()),e}unpipe(e){let r=this.pipes.find(n=>n.dest===e);r&&(this.pipes.splice(this.pipes.indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);return e==="data"&&!this.pipes.length&&!this.flowing?this[Es]():e==="readable"&&this[Qe]!==0?super.emit("readable"):H8(e)&&this[En]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Xo]&&(this[Wr]?ea(()=>r.call(this,this[Xo])):r.call(this,this[Xo])),n}get emittedEnd(){return this[En]}[zr](){!this[wc]&&!this[En]&&!this[ht]&&this.buffer.length===0&&this[Gr]&&(this[wc]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[xc]&&this.emit("close"),this[wc]=!1)}emit(e,r,...n){if(e!=="error"&&e!=="close"&&e!==ht&&this[ht])return;if(e==="data")return r?this[Wr]?ea(()=>this[Up](r)):this[Up](r):!1;if(e==="end")return this[ZS]();if(e==="close"){if(this[xc]=!0,!this[En]&&!this[ht])return;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Xo]=r;let s=super.emit("error",r);return this[zr](),s}else if(e==="resume"){let s=super.emit("resume");return this[zr](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,r,...n);return this[zr](),i}[Up](e){for(let n of this.pipes)n.dest.write(e)===!1&&this.pause();let r=super.emit("data",e);return this[zr](),r}[ZS](){this[En]||(this[En]=!0,this.readable=!1,this[Wr]?ea(()=>this[Hp]()):this[Hp]())}[Hp](){if(this[Vr]){let r=this[Vr].end();if(r){for(let n of this.pipes)n.dest.write(r);super.emit("data",r)}}for(let r of this.pipes)r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[lt]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[lt]||(e.dataLength+=n.length)}),r.then(()=>e)}concat(){return this[lt]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[lt]?Promise.reject(new Error("cannot concat in objectMode")):this[St]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,r)=>{this.on(ht,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[q8](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Gr])return Promise.resolve({done:!0});let n=null,i=null,s=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",s),this.removeListener("end",a),this.pause(),n({value:c,done:!!this[Gr]})},a=()=>{this.removeListener("error",s),this.removeListener("data",o),n({done:!0})},u=()=>s(new Error("stream destroyed"));return new Promise((c,l)=>{i=l,n=c,this.once(ht,u),this.once("error",s),this.once("end",a),this.once("data",o)})}}}[U8](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(e){return this[ht]?(e?this.emit("error",e):this.emit(ht),this):(this[ht]=!0,this.buffer.length=0,this[Qe]=0,typeof this.close=="function"&&!this[xc]&&this.close(),e?this.emit("error",e):this.emit(ht),this)}static isStream(e){return!!e&&(e instanceof XS||e instanceof VS||e instanceof j8&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var om=A(Ft=>{"use strict";var Kp=require("assert"),wn=require("buffer").Buffer,rA=require("zlib"),ri=Ft.constants=GS(),z8=Gp(),eA=wn.concat,ni=Symbol("_superWrite"),xs=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"}},V8=Symbol("opts"),ta=Symbol("flushFlag"),tA=Symbol("finishFlushFlag"),sm=Symbol("fullFlushFlag"),Pe=Symbol("handle"),Cc=Symbol("onError"),ws=Symbol("sawError"),zp=Symbol("level"),Vp=Symbol("strategy"),Wp=Symbol("ended"),OW=Symbol("_defaultFullFlush"),Rc=class extends z8{constructor(e,r){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[ws]=!1,this[Wp]=!1,this[V8]=e,this[ta]=e.flush,this[tA]=e.finishFlush;try{this[Pe]=new rA[r](e)}catch(n){throw new xs(n)}this[Cc]=n=>{this[ws]||(this[ws]=!0,this.close(),this.emit("error",n))},this[Pe].on("error",n=>this[Cc](new xs(n))),this.once("end",()=>this.close)}close(){this[Pe]&&(this[Pe].close(),this[Pe]=null,this.emit("close"))}reset(){if(!this[ws])return Kp(this[Pe],"zlib binding closed"),this[Pe].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[sm]),this.write(Object.assign(wn.alloc(0),{[ta]:e})))}end(e,r,n){return e&&this.write(e,r),this.flush(this[tA]),this[Wp]=!0,super.end(null,null,n)}get ended(){return this[Wp]}write(e,r,n){if(typeof r=="function"&&(n=r,r="utf8"),typeof e=="string"&&(e=wn.from(e,r)),this[ws])return;Kp(this[Pe],"zlib binding closed");let i=this[Pe]._handle,s=i.close;i.close=()=>{};let o=this[Pe].close;this[Pe].close=()=>{},wn.concat=c=>c;let a;try{let c=typeof e[ta]=="number"?e[ta]:this[ta];a=this[Pe]._processChunk(e,c),wn.concat=eA}catch(c){wn.concat=eA,this[Cc](new xs(c))}finally{this[Pe]&&(this[Pe]._handle=i,i.close=s,this[Pe].close=o,this[Pe].removeAllListeners("error"))}this[Pe]&&this[Pe].on("error",c=>this[Cc](new xs(c)));let u;if(a)if(Array.isArray(a)&&a.length>0){u=this[ni](wn.from(a[0]));for(let c=1;c<a.length;c++)u=this[ni](a[c])}else u=this[ni](wn.from(a));return n&&n(),u}[ni](e){return super.write(e)}},Yr=class extends Rc{constructor(e,r){e=e||{},e.flush=e.flush||ri.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ri.Z_FINISH,super(e,r),this[sm]=ri.Z_FULL_FLUSH,this[zp]=e.level,this[Vp]=e.strategy}params(e,r){if(!this[ws]){if(!this[Pe])throw new Error("cannot switch params when binding is closed");if(!this[Pe].params)throw new Error("not supported in this implementation");if(this[zp]!==e||this[Vp]!==r){this.flush(ri.Z_SYNC_FLUSH),Kp(this[Pe],"zlib binding closed");let n=this[Pe].flush;this[Pe].flush=(i,s)=>{this.flush(i),s()};try{this[Pe].params(e,r)}finally{this[Pe].flush=n}this[Pe]&&(this[zp]=e,this[Vp]=r)}}}},Zp=class extends Yr{constructor(e){super(e,"Deflate")}},Jp=class extends Yr{constructor(e){super(e,"Inflate")}},Yp=Symbol("_portable"),Xp=class extends Yr{constructor(e){super(e,"Gzip"),this[Yp]=e&&!!e.portable}[ni](e){return this[Yp]?(this[Yp]=!1,e[9]=255,super[ni](e)):super[ni](e)}},Qp=class extends Yr{constructor(e){super(e,"Gunzip")}},em=class extends Yr{constructor(e){super(e,"DeflateRaw")}},tm=class extends Yr{constructor(e){super(e,"InflateRaw")}},rm=class extends Yr{constructor(e){super(e,"Unzip")}},kc=class extends Rc{constructor(e,r){e=e||{},e.flush=e.flush||ri.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ri.BROTLI_OPERATION_FINISH,super(e,r),this[sm]=ri.BROTLI_OPERATION_FLUSH}},nm=class extends kc{constructor(e){super(e,"BrotliCompress")}},im=class extends kc{constructor(e){super(e,"BrotliDecompress")}};Ft.Deflate=Zp;Ft.Inflate=Jp;Ft.Gzip=Xp;Ft.Gunzip=Qp;Ft.DeflateRaw=em;Ft.InflateRaw=tm;Ft.Unzip=rm;typeof rA.BrotliCompress=="function"?(Ft.BrotliCompress=nm,Ft.BrotliDecompress=im):Ft.BrotliCompress=Ft.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var Ss=A((IW,nA)=>{var W8=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;nA.exports=W8!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")});var Tc=A((BW,iA)=>{"use strict";var Y8=Ec(),am=Ss(),um=Symbol("slurp");iA.exports=class extends Y8{constructor(e,r,n){switch(super(),this.pause(),this.extended=r,this.globalExtended=n,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=am(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=am(e.linkpath),this.uname=e.uname,this.gname=e.gname,r&&this[um](r),n&&this[um](n,!0)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");let n=this.remain,i=this.blockRemain;return this.remain=Math.max(0,n-r),this.blockRemain=Math.max(0,i-r),this.ignore?!0:n>=r?super.write(e):super.write(e.slice(0,n))}[um](e,r){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(r&&n==="path")&&(this[n]=n==="path"||n==="linkpath"?am(e[n]):e[n])}}});var cm=A(Oc=>{"use strict";Oc.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"]]);Oc.code=new Map(Array.from(Oc.name).map(t=>[t[1],t[0]]))});var uA=A((MW,aA)=>{"use strict";var K8=(t,e)=>{if(Number.isSafeInteger(t))t<0?J8(t,e):Z8(t,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Z8=(t,e)=>{e[0]=128;for(var r=e.length;r>1;r--)e[r-1]=t&255,t=Math.floor(t/256)},J8=(t,e)=>{e[0]=255;var r=!1;t=t*-1;for(var n=e.length;n>1;n--){var i=t&255;t=Math.floor(t/256),r?e[n-1]=sA(i):i===0?e[n-1]=0:(r=!0,e[n-1]=oA(i))}},X8=t=>{let e=t[0],r=e===128?e6(t.slice(1,t.length)):e===255?Q8(t):null;if(r===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(r))throw Error("parsed number outside of javascript safe integer range");return r},Q8=t=>{for(var e=t.length,r=0,n=!1,i=e-1;i>-1;i--){var s=t[i],o;n?o=sA(s):s===0?o=s:(n=!0,o=oA(s)),o!==0&&(r-=o*Math.pow(256,e-i-1))}return r},e6=t=>{for(var e=t.length,r=0,n=e-1;n>-1;n--){var i=t[n];i!==0&&(r+=i*Math.pow(256,e-n-1))}return r},sA=t=>(255^t)&255,oA=t=>(255^t)+1&255;aA.exports={encode:K8,parse:X8}});var Ds=A((jW,lA)=>{"use strict";var lm=cm(),As=require("path").posix,cA=uA(),hm=Symbol("slurp"),Pt=Symbol("type"),pm=class{constructor(e,r,n,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[Pt]="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,r||0,n,i):e&&this.set(e)}decode(e,r,n,i){if(r||(r=0),!e||!(e.length>=r+512))throw new Error("need 512 bytes for header");if(this.path=ii(e,r,100),this.mode=xn(e,r+100,8),this.uid=xn(e,r+108,8),this.gid=xn(e,r+116,8),this.size=xn(e,r+124,12),this.mtime=fm(e,r+136,12),this.cksum=xn(e,r+148,12),this[hm](n),this[hm](i,!0),this[Pt]=ii(e,r+156,1),this[Pt]===""&&(this[Pt]="0"),this[Pt]==="0"&&this.path.slice(-1)==="/"&&(this[Pt]="5"),this[Pt]==="5"&&(this.size=0),this.linkpath=ii(e,r+157,100),e.slice(r+257,r+265).toString()==="ustar\x0000")if(this.uname=ii(e,r+265,32),this.gname=ii(e,r+297,32),this.devmaj=xn(e,r+329,8),this.devmin=xn(e,r+337,8),e[r+475]!==0){let o=ii(e,r+345,155);this.path=o+"/"+this.path}else{let o=ii(e,r+345,130);o&&(this.path=o+"/"+this.path),this.atime=fm(e,r+476,12),this.ctime=fm(e,r+488,12)}let s=8*32;for(let o=r;o<r+148;o++)s+=e[o];for(let o=r+156;o<r+512;o++)s+=e[o];this.cksumValid=s===this.cksum,this.cksum===null&&s===8*32&&(this.nullBlock=!0)}[hm](e,r){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(r&&n==="path")&&(this[n]=e[n])}encode(e,r){if(e||(e=this.block=Buffer.alloc(512),r=0),r||(r=0),!(e.length>=r+512))throw new Error("need 512 bytes for header");let n=this.ctime||this.atime?130:155,i=t6(this.path||"",n),s=i[0],o=i[1];this.needPax=i[2],this.needPax=si(e,r,100,s)||this.needPax,this.needPax=Sn(e,r+100,8,this.mode)||this.needPax,this.needPax=Sn(e,r+108,8,this.uid)||this.needPax,this.needPax=Sn(e,r+116,8,this.gid)||this.needPax,this.needPax=Sn(e,r+124,12,this.size)||this.needPax,this.needPax=dm(e,r+136,12,this.mtime)||this.needPax,e[r+156]=this[Pt].charCodeAt(0),this.needPax=si(e,r+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",r+257,8),this.needPax=si(e,r+265,32,this.uname)||this.needPax,this.needPax=si(e,r+297,32,this.gname)||this.needPax,this.needPax=Sn(e,r+329,8,this.devmaj)||this.needPax,this.needPax=Sn(e,r+337,8,this.devmin)||this.needPax,this.needPax=si(e,r+345,n,o)||this.needPax,e[r+475]!==0?this.needPax=si(e,r+345,155,o)||this.needPax:(this.needPax=si(e,r+345,130,o)||this.needPax,this.needPax=dm(e,r+476,12,this.atime)||this.needPax,this.needPax=dm(e,r+488,12,this.ctime)||this.needPax);let a=8*32;for(let u=r;u<r+148;u++)a+=e[u];for(let u=r+156;u<r+512;u++)a+=e[u];return this.cksum=a,Sn(e,r+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let r in e)e[r]!==null&&e[r]!==void 0&&(this[r]=e[r])}get type(){return lm.name.get(this[Pt])||this[Pt]}get typeKey(){return this[Pt]}set type(e){lm.code.has(e)?this[Pt]=lm.code.get(e):this[Pt]=e}},t6=(t,e)=>{let n=t,i="",s,o=As.parse(t).root||".";if(Buffer.byteLength(n)<100)s=[n,i,!1];else{i=As.dirname(n),n=As.basename(n);do Buffer.byteLength(n)<=100&&Buffer.byteLength(i)<=e?s=[n,i,!1]:Buffer.byteLength(n)>100&&Buffer.byteLength(i)<=e?s=[n.slice(0,100-1),i,!0]:(n=As.join(As.basename(i),n),i=As.dirname(i));while(i!==o&&!s);s||(s=[t.slice(0,100-1),"",!0])}return s},ii=(t,e,r)=>t.slice(e,e+r).toString("utf8").replace(/\0.*/,""),fm=(t,e,r)=>r6(xn(t,e,r)),r6=t=>t===null?null:new Date(t*1e3),xn=(t,e,r)=>t[e]&128?cA.parse(t.slice(e,e+r)):i6(t,e,r),n6=t=>isNaN(t)?null:t,i6=(t,e,r)=>n6(parseInt(t.slice(e,e+r).toString("utf8").replace(/\0.*$/,"").trim(),8)),s6={12:8589934591,8:2097151},Sn=(t,e,r,n)=>n===null?!1:n>s6[r]||n<0?(cA.encode(n,t.slice(e,e+r)),!0):(o6(t,e,r,n),!1),o6=(t,e,r,n)=>t.write(a6(n,r),e,r,"ascii"),a6=(t,e)=>u6(Math.floor(t).toString(8),e),u6=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join("0")+t+" ")+"\0",dm=(t,e,r,n)=>n===null?!1:Sn(t,e,r,n.getTime()/1e3),c6=new Array(156).join("\0"),si=(t,e,r,n)=>n===null?!1:(t.write(n+c6,e,r,"utf8"),n.length!==Buffer.byteLength(n)||n.length>r);lA.exports=pm});var Fc=A((qW,hA)=>{"use strict";var l6=Ds(),h6=require("path"),ra=class{constructor(e,r){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=r||!1}encode(){let e=this.encodeBody();if(e==="")return null;let r=Buffer.byteLength(e),n=512*Math.ceil(1+r/512),i=Buffer.allocUnsafe(n);for(let s=0;s<512;s++)i[s]=0;new l6({path:("PaxHeader/"+h6.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,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,r,"utf8");for(let s=r+512;s<i.length;s++)i[s]=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 r=this[e]instanceof Date?this[e].getTime()/1e3:this[e],n=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+r+`
|
|
24
|
-
`,i=Buffer.byteLength(n),s=Math.floor(Math.log(i)/Math.log(10))+1;return i+s>=Math.pow(10,s)&&(s+=1),s+i+n}};ra.parse=(t,e,r)=>new ra(
|
|
25
|
-
`).reduce(p6,Object.create(null)),p6=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.slice((r+" ").length);let n=e.split("="),i=n.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return t;let s=n.join("=");return t[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s,t};hA.exports=ra});var Cs=A((UW,fA)=>{fA.exports=t=>{let e=t.length-1,r=-1;for(;e>-1&&t.charAt(e)==="/";)r=e,e--;return r===-1?t:t.slice(0,r)}});var Pc=A((HW,dA)=>{"use strict";dA.exports=t=>class extends t{warn(e,r,n={}){this.file&&(n.file=this.file),this.cwd&&(n.cwd=this.cwd),n.code=r instanceof Error&&r.code||e,n.tarCode=e,!this.strict&&n.recoverable!==!1?(r instanceof Error&&(n=Object.assign(r,n),r=r.message),this.emit("warn",n.tarCode,r,n)):r instanceof Error?this.emit("error",Object.assign(r,n)):this.emit("error",Object.assign(new Error(`${e}: ${r}`),n))}}});var ym=A((GW,pA)=>{"use strict";var Ic=["|","<",">","?",":"],mm=Ic.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),m6=new Map(Ic.map((t,e)=>[t,mm[e]])),y6=new Map(mm.map((t,e)=>[t,Ic[e]]));pA.exports={encode:t=>Ic.reduce((e,r)=>e.split(r).join(m6.get(r)),t),decode:t=>mm.reduce((e,r)=>e.split(r).join(y6.get(r)),t)}});var gm=A((zW,yA)=>{var{isAbsolute:g6,parse:mA}=require("path").win32;yA.exports=t=>{let e="",r=mA(t);for(;g6(t)||r.root;){let n=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":r.root;t=t.slice(n.length),e+=n,r=mA(t)}return[e,t]}});var _A=A((VW,gA)=>{"use strict";gA.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var Cm=A((KW,FA)=>{"use strict";var AA=Ec(),DA=Fc(),CA=Ds(),xr=require("fs"),bA=require("path"),wr=Ss(),_6=Cs(),RA=(t,e)=>e?(t=wr(t).replace(/^\.(\/|$)/,""),_6(e)+"/"+t):wr(t),b6=16*1024*1024,vA=Symbol("process"),EA=Symbol("file"),wA=Symbol("directory"),bm=Symbol("symlink"),xA=Symbol("hardlink"),na=Symbol("header"),Lc=Symbol("read"),vm=Symbol("lstat"),Bc=Symbol("onlstat"),Em=Symbol("onread"),wm=Symbol("onreadlink"),xm=Symbol("openfile"),Sm=Symbol("onopenfile"),An=Symbol("close"),Nc=Symbol("mode"),Am=Symbol("awaitDrain"),_m=Symbol("ondrain"),Sr=Symbol("prefix"),SA=Symbol("hadError"),kA=Pc(),v6=ym(),TA=gm(),OA=_A(),Mc=kA(class extends AA{constructor(e,r){if(r=r||{},super(r),typeof e!="string")throw new TypeError("path is required");this.path=wr(e),this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||b6,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=wr(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,this.prefix=r.prefix?wr(r.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 r.onwarn=="function"&&this.on("warn",r.onwarn);let n=!1;if(!this.preservePaths){let[i,s]=TA(this.path);i&&(this.path=s,n=i)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=v6.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=wr(r.absolute||bA.resolve(this.cwd,e)),this.path===""&&(this.path="./"),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.statCache.has(this.absolute)?this[Bc](this.statCache.get(this.absolute)):this[vm]()}emit(e,...r){return e==="error"&&(this[SA]=!0),super.emit(e,...r)}[vm](){xr.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[Bc](r)})}[Bc](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=w6(e),this.emit("stat",e),this[vA]()}[vA](){switch(this.type){case"File":return this[EA]();case"Directory":return this[wA]();case"SymbolicLink":return this[bm]();default:return this.end()}}[Nc](e){return OA(e,this.type==="Directory",this.portable)}[Sr](e){return RA(e,this.prefix)}[na](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new CA({path:this[Sr](this.path),linkpath:this.type==="Link"?this[Sr](this.linkpath):this.linkpath,mode:this[Nc](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 DA({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[Sr](this.path),linkpath:this.type==="Link"?this[Sr](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)}[wA](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[na](),this.end()}[bm](){xr.readlink(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[wm](r)})}[wm](e){this.linkpath=wr(e),this[na](),this.end()}[xA](e){this.type="Link",this.linkpath=wr(bA.relative(this.cwd,e)),this.stat.size=0,this[na](),this.end()}[EA](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let r=this.linkCache.get(e);if(r.indexOf(this.cwd)===0)return this[xA](r)}this.linkCache.set(e,this.absolute)}if(this[na](),this.stat.size===0)return this.end();this[xm]()}[xm](){xr.open(this.absolute,"r",(e,r)=>{if(e)return this.emit("error",e);this[Sm](r)})}[Sm](e){if(this.fd=e,this[SA])return this[An]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let r=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(r),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Lc]()}[Lc](){let{fd:e,buf:r,offset:n,length:i,pos:s}=this;xr.read(e,r,n,i,s,(o,a)=>{if(o)return this[An](()=>this.emit("error",o));this[Em](a)})}[An](e){xr.close(this.fd,e)}[Em](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[An](()=>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[An](()=>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 r=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(r)?this[_m]():this[Am](()=>this[_m]())}[Am](e){this.once("drain",e)}write(e){if(this.blockRemain<e.length){let r=new Error("writing more data than expected");return r.path=this.absolute,this.emit("error",r)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[_m](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[An](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[Lc]()}}),Dm=class extends Mc{[vm](){this[Bc](xr.lstatSync(this.absolute))}[bm](){this[wm](xr.readlinkSync(this.absolute))}[xm](){this[Sm](xr.openSync(this.absolute,"r"))}[Lc](){let e=!0;try{let{fd:r,buf:n,offset:i,length:s,pos:o}=this,a=xr.readSync(r,n,i,s,o);this[Em](a),e=!1}finally{if(e)try{this[An](()=>{})}catch{}}}[Am](e){e()}[An](e){xr.closeSync(this.fd),e()}},E6=kA(class extends AA{constructor(e,r){r=r||{},super(r),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=r.prefix||null,this.path=wr(e.path),this.mode=this[Nc](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:r.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=wr(e.linkpath),typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let n=!1;if(!this.preservePaths){let[i,s]=TA(this.path);i&&(this.path=s,n=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new CA({path:this[Sr](this.path),linkpath:this.type==="Link"?this[Sr](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}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new DA({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[Sr](this.path),linkpath:this.type==="Link"?this[Sr](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)}[Sr](e){return RA(e,this.prefix)}[Nc](e){return OA(e,this.type==="Directory",this.portable)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});Mc.Sync=Dm;Mc.Tar=E6;var w6=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";FA.exports=Mc});var IA=A((ZW,PA)=>{"use strict";PA.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var Rm=A((JW,LA)=>{"use strict";LA.exports=Ce;Ce.Node=oi;Ce.create=Ce;function Ce(t){var e=this;if(e instanceof Ce||(e=new Ce),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)e.push(arguments[r]);return e}Ce.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};Ce.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};Ce.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};Ce.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)S6(this,arguments[t]);return this.length};Ce.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)A6(this,arguments[t]);return this.length};Ce.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};Ce.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};Ce.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;r!==null;n++)t.call(e,r.value,n,this),r=r.next};Ce.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;r!==null;n--)t.call(e,r.value,n,this),r=r.prev};Ce.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};Ce.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};Ce.prototype.map=function(t,e){e=e||this;for(var r=new Ce,n=this.head;n!==null;)r.push(t.call(e,n.value,this)),n=n.next;return r};Ce.prototype.mapReverse=function(t,e){e=e||this;for(var r=new Ce,n=this.tail;n!==null;)r.push(t.call(e,n.value,this)),n=n.prev;return r};Ce.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};Ce.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};Ce.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};Ce.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};Ce.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Ce;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(;i!==null&&n<e;n++,i=i.next)r.push(i.value);return r};Ce.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Ce;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};Ce.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(var s=[],n=0;i&&n<e;n++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=x6(this,i,r[n]);return s};Ce.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};function x6(t,e,r){var n=e===t.head?new oi(r,null,e,t):new oi(r,e,e.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function S6(t,e){t.tail=new oi(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function A6(t,e){t.head=new oi(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function oi(t,e,r,n){if(!(this instanceof oi))return new oi(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{IA()(Ce)}catch{}});var Wc=A((QW,HA)=>{"use strict";var zc=class{constructor(e,r){this.path=e||"./",this.absolute=r,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},D6=Ec(),C6=om(),R6=Tc(),Nm=Cm(),k6=Nm.Sync,T6=Nm.Tar,O6=Rm(),BA=Buffer.alloc(1024),Uc=Symbol("onStat"),jc=Symbol("ended"),Ar=Symbol("queue"),Rs=Symbol("current"),ai=Symbol("process"),qc=Symbol("processing"),NA=Symbol("processJob"),Dr=Symbol("jobs"),km=Symbol("jobDone"),Hc=Symbol("addFSEntry"),MA=Symbol("addTarEntry"),Pm=Symbol("stat"),Im=Symbol("readdir"),$c=Symbol("onreaddir"),Gc=Symbol("pipe"),jA=Symbol("entry"),Tm=Symbol("entryOpt"),Lm=Symbol("writeEntryClass"),UA=Symbol("write"),Om=Symbol("ondrain"),Vc=require("fs"),qA=require("path"),F6=Pc(),Fm=Ss(),Mm=F6(class extends D6{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=Fm(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[Lm]=Nm,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 C6.Gzip(e.gzip),this.zip.on("data",r=>super.write(r)),this.zip.on("end",r=>super.end()),this.zip.on("drain",r=>this[Om]()),this.on("resume",r=>this.zip.resume())):this.on("drain",this[Om]),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:r=>!0,this[Ar]=new O6,this[Dr]=0,this.jobs=+e.jobs||4,this[qc]=!1,this[jc]=!1}[UA](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[jc]=!0,this[ai](),this}write(e){if(this[jc])throw new Error("write after end");return e instanceof R6?this[MA](e):this[Hc](e),this.flowing}[MA](e){let r=Fm(qA.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let n=new zc(e.path,r,!1);n.entry=new T6(e,this[Tm](n)),n.entry.on("end",i=>this[km](n)),this[Dr]+=1,this[Ar].push(n)}this[ai]()}[Hc](e){let r=Fm(qA.resolve(this.cwd,e));this[Ar].push(new zc(e,r)),this[ai]()}[Pm](e){e.pending=!0,this[Dr]+=1;let r=this.follow?"stat":"lstat";Vc[r](e.absolute,(n,i)=>{e.pending=!1,this[Dr]-=1,n?this.emit("error",n):this[Uc](e,i)})}[Uc](e,r){this.statCache.set(e.absolute,r),e.stat=r,this.filter(e.path,r)||(e.ignore=!0),this[ai]()}[Im](e){e.pending=!0,this[Dr]+=1,Vc.readdir(e.absolute,(r,n)=>{if(e.pending=!1,this[Dr]-=1,r)return this.emit("error",r);this[$c](e,n)})}[$c](e,r){this.readdirCache.set(e.absolute,r),e.readdir=r,this[ai]()}[ai](){if(!this[qc]){this[qc]=!0;for(let e=this[Ar].head;e!==null&&this[Dr]<this.jobs;e=e.next)if(this[NA](e.value),e.value.ignore){let r=e.next;this[Ar].removeNode(e),e.next=r}this[qc]=!1,this[jc]&&!this[Ar].length&&this[Dr]===0&&(this.zip?this.zip.end(BA):(super.write(BA),super.end()))}}get[Rs](){return this[Ar]&&this[Ar].head&&this[Ar].head.value}[km](e){this[Ar].shift(),this[Dr]-=1,this[ai]()}[NA](e){if(!e.pending){if(e.entry){e===this[Rs]&&!e.piped&&this[Gc](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[Uc](e,this.statCache.get(e.absolute)):this[Pm](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[$c](e,this.readdirCache.get(e.absolute)):this[Im](e),!e.readdir))){if(e.entry=this[jA](e),!e.entry){e.ignore=!0;return}e===this[Rs]&&!e.piped&&this[Gc](e)}}}[Tm](e){return{onwarn:(r,n,i)=>this.warn(r,n,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}}[jA](e){this[Dr]+=1;try{return new this[Lm](e.path,this[Tm](e)).on("end",()=>this[km](e)).on("error",r=>this.emit("error",r))}catch(r){this.emit("error",r)}}[Om](){this[Rs]&&this[Rs].entry&&this[Rs].entry.resume()}[Gc](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let s=e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[Hc](o+i)});let r=e.entry,n=this.zip;n?r.on("data",i=>{n.write(i)||r.pause()}):r.on("data",i=>{super.write(i)||r.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),Bm=class extends Mm{constructor(e){super(e),this[Lm]=k6}pause(){}resume(){}[Pm](e){let r=this.follow?"statSync":"lstatSync";this[Uc](e,Vc[r](e.absolute))}[Im](e,r){this[$c](e,Vc.readdirSync(e.absolute))}[Gc](e){let r=e.entry,n=this.zip;e.readdir&&e.readdir.forEach(i=>{let s=e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[Hc](o+i)}),n?r.on("data",i=>{n.write(i)}):r.on("data",i=>{super[UA](i)})}};Mm.Sync=Bm;HA.exports=Mm});var Bs=A(sa=>{"use strict";var P6=Gp(),I6=require("events").EventEmitter,At=require("fs"),Um=At.writev;if(!Um){let t=process.binding("fs"),e=t.FSReqWrap||t.FSReqCallback;Um=(r,n,i,s)=>{let o=(u,c)=>s(u,c,n),a=new e;a.oncomplete=o,t.writeBuffers(r,n,i,a)}}var Is=Symbol("_autoClose"),or=Symbol("_close"),ia=Symbol("_ended"),Oe=Symbol("_fd"),$A=Symbol("_finished"),Cn=Symbol("_flags"),jm=Symbol("_flush"),Hm=Symbol("_handleChunk"),$m=Symbol("_makeBuf"),Xc=Symbol("_mode"),Yc=Symbol("_needDrain"),Fs=Symbol("_onerror"),Ls=Symbol("_onopen"),qm=Symbol("_onread"),Ts=Symbol("_onwrite"),Rn=Symbol("_open"),Kr=Symbol("_path"),ui=Symbol("_pos"),Cr=Symbol("_queue"),Os=Symbol("_read"),GA=Symbol("_readSize"),Dn=Symbol("_reading"),Kc=Symbol("_remain"),zA=Symbol("_size"),Zc=Symbol("_write"),ks=Symbol("_writing"),Jc=Symbol("_defaultFlag"),Ps=Symbol("_errored"),Qc=class extends P6{constructor(e,r){if(r=r||{},super(r),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Ps]=!1,this[Oe]=typeof r.fd=="number"?r.fd:null,this[Kr]=e,this[GA]=r.readSize||16*1024*1024,this[Dn]=!1,this[zA]=typeof r.size=="number"?r.size:1/0,this[Kc]=this[zA],this[Is]=typeof r.autoClose=="boolean"?r.autoClose:!0,typeof this[Oe]=="number"?this[Os]():this[Rn]()}get fd(){return this[Oe]}get path(){return this[Kr]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Rn](){At.open(this[Kr],"r",(e,r)=>this[Ls](e,r))}[Ls](e,r){e?this[Fs](e):(this[Oe]=r,this.emit("open",r),this[Os]())}[$m](){return Buffer.allocUnsafe(Math.min(this[GA],this[Kc]))}[Os](){if(!this[Dn]){this[Dn]=!0;let e=this[$m]();if(e.length===0)return process.nextTick(()=>this[qm](null,0,e));At.read(this[Oe],e,0,e.length,null,(r,n,i)=>this[qm](r,n,i))}}[qm](e,r,n){this[Dn]=!1,e?this[Fs](e):this[Hm](r,n)&&this[Os]()}[or](){if(this[Is]&&typeof this[Oe]=="number"){let e=this[Oe];this[Oe]=null,At.close(e,r=>r?this.emit("error",r):this.emit("close"))}}[Fs](e){this[Dn]=!0,this[or](),this.emit("error",e)}[Hm](e,r){let n=!1;return this[Kc]-=e,e>0&&(n=super.write(e<r.length?r.slice(0,e):r)),(e===0||this[Kc]<=0)&&(n=!1,this[or](),super.end()),n}emit(e,r){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[Oe]=="number"&&this[Os]();break;case"error":return this[Ps]?void 0:(this[Ps]=!0,super.emit(e,r));default:return super.emit(e,r)}}},Gm=class extends Qc{[Rn](){let e=!0;try{this[Ls](null,At.openSync(this[Kr],"r")),e=!1}finally{e&&this[or]()}}[Os](){let e=!0;try{if(!this[Dn]){this[Dn]=!0;do{let r=this[$m](),n=r.length===0?0:At.readSync(this[Oe],r,0,r.length,null);if(!this[Hm](n,r))break}while(!0);this[Dn]=!1}e=!1}finally{e&&this[or]()}}[or](){if(this[Is]&&typeof this[Oe]=="number"){let e=this[Oe];this[Oe]=null,At.closeSync(e),this.emit("close")}}},el=class extends I6{constructor(e,r){r=r||{},super(r),this.readable=!1,this.writable=!0,this[Ps]=!1,this[ks]=!1,this[ia]=!1,this[Yc]=!1,this[Cr]=[],this[Kr]=e,this[Oe]=typeof r.fd=="number"?r.fd:null,this[Xc]=r.mode===void 0?438:r.mode,this[ui]=typeof r.start=="number"?r.start:null,this[Is]=typeof r.autoClose=="boolean"?r.autoClose:!0;let n=this[ui]!==null?"r+":"w";this[Jc]=r.flags===void 0,this[Cn]=this[Jc]?n:r.flags,this[Oe]===null&&this[Rn]()}emit(e,r){if(e==="error"){if(this[Ps])return;this[Ps]=!0}return super.emit(e,r)}get fd(){return this[Oe]}get path(){return this[Kr]}[Fs](e){this[or](),this[ks]=!0,this.emit("error",e)}[Rn](){At.open(this[Kr],this[Cn],this[Xc],(e,r)=>this[Ls](e,r))}[Ls](e,r){this[Jc]&&this[Cn]==="r+"&&e&&e.code==="ENOENT"?(this[Cn]="w",this[Rn]()):e?this[Fs](e):(this[Oe]=r,this.emit("open",r),this[jm]())}end(e,r){return e&&this.write(e,r),this[ia]=!0,!this[ks]&&!this[Cr].length&&typeof this[Oe]=="number"&&this[Ts](null,0),this}write(e,r){return typeof e=="string"&&(e=Buffer.from(e,r)),this[ia]?(this.emit("error",new Error("write() after end()")),!1):this[Oe]===null||this[ks]||this[Cr].length?(this[Cr].push(e),this[Yc]=!0,!1):(this[ks]=!0,this[Zc](e),!0)}[Zc](e){At.write(this[Oe],e,0,e.length,this[ui],(r,n)=>this[Ts](r,n))}[Ts](e,r){e?this[Fs](e):(this[ui]!==null&&(this[ui]+=r),this[Cr].length?this[jm]():(this[ks]=!1,this[ia]&&!this[$A]?(this[$A]=!0,this[or](),this.emit("finish")):this[Yc]&&(this[Yc]=!1,this.emit("drain"))))}[jm](){if(this[Cr].length===0)this[ia]&&this[Ts](null,0);else if(this[Cr].length===1)this[Zc](this[Cr].pop());else{let e=this[Cr];this[Cr]=[],Um(this[Oe],e,this[ui],(r,n)=>this[Ts](r,n))}}[or](){if(this[Is]&&typeof this[Oe]=="number"){let e=this[Oe];this[Oe]=null,At.close(e,r=>r?this.emit("error",r):this.emit("close"))}}},zm=class extends el{[Rn](){let e;if(this[Jc]&&this[Cn]==="r+")try{e=At.openSync(this[Kr],this[Cn],this[Xc])}catch(r){if(r.code==="ENOENT")return this[Cn]="w",this[Rn]();throw r}else e=At.openSync(this[Kr],this[Cn],this[Xc]);this[Ls](null,e)}[or](){if(this[Is]&&typeof this[Oe]=="number"){let e=this[Oe];this[Oe]=null,At.closeSync(e),this.emit("close")}}[Zc](e){let r=!0;try{this[Ts](null,At.writeSync(this[Oe],e,0,e.length,this[ui])),r=!1}finally{if(r)try{this[or]()}catch{}}}};sa.ReadStream=Qc;sa.ReadStreamSync=Gm;sa.WriteStream=el;sa.WriteStreamSync=zm});var al=A((rY,QA)=>{"use strict";var L6=Pc(),B6=Ds(),N6=require("events"),M6=Rm(),j6=1024*1024,q6=Tc(),VA=Fc(),U6=om(),{nextTick:H6}=require("process"),Vm=Buffer.from([31,139]),Vt=Symbol("state"),ci=Symbol("writeEntry"),Zr=Symbol("readEntry"),Wm=Symbol("nextEntry"),WA=Symbol("processEntry"),Wt=Symbol("extendedHeader"),oa=Symbol("globalExtendedHeader"),kn=Symbol("meta"),YA=Symbol("emitMeta"),Le=Symbol("buffer"),Jr=Symbol("queue"),li=Symbol("ended"),KA=Symbol("emittedEnd"),hi=Symbol("emit"),Dt=Symbol("unzip"),tl=Symbol("consumeChunk"),rl=Symbol("consumeChunkSub"),Ym=Symbol("consumeBody"),ZA=Symbol("consumeMeta"),JA=Symbol("consumeHeader"),nl=Symbol("consuming"),Km=Symbol("bufferConcat"),Zm=Symbol("maybeEnd"),aa=Symbol("writing"),Tn=Symbol("aborted"),il=Symbol("onDone"),fi=Symbol("sawValidEntry"),sl=Symbol("sawNullBlock"),ol=Symbol("sawEOF"),XA=Symbol("closeStream"),$6=t=>!0;QA.exports=L6(class extends N6{constructor(e){e=e||{},super(e),this.file=e.file||"",this[fi]=null,this.on(il,r=>{(this[Vt]==="begin"||this[fi]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(il,e.ondone):this.on(il,r=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||j6,this.filter=typeof e.filter=="function"?e.filter:$6,this.writable=!0,this.readable=!1,this[Jr]=new M6,this[Le]=null,this[Zr]=null,this[ci]=null,this[Vt]="begin",this[kn]="",this[Wt]=null,this[oa]=null,this[li]=!1,this[Dt]=null,this[Tn]=!1,this[sl]=!1,this[ol]=!1,this.on("end",()=>this[XA]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[JA](e,r){this[fi]===null&&(this[fi]=!1);let n;try{n=new B6(e,r,this[Wt],this[oa])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(n.nullBlock)this[sl]?(this[ol]=!0,this[Vt]==="begin"&&(this[Vt]="header"),this[hi]("eof")):(this[sl]=!0,this[hi]("nullBlock"));else if(this[sl]=!1,!n.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:n});else if(!n.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:n});else{let i=n.type;if(/^(Symbolic)?Link$/.test(i)&&!n.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:n});else if(!/^(Symbolic)?Link$/.test(i)&&n.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:n});else{let s=this[ci]=new q6(n,this[Wt],this[oa]);if(!this[fi])if(s.remain){let o=()=>{s.invalid||(this[fi]=!0)};s.on("end",o)}else this[fi]=!0;s.meta?s.size>this.maxMetaEntrySize?(s.ignore=!0,this[hi]("ignoredEntry",s),this[Vt]="ignore",s.resume()):s.size>0&&(this[kn]="",s.on("data",o=>this[kn]+=o),this[Vt]="meta"):(this[Wt]=null,s.ignore=s.ignore||!this.filter(s.path,s),s.ignore?(this[hi]("ignoredEntry",s),this[Vt]=s.remain?"ignore":"header",s.resume()):(s.remain?this[Vt]="body":(this[Vt]="header",s.end()),this[Zr]?this[Jr].push(s):(this[Jr].push(s),this[Wm]())))}}}[XA](){H6(()=>this.emit("close"))}[WA](e){let r=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Zr]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",n=>this[Wm]()),r=!1)):(this[Zr]=null,r=!1),r}[Wm](){do;while(this[WA](this[Jr].shift()));if(!this[Jr].length){let e=this[Zr];!e||e.flowing||e.size===e.remain?this[aa]||this.emit("drain"):e.once("drain",n=>this.emit("drain"))}}[Ym](e,r){let n=this[ci],i=n.blockRemain,s=i>=e.length&&r===0?e:e.slice(r,r+i);return n.write(s),n.blockRemain||(this[Vt]="header",this[ci]=null,n.end()),s.length}[ZA](e,r){let n=this[ci],i=this[Ym](e,r);return this[ci]||this[YA](n),i}[hi](e,r,n){!this[Jr].length&&!this[Zr]?this.emit(e,r,n):this[Jr].push([e,r,n])}[YA](e){switch(this[hi]("meta",this[kn]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[Wt]=VA.parse(this[kn],this[Wt],!1);break;case"GlobalExtendedHeader":this[oa]=VA.parse(this[kn],this[oa],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[Wt]=this[Wt]||Object.create(null),this[Wt].path=this[kn].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[Wt]=this[Wt]||Object.create(null),this[Wt].linkpath=this[kn].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Tn]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[Tn])return;if(this[Dt]===null&&e){if(this[Le]&&(e=Buffer.concat([this[Le],e]),this[Le]=null),e.length<Vm.length)return this[Le]=e,!0;for(let n=0;this[Dt]===null&&n<Vm.length;n++)e[n]!==Vm[n]&&(this[Dt]=!1);if(this[Dt]===null){let n=this[li];this[li]=!1,this[Dt]=new U6.Unzip,this[Dt].on("data",s=>this[tl](s)),this[Dt].on("error",s=>this.abort(s)),this[Dt].on("end",s=>{this[li]=!0,this[tl]()}),this[aa]=!0;let i=this[Dt][n?"end":"write"](e);return this[aa]=!1,i}}this[aa]=!0,this[Dt]?this[Dt].write(e):this[tl](e),this[aa]=!1;let r=this[Jr].length?!1:this[Zr]?this[Zr].flowing:!0;return!r&&!this[Jr].length&&this[Zr].once("drain",n=>this.emit("drain")),r}[Km](e){e&&!this[Tn]&&(this[Le]=this[Le]?Buffer.concat([this[Le],e]):e)}[Zm](){if(this[li]&&!this[KA]&&!this[Tn]&&!this[nl]){this[KA]=!0;let e=this[ci];if(e&&e.blockRemain){let r=this[Le]?this[Le].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${r} available)`,{entry:e}),this[Le]&&e.write(this[Le]),e.end()}this[hi](il)}}[tl](e){if(this[nl])this[Km](e);else if(!e&&!this[Le])this[Zm]();else{if(this[nl]=!0,this[Le]){this[Km](e);let r=this[Le];this[Le]=null,this[rl](r)}else this[rl](e);for(;this[Le]&&this[Le].length>=512&&!this[Tn]&&!this[ol];){let r=this[Le];this[Le]=null,this[rl](r)}this[nl]=!1}(!this[Le]||this[li])&&this[Zm]()}[rl](e){let r=0,n=e.length;for(;r+512<=n&&!this[Tn]&&!this[ol];)switch(this[Vt]){case"begin":case"header":this[JA](e,r),r+=512;break;case"ignore":case"body":r+=this[Ym](e,r);break;case"meta":r+=this[ZA](e,r);break;default:throw new Error("invalid state: "+this[Vt])}r<n&&(this[Le]?this[Le]=Buffer.concat([e.slice(r),this[Le]]):this[Le]=e.slice(r))}end(e){this[Tn]||(this[Dt]?this[Dt].end(e):(this[li]=!0,this.write(e)))}})});var ul=A((nY,nD)=>{"use strict";var G6=bs(),tD=al(),Ns=require("fs"),z6=Bs(),eD=require("path"),Jm=Cs();nD.exports=(t,e,r)=>{typeof t=="function"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(r=e,e=null),e?e=Array.from(e):e=[];let n=G6(t);if(n.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!n.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return e.length&&W6(n,e),n.noResume||V6(n),n.file&&n.sync?Y6(n):n.file?K6(n,r):rD(n)};var V6=t=>{let e=t.onentry;t.onentry=e?r=>{e(r),r.resume()}:r=>r.resume()},W6=(t,e)=>{let r=new Map(e.map(s=>[Jm(s),!0])),n=t.filter,i=(s,o)=>{let a=o||eD.parse(s).root||".",u=s===a?!1:r.has(s)?r.get(s):i(eD.dirname(s),a);return r.set(s,u),u};t.filter=n?(s,o)=>n(s,o)&&i(Jm(s)):s=>i(Jm(s))},Y6=t=>{let e=rD(t),r=t.file,n=!0,i;try{let s=Ns.statSync(r),o=t.maxReadSize||16*1024*1024;if(s.size<o)e.end(Ns.readFileSync(r));else{let a=0,u=Buffer.allocUnsafe(o);for(i=Ns.openSync(r,"r");a<s.size;){let c=Ns.readSync(i,u,0,o,a);a+=c,e.write(u.slice(0,c))}e.end()}n=!1}finally{if(n&&i)try{Ns.closeSync(i)}catch{}}},K6=(t,e)=>{let r=new tD(t),n=t.maxReadSize||16*1024*1024,i=t.file,s=new Promise((o,a)=>{r.on("error",a),r.on("end",o),Ns.stat(i,(u,c)=>{if(u)a(u);else{let l=new z6.ReadStream(i,{readSize:n,size:c.size});l.on("error",a),l.pipe(r)}})});return e?s.then(e,e):s},rD=t=>new tD(t)});var cD=A((iY,uD)=>{"use strict";var Z6=bs(),cl=Wc(),iD=Bs(),sD=ul(),oD=require("path");uD.exports=(t,e,r)=>{if(typeof e=="function"&&(r=e),Array.isArray(t)&&(e=t,t={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let n=Z6(t);if(n.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!n.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return n.file&&n.sync?J6(n,e):n.file?X6(n,e,r):n.sync?Q6(n,e):e4(n,e)};var J6=(t,e)=>{let r=new cl.Sync(t),n=new iD.WriteStreamSync(t.file,{mode:t.mode||438});r.pipe(n),aD(r,e)},X6=(t,e,r)=>{let n=new cl(t),i=new iD.WriteStream(t.file,{mode:t.mode||438});n.pipe(i);let s=new Promise((o,a)=>{i.on("error",a),i.on("close",o),n.on("error",a)});return Xm(n,e),r?s.then(r,r):s},aD=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?sD({file:oD.resolve(t.cwd,r.slice(1)),sync:!0,noResume:!0,onentry:n=>t.add(n)}):t.add(r)}),t.end()},Xm=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)==="@")return sD({file:oD.resolve(t.cwd,r.slice(1)),noResume:!0,onentry:n=>t.add(n)}).then(n=>Xm(t,e));t.add(r)}t.end()},Q6=(t,e)=>{let r=new cl.Sync(t);return aD(r,e),r},e4=(t,e)=>{let r=new cl(t);return Xm(r,e),r}});var Qm=A((sY,yD)=>{"use strict";var t4=bs(),lD=Wc(),It=require("fs"),hD=Bs(),fD=ul(),dD=require("path"),pD=Ds();yD.exports=(t,e,r)=>{let n=t4(t);if(!n.file)throw new TypeError("file is required");if(n.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),n.sync?r4(n,e):i4(n,e,r)};var r4=(t,e)=>{let r=new lD.Sync(t),n=!0,i,s;try{try{i=It.openSync(t.file,"r+")}catch(u){if(u.code==="ENOENT")i=It.openSync(t.file,"w+");else throw u}let o=It.fstatSync(i),a=Buffer.alloc(512);e:for(s=0;s<o.size;s+=512){for(let l=0,h=0;l<512;l+=h){if(h=It.readSync(i,a,l,a.length-l,s+l),s===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!h)break e}let u=new pD(a);if(!u.cksumValid)break;let c=512*Math.ceil(u.size/512);if(s+c+512>o.size)break;s+=c,t.mtimeCache&&t.mtimeCache.set(u.path,u.mtime)}n=!1,n4(t,r,s,i,e)}finally{if(n)try{It.closeSync(i)}catch{}}},n4=(t,e,r,n,i)=>{let s=new hD.WriteStreamSync(t.file,{fd:n,start:r});e.pipe(s),s4(e,i)},i4=(t,e,r)=>{e=Array.from(e);let n=new lD(t),i=(o,a,u)=>{let c=(m,y)=>{m?It.close(o,p=>u(m)):u(null,y)},l=0;if(a===0)return c(null,0);let h=0,f=Buffer.alloc(512),d=(m,y)=>{if(m)return c(m);if(h+=y,h<512&&y)return It.read(o,f,h,f.length-h,l+h,d);if(l===0&&f[0]===31&&f[1]===139)return c(new Error("cannot append to compressed archives"));if(h<512)return c(null,l);let p=new pD(f);if(!p.cksumValid)return c(null,l);let w=512*Math.ceil(p.size/512);if(l+w+512>a||(l+=w+512,l>=a))return c(null,l);t.mtimeCache&&t.mtimeCache.set(p.path,p.mtime),h=0,It.read(o,f,0,512,l,d)};It.read(o,f,0,512,l,d)},s=new Promise((o,a)=>{n.on("error",a);let u="r+",c=(l,h)=>{if(l&&l.code==="ENOENT"&&u==="r+")return u="w+",It.open(t.file,u,c);if(l)return a(l);It.fstat(h,(f,d)=>{if(f)return It.close(h,()=>a(f));i(h,d.size,(m,y)=>{if(m)return a(m);let p=new hD.WriteStream(t.file,{fd:h,start:y});n.pipe(p),p.on("error",a),p.on("close",o),mD(n,e)})})};It.open(t.file,u,c)});return r?s.then(r,r):s},s4=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?fD({file:dD.resolve(t.cwd,r.slice(1)),sync:!0,noResume:!0,onentry:n=>t.add(n)}):t.add(r)}),t.end()},mD=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)==="@")return fD({file:dD.resolve(t.cwd,r.slice(1)),noResume:!0,onentry:n=>t.add(n)}).then(n=>mD(t,e));t.add(r)}t.end()}});var _D=A((oY,gD)=>{"use strict";var o4=bs(),a4=Qm();gD.exports=(t,e,r)=>{let n=o4(t);if(!n.file)throw new TypeError("file is required");if(n.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),u4(n),a4(n,e,r)};var u4=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(r,n)=>e(r,n)&&!(t.mtimeCache.get(r)>n.mtime):(r,n)=>!(t.mtimeCache.get(r)>n.mtime)}});var ED=A((aY,vD)=>{var{promisify:bD}=require("util"),On=require("fs"),c4=t=>{if(!t)t={mode:511,fs:On};else if(typeof t=="object")t={mode:511,fs:On,...t};else if(typeof t=="number")t={mode:t,fs:On};else if(typeof t=="string")t={mode:parseInt(t,8),fs:On};else throw new TypeError("invalid options argument");return t.mkdir=t.mkdir||t.fs.mkdir||On.mkdir,t.mkdirAsync=bD(t.mkdir),t.stat=t.stat||t.fs.stat||On.stat,t.statAsync=bD(t.stat),t.statSync=t.statSync||t.fs.statSync||On.statSync,t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||On.mkdirSync,t};vD.exports=c4});var xD=A((uY,wD)=>{var l4=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:h4,parse:f4}=require("path"),d4=t=>{if(/\0/.test(t))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_ARG_VALUE"});if(t=h4(t),l4==="win32"){let e=/[*|"<>?:]/,{root:r}=f4(t);if(e.test(t.substr(r.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t};wD.exports=d4});var RD=A((cY,CD)=>{var{dirname:SD}=require("path"),AD=(t,e,r=void 0)=>r===e?Promise.resolve():t.statAsync(e).then(n=>n.isDirectory()?r:void 0,n=>n.code==="ENOENT"?AD(t,SD(e),e):void 0),DD=(t,e,r=void 0)=>{if(r!==e)try{return t.statSync(e).isDirectory()?r:void 0}catch(n){return n.code==="ENOENT"?DD(t,SD(e),e):void 0}};CD.exports={findMade:AD,findMadeSync:DD}});var r0=A((lY,TD)=>{var{dirname:kD}=require("path"),e0=(t,e,r)=>{e.recursive=!1;let n=kD(t);return n===t?e.mkdirAsync(t,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(t,e).then(()=>r||t,i=>{if(i.code==="ENOENT")return e0(n,e).then(s=>e0(t,e,s));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;return e.statAsync(t).then(s=>{if(s.isDirectory())return r;throw i},()=>{throw i})})},t0=(t,e,r)=>{let n=kD(t);if(e.recursive=!1,n===t)try{return e.mkdirSync(t,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(t,e),r||t}catch(i){if(i.code==="ENOENT")return t0(t,e,t0(n,e,r));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(t).isDirectory())throw i}catch{throw i}}};TD.exports={mkdirpManual:e0,mkdirpManualSync:t0}});var PD=A((hY,FD)=>{var{dirname:OD}=require("path"),{findMade:p4,findMadeSync:m4}=RD(),{mkdirpManual:y4,mkdirpManualSync:g4}=r0(),_4=(t,e)=>(e.recursive=!0,OD(t)===t?e.mkdirAsync(t,e):p4(e,t).then(n=>e.mkdirAsync(t,e).then(()=>n).catch(i=>{if(i.code==="ENOENT")return y4(t,e);throw i}))),b4=(t,e)=>{if(e.recursive=!0,OD(t)===t)return e.mkdirSync(t,e);let n=m4(e,t);try{return e.mkdirSync(t,e),n}catch(i){if(i.code==="ENOENT")return g4(t,e);throw i}};FD.exports={mkdirpNative:_4,mkdirpNativeSync:b4}});var ND=A((fY,BD)=>{var ID=require("fs"),v4=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,n0=v4.replace(/^v/,"").split("."),LD=+n0[0]>10||+n0[0]==10&&+n0[1]>=12,E4=LD?t=>t.mkdir===ID.mkdir:()=>!1,w4=LD?t=>t.mkdirSync===ID.mkdirSync:()=>!1;BD.exports={useNative:E4,useNativeSync:w4}});var $D=A((dY,HD)=>{var Ms=ED(),js=xD(),{mkdirpNative:MD,mkdirpNativeSync:jD}=PD(),{mkdirpManual:qD,mkdirpManualSync:UD}=r0(),{useNative:x4,useNativeSync:S4}=ND(),qs=(t,e)=>(t=js(t),e=Ms(e),x4(e)?MD(t,e):qD(t,e)),A4=(t,e)=>(t=js(t),e=Ms(e),S4(e)?jD(t,e):UD(t,e));qs.sync=A4;qs.native=(t,e)=>MD(js(t),Ms(e));qs.manual=(t,e)=>qD(js(t),Ms(e));qs.nativeSync=(t,e)=>jD(js(t),Ms(e));qs.manualSync=(t,e)=>UD(js(t),Ms(e));HD.exports=qs});var ZD=A((pY,KD)=>{"use strict";var Yt=require("fs"),di=require("path"),D4=Yt.lchown?"lchown":"chown",C4=Yt.lchownSync?"lchownSync":"chownSync",zD=Yt.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),GD=(t,e,r)=>{try{return Yt[C4](t,e,r)}catch(n){if(n.code!=="ENOENT")throw n}},R4=(t,e,r)=>{try{return Yt.chownSync(t,e,r)}catch(n){if(n.code!=="ENOENT")throw n}},k4=zD?(t,e,r,n)=>i=>{!i||i.code!=="EISDIR"?n(i):Yt.chown(t,e,r,n)}:(t,e,r,n)=>n,i0=zD?(t,e,r)=>{try{return GD(t,e,r)}catch(n){if(n.code!=="EISDIR")throw n;R4(t,e,r)}}:(t,e,r)=>GD(t,e,r),T4=process.version,VD=(t,e,r)=>Yt.readdir(t,e,r),O4=(t,e)=>Yt.readdirSync(t,e);/^v4\./.test(T4)&&(VD=(t,e,r)=>Yt.readdir(t,r));var ll=(t,e,r,n)=>{Yt[D4](t,e,r,k4(t,e,r,i=>{n(i&&i.code!=="ENOENT"?i:null)}))},WD=(t,e,r,n,i)=>{if(typeof e=="string")return Yt.lstat(di.resolve(t,e),(s,o)=>{if(s)return i(s.code!=="ENOENT"?s:null);o.name=e,WD(t,o,r,n,i)});if(e.isDirectory())s0(di.resolve(t,e.name),r,n,s=>{if(s)return i(s);let o=di.resolve(t,e.name);ll(o,r,n,i)});else{let s=di.resolve(t,e.name);ll(s,r,n,i)}},s0=(t,e,r,n)=>{VD(t,{withFileTypes:!0},(i,s)=>{if(i){if(i.code==="ENOENT")return n();if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return n(i)}if(i||!s.length)return ll(t,e,r,n);let o=s.length,a=null,u=c=>{if(!a){if(c)return n(a=c);if(--o===0)return ll(t,e,r,n)}};s.forEach(c=>WD(t,c,e,r,u))})},F4=(t,e,r,n)=>{if(typeof e=="string")try{let i=Yt.lstatSync(di.resolve(t,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&YD(di.resolve(t,e.name),r,n),i0(di.resolve(t,e.name),r,n)},YD=(t,e,r)=>{let n;try{n=O4(t,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return i0(t,e,r);throw i}return n&&n.length&&n.forEach(i=>F4(t,i,e,r)),i0(t,e,r)};KD.exports=s0;s0.sync=YD});var eC=A((mY,o0)=>{"use strict";var JD=$D(),Kt=require("fs"),hl=require("path"),XD=ZD(),ar=Ss(),fl=class extends Error{constructor(e,r){super("Cannot extract through symbolic link"),this.path=r,this.symlink=e}get name(){return"SylinkError"}},dl=class extends Error{constructor(e,r){super(r+": Cannot cd into '"+e+"'"),this.path=e,this.code=r}get name(){return"CwdError"}},pl=(t,e)=>t.get(ar(e)),ua=(t,e,r)=>t.set(ar(e),r),P4=(t,e)=>{Kt.stat(t,(r,n)=>{(r||!n.isDirectory())&&(r=new dl(t,r&&r.code||"ENOTDIR")),e(r)})};o0.exports=(t,e,r)=>{t=ar(t);let n=e.umask,i=e.mode|448,s=(i&n)!==0,o=e.uid,a=e.gid,u=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,l=e.unlink,h=e.cache,f=ar(e.cwd),d=(p,w)=>{p?r(p):(ua(h,t,!0),w&&u?XD(w,o,a,O=>d(O)):s?Kt.chmod(t,i,r):r())};if(h&&pl(h,t)===!0)return d();if(t===f)return P4(t,d);if(c)return JD(t,{mode:i}).then(p=>d(null,p),d);let y=ar(hl.relative(f,t)).split("/");ml(f,y,i,h,l,f,null,d)};var ml=(t,e,r,n,i,s,o,a)=>{if(!e.length)return a(null,o);let u=e.shift(),c=ar(hl.resolve(t+"/"+u));if(pl(n,c))return ml(c,e,r,n,i,s,o,a);Kt.mkdir(c,r,QD(c,e,r,n,i,s,o,a))},QD=(t,e,r,n,i,s,o,a)=>u=>{u?Kt.lstat(t,(c,l)=>{if(c)c.path=c.path&&ar(c.path),a(c);else if(l.isDirectory())ml(t,e,r,n,i,s,o,a);else if(i)Kt.unlink(t,h=>{if(h)return a(h);Kt.mkdir(t,r,QD(t,e,r,n,i,s,o,a))});else{if(l.isSymbolicLink())return a(new fl(t,t+"/"+e.join("/")));a(u)}}):(o=o||t,ml(t,e,r,n,i,s,o,a))},I4=t=>{let e=!1,r="ENOTDIR";try{e=Kt.statSync(t).isDirectory()}catch(n){r=n.code}finally{if(!e)throw new dl(t,r)}};o0.exports.sync=(t,e)=>{t=ar(t);let r=e.umask,n=e.mode|448,i=(n&r)!==0,s=e.uid,o=e.gid,a=typeof s=="number"&&typeof o=="number"&&(s!==e.processUid||o!==e.processGid),u=e.preserve,c=e.unlink,l=e.cache,h=ar(e.cwd),f=p=>{ua(l,t,!0),p&&a&&XD.sync(p,s,o),i&&Kt.chmodSync(t,n)};if(l&&pl(l,t)===!0)return f();if(t===h)return I4(h),f();if(u)return f(JD.sync(t,n));let m=ar(hl.relative(h,t)).split("/"),y=null;for(let p=m.shift(),w=h;p&&(w+="/"+p);p=m.shift())if(w=ar(hl.resolve(w)),!pl(l,w))try{Kt.mkdirSync(w,n),y=y||w,ua(l,w,!0)}catch{let P=Kt.lstatSync(w);if(P.isDirectory()){ua(l,w,!0);continue}else if(c){Kt.unlinkSync(w),Kt.mkdirSync(w,n),y=y||w,ua(l,w,!0);continue}else if(P.isSymbolicLink())return new fl(w,w+"/"+m.join("/"))}return f(y)}});var u0=A((yY,tC)=>{var a0=Object.create(null),{hasOwnProperty:L4}=Object.prototype;tC.exports=t=>(L4.call(a0,t)||(a0[t]=t.normalize("NFKD")),a0[t])});var sC=A((gY,iC)=>{var rC=require("assert"),B4=u0(),N4=Cs(),{join:nC}=require("path"),M4=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,j4=M4==="win32";iC.exports=()=>{let t=new Map,e=new Map,r=c=>c.split("/").slice(0,-1).reduce((h,f)=>(h.length&&(f=nC(h[h.length-1],f)),h.push(f||"/"),h),[]),n=new Set,i=c=>{let l=e.get(c);if(!l)throw new Error("function does not have any path reservations");return{paths:l.paths.map(h=>t.get(h)),dirs:[...l.dirs].map(h=>t.get(h))}},s=c=>{let{paths:l,dirs:h}=i(c);return l.every(f=>f[0]===c)&&h.every(f=>f[0]instanceof Set&&f[0].has(c))},o=c=>n.has(c)||!s(c)?!1:(n.add(c),c(()=>a(c)),!0),a=c=>{if(!n.has(c))return!1;let{paths:l,dirs:h}=e.get(c),f=new Set;return l.forEach(d=>{let m=t.get(d);rC.equal(m[0],c),m.length===1?t.delete(d):(m.shift(),typeof m[0]=="function"?f.add(m[0]):m[0].forEach(y=>f.add(y)))}),h.forEach(d=>{let m=t.get(d);rC(m[0]instanceof Set),m[0].size===1&&m.length===1?t.delete(d):m[0].size===1?(m.shift(),f.add(m[0])):m[0].delete(c)}),n.delete(c),f.forEach(d=>o(d)),!0};return{check:s,reserve:(c,l)=>{c=j4?["win32 parallelization disabled"]:c.map(f=>B4(N4(nC(f))).toLowerCase());let h=new Set(c.map(f=>r(f)).reduce((f,d)=>f.concat(d)));return e.set(l,{dirs:h,paths:c}),c.forEach(f=>{let d=t.get(f);d?d.push(l):t.set(f,[l])}),h.forEach(f=>{let d=t.get(f);d?d[d.length-1]instanceof Set?d[d.length-1].add(l):d.push(new Set([l])):t.set(f,[new Set([l])])}),o(l)}}}});var uC=A((_Y,aC)=>{var q4=process.env.__FAKE_PLATFORM__||process.platform,U4=q4==="win32",H4=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:$4,O_TRUNC:G4,O_WRONLY:z4,UV_FS_O_FILEMAP:oC=0}=H4.constants,V4=U4&&!!oC,W4=512*1024,Y4=oC|G4|$4|z4;aC.exports=V4?t=>t<W4?Y4:"w":()=>"w"});var g0=A((bY,wC)=>{"use strict";var K4=require("assert"),Z4=al(),Re=require("fs"),J4=Bs(),Xr=require("path"),bC=eC(),cC=ym(),X4=sC(),Q4=gm(),Lt=Ss(),ej=Cs(),tj=u0(),lC=Symbol("onEntry"),h0=Symbol("checkFs"),hC=Symbol("checkFs2"),_l=Symbol("pruneCache"),f0=Symbol("isReusable"),Zt=Symbol("makeFs"),d0=Symbol("file"),p0=Symbol("directory"),bl=Symbol("link"),fC=Symbol("symlink"),dC=Symbol("hardlink"),pC=Symbol("unsupported"),mC=Symbol("checkPath"),Fn=Symbol("mkdir"),ft=Symbol("onError"),yl=Symbol("pending"),yC=Symbol("pend"),Us=Symbol("unpend"),c0=Symbol("ended"),l0=Symbol("maybeClose"),m0=Symbol("skip"),ca=Symbol("doChown"),la=Symbol("uid"),ha=Symbol("gid"),fa=Symbol("checkedCwd"),vC=require("crypto"),EC=uC(),rj=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,da=rj==="win32",nj=(t,e)=>{if(!da)return Re.unlink(t,e);let r=t+".DELETE."+vC.randomBytes(16).toString("hex");Re.rename(t,r,n=>{if(n)return e(n);Re.unlink(r,e)})},ij=t=>{if(!da)return Re.unlinkSync(t);let e=t+".DELETE."+vC.randomBytes(16).toString("hex");Re.renameSync(t,e),Re.unlinkSync(e)},gC=(t,e,r)=>t===t>>>0?t:e===e>>>0?e:r,_C=t=>tj(ej(Lt(t))).toLowerCase(),sj=(t,e)=>{e=_C(e);for(let r of t.keys()){let n=_C(r);(n===e||n.indexOf(e+"/")===0)&&t.delete(r)}},oj=t=>{for(let e of t.keys())t.delete(e)},pa=class extends Z4{constructor(e){if(e||(e={}),e.ondone=r=>{this[c0]=!0,this[l0]()},super(e),this[fa]=!1,this.reservations=X4(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[yl]=0,this[c0]=!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||da,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=Lt(Xr.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",r=>this[lC](r))}warn(e,r,n={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(n.recoverable=!1),super.warn(e,r,n)}[l0](){this[c0]&&this[yl]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[mC](e){if(this.strip){let r=Lt(e.path).split("/");if(r.length<this.strip)return!1;if(e.path=r.slice(this.strip).join("/"),e.type==="Link"){let n=Lt(e.linkpath).split("/");if(n.length>=this.strip)e.linkpath=n.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let r=Lt(e.path),n=r.split("/");if(n.includes("..")||da&&/^[a-z]:\.\.$/i.test(n[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:r}),!1;let[i,s]=Q4(r);i&&(e.path=s,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:r}))}if(Xr.isAbsolute(e.path)?e.absolute=Lt(Xr.resolve(e.path)):e.absolute=Lt(Xr.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:Lt(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:r}=Xr.win32.parse(e.absolute);e.absolute=r+cC.encode(e.absolute.slice(r.length));let{root:n}=Xr.win32.parse(e.path);e.path=n+cC.encode(e.path.slice(n.length))}return!0}[lC](e){if(!this[mC](e))return e.resume();switch(K4.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[h0](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[pC](e)}}[ft](e,r){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:r}),this[Us](),r.resume())}[Fn](e,r,n){bC(Lt(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:r,noChmod:this.noChmod},n)}[ca](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}[la](e){return gC(this.uid,e.uid,this.processUid)}[ha](e){return gC(this.gid,e.gid,this.processGid)}[d0](e,r){let n=e.mode&4095||this.fmode,i=new J4.WriteStream(e.absolute,{flags:EC(e.size),mode:n,autoClose:!1});i.on("error",u=>{i.fd&&Re.close(i.fd,()=>{}),i.write=()=>!0,this[ft](u,e),r()});let s=1,o=u=>{if(u){i.fd&&Re.close(i.fd,()=>{}),this[ft](u,e),r();return}--s===0&&Re.close(i.fd,c=>{c?this[ft](c,e):this[Us](),r()})};i.on("finish",u=>{let c=e.absolute,l=i.fd;if(e.mtime&&!this.noMtime){s++;let h=e.atime||new Date,f=e.mtime;Re.futimes(l,h,f,d=>d?Re.utimes(c,h,f,m=>o(m&&d)):o())}if(this[ca](e)){s++;let h=this[la](e),f=this[ha](e);Re.fchown(l,h,f,d=>d?Re.chown(c,h,f,m=>o(m&&d)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",u=>{this[ft](u,e),r()}),e.pipe(a)),a.pipe(i)}[p0](e,r){let n=e.mode&4095||this.dmode;this[Fn](e.absolute,n,i=>{if(i){this[ft](i,e),r();return}let s=1,o=a=>{--s===0&&(r(),this[Us](),e.resume())};e.mtime&&!this.noMtime&&(s++,Re.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[ca](e)&&(s++,Re.chown(e.absolute,this[la](e),this[ha](e),o)),o()})}[pC](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[fC](e,r){this[bl](e,e.linkpath,"symlink",r)}[dC](e,r){let n=Lt(Xr.resolve(this.cwd,e.linkpath));this[bl](e,n,"link",r)}[yC](){this[yl]++}[Us](){this[yl]--,this[l0]()}[m0](e){this[Us](),e.resume()}[f0](e,r){return e.type==="File"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!da}[h0](e){this[yC]();let r=[e.path];e.linkpath&&r.push(e.linkpath),this.reservations.reserve(r,n=>this[hC](e,n))}[_l](e){e.type==="SymbolicLink"?oj(this.dirCache):e.type!=="Directory"&&sj(this.dirCache,e.absolute)}[hC](e,r){this[_l](e);let n=a=>{this[_l](e),r(a)},i=()=>{this[Fn](this.cwd,this.dmode,a=>{if(a){this[ft](a,e),n();return}this[fa]=!0,s()})},s=()=>{if(e.absolute!==this.cwd){let a=Lt(Xr.dirname(e.absolute));if(a!==this.cwd)return this[Fn](a,this.dmode,u=>{if(u){this[ft](u,e),n();return}o()})}o()},o=()=>{Re.lstat(e.absolute,(a,u)=>{if(u&&(this.keep||this.newer&&u.mtime>e.mtime)){this[m0](e),n();return}if(a||this[f0](e,u))return this[Zt](null,e,n);if(u.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(u.mode&4095)!==e.mode,l=h=>this[Zt](h,e,n);return c?Re.chmod(e.absolute,e.mode,l):l()}if(e.absolute!==this.cwd)return Re.rmdir(e.absolute,c=>this[Zt](c,e,n))}if(e.absolute===this.cwd)return this[Zt](null,e,n);nj(e.absolute,c=>this[Zt](c,e,n))})};this[fa]?s():i()}[Zt](e,r,n){if(e){this[ft](e,r),n();return}switch(r.type){case"File":case"OldFile":case"ContiguousFile":return this[d0](r,n);case"Link":return this[dC](r,n);case"SymbolicLink":return this[fC](r,n);case"Directory":case"GNUDumpDir":return this[p0](r,n)}}[bl](e,r,n,i){Re[n](r,e.absolute,s=>{s?this[ft](s,e):(this[Us](),e.resume()),i()})}},gl=t=>{try{return[null,t()]}catch(e){return[e,null]}},y0=class extends pa{[Zt](e,r){return super[Zt](e,r,()=>{})}[h0](e){if(this[_l](e),!this[fa]){let s=this[Fn](this.cwd,this.dmode);if(s)return this[ft](s,e);this[fa]=!0}if(e.absolute!==this.cwd){let s=Lt(Xr.dirname(e.absolute));if(s!==this.cwd){let o=this[Fn](s,this.dmode);if(o)return this[ft](o,e)}}let[r,n]=gl(()=>Re.lstatSync(e.absolute));if(n&&(this.keep||this.newer&&n.mtime>e.mtime))return this[m0](e);if(r||this[f0](e,n))return this[Zt](null,e);if(n.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(n.mode&4095)!==e.mode,[a]=o?gl(()=>{Re.chmodSync(e.absolute,e.mode)}):[];return this[Zt](a,e)}let[s]=gl(()=>Re.rmdirSync(e.absolute));this[Zt](s,e)}let[i]=e.absolute===this.cwd?[]:gl(()=>ij(e.absolute));this[Zt](i,e)}[d0](e,r){let n=e.mode&4095||this.fmode,i=a=>{let u;try{Re.closeSync(s)}catch(c){u=c}(a||u)&&this[ft](a||u,e),r()},s;try{s=Re.openSync(e.absolute,EC(e.size),n)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[ft](a,e)),e.pipe(o)),o.on("data",a=>{try{Re.writeSync(s,a,0,a.length)}catch(u){i(u)}}),o.on("end",a=>{let u=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,l=e.mtime;try{Re.futimesSync(s,c,l)}catch(h){try{Re.utimesSync(e.absolute,c,l)}catch{u=h}}}if(this[ca](e)){let c=this[la](e),l=this[ha](e);try{Re.fchownSync(s,c,l)}catch(h){try{Re.chownSync(e.absolute,c,l)}catch{u=u||h}}}i(u)})}[p0](e,r){let n=e.mode&4095||this.dmode,i=this[Fn](e.absolute,n);if(i){this[ft](i,e),r();return}if(e.mtime&&!this.noMtime)try{Re.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[ca](e))try{Re.chownSync(e.absolute,this[la](e),this[ha](e))}catch{}r(),e.resume()}[Fn](e,r){try{return bC.sync(Lt(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:r})}catch(n){return n}}[bl](e,r,n,i){try{Re[n+"Sync"](r,e.absolute),i(),e.resume()}catch(s){return this[ft](s,e)}}};pa.Sync=y0;wC.exports=pa});var CC=A((vY,DC)=>{"use strict";var aj=bs(),vl=g0(),SC=require("fs"),AC=Bs(),xC=require("path"),_0=Cs();DC.exports=(t,e,r)=>{typeof t=="function"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(r=e,e=null),e?e=Array.from(e):e=[];let n=aj(t);if(n.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!n.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return e.length&&uj(n,e),n.file&&n.sync?cj(n):n.file?lj(n,r):n.sync?hj(n):fj(n)};var uj=(t,e)=>{let r=new Map(e.map(s=>[_0(s),!0])),n=t.filter,i=(s,o)=>{let a=o||xC.parse(s).root||".",u=s===a?!1:r.has(s)?r.get(s):i(xC.dirname(s),a);return r.set(s,u),u};t.filter=n?(s,o)=>n(s,o)&&i(_0(s)):s=>i(_0(s))},cj=t=>{let e=new vl.Sync(t),r=t.file,n=SC.statSync(r),i=t.maxReadSize||16*1024*1024;new AC.ReadStreamSync(r,{readSize:i,size:n.size}).pipe(e)},lj=(t,e)=>{let r=new vl(t),n=t.maxReadSize||16*1024*1024,i=t.file,s=new Promise((o,a)=>{r.on("error",a),r.on("close",o),SC.stat(i,(u,c)=>{if(u)a(u);else{let l=new AC.ReadStream(i,{readSize:n,size:c.size});l.on("error",a),l.pipe(r)}})});return e?s.then(e,e):s},hj=t=>new vl.Sync(t),fj=t=>new vl(t)});var RC=A(We=>{"use strict";We.c=We.create=cD();We.r=We.replace=Qm();We.t=We.list=ul();We.u=We.update=_D();We.x=We.extract=CC();We.Pack=Wc();We.Unpack=g0();We.Parse=al();We.ReadEntry=Tc();We.WriteEntry=Cm();We.Header=Ds();We.Pax=Fc();We.types=cm()});var en=A((Qr,El)=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});var kC=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function dj(t){return kC.includes(t)}var pj=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...kC];function mj(t){return pj.includes(t)}var yj=["null","undefined","string","number","bigint","boolean","symbol"];function gj(t){return yj.includes(t)}function Hs(t){return e=>typeof e===t}var{toString:TC}=Object.prototype,ma=t=>{let e=TC.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&T.domElement(t))return"HTMLElement";if(mj(e))return e},Fe=t=>e=>ma(e)===t;function T(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(T.observable(t))return"Observable";if(T.array(t))return"Array";if(T.buffer(t))return"Buffer";let e=ma(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}T.undefined=Hs("undefined");T.string=Hs("string");var _j=Hs("number");T.number=t=>_j(t)&&!T.nan(t);T.bigint=Hs("bigint");T.function_=Hs("function");T.null_=t=>t===null;T.class_=t=>T.function_(t)&&t.toString().startsWith("class ");T.boolean=t=>t===!0||t===!1;T.symbol=Hs("symbol");T.numericString=t=>T.string(t)&&!T.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));T.array=(t,e)=>Array.isArray(t)?T.function_(e)?t.every(e):!0:!1;T.buffer=t=>{var e,r,n,i;return(i=(n=(r=(e=t)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.isBuffer)===null||n===void 0?void 0:n.call(r,t))!==null&&i!==void 0?i:!1};T.blob=t=>Fe("Blob")(t);T.nullOrUndefined=t=>T.null_(t)||T.undefined(t);T.object=t=>!T.null_(t)&&(typeof t=="object"||T.function_(t));T.iterable=t=>{var e;return T.function_((e=t)===null||e===void 0?void 0:e[Symbol.iterator])};T.asyncIterable=t=>{var e;return T.function_((e=t)===null||e===void 0?void 0:e[Symbol.asyncIterator])};T.generator=t=>{var e,r;return T.iterable(t)&&T.function_((e=t)===null||e===void 0?void 0:e.next)&&T.function_((r=t)===null||r===void 0?void 0:r.throw)};T.asyncGenerator=t=>T.asyncIterable(t)&&T.function_(t.next)&&T.function_(t.throw);T.nativePromise=t=>Fe("Promise")(t);var bj=t=>{var e,r;return T.function_((e=t)===null||e===void 0?void 0:e.then)&&T.function_((r=t)===null||r===void 0?void 0:r.catch)};T.promise=t=>T.nativePromise(t)||bj(t);T.generatorFunction=Fe("GeneratorFunction");T.asyncGeneratorFunction=t=>ma(t)==="AsyncGeneratorFunction";T.asyncFunction=t=>ma(t)==="AsyncFunction";T.boundFunction=t=>T.function_(t)&&!t.hasOwnProperty("prototype");T.regExp=Fe("RegExp");T.date=Fe("Date");T.error=Fe("Error");T.map=t=>Fe("Map")(t);T.set=t=>Fe("Set")(t);T.weakMap=t=>Fe("WeakMap")(t);T.weakSet=t=>Fe("WeakSet")(t);T.int8Array=Fe("Int8Array");T.uint8Array=Fe("Uint8Array");T.uint8ClampedArray=Fe("Uint8ClampedArray");T.int16Array=Fe("Int16Array");T.uint16Array=Fe("Uint16Array");T.int32Array=Fe("Int32Array");T.uint32Array=Fe("Uint32Array");T.float32Array=Fe("Float32Array");T.float64Array=Fe("Float64Array");T.bigInt64Array=Fe("BigInt64Array");T.bigUint64Array=Fe("BigUint64Array");T.arrayBuffer=Fe("ArrayBuffer");T.sharedArrayBuffer=Fe("SharedArrayBuffer");T.dataView=Fe("DataView");T.enumCase=(t,e)=>Object.values(e).includes(t);T.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;T.urlInstance=t=>Fe("URL")(t);T.urlString=t=>{if(!T.string(t))return!1;try{return new URL(t),!0}catch{return!1}};T.truthy=t=>!!t;T.falsy=t=>!t;T.nan=t=>Number.isNaN(t);T.primitive=t=>T.null_(t)||gj(typeof t);T.integer=t=>Number.isInteger(t);T.safeInteger=t=>Number.isSafeInteger(t);T.plainObject=t=>{if(TC.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};T.typedArray=t=>dj(ma(t));var vj=t=>T.safeInteger(t)&&t>=0;T.arrayLike=t=>!T.nullOrUndefined(t)&&!T.function_(t)&&vj(t.length);T.inRange=(t,e)=>{if(T.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(T.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var Ej=1,wj=["innerHTML","ownerDocument","style","attributes","nodeValue"];T.domElement=t=>T.object(t)&&t.nodeType===Ej&&T.string(t.nodeName)&&!T.plainObject(t)&&wj.every(e=>e in t);T.observable=t=>{var e,r,n,i;return t?t===((r=(e=t)[Symbol.observable])===null||r===void 0?void 0:r.call(e))||t===((i=(n=t)["@@observable"])===null||i===void 0?void 0:i.call(n)):!1};T.nodeStream=t=>T.object(t)&&T.function_(t.pipe)&&!T.observable(t);T.infinite=t=>t===1/0||t===-1/0;var OC=t=>e=>T.integer(e)&&Math.abs(e%2)===t;T.evenInteger=OC(0);T.oddInteger=OC(1);T.emptyArray=t=>T.array(t)&&t.length===0;T.nonEmptyArray=t=>T.array(t)&&t.length>0;T.emptyString=t=>T.string(t)&&t.length===0;var xj=t=>T.string(t)&&!/\S/.test(t);T.emptyStringOrWhitespace=t=>T.emptyString(t)||xj(t);T.nonEmptyString=t=>T.string(t)&&t.length>0;T.nonEmptyStringAndNotWhitespace=t=>T.string(t)&&!T.emptyStringOrWhitespace(t);T.emptyObject=t=>T.object(t)&&!T.map(t)&&!T.set(t)&&Object.keys(t).length===0;T.nonEmptyObject=t=>T.object(t)&&!T.map(t)&&!T.set(t)&&Object.keys(t).length>0;T.emptySet=t=>T.set(t)&&t.size===0;T.nonEmptySet=t=>T.set(t)&&t.size>0;T.emptyMap=t=>T.map(t)&&t.size===0;T.nonEmptyMap=t=>T.map(t)&&t.size>0;T.propertyKey=t=>T.any([T.string,T.number,T.symbol],t);T.formData=t=>Fe("FormData")(t);T.urlSearchParams=t=>Fe("URLSearchParams")(t);var FC=(t,e,r)=>{if(!T.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError("Invalid number of values");return t.call(r,e)};T.any=(t,...e)=>(T.array(t)?t:[t]).some(n=>FC(Array.prototype.some,n,e));T.all=(t,...e)=>FC(Array.prototype.every,t,e);var se=(t,e,r,n={})=>{if(!t){let{multipleValues:i}=n,s=i?`received values of types ${[...new Set(r.map(o=>`\`${T(o)}\``))].join(", ")}`:`received value of type \`${T(r)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${s}.`)}};Qr.assert={undefined:t=>se(T.undefined(t),"undefined",t),string:t=>se(T.string(t),"string",t),number:t=>se(T.number(t),"number",t),bigint:t=>se(T.bigint(t),"bigint",t),function_:t=>se(T.function_(t),"Function",t),null_:t=>se(T.null_(t),"null",t),class_:t=>se(T.class_(t),"Class",t),boolean:t=>se(T.boolean(t),"boolean",t),symbol:t=>se(T.symbol(t),"symbol",t),numericString:t=>se(T.numericString(t),"string with a number",t),array:(t,e)=>{se(T.array(t),"Array",t),e&&t.forEach(e)},buffer:t=>se(T.buffer(t),"Buffer",t),blob:t=>se(T.blob(t),"Blob",t),nullOrUndefined:t=>se(T.nullOrUndefined(t),"null or undefined",t),object:t=>se(T.object(t),"Object",t),iterable:t=>se(T.iterable(t),"Iterable",t),asyncIterable:t=>se(T.asyncIterable(t),"AsyncIterable",t),generator:t=>se(T.generator(t),"Generator",t),asyncGenerator:t=>se(T.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>se(T.nativePromise(t),"native Promise",t),promise:t=>se(T.promise(t),"Promise",t),generatorFunction:t=>se(T.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>se(T.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>se(T.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>se(T.boundFunction(t),"Function",t),regExp:t=>se(T.regExp(t),"RegExp",t),date:t=>se(T.date(t),"Date",t),error:t=>se(T.error(t),"Error",t),map:t=>se(T.map(t),"Map",t),set:t=>se(T.set(t),"Set",t),weakMap:t=>se(T.weakMap(t),"WeakMap",t),weakSet:t=>se(T.weakSet(t),"WeakSet",t),int8Array:t=>se(T.int8Array(t),"Int8Array",t),uint8Array:t=>se(T.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>se(T.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>se(T.int16Array(t),"Int16Array",t),uint16Array:t=>se(T.uint16Array(t),"Uint16Array",t),int32Array:t=>se(T.int32Array(t),"Int32Array",t),uint32Array:t=>se(T.uint32Array(t),"Uint32Array",t),float32Array:t=>se(T.float32Array(t),"Float32Array",t),float64Array:t=>se(T.float64Array(t),"Float64Array",t),bigInt64Array:t=>se(T.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>se(T.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>se(T.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>se(T.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>se(T.dataView(t),"DataView",t),enumCase:(t,e)=>se(T.enumCase(t,e),"EnumCase",t),urlInstance:t=>se(T.urlInstance(t),"URL",t),urlString:t=>se(T.urlString(t),"string with a URL",t),truthy:t=>se(T.truthy(t),"truthy",t),falsy:t=>se(T.falsy(t),"falsy",t),nan:t=>se(T.nan(t),"NaN",t),primitive:t=>se(T.primitive(t),"primitive",t),integer:t=>se(T.integer(t),"integer",t),safeInteger:t=>se(T.safeInteger(t),"integer",t),plainObject:t=>se(T.plainObject(t),"plain object",t),typedArray:t=>se(T.typedArray(t),"TypedArray",t),arrayLike:t=>se(T.arrayLike(t),"array-like",t),domElement:t=>se(T.domElement(t),"HTMLElement",t),observable:t=>se(T.observable(t),"Observable",t),nodeStream:t=>se(T.nodeStream(t),"Node.js Stream",t),infinite:t=>se(T.infinite(t),"infinite number",t),emptyArray:t=>se(T.emptyArray(t),"empty array",t),nonEmptyArray:t=>se(T.nonEmptyArray(t),"non-empty array",t),emptyString:t=>se(T.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>se(T.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>se(T.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>se(T.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>se(T.emptyObject(t),"empty object",t),nonEmptyObject:t=>se(T.nonEmptyObject(t),"non-empty object",t),emptySet:t=>se(T.emptySet(t),"empty set",t),nonEmptySet:t=>se(T.nonEmptySet(t),"non-empty set",t),emptyMap:t=>se(T.emptyMap(t),"empty map",t),nonEmptyMap:t=>se(T.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>se(T.propertyKey(t),"PropertyKey",t),formData:t=>se(T.formData(t),"FormData",t),urlSearchParams:t=>se(T.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>se(T.evenInteger(t),"even integer",t),oddInteger:t=>se(T.oddInteger(t),"odd integer",t),directInstanceOf:(t,e)=>se(T.directInstanceOf(t,e),"T",t),inRange:(t,e)=>se(T.inRange(t,e),"in range",t),any:(t,...e)=>se(T.any(t,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(t,...e)=>se(T.all(t,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(T,{class:{value:T.class_},function:{value:T.function_},null:{value:T.null_}});Object.defineProperties(Qr.assert,{class:{value:Qr.assert.class_},function:{value:Qr.assert.function_},null:{value:Qr.assert.null_}});Qr.default=T;El.exports=T;El.exports.default=T;El.exports.assert=Qr.assert});var PC=A((wY,b0)=>{"use strict";var wl=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},$s=class{static fn(e){return(...r)=>new $s((n,i,s)=>{r.push(s),e(...r).then(n,i)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,n)=>{this._reject=n;let i=a=>{(!this._isCanceled||!o.shouldReject)&&(this._isPending=!1,r(a))},s=a=>{this._isPending=!1,n(a)},o=a=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(a)};return Object.defineProperties(o,{shouldReject:{get:()=>this._rejectOnCancel,set:a=>{this._rejectOnCancel=a}}}),e(i,s,o)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r);return}this._rejectOnCancel&&this._reject(new wl(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf($s.prototype,Promise.prototype);b0.exports=$s;b0.exports.CancelError=wl});var IC=A((E0,w0)=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});function Sj(t){return t.encrypted}var v0=(t,e)=>{let r;typeof e=="function"?r={connect:e}:r=e;let n=typeof r.connect=="function",i=typeof r.secureConnect=="function",s=typeof r.close=="function",o=()=>{n&&r.connect(),Sj(t)&&i&&(t.authorized?r.secureConnect():t.authorizationError||t.once("secureConnect",r.secureConnect)),s&&t.once("close",r.close)};t.writable&&!t.connecting?o():t.connecting?t.once("connect",o):t.destroyed&&s&&r.close(t._hadError)};E0.default=v0;w0.exports=v0;w0.exports.default=v0});var LC=A((S0,A0)=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});var Aj=IC(),Dj=require("util"),Cj=Number(process.versions.node.split(".")[0]),x0=t=>{if(t.timings)return t.timings;let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;let r=a=>{let u=a.emit.bind(a);a.emit=(c,...l)=>(c==="error"&&(e.error=Date.now(),e.phases.total=e.error-e.start,a.emit=u),u(c,...l))};r(t);let n=()=>{e.abort=Date.now(),(!e.response||Cj>=13)&&(e.phases.total=Date.now()-e.start)};t.prependOnceListener("abort",n);let i=a=>{if(e.socket=Date.now(),e.phases.wait=e.socket-e.start,Dj.types.isProxy(a))return;let u=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};a.prependOnceListener("lookup",u),Aj.default(a,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(a.removeListener("lookup",u),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?i(t.socket):t.prependOnceListener("socket",i);let s=()=>{var a;e.upload=Date.now(),e.phases.request=e.upload-((a=e.secureConnect)!==null&&a!==void 0?a:e.connect)};return(()=>typeof t.writableFinished=="boolean"?t.writableFinished:t.finished&&t.outputSize===0&&(!t.socket||t.socket.writableLength===0))()?s():t.prependOnceListener("finish",s),t.prependOnceListener("response",a=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,a.timings=e,r(a),a.prependOnceListener("end",()=>{e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start}),a.prependOnceListener("aborted",n)}),e};S0.default=x0;A0.exports=x0;A0.exports.default=x0});var HC=A((xY,R0)=>{"use strict";var{V4MAPPED:Rj,ADDRCONFIG:kj,ALL:UC,promises:{Resolver:BC},lookup:Tj}=require("dns"),{promisify:D0}=require("util"),Oj=require("os"),Gs=Symbol("cacheableLookupCreateConnection"),C0=Symbol("cacheableLookupInstance"),NC=Symbol("expires"),Fj=typeof UC=="number",MC=t=>{if(!(t&&typeof t.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},Pj=t=>{for(let e of t)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},jC=()=>{let t=!1,e=!1;for(let r of Object.values(Oj.networkInterfaces()))for(let n of r)if(!n.internal&&(n.family==="IPv6"?e=!0:t=!0,t&&e))return{has4:t,has6:e};return{has4:t,has6:e}},Ij=t=>Symbol.iterator in t,qC={ttl:!0},Lj={all:!0},xl=class{constructor({cache:e=new Map,maxTtl:r=1/0,fallbackDuration:n=3600,errorTtl:i=.15,resolver:s=new BC,lookup:o=Tj}={}){if(this.maxTtl=r,this.errorTtl=i,this._cache=e,this._resolver=s,this._dnsLookup=D0(o),this._resolver instanceof BC?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=D0(this._resolver.resolve4.bind(this._resolver)),this._resolve6=D0(this._resolver.resolve6.bind(this._resolver))),this._iface=jC(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,n<1)this._fallback=!1;else{this._fallback=!0;let a=setInterval(()=>{this._hostnamesToFallback.clear()},n*1e3);a.unref&&a.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,n){if(typeof r=="function"?(n=r,r={}):typeof r=="number"&&(r={family:r}),!n)throw new Error("Callback must be a function.");this.lookupAsync(e,r).then(i=>{r.all?n(null,i):n(null,i.address,i.family,i.expires,i.ttl)},n)}async lookupAsync(e,r={}){typeof r=="number"&&(r={family:r});let n=await this.query(e);if(r.family===6){let i=n.filter(s=>s.family===6);r.hints&Rj&&(Fj&&r.hints&UC||i.length===0)?Pj(n):n=i}else r.family===4&&(n=n.filter(i=>i.family===4));if(r.hints&kj){let{_iface:i}=this;n=n.filter(s=>s.family===6?i.has6:i.has4)}if(n.length===0){let i=new Error(`cacheableLookup ENOTFOUND ${e}`);throw i.code="ENOTFOUND",i.hostname=e,i}return r.all?n:n[0]}async query(e){let r=await this._cache.get(e);if(!r){let n=this._pending[e];if(n)r=await n;else{let i=this.queryAndCache(e);this._pending[e]=i;try{r=await i}finally{delete this._pending[e]}}}return r=r.map(n=>({...n})),r}async _resolve(e){let r=async c=>{try{return await c}catch(l){if(l.code==="ENODATA"||l.code==="ENOTFOUND")return[];throw l}},[n,i]=await Promise.all([this._resolve4(e,qC),this._resolve6(e,qC)].map(c=>r(c))),s=0,o=0,a=0,u=Date.now();for(let c of n)c.family=4,c.expires=u+c.ttl*1e3,s=Math.max(s,c.ttl);for(let c of i)c.family=6,c.expires=u+c.ttl*1e3,o=Math.max(o,c.ttl);return n.length>0?i.length>0?a=Math.min(s,o):a=s:a=o,{entries:[...n,...i],cacheTtl:a}}async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,r,n){if(this.maxTtl>0&&n>0){n=Math.min(n,this.maxTtl)*1e3,r[NC]=Date.now()+n;try{await this._cache.set(e,r,n)}catch(i){this.lookupAsync=async()=>{let s=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw s.cause=i,s}}Ij(this._cache)&&this._tick(n)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,Lj);let r=await this._resolve(e);r.entries.length===0&&this._fallback&&(r=await this._lookup(e),r.entries.length!==0&&this._hostnamesToFallback.add(e));let n=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,n),r.entries}_tick(e){let r=this._nextRemovalTime;(!r||e<r)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=e,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let n=1/0,i=Date.now();for(let[s,o]of this._cache){let a=o[NC];i>=a?this._cache.delete(s):a<n&&(n=a)}n!==1/0&&this._tick(n-i)},e),this._removalTimeout.unref&&this._removalTimeout.unref())}install(e){if(MC(e),Gs in e)throw new Error("CacheableLookup has been already installed");e[Gs]=e.createConnection,e[C0]=this,e.createConnection=(r,n)=>("lookup"in r||(r.lookup=this.lookup),e[Gs](r,n))}uninstall(e){if(MC(e),e[Gs]){if(e[C0]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[Gs],delete e[Gs],delete e[C0]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=jC(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};R0.exports=xl;R0.exports.default=xl});var zC=A((SY,GC)=>{"use strict";var Bj="text/plain",Nj="us-ascii",$C=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),Mj=(t,{stripHash:e})=>{let r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:i,hash:s}=r.groups,o=n.split(";");s=e?"":s;let a=!1;o[o.length-1]==="base64"&&(o.pop(),a=!0);let u=(o.shift()||"").toLowerCase(),l=[...o.map(h=>{let[f,d=""]=h.split("=").map(m=>m.trim());return f==="charset"&&(d=d.toLowerCase(),d===Nj)?"":`${f}${d?`=${d}`:""}`}).filter(Boolean)];return a&&l.push("base64"),(l.length!==0||u&&u!==Bj)&&l.unshift(u),`data:${l.join(";")},${a?i.trim():i}${s?`#${s}`:""}`},jj=(t,e)=>{if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return Mj(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let i=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&i.protocol==="https:"&&(i.protocol="http:"),e.forceHttps&&i.protocol==="http:"&&(i.protocol="https:"),e.stripAuthentication&&(i.username="",i.password=""),e.stripHash?i.hash="":e.stripTextFragment&&(i.hash=i.hash.replace(/#?:~:text.*?$/i,"")),i.pathname&&(i.pathname=i.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")),i.pathname)try{i.pathname=decodeURI(i.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let o=i.pathname.split("/"),a=o[o.length-1];$C(a,e.removeDirectoryIndex)&&(o=o.slice(0,o.length-1),i.pathname=o.slice(1).join("/")+"/")}if(i.hostname&&(i.hostname=i.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(i.hostname)&&(i.hostname=i.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let o of[...i.searchParams.keys()])$C(o,e.removeQueryParameters)&&i.searchParams.delete(o);e.removeQueryParameters===!0&&(i.search=""),e.sortQueryParameters&&i.searchParams.sort(),e.removeTrailingSlash&&(i.pathname=i.pathname.replace(/\/$/,""));let s=t;return t=i.toString(),!e.removeSingleSlash&&i.pathname==="/"&&!s.endsWith("/")&&i.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||i.pathname==="/")&&i.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t};GC.exports=jj});var YC=A((AY,WC)=>{WC.exports=VC;function VC(t,e){if(t&&e)return VC(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(n){r[n]=t[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var s=t.apply(this,n),o=n[n.length-1];return typeof s=="function"&&s!==o&&Object.keys(o).forEach(function(a){s[a]=o[a]}),s}}});var T0=A((DY,k0)=>{var KC=YC();k0.exports=KC(Sl);k0.exports.strict=KC(ZC);Sl.proto=Sl(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Sl(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return ZC(this)},configurable:!0})});function Sl(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function ZC(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var QC=A((CY,XC)=>{var qj=T0(),Uj=function(){},Hj=function(t){return t.setHeader&&typeof t.abort=="function"},$j=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},JC=function(t,e,r){if(typeof e=="function")return JC(t,null,e);e||(e={}),r=qj(r||Uj);var n=t._writableState,i=t._readableState,s=e.readable||e.readable!==!1&&t.readable,o=e.writable||e.writable!==!1&&t.writable,a=!1,u=function(){t.writable||c()},c=function(){o=!1,s||r.call(t)},l=function(){s=!1,o||r.call(t)},h=function(p){r.call(t,p?new Error("exited with error code: "+p):null)},f=function(p){r.call(t,p)},d=function(){process.nextTick(m)},m=function(){if(!a){if(s&&!(i&&i.ended&&!i.destroyed))return r.call(t,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(t,new Error("premature close"))}},y=function(){t.req.on("finish",c)};return Hj(t)?(t.on("complete",c),t.on("abort",d),t.req?y():t.on("request",y)):o&&!n&&(t.on("end",u),t.on("close",u)),$j(t)&&t.on("exit",h),t.on("end",l),t.on("finish",c),e.error!==!1&&t.on("error",f),t.on("close",d),function(){a=!0,t.removeListener("complete",c),t.removeListener("abort",d),t.removeListener("request",y),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("exit",h),t.removeListener("end",l),t.removeListener("error",f),t.removeListener("close",d)}};XC.exports=JC});var r2=A((RY,t2)=>{var Gj=T0(),zj=QC(),O0=require("fs"),ya=function(){},Vj=/^v?\.0/.test(process.version),Al=function(t){return typeof t=="function"},Wj=function(t){return!Vj||!O0?!1:(t instanceof(O0.ReadStream||ya)||t instanceof(O0.WriteStream||ya))&&Al(t.close)},Yj=function(t){return t.setHeader&&Al(t.abort)},Kj=function(t,e,r,n){n=Gj(n);var i=!1;t.on("close",function(){i=!0}),zj(t,{readable:e,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,Wj(t))return t.close(ya);if(Yj(t))return t.abort();if(Al(t.destroy))return t.destroy();n(o||new Error("stream was destroyed"))}}},e2=function(t){t()},Zj=function(t,e){return t.pipe(e)},Jj=function(){var t=Array.prototype.slice.call(arguments),e=Al(t[t.length-1]||ya)&&t.pop()||ya;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r,n=t.map(function(i,s){var o=s<t.length-1,a=s>0;return Kj(i,o,a,function(u){r||(r=u),u&&n.forEach(e2),!o&&(n.forEach(e2),e(r))})});return t.reduce(Zj)};t2.exports=Jj});var i2=A((kY,n2)=>{"use strict";var{PassThrough:Xj}=require("stream");n2.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,n=r==="buffer",i=!1;e?i=!(r||n):r=r||"utf8",n&&(r=null);let s=new Xj({objectMode:i});r&&s.setEncoding(r);let o=0,a=[];return s.on("data",u=>{a.push(u),i?o=a.length:o+=u.length}),s.getBufferedValue=()=>e?a:n?Buffer.concat(a,o):a.join(""),s.getBufferedLength=()=>o,s}});var s2=A((TY,zs)=>{"use strict";var{constants:Qj}=require("buffer"),e9=r2(),t9=i2(),Dl=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Cl(t,e){if(!t)return Promise.reject(new Error("Expected a stream"));e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,n;return await new Promise((i,s)=>{let o=a=>{a&&n.getBufferedLength()<=Qj.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),s(a)};n=e9(t,t9(e),a=>{if(a){o(a);return}i()}),n.on("data",()=>{n.getBufferedLength()>r&&o(new Dl)})}),n.getBufferedValue()}zs.exports=Cl;zs.exports.default=Cl;zs.exports.buffer=(t,e)=>Cl(t,{...e,encoding:"buffer"});zs.exports.array=(t,e)=>Cl(t,{...e,array:!0});zs.exports.MaxBufferError=Dl});var a2=A((FY,o2)=>{"use strict";var r9=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),n9=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),i9=new Set([500,502,503,504]),s9={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},o9={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function pi(t){let e=parseInt(t,10);return isFinite(e)?e:0}function a9(t){return t?i9.has(t.status):!0}function F0(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[i,s]=n.split(/=/,2);e[i.trim()]=s===void 0?!0:s.trim().replace(/^"|"$/g,"")}return e}function u9(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}o2.exports=class{constructor(e,r,{shared:n,cacheHeuristic:i,immutableMinTimeToLive:s,ignoreCargoCult:o,_fromObject:a}={}){if(a){this._fromObject(a);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=i!==void 0?i:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=F0(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=F0(e.headers["cache-control"]),o&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":u9(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&n9.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||r9.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=F0(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)s9[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let i of n)delete r[i]}if(r.warning){let n=r.warning.split(/,/).filter(i=>!/^\s*1[0-9][0-9]/.test(i));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return pi(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return pi(this._rescc["s-maxage"])}if(this._rescc["max-age"])return pi(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||n<r?0:Math.max(e,(n-r)/1e3)}if(this._resHeaders["last-modified"]){let n=Date.parse(this._resHeaders["last-modified"]);if(isFinite(n)&&r>n)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+pi(this._rescc["stale-if-error"]),n=e+pi(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+pi(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+pi(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let i=r["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));i.length?r["if-none-match"]=i.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&a9(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;if(r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0),!n)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let i={};for(let o in this._resHeaders)i[o]=o in r.headers&&!o9[o]?r.headers[o]:this._resHeaders[o];let s=Object.assign({},r,{status:this._status,method:this._method,headers:i});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var Rl=A((PY,u2)=>{"use strict";u2.exports=t=>{let e={};for(let[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}});var l2=A((IY,c2)=>{"use strict";var c9=require("stream").Readable,l9=Rl(),P0=class extends c9{constructor(e,r,n,i){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof r!="object")throw new TypeError("Argument `headers` should be an object");if(!(n instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if(typeof i!="string")throw new TypeError("Argument `url` should be a string");super(),this.statusCode=e,this.headers=l9(r),this.body=n,this.url=i}_read(){this.push(this.body),this.push(null)}};c2.exports=P0});var f2=A((LY,h2)=>{"use strict";var h9=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];h2.exports=(t,e)=>{let r=new Set(Object.keys(t).concat(h9));for(let n of r)n in e||(e[n]=typeof t[n]=="function"?t[n].bind(t):t[n])}});var p2=A((BY,d2)=>{"use strict";var f9=require("stream").PassThrough,d9=f2(),p9=t=>{if(!(t&&t.pipe))throw new TypeError("Parameter `response` must be a response stream.");let e=new f9;return d9(t,e),t.pipe(e)};d2.exports=p9});var m2=A(I0=>{I0.stringify=function t(e){if(typeof e=="undefined")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var r="",n=Array.isArray(e);r=n?"[":"{";var i=!0;for(var s in e){var o=typeof e[s]=="function"||!n&&typeof e[s]=="undefined";Object.hasOwnProperty.call(e,s)&&!o&&(i||(r+=","),i=!1,n?e[s]==null?r+="null":r+=t(e[s]):e[s]!==void 0&&(r+=t(s)+":"+t(e[s])))}return r+=n?"]":"}",r}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e=="undefined"?"null":JSON.stringify(e)};I0.parse=function(t){return JSON.parse(t,function(e,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})}});var b2=A((MY,_2)=>{"use strict";var m9=require("events"),y2=m2(),y9=t=>{let e={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(t.adapter||t.uri){let r=t.adapter||/^[^:+]*/.exec(t.uri)[0];return new(require(e[r]))(t)}return new Map},g2=["sqlite","postgres","mysql","mongo","redis","tiered"],L0=class extends m9{constructor(e,{emitErrors:r=!0,...n}={}){if(super(),this.opts={namespace:"keyv",serialize:y2.stringify,deserialize:y2.parse,...typeof e=="string"?{uri:e}:e,...n},!this.opts.store){let s={...this.opts};this.opts.store=y9(s)}if(this.opts.compression){let s=this.opts.compression;this.opts.serialize=s.serialize.bind(s),this.opts.deserialize=s.deserialize.bind(s)}typeof this.opts.store.on=="function"&&r&&this.opts.store.on("error",s=>this.emit("error",s)),this.opts.store.namespace=this.opts.namespace;let i=s=>async function*(){for await(let[o,a]of typeof s=="function"?s(this.opts.store.namespace):s){let u=this.opts.deserialize(a);if(!(this.opts.store.namespace&&!o.includes(this.opts.store.namespace))){if(typeof u.expires=="number"&&Date.now()>u.expires){this.delete(o);continue}yield[this._getKeyUnprefix(o),u.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=i(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=i(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return g2.includes(this.opts.store.opts.dialect)||g2.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(r=>`${this.opts.namespace}:${r}`)}_getKeyUnprefix(e){return e.split(":").splice(1).join(":")}get(e,r){let{store:n}=this.opts,i=Array.isArray(e),s=i?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(i&&n.getMany===void 0){let o=[];for(let a of s)o.push(Promise.resolve().then(()=>n.get(a)).then(u=>typeof u=="string"?this.opts.deserialize(u):this.opts.compression?this.opts.deserialize(u):u).then(u=>{if(u!=null)return typeof u.expires=="number"&&Date.now()>u.expires?this.delete(a).then(()=>{}):r&&r.raw?u:u.value}));return Promise.allSettled(o).then(a=>{let u=[];for(let c of a)u.push(c.value);return u})}return Promise.resolve().then(()=>i?n.getMany(s):n.get(s)).then(o=>typeof o=="string"?this.opts.deserialize(o):this.opts.compression?this.opts.deserialize(o):o).then(o=>{if(o!=null){if(i){let a=[];for(let u of o){if(typeof u=="string"&&(u=this.opts.deserialize(u)),u==null){a.push(void 0);continue}typeof u.expires=="number"&&Date.now()>u.expires?(this.delete(e).then(()=>{}),a.push(void 0)):a.push(r&&r.raw?u:u.value)}return a}return typeof o.expires=="number"&&Date.now()>o.expires?this.delete(e).then(()=>{}):r&&r.raw?o:o.value}})}set(e,r,n){let i=this._getKeyPrefix(e);typeof n=="undefined"&&(n=this.opts.ttl),n===0&&(n=void 0);let{store:s}=this.opts;return Promise.resolve().then(()=>{let o=typeof n=="number"?Date.now()+n:null;return typeof r=="symbol"&&this.emit("error","symbol cannot be serialized"),r={value:r,expires:o},this.opts.serialize(r)}).then(o=>s.set(i,o,n)).then(()=>!0)}delete(e){let{store:r}=this.opts;if(Array.isArray(e)){let i=this._getKeyPrefixArray(e);if(r.deleteMany===void 0){let s=[];for(let o of i)s.push(r.delete(o));return Promise.allSettled(s).then(o=>o.every(a=>a.value===!0))}return Promise.resolve().then(()=>r.deleteMany(i))}let n=this._getKeyPrefix(e);return Promise.resolve().then(()=>r.delete(n))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let r=this._getKeyPrefix(e),{store:n}=this.opts;return Promise.resolve().then(async()=>typeof n.has=="function"?n.has(r):await n.get(r)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect=="function")return e.disconnect()}};_2.exports=L0});var w2=A((jY,E2)=>{"use strict";var g9=require("events"),kl=require("url"),_9=zC(),b9=s2(),B0=a2(),v2=l2(),v9=Rl(),E9=p2(),w9=b2(),ur=class{constructor(e,r){if(typeof e!="function")throw new TypeError("Parameter `request` must be a function");return this.cache=new w9({uri:typeof r=="string"&&r,store:typeof r!="string"&&r,namespace:"cacheable-request"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(r,n)=>{let i;if(typeof r=="string")i=N0(kl.parse(r)),r={};else if(r instanceof kl.URL)i=N0(kl.parse(r.toString())),r={};else{let[h,...f]=(r.path||"").split("?"),d=f.length>0?`?${f.join("?")}`:"";i=N0({...r,pathname:h,search:d})}r={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...r,...x9(i)},r.headers=v9(r.headers);let s=new g9,o=_9(kl.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),a=`${r.method}:${o}`,u=!1,c=!1,l=h=>{c=!0;let f=!1,d,m=new Promise(p=>{d=()=>{f||(f=!0,p())}}),y=p=>{if(u&&!h.forceRefresh){p.status=p.statusCode;let O=B0.fromObject(u.cachePolicy).revalidatedPolicy(h,p);if(!O.modified){let P=O.policy.responseHeaders();p=new v2(u.statusCode,P,u.body,u.url),p.cachePolicy=O.policy,p.fromCache=!0}}p.fromCache||(p.cachePolicy=new B0(h,p,h),p.fromCache=!1);let w;h.cache&&p.cachePolicy.storable()?(w=E9(p),(async()=>{try{let O=b9.buffer(p);if(await Promise.race([m,new Promise(M=>p.once("end",M))]),f)return;let P=await O,I={cachePolicy:p.cachePolicy.toObject(),url:p.url,statusCode:p.fromCache?u.statusCode:p.statusCode,body:P},k=h.strictTtl?p.cachePolicy.timeToLive():void 0;h.maxTtl&&(k=k?Math.min(k,h.maxTtl):h.maxTtl),await this.cache.set(a,I,k)}catch(O){s.emit("error",new ur.CacheError(O))}})()):h.cache&&u&&(async()=>{try{await this.cache.delete(a)}catch(O){s.emit("error",new ur.CacheError(O))}})(),s.emit("response",w||p),typeof n=="function"&&n(w||p)};try{let p=e(h,y);p.once("error",d),p.once("abort",d),s.emit("request",p)}catch(p){s.emit("error",new ur.RequestError(p))}};return(async()=>{let h=async d=>{await Promise.resolve();let m=d.cache?await this.cache.get(a):void 0;if(typeof m=="undefined")return l(d);let y=B0.fromObject(m.cachePolicy);if(y.satisfiesWithoutRevalidation(d)&&!d.forceRefresh){let p=y.responseHeaders(),w=new v2(m.statusCode,p,m.body,m.url);w.cachePolicy=y,w.fromCache=!0,s.emit("response",w),typeof n=="function"&&n(w)}else u=m,d.headers=y.revalidationHeaders(d),l(d)},f=d=>s.emit("error",new ur.CacheError(d));this.cache.once("error",f),s.on("response",()=>this.cache.removeListener("error",f));try{await h(r)}catch(d){r.automaticFailover&&!c&&l(r),s.emit("error",new ur.CacheError(d))}})(),s}}};function x9(t){let e={...t};return e.path=`${t.pathname||"/"}${t.search||""}`,delete e.pathname,delete e.search,e}function N0(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}}ur.RequestError=class extends Error{constructor(t){super(t.message),this.name="RequestError",Object.assign(this,t)}};ur.CacheError=class extends Error{constructor(t){super(t.message),this.name="CacheError",Object.assign(this,t)}};E2.exports=ur});var S2=A((HY,x2)=>{"use strict";var S9=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];x2.exports=(t,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set(Object.keys(t).concat(S9)),n={};for(let i of r)i in e||(n[i]={get(){let s=t[i];return typeof s=="function"?s.bind(t):s},set(s){t[i]=s},enumerable:!0,configurable:!1});return Object.defineProperties(e,n),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var D2=A(($Y,A2)=>{"use strict";var{Transform:A9,PassThrough:D9}=require("stream"),M0=require("zlib"),C9=S2();A2.exports=t=>{let e=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return t;let r=e==="br";if(r&&typeof M0.createBrotliDecompress!="function")return t.destroy(new Error("Brotli is not supported on Node.js < 12")),t;let n=!0,i=new A9({transform(a,u,c){n=!1,c(null,a)},flush(a){a()}}),s=new D9({autoDestroy:!1,destroy(a,u){t.destroy(),u(a)}}),o=r?M0.createBrotliDecompress():M0.createUnzip();return o.once("error",a=>{if(n&&!t.readable){s.end();return}s.destroy(a)}),C9(t,s),t.pipe(i).pipe(o).pipe(s),s}});var q0=A((GY,C2)=>{"use strict";var j0=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,r){if(this.cache.set(e,r),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[n,i]of this.oldCache.entries())this.onEviction(n,i);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let r=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,r),r}}set(e,r){return this.cache.has(e)?this.cache.set(e,r):this._set(e,r),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[r]=e;this.cache.has(r)||(yield e)}}get size(){let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}};C2.exports=j0});var H0=A((zY,O2)=>{"use strict";var R9=require("events"),k9=require("tls"),T9=require("http2"),O9=q0(),gt=Symbol("currentStreamsCount"),R2=Symbol("request"),Jt=Symbol("cachedOriginSet"),Vs=Symbol("gracefullyClosing"),F9=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"],P9=(t,e,r)=>{let n=0,i=t.length;for(;n<i;){let s=n+i>>>1;r(t[s],e)?n=s+1:i=s}return n},I9=(t,e)=>t.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,U0=(t,e)=>{for(let r of t)r[Jt].length<e[Jt].length&&r[Jt].every(n=>e[Jt].includes(n))&&r[gt]+e[gt]<=e.remoteSettings.maxConcurrentStreams&&T2(r)},L9=(t,e)=>{for(let r of t)e[Jt].length<r[Jt].length&&e[Jt].every(n=>r[Jt].includes(n))&&e[gt]+r[gt]<=r.remoteSettings.maxConcurrentStreams&&T2(e)},k2=({agent:t,isFree:e})=>{let r={};for(let n in t.sessions){let s=t.sessions[n].filter(o=>{let a=o[Rr.kCurrentStreamsCount]<o.remoteSettings.maxConcurrentStreams;return e?a:!a});s.length!==0&&(r[n]=s)}return r},T2=t=>{t[Vs]=!0,t[gt]===0&&t.close()},Rr=class extends R9{constructor({timeout:e=6e4,maxSessions:r=1/0,maxFreeSessions:n=10,maxCachedTlsSessions:i=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=r,this.maxFreeSessions=n,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new O9({maxSize:i})}static normalizeOrigin(e,r){return typeof e=="string"&&(e=new URL(e)),r&&e.hostname!==r&&(e.hostname=r),e.origin}normalizeOptions(e){let r="";if(e)for(let n of F9)e[n]&&(r+=`:${e[n]}`);return r}_tryToCreateNewSession(e,r){if(!(e in this.queue)||!(r in this.queue[e]))return;let n=this.queue[e][r];this._sessionsCount<this.maxSessions&&!n.completed&&(n.completed=!0,n())}getSession(e,r,n){return new Promise((i,s)=>{Array.isArray(n)?(n=[...n],i()):n=[{resolve:i,reject:s}];let o=this.normalizeOptions(r),a=Rr.normalizeOrigin(e,r&&r.servername);if(a===void 0){for(let{reject:l}of n)l(new TypeError("The `origin` argument needs to be a string or an URL object"));return}if(o in this.sessions){let l=this.sessions[o],h=-1,f=-1,d;for(let m of l){let y=m.remoteSettings.maxConcurrentStreams;if(y<h)break;if(m[Jt].includes(a)){let p=m[gt];if(p>=y||m[Vs]||m.destroyed)continue;d||(h=y),p>f&&(d=m,f=p)}}if(d){if(n.length!==1){for(let{reject:m}of n){let y=new Error(`Expected the length of listeners to be 1, got ${n.length}.
|
|
23
|
+
`);return p?(n.originalMessage=n.message,n.message=O):n=new Error(O),n.shortMessage=w,n.command=o,n.escapedCommand=a,n.exitCode=s,n.signal=i,n.signalDescription=f,n.stdout=t,n.stderr=e,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!u,n.isCanceled=c,n.killed=l&&!u,n};tS.exports=TM});var iS=A((dW,Dp)=>{"use strict";var lc=["stdin","stdout","stderr"],OM=t=>lc.some(e=>t[e]!==void 0),nS=t=>{if(!t)return;let{stdio:e}=t;if(e===void 0)return lc.map(n=>t[n]);if(OM(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${lc.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,lc.length);return Array.from({length:r},(n,i)=>e[i])};Dp.exports=nS;Dp.exports.node=t=>{let e=nS(t);return e==="ipc"?"ipc":e===void 0||typeof e=="string"?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}});var oS=A((pW,sS)=>{"use strict";var FM=require("os"),PM=Vd(),IM=1e3*5,LM=(t,e="SIGTERM",r={})=>{let n=t(e);return BM(t,e,r,n),n},BM=(t,e,r,n)=>{if(!NM(e,r,n))return;let i=jM(r),s=setTimeout(()=>{t("SIGKILL")},i);s.unref&&s.unref()},NM=(t,{forceKillAfterTimeout:e},r)=>MM(t)&&e!==!1&&r,MM=t=>t===FM.constants.signals.SIGTERM||typeof t=="string"&&t.toUpperCase()==="SIGTERM",jM=({forceKillAfterTimeout:t=!0})=>{if(t===!0)return IM;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},qM=(t,e)=>{t.kill()&&(e.isCanceled=!0)},UM=(t,e,r)=>{t.kill(e),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},HM=(t,{timeout:e,killSignal:r="SIGTERM"},n)=>{if(e===0||e===void 0)return n;let i,s=new Promise((a,u)=>{i=setTimeout(()=>{UM(t,r,u)},e)}),o=n.finally(()=>{clearTimeout(i)});return Promise.race([s,o])},$M=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},GM=async(t,{cleanup:e,detached:r},n)=>{if(!e||r)return n;let i=PM(()=>{t.kill()});return n.finally(()=>{i()})};sS.exports={spawnedKill:LM,spawnedCancel:qM,setupTimeout:HM,validateTimeout:$M,setExitHandler:GM}});var uS=A((mW,aS)=>{"use strict";var vr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";vr.writable=t=>vr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";vr.readable=t=>vr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";vr.duplex=t=>vr.writable(t)&&vr.readable(t);vr.transform=t=>vr.duplex(t)&&typeof t._transform=="function";aS.exports=vr});var lS=A((yW,cS)=>{"use strict";var{PassThrough:zM}=require("stream");cS.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,n=r==="buffer",i=!1;e?i=!(r||n):r=r||"utf8",n&&(r=null);let s=new zM({objectMode:i});r&&s.setEncoding(r);let o=0,a=[];return s.on("data",u=>{a.push(u),i?o=a.length:o+=u.length}),s.getBufferedValue=()=>e?a:n?Buffer.concat(a,o):a.join(""),s.getBufferedLength=()=>o,s}});var hS=A((gW,zo)=>{"use strict";var{constants:VM}=require("buffer"),WM=require("stream"),{promisify:YM}=require("util"),KM=lS(),ZM=YM(WM.pipeline),hc=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Cp(t,e){if(!t)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,n=KM(e);return await new Promise((i,s)=>{let o=a=>{a&&n.getBufferedLength()<=VM.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),s(a)};(async()=>{try{await ZM(t,n),i()}catch(a){o(a)}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(new hc)})}),n.getBufferedValue()}zo.exports=Cp;zo.exports.buffer=(t,e)=>Cp(t,{...e,encoding:"buffer"});zo.exports.array=(t,e)=>Cp(t,{...e,array:!0});zo.exports.MaxBufferError=hc});var dS=A((_W,fS)=>{"use strict";var{PassThrough:JM}=require("stream");fS.exports=function(){var t=[],e=new JM({objectMode:!0});return e.setMaxListeners(0),e.add=r,e.isEmpty=n,e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(r),e;function r(s){return Array.isArray(s)?(s.forEach(r),this):(t.push(s),s.once("end",i.bind(null,s)),s.once("error",e.emit.bind(e,"error")),s.pipe(e,{end:!1}),this)}function n(){return t.length==0}function i(s){t=t.filter(function(o){return o!==s}),!t.length&&e.readable&&e.end()}}});var gS=A((bW,yS)=>{"use strict";var mS=uS(),pS=hS(),XM=dS(),QM=(t,e)=>{e===void 0||t.stdin===void 0||(mS(e)?e.pipe(t.stdin):t.stdin.end(e))},e6=(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;let r=XM();return t.stdout&&r.add(t.stdout),t.stderr&&r.add(t.stderr),r},Rp=async(t,e)=>{if(t){t.destroy();try{return await e}catch(r){return r.bufferedData}}},kp=(t,{encoding:e,buffer:r,maxBuffer:n})=>{if(!(!t||!r))return e?pS(t,{encoding:e,maxBuffer:n}):pS.buffer(t,{maxBuffer:n})},t6=async({stdout:t,stderr:e,all:r},{encoding:n,buffer:i,maxBuffer:s},o)=>{let a=kp(t,{encoding:n,buffer:i,maxBuffer:s}),u=kp(e,{encoding:n,buffer:i,maxBuffer:s}),c=kp(r,{encoding:n,buffer:i,maxBuffer:s*2});try{return await Promise.all([o,a,u,c])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},Rp(t,a),Rp(e,u),Rp(r,c)])}},r6=({input:t})=>{if(mS(t))throw new TypeError("The `input` option cannot be a stream in sync mode")};yS.exports={handleInput:QM,makeAllStream:e6,getSpawnedResult:t6,validateInputSync:r6}});var bS=A((vW,_S)=>{"use strict";var n6=(async()=>{})().constructor.prototype,i6=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(n6,t)]),s6=(t,e)=>{for(let[r,n]of i6){let i=typeof e=="function"?(...s)=>Reflect.apply(n.value,e(),s):n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}return t},o6=t=>new Promise((e,r)=>{t.on("exit",(n,i)=>{e({exitCode:n,signal:i})}),t.on("error",n=>{r(n)}),t.stdin&&t.stdin.on("error",n=>{r(n)})});_S.exports={mergePromise:s6,getSpawnedPromise:o6}});var wS=A((EW,ES)=>{"use strict";var vS=(t,e=[])=>Array.isArray(e)?[t,...e]:[t],a6=/^[\w.-]+$/,u6=/"/g,c6=t=>typeof t!="string"||a6.test(t)?t:`"${t.replace(u6,'\\"')}"`,l6=(t,e)=>vS(t,e).join(" "),h6=(t,e)=>vS(t,e).map(r=>c6(r)).join(" "),f6=/ +/g,d6=t=>{let e=[];for(let r of t.trim().split(f6)){let n=e[e.length-1];n&&n.endsWith("\\")?e[e.length-1]=`${n.slice(0,-1)} ${r}`:e.push(r)}return e};ES.exports={joinCommand:l6,getEscapedCommand:h6,parseCommand:d6}});var _s=A((wW,gs)=>{"use strict";var p6=require("path"),Tp=require("child_process"),m6=$x(),y6=zx(),g6=Yx(),_6=$d(),fc=rS(),SS=iS(),{spawnedKill:b6,spawnedCancel:v6,setupTimeout:E6,validateTimeout:w6,setExitHandler:x6}=oS(),{handleInput:S6,getSpawnedResult:A6,makeAllStream:D6,validateInputSync:C6}=gS(),{mergePromise:xS,getSpawnedPromise:R6}=bS(),{joinCommand:AS,parseCommand:DS,getEscapedCommand:CS}=wS(),k6=1e3*1e3*100,T6=({env:t,extendEnv:e,preferLocal:r,localDir:n,execPath:i})=>{let s=e?{...process.env,...t}:t;return r?g6.env({env:s,cwd:n,execPath:i}):s},RS=(t,e,r={})=>{let n=m6._parse(t,e,r);return t=n.command,e=n.args,r=n.options,r={maxBuffer:k6,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r},r.env=T6(r),r.stdio=SS(r),process.platform==="win32"&&p6.basename(t,".exe")==="cmd"&&e.unshift("/q"),{file:t,args:e,options:r,parsed:n}},Vo=(t,e,r)=>typeof e!="string"&&!Buffer.isBuffer(e)?r===void 0?void 0:"":t.stripFinalNewline?y6(e):e,dc=(t,e,r)=>{let n=RS(t,e,r),i=AS(t,e),s=CS(t,e);w6(n.options);let o;try{o=Tp.spawn(n.file,n.args,n.options)}catch(d){let m=new Tp.ChildProcess,y=Promise.reject(fc({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return xS(m,y)}let a=R6(o),u=E6(o,n.options,a),c=x6(o,n.options,u),l={isCanceled:!1};o.kill=b6.bind(null,o.kill.bind(o)),o.cancel=v6.bind(null,o,l);let f=_6(async()=>{let[{error:d,exitCode:m,signal:y,timedOut:p},w,O,P]=await A6(o,n.options,c),I=Vo(n.options,w),k=Vo(n.options,O),M=Vo(n.options,P);if(d||m!==0||y!==null){let x=fc({error:d,exitCode:m,signal:y,stdout:I,stderr:k,all:M,command:i,escapedCommand:s,parsed:n,timedOut:p,isCanceled:l.isCanceled,killed:o.killed});if(!n.options.reject)return x;throw x}return{command:i,escapedCommand:s,exitCode:0,stdout:I,stderr:k,all:M,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return S6(o,n.options.input),o.all=D6(o,n.options),xS(o,f)};gs.exports=dc;gs.exports.sync=(t,e,r)=>{let n=RS(t,e,r),i=AS(t,e),s=CS(t,e);C6(n.options);let o;try{o=Tp.spawnSync(n.file,n.args,n.options)}catch(c){throw fc({error:c,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let a=Vo(n.options,o.stdout,o.error),u=Vo(n.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){let c=fc({stdout:a,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:s,parsed:n,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!n.options.reject)return c;throw c}return{command:i,escapedCommand:s,exitCode:0,stdout:a,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};gs.exports.command=(t,e)=>{let[r,...n]=DS(t);return dc(r,n,e)};gs.exports.commandSync=(t,e)=>{let[r,...n]=DS(t);return dc.sync(r,n,e)};gs.exports.node=(t,e,r={})=>{e&&!Array.isArray(e)&&typeof e=="object"&&(r=e,e=[]);let n=SS.node(r),i=process.execArgv.filter(a=>!a.startsWith("--inspect")),{nodePath:s=process.execPath,nodeOptions:o=i}=r;return dc(s,[...o,t,...Array.isArray(e)?e:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:n,shell:!1})}});var bs=A((CW,PS)=>{"use strict";var FS=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"]]);PS.exports=t=>t?Object.keys(t).map(e=>[FS.has(e)?FS.get(e):e,t[e]]).reduce((e,r)=>(e[r[0]]=r[1],e),Object.create(null)):{}});var Ec=A((RW,HS)=>{"use strict";var IS=typeof process=="object"&&process?process:{stdout:null,stderr:null},F6=require("events"),LS=require("stream"),BS=require("string_decoder").StringDecoder,qr=Symbol("EOF"),Ur=Symbol("maybeEmitEnd"),vn=Symbol("emittedEnd"),yc=Symbol("emittingEnd"),Ko=Symbol("emittedError"),gc=Symbol("closed"),NS=Symbol("read"),_c=Symbol("flush"),MS=Symbol("flushChunk"),xt=Symbol("encoding"),Hr=Symbol("decoder"),bc=Symbol("flowing"),Zo=Symbol("paused"),vs=Symbol("resume"),qe=Symbol("buffer"),Er=Symbol("pipes"),Xe=Symbol("bufferLength"),Ip=Symbol("bufferPush"),Lp=Symbol("bufferShift"),ut=Symbol("objectMode"),ct=Symbol("destroyed"),Bp=Symbol("emitData"),jS=Symbol("emitEnd"),Np=Symbol("emitEnd2"),$r=Symbol("async"),Jo=t=>Promise.resolve().then(t),qS=global._MP_NO_ITERATOR_SYMBOLS_!=="1",P6=qS&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),I6=qS&&Symbol.iterator||Symbol("iterator not implemented"),L6=t=>t==="end"||t==="finish"||t==="prefinish",B6=t=>t instanceof ArrayBuffer||typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,N6=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),vc=class{constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[vs](),r.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Mp=class extends vc{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}};HS.exports=class US extends LS{constructor(e){super(),this[bc]=!1,this[Zo]=!1,this[Er]=[],this[qe]=[],this[ut]=e&&e.objectMode||!1,this[ut]?this[xt]=null:this[xt]=e&&e.encoding||null,this[xt]==="buffer"&&(this[xt]=null),this[$r]=e&&!!e.async||!1,this[Hr]=this[xt]?new BS(this[xt]):null,this[qr]=!1,this[vn]=!1,this[yc]=!1,this[gc]=!1,this[Ko]=null,this.writable=!0,this.readable=!0,this[Xe]=0,this[ct]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[qe]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Er]})}get bufferLength(){return this[Xe]}get encoding(){return this[xt]}set encoding(e){if(this[ut])throw new Error("cannot set encoding in objectMode");if(this[xt]&&e!==this[xt]&&(this[Hr]&&this[Hr].lastNeed||this[Xe]))throw new Error("cannot change encoding");this[xt]!==e&&(this[Hr]=e?new BS(e):null,this[qe].length&&(this[qe]=this[qe].map(r=>this[Hr].write(r)))),this[xt]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[ut]}set objectMode(e){this[ut]=this[ut]||!!e}get async(){return this[$r]}set async(e){this[$r]=this[$r]||!!e}write(e,r,n){if(this[qr])throw new Error("write after end");if(this[ct])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[$r]?Jo:s=>s();return!this[ut]&&!Buffer.isBuffer(e)&&(N6(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):B6(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[ut]?(this.flowing&&this[Xe]!==0&&this[_c](!0),this.flowing?this.emit("data",e):this[Ip](e),this[Xe]!==0&&this.emit("readable"),n&&i(n),this.flowing):e.length?(typeof e=="string"&&!(r===this[xt]&&!this[Hr].lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[xt]&&(e=this[Hr].write(e)),this.flowing&&this[Xe]!==0&&this[_c](!0),this.flowing?this.emit("data",e):this[Ip](e),this[Xe]!==0&&this.emit("readable"),n&&i(n),this.flowing):(this[Xe]!==0&&this.emit("readable"),n&&i(n),this.flowing)}read(e){if(this[ct])return null;if(this[Xe]===0||e===0||e>this[Xe])return this[Ur](),null;this[ut]&&(e=null),this[qe].length>1&&!this[ut]&&(this.encoding?this[qe]=[this[qe].join("")]:this[qe]=[Buffer.concat(this[qe],this[Xe])]);let r=this[NS](e||null,this[qe][0]);return this[Ur](),r}[NS](e,r){return e===r.length||e===null?this[Lp]():(this[qe][0]=r.slice(e),r=r.slice(0,e),this[Xe]-=e),this.emit("data",r),!this[qe].length&&!this[qr]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=null),typeof r=="function"&&(n=r,r="utf8"),e&&this.write(e,r),n&&this.once("end",n),this[qr]=!0,this.writable=!1,(this.flowing||!this[Zo])&&this[Ur](),this}[vs](){this[ct]||(this[Zo]=!1,this[bc]=!0,this.emit("resume"),this[qe].length?this[_c]():this[qr]?this[Ur]():this.emit("drain"))}resume(){return this[vs]()}pause(){this[bc]=!1,this[Zo]=!0}get destroyed(){return this[ct]}get flowing(){return this[bc]}get paused(){return this[Zo]}[Ip](e){this[ut]?this[Xe]+=1:this[Xe]+=e.length,this[qe].push(e)}[Lp](){return this[qe].length&&(this[ut]?this[Xe]-=1:this[Xe]-=this[qe][0].length),this[qe].shift()}[_c](e){do;while(this[MS](this[Lp]()));!e&&!this[qe].length&&!this[qr]&&this.emit("drain")}[MS](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,r){if(this[ct])return;let n=this[vn];return r=r||{},e===IS.stdout||e===IS.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[Er].push(r.proxyErrors?new Mp(this,e,r):new vc(this,e,r)),this[$r]?Jo(()=>this[vs]()):this[vs]()),e}unpipe(e){let r=this[Er].find(n=>n.dest===e);r&&(this[Er].splice(this[Er].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);return e==="data"&&!this[Er].length&&!this.flowing?this[vs]():e==="readable"&&this[Xe]!==0?super.emit("readable"):L6(e)&&this[vn]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Ko]&&(this[$r]?Jo(()=>r.call(this,this[Ko])):r.call(this,this[Ko])),n}get emittedEnd(){return this[vn]}[Ur](){!this[yc]&&!this[vn]&&!this[ct]&&this[qe].length===0&&this[qr]&&(this[yc]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[gc]&&this.emit("close"),this[yc]=!1)}emit(e,r,...n){if(e!=="error"&&e!=="close"&&e!==ct&&this[ct])return;if(e==="data")return r?this[$r]?Jo(()=>this[Bp](r)):this[Bp](r):!1;if(e==="end")return this[jS]();if(e==="close"){if(this[gc]=!0,!this[vn]&&!this[ct])return;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Ko]=r;let s=super.emit("error",r);return this[Ur](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ur](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,r,...n);return this[Ur](),i}[Bp](e){for(let n of this[Er])n.dest.write(e)===!1&&this.pause();let r=super.emit("data",e);return this[Ur](),r}[jS](){this[vn]||(this[vn]=!0,this.readable=!1,this[$r]?Jo(()=>this[Np]()):this[Np]())}[Np](){if(this[Hr]){let r=this[Hr].end();if(r){for(let n of this[Er])n.dest.write(r);super.emit("data",r)}}for(let r of this[Er])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[ut]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[ut]||(e.dataLength+=n.length)}),r.then(()=>e)}concat(){return this[ut]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[ut]?Promise.reject(new Error("cannot concat in objectMode")):this[xt]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,r)=>{this.on(ct,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[P6](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[qr])return Promise.resolve({done:!0});let n=null,i=null,s=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",s),this.removeListener("end",a),this.pause(),n({value:c,done:!!this[qr]})},a=()=>{this.removeListener("error",s),this.removeListener("data",o),n({done:!0})},u=()=>s(new Error("stream destroyed"));return new Promise((c,l)=>{i=l,n=c,this.once(ct,u),this.once("error",s),this.once("end",a),this.once("data",o)})}}}[I6](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(e){return this[ct]?(e?this.emit("error",e):this.emit(ct),this):(this[ct]=!0,this[qe].length=0,this[Xe]=0,typeof this.close=="function"&&!this[gc]&&this.close(),e?this.emit("error",e):this.emit(ct),this)}static isStream(e){return!!e&&(e instanceof US||e instanceof LS||e instanceof F6&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var GS=A((kW,$S)=>{var M6=require("zlib").constants||{ZLIB_VERNUM:4736};$S.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},M6))});var Gp=A((TW,QS)=>{"use strict";var zS=typeof process=="object"&&process?process:{stdout:null,stderr:null},j6=require("events"),VS=require("stream"),WS=require("string_decoder").StringDecoder,Gr=Symbol("EOF"),zr=Symbol("maybeEmitEnd"),En=Symbol("emittedEnd"),wc=Symbol("emittingEnd"),Xo=Symbol("emittedError"),xc=Symbol("closed"),YS=Symbol("read"),Sc=Symbol("flush"),KS=Symbol("flushChunk"),St=Symbol("encoding"),Vr=Symbol("decoder"),Ac=Symbol("flowing"),Qo=Symbol("paused"),Es=Symbol("resume"),Qe=Symbol("bufferLength"),jp=Symbol("bufferPush"),qp=Symbol("bufferShift"),lt=Symbol("objectMode"),ht=Symbol("destroyed"),Up=Symbol("emitData"),ZS=Symbol("emitEnd"),Hp=Symbol("emitEnd2"),Wr=Symbol("async"),ea=t=>Promise.resolve().then(t),JS=global._MP_NO_ITERATOR_SYMBOLS_!=="1",q6=JS&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),U6=JS&&Symbol.iterator||Symbol("iterator not implemented"),H6=t=>t==="end"||t==="finish"||t==="prefinish",$6=t=>t instanceof ArrayBuffer||typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,G6=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Dc=class{constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[Es](),r.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},$p=class extends Dc{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}};QS.exports=class XS extends VS{constructor(e){super(),this[Ac]=!1,this[Qo]=!1,this.pipes=[],this.buffer=[],this[lt]=e&&e.objectMode||!1,this[lt]?this[St]=null:this[St]=e&&e.encoding||null,this[St]==="buffer"&&(this[St]=null),this[Wr]=e&&!!e.async||!1,this[Vr]=this[St]?new WS(this[St]):null,this[Gr]=!1,this[En]=!1,this[wc]=!1,this[xc]=!1,this[Xo]=null,this.writable=!0,this.readable=!0,this[Qe]=0,this[ht]=!1}get bufferLength(){return this[Qe]}get encoding(){return this[St]}set encoding(e){if(this[lt])throw new Error("cannot set encoding in objectMode");if(this[St]&&e!==this[St]&&(this[Vr]&&this[Vr].lastNeed||this[Qe]))throw new Error("cannot change encoding");this[St]!==e&&(this[Vr]=e?new WS(e):null,this.buffer.length&&(this.buffer=this.buffer.map(r=>this[Vr].write(r)))),this[St]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[lt]}set objectMode(e){this[lt]=this[lt]||!!e}get async(){return this[Wr]}set async(e){this[Wr]=this[Wr]||!!e}write(e,r,n){if(this[Gr])throw new Error("write after end");if(this[ht])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[Wr]?ea:s=>s();return!this[lt]&&!Buffer.isBuffer(e)&&(G6(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):$6(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[lt]?(this.flowing&&this[Qe]!==0&&this[Sc](!0),this.flowing?this.emit("data",e):this[jp](e),this[Qe]!==0&&this.emit("readable"),n&&i(n),this.flowing):e.length?(typeof e=="string"&&!(r===this[St]&&!this[Vr].lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[St]&&(e=this[Vr].write(e)),this.flowing&&this[Qe]!==0&&this[Sc](!0),this.flowing?this.emit("data",e):this[jp](e),this[Qe]!==0&&this.emit("readable"),n&&i(n),this.flowing):(this[Qe]!==0&&this.emit("readable"),n&&i(n),this.flowing)}read(e){if(this[ht])return null;if(this[Qe]===0||e===0||e>this[Qe])return this[zr](),null;this[lt]&&(e=null),this.buffer.length>1&&!this[lt]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Qe])]);let r=this[YS](e||null,this.buffer[0]);return this[zr](),r}[YS](e,r){return e===r.length||e===null?this[qp]():(this.buffer[0]=r.slice(e),r=r.slice(0,e),this[Qe]-=e),this.emit("data",r),!this.buffer.length&&!this[Gr]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=null),typeof r=="function"&&(n=r,r="utf8"),e&&this.write(e,r),n&&this.once("end",n),this[Gr]=!0,this.writable=!1,(this.flowing||!this[Qo])&&this[zr](),this}[Es](){this[ht]||(this[Qo]=!1,this[Ac]=!0,this.emit("resume"),this.buffer.length?this[Sc]():this[Gr]?this[zr]():this.emit("drain"))}resume(){return this[Es]()}pause(){this[Ac]=!1,this[Qo]=!0}get destroyed(){return this[ht]}get flowing(){return this[Ac]}get paused(){return this[Qo]}[jp](e){this[lt]?this[Qe]+=1:this[Qe]+=e.length,this.buffer.push(e)}[qp](){return this.buffer.length&&(this[lt]?this[Qe]-=1:this[Qe]-=this.buffer[0].length),this.buffer.shift()}[Sc](e){do;while(this[KS](this[qp]()));!e&&!this.buffer.length&&!this[Gr]&&this.emit("drain")}[KS](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,r){if(this[ht])return;let n=this[En];return r=r||{},e===zS.stdout||e===zS.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this.pipes.push(r.proxyErrors?new $p(this,e,r):new Dc(this,e,r)),this[Wr]?ea(()=>this[Es]()):this[Es]()),e}unpipe(e){let r=this.pipes.find(n=>n.dest===e);r&&(this.pipes.splice(this.pipes.indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);return e==="data"&&!this.pipes.length&&!this.flowing?this[Es]():e==="readable"&&this[Qe]!==0?super.emit("readable"):H6(e)&&this[En]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Xo]&&(this[Wr]?ea(()=>r.call(this,this[Xo])):r.call(this,this[Xo])),n}get emittedEnd(){return this[En]}[zr](){!this[wc]&&!this[En]&&!this[ht]&&this.buffer.length===0&&this[Gr]&&(this[wc]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[xc]&&this.emit("close"),this[wc]=!1)}emit(e,r,...n){if(e!=="error"&&e!=="close"&&e!==ht&&this[ht])return;if(e==="data")return r?this[Wr]?ea(()=>this[Up](r)):this[Up](r):!1;if(e==="end")return this[ZS]();if(e==="close"){if(this[xc]=!0,!this[En]&&!this[ht])return;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Xo]=r;let s=super.emit("error",r);return this[zr](),s}else if(e==="resume"){let s=super.emit("resume");return this[zr](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,r,...n);return this[zr](),i}[Up](e){for(let n of this.pipes)n.dest.write(e)===!1&&this.pause();let r=super.emit("data",e);return this[zr](),r}[ZS](){this[En]||(this[En]=!0,this.readable=!1,this[Wr]?ea(()=>this[Hp]()):this[Hp]())}[Hp](){if(this[Vr]){let r=this[Vr].end();if(r){for(let n of this.pipes)n.dest.write(r);super.emit("data",r)}}for(let r of this.pipes)r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[lt]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[lt]||(e.dataLength+=n.length)}),r.then(()=>e)}concat(){return this[lt]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[lt]?Promise.reject(new Error("cannot concat in objectMode")):this[St]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,r)=>{this.on(ht,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[q6](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Gr])return Promise.resolve({done:!0});let n=null,i=null,s=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",s),this.removeListener("end",a),this.pause(),n({value:c,done:!!this[Gr]})},a=()=>{this.removeListener("error",s),this.removeListener("data",o),n({done:!0})},u=()=>s(new Error("stream destroyed"));return new Promise((c,l)=>{i=l,n=c,this.once(ht,u),this.once("error",s),this.once("end",a),this.once("data",o)})}}}[U6](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(e){return this[ht]?(e?this.emit("error",e):this.emit(ht),this):(this[ht]=!0,this.buffer.length=0,this[Qe]=0,typeof this.close=="function"&&!this[xc]&&this.close(),e?this.emit("error",e):this.emit(ht),this)}static isStream(e){return!!e&&(e instanceof XS||e instanceof VS||e instanceof j6&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var om=A(Ft=>{"use strict";var Kp=require("assert"),wn=require("buffer").Buffer,rA=require("zlib"),ri=Ft.constants=GS(),z6=Gp(),eA=wn.concat,ni=Symbol("_superWrite"),xs=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"}},V6=Symbol("opts"),ta=Symbol("flushFlag"),tA=Symbol("finishFlushFlag"),sm=Symbol("fullFlushFlag"),Pe=Symbol("handle"),Cc=Symbol("onError"),ws=Symbol("sawError"),zp=Symbol("level"),Vp=Symbol("strategy"),Wp=Symbol("ended"),OW=Symbol("_defaultFullFlush"),Rc=class extends z6{constructor(e,r){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[ws]=!1,this[Wp]=!1,this[V6]=e,this[ta]=e.flush,this[tA]=e.finishFlush;try{this[Pe]=new rA[r](e)}catch(n){throw new xs(n)}this[Cc]=n=>{this[ws]||(this[ws]=!0,this.close(),this.emit("error",n))},this[Pe].on("error",n=>this[Cc](new xs(n))),this.once("end",()=>this.close)}close(){this[Pe]&&(this[Pe].close(),this[Pe]=null,this.emit("close"))}reset(){if(!this[ws])return Kp(this[Pe],"zlib binding closed"),this[Pe].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[sm]),this.write(Object.assign(wn.alloc(0),{[ta]:e})))}end(e,r,n){return e&&this.write(e,r),this.flush(this[tA]),this[Wp]=!0,super.end(null,null,n)}get ended(){return this[Wp]}write(e,r,n){if(typeof r=="function"&&(n=r,r="utf8"),typeof e=="string"&&(e=wn.from(e,r)),this[ws])return;Kp(this[Pe],"zlib binding closed");let i=this[Pe]._handle,s=i.close;i.close=()=>{};let o=this[Pe].close;this[Pe].close=()=>{},wn.concat=c=>c;let a;try{let c=typeof e[ta]=="number"?e[ta]:this[ta];a=this[Pe]._processChunk(e,c),wn.concat=eA}catch(c){wn.concat=eA,this[Cc](new xs(c))}finally{this[Pe]&&(this[Pe]._handle=i,i.close=s,this[Pe].close=o,this[Pe].removeAllListeners("error"))}this[Pe]&&this[Pe].on("error",c=>this[Cc](new xs(c)));let u;if(a)if(Array.isArray(a)&&a.length>0){u=this[ni](wn.from(a[0]));for(let c=1;c<a.length;c++)u=this[ni](a[c])}else u=this[ni](wn.from(a));return n&&n(),u}[ni](e){return super.write(e)}},Yr=class extends Rc{constructor(e,r){e=e||{},e.flush=e.flush||ri.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ri.Z_FINISH,super(e,r),this[sm]=ri.Z_FULL_FLUSH,this[zp]=e.level,this[Vp]=e.strategy}params(e,r){if(!this[ws]){if(!this[Pe])throw new Error("cannot switch params when binding is closed");if(!this[Pe].params)throw new Error("not supported in this implementation");if(this[zp]!==e||this[Vp]!==r){this.flush(ri.Z_SYNC_FLUSH),Kp(this[Pe],"zlib binding closed");let n=this[Pe].flush;this[Pe].flush=(i,s)=>{this.flush(i),s()};try{this[Pe].params(e,r)}finally{this[Pe].flush=n}this[Pe]&&(this[zp]=e,this[Vp]=r)}}}},Zp=class extends Yr{constructor(e){super(e,"Deflate")}},Jp=class extends Yr{constructor(e){super(e,"Inflate")}},Yp=Symbol("_portable"),Xp=class extends Yr{constructor(e){super(e,"Gzip"),this[Yp]=e&&!!e.portable}[ni](e){return this[Yp]?(this[Yp]=!1,e[9]=255,super[ni](e)):super[ni](e)}},Qp=class extends Yr{constructor(e){super(e,"Gunzip")}},em=class extends Yr{constructor(e){super(e,"DeflateRaw")}},tm=class extends Yr{constructor(e){super(e,"InflateRaw")}},rm=class extends Yr{constructor(e){super(e,"Unzip")}},kc=class extends Rc{constructor(e,r){e=e||{},e.flush=e.flush||ri.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ri.BROTLI_OPERATION_FINISH,super(e,r),this[sm]=ri.BROTLI_OPERATION_FLUSH}},nm=class extends kc{constructor(e){super(e,"BrotliCompress")}},im=class extends kc{constructor(e){super(e,"BrotliDecompress")}};Ft.Deflate=Zp;Ft.Inflate=Jp;Ft.Gzip=Xp;Ft.Gunzip=Qp;Ft.DeflateRaw=em;Ft.InflateRaw=tm;Ft.Unzip=rm;typeof rA.BrotliCompress=="function"?(Ft.BrotliCompress=nm,Ft.BrotliDecompress=im):Ft.BrotliCompress=Ft.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var Ss=A((IW,nA)=>{var W6=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;nA.exports=W6!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")});var Tc=A((BW,iA)=>{"use strict";var Y6=Ec(),am=Ss(),um=Symbol("slurp");iA.exports=class extends Y6{constructor(e,r,n){switch(super(),this.pause(),this.extended=r,this.globalExtended=n,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=am(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=am(e.linkpath),this.uname=e.uname,this.gname=e.gname,r&&this[um](r),n&&this[um](n,!0)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");let n=this.remain,i=this.blockRemain;return this.remain=Math.max(0,n-r),this.blockRemain=Math.max(0,i-r),this.ignore?!0:n>=r?super.write(e):super.write(e.slice(0,n))}[um](e,r){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(r&&n==="path")&&(this[n]=n==="path"||n==="linkpath"?am(e[n]):e[n])}}});var cm=A(Oc=>{"use strict";Oc.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"]]);Oc.code=new Map(Array.from(Oc.name).map(t=>[t[1],t[0]]))});var uA=A((MW,aA)=>{"use strict";var K6=(t,e)=>{if(Number.isSafeInteger(t))t<0?J6(t,e):Z6(t,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Z6=(t,e)=>{e[0]=128;for(var r=e.length;r>1;r--)e[r-1]=t&255,t=Math.floor(t/256)},J6=(t,e)=>{e[0]=255;var r=!1;t=t*-1;for(var n=e.length;n>1;n--){var i=t&255;t=Math.floor(t/256),r?e[n-1]=sA(i):i===0?e[n-1]=0:(r=!0,e[n-1]=oA(i))}},X6=t=>{let e=t[0],r=e===128?e8(t.slice(1,t.length)):e===255?Q6(t):null;if(r===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(r))throw Error("parsed number outside of javascript safe integer range");return r},Q6=t=>{for(var e=t.length,r=0,n=!1,i=e-1;i>-1;i--){var s=t[i],o;n?o=sA(s):s===0?o=s:(n=!0,o=oA(s)),o!==0&&(r-=o*Math.pow(256,e-i-1))}return r},e8=t=>{for(var e=t.length,r=0,n=e-1;n>-1;n--){var i=t[n];i!==0&&(r+=i*Math.pow(256,e-n-1))}return r},sA=t=>(255^t)&255,oA=t=>(255^t)+1&255;aA.exports={encode:K6,parse:X6}});var Ds=A((jW,lA)=>{"use strict";var lm=cm(),As=require("path").posix,cA=uA(),hm=Symbol("slurp"),Pt=Symbol("type"),pm=class{constructor(e,r,n,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[Pt]="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,r||0,n,i):e&&this.set(e)}decode(e,r,n,i){if(r||(r=0),!e||!(e.length>=r+512))throw new Error("need 512 bytes for header");if(this.path=ii(e,r,100),this.mode=xn(e,r+100,8),this.uid=xn(e,r+108,8),this.gid=xn(e,r+116,8),this.size=xn(e,r+124,12),this.mtime=fm(e,r+136,12),this.cksum=xn(e,r+148,12),this[hm](n),this[hm](i,!0),this[Pt]=ii(e,r+156,1),this[Pt]===""&&(this[Pt]="0"),this[Pt]==="0"&&this.path.slice(-1)==="/"&&(this[Pt]="5"),this[Pt]==="5"&&(this.size=0),this.linkpath=ii(e,r+157,100),e.slice(r+257,r+265).toString()==="ustar\x0000")if(this.uname=ii(e,r+265,32),this.gname=ii(e,r+297,32),this.devmaj=xn(e,r+329,8),this.devmin=xn(e,r+337,8),e[r+475]!==0){let o=ii(e,r+345,155);this.path=o+"/"+this.path}else{let o=ii(e,r+345,130);o&&(this.path=o+"/"+this.path),this.atime=fm(e,r+476,12),this.ctime=fm(e,r+488,12)}let s=8*32;for(let o=r;o<r+148;o++)s+=e[o];for(let o=r+156;o<r+512;o++)s+=e[o];this.cksumValid=s===this.cksum,this.cksum===null&&s===8*32&&(this.nullBlock=!0)}[hm](e,r){for(let n in e)e[n]!==null&&e[n]!==void 0&&!(r&&n==="path")&&(this[n]=e[n])}encode(e,r){if(e||(e=this.block=Buffer.alloc(512),r=0),r||(r=0),!(e.length>=r+512))throw new Error("need 512 bytes for header");let n=this.ctime||this.atime?130:155,i=t8(this.path||"",n),s=i[0],o=i[1];this.needPax=i[2],this.needPax=si(e,r,100,s)||this.needPax,this.needPax=Sn(e,r+100,8,this.mode)||this.needPax,this.needPax=Sn(e,r+108,8,this.uid)||this.needPax,this.needPax=Sn(e,r+116,8,this.gid)||this.needPax,this.needPax=Sn(e,r+124,12,this.size)||this.needPax,this.needPax=dm(e,r+136,12,this.mtime)||this.needPax,e[r+156]=this[Pt].charCodeAt(0),this.needPax=si(e,r+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",r+257,8),this.needPax=si(e,r+265,32,this.uname)||this.needPax,this.needPax=si(e,r+297,32,this.gname)||this.needPax,this.needPax=Sn(e,r+329,8,this.devmaj)||this.needPax,this.needPax=Sn(e,r+337,8,this.devmin)||this.needPax,this.needPax=si(e,r+345,n,o)||this.needPax,e[r+475]!==0?this.needPax=si(e,r+345,155,o)||this.needPax:(this.needPax=si(e,r+345,130,o)||this.needPax,this.needPax=dm(e,r+476,12,this.atime)||this.needPax,this.needPax=dm(e,r+488,12,this.ctime)||this.needPax);let a=8*32;for(let u=r;u<r+148;u++)a+=e[u];for(let u=r+156;u<r+512;u++)a+=e[u];return this.cksum=a,Sn(e,r+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let r in e)e[r]!==null&&e[r]!==void 0&&(this[r]=e[r])}get type(){return lm.name.get(this[Pt])||this[Pt]}get typeKey(){return this[Pt]}set type(e){lm.code.has(e)?this[Pt]=lm.code.get(e):this[Pt]=e}},t8=(t,e)=>{let n=t,i="",s,o=As.parse(t).root||".";if(Buffer.byteLength(n)<100)s=[n,i,!1];else{i=As.dirname(n),n=As.basename(n);do Buffer.byteLength(n)<=100&&Buffer.byteLength(i)<=e?s=[n,i,!1]:Buffer.byteLength(n)>100&&Buffer.byteLength(i)<=e?s=[n.slice(0,100-1),i,!0]:(n=As.join(As.basename(i),n),i=As.dirname(i));while(i!==o&&!s);s||(s=[t.slice(0,100-1),"",!0])}return s},ii=(t,e,r)=>t.slice(e,e+r).toString("utf8").replace(/\0.*/,""),fm=(t,e,r)=>r8(xn(t,e,r)),r8=t=>t===null?null:new Date(t*1e3),xn=(t,e,r)=>t[e]&128?cA.parse(t.slice(e,e+r)):i8(t,e,r),n8=t=>isNaN(t)?null:t,i8=(t,e,r)=>n8(parseInt(t.slice(e,e+r).toString("utf8").replace(/\0.*$/,"").trim(),8)),s8={12:8589934591,8:2097151},Sn=(t,e,r,n)=>n===null?!1:n>s8[r]||n<0?(cA.encode(n,t.slice(e,e+r)),!0):(o8(t,e,r,n),!1),o8=(t,e,r,n)=>t.write(a8(n,r),e,r,"ascii"),a8=(t,e)=>u8(Math.floor(t).toString(8),e),u8=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join("0")+t+" ")+"\0",dm=(t,e,r,n)=>n===null?!1:Sn(t,e,r,n.getTime()/1e3),c8=new Array(156).join("\0"),si=(t,e,r,n)=>n===null?!1:(t.write(n+c8,e,r,"utf8"),n.length!==Buffer.byteLength(n)||n.length>r);lA.exports=pm});var Fc=A((qW,hA)=>{"use strict";var l8=Ds(),h8=require("path"),ra=class{constructor(e,r){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=r||!1}encode(){let e=this.encodeBody();if(e==="")return null;let r=Buffer.byteLength(e),n=512*Math.ceil(1+r/512),i=Buffer.allocUnsafe(n);for(let s=0;s<512;s++)i[s]=0;new l8({path:("PaxHeader/"+h8.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,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,r,"utf8");for(let s=r+512;s<i.length;s++)i[s]=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 r=this[e]instanceof Date?this[e].getTime()/1e3:this[e],n=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+r+`
|
|
24
|
+
`,i=Buffer.byteLength(n),s=Math.floor(Math.log(i)/Math.log(10))+1;return i+s>=Math.pow(10,s)&&(s+=1),s+i+n}};ra.parse=(t,e,r)=>new ra(f8(d8(t),e),r);var f8=(t,e)=>e?Object.keys(t).reduce((r,n)=>(r[n]=t[n],r),e):t,d8=t=>t.replace(/\n$/,"").split(`
|
|
25
|
+
`).reduce(p8,Object.create(null)),p8=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.slice((r+" ").length);let n=e.split("="),i=n.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return t;let s=n.join("=");return t[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s,t};hA.exports=ra});var Cs=A((UW,fA)=>{fA.exports=t=>{let e=t.length-1,r=-1;for(;e>-1&&t.charAt(e)==="/";)r=e,e--;return r===-1?t:t.slice(0,r)}});var Pc=A((HW,dA)=>{"use strict";dA.exports=t=>class extends t{warn(e,r,n={}){this.file&&(n.file=this.file),this.cwd&&(n.cwd=this.cwd),n.code=r instanceof Error&&r.code||e,n.tarCode=e,!this.strict&&n.recoverable!==!1?(r instanceof Error&&(n=Object.assign(r,n),r=r.message),this.emit("warn",n.tarCode,r,n)):r instanceof Error?this.emit("error",Object.assign(r,n)):this.emit("error",Object.assign(new Error(`${e}: ${r}`),n))}}});var ym=A((GW,pA)=>{"use strict";var Ic=["|","<",">","?",":"],mm=Ic.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),m8=new Map(Ic.map((t,e)=>[t,mm[e]])),y8=new Map(mm.map((t,e)=>[t,Ic[e]]));pA.exports={encode:t=>Ic.reduce((e,r)=>e.split(r).join(m8.get(r)),t),decode:t=>mm.reduce((e,r)=>e.split(r).join(y8.get(r)),t)}});var gm=A((zW,yA)=>{var{isAbsolute:g8,parse:mA}=require("path").win32;yA.exports=t=>{let e="",r=mA(t);for(;g8(t)||r.root;){let n=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":r.root;t=t.slice(n.length),e+=n,r=mA(t)}return[e,t]}});var _A=A((VW,gA)=>{"use strict";gA.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var Cm=A((KW,FA)=>{"use strict";var AA=Ec(),DA=Fc(),CA=Ds(),xr=require("fs"),bA=require("path"),wr=Ss(),_8=Cs(),RA=(t,e)=>e?(t=wr(t).replace(/^\.(\/|$)/,""),_8(e)+"/"+t):wr(t),b8=16*1024*1024,vA=Symbol("process"),EA=Symbol("file"),wA=Symbol("directory"),bm=Symbol("symlink"),xA=Symbol("hardlink"),na=Symbol("header"),Lc=Symbol("read"),vm=Symbol("lstat"),Bc=Symbol("onlstat"),Em=Symbol("onread"),wm=Symbol("onreadlink"),xm=Symbol("openfile"),Sm=Symbol("onopenfile"),An=Symbol("close"),Nc=Symbol("mode"),Am=Symbol("awaitDrain"),_m=Symbol("ondrain"),Sr=Symbol("prefix"),SA=Symbol("hadError"),kA=Pc(),v8=ym(),TA=gm(),OA=_A(),Mc=kA(class extends AA{constructor(e,r){if(r=r||{},super(r),typeof e!="string")throw new TypeError("path is required");this.path=wr(e),this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||b8,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=wr(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,this.prefix=r.prefix?wr(r.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 r.onwarn=="function"&&this.on("warn",r.onwarn);let n=!1;if(!this.preservePaths){let[i,s]=TA(this.path);i&&(this.path=s,n=i)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=v8.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=wr(r.absolute||bA.resolve(this.cwd,e)),this.path===""&&(this.path="./"),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.statCache.has(this.absolute)?this[Bc](this.statCache.get(this.absolute)):this[vm]()}emit(e,...r){return e==="error"&&(this[SA]=!0),super.emit(e,...r)}[vm](){xr.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[Bc](r)})}[Bc](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=w8(e),this.emit("stat",e),this[vA]()}[vA](){switch(this.type){case"File":return this[EA]();case"Directory":return this[wA]();case"SymbolicLink":return this[bm]();default:return this.end()}}[Nc](e){return OA(e,this.type==="Directory",this.portable)}[Sr](e){return RA(e,this.prefix)}[na](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new CA({path:this[Sr](this.path),linkpath:this.type==="Link"?this[Sr](this.linkpath):this.linkpath,mode:this[Nc](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 DA({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[Sr](this.path),linkpath:this.type==="Link"?this[Sr](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)}[wA](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[na](),this.end()}[bm](){xr.readlink(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[wm](r)})}[wm](e){this.linkpath=wr(e),this[na](),this.end()}[xA](e){this.type="Link",this.linkpath=wr(bA.relative(this.cwd,e)),this.stat.size=0,this[na](),this.end()}[EA](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let r=this.linkCache.get(e);if(r.indexOf(this.cwd)===0)return this[xA](r)}this.linkCache.set(e,this.absolute)}if(this[na](),this.stat.size===0)return this.end();this[xm]()}[xm](){xr.open(this.absolute,"r",(e,r)=>{if(e)return this.emit("error",e);this[Sm](r)})}[Sm](e){if(this.fd=e,this[SA])return this[An]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let r=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(r),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Lc]()}[Lc](){let{fd:e,buf:r,offset:n,length:i,pos:s}=this;xr.read(e,r,n,i,s,(o,a)=>{if(o)return this[An](()=>this.emit("error",o));this[Em](a)})}[An](e){xr.close(this.fd,e)}[Em](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[An](()=>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[An](()=>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 r=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(r)?this[_m]():this[Am](()=>this[_m]())}[Am](e){this.once("drain",e)}write(e){if(this.blockRemain<e.length){let r=new Error("writing more data than expected");return r.path=this.absolute,this.emit("error",r)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[_m](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[An](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[Lc]()}}),Dm=class extends Mc{[vm](){this[Bc](xr.lstatSync(this.absolute))}[bm](){this[wm](xr.readlinkSync(this.absolute))}[xm](){this[Sm](xr.openSync(this.absolute,"r"))}[Lc](){let e=!0;try{let{fd:r,buf:n,offset:i,length:s,pos:o}=this,a=xr.readSync(r,n,i,s,o);this[Em](a),e=!1}finally{if(e)try{this[An](()=>{})}catch{}}}[Am](e){e()}[An](e){xr.closeSync(this.fd),e()}},E8=kA(class extends AA{constructor(e,r){r=r||{},super(r),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=r.prefix||null,this.path=wr(e.path),this.mode=this[Nc](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:r.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=wr(e.linkpath),typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let n=!1;if(!this.preservePaths){let[i,s]=TA(this.path);i&&(this.path=s,n=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new CA({path:this[Sr](this.path),linkpath:this.type==="Link"?this[Sr](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}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new DA({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[Sr](this.path),linkpath:this.type==="Link"?this[Sr](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)}[Sr](e){return RA(e,this.prefix)}[Nc](e){return OA(e,this.type==="Directory",this.portable)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});Mc.Sync=Dm;Mc.Tar=E8;var w8=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";FA.exports=Mc});var IA=A((ZW,PA)=>{"use strict";PA.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var Rm=A((JW,LA)=>{"use strict";LA.exports=Ce;Ce.Node=oi;Ce.create=Ce;function Ce(t){var e=this;if(e instanceof Ce||(e=new Ce),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)e.push(arguments[r]);return e}Ce.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};Ce.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};Ce.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};Ce.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)S8(this,arguments[t]);return this.length};Ce.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)A8(this,arguments[t]);return this.length};Ce.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};Ce.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};Ce.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;r!==null;n++)t.call(e,r.value,n,this),r=r.next};Ce.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;r!==null;n--)t.call(e,r.value,n,this),r=r.prev};Ce.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};Ce.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};Ce.prototype.map=function(t,e){e=e||this;for(var r=new Ce,n=this.head;n!==null;)r.push(t.call(e,n.value,this)),n=n.next;return r};Ce.prototype.mapReverse=function(t,e){e=e||this;for(var r=new Ce,n=this.tail;n!==null;)r.push(t.call(e,n.value,this)),n=n.prev;return r};Ce.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};Ce.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};Ce.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};Ce.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};Ce.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Ce;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(;i!==null&&n<e;n++,i=i.next)r.push(i.value);return r};Ce.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Ce;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};Ce.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(var s=[],n=0;i&&n<e;n++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=x8(this,i,r[n]);return s};Ce.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};function x8(t,e,r){var n=e===t.head?new oi(r,null,e,t):new oi(r,e,e.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function S8(t,e){t.tail=new oi(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function A8(t,e){t.head=new oi(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function oi(t,e,r,n){if(!(this instanceof oi))return new oi(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{IA()(Ce)}catch{}});var Wc=A((QW,HA)=>{"use strict";var zc=class{constructor(e,r){this.path=e||"./",this.absolute=r,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},D8=Ec(),C8=om(),R8=Tc(),Nm=Cm(),k8=Nm.Sync,T8=Nm.Tar,O8=Rm(),BA=Buffer.alloc(1024),Uc=Symbol("onStat"),jc=Symbol("ended"),Ar=Symbol("queue"),Rs=Symbol("current"),ai=Symbol("process"),qc=Symbol("processing"),NA=Symbol("processJob"),Dr=Symbol("jobs"),km=Symbol("jobDone"),Hc=Symbol("addFSEntry"),MA=Symbol("addTarEntry"),Pm=Symbol("stat"),Im=Symbol("readdir"),$c=Symbol("onreaddir"),Gc=Symbol("pipe"),jA=Symbol("entry"),Tm=Symbol("entryOpt"),Lm=Symbol("writeEntryClass"),UA=Symbol("write"),Om=Symbol("ondrain"),Vc=require("fs"),qA=require("path"),F8=Pc(),Fm=Ss(),Mm=F8(class extends D8{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=Fm(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[Lm]=Nm,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 C8.Gzip(e.gzip),this.zip.on("data",r=>super.write(r)),this.zip.on("end",r=>super.end()),this.zip.on("drain",r=>this[Om]()),this.on("resume",r=>this.zip.resume())):this.on("drain",this[Om]),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:r=>!0,this[Ar]=new O8,this[Dr]=0,this.jobs=+e.jobs||4,this[qc]=!1,this[jc]=!1}[UA](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[jc]=!0,this[ai](),this}write(e){if(this[jc])throw new Error("write after end");return e instanceof R8?this[MA](e):this[Hc](e),this.flowing}[MA](e){let r=Fm(qA.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let n=new zc(e.path,r,!1);n.entry=new T8(e,this[Tm](n)),n.entry.on("end",i=>this[km](n)),this[Dr]+=1,this[Ar].push(n)}this[ai]()}[Hc](e){let r=Fm(qA.resolve(this.cwd,e));this[Ar].push(new zc(e,r)),this[ai]()}[Pm](e){e.pending=!0,this[Dr]+=1;let r=this.follow?"stat":"lstat";Vc[r](e.absolute,(n,i)=>{e.pending=!1,this[Dr]-=1,n?this.emit("error",n):this[Uc](e,i)})}[Uc](e,r){this.statCache.set(e.absolute,r),e.stat=r,this.filter(e.path,r)||(e.ignore=!0),this[ai]()}[Im](e){e.pending=!0,this[Dr]+=1,Vc.readdir(e.absolute,(r,n)=>{if(e.pending=!1,this[Dr]-=1,r)return this.emit("error",r);this[$c](e,n)})}[$c](e,r){this.readdirCache.set(e.absolute,r),e.readdir=r,this[ai]()}[ai](){if(!this[qc]){this[qc]=!0;for(let e=this[Ar].head;e!==null&&this[Dr]<this.jobs;e=e.next)if(this[NA](e.value),e.value.ignore){let r=e.next;this[Ar].removeNode(e),e.next=r}this[qc]=!1,this[jc]&&!this[Ar].length&&this[Dr]===0&&(this.zip?this.zip.end(BA):(super.write(BA),super.end()))}}get[Rs](){return this[Ar]&&this[Ar].head&&this[Ar].head.value}[km](e){this[Ar].shift(),this[Dr]-=1,this[ai]()}[NA](e){if(!e.pending){if(e.entry){e===this[Rs]&&!e.piped&&this[Gc](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[Uc](e,this.statCache.get(e.absolute)):this[Pm](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[$c](e,this.readdirCache.get(e.absolute)):this[Im](e),!e.readdir))){if(e.entry=this[jA](e),!e.entry){e.ignore=!0;return}e===this[Rs]&&!e.piped&&this[Gc](e)}}}[Tm](e){return{onwarn:(r,n,i)=>this.warn(r,n,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}}[jA](e){this[Dr]+=1;try{return new this[Lm](e.path,this[Tm](e)).on("end",()=>this[km](e)).on("error",r=>this.emit("error",r))}catch(r){this.emit("error",r)}}[Om](){this[Rs]&&this[Rs].entry&&this[Rs].entry.resume()}[Gc](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let s=e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[Hc](o+i)});let r=e.entry,n=this.zip;n?r.on("data",i=>{n.write(i)||r.pause()}):r.on("data",i=>{super.write(i)||r.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),Bm=class extends Mm{constructor(e){super(e),this[Lm]=k8}pause(){}resume(){}[Pm](e){let r=this.follow?"statSync":"lstatSync";this[Uc](e,Vc[r](e.absolute))}[Im](e,r){this[$c](e,Vc.readdirSync(e.absolute))}[Gc](e){let r=e.entry,n=this.zip;e.readdir&&e.readdir.forEach(i=>{let s=e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[Hc](o+i)}),n?r.on("data",i=>{n.write(i)}):r.on("data",i=>{super[UA](i)})}};Mm.Sync=Bm;HA.exports=Mm});var Bs=A(sa=>{"use strict";var P8=Gp(),I8=require("events").EventEmitter,At=require("fs"),Um=At.writev;if(!Um){let t=process.binding("fs"),e=t.FSReqWrap||t.FSReqCallback;Um=(r,n,i,s)=>{let o=(u,c)=>s(u,c,n),a=new e;a.oncomplete=o,t.writeBuffers(r,n,i,a)}}var Is=Symbol("_autoClose"),or=Symbol("_close"),ia=Symbol("_ended"),Oe=Symbol("_fd"),$A=Symbol("_finished"),Cn=Symbol("_flags"),jm=Symbol("_flush"),Hm=Symbol("_handleChunk"),$m=Symbol("_makeBuf"),Xc=Symbol("_mode"),Yc=Symbol("_needDrain"),Fs=Symbol("_onerror"),Ls=Symbol("_onopen"),qm=Symbol("_onread"),Ts=Symbol("_onwrite"),Rn=Symbol("_open"),Kr=Symbol("_path"),ui=Symbol("_pos"),Cr=Symbol("_queue"),Os=Symbol("_read"),GA=Symbol("_readSize"),Dn=Symbol("_reading"),Kc=Symbol("_remain"),zA=Symbol("_size"),Zc=Symbol("_write"),ks=Symbol("_writing"),Jc=Symbol("_defaultFlag"),Ps=Symbol("_errored"),Qc=class extends P8{constructor(e,r){if(r=r||{},super(r),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Ps]=!1,this[Oe]=typeof r.fd=="number"?r.fd:null,this[Kr]=e,this[GA]=r.readSize||16*1024*1024,this[Dn]=!1,this[zA]=typeof r.size=="number"?r.size:1/0,this[Kc]=this[zA],this[Is]=typeof r.autoClose=="boolean"?r.autoClose:!0,typeof this[Oe]=="number"?this[Os]():this[Rn]()}get fd(){return this[Oe]}get path(){return this[Kr]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Rn](){At.open(this[Kr],"r",(e,r)=>this[Ls](e,r))}[Ls](e,r){e?this[Fs](e):(this[Oe]=r,this.emit("open",r),this[Os]())}[$m](){return Buffer.allocUnsafe(Math.min(this[GA],this[Kc]))}[Os](){if(!this[Dn]){this[Dn]=!0;let e=this[$m]();if(e.length===0)return process.nextTick(()=>this[qm](null,0,e));At.read(this[Oe],e,0,e.length,null,(r,n,i)=>this[qm](r,n,i))}}[qm](e,r,n){this[Dn]=!1,e?this[Fs](e):this[Hm](r,n)&&this[Os]()}[or](){if(this[Is]&&typeof this[Oe]=="number"){let e=this[Oe];this[Oe]=null,At.close(e,r=>r?this.emit("error",r):this.emit("close"))}}[Fs](e){this[Dn]=!0,this[or](),this.emit("error",e)}[Hm](e,r){let n=!1;return this[Kc]-=e,e>0&&(n=super.write(e<r.length?r.slice(0,e):r)),(e===0||this[Kc]<=0)&&(n=!1,this[or](),super.end()),n}emit(e,r){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[Oe]=="number"&&this[Os]();break;case"error":return this[Ps]?void 0:(this[Ps]=!0,super.emit(e,r));default:return super.emit(e,r)}}},Gm=class extends Qc{[Rn](){let e=!0;try{this[Ls](null,At.openSync(this[Kr],"r")),e=!1}finally{e&&this[or]()}}[Os](){let e=!0;try{if(!this[Dn]){this[Dn]=!0;do{let r=this[$m](),n=r.length===0?0:At.readSync(this[Oe],r,0,r.length,null);if(!this[Hm](n,r))break}while(!0);this[Dn]=!1}e=!1}finally{e&&this[or]()}}[or](){if(this[Is]&&typeof this[Oe]=="number"){let e=this[Oe];this[Oe]=null,At.closeSync(e),this.emit("close")}}},el=class extends I8{constructor(e,r){r=r||{},super(r),this.readable=!1,this.writable=!0,this[Ps]=!1,this[ks]=!1,this[ia]=!1,this[Yc]=!1,this[Cr]=[],this[Kr]=e,this[Oe]=typeof r.fd=="number"?r.fd:null,this[Xc]=r.mode===void 0?438:r.mode,this[ui]=typeof r.start=="number"?r.start:null,this[Is]=typeof r.autoClose=="boolean"?r.autoClose:!0;let n=this[ui]!==null?"r+":"w";this[Jc]=r.flags===void 0,this[Cn]=this[Jc]?n:r.flags,this[Oe]===null&&this[Rn]()}emit(e,r){if(e==="error"){if(this[Ps])return;this[Ps]=!0}return super.emit(e,r)}get fd(){return this[Oe]}get path(){return this[Kr]}[Fs](e){this[or](),this[ks]=!0,this.emit("error",e)}[Rn](){At.open(this[Kr],this[Cn],this[Xc],(e,r)=>this[Ls](e,r))}[Ls](e,r){this[Jc]&&this[Cn]==="r+"&&e&&e.code==="ENOENT"?(this[Cn]="w",this[Rn]()):e?this[Fs](e):(this[Oe]=r,this.emit("open",r),this[jm]())}end(e,r){return e&&this.write(e,r),this[ia]=!0,!this[ks]&&!this[Cr].length&&typeof this[Oe]=="number"&&this[Ts](null,0),this}write(e,r){return typeof e=="string"&&(e=Buffer.from(e,r)),this[ia]?(this.emit("error",new Error("write() after end()")),!1):this[Oe]===null||this[ks]||this[Cr].length?(this[Cr].push(e),this[Yc]=!0,!1):(this[ks]=!0,this[Zc](e),!0)}[Zc](e){At.write(this[Oe],e,0,e.length,this[ui],(r,n)=>this[Ts](r,n))}[Ts](e,r){e?this[Fs](e):(this[ui]!==null&&(this[ui]+=r),this[Cr].length?this[jm]():(this[ks]=!1,this[ia]&&!this[$A]?(this[$A]=!0,this[or](),this.emit("finish")):this[Yc]&&(this[Yc]=!1,this.emit("drain"))))}[jm](){if(this[Cr].length===0)this[ia]&&this[Ts](null,0);else if(this[Cr].length===1)this[Zc](this[Cr].pop());else{let e=this[Cr];this[Cr]=[],Um(this[Oe],e,this[ui],(r,n)=>this[Ts](r,n))}}[or](){if(this[Is]&&typeof this[Oe]=="number"){let e=this[Oe];this[Oe]=null,At.close(e,r=>r?this.emit("error",r):this.emit("close"))}}},zm=class extends el{[Rn](){let e;if(this[Jc]&&this[Cn]==="r+")try{e=At.openSync(this[Kr],this[Cn],this[Xc])}catch(r){if(r.code==="ENOENT")return this[Cn]="w",this[Rn]();throw r}else e=At.openSync(this[Kr],this[Cn],this[Xc]);this[Ls](null,e)}[or](){if(this[Is]&&typeof this[Oe]=="number"){let e=this[Oe];this[Oe]=null,At.closeSync(e),this.emit("close")}}[Zc](e){let r=!0;try{this[Ts](null,At.writeSync(this[Oe],e,0,e.length,this[ui])),r=!1}finally{if(r)try{this[or]()}catch{}}}};sa.ReadStream=Qc;sa.ReadStreamSync=Gm;sa.WriteStream=el;sa.WriteStreamSync=zm});var al=A((rY,QA)=>{"use strict";var L8=Pc(),B8=Ds(),N8=require("events"),M8=Rm(),j8=1024*1024,q8=Tc(),VA=Fc(),U8=om(),{nextTick:H8}=require("process"),Vm=Buffer.from([31,139]),Vt=Symbol("state"),ci=Symbol("writeEntry"),Zr=Symbol("readEntry"),Wm=Symbol("nextEntry"),WA=Symbol("processEntry"),Wt=Symbol("extendedHeader"),oa=Symbol("globalExtendedHeader"),kn=Symbol("meta"),YA=Symbol("emitMeta"),Le=Symbol("buffer"),Jr=Symbol("queue"),li=Symbol("ended"),KA=Symbol("emittedEnd"),hi=Symbol("emit"),Dt=Symbol("unzip"),tl=Symbol("consumeChunk"),rl=Symbol("consumeChunkSub"),Ym=Symbol("consumeBody"),ZA=Symbol("consumeMeta"),JA=Symbol("consumeHeader"),nl=Symbol("consuming"),Km=Symbol("bufferConcat"),Zm=Symbol("maybeEnd"),aa=Symbol("writing"),Tn=Symbol("aborted"),il=Symbol("onDone"),fi=Symbol("sawValidEntry"),sl=Symbol("sawNullBlock"),ol=Symbol("sawEOF"),XA=Symbol("closeStream"),$8=t=>!0;QA.exports=L8(class extends N8{constructor(e){e=e||{},super(e),this.file=e.file||"",this[fi]=null,this.on(il,r=>{(this[Vt]==="begin"||this[fi]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(il,e.ondone):this.on(il,r=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||j8,this.filter=typeof e.filter=="function"?e.filter:$8,this.writable=!0,this.readable=!1,this[Jr]=new M8,this[Le]=null,this[Zr]=null,this[ci]=null,this[Vt]="begin",this[kn]="",this[Wt]=null,this[oa]=null,this[li]=!1,this[Dt]=null,this[Tn]=!1,this[sl]=!1,this[ol]=!1,this.on("end",()=>this[XA]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[JA](e,r){this[fi]===null&&(this[fi]=!1);let n;try{n=new B8(e,r,this[Wt],this[oa])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(n.nullBlock)this[sl]?(this[ol]=!0,this[Vt]==="begin"&&(this[Vt]="header"),this[hi]("eof")):(this[sl]=!0,this[hi]("nullBlock"));else if(this[sl]=!1,!n.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:n});else if(!n.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:n});else{let i=n.type;if(/^(Symbolic)?Link$/.test(i)&&!n.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:n});else if(!/^(Symbolic)?Link$/.test(i)&&n.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:n});else{let s=this[ci]=new q8(n,this[Wt],this[oa]);if(!this[fi])if(s.remain){let o=()=>{s.invalid||(this[fi]=!0)};s.on("end",o)}else this[fi]=!0;s.meta?s.size>this.maxMetaEntrySize?(s.ignore=!0,this[hi]("ignoredEntry",s),this[Vt]="ignore",s.resume()):s.size>0&&(this[kn]="",s.on("data",o=>this[kn]+=o),this[Vt]="meta"):(this[Wt]=null,s.ignore=s.ignore||!this.filter(s.path,s),s.ignore?(this[hi]("ignoredEntry",s),this[Vt]=s.remain?"ignore":"header",s.resume()):(s.remain?this[Vt]="body":(this[Vt]="header",s.end()),this[Zr]?this[Jr].push(s):(this[Jr].push(s),this[Wm]())))}}}[XA](){H8(()=>this.emit("close"))}[WA](e){let r=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Zr]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",n=>this[Wm]()),r=!1)):(this[Zr]=null,r=!1),r}[Wm](){do;while(this[WA](this[Jr].shift()));if(!this[Jr].length){let e=this[Zr];!e||e.flowing||e.size===e.remain?this[aa]||this.emit("drain"):e.once("drain",n=>this.emit("drain"))}}[Ym](e,r){let n=this[ci],i=n.blockRemain,s=i>=e.length&&r===0?e:e.slice(r,r+i);return n.write(s),n.blockRemain||(this[Vt]="header",this[ci]=null,n.end()),s.length}[ZA](e,r){let n=this[ci],i=this[Ym](e,r);return this[ci]||this[YA](n),i}[hi](e,r,n){!this[Jr].length&&!this[Zr]?this.emit(e,r,n):this[Jr].push([e,r,n])}[YA](e){switch(this[hi]("meta",this[kn]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[Wt]=VA.parse(this[kn],this[Wt],!1);break;case"GlobalExtendedHeader":this[oa]=VA.parse(this[kn],this[oa],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[Wt]=this[Wt]||Object.create(null),this[Wt].path=this[kn].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[Wt]=this[Wt]||Object.create(null),this[Wt].linkpath=this[kn].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Tn]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[Tn])return;if(this[Dt]===null&&e){if(this[Le]&&(e=Buffer.concat([this[Le],e]),this[Le]=null),e.length<Vm.length)return this[Le]=e,!0;for(let n=0;this[Dt]===null&&n<Vm.length;n++)e[n]!==Vm[n]&&(this[Dt]=!1);if(this[Dt]===null){let n=this[li];this[li]=!1,this[Dt]=new U8.Unzip,this[Dt].on("data",s=>this[tl](s)),this[Dt].on("error",s=>this.abort(s)),this[Dt].on("end",s=>{this[li]=!0,this[tl]()}),this[aa]=!0;let i=this[Dt][n?"end":"write"](e);return this[aa]=!1,i}}this[aa]=!0,this[Dt]?this[Dt].write(e):this[tl](e),this[aa]=!1;let r=this[Jr].length?!1:this[Zr]?this[Zr].flowing:!0;return!r&&!this[Jr].length&&this[Zr].once("drain",n=>this.emit("drain")),r}[Km](e){e&&!this[Tn]&&(this[Le]=this[Le]?Buffer.concat([this[Le],e]):e)}[Zm](){if(this[li]&&!this[KA]&&!this[Tn]&&!this[nl]){this[KA]=!0;let e=this[ci];if(e&&e.blockRemain){let r=this[Le]?this[Le].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${r} available)`,{entry:e}),this[Le]&&e.write(this[Le]),e.end()}this[hi](il)}}[tl](e){if(this[nl])this[Km](e);else if(!e&&!this[Le])this[Zm]();else{if(this[nl]=!0,this[Le]){this[Km](e);let r=this[Le];this[Le]=null,this[rl](r)}else this[rl](e);for(;this[Le]&&this[Le].length>=512&&!this[Tn]&&!this[ol];){let r=this[Le];this[Le]=null,this[rl](r)}this[nl]=!1}(!this[Le]||this[li])&&this[Zm]()}[rl](e){let r=0,n=e.length;for(;r+512<=n&&!this[Tn]&&!this[ol];)switch(this[Vt]){case"begin":case"header":this[JA](e,r),r+=512;break;case"ignore":case"body":r+=this[Ym](e,r);break;case"meta":r+=this[ZA](e,r);break;default:throw new Error("invalid state: "+this[Vt])}r<n&&(this[Le]?this[Le]=Buffer.concat([e.slice(r),this[Le]]):this[Le]=e.slice(r))}end(e){this[Tn]||(this[Dt]?this[Dt].end(e):(this[li]=!0,this.write(e)))}})});var ul=A((nY,nD)=>{"use strict";var G8=bs(),tD=al(),Ns=require("fs"),z8=Bs(),eD=require("path"),Jm=Cs();nD.exports=(t,e,r)=>{typeof t=="function"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(r=e,e=null),e?e=Array.from(e):e=[];let n=G8(t);if(n.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!n.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return e.length&&W8(n,e),n.noResume||V8(n),n.file&&n.sync?Y8(n):n.file?K8(n,r):rD(n)};var V8=t=>{let e=t.onentry;t.onentry=e?r=>{e(r),r.resume()}:r=>r.resume()},W8=(t,e)=>{let r=new Map(e.map(s=>[Jm(s),!0])),n=t.filter,i=(s,o)=>{let a=o||eD.parse(s).root||".",u=s===a?!1:r.has(s)?r.get(s):i(eD.dirname(s),a);return r.set(s,u),u};t.filter=n?(s,o)=>n(s,o)&&i(Jm(s)):s=>i(Jm(s))},Y8=t=>{let e=rD(t),r=t.file,n=!0,i;try{let s=Ns.statSync(r),o=t.maxReadSize||16*1024*1024;if(s.size<o)e.end(Ns.readFileSync(r));else{let a=0,u=Buffer.allocUnsafe(o);for(i=Ns.openSync(r,"r");a<s.size;){let c=Ns.readSync(i,u,0,o,a);a+=c,e.write(u.slice(0,c))}e.end()}n=!1}finally{if(n&&i)try{Ns.closeSync(i)}catch{}}},K8=(t,e)=>{let r=new tD(t),n=t.maxReadSize||16*1024*1024,i=t.file,s=new Promise((o,a)=>{r.on("error",a),r.on("end",o),Ns.stat(i,(u,c)=>{if(u)a(u);else{let l=new z8.ReadStream(i,{readSize:n,size:c.size});l.on("error",a),l.pipe(r)}})});return e?s.then(e,e):s},rD=t=>new tD(t)});var cD=A((iY,uD)=>{"use strict";var Z8=bs(),cl=Wc(),iD=Bs(),sD=ul(),oD=require("path");uD.exports=(t,e,r)=>{if(typeof e=="function"&&(r=e),Array.isArray(t)&&(e=t,t={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let n=Z8(t);if(n.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!n.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return n.file&&n.sync?J8(n,e):n.file?X8(n,e,r):n.sync?Q8(n,e):e4(n,e)};var J8=(t,e)=>{let r=new cl.Sync(t),n=new iD.WriteStreamSync(t.file,{mode:t.mode||438});r.pipe(n),aD(r,e)},X8=(t,e,r)=>{let n=new cl(t),i=new iD.WriteStream(t.file,{mode:t.mode||438});n.pipe(i);let s=new Promise((o,a)=>{i.on("error",a),i.on("close",o),n.on("error",a)});return Xm(n,e),r?s.then(r,r):s},aD=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?sD({file:oD.resolve(t.cwd,r.slice(1)),sync:!0,noResume:!0,onentry:n=>t.add(n)}):t.add(r)}),t.end()},Xm=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)==="@")return sD({file:oD.resolve(t.cwd,r.slice(1)),noResume:!0,onentry:n=>t.add(n)}).then(n=>Xm(t,e));t.add(r)}t.end()},Q8=(t,e)=>{let r=new cl.Sync(t);return aD(r,e),r},e4=(t,e)=>{let r=new cl(t);return Xm(r,e),r}});var Qm=A((sY,yD)=>{"use strict";var t4=bs(),lD=Wc(),It=require("fs"),hD=Bs(),fD=ul(),dD=require("path"),pD=Ds();yD.exports=(t,e,r)=>{let n=t4(t);if(!n.file)throw new TypeError("file is required");if(n.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),n.sync?r4(n,e):i4(n,e,r)};var r4=(t,e)=>{let r=new lD.Sync(t),n=!0,i,s;try{try{i=It.openSync(t.file,"r+")}catch(u){if(u.code==="ENOENT")i=It.openSync(t.file,"w+");else throw u}let o=It.fstatSync(i),a=Buffer.alloc(512);e:for(s=0;s<o.size;s+=512){for(let l=0,h=0;l<512;l+=h){if(h=It.readSync(i,a,l,a.length-l,s+l),s===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!h)break e}let u=new pD(a);if(!u.cksumValid)break;let c=512*Math.ceil(u.size/512);if(s+c+512>o.size)break;s+=c,t.mtimeCache&&t.mtimeCache.set(u.path,u.mtime)}n=!1,n4(t,r,s,i,e)}finally{if(n)try{It.closeSync(i)}catch{}}},n4=(t,e,r,n,i)=>{let s=new hD.WriteStreamSync(t.file,{fd:n,start:r});e.pipe(s),s4(e,i)},i4=(t,e,r)=>{e=Array.from(e);let n=new lD(t),i=(o,a,u)=>{let c=(m,y)=>{m?It.close(o,p=>u(m)):u(null,y)},l=0;if(a===0)return c(null,0);let h=0,f=Buffer.alloc(512),d=(m,y)=>{if(m)return c(m);if(h+=y,h<512&&y)return It.read(o,f,h,f.length-h,l+h,d);if(l===0&&f[0]===31&&f[1]===139)return c(new Error("cannot append to compressed archives"));if(h<512)return c(null,l);let p=new pD(f);if(!p.cksumValid)return c(null,l);let w=512*Math.ceil(p.size/512);if(l+w+512>a||(l+=w+512,l>=a))return c(null,l);t.mtimeCache&&t.mtimeCache.set(p.path,p.mtime),h=0,It.read(o,f,0,512,l,d)};It.read(o,f,0,512,l,d)},s=new Promise((o,a)=>{n.on("error",a);let u="r+",c=(l,h)=>{if(l&&l.code==="ENOENT"&&u==="r+")return u="w+",It.open(t.file,u,c);if(l)return a(l);It.fstat(h,(f,d)=>{if(f)return It.close(h,()=>a(f));i(h,d.size,(m,y)=>{if(m)return a(m);let p=new hD.WriteStream(t.file,{fd:h,start:y});n.pipe(p),p.on("error",a),p.on("close",o),mD(n,e)})})};It.open(t.file,u,c)});return r?s.then(r,r):s},s4=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?fD({file:dD.resolve(t.cwd,r.slice(1)),sync:!0,noResume:!0,onentry:n=>t.add(n)}):t.add(r)}),t.end()},mD=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)==="@")return fD({file:dD.resolve(t.cwd,r.slice(1)),noResume:!0,onentry:n=>t.add(n)}).then(n=>mD(t,e));t.add(r)}t.end()}});var _D=A((oY,gD)=>{"use strict";var o4=bs(),a4=Qm();gD.exports=(t,e,r)=>{let n=o4(t);if(!n.file)throw new TypeError("file is required");if(n.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),u4(n),a4(n,e,r)};var u4=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(r,n)=>e(r,n)&&!(t.mtimeCache.get(r)>n.mtime):(r,n)=>!(t.mtimeCache.get(r)>n.mtime)}});var ED=A((aY,vD)=>{var{promisify:bD}=require("util"),On=require("fs"),c4=t=>{if(!t)t={mode:511,fs:On};else if(typeof t=="object")t={mode:511,fs:On,...t};else if(typeof t=="number")t={mode:t,fs:On};else if(typeof t=="string")t={mode:parseInt(t,8),fs:On};else throw new TypeError("invalid options argument");return t.mkdir=t.mkdir||t.fs.mkdir||On.mkdir,t.mkdirAsync=bD(t.mkdir),t.stat=t.stat||t.fs.stat||On.stat,t.statAsync=bD(t.stat),t.statSync=t.statSync||t.fs.statSync||On.statSync,t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||On.mkdirSync,t};vD.exports=c4});var xD=A((uY,wD)=>{var l4=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:h4,parse:f4}=require("path"),d4=t=>{if(/\0/.test(t))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_ARG_VALUE"});if(t=h4(t),l4==="win32"){let e=/[*|"<>?:]/,{root:r}=f4(t);if(e.test(t.substr(r.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t};wD.exports=d4});var RD=A((cY,CD)=>{var{dirname:SD}=require("path"),AD=(t,e,r=void 0)=>r===e?Promise.resolve():t.statAsync(e).then(n=>n.isDirectory()?r:void 0,n=>n.code==="ENOENT"?AD(t,SD(e),e):void 0),DD=(t,e,r=void 0)=>{if(r!==e)try{return t.statSync(e).isDirectory()?r:void 0}catch(n){return n.code==="ENOENT"?DD(t,SD(e),e):void 0}};CD.exports={findMade:AD,findMadeSync:DD}});var r0=A((lY,TD)=>{var{dirname:kD}=require("path"),e0=(t,e,r)=>{e.recursive=!1;let n=kD(t);return n===t?e.mkdirAsync(t,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(t,e).then(()=>r||t,i=>{if(i.code==="ENOENT")return e0(n,e).then(s=>e0(t,e,s));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;return e.statAsync(t).then(s=>{if(s.isDirectory())return r;throw i},()=>{throw i})})},t0=(t,e,r)=>{let n=kD(t);if(e.recursive=!1,n===t)try{return e.mkdirSync(t,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(t,e),r||t}catch(i){if(i.code==="ENOENT")return t0(t,e,t0(n,e,r));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(t).isDirectory())throw i}catch{throw i}}};TD.exports={mkdirpManual:e0,mkdirpManualSync:t0}});var PD=A((hY,FD)=>{var{dirname:OD}=require("path"),{findMade:p4,findMadeSync:m4}=RD(),{mkdirpManual:y4,mkdirpManualSync:g4}=r0(),_4=(t,e)=>(e.recursive=!0,OD(t)===t?e.mkdirAsync(t,e):p4(e,t).then(n=>e.mkdirAsync(t,e).then(()=>n).catch(i=>{if(i.code==="ENOENT")return y4(t,e);throw i}))),b4=(t,e)=>{if(e.recursive=!0,OD(t)===t)return e.mkdirSync(t,e);let n=m4(e,t);try{return e.mkdirSync(t,e),n}catch(i){if(i.code==="ENOENT")return g4(t,e);throw i}};FD.exports={mkdirpNative:_4,mkdirpNativeSync:b4}});var ND=A((fY,BD)=>{var ID=require("fs"),v4=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,n0=v4.replace(/^v/,"").split("."),LD=+n0[0]>10||+n0[0]==10&&+n0[1]>=12,E4=LD?t=>t.mkdir===ID.mkdir:()=>!1,w4=LD?t=>t.mkdirSync===ID.mkdirSync:()=>!1;BD.exports={useNative:E4,useNativeSync:w4}});var $D=A((dY,HD)=>{var Ms=ED(),js=xD(),{mkdirpNative:MD,mkdirpNativeSync:jD}=PD(),{mkdirpManual:qD,mkdirpManualSync:UD}=r0(),{useNative:x4,useNativeSync:S4}=ND(),qs=(t,e)=>(t=js(t),e=Ms(e),x4(e)?MD(t,e):qD(t,e)),A4=(t,e)=>(t=js(t),e=Ms(e),S4(e)?jD(t,e):UD(t,e));qs.sync=A4;qs.native=(t,e)=>MD(js(t),Ms(e));qs.manual=(t,e)=>qD(js(t),Ms(e));qs.nativeSync=(t,e)=>jD(js(t),Ms(e));qs.manualSync=(t,e)=>UD(js(t),Ms(e));HD.exports=qs});var ZD=A((pY,KD)=>{"use strict";var Yt=require("fs"),di=require("path"),D4=Yt.lchown?"lchown":"chown",C4=Yt.lchownSync?"lchownSync":"chownSync",zD=Yt.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),GD=(t,e,r)=>{try{return Yt[C4](t,e,r)}catch(n){if(n.code!=="ENOENT")throw n}},R4=(t,e,r)=>{try{return Yt.chownSync(t,e,r)}catch(n){if(n.code!=="ENOENT")throw n}},k4=zD?(t,e,r,n)=>i=>{!i||i.code!=="EISDIR"?n(i):Yt.chown(t,e,r,n)}:(t,e,r,n)=>n,i0=zD?(t,e,r)=>{try{return GD(t,e,r)}catch(n){if(n.code!=="EISDIR")throw n;R4(t,e,r)}}:(t,e,r)=>GD(t,e,r),T4=process.version,VD=(t,e,r)=>Yt.readdir(t,e,r),O4=(t,e)=>Yt.readdirSync(t,e);/^v4\./.test(T4)&&(VD=(t,e,r)=>Yt.readdir(t,r));var ll=(t,e,r,n)=>{Yt[D4](t,e,r,k4(t,e,r,i=>{n(i&&i.code!=="ENOENT"?i:null)}))},WD=(t,e,r,n,i)=>{if(typeof e=="string")return Yt.lstat(di.resolve(t,e),(s,o)=>{if(s)return i(s.code!=="ENOENT"?s:null);o.name=e,WD(t,o,r,n,i)});if(e.isDirectory())s0(di.resolve(t,e.name),r,n,s=>{if(s)return i(s);let o=di.resolve(t,e.name);ll(o,r,n,i)});else{let s=di.resolve(t,e.name);ll(s,r,n,i)}},s0=(t,e,r,n)=>{VD(t,{withFileTypes:!0},(i,s)=>{if(i){if(i.code==="ENOENT")return n();if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return n(i)}if(i||!s.length)return ll(t,e,r,n);let o=s.length,a=null,u=c=>{if(!a){if(c)return n(a=c);if(--o===0)return ll(t,e,r,n)}};s.forEach(c=>WD(t,c,e,r,u))})},F4=(t,e,r,n)=>{if(typeof e=="string")try{let i=Yt.lstatSync(di.resolve(t,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&YD(di.resolve(t,e.name),r,n),i0(di.resolve(t,e.name),r,n)},YD=(t,e,r)=>{let n;try{n=O4(t,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return i0(t,e,r);throw i}return n&&n.length&&n.forEach(i=>F4(t,i,e,r)),i0(t,e,r)};KD.exports=s0;s0.sync=YD});var eC=A((mY,o0)=>{"use strict";var JD=$D(),Kt=require("fs"),hl=require("path"),XD=ZD(),ar=Ss(),fl=class extends Error{constructor(e,r){super("Cannot extract through symbolic link"),this.path=r,this.symlink=e}get name(){return"SylinkError"}},dl=class extends Error{constructor(e,r){super(r+": Cannot cd into '"+e+"'"),this.path=e,this.code=r}get name(){return"CwdError"}},pl=(t,e)=>t.get(ar(e)),ua=(t,e,r)=>t.set(ar(e),r),P4=(t,e)=>{Kt.stat(t,(r,n)=>{(r||!n.isDirectory())&&(r=new dl(t,r&&r.code||"ENOTDIR")),e(r)})};o0.exports=(t,e,r)=>{t=ar(t);let n=e.umask,i=e.mode|448,s=(i&n)!==0,o=e.uid,a=e.gid,u=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,l=e.unlink,h=e.cache,f=ar(e.cwd),d=(p,w)=>{p?r(p):(ua(h,t,!0),w&&u?XD(w,o,a,O=>d(O)):s?Kt.chmod(t,i,r):r())};if(h&&pl(h,t)===!0)return d();if(t===f)return P4(t,d);if(c)return JD(t,{mode:i}).then(p=>d(null,p),d);let y=ar(hl.relative(f,t)).split("/");ml(f,y,i,h,l,f,null,d)};var ml=(t,e,r,n,i,s,o,a)=>{if(!e.length)return a(null,o);let u=e.shift(),c=ar(hl.resolve(t+"/"+u));if(pl(n,c))return ml(c,e,r,n,i,s,o,a);Kt.mkdir(c,r,QD(c,e,r,n,i,s,o,a))},QD=(t,e,r,n,i,s,o,a)=>u=>{u?Kt.lstat(t,(c,l)=>{if(c)c.path=c.path&&ar(c.path),a(c);else if(l.isDirectory())ml(t,e,r,n,i,s,o,a);else if(i)Kt.unlink(t,h=>{if(h)return a(h);Kt.mkdir(t,r,QD(t,e,r,n,i,s,o,a))});else{if(l.isSymbolicLink())return a(new fl(t,t+"/"+e.join("/")));a(u)}}):(o=o||t,ml(t,e,r,n,i,s,o,a))},I4=t=>{let e=!1,r="ENOTDIR";try{e=Kt.statSync(t).isDirectory()}catch(n){r=n.code}finally{if(!e)throw new dl(t,r)}};o0.exports.sync=(t,e)=>{t=ar(t);let r=e.umask,n=e.mode|448,i=(n&r)!==0,s=e.uid,o=e.gid,a=typeof s=="number"&&typeof o=="number"&&(s!==e.processUid||o!==e.processGid),u=e.preserve,c=e.unlink,l=e.cache,h=ar(e.cwd),f=p=>{ua(l,t,!0),p&&a&&XD.sync(p,s,o),i&&Kt.chmodSync(t,n)};if(l&&pl(l,t)===!0)return f();if(t===h)return I4(h),f();if(u)return f(JD.sync(t,n));let m=ar(hl.relative(h,t)).split("/"),y=null;for(let p=m.shift(),w=h;p&&(w+="/"+p);p=m.shift())if(w=ar(hl.resolve(w)),!pl(l,w))try{Kt.mkdirSync(w,n),y=y||w,ua(l,w,!0)}catch{let P=Kt.lstatSync(w);if(P.isDirectory()){ua(l,w,!0);continue}else if(c){Kt.unlinkSync(w),Kt.mkdirSync(w,n),y=y||w,ua(l,w,!0);continue}else if(P.isSymbolicLink())return new fl(w,w+"/"+m.join("/"))}return f(y)}});var u0=A((yY,tC)=>{var a0=Object.create(null),{hasOwnProperty:L4}=Object.prototype;tC.exports=t=>(L4.call(a0,t)||(a0[t]=t.normalize("NFKD")),a0[t])});var sC=A((gY,iC)=>{var rC=require("assert"),B4=u0(),N4=Cs(),{join:nC}=require("path"),M4=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,j4=M4==="win32";iC.exports=()=>{let t=new Map,e=new Map,r=c=>c.split("/").slice(0,-1).reduce((h,f)=>(h.length&&(f=nC(h[h.length-1],f)),h.push(f||"/"),h),[]),n=new Set,i=c=>{let l=e.get(c);if(!l)throw new Error("function does not have any path reservations");return{paths:l.paths.map(h=>t.get(h)),dirs:[...l.dirs].map(h=>t.get(h))}},s=c=>{let{paths:l,dirs:h}=i(c);return l.every(f=>f[0]===c)&&h.every(f=>f[0]instanceof Set&&f[0].has(c))},o=c=>n.has(c)||!s(c)?!1:(n.add(c),c(()=>a(c)),!0),a=c=>{if(!n.has(c))return!1;let{paths:l,dirs:h}=e.get(c),f=new Set;return l.forEach(d=>{let m=t.get(d);rC.equal(m[0],c),m.length===1?t.delete(d):(m.shift(),typeof m[0]=="function"?f.add(m[0]):m[0].forEach(y=>f.add(y)))}),h.forEach(d=>{let m=t.get(d);rC(m[0]instanceof Set),m[0].size===1&&m.length===1?t.delete(d):m[0].size===1?(m.shift(),f.add(m[0])):m[0].delete(c)}),n.delete(c),f.forEach(d=>o(d)),!0};return{check:s,reserve:(c,l)=>{c=j4?["win32 parallelization disabled"]:c.map(f=>B4(N4(nC(f))).toLowerCase());let h=new Set(c.map(f=>r(f)).reduce((f,d)=>f.concat(d)));return e.set(l,{dirs:h,paths:c}),c.forEach(f=>{let d=t.get(f);d?d.push(l):t.set(f,[l])}),h.forEach(f=>{let d=t.get(f);d?d[d.length-1]instanceof Set?d[d.length-1].add(l):d.push(new Set([l])):t.set(f,[new Set([l])])}),o(l)}}}});var uC=A((_Y,aC)=>{var q4=process.env.__FAKE_PLATFORM__||process.platform,U4=q4==="win32",H4=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:$4,O_TRUNC:G4,O_WRONLY:z4,UV_FS_O_FILEMAP:oC=0}=H4.constants,V4=U4&&!!oC,W4=512*1024,Y4=oC|G4|$4|z4;aC.exports=V4?t=>t<W4?Y4:"w":()=>"w"});var g0=A((bY,wC)=>{"use strict";var K4=require("assert"),Z4=al(),Re=require("fs"),J4=Bs(),Xr=require("path"),bC=eC(),cC=ym(),X4=sC(),Q4=gm(),Lt=Ss(),ej=Cs(),tj=u0(),lC=Symbol("onEntry"),h0=Symbol("checkFs"),hC=Symbol("checkFs2"),_l=Symbol("pruneCache"),f0=Symbol("isReusable"),Zt=Symbol("makeFs"),d0=Symbol("file"),p0=Symbol("directory"),bl=Symbol("link"),fC=Symbol("symlink"),dC=Symbol("hardlink"),pC=Symbol("unsupported"),mC=Symbol("checkPath"),Fn=Symbol("mkdir"),ft=Symbol("onError"),yl=Symbol("pending"),yC=Symbol("pend"),Us=Symbol("unpend"),c0=Symbol("ended"),l0=Symbol("maybeClose"),m0=Symbol("skip"),ca=Symbol("doChown"),la=Symbol("uid"),ha=Symbol("gid"),fa=Symbol("checkedCwd"),vC=require("crypto"),EC=uC(),rj=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,da=rj==="win32",nj=(t,e)=>{if(!da)return Re.unlink(t,e);let r=t+".DELETE."+vC.randomBytes(16).toString("hex");Re.rename(t,r,n=>{if(n)return e(n);Re.unlink(r,e)})},ij=t=>{if(!da)return Re.unlinkSync(t);let e=t+".DELETE."+vC.randomBytes(16).toString("hex");Re.renameSync(t,e),Re.unlinkSync(e)},gC=(t,e,r)=>t===t>>>0?t:e===e>>>0?e:r,_C=t=>tj(ej(Lt(t))).toLowerCase(),sj=(t,e)=>{e=_C(e);for(let r of t.keys()){let n=_C(r);(n===e||n.indexOf(e+"/")===0)&&t.delete(r)}},oj=t=>{for(let e of t.keys())t.delete(e)},pa=class extends Z4{constructor(e){if(e||(e={}),e.ondone=r=>{this[c0]=!0,this[l0]()},super(e),this[fa]=!1,this.reservations=X4(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[yl]=0,this[c0]=!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||da,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=Lt(Xr.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",r=>this[lC](r))}warn(e,r,n={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(n.recoverable=!1),super.warn(e,r,n)}[l0](){this[c0]&&this[yl]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[mC](e){if(this.strip){let r=Lt(e.path).split("/");if(r.length<this.strip)return!1;if(e.path=r.slice(this.strip).join("/"),e.type==="Link"){let n=Lt(e.linkpath).split("/");if(n.length>=this.strip)e.linkpath=n.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let r=Lt(e.path),n=r.split("/");if(n.includes("..")||da&&/^[a-z]:\.\.$/i.test(n[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:r}),!1;let[i,s]=Q4(r);i&&(e.path=s,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:r}))}if(Xr.isAbsolute(e.path)?e.absolute=Lt(Xr.resolve(e.path)):e.absolute=Lt(Xr.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:Lt(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:r}=Xr.win32.parse(e.absolute);e.absolute=r+cC.encode(e.absolute.slice(r.length));let{root:n}=Xr.win32.parse(e.path);e.path=n+cC.encode(e.path.slice(n.length))}return!0}[lC](e){if(!this[mC](e))return e.resume();switch(K4.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[h0](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[pC](e)}}[ft](e,r){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:r}),this[Us](),r.resume())}[Fn](e,r,n){bC(Lt(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:r,noChmod:this.noChmod},n)}[ca](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}[la](e){return gC(this.uid,e.uid,this.processUid)}[ha](e){return gC(this.gid,e.gid,this.processGid)}[d0](e,r){let n=e.mode&4095||this.fmode,i=new J4.WriteStream(e.absolute,{flags:EC(e.size),mode:n,autoClose:!1});i.on("error",u=>{i.fd&&Re.close(i.fd,()=>{}),i.write=()=>!0,this[ft](u,e),r()});let s=1,o=u=>{if(u){i.fd&&Re.close(i.fd,()=>{}),this[ft](u,e),r();return}--s===0&&Re.close(i.fd,c=>{c?this[ft](c,e):this[Us](),r()})};i.on("finish",u=>{let c=e.absolute,l=i.fd;if(e.mtime&&!this.noMtime){s++;let h=e.atime||new Date,f=e.mtime;Re.futimes(l,h,f,d=>d?Re.utimes(c,h,f,m=>o(m&&d)):o())}if(this[ca](e)){s++;let h=this[la](e),f=this[ha](e);Re.fchown(l,h,f,d=>d?Re.chown(c,h,f,m=>o(m&&d)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",u=>{this[ft](u,e),r()}),e.pipe(a)),a.pipe(i)}[p0](e,r){let n=e.mode&4095||this.dmode;this[Fn](e.absolute,n,i=>{if(i){this[ft](i,e),r();return}let s=1,o=a=>{--s===0&&(r(),this[Us](),e.resume())};e.mtime&&!this.noMtime&&(s++,Re.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[ca](e)&&(s++,Re.chown(e.absolute,this[la](e),this[ha](e),o)),o()})}[pC](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[fC](e,r){this[bl](e,e.linkpath,"symlink",r)}[dC](e,r){let n=Lt(Xr.resolve(this.cwd,e.linkpath));this[bl](e,n,"link",r)}[yC](){this[yl]++}[Us](){this[yl]--,this[l0]()}[m0](e){this[Us](),e.resume()}[f0](e,r){return e.type==="File"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!da}[h0](e){this[yC]();let r=[e.path];e.linkpath&&r.push(e.linkpath),this.reservations.reserve(r,n=>this[hC](e,n))}[_l](e){e.type==="SymbolicLink"?oj(this.dirCache):e.type!=="Directory"&&sj(this.dirCache,e.absolute)}[hC](e,r){this[_l](e);let n=a=>{this[_l](e),r(a)},i=()=>{this[Fn](this.cwd,this.dmode,a=>{if(a){this[ft](a,e),n();return}this[fa]=!0,s()})},s=()=>{if(e.absolute!==this.cwd){let a=Lt(Xr.dirname(e.absolute));if(a!==this.cwd)return this[Fn](a,this.dmode,u=>{if(u){this[ft](u,e),n();return}o()})}o()},o=()=>{Re.lstat(e.absolute,(a,u)=>{if(u&&(this.keep||this.newer&&u.mtime>e.mtime)){this[m0](e),n();return}if(a||this[f0](e,u))return this[Zt](null,e,n);if(u.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(u.mode&4095)!==e.mode,l=h=>this[Zt](h,e,n);return c?Re.chmod(e.absolute,e.mode,l):l()}if(e.absolute!==this.cwd)return Re.rmdir(e.absolute,c=>this[Zt](c,e,n))}if(e.absolute===this.cwd)return this[Zt](null,e,n);nj(e.absolute,c=>this[Zt](c,e,n))})};this[fa]?s():i()}[Zt](e,r,n){if(e){this[ft](e,r),n();return}switch(r.type){case"File":case"OldFile":case"ContiguousFile":return this[d0](r,n);case"Link":return this[dC](r,n);case"SymbolicLink":return this[fC](r,n);case"Directory":case"GNUDumpDir":return this[p0](r,n)}}[bl](e,r,n,i){Re[n](r,e.absolute,s=>{s?this[ft](s,e):(this[Us](),e.resume()),i()})}},gl=t=>{try{return[null,t()]}catch(e){return[e,null]}},y0=class extends pa{[Zt](e,r){return super[Zt](e,r,()=>{})}[h0](e){if(this[_l](e),!this[fa]){let s=this[Fn](this.cwd,this.dmode);if(s)return this[ft](s,e);this[fa]=!0}if(e.absolute!==this.cwd){let s=Lt(Xr.dirname(e.absolute));if(s!==this.cwd){let o=this[Fn](s,this.dmode);if(o)return this[ft](o,e)}}let[r,n]=gl(()=>Re.lstatSync(e.absolute));if(n&&(this.keep||this.newer&&n.mtime>e.mtime))return this[m0](e);if(r||this[f0](e,n))return this[Zt](null,e);if(n.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(n.mode&4095)!==e.mode,[a]=o?gl(()=>{Re.chmodSync(e.absolute,e.mode)}):[];return this[Zt](a,e)}let[s]=gl(()=>Re.rmdirSync(e.absolute));this[Zt](s,e)}let[i]=e.absolute===this.cwd?[]:gl(()=>ij(e.absolute));this[Zt](i,e)}[d0](e,r){let n=e.mode&4095||this.fmode,i=a=>{let u;try{Re.closeSync(s)}catch(c){u=c}(a||u)&&this[ft](a||u,e),r()},s;try{s=Re.openSync(e.absolute,EC(e.size),n)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[ft](a,e)),e.pipe(o)),o.on("data",a=>{try{Re.writeSync(s,a,0,a.length)}catch(u){i(u)}}),o.on("end",a=>{let u=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,l=e.mtime;try{Re.futimesSync(s,c,l)}catch(h){try{Re.utimesSync(e.absolute,c,l)}catch{u=h}}}if(this[ca](e)){let c=this[la](e),l=this[ha](e);try{Re.fchownSync(s,c,l)}catch(h){try{Re.chownSync(e.absolute,c,l)}catch{u=u||h}}}i(u)})}[p0](e,r){let n=e.mode&4095||this.dmode,i=this[Fn](e.absolute,n);if(i){this[ft](i,e),r();return}if(e.mtime&&!this.noMtime)try{Re.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[ca](e))try{Re.chownSync(e.absolute,this[la](e),this[ha](e))}catch{}r(),e.resume()}[Fn](e,r){try{return bC.sync(Lt(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:r})}catch(n){return n}}[bl](e,r,n,i){try{Re[n+"Sync"](r,e.absolute),i(),e.resume()}catch(s){return this[ft](s,e)}}};pa.Sync=y0;wC.exports=pa});var CC=A((vY,DC)=>{"use strict";var aj=bs(),vl=g0(),SC=require("fs"),AC=Bs(),xC=require("path"),_0=Cs();DC.exports=(t,e,r)=>{typeof t=="function"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(r=e,e=null),e?e=Array.from(e):e=[];let n=aj(t);if(n.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!n.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return e.length&&uj(n,e),n.file&&n.sync?cj(n):n.file?lj(n,r):n.sync?hj(n):fj(n)};var uj=(t,e)=>{let r=new Map(e.map(s=>[_0(s),!0])),n=t.filter,i=(s,o)=>{let a=o||xC.parse(s).root||".",u=s===a?!1:r.has(s)?r.get(s):i(xC.dirname(s),a);return r.set(s,u),u};t.filter=n?(s,o)=>n(s,o)&&i(_0(s)):s=>i(_0(s))},cj=t=>{let e=new vl.Sync(t),r=t.file,n=SC.statSync(r),i=t.maxReadSize||16*1024*1024;new AC.ReadStreamSync(r,{readSize:i,size:n.size}).pipe(e)},lj=(t,e)=>{let r=new vl(t),n=t.maxReadSize||16*1024*1024,i=t.file,s=new Promise((o,a)=>{r.on("error",a),r.on("close",o),SC.stat(i,(u,c)=>{if(u)a(u);else{let l=new AC.ReadStream(i,{readSize:n,size:c.size});l.on("error",a),l.pipe(r)}})});return e?s.then(e,e):s},hj=t=>new vl.Sync(t),fj=t=>new vl(t)});var RC=A(We=>{"use strict";We.c=We.create=cD();We.r=We.replace=Qm();We.t=We.list=ul();We.u=We.update=_D();We.x=We.extract=CC();We.Pack=Wc();We.Unpack=g0();We.Parse=al();We.ReadEntry=Tc();We.WriteEntry=Cm();We.Header=Ds();We.Pax=Fc();We.types=cm()});var en=A((Qr,El)=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});var kC=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function dj(t){return kC.includes(t)}var pj=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...kC];function mj(t){return pj.includes(t)}var yj=["null","undefined","string","number","bigint","boolean","symbol"];function gj(t){return yj.includes(t)}function Hs(t){return e=>typeof e===t}var{toString:TC}=Object.prototype,ma=t=>{let e=TC.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&T.domElement(t))return"HTMLElement";if(mj(e))return e},Fe=t=>e=>ma(e)===t;function T(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(T.observable(t))return"Observable";if(T.array(t))return"Array";if(T.buffer(t))return"Buffer";let e=ma(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}T.undefined=Hs("undefined");T.string=Hs("string");var _j=Hs("number");T.number=t=>_j(t)&&!T.nan(t);T.bigint=Hs("bigint");T.function_=Hs("function");T.null_=t=>t===null;T.class_=t=>T.function_(t)&&t.toString().startsWith("class ");T.boolean=t=>t===!0||t===!1;T.symbol=Hs("symbol");T.numericString=t=>T.string(t)&&!T.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));T.array=(t,e)=>Array.isArray(t)?T.function_(e)?t.every(e):!0:!1;T.buffer=t=>{var e,r,n,i;return(i=(n=(r=(e=t)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.isBuffer)===null||n===void 0?void 0:n.call(r,t))!==null&&i!==void 0?i:!1};T.blob=t=>Fe("Blob")(t);T.nullOrUndefined=t=>T.null_(t)||T.undefined(t);T.object=t=>!T.null_(t)&&(typeof t=="object"||T.function_(t));T.iterable=t=>{var e;return T.function_((e=t)===null||e===void 0?void 0:e[Symbol.iterator])};T.asyncIterable=t=>{var e;return T.function_((e=t)===null||e===void 0?void 0:e[Symbol.asyncIterator])};T.generator=t=>{var e,r;return T.iterable(t)&&T.function_((e=t)===null||e===void 0?void 0:e.next)&&T.function_((r=t)===null||r===void 0?void 0:r.throw)};T.asyncGenerator=t=>T.asyncIterable(t)&&T.function_(t.next)&&T.function_(t.throw);T.nativePromise=t=>Fe("Promise")(t);var bj=t=>{var e,r;return T.function_((e=t)===null||e===void 0?void 0:e.then)&&T.function_((r=t)===null||r===void 0?void 0:r.catch)};T.promise=t=>T.nativePromise(t)||bj(t);T.generatorFunction=Fe("GeneratorFunction");T.asyncGeneratorFunction=t=>ma(t)==="AsyncGeneratorFunction";T.asyncFunction=t=>ma(t)==="AsyncFunction";T.boundFunction=t=>T.function_(t)&&!t.hasOwnProperty("prototype");T.regExp=Fe("RegExp");T.date=Fe("Date");T.error=Fe("Error");T.map=t=>Fe("Map")(t);T.set=t=>Fe("Set")(t);T.weakMap=t=>Fe("WeakMap")(t);T.weakSet=t=>Fe("WeakSet")(t);T.int8Array=Fe("Int8Array");T.uint8Array=Fe("Uint8Array");T.uint8ClampedArray=Fe("Uint8ClampedArray");T.int16Array=Fe("Int16Array");T.uint16Array=Fe("Uint16Array");T.int32Array=Fe("Int32Array");T.uint32Array=Fe("Uint32Array");T.float32Array=Fe("Float32Array");T.float64Array=Fe("Float64Array");T.bigInt64Array=Fe("BigInt64Array");T.bigUint64Array=Fe("BigUint64Array");T.arrayBuffer=Fe("ArrayBuffer");T.sharedArrayBuffer=Fe("SharedArrayBuffer");T.dataView=Fe("DataView");T.enumCase=(t,e)=>Object.values(e).includes(t);T.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;T.urlInstance=t=>Fe("URL")(t);T.urlString=t=>{if(!T.string(t))return!1;try{return new URL(t),!0}catch{return!1}};T.truthy=t=>!!t;T.falsy=t=>!t;T.nan=t=>Number.isNaN(t);T.primitive=t=>T.null_(t)||gj(typeof t);T.integer=t=>Number.isInteger(t);T.safeInteger=t=>Number.isSafeInteger(t);T.plainObject=t=>{if(TC.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};T.typedArray=t=>dj(ma(t));var vj=t=>T.safeInteger(t)&&t>=0;T.arrayLike=t=>!T.nullOrUndefined(t)&&!T.function_(t)&&vj(t.length);T.inRange=(t,e)=>{if(T.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(T.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var Ej=1,wj=["innerHTML","ownerDocument","style","attributes","nodeValue"];T.domElement=t=>T.object(t)&&t.nodeType===Ej&&T.string(t.nodeName)&&!T.plainObject(t)&&wj.every(e=>e in t);T.observable=t=>{var e,r,n,i;return t?t===((r=(e=t)[Symbol.observable])===null||r===void 0?void 0:r.call(e))||t===((i=(n=t)["@@observable"])===null||i===void 0?void 0:i.call(n)):!1};T.nodeStream=t=>T.object(t)&&T.function_(t.pipe)&&!T.observable(t);T.infinite=t=>t===1/0||t===-1/0;var OC=t=>e=>T.integer(e)&&Math.abs(e%2)===t;T.evenInteger=OC(0);T.oddInteger=OC(1);T.emptyArray=t=>T.array(t)&&t.length===0;T.nonEmptyArray=t=>T.array(t)&&t.length>0;T.emptyString=t=>T.string(t)&&t.length===0;var xj=t=>T.string(t)&&!/\S/.test(t);T.emptyStringOrWhitespace=t=>T.emptyString(t)||xj(t);T.nonEmptyString=t=>T.string(t)&&t.length>0;T.nonEmptyStringAndNotWhitespace=t=>T.string(t)&&!T.emptyStringOrWhitespace(t);T.emptyObject=t=>T.object(t)&&!T.map(t)&&!T.set(t)&&Object.keys(t).length===0;T.nonEmptyObject=t=>T.object(t)&&!T.map(t)&&!T.set(t)&&Object.keys(t).length>0;T.emptySet=t=>T.set(t)&&t.size===0;T.nonEmptySet=t=>T.set(t)&&t.size>0;T.emptyMap=t=>T.map(t)&&t.size===0;T.nonEmptyMap=t=>T.map(t)&&t.size>0;T.propertyKey=t=>T.any([T.string,T.number,T.symbol],t);T.formData=t=>Fe("FormData")(t);T.urlSearchParams=t=>Fe("URLSearchParams")(t);var FC=(t,e,r)=>{if(!T.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError("Invalid number of values");return t.call(r,e)};T.any=(t,...e)=>(T.array(t)?t:[t]).some(n=>FC(Array.prototype.some,n,e));T.all=(t,...e)=>FC(Array.prototype.every,t,e);var se=(t,e,r,n={})=>{if(!t){let{multipleValues:i}=n,s=i?`received values of types ${[...new Set(r.map(o=>`\`${T(o)}\``))].join(", ")}`:`received value of type \`${T(r)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${s}.`)}};Qr.assert={undefined:t=>se(T.undefined(t),"undefined",t),string:t=>se(T.string(t),"string",t),number:t=>se(T.number(t),"number",t),bigint:t=>se(T.bigint(t),"bigint",t),function_:t=>se(T.function_(t),"Function",t),null_:t=>se(T.null_(t),"null",t),class_:t=>se(T.class_(t),"Class",t),boolean:t=>se(T.boolean(t),"boolean",t),symbol:t=>se(T.symbol(t),"symbol",t),numericString:t=>se(T.numericString(t),"string with a number",t),array:(t,e)=>{se(T.array(t),"Array",t),e&&t.forEach(e)},buffer:t=>se(T.buffer(t),"Buffer",t),blob:t=>se(T.blob(t),"Blob",t),nullOrUndefined:t=>se(T.nullOrUndefined(t),"null or undefined",t),object:t=>se(T.object(t),"Object",t),iterable:t=>se(T.iterable(t),"Iterable",t),asyncIterable:t=>se(T.asyncIterable(t),"AsyncIterable",t),generator:t=>se(T.generator(t),"Generator",t),asyncGenerator:t=>se(T.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>se(T.nativePromise(t),"native Promise",t),promise:t=>se(T.promise(t),"Promise",t),generatorFunction:t=>se(T.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>se(T.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>se(T.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>se(T.boundFunction(t),"Function",t),regExp:t=>se(T.regExp(t),"RegExp",t),date:t=>se(T.date(t),"Date",t),error:t=>se(T.error(t),"Error",t),map:t=>se(T.map(t),"Map",t),set:t=>se(T.set(t),"Set",t),weakMap:t=>se(T.weakMap(t),"WeakMap",t),weakSet:t=>se(T.weakSet(t),"WeakSet",t),int8Array:t=>se(T.int8Array(t),"Int8Array",t),uint8Array:t=>se(T.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>se(T.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>se(T.int16Array(t),"Int16Array",t),uint16Array:t=>se(T.uint16Array(t),"Uint16Array",t),int32Array:t=>se(T.int32Array(t),"Int32Array",t),uint32Array:t=>se(T.uint32Array(t),"Uint32Array",t),float32Array:t=>se(T.float32Array(t),"Float32Array",t),float64Array:t=>se(T.float64Array(t),"Float64Array",t),bigInt64Array:t=>se(T.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>se(T.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>se(T.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>se(T.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>se(T.dataView(t),"DataView",t),enumCase:(t,e)=>se(T.enumCase(t,e),"EnumCase",t),urlInstance:t=>se(T.urlInstance(t),"URL",t),urlString:t=>se(T.urlString(t),"string with a URL",t),truthy:t=>se(T.truthy(t),"truthy",t),falsy:t=>se(T.falsy(t),"falsy",t),nan:t=>se(T.nan(t),"NaN",t),primitive:t=>se(T.primitive(t),"primitive",t),integer:t=>se(T.integer(t),"integer",t),safeInteger:t=>se(T.safeInteger(t),"integer",t),plainObject:t=>se(T.plainObject(t),"plain object",t),typedArray:t=>se(T.typedArray(t),"TypedArray",t),arrayLike:t=>se(T.arrayLike(t),"array-like",t),domElement:t=>se(T.domElement(t),"HTMLElement",t),observable:t=>se(T.observable(t),"Observable",t),nodeStream:t=>se(T.nodeStream(t),"Node.js Stream",t),infinite:t=>se(T.infinite(t),"infinite number",t),emptyArray:t=>se(T.emptyArray(t),"empty array",t),nonEmptyArray:t=>se(T.nonEmptyArray(t),"non-empty array",t),emptyString:t=>se(T.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>se(T.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>se(T.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>se(T.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>se(T.emptyObject(t),"empty object",t),nonEmptyObject:t=>se(T.nonEmptyObject(t),"non-empty object",t),emptySet:t=>se(T.emptySet(t),"empty set",t),nonEmptySet:t=>se(T.nonEmptySet(t),"non-empty set",t),emptyMap:t=>se(T.emptyMap(t),"empty map",t),nonEmptyMap:t=>se(T.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>se(T.propertyKey(t),"PropertyKey",t),formData:t=>se(T.formData(t),"FormData",t),urlSearchParams:t=>se(T.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>se(T.evenInteger(t),"even integer",t),oddInteger:t=>se(T.oddInteger(t),"odd integer",t),directInstanceOf:(t,e)=>se(T.directInstanceOf(t,e),"T",t),inRange:(t,e)=>se(T.inRange(t,e),"in range",t),any:(t,...e)=>se(T.any(t,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(t,...e)=>se(T.all(t,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(T,{class:{value:T.class_},function:{value:T.function_},null:{value:T.null_}});Object.defineProperties(Qr.assert,{class:{value:Qr.assert.class_},function:{value:Qr.assert.function_},null:{value:Qr.assert.null_}});Qr.default=T;El.exports=T;El.exports.default=T;El.exports.assert=Qr.assert});var PC=A((wY,b0)=>{"use strict";var wl=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},$s=class{static fn(e){return(...r)=>new $s((n,i,s)=>{r.push(s),e(...r).then(n,i)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,n)=>{this._reject=n;let i=a=>{(!this._isCanceled||!o.shouldReject)&&(this._isPending=!1,r(a))},s=a=>{this._isPending=!1,n(a)},o=a=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(a)};return Object.defineProperties(o,{shouldReject:{get:()=>this._rejectOnCancel,set:a=>{this._rejectOnCancel=a}}}),e(i,s,o)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r);return}this._rejectOnCancel&&this._reject(new wl(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf($s.prototype,Promise.prototype);b0.exports=$s;b0.exports.CancelError=wl});var IC=A((E0,w0)=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});function Sj(t){return t.encrypted}var v0=(t,e)=>{let r;typeof e=="function"?r={connect:e}:r=e;let n=typeof r.connect=="function",i=typeof r.secureConnect=="function",s=typeof r.close=="function",o=()=>{n&&r.connect(),Sj(t)&&i&&(t.authorized?r.secureConnect():t.authorizationError||t.once("secureConnect",r.secureConnect)),s&&t.once("close",r.close)};t.writable&&!t.connecting?o():t.connecting?t.once("connect",o):t.destroyed&&s&&r.close(t._hadError)};E0.default=v0;w0.exports=v0;w0.exports.default=v0});var LC=A((S0,A0)=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});var Aj=IC(),Dj=require("util"),Cj=Number(process.versions.node.split(".")[0]),x0=t=>{if(t.timings)return t.timings;let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;let r=a=>{let u=a.emit.bind(a);a.emit=(c,...l)=>(c==="error"&&(e.error=Date.now(),e.phases.total=e.error-e.start,a.emit=u),u(c,...l))};r(t);let n=()=>{e.abort=Date.now(),(!e.response||Cj>=13)&&(e.phases.total=Date.now()-e.start)};t.prependOnceListener("abort",n);let i=a=>{if(e.socket=Date.now(),e.phases.wait=e.socket-e.start,Dj.types.isProxy(a))return;let u=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};a.prependOnceListener("lookup",u),Aj.default(a,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(a.removeListener("lookup",u),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?i(t.socket):t.prependOnceListener("socket",i);let s=()=>{var a;e.upload=Date.now(),e.phases.request=e.upload-((a=e.secureConnect)!==null&&a!==void 0?a:e.connect)};return(()=>typeof t.writableFinished=="boolean"?t.writableFinished:t.finished&&t.outputSize===0&&(!t.socket||t.socket.writableLength===0))()?s():t.prependOnceListener("finish",s),t.prependOnceListener("response",a=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,a.timings=e,r(a),a.prependOnceListener("end",()=>{e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start}),a.prependOnceListener("aborted",n)}),e};S0.default=x0;A0.exports=x0;A0.exports.default=x0});var HC=A((xY,R0)=>{"use strict";var{V4MAPPED:Rj,ADDRCONFIG:kj,ALL:UC,promises:{Resolver:BC},lookup:Tj}=require("dns"),{promisify:D0}=require("util"),Oj=require("os"),Gs=Symbol("cacheableLookupCreateConnection"),C0=Symbol("cacheableLookupInstance"),NC=Symbol("expires"),Fj=typeof UC=="number",MC=t=>{if(!(t&&typeof t.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},Pj=t=>{for(let e of t)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},jC=()=>{let t=!1,e=!1;for(let r of Object.values(Oj.networkInterfaces()))for(let n of r)if(!n.internal&&(n.family==="IPv6"?e=!0:t=!0,t&&e))return{has4:t,has6:e};return{has4:t,has6:e}},Ij=t=>Symbol.iterator in t,qC={ttl:!0},Lj={all:!0},xl=class{constructor({cache:e=new Map,maxTtl:r=1/0,fallbackDuration:n=3600,errorTtl:i=.15,resolver:s=new BC,lookup:o=Tj}={}){if(this.maxTtl=r,this.errorTtl=i,this._cache=e,this._resolver=s,this._dnsLookup=D0(o),this._resolver instanceof BC?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=D0(this._resolver.resolve4.bind(this._resolver)),this._resolve6=D0(this._resolver.resolve6.bind(this._resolver))),this._iface=jC(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,n<1)this._fallback=!1;else{this._fallback=!0;let a=setInterval(()=>{this._hostnamesToFallback.clear()},n*1e3);a.unref&&a.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,n){if(typeof r=="function"?(n=r,r={}):typeof r=="number"&&(r={family:r}),!n)throw new Error("Callback must be a function.");this.lookupAsync(e,r).then(i=>{r.all?n(null,i):n(null,i.address,i.family,i.expires,i.ttl)},n)}async lookupAsync(e,r={}){typeof r=="number"&&(r={family:r});let n=await this.query(e);if(r.family===6){let i=n.filter(s=>s.family===6);r.hints&Rj&&(Fj&&r.hints&UC||i.length===0)?Pj(n):n=i}else r.family===4&&(n=n.filter(i=>i.family===4));if(r.hints&kj){let{_iface:i}=this;n=n.filter(s=>s.family===6?i.has6:i.has4)}if(n.length===0){let i=new Error(`cacheableLookup ENOTFOUND ${e}`);throw i.code="ENOTFOUND",i.hostname=e,i}return r.all?n:n[0]}async query(e){let r=await this._cache.get(e);if(!r){let n=this._pending[e];if(n)r=await n;else{let i=this.queryAndCache(e);this._pending[e]=i;try{r=await i}finally{delete this._pending[e]}}}return r=r.map(n=>({...n})),r}async _resolve(e){let r=async c=>{try{return await c}catch(l){if(l.code==="ENODATA"||l.code==="ENOTFOUND")return[];throw l}},[n,i]=await Promise.all([this._resolve4(e,qC),this._resolve6(e,qC)].map(c=>r(c))),s=0,o=0,a=0,u=Date.now();for(let c of n)c.family=4,c.expires=u+c.ttl*1e3,s=Math.max(s,c.ttl);for(let c of i)c.family=6,c.expires=u+c.ttl*1e3,o=Math.max(o,c.ttl);return n.length>0?i.length>0?a=Math.min(s,o):a=s:a=o,{entries:[...n,...i],cacheTtl:a}}async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,r,n){if(this.maxTtl>0&&n>0){n=Math.min(n,this.maxTtl)*1e3,r[NC]=Date.now()+n;try{await this._cache.set(e,r,n)}catch(i){this.lookupAsync=async()=>{let s=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw s.cause=i,s}}Ij(this._cache)&&this._tick(n)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,Lj);let r=await this._resolve(e);r.entries.length===0&&this._fallback&&(r=await this._lookup(e),r.entries.length!==0&&this._hostnamesToFallback.add(e));let n=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,n),r.entries}_tick(e){let r=this._nextRemovalTime;(!r||e<r)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=e,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let n=1/0,i=Date.now();for(let[s,o]of this._cache){let a=o[NC];i>=a?this._cache.delete(s):a<n&&(n=a)}n!==1/0&&this._tick(n-i)},e),this._removalTimeout.unref&&this._removalTimeout.unref())}install(e){if(MC(e),Gs in e)throw new Error("CacheableLookup has been already installed");e[Gs]=e.createConnection,e[C0]=this,e.createConnection=(r,n)=>("lookup"in r||(r.lookup=this.lookup),e[Gs](r,n))}uninstall(e){if(MC(e),e[Gs]){if(e[C0]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[Gs],delete e[Gs],delete e[C0]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=jC(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};R0.exports=xl;R0.exports.default=xl});var zC=A((SY,GC)=>{"use strict";var Bj="text/plain",Nj="us-ascii",$C=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),Mj=(t,{stripHash:e})=>{let r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:i,hash:s}=r.groups,o=n.split(";");s=e?"":s;let a=!1;o[o.length-1]==="base64"&&(o.pop(),a=!0);let u=(o.shift()||"").toLowerCase(),l=[...o.map(h=>{let[f,d=""]=h.split("=").map(m=>m.trim());return f==="charset"&&(d=d.toLowerCase(),d===Nj)?"":`${f}${d?`=${d}`:""}`}).filter(Boolean)];return a&&l.push("base64"),(l.length!==0||u&&u!==Bj)&&l.unshift(u),`data:${l.join(";")},${a?i.trim():i}${s?`#${s}`:""}`},jj=(t,e)=>{if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return Mj(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let i=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&i.protocol==="https:"&&(i.protocol="http:"),e.forceHttps&&i.protocol==="http:"&&(i.protocol="https:"),e.stripAuthentication&&(i.username="",i.password=""),e.stripHash?i.hash="":e.stripTextFragment&&(i.hash=i.hash.replace(/#?:~:text.*?$/i,"")),i.pathname&&(i.pathname=i.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")),i.pathname)try{i.pathname=decodeURI(i.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let o=i.pathname.split("/"),a=o[o.length-1];$C(a,e.removeDirectoryIndex)&&(o=o.slice(0,o.length-1),i.pathname=o.slice(1).join("/")+"/")}if(i.hostname&&(i.hostname=i.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(i.hostname)&&(i.hostname=i.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let o of[...i.searchParams.keys()])$C(o,e.removeQueryParameters)&&i.searchParams.delete(o);e.removeQueryParameters===!0&&(i.search=""),e.sortQueryParameters&&i.searchParams.sort(),e.removeTrailingSlash&&(i.pathname=i.pathname.replace(/\/$/,""));let s=t;return t=i.toString(),!e.removeSingleSlash&&i.pathname==="/"&&!s.endsWith("/")&&i.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||i.pathname==="/")&&i.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t};GC.exports=jj});var YC=A((AY,WC)=>{WC.exports=VC;function VC(t,e){if(t&&e)return VC(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(n){r[n]=t[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var s=t.apply(this,n),o=n[n.length-1];return typeof s=="function"&&s!==o&&Object.keys(o).forEach(function(a){s[a]=o[a]}),s}}});var T0=A((DY,k0)=>{var KC=YC();k0.exports=KC(Sl);k0.exports.strict=KC(ZC);Sl.proto=Sl(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Sl(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return ZC(this)},configurable:!0})});function Sl(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function ZC(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var QC=A((CY,XC)=>{var qj=T0(),Uj=function(){},Hj=function(t){return t.setHeader&&typeof t.abort=="function"},$j=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},JC=function(t,e,r){if(typeof e=="function")return JC(t,null,e);e||(e={}),r=qj(r||Uj);var n=t._writableState,i=t._readableState,s=e.readable||e.readable!==!1&&t.readable,o=e.writable||e.writable!==!1&&t.writable,a=!1,u=function(){t.writable||c()},c=function(){o=!1,s||r.call(t)},l=function(){s=!1,o||r.call(t)},h=function(p){r.call(t,p?new Error("exited with error code: "+p):null)},f=function(p){r.call(t,p)},d=function(){process.nextTick(m)},m=function(){if(!a){if(s&&!(i&&i.ended&&!i.destroyed))return r.call(t,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(t,new Error("premature close"))}},y=function(){t.req.on("finish",c)};return Hj(t)?(t.on("complete",c),t.on("abort",d),t.req?y():t.on("request",y)):o&&!n&&(t.on("end",u),t.on("close",u)),$j(t)&&t.on("exit",h),t.on("end",l),t.on("finish",c),e.error!==!1&&t.on("error",f),t.on("close",d),function(){a=!0,t.removeListener("complete",c),t.removeListener("abort",d),t.removeListener("request",y),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("exit",h),t.removeListener("end",l),t.removeListener("error",f),t.removeListener("close",d)}};XC.exports=JC});var r2=A((RY,t2)=>{var Gj=T0(),zj=QC(),O0=require("fs"),ya=function(){},Vj=/^v?\.0/.test(process.version),Al=function(t){return typeof t=="function"},Wj=function(t){return!Vj||!O0?!1:(t instanceof(O0.ReadStream||ya)||t instanceof(O0.WriteStream||ya))&&Al(t.close)},Yj=function(t){return t.setHeader&&Al(t.abort)},Kj=function(t,e,r,n){n=Gj(n);var i=!1;t.on("close",function(){i=!0}),zj(t,{readable:e,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,Wj(t))return t.close(ya);if(Yj(t))return t.abort();if(Al(t.destroy))return t.destroy();n(o||new Error("stream was destroyed"))}}},e2=function(t){t()},Zj=function(t,e){return t.pipe(e)},Jj=function(){var t=Array.prototype.slice.call(arguments),e=Al(t[t.length-1]||ya)&&t.pop()||ya;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r,n=t.map(function(i,s){var o=s<t.length-1,a=s>0;return Kj(i,o,a,function(u){r||(r=u),u&&n.forEach(e2),!o&&(n.forEach(e2),e(r))})});return t.reduce(Zj)};t2.exports=Jj});var i2=A((kY,n2)=>{"use strict";var{PassThrough:Xj}=require("stream");n2.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,n=r==="buffer",i=!1;e?i=!(r||n):r=r||"utf8",n&&(r=null);let s=new Xj({objectMode:i});r&&s.setEncoding(r);let o=0,a=[];return s.on("data",u=>{a.push(u),i?o=a.length:o+=u.length}),s.getBufferedValue=()=>e?a:n?Buffer.concat(a,o):a.join(""),s.getBufferedLength=()=>o,s}});var s2=A((TY,zs)=>{"use strict";var{constants:Qj}=require("buffer"),e9=r2(),t9=i2(),Dl=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Cl(t,e){if(!t)return Promise.reject(new Error("Expected a stream"));e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,n;return await new Promise((i,s)=>{let o=a=>{a&&n.getBufferedLength()<=Qj.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),s(a)};n=e9(t,t9(e),a=>{if(a){o(a);return}i()}),n.on("data",()=>{n.getBufferedLength()>r&&o(new Dl)})}),n.getBufferedValue()}zs.exports=Cl;zs.exports.default=Cl;zs.exports.buffer=(t,e)=>Cl(t,{...e,encoding:"buffer"});zs.exports.array=(t,e)=>Cl(t,{...e,array:!0});zs.exports.MaxBufferError=Dl});var a2=A((FY,o2)=>{"use strict";var r9=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),n9=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),i9=new Set([500,502,503,504]),s9={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},o9={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function pi(t){let e=parseInt(t,10);return isFinite(e)?e:0}function a9(t){return t?i9.has(t.status):!0}function F0(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[i,s]=n.split(/=/,2);e[i.trim()]=s===void 0?!0:s.trim().replace(/^"|"$/g,"")}return e}function u9(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}o2.exports=class{constructor(e,r,{shared:n,cacheHeuristic:i,immutableMinTimeToLive:s,ignoreCargoCult:o,_fromObject:a}={}){if(a){this._fromObject(a);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=i!==void 0?i:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=F0(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=F0(e.headers["cache-control"]),o&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":u9(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&n9.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||r9.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=F0(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)s9[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let i of n)delete r[i]}if(r.warning){let n=r.warning.split(/,/).filter(i=>!/^\s*1[0-9][0-9]/.test(i));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return pi(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return pi(this._rescc["s-maxage"])}if(this._rescc["max-age"])return pi(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||n<r?0:Math.max(e,(n-r)/1e3)}if(this._resHeaders["last-modified"]){let n=Date.parse(this._resHeaders["last-modified"]);if(isFinite(n)&&r>n)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+pi(this._rescc["stale-if-error"]),n=e+pi(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+pi(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+pi(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let i=r["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));i.length?r["if-none-match"]=i.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&a9(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;if(r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0),!n)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let i={};for(let o in this._resHeaders)i[o]=o in r.headers&&!o9[o]?r.headers[o]:this._resHeaders[o];let s=Object.assign({},r,{status:this._status,method:this._method,headers:i});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var Rl=A((PY,u2)=>{"use strict";u2.exports=t=>{let e={};for(let[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}});var l2=A((IY,c2)=>{"use strict";var c9=require("stream").Readable,l9=Rl(),P0=class extends c9{constructor(e,r,n,i){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof r!="object")throw new TypeError("Argument `headers` should be an object");if(!(n instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if(typeof i!="string")throw new TypeError("Argument `url` should be a string");super(),this.statusCode=e,this.headers=l9(r),this.body=n,this.url=i}_read(){this.push(this.body),this.push(null)}};c2.exports=P0});var f2=A((LY,h2)=>{"use strict";var h9=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];h2.exports=(t,e)=>{let r=new Set(Object.keys(t).concat(h9));for(let n of r)n in e||(e[n]=typeof t[n]=="function"?t[n].bind(t):t[n])}});var p2=A((BY,d2)=>{"use strict";var f9=require("stream").PassThrough,d9=f2(),p9=t=>{if(!(t&&t.pipe))throw new TypeError("Parameter `response` must be a response stream.");let e=new f9;return d9(t,e),t.pipe(e)};d2.exports=p9});var m2=A(I0=>{I0.stringify=function t(e){if(typeof e=="undefined")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var r="",n=Array.isArray(e);r=n?"[":"{";var i=!0;for(var s in e){var o=typeof e[s]=="function"||!n&&typeof e[s]=="undefined";Object.hasOwnProperty.call(e,s)&&!o&&(i||(r+=","),i=!1,n?e[s]==null?r+="null":r+=t(e[s]):e[s]!==void 0&&(r+=t(s)+":"+t(e[s])))}return r+=n?"]":"}",r}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e=="undefined"?"null":JSON.stringify(e)};I0.parse=function(t){return JSON.parse(t,function(e,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})}});var b2=A((MY,_2)=>{"use strict";var m9=require("events"),y2=m2(),y9=t=>{let e={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(t.adapter||t.uri){let r=t.adapter||/^[^:+]*/.exec(t.uri)[0];return new(require(e[r]))(t)}return new Map},g2=["sqlite","postgres","mysql","mongo","redis","tiered"],L0=class extends m9{constructor(e,{emitErrors:r=!0,...n}={}){if(super(),this.opts={namespace:"keyv",serialize:y2.stringify,deserialize:y2.parse,...typeof e=="string"?{uri:e}:e,...n},!this.opts.store){let s={...this.opts};this.opts.store=y9(s)}if(this.opts.compression){let s=this.opts.compression;this.opts.serialize=s.serialize.bind(s),this.opts.deserialize=s.deserialize.bind(s)}typeof this.opts.store.on=="function"&&r&&this.opts.store.on("error",s=>this.emit("error",s)),this.opts.store.namespace=this.opts.namespace;let i=s=>async function*(){for await(let[o,a]of typeof s=="function"?s(this.opts.store.namespace):s){let u=this.opts.deserialize(a);if(!(this.opts.store.namespace&&!o.includes(this.opts.store.namespace))){if(typeof u.expires=="number"&&Date.now()>u.expires){this.delete(o);continue}yield[this._getKeyUnprefix(o),u.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=i(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=i(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return g2.includes(this.opts.store.opts.dialect)||g2.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(r=>`${this.opts.namespace}:${r}`)}_getKeyUnprefix(e){return e.split(":").splice(1).join(":")}get(e,r){let{store:n}=this.opts,i=Array.isArray(e),s=i?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(i&&n.getMany===void 0){let o=[];for(let a of s)o.push(Promise.resolve().then(()=>n.get(a)).then(u=>typeof u=="string"?this.opts.deserialize(u):this.opts.compression?this.opts.deserialize(u):u).then(u=>{if(u!=null)return typeof u.expires=="number"&&Date.now()>u.expires?this.delete(a).then(()=>{}):r&&r.raw?u:u.value}));return Promise.allSettled(o).then(a=>{let u=[];for(let c of a)u.push(c.value);return u})}return Promise.resolve().then(()=>i?n.getMany(s):n.get(s)).then(o=>typeof o=="string"?this.opts.deserialize(o):this.opts.compression?this.opts.deserialize(o):o).then(o=>{if(o!=null){if(i){let a=[];for(let u of o){if(typeof u=="string"&&(u=this.opts.deserialize(u)),u==null){a.push(void 0);continue}typeof u.expires=="number"&&Date.now()>u.expires?(this.delete(e).then(()=>{}),a.push(void 0)):a.push(r&&r.raw?u:u.value)}return a}return typeof o.expires=="number"&&Date.now()>o.expires?this.delete(e).then(()=>{}):r&&r.raw?o:o.value}})}set(e,r,n){let i=this._getKeyPrefix(e);typeof n=="undefined"&&(n=this.opts.ttl),n===0&&(n=void 0);let{store:s}=this.opts;return Promise.resolve().then(()=>{let o=typeof n=="number"?Date.now()+n:null;return typeof r=="symbol"&&this.emit("error","symbol cannot be serialized"),r={value:r,expires:o},this.opts.serialize(r)}).then(o=>s.set(i,o,n)).then(()=>!0)}delete(e){let{store:r}=this.opts;if(Array.isArray(e)){let i=this._getKeyPrefixArray(e);if(r.deleteMany===void 0){let s=[];for(let o of i)s.push(r.delete(o));return Promise.allSettled(s).then(o=>o.every(a=>a.value===!0))}return Promise.resolve().then(()=>r.deleteMany(i))}let n=this._getKeyPrefix(e);return Promise.resolve().then(()=>r.delete(n))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let r=this._getKeyPrefix(e),{store:n}=this.opts;return Promise.resolve().then(async()=>typeof n.has=="function"?n.has(r):await n.get(r)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect=="function")return e.disconnect()}};_2.exports=L0});var w2=A((jY,E2)=>{"use strict";var g9=require("events"),kl=require("url"),_9=zC(),b9=s2(),B0=a2(),v2=l2(),v9=Rl(),E9=p2(),w9=b2(),ur=class{constructor(e,r){if(typeof e!="function")throw new TypeError("Parameter `request` must be a function");return this.cache=new w9({uri:typeof r=="string"&&r,store:typeof r!="string"&&r,namespace:"cacheable-request"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(r,n)=>{let i;if(typeof r=="string")i=N0(kl.parse(r)),r={};else if(r instanceof kl.URL)i=N0(kl.parse(r.toString())),r={};else{let[h,...f]=(r.path||"").split("?"),d=f.length>0?`?${f.join("?")}`:"";i=N0({...r,pathname:h,search:d})}r={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...r,...x9(i)},r.headers=v9(r.headers);let s=new g9,o=_9(kl.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),a=`${r.method}:${o}`,u=!1,c=!1,l=h=>{c=!0;let f=!1,d,m=new Promise(p=>{d=()=>{f||(f=!0,p())}}),y=p=>{if(u&&!h.forceRefresh){p.status=p.statusCode;let O=B0.fromObject(u.cachePolicy).revalidatedPolicy(h,p);if(!O.modified){let P=O.policy.responseHeaders();p=new v2(u.statusCode,P,u.body,u.url),p.cachePolicy=O.policy,p.fromCache=!0}}p.fromCache||(p.cachePolicy=new B0(h,p,h),p.fromCache=!1);let w;h.cache&&p.cachePolicy.storable()?(w=E9(p),(async()=>{try{let O=b9.buffer(p);if(await Promise.race([m,new Promise(M=>p.once("end",M))]),f)return;let P=await O,I={cachePolicy:p.cachePolicy.toObject(),url:p.url,statusCode:p.fromCache?u.statusCode:p.statusCode,body:P},k=h.strictTtl?p.cachePolicy.timeToLive():void 0;h.maxTtl&&(k=k?Math.min(k,h.maxTtl):h.maxTtl),await this.cache.set(a,I,k)}catch(O){s.emit("error",new ur.CacheError(O))}})()):h.cache&&u&&(async()=>{try{await this.cache.delete(a)}catch(O){s.emit("error",new ur.CacheError(O))}})(),s.emit("response",w||p),typeof n=="function"&&n(w||p)};try{let p=e(h,y);p.once("error",d),p.once("abort",d),s.emit("request",p)}catch(p){s.emit("error",new ur.RequestError(p))}};return(async()=>{let h=async d=>{await Promise.resolve();let m=d.cache?await this.cache.get(a):void 0;if(typeof m=="undefined")return l(d);let y=B0.fromObject(m.cachePolicy);if(y.satisfiesWithoutRevalidation(d)&&!d.forceRefresh){let p=y.responseHeaders(),w=new v2(m.statusCode,p,m.body,m.url);w.cachePolicy=y,w.fromCache=!0,s.emit("response",w),typeof n=="function"&&n(w)}else u=m,d.headers=y.revalidationHeaders(d),l(d)},f=d=>s.emit("error",new ur.CacheError(d));this.cache.once("error",f),s.on("response",()=>this.cache.removeListener("error",f));try{await h(r)}catch(d){r.automaticFailover&&!c&&l(r),s.emit("error",new ur.CacheError(d))}})(),s}}};function x9(t){let e={...t};return e.path=`${t.pathname||"/"}${t.search||""}`,delete e.pathname,delete e.search,e}function N0(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}}ur.RequestError=class extends Error{constructor(t){super(t.message),this.name="RequestError",Object.assign(this,t)}};ur.CacheError=class extends Error{constructor(t){super(t.message),this.name="CacheError",Object.assign(this,t)}};E2.exports=ur});var S2=A((HY,x2)=>{"use strict";var S9=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];x2.exports=(t,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set(Object.keys(t).concat(S9)),n={};for(let i of r)i in e||(n[i]={get(){let s=t[i];return typeof s=="function"?s.bind(t):s},set(s){t[i]=s},enumerable:!0,configurable:!1});return Object.defineProperties(e,n),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var D2=A(($Y,A2)=>{"use strict";var{Transform:A9,PassThrough:D9}=require("stream"),M0=require("zlib"),C9=S2();A2.exports=t=>{let e=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return t;let r=e==="br";if(r&&typeof M0.createBrotliDecompress!="function")return t.destroy(new Error("Brotli is not supported on Node.js < 12")),t;let n=!0,i=new A9({transform(a,u,c){n=!1,c(null,a)},flush(a){a()}}),s=new D9({autoDestroy:!1,destroy(a,u){t.destroy(),u(a)}}),o=r?M0.createBrotliDecompress():M0.createUnzip();return o.once("error",a=>{if(n&&!t.readable){s.end();return}s.destroy(a)}),C9(t,s),t.pipe(i).pipe(o).pipe(s),s}});var q0=A((GY,C2)=>{"use strict";var j0=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,r){if(this.cache.set(e,r),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[n,i]of this.oldCache.entries())this.onEviction(n,i);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let r=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,r),r}}set(e,r){return this.cache.has(e)?this.cache.set(e,r):this._set(e,r),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[r]=e;this.cache.has(r)||(yield e)}}get size(){let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}};C2.exports=j0});var H0=A((zY,O2)=>{"use strict";var R9=require("events"),k9=require("tls"),T9=require("http2"),O9=q0(),gt=Symbol("currentStreamsCount"),R2=Symbol("request"),Jt=Symbol("cachedOriginSet"),Vs=Symbol("gracefullyClosing"),F9=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"],P9=(t,e,r)=>{let n=0,i=t.length;for(;n<i;){let s=n+i>>>1;r(t[s],e)?n=s+1:i=s}return n},I9=(t,e)=>t.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,U0=(t,e)=>{for(let r of t)r[Jt].length<e[Jt].length&&r[Jt].every(n=>e[Jt].includes(n))&&r[gt]+e[gt]<=e.remoteSettings.maxConcurrentStreams&&T2(r)},L9=(t,e)=>{for(let r of t)e[Jt].length<r[Jt].length&&e[Jt].every(n=>r[Jt].includes(n))&&e[gt]+r[gt]<=r.remoteSettings.maxConcurrentStreams&&T2(e)},k2=({agent:t,isFree:e})=>{let r={};for(let n in t.sessions){let s=t.sessions[n].filter(o=>{let a=o[Rr.kCurrentStreamsCount]<o.remoteSettings.maxConcurrentStreams;return e?a:!a});s.length!==0&&(r[n]=s)}return r},T2=t=>{t[Vs]=!0,t[gt]===0&&t.close()},Rr=class extends R9{constructor({timeout:e=6e4,maxSessions:r=1/0,maxFreeSessions:n=10,maxCachedTlsSessions:i=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=r,this.maxFreeSessions=n,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new O9({maxSize:i})}static normalizeOrigin(e,r){return typeof e=="string"&&(e=new URL(e)),r&&e.hostname!==r&&(e.hostname=r),e.origin}normalizeOptions(e){let r="";if(e)for(let n of F9)e[n]&&(r+=`:${e[n]}`);return r}_tryToCreateNewSession(e,r){if(!(e in this.queue)||!(r in this.queue[e]))return;let n=this.queue[e][r];this._sessionsCount<this.maxSessions&&!n.completed&&(n.completed=!0,n())}getSession(e,r,n){return new Promise((i,s)=>{Array.isArray(n)?(n=[...n],i()):n=[{resolve:i,reject:s}];let o=this.normalizeOptions(r),a=Rr.normalizeOrigin(e,r&&r.servername);if(a===void 0){for(let{reject:l}of n)l(new TypeError("The `origin` argument needs to be a string or an URL object"));return}if(o in this.sessions){let l=this.sessions[o],h=-1,f=-1,d;for(let m of l){let y=m.remoteSettings.maxConcurrentStreams;if(y<h)break;if(m[Jt].includes(a)){let p=m[gt];if(p>=y||m[Vs]||m.destroyed)continue;d||(h=y),p>f&&(d=m,f=p)}}if(d){if(n.length!==1){for(let{reject:m}of n){let y=new Error(`Expected the length of listeners to be 1, got ${n.length}.
|
|
26
26
|
Please report this to https://github.com/szmarczak/http2-wrapper/`);m(y)}return}n[0].resolve(d);return}}if(o in this.queue){if(a in this.queue[o]){this.queue[o][a].listeners.push(...n),this._tryToCreateNewSession(o,a);return}}else this.queue[o]={};let u=()=>{o in this.queue&&this.queue[o][a]===c&&(delete this.queue[o][a],Object.keys(this.queue[o]).length===0&&delete this.queue[o])},c=()=>{let l=`${a}:${o}`,h=!1;try{let f=T9.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(l),...r});f[gt]=0,f[Vs]=!1;let d=()=>f[gt]<f.remoteSettings.maxConcurrentStreams,m=!0;f.socket.once("session",p=>{this.tlsSessionCache.set(l,p)}),f.once("error",p=>{for(let{reject:w}of n)w(p);this.tlsSessionCache.delete(l)}),f.setTimeout(this.timeout,()=>{f.destroy()}),f.once("close",()=>{if(h){m&&this._freeSessionsCount--,this._sessionsCount--;let p=this.sessions[o];p.splice(p.indexOf(f),1),p.length===0&&delete this.sessions[o]}else{let p=new Error("Session closed without receiving a SETTINGS frame");p.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:w}of n)w(p);u()}this._tryToCreateNewSession(o,a)});let y=()=>{if(!(!(o in this.queue)||!d())){for(let p of f[Jt])if(p in this.queue[o]){let{listeners:w}=this.queue[o][p];for(;w.length!==0&&d();)w.shift().resolve(f);let O=this.queue[o];if(O[p].listeners.length===0&&(delete O[p],Object.keys(O).length===0)){delete this.queue[o];break}if(!d())break}}};f.on("origin",()=>{f[Jt]=f.originSet,d()&&(y(),U0(this.sessions[o],f))}),f.once("remoteSettings",()=>{if(f.ref(),f.unref(),this._sessionsCount++,c.destroyed){let p=new Error("Agent has been destroyed");for(let w of n)w.reject(p);f.destroy();return}f[Jt]=f.originSet;{let p=this.sessions;if(o in p){let w=p[o];w.splice(P9(w,f,I9),0,f)}else p[o]=[f]}this._freeSessionsCount+=1,h=!0,this.emit("session",f),y(),u(),f[gt]===0&&this._freeSessionsCount>this.maxFreeSessions&&f.close(),n.length!==0&&(this.getSession(a,r,n),n.length=0),f.on("remoteSettings",()=>{y(),U0(this.sessions[o],f)})}),f[R2]=f.request,f.request=(p,w)=>{if(f[Vs])throw new Error("The session is gracefully closing. No new streams are allowed.");let O=f[R2](p,w);return f.ref(),++f[gt],f[gt]===f.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,O.once("close",()=>{if(m=d(),--f[gt],!f.destroyed&&!f.closed&&(L9(this.sessions[o],f),d()&&!f.closed)){m||(this._freeSessionsCount++,m=!0);let P=f[gt]===0;P&&f.unref(),P&&(this._freeSessionsCount>this.maxFreeSessions||f[Vs])?f.close():(U0(this.sessions[o],f),y())}}),O}}catch(f){for(let d of n)d.reject(f);u()}};c.listeners=n,c.completed=!1,c.destroyed=!1,this.queue[o][a]=c,this._tryToCreateNewSession(o,a)})}request(e,r,n,i){return new Promise((s,o)=>{this.getSession(e,r,[{reject:o,resolve:a=>{try{s(a.request(n,i))}catch(u){o(u)}}}])})}createConnection(e,r){return Rr.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let n=e.port||443,i=e.hostname||e.host;return typeof r.servername=="undefined"&&(r.servername=i),k9.connect(n,i,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[gt]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let n of r)n.destroy(e);for(let r of Object.values(this.queue))for(let n of Object.values(r))n.destroyed=!0;this.queue={}}get freeSessions(){return k2({agent:this,isFree:!0})}get busySessions(){return k2({agent:this,isFree:!1})}};Rr.kCurrentStreamsCount=gt;Rr.kGracefullyClosing=Vs;O2.exports={Agent:Rr,globalAgent:new Rr}});var G0=A((VY,F2)=>{"use strict";var{Readable:B9}=require("stream"),$0=class extends B9{constructor(e,r){super({highWaterMark:r,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};F2.exports=$0});var z0=A((WY,P2)=>{"use strict";P2.exports=t=>{let e={protocol:t.protocol,hostname:typeof t.hostname=="string"&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return typeof t.port=="string"&&t.port.length!==0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}});var L2=A((YY,I2)=>{"use strict";I2.exports=(t,e,r)=>{for(let n of r)t.on(n,(...i)=>e.emit(n,...i))}});var N2=A((KY,B2)=>{"use strict";B2.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var j2=A((JY,M2)=>{"use strict";var Ws=(t,e,r)=>{M2.exports[e]=class extends t{constructor(...i){super(typeof r=="string"?r:r(i)),this.name=`${super.name} [${e}]`,this.code=e}}};Ws(TypeError,"ERR_INVALID_ARG_TYPE",t=>{let e=t[0].includes(".")?"property":"argument",r=t[1],n=Array.isArray(r);return n&&(r=`${r.slice(0,-1).join(", ")} or ${r.slice(-1)}`),`The "${t[0]}" ${e} must be ${n?"one of":"of"} type ${r}. Received ${typeof t[2]}`});Ws(TypeError,"ERR_INVALID_PROTOCOL",t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`);Ws(Error,"ERR_HTTP_HEADERS_SENT",t=>`Cannot ${t[0]} headers after they are sent to the client`);Ws(TypeError,"ERR_INVALID_HTTP_TOKEN",t=>`${t[0]} must be a valid HTTP token [${t[1]}]`);Ws(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",t=>`Invalid value "${t[0]} for header "${t[1]}"`);Ws(TypeError,"ERR_INVALID_CHAR",t=>`Invalid character in ${t[0]} [${t[1]}]`)});var Z0=A((XY,V2)=>{"use strict";var N9=require("http2"),{Writable:M9}=require("stream"),{Agent:q2,globalAgent:j9}=H0(),q9=G0(),U9=z0(),H9=L2(),$9=N2(),{ERR_INVALID_ARG_TYPE:V0,ERR_INVALID_PROTOCOL:G9,ERR_HTTP_HEADERS_SENT:U2,ERR_INVALID_HTTP_TOKEN:z9,ERR_HTTP_INVALID_HEADER_VALUE:V9,ERR_INVALID_CHAR:W9}=j2(),{HTTP2_HEADER_STATUS:H2,HTTP2_HEADER_METHOD:$2,HTTP2_HEADER_PATH:G2,HTTP2_METHOD_CONNECT:Y9}=N9.constants,dt=Symbol("headers"),W0=Symbol("origin"),Y0=Symbol("session"),z2=Symbol("options"),Tl=Symbol("flushedHeaders"),ga=Symbol("jobs"),K9=/^[\^`\-\w!#$%&*+.|~]+$/,Z9=/[^\t\u0020-\u007E\u0080-\u00FF]/,K0=class extends M9{constructor(e,r,n){super({autoDestroy:!1});let i=typeof e=="string"||e instanceof URL;if(i&&(e=U9(e instanceof URL?e:new URL(e))),typeof r=="function"||r===void 0?(n=r,r=i?e:{...e}):r={...e,...r},r.h2session)this[Y0]=r.h2session;else if(r.agent===!1)this.agent=new q2({maxFreeSessions:0});else if(typeof r.agent=="undefined"||r.agent===null)typeof r.createConnection=="function"?(this.agent=new q2({maxFreeSessions:0}),this.agent.createConnection=r.createConnection):this.agent=j9;else if(typeof r.agent.request=="function")this.agent=r.agent;else throw new V0("options.agent",["Agent-like Object","undefined","false"],r.agent);if(r.protocol&&r.protocol!=="https:")throw new G9(r.protocol,"https:");let s=r.port||r.defaultPort||this.agent&&this.agent.defaultPort||443,o=r.hostname||r.host||"localhost";delete r.hostname,delete r.host,delete r.port;let{timeout:a}=r;if(r.timeout=void 0,this[dt]=Object.create(null),this[ga]=[],this.socket=null,this.connection=null,this.method=r.method||"GET",this.path=r.path,this.res=null,this.aborted=!1,this.reusedSocket=!1,r.headers)for(let[u,c]of Object.entries(r.headers))this.setHeader(u,c);r.auth&&!("authorization"in this[dt])&&(this[dt].authorization="Basic "+Buffer.from(r.auth).toString("base64")),r.session=r.tlsSession,r.path=r.socketPath,this[z2]=r,s===443?(this[W0]=`https://${o}`,":authority"in this[dt]||(this[dt][":authority"]=o)):(this[W0]=`https://${o}:${s}`,":authority"in this[dt]||(this[dt][":authority"]=`${o}:${s}`)),a&&this.setTimeout(a),n&&this.once("response",n),this[Tl]=!1}get method(){return this[dt][$2]}set method(e){e&&(this[dt][$2]=e.toUpperCase())}get path(){return this[dt][G2]}set path(e){e&&(this[dt][G2]=e)}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,r,n){if(this._mustNotHaveABody){n(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let i=()=>this._request.write(e,r,n);this._request?i():this[ga].push(i)}_final(e){if(this.destroyed)return;this.flushHeaders();let r=()=>{if(this._mustNotHaveABody){e();return}this._request.end(e)};this._request?r():this[ga].push(r)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}_destroy(e,r){this.res&&this.res._dump(),this._request&&this._request.destroy(),r(e)}async flushHeaders(){if(this[Tl]||this.destroyed)return;this[Tl]=!0;let e=this.method===Y9,r=n=>{if(this._request=n,this.destroyed){n.destroy();return}e||H9(n,this,["timeout","continue","close","error"]);let i=o=>(...a)=>{!this.writable&&!this.destroyed?o(...a):this.once("finish",()=>{o(...a)})};n.once("response",i((o,a,u)=>{let c=new q9(this.socket,n.readableHighWaterMark);this.res=c,c.req=this,c.statusCode=o[H2],c.headers=o,c.rawHeaders=u,c.once("end",()=>{this.aborted?(c.aborted=!0,c.emit("aborted")):(c.complete=!0,c.socket=null,c.connection=null)}),e?(c.upgrade=!0,this.emit("connect",c,n,Buffer.alloc(0))?this.emit("close"):n.destroy()):(n.on("data",l=>{!c._dumped&&!c.push(l)&&n.pause()}),n.once("end",()=>{c.push(null)}),this.emit("response",c)||c._dump())})),n.once("headers",i(o=>this.emit("information",{statusCode:o[H2]}))),n.once("trailers",i((o,a,u)=>{let{res:c}=this;c.trailers=o,c.rawTrailers=u}));let{socket:s}=n.session;this.socket=s,this.connection=s;for(let o of this[ga])o();this.emit("socket",this.socket)};if(this[Y0])try{r(this[Y0].request(this[dt]))}catch(n){this.emit("error",n)}else{this.reusedSocket=!0;try{r(await this.agent.request(this[W0],this[z2],this[dt]))}catch(n){this.emit("error",n)}}}getHeader(e){if(typeof e!="string")throw new V0("name","string",e);return this[dt][e.toLowerCase()]}get headersSent(){return this[Tl]}removeHeader(e){if(typeof e!="string")throw new V0("name","string",e);if(this.headersSent)throw new U2("remove");delete this[dt][e.toLowerCase()]}setHeader(e,r){if(this.headersSent)throw new U2("set");if(typeof e!="string"||!K9.test(e)&&!$9(e))throw new z9("Header name",e);if(typeof r=="undefined")throw new V9(r,e);if(Z9.test(r))throw new W9("header content",e);this[dt][e.toLowerCase()]=r}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,r){let n=()=>this._request.setTimeout(e,r);return this._request?n():this[ga].push(n),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};V2.exports=K0});var Y2=A((QY,W2)=>{"use strict";var J9=require("tls");W2.exports=(t={},e=J9.connect)=>new Promise((r,n)=>{let i=!1,s,o=async()=>{await u,s.off("timeout",a),s.off("error",n),t.resolveSocket?(r({alpnProtocol:s.alpnProtocol,socket:s,timeout:i}),i&&(await Promise.resolve(),s.emit("timeout"))):(s.destroy(),r({alpnProtocol:s.alpnProtocol,timeout:i}))},a=async()=>{i=!0,o()},u=(async()=>{try{s=await e(t,o),s.on("error",n),s.once("timeout",a)}catch(c){n(c)}})()})});var Z2=A((eK,K2)=>{"use strict";var X9=require("net");K2.exports=t=>{let e=t.host,r=t.headers&&t.headers.host;return r&&(r.startsWith("[")?r.indexOf("]")===-1?e=r:e=r.slice(1,-1):e=r.split(":",1)[0]),X9.isIP(e)?"":e}});var Q2=A((tK,X0)=>{"use strict";var J2=require("http"),J0=require("https"),Q9=Y2(),eq=q0(),tq=Z0(),rq=Z2(),nq=z0(),Ol=new eq({maxSize:100}),_a=new Map,X2=(t,e,r)=>{e._httpMessage={shouldKeepAlive:!0};let n=()=>{t.emit("free",e,r)};e.on("free",n);let i=()=>{t.removeSocket(e,r)};e.on("close",i);let s=()=>{t.removeSocket(e,r),e.off("close",i),e.off("free",n),e.off("agentRemove",s)};e.on("agentRemove",s),t.emit("free",e,r)},iq=async t=>{let e=`${t.host}:${t.port}:${t.ALPNProtocols.sort()}`;if(!Ol.has(e)){if(_a.has(e))return(await _a.get(e)).alpnProtocol;let{path:r,agent:n}=t;t.path=t.socketPath;let i=Q9(t);_a.set(e,i);try{let{socket:s,alpnProtocol:o}=await i;if(Ol.set(e,o),t.path=r,o==="h2")s.destroy();else{let{globalAgent:a}=J0,u=J0.Agent.prototype.createConnection;n?n.createConnection===u?X2(n,s,t):s.destroy():a.createConnection===u?X2(a,s,t):s.destroy()}return _a.delete(e),o}catch(s){throw _a.delete(e),s}}return Ol.get(e)};X0.exports=async(t,e,r)=>{if((typeof t=="string"||t instanceof URL)&&(t=nq(new URL(t))),typeof e=="function"&&(r=e,e=void 0),e={ALPNProtocols:["h2","http/1.1"],...t,...e,resolveSocket:!0},!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");e.protocol=e.protocol||"https:";let n=e.protocol==="https:";e.host=e.hostname||e.host||"localhost",e.session=e.tlsSession,e.servername=e.servername||rq(e),e.port=e.port||(n?443:80),e._defaultAgent=n?J0.globalAgent:J2.globalAgent;let i=e.agent;if(i){if(i.addRequest)throw new Error("The `options.agent` object can contain only `http`, `https` or `http2` properties");e.agent=i[n?"https":"http"]}return n&&await iq(e)==="h2"?(i&&(e.agent=i.http2),new tq(e,r)):J2.request(e,r)};X0.exports.protocolCache=Ol});var tR=A((rK,eR)=>{"use strict";var sq=require("http2"),oq=H0(),Q0=Z0(),aq=G0(),uq=Q2(),cq=(t,e,r)=>new Q0(t,e,r),lq=(t,e,r)=>{let n=new Q0(t,e,r);return n.end(),n};eR.exports={...sq,ClientRequest:Q0,IncomingMessage:aq,...oq,request:cq,get:lq,auto:uq}});var ty=A(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});var rR=en();ey.default=t=>rR.default.nodeStream(t)&&rR.default.function_(t.getBoundary)});var oR=A(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});var iR=require("fs"),sR=require("util"),nR=en(),hq=ty(),fq=sR.promisify(iR.stat);ry.default=async(t,e)=>{if(e&&"content-length"in e)return Number(e["content-length"]);if(!t)return 0;if(nR.default.string(t))return Buffer.byteLength(t);if(nR.default.buffer(t))return t.length;if(hq.default(t))return sR.promisify(t.getLength.bind(t))();if(t instanceof iR.ReadStream){let{size:r}=await fq(t.path);return r===0?void 0:r}}});var iy=A(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});function dq(t,e,r){let n={};for(let i of r)n[i]=(...s)=>{e.emit(i,...s)},t.on(i,n[i]);return()=>{for(let i of r)t.off(i,n[i])}}ny.default=dq});var aR=A(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.default=()=>{let t=[];return{once(e,r,n){e.once(r,n),t.push({origin:e,event:r,fn:n})},unhandleAll(){for(let e of t){let{origin:r,event:n,fn:i}=e;r.removeListener(n,i)}t.length=0}}}});var cR=A(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.TimeoutError=void 0;var pq=require("net"),mq=aR(),uR=Symbol("reentry"),yq=()=>{},Fl=class extends Error{constructor(e,r){super(`Timeout awaiting '${r}' for ${e}ms`),this.event=r,this.name="TimeoutError",this.code="ETIMEDOUT"}};ba.TimeoutError=Fl;ba.default=(t,e,r)=>{if(uR in t)return yq;t[uR]=!0;let n=[],{once:i,unhandleAll:s}=mq.default(),o=(h,f,d)=>{var m;let y=setTimeout(f,h,h,d);(m=y.unref)===null||m===void 0||m.call(y);let p=()=>{clearTimeout(y)};return n.push(p),p},{host:a,hostname:u}=r,c=(h,f)=>{t.destroy(new Fl(h,f))},l=()=>{for(let h of n)h();s()};if(t.once("error",h=>{if(l(),t.listenerCount("error")===0)throw h}),t.once("close",l),i(t,"response",h=>{i(h,"end",l)}),typeof e.request!="undefined"&&o(e.request,c,"request"),typeof e.socket!="undefined"){let h=()=>{c(e.socket,"socket")};t.setTimeout(e.socket,h),n.push(()=>{t.removeListener("timeout",h)})}return i(t,"socket",h=>{var f;let{socketPath:d}=t;if(h.connecting){let m=!!(d!=null?d:pq.isIP((f=u!=null?u:a)!==null&&f!==void 0?f:"")!==0);if(typeof e.lookup!="undefined"&&!m&&typeof h.address().address=="undefined"){let y=o(e.lookup,c,"lookup");i(h,"lookup",y)}if(typeof e.connect!="undefined"){let y=()=>o(e.connect,c,"connect");m?i(h,"connect",y()):i(h,"lookup",p=>{p===null&&i(h,"connect",y())})}typeof e.secureConnect!="undefined"&&r.protocol==="https:"&&i(h,"connect",()=>{let y=o(e.secureConnect,c,"secureConnect");i(h,"secureConnect",y)})}if(typeof e.send!="undefined"){let m=()=>o(e.send,c,"send");h.connecting?i(h,"connect",()=>{i(t,"upload-complete",m())}):i(t,"upload-complete",m())}}),typeof e.response!="undefined"&&i(t,"upload-complete",()=>{let h=o(e.response,c,"response");i(t,"response",h)}),l}});var hR=A(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});var lR=en();oy.default=t=>{t=t;let e={protocol:t.protocol,hostname:lR.default.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return lR.default.string(t.port)&&t.port.length>0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}});var fR=A(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});var gq=require("url"),_q=["protocol","host","hostname","port","pathname","search"];ay.default=(t,e)=>{var r,n;if(e.path){if(e.pathname)throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.");if(e.search)throw new TypeError("Parameters `path` and `search` are mutually exclusive.");if(e.searchParams)throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}if(e.search&&e.searchParams)throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.");if(!t){if(!e.protocol)throw new TypeError("No URL protocol specified");t=`${e.protocol}//${(n=(r=e.hostname)!==null&&r!==void 0?r:e.host)!==null&&n!==void 0?n:""}`}let i=new gq.URL(t);if(e.path){let s=e.path.indexOf("?");s===-1?e.pathname=e.path:(e.pathname=e.path.slice(0,s),e.search=e.path.slice(s+1)),delete e.path}for(let s of _q)e[s]&&(i[s]=e[s].toString());return i}});var dR=A(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});var uy=class{constructor(){this.weakMap=new WeakMap,this.map=new Map}set(e,r){typeof e=="object"?this.weakMap.set(e,r):this.map.set(e,r)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}};cy.default=uy});var hy=A(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});var bq=async t=>{let e=[],r=0;for await(let n of t)e.push(n),r+=Buffer.byteLength(n);return Buffer.isBuffer(e[0])?Buffer.concat(e,r):Buffer.from(e.join(""))};ly.default=bq});var mR=A(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.dnsLookupIpVersionToFamily=mi.isDnsLookupIpVersion=void 0;var pR={auto:0,ipv4:4,ipv6:6};mi.isDnsLookupIpVersion=t=>t in pR;mi.dnsLookupIpVersionToFamily=t=>{if(mi.isDnsLookupIpVersion(t))return pR[t];throw new Error("Invalid DNS lookup IP version")}});var fy=A(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.isResponseOk=void 0;Pl.isResponseOk=t=>{let{statusCode:e}=t,r=t.request.options.followRedirect?299:399;return e>=200&&e<=r||e===304}});var gR=A(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});var yR=new Set;dy.default=t=>{yR.has(t)||(yR.add(t),process.emitWarning(`Got: ${t}`,{type:"DeprecationWarning"}))}});var _R=A(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});var Be=en(),vq=(t,e)=>{if(Be.default.null_(t.encoding))throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");Be.assert.any([Be.default.string,Be.default.undefined],t.encoding),Be.assert.any([Be.default.boolean,Be.default.undefined],t.resolveBodyOnly),Be.assert.any([Be.default.boolean,Be.default.undefined],t.methodRewriting),Be.assert.any([Be.default.boolean,Be.default.undefined],t.isStream),Be.assert.any([Be.default.string,Be.default.undefined],t.responseType),t.responseType===void 0&&(t.responseType="text");let{retry:r}=t;if(e?t.retry={...e.retry}:t.retry={calculateDelay:n=>n.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},Be.default.object(r)?(t.retry={...t.retry,...r},t.retry.methods=[...new Set(t.retry.methods.map(n=>n.toUpperCase()))],t.retry.statusCodes=[...new Set(t.retry.statusCodes)],t.retry.errorCodes=[...new Set(t.retry.errorCodes)]):Be.default.number(r)&&(t.retry.limit=r),Be.default.undefined(t.retry.maxRetryAfter)&&(t.retry.maxRetryAfter=Math.min(...[t.timeout.request,t.timeout.connect].filter(Be.default.number))),Be.default.object(t.pagination)){e&&(t.pagination={...e.pagination,...t.pagination});let{pagination:n}=t;if(!Be.default.function_(n.transform))throw new Error("`options.pagination.transform` must be implemented");if(!Be.default.function_(n.shouldContinue))throw new Error("`options.pagination.shouldContinue` must be implemented");if(!Be.default.function_(n.filter))throw new TypeError("`options.pagination.filter` must be implemented");if(!Be.default.function_(n.paginate))throw new Error("`options.pagination.paginate` must be implemented")}return t.responseType==="json"&&t.headers.accept===void 0&&(t.headers.accept="application/json"),t};py.default=vq});var bR=A(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.retryAfterStatusCodes=void 0;va.retryAfterStatusCodes=new Set([413,429,503]);var Eq=({attemptCount:t,retryOptions:e,error:r,retryAfter:n})=>{if(t>e.limit)return 0;let i=e.methods.includes(r.options.method),s=e.errorCodes.includes(r.code),o=r.response&&e.statusCodes.includes(r.response.statusCode);if(!i||!s&&!o)return 0;if(r.response){if(n)return e.maxRetryAfter===void 0||n>e.maxRetryAfter?0:n;if(r.response.statusCode===413)return 0}let a=Math.random()*100;return 2**(t-1)*1e3+a};va.default=Eq});var xa=A(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.UnsupportedProtocolError=ke.ReadError=ke.TimeoutError=ke.UploadError=ke.CacheError=ke.HTTPError=ke.MaxRedirectsError=ke.RequestError=ke.setNonEnumerableProperties=ke.knownHookEvents=ke.withoutBody=ke.kIsNormalizedAlready=void 0;var vR=require("util"),ER=require("stream"),wq=require("fs"),Pn=require("url"),wR=require("http"),my=require("http"),xq=require("https"),Sq=LC(),Aq=HC(),xR=w2(),Dq=D2(),Cq=tR(),Rq=Rl(),K=en(),kq=oR(),SR=ty(),Tq=iy(),AR=cR(),Oq=hR(),DR=fR(),Fq=dR(),Pq=hy(),CR=mR(),Iq=fy(),In=gR(),Lq=_R(),Bq=bR(),yy,nt=Symbol("request"),Bl=Symbol("response"),Ys=Symbol("responseSize"),Ks=Symbol("downloadedSize"),Zs=Symbol("bodySize"),Js=Symbol("uploadedSize"),Il=Symbol("serverResponsesPiped"),RR=Symbol("unproxyEvents"),kR=Symbol("isFromCache"),gy=Symbol("cancelTimeouts"),TR=Symbol("startedReading"),Xs=Symbol("stopReading"),Ll=Symbol("triggerRead"),Ln=Symbol("body"),Ea=Symbol("jobs"),OR=Symbol("originalResponse"),FR=Symbol("retryTimeout");ke.kIsNormalizedAlready=Symbol("isNormalizedAlready");var Nq=K.default.string(process.versions.brotli);ke.withoutBody=new Set(["GET","HEAD"]);ke.knownHookEvents=["init","beforeRequest","beforeRedirect","beforeError","beforeRetry","afterResponse"];function Mq(t){for(let e in t){let r=t[e];if(!K.default.string(r)&&!K.default.number(r)&&!K.default.boolean(r)&&!K.default.null_(r)&&!K.default.undefined(r))throw new TypeError(`The \`searchParams\` value '${String(r)}' must be a string, number, boolean or null`)}}function jq(t){return K.default.object(t)&&!("statusCode"in t)}var _y=new Fq.default,qq=async t=>new Promise((e,r)=>{let n=i=>{r(i)};t.pending||e(),t.once("error",n),t.once("ready",()=>{t.off("error",n),e()})}),Uq=new Set([300,301,302,303,304,307,308]),Hq=["context","body","json","form"];ke.setNonEnumerableProperties=(t,e)=>{let r={};for(let n of t)if(n)for(let i of Hq)i in n&&(r[i]={writable:!0,configurable:!0,enumerable:!1,value:n[i]});Object.defineProperties(e,r)};var Ue=class extends Error{constructor(e,r,n){var i,s;if(super(e),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=(i=r.code)!==null&&i!==void 0?i:"ERR_GOT_REQUEST_ERROR",n instanceof $l?(Object.defineProperty(this,"request",{enumerable:!1,value:n}),Object.defineProperty(this,"response",{enumerable:!1,value:n[Bl]}),Object.defineProperty(this,"options",{enumerable:!1,value:n.options})):Object.defineProperty(this,"options",{enumerable:!1,value:n}),this.timings=(s=this.request)===null||s===void 0?void 0:s.timings,K.default.string(r.stack)&&K.default.string(this.stack)){let o=this.stack.indexOf(this.message)+this.message.length,a=this.stack.slice(o).split(`
|
|
27
27
|
`).reverse(),u=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
|
|
28
28
|
`).reverse();for(;u.length!==0&&u[0]===a[0];)a.shift();this.stack=`${this.stack.slice(0,o)}${a.reverse().join(`
|
|
29
29
|
`)}${u.reverse().join(`
|
|
30
|
-
`)}`}}};ke.RequestError=Ue;var Nl=class extends Ue{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};ke.MaxRedirectsError=Nl;var Ml=class extends Ue{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};ke.HTTPError=Ml;var jl=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};ke.CacheError=jl;var ql=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};ke.UploadError=ql;var Ul=class extends Ue{constructor(e,r,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=r}};ke.TimeoutError=Ul;var wa=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};ke.ReadError=wa;var Hl=class extends Ue{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};ke.UnsupportedProtocolError=Hl;var $q=["socket","connect","continue","information","upgrade","timeout"],$l=class extends ER.Duplex{constructor(e,r={},n){super({autoDestroy:!1,highWaterMark:0}),this[Ks]=0,this[Js]=0,this.requestInitialized=!1,this[Il]=new Set,this.redirects=[],this[Xs]=!1,this[Ll]=!1,this[Ea]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",i),c.on("data",s),c.prependListener("end",i),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",i),c.off("data",s),c.off("end",i),c.off("end",s)}),this.on("pipe",c=>{c instanceof my.IncomingMessage&&(this.options.headers={...c.headers,...this.options.headers})});let{json:o,body:a,form:u}=r;if((o||a||u)&&this._lockWrite(),ke.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,n)}catch(c){K.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof wq.ReadStream&&await qq(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[nt])===null||c===void 0||c.destroy();return}for(let h of this[Ea])h();this[Ea].length=0,this.requestInitialized=!0}catch(l){if(l instanceof Ue){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,r,n){var i,s,o,a,u;let c=r;if(K.default.object(e)&&!K.default.urlInstance(e))r={...n,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...n,...r},e!==void 0&&(r.url=e),K.default.urlInstance(r.url)&&(r.url=new Pn.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),K.assert.any([K.default.string,K.default.undefined],r.method),K.assert.any([K.default.object,K.default.undefined],r.headers),K.assert.any([K.default.string,K.default.urlInstance,K.default.undefined],r.prefixUrl),K.assert.any([K.default.object,K.default.undefined],r.cookieJar),K.assert.any([K.default.object,K.default.string,K.default.undefined],r.searchParams),K.assert.any([K.default.object,K.default.string,K.default.undefined],r.cache),K.assert.any([K.default.object,K.default.number,K.default.undefined],r.timeout),K.assert.any([K.default.object,K.default.undefined],r.context),K.assert.any([K.default.object,K.default.undefined],r.hooks),K.assert.any([K.default.boolean,K.default.undefined],r.decompress),K.assert.any([K.default.boolean,K.default.undefined],r.ignoreInvalidCookies),K.assert.any([K.default.boolean,K.default.undefined],r.followRedirect),K.assert.any([K.default.number,K.default.undefined],r.maxRedirects),K.assert.any([K.default.boolean,K.default.undefined],r.throwHttpErrors),K.assert.any([K.default.boolean,K.default.undefined],r.http2),K.assert.any([K.default.boolean,K.default.undefined],r.allowGetBody),K.assert.any([K.default.string,K.default.undefined],r.localAddress),K.assert.any([CR.isDnsLookupIpVersion,K.default.undefined],r.dnsLookupIpVersion),K.assert.any([K.default.object,K.default.undefined],r.https),K.assert.any([K.default.boolean,K.default.undefined],r.rejectUnauthorized),r.https&&(K.assert.any([K.default.boolean,K.default.undefined],r.https.rejectUnauthorized),K.assert.any([K.default.function_,K.default.undefined],r.https.checkServerIdentity),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.certificateAuthority),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.key),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.certificate),K.assert.any([K.default.string,K.default.undefined],r.https.passphrase),K.assert.any([K.default.string,K.default.buffer,K.default.array,K.default.undefined],r.https.pfx)),K.assert.any([K.default.object,K.default.undefined],r.cacheOptions),K.default.string(r.method)?r.method=r.method.toUpperCase():r.method="GET",r.headers===(n==null?void 0:n.headers)?r.headers={...r.headers}:r.headers=Rq({...n==null?void 0:n.headers,...r.headers}),"slashes"in r)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in r)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in r&&r.searchParams&&r.searchParams!==(n==null?void 0:n.searchParams)){let d;if(K.default.string(r.searchParams)||r.searchParams instanceof Pn.URLSearchParams)d=new Pn.URLSearchParams(r.searchParams);else{Mq(r.searchParams),d=new Pn.URLSearchParams;for(let m in r.searchParams){let y=r.searchParams[m];y===null?d.append(m,""):y!==void 0&&d.append(m,y)}}(i=n==null?void 0:n.searchParams)===null||i===void 0||i.forEach((m,y)=>{d.has(y)||d.append(y,m)}),r.searchParams=d}if(r.username=(s=r.username)!==null&&s!==void 0?s:"",r.password=(o=r.password)!==null&&o!==void 0?o:"",K.default.undefined(r.prefixUrl)?r.prefixUrl=(a=n==null?void 0:n.prefixUrl)!==null&&a!==void 0?a:"":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")&&(r.prefixUrl+="/")),K.default.string(r.url)){if(r.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");r.url=DR.default(r.prefixUrl+r.url,r)}else(K.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol)&&(r.url=DR.default(r.prefixUrl,r));if(r.url){"port"in r&&delete r.port;let{prefixUrl:d}=r;Object.defineProperty(r,"prefixUrl",{set:y=>{let p=r.url;if(!p.href.startsWith(y))throw new Error(`Cannot change \`prefixUrl\` from ${d} to ${y}: ${p.href}`);r.url=new Pn.URL(y+p.href.slice(d.length)),d=y},get:()=>d});let{protocol:m}=r.url;if(m==="unix:"&&(m="http:",r.url=new Pn.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),m!=="http:"&&m!=="https:")throw new Hl(r);r.username===""?r.username=r.url.username:r.url.username=r.username,r.password===""?r.password=r.url.password:r.url.password=r.password}let{cookieJar:l}=r;if(l){let{setCookie:d,getCookieString:m}=l;K.assert.function_(d),K.assert.function_(m),d.length===4&&m.length===0&&(d=vR.promisify(d.bind(r.cookieJar)),m=vR.promisify(m.bind(r.cookieJar)),r.cookieJar={setCookie:d,getCookieString:m})}let{cache:h}=r;if(h&&(_y.has(h)||_y.set(h,new xR((d,m)=>{let y=d[nt](d,m);return K.default.promise(y)&&(y.once=(p,w)=>{if(p==="error")y.catch(w);else if(p==="abort")(async()=>{try{(await y).once("abort",w)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${p}`);return y}),y},h))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)yy||(yy=new Aq.default),r.dnsCache=yy;else if(!K.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${K.default(r.dnsCache)}`);K.default.number(r.timeout)?r.timeout={request:r.timeout}:n&&r.timeout!==n.timeout?r.timeout={...n.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let f=r.hooks===(n==null?void 0:n.hooks);r.hooks={...r.hooks};for(let d of ke.knownHookEvents)if(d in r.hooks)if(K.default.array(r.hooks[d]))r.hooks[d]=[...r.hooks[d]];else throw new TypeError(`Parameter \`${d}\` must be an Array, got ${K.default(r.hooks[d])}`);else r.hooks[d]=[];if(n&&!f)for(let d of ke.knownHookEvents)n.hooks[d].length>0&&(r.hooks[d]=[...n.hooks[d],...r.hooks[d]]);if("family"in r&&In.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n!=null&&n.https&&(r.https={...n.https,...r.https}),"rejectUnauthorized"in r&&In.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in r&&In.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in r&&In.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in r&&In.default('"options.key" was never documented, please use "options.https.key"'),"cert"in r&&In.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in r&&In.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in r&&In.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in r)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(r.agent){for(let d in r.agent)if(d!=="http"&&d!=="https"&&d!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${d}\``)}return r.maxRedirects=(u=r.maxRedirects)!==null&&u!==void 0?u:0,ke.setNonEnumerableProperties([n,c],r),Lq.default(r,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!K.default.undefined(e.form),i=!K.default.undefined(e.json),s=!K.default.undefined(e.body),o=n||i||s,a=ke.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,o){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([s,n,i].filter(u=>u).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(s&&!(e.body instanceof ER.Readable)&&!K.default.string(e.body)&&!K.default.buffer(e.body)&&!SR.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!K.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let u=!K.default.string(r["content-type"]);s?(SR.default(e.body)&&u&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[Ln]=e.body):n?(u&&(r["content-type"]="application/x-www-form-urlencoded"),this[Ln]=new Pn.URLSearchParams(e.form).toString()):(u&&(r["content-type"]="application/json"),this[Ln]=e.stringifyJson(e.json));let c=await kq.default(this[Ln],e.headers);K.default.undefined(r["content-length"])&&K.default.undefined(r["transfer-encoding"])&&!a&&!K.default.undefined(c)&&(r["content-length"]=String(c))}}else a?this._lockWrite():this._unlockWrite();this[Zs]=Number(r["content-length"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:n}=r;this[OR]=e,r.decompress&&(e=Dq(e));let i=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:wR.STATUS_CODES[i],s.url=r.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirects,s.request=this,s.isFromCache=e.fromCache||!1,s.ip=this.ip,s.retryCount=this.retryCount,this[kR]=s.isFromCache,this[Ys]=Number(e.headers["content-length"])||void 0,this[Bl]=e,e.once("end",()=>{this[Ys]=this[Ks],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new wa(a,this))}),e.once("aborted",()=>{this._beforeError(new wa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(K.default.object(r.cookieJar)&&o){let a=o.map(async u=>r.cookieJar.setCookie(u,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async u=>u.catch(()=>{})));try{await Promise.all(a)}catch(u){this._beforeError(u);return}}if(r.followRedirect&&e.headers.location&&Uq.has(i)){if(e.resume(),this[nt]&&(this[gy](),delete this[nt],this[RR]()),(i===303&&r.method!=="GET"&&r.method!=="HEAD"||!r.methodRewriting)&&(r.method="GET","body"in r&&delete r.body,"json"in r&&delete r.json,"form"in r&&delete r.form,this[Ln]=void 0,delete r.headers["content-length"]),this.redirects.length>=r.maxRedirects){this._beforeError(new Nl(this));return}try{let h=function(f){return f.protocol==="unix:"||f.hostname==="unix"},u=Buffer.from(e.headers.location,"binary").toString(),c=new Pn.URL(u,n),l=c.toString();if(decodeURI(l),!h(n)&&h(c)){this._beforeError(new Ue("Cannot redirect to UNIX socket",{},this));return}c.hostname!==n.hostname||c.port!==n.port?("host"in r.headers&&delete r.headers.host,"cookie"in r.headers&&delete r.headers.cookie,"authorization"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username="",r.password="")):(c.username=r.username,c.password=r.password),this.redirects.push(l),r.url=c;for(let f of r.hooks.beforeRedirect)await f(r,s);this.emit("redirect",s,r),await this._makeRequest()}catch(u){this._beforeError(u);return}return}if(r.isStream&&r.throwHttpErrors&&!Iq.isResponseOk(s)){this._beforeError(new Ml(s));return}e.on("readable",()=>{this[Ll]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[Il])if(!a.headersSent){for(let u in e.headers){let c=r.decompress?u!=="content-encoding":!0,l=e.headers[u];c&&a.setHeader(u,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:i}=r;Sq.default(e),this[gy]=AR.default(e,n,i);let s=r.cache?"cacheableResponse":"response";e.once(s,u=>{this._onResponse(u)}),e.once("error",u=>{var c;e.destroy(),(c=e.res)===null||c===void 0||c.removeAllListeners("end"),u=u instanceof AR.TimeoutError?new Ul(u,this.timings,this):new Ue(u.message,u,this),this._beforeError(u)}),this[RR]=Tq.default(e,this,$q),this[nt]=e,this.emit("uploadProgress",this.uploadProgress);let o=this[Ln],a=this.redirects.length===0?this:e;K.default.nodeStream(o)?(o.pipe(a),o.once("error",u=>{this._beforeError(new ql(u,this))})):(this._unlockWrite(),K.default.undefined(o)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(o,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,r){return new Promise((n,i)=>{Object.assign(r,Oq.default(e)),delete r.url;let s,o=_y.get(r.cache)(r,async a=>{a._readableState.autoDestroy=!1,s&&(await s).emit("cacheableResponse",a),n(a)});r.url=e,o.once("error",i),o.once("request",async a=>{s=a,n(s)})})}async _makeRequest(){var e,r,n,i,s;let{options:o}=this,{headers:a}=o;for(let w in a)if(K.default.undefined(a[w]))delete a[w];else if(K.default.null_(a[w]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${w}\` header`);if(o.decompress&&K.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=Nq?"gzip, deflate, br":"gzip, deflate"),o.cookieJar){let w=await o.cookieJar.getCookieString(o.url.toString());K.default.nonEmptyString(w)&&(o.headers.cookie=w)}for(let w of o.hooks.beforeRequest){let O=await w(o);if(!K.default.undefined(O)){o.request=()=>O;break}}o.body&&this[Ln]!==o.body&&(this[Ln]=o.body);let{agent:u,request:c,timeout:l,url:h}=o;if(o.dnsCache&&!("lookup"in o)&&(o.lookup=o.dnsCache.lookup),h.hostname==="unix"){let w=/(?<socketPath>.+?):(?<path>.+)/.exec(`${h.pathname}${h.search}`);if(w!=null&&w.groups){let{socketPath:O,path:P}=w.groups;Object.assign(o,{socketPath:O,path:P,host:""})}}let f=h.protocol==="https:",d;o.http2?d=Cq.auto:d=f?xq.request:wR.request;let m=(e=o.request)!==null&&e!==void 0?e:d,y=o.cache?this._createCacheableRequest:m;u&&!o.http2&&(o.agent=u[f?"https":"http"]),o[nt]=m,delete o.request,delete o.timeout;let p=o;if(p.shared=(r=o.cacheOptions)===null||r===void 0?void 0:r.shared,p.cacheHeuristic=(n=o.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,p.immutableMinTimeToLive=(i=o.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,p.ignoreCargoCult=(s=o.cacheOptions)===null||s===void 0?void 0:s.ignoreCargoCult,o.dnsLookupIpVersion!==void 0)try{p.family=CR.dnsLookupIpVersionToFamily(o.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}o.https&&("rejectUnauthorized"in o.https&&(p.rejectUnauthorized=o.https.rejectUnauthorized),o.https.checkServerIdentity&&(p.checkServerIdentity=o.https.checkServerIdentity),o.https.certificateAuthority&&(p.ca=o.https.certificateAuthority),o.https.certificate&&(p.cert=o.https.certificate),o.https.key&&(p.key=o.https.key),o.https.passphrase&&(p.passphrase=o.https.passphrase),o.https.pfx&&(p.pfx=o.https.pfx));try{let w=await y(h,p);K.default.undefined(w)&&(w=d(h,p)),o.request=c,o.timeout=l,o.agent=u,o.https&&("rejectUnauthorized"in o.https&&delete p.rejectUnauthorized,o.https.checkServerIdentity&&delete p.checkServerIdentity,o.https.certificateAuthority&&delete p.ca,o.https.certificate&&delete p.cert,o.https.key&&delete p.key,o.https.passphrase&&delete p.passphrase,o.https.pfx&&delete p.pfx),jq(w)?this._onRequest(w):this.writable?(this.once("finish",()=>{this._onResponse(w)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(w)}catch(w){throw w instanceof xR.CacheError?new jl(w,this):new Ue(w.message,w,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ue(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[Xs])return;let{options:r}=this,n=this.retryCount+1;this[Xs]=!0,e instanceof Ue||(e=new Ue(e.message,e,this));let i=e,{response:s}=i;(async()=>{if(s&&!s.body){s.setEncoding(this._readableState.encoding);try{s.rawBody=await Pq.default(s),s.body=s.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let o;try{let a;s&&"retry-after"in s.headers&&(a=Number(s.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(s.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),o=await r.retry.calculateDelay({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:Bq.default({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new Ue(a.message,a,this));return}if(o){let a=async()=>{try{for(let u of this.options.hooks.beforeRetry)await u(this.options,i,n)}catch(u){this._error(new Ue(u.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[FR]=setTimeout(a,o);return}}this._error(i)})()}_read(){this[Ll]=!0;let e=this[Bl];if(e&&!this[Xs]){e.readableLength&&(this[Ll]=!1);let r;for(;(r=e.read())!==null;){this[Ks]+=r.length,this[TR]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let i=()=>{this._writeRequest(e,r,n)};this.requestInitialized?i():this[Ea].push(i)}_writeRequest(e,r,n){this[nt].destroyed||(this._progressCallbacks.push(()=>{this[Js]+=Buffer.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[nt].write(e,r,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(nt in this)){e();return}if(this[nt].destroyed){e();return}this[nt].end(n=>{n||(this[Zs]=this[Js],this.emit("uploadProgress",this.uploadProgress),this[nt].emit("upload-complete")),e(n)})};this.requestInitialized?r():this[Ea].push(r)}_destroy(e,r){var n;this[Xs]=!0,clearTimeout(this[FR]),nt in this&&(this[gy](),!((n=this[Bl])===null||n===void 0)&&n.complete||this[nt].destroy()),e!==null&&!K.default.undefined(e)&&!(e instanceof Ue)&&(e=new Ue(e.message,e,this)),r(e)}get _isAboutToError(){return this[Xs]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,n;return((r=(e=this[nt])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((n=this[OR])===null||n===void 0)&&n.complete)}get socket(){var e,r;return(r=(e=this[nt])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[Ys]?e=this[Ks]/this[Ys]:this[Ys]===this[Ks]?e=1:e=0,{percent:e,transferred:this[Ks],total:this[Ys]}}get uploadProgress(){let e;return this[Zs]?e=this[Js]/this[Zs]:this[Zs]===this[Js]?e=1:e=0,{percent:e,transferred:this[Js],total:this[Zs]}}get timings(){var e;return(e=this[nt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[kR]}pipe(e,r){if(this[TR])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof my.ServerResponse&&this[Il].add(e),super.pipe(e,r)}unpipe(e){return e instanceof my.ServerResponse&&this[Il].delete(e),super.unpipe(e),this}};ke.default=$l});var Sa=A(cr=>{"use strict";var Gq=cr&&cr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zq=cr&&cr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gq(e,t,r)};Object.defineProperty(cr,"__esModule",{value:!0});cr.CancelError=cr.ParseError=void 0;var PR=xa(),by=class extends PR.RequestError{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};cr.ParseError=by;var vy=class extends PR.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};cr.CancelError=vy;zq(xa(),cr)});var LR=A(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});var IR=Sa(),Vq=(t,e,r,n)=>{let{rawBody:i}=t;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":r(i.toString());if(e==="buffer")return i;throw new IR.ParseError({message:`Unknown body type '${e}'`,name:"Error"},t)}catch(s){throw new IR.ParseError(s,t)}};Ey.default=Vq});var wy=A(Bn=>{"use strict";var Wq=Bn&&Bn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Yq=Bn&&Bn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wq(e,t,r)};Object.defineProperty(Bn,"__esModule",{value:!0});var Kq=require("events"),Zq=en(),Jq=PC(),Gl=Sa(),BR=LR(),NR=xa(),Xq=iy(),Qq=hy(),MR=fy(),eU=["request","response","redirect","uploadProgress","downloadProgress"];function jR(t){let e,r,n=new Kq.EventEmitter,i=new Jq((o,a,u)=>{let c=l=>{let h=new NR.default(void 0,t);h.retryCount=l,h._noPipe=!0,u(()=>h.destroy()),u.shouldReject=!1,u(()=>a(new Gl.CancelError(h))),e=h,h.once("response",async m=>{var y;if(m.retryCount=l,m.request.aborted)return;let p;try{p=await Qq.default(h),m.rawBody=p}catch{return}if(h._isAboutToError)return;let w=((y=m.headers["content-encoding"])!==null&&y!==void 0?y:"").toLowerCase(),O=["gzip","deflate","br"].includes(w),{options:P}=h;if(O&&!P.decompress)m.body=p;else try{m.body=BR.default(m,P.responseType,P.parseJson,P.encoding)}catch(I){if(m.body=p.toString(),MR.isResponseOk(m)){h._beforeError(I);return}}try{for(let[I,k]of P.hooks.afterResponse.entries())m=await k(m,async M=>{let x=NR.default.normalizeArguments(void 0,{...M,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},P);x.hooks.afterResponse=x.hooks.afterResponse.slice(0,I);for(let U of x.hooks.beforeRetry)await U(x);let D=jR(x);return u(()=>{D.catch(()=>{}),D.cancel()}),D})}catch(I){h._beforeError(new Gl.RequestError(I.message,I,h));return}if(r=m,!MR.isResponseOk(m)){h._beforeError(new Gl.HTTPError(m));return}h.destroy(),o(h.options.resolveBodyOnly?m.body:m)});let f=m=>{if(i.isCanceled)return;let{options:y}=h;if(m instanceof Gl.HTTPError&&!y.throwHttpErrors){let{response:p}=m;o(h.options.resolveBodyOnly?p.body:p);return}a(m)};h.once("error",f);let d=h.options.body;h.once("retry",(m,y)=>{var p,w;if(d===((p=y.request)===null||p===void 0?void 0:p.options.body)&&Zq.default.nodeStream((w=y.request)===null||w===void 0?void 0:w.options.body)){f(y);return}c(m)}),Xq.default(h,n,eU)};c(0)});i.on=(o,a)=>(n.on(o,a),i);let s=o=>{let a=(async()=>{await i;let{options:u}=r.request;return BR.default(r,o,u.parseJson,u.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:o}=e.options;return!e.writableFinished&&o.accept===void 0&&(o.accept="application/json"),s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}Bn.default=jR;Yq(Sa(),Bn)});var qR=A(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});var tU=Sa();function rU(t,...e){let r=(async()=>{if(t instanceof tU.RequestError)try{for(let i of e)if(i)for(let s of i)t=await s(t)}catch(i){t=i}throw t})(),n=()=>r;return r.json=n,r.text=n,r.buffer=n,r.on=n,r}xy.default=rU});var $R=A(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});var UR=en();function HR(t){for(let e of Object.values(t))(UR.default.plainObject(e)||UR.default.array(e))&&HR(e);return Object.freeze(t)}Sy.default=HR});var zR=A(GR=>{"use strict";Object.defineProperty(GR,"__esModule",{value:!0})});var Ay=A(Qt=>{"use strict";var nU=Qt&&Qt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iU=Qt&&Qt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nU(e,t,r)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.defaultHandler=void 0;var VR=en(),Xt=wy(),sU=qR(),Vl=xa(),oU=$R(),aU={RequestError:Xt.RequestError,CacheError:Xt.CacheError,ReadError:Xt.ReadError,HTTPError:Xt.HTTPError,MaxRedirectsError:Xt.MaxRedirectsError,TimeoutError:Xt.TimeoutError,ParseError:Xt.ParseError,CancelError:Xt.CancelError,UnsupportedProtocolError:Xt.UnsupportedProtocolError,UploadError:Xt.UploadError},uU=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:zl}=Vl.default,WR=(...t)=>{let e;for(let r of t)e=zl(void 0,r,e);return e},cU=t=>t.isStream?new Vl.default(void 0,t):Xt.default(t),lU=t=>"defaults"in t&&"options"in t.defaults,hU=["get","post","put","patch","head","delete"];Qt.defaultHandler=(t,e)=>e(t);var YR=(t,e)=>{if(t)for(let r of t)r(e)},KR=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(n=>(i,s)=>{let o,a=n(i,u=>(o=s(u),o));if(a!==o&&!i.isStream&&o){let u=a,{then:c,catch:l,finally:h}=u;Object.setPrototypeOf(u,Object.getPrototypeOf(o)),Object.defineProperties(u,Object.getOwnPropertyDescriptors(o)),u.then=c,u.catch=l,u.finally=h}return a});let e=(n,i={},s)=>{var o,a;let u=0,c=l=>t.handlers[u++](l,u===t.handlers.length?cU:c);if(VR.default.plainObject(n)){let l={...n,...i};Vl.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{YR(t.options.hooks.init,i),YR((o=i.hooks)===null||o===void 0?void 0:o.init,i)}catch(f){l=f}let h=zl(n,i,s!=null?s:t.options);if(h[Vl.kIsNormalizedAlready]=!0,l)throw new Xt.RequestError(l.message,l,h);return c(h)}catch(l){if(i.isStream)throw l;return sU.default(l,t.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[t.options],s=[...t._rawHandlers],o;for(let a of n)lU(a)?(i.push(a.defaults.options),s.push(...a.defaults._rawHandlers),o=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&s.push(...a.handlers),o=a.mutableDefaults);return s=s.filter(a=>a!==Qt.defaultHandler),s.length===0&&s.push(Qt.defaultHandler),KR({options:WR(...i),handlers:s,mutableDefaults:!!o})};let r=async function*(n,i){let s=zl(n,i,t.options);s.resolveBodyOnly=!1;let o=s.pagination;if(!VR.default.object(o))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:u}=o,c=0;for(;c<o.requestLimit;){c!==0&&await uU(o.backoff);let l=await e(void 0,void 0,s),h=await o.transform(l),f=[];for(let m of h)if(o.filter(m,a,f)&&(!o.shouldContinue(m,a,f)||(yield m,o.stackAllItems&&a.push(m),f.push(m),--u<=0)))return;let d=o.paginate(l,a,f);if(d===!1)return;d===l.request.options?s=l.request.options:d!==void 0&&(s=zl(void 0,d,s)),c++}};e.paginate=r,e.paginate.all=async(n,i)=>{let s=[];for await(let o of r(n,i))s.push(o);return s},e.paginate.each=r,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of hU)e[n]=(i,s)=>e(i,{...s,method:n}),e.stream[n]=(i,s)=>e(i,{...s,method:n,isStream:!0});return Object.assign(e,aU),Object.defineProperty(e,"defaults",{value:t.mutableDefaults?t:oU.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=WR,e};Qt.default=KR;iU(zR(),Qt)});var Cy=A((tn,Wl)=>{"use strict";var fU=tn&&tn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZR=tn&&tn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fU(e,t,r)};Object.defineProperty(tn,"__esModule",{value:!0});var dU=require("url"),JR=Ay(),pU={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType==="json"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,"link"))return!1;let e=t.headers.link.split(","),r;for(let n of e){let i=n.split(";");if(i[1].includes("next")){r=i[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new dU.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[JR.defaultHandler],mutableDefaults:!1},Dy=JR.default(pU);tn.default=Dy;Wl.exports=Dy;Wl.exports.default=Dy;Wl.exports.__esModule=!0;ZR(Ay(),tn);ZR(wy(),tn)});var ik=A((CK,nk)=>{function er(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,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))}nk.exports=er;er.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};er.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};er.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};er.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};er.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};er.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};er.prototype.start=er.prototype.try;er.prototype.errors=function(){return this._errors};er.prototype.attempts=function(){return this._attempts};er.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var sk=A(yi=>{var yU=ik();yi.operation=function(t){var e=yi.timeouts(t);return new yU(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};yi.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};yi.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};yi.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=yi.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var ak=A((kK,ok)=>{ok.exports=sk()});var ck=A((TK,uk)=>{var gU=ak();function _U(t,e){function r(n,i){var s=e||{},o;"randomize"in s||(s.randomize=!0),o=gU.operation(s);function a(l){i(l||new Error("Aborted"))}function u(l,h){if(l.bail){a(l);return}o.retry(l)?s.onRetry&&s.onRetry(l,h):i(o.mainError())}function c(l){var h;try{h=t(a,l)}catch(f){u(f,l);return}Promise.resolve(h).then(n).catch(function(d){u(d,l)})}o.attempt(c)}return new Promise(r)}uk.exports=_U});var Dk=A(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});function _7(t){return t&&t.__esModule?t:{default:t}}var wk=Object.defineProperty,vk=Object.getOwnPropertySymbols,b7=Object.prototype.hasOwnProperty,v7=Object.prototype.propertyIsEnumerable,Ek=(t,e,r)=>e in t?wk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E7=(t,e)=>{for(var r in e||(e={}))b7.call(e,r)&&Ek(t,r,e[r]);if(vk)for(var r of vk(e))v7.call(e,r)&&Ek(t,r,e[r]);return t},w7=(t,e)=>{for(var r in e)wk(t,r,{get:e[r],enumerable:!0})},x7=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),xk={};w7(xk,{configDir:()=>Ak,darwinConfig:()=>zy,getPathForPlatform:()=>Wy,getPlatform:()=>Gy,linuxConfig:()=>nh,winConfig:()=>Vy});var S7=require("fs/promises"),A7=require("path"),Sk=_7(A7);function Gy(){return process.platform}function nh(){if(process.env.XDG_CONFIG_HOME!==void 0)return process.env.XDG_CONFIG_HOME;if(process.env.HOME!==void 0)return Sk.default.join(process.env.HOME,".config")}function zy(){if(process.env.HOME!==void 0)return Sk.default.join(process.env.HOME,"/Library/Application Support")}function Vy(){return process.env.APPDATA}function Wy({platform:t}){switch(t){case"linux":return nh();case"darwin":return zy();case"win32":return Vy();default:return nh()}}function Ak(){return x7(this,arguments,function*(t={}){var e;let r=(e=t.platform)!=null?e:Gy(),n=Wy({platform:r});if(n!==void 0){if(t.validate===!1)return n;try{return yield S7.stat.call(void 0,n),n}catch{return}}})}Fr.__spreadValues=E7;Fr.getPlatform=Gy;Fr.linuxConfig=nh;Fr.darwinConfig=zy;Fr.winConfig=Vy;Fr.getPathForPlatform=Wy;Fr.configDir=Ak;Fr.config_dir_exports=xk});var Ck=A(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});var D7=Dk();Yy.configDir=D7.configDir});var Pk=A((yZ,N7)=>{N7.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Bk=A(qt=>{"use strict";var Lk=Pk(),Ye=process.env;Object.defineProperty(qt,"_vendors",{value:Lk.map(function(t){return t.constant})});qt.name=null;qt.isPR=null;Lk.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Ik(n)});if(qt[t.constant]=r,!!r)switch(qt.name=t.name,typeof t.pr){case"string":qt.isPR=!!Ye[t.pr];break;case"object":"env"in t.pr?qt.isPR=t.pr.env in Ye&&Ye[t.pr.env]!==t.pr.ne:"any"in t.pr?qt.isPR=t.pr.any.some(function(n){return!!Ye[n]}):qt.isPR=Ik(t.pr);break;default:qt.isPR=null}});qt.isCI=!!(Ye.CI!=="false"&&(Ye.BUILD_ID||Ye.BUILD_NUMBER||Ye.CI||Ye.CI_APP_ID||Ye.CI_BUILD_ID||Ye.CI_BUILD_NUMBER||Ye.CI_NAME||Ye.CONTINUOUS_INTEGRATION||Ye.RUN_ID||qt.name));function Ik(t){return typeof t=="string"?!!Ye[t]:"env"in t?Ye[t.env]&&Ye[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!Ye[e]}):Object.keys(t).every(function(e){return Ye[e]===t[e]})}});var eg=A((PZ,G7)=>{G7.exports={name:"create-turbo",version:"2.6.4-canary.4",description:"Create a new Turborepo",homepage:"https://turborepo.com",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"11.0.0","fs-extra":"11.1.1",inquirer:"8.2.4",picocolors:"1.0.1","proxy-agent":"6.5.0",semver:"7.5.0","update-check":"1.5.4"},devDependencies:{"@jest/globals":"29.7.0","@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"9.0.13","@types/inquirer":"7.3.3","@types/node":"18.17.4","@types/semver":"7.3.12",jest:"29.7.0","ts-jest":"29.2.5",tsup:"6.7.0",typescript:"5.5.4"},files:["dist"]}});var JT=oe(require("http")),XT=oe(require("https")),Dg=oe(require("picocolors")),Ha=require("commander");var yO=oe(Pg());function Eh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wo(t){return wo=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},wo(t)}function wh(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xh(t,e){if(e&&(wo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wh(t)}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zn(t)}function Lr(t,e){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Lr(t,e)}function Sh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lr(t,e)}function Ah(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Dh(){if(typeof Reflect=="undefined"||!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 Bi(t,e,r){return Dh()?Bi=Reflect.construct.bind():Bi=function(i,s,o){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(i,a),c=new u;return o&&Lr(c,o.prototype),c},Bi.apply(null,arguments)}function xo(t){var e=typeof Map=="function"?new Map:void 0;return xo=function(n){if(n===null||!Ah(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Bi(n,arguments,zn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Lr(i,n)},xo(t)}var Jg=oe(Zg());var gO=oe(require("fs-extra")),wG=function(t){Sh(e,t);function e(r){var n;return Eh(this,e),n=xh(this,zn(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(xo(Error));var _O=oe(require("fs")),bO=oe(require("path"));var B3=oe(require("fs")),N3=oe(require("path"));function d_(t){return typeof t=="undefined"||t===null}function wO(t){return typeof t=="object"&&t!==null}function xO(t){return Array.isArray(t)?t:d_(t)?[]:[t]}function SO(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}function AO(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function DO(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var CO=d_,RO=wO,kO=xO,TO=AO,OO=DO,FO=SO,Ve={isNothing:CO,isObject:RO,toArray:kO,repeat:TO,isNegativeZero:OO,extend:FO};function p_(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
|
30
|
+
`)}`}}};ke.RequestError=Ue;var Nl=class extends Ue{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};ke.MaxRedirectsError=Nl;var Ml=class extends Ue{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};ke.HTTPError=Ml;var jl=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};ke.CacheError=jl;var ql=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};ke.UploadError=ql;var Ul=class extends Ue{constructor(e,r,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=r}};ke.TimeoutError=Ul;var wa=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};ke.ReadError=wa;var Hl=class extends Ue{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};ke.UnsupportedProtocolError=Hl;var $q=["socket","connect","continue","information","upgrade","timeout"],$l=class extends ER.Duplex{constructor(e,r={},n){super({autoDestroy:!1,highWaterMark:0}),this[Ks]=0,this[Js]=0,this.requestInitialized=!1,this[Il]=new Set,this.redirects=[],this[Xs]=!1,this[Ll]=!1,this[Ea]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",i),c.on("data",s),c.prependListener("end",i),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",i),c.off("data",s),c.off("end",i),c.off("end",s)}),this.on("pipe",c=>{c instanceof my.IncomingMessage&&(this.options.headers={...c.headers,...this.options.headers})});let{json:o,body:a,form:u}=r;if((o||a||u)&&this._lockWrite(),ke.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,n)}catch(c){K.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof wq.ReadStream&&await qq(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[nt])===null||c===void 0||c.destroy();return}for(let h of this[Ea])h();this[Ea].length=0,this.requestInitialized=!0}catch(l){if(l instanceof Ue){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,r,n){var i,s,o,a,u;let c=r;if(K.default.object(e)&&!K.default.urlInstance(e))r={...n,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...n,...r},e!==void 0&&(r.url=e),K.default.urlInstance(r.url)&&(r.url=new Pn.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),K.assert.any([K.default.string,K.default.undefined],r.method),K.assert.any([K.default.object,K.default.undefined],r.headers),K.assert.any([K.default.string,K.default.urlInstance,K.default.undefined],r.prefixUrl),K.assert.any([K.default.object,K.default.undefined],r.cookieJar),K.assert.any([K.default.object,K.default.string,K.default.undefined],r.searchParams),K.assert.any([K.default.object,K.default.string,K.default.undefined],r.cache),K.assert.any([K.default.object,K.default.number,K.default.undefined],r.timeout),K.assert.any([K.default.object,K.default.undefined],r.context),K.assert.any([K.default.object,K.default.undefined],r.hooks),K.assert.any([K.default.boolean,K.default.undefined],r.decompress),K.assert.any([K.default.boolean,K.default.undefined],r.ignoreInvalidCookies),K.assert.any([K.default.boolean,K.default.undefined],r.followRedirect),K.assert.any([K.default.number,K.default.undefined],r.maxRedirects),K.assert.any([K.default.boolean,K.default.undefined],r.throwHttpErrors),K.assert.any([K.default.boolean,K.default.undefined],r.http2),K.assert.any([K.default.boolean,K.default.undefined],r.allowGetBody),K.assert.any([K.default.string,K.default.undefined],r.localAddress),K.assert.any([CR.isDnsLookupIpVersion,K.default.undefined],r.dnsLookupIpVersion),K.assert.any([K.default.object,K.default.undefined],r.https),K.assert.any([K.default.boolean,K.default.undefined],r.rejectUnauthorized),r.https&&(K.assert.any([K.default.boolean,K.default.undefined],r.https.rejectUnauthorized),K.assert.any([K.default.function_,K.default.undefined],r.https.checkServerIdentity),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.certificateAuthority),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.key),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.certificate),K.assert.any([K.default.string,K.default.undefined],r.https.passphrase),K.assert.any([K.default.string,K.default.buffer,K.default.array,K.default.undefined],r.https.pfx)),K.assert.any([K.default.object,K.default.undefined],r.cacheOptions),K.default.string(r.method)?r.method=r.method.toUpperCase():r.method="GET",r.headers===(n==null?void 0:n.headers)?r.headers={...r.headers}:r.headers=Rq({...n==null?void 0:n.headers,...r.headers}),"slashes"in r)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in r)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in r&&r.searchParams&&r.searchParams!==(n==null?void 0:n.searchParams)){let d;if(K.default.string(r.searchParams)||r.searchParams instanceof Pn.URLSearchParams)d=new Pn.URLSearchParams(r.searchParams);else{Mq(r.searchParams),d=new Pn.URLSearchParams;for(let m in r.searchParams){let y=r.searchParams[m];y===null?d.append(m,""):y!==void 0&&d.append(m,y)}}(i=n==null?void 0:n.searchParams)===null||i===void 0||i.forEach((m,y)=>{d.has(y)||d.append(y,m)}),r.searchParams=d}if(r.username=(s=r.username)!==null&&s!==void 0?s:"",r.password=(o=r.password)!==null&&o!==void 0?o:"",K.default.undefined(r.prefixUrl)?r.prefixUrl=(a=n==null?void 0:n.prefixUrl)!==null&&a!==void 0?a:"":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")&&(r.prefixUrl+="/")),K.default.string(r.url)){if(r.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");r.url=DR.default(r.prefixUrl+r.url,r)}else(K.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol)&&(r.url=DR.default(r.prefixUrl,r));if(r.url){"port"in r&&delete r.port;let{prefixUrl:d}=r;Object.defineProperty(r,"prefixUrl",{set:y=>{let p=r.url;if(!p.href.startsWith(y))throw new Error(`Cannot change \`prefixUrl\` from ${d} to ${y}: ${p.href}`);r.url=new Pn.URL(y+p.href.slice(d.length)),d=y},get:()=>d});let{protocol:m}=r.url;if(m==="unix:"&&(m="http:",r.url=new Pn.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),m!=="http:"&&m!=="https:")throw new Hl(r);r.username===""?r.username=r.url.username:r.url.username=r.username,r.password===""?r.password=r.url.password:r.url.password=r.password}let{cookieJar:l}=r;if(l){let{setCookie:d,getCookieString:m}=l;K.assert.function_(d),K.assert.function_(m),d.length===4&&m.length===0&&(d=vR.promisify(d.bind(r.cookieJar)),m=vR.promisify(m.bind(r.cookieJar)),r.cookieJar={setCookie:d,getCookieString:m})}let{cache:h}=r;if(h&&(_y.has(h)||_y.set(h,new xR((d,m)=>{let y=d[nt](d,m);return K.default.promise(y)&&(y.once=(p,w)=>{if(p==="error")y.catch(w);else if(p==="abort")(async()=>{try{(await y).once("abort",w)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${p}`);return y}),y},h))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)yy||(yy=new Aq.default),r.dnsCache=yy;else if(!K.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${K.default(r.dnsCache)}`);K.default.number(r.timeout)?r.timeout={request:r.timeout}:n&&r.timeout!==n.timeout?r.timeout={...n.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let f=r.hooks===(n==null?void 0:n.hooks);r.hooks={...r.hooks};for(let d of ke.knownHookEvents)if(d in r.hooks)if(K.default.array(r.hooks[d]))r.hooks[d]=[...r.hooks[d]];else throw new TypeError(`Parameter \`${d}\` must be an Array, got ${K.default(r.hooks[d])}`);else r.hooks[d]=[];if(n&&!f)for(let d of ke.knownHookEvents)n.hooks[d].length>0&&(r.hooks[d]=[...n.hooks[d],...r.hooks[d]]);if("family"in r&&In.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n!=null&&n.https&&(r.https={...n.https,...r.https}),"rejectUnauthorized"in r&&In.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in r&&In.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in r&&In.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in r&&In.default('"options.key" was never documented, please use "options.https.key"'),"cert"in r&&In.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in r&&In.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in r&&In.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in r)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(r.agent){for(let d in r.agent)if(d!=="http"&&d!=="https"&&d!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${d}\``)}return r.maxRedirects=(u=r.maxRedirects)!==null&&u!==void 0?u:0,ke.setNonEnumerableProperties([n,c],r),Lq.default(r,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!K.default.undefined(e.form),i=!K.default.undefined(e.json),s=!K.default.undefined(e.body),o=n||i||s,a=ke.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,o){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([s,n,i].filter(u=>u).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(s&&!(e.body instanceof ER.Readable)&&!K.default.string(e.body)&&!K.default.buffer(e.body)&&!SR.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!K.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let u=!K.default.string(r["content-type"]);s?(SR.default(e.body)&&u&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[Ln]=e.body):n?(u&&(r["content-type"]="application/x-www-form-urlencoded"),this[Ln]=new Pn.URLSearchParams(e.form).toString()):(u&&(r["content-type"]="application/json"),this[Ln]=e.stringifyJson(e.json));let c=await kq.default(this[Ln],e.headers);K.default.undefined(r["content-length"])&&K.default.undefined(r["transfer-encoding"])&&!a&&!K.default.undefined(c)&&(r["content-length"]=String(c))}}else a?this._lockWrite():this._unlockWrite();this[Zs]=Number(r["content-length"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:n}=r;this[OR]=e,r.decompress&&(e=Dq(e));let i=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:wR.STATUS_CODES[i],s.url=r.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirects,s.request=this,s.isFromCache=e.fromCache||!1,s.ip=this.ip,s.retryCount=this.retryCount,this[kR]=s.isFromCache,this[Ys]=Number(e.headers["content-length"])||void 0,this[Bl]=e,e.once("end",()=>{this[Ys]=this[Ks],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new wa(a,this))}),e.once("aborted",()=>{this._beforeError(new wa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(K.default.object(r.cookieJar)&&o){let a=o.map(async u=>r.cookieJar.setCookie(u,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async u=>u.catch(()=>{})));try{await Promise.all(a)}catch(u){this._beforeError(u);return}}if(r.followRedirect&&e.headers.location&&Uq.has(i)){if(e.resume(),this[nt]&&(this[gy](),delete this[nt],this[RR]()),(i===303&&r.method!=="GET"&&r.method!=="HEAD"||!r.methodRewriting)&&(r.method="GET","body"in r&&delete r.body,"json"in r&&delete r.json,"form"in r&&delete r.form,this[Ln]=void 0,delete r.headers["content-length"]),this.redirects.length>=r.maxRedirects){this._beforeError(new Nl(this));return}try{let h=function(f){return f.protocol==="unix:"||f.hostname==="unix"},u=Buffer.from(e.headers.location,"binary").toString(),c=new Pn.URL(u,n),l=c.toString();if(decodeURI(l),!h(n)&&h(c)){this._beforeError(new Ue("Cannot redirect to UNIX socket",{},this));return}c.hostname!==n.hostname||c.port!==n.port?("host"in r.headers&&delete r.headers.host,"cookie"in r.headers&&delete r.headers.cookie,"authorization"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username="",r.password="")):(c.username=r.username,c.password=r.password),this.redirects.push(l),r.url=c;for(let f of r.hooks.beforeRedirect)await f(r,s);this.emit("redirect",s,r),await this._makeRequest()}catch(u){this._beforeError(u);return}return}if(r.isStream&&r.throwHttpErrors&&!Iq.isResponseOk(s)){this._beforeError(new Ml(s));return}e.on("readable",()=>{this[Ll]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[Il])if(!a.headersSent){for(let u in e.headers){let c=r.decompress?u!=="content-encoding":!0,l=e.headers[u];c&&a.setHeader(u,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:i}=r;Sq.default(e),this[gy]=AR.default(e,n,i);let s=r.cache?"cacheableResponse":"response";e.once(s,u=>{this._onResponse(u)}),e.once("error",u=>{var c;e.destroy(),(c=e.res)===null||c===void 0||c.removeAllListeners("end"),u=u instanceof AR.TimeoutError?new Ul(u,this.timings,this):new Ue(u.message,u,this),this._beforeError(u)}),this[RR]=Tq.default(e,this,$q),this[nt]=e,this.emit("uploadProgress",this.uploadProgress);let o=this[Ln],a=this.redirects.length===0?this:e;K.default.nodeStream(o)?(o.pipe(a),o.once("error",u=>{this._beforeError(new ql(u,this))})):(this._unlockWrite(),K.default.undefined(o)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(o,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,r){return new Promise((n,i)=>{Object.assign(r,Oq.default(e)),delete r.url;let s,o=_y.get(r.cache)(r,async a=>{a._readableState.autoDestroy=!1,s&&(await s).emit("cacheableResponse",a),n(a)});r.url=e,o.once("error",i),o.once("request",async a=>{s=a,n(s)})})}async _makeRequest(){var e,r,n,i,s;let{options:o}=this,{headers:a}=o;for(let w in a)if(K.default.undefined(a[w]))delete a[w];else if(K.default.null_(a[w]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${w}\` header`);if(o.decompress&&K.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=Nq?"gzip, deflate, br":"gzip, deflate"),o.cookieJar){let w=await o.cookieJar.getCookieString(o.url.toString());K.default.nonEmptyString(w)&&(o.headers.cookie=w)}for(let w of o.hooks.beforeRequest){let O=await w(o);if(!K.default.undefined(O)){o.request=()=>O;break}}o.body&&this[Ln]!==o.body&&(this[Ln]=o.body);let{agent:u,request:c,timeout:l,url:h}=o;if(o.dnsCache&&!("lookup"in o)&&(o.lookup=o.dnsCache.lookup),h.hostname==="unix"){let w=/(?<socketPath>.+?):(?<path>.+)/.exec(`${h.pathname}${h.search}`);if(w!=null&&w.groups){let{socketPath:O,path:P}=w.groups;Object.assign(o,{socketPath:O,path:P,host:""})}}let f=h.protocol==="https:",d;o.http2?d=Cq.auto:d=f?xq.request:wR.request;let m=(e=o.request)!==null&&e!==void 0?e:d,y=o.cache?this._createCacheableRequest:m;u&&!o.http2&&(o.agent=u[f?"https":"http"]),o[nt]=m,delete o.request,delete o.timeout;let p=o;if(p.shared=(r=o.cacheOptions)===null||r===void 0?void 0:r.shared,p.cacheHeuristic=(n=o.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,p.immutableMinTimeToLive=(i=o.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,p.ignoreCargoCult=(s=o.cacheOptions)===null||s===void 0?void 0:s.ignoreCargoCult,o.dnsLookupIpVersion!==void 0)try{p.family=CR.dnsLookupIpVersionToFamily(o.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}o.https&&("rejectUnauthorized"in o.https&&(p.rejectUnauthorized=o.https.rejectUnauthorized),o.https.checkServerIdentity&&(p.checkServerIdentity=o.https.checkServerIdentity),o.https.certificateAuthority&&(p.ca=o.https.certificateAuthority),o.https.certificate&&(p.cert=o.https.certificate),o.https.key&&(p.key=o.https.key),o.https.passphrase&&(p.passphrase=o.https.passphrase),o.https.pfx&&(p.pfx=o.https.pfx));try{let w=await y(h,p);K.default.undefined(w)&&(w=d(h,p)),o.request=c,o.timeout=l,o.agent=u,o.https&&("rejectUnauthorized"in o.https&&delete p.rejectUnauthorized,o.https.checkServerIdentity&&delete p.checkServerIdentity,o.https.certificateAuthority&&delete p.ca,o.https.certificate&&delete p.cert,o.https.key&&delete p.key,o.https.passphrase&&delete p.passphrase,o.https.pfx&&delete p.pfx),jq(w)?this._onRequest(w):this.writable?(this.once("finish",()=>{this._onResponse(w)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(w)}catch(w){throw w instanceof xR.CacheError?new jl(w,this):new Ue(w.message,w,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ue(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[Xs])return;let{options:r}=this,n=this.retryCount+1;this[Xs]=!0,e instanceof Ue||(e=new Ue(e.message,e,this));let i=e,{response:s}=i;(async()=>{if(s&&!s.body){s.setEncoding(this._readableState.encoding);try{s.rawBody=await Pq.default(s),s.body=s.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let o;try{let a;s&&"retry-after"in s.headers&&(a=Number(s.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(s.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),o=await r.retry.calculateDelay({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:Bq.default({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new Ue(a.message,a,this));return}if(o){let a=async()=>{try{for(let u of this.options.hooks.beforeRetry)await u(this.options,i,n)}catch(u){this._error(new Ue(u.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[FR]=setTimeout(a,o);return}}this._error(i)})()}_read(){this[Ll]=!0;let e=this[Bl];if(e&&!this[Xs]){e.readableLength&&(this[Ll]=!1);let r;for(;(r=e.read())!==null;){this[Ks]+=r.length,this[TR]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let i=()=>{this._writeRequest(e,r,n)};this.requestInitialized?i():this[Ea].push(i)}_writeRequest(e,r,n){this[nt].destroyed||(this._progressCallbacks.push(()=>{this[Js]+=Buffer.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[nt].write(e,r,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(nt in this)){e();return}if(this[nt].destroyed){e();return}this[nt].end(n=>{n||(this[Zs]=this[Js],this.emit("uploadProgress",this.uploadProgress),this[nt].emit("upload-complete")),e(n)})};this.requestInitialized?r():this[Ea].push(r)}_destroy(e,r){var n;this[Xs]=!0,clearTimeout(this[FR]),nt in this&&(this[gy](),!((n=this[Bl])===null||n===void 0)&&n.complete||this[nt].destroy()),e!==null&&!K.default.undefined(e)&&!(e instanceof Ue)&&(e=new Ue(e.message,e,this)),r(e)}get _isAboutToError(){return this[Xs]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,n;return((r=(e=this[nt])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((n=this[OR])===null||n===void 0)&&n.complete)}get socket(){var e,r;return(r=(e=this[nt])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[Ys]?e=this[Ks]/this[Ys]:this[Ys]===this[Ks]?e=1:e=0,{percent:e,transferred:this[Ks],total:this[Ys]}}get uploadProgress(){let e;return this[Zs]?e=this[Js]/this[Zs]:this[Zs]===this[Js]?e=1:e=0,{percent:e,transferred:this[Js],total:this[Zs]}}get timings(){var e;return(e=this[nt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[kR]}pipe(e,r){if(this[TR])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof my.ServerResponse&&this[Il].add(e),super.pipe(e,r)}unpipe(e){return e instanceof my.ServerResponse&&this[Il].delete(e),super.unpipe(e),this}};ke.default=$l});var Sa=A(cr=>{"use strict";var Gq=cr&&cr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zq=cr&&cr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gq(e,t,r)};Object.defineProperty(cr,"__esModule",{value:!0});cr.CancelError=cr.ParseError=void 0;var PR=xa(),by=class extends PR.RequestError{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};cr.ParseError=by;var vy=class extends PR.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};cr.CancelError=vy;zq(xa(),cr)});var LR=A(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});var IR=Sa(),Vq=(t,e,r,n)=>{let{rawBody:i}=t;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":r(i.toString());if(e==="buffer")return i;throw new IR.ParseError({message:`Unknown body type '${e}'`,name:"Error"},t)}catch(s){throw new IR.ParseError(s,t)}};Ey.default=Vq});var wy=A(Bn=>{"use strict";var Wq=Bn&&Bn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Yq=Bn&&Bn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wq(e,t,r)};Object.defineProperty(Bn,"__esModule",{value:!0});var Kq=require("events"),Zq=en(),Jq=PC(),Gl=Sa(),BR=LR(),NR=xa(),Xq=iy(),Qq=hy(),MR=fy(),eU=["request","response","redirect","uploadProgress","downloadProgress"];function jR(t){let e,r,n=new Kq.EventEmitter,i=new Jq((o,a,u)=>{let c=l=>{let h=new NR.default(void 0,t);h.retryCount=l,h._noPipe=!0,u(()=>h.destroy()),u.shouldReject=!1,u(()=>a(new Gl.CancelError(h))),e=h,h.once("response",async m=>{var y;if(m.retryCount=l,m.request.aborted)return;let p;try{p=await Qq.default(h),m.rawBody=p}catch{return}if(h._isAboutToError)return;let w=((y=m.headers["content-encoding"])!==null&&y!==void 0?y:"").toLowerCase(),O=["gzip","deflate","br"].includes(w),{options:P}=h;if(O&&!P.decompress)m.body=p;else try{m.body=BR.default(m,P.responseType,P.parseJson,P.encoding)}catch(I){if(m.body=p.toString(),MR.isResponseOk(m)){h._beforeError(I);return}}try{for(let[I,k]of P.hooks.afterResponse.entries())m=await k(m,async M=>{let x=NR.default.normalizeArguments(void 0,{...M,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},P);x.hooks.afterResponse=x.hooks.afterResponse.slice(0,I);for(let U of x.hooks.beforeRetry)await U(x);let D=jR(x);return u(()=>{D.catch(()=>{}),D.cancel()}),D})}catch(I){h._beforeError(new Gl.RequestError(I.message,I,h));return}if(r=m,!MR.isResponseOk(m)){h._beforeError(new Gl.HTTPError(m));return}h.destroy(),o(h.options.resolveBodyOnly?m.body:m)});let f=m=>{if(i.isCanceled)return;let{options:y}=h;if(m instanceof Gl.HTTPError&&!y.throwHttpErrors){let{response:p}=m;o(h.options.resolveBodyOnly?p.body:p);return}a(m)};h.once("error",f);let d=h.options.body;h.once("retry",(m,y)=>{var p,w;if(d===((p=y.request)===null||p===void 0?void 0:p.options.body)&&Zq.default.nodeStream((w=y.request)===null||w===void 0?void 0:w.options.body)){f(y);return}c(m)}),Xq.default(h,n,eU)};c(0)});i.on=(o,a)=>(n.on(o,a),i);let s=o=>{let a=(async()=>{await i;let{options:u}=r.request;return BR.default(r,o,u.parseJson,u.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:o}=e.options;return!e.writableFinished&&o.accept===void 0&&(o.accept="application/json"),s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}Bn.default=jR;Yq(Sa(),Bn)});var qR=A(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});var tU=Sa();function rU(t,...e){let r=(async()=>{if(t instanceof tU.RequestError)try{for(let i of e)if(i)for(let s of i)t=await s(t)}catch(i){t=i}throw t})(),n=()=>r;return r.json=n,r.text=n,r.buffer=n,r.on=n,r}xy.default=rU});var $R=A(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});var UR=en();function HR(t){for(let e of Object.values(t))(UR.default.plainObject(e)||UR.default.array(e))&&HR(e);return Object.freeze(t)}Sy.default=HR});var zR=A(GR=>{"use strict";Object.defineProperty(GR,"__esModule",{value:!0})});var Ay=A(Qt=>{"use strict";var nU=Qt&&Qt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iU=Qt&&Qt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nU(e,t,r)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.defaultHandler=void 0;var VR=en(),Xt=wy(),sU=qR(),Vl=xa(),oU=$R(),aU={RequestError:Xt.RequestError,CacheError:Xt.CacheError,ReadError:Xt.ReadError,HTTPError:Xt.HTTPError,MaxRedirectsError:Xt.MaxRedirectsError,TimeoutError:Xt.TimeoutError,ParseError:Xt.ParseError,CancelError:Xt.CancelError,UnsupportedProtocolError:Xt.UnsupportedProtocolError,UploadError:Xt.UploadError},uU=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:zl}=Vl.default,WR=(...t)=>{let e;for(let r of t)e=zl(void 0,r,e);return e},cU=t=>t.isStream?new Vl.default(void 0,t):Xt.default(t),lU=t=>"defaults"in t&&"options"in t.defaults,hU=["get","post","put","patch","head","delete"];Qt.defaultHandler=(t,e)=>e(t);var YR=(t,e)=>{if(t)for(let r of t)r(e)},KR=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(n=>(i,s)=>{let o,a=n(i,u=>(o=s(u),o));if(a!==o&&!i.isStream&&o){let u=a,{then:c,catch:l,finally:h}=u;Object.setPrototypeOf(u,Object.getPrototypeOf(o)),Object.defineProperties(u,Object.getOwnPropertyDescriptors(o)),u.then=c,u.catch=l,u.finally=h}return a});let e=(n,i={},s)=>{var o,a;let u=0,c=l=>t.handlers[u++](l,u===t.handlers.length?cU:c);if(VR.default.plainObject(n)){let l={...n,...i};Vl.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{YR(t.options.hooks.init,i),YR((o=i.hooks)===null||o===void 0?void 0:o.init,i)}catch(f){l=f}let h=zl(n,i,s!=null?s:t.options);if(h[Vl.kIsNormalizedAlready]=!0,l)throw new Xt.RequestError(l.message,l,h);return c(h)}catch(l){if(i.isStream)throw l;return sU.default(l,t.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[t.options],s=[...t._rawHandlers],o;for(let a of n)lU(a)?(i.push(a.defaults.options),s.push(...a.defaults._rawHandlers),o=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&s.push(...a.handlers),o=a.mutableDefaults);return s=s.filter(a=>a!==Qt.defaultHandler),s.length===0&&s.push(Qt.defaultHandler),KR({options:WR(...i),handlers:s,mutableDefaults:!!o})};let r=async function*(n,i){let s=zl(n,i,t.options);s.resolveBodyOnly=!1;let o=s.pagination;if(!VR.default.object(o))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:u}=o,c=0;for(;c<o.requestLimit;){c!==0&&await uU(o.backoff);let l=await e(void 0,void 0,s),h=await o.transform(l),f=[];for(let m of h)if(o.filter(m,a,f)&&(!o.shouldContinue(m,a,f)||(yield m,o.stackAllItems&&a.push(m),f.push(m),--u<=0)))return;let d=o.paginate(l,a,f);if(d===!1)return;d===l.request.options?s=l.request.options:d!==void 0&&(s=zl(void 0,d,s)),c++}};e.paginate=r,e.paginate.all=async(n,i)=>{let s=[];for await(let o of r(n,i))s.push(o);return s},e.paginate.each=r,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of hU)e[n]=(i,s)=>e(i,{...s,method:n}),e.stream[n]=(i,s)=>e(i,{...s,method:n,isStream:!0});return Object.assign(e,aU),Object.defineProperty(e,"defaults",{value:t.mutableDefaults?t:oU.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=WR,e};Qt.default=KR;iU(zR(),Qt)});var Cy=A((tn,Wl)=>{"use strict";var fU=tn&&tn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZR=tn&&tn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fU(e,t,r)};Object.defineProperty(tn,"__esModule",{value:!0});var dU=require("url"),JR=Ay(),pU={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType==="json"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,"link"))return!1;let e=t.headers.link.split(","),r;for(let n of e){let i=n.split(";");if(i[1].includes("next")){r=i[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new dU.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[JR.defaultHandler],mutableDefaults:!1},Dy=JR.default(pU);tn.default=Dy;Wl.exports=Dy;Wl.exports.default=Dy;Wl.exports.__esModule=!0;ZR(Ay(),tn);ZR(wy(),tn)});var ik=A((CK,nk)=>{function er(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,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))}nk.exports=er;er.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};er.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};er.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};er.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};er.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};er.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};er.prototype.start=er.prototype.try;er.prototype.errors=function(){return this._errors};er.prototype.attempts=function(){return this._attempts};er.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var sk=A(yi=>{var yU=ik();yi.operation=function(t){var e=yi.timeouts(t);return new yU(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};yi.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};yi.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};yi.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=yi.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var ak=A((kK,ok)=>{ok.exports=sk()});var ck=A((TK,uk)=>{var gU=ak();function _U(t,e){function r(n,i){var s=e||{},o;"randomize"in s||(s.randomize=!0),o=gU.operation(s);function a(l){i(l||new Error("Aborted"))}function u(l,h){if(l.bail){a(l);return}o.retry(l)?s.onRetry&&s.onRetry(l,h):i(o.mainError())}function c(l){var h;try{h=t(a,l)}catch(f){u(f,l);return}Promise.resolve(h).then(n).catch(function(d){u(d,l)})}o.attempt(c)}return new Promise(r)}uk.exports=_U});var Dk=A(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});function _7(t){return t&&t.__esModule?t:{default:t}}var wk=Object.defineProperty,vk=Object.getOwnPropertySymbols,b7=Object.prototype.hasOwnProperty,v7=Object.prototype.propertyIsEnumerable,Ek=(t,e,r)=>e in t?wk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E7=(t,e)=>{for(var r in e||(e={}))b7.call(e,r)&&Ek(t,r,e[r]);if(vk)for(var r of vk(e))v7.call(e,r)&&Ek(t,r,e[r]);return t},w7=(t,e)=>{for(var r in e)wk(t,r,{get:e[r],enumerable:!0})},x7=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),xk={};w7(xk,{configDir:()=>Ak,darwinConfig:()=>zy,getPathForPlatform:()=>Wy,getPlatform:()=>Gy,linuxConfig:()=>nh,winConfig:()=>Vy});var S7=require("fs/promises"),A7=require("path"),Sk=_7(A7);function Gy(){return process.platform}function nh(){if(process.env.XDG_CONFIG_HOME!==void 0)return process.env.XDG_CONFIG_HOME;if(process.env.HOME!==void 0)return Sk.default.join(process.env.HOME,".config")}function zy(){if(process.env.HOME!==void 0)return Sk.default.join(process.env.HOME,"/Library/Application Support")}function Vy(){return process.env.APPDATA}function Wy({platform:t}){switch(t){case"linux":return nh();case"darwin":return zy();case"win32":return Vy();default:return nh()}}function Ak(){return x7(this,arguments,function*(t={}){var e;let r=(e=t.platform)!=null?e:Gy(),n=Wy({platform:r});if(n!==void 0){if(t.validate===!1)return n;try{return yield S7.stat.call(void 0,n),n}catch{return}}})}Fr.__spreadValues=E7;Fr.getPlatform=Gy;Fr.linuxConfig=nh;Fr.darwinConfig=zy;Fr.winConfig=Vy;Fr.getPathForPlatform=Wy;Fr.configDir=Ak;Fr.config_dir_exports=xk});var Ck=A(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});var D7=Dk();Yy.configDir=D7.configDir});var Pk=A((yZ,N7)=>{N7.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Bk=A(qt=>{"use strict";var Lk=Pk(),Ye=process.env;Object.defineProperty(qt,"_vendors",{value:Lk.map(function(t){return t.constant})});qt.name=null;qt.isPR=null;Lk.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Ik(n)});if(qt[t.constant]=r,!!r)switch(qt.name=t.name,typeof t.pr){case"string":qt.isPR=!!Ye[t.pr];break;case"object":"env"in t.pr?qt.isPR=t.pr.env in Ye&&Ye[t.pr.env]!==t.pr.ne:"any"in t.pr?qt.isPR=t.pr.any.some(function(n){return!!Ye[n]}):qt.isPR=Ik(t.pr);break;default:qt.isPR=null}});qt.isCI=!!(Ye.CI!=="false"&&(Ye.BUILD_ID||Ye.BUILD_NUMBER||Ye.CI||Ye.CI_APP_ID||Ye.CI_BUILD_ID||Ye.CI_BUILD_NUMBER||Ye.CI_NAME||Ye.CONTINUOUS_INTEGRATION||Ye.RUN_ID||qt.name));function Ik(t){return typeof t=="string"?!!Ye[t]:"env"in t?Ye[t.env]&&Ye[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!Ye[e]}):Object.keys(t).every(function(e){return Ye[e]===t[e]})}});var eg=A((PZ,G7)=>{G7.exports={name:"create-turbo",version:"2.6.4-canary.6",description:"Create a new Turborepo",homepage:"https://turborepo.com",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"11.0.0","fs-extra":"11.1.1",inquirer:"8.2.4",picocolors:"1.0.1","proxy-agent":"6.5.0",semver:"7.5.0","update-check":"1.5.4"},devDependencies:{"@jest/globals":"29.7.0","@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"9.0.13","@types/inquirer":"7.3.3","@types/node":"18.17.4","@types/semver":"7.3.12",jest:"29.7.0","ts-jest":"29.2.5",tsup:"6.7.0",typescript:"5.5.4"},files:["dist"]}});var JT=oe(require("http")),XT=oe(require("https")),Dg=oe(require("picocolors")),Ha=require("commander");var yO=oe(Pg());function Eh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wo(t){return wo=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},wo(t)}function wh(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xh(t,e){if(e&&(wo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wh(t)}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zn(t)}function Lr(t,e){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Lr(t,e)}function Sh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lr(t,e)}function Ah(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Dh(){if(typeof Reflect=="undefined"||!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 Bi(t,e,r){return Dh()?Bi=Reflect.construct.bind():Bi=function(i,s,o){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(i,a),c=new u;return o&&Lr(c,o.prototype),c},Bi.apply(null,arguments)}function xo(t){var e=typeof Map=="function"?new Map:void 0;return xo=function(n){if(n===null||!Ah(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Bi(n,arguments,zn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Lr(i,n)},xo(t)}var Jg=oe(Zg());var gO=oe(require("fs-extra")),wG=function(t){Sh(e,t);function e(r){var n;return Eh(this,e),n=xh(this,zn(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(xo(Error));var _O=oe(require("fs")),bO=oe(require("path"));var B3=oe(require("fs")),N3=oe(require("path"));function d_(t){return typeof t=="undefined"||t===null}function wO(t){return typeof t=="object"&&t!==null}function xO(t){return Array.isArray(t)?t:d_(t)?[]:[t]}function SO(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}function AO(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function DO(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var CO=d_,RO=wO,kO=xO,TO=AO,OO=DO,FO=SO,Ve={isNothing:CO,isObject:RO,toArray:kO,repeat:TO,isNegativeZero:OO,extend:FO};function p_(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
|
31
31
|
|
|
32
32
|
`+t.mark.snippet),n+" "+r):n}function Ao(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=p_(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ao.prototype=Object.create(Error.prototype);Ao.prototype.constructor=Ao;Ao.prototype.toString=function(e){return this.name+": "+p_(this,e)};var pt=Ao;function Ph(t,e,r,n,i){var s="",o="",a=Math.floor(i/2)-1;return n-e>a&&(s=" ... ",e=n-a+s.length),r-n>a&&(o=" ...",r=n+a-o.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function Ih(t,e){return Ve.repeat(" ",e-t.length)+t}function PO(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var a="",u,c,l=Math.min(t.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+l+3);for(u=1;u<=e.linesBefore&&!(o-u<0);u++)c=Ph(t.buffer,n[o-u],i[o-u],t.position-(n[o]-n[o-u]),h),a=Ve.repeat(" ",e.indent)+Ih((t.line-u+1).toString(),l)+" | "+c.str+`
|
|
33
33
|
`+a;for(c=Ph(t.buffer,n[o],i[o],t.position,h),a+=Ve.repeat(" ",e.indent)+Ih((t.line+1).toString(),l)+" | "+c.str+`
|
|
@@ -58,7 +58,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);m(y)}return}
|
|
|
58
58
|
`+t.slice(i,s),i=s+1),o=a;return u+=`
|
|
59
59
|
`,t.length-i>e&&o>i?u+=t.slice(i,o)+`
|
|
60
60
|
`+t.slice(o+1):u+=t.slice(i),u.slice(1)}function b5(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=So(t,i),n=it[r],!n&&Ro(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||l5(r);return e}function v5(t,e,r){var n="",i=t.tag,s,o,a;for(s=0,o=r.length;s<o;s+=1)a=r[s],t.replacer&&(a=t.replacer.call(r,String(s),a)),(Br(t,e,a,!1,!1)||typeof a=="undefined"&&Br(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}function h_(t,e,r,n){var i="",s=t.tag,o,a,u;for(o=0,a=r.length;o<a;o+=1)u=r[o],t.replacer&&(u=t.replacer.call(r,String(o),u)),(Br(t,e+1,u,!0,!0,!1,!0)||typeof u=="undefined"&&Br(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Mh(t,e)),t.dump&&Do===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}function E5(t,e,r){var n="",i=t.tag,s=Object.keys(r),o,a,u,c,l;for(o=0,a=s.length;o<a;o+=1)l="",n!==""&&(l+=", "),t.condenseFlow&&(l+='"'),u=s[o],c=r[u],t.replacer&&(c=t.replacer.call(r,u,c)),Br(t,e,u,!1,!1)&&(t.dump.length>1024&&(l+="? "),l+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Br(t,e,c,!1,!1)&&(l+=t.dump,n+=l));t.tag=i,t.dump="{"+n+"}"}function w5(t,e,r,n){var i="",s=t.tag,o=Object.keys(r),a,u,c,l,h,f;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new pt("sortKeys must be a boolean or a function");for(a=0,u=o.length;a<u;a+=1)f="",(!n||i!=="")&&(f+=Mh(t,e)),c=o[a],l=r[c],t.replacer&&(l=t.replacer.call(r,c,l)),Br(t,e+1,c,!0,!0,!0)&&(h=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,h&&(t.dump&&Do===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,h&&(f+=Mh(t,e)),Br(t,e+1,l,!0,h)&&(t.dump&&Do===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=s,t.dump=i||"{}"}function f_(t,e,r){var n,i,s,o,a,u;for(i=r?t.explicitTypes:t.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){if(u=t.styleMap[a.tag]||a.defaultStyle,$_.call(a.represent)==="[object Function]")n=a.represent(e,u);else if(G_.call(a.represent,u))n=a.represent[u](e,u);else throw new pt("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');t.dump=n}return!0}return!1}function Br(t,e,r,n,i,s,o){t.tag=null,t.dump=r,f_(t,r,!1)||f_(t,r,!0);var a=$_.call(t.dump),u=n,c;n&&(n=t.flowLevel<0||t.flowLevel>e);var l=a==="[object Object]"||a==="[object Array]",h,f;if(l&&(h=t.duplicates.indexOf(r),f=h!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(l&&f&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),a==="[object Object]")n&&Object.keys(t.dump).length!==0?(w5(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(E5(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?h_(t,e-1,t.dump,i):h_(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(v5(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&g5(t,t.dump,e,s,u);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new pt("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(c=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",t.dump=c+" "+t.dump)}return!0}function x5(t,e){var r=[],n=[],i,s;for(qh(t,r,n),i=0,s=n.length;i<s;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(s)}function qh(t,e,r){var n,i,s;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,s=t.length;i<s;i+=1)qh(t[i],e,r);else for(n=Object.keys(t),i=0,s=n.length;i<s;i+=1)qh(t[n[i]],e,r)}function S5(t,e){e=e||{};var r=new f5(e);r.noRefs||x5(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Br(r,0,n,!0,!0)?r.dump+`
|
|
61
|
-
`:""}var A5=S5,D5={dump:A5};function Vh(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var C5=rt,R5=m_,k5=b_,T5=S_,O5=A_,F5=Hh,P5=H_.load,I5=H_.loadAll,L5=D5.dump,B5=pt,N5={binary:T_,float:x_,map:__,null:v_,pairs:F_,set:P_,timestamp:R_,bool:E_,int:w_,merge:k_,omap:O_,seq:g_,str:y_},M5=Vh("safeLoad","load"),j5=Vh("safeLoadAll","loadAll"),q5=Vh("safeDump","dump"),U5={Type:C5,Schema:R5,FAILSAFE_SCHEMA:k5,JSON_SCHEMA:T5,CORE_SCHEMA:O5,DEFAULT_SCHEMA:F5,load:P5,loadAll:I5,dump:L5,YAMLException:B5,types:N5,safeLoad:M5,safeLoadAll:j5,safeDump:q5},Wh=U5;var M3=oe(Ru());var de={};oO(de,{bold:()=>R3,dimmed:()=>T3,error:()=>yt,grey:()=>O3,info:()=>C3,item:()=>F3,log:()=>wt,turboBlue:()=>fs,turboGradient:()=>D3,turboLoader:()=>pp,turboRed:()=>ex,underline:()=>k3,warn:()=>rx,yellow:()=>tx});var Et=require("picocolors"),Zw=oe(Qu()),Jw=oe(oc()),Xw="#0099F7",Qw="#F11712",A3="#FFFF00",dp=t=>{let e=P3(t);return r=>`\x1B[38;5;${e}m${r}${(0,Et.reset)("")}`},D3=(0,Jw.default)(Xw,Qw),fs=dp(Xw),ex=dp(Qw),tx=dp(A3),pp=t=>(0,Zw.default)({text:t,spinner:{frames:[" ",fs("> "),fs(">> "),fs(">>>")]}}),C3=(...t)=>{wt(fs((0,Et.bold)(">>>")),t.join(" "))},R3=(...t)=>{wt((0,Et.bold)(t.join(" ")))},k3=(...t)=>{wt((0,Et.underline)(t.join(" ")))},T3=(...t)=>{wt((0,Et.dim)(t.join(" ")))},O3=(...t)=>{wt((0,Et.gray)(t.join(" ")))},F3=(...t)=>{wt(fs((0,Et.bold)(" \u2022")),t.join(" "))},wt=(...t)=>{console.log(...t)},rx=(...t)=>{console.error(tx((0,Et.bold)(">>>")),t.join(" "))},yt=(...t)=>{console.error(ex((0,Et.bold)(">>>")),t.join(" "))};function P3(t){let e=parseInt(t.slice(1),16),r=Math.floor(e/(256*256))%256,n=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)}var kS=oe(require("os")),TS=oe(_s());async function pc(t,e=[],r){let n={cwd:kS.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:i}=await(0,TS.default)(t,e,n);return i.trim()}catch{return}}async function Wo(){let[t,e,r,n]=await Promise.all([pc("yarnpkg",["--version"],{cwd:"."}),pc("npm",["--version"]),pc("pnpm",["--version"]),pc("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:n}}var OS=oe(require("fs-extra")),
|
|
61
|
+
`:""}var A5=S5,D5={dump:A5};function Vh(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var C5=rt,R5=m_,k5=b_,T5=S_,O5=A_,F5=Hh,P5=H_.load,I5=H_.loadAll,L5=D5.dump,B5=pt,N5={binary:T_,float:x_,map:__,null:v_,pairs:F_,set:P_,timestamp:R_,bool:E_,int:w_,merge:k_,omap:O_,seq:g_,str:y_},M5=Vh("safeLoad","load"),j5=Vh("safeLoadAll","loadAll"),q5=Vh("safeDump","dump"),U5={Type:C5,Schema:R5,FAILSAFE_SCHEMA:k5,JSON_SCHEMA:T5,CORE_SCHEMA:O5,DEFAULT_SCHEMA:F5,load:P5,loadAll:I5,dump:L5,YAMLException:B5,types:N5,safeLoad:M5,safeLoadAll:j5,safeDump:q5},Wh=U5;var M3=oe(Ru());var de={};oO(de,{bold:()=>R3,dimmed:()=>T3,error:()=>yt,grey:()=>O3,info:()=>C3,item:()=>F3,log:()=>wt,turboBlue:()=>fs,turboGradient:()=>D3,turboLoader:()=>pp,turboRed:()=>ex,underline:()=>k3,warn:()=>rx,yellow:()=>tx});var Et=require("picocolors"),Zw=oe(Qu()),Jw=oe(oc()),Xw="#0099F7",Qw="#F11712",A3="#FFFF00",dp=t=>{let e=P3(t);return r=>`\x1B[38;5;${e}m${r}${(0,Et.reset)("")}`},D3=(0,Jw.default)(Xw,Qw),fs=dp(Xw),ex=dp(Qw),tx=dp(A3),pp=t=>(0,Zw.default)({text:t,spinner:{frames:[" ",fs("> "),fs(">> "),fs(">>>")]}}),C3=(...t)=>{wt(fs((0,Et.bold)(">>>")),t.join(" "))},R3=(...t)=>{wt((0,Et.bold)(t.join(" ")))},k3=(...t)=>{wt((0,Et.underline)(t.join(" ")))},T3=(...t)=>{wt((0,Et.dim)(t.join(" ")))},O3=(...t)=>{wt((0,Et.gray)(t.join(" ")))},F3=(...t)=>{wt(fs((0,Et.bold)(" \u2022")),t.join(" "))},wt=(...t)=>{console.log(...t)},rx=(...t)=>{console.error(tx((0,Et.bold)(">>>")),t.join(" "))},yt=(...t)=>{console.error(ex((0,Et.bold)(">>>")),t.join(" "))};function P3(t){let e=parseInt(t.slice(1),16),r=Math.floor(e/(256*256))%256,n=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)}var kS=oe(require("os")),TS=oe(_s());async function pc(t,e=[],r){let n={cwd:kS.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:i}=await(0,TS.default)(t,e,n);return i.trim()}catch{return}}async function Wo(){let[t,e,r,n]=await Promise.all([pc("yarnpkg",["--version"],{cwd:"."}),pc("npm",["--version"]),pc("pnpm",["--version"]),pc("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:n}}var OS=oe(require("fs-extra")),O6=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log","yarnrc.yml",".yarn"];function Yo(t){let e=OS.default.readdirSync(t).filter(r=>!O6.includes(r)).filter(r=>!r.endsWith(".iml"));return{isEmpty:e.length===0,conflicts:e}}var Op=oe(require("path")),Fp=oe(require("fs-extra")),Pp=oe(require("picocolors"));function mc(t){let e=Op.default.resolve(t),r=Op.default.basename(e),n=Fp.default.existsSync(e),i=Fp.default.lstatSync(e,{throwIfNoEntry:!1});if(i&&!i.isDirectory())return{valid:!1,root:e,projectName:r,error:`${Pp.default.dim(r)} is not a directory - please try a different location`};if(n){let{isEmpty:s,conflicts:o}=Yo(e);if(!s)return{valid:!1,root:e,projectName:r,error:`${Pp.default.dim(r)} (${e}) has ${o.length} conflicting ${o.length===1?"file":"files"} - please try a different location`}}return{valid:!0,root:e,projectName:r}}var XR=require("stream"),QR=require("util"),ek=require("path"),tk=require("os"),Aa=require("fs"),Ry=oe(RC()),Kl=oe(Cy()),mU=(0,QR.promisify)(XR.Stream.pipeline);async function Yl(t){try{return(await Kl.default.head(t)).statusCode===200}catch{return!1}}async function ky(t,e){let[,r,n,i,s,...o]=t.pathname.split("/"),a=e?e.replace(/^\//,""):o.join("/");if(i===void 0||i===""&&s===void 0)try{let c=await(0,Kl.default)(`https://api.github.com/repos/${r}/${n}`),l=JSON.parse(c.body);return{username:r,name:n,branch:l.default_branch,filePath:a}}catch{return}let u=e?`${s}/${o.join("/")}`.replace(new RegExp(`/${a}|/$`),""):s;if(r&&n&&u&&i==="tree")return{username:r,name:n,branch:u,filePath:a}}function Ty({username:t,name:e,branch:r,filePath:n}){let i=`https://api.github.com/repos/${t}/${e}/contents`,s=`${n?`/${n}`:""}/package.json`;return Yl(`${i+s}?ref=${r}`)}function Oy(t){try{let e=new URL(t);return Yl(e.href)}catch{return Yl(`https://api.github.com/repos/vercel/turborepo/contents/examples/${encodeURIComponent(t)}`)}}async function rk(t,e){let r=(0,ek.join)((0,tk.tmpdir)(),`${e}.temp-${Date.now()}`);return await mU(Kl.default.stream(t),(0,Aa.createWriteStream)(r)),r}async function Fy(t,{username:e,name:r,branch:n,filePath:i}){let s=await rk(`https://codeload.github.com/${e}/${r}/tar.gz/${n}`,"turbo-ct-example"),o=null;await(0,Ry.x)({file:s,cwd:t,strip:i?i.split("/").length+1:1,filter:a=>{if(o===null){let u=a.split("/");o=u.length?u[0]:null}return a.startsWith(`${o}${i?`/${i}/`:"/"}`)}}),await Aa.promises.unlink(s)}async function Py(t,e){let r=await rk("https://codeload.github.com/vercel/turborepo/tar.gz/main","turbo-ct-example"),n=null;await(0,Ry.x)({file:r,cwd:t,strip:2+e.split("/").length,filter:i=>{if(n===null){let s=i.split("/");n=s.length?s[0]:null}return i.includes(`${n}/examples/${e}/`)}}),await Aa.promises.unlink(r)}var Iy=oe(require("fs-extra"));async function Ly(t){try{return await Iy.default.access(t,Iy.default.constants.W_OK),!0}catch{return!1}}var Qs=oe(require("path")),By=oe(ck()),gi=oe(require("picocolors")),Zl=oe(require("fs-extra"));function bU(t){return typeof t=="object"&&t!==null&&typeof t.message=="string"}var eo=class extends Error{};async function Ny({appPath:t,example:e,isDefaultExample:r,examplePath:n}){let i,s;if(r)i={username:"vercel",name:"turborepo",branch:"main",filePath:"examples/basic"};else{try{s=new URL(e)}catch(p){p.code!=="ERR_INVALID_URL"&&(yt(p),process.exit(1))}s?(s.origin!=="https://github.com"&&(yt(`Invalid URL: ${gi.default.red(`"${e}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`),process.exit(1)),i=await ky(s,n),i||(yt(`Unable to fetch repository information from: ${gi.default.red(`"${e}"`)}. Please fix the URL and try again.`),process.exit(1)),await Ty(i)||(yt(`Could not locate the repository for ${gi.default.red(`"${e}"`)}. Please check that the repository exists and try again.`),process.exit(1))):await Oy(e)||(yt(`Could not locate an example named ${gi.default.red(`"${e}"`)}. It could be due to the following:
|
|
62
62
|
`,`1. Your spelling of example ${gi.default.red(`"${e}"`)} might be incorrect.
|
|
63
63
|
`,"2. You might not be connected to the internet or you are behind a proxy."),process.exit(1))}let o=Qs.default.resolve(t);await Ly(Qs.default.dirname(o))||(yt("The application path is not writable, please check folder permissions and try again."),yt("It is likely you do not have write permissions for this folder."),process.exit(1));let a=Qs.default.basename(o);try{await Zl.default.mkdir(o,{recursive:!0})}catch(p){yt("Unable to create project directory"),yt(p),process.exit(1)}let{isEmpty:u,conflicts:c}=Yo(o);u||(yt(`${gi.default.dim(o)} has ${c.length} conflicting ${c.length===1?"file":"files"} - please try a different location`),process.exit(1));let l=process.cwd();process.chdir(o),wt();let h=pp("Downloading files... (This might take a moment)");try{!r&&i?(h.start(),await(0,By.default)(()=>Fy(o,i),{retries:3})):(h.start(),await(0,By.default)(()=>Py(o,e),{retries:3}))}catch(p){throw new eo(bU(p)?p.message:String(p))}finally{h.stop()}let f=Qs.default.join(o,"package.json"),d=Zl.default.existsSync(f),m=[];if(d){let p;try{p=Zl.default.readJsonSync(f)}catch{}p&&m.push(...Object.keys(p.scripts||{}))}let y=t;return Qs.default.join(l,a)===t&&(y=a),{cdPath:y,hasPackageJson:d,availableScripts:m,repoInfo:i}}var Jl=oe(require("picocolors")),lk=oe(require("update-check"));function My(t){let{packageInfo:e,upgradeCommand:r}=t,n=(0,lk.default)(e).catch(()=>null);return async function(s=0){try{let o=await n;if(o!=null&&o.latest){wt(),wt(Jl.default.yellow(Jl.default.bold(`A new version of \`${e.name}\` is available!`)));let a=typeof r=="function"?await r():r;a&&wt(`You can update by running: ${Jl.default.cyan(a)}`),wt()}process.exit(s)}catch(o){process.env.DEBUG&&yt("Update check failed:",o),process.exit(s)}}}var ho=require("fs"),Zy=require("crypto");var Ok=oe(require("picocolors"));var Te;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Te||(Te={}));var qy;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(qy||(qy={}));var ae=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nn=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map!="undefined"&&t instanceof Map?ae.map:typeof Set!="undefined"&&t instanceof Set?ae.set:typeof Date!="undefined"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ie=Te.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),vU=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Nt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Nt.create=t=>new Nt(t);var Da=(t,e)=>{let r;switch(t.code){case ie.invalid_type:t.received===ae.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Te.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Te.joinValues(t.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Te.joinValues(t.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Te.joinValues(t.options)}, received '${t.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ie.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ie.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=e.defaultError,Te.assertNever(t)}return{message:r}},dk=Da;function EU(t){dk=t}function Ql(){return dk}var eh=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s},a="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},wU=[];function ue(t,e){let r=eh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ql(),Da].filter(n=>!!n)});t.common.issues.push(r)}var et=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Ee;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return et.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Ee;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},Ee=Object.freeze({status:"aborted"}),pk=t=>({status:"dirty",value:t}),_t=t=>({status:"valid",value:t}),Uy=t=>t.status==="aborted",Hy=t=>t.status==="dirty",Ca=t=>t.status==="valid",th=t=>typeof Promise!="undefined"&&t instanceof Promise,ge;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ge||(ge={}));var tr=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},hk=(t,e)=>{if(Ca(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Nt(t.common.issues);return this._error=r,this._error}}};function we(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data=="undefined"?{message:n!=null?n:a.defaultError}:{message:r!=null?r:a.defaultError},description:i}}var xe=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Nn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new et,ctx:{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(th(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return hk(i,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(th(i)?i:Promise.resolve(i));return hk(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue({code:ie.custom,...n(i)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new jt({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return lr.create(this,this._def)}nullable(){return on.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mt.create(this,this._def)}promise(){return qn.create(this,this._def)}or(e){return Ei.create([this,e],this._def)}and(e){return wi.create(this,e,this._def)}transform(e){return new jt({...we(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ci({...we(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new rh({typeName:be.ZodBranded,type:this,...we(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new oo({...we(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ri.create(this,e)}readonly(){return uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xU=/^c[^\s-]{8,}$/i,SU=/^[a-z][a-z0-9]*$/,AU=/^[0-9A-HJKMNP-TV-Z]{26}$/,DU=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,CU=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",jy,kU=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,TU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,OU=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function FU(t,e){return!!((e==="v4"||!e)&&kU.test(t)||(e==="v6"||!e)&&TU.test(t))}var Bt=class extends xe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.string,received:s.parsedType}),Ee}let n=new et,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")CU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"email",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")jy||(jy=new RegExp(RU,"u")),jy.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"emoji",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")DU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"uuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")xU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")SU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid2",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")AU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ulid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ue(i,{validation:"url",code:ie.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"regex",code:ie.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?OU(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?FU(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ip",code:ie.invalid_string,message:s.message}),n.dirty()):Te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:ie.invalid_string,...ge.errToObj(n)})}_addCheck(e){return new Bt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ge.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...ge.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ge.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...ge.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ge.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ge.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ge.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ge.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ge.errToObj(r)})}nonempty(e){return this.min(1,ge.errToObj(e))}trim(){return new Bt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Bt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Bt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Bt.create=t=>{var e;return new Bt({checks:[],typeName:be.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};function PU(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var kr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.number,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="int"?Te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?PU(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_finite,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};kr.create=t=>new kr({checks:[],typeName:be.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var Tr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.bigint,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new Tr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new Tr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Tr.create=t=>{var e;return new Tr({checks:[],typeName:be.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};var _i=class extends xe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.boolean,received:n.parsedType}),Ee}return _t(e.data)}};_i.create=t=>new _i({typeName:be.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var nn=class extends xe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.date,received:s.parsedType}),Ee}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_date}),Ee}let n=new et,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ge.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ge.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};nn.create=t=>new nn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:be.ZodDate,...we(t)});var ro=class extends xe{_parse(e){if(this._getType(e)!==ae.symbol){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.symbol,received:n.parsedType}),Ee}return _t(e.data)}};ro.create=t=>new ro({typeName:be.ZodSymbol,...we(t)});var bi=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.undefined,received:n.parsedType}),Ee}return _t(e.data)}};bi.create=t=>new bi({typeName:be.ZodUndefined,...we(t)});var vi=class extends xe{_parse(e){if(this._getType(e)!==ae.null){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.null,received:n.parsedType}),Ee}return _t(e.data)}};vi.create=t=>new vi({typeName:be.ZodNull,...we(t)});var jn=class extends xe{constructor(){super(...arguments),this._any=!0}_parse(e){return _t(e.data)}};jn.create=t=>new jn({typeName:be.ZodAny,...we(t)});var rn=class extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _t(e.data)}};rn.create=t=>new rn({typeName:be.ZodUnknown,...we(t)});var hr=class extends xe{_parse(e){let r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:ae.never,received:r.parsedType}),Ee}};hr.create=t=>new hr({typeName:be.ZodNever,...we(t)});var no=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.void,received:n.parsedType}),Ee}return _t(e.data)}};no.create=t=>new no({typeName:be.ZodVoid,...we(t)});var Mt=class extends xe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==ae.array)return ue(r,{code:ie.invalid_type,expected:ae.array,received:r.parsedType}),Ee;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(ue(r,{code:o?ie.too_big:ie.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(ue(r,{code:ie.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(ue(r,{code:ie.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new tr(r,o,r.path,a)))).then(o=>et.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new tr(r,o,r.path,a)));return et.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Mt({...this._def,minLength:{value:e,message:ge.toString(r)}})}max(e,r){return new Mt({...this._def,maxLength:{value:e,message:ge.toString(r)}})}length(e,r){return new Mt({...this._def,exactLength:{value:e,message:ge.toString(r)}})}nonempty(e){return this.min(1,e)}};Mt.create=(t,e)=>new Mt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...we(e)});function to(t){if(t instanceof Ne){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=lr.create(to(n))}return new Ne({...t._def,shape:()=>e})}else return t instanceof Mt?new Mt({...t._def,type:to(t.element)}):t instanceof lr?lr.create(to(t.unwrap())):t instanceof on?on.create(to(t.unwrap())):t instanceof rr?rr.create(t.items.map(e=>to(e))):t}var Ne=class extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Te.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ae.object){let c=this._getOrReturnCtx(e);return ue(c,{code:ie.invalid_type,expected:ae.object,received:c.parsedType}),Ee}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof hr&&this._def.unknownKeys==="strip"))for(let c in i.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=s[c],h=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new tr(i,h,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof hr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")a.length>0&&(ue(i,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let h=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new tr(i,h,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let h=await l.key;c.push({key:h,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>et.mergeObjectSync(n,c)):et.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return ge.errToObj,new Ne({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let u=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=ge.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Ne({...this._def,unknownKeys:"strip"})}passthrough(){return new Ne({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ne({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ne({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:be.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ne({...this._def,catchall:e})}pick(e){let r={};return Te.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Ne({...this._def,shape:()=>r})}omit(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Ne({...this._def,shape:()=>r})}deepPartial(){return to(this)}partial(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Ne({...this._def,shape:()=>r})}required(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof lr;)s=s._def.innerType;r[n]=s}}),new Ne({...this._def,shape:()=>r})}keyof(){return mk(Te.objectKeys(this.shape))}};Ne.create=(t,e)=>new Ne({shape:()=>t,unknownKeys:"strip",catchall:hr.create(),typeName:be.ZodObject,...we(e)});Ne.strictCreate=(t,e)=>new Ne({shape:()=>t,unknownKeys:"strict",catchall:hr.create(),typeName:be.ZodObject,...we(e)});Ne.lazycreate=(t,e)=>new Ne({shape:t,unknownKeys:"strip",catchall:hr.create(),typeName:be.ZodObject,...we(e)});var Ei=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Nt(a.ctx.common.issues));return ue(r,{code:ie.invalid_union,unionErrors:o}),Ee}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(u=>new Nt(u));return ue(r,{code:ie.invalid_union,unionErrors:a}),Ee}}get options(){return this._def.options}};Ei.create=(t,e)=>new Ei({options:t,typeName:be.ZodUnion,...we(e)});var Xl=t=>t instanceof Si?Xl(t.schema):t instanceof jt?Xl(t.innerType()):t instanceof Ai?[t.value]:t instanceof Or?t.options:t instanceof Di?Object.keys(t.enum):t instanceof Ci?Xl(t._def.innerType):t instanceof bi?[void 0]:t instanceof vi?[null]:null,io=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.object)return ue(r,{code:ie.invalid_type,expected:ae.object,received:r.parsedType}),Ee;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ue(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=Xl(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new io({typeName:be.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...we(n)})}};function $y(t,e){let r=Nn(t),n=Nn(e);if(t===e)return{valid:!0,data:t};if(r===ae.object&&n===ae.object){let i=Te.objectKeys(e),s=Te.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of s){let u=$y(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===ae.array&&n===ae.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],u=$y(o,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===ae.date&&n===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var wi=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(Uy(s)||Uy(o))return Ee;let a=$y(s.value,o.value);return a.valid?((Hy(s)||Hy(o))&&r.dirty(),{status:r.value,value:a.data}):(ue(n,{code:ie.invalid_intersection_types}),Ee)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wi.create=(t,e,r)=>new wi({left:t,right:e,typeName:be.ZodIntersection,...we(r)});var rr=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.array)return ue(n,{code:ie.invalid_type,expected:ae.array,received:n.parsedType}),Ee;if(n.data.length<this._def.items.length)return ue(n,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&n.data.length>this._def.items.length&&(ue(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new tr(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>et.mergeArray(r,o)):et.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new rr({...this._def,rest:e})}};rr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rr({items:t,typeName:be.ZodTuple,rest:null,...we(e)})};var xi=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ue(n,{code:ie.invalid_type,expected:ae.object,received:n.parsedType}),Ee;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new tr(n,a,n.path,a)),value:o._parse(new tr(n,n.data[a],n.path,a))});return n.common.async?et.mergeObjectAsync(r,i):et.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof xe?new xi({keyType:e,valueType:r,typeName:be.ZodRecord,...we(n)}):new xi({keyType:Bt.create(),valueType:e,typeName:be.ZodRecord,...we(r)})}},so=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.map)return ue(n,{code:ie.invalid_type,expected:ae.map,received:n.parsedType}),Ee;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:i._parse(new tr(n,a,n.path,[c,"key"])),value:s._parse(new tr(n,u,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};so.create=(t,e,r)=>new so({valueType:e,keyType:t,typeName:be.ZodMap,...we(r)});var sn=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.set)return ue(n,{code:ie.invalid_type,expected:ae.set,received:n.parsedType}),Ee;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(ue(n,{code:ie.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(ue(n,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return Ee;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((u,c)=>s._parse(new tr(n,u,n.path,c)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new sn({...this._def,minSize:{value:e,message:ge.toString(r)}})}max(e,r){return new sn({...this._def,maxSize:{value:e,message:ge.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};sn.create=(t,e)=>new sn({valueType:t,minSize:null,maxSize:null,typeName:be.ZodSet,...we(e)});var Mn=class extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.function)return ue(r,{code:ie.invalid_type,expected:ae.function,received:r.parsedType}),Ee;function n(a,u){return eh({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ql(),Da].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function i(a,u){return eh({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ql(),Da].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:u}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof qn){let a=this;return _t(async function(...u){let c=new Nt([]),l=await a._def.args.parseAsync(u,s).catch(d=>{throw c.addIssue(n(u,d)),c}),h=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(h,s).catch(d=>{throw c.addIssue(i(h,d)),c})})}else{let a=this;return _t(function(...u){let c=a._def.args.safeParse(u,s);if(!c.success)throw new Nt([n(u,c.error)]);let l=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(l,s);if(!h.success)throw new Nt([i(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mn({...this._def,args:rr.create(e).rest(rn.create())})}returns(e){return new Mn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Mn({args:e||rr.create([]).rest(rn.create()),returns:r||rn.create(),typeName:be.ZodFunction,...we(n)})}},Si=class extends xe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Si.create=(t,e)=>new Si({getter:t,typeName:be.ZodLazy,...we(e)});var Ai=class extends xe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ue(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ai.create=(t,e)=>new Ai({value:t,typeName:be.ZodLiteral,...we(e)});function mk(t,e){return new Or({values:t,typeName:be.ZodEnum,...we(e)})}var Or=class extends xe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{expected:Te.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Ee}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Ee}return _t(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return Or.create(e)}exclude(e){return Or.create(this.options.filter(r=>!e.includes(r)))}};Or.create=mk;var Di=class extends xe{_parse(e){let r=Te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ae.string&&n.parsedType!==ae.number){let i=Te.objectValues(r);return ue(n,{expected:Te.joinValues(i),received:n.parsedType,code:ie.invalid_type}),Ee}if(r.indexOf(e.data)===-1){let i=Te.objectValues(r);return ue(n,{received:n.data,code:ie.invalid_enum_value,options:i}),Ee}return _t(e.data)}get enum(){return this._def.values}};Di.create=(t,e)=>new Di({values:t,typeName:be.ZodNativeEnum,...we(e)});var qn=class extends xe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.promise&&r.common.async===!1)return ue(r,{code:ie.invalid_type,expected:ae.promise,received:r.parsedType}),Ee;let n=r.parsedType===ae.promise?r.data:Promise.resolve(r.data);return _t(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};qn.create=(t,e)=>new qn({type:t,typeName:be.ZodPromise,...we(e)});var jt=class extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{ue(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){let o=a=>{let u=i.refinement(a,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ca(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ca(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Te.assertNever(i)}};jt.create=(t,e,r)=>new jt({schema:t,typeName:be.ZodEffects,effect:e,...we(r)});jt.createWithPreprocess=(t,e,r)=>new jt({schema:e,effect:{type:"preprocess",transform:t},typeName:be.ZodEffects,...we(r)});var lr=class extends xe{_parse(e){return this._getType(e)===ae.undefined?_t(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lr.create=(t,e)=>new lr({innerType:t,typeName:be.ZodOptional,...we(e)});var on=class extends xe{_parse(e){return this._getType(e)===ae.null?_t(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};on.create=(t,e)=>new on({innerType:t,typeName:be.ZodNullable,...we(e)});var Ci=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===ae.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ci.create=(t,e)=>new Ci({innerType:t,typeName:be.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...we(e)});var oo=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return th(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Nt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Nt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};oo.create=(t,e)=>new oo({innerType:t,typeName:be.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...we(e)});var ao=class extends xe{_parse(e){if(this._getType(e)!==ae.nan){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.nan,received:n.parsedType}),Ee}return{status:"valid",value:e.data}}};ao.create=t=>new ao({typeName:be.ZodNaN,...we(t)});var IU=Symbol("zod_brand"),rh=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ri=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ee:s.status==="dirty"?(r.dirty(),pk(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ee:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Ri({in:e,out:r,typeName:be.ZodPipeline})}},uo=class extends xe{_parse(e){let r=this._def.innerType._parse(e);return Ca(r)&&(r.value=Object.freeze(r.value)),r}};uo.create=(t,e)=>new uo({innerType:t,typeName:be.ZodReadonly,...we(e)});var yk=(t,e={},r)=>t?jn.create().superRefine((n,i)=>{var s,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:u})}}):jn.create(),LU={object:Ne.lazycreate},be;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(be||(be={}));var BU=(t,e={message:`Input not instance of ${t.name}`})=>yk(r=>r instanceof t,e),gk=Bt.create,_k=kr.create,NU=ao.create,MU=Tr.create,bk=_i.create,jU=nn.create,qU=ro.create,UU=bi.create,HU=vi.create,$U=jn.create,GU=rn.create,zU=hr.create,VU=no.create,WU=Mt.create,YU=Ne.create,KU=Ne.strictCreate,ZU=Ei.create,JU=io.create,XU=wi.create,QU=rr.create,e7=xi.create,t7=so.create,r7=sn.create,n7=Mn.create,i7=Si.create,s7=Ai.create,o7=Or.create,a7=Di.create,u7=qn.create,fk=jt.create,c7=lr.create,l7=on.create,h7=jt.createWithPreprocess,f7=Ri.create,d7=()=>gk().optional(),p7=()=>_k().optional(),m7=()=>bk().optional(),y7={string:t=>Bt.create({...t,coerce:!0}),number:t=>kr.create({...t,coerce:!0}),boolean:t=>_i.create({...t,coerce:!0}),bigint:t=>Tr.create({...t,coerce:!0}),date:t=>nn.create({...t,coerce:!0})},g7=Ee,co=Object.freeze({__proto__:null,defaultErrorMap:Da,setErrorMap:EU,getErrorMap:Ql,makeIssue:eh,EMPTY_PATH:wU,addIssueToContext:ue,ParseStatus:et,INVALID:Ee,DIRTY:pk,OK:_t,isAborted:Uy,isDirty:Hy,isValid:Ca,isAsync:th,get util(){return Te},get objectUtil(){return qy},ZodParsedType:ae,getParsedType:Nn,ZodType:xe,ZodString:Bt,ZodNumber:kr,ZodBigInt:Tr,ZodBoolean:_i,ZodDate:nn,ZodSymbol:ro,ZodUndefined:bi,ZodNull:vi,ZodAny:jn,ZodUnknown:rn,ZodNever:hr,ZodVoid:no,ZodArray:Mt,ZodObject:Ne,ZodUnion:Ei,ZodDiscriminatedUnion:io,ZodIntersection:wi,ZodTuple:rr,ZodRecord:xi,ZodMap:so,ZodSet:sn,ZodFunction:Mn,ZodLazy:Si,ZodLiteral:Ai,ZodEnum:Or,ZodNativeEnum:Di,ZodPromise:qn,ZodEffects:jt,ZodTransformer:jt,ZodOptional:lr,ZodNullable:on,ZodDefault:Ci,ZodCatch:oo,ZodNaN:ao,BRAND:IU,ZodBranded:rh,ZodPipeline:Ri,ZodReadonly:uo,custom:yk,Schema:xe,ZodSchema:xe,late:LU,get ZodFirstPartyTypeKind(){return be},coerce:y7,any:$U,array:WU,bigint:MU,boolean:bk,date:jU,discriminatedUnion:JU,effect:fk,enum:o7,function:n7,instanceof:BU,intersection:XU,lazy:i7,literal:s7,map:t7,nan:NU,nativeEnum:a7,never:zU,null:HU,nullable:l7,number:_k,object:YU,oboolean:m7,onumber:p7,optional:c7,ostring:d7,pipeline:f7,preprocess:h7,promise:u7,record:e7,set:r7,strictObject:KU,string:gk,symbol:qU,transformer:fk,tuple:QU,undefined:UU,union:ZU,unknown:GU,void:VU,NEVER:g7,ZodIssueCode:ie,quotelessJson:vU,ZodError:Nt});var Ky=oe(require("os")),Rk=oe(require("crypto")),kk=oe(require("path")),Tk=oe(Ck());function C7(t){let e=process.version,r=Ky.default.type(),n=Ky.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function R7(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,Tk.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return kk.default.join(t,"turborepo","telemetry.json")}function k7({input:t,salt:e}){return Rk.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var lo={buildUserAgent:C7,oneWayHashWithSalt:k7,defaultConfigPath:R7};var T7="TURBO_TELEMETRY_DEBUG",O7="TURBO_TELEMETRY_DISABLED",F7="TURBO_TELEMETRY_MESSAGE_DISABLED",P7="DO_NOT_TRACK",I7=co.object({telemetry_enabled:co.boolean(),telemetry_id:co.string(),telemetry_salt:co.string(),telemetry_alerted:co.string().optional()}),Ct=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,ho.readFileSync)(e,"utf-8"),n=JSON.parse(r),i=Ct.validateConfig(n);return new Ct({configPath:e,config:i})}catch{return Ct.tryRemove({configPath:e})?Ct.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await lo.defaultConfigPath();return Ct.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return I7.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=(0,Zy.randomUUID)(),n=(0,Zy.randomUUID)(),i=lo.oneWayHashWithSalt({input:r,salt:n}),s=new Ct({configPath:e,config:{telemetry_enabled:!0,telemetry_id:i,telemetry_salt:n}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,ho.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,ho.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[P7]||"0",r=process.env[O7]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[F7]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(de.log(),de.bold("Attention:"),de.grey("Turborepo now collects completely anonymous telemetry regarding usage."),de.grey("This information is used to shape the Turborepo roadmap and prioritize features."),de.grey("You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"),de.underline(Ok.default.gray("https://turborepo.com/docs/telemetry"))),this.alertShown()}enable(){this.config.telemetry_enabled=!0,this.tryWrite()}disable(){this.config.telemetry_enabled=!1,this.tryWrite()}alertShown(){return this.hasSeenAlert()||(this.config.telemetry_alerted=new Date().toISOString(),this.tryWrite()),!0}oneWayHash(e){return lo.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[T7]||"0";return e==="1"||e.toLowerCase()==="true"}};var Jy=require("crypto"),Fk=oe(Cy());var L7=20,B7="/api/turborepo/v1/events",ki=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=L7;this.timeout=250;this.sessionId=(0,Jy.randomUUID)();this.eventBatches=[];this.events=[];let s=new URL(B7,e);this.api=s.toString(),this.packageInfo=r,this.config=n,i!=null&&i.timeout&&(this.timeout=i.timeout),i!=null&&i.batchSize&&(this.batchSize=i.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(Fk.default.post(this.api,{timeout:this.timeout,json:e,headers:{"x-turbo-telemetry-id":this.config.id,"x-turbo-session-id":this.sessionId,"User-Agent":lo.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:(0,Jy.randomUUID)(),key:e,value:i?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:n};return Ct.isDebug()&&(de.log(),de.bold("[telemetry event]"),de.dimmed(JSON.stringify(s,null,2)),de.log()),this.config.isEnabled()&&(this.events.push({package:s}),this.events.length>=this.batchSize&&this.flushEvents()),s}async close(){for(;this.hasPendingEvents();)this.flushEvents();try{await this.waitForFlush()}catch{}}trackCliOption({option:e,value:r}){return this.track({key:`option:${e}`,value:r})}trackCliArgument({argument:e,value:r}){return this.track({key:`argument:${e}`,value:r})}trackCliCommand({command:e,value:r}){return this.track({key:`command:${e}`,value:r})}trackCommandStatus({command:e,status:r}){return this.trackCliCommand({command:e,value:r})}trackCommandWarning(e){return this.track({key:"warning",value:e})}trackCommandError(e){return this.track({key:"error",value:e})}};var Ra=class extends ki{trackOptionExample(e){if(e)return this.trackCliOption({option:"example",value:e})}trackOptionPackageManager(e){if(e)return this.trackCliOption({option:"package_manager",value:e})}trackOptionSkipInstall(e){if(e)return this.trackCliOption({option:"skip_install",value:e.toString()})}trackOptionSkipTransforms(e){if(e)return this.trackCliOption({option:"skip_transforms",value:e.toString()})}trackOptionTurboVersion(e){if(e)return this.trackCliOption({option:"turbo_version",value:e})}trackOptionExamplePath(e){if(e)return this.trackCliOption({option:"example_path",value:e})}trackArgumentDirectory(e){if(e)return this.trackCliArgument({argument:"project_directory",value:"provided"})}trackArgumentPackageManager(e){if(e)return this.trackCliArgument({argument:"package_manager",value:e})}};var Nk=oe(Bk());var M7=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],ka=class extends ki{trackCI(){var e;return this.track({key:"ci",value:(e=Nk.name)!=null?e:"unknown"})}trackArgumentWorkspace(e){if(e)return this.trackCliArgument({argument:"workspace",value:"provided"})}trackOptionTask(e){if(e)return this.trackCliOption({option:"task",value:M7.includes(e)?e:"other"})}trackOptionFallback(e){if(e)return this.trackCliOption({option:"fallback",value:e})}trackOptionDirectory(e){if(e)return this.trackCliOption({option:"directory",value:"custom"})}trackOptionMaxBuffer(e){if(e!==void 0)return this.trackCliOption({option:"max_buffer",value:e.toString()})}};var j7={"create-turbo":Ra,"turbo-ignore":ka},q7="https://telemetry.vercel.com";async function Xy({packageInfo:t,opts:e}){let r=j7[t.name],n=await Ct.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:q7,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}var Ta=oe(require("picocolors"));var Mk=require("commander"),jk="status",U7=["enable","disable",jk];function H7(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();de.log(`Status: ${e?Ta.default.bold(Ta.default.green("Enabled")):Ta.default.bold(Ta.default.red("Disabled"))}`),de.log(),e?de.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):de.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),de.log("Learn more: https://turborepo.com/docs/telemetry")}function $7(t,e){if(!e.telemetry){de.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),de.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),de.bold("Success!")),de.log(),H7(e)}function Qy(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new Mk.Argument("[action]","Action to perform").choices(U7).default(jk)).action($7)}var QT=require("proxy-agent"),gh=oe(eg());var qa=oe(require("path")),tt=oe(require("picocolors"));var Rt=require("picocolors"),tT=oe(Qu(),1),rT=oe(oc(),1),aT=oe(require("os"),1),uT=oe(_s(),1),$H=oe(require("picocolors"),1),GH=oe(require("update-check"),1),BZ=require("fs-extra");var UZ=oe(Ru(),1),$Z=require("fs-extra"),zZ=require("fs-extra"),WZ=require("picocolors"),lT=require("stream"),hT=require("util"),JZ=require("fs-extra"),eJ=require("picocolors"),rJ=require("fs-extra"),Ti=oe(require("path"),1),fr=oe(require("fs-extra"),1),fT=oe(_s(),1),dT=oe(require("path"),1),pT=oe(require("fs-extra"),1),mT=oe(require("picocolors"),1),un=oe(require("path"),1),yT=oe(_s(),1),Ht=require("fs-extra"),gT=oe(Ru(),1);var Fa=oe(require("path"),1),Oi=oe(require("fs-extra"),1),go=oe(require("path"),1),Fi=oe(require("fs-extra"),1),Pa=oe(require("path"),1),Ii=oe(require("fs-extra"),1),Ut=oe(require("picocolors"),1),xT=oe(oc(),1),ST=oe(_s(),1),AT=oe(Qu(),1),DT=require("semver"),CT=oe(require("picocolors"),1),z7=Object.create,ng=Object.defineProperty,V7=Object.getOwnPropertyDescriptor,W7=Object.getOwnPropertyNames,Y7=Object.getPrototypeOf,K7=Object.prototype.hasOwnProperty,_e=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),Z7=(t,e)=>()=>(t&&(e=t(t=0)),e),me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),J7=(t,e)=>{for(var r in e)ng(t,r,{get:e[r],enumerable:!0})},X7=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of W7(e))!K7.call(t,i)&&i!==r&&ng(t,i,{get:()=>e[i],enumerable:!(n=V7(e,i))||n.enumerable});return t},ah=(t,e,r)=>(r=t!=null?z7(Y7(t)):{},X7(e||!t||!t.__esModule?ng(r,"default",{value:t,enumerable:!0}):r,t)),ee=Z7(()=>{}),Q7=me((t,e)=>{ee();function r(n){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,r(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),eH=me((t,e)=>{ee();var r=Q7().default;function n(){"use strict";e.exports=n=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var i,s={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(q,g,_){q[g]=_.value},c=typeof Symbol=="function"?Symbol:{},l=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(q,g,_){return Object.defineProperty(q,g,{value:_,enumerable:!0,configurable:!0,writable:!0}),q[g]}try{d({},"")}catch{d=function(q,g,_){return q[g]=_}}function m(q,g,_,v){var R=g&&g.prototype instanceof k?g:k,S=Object.create(R.prototype),H=new G(v||[]);return u(S,"_invoke",{value:te(q,_,H)}),S}function y(q,g,_){try{return{type:"normal",arg:q.call(g,_)}}catch(v){return{type:"throw",arg:v}}}s.wrap=m;var p="suspendedStart",w="suspendedYield",O="executing",P="completed",I={};function k(){}function M(){}function x(){}var D={};d(D,l,function(){return this});var U=Object.getPrototypeOf,V=U&&U(U(Z([])));V&&V!==o&&a.call(V,l)&&(D=V);var N=x.prototype=k.prototype=Object.create(D);function W(q){["next","throw","return"].forEach(function(g){d(q,g,function(_){return this._invoke(g,_)})})}function Q(q,g){function _(R,S,H,$){var ne=y(q[R],q,S);if(ne.type!=="throw"){var Y=ne.arg,fe=Y.value;return fe&&r(fe)=="object"&&a.call(fe,"__await")?g.resolve(fe.__await).then(function(J){_("next",J,H,$)},function(J){_("throw",J,H,$)}):g.resolve(fe).then(function(J){Y.value=J,H(Y)},function(J){return _("throw",J,H,$)})}$(ne.arg)}var v;u(this,"_invoke",{value:function(R,S){function H(){return new g(function($,ne){_(R,S,$,ne)})}return v=v?v.then(H,H):H()}})}function te(q,g,_){var v=p;return function(R,S){if(v===O)throw new Error("Generator is already running");if(v===P){if(R==="throw")throw S;return{value:i,done:!0}}for(_.method=R,_.arg=S;;){var H=_.delegate;if(H){var $=j(H,_);if($){if($===I)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(v===p)throw v=P,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);v=O;var ne=y(q,g,_);if(ne.type==="normal"){if(v=_.done?P:w,ne.arg===I)continue;return{value:ne.arg,done:_.done}}ne.type==="throw"&&(v=P,_.method="throw",_.arg=ne.arg)}}}function j(q,g){var _=g.method,v=q.iterator[_];if(v===i)return g.delegate=null,_==="throw"&&q.iterator.return&&(g.method="return",g.arg=i,j(q,g),g.method==="throw")||_!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+_+"' method")),I;var R=y(v,q.iterator,g.arg);if(R.type==="throw")return g.method="throw",g.arg=R.arg,g.delegate=null,I;var S=R.arg;return S?S.done?(g[q.resultName]=S.value,g.next=q.nextLoc,g.method!=="return"&&(g.method="next",g.arg=i),g.delegate=null,I):S:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,I)}function F(q){var g={tryLoc:q[0]};1 in q&&(g.catchLoc=q[1]),2 in q&&(g.finallyLoc=q[2],g.afterLoc=q[3]),this.tryEntries.push(g)}function L(q){var g=q.completion||{};g.type="normal",delete g.arg,q.completion=g}function G(q){this.tryEntries=[{tryLoc:"root"}],q.forEach(F,this),this.reset(!0)}function Z(q){if(q||q===""){var g=q[l];if(g)return g.call(q);if(typeof q.next=="function")return q;if(!isNaN(q.length)){var _=-1,v=function R(){for(;++_<q.length;)if(a.call(q,_))return R.value=q[_],R.done=!1,R;return R.value=i,R.done=!0,R};return v.next=v}}throw new TypeError(r(q)+" is not iterable")}return M.prototype=x,u(N,"constructor",{value:x,configurable:!0}),u(x,"constructor",{value:M,configurable:!0}),M.displayName=d(x,f,"GeneratorFunction"),s.isGeneratorFunction=function(q){var g=typeof q=="function"&&q.constructor;return!!g&&(g===M||(g.displayName||g.name)==="GeneratorFunction")},s.mark=function(q){return Object.setPrototypeOf?Object.setPrototypeOf(q,x):(q.__proto__=x,d(q,f,"GeneratorFunction")),q.prototype=Object.create(N),q},s.awrap=function(q){return{__await:q}},W(Q.prototype),d(Q.prototype,h,function(){return this}),s.AsyncIterator=Q,s.async=function(q,g,_,v,R){R===void 0&&(R=Promise);var S=new Q(m(q,g,_,v),R);return s.isGeneratorFunction(g)?S:S.next().then(function(H){return H.done?H.value:S.next()})},W(N),d(N,f,"Generator"),d(N,l,function(){return this}),d(N,"toString",function(){return"[object Generator]"}),s.keys=function(q){var g=Object(q),_=[];for(var v in g)_.push(v);return _.reverse(),function R(){for(;_.length;){var S=_.pop();if(S in g)return R.value=S,R.done=!1,R}return R.done=!0,R}},s.values=Z,G.prototype={constructor:G,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(L),!q)for(var g in this)g.charAt(0)==="t"&&a.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=i)},stop:function(){this.done=!0;var q=this.tryEntries[0].completion;if(q.type==="throw")throw q.arg;return this.rval},dispatchException:function(q){if(this.done)throw q;var g=this;function _(ne,Y){return S.type="throw",S.arg=q,g.next=ne,Y&&(g.method="next",g.arg=i),!!Y}for(var v=this.tryEntries.length-1;v>=0;--v){var R=this.tryEntries[v],S=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var H=a.call(R,"catchLoc"),$=a.call(R,"finallyLoc");if(H&&$){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(H){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return _(R.finallyLoc)}}}},abrupt:function(q,g){for(var _=this.tryEntries.length-1;_>=0;--_){var v=this.tryEntries[_];if(v.tryLoc<=this.prev&&a.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var R=v;break}}R&&(q==="break"||q==="continue")&&R.tryLoc<=g&&g<=R.finallyLoc&&(R=null);var S=R?R.completion:{};return S.type=q,S.arg=g,R?(this.method="next",this.next=R.finallyLoc,I):this.complete(S)},complete:function(q,g){if(q.type==="throw")throw q.arg;return q.type==="break"||q.type==="continue"?this.next=q.arg:q.type==="return"?(this.rval=this.arg=q.arg,this.method="return",this.next="end"):q.type==="normal"&&g&&(this.next=g),I},finish:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.finallyLoc===q)return this.complete(_.completion,_.afterLoc),L(_),I}},catch:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.tryLoc===q){var v=_.completion;if(v.type==="throw"){var R=v.arg;L(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(q,g,_){return this.delegate={iterator:Z(q),resultName:g,nextLoc:_},this.method==="next"&&(this.arg=i),I}},s}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}),tH=me((t,e)=>{ee();var r=eH()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),rH=me((t,e)=>{"use strict";ee();var r=(n,...i)=>new Promise(s=>{s(n(...i))});e.exports=r,e.exports.default=r}),nH=me((t,e)=>{"use strict";ee();var r=rH(),n=i=>{if(!((Number.isInteger(i)||i===1/0)&&i>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let s=[],o=0,a=()=>{o--,s.length>0&&s.shift()()},u=(h,f,...d)=>{o++;let m=r(h,...d);f(m),m.then(a,a)},c=(h,f,...d)=>{o<i?u(h,f,...d):s.push(u.bind(null,h,f,...d))},l=(h,...f)=>new Promise(d=>c(h,d,...f));return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),l};e.exports=n,e.exports.default=n}),iH=me((t,e)=>{"use strict";ee();var r=nH(),n=class extends Error{constructor(a){super(),this.value=a}},i=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new n(u[0]);return!1},o=async(a,u,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let l=r(c.concurrency),h=[...a].map(d=>[d,l(i,d,u)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof n)return d.value;throw d}};e.exports=o,e.exports.default=o}),sH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=_e("fs"),{promisify:i}=_e("util"),s=iH(),o=i(n.stat),a=i(n.lstat),u={directory:"isDirectory",file:"isFile"};function c({type:h}){if(!(h in u))throw new Error(`Invalid type specified: ${h}`)}var l=(h,f)=>h===void 0||f[u[h]]();e.exports=async(h,f)=>{f={cwd:process.cwd(),type:"file",allowSymlinks:!0,...f},c(f);let d=f.allowSymlinks?o:a;return s(h,async m=>{try{let y=await d(r.resolve(f.cwd,m));return l(f.type,y)}catch{return!1}},f)},e.exports.sync=(h,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let d=f.allowSymlinks?n.statSync:n.lstatSync;for(let m of h)try{let y=d(r.resolve(f.cwd,m));if(l(f.type,y))return m}catch{}}}),oH=me((t,e)=>{"use strict";ee();var r=_e("fs"),{promisify:n}=_e("util"),i=n(r.access);e.exports=async s=>{try{return await i(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),aH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=sH(),i=oH(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=async f=>{if(typeof o!="function")return n(l,f);let d=await o(f.cwd);return typeof d=="string"?n([d],f):d};for(;;){let f=await h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.sync=(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=f=>{if(typeof o!="function")return n.sync(l,f);let d=o(f.cwd);return typeof d=="string"?n.sync([d],f):d};for(;;){let f=h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.exists=i,e.exports.sync.exists=i.sync,e.exports.stop=s}),Ia=me((t,e)=>{"use strict";ee();var r=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"]]);e.exports=n=>n?Object.keys(n).map(i=>[r.has(i)?r.get(i):i,n[i]]).reduce((i,s)=>(i[s[0]]=s[1],i),Object.create(null)):{}}),ig=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),w=Symbol("flowing"),O=Symbol("paused"),P=Symbol("resume"),I=Symbol("buffer"),k=Symbol("pipes"),M=Symbol("bufferLength"),x=Symbol("bufferPush"),D=Symbol("bufferShift"),U=Symbol("objectMode"),V=Symbol("destroyed"),N=Symbol("emitData"),W=Symbol("emitEnd"),Q=Symbol("emitEnd2"),te=Symbol("async"),j=R=>Promise.resolve().then(R),F=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=F&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),G=F&&Symbol.iterator||Symbol("iterator not implemented"),Z=R=>R==="end"||R==="finish"||R==="prefinish",q=R=>R instanceof ArrayBuffer||typeof R=="object"&&R.constructor&&R.constructor.name==="ArrayBuffer"&&R.byteLength>=0,g=R=>!Buffer.isBuffer(R)&&ArrayBuffer.isView(R),_=class{constructor(R,S,H){this.src=R,this.dest=S,this.opts=H,this.ondrain=()=>R[P](),S.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},v=class extends _{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(R,S,H){super(R,S,H),this.proxyErrors=$=>S.emit("error",$),R.on("error",this.proxyErrors)}};e.exports=class Hk extends i{constructor(S){super(),this[w]=!1,this[O]=!1,this[k]=[],this[I]=[],this[U]=S&&S.objectMode||!1,this[U]?this[y]=null:this[y]=S&&S.encoding||null,this[y]==="buffer"&&(this[y]=null),this[te]=S&&!!S.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[M]=0,this[V]=!1,S&&S.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[I]}),S&&S.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[k]})}get bufferLength(){return this[M]}get encoding(){return this[y]}set encoding(S){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[y]&&S!==this[y]&&(this[p]&&this[p].lastNeed||this[M]))throw new Error("cannot change encoding");this[y]!==S&&(this[p]=S?new s(S):null,this[I].length&&(this[I]=this[I].map(H=>this[p].write(H)))),this[y]=S}setEncoding(S){this.encoding=S}get objectMode(){return this[U]}set objectMode(S){this[U]=this[U]||!!S}get async(){return this[te]}set async(S){this[te]=this[te]||!!S}write(S,H,$){if(this[o])throw new Error("write after end");if(this[V])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof H=="function"&&($=H,H="utf8"),H||(H="utf8");let ne=this[te]?j:Y=>Y();return!this[U]&&!Buffer.isBuffer(S)&&(g(S)?S=Buffer.from(S.buffer,S.byteOffset,S.byteLength):q(S)?S=Buffer.from(S):typeof S!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&ne($),this.flowing):S.length?(typeof S=="string"&&!(H===this[y]&&!this[p].lastNeed)&&(S=Buffer.from(S,H)),Buffer.isBuffer(S)&&this[y]&&(S=this[p].write(S)),this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&ne($),this.flowing):(this[M]!==0&&this.emit("readable"),$&&ne($),this.flowing)}read(S){if(this[V])return null;if(this[M]===0||S===0||S>this[M])return this[a](),null;this[U]&&(S=null),this[I].length>1&&!this[U]&&(this.encoding?this[I]=[this[I].join("")]:this[I]=[Buffer.concat(this[I],this[M])]);let H=this[f](S||null,this[I][0]);return this[a](),H}[f](S,H){return S===H.length||S===null?this[D]():(this[I][0]=H.slice(S),H=H.slice(0,S),this[M]-=S),this.emit("data",H),!this[I].length&&!this[o]&&this.emit("drain"),H}end(S,H,$){return typeof S=="function"&&($=S,S=null),typeof H=="function"&&($=H,H="utf8"),S&&this.write(S,H),$&&this.once("end",$),this[o]=!0,this.writable=!1,(this.flowing||!this[O])&&this[a](),this}[P](){this[V]||(this[O]=!1,this[w]=!0,this.emit("resume"),this[I].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[w]=!1,this[O]=!0}get destroyed(){return this[V]}get flowing(){return this[w]}get paused(){return this[O]}[x](S){this[U]?this[M]+=1:this[M]+=S.length,this[I].push(S)}[D](){return this[I].length&&(this[U]?this[M]-=1:this[M]-=this[I][0].length),this[I].shift()}[d](S){do;while(this[m](this[D]()));!S&&!this[I].length&&!this[o]&&this.emit("drain")}[m](S){return S?(this.emit("data",S),this.flowing):!1}pipe(S,H){if(this[V])return;let $=this[u];return H=H||{},S===r.stdout||S===r.stderr?H.end=!1:H.end=H.end!==!1,H.proxyErrors=!!H.proxyErrors,$?H.end&&S.end():(this[k].push(H.proxyErrors?new v(this,S,H):new _(this,S,H)),this[te]?j(()=>this[P]()):this[P]()),S}unpipe(S){let H=this[k].find($=>$.dest===S);H&&(this[k].splice(this[k].indexOf(H),1),H.unpipe())}addListener(S,H){return this.on(S,H)}on(S,H){let $=super.on(S,H);return S==="data"&&!this[k].length&&!this.flowing?this[P]():S==="readable"&&this[M]!==0?super.emit("readable"):Z(S)&&this[u]?(super.emit(S),this.removeAllListeners(S)):S==="error"&&this[l]&&(this[te]?j(()=>H.call(this,this[l])):H.call(this,this[l])),$}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[V]&&this[I].length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(S,H,...$){if(S!=="error"&&S!=="close"&&S!==V&&this[V])return;if(S==="data")return H?this[te]?j(()=>this[N](H)):this[N](H):!1;if(S==="end")return this[W]();if(S==="close"){if(this[h]=!0,!this[u]&&!this[V])return;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(S==="error"){this[l]=H;let Y=super.emit("error",H);return this[a](),Y}else if(S==="resume"){let Y=super.emit("resume");return this[a](),Y}else if(S==="finish"||S==="prefinish"){let Y=super.emit(S);return this.removeAllListeners(S),Y}let ne=super.emit(S,H,...$);return this[a](),ne}[N](S){for(let $ of this[k])$.dest.write(S)===!1&&this.pause();let H=super.emit("data",S);return this[a](),H}[W](){this[u]||(this[u]=!0,this.readable=!1,this[te]?j(()=>this[Q]()):this[Q]())}[Q](){if(this[p]){let H=this[p].end();if(H){for(let $ of this[k])$.dest.write(H);super.emit("data",H)}}for(let H of this[k])H.end();let S=super.emit("end");return this.removeAllListeners("end"),S}collect(){let S=[];this[U]||(S.dataLength=0);let H=this.promise();return this.on("data",$=>{S.push($),this[U]||(S.dataLength+=$.length)}),H.then(()=>S)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(S=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?S.join(""):Buffer.concat(S,S.dataLength))}promise(){return new Promise((S,H)=>{this.on(V,()=>H(new Error("stream destroyed"))),this.on("error",$=>H($)),this.on("end",()=>S())})}[L](){return{next:()=>{let S=this.read();if(S!==null)return Promise.resolve({done:!1,value:S});if(this[o])return Promise.resolve({done:!0});let H=null,$=null,ne=E=>{this.removeListener("data",Y),this.removeListener("end",fe),$(E)},Y=E=>{this.removeListener("error",ne),this.removeListener("end",fe),this.pause(),H({value:E,done:!!this[o]})},fe=()=>{this.removeListener("error",ne),this.removeListener("data",Y),H({done:!0})},J=()=>ne(new Error("stream destroyed"));return new Promise((E,B)=>{$=B,H=E,this.once(V,J),this.once("error",ne),this.once("end",fe),this.once("data",Y)})}}}[G](){return{next:()=>{let S=this.read();return{value:S,done:S===null}}}}destroy(S){return this[V]?(S?this.emit("error",S):this.emit(V),this):(this[V]=!0,this[I].length=0,this[M]=0,typeof this.close=="function"&&!this[h]&&this.close(),S?this.emit("error",S):this.emit(V),this)}static isStream(S){return!!S&&(S instanceof Hk||S instanceof i||S instanceof n&&(typeof S.pipe=="function"||typeof S.write=="function"&&typeof S.end=="function"))}}}),uH=me((t,e)=>{ee();var r=_e("zlib").constants||{ZLIB_VERNUM:4736};e.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},r))}),$k=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),w=Symbol("flowing"),O=Symbol("paused"),P=Symbol("resume"),I=Symbol("bufferLength"),k=Symbol("bufferPush"),M=Symbol("bufferShift"),x=Symbol("objectMode"),D=Symbol("destroyed"),U=Symbol("emitData"),V=Symbol("emitEnd"),N=Symbol("emitEnd2"),W=Symbol("async"),Q=_=>Promise.resolve().then(_),te=global._MP_NO_ITERATOR_SYMBOLS_!=="1",j=te&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),F=te&&Symbol.iterator||Symbol("iterator not implemented"),L=_=>_==="end"||_==="finish"||_==="prefinish",G=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,Z=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_),q=class{constructor(_,v,R){this.src=_,this.dest=v,this.opts=R,this.ondrain=()=>_[P](),v.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},g=class extends q{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(_,v,R){super(_,v,R),this.proxyErrors=S=>v.emit("error",S),_.on("error",this.proxyErrors)}};e.exports=class Gk extends i{constructor(v){super(),this[w]=!1,this[O]=!1,this.pipes=[],this.buffer=[],this[x]=v&&v.objectMode||!1,this[x]?this[y]=null:this[y]=v&&v.encoding||null,this[y]==="buffer"&&(this[y]=null),this[W]=v&&!!v.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[I]=0,this[D]=!1}get bufferLength(){return this[I]}get encoding(){return this[y]}set encoding(v){if(this[x])throw new Error("cannot set encoding in objectMode");if(this[y]&&v!==this[y]&&(this[p]&&this[p].lastNeed||this[I]))throw new Error("cannot change encoding");this[y]!==v&&(this[p]=v?new s(v):null,this.buffer.length&&(this.buffer=this.buffer.map(R=>this[p].write(R)))),this[y]=v}setEncoding(v){this.encoding=v}get objectMode(){return this[x]}set objectMode(v){this[x]=this[x]||!!v}get async(){return this[W]}set async(v){this[W]=this[W]||!!v}write(v,R,S){if(this[o])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof R=="function"&&(S=R,R="utf8"),R||(R="utf8");let H=this[W]?Q:$=>$();return!this[x]&&!Buffer.isBuffer(v)&&(Z(v)?v=Buffer.from(v.buffer,v.byteOffset,v.byteLength):G(v)?v=Buffer.from(v):typeof v!="string"&&(this.objectMode=!0)),this[x]?(this.flowing&&this[I]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[k](v),this[I]!==0&&this.emit("readable"),S&&H(S),this.flowing):v.length?(typeof v=="string"&&!(R===this[y]&&!this[p].lastNeed)&&(v=Buffer.from(v,R)),Buffer.isBuffer(v)&&this[y]&&(v=this[p].write(v)),this.flowing&&this[I]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[k](v),this[I]!==0&&this.emit("readable"),S&&H(S),this.flowing):(this[I]!==0&&this.emit("readable"),S&&H(S),this.flowing)}read(v){if(this[D])return null;if(this[I]===0||v===0||v>this[I])return this[a](),null;this[x]&&(v=null),this.buffer.length>1&&!this[x]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[I])]);let R=this[f](v||null,this.buffer[0]);return this[a](),R}[f](v,R){return v===R.length||v===null?this[M]():(this.buffer[0]=R.slice(v),R=R.slice(0,v),this[I]-=v),this.emit("data",R),!this.buffer.length&&!this[o]&&this.emit("drain"),R}end(v,R,S){return typeof v=="function"&&(S=v,v=null),typeof R=="function"&&(S=R,R="utf8"),v&&this.write(v,R),S&&this.once("end",S),this[o]=!0,this.writable=!1,(this.flowing||!this[O])&&this[a](),this}[P](){this[D]||(this[O]=!1,this[w]=!0,this.emit("resume"),this.buffer.length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[w]=!1,this[O]=!0}get destroyed(){return this[D]}get flowing(){return this[w]}get paused(){return this[O]}[k](v){this[x]?this[I]+=1:this[I]+=v.length,this.buffer.push(v)}[M](){return this.buffer.length&&(this[x]?this[I]-=1:this[I]-=this.buffer[0].length),this.buffer.shift()}[d](v){do;while(this[m](this[M]()));!v&&!this.buffer.length&&!this[o]&&this.emit("drain")}[m](v){return v?(this.emit("data",v),this.flowing):!1}pipe(v,R){if(this[D])return;let S=this[u];return R=R||{},v===r.stdout||v===r.stderr?R.end=!1:R.end=R.end!==!1,R.proxyErrors=!!R.proxyErrors,S?R.end&&v.end():(this.pipes.push(R.proxyErrors?new g(this,v,R):new q(this,v,R)),this[W]?Q(()=>this[P]()):this[P]()),v}unpipe(v){let R=this.pipes.find(S=>S.dest===v);R&&(this.pipes.splice(this.pipes.indexOf(R),1),R.unpipe())}addListener(v,R){return this.on(v,R)}on(v,R){let S=super.on(v,R);return v==="data"&&!this.pipes.length&&!this.flowing?this[P]():v==="readable"&&this[I]!==0?super.emit("readable"):L(v)&&this[u]?(super.emit(v),this.removeAllListeners(v)):v==="error"&&this[l]&&(this[W]?Q(()=>R.call(this,this[l])):R.call(this,this[l])),S}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[D]&&this.buffer.length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(v,R,...S){if(v!=="error"&&v!=="close"&&v!==D&&this[D])return;if(v==="data")return R?this[W]?Q(()=>this[U](R)):this[U](R):!1;if(v==="end")return this[V]();if(v==="close"){if(this[h]=!0,!this[u]&&!this[D])return;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(v==="error"){this[l]=R;let $=super.emit("error",R);return this[a](),$}else if(v==="resume"){let $=super.emit("resume");return this[a](),$}else if(v==="finish"||v==="prefinish"){let $=super.emit(v);return this.removeAllListeners(v),$}let H=super.emit(v,R,...S);return this[a](),H}[U](v){for(let S of this.pipes)S.dest.write(v)===!1&&this.pause();let R=super.emit("data",v);return this[a](),R}[V](){this[u]||(this[u]=!0,this.readable=!1,this[W]?Q(()=>this[N]()):this[N]())}[N](){if(this[p]){let R=this[p].end();if(R){for(let S of this.pipes)S.dest.write(R);super.emit("data",R)}}for(let R of this.pipes)R.end();let v=super.emit("end");return this.removeAllListeners("end"),v}collect(){let v=[];this[x]||(v.dataLength=0);let R=this.promise();return this.on("data",S=>{v.push(S),this[x]||(v.dataLength+=S.length)}),R.then(()=>v)}concat(){return this[x]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(v=>this[x]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?v.join(""):Buffer.concat(v,v.dataLength))}promise(){return new Promise((v,R)=>{this.on(D,()=>R(new Error("stream destroyed"))),this.on("error",S=>R(S)),this.on("end",()=>v())})}[j](){return{next:()=>{let v=this.read();if(v!==null)return Promise.resolve({done:!1,value:v});if(this[o])return Promise.resolve({done:!0});let R=null,S=null,H=fe=>{this.removeListener("data",$),this.removeListener("end",ne),S(fe)},$=fe=>{this.removeListener("error",H),this.removeListener("end",ne),this.pause(),R({value:fe,done:!!this[o]})},ne=()=>{this.removeListener("error",H),this.removeListener("data",$),R({done:!0})},Y=()=>H(new Error("stream destroyed"));return new Promise((fe,J)=>{S=J,R=fe,this.once(D,Y),this.once("error",H),this.once("end",ne),this.once("data",$)})}}}[F](){return{next:()=>{let v=this.read();return{value:v,done:v===null}}}}destroy(v){return this[D]?(v?this.emit("error",v):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[I]=0,typeof this.close=="function"&&!this[h]&&this.close(),v?this.emit("error",v):this.emit(D),this)}static isStream(v){return!!v&&(v instanceof Gk||v instanceof i||v instanceof n&&(typeof v.pipe=="function"||typeof v.write=="function"&&typeof v.end=="function"))}}}),zk=me(t=>{"use strict";ee();var e=_e("assert"),r=_e("buffer").Buffer,n=_e("zlib"),i=t.constants=uH(),s=$k(),o=r.concat,a=Symbol("_superWrite"),u=class extends Error{constructor(L){super("zlib: "+L.message),this.code=L.code,this.errno=L.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+L.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},c=Symbol("opts"),l=Symbol("flushFlag"),h=Symbol("finishFlushFlag"),f=Symbol("fullFlushFlag"),d=Symbol("handle"),m=Symbol("onError"),y=Symbol("sawError"),p=Symbol("level"),w=Symbol("strategy"),O=Symbol("ended"),P=Symbol("_defaultFullFlush"),I=class extends s{constructor(L,G){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[y]=!1,this[O]=!1,this[c]=L,this[l]=L.flush,this[h]=L.finishFlush;try{this[d]=new n[G](L)}catch(Z){throw new u(Z)}this[m]=Z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",Z))},this[d].on("error",Z=>this[m](new u(Z))),this.once("end",()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit("close"))}reset(){if(!this[y])return e(this[d],"zlib binding closed"),this[d].reset()}flush(L){this.ended||(typeof L!="number"&&(L=this[f]),this.write(Object.assign(r.alloc(0),{[l]:L})))}end(L,G,Z){return L&&this.write(L,G),this.flush(this[h]),this[O]=!0,super.end(null,null,Z)}get ended(){return this[O]}write(L,G,Z){if(typeof G=="function"&&(Z=G,G="utf8"),typeof L=="string"&&(L=r.from(L,G)),this[y])return;e(this[d],"zlib binding closed");let q=this[d]._handle,g=q.close;q.close=()=>{};let _=this[d].close;this[d].close=()=>{},r.concat=S=>S;let v;try{let S=typeof L[l]=="number"?L[l]:this[l];v=this[d]._processChunk(L,S),r.concat=o}catch(S){r.concat=o,this[m](new u(S))}finally{this[d]&&(this[d]._handle=q,q.close=g,this[d].close=_,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",S=>this[m](new u(S)));let R;if(v)if(Array.isArray(v)&&v.length>0){R=this[a](r.from(v[0]));for(let S=1;S<v.length;S++)R=this[a](v[S])}else R=this[a](r.from(v));return Z&&Z(),R}[a](L){return super.write(L)}},k=class extends I{constructor(L,G){L=L||{},L.flush=L.flush||i.Z_NO_FLUSH,L.finishFlush=L.finishFlush||i.Z_FINISH,super(L,G),this[f]=i.Z_FULL_FLUSH,this[p]=L.level,this[w]=L.strategy}params(L,G){if(!this[y]){if(!this[d])throw new Error("cannot switch params when binding is closed");if(!this[d].params)throw new Error("not supported in this implementation");if(this[p]!==L||this[w]!==G){this.flush(i.Z_SYNC_FLUSH),e(this[d],"zlib binding closed");let Z=this[d].flush;this[d].flush=(q,g)=>{this.flush(q),g()};try{this[d].params(L,G)}finally{this[d].flush=Z}this[d]&&(this[p]=L,this[w]=G)}}}},M=class extends k{constructor(L){super(L,"Deflate")}},x=class extends k{constructor(L){super(L,"Inflate")}},D=Symbol("_portable"),U=class extends k{constructor(L){super(L,"Gzip"),this[D]=L&&!!L.portable}[a](L){return this[D]?(this[D]=!1,L[9]=255,super[a](L)):super[a](L)}},V=class extends k{constructor(L){super(L,"Gunzip")}},N=class extends k{constructor(L){super(L,"DeflateRaw")}},W=class extends k{constructor(L){super(L,"InflateRaw")}},Q=class extends k{constructor(L){super(L,"Unzip")}},te=class extends I{constructor(L,G){L=L||{},L.flush=L.flush||i.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||i.BROTLI_OPERATION_FINISH,super(L,G),this[f]=i.BROTLI_OPERATION_FLUSH}},j=class extends te{constructor(L){super(L,"BrotliCompress")}},F=class extends te{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=M,t.Inflate=x,t.Gzip=U,t.Gunzip=V,t.DeflateRaw=N,t.InflateRaw=W,t.Unzip=Q,typeof n.BrotliCompress=="function"?(t.BrotliCompress=j,t.BrotliDecompress=F):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),La=me((t,e)=>{ee();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?n=>n:n=>n&&n.replace(/\\/g,"/")}),sg=me((t,e)=>{"use strict";ee();var r=ig(),n=La(),i=Symbol("slurp");e.exports=class extends r{constructor(s,o,a){switch(super(),this.pause(),this.extended=o,this.globalExtended=a,this.header=s,this.startBlockSize=512*Math.ceil(s.size/512),this.blockRemain=this.startBlockSize,this.remain=s.size,this.type=s.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=n(s.path),this.mode=s.mode,this.mode&&(this.mode=this.mode&4095),this.uid=s.uid,this.gid=s.gid,this.uname=s.uname,this.gname=s.gname,this.size=s.size,this.mtime=s.mtime,this.atime=s.atime,this.ctime=s.ctime,this.linkpath=n(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[i](o),a&&this[i](a,!0)}write(s){let o=s.length;if(o>this.blockRemain)throw new Error("writing more to entry than is appropriate");let a=this.remain,u=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,u-o),this.ignore?!0:a>=o?super.write(s):super.write(s.slice(0,a))}[i](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?n(s[a]):s[a])}}}),Vk=me(t=>{"use strict";ee(),t.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"]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))}),cH=me((t,e)=>{"use strict";ee();var r=(l,h)=>{if(Number.isSafeInteger(l))l<0?i(l,h):n(l,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},n=(l,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=l&255,l=Math.floor(l/256)},i=(l,h)=>{h[0]=255;var f=!1;l=l*-1;for(var d=h.length;d>1;d--){var m=l&255;l=Math.floor(l/256),f?h[d-1]=u(m):m===0?h[d-1]=0:(f=!0,h[d-1]=c(m))}},s=l=>{let h=l[0],f=h===128?a(l.slice(1,l.length)):h===255?o(l):null;if(f===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(f))throw Error("parsed number outside of javascript safe integer range");return f},o=l=>{for(var h=l.length,f=0,d=!1,m=h-1;m>-1;m--){var y=l[m],p;d?p=u(y):y===0?p=y:(d=!0,p=c(y)),p!==0&&(f-=p*Math.pow(256,h-m-1))}return f},a=l=>{for(var h=l.length,f=0,d=h-1;d>-1;d--){var m=l[d];m!==0&&(f+=m*Math.pow(256,h-d-1))}return f},u=l=>(255^l)&255,c=l=>(255^l)+1&255;e.exports={encode:r,parse:s}}),Ba=me((t,e)=>{"use strict";ee();var r=Vk(),n=_e("path").posix,i=cH(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(x,D,U,V){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[o]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(x)?this.decode(x,D||0,U,V):x&&this.set(x)}decode(x,D,U,V){if(D||(D=0),!x||!(x.length>=D+512))throw new Error("need 512 bytes for header");if(this.path=c(x,D,100),this.mode=f(x,D+100,8),this.uid=f(x,D+108,8),this.gid=f(x,D+116,8),this.size=f(x,D+124,12),this.mtime=l(x,D+136,12),this.cksum=f(x,D+148,12),this[s](U),this[s](V,!0),this[o]=c(x,D+156,1),this[o]===""&&(this[o]="0"),this[o]==="0"&&this.path.slice(-1)==="/"&&(this[o]="5"),this[o]==="5"&&(this.size=0),this.linkpath=c(x,D+157,100),x.slice(D+257,D+265).toString()==="ustar\x0000")if(this.uname=c(x,D+265,32),this.gname=c(x,D+297,32),this.devmaj=f(x,D+329,8),this.devmin=f(x,D+337,8),x[D+475]!==0){let W=c(x,D+345,155);this.path=W+"/"+this.path}else{let W=c(x,D+345,130);W&&(this.path=W+"/"+this.path),this.atime=l(x,D+476,12),this.ctime=l(x,D+488,12)}let N=8*32;for(let W=D;W<D+148;W++)N+=x[W];for(let W=D+156;W<D+512;W++)N+=x[W];this.cksumValid=N===this.cksum,this.cksum===null&&N===8*32&&(this.nullBlock=!0)}[s](x,D){for(let U in x)x[U]!==null&&x[U]!==void 0&&!(D&&U==="path")&&(this[U]=x[U])}encode(x,D){if(x||(x=this.block=Buffer.alloc(512),D=0),D||(D=0),!(x.length>=D+512))throw new Error("need 512 bytes for header");let U=this.ctime||this.atime?130:155,V=u(this.path||"",U),N=V[0],W=V[1];this.needPax=V[2],this.needPax=M(x,D,100,N)||this.needPax,this.needPax=p(x,D+100,8,this.mode)||this.needPax,this.needPax=p(x,D+108,8,this.uid)||this.needPax,this.needPax=p(x,D+116,8,this.gid)||this.needPax,this.needPax=p(x,D+124,12,this.size)||this.needPax,this.needPax=I(x,D+136,12,this.mtime)||this.needPax,x[D+156]=this[o].charCodeAt(0),this.needPax=M(x,D+157,100,this.linkpath)||this.needPax,x.write("ustar\x0000",D+257,8),this.needPax=M(x,D+265,32,this.uname)||this.needPax,this.needPax=M(x,D+297,32,this.gname)||this.needPax,this.needPax=p(x,D+329,8,this.devmaj)||this.needPax,this.needPax=p(x,D+337,8,this.devmin)||this.needPax,this.needPax=M(x,D+345,U,W)||this.needPax,x[D+475]!==0?this.needPax=M(x,D+345,155,W)||this.needPax:(this.needPax=M(x,D+345,130,W)||this.needPax,this.needPax=I(x,D+476,12,this.atime)||this.needPax,this.needPax=I(x,D+488,12,this.ctime)||this.needPax);let Q=8*32;for(let te=D;te<D+148;te++)Q+=x[te];for(let te=D+156;te<D+512;te++)Q+=x[te];return this.cksum=Q,p(x,D+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(x){for(let D in x)x[D]!==null&&x[D]!==void 0&&(this[D]=x[D])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(x){r.code.has(x)?this[o]=r.code.get(x):this[o]=x}},u=(x,D)=>{let U=x,V="",N,W=n.parse(x).root||".";if(Buffer.byteLength(U)<100)N=[U,V,!1];else{V=n.dirname(U),U=n.basename(U);do Buffer.byteLength(U)<=100&&Buffer.byteLength(V)<=D?N=[U,V,!1]:Buffer.byteLength(U)>100&&Buffer.byteLength(V)<=D?N=[U.slice(0,100-1),V,!0]:(U=n.join(n.basename(V),U),V=n.dirname(V));while(V!==W&&!N);N||(N=[x.slice(0,100-1),"",!0])}return N},c=(x,D,U)=>x.slice(D,D+U).toString("utf8").replace(/\0.*/,""),l=(x,D,U)=>h(f(x,D,U)),h=x=>x===null?null:new Date(x*1e3),f=(x,D,U)=>x[D]&128?i.parse(x.slice(D,D+U)):m(x,D,U),d=x=>isNaN(x)?null:x,m=(x,D,U)=>d(parseInt(x.slice(D,D+U).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},p=(x,D,U,V)=>V===null?!1:V>y[U]||V<0?(i.encode(V,x.slice(D,D+U)),!0):(w(x,D,U,V),!1),w=(x,D,U,V)=>x.write(O(V,U),D,U,"ascii"),O=(x,D)=>P(Math.floor(x).toString(8),D),P=(x,D)=>(x.length===D-1?x:new Array(D-x.length-1).join("0")+x+" ")+"\0",I=(x,D,U,V)=>V===null?!1:p(x,D,U,V.getTime()/1e3),k=new Array(156).join("\0"),M=(x,D,U,V)=>V===null?!1:(x.write(V+k,D,U,"utf8"),V.length!==Buffer.byteLength(V)||V.length>U);e.exports=a}),og=me((t,e)=>{"use strict";ee();var r=Ba(),n=_e("path"),i=class{constructor(u,c){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=c||!1}encode(){let u=this.encodeBody();if(u==="")return null;let c=Buffer.byteLength(u),l=512*Math.ceil(1+c/512),h=Buffer.allocUnsafe(l);for(let f=0;f<512;f++)h[f]=0;new r({path:("PaxHeader/"+n.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:c,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(h),h.write(u,512,c,"utf8");for(let f=c+512;f<h.length;f++)h[f]=0;return h}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(u){if(this[u]===null||this[u]===void 0)return"";let c=this[u]instanceof Date?this[u].getTime()/1e3:this[u],l=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+c+`
|
|
64
64
|
`,h=Buffer.byteLength(l),f=Math.floor(Math.log(h)/Math.log(10))+1;return h+f>=Math.pow(10,f)&&(f+=1),f+h+l}};i.parse=(u,c,l)=>new i(s(o(u),c),l);var s=(u,c)=>c?Object.keys(u).reduce((l,h)=>(l[h]=u[h],l),c):u,o=u=>u.replace(/\n$/,"").split(`
|