@socketsecurity/lib 3.2.2 → 3.2.3
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/CHANGELOG.md +9 -0
- package/dist/external/libnpmpack.js +67 -71
- package/dist/external/make-fetch-happen.js +16 -20
- package/dist/external/pacote.js +37 -41
- package/package.json +1 -1
|
@@ -2,32 +2,28 @@
|
|
|
2
2
|
* Bundled from make-fetch-happen
|
|
3
3
|
* This is a zero-dependency bundle created by esbuild.
|
|
4
4
|
*/
|
|
5
|
-
var Ch=Object.defineProperty;var o=(s,e)=>Ch(s,"name",{value:e,configurable:!0});var Ry=(s,e)=>()=>(s&&(e=s(s=0)),e);var m=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Oy=(s,e)=>{for(var t in e)Ch(s,t,{get:e[t],enumerable:!0})};var ee=m(oe=>{"use strict";var vy=oe&&oe.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(oe,"__esModule",{value:!0});oe.Minipass=oe.isWritable=oe.isReadable=oe.isStream=void 0;var Ah=typeof process=="object"&&process?process:{stdout:null,stderr:null},oo=require("node:events"),Ph=vy(require("node:stream")),Iy=require("node:string_decoder"),Ty=o(s=>!!s&&typeof s=="object"&&(s instanceof Qr||s instanceof Ph.default||(0,oe.isReadable)(s)||(0,oe.isWritable)(s)),"isStream");oe.isStream=Ty;var Cy=o(s=>!!s&&typeof s=="object"&&s instanceof oo.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==Ph.default.Writable.prototype.pipe,"isReadable");oe.isReadable=Cy;var Ay=o(s=>!!s&&typeof s=="object"&&s instanceof oo.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function","isWritable");oe.isWritable=Ay;var st=Symbol("EOF"),rt=Symbol("maybeEmitEnd"),_t=Symbol("emittedEnd"),Wr=Symbol("emittingEnd"),js=Symbol("emittedError"),Zr=Symbol("closed"),xh=Symbol("read"),Kr=Symbol("flush"),Bh=Symbol("flushChunk"),ke=Symbol("encoding"),os=Symbol("decoder"),G=Symbol("flowing"),Hs=Symbol("paused"),as=Symbol("resume"),V=Symbol("buffer"),ne=Symbol("pipes"),W=Symbol("bufferLength"),eo=Symbol("bufferPush"),Yr=Symbol("bufferShift"),Q=Symbol("objectMode"),j=Symbol("destroyed"),to=Symbol("error"),so=Symbol("emitData"),Nh=Symbol("emitEnd"),ro=Symbol("emitEnd2"),qe=Symbol("async"),io=Symbol("abort"),Xr=Symbol("aborted"),zs=Symbol("signal"),Lt=Symbol("dataListeners"),Ee=Symbol("discarded"),Gs=o(s=>Promise.resolve().then(s),"defer"),xy=o(s=>s(),"nodefer"),By=o(s=>s==="end"||s==="finish"||s==="prefinish","isEndish"),Ny=o(s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,"isArrayBufferLike"),Py=o(s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),"isArrayBufferView"),Jr=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[as](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},no=class extends Jr{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},Ly=o(s=>!!s.objectMode,"isObjectModeOptions"),ky=o(s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer","isEncodingOptions"),Qr=class extends oo.EventEmitter{static{o(this,"Minipass")}[G]=!1;[Hs]=!1;[ne]=[];[V]=[];[Q];[ke];[qe];[os];[st]=!1;[_t]=!1;[Wr]=!1;[Zr]=!1;[js]=null;[W]=0;[j]=!1;[zs];[Xr]=!1;[Lt]=0;[Ee]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Ly(t)?(this[Q]=!0,this[ke]=null):ky(t)?(this[ke]=t.encoding,this[Q]=!1):(this[Q]=!1,this[ke]=null),this[qe]=!!t.async,this[os]=this[ke]?new Iy.StringDecoder(this[ke]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[V],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[ne],"get")});let{signal:r}=t;r&&(this[zs]=r,r.aborted?this[io]():r.addEventListener("abort",()=>this[io]()))}get bufferLength(){return this[W]}get encoding(){return this[ke]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Q]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[qe]}set async(e){this[qe]=this[qe]||!!e}[io](){this[Xr]=!0,this.emit("abort",this[zs]?.reason),this.destroy(this[zs]?.reason)}get aborted(){return this[Xr]}set aborted(e){}write(e,t,r){if(this[Xr])return!1;if(this[st])throw new Error("write after end");if(this[j])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[qe]?Gs:xy;if(!this[Q]&&!Buffer.isBuffer(e)){if(Py(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Ny(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Q]?(this[G]&&this[W]!==0&&this[Kr](!0),this[G]?this.emit("data",e):this[eo](e),this[W]!==0&&this.emit("readable"),r&&i(r),this[G]):e.length?(typeof e=="string"&&!(t===this[ke]&&!this[os]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[ke]&&(e=this[os].write(e)),this[G]&&this[W]!==0&&this[Kr](!0),this[G]?this.emit("data",e):this[eo](e),this[W]!==0&&this.emit("readable"),r&&i(r),this[G]):(this[W]!==0&&this.emit("readable"),r&&i(r),this[G])}read(e){if(this[j])return null;if(this[Ee]=!1,this[W]===0||e===0||e&&e>this[W])return this[rt](),null;this[Q]&&(e=null),this[V].length>1&&!this[Q]&&(this[V]=[this[ke]?this[V].join(""):Buffer.concat(this[V],this[W])]);let t=this[xh](e||null,this[V][0]);return this[rt](),t}[xh](e,t){if(this[Q])this[Yr]();else{let r=t;e===r.length||e===null?this[Yr]():typeof r=="string"?(this[V][0]=r.slice(e),t=r.slice(0,e),this[W]-=e):(this[V][0]=r.subarray(e),t=r.subarray(0,e),this[W]-=e)}return this.emit("data",t),!this[V].length&&!this[st]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[st]=!0,this.writable=!1,(this[G]||!this[Hs])&&this[rt](),this}[as](){this[j]||(!this[Lt]&&!this[ne].length&&(this[Ee]=!0),this[Hs]=!1,this[G]=!0,this.emit("resume"),this[V].length?this[Kr]():this[st]?this[rt]():this.emit("drain"))}resume(){return this[as]()}pause(){this[G]=!1,this[Hs]=!0,this[Ee]=!1}get destroyed(){return this[j]}get flowing(){return this[G]}get paused(){return this[Hs]}[eo](e){this[Q]?this[W]+=1:this[W]+=e.length,this[V].push(e)}[Yr](){return this[Q]?this[W]-=1:this[W]-=this[V][0].length,this[V].shift()}[Kr](e=!1){do;while(this[Bh](this[Yr]())&&this[V].length);!e&&!this[V].length&&!this[st]&&this.emit("drain")}[Bh](e){return this.emit("data",e),this[G]}pipe(e,t){if(this[j])return e;this[Ee]=!1;let r=this[_t];return t=t||{},e===Ah.stdout||e===Ah.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[ne].push(t.proxyErrors?new no(this,e,t):new Jr(this,e,t)),this[qe]?Gs(()=>this[as]()):this[as]()),e}unpipe(e){let t=this[ne].find(r=>r.dest===e);t&&(this[ne].length===1?(this[G]&&this[Lt]===0&&(this[G]=!1),this[ne]=[]):this[ne].splice(this[ne].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[Ee]=!1,this[Lt]++,!this[ne].length&&!this[G]&&this[as]();else if(e==="readable"&&this[W]!==0)super.emit("readable");else if(By(e)&&this[_t])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[js]){let i=t;this[qe]?Gs(()=>i.call(this,this[js])):i.call(this,this[js])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Lt]=this.listeners("data").length,this[Lt]===0&&!this[Ee]&&!this[ne].length&&(this[G]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Lt]=0,!this[Ee]&&!this[ne].length&&(this[G]=!1)),t}get emittedEnd(){return this[_t]}[rt](){!this[Wr]&&!this[_t]&&!this[j]&&this[V].length===0&&this[st]&&(this[Wr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Zr]&&this.emit("close"),this[Wr]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==j&&this[j])return!1;if(e==="data")return!this[Q]&&!r?!1:this[qe]?(Gs(()=>this[so](r)),!0):this[so](r);if(e==="end")return this[Nh]();if(e==="close"){if(this[Zr]=!0,!this[_t]&&!this[j])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[js]=r,super.emit(to,r);let n=!this[zs]||this.listeners("error").length?super.emit("error",r):!1;return this[rt](),n}else if(e==="resume"){let n=super.emit("resume");return this[rt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,...t);return this[rt](),i}[so](e){for(let r of this[ne])r.dest.write(e)===!1&&this.pause();let t=this[Ee]?!1:super.emit("data",e);return this[rt](),t}[Nh](){return this[_t]?!1:(this[_t]=!0,this.readable=!1,this[qe]?(Gs(()=>this[ro]()),!0):this[ro]())}[ro](){if(this[os]){let t=this[os].end();if(t){for(let r of this[ne])r.dest.write(t);this[Ee]||super.emit("data",t)}}for(let t of this[ne])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Q]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Q]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Q])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[ke]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(j,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ee]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[st])return t();let n,a,c=o(f=>{this.off("data",h),this.off("end",u),this.off(j,l),t(),a(f)},"onerr"),h=o(f=>{this.off("error",c),this.off("end",u),this.off(j,l),this.pause(),n({value:f,done:!!this[st]})},"ondata"),u=o(()=>{this.off("error",c),this.off("data",h),this.off(j,l),t(),n({done:!0,value:void 0})},"onend"),l=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,d)=>{a=d,n=f,this.once(j,l),this.once("error",c),this.once("end",u),this.once("data",h)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ee]=!1;let e=!1,t=o(()=>(this.pause(),this.off(to,t),this.off(j,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(to,t),this.once(j,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[j])return e?this.emit("error",e):this.emit(j),this;this[j]=!0,this[Ee]=!0,this[V].length=0,this[W]=0;let t=this;return typeof t.close=="function"&&!this[Zr]&&t.close(),e?this.emit("error",e):this.emit(j),this}static get isStream(){return oe.isStream}};oe.Minipass=Qr});var ao=m(cs=>{"use strict";var Dy=cs&&cs.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(cs,"__esModule",{value:!0});cs.constants=void 0;var Fy=Dy(require("zlib")),My=Fy.default.constants||{ZLIB_VERNUM:4736};cs.constants=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},My))});var Dh=m(B=>{"use strict";var $y=B&&B.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),qy=B&&B.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Uy=B&&B.__importStar||(function(){var s=o(function(e){return s=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},s(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=s(e),i=0;i<r.length;i++)r[i]!=="default"&&$y(t,e,r[i]);return qy(t,e),t}})(),jy=B&&B.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(B,"__esModule",{value:!0});B.ZstdDecompress=B.ZstdCompress=B.BrotliDecompress=B.BrotliCompress=B.Unzip=B.InflateRaw=B.DeflateRaw=B.Gunzip=B.Gzip=B.Inflate=B.Deflate=B.Zlib=B.ZlibError=B.constants=void 0;var uo=jy(require("assert")),kt=require("buffer"),Hy=ee(),Lh=Uy(require("zlib")),Ue=ao(),zy=ao();Object.defineProperty(B,"constants",{enumerable:!0,get:o(function(){return zy.constants},"get")});var Gy=kt.Buffer.concat,kh=Object.getOwnPropertyDescriptor(kt.Buffer,"concat"),Vy=o(s=>s,"noop"),co=kh?.writable===!0||kh?.set!==void 0?s=>{kt.Buffer.concat=s?Vy:Gy}:s=>{},Dt=Symbol("_superWrite"),Ft=class extends Error{static{o(this,"ZlibError")}code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};B.ZlibError=Ft;var ho=Symbol("flushFlag"),Vs=class extends Hy.Minipass{static{o(this,"ZlibBase")}#e=!1;#t=!1;#s;#r;#i;#a;#l;get sawError(){return this.#e}get handle(){return this.#a}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#r=e.finishFlush??0,this.#i=e.fullFlushFlag??0,typeof Lh[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#a=new Lh[t](e)}catch(r){throw new Ft(r,this.constructor)}this.#l=r=>{this.#e||(this.#e=!0,this.close(),this.emit("error",r))},this.#a?.on("error",r=>this.#l(new Ft(r))),this.once("end",()=>this.close)}close(){this.#a&&(this.#a.close(),this.#a=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,uo.default)(this.#a,"zlib binding closed"),this.#a.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#i),this.write(Object.assign(kt.Buffer.alloc(0),{[ho]:e})))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(r)}get ended(){return this.#t}[Dt](e){return super.write(e)}write(e,t,r){if(typeof t=="function"&&(r=t,t="utf8"),typeof e=="string"&&(e=kt.Buffer.from(e,t)),this.#e)return;(0,uo.default)(this.#a,"zlib binding closed");let i=this.#a._handle,n=i.close;i.close=()=>{};let a=this.#a.close;this.#a.close=()=>{},co(!0);let c;try{let u=typeof e[ho]=="number"?e[ho]:this.#s;c=this.#a._processChunk(e,u),co(!1)}catch(u){co(!1),this.#l(new Ft(u,this.write))}finally{this.#a&&(this.#a._handle=i,i.close=n,this.#a.close=a,this.#a.removeAllListeners("error"))}this.#a&&this.#a.on("error",u=>this.#l(new Ft(u,this.write)));let h;if(c)if(Array.isArray(c)&&c.length>0){let u=c[0];h=this[Dt](kt.Buffer.from(u));for(let l=1;l<c.length;l++)h=this[Dt](c[l])}else h=this[Dt](kt.Buffer.from(c));return r&&r(),h}},je=class extends Vs{static{o(this,"Zlib")}#e;#t;constructor(e,t){e=e||{},e.flush=e.flush||Ue.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||Ue.constants.Z_FINISH,e.fullFlushFlag=Ue.constants.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#t=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#t!==t){this.flush(Ue.constants.Z_SYNC_FLUSH),(0,uo.default)(this.handle,"zlib binding closed");let r=this.handle.flush;this.handle.flush=(i,n)=>{typeof i=="function"&&(n=i,i=this.flushFlag),this.flush(i),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=r}this.handle&&(this.#e=e,this.#t=t)}}}};B.Zlib=je;var lo=class extends je{static{o(this,"Deflate")}constructor(e){super(e,"Deflate")}};B.Deflate=lo;var fo=class extends je{static{o(this,"Inflate")}constructor(e){super(e,"Inflate")}};B.Inflate=fo;var po=class extends je{static{o(this,"Gzip")}#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Dt](e){return this.#e?(this.#e=!1,e[9]=255,super[Dt](e)):super[Dt](e)}};B.Gzip=po;var mo=class extends je{static{o(this,"Gunzip")}constructor(e){super(e,"Gunzip")}};B.Gunzip=mo;var go=class extends je{static{o(this,"DeflateRaw")}constructor(e){super(e,"DeflateRaw")}};B.DeflateRaw=go;var yo=class extends je{static{o(this,"InflateRaw")}constructor(e){super(e,"InflateRaw")}};B.InflateRaw=yo;var Eo=class extends je{static{o(this,"Unzip")}constructor(e){super(e,"Unzip")}};B.Unzip=Eo;var ei=class extends Vs{static{o(this,"Brotli")}constructor(e,t){e=e||{},e.flush=e.flush||Ue.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||Ue.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=Ue.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},wo=class extends ei{static{o(this,"BrotliCompress")}constructor(e){super(e,"BrotliCompress")}};B.BrotliCompress=wo;var So=class extends ei{static{o(this,"BrotliDecompress")}constructor(e){super(e,"BrotliDecompress")}};B.BrotliDecompress=So;var ti=class extends Vs{static{o(this,"Zstd")}constructor(e,t){e=e||{},e.flush=e.flush||Ue.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||Ue.constants.ZSTD_e_end,e.fullFlushFlag=Ue.constants.ZSTD_e_flush,super(e,t)}},_o=class extends ti{static{o(this,"ZstdCompress")}constructor(e){super(e,"ZstdCompress")}};B.ZstdCompress=_o;var bo=class extends ti{static{o(this,"ZstdDecompress")}constructor(e){super(e,"ZstdDecompress")}};B.ZstdDecompress=bo});var ai=m((qA,Gh)=>{"use strict";var Fh=typeof process=="object"&&process?process:{stdout:null,stderr:null},Wy=require("events"),Mh=require("stream"),$h=require("string_decoder").StringDecoder,it=Symbol("EOF"),nt=Symbol("maybeEmitEnd"),bt=Symbol("emittedEnd"),si=Symbol("emittingEnd"),Ws=Symbol("emittedError"),ri=Symbol("closed"),qh=Symbol("read"),ii=Symbol("flush"),Uh=Symbol("flushChunk"),le=Symbol("encoding"),ot=Symbol("decoder"),ni=Symbol("flowing"),Zs=Symbol("paused"),hs=Symbol("resume"),Z=Symbol("bufferLength"),Ro=Symbol("bufferPush"),Oo=Symbol("bufferShift"),te=Symbol("objectMode"),se=Symbol("destroyed"),vo=Symbol("emitData"),jh=Symbol("emitEnd"),Io=Symbol("emitEnd2"),at=Symbol("async"),Ks=o(s=>Promise.resolve().then(s),"defer"),Hh=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Zy=Hh&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Ky=Hh&&Symbol.iterator||Symbol("iterator not implemented"),Yy=o(s=>s==="end"||s==="finish"||s==="prefinish","isEndish"),Xy=o(s=>s instanceof ArrayBuffer||typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,"isArrayBuffer"),Jy=o(s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),"isArrayBufferView"),oi=class{static{o(this,"Pipe")}constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[hs](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},To=class extends oi{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};Gh.exports=class zh extends Mh{static{o(this,"Minipass")}constructor(e){super(),this[ni]=!1,this[Zs]=!1,this.pipes=[],this.buffer=[],this[te]=e&&e.objectMode||!1,this[te]?this[le]=null:this[le]=e&&e.encoding||null,this[le]==="buffer"&&(this[le]=null),this[at]=e&&!!e.async||!1,this[ot]=this[le]?new $h(this[le]):null,this[it]=!1,this[bt]=!1,this[si]=!1,this[ri]=!1,this[Ws]=null,this.writable=!0,this.readable=!0,this[Z]=0,this[se]=!1}get bufferLength(){return this[Z]}get encoding(){return this[le]}set encoding(e){if(this[te])throw new Error("cannot set encoding in objectMode");if(this[le]&&e!==this[le]&&(this[ot]&&this[ot].lastNeed||this[Z]))throw new Error("cannot change encoding");this[le]!==e&&(this[ot]=e?new $h(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[ot].write(t)))),this[le]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[te]}set objectMode(e){this[te]=this[te]||!!e}get async(){return this[at]}set async(e){this[at]=this[at]||!!e}write(e,t,r){if(this[it])throw new Error("write after end");if(this[se])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[at]?Ks:n=>n();return!this[te]&&!Buffer.isBuffer(e)&&(Jy(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Xy(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[te]?(this.flowing&&this[Z]!==0&&this[ii](!0),this.flowing?this.emit("data",e):this[Ro](e),this[Z]!==0&&this.emit("readable"),r&&i(r),this.flowing):e.length?(typeof e=="string"&&!(t===this[le]&&!this[ot].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[le]&&(e=this[ot].write(e)),this.flowing&&this[Z]!==0&&this[ii](!0),this.flowing?this.emit("data",e):this[Ro](e),this[Z]!==0&&this.emit("readable"),r&&i(r),this.flowing):(this[Z]!==0&&this.emit("readable"),r&&i(r),this.flowing)}read(e){if(this[se])return null;if(this[Z]===0||e===0||e>this[Z])return this[nt](),null;this[te]&&(e=null),this.buffer.length>1&&!this[te]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Z])]);let t=this[qh](e||null,this.buffer[0]);return this[nt](),t}[qh](e,t){return e===t.length||e===null?this[Oo]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[Z]-=e),this.emit("data",t),!this.buffer.length&&!this[it]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t),r&&this.once("end",r),this[it]=!0,this.writable=!1,(this.flowing||!this[Zs])&&this[nt](),this}[hs](){this[se]||(this[Zs]=!1,this[ni]=!0,this.emit("resume"),this.buffer.length?this[ii]():this[it]?this[nt]():this.emit("drain"))}resume(){return this[hs]()}pause(){this[ni]=!1,this[Zs]=!0}get destroyed(){return this[se]}get flowing(){return this[ni]}get paused(){return this[Zs]}[Ro](e){this[te]?this[Z]+=1:this[Z]+=e.length,this.buffer.push(e)}[Oo](){return this.buffer.length&&(this[te]?this[Z]-=1:this[Z]-=this.buffer[0].length),this.buffer.shift()}[ii](e){do;while(this[Uh](this[Oo]()));!e&&!this.buffer.length&&!this[it]&&this.emit("drain")}[Uh](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[se])return;let r=this[bt];return t=t||{},e===Fh.stdout||e===Fh.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new To(this,e,t):new oi(this,e,t)),this[at]?Ks(()=>this[hs]()):this[hs]()),e}unpipe(e){let t=this.pipes.find(r=>r.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[hs]():e==="readable"&&this[Z]!==0?super.emit("readable"):Yy(e)&&this[bt]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Ws]&&(this[at]?Ks(()=>t.call(this,this[Ws])):t.call(this,this[Ws])),r}get emittedEnd(){return this[bt]}[nt](){!this[si]&&!this[bt]&&!this[se]&&this.buffer.length===0&&this[it]&&(this[si]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ri]&&this.emit("close"),this[si]=!1)}emit(e,t,...r){if(e!=="error"&&e!=="close"&&e!==se&&this[se])return;if(e==="data")return t?this[at]?Ks(()=>this[vo](t)):this[vo](t):!1;if(e==="end")return this[jh]();if(e==="close"){if(this[ri]=!0,!this[bt]&&!this[se])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Ws]=t;let n=super.emit("error",t);return this[nt](),n}else if(e==="resume"){let n=super.emit("resume");return this[nt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...r);return this[nt](),i}[vo](e){for(let r of this.pipes)r.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[nt](),t}[jh](){this[bt]||(this[bt]=!0,this.readable=!1,this[at]?Ks(()=>this[Io]()):this[Io]())}[Io](){if(this[ot]){let t=this[ot].end();if(t){for(let r of this.pipes)r.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[te]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[te]||(e.dataLength+=r.length)}),t.then(()=>e)}concat(){return this[te]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[te]?Promise.reject(new Error("cannot concat in objectMode")):this[le]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(se,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Zy](){return{next:o(()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[it])return Promise.resolve({done:!0});let r=null,i=null,n=o(u=>{this.removeListener("data",a),this.removeListener("end",c),i(u)},"onerr"),a=o(u=>{this.removeListener("error",n),this.removeListener("end",c),this.pause(),r({value:u,done:!!this[it]})},"ondata"),c=o(()=>{this.removeListener("error",n),this.removeListener("data",a),r({done:!0})},"onend"),h=o(()=>n(new Error("stream destroyed")),"ondestroy");return new Promise((u,l)=>{i=l,r=u,this.once(se,h),this.once("error",n),this.once("end",c),this.once("data",a)})},"next")}}[Ky](){return{next:o(()=>{let t=this.read();return{value:t,done:t===null}},"next")}}destroy(e){return this[se]?(e?this.emit("error",e):this.emit(se),this):(this[se]=!0,this.buffer.length=0,this[Z]=0,typeof this.close=="function"&&!this[ri]&&this.close(),e?this.emit("error",e):this.emit(se),this)}static isStream(e){return!!e&&(e instanceof zh||e instanceof Mh||e instanceof Wy&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Wh=m((jA,Vh)=>{var Qy=ai(),Ys=class extends Error{static{o(this,"SizeError")}constructor(e,t){super(`Bad data size: expected ${t} bytes, but got ${e}`),this.expect=t,this.found=e,this.code="EBADSIZE",Error.captureStackTrace(this,this.constructor)}get name(){return"SizeError"}},ci=class extends Qy{static{o(this,"MinipassSized")}constructor(e={}){if(super(e),e.objectMode)throw new TypeError(`${this.constructor.name} streams only work with string and buffer data`);if(this.found=0,this.expect=e.size,typeof this.expect!="number"||this.expect>Number.MAX_SAFE_INTEGER||isNaN(this.expect)||this.expect<0||!isFinite(this.expect)||this.expect!==Math.floor(this.expect))throw new Error("invalid expected size: "+this.expect)}write(e,t,r){let i=Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,typeof t=="string"?t:"utf8"):e;return Buffer.isBuffer(i)?(this.found+=i.length,this.found>this.expect&&this.emit("error",new Ys(this.found,this.expect)),super.write(e,t,r)):(this.emit("error",new TypeError(`${this.constructor.name} streams only work with string and buffer data`)),!1)}emit(e,...t){return e==="end"&&this.found!==this.expect&&this.emit("error",new Ys(this.found,this.expect)),super.emit(e,...t)}};ci.SizeError=Ys;Vh.exports=ci});var Kh=m((zA,Zh)=>{"use strict";var{Minipass:eE}=ee(),Co=Symbol("type"),ct=Symbol("buffer"),hi=class s{static{o(this,"Blob")}constructor(e,t){this[Co]="";let r=[],i=0;if(e){let a=e,c=Number(a.length);for(let h=0;h<c;h++){let u=a[h],l=u instanceof Buffer?u:ArrayBuffer.isView(u)?Buffer.from(u.buffer,u.byteOffset,u.byteLength):u instanceof ArrayBuffer?Buffer.from(u):u instanceof s?u[ct]:typeof u=="string"?Buffer.from(u):Buffer.from(String(u));i+=l.length,r.push(l)}}this[ct]=Buffer.concat(r,i);let n=t&&t.type!==void 0&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[Co]=n)}get size(){return this[ct].length}get type(){return this[Co]}text(){return Promise.resolve(this[ct].toString())}arrayBuffer(){let e=this[ct],t=e.byteOffset,r=e.byteLength,i=e.buffer.slice(t,t+r);return Promise.resolve(i)}stream(){return new eE().end(this[ct])}slice(e,t,r){let i=this.size,n=e===void 0?0:e<0?Math.max(i+e,0):Math.min(e,i),a=t===void 0?i:t<0?Math.max(i+t,0):Math.min(t,i),c=Math.max(a-n,0),u=this[ct].slice(n,n+c),l=new s([],{type:r});return l[ct]=u,l}get[Symbol.toStringTag](){return"Blob"}static get BUFFER(){return ct}};Object.defineProperties(hi.prototype,{size:{enumerable:!0},type:{enumerable:!0}});Zh.exports=hi});var xo=m((VA,Yh)=>{"use strict";var Ao=class extends Error{static{o(this,"FetchError")}constructor(e,t,r){super(e),this.code="FETCH_ERROR",r&&Object.assign(this,r),this.errno=this.code,this.type=this.code==="EBADSIZE"&&this.found>this.expect?"max-size":t,this.message=e,Error.captureStackTrace(this,this.constructor)}get name(){return"FetchError"}set name(e){}get[Symbol.toStringTag](){return"FetchError"}};Yh.exports=Ao});var Jh=m((ZA,Xh)=>{Xh.exports={}});var li=m((KA,tu)=>{"use strict";var{Minipass:He}=ee(),Bo=Wh(),eu=Kh(),{BUFFER:tE}=eu,Xs=xo(),No;try{No=Jh().convert}catch{}var ht=Symbol("Body internals"),Mt=Symbol("consumeBody"),ui=class{static{o(this,"Body")}constructor(e,t={}){let{size:r=0,timeout:i=0}=t,n=e==null?null:Qh(e)?Buffer.from(e.toString()):Js(e)||Buffer.isBuffer(e)?e:Object.prototype.toString.call(e)==="[object ArrayBuffer]"?Buffer.from(e):ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):He.isStream(e)?e:Buffer.from(String(e));this[ht]={body:n,disturbed:!1,error:null},this.size=r,this.timeout=i,He.isStream(n)&&n.on("error",a=>{let c=a.name==="AbortError"?a:new Xs(`Invalid response while trying to fetch ${this.url}: ${a.message}`,"system",a);this[ht].error=c})}get body(){return this[ht].body}get bodyUsed(){return this[ht].disturbed}arrayBuffer(){return this[Mt]().then(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}blob(){let e=this.headers&&this.headers.get("content-type")||"";return this[Mt]().then(t=>Object.assign(new eu([],{type:e.toLowerCase()}),{[tE]:t}))}async json(){let e=await this[Mt]();try{return JSON.parse(e.toString())}catch(t){throw new Xs(`invalid json response body at ${this.url} reason: ${t.message}`,"invalid-json")}}text(){return this[Mt]().then(e=>e.toString())}buffer(){return this[Mt]()}textConverted(){return this[Mt]().then(e=>sE(e,this.headers))}[Mt](){if(this[ht].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[ht].disturbed=!0,this[ht].error)return Promise.reject(this[ht].error);if(this.body===null)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);let e=Js(this.body)?this.body.stream():this.body;if(!He.isStream(e))return Promise.resolve(Buffer.alloc(0));let t=this.size&&e instanceof Bo||!this.size&&e instanceof He&&!(e instanceof Bo)?e:this.size?new Bo({size:this.size}):new He,r=this.timeout&&t.writable?setTimeout(()=>{t.emit("error",new Xs(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return r&&r.unref&&r.unref(),new Promise(i=>{t!==e&&(e.on("error",n=>t.emit("error",n)),e.pipe(t)),i()}).then(()=>t.concat()).then(i=>(clearTimeout(r),i)).catch(i=>{throw clearTimeout(r),i.name==="AbortError"||i.name==="FetchError"?i:i.name==="RangeError"?new Xs(`Could not create Buffer from response body for ${this.url}: ${i.message}`,"system",i):new Xs(`Invalid response body while trying to fetch ${this.url}: ${i.message}`,"system",i)})}static clone(e){if(e.bodyUsed)throw new Error("cannot clone body after it is used");let t=e.body;if(He.isStream(t)&&typeof t.getBoundary!="function"){let r=new He,i=new He,n=new He;return r.on("error",a=>{i.emit("error",a),n.emit("error",a)}),t.on("error",a=>r.emit("error",a)),r.pipe(i),r.pipe(n),t.pipe(r),e[ht].body=i,n}else return e.body}static extractContentType(e){return e==null?null:typeof e=="string"?"text/plain;charset=UTF-8":Qh(e)?"application/x-www-form-urlencoded;charset=UTF-8":Js(e)?e.type||null:Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object ArrayBuffer]"||ArrayBuffer.isView(e)?null:typeof e.getBoundary=="function"?`multipart/form-data;boundary=${e.getBoundary()}`:He.isStream(e)?null:"text/plain;charset=UTF-8"}static getTotalBytes(e){let{body:t}=e;return t==null?0:Js(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length===0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}static writeToStream(e,t){let{body:r}=t;return r==null?e.end():Buffer.isBuffer(r)||typeof r=="string"?e.end(r):(Js(r)?r.stream():r).on("error",n=>e.emit("error",n)).pipe(e),e}};Object.defineProperties(ui.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var Qh=o(s=>typeof s!="object"||typeof s.append!="function"||typeof s.delete!="function"||typeof s.get!="function"||typeof s.getAll!="function"||typeof s.has!="function"||typeof s.set!="function"?!1:s.constructor.name==="URLSearchParams"||Object.prototype.toString.call(s)==="[object URLSearchParams]"||typeof s.sort=="function","isURLSearchParams"),Js=o(s=>typeof s=="object"&&typeof s.arrayBuffer=="function"&&typeof s.type=="string"&&typeof s.stream=="function"&&typeof s.constructor=="function"&&typeof s.constructor.name=="string"&&/^(Blob|File)$/.test(s.constructor.name)&&/^(Blob|File)$/.test(s[Symbol.toStringTag]),"isBlob"),sE=o((s,e)=>{if(typeof No!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let t=e&&e.get("content-type"),r="utf-8",i;t&&(i=/charset=([^;]*)/i.exec(t));let n=s.slice(0,1024).toString();return!i&&n&&(i=/<meta.+?charset=(['"])(.+?)\1/i.exec(n)),!i&&n&&(i=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),i||(i=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),i&&i.pop()),i&&(i=/charset=(.*)/i.exec(i.pop()))),!i&&n&&(i=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n)),i&&(r=i.pop(),(r==="gb2312"||r==="gbk")&&(r="gb18030")),No(s,"UTF-8",r).toString()},"convertBody");tu.exports=ui});var di=m((XA,iu)=>{"use strict";var ru=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Lo=/[^\t\x20-\x7e\x80-\xff]/,Qs=o(s=>{if(s=`${s}`,ru.test(s)||s==="")throw new TypeError(`${s} is not a legal HTTP header name`)},"validateName"),su=o(s=>{if(s=`${s}`,Lo.test(s))throw new TypeError(`${s} is not a legal HTTP header value`)},"validateValue"),us=o((s,e)=>{e=e.toLowerCase();for(let t in s)if(t.toLowerCase()===e)return t},"find"),H=Symbol("map"),fi=class s{static{o(this,"Headers")}constructor(e=void 0){if(this[H]=Object.create(null),e instanceof s){let t=e.raw(),r=Object.keys(t);for(let i of r)for(let n of t[i])this.append(i,n);return}if(e!=null)if(typeof e=="object"){let t=e[Symbol.iterator];if(t!=null){if(typeof t!="function")throw new TypeError("Header pairs must be iterable");let r=[];for(let i of e){if(typeof i!="object"||typeof i[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");let n=Array.from(i);if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");r.push(n)}for(let i of r)this.append(i[0],i[1])}else for(let r of Object.keys(e))this.append(r,e[r])}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,Qs(e);let t=us(this[H],e);return t===void 0?null:this[H][t].join(", ")}forEach(e,t=void 0){let r=ko(this);for(let i=0;i<r.length;i++){let[n,a]=r[i];e.call(t,a,n,this),r=ko(this)}}set(e,t){e=`${e}`,t=`${t}`,Qs(e),su(t);let r=us(this[H],e);this[H][r!==void 0?r:e]=[t]}append(e,t){e=`${e}`,t=`${t}`,Qs(e),su(t);let r=us(this[H],e);r!==void 0?this[H][r].push(t):this[H][e]=[t]}has(e){return e=`${e}`,Qs(e),us(this[H],e)!==void 0}delete(e){e=`${e}`,Qs(e);let t=us(this[H],e);t!==void 0&&delete this[H][t]}raw(){return this[H]}keys(){return new $t(this,"key")}values(){return new $t(this,"value")}[Symbol.iterator](){return new $t(this,"key+value")}entries(){return new $t(this,"key+value")}get[Symbol.toStringTag](){return"Headers"}static exportNodeCompatibleHeaders(e){let t=Object.assign(Object.create(null),e[H]),r=us(e[H],"Host");return r!==void 0&&(t[r]=t[r][0]),t}static createHeadersLenient(e){let t=new s;for(let r of Object.keys(e))if(!ru.test(r))if(Array.isArray(e[r]))for(let i of e[r])Lo.test(i)||(t[H][r]===void 0?t[H][r]=[i]:t[H][r].push(i));else Lo.test(e[r])||(t[H][r]=[e[r]]);return t}};Object.defineProperties(fi.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});var ko=o((s,e="key+value")=>Object.keys(s[H]).sort().map(e==="key"?t=>t.toLowerCase():e==="value"?t=>s[H][t].join(", "):t=>[t.toLowerCase(),s[H][t].join(", ")]),"getHeaders"),Po=Symbol("internal"),$t=class s{static{o(this,"HeadersIterator")}constructor(e,t){this[Po]={target:e,kind:t,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==s.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");let{target:e,kind:t,index:r}=this[Po],i=ko(e,t),n=i.length;return r>=n?{value:void 0,done:!0}:(this[Po].index++,{value:i[r],done:!1})}};Object.setPrototypeOf($t.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));iu.exports=fi});var cu=m((QA,au)=>{"use strict";var rE=require("http"),{STATUS_CODES:iE}=rE,nu=di(),ou=li(),{clone:nE,extractContentType:oE}=ou,ut=Symbol("Response internals"),pi=class s extends ou{static{o(this,"Response")}constructor(e=null,t={}){super(e,t);let r=t.status||200,i=new nu(t.headers);if(e!=null&&!i.has("Content-Type")){let n=oE(e);n&&i.append("Content-Type",n)}this[ut]={url:t.url,status:r,statusText:t.statusText||iE[r],headers:i,counter:t.counter,trailer:Promise.resolve(t.trailer||new nu)}}get trailer(){return this[ut].trailer}get url(){return this[ut].url||""}get status(){return this[ut].status}get ok(){return this[ut].status>=200&&this[ut].status<300}get redirected(){return this[ut].counter>0}get statusText(){return this[ut].statusText}get headers(){return this[ut].headers}clone(){return new s(nE(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,trailer:this.trailer})}get[Symbol.toStringTag](){return"Response"}};au.exports=pi;Object.defineProperties(pi.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var hu=m((tx,aE)=>{aE.exports={name:"minipass-fetch",version:"4.0.1",description:"An implementation of window.fetch in Node.js using Minipass streams",license:"MIT",main:"lib/index.js",scripts:{"test:tls-fixtures":"./test/fixtures/tls/setup.sh",test:"tap",snap:"tap",lint:"npm run eslint",postlint:"template-oss-check",lintfix:"npm run eslint -- --fix",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},tap:{"coverage-map":"map.js","check-coverage":!0,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.3","@ungap/url-search-params":"^0.2.2","abort-controller":"^3.0.0","abortcontroller-polyfill":"~1.7.3",encoding:"^0.1.13","form-data":"^4.0.0",nock:"^13.2.4",parted:"^0.1.1","string-to-arraybuffer":"^1.0.2",tap:"^16.0.0"},dependencies:{minipass:"^7.0.3","minipass-sized":"^1.0.3",minizlib:"^3.0.1"},optionalDependencies:{encoding:"^0.1.13"},repository:{type:"git",url:"git+https://github.com/npm/minipass-fetch.git"},keywords:["fetch","minipass","node-fetch","window.fetch"],files:["bin/","lib/"],engines:{node:"^18.17.0 || >=20.5.0"},author:"GitHub Inc.",templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.3",publish:"true"}}});var fu=m((sx,lu)=>{"use strict";var{URL:Do}=require("url"),{Minipass:cE}=ee(),Fo=di(),{exportNodeCompatibleHeaders:hE}=Fo,uu=li(),{clone:uE,extractContentType:lE,getTotalBytes:fE}=uu,dE=hu().version,pE=`minipass-fetch/${dE} (+https://github.com/isaacs/minipass-fetch)`,De=Symbol("Request internals"),mi=o(s=>typeof s=="object"&&typeof s[De]=="object","isRequest"),mE=o(s=>{let e=s&&typeof s=="object"&&Object.getPrototypeOf(s);return!!(e&&e.constructor.name==="AbortSignal")},"isAbortSignal"),gi=class s extends uu{static{o(this,"Request")}constructor(e,t={}){let r=mi(e)?new Do(e.url):e&&e.href?new Do(e.href):new Do(`${e}`);mi(e)?t={...e[De],...t}:(!e||typeof e=="string")&&(e={});let i=(t.method||e.method||"GET").toUpperCase(),n=i==="GET"||i==="HEAD";if((t.body!==null&&t.body!==void 0||mi(e)&&e.body!==null)&&n)throw new TypeError("Request with GET/HEAD method cannot have body");let a=t.body!==null&&t.body!==void 0?t.body:mi(e)&&e.body!==null?uE(e):null;super(a,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});let c=new Fo(t.headers||e.headers||{});if(a!=null&&!c.has("Content-Type")){let tt=lE(a);tt&&c.append("Content-Type",tt)}let h="signal"in t?t.signal:null;if(h!=null&&!mE(h))throw new TypeError("Expected signal must be an instanceof AbortSignal");let{ca:u,cert:l,ciphers:f,clientCertEngine:d,crl:p,dhparam:y,ecdhCurve:g,family:w,honorCipherOrder:S,key:I,passphrase:T,pfx:_,rejectUnauthorized:O=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0",secureOptions:A,secureProtocol:P,servername:z,sessionIdContext:ue}=t;this[De]={method:i,redirect:t.redirect||e.redirect||"follow",headers:c,parsedURL:r,signal:h,ca:u,cert:l,ciphers:f,clientCertEngine:d,crl:p,dhparam:y,ecdhCurve:g,family:w,honorCipherOrder:S,key:I,passphrase:T,pfx:_,rejectUnauthorized:O,secureOptions:A,secureProtocol:P,servername:z,sessionIdContext:ue},this.follow=t.follow!==void 0?t.follow:e.follow!==void 0?e.follow:20,this.compress=t.compress!==void 0?t.compress:e.compress!==void 0?e.compress:!0,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent}get method(){return this[De].method}get url(){return this[De].parsedURL.toString()}get headers(){return this[De].headers}get redirect(){return this[De].redirect}get signal(){return this[De].signal}clone(){return new s(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(e){let t=e[De].parsedURL,r=new Fo(e[De].headers);if(r.has("Accept")||r.set("Accept","*/*"),!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&cE.isStream(e.body)&&typeof e.body.destroy!="function")throw new Error("Cancellation of streamed requests with AbortSignal is not supported");let i=(e.body===null||e.body===void 0)&&/^(POST|PUT)$/i.test(e.method)?"0":e.body!==null&&e.body!==void 0?fE(e):null;i&&r.set("Content-Length",i+""),r.has("User-Agent")||r.set("User-Agent",pE),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=typeof e.agent=="function"?e.agent(t):e.agent;!r.has("Connection")&&!n&&r.set("Connection","close");let{ca:a,cert:c,ciphers:h,clientCertEngine:u,crl:l,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:y,key:g,passphrase:w,pfx:S,rejectUnauthorized:I,secureOptions:T,secureProtocol:_,servername:O,sessionIdContext:A}=e[De];return{...{auth:t.username||t.password?`${t.username}:${t.password}`:"",host:t.host,hostname:t.hostname,path:`${t.pathname}${t.search}`,port:t.port,protocol:t.protocol},method:e.method,headers:hE(r),agent:n,ca:a,cert:c,ciphers:h,clientCertEngine:u,crl:l,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:y,key:g,passphrase:w,pfx:S,rejectUnauthorized:I,secureOptions:T,secureProtocol:_,servername:O,sessionIdContext:A,timeout:e.timeout}}};lu.exports=gi;Object.defineProperties(gi.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})});var pu=m((ix,du)=>{"use strict";var Mo=class extends Error{static{o(this,"AbortError")}constructor(e){super(e),this.code="FETCH_ABORTED",this.type="aborted",Error.captureStackTrace(this,this.constructor)}get name(){return"AbortError"}set name(e){}};du.exports=Mo});var sr=m((ox,yu)=>{"use strict";var{URL:er}=require("url"),gE=require("http"),yE=require("https"),ls=Dh(),{Minipass:mu}=ee(),EE=li(),{writeToStream:wE,getTotalBytes:SE}=EE,qt=cu(),qo=di(),{createHeadersLenient:gu}=qo,tr=fu(),{getNodeRequestOptions:_E}=tr,Rt=xo(),$o=pu(),lt=o(async(s,e)=>{if(/^data:/.test(s)){let t=new tr(s,e);return Promise.resolve().then(()=>new Promise((r,i)=>{let n,a;try{let{pathname:u,search:l}=new er(s),f=u.split(",");if(f.length<2)throw new Error("invalid data: URI");let d=f.shift(),p=/;base64$/.test(d);n=p?d.slice(0,-7):d;let y=decodeURIComponent(f.join(",")+l);a=p?Buffer.from(y,"base64"):Buffer.from(y)}catch(u){return i(new Rt(`[${t.method}] ${t.url} invalid URL, ${u.message}`,"system",u))}let{signal:c}=t;if(c&&c.aborted)return i(new $o("The user aborted a request."));let h={"Content-Length":a.length};return n&&(h["Content-Type"]=n),r(new qt(a,{headers:h}))}))}return new Promise((t,r)=>{let i=new tr(s,e),n;try{n=_E(i)}catch(y){return r(y)}let a=(n.protocol==="https:"?yE:gE).request,{signal:c}=i,h=null,u=o(()=>{let y=new $o("The user aborted a request.");r(y),mu.isStream(i.body)&&typeof i.body.destroy=="function"&&i.body.destroy(y),h&&h.body&&h.body.emit("error",y)},"abort");if(c&&c.aborted)return u();let l=o(()=>{u(),f()},"abortAndFinalize"),f=o(()=>{d.abort(),c&&c.removeEventListener("abort",l),clearTimeout(p)},"finalize"),d=a(n);c&&c.addEventListener("abort",l);let p=null;i.timeout&&d.once("socket",()=>{p=setTimeout(()=>{r(new Rt(`network timeout at: ${i.url}`,"request-timeout")),f()},i.timeout)}),d.on("error",y=>{d.res&&d.res.emit("error",y),r(new Rt(`request to ${i.url} failed, reason: ${y.message}`,"system",y)),f()}),d.on("response",y=>{clearTimeout(p);let g=gu(y.headers);if(lt.isRedirect(y.statusCode)){let O=g.get("Location"),A=null;try{A=O===null?null:new er(O,i.url).toString()}catch{if(i.redirect!=="manual"){r(new Rt(`uri requested responds with an invalid redirect URL: ${O}`,"invalid-redirect")),f();return}}if(i.redirect==="error"){r(new Rt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),f();return}else if(i.redirect==="manual"){if(A!==null)try{g.set("Location",A)}catch(P){r(P)}}else if(i.redirect==="follow"&&A!==null){if(i.counter>=i.follow){r(new Rt(`maximum redirect reached at: ${i.url}`,"max-redirect")),f();return}if(y.statusCode!==303&&i.body&&SE(i)===null){r(new Rt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),f();return}i.headers.set("host",new er(A).host);let P={headers:new qo(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout},z=new er(i.url),ue=new er(A);z.hostname!==ue.hostname&&(P.headers.delete("authorization"),P.headers.delete("cookie")),(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&i.method==="POST")&&(P.method="GET",P.body=void 0,P.headers.delete("content-length")),t(lt(new tr(A,P))),f();return}}y.once("end",()=>c&&c.removeEventListener("abort",l));let w=new mu;w.on("error",f),y.on("error",O=>w.emit("error",O)),y.on("data",O=>w.write(O)),y.on("end",()=>w.end());let S={url:i.url,status:y.statusCode,statusText:y.statusMessage,headers:g,size:i.size,timeout:i.timeout,counter:i.counter,trailer:new Promise(O=>y.on("end",()=>O(gu(y.trailers))))},I=g.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||I===null||y.statusCode===204||y.statusCode===304){h=new qt(w,S),t(h);return}let T={flush:ls.constants.Z_SYNC_FLUSH,finishFlush:ls.constants.Z_SYNC_FLUSH};if(I==="gzip"||I==="x-gzip"){let O=new ls.Gunzip(T);h=new qt(w.on("error",A=>O.emit("error",A)).pipe(O),S),t(h);return}if(I==="deflate"||I==="x-deflate"){y.once("data",O=>{let A=(O[0]&15)===8?new ls.Inflate:new ls.InflateRaw;w.on("error",P=>A.emit("error",P)).pipe(A),h=new qt(A,S),t(h)});return}if(I==="br"){try{var _=new ls.BrotliDecompress}catch(O){r(O),f();return}w.on("error",O=>_.emit("error",O)).pipe(_),h=new qt(_,S),t(h);return}h=new qt(w,S),t(h)}),wE(d,i)})},"fetch");yu.exports=lt;lt.isRedirect=s=>s===301||s===302||s===303||s===307||s===308;lt.Headers=qo;lt.Request=tr;lt.Response=qt;lt.FetchError=Rt;lt.AbortError=$o});var wu=m((cx,Eu)=>{var bE=require("dns"),RE=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"],OE=o(s=>{let{strictSSL:e,...t}={...s};if(t.method=t.method?t.method.toUpperCase():"GET",e==null?t.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0":t.rejectUnauthorized=e!==!1,!t.retry)t.retry={retries:0};else if(typeof t.retry=="string"){let r=parseInt(t.retry,10);isFinite(r)?t.retry={retries:r}:t.retry={retries:0}}else typeof t.retry=="number"?t.retry={retries:t.retry}:t.retry={retries:0,...t.retry};return t.dns={ttl:300*1e3,lookup:bE.lookup,...t.dns},t.cache=t.cache||"default",t.cache==="default"&&Object.keys(t.headers||{}).some(i=>RE.includes(i.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t},"configureOptions");Eu.exports=OE});var _u=m((lx,Su)=>{"use strict";var vE=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),IE=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),TE=new Set([500,502,503,504]),CE={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},AE={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function ft(s){let e=parseInt(s,10);return isFinite(e)?e:0}o(ft,"toNumberOrZero");function xE(s){return s?TE.has(s.status):!0}o(xE,"isErrorResponse");function Uo(s){let e={};if(!s)return e;let t=s.trim().split(/,/);for(let r of t){let[i,n]=r.split(/=/,2);e[i.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}o(Uo,"parseCacheControl");function BE(s){let e=[];for(let t in s){let r=s[t];e.push(r===!0?t:t+"="+r)}if(e.length)return e.join(", ")}o(BE,"formatCacheControl");Su.exports=class{static{o(this,"CachePolicy")}constructor(e,t,{shared:r,cacheHeuristic:i,immutableMinTimeToLive:n,ignoreCargoCult:a,_fromObject:c}={}){if(c){this._fromObject(c);return}if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=r!==!1,this._ignoreCargoCult=!!a,this._cacheHeuristic=i!==void 0?i:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=Uo(t.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=t.headers.vary?e.headers:null,this._reqcc=Uo(e.headers["cache-control"]),this._ignoreCargoCult&&"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":BE(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),t.headers["cache-control"]==null&&/no-cache/.test(t.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())&&IE.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||vE.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){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,t){return{synchronous:t,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc["must-revalidate"])return this._evaluateRequestMissResult(e);if(!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);let t=Uo(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):t["max-age"]&&this.age()>ft(t["max-age"])?this._evaluateRequestMissResult(e):t["min-fresh"]&&this.maxAge()-this.age()<ft(t["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in t&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&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 t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let r in e)CE[r]||(t[r]=e[r]);if(e.connection){let r=e.connection.trim().split(/\s*,\s*/);for(let i of r)delete t[i]}if(t.warning){let r=t.warning.split(/,/).filter(i=>!/^\s*1[0-9][0-9]/.test(i));r.length?t.warning=r.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,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(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return ft(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 ft(this._rescc["s-maxage"])}if(this._rescc["max-age"])return ft(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||r<t?0:Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){let r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+ft(this._rescc["stale-if-error"]),r=e+ft(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,t,r)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+ft(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=ft(this._rescc["stale-while-revalidate"]);return e>0&&this.maxAge()+e>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._ignoreCargoCult=!!e.icc,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,icc:this._ignoreCargoCult,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 t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete t["if-modified-since"],t["if-none-match"]){let i=t["if-none-match"].split(/,/).filter(n=>!/^\s*W\//.test(n));i.length?t["if-none-match"]=i.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&xE(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;t.status!==void 0&&t.status!=304?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(r=!0);let i={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!r)return{policy:new this.constructor(e,t,i),modified:t.status!=304,matches:!1};let n={};for(let c in this._resHeaders)n[c]=c in t.headers&&!AE[c]?t.headers[c]:this._resHeaders[c];let a=Object.assign({},t,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,a,i),modified:!1,matches:!0}}}});var vu=m((dx,jo)=>{"use strict";jo.exports=Ou;jo.exports.preferredCharsets=Ou;var NE=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function PE(s){for(var e=s.split(","),t=0,r=0;t<e.length;t++){var i=LE(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(PE,"parseAcceptCharset");function LE(s,e){var t=NE.exec(s);if(!t)return null;var r=t[1],i=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){i=parseFloat(c[1]);break}}return{charset:r,q:i,i:e}}o(LE,"parseCharset");function kE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=DE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(kE,"getCharsetPriority");function DE(s,e,t){var r=0;if(e.charset.toLowerCase()===s.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}o(DE,"specify");function Ou(s,e){var t=PE(s===void 0?"*":s||"");if(!e)return t.filter(Ru).sort(bu).map(FE);var r=e.map(o(function(n,a){return kE(n,t,a)},"getPriority"));return r.filter(Ru).sort(bu).map(o(function(n){return e[r.indexOf(n)]},"getCharset"))}o(Ou,"preferredCharsets");function bu(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(bu,"compareSpecs");function FE(s){return s.charset}o(FE,"getFullCharset");function Ru(s){return s.q>0}o(Ru,"isQuality")});var Au=m((mx,Ho)=>{"use strict";Ho.exports=Cu;Ho.exports.preferredEncodings=Cu;var ME=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function $E(s){for(var e=s.split(","),t=!1,r=1,i=0,n=0;i<e.length;i++){var a=qE(e[i].trim(),i);a&&(e[n++]=a,t=t||Tu("identity",a),r=Math.min(r,a.q||1))}return t||(e[n++]={encoding:"identity",q:r,i}),e.length=n,e}o($E,"parseAcceptEncoding");function qE(s,e){var t=ME.exec(s);if(!t)return null;var r=t[1],i=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){i=parseFloat(c[1]);break}}return{encoding:r,q:i,i:e}}o(qE,"parseEncoding");function UE(s,e,t){for(var r={encoding:s,o:-1,q:0,s:0},i=0;i<e.length;i++){var n=Tu(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(UE,"getEncodingPriority");function Tu(s,e,t){var r=0;if(e.encoding.toLowerCase()===s.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{encoding:s,i:t,o:e.i,q:e.q,s:r}}o(Tu,"specify");function Cu(s,e,t){var r=$E(s||""),i=t?o(function(c,h){if(c.q!==h.q)return h.q-c.q;var u=t.indexOf(c.encoding),l=t.indexOf(h.encoding);return u===-1&&l===-1?h.s-c.s||c.o-h.o||c.i-h.i:u!==-1&&l!==-1?u-l:u===-1?1:-1},"comparator"):jE;if(!e)return r.filter(Iu).sort(i).map(HE);var n=e.map(o(function(c,h){return UE(c,r,h)},"getPriority"));return n.filter(Iu).sort(i).map(o(function(c){return e[n.indexOf(c)]},"getEncoding"))}o(Cu,"preferredEncodings");function jE(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i}o(jE,"compareSpecs");function HE(s){return s.encoding}o(HE,"getFullEncoding");function Iu(s){return s.q>0}o(Iu,"isQuality")});var Lu=m((yx,zo)=>{"use strict";zo.exports=Pu;zo.exports.preferredLanguages=Pu;var zE=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function GE(s){for(var e=s.split(","),t=0,r=0;t<e.length;t++){var i=Nu(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(GE,"parseAcceptLanguage");function Nu(s,e){var t=zE.exec(s);if(!t)return null;var r=t[1],i=t[2],n=r;i&&(n+="-"+i);var a=1;if(t[3])for(var c=t[3].split(";"),h=0;h<c.length;h++){var u=c[h].split("=");u[0]==="q"&&(a=parseFloat(u[1]))}return{prefix:r,suffix:i,q:a,i:e,full:n}}o(Nu,"parseLanguage");function VE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=WE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(VE,"getLanguagePriority");function WE(s,e,t){var r=Nu(s);if(!r)return null;var i=0;if(e.full.toLowerCase()===r.full.toLowerCase())i|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())i|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())i|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}o(WE,"specify");function Pu(s,e){var t=GE(s===void 0?"*":s||"");if(!e)return t.filter(Bu).sort(xu).map(ZE);var r=e.map(o(function(n,a){return VE(n,t,a)},"getPriority"));return r.filter(Bu).sort(xu).map(o(function(n){return e[r.indexOf(n)]},"getLanguage"))}o(Pu,"preferredLanguages");function xu(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(xu,"compareSpecs");function ZE(s){return s.full}o(ZE,"getFullLanguage");function Bu(s){return s.q>0}o(Bu,"isQuality")});var qu=m((wx,Go)=>{"use strict";Go.exports=Mu;Go.exports.preferredMediaTypes=Mu;var KE=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function YE(s){for(var e=tw(s),t=0,r=0;t<e.length;t++){var i=Fu(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(YE,"parseAccept");function Fu(s,e){var t=KE.exec(s);if(!t)return null;var r=Object.create(null),i=1,n=t[2],a=t[1];if(t[3])for(var c=sw(t[3]).map(ew),h=0;h<c.length;h++){var u=c[h],l=u[0].toLowerCase(),f=u[1],d=f&&f[0]==='"'&&f[f.length-1]==='"'?f.slice(1,-1):f;if(l==="q"){i=parseFloat(d);break}r[l]=d}return{type:a,subtype:n,params:r,q:i,i:e}}o(Fu,"parseMediaType");function XE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=JE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(XE,"getMediaTypePriority");function JE(s,e,t){var r=Fu(s),i=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())i|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.subtype.toLowerCase())i|=2;else if(e.subtype!="*")return null;var n=Object.keys(e.params);if(n.length>0)if(n.every(function(a){return e.params[a]=="*"||(e.params[a]||"").toLowerCase()==(r.params[a]||"").toLowerCase()}))i|=1;else return null;return{i:t,o:e.i,q:e.q,s:i}}o(JE,"specify");function Mu(s,e){var t=YE(s===void 0?"*/*":s||"");if(!e)return t.filter(Du).sort(ku).map(QE);var r=e.map(o(function(n,a){return XE(n,t,a)},"getPriority"));return r.filter(Du).sort(ku).map(o(function(n){return e[r.indexOf(n)]},"getType"))}o(Mu,"preferredMediaTypes");function ku(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(ku,"compareSpecs");function QE(s){return s.type+"/"+s.subtype}o(QE,"getFullType");function Du(s){return s.q>0}o(Du,"isQuality");function $u(s){for(var e=0,t=0;(t=s.indexOf('"',t))!==-1;)e++,t++;return e}o($u,"quoteCount");function ew(s){var e=s.indexOf("="),t,r;return e===-1?t=s:(t=s.slice(0,e),r=s.slice(e+1)),[t,r]}o(ew,"splitKeyValuePair");function tw(s){for(var e=s.split(","),t=1,r=0;t<e.length;t++)$u(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}o(tw,"splitMediaTypes");function sw(s){for(var e=s.split(";"),t=1,r=0;t<e.length;t++)$u(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}o(sw,"splitParameters")});var Uu=m((_x,Vo)=>{"use strict";var rw=vu(),iw=Au(),nw=Lu(),ow=qu();Vo.exports=k;Vo.exports.Negotiator=k;function k(s){if(!(this instanceof k))return new k(s);this.request=s}o(k,"Negotiator");k.prototype.charset=o(function(e){var t=this.charsets(e);return t&&t[0]},"charset");k.prototype.charsets=o(function(e){return rw(this.request.headers["accept-charset"],e)},"charsets");k.prototype.encoding=o(function(e,t){var r=this.encodings(e,t);return r&&r[0]},"encoding");k.prototype.encodings=o(function(e,t){var r=t||{};return iw(this.request.headers["accept-encoding"],e,r.preferred)},"encodings");k.prototype.language=o(function(e){var t=this.languages(e);return t&&t[0]},"language");k.prototype.languages=o(function(e){return nw(this.request.headers["accept-language"],e)},"languages");k.prototype.mediaType=o(function(e){var t=this.mediaTypes(e);return t&&t[0]},"mediaType");k.prototype.mediaTypes=o(function(e){return ow(this.request.headers.accept,e)},"mediaTypes");k.prototype.preferredCharset=k.prototype.charset;k.prototype.preferredCharsets=k.prototype.charsets;k.prototype.preferredEncoding=k.prototype.encoding;k.prototype.preferredEncodings=k.prototype.encodings;k.prototype.preferredLanguage=k.prototype.language;k.prototype.preferredLanguages=k.prototype.languages;k.prototype.preferredMediaType=k.prototype.mediaType;k.prototype.preferredMediaTypes=k.prototype.mediaTypes});var Ot=m((Rx,ze)=>{"use strict";var ir=require("crypto"),{Minipass:aw}=ee(),Zo=["sha512","sha384","sha256"],Yo=["sha512"],cw=/^[a-z0-9+/]+(?:=?=?)$/i,hw=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,uw=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,lw=/^[\x21-\x7E]+$/,nr=o(s=>s?.length?`?${s.join("?")}`:"","getOptString"),Ko=class extends aw{static{o(this,"IntegrityStream")}#e;#t;#s;constructor(e){super(),this.size=0,this.opts=e,this.#r(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...Yo],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(ir.createHash)}#r(){this.sri=this.opts?.integrity?we(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=nr(this.opts?.options)}on(e,t){return e==="size"&&this.#t?t(this.#t):e==="integrity"&&this.#e?t(this.#e):e==="verified"&&this.#s?t(this.#s):super.on(e,t)}emit(e,t){return e==="end"&&this.#i(),super.emit(e,t)}write(e){return this.size+=e.length,this.hashes.forEach(t=>t.update(e)),super.write(e)}#i(){this.goodSri||this.#r();let e=we(this.hashes.map((r,i)=>`${this.algorithms[i]}-${r.digest("base64")}${this.optString}`).join(" "),this.opts),t=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize=="number"&&this.size!==this.expectedSize){let r=new Error(`stream size mismatch when checking ${this.sri}.
|
|
5
|
+
var fh=Object.defineProperty;var o=(s,e)=>fh(s,"name",{value:e,configurable:!0});var Xg=(s,e)=>()=>(s&&(e=s(s=0)),e);var m=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Jg=(s,e)=>{for(var t in e)fh(s,t,{get:e[t],enumerable:!0})};var J=m(ie=>{"use strict";var Qg=ie&&ie.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ie,"__esModule",{value:!0});ie.Minipass=ie.isWritable=ie.isReadable=ie.isStream=void 0;var dh=typeof process=="object"&&process?process:{stdout:null,stderr:null},Zn=require("node:events"),yh=Qg(require("node:stream")),ey=require("node:string_decoder"),ty=o(s=>!!s&&typeof s=="object"&&(s instanceof Gr||s instanceof yh.default||(0,ie.isReadable)(s)||(0,ie.isWritable)(s)),"isStream");ie.isStream=ty;var sy=o(s=>!!s&&typeof s=="object"&&s instanceof Zn.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==yh.default.Writable.prototype.pipe,"isReadable");ie.isReadable=sy;var ry=o(s=>!!s&&typeof s=="object"&&s instanceof Zn.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function","isWritable");ie.isWritable=ry;var Je=Symbol("EOF"),Qe=Symbol("maybeEmitEnd"),yt=Symbol("emittedEnd"),Fr=Symbol("emittingEnd"),Ps=Symbol("emittedError"),qr=Symbol("closed"),ph=Symbol("read"),Ur=Symbol("flush"),mh=Symbol("flushChunk"),Be=Symbol("encoding"),es=Symbol("decoder"),z=Symbol("flowing"),Ls=Symbol("paused"),ts=Symbol("resume"),G=Symbol("buffer"),re=Symbol("pipes"),V=Symbol("bufferLength"),jn=Symbol("bufferPush"),jr=Symbol("bufferShift"),X=Symbol("objectMode"),j=Symbol("destroyed"),Hn=Symbol("error"),zn=Symbol("emitData"),gh=Symbol("emitEnd"),Gn=Symbol("emitEnd2"),De=Symbol("async"),Vn=Symbol("abort"),Hr=Symbol("aborted"),ks=Symbol("signal"),xt=Symbol("dataListeners"),pe=Symbol("discarded"),Ds=o(s=>Promise.resolve().then(s),"defer"),iy=o(s=>s(),"nodefer"),ny=o(s=>s==="end"||s==="finish"||s==="prefinish","isEndish"),oy=o(s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,"isArrayBufferLike"),ay=o(s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),"isArrayBufferView"),zr=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[ts](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Wn=class extends zr{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},cy=o(s=>!!s.objectMode,"isObjectModeOptions"),hy=o(s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer","isEncodingOptions"),Gr=class extends Zn.EventEmitter{static{o(this,"Minipass")}[z]=!1;[Ls]=!1;[re]=[];[G]=[];[X];[Be];[De];[es];[Je]=!1;[yt]=!1;[Fr]=!1;[qr]=!1;[Ps]=null;[V]=0;[j]=!1;[ks];[Hr]=!1;[xt]=0;[pe]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");cy(t)?(this[X]=!0,this[Be]=null):hy(t)?(this[Be]=t.encoding,this[X]=!1):(this[X]=!1,this[Be]=null),this[De]=!!t.async,this[es]=this[Be]?new ey.StringDecoder(this[Be]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[G],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[re],"get")});let{signal:r}=t;r&&(this[ks]=r,r.aborted?this[Vn]():r.addEventListener("abort",()=>this[Vn]()))}get bufferLength(){return this[V]}get encoding(){return this[Be]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[X]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[De]}set async(e){this[De]=this[De]||!!e}[Vn](){this[Hr]=!0,this.emit("abort",this[ks]?.reason),this.destroy(this[ks]?.reason)}get aborted(){return this[Hr]}set aborted(e){}write(e,t,r){if(this[Hr])return!1;if(this[Je])throw new Error("write after end");if(this[j])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[De]?Ds:iy;if(!this[X]&&!Buffer.isBuffer(e)){if(ay(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(oy(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[X]?(this[z]&&this[V]!==0&&this[Ur](!0),this[z]?this.emit("data",e):this[jn](e),this[V]!==0&&this.emit("readable"),r&&i(r),this[z]):e.length?(typeof e=="string"&&!(t===this[Be]&&!this[es]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Be]&&(e=this[es].write(e)),this[z]&&this[V]!==0&&this[Ur](!0),this[z]?this.emit("data",e):this[jn](e),this[V]!==0&&this.emit("readable"),r&&i(r),this[z]):(this[V]!==0&&this.emit("readable"),r&&i(r),this[z])}read(e){if(this[j])return null;if(this[pe]=!1,this[V]===0||e===0||e&&e>this[V])return this[Qe](),null;this[X]&&(e=null),this[G].length>1&&!this[X]&&(this[G]=[this[Be]?this[G].join(""):Buffer.concat(this[G],this[V])]);let t=this[ph](e||null,this[G][0]);return this[Qe](),t}[ph](e,t){if(this[X])this[jr]();else{let r=t;e===r.length||e===null?this[jr]():typeof r=="string"?(this[G][0]=r.slice(e),t=r.slice(0,e),this[V]-=e):(this[G][0]=r.subarray(e),t=r.subarray(0,e),this[V]-=e)}return this.emit("data",t),!this[G].length&&!this[Je]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[Je]=!0,this.writable=!1,(this[z]||!this[Ls])&&this[Qe](),this}[ts](){this[j]||(!this[xt]&&!this[re].length&&(this[pe]=!0),this[Ls]=!1,this[z]=!0,this.emit("resume"),this[G].length?this[Ur]():this[Je]?this[Qe]():this.emit("drain"))}resume(){return this[ts]()}pause(){this[z]=!1,this[Ls]=!0,this[pe]=!1}get destroyed(){return this[j]}get flowing(){return this[z]}get paused(){return this[Ls]}[jn](e){this[X]?this[V]+=1:this[V]+=e.length,this[G].push(e)}[jr](){return this[X]?this[V]-=1:this[V]-=this[G][0].length,this[G].shift()}[Ur](e=!1){do;while(this[mh](this[jr]())&&this[G].length);!e&&!this[G].length&&!this[Je]&&this.emit("drain")}[mh](e){return this.emit("data",e),this[z]}pipe(e,t){if(this[j])return e;this[pe]=!1;let r=this[yt];return t=t||{},e===dh.stdout||e===dh.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[re].push(t.proxyErrors?new Wn(this,e,t):new zr(this,e,t)),this[De]?Ds(()=>this[ts]()):this[ts]()),e}unpipe(e){let t=this[re].find(r=>r.dest===e);t&&(this[re].length===1?(this[z]&&this[xt]===0&&(this[z]=!1),this[re]=[]):this[re].splice(this[re].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[pe]=!1,this[xt]++,!this[re].length&&!this[z]&&this[ts]();else if(e==="readable"&&this[V]!==0)super.emit("readable");else if(ny(e)&&this[yt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ps]){let i=t;this[De]?Ds(()=>i.call(this,this[Ps])):i.call(this,this[Ps])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[xt]=this.listeners("data").length,this[xt]===0&&!this[pe]&&!this[re].length&&(this[z]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[xt]=0,!this[pe]&&!this[re].length&&(this[z]=!1)),t}get emittedEnd(){return this[yt]}[Qe](){!this[Fr]&&!this[yt]&&!this[j]&&this[G].length===0&&this[Je]&&(this[Fr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[qr]&&this.emit("close"),this[Fr]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==j&&this[j])return!1;if(e==="data")return!this[X]&&!r?!1:this[De]?(Ds(()=>this[zn](r)),!0):this[zn](r);if(e==="end")return this[gh]();if(e==="close"){if(this[qr]=!0,!this[yt]&&!this[j])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Ps]=r,super.emit(Hn,r);let n=!this[ks]||this.listeners("error").length?super.emit("error",r):!1;return this[Qe](),n}else if(e==="resume"){let n=super.emit("resume");return this[Qe](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,...t);return this[Qe](),i}[zn](e){for(let r of this[re])r.dest.write(e)===!1&&this.pause();let t=this[pe]?!1:super.emit("data",e);return this[Qe](),t}[gh](){return this[yt]?!1:(this[yt]=!0,this.readable=!1,this[De]?(Ds(()=>this[Gn]()),!0):this[Gn]())}[Gn](){if(this[es]){let t=this[es].end();if(t){for(let r of this[re])r.dest.write(t);this[pe]||super.emit("data",t)}}for(let t of this[re])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[X]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[X]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[X])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Be]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(j,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[pe]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Je])return t();let n,a,c=o(f=>{this.off("data",h),this.off("end",u),this.off(j,l),t(),a(f)},"onerr"),h=o(f=>{this.off("error",c),this.off("end",u),this.off(j,l),this.pause(),n({value:f,done:!!this[Je]})},"ondata"),u=o(()=>{this.off("error",c),this.off("data",h),this.off(j,l),t(),n({done:!0,value:void 0})},"onend"),l=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,d)=>{a=d,n=f,this.once(j,l),this.once("error",c),this.once("end",u),this.once("data",h)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[pe]=!1;let e=!1,t=o(()=>(this.pause(),this.off(Hn,t),this.off(j,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(Hn,t),this.once(j,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[j])return e?this.emit("error",e):this.emit(j),this;this[j]=!0,this[pe]=!0,this[G].length=0,this[V]=0;let t=this;return typeof t.close=="function"&&!this[qr]&&t.close(),e?this.emit("error",e):this.emit(j),this}static get isStream(){return ie.isStream}};ie.Minipass=Gr});var Kn=m(ss=>{"use strict";var uy=ss&&ss.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ss,"__esModule",{value:!0});ss.constants=void 0;var ly=uy(require("zlib")),fy=ly.default.constants||{ZLIB_VERNUM:4736};ss.constants=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},fy))});var Sh=m(B=>{"use strict";var dy=B&&B.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),py=B&&B.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),my=B&&B.__importStar||(function(){var s=o(function(e){return s=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},s(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=s(e),i=0;i<r.length;i++)r[i]!=="default"&&dy(t,e,r[i]);return py(t,e),t}})(),gy=B&&B.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(B,"__esModule",{value:!0});B.ZstdDecompress=B.ZstdCompress=B.BrotliDecompress=B.BrotliCompress=B.Unzip=B.InflateRaw=B.DeflateRaw=B.Gunzip=B.Gzip=B.Inflate=B.Deflate=B.Zlib=B.ZlibError=B.constants=void 0;var Jn=gy(require("assert")),Ct=require("buffer"),yy=J(),Eh=my(require("zlib")),Me=Kn(),Ey=Kn();Object.defineProperty(B,"constants",{enumerable:!0,get:o(function(){return Ey.constants},"get")});var wy=Ct.Buffer.concat,wh=Object.getOwnPropertyDescriptor(Ct.Buffer,"concat"),Sy=o(s=>s,"noop"),Yn=wh?.writable===!0||wh?.set!==void 0?s=>{Ct.Buffer.concat=s?Sy:wy}:s=>{},Bt=Symbol("_superWrite"),Nt=class extends Error{static{o(this,"ZlibError")}code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};B.ZlibError=Nt;var Xn=Symbol("flushFlag"),Ms=class extends yy.Minipass{static{o(this,"ZlibBase")}#e=!1;#t=!1;#s;#r;#i;#a;#l;get sawError(){return this.#e}get handle(){return this.#a}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#r=e.finishFlush??0,this.#i=e.fullFlushFlag??0,typeof Eh[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#a=new Eh[t](e)}catch(r){throw new Nt(r,this.constructor)}this.#l=r=>{this.#e||(this.#e=!0,this.close(),this.emit("error",r))},this.#a?.on("error",r=>this.#l(new Nt(r))),this.once("end",()=>this.close)}close(){this.#a&&(this.#a.close(),this.#a=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,Jn.default)(this.#a,"zlib binding closed"),this.#a.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#i),this.write(Object.assign(Ct.Buffer.alloc(0),{[Xn]:e})))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(r)}get ended(){return this.#t}[Bt](e){return super.write(e)}write(e,t,r){if(typeof t=="function"&&(r=t,t="utf8"),typeof e=="string"&&(e=Ct.Buffer.from(e,t)),this.#e)return;(0,Jn.default)(this.#a,"zlib binding closed");let i=this.#a._handle,n=i.close;i.close=()=>{};let a=this.#a.close;this.#a.close=()=>{},Yn(!0);let c;try{let u=typeof e[Xn]=="number"?e[Xn]:this.#s;c=this.#a._processChunk(e,u),Yn(!1)}catch(u){Yn(!1),this.#l(new Nt(u,this.write))}finally{this.#a&&(this.#a._handle=i,i.close=n,this.#a.close=a,this.#a.removeAllListeners("error"))}this.#a&&this.#a.on("error",u=>this.#l(new Nt(u,this.write)));let h;if(c)if(Array.isArray(c)&&c.length>0){let u=c[0];h=this[Bt](Ct.Buffer.from(u));for(let l=1;l<c.length;l++)h=this[Bt](c[l])}else h=this[Bt](Ct.Buffer.from(c));return r&&r(),h}},$e=class extends Ms{static{o(this,"Zlib")}#e;#t;constructor(e,t){e=e||{},e.flush=e.flush||Me.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||Me.constants.Z_FINISH,e.fullFlushFlag=Me.constants.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#t=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#t!==t){this.flush(Me.constants.Z_SYNC_FLUSH),(0,Jn.default)(this.handle,"zlib binding closed");let r=this.handle.flush;this.handle.flush=(i,n)=>{typeof i=="function"&&(n=i,i=this.flushFlag),this.flush(i),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=r}this.handle&&(this.#e=e,this.#t=t)}}}};B.Zlib=$e;var Qn=class extends $e{static{o(this,"Deflate")}constructor(e){super(e,"Deflate")}};B.Deflate=Qn;var eo=class extends $e{static{o(this,"Inflate")}constructor(e){super(e,"Inflate")}};B.Inflate=eo;var to=class extends $e{static{o(this,"Gzip")}#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Bt](e){return this.#e?(this.#e=!1,e[9]=255,super[Bt](e)):super[Bt](e)}};B.Gzip=to;var so=class extends $e{static{o(this,"Gunzip")}constructor(e){super(e,"Gunzip")}};B.Gunzip=so;var ro=class extends $e{static{o(this,"DeflateRaw")}constructor(e){super(e,"DeflateRaw")}};B.DeflateRaw=ro;var io=class extends $e{static{o(this,"InflateRaw")}constructor(e){super(e,"InflateRaw")}};B.InflateRaw=io;var no=class extends $e{static{o(this,"Unzip")}constructor(e){super(e,"Unzip")}};B.Unzip=no;var Vr=class extends Ms{static{o(this,"Brotli")}constructor(e,t){e=e||{},e.flush=e.flush||Me.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||Me.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=Me.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},oo=class extends Vr{static{o(this,"BrotliCompress")}constructor(e){super(e,"BrotliCompress")}};B.BrotliCompress=oo;var ao=class extends Vr{static{o(this,"BrotliDecompress")}constructor(e){super(e,"BrotliDecompress")}};B.BrotliDecompress=ao;var Wr=class extends Ms{static{o(this,"Zstd")}constructor(e,t){e=e||{},e.flush=e.flush||Me.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||Me.constants.ZSTD_e_end,e.fullFlushFlag=Me.constants.ZSTD_e_flush,super(e,t)}},co=class extends Wr{static{o(this,"ZstdCompress")}constructor(e){super(e,"ZstdCompress")}};B.ZstdCompress=co;var ho=class extends Wr{static{o(this,"ZstdDecompress")}constructor(e){super(e,"ZstdDecompress")}};B.ZstdDecompress=ho});var Qr=m((VA,xh)=>{"use strict";var _h=typeof process=="object"&&process?process:{stdout:null,stderr:null},_y=require("events"),bh=require("stream"),Rh=require("string_decoder").StringDecoder,et=Symbol("EOF"),tt=Symbol("maybeEmitEnd"),Et=Symbol("emittedEnd"),Zr=Symbol("emittingEnd"),$s=Symbol("emittedError"),Kr=Symbol("closed"),Oh=Symbol("read"),Yr=Symbol("flush"),Ih=Symbol("flushChunk"),ce=Symbol("encoding"),st=Symbol("decoder"),Xr=Symbol("flowing"),Fs=Symbol("paused"),rs=Symbol("resume"),W=Symbol("bufferLength"),uo=Symbol("bufferPush"),lo=Symbol("bufferShift"),Q=Symbol("objectMode"),ee=Symbol("destroyed"),fo=Symbol("emitData"),vh=Symbol("emitEnd"),po=Symbol("emitEnd2"),rt=Symbol("async"),qs=o(s=>Promise.resolve().then(s),"defer"),Th=global._MP_NO_ITERATOR_SYMBOLS_!=="1",by=Th&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Ry=Th&&Symbol.iterator||Symbol("iterator not implemented"),Oy=o(s=>s==="end"||s==="finish"||s==="prefinish","isEndish"),Iy=o(s=>s instanceof ArrayBuffer||typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,"isArrayBuffer"),vy=o(s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),"isArrayBufferView"),Jr=class{static{o(this,"Pipe")}constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[rs](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},mo=class extends Jr{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};xh.exports=class Ah extends bh{static{o(this,"Minipass")}constructor(e){super(),this[Xr]=!1,this[Fs]=!1,this.pipes=[],this.buffer=[],this[Q]=e&&e.objectMode||!1,this[Q]?this[ce]=null:this[ce]=e&&e.encoding||null,this[ce]==="buffer"&&(this[ce]=null),this[rt]=e&&!!e.async||!1,this[st]=this[ce]?new Rh(this[ce]):null,this[et]=!1,this[Et]=!1,this[Zr]=!1,this[Kr]=!1,this[$s]=null,this.writable=!0,this.readable=!0,this[W]=0,this[ee]=!1}get bufferLength(){return this[W]}get encoding(){return this[ce]}set encoding(e){if(this[Q])throw new Error("cannot set encoding in objectMode");if(this[ce]&&e!==this[ce]&&(this[st]&&this[st].lastNeed||this[W]))throw new Error("cannot change encoding");this[ce]!==e&&(this[st]=e?new Rh(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[st].write(t)))),this[ce]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Q]}set objectMode(e){this[Q]=this[Q]||!!e}get async(){return this[rt]}set async(e){this[rt]=this[rt]||!!e}write(e,t,r){if(this[et])throw new Error("write after end");if(this[ee])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[rt]?qs:n=>n();return!this[Q]&&!Buffer.isBuffer(e)&&(vy(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Iy(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[Q]?(this.flowing&&this[W]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[uo](e),this[W]!==0&&this.emit("readable"),r&&i(r),this.flowing):e.length?(typeof e=="string"&&!(t===this[ce]&&!this[st].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[ce]&&(e=this[st].write(e)),this.flowing&&this[W]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[uo](e),this[W]!==0&&this.emit("readable"),r&&i(r),this.flowing):(this[W]!==0&&this.emit("readable"),r&&i(r),this.flowing)}read(e){if(this[ee])return null;if(this[W]===0||e===0||e>this[W])return this[tt](),null;this[Q]&&(e=null),this.buffer.length>1&&!this[Q]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[W])]);let t=this[Oh](e||null,this.buffer[0]);return this[tt](),t}[Oh](e,t){return e===t.length||e===null?this[lo]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[W]-=e),this.emit("data",t),!this.buffer.length&&!this[et]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t),r&&this.once("end",r),this[et]=!0,this.writable=!1,(this.flowing||!this[Fs])&&this[tt](),this}[rs](){this[ee]||(this[Fs]=!1,this[Xr]=!0,this.emit("resume"),this.buffer.length?this[Yr]():this[et]?this[tt]():this.emit("drain"))}resume(){return this[rs]()}pause(){this[Xr]=!1,this[Fs]=!0}get destroyed(){return this[ee]}get flowing(){return this[Xr]}get paused(){return this[Fs]}[uo](e){this[Q]?this[W]+=1:this[W]+=e.length,this.buffer.push(e)}[lo](){return this.buffer.length&&(this[Q]?this[W]-=1:this[W]-=this.buffer[0].length),this.buffer.shift()}[Yr](e){do;while(this[Ih](this[lo]()));!e&&!this.buffer.length&&!this[et]&&this.emit("drain")}[Ih](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[ee])return;let r=this[Et];return t=t||{},e===_h.stdout||e===_h.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new mo(this,e,t):new Jr(this,e,t)),this[rt]?qs(()=>this[rs]()):this[rs]()),e}unpipe(e){let t=this.pipes.find(r=>r.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[rs]():e==="readable"&&this[W]!==0?super.emit("readable"):Oy(e)&&this[Et]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[$s]&&(this[rt]?qs(()=>t.call(this,this[$s])):t.call(this,this[$s])),r}get emittedEnd(){return this[Et]}[tt](){!this[Zr]&&!this[Et]&&!this[ee]&&this.buffer.length===0&&this[et]&&(this[Zr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Kr]&&this.emit("close"),this[Zr]=!1)}emit(e,t,...r){if(e!=="error"&&e!=="close"&&e!==ee&&this[ee])return;if(e==="data")return t?this[rt]?qs(()=>this[fo](t)):this[fo](t):!1;if(e==="end")return this[vh]();if(e==="close"){if(this[Kr]=!0,!this[Et]&&!this[ee])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[$s]=t;let n=super.emit("error",t);return this[tt](),n}else if(e==="resume"){let n=super.emit("resume");return this[tt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...r);return this[tt](),i}[fo](e){for(let r of this.pipes)r.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[tt](),t}[vh](){this[Et]||(this[Et]=!0,this.readable=!1,this[rt]?qs(()=>this[po]()):this[po]())}[po](){if(this[st]){let t=this[st].end();if(t){for(let r of this.pipes)r.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[Q]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Q]||(e.dataLength+=r.length)}),t.then(()=>e)}concat(){return this[Q]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[Q]?Promise.reject(new Error("cannot concat in objectMode")):this[ce]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(ee,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[by](){return{next:o(()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[et])return Promise.resolve({done:!0});let r=null,i=null,n=o(u=>{this.removeListener("data",a),this.removeListener("end",c),i(u)},"onerr"),a=o(u=>{this.removeListener("error",n),this.removeListener("end",c),this.pause(),r({value:u,done:!!this[et]})},"ondata"),c=o(()=>{this.removeListener("error",n),this.removeListener("data",a),r({done:!0})},"onend"),h=o(()=>n(new Error("stream destroyed")),"ondestroy");return new Promise((u,l)=>{i=l,r=u,this.once(ee,h),this.once("error",n),this.once("end",c),this.once("data",a)})},"next")}}[Ry](){return{next:o(()=>{let t=this.read();return{value:t,done:t===null}},"next")}}destroy(e){return this[ee]?(e?this.emit("error",e):this.emit(ee),this):(this[ee]=!0,this.buffer.length=0,this[W]=0,typeof this.close=="function"&&!this[Kr]&&this.close(),e?this.emit("error",e):this.emit(ee),this)}static isStream(e){return!!e&&(e instanceof Ah||e instanceof bh||e instanceof _y&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Bh=m((ZA,Ch)=>{var Ty=Qr(),Us=class extends Error{static{o(this,"SizeError")}constructor(e,t){super(`Bad data size: expected ${t} bytes, but got ${e}`),this.expect=t,this.found=e,this.code="EBADSIZE",Error.captureStackTrace(this,this.constructor)}get name(){return"SizeError"}},ei=class extends Ty{static{o(this,"MinipassSized")}constructor(e={}){if(super(e),e.objectMode)throw new TypeError(`${this.constructor.name} streams only work with string and buffer data`);if(this.found=0,this.expect=e.size,typeof this.expect!="number"||this.expect>Number.MAX_SAFE_INTEGER||isNaN(this.expect)||this.expect<0||!isFinite(this.expect)||this.expect!==Math.floor(this.expect))throw new Error("invalid expected size: "+this.expect)}write(e,t,r){let i=Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,typeof t=="string"?t:"utf8"):e;return Buffer.isBuffer(i)?(this.found+=i.length,this.found>this.expect&&this.emit("error",new Us(this.found,this.expect)),super.write(e,t,r)):(this.emit("error",new TypeError(`${this.constructor.name} streams only work with string and buffer data`)),!1)}emit(e,...t){return e==="end"&&this.found!==this.expect&&this.emit("error",new Us(this.found,this.expect)),super.emit(e,...t)}};ei.SizeError=Us;Ch.exports=ei});var Ph=m((YA,Nh)=>{"use strict";var{Minipass:Ay}=J(),go=Symbol("type"),it=Symbol("buffer"),ti=class s{static{o(this,"Blob")}constructor(e,t){this[go]="";let r=[],i=0;if(e){let a=e,c=Number(a.length);for(let h=0;h<c;h++){let u=a[h],l=u instanceof Buffer?u:ArrayBuffer.isView(u)?Buffer.from(u.buffer,u.byteOffset,u.byteLength):u instanceof ArrayBuffer?Buffer.from(u):u instanceof s?u[it]:typeof u=="string"?Buffer.from(u):Buffer.from(String(u));i+=l.length,r.push(l)}}this[it]=Buffer.concat(r,i);let n=t&&t.type!==void 0&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[go]=n)}get size(){return this[it].length}get type(){return this[go]}text(){return Promise.resolve(this[it].toString())}arrayBuffer(){let e=this[it],t=e.byteOffset,r=e.byteLength,i=e.buffer.slice(t,t+r);return Promise.resolve(i)}stream(){return new Ay().end(this[it])}slice(e,t,r){let i=this.size,n=e===void 0?0:e<0?Math.max(i+e,0):Math.min(e,i),a=t===void 0?i:t<0?Math.max(i+t,0):Math.min(t,i),c=Math.max(a-n,0),u=this[it].slice(n,n+c),l=new s([],{type:r});return l[it]=u,l}get[Symbol.toStringTag](){return"Blob"}static get BUFFER(){return it}};Object.defineProperties(ti.prototype,{size:{enumerable:!0},type:{enumerable:!0}});Nh.exports=ti});var Eo=m((JA,Lh)=>{"use strict";var yo=class extends Error{static{o(this,"FetchError")}constructor(e,t,r){super(e),this.code="FETCH_ERROR",r&&Object.assign(this,r),this.errno=this.code,this.type=this.code==="EBADSIZE"&&this.found>this.expect?"max-size":t,this.message=e,Error.captureStackTrace(this,this.constructor)}get name(){return"FetchError"}set name(e){}get[Symbol.toStringTag](){return"FetchError"}};Lh.exports=yo});var Dh=m((ex,kh)=>{"use strict";kh.exports={}});var ri=m((tx,Fh)=>{"use strict";var{Minipass:Fe}=J(),wo=Bh(),$h=Ph(),{BUFFER:xy}=$h,js=Eo(),So;try{So=Dh().convert}catch{}var nt=Symbol("Body internals"),Pt=Symbol("consumeBody"),si=class{static{o(this,"Body")}constructor(e,t={}){let{size:r=0,timeout:i=0}=t,n=e==null?null:Mh(e)?Buffer.from(e.toString()):Hs(e)||Buffer.isBuffer(e)?e:Object.prototype.toString.call(e)==="[object ArrayBuffer]"?Buffer.from(e):ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Fe.isStream(e)?e:Buffer.from(String(e));this[nt]={body:n,disturbed:!1,error:null},this.size=r,this.timeout=i,Fe.isStream(n)&&n.on("error",a=>{let c=a.name==="AbortError"?a:new js(`Invalid response while trying to fetch ${this.url}: ${a.message}`,"system",a);this[nt].error=c})}get body(){return this[nt].body}get bodyUsed(){return this[nt].disturbed}arrayBuffer(){return this[Pt]().then(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}blob(){let e=this.headers&&this.headers.get("content-type")||"";return this[Pt]().then(t=>Object.assign(new $h([],{type:e.toLowerCase()}),{[xy]:t}))}async json(){let e=await this[Pt]();try{return JSON.parse(e.toString())}catch(t){throw new js(`invalid json response body at ${this.url} reason: ${t.message}`,"invalid-json")}}text(){return this[Pt]().then(e=>e.toString())}buffer(){return this[Pt]()}textConverted(){return this[Pt]().then(e=>Cy(e,this.headers))}[Pt](){if(this[nt].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[nt].disturbed=!0,this[nt].error)return Promise.reject(this[nt].error);if(this.body===null)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);let e=Hs(this.body)?this.body.stream():this.body;if(!Fe.isStream(e))return Promise.resolve(Buffer.alloc(0));let t=this.size&&e instanceof wo||!this.size&&e instanceof Fe&&!(e instanceof wo)?e:this.size?new wo({size:this.size}):new Fe,r=this.timeout&&t.writable?setTimeout(()=>{t.emit("error",new js(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return r&&r.unref&&r.unref(),new Promise(i=>{t!==e&&(e.on("error",n=>t.emit("error",n)),e.pipe(t)),i()}).then(()=>t.concat()).then(i=>(clearTimeout(r),i)).catch(i=>{throw clearTimeout(r),i.name==="AbortError"||i.name==="FetchError"?i:i.name==="RangeError"?new js(`Could not create Buffer from response body for ${this.url}: ${i.message}`,"system",i):new js(`Invalid response body while trying to fetch ${this.url}: ${i.message}`,"system",i)})}static clone(e){if(e.bodyUsed)throw new Error("cannot clone body after it is used");let t=e.body;if(Fe.isStream(t)&&typeof t.getBoundary!="function"){let r=new Fe,i=new Fe,n=new Fe;return r.on("error",a=>{i.emit("error",a),n.emit("error",a)}),t.on("error",a=>r.emit("error",a)),r.pipe(i),r.pipe(n),t.pipe(r),e[nt].body=i,n}else return e.body}static extractContentType(e){return e==null?null:typeof e=="string"?"text/plain;charset=UTF-8":Mh(e)?"application/x-www-form-urlencoded;charset=UTF-8":Hs(e)?e.type||null:Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object ArrayBuffer]"||ArrayBuffer.isView(e)?null:typeof e.getBoundary=="function"?`multipart/form-data;boundary=${e.getBoundary()}`:Fe.isStream(e)?null:"text/plain;charset=UTF-8"}static getTotalBytes(e){let{body:t}=e;return t==null?0:Hs(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length===0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}static writeToStream(e,t){let{body:r}=t;return r==null?e.end():Buffer.isBuffer(r)||typeof r=="string"?e.end(r):(Hs(r)?r.stream():r).on("error",n=>e.emit("error",n)).pipe(e),e}};Object.defineProperties(si.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var Mh=o(s=>typeof s!="object"||typeof s.append!="function"||typeof s.delete!="function"||typeof s.get!="function"||typeof s.getAll!="function"||typeof s.has!="function"||typeof s.set!="function"?!1:s.constructor.name==="URLSearchParams"||Object.prototype.toString.call(s)==="[object URLSearchParams]"||typeof s.sort=="function","isURLSearchParams"),Hs=o(s=>typeof s=="object"&&typeof s.arrayBuffer=="function"&&typeof s.type=="string"&&typeof s.stream=="function"&&typeof s.constructor=="function"&&typeof s.constructor.name=="string"&&/^(Blob|File)$/.test(s.constructor.name)&&/^(Blob|File)$/.test(s[Symbol.toStringTag]),"isBlob"),Cy=o((s,e)=>{if(typeof So!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let t=e&&e.get("content-type"),r="utf-8",i;t&&(i=/charset=([^;]*)/i.exec(t));let n=s.slice(0,1024).toString();return!i&&n&&(i=/<meta.+?charset=(['"])(.+?)\1/i.exec(n)),!i&&n&&(i=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),i||(i=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),i&&i.pop()),i&&(i=/charset=(.*)/i.exec(i.pop()))),!i&&n&&(i=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n)),i&&(r=i.pop(),(r==="gb2312"||r==="gbk")&&(r="gb18030")),So(s,"UTF-8",r).toString()},"convertBody");Fh.exports=si});var ni=m((rx,jh)=>{"use strict";var Uh=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,bo=/[^\t\x20-\x7e\x80-\xff]/,zs=o(s=>{if(s=`${s}`,Uh.test(s)||s==="")throw new TypeError(`${s} is not a legal HTTP header name`)},"validateName"),qh=o(s=>{if(s=`${s}`,bo.test(s))throw new TypeError(`${s} is not a legal HTTP header value`)},"validateValue"),is=o((s,e)=>{e=e.toLowerCase();for(let t in s)if(t.toLowerCase()===e)return t},"find"),H=Symbol("map"),ii=class s{static{o(this,"Headers")}constructor(e=void 0){if(this[H]=Object.create(null),e instanceof s){let t=e.raw(),r=Object.keys(t);for(let i of r)for(let n of t[i])this.append(i,n);return}if(e!=null)if(typeof e=="object"){let t=e[Symbol.iterator];if(t!=null){if(typeof t!="function")throw new TypeError("Header pairs must be iterable");let r=[];for(let i of e){if(typeof i!="object"||typeof i[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");let n=Array.from(i);if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");r.push(n)}for(let i of r)this.append(i[0],i[1])}else for(let r of Object.keys(e))this.append(r,e[r])}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,zs(e);let t=is(this[H],e);return t===void 0?null:this[H][t].join(", ")}forEach(e,t=void 0){let r=Ro(this);for(let i=0;i<r.length;i++){let[n,a]=r[i];e.call(t,a,n,this),r=Ro(this)}}set(e,t){e=`${e}`,t=`${t}`,zs(e),qh(t);let r=is(this[H],e);this[H][r!==void 0?r:e]=[t]}append(e,t){e=`${e}`,t=`${t}`,zs(e),qh(t);let r=is(this[H],e);r!==void 0?this[H][r].push(t):this[H][e]=[t]}has(e){return e=`${e}`,zs(e),is(this[H],e)!==void 0}delete(e){e=`${e}`,zs(e);let t=is(this[H],e);t!==void 0&&delete this[H][t]}raw(){return this[H]}keys(){return new Lt(this,"key")}values(){return new Lt(this,"value")}[Symbol.iterator](){return new Lt(this,"key+value")}entries(){return new Lt(this,"key+value")}get[Symbol.toStringTag](){return"Headers"}static exportNodeCompatibleHeaders(e){let t=Object.assign(Object.create(null),e[H]),r=is(e[H],"Host");return r!==void 0&&(t[r]=t[r][0]),t}static createHeadersLenient(e){let t=new s;for(let r of Object.keys(e))if(!Uh.test(r))if(Array.isArray(e[r]))for(let i of e[r])bo.test(i)||(t[H][r]===void 0?t[H][r]=[i]:t[H][r].push(i));else bo.test(e[r])||(t[H][r]=[e[r]]);return t}};Object.defineProperties(ii.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});var Ro=o((s,e="key+value")=>Object.keys(s[H]).sort().map(e==="key"?t=>t.toLowerCase():e==="value"?t=>s[H][t].join(", "):t=>[t.toLowerCase(),s[H][t].join(", ")]),"getHeaders"),_o=Symbol("internal"),Lt=class s{static{o(this,"HeadersIterator")}constructor(e,t){this[_o]={target:e,kind:t,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==s.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");let{target:e,kind:t,index:r}=this[_o],i=Ro(e,t),n=i.length;return r>=n?{value:void 0,done:!0}:(this[_o].index++,{value:i[r],done:!1})}};Object.setPrototypeOf(Lt.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));jh.exports=ii});var Vh=m((nx,Gh)=>{"use strict";var By=require("http"),{STATUS_CODES:Ny}=By,Hh=ni(),zh=ri(),{clone:Py,extractContentType:Ly}=zh,ot=Symbol("Response internals"),oi=class s extends zh{static{o(this,"Response")}constructor(e=null,t={}){super(e,t);let r=t.status||200,i=new Hh(t.headers);if(e!=null&&!i.has("Content-Type")){let n=Ly(e);n&&i.append("Content-Type",n)}this[ot]={url:t.url,status:r,statusText:t.statusText||Ny[r],headers:i,counter:t.counter,trailer:Promise.resolve(t.trailer||new Hh)}}get trailer(){return this[ot].trailer}get url(){return this[ot].url||""}get status(){return this[ot].status}get ok(){return this[ot].status>=200&&this[ot].status<300}get redirected(){return this[ot].counter>0}get statusText(){return this[ot].statusText}get headers(){return this[ot].headers}clone(){return new s(Py(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,trailer:this.trailer})}get[Symbol.toStringTag](){return"Response"}};Gh.exports=oi;Object.defineProperties(oi.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var Wh=m((ax,ky)=>{ky.exports={name:"minipass-fetch",version:"4.0.1",description:"An implementation of window.fetch in Node.js using Minipass streams",license:"MIT",main:"lib/index.js",scripts:{"test:tls-fixtures":"./test/fixtures/tls/setup.sh",test:"tap",snap:"tap",lint:"npm run eslint",postlint:"template-oss-check",lintfix:"npm run eslint -- --fix",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},tap:{"coverage-map":"map.js","check-coverage":!0,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.3","@ungap/url-search-params":"^0.2.2","abort-controller":"^3.0.0","abortcontroller-polyfill":"~1.7.3",encoding:"^0.1.13","form-data":"^4.0.0",nock:"^13.2.4",parted:"^0.1.1","string-to-arraybuffer":"^1.0.2",tap:"^16.0.0"},dependencies:{minipass:"^7.0.3","minipass-sized":"^1.0.3",minizlib:"^3.0.1"},optionalDependencies:{encoding:"^0.1.13"},repository:{type:"git",url:"git+https://github.com/npm/minipass-fetch.git"},keywords:["fetch","minipass","node-fetch","window.fetch"],files:["bin/","lib/"],engines:{node:"^18.17.0 || >=20.5.0"},author:"GitHub Inc.",templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.3",publish:"true"}}});var Yh=m((cx,Kh)=>{"use strict";var{URL:Oo}=require("url"),{Minipass:Dy}=J(),Io=ni(),{exportNodeCompatibleHeaders:My}=Io,Zh=ri(),{clone:$y,extractContentType:Fy,getTotalBytes:qy}=Zh,Uy=Wh().version,jy=`minipass-fetch/${Uy} (+https://github.com/isaacs/minipass-fetch)`,Ne=Symbol("Request internals"),ai=o(s=>typeof s=="object"&&typeof s[Ne]=="object","isRequest"),Hy=o(s=>{let e=s&&typeof s=="object"&&Object.getPrototypeOf(s);return!!(e&&e.constructor.name==="AbortSignal")},"isAbortSignal"),ci=class s extends Zh{static{o(this,"Request")}constructor(e,t={}){let r=ai(e)?new Oo(e.url):e&&e.href?new Oo(e.href):new Oo(`${e}`);ai(e)?t={...e[Ne],...t}:(!e||typeof e=="string")&&(e={});let i=(t.method||e.method||"GET").toUpperCase(),n=i==="GET"||i==="HEAD";if((t.body!==null&&t.body!==void 0||ai(e)&&e.body!==null)&&n)throw new TypeError("Request with GET/HEAD method cannot have body");let a=t.body!==null&&t.body!==void 0?t.body:ai(e)&&e.body!==null?$y(e):null;super(a,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});let c=new Io(t.headers||e.headers||{});if(a!=null&&!c.has("Content-Type")){let Xe=Fy(a);Xe&&c.append("Content-Type",Xe)}let h="signal"in t?t.signal:null;if(h!=null&&!Hy(h))throw new TypeError("Expected signal must be an instanceof AbortSignal");let{ca:u,cert:l,ciphers:f,clientCertEngine:d,crl:p,dhparam:g,ecdhCurve:y,family:S,honorCipherOrder:w,key:T,passphrase:v,pfx:R,rejectUnauthorized:I=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0",secureOptions:C,secureProtocol:P,servername:Y,sessionIdContext:Se}=t;this[Ne]={method:i,redirect:t.redirect||e.redirect||"follow",headers:c,parsedURL:r,signal:h,ca:u,cert:l,ciphers:f,clientCertEngine:d,crl:p,dhparam:g,ecdhCurve:y,family:S,honorCipherOrder:w,key:T,passphrase:v,pfx:R,rejectUnauthorized:I,secureOptions:C,secureProtocol:P,servername:Y,sessionIdContext:Se},this.follow=t.follow!==void 0?t.follow:e.follow!==void 0?e.follow:20,this.compress=t.compress!==void 0?t.compress:e.compress!==void 0?e.compress:!0,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent}get method(){return this[Ne].method}get url(){return this[Ne].parsedURL.toString()}get headers(){return this[Ne].headers}get redirect(){return this[Ne].redirect}get signal(){return this[Ne].signal}clone(){return new s(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(e){let t=e[Ne].parsedURL,r=new Io(e[Ne].headers);if(r.has("Accept")||r.set("Accept","*/*"),!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&Dy.isStream(e.body)&&typeof e.body.destroy!="function")throw new Error("Cancellation of streamed requests with AbortSignal is not supported");let i=(e.body===null||e.body===void 0)&&/^(POST|PUT)$/i.test(e.method)?"0":e.body!==null&&e.body!==void 0?qy(e):null;i&&r.set("Content-Length",i+""),r.has("User-Agent")||r.set("User-Agent",jy),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=typeof e.agent=="function"?e.agent(t):e.agent;!r.has("Connection")&&!n&&r.set("Connection","close");let{ca:a,cert:c,ciphers:h,clientCertEngine:u,crl:l,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:g,key:y,passphrase:S,pfx:w,rejectUnauthorized:T,secureOptions:v,secureProtocol:R,servername:I,sessionIdContext:C}=e[Ne];return{...{auth:t.username||t.password?`${t.username}:${t.password}`:"",host:t.host,hostname:t.hostname,path:`${t.pathname}${t.search}`,port:t.port,protocol:t.protocol},method:e.method,headers:My(r),agent:n,ca:a,cert:c,ciphers:h,clientCertEngine:u,crl:l,dhparam:f,ecdhCurve:d,family:p,honorCipherOrder:g,key:y,passphrase:S,pfx:w,rejectUnauthorized:T,secureOptions:v,secureProtocol:R,servername:I,sessionIdContext:C,timeout:e.timeout}}};Kh.exports=ci;Object.defineProperties(ci.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})});var Jh=m((ux,Xh)=>{"use strict";var vo=class extends Error{static{o(this,"AbortError")}constructor(e){super(e),this.code="FETCH_ABORTED",this.type="aborted",Error.captureStackTrace(this,this.constructor)}get name(){return"AbortError"}set name(e){}};Xh.exports=vo});var Ws=m((fx,tu)=>{"use strict";var{URL:Gs}=require("url"),zy=require("http"),Gy=require("https"),ns=Sh(),{Minipass:Qh}=J(),Vy=ri(),{writeToStream:Wy,getTotalBytes:Zy}=Vy,kt=Vh(),Ao=ni(),{createHeadersLenient:eu}=Ao,Vs=Yh(),{getNodeRequestOptions:Ky}=Vs,wt=Eo(),To=Jh(),at=o(async(s,e)=>{if(/^data:/.test(s)){let t=new Vs(s,e);return Promise.resolve().then(()=>new Promise((r,i)=>{let n,a;try{let{pathname:u,search:l}=new Gs(s),f=u.split(",");if(f.length<2)throw new Error("invalid data: URI");let d=f.shift(),p=/;base64$/.test(d);n=p?d.slice(0,-7):d;let g=decodeURIComponent(f.join(",")+l);a=p?Buffer.from(g,"base64"):Buffer.from(g)}catch(u){return i(new wt(`[${t.method}] ${t.url} invalid URL, ${u.message}`,"system",u))}let{signal:c}=t;if(c&&c.aborted)return i(new To("The user aborted a request."));let h={"Content-Length":a.length};return n&&(h["Content-Type"]=n),r(new kt(a,{headers:h}))}))}return new Promise((t,r)=>{let i=new Vs(s,e),n;try{n=Ky(i)}catch(g){return r(g)}let a=(n.protocol==="https:"?Gy:zy).request,{signal:c}=i,h=null,u=o(()=>{let g=new To("The user aborted a request.");r(g),Qh.isStream(i.body)&&typeof i.body.destroy=="function"&&i.body.destroy(g),h&&h.body&&h.body.emit("error",g)},"abort");if(c&&c.aborted)return u();let l=o(()=>{u(),f()},"abortAndFinalize"),f=o(()=>{d.abort(),c&&c.removeEventListener("abort",l),clearTimeout(p)},"finalize"),d=a(n);c&&c.addEventListener("abort",l);let p=null;i.timeout&&d.once("socket",()=>{p=setTimeout(()=>{r(new wt(`network timeout at: ${i.url}`,"request-timeout")),f()},i.timeout)}),d.on("error",g=>{d.res&&d.res.emit("error",g),r(new wt(`request to ${i.url} failed, reason: ${g.message}`,"system",g)),f()}),d.on("response",g=>{clearTimeout(p);let y=eu(g.headers);if(at.isRedirect(g.statusCode)){let I=y.get("Location"),C=null;try{C=I===null?null:new Gs(I,i.url).toString()}catch{if(i.redirect!=="manual"){r(new wt(`uri requested responds with an invalid redirect URL: ${I}`,"invalid-redirect")),f();return}}if(i.redirect==="error"){r(new wt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),f();return}else if(i.redirect==="manual"){if(C!==null)try{y.set("Location",C)}catch(P){r(P)}}else if(i.redirect==="follow"&&C!==null){if(i.counter>=i.follow){r(new wt(`maximum redirect reached at: ${i.url}`,"max-redirect")),f();return}if(g.statusCode!==303&&i.body&&Zy(i)===null){r(new wt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),f();return}i.headers.set("host",new Gs(C).host);let P={headers:new Ao(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout},Y=new Gs(i.url),Se=new Gs(C);Y.hostname!==Se.hostname&&(P.headers.delete("authorization"),P.headers.delete("cookie")),(g.statusCode===303||(g.statusCode===301||g.statusCode===302)&&i.method==="POST")&&(P.method="GET",P.body=void 0,P.headers.delete("content-length")),t(at(new Vs(C,P))),f();return}}g.once("end",()=>c&&c.removeEventListener("abort",l));let S=new Qh;S.on("error",f),g.on("error",I=>S.emit("error",I)),g.on("data",I=>S.write(I)),g.on("end",()=>S.end());let w={url:i.url,status:g.statusCode,statusText:g.statusMessage,headers:y,size:i.size,timeout:i.timeout,counter:i.counter,trailer:new Promise(I=>g.on("end",()=>I(eu(g.trailers))))},T=y.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||T===null||g.statusCode===204||g.statusCode===304){h=new kt(S,w),t(h);return}let v={flush:ns.constants.Z_SYNC_FLUSH,finishFlush:ns.constants.Z_SYNC_FLUSH};if(T==="gzip"||T==="x-gzip"){let I=new ns.Gunzip(v);h=new kt(S.on("error",C=>I.emit("error",C)).pipe(I),w),t(h);return}if(T==="deflate"||T==="x-deflate"){g.once("data",I=>{let C=(I[0]&15)===8?new ns.Inflate:new ns.InflateRaw;S.on("error",P=>C.emit("error",P)).pipe(C),h=new kt(C,w),t(h)});return}if(T==="br"){try{var R=new ns.BrotliDecompress}catch(I){r(I),f();return}S.on("error",I=>R.emit("error",I)).pipe(R),h=new kt(R,w),t(h);return}h=new kt(S,w),t(h)}),Wy(d,i)})},"fetch");tu.exports=at;at.isRedirect=s=>s===301||s===302||s===303||s===307||s===308;at.Headers=Ao;at.Request=Vs;at.Response=kt;at.FetchError=wt;at.AbortError=To});var ru=m((px,su)=>{var Yy=require("dns"),Xy=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"],Jy=o(s=>{let{strictSSL:e,...t}={...s};if(t.method=t.method?t.method.toUpperCase():"GET",e==null?t.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0":t.rejectUnauthorized=e!==!1,!t.retry)t.retry={retries:0};else if(typeof t.retry=="string"){let r=parseInt(t.retry,10);isFinite(r)?t.retry={retries:r}:t.retry={retries:0}}else typeof t.retry=="number"?t.retry={retries:t.retry}:t.retry={retries:0,...t.retry};return t.dns={ttl:300*1e3,lookup:Yy.lookup,...t.dns},t.cache=t.cache||"default",t.cache==="default"&&Object.keys(t.headers||{}).some(i=>Xy.includes(i.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t},"configureOptions");su.exports=Jy});var nu=m((yx,iu)=>{"use strict";var Qy=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),eE=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),tE=new Set([500,502,503,504]),sE={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},rE={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function ct(s){let e=parseInt(s,10);return isFinite(e)?e:0}o(ct,"toNumberOrZero");function iE(s){return s?tE.has(s.status):!0}o(iE,"isErrorResponse");function xo(s){let e={};if(!s)return e;let t=s.trim().split(/,/);for(let r of t){let[i,n]=r.split(/=/,2);e[i.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}o(xo,"parseCacheControl");function nE(s){let e=[];for(let t in s){let r=s[t];e.push(r===!0?t:t+"="+r)}if(e.length)return e.join(", ")}o(nE,"formatCacheControl");iu.exports=class{static{o(this,"CachePolicy")}constructor(e,t,{shared:r,cacheHeuristic:i,immutableMinTimeToLive:n,ignoreCargoCult:a,_fromObject:c}={}){if(c){this._fromObject(c);return}if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=r!==!1,this._ignoreCargoCult=!!a,this._cacheHeuristic=i!==void 0?i:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=xo(t.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=t.headers.vary?e.headers:null,this._reqcc=xo(e.headers["cache-control"]),this._ignoreCargoCult&&"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":nE(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),t.headers["cache-control"]==null&&/no-cache/.test(t.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())&&eE.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||Qy.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){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,t){return{synchronous:t,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc["must-revalidate"])return this._evaluateRequestMissResult(e);if(!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);let t=xo(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):t["max-age"]&&this.age()>ct(t["max-age"])?this._evaluateRequestMissResult(e):t["min-fresh"]&&this.maxAge()-this.age()<ct(t["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in t&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&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 t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let r in e)sE[r]||(t[r]=e[r]);if(e.connection){let r=e.connection.trim().split(/\s*,\s*/);for(let i of r)delete t[i]}if(t.warning){let r=t.warning.split(/,/).filter(i=>!/^\s*1[0-9][0-9]/.test(i));r.length?t.warning=r.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,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(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return ct(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 ct(this._rescc["s-maxage"])}if(this._rescc["max-age"])return ct(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||r<t?0:Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){let r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+ct(this._rescc["stale-if-error"]),r=e+ct(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,t,r)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+ct(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=ct(this._rescc["stale-while-revalidate"]);return e>0&&this.maxAge()+e>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._ignoreCargoCult=!!e.icc,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,icc:this._ignoreCargoCult,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 t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete t["if-modified-since"],t["if-none-match"]){let i=t["if-none-match"].split(/,/).filter(n=>!/^\s*W\//.test(n));i.length?t["if-none-match"]=i.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&iE(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;t.status!==void 0&&t.status!=304?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(r=!0);let i={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!r)return{policy:new this.constructor(e,t,i),modified:t.status!=304,matches:!1};let n={};for(let c in this._resHeaders)n[c]=c in t.headers&&!rE[c]?t.headers[c]:this._resHeaders[c];let a=Object.assign({},t,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,a,i),modified:!1,matches:!0}}}});var hu=m((wx,Co)=>{"use strict";Co.exports=cu;Co.exports.preferredCharsets=cu;var oE=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function aE(s){for(var e=s.split(","),t=0,r=0;t<e.length;t++){var i=cE(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(aE,"parseAcceptCharset");function cE(s,e){var t=oE.exec(s);if(!t)return null;var r=t[1],i=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){i=parseFloat(c[1]);break}}return{charset:r,q:i,i:e}}o(cE,"parseCharset");function hE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=uE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(hE,"getCharsetPriority");function uE(s,e,t){var r=0;if(e.charset.toLowerCase()===s.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}o(uE,"specify");function cu(s,e){var t=aE(s===void 0?"*":s||"");if(!e)return t.filter(au).sort(ou).map(lE);var r=e.map(o(function(n,a){return hE(n,t,a)},"getPriority"));return r.filter(au).sort(ou).map(o(function(n){return e[r.indexOf(n)]},"getCharset"))}o(cu,"preferredCharsets");function ou(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(ou,"compareSpecs");function lE(s){return s.charset}o(lE,"getFullCharset");function au(s){return s.q>0}o(au,"isQuality")});var du=m((_x,Bo)=>{"use strict";Bo.exports=fu;Bo.exports.preferredEncodings=fu;var fE=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function dE(s){for(var e=s.split(","),t=!1,r=1,i=0,n=0;i<e.length;i++){var a=pE(e[i].trim(),i);a&&(e[n++]=a,t=t||lu("identity",a),r=Math.min(r,a.q||1))}return t||(e[n++]={encoding:"identity",q:r,i}),e.length=n,e}o(dE,"parseAcceptEncoding");function pE(s,e){var t=fE.exec(s);if(!t)return null;var r=t[1],i=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){i=parseFloat(c[1]);break}}return{encoding:r,q:i,i:e}}o(pE,"parseEncoding");function mE(s,e,t){for(var r={encoding:s,o:-1,q:0,s:0},i=0;i<e.length;i++){var n=lu(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(mE,"getEncodingPriority");function lu(s,e,t){var r=0;if(e.encoding.toLowerCase()===s.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{encoding:s,i:t,o:e.i,q:e.q,s:r}}o(lu,"specify");function fu(s,e,t){var r=dE(s||""),i=t?o(function(c,h){if(c.q!==h.q)return h.q-c.q;var u=t.indexOf(c.encoding),l=t.indexOf(h.encoding);return u===-1&&l===-1?h.s-c.s||c.o-h.o||c.i-h.i:u!==-1&&l!==-1?u-l:u===-1?1:-1},"comparator"):gE;if(!e)return r.filter(uu).sort(i).map(yE);var n=e.map(o(function(c,h){return mE(c,r,h)},"getPriority"));return n.filter(uu).sort(i).map(o(function(c){return e[n.indexOf(c)]},"getEncoding"))}o(fu,"preferredEncodings");function gE(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i}o(gE,"compareSpecs");function yE(s){return s.encoding}o(yE,"getFullEncoding");function uu(s){return s.q>0}o(uu,"isQuality")});var Eu=m((Rx,No)=>{"use strict";No.exports=yu;No.exports.preferredLanguages=yu;var EE=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function wE(s){for(var e=s.split(","),t=0,r=0;t<e.length;t++){var i=gu(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(wE,"parseAcceptLanguage");function gu(s,e){var t=EE.exec(s);if(!t)return null;var r=t[1],i=t[2],n=r;i&&(n+="-"+i);var a=1;if(t[3])for(var c=t[3].split(";"),h=0;h<c.length;h++){var u=c[h].split("=");u[0]==="q"&&(a=parseFloat(u[1]))}return{prefix:r,suffix:i,q:a,i:e,full:n}}o(gu,"parseLanguage");function SE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=_E(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(SE,"getLanguagePriority");function _E(s,e,t){var r=gu(s);if(!r)return null;var i=0;if(e.full.toLowerCase()===r.full.toLowerCase())i|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())i|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())i|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}o(_E,"specify");function yu(s,e){var t=wE(s===void 0?"*":s||"");if(!e)return t.filter(mu).sort(pu).map(bE);var r=e.map(o(function(n,a){return SE(n,t,a)},"getPriority"));return r.filter(mu).sort(pu).map(o(function(n){return e[r.indexOf(n)]},"getLanguage"))}o(yu,"preferredLanguages");function pu(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(pu,"compareSpecs");function bE(s){return s.full}o(bE,"getFullLanguage");function mu(s){return s.q>0}o(mu,"isQuality")});var Ou=m((Ix,Po)=>{"use strict";Po.exports=bu;Po.exports.preferredMediaTypes=bu;var RE=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function OE(s){for(var e=xE(s),t=0,r=0;t<e.length;t++){var i=_u(e[t].trim(),t);i&&(e[r++]=i)}return e.length=r,e}o(OE,"parseAccept");function _u(s,e){var t=RE.exec(s);if(!t)return null;var r=Object.create(null),i=1,n=t[2],a=t[1];if(t[3])for(var c=CE(t[3]).map(AE),h=0;h<c.length;h++){var u=c[h],l=u[0].toLowerCase(),f=u[1],d=f&&f[0]==='"'&&f[f.length-1]==='"'?f.slice(1,-1):f;if(l==="q"){i=parseFloat(d);break}r[l]=d}return{type:a,subtype:n,params:r,q:i,i:e}}o(_u,"parseMediaType");function IE(s,e,t){for(var r={o:-1,q:0,s:0},i=0;i<e.length;i++){var n=vE(s,e[i],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(IE,"getMediaTypePriority");function vE(s,e,t){var r=_u(s),i=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())i|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.subtype.toLowerCase())i|=2;else if(e.subtype!="*")return null;var n=Object.keys(e.params);if(n.length>0)if(n.every(function(a){return e.params[a]=="*"||(e.params[a]||"").toLowerCase()==(r.params[a]||"").toLowerCase()}))i|=1;else return null;return{i:t,o:e.i,q:e.q,s:i}}o(vE,"specify");function bu(s,e){var t=OE(s===void 0?"*/*":s||"");if(!e)return t.filter(Su).sort(wu).map(TE);var r=e.map(o(function(n,a){return IE(n,t,a)},"getPriority"));return r.filter(Su).sort(wu).map(o(function(n){return e[r.indexOf(n)]},"getType"))}o(bu,"preferredMediaTypes");function wu(s,e){return e.q-s.q||e.s-s.s||s.o-e.o||s.i-e.i||0}o(wu,"compareSpecs");function TE(s){return s.type+"/"+s.subtype}o(TE,"getFullType");function Su(s){return s.q>0}o(Su,"isQuality");function Ru(s){for(var e=0,t=0;(t=s.indexOf('"',t))!==-1;)e++,t++;return e}o(Ru,"quoteCount");function AE(s){var e=s.indexOf("="),t,r;return e===-1?t=s:(t=s.slice(0,e),r=s.slice(e+1)),[t,r]}o(AE,"splitKeyValuePair");function xE(s){for(var e=s.split(","),t=1,r=0;t<e.length;t++)Ru(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}o(xE,"splitMediaTypes");function CE(s){for(var e=s.split(";"),t=1,r=0;t<e.length;t++)Ru(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}o(CE,"splitParameters")});var Iu=m((Tx,Lo)=>{"use strict";var BE=hu(),NE=du(),PE=Eu(),LE=Ou();Lo.exports=k;Lo.exports.Negotiator=k;function k(s){if(!(this instanceof k))return new k(s);this.request=s}o(k,"Negotiator");k.prototype.charset=o(function(e){var t=this.charsets(e);return t&&t[0]},"charset");k.prototype.charsets=o(function(e){return BE(this.request.headers["accept-charset"],e)},"charsets");k.prototype.encoding=o(function(e,t){var r=this.encodings(e,t);return r&&r[0]},"encoding");k.prototype.encodings=o(function(e,t){var r=t||{};return NE(this.request.headers["accept-encoding"],e,r.preferred)},"encodings");k.prototype.language=o(function(e){var t=this.languages(e);return t&&t[0]},"language");k.prototype.languages=o(function(e){return PE(this.request.headers["accept-language"],e)},"languages");k.prototype.mediaType=o(function(e){var t=this.mediaTypes(e);return t&&t[0]},"mediaType");k.prototype.mediaTypes=o(function(e){return LE(this.request.headers.accept,e)},"mediaTypes");k.prototype.preferredCharset=k.prototype.charset;k.prototype.preferredCharsets=k.prototype.charsets;k.prototype.preferredEncoding=k.prototype.encoding;k.prototype.preferredEncodings=k.prototype.encodings;k.prototype.preferredLanguage=k.prototype.language;k.prototype.preferredLanguages=k.prototype.languages;k.prototype.preferredMediaType=k.prototype.mediaType;k.prototype.preferredMediaTypes=k.prototype.mediaTypes});var St=m((xx,qe)=>{"use strict";var Ks=require("crypto"),{Minipass:kE}=J(),Do=["sha512","sha384","sha256"],$o=["sha512"],DE=/^[a-z0-9+/]+(?:=?=?)$/i,ME=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,$E=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,FE=/^[\x21-\x7E]+$/,Ys=o(s=>s?.length?`?${s.join("?")}`:"","getOptString"),Mo=class extends kE{static{o(this,"IntegrityStream")}#e;#t;#s;constructor(e){super(),this.size=0,this.opts=e,this.#r(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...$o],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(Ks.createHash)}#r(){this.sri=this.opts?.integrity?me(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=Ys(this.opts?.options)}on(e,t){return e==="size"&&this.#t?t(this.#t):e==="integrity"&&this.#e?t(this.#e):e==="verified"&&this.#s?t(this.#s):super.on(e,t)}emit(e,t){return e==="end"&&this.#i(),super.emit(e,t)}write(e){return this.size+=e.length,this.hashes.forEach(t=>t.update(e)),super.write(e)}#i(){this.goodSri||this.#r();let e=me(this.hashes.map((r,i)=>`${this.algorithms[i]}-${r.digest("base64")}${this.optString}`).join(" "),this.opts),t=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize=="number"&&this.size!==this.expectedSize){let r=new Error(`stream size mismatch when checking ${this.sri}.
|
|
6
6
|
Wanted: ${this.expectedSize}
|
|
7
|
-
Found: ${this.size}`);r.code="EBADSIZE",r.found=this.size,r.expected=this.expectedSize,r.sri=this.sri,this.emit("error",r)}else if(this.sri&&!t){let r=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);r.code="EINTEGRITY",r.found=e,r.expected=this.digests,r.algorithm=this.algorithm,r.sri=this.sri,this.emit("error",r)}else this.#t=this.size,this.emit("size",this.size),this.#e=e,this.emit("integrity",e),t&&(this.#s=t,this.emit("verified",t))}},
|
|
7
|
+
Found: ${this.size}`);r.code="EBADSIZE",r.found=this.size,r.expected=this.expectedSize,r.sri=this.sri,this.emit("error",r)}else if(this.sri&&!t){let r=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);r.code="EINTEGRITY",r.found=e,r.expected=this.digests,r.algorithm=this.algorithm,r.sri=this.sri,this.emit("error",r)}else this.#t=this.size,this.emit("size",this.size),this.#e=e,this.emit("integrity",e),t&&(this.#s=t,this.emit("verified",t))}},ht=class{static{o(this,"Hash")}get isHash(){return!0}constructor(e,t){let r=t?.strict;this.source=e.trim(),this.digest="",this.algorithm="",this.options=[];let i=this.source.match(r?$E:ME);if(!i||r&&!Do.includes(i[1]))return;this.algorithm=i[1],this.digest=i[2];let n=i[3];n&&(this.options=n.slice(1).split("?"))}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}match(e,t){let r=me(e,t);if(!r)return!1;if(r.isIntegrity){let i=r.pickAlgorithm(t,[this.algorithm]);if(!i)return!1;let n=r[i].find(a=>a.digest===this.digest);return n||!1}return r.digest===this.digest?r:!1}toString(e){return e?.strict&&!(Do.includes(this.algorithm)&&this.digest.match(DE)&&this.options.every(t=>t.match(FE)))?"":`${this.algorithm}-${this.digest}${Ys(this.options)}`}};function vu(s,e,t,r){let i=s!=="",n=!1,a="",c=r.length-1;for(let u=0;u<c;u++){let l=ht.prototype.toString.call(r[u],t);l&&(n=!0,a+=l,a+=e)}let h=ht.prototype.toString.call(r[c],t);return h&&(n=!0,a+=h),i&&n?s+e+a:s+a}o(vu,"integrityHashToString");var Dt=class{static{o(this,"Integrity")}get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let t=e?.sep||" ",r="";if(e?.strict){t=t.replace(/\S+/g," ");for(let i of Do)this[i]&&(r=vu(r,t,e,this[i]))}else for(let i of Object.keys(this))r=vu(r,t,e,this[i]);return r}concat(e,t){let r=typeof e=="string"?e:Zs(e,t);return me(`${this.toString(t)} ${r}`,t)}hexDigest(){return me(this,{single:!0}).hexDigest()}merge(e,t){let r=me(e,t);for(let i in r)if(this[i]){if(!this[i].find(n=>r[i].find(a=>n.digest===a.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[i]=r[i]}match(e,t){let r=me(e,t);if(!r)return!1;let i=r.pickAlgorithm(t,Object.keys(this));return!!i&&this[i]&&r[i]&&this[i].find(n=>r[i].find(a=>n.digest===a.digest))||!1}pickAlgorithm(e,t){let r=e?.pickAlgorithm||WE,i=Object.keys(this).filter(n=>t?.length?t.includes(n):!0);return i.length?i.reduce((n,a)=>r(n,a)||n):null}};qe.exports.parse=me;function me(s,e){if(!s)return null;if(typeof s=="string")return ko(s,e);if(s.algorithm&&s.digest){let t=new Dt;return t[s.algorithm]=[s],ko(Zs(t,e),e)}else return ko(Zs(s,e),e)}o(me,"parse");function ko(s,e){if(e?.single)return new ht(s,e);let t=s.trim().split(/\s+/).reduce((r,i)=>{let n=new ht(i,e);if(n.algorithm&&n.digest){let a=n.algorithm;r[a]||(r[a]=[]),r[a].push(n)}return r},new Dt);return t.isEmpty()?null:t}o(ko,"_parse");qe.exports.stringify=Zs;function Zs(s,e){return s.algorithm&&s.digest?ht.prototype.toString.call(s,e):typeof s=="string"?Zs(me(s,e),e):Dt.prototype.toString.call(s,e)}o(Zs,"stringify");qe.exports.fromHex=qE;function qE(s,e,t){let r=Ys(t?.options);return me(`${e}-${Buffer.from(s,"hex").toString("base64")}${r}`,t)}o(qE,"fromHex");qe.exports.fromData=UE;function UE(s,e){let t=e?.algorithms||[...$o],r=Ys(e?.options);return t.reduce((i,n)=>{let a=Ks.createHash(n).update(s).digest("base64"),c=new ht(`${n}-${a}${r}`,e);if(c.algorithm&&c.digest){let h=c.algorithm;i[h]||(i[h]=[]),i[h].push(c)}return i},new Dt)}o(UE,"fromData");qe.exports.fromStream=jE;function jE(s,e){let t=Fo(e);return new Promise((r,i)=>{s.pipe(t),s.on("error",i),t.on("error",i);let n;t.on("integrity",a=>{n=a}),t.on("end",()=>r(n)),t.resume()})}o(jE,"fromStream");qe.exports.checkData=HE;function HE(s,e,t){if(e=me(e,t),!e||!Object.keys(e).length){if(t?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let r=e.pickAlgorithm(t),i=Ks.createHash(r).update(s).digest("base64"),n=me({algorithm:r,digest:i}),a=n.match(e,t);if(t=t||{},a||!t.error)return a;if(typeof t.size=="number"&&s.length!==t.size){let c=new Error(`data size mismatch when checking ${e}.
|
|
8
8
|
Wanted: ${t.size}
|
|
9
|
-
Found: ${s.length}`);throw c.code="EBADSIZE",c.found=s.length,c.expected=t.size,c.sri=e,c}else{let c=new Error(`Integrity checksum failed when using ${r}: Wanted ${e}, but got ${n}. (${s.length} bytes)`);throw c.code="EINTEGRITY",c.found=n,c.expected=e,c.algorithm=r,c.sri=e,c}}o(mw,"checkData");ze.exports.checkStream=gw;function gw(s,e,t){if(t=t||Object.create(null),t.integrity=e,e=we(e,t),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let r=Xo(t);return new Promise((i,n)=>{s.pipe(r),s.on("error",n),r.on("error",n);let a;r.on("verified",c=>{a=c}),r.on("end",()=>i(a)),r.resume()})}o(gw,"checkStream");ze.exports.integrityStream=Xo;function Xo(s=Object.create(null)){return new Ko(s)}o(Xo,"integrityStream");ze.exports.create=yw;function yw(s){let e=s?.algorithms||[...Yo],t=nr(s?.options),r=e.map(ir.createHash);return{update:o(function(i,n){return r.forEach(a=>a.update(i,n)),this},"update"),digest:o(function(){return e.reduce((n,a)=>{let c=r.shift().digest("base64"),h=new dt(`${a}-${c}${t}`,s);if(h.algorithm&&h.digest){let u=h.algorithm;n[u]||(n[u]=[]),n[u].push(h)}return n},new Ut)},"digest")}}o(yw,"createIntegrity");var Ew=ir.getHashes(),Hu=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(s=>Ew.includes(s));function ww(s,e){return Hu.indexOf(s.toLowerCase())>=Hu.indexOf(e.toLowerCase())?s:e}o(ww,"getPrioritizedHash")});var Qo=m((vx,Zu)=>{var zu=_u(),Gu=Uu(),Sw=Ot(),Vu={shared:!1,ignoreCargoCult:!0},_w={status:200,headers:{}},fs=o(s=>{let e={method:s.method,url:s.url,headers:{},compress:s.compress};return s.headers.forEach((t,r)=>{e.headers[r]=t}),e},"requestObject"),Wu=o(s=>{let e={status:s.status,headers:{}};return s.headers.forEach((t,r)=>{e.headers[r]=t}),e},"responseObject"),Jo=class{static{o(this,"CachePolicy")}constructor({entry:e,request:t,response:r,options:i}){this.entry=e,this.request=fs(t),this.response=Wu(r),this.options=i,this.policy=new zu(this.request,this.response,Vu),this.entry&&(this.policy._responseTime=this.entry.metadata.time)}static storable(e,t){return!t.cachePath||t.cache==="no-store"||!["GET","HEAD"].includes(e.method)?!1:new zu(fs(e),_w,Vu).storable()}satisfies(e){let t=fs(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let r=new Gu(this.request),i=new Gu(t);return JSON.stringify(r.mediaTypes())!==JSON.stringify(i.mediaTypes())||JSON.stringify(r.languages())!==JSON.stringify(i.languages())||JSON.stringify(r.encodings())!==JSON.stringify(i.encodings())?!1:this.options.integrity?Sw.parse(this.options.integrity).match(this.entry.integrity):!0}storable(){return this.policy.storable()}get mustRevalidate(){return!!this.policy._rescc["must-revalidate"]}needsRevalidation(e){let t=fs(e);return t.method="GET",!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=fs(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let r=fs(e),i=Wu(t);return!this.policy.revalidatedPolicy(r,i).modified}};Zu.exports=Jo});var Yu=m((Tx,Ku)=>{var ea=class extends Error{static{o(this,"NotCachedError")}constructor(e){super(`request to ${e} failed: cache mode is 'only-if-cached' but no cached response is available.`),this.code="ENOTCACHED"}};Ku.exports={NotCachedError:ea}});var yi=m((Ax,el)=>{var bw=ai(),Xu=Symbol("_flush"),Ju=Symbol("_flushed"),Qu=Symbol("_flushing"),ta=class extends bw{static{o(this,"Flush")}constructor(e={}){if(typeof e=="function"&&(e={flush:e}),super(e),typeof e.flush!="function"&&typeof this.flush!="function")throw new TypeError("must provide flush function in options");this[Xu]=e.flush||this.flush}emit(e,...t){if(e!=="end"&&e!=="finish"||this[Ju])return super.emit(e,...t);if(this[Qu])return;this[Qu]=!0;let r=o(n=>{this[Ju]=!0,n?super.emit("error",n):super.emit("end")},"afterFlush"),i=this[Xu](r);i&&i.then&&i.then(()=>r(),n=>r(n))}};el.exports=ta});var na=m((Bx,ia)=>{var{Minipass:tl}=ee(),ds=Symbol("_data"),ps=Symbol("_length"),sa=class extends tl{static{o(this,"Collect")}constructor(e){super(e),this[ds]=[],this[ps]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[ds].push(i),this[ps]+=i.length,r&&r(),!0}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let i=Buffer.concat(this[ds],this[ps]);return super.write(i),super.end(r)}};ia.exports=sa;var ra=class extends tl{static{o(this,"CollectPassThrough")}constructor(e){super(e),this[ds]=[],this[ps]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[ds].push(i),this[ps]+=i.length,super.write(e,t,r)}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let i=Buffer.concat(this[ds],this[ps]);return this.emit("collect",i),super.end(r)}};ia.exports.PassThrough=ra});var ms=m((Px,nl)=>{var Rw=ai(),Ow=require("events"),vw=o(s=>s&&s instanceof Ow&&(typeof s.pipe=="function"||typeof s.write=="function"&&typeof s.end=="function"),"isStream"),jt=Symbol("_head"),Se=Symbol("_tail"),oa=Symbol("_linkStreams"),aa=Symbol("_setHead"),ca=Symbol("_setTail"),sl=Symbol("_onError"),rl=Symbol("_onData"),ha=Symbol("_onEnd"),il=Symbol("_onDrain"),Ei=Symbol("_streams"),ua=class extends Rw{static{o(this,"Pipeline")}constructor(e,...t){vw(e)&&(t.unshift(e),e={}),super(e),this[Ei]=[],t.length&&this.push(...t)}[oa](e){return e.reduce((t,r)=>(t.on("error",i=>r.emit("error",i)),t.pipe(r),r))}push(...e){this[Ei].push(...e),this[Se]&&e.unshift(this[Se]);let t=this[oa](e);this[ca](t),this[jt]||this[aa](e[0])}unshift(...e){this[Ei].unshift(...e),this[jt]&&e.push(this[jt]);let t=this[oa](e);this[aa](e[0]),this[Se]||this[ca](t)}destroy(e){return this[Ei].forEach(t=>typeof t.destroy=="function"&&t.destroy()),super.destroy(e)}[ca](e){this[Se]=e,e.on("error",t=>this[sl](e,t)),e.on("data",t=>this[rl](e,t)),e.on("end",()=>this[ha](e)),e.on("finish",()=>this[ha](e))}[sl](e,t){e===this[Se]&&this.emit("error",t)}[rl](e,t){e===this[Se]&&super.write(t)}[ha](e){e===this[Se]&&super.end()}pause(){return super.pause(),this[Se]&&this[Se].pause&&this[Se].pause()}emit(e,...t){return e==="resume"&&this[Se]&&this[Se].resume&&this[Se].resume(),super.emit(e,...t)}[aa](e){this[jt]=e,e.on("drain",()=>this[il](e))}[il](e){e===this[jt]&&this.emit("drain")}write(e,t,r){return this[jt].write(e,t,r)&&(this.flowing||this.buffer.length===0)}end(e,t,r){return this[jt].end(e,t,r),this}};nl.exports=ua});var ol=m((kx,la)=>{(function(){var s;function e(t,r){var i=this instanceof e?this:s;if(i.reset(r),typeof t=="string"&&t.length>0&&i.hash(t),i!==this)return i}o(e,"MurmurHash3"),e.prototype.hash=function(t){var r,i,n,a,c;switch(c=t.length,this.len+=c,i=this.k1,n=0,this.rem){case 0:i^=c>n?t.charCodeAt(n++)&65535:0;case 1:i^=c>n?(t.charCodeAt(n++)&65535)<<8:0;case 2:i^=c>n?(t.charCodeAt(n++)&65535)<<16:0;case 3:i^=c>n?(t.charCodeAt(n)&255)<<24:0,i^=c>n?(t.charCodeAt(n++)&65280)>>8:0}if(this.rem=c+this.rem&3,c-=this.rem,c>0){for(r=this.h1;i=i*11601+(i&65535)*3432906752&4294967295,i=i<<15|i>>>17,i=i*13715+(i&65535)*461832192&4294967295,r^=i,r=r<<13|r>>>19,r=r*5+3864292196&4294967295,!(n>=c);)i=t.charCodeAt(n++)&65535^(t.charCodeAt(n++)&65535)<<8^(t.charCodeAt(n++)&65535)<<16,a=t.charCodeAt(n++),i^=(a&255)<<24^(a&65280)>>8;switch(i=0,this.rem){case 3:i^=(t.charCodeAt(n+2)&65535)<<16;case 2:i^=(t.charCodeAt(n+1)&65535)<<8;case 1:i^=t.charCodeAt(n)&65535}this.h1=r}return this.k1=i,this},e.prototype.result=function(){var t,r;return t=this.k1,r=this.h1,t>0&&(t=t*11601+(t&65535)*3432906752&4294967295,t=t<<15|t>>>17,t=t*13715+(t&65535)*461832192&4294967295,r^=t),r^=this.len,r^=r>>>16,r=r*51819+(r&65535)*2246770688&4294967295,r^=r>>>13,r=r*44597+(r&65535)*3266445312&4294967295,r^=r>>>16,r>>>0},e.prototype.reset=function(t){return this.h1=typeof t=="number"?t:0,this.rem=this.k1=this.len=0,this},s=new e,typeof la<"u"?la.exports=e:this.MurmurHash3=e})()});var cl=m((Fx,al)=>{"use strict";var Iw=ol();al.exports=function(s){if(s){var e=new Iw(s);return("00000000"+e.result().toString(16)).slice(-8)}else return(Math.random().toString(16)+"0000000").slice(2,10)}});var fa=m((Mx,hl)=>{var Tw=require("path"),Cw=cl();hl.exports=function(s,e,t){return Tw.join(s,(e?e+"-":"")+Cw(t))}});var da=m(($x,Aw)=>{Aw.exports={name:"cacache",version:"20.0.1","cache-version":{content:"2",index:"5"},description:"Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",snap:"tap",coverage:"tap","test-docker":'docker run -it --rm --name pacotest -v "$PWD":/tmp -w /tmp node:latest npm test',lint:"npm run eslint",npmclilint:"npmcli-lint",lintfix:"npm run eslint -- --fix",postsnap:"npm run lintfix --",postlint:"template-oss-check",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},repository:{type:"git",url:"git+https://github.com/npm/cacache.git"},keywords:["cache","caching","content-addressable","sri","sri hash","subresource integrity","cache","storage","store","file store","filesystem","disk cache","disk storage"],license:"ISC",dependencies:{"@npmcli/fs":"^4.0.0","fs-minipass":"^3.0.0",glob:"^11.0.3","lru-cache":"^11.1.0",minipass:"^7.0.3","minipass-collect":"^2.0.1","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4","p-map":"^7.0.2",ssri:"^12.0.0","unique-filename":"^4.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",windowsCI:!1,version:"4.25.0",publish:"true"},author:"GitHub Inc.",tap:{"nyc-arg":["--exclude","tap-snapshots/**"]}}});var pa=m((qx,ul)=>{"use strict";ul.exports=xw;function xw(s){return[s.slice(0,2),s.slice(2,4),s.slice(4)]}o(xw,"hashToSegments")});var gs=m((jx,ma)=>{"use strict";var Bw=da()["cache-version"].content,Nw=pa(),ll=require("path"),Pw=Ot();ma.exports=Lw;function Lw(s,e){let t=Pw.parse(e,{single:!0});return ll.join(fl(s),t.algorithm,...Nw(t.hexDigest()))}o(Lw,"contentPath");ma.exports.contentDir=fl;function fl(s){return ll.join(s,`content-v${Bw}`)}o(fl,"contentDir")});var ga=m((zx,dl)=>{var kw=o((s,{copy:e,wrap:t})=>{let r={};if(s&&typeof s=="object")for(let i of e)s[i]!==void 0&&(r[i]=s[i]);else r[t]=s;return r},"getOptions");dl.exports=kw});var or=m((Vx,pl)=>{"use strict";var Dw="2.0.0",Fw=Number.MAX_SAFE_INTEGER||9007199254740991,Mw=16,$w=250,qw=["major","premajor","minor","preminor","patch","prepatch","prerelease"];pl.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Mw,MAX_SAFE_BUILD_LENGTH:$w,MAX_SAFE_INTEGER:Fw,RELEASE_TYPES:qw,SEMVER_SPEC_VERSION:Dw,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ar=m((Wx,ml)=>{"use strict";var Uw=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...s)=>{}:()=>{};ml.exports=Uw});var ys=m((Ge,gl)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ya,MAX_SAFE_BUILD_LENGTH:jw,MAX_LENGTH:Hw}=or(),zw=ar();Ge=gl.exports={};var Gw=Ge.re=[],Vw=Ge.safeRe=[],b=Ge.src=[],Ww=Ge.safeSrc=[],R=Ge.t={},Zw=0,Ea="[a-zA-Z0-9-]",Kw=[["\\s",1],["\\d",Hw],[Ea,jw]],Yw=o(s=>{for(let[e,t]of Kw)s=s.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return s},"makeSafeRegex"),C=o((s,e,t)=>{let r=Yw(e),i=Zw++;zw(s,i,e),R[s]=i,b[i]=e,Ww[i]=r,Gw[i]=new RegExp(e,t?"g":void 0),Vw[i]=new RegExp(r,t?"g":void 0)},"createToken");C("NUMERICIDENTIFIER","0|[1-9]\\d*");C("NUMERICIDENTIFIERLOOSE","\\d+");C("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ea}*`);C("MAINVERSION",`(${b[R.NUMERICIDENTIFIER]})\\.(${b[R.NUMERICIDENTIFIER]})\\.(${b[R.NUMERICIDENTIFIER]})`);C("MAINVERSIONLOOSE",`(${b[R.NUMERICIDENTIFIERLOOSE]})\\.(${b[R.NUMERICIDENTIFIERLOOSE]})\\.(${b[R.NUMERICIDENTIFIERLOOSE]})`);C("PRERELEASEIDENTIFIER",`(?:${b[R.NONNUMERICIDENTIFIER]}|${b[R.NUMERICIDENTIFIER]})`);C("PRERELEASEIDENTIFIERLOOSE",`(?:${b[R.NONNUMERICIDENTIFIER]}|${b[R.NUMERICIDENTIFIERLOOSE]})`);C("PRERELEASE",`(?:-(${b[R.PRERELEASEIDENTIFIER]}(?:\\.${b[R.PRERELEASEIDENTIFIER]})*))`);C("PRERELEASELOOSE",`(?:-?(${b[R.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${b[R.PRERELEASEIDENTIFIERLOOSE]})*))`);C("BUILDIDENTIFIER",`${Ea}+`);C("BUILD",`(?:\\+(${b[R.BUILDIDENTIFIER]}(?:\\.${b[R.BUILDIDENTIFIER]})*))`);C("FULLPLAIN",`v?${b[R.MAINVERSION]}${b[R.PRERELEASE]}?${b[R.BUILD]}?`);C("FULL",`^${b[R.FULLPLAIN]}$`);C("LOOSEPLAIN",`[v=\\s]*${b[R.MAINVERSIONLOOSE]}${b[R.PRERELEASELOOSE]}?${b[R.BUILD]}?`);C("LOOSE",`^${b[R.LOOSEPLAIN]}$`);C("GTLT","((?:<|>)?=?)");C("XRANGEIDENTIFIERLOOSE",`${b[R.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);C("XRANGEIDENTIFIER",`${b[R.NUMERICIDENTIFIER]}|x|X|\\*`);C("XRANGEPLAIN",`[v=\\s]*(${b[R.XRANGEIDENTIFIER]})(?:\\.(${b[R.XRANGEIDENTIFIER]})(?:\\.(${b[R.XRANGEIDENTIFIER]})(?:${b[R.PRERELEASE]})?${b[R.BUILD]}?)?)?`);C("XRANGEPLAINLOOSE",`[v=\\s]*(${b[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[R.XRANGEIDENTIFIERLOOSE]})(?:${b[R.PRERELEASELOOSE]})?${b[R.BUILD]}?)?)?`);C("XRANGE",`^${b[R.GTLT]}\\s*${b[R.XRANGEPLAIN]}$`);C("XRANGELOOSE",`^${b[R.GTLT]}\\s*${b[R.XRANGEPLAINLOOSE]}$`);C("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ya}})(?:\\.(\\d{1,${ya}}))?(?:\\.(\\d{1,${ya}}))?`);C("COERCE",`${b[R.COERCEPLAIN]}(?:$|[^\\d])`);C("COERCEFULL",b[R.COERCEPLAIN]+`(?:${b[R.PRERELEASE]})?(?:${b[R.BUILD]})?(?:$|[^\\d])`);C("COERCERTL",b[R.COERCE],!0);C("COERCERTLFULL",b[R.COERCEFULL],!0);C("LONETILDE","(?:~>?)");C("TILDETRIM",`(\\s*)${b[R.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";C("TILDE",`^${b[R.LONETILDE]}${b[R.XRANGEPLAIN]}$`);C("TILDELOOSE",`^${b[R.LONETILDE]}${b[R.XRANGEPLAINLOOSE]}$`);C("LONECARET","(?:\\^)");C("CARETTRIM",`(\\s*)${b[R.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";C("CARET",`^${b[R.LONECARET]}${b[R.XRANGEPLAIN]}$`);C("CARETLOOSE",`^${b[R.LONECARET]}${b[R.XRANGEPLAINLOOSE]}$`);C("COMPARATORLOOSE",`^${b[R.GTLT]}\\s*(${b[R.LOOSEPLAIN]})$|^$`);C("COMPARATOR",`^${b[R.GTLT]}\\s*(${b[R.FULLPLAIN]})$|^$`);C("COMPARATORTRIM",`(\\s*)${b[R.GTLT]}\\s*(${b[R.LOOSEPLAIN]}|${b[R.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";C("HYPHENRANGE",`^\\s*(${b[R.XRANGEPLAIN]})\\s+-\\s+(${b[R.XRANGEPLAIN]})\\s*$`);C("HYPHENRANGELOOSE",`^\\s*(${b[R.XRANGEPLAINLOOSE]})\\s+-\\s+(${b[R.XRANGEPLAINLOOSE]})\\s*$`);C("STAR","(<|>)?=?\\s*\\*");C("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");C("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var wi=m((Kx,yl)=>{"use strict";var Xw=Object.freeze({loose:!0}),Jw=Object.freeze({}),Qw=o(s=>s?typeof s!="object"?Xw:s:Jw,"parseOptions");yl.exports=Qw});var wa=m((Xx,Sl)=>{"use strict";var El=/^[0-9]+$/,wl=o((s,e)=>{let t=El.test(s),r=El.test(e);return t&&r&&(s=+s,e=+e),s===e?0:t&&!r?-1:r&&!t?1:s<e?-1:1},"compareIdentifiers"),eS=o((s,e)=>wl(e,s),"rcompareIdentifiers");Sl.exports={compareIdentifiers:wl,rcompareIdentifiers:eS}});var re=m((Qx,bl)=>{"use strict";var Si=ar(),{MAX_LENGTH:_l,MAX_SAFE_INTEGER:_i}=or(),{safeRe:bi,t:Ri}=ys(),tS=wi(),{compareIdentifiers:Es}=wa(),Sa=class s{static{o(this,"SemVer")}constructor(e,t){if(t=tS(t),e instanceof s){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>_l)throw new TypeError(`version is longer than ${_l} characters`);Si("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?bi[Ri.LOOSE]:bi[Ri.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>_i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>_i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>_i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<_i)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Si("SemVer.compare",this.version,this.options,e),!(e instanceof s)){if(typeof e=="string"&&e===this.version)return 0;e=new s(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof s||(e=new s(e,this.options)),Es(this.major,e.major)||Es(this.minor,e.minor)||Es(this.patch,e.patch)}comparePre(e){if(e instanceof s||(e=new s(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(Si("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Es(r,i)}while(++t)}compareBuild(e){e instanceof s||(e=new s(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(Si("build compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Es(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?bi[Ri.PRERELEASELOOSE]:bi[Ri.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let n=[t,i];r===!1&&(n=[t]),Es(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};bl.exports=Sa});var Ht=m((t1,Ol)=>{"use strict";var Rl=re(),sS=o((s,e,t=!1)=>{if(s instanceof Rl)return s;try{return new Rl(s,e)}catch(r){if(!t)return null;throw r}},"parse");Ol.exports=sS});var Il=m((r1,vl)=>{"use strict";var rS=Ht(),iS=o((s,e)=>{let t=rS(s,e);return t?t.version:null},"valid");vl.exports=iS});var Cl=m((n1,Tl)=>{"use strict";var nS=Ht(),oS=o((s,e)=>{let t=nS(s.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");Tl.exports=oS});var Bl=m((a1,xl)=>{"use strict";var Al=re(),aS=o((s,e,t,r,i)=>{typeof t=="string"&&(i=r,r=t,t=void 0);try{return new Al(s instanceof Al?s.version:s,t).inc(e,r,i).version}catch{return null}},"inc");xl.exports=aS});var Ll=m((h1,Pl)=>{"use strict";var Nl=Ht(),cS=o((s,e)=>{let t=Nl(s,null,!0),r=Nl(e,null,!0),i=t.compare(r);if(i===0)return null;let n=i>0,a=n?t:r,c=n?r:t,h=!!a.prerelease.length;if(!!c.prerelease.length&&!h){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}let l=h?"pre":"";return t.major!==r.major?l+"major":t.minor!==r.minor?l+"minor":t.patch!==r.patch?l+"patch":"prerelease"},"diff");Pl.exports=cS});var Dl=m((l1,kl)=>{"use strict";var hS=re(),uS=o((s,e)=>new hS(s,e).major,"major");kl.exports=uS});var Ml=m((d1,Fl)=>{"use strict";var lS=re(),fS=o((s,e)=>new lS(s,e).minor,"minor");Fl.exports=fS});var ql=m((m1,$l)=>{"use strict";var dS=re(),pS=o((s,e)=>new dS(s,e).patch,"patch");$l.exports=pS});var jl=m((y1,Ul)=>{"use strict";var mS=Ht(),gS=o((s,e)=>{let t=mS(s,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");Ul.exports=gS});var Oe=m((w1,zl)=>{"use strict";var Hl=re(),yS=o((s,e,t)=>new Hl(s,t).compare(new Hl(e,t)),"compare");zl.exports=yS});var Vl=m((_1,Gl)=>{"use strict";var ES=Oe(),wS=o((s,e,t)=>ES(e,s,t),"rcompare");Gl.exports=wS});var Zl=m((R1,Wl)=>{"use strict";var SS=Oe(),_S=o((s,e)=>SS(s,e,!0),"compareLoose");Wl.exports=_S});var Oi=m((v1,Yl)=>{"use strict";var Kl=re(),bS=o((s,e,t)=>{let r=new Kl(s,t),i=new Kl(e,t);return r.compare(i)||r.compareBuild(i)},"compareBuild");Yl.exports=bS});var Jl=m((T1,Xl)=>{"use strict";var RS=Oi(),OS=o((s,e)=>s.sort((t,r)=>RS(t,r,e)),"sort");Xl.exports=OS});var ef=m((A1,Ql)=>{"use strict";var vS=Oi(),IS=o((s,e)=>s.sort((t,r)=>vS(r,t,e)),"rsort");Ql.exports=IS});var cr=m((B1,tf)=>{"use strict";var TS=Oe(),CS=o((s,e,t)=>TS(s,e,t)>0,"gt");tf.exports=CS});var vi=m((P1,sf)=>{"use strict";var AS=Oe(),xS=o((s,e,t)=>AS(s,e,t)<0,"lt");sf.exports=xS});var _a=m((k1,rf)=>{"use strict";var BS=Oe(),NS=o((s,e,t)=>BS(s,e,t)===0,"eq");rf.exports=NS});var ba=m((F1,nf)=>{"use strict";var PS=Oe(),LS=o((s,e,t)=>PS(s,e,t)!==0,"neq");nf.exports=LS});var Ii=m(($1,of)=>{"use strict";var kS=Oe(),DS=o((s,e,t)=>kS(s,e,t)>=0,"gte");of.exports=DS});var Ti=m((U1,af)=>{"use strict";var FS=Oe(),MS=o((s,e,t)=>FS(s,e,t)<=0,"lte");af.exports=MS});var Ra=m((H1,cf)=>{"use strict";var $S=_a(),qS=ba(),US=cr(),jS=Ii(),HS=vi(),zS=Ti(),GS=o((s,e,t,r)=>{switch(e){case"===":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s===t;case"!==":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s!==t;case"":case"=":case"==":return $S(s,t,r);case"!=":return qS(s,t,r);case">":return US(s,t,r);case">=":return jS(s,t,r);case"<":return HS(s,t,r);case"<=":return zS(s,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");cf.exports=GS});var uf=m((G1,hf)=>{"use strict";var VS=re(),WS=Ht(),{safeRe:Ci,t:Ai}=ys(),ZS=o((s,e)=>{if(s instanceof VS)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;e=e||{};let t=null;if(!e.rtl)t=s.match(e.includePrerelease?Ci[Ai.COERCEFULL]:Ci[Ai.COERCE]);else{let h=e.includePrerelease?Ci[Ai.COERCERTLFULL]:Ci[Ai.COERCERTL],u;for(;(u=h.exec(s))&&(!t||t.index+t[0].length!==s.length);)(!t||u.index+u[0].length!==t.index+t[0].length)&&(t=u),h.lastIndex=u.index+u[1].length+u[2].length;h.lastIndex=-1}if(t===null)return null;let r=t[2],i=t[3]||"0",n=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return WS(`${r}.${i}.${n}${a}${c}`,e)},"coerce");hf.exports=ZS});var ff=m((W1,lf)=>{"use strict";var Oa=class{static{o(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};lf.exports=Oa});var ve=m((K1,gf)=>{"use strict";var KS=/\s+/g,va=class s{static{o(this,"Range")}constructor(e,t){if(t=XS(t),e instanceof s)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new s(e.raw,t);if(e instanceof Ia)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(KS," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!pf(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&i_(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&s_)|(this.options.loose&&r_))+":"+e,i=df.get(r);if(i)return i;let n=this.options.loose,a=n?fe[ae.HYPHENRANGELOOSE]:fe[ae.HYPHENRANGE];e=e.replace(a,p_(this.options.includePrerelease)),q("hyphen replace",e),e=e.replace(fe[ae.COMPARATORTRIM],QS),q("comparator trim",e),e=e.replace(fe[ae.TILDETRIM],e_),q("tilde trim",e),e=e.replace(fe[ae.CARETTRIM],t_),q("caret trim",e);let c=e.split(" ").map(f=>n_(f,this.options)).join(" ").split(/\s+/).map(f=>d_(f,this.options));n&&(c=c.filter(f=>(q("loose invalid filter",f,this.options),!!f.match(fe[ae.COMPARATORLOOSE])))),q("range list",c);let h=new Map,u=c.map(f=>new Ia(f,this.options));for(let f of u){if(pf(f))return[f];h.set(f.value,f)}h.size>1&&h.has("")&&h.delete("");let l=[...h.values()];return df.set(r,l),l}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Range is required");return this.set.some(r=>mf(r,t)&&e.set.some(i=>mf(i,t)&&r.every(n=>i.every(a=>n.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new JS(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(m_(this.set[t],e,this.options))return!0;return!1}};gf.exports=va;var YS=ff(),df=new YS,XS=wi(),Ia=hr(),q=ar(),JS=re(),{safeRe:fe,t:ae,comparatorTrimReplace:QS,tildeTrimReplace:e_,caretTrimReplace:t_}=ys(),{FLAG_INCLUDE_PRERELEASE:s_,FLAG_LOOSE:r_}=or(),pf=o(s=>s.value==="<0.0.0-0","isNullSet"),i_=o(s=>s.value==="","isAny"),mf=o((s,e)=>{let t=!0,r=s.slice(),i=r.pop();for(;t&&r.length;)t=r.every(n=>i.intersects(n,e)),i=r.pop();return t},"isSatisfiable"),n_=o((s,e)=>(q("comp",s,e),s=c_(s,e),q("caret",s),s=o_(s,e),q("tildes",s),s=u_(s,e),q("xrange",s),s=f_(s,e),q("stars",s),s),"parseComparator"),ce=o(s=>!s||s.toLowerCase()==="x"||s==="*","isX"),o_=o((s,e)=>s.trim().split(/\s+/).map(t=>a_(t,e)).join(" "),"replaceTildes"),a_=o((s,e)=>{let t=e.loose?fe[ae.TILDELOOSE]:fe[ae.TILDE];return s.replace(t,(r,i,n,a,c)=>{q("tilde",s,r,i,n,a,c);let h;return ce(i)?h="":ce(n)?h=`>=${i}.0.0 <${+i+1}.0.0-0`:ce(a)?h=`>=${i}.${n}.0 <${i}.${+n+1}.0-0`:c?(q("replaceTilde pr",c),h=`>=${i}.${n}.${a}-${c} <${i}.${+n+1}.0-0`):h=`>=${i}.${n}.${a} <${i}.${+n+1}.0-0`,q("tilde return",h),h})},"replaceTilde"),c_=o((s,e)=>s.trim().split(/\s+/).map(t=>h_(t,e)).join(" "),"replaceCarets"),h_=o((s,e)=>{q("caret",s,e);let t=e.loose?fe[ae.CARETLOOSE]:fe[ae.CARET],r=e.includePrerelease?"-0":"";return s.replace(t,(i,n,a,c,h)=>{q("caret",s,i,n,a,c,h);let u;return ce(n)?u="":ce(a)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:ce(c)?n==="0"?u=`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:h?(q("replaceCaret pr",h),n==="0"?a==="0"?u=`>=${n}.${a}.${c}-${h} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}-${h} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c}-${h} <${+n+1}.0.0-0`):(q("no pr"),n==="0"?a==="0"?u=`>=${n}.${a}.${c}${r} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}${r} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c} <${+n+1}.0.0-0`),q("caret return",u),u})},"replaceCaret"),u_=o((s,e)=>(q("replaceXRanges",s,e),s.split(/\s+/).map(t=>l_(t,e)).join(" ")),"replaceXRanges"),l_=o((s,e)=>{s=s.trim();let t=e.loose?fe[ae.XRANGELOOSE]:fe[ae.XRANGE];return s.replace(t,(r,i,n,a,c,h)=>{q("xRange",s,r,i,n,a,c,h);let u=ce(n),l=u||ce(a),f=l||ce(c),d=f;return i==="="&&d&&(i=""),h=e.includePrerelease?"-0":"",u?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&d?(l&&(a=0),c=0,i===">"?(i=">=",l?(n=+n+1,a=0,c=0):(a=+a+1,c=0)):i==="<="&&(i="<",l?n=+n+1:a=+a+1),i==="<"&&(h="-0"),r=`${i+n}.${a}.${c}${h}`):l?r=`>=${n}.0.0${h} <${+n+1}.0.0-0`:f&&(r=`>=${n}.${a}.0${h} <${n}.${+a+1}.0-0`),q("xRange return",r),r})},"replaceXRange"),f_=o((s,e)=>(q("replaceStars",s,e),s.trim().replace(fe[ae.STAR],"")),"replaceStars"),d_=o((s,e)=>(q("replaceGTE0",s,e),s.trim().replace(fe[e.includePrerelease?ae.GTE0PRE:ae.GTE0],"")),"replaceGTE0"),p_=o(s=>(e,t,r,i,n,a,c,h,u,l,f,d)=>(ce(r)?t="":ce(i)?t=`>=${r}.0.0${s?"-0":""}`:ce(n)?t=`>=${r}.${i}.0${s?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${s?"-0":""}`,ce(u)?h="":ce(l)?h=`<${+u+1}.0.0-0`:ce(f)?h=`<${u}.${+l+1}.0-0`:d?h=`<=${u}.${l}.${f}-${d}`:s?h=`<${u}.${l}.${+f+1}-0`:h=`<=${h}`,`${t} ${h}`.trim()),"hyphenReplace"),m_=o((s,e,t)=>{for(let r=0;r<s.length;r++)if(!s[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<s.length;r++)if(q(s[r].semver),s[r].semver!==Ia.ANY&&s[r].semver.prerelease.length>0){let i=s[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0},"testSet")});var hr=m((X1,bf)=>{"use strict";var ur=Symbol("SemVer ANY"),Aa=class s{static{o(this,"Comparator")}static get ANY(){return ur}constructor(e,t){if(t=yf(t),e instanceof s){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Ca("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ur?this.value="":this.value=this.operator+this.semver.version,Ca("comp",this)}parse(e){let t=this.options.loose?Ef[wf.COMPARATORLOOSE]:Ef[wf.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new Sf(r[2],this.options.loose):this.semver=ur}toString(){return this.value}test(e){if(Ca("Comparator.test",e,this.options.loose),this.semver===ur||e===ur)return!0;if(typeof e=="string")try{e=new Sf(e,this.options)}catch{return!1}return Ta(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new _f(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new _f(this.value,t).test(e.semver):(t=yf(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Ta(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ta(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};bf.exports=Aa;var yf=wi(),{safeRe:Ef,t:wf}=ys(),Ta=Ra(),Ca=ar(),Sf=re(),_f=ve()});var lr=m((Q1,Rf)=>{"use strict";var g_=ve(),y_=o((s,e,t)=>{try{e=new g_(e,t)}catch{return!1}return e.test(s)},"satisfies");Rf.exports=y_});var vf=m((tB,Of)=>{"use strict";var E_=ve(),w_=o((s,e)=>new E_(s,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" ")),"toComparators");Of.exports=w_});var Tf=m((rB,If)=>{"use strict";var S_=re(),__=ve(),b_=o((s,e,t)=>{let r=null,i=null,n=null;try{n=new __(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===-1)&&(r=a,i=new S_(r,t))}),r},"maxSatisfying");If.exports=b_});var Af=m((nB,Cf)=>{"use strict";var R_=re(),O_=ve(),v_=o((s,e,t)=>{let r=null,i=null,n=null;try{n=new O_(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===1)&&(r=a,i=new R_(r,t))}),r},"minSatisfying");Cf.exports=v_});var Nf=m((aB,Bf)=>{"use strict";var xa=re(),I_=ve(),xf=cr(),T_=o((s,e)=>{s=new I_(s,e);let t=new xa("0.0.0");if(s.test(t)||(t=new xa("0.0.0-0"),s.test(t)))return t;t=null;for(let r=0;r<s.set.length;++r){let i=s.set[r],n=null;i.forEach(a=>{let c=new xa(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!n||xf(c,n))&&(n=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!t||xf(t,n))&&(t=n)}return t&&s.test(t)?t:null},"minVersion");Bf.exports=T_});var Lf=m((hB,Pf)=>{"use strict";var C_=ve(),A_=o((s,e)=>{try{return new C_(s,e).range||"*"}catch{return null}},"validRange");Pf.exports=A_});var xi=m((lB,Mf)=>{"use strict";var x_=re(),Ff=hr(),{ANY:B_}=Ff,N_=ve(),P_=lr(),kf=cr(),Df=vi(),L_=Ti(),k_=Ii(),D_=o((s,e,t,r)=>{s=new x_(s,r),e=new N_(e,r);let i,n,a,c,h;switch(t){case">":i=kf,n=L_,a=Df,c=">",h=">=";break;case"<":i=Df,n=k_,a=kf,c="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(P_(s,e,r))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],f=null,d=null;if(l.forEach(p=>{p.semver===B_&&(p=new Ff(">=0.0.0")),f=f||p,d=d||p,i(p.semver,f.semver,r)?f=p:a(p.semver,d.semver,r)&&(d=p)}),f.operator===c||f.operator===h||(!d.operator||d.operator===c)&&n(s,d.semver))return!1;if(d.operator===h&&a(s,d.semver))return!1}return!0},"outside");Mf.exports=D_});var qf=m((dB,$f)=>{"use strict";var F_=xi(),M_=o((s,e,t)=>F_(s,e,">",t),"gtr");$f.exports=M_});var jf=m((mB,Uf)=>{"use strict";var $_=xi(),q_=o((s,e,t)=>$_(s,e,"<",t),"ltr");Uf.exports=q_});var Gf=m((yB,zf)=>{"use strict";var Hf=ve(),U_=o((s,e,t)=>(s=new Hf(s,t),e=new Hf(e,t),s.intersects(e,t)),"intersects");zf.exports=U_});var Wf=m((wB,Vf)=>{"use strict";var j_=lr(),H_=Oe();Vf.exports=(s,e,t)=>{let r=[],i=null,n=null,a=s.sort((l,f)=>H_(l,f,t));for(let l of a)j_(l,e,t)?(n=l,i||(i=l)):(n&&r.push([i,n]),n=null,i=null);i&&r.push([i,null]);let c=[];for(let[l,f]of r)l===f?c.push(l):!f&&l===a[0]?c.push("*"):f?l===a[0]?c.push(`<=${f}`):c.push(`${l} - ${f}`):c.push(`>=${l}`);let h=c.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return h.length<u.length?h:e}});var Qf=m((SB,Jf)=>{"use strict";var Zf=ve(),Na=hr(),{ANY:Ba}=Na,fr=lr(),Pa=Oe(),z_=o((s,e,t={})=>{if(s===e)return!0;s=new Zf(s,t),e=new Zf(e,t);let r=!1;e:for(let i of s.set){for(let n of e.set){let a=V_(i,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},"subset"),G_=[new Na(">=0.0.0-0")],Kf=[new Na(">=0.0.0")],V_=o((s,e,t)=>{if(s===e)return!0;if(s.length===1&&s[0].semver===Ba){if(e.length===1&&e[0].semver===Ba)return!0;t.includePrerelease?s=G_:s=Kf}if(e.length===1&&e[0].semver===Ba){if(t.includePrerelease)return!0;e=Kf}let r=new Set,i,n;for(let p of s)p.operator===">"||p.operator===">="?i=Yf(i,p,t):p.operator==="<"||p.operator==="<="?n=Xf(n,p,t):r.add(p.semver);if(r.size>1)return null;let a;if(i&&n){if(a=Pa(i.semver,n.semver,t),a>0)return null;if(a===0&&(i.operator!==">="||n.operator!=="<="))return null}for(let p of r){if(i&&!fr(p,String(i),t)||n&&!fr(p,String(n),t))return null;for(let y of e)if(!fr(p,String(y),t))return!1;return!0}let c,h,u,l,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,d=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&n.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let p of e){if(l=l||p.operator===">"||p.operator===">=",u=u||p.operator==="<"||p.operator==="<=",i){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator===">"||p.operator===">="){if(c=Yf(i,p,t),c===p&&c!==i)return!1}else if(i.operator===">="&&!fr(i.semver,String(p),t))return!1}if(n){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator==="<"||p.operator==="<="){if(h=Xf(n,p,t),h===p&&h!==n)return!1}else if(n.operator==="<="&&!fr(n.semver,String(p),t))return!1}if(!p.operator&&(n||i)&&a!==0)return!1}return!(i&&u&&!n&&a!==0||n&&l&&!i&&a!==0||d||f)},"simpleSubset"),Yf=o((s,e,t)=>{if(!s)return e;let r=Pa(s.semver,e.semver,t);return r>0?s:r<0||e.operator===">"&&s.operator===">="?e:s},"higherGT"),Xf=o((s,e,t)=>{if(!s)return e;let r=Pa(s.semver,e.semver,t);return r<0?s:r>0||e.operator==="<"&&s.operator==="<="?e:s},"lowerLT");Jf.exports=z_});var rd=m((bB,sd)=>{"use strict";var La=ys(),ed=or(),W_=re(),td=wa(),Z_=Ht(),K_=Il(),Y_=Cl(),X_=Bl(),J_=Ll(),Q_=Dl(),e0=Ml(),t0=ql(),s0=jl(),r0=Oe(),i0=Vl(),n0=Zl(),o0=Oi(),a0=Jl(),c0=ef(),h0=cr(),u0=vi(),l0=_a(),f0=ba(),d0=Ii(),p0=Ti(),m0=Ra(),g0=uf(),y0=hr(),E0=ve(),w0=lr(),S0=vf(),_0=Tf(),b0=Af(),R0=Nf(),O0=Lf(),v0=xi(),I0=qf(),T0=jf(),C0=Gf(),A0=Wf(),x0=Qf();sd.exports={parse:Z_,valid:K_,clean:Y_,inc:X_,diff:J_,major:Q_,minor:e0,patch:t0,prerelease:s0,compare:r0,rcompare:i0,compareLoose:n0,compareBuild:o0,sort:a0,rsort:c0,gt:h0,lt:u0,eq:l0,neq:f0,gte:d0,lte:p0,cmp:m0,coerce:g0,Comparator:y0,Range:E0,satisfies:w0,toComparators:S0,maxSatisfying:_0,minSatisfying:b0,minVersion:R0,validRange:O0,outside:v0,gtr:I0,ltr:T0,intersects:C0,simplifyRange:A0,subset:x0,SemVer:W_,re:La.re,src:La.src,tokens:La.t,SEMVER_SPEC_VERSION:ed.SEMVER_SPEC_VERSION,RELEASE_TYPES:ed.RELEASE_TYPES,compareIdentifiers:td.compareIdentifiers,rcompareIdentifiers:td.rcompareIdentifiers}});var nd=m((RB,id)=>{var B0=rd(),N0=o(s=>B0.satisfies(process.version,s,{includePrerelease:!0}),"satisfies");id.exports={satisfies:N0}});var od=m((TB,Da)=>{"use strict";var{inspect:P0}=require("util"),ka=class{static{o(this,"SystemError")}constructor(e,t,r){let i=`${t}: ${r.syscall} returned ${r.code} (${r.message})`;r.path!==void 0&&(i+=` ${r.path}`),r.dest!==void 0&&(i+=` => ${r.dest}`),this.code=e,Object.defineProperties(this,{name:{value:"SystemError",enumerable:!1,writable:!0,configurable:!0},message:{value:i,enumerable:!1,writable:!0,configurable:!0},info:{value:r,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return r.errno},set(n){r.errno=n},enumerable:!0,configurable:!0},syscall:{get(){return r.syscall},set(n){r.syscall=n},enumerable:!0,configurable:!0}}),r.path!==void 0&&Object.defineProperty(this,"path",{get(){return r.path},set(n){r.path=n},enumerable:!0,configurable:!0}),r.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return r.dest},set(n){r.dest=n},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return P0(this,{...t,getters:!0,customInspect:!1})}};function pt(s,e){Da.exports[s]=class extends ka{static{o(this,"NodeError")}constructor(r){super(s,e,r)}}}o(pt,"E");pt("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory");pt("ERR_FS_CP_EEXIST","Target already exists");pt("ERR_FS_CP_EINVAL","Invalid src or dest");pt("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe");pt("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory");pt("ERR_FS_CP_SOCKET","Cannot copy a socket file");pt("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self");pt("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type");pt("ERR_FS_EISDIR","Path is a directory");Da.exports.ERR_INVALID_ARG_TYPE=class extends Error{static{o(this,"ERR_INVALID_ARG_TYPE")}constructor(e,t,r){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${e} argument must be ${t}. Received ${typeof r}`}}});var vd=m((AB,Od)=>{"use strict";var{ERR_FS_CP_DIR_TO_NON_DIR:L0,ERR_FS_CP_EEXIST:k0,ERR_FS_CP_EINVAL:Bi,ERR_FS_CP_FIFO_PIPE:D0,ERR_FS_CP_NON_DIR_TO_DIR:F0,ERR_FS_CP_SOCKET:M0,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:$0,ERR_FS_CP_UNKNOWN:q0,ERR_FS_EISDIR:U0,ERR_INVALID_ARG_TYPE:j0}=od(),{constants:{errno:{EEXIST:H0,EISDIR:z0,EINVAL:mt,ENOTDIR:G0}}}=require("os"),{chmod:V0,copyFile:W0,lstat:md,mkdir:gd,readdir:Z0,readlink:ad,stat:ws,symlink:Fa,unlink:yd,utimes:K0}=require("fs/promises"),{dirname:dr,isAbsolute:cd,join:hd,parse:Y0,resolve:pr,sep:X0,toNamespacedPath:ud}=require("path"),{fileURLToPath:J0}=require("url"),Q0={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function eb(s,e,t){if(t!=null&&typeof t!="object")throw new j0("options",["Object"],t);return tb(ud(ld(s)),ud(ld(e)),{...Q0,...t})}o(eb,"cp");function ld(s){return s!=null&&s.href&&s.origin?J0(s):s}o(ld,"getValidatedPath");async function tb(s,e,t){t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended","TimestampPrecisionWarning");let r=await Ed(s,e,t),{srcStat:i,destStat:n}=r;return await Sd(s,i,e),t.filter?_d(fd,n,s,e,t):fd(n,s,e,t)}o(tb,"cpFn");async function Ed(s,e,t){let{0:r,1:i}=await sb(s,e,t);if(i){if(wd(r,i))throw new Bi({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:mt});if(r.isDirectory()&&!i.isDirectory())throw new L0({message:`cannot overwrite directory ${s} with non-directory ${e}`,path:e,syscall:"cp",errno:z0});if(!r.isDirectory()&&i.isDirectory())throw new F0({message:`cannot overwrite non-directory ${s} with directory ${e}`,path:e,syscall:"cp",errno:G0})}if(r.isDirectory()&&Ma(s,e))throw new Bi({message:`cannot copy ${s} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:mt});return{srcStat:r,destStat:i}}o(Ed,"checkPaths");function wd(s,e){return e.ino&&e.dev&&e.ino===s.ino&&e.dev===s.dev}o(wd,"areIdentical");function sb(s,e,t){let r=t.dereference?i=>ws(i,{bigint:!0}):i=>md(i,{bigint:!0});return Promise.all([r(s),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})])}o(sb,"getStats");async function fd(s,e,t,r){let i=dr(t);return await rb(i)||await gd(i,{recursive:!0}),Ni(s,e,t,r)}o(fd,"checkParentDir");function rb(s){return ws(s).then(()=>!0,e=>e.code==="ENOENT"?!1:Promise.reject(e))}o(rb,"pathExists");async function Sd(s,e,t){let r=pr(dr(s)),i=pr(dr(t));if(i===r||i===Y0(i).root)return;let n;try{n=await ws(i,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(wd(e,n))throw new Bi({message:`cannot copy ${s} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:mt});return Sd(s,e,i)}o(Sd,"checkParentPaths");var dd=o(s=>pr(s).split(X0).filter(Boolean),"normalizePathToArray");function Ma(s,e){let t=dd(s),r=dd(e);return t.every((i,n)=>r[n]===i)}o(Ma,"isSrcSubdir");async function _d(s,e,t,r,i,n){if(await i.filter(t,r))return s(e,t,r,i,n)}o(_d,"handleFilter");function ib(s,e,t,r){return r.filter?_d(Ni,s,e,t,r):Ni(s,e,t,r)}o(ib,"startCopy");async function Ni(s,e,t,r){let n=await(r.dereference?ws:md)(e);if(n.isDirectory()&&r.recursive)return lb(n,s,e,t,r);if(n.isDirectory())throw new U0({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:mt});if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return nb(n,s,e,t,r);if(n.isSymbolicLink())return db(s,e,t);throw n.isSocket()?new M0({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:mt}):n.isFIFO()?new D0({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:mt}):new q0({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:mt})}o(Ni,"getStatsForCopy");function nb(s,e,t,r,i){return e?ob(s,t,r,i):bd(s,t,r,i)}o(nb,"onFile");async function ob(s,e,t,r){if(r.force)return await yd(t),bd(s,e,t,r);if(r.errorOnExist)throw new k0({message:`${t} already exists`,path:t,syscall:"cp",errno:H0})}o(ob,"mayCopyFile");async function bd(s,e,t,r){return await W0(e,t),r.preserveTimestamps?ab(s.mode,e,t):Pi(t,s.mode)}o(bd,"_copyFile");async function ab(s,e,t){return cb(s)&&await hb(t,s),pd(s,e,t)}o(ab,"handleTimestampsAndMode");function cb(s){return(s&128)===0}o(cb,"fileIsNotWritable");function hb(s,e){return Pi(s,e|128)}o(hb,"makeFileWritable");async function pd(s,e,t){return await ub(e,t),Pi(t,s)}o(pd,"setDestTimestampsAndMode");function Pi(s,e){return V0(s,e)}o(Pi,"setDestMode");async function ub(s,e){let t=await ws(s);return K0(e,t.atime,t.mtime)}o(ub,"setDestTimestamps");function lb(s,e,t,r,i){return e?Rd(t,r,i):fb(s.mode,t,r,i)}o(lb,"onDir");async function fb(s,e,t,r){return await gd(t),await Rd(e,t,r),Pi(t,s)}o(fb,"mkDirAndCopy");async function Rd(s,e,t){let r=await Z0(s);for(let i=0;i<r.length;i++){let n=r[i],a=hd(s,n),c=hd(e,n),{destStat:h}=await Ed(a,c,t);await ib(h,a,c,t)}}o(Rd,"copyDir");async function db(s,e,t){let r=await ad(e);if(cd(r)||(r=pr(dr(e),r)),!s)return Fa(r,t);let i;try{i=await ad(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return Fa(r,t);throw a}if(cd(i)||(i=pr(dr(t),i)),Ma(r,i))throw new Bi({message:`cannot copy ${r} to a subdirectory of self ${i}`,path:t,syscall:"cp",errno:mt});if((await ws(e)).isDirectory()&&Ma(i,r))throw new $0({message:`cannot overwrite ${i} with ${r}`,path:t,syscall:"cp",errno:mt});return pb(r,t)}o(db,"onLink");async function pb(s,e){return await yd(e),Fa(s,e)}o(pb,"copyLink");Od.exports=eb});var Td=m((BB,Id)=>{var mb=require("fs/promises"),gb=ga(),yb=nd(),Eb=vd(),wb=yb.satisfies(">=16.7.0"),Sb=o(async(s,e,t)=>{let r=gb(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return wb?mb.cp(s,e,r):Eb(s,e,r)},"cp");Id.exports=Sb});var Ad=m((PB,Cd)=>{var{join:_b,sep:bb}=require("path"),Rb=ga(),{mkdir:Ob,mkdtemp:vb,rm:Ib}=require("fs/promises"),Tb=o(async(s,e,t)=>{let r=Rb(t,{copy:["tmpPrefix"]});await Ob(s,{recursive:!0});let i=await vb(_b(`${s}${bb}`,r.tmpPrefix||"")),n,a;try{a=await e(i)}catch(c){n=c}try{await Ib(i,{force:!0,recursive:!0})}catch{}if(n)throw n;return a},"withTempDir");Cd.exports=Tb});var Pd=m((kB,Nd)=>{var{readdir:xd}=require("fs/promises"),{join:Bd}=require("path"),Cb=o(async s=>{let e=[];for(let t of await xd(s))if(t.startsWith("@"))for(let r of await xd(Bd(s,t)))e.push(Bd(t,r));else e.push(t);return e},"readdirScoped");Nd.exports=Cb});var $d=m((FB,Md)=>{var{dirname:Ld,join:kd,resolve:Dd,relative:Ab,isAbsolute:xb}=require("path"),Ve=require("fs/promises"),Bb=o(async s=>{try{return await Ve.access(s),!0}catch(e){return e.code!=="ENOENT"}},"pathExists"),Fd=o(async(s,e,t={},r=!0,i=[])=>{if(!s||!e)throw new TypeError("`source` and `destination` file required");if(t={overwrite:!0,...t},!t.overwrite&&await Bb(e))throw new Error(`The destination file exists: ${e}`);await Ve.mkdir(Ld(e),{recursive:!0});try{await Ve.rename(s,e)}catch(n){if(n.code==="EXDEV"||n.code==="EPERM"){let a=await Ve.lstat(s);if(a.isDirectory()){let c=await Ve.readdir(s);await Promise.all(c.map(h=>Fd(kd(s,h),kd(e,h),t,!1,i)))}else a.isSymbolicLink()?i.push({source:s,destination:e}):await Ve.copyFile(s,e)}else throw n}r&&(await Promise.all(i.map(async({source:n,destination:a})=>{let c=await Ve.readlink(n);xb(c)&&(c=Dd(a,Ab(n,c)));let h="file";try{h=await Ve.stat(Dd(Ld(n),c)),h.isDirectory()&&(h="junction")}catch{}await Ve.symlink(c,a,h)})),await Ve.rm(s,{recursive:!0,force:!0}))},"moveFile");Md.exports=Fd});var Li=m(($B,qd)=>{"use strict";var Nb=Td(),Pb=Ad(),Lb=Pd(),kb=$d();qd.exports={cp:Nb,withTempDir:Pb,readdirScoped:Lb,moveFile:kb}});var ki={};Oy(ki,{default:()=>Ud,pMapIterable:()=>Db,pMapSkip:()=>mr});async function Ud(s,e,{concurrency:t=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:i}={}){return new Promise((n,a)=>{if(s[Symbol.iterator]===void 0&&s[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof s})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);let c=[],h=[],u=new Map,l=!1,f=!1,d=!1,p=0,y=0,g=s[Symbol.iterator]===void 0?s[Symbol.asyncIterator]():s[Symbol.iterator](),w=o(()=>{T(i.reason)},"signalListener"),S=o(()=>{i?.removeEventListener("abort",w)},"cleanup"),I=o(O=>{n(O),S()},"resolve"),T=o(O=>{l=!0,f=!0,a(O),S()},"reject");i&&(i.aborted&&T(i.reason),i.addEventListener("abort",w,{once:!0}));let _=o(async()=>{if(f)return;let O=await g.next(),A=y;if(y++,O.done){if(d=!0,p===0&&!f){if(!r&&h.length>0){T(new AggregateError(h));return}if(f=!0,u.size===0){I(c);return}let P=[];for(let[z,ue]of c.entries())u.get(z)!==mr&&P.push(ue);I(P)}return}p++,(async()=>{try{let P=await O.value;if(f)return;let z=await e(P,A);z===mr&&u.set(A,z),c[A]=z,p--,await _()}catch(P){if(r)T(P);else{h.push(P),p--;try{await _()}catch(z){T(z)}}}})()},"next");(async()=>{for(let O=0;O<t;O++){try{await _()}catch(A){T(A);break}if(d||l)break}})()})}function Db(s,e,{concurrency:t=Number.POSITIVE_INFINITY,backpressure:r=t}={}){if(s[Symbol.iterator]===void 0&&s[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof s})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);if(!(Number.isSafeInteger(r)&&r>=t||r===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${t}) and up or \`Infinity\`, got \`${r}\` (${typeof r})`);return{async*[Symbol.asyncIterator](){let i=s[Symbol.asyncIterator]===void 0?s[Symbol.iterator]():s[Symbol.asyncIterator](),n=[],a=0,c=!1,h=0;function u(){if(c||!(a<t&&n.length<r))return;let l=(async()=>{let{done:f,value:d}=await i.next();if(f)return{done:!0};a++,u();try{let p=await e(await d,h++);if(a--,p===mr){let y=n.indexOf(l);y>0&&n.splice(y,1)}return u(),{done:!1,value:p}}catch(p){return c=!0,{error:p}}})();n.push(l)}for(o(u,"trySpawn"),u();n.length>0;){let{error:l,done:f,value:d}=await n[0];if(n.shift(),l)throw l;if(f)return;u(),d!==mr&&(yield d)}}}}var mr,Di=Ry(()=>{o(Ud,"pMap");o(Db,"pMapIterable");mr=Symbol("skip")});var Ss=m((jB,_e)=>{"use strict";var Fb=require("crypto"),{appendFile:Mb,mkdir:Ua,readFile:$b,readdir:qb,rm:jd,writeFile:Ub}=require("fs/promises"),{Minipass:jb}=ee(),We=require("path"),Hb=Ot(),zb=fa(),Gb=gs(),Vb=pa(),Wb=da()["cache-version"].index,{moveFile:Zb}=Li(),$a=5;_e.exports.NotFoundError=class extends Error{static{o(this,"NotFoundError")}constructor(e,t){super(`No cache entry for ${t} found in ${e}`),this.code="ENOENT",this.cache=e,this.key=t}};_e.exports.compact=Kb;async function Kb(s,e,t,r={}){let i=gr(s,e),n=await Fi(i),a=[];for(let d=n.length-1;d>=0;--d){let p=n[d];if(p.integrity===null&&!r.validateEntry)break;(!r.validateEntry||r.validateEntry(p)===!0)&&(a.length===0||!a.find(y=>t(y,p)))&&a.unshift(p)}let c=`
|
|
10
|
-
`+a.map(d=>{let p=JSON.stringify(d);return`${
|
|
11
|
-
`),h=o(async()=>{let d=
|
|
12
|
-
${
|
|
13
|
-
`).forEach(t=>{if(!t)return;let r=t.split(" ");if(!r[1]||Mi(r[1])!==r[0])return;let i;try{i=JSON.parse(r[1])}catch{}i&&e.push(i)}),e}o(Qb,"_bucketEntries");_e.exports.bucketDir=ja;function ja(s){return We.join(s,`index-v${Wb}`)}o(ja,"bucketDir");_e.exports.bucketPath=gr;function gr(s,e){let t=Gd(e);return We.join.apply(We,[ja(s)].concat(Vb(t)))}o(gr,"bucketPath");_e.exports.hashKey=Gd;function Gd(s){return Vd(s,"sha256")}o(Gd,"hashKey");_e.exports.hashEntry=Mi;function Mi(s){return Vd(s,"sha1")}o(Mi,"hashEntry");function Vd(s,e){return Fb.createHash(e).update(s).digest("hex")}o(Vd,"hash");function $i(s,e,t){return!e.integrity&&!t?null:{key:e.key,integrity:e.integrity,path:e.integrity?Gb(s,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}}o($i,"formatEntry");function qa(s){return qb(s).catch(e=>{if(e.code==="ENOENT"||e.code==="ENOTDIR")return[];throw e})}o(qa,"readdirOrEmpty")});var bs=m(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.LRUCache=void 0;var eR=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Zd=new Set,Ha=typeof process=="object"&&process?process:{},Kd=o((s,e,t,r)=>{typeof Ha.emitWarning=="function"&&Ha.emitWarning(s,e,t,r)},"emitWarning"),qi=globalThis.AbortController,Wd=globalThis.AbortSignal;if(typeof qi>"u"){Wd=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},qi=class{static{o(this,"AbortController")}constructor(){e()}signal=new Wd;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let s=Ha.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{s&&(s=!1,Kd("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var tR=o(s=>!Zd.has(s),"shouldWarn"),VB=Symbol("type"),vt=o(s=>s&&s===Math.floor(s)&&s>0&&isFinite(s),"isPosInt"),Yd=o(s=>vt(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?_s:null:null,"getUintArray"),_s=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},za=class s{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=Yd(e);if(!t)return[];s.#e=!0;let r=new s(e,t);return s.#e=!1,r}constructor(e,t){if(!s.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Ga=class s{static{o(this,"LRUCache")}#e;#t;#s;#r;#i;#a;#l;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#p;#d;#h;#n;#g;#_;#S;#y;#C;#E;#R;#I;#w;#b;#T;#m;#o;static unsafeExposeInternals(e){return{starts:e.#I,ttls:e.#w,sizes:e.#R,keyMap:e.#d,keyList:e.#h,valList:e.#n,next:e.#g,prev:e.#_,get head(){return e.#S},get tail(){return e.#y},free:e.#C,isBackgroundFetch:o(t=>e.#u(t),"isBackgroundFetch"),backgroundFetch:o((t,r,i,n)=>e.#H(t,r,i,n),"backgroundFetch"),moveToTail:o(t=>e.#F(t),"moveToTail"),indexes:o(t=>e.#x(t),"indexes"),rindexes:o(t=>e.#N(t),"rindexes"),isStale:o(t=>e.#v(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#p}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#l}get dispose(){return this.#s}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:h,dispose:u,onInsert:l,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:y=0,maxEntrySize:g=0,sizeCalculation:w,fetchMethod:S,memoMethod:I,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:A,ignoreFetchAbort:P,perf:z}=e;if(z!==void 0&&typeof z?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=z??eR,t!==0&&!vt(t))throw new TypeError("max option must be a nonnegative integer");let ue=t?Yd(t):Array;if(!ue)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=y,this.maxEntrySize=g||this.#t,this.sizeCalculation=w,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(I!==void 0&&typeof I!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#l=I,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=S,this.#T=!!S,this.#d=new Map,this.#h=new Array(t).fill(void 0),this.#n=new Array(t).fill(void 0),this.#g=new ue(t),this.#_=new ue(t),this.#S=0,this.#y=0,this.#C=za.create(t),this.#c=0,this.#p=0,typeof u=="function"&&(this.#s=u),typeof l=="function"&&(this.#r=l),typeof f=="function"?(this.#i=f,this.#E=[]):(this.#i=void 0,this.#E=void 0),this.#b=!!this.#s,this.#o=!!this.#r,this.#m=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#t!==0&&!vt(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!vt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#M()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=vt(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!vt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let tt="LRU_CACHE_UNBOUNDED";tR(tt)&&(Zd.add(tt),Kd("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",tt,s))}}getRemainingTTL(e){return this.#d.has(e)?1/0:0}#P(){let e=new _s(this.#e),t=new _s(this.#e);this.#w=e,this.#I=t,this.#U=(n,a,c=this.#f.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#v(n)&&this.#B(this.#h[n],"expire")},a+1);h.unref&&h.unref()}},this.#A=n=>{t[n]=e[n]!==0?this.#f.now():0},this.#O=(n,a)=>{if(e[a]){let c=e[a],h=t[a];if(!c||!h)return;n.ttl=c,n.start=h,n.now=r||i();let u=n.now-h;n.remainingTTL=c-u}};let r=0,i=o(()=>{let n=this.#f.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#d.get(n);if(a===void 0)return 0;let c=e[a],h=t[a];if(!c||!h)return 1/0;let u=(r||i())-h;return c-u},this.#v=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||i())-a>c}}#A=o(()=>{},"#updateItemAge");#O=o(()=>{},"#statusTTL");#U=o(()=>{},"#setItemTTL");#v=o(()=>!1,"#isStale");#M(){let e=new _s(this.#e);this.#p=0,this.#R=e,this.#L=t=>{this.#p-=e[t],e[t]=0},this.#k=(t,r,i,n)=>{if(this.#u(r))return 0;if(!vt(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(r,t),!vt(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#$=(t,r,i)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#p>n;)this.#D(!0)}this.#p+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#p)}}#L=o(e=>{},"#removeItemSize");#$=o((e,t,r)=>{},"#addItemSize");#k=o((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#x({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;!(!this.#j(t)||((e||!this.#v(t))&&(yield t),t===this.#S));)t=this.#_[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;!(!this.#j(t)||((e||!this.#v(t))&&(yield t),t===this.#y));)t=this.#g[t]}#j(e){return e!==void 0&&this.#d.get(this.#h[e])===e}*entries(){for(let e of this.#x())this.#n[e]!==void 0&&this.#h[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#h[e],this.#n[e]])}*rentries(){for(let e of this.#N())this.#n[e]!==void 0&&this.#h[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#h[e],this.#n[e]])}*keys(){for(let e of this.#x()){let t=this.#h[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#h[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*values(){for(let e of this.#x())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#N())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#x()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;if(n!==void 0&&e(n,this.#h[r],this))return this.get(this.#h[r],t)}}forEach(e,t=this){for(let r of this.#x()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#h[r],this)}}rforEach(e,t=this){for(let r of this.#N()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#h[r],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#v(t)&&(this.#B(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#d.get(e);if(t===void 0)return;let r=this.#n[t],i=this.#u(r)?r.__staleWhileFetching:r;if(i===void 0)return;let n={value:i};if(this.#w&&this.#I){let a=this.#w[t],c=this.#I[t];if(a&&c){let h=a-(this.#f.now()-c);n.ttl=h,n.start=Date.now()}}return this.#R&&(n.size=this.#R[t]),n}dump(){let e=[];for(let t of this.#x({allowStale:!0})){let r=this.#h[t],i=this.#n[t],n=this.#u(i)?i.__staleWhileFetching:i;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#w&&this.#I){a.ttl=this.#w[t];let c=this.#f.now()-this.#I[t];a.start=Math.floor(Date.now()-c)}this.#R&&(a.size=this.#R[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=this.#f.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:h}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,l=this.#k(e,t,r.size||0,c);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#B(e,"set"),this;let f=this.#c===0?void 0:this.#d.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#C.length!==0?this.#C.pop():this.#c===this.#e?this.#D(!1):this.#c,this.#h[f]=e,this.#n[f]=t,this.#d.set(e,f),this.#g[this.#y]=f,this.#_[f]=this.#y,this.#y=f,this.#c++,this.#$(f,l,h),h&&(h.set="add"),u=!1,this.#o&&this.#r?.(t,e,"add");else{this.#F(f);let d=this.#n[f];if(t!==d){if(this.#T&&this.#u(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!a&&(this.#b&&this.#s?.(p,e,"set"),this.#m&&this.#E?.push([p,e,"set"]))}else a||(this.#b&&this.#s?.(d,e,"set"),this.#m&&this.#E?.push([d,e,"set"]));if(this.#L(f),this.#$(f,l,h),this.#n[f]=t,h){h.set="replace";let p=d&&this.#u(d)?d.__staleWhileFetching:d;p!==void 0&&(h.oldValue=p)}}else h&&(h.set="update");this.#o&&this.onInsert?.(t,e,t===d?"update":"replace")}if(i!==0&&!this.#w&&this.#P(),this.#w&&(u||this.#U(f,i,n),h&&this.#O(h,f)),!a&&this.#m&&this.#E){let d=this.#E,p;for(;p=d?.shift();)this.#i?.(...p)}return this}pop(){try{for(;this.#c;){let e=this.#n[this.#S];if(this.#D(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#m&&this.#E){let e=this.#E,t;for(;t=e?.shift();)this.#i?.(...t)}}}#D(e){let t=this.#S,r=this.#h[t],i=this.#n[t];return this.#T&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#b||this.#m)&&(this.#b&&this.#s?.(i,r,"evict"),this.#m&&this.#E?.push([i,r,"evict"])),this.#L(t),e&&(this.#h[t]=void 0,this.#n[t]=void 0,this.#C.push(t)),this.#c===1?(this.#S=this.#y=0,this.#C.length=0):this.#S=this.#g[t],this.#d.delete(r),this.#c--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,n=this.#d.get(e);if(n!==void 0){let a=this.#n[n];if(this.#u(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#v(n))i&&(i.has="stale",this.#O(i,n));else return r&&this.#A(n),i&&(i.has="hit",this.#O(i,n)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#d.get(e);if(i===void 0||!r&&this.#v(i))return;let n=this.#n[i];return this.#u(n)?n.__staleWhileFetching:n}#H(e,t,r,i){let n=t===void 0?void 0:this.#n[t];if(this.#u(n))return n;let a=new qi,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let h={signal:a.signal,options:r,context:i},u=o((g,w=!1)=>{let{aborted:S}=a.signal,I=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(S&&!w?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,I&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),S&&!I&&!w)return f(a.signal.reason);let T=p,_=this.#n[t];return(_===p||I&&w&&_===void 0)&&(g===void 0?T.__staleWhileFetching!==void 0?this.#n[t]=T.__staleWhileFetching:this.#B(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,h.options))),g},"cb"),l=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:w}=a.signal,S=w&&r.allowStaleOnFetchAbort,I=S||r.allowStaleOnFetchRejection,T=I||r.noDeleteOnFetchRejection,_=p;if(this.#n[t]===p&&(!T||_.__staleWhileFetching===void 0?this.#B(e,"fetch"):S||(this.#n[t]=_.__staleWhileFetching)),I)return r.status&&_.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw g},"fetchFail"),d=o((g,w)=>{let S=this.#a?.(e,n,h);S&&S instanceof Promise&&S.then(I=>g(I===void 0?void 0:I),w),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(I=>u(I,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,l),y=Object.assign(p,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...h.options,status:void 0}),t=this.#d.get(e)):this.#n[t]=y,y}#u(e){if(!this.#T)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof qi}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:h=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:w=!1,status:S,signal:I}=t;if(!this.#T)return S&&(S.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:S});let T={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:h,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:S,signal:I},_=this.#d.get(e);if(_===void 0){S&&(S.fetch="miss");let O=this.#H(e,_,T,g);return O.__returned=O}else{let O=this.#n[_];if(this.#u(O)){let tt=r&&O.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",tt&&(S.returnedStale=!0)),tt?O.__staleWhileFetching:O.__returned=O}let A=this.#v(_);if(!w&&!A)return S&&(S.fetch="hit"),this.#F(_),i&&this.#A(_),S&&this.#O(S,_),O;let P=this.#H(e,_,T,g),ue=P.__staleWhileFetching!==void 0&&r;return S&&(S.fetch=A?"stale":"refresh",ue&&A&&(S.returnedStale=!0)),ue?P.__staleWhileFetching:P.__returned=P}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#l;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let h=r(e,c,{options:a,context:i});return this.set(e,h,a),h}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#d.get(e);if(c!==void 0){let h=this.#n[c],u=this.#u(h);return a&&this.#O(a,c),this.#v(c)?(a&&(a.get="stale"),u?(a&&r&&h.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?h.__staleWhileFetching:void 0):(n||this.#B(e,"expire"),a&&r&&(a.returnedStale=!0),r?h:void 0)):(a&&(a.get="hit"),u?h.__staleWhileFetching:(this.#F(c),i&&this.#A(c),h))}else a&&(a.get="miss")}#z(e,t){this.#_[t]=e,this.#g[e]=t}#F(e){e!==this.#y&&(e===this.#S?this.#S=this.#g[e]:this.#z(this.#_[e],this.#g[e]),this.#z(this.#y,e),this.#y=e)}delete(e){return this.#B(e,"delete")}#B(e,t){let r=!1;if(this.#c!==0){let i=this.#d.get(e);if(i!==void 0)if(r=!0,this.#c===1)this.#q(t);else{this.#L(i);let n=this.#n[i];if(this.#u(n)?n.__abortController.abort(new Error("deleted")):(this.#b||this.#m)&&(this.#b&&this.#s?.(n,e,t),this.#m&&this.#E?.push([n,e,t])),this.#d.delete(e),this.#h[i]=void 0,this.#n[i]=void 0,i===this.#y)this.#y=this.#_[i];else if(i===this.#S)this.#S=this.#g[i];else{let a=this.#_[i];this.#g[a]=this.#g[i];let c=this.#g[i];this.#_[c]=this.#_[i]}this.#c--,this.#C.push(i)}}if(this.#m&&this.#E?.length){let i=this.#E,n;for(;n=i?.shift();)this.#i?.(...n)}return r}clear(){return this.#q("delete")}#q(e){for(let t of this.#N({allowStale:!0})){let r=this.#n[t];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#h[t];this.#b&&this.#s?.(r,i,e),this.#m&&this.#E?.push([r,i,e])}}if(this.#d.clear(),this.#n.fill(void 0),this.#h.fill(void 0),this.#w&&this.#I&&(this.#w.fill(0),this.#I.fill(0)),this.#R&&this.#R.fill(0),this.#S=0,this.#y=0,this.#C.length=0,this.#p=0,this.#c=0,this.#m&&this.#E){let t=this.#E,r;for(;r=t?.shift();)this.#i?.(...r)}}};Ui.LRUCache=Ga});var yr=m((KB,Rs)=>{"use strict";var{LRUCache:sR}=bs(),ji=new sR({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:o((s,e)=>e.startsWith("key:")?s.data.length:s.length,"sizeCalculation")});Rs.exports.clearMemoized=rR;function rR(){let s={};return ji.forEach((e,t)=>{s[t]=e}),ji.clear(),s}o(rR,"clearMemoized");Rs.exports.put=iR;function iR(s,e,t,r){Hi(r).set(`key:${s}:${e.key}`,{entry:e,data:t}),Xd(s,e.integrity,t,r)}o(iR,"put");Rs.exports.put.byDigest=Xd;function Xd(s,e,t,r){Hi(r).set(`digest:${s}:${e}`,t)}o(Xd,"putDigest");Rs.exports.get=nR;function nR(s,e,t){return Hi(t).get(`key:${s}:${e}`)}o(nR,"get");Rs.exports.get.byDigest=oR;function oR(s,e,t){return Hi(t).get(`digest:${s}:${e}`)}o(oR,"getDigest");var Va=class{static{o(this,"ObjProxy")}constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function Hi(s){return!s||!s.memoize?ji:s.memoize.get&&s.memoize.set?s.memoize:typeof s.memoize=="object"?new Va(s.memoize):ji}o(Hi,"pickMem")});var Xi=m(wr=>{"use strict";var{Minipass:aR}=ee(),cR=require("events").EventEmitter,de=require("fs"),hR=de.writev,Cs=Symbol("_autoClose"),Fe=Symbol("_close"),Er=Symbol("_ended"),D=Symbol("_fd"),Jd=Symbol("_finished"),Tt=Symbol("_flags"),Wa=Symbol("_flush"),Ka=Symbol("_handleChunk"),Ya=Symbol("_makeBuf"),Zi=Symbol("_mode"),zi=Symbol("_needDrain"),Is=Symbol("_onerror"),As=Symbol("_onopen"),Za=Symbol("_onread"),Os=Symbol("_onwrite"),Ct=Symbol("_open"),gt=Symbol("_path"),Gt=Symbol("_pos"),Ze=Symbol("_queue"),vs=Symbol("_read"),Qd=Symbol("_readSize"),It=Symbol("_reading"),Gi=Symbol("_remain"),ep=Symbol("_size"),Vi=Symbol("_write"),zt=Symbol("_writing"),Wi=Symbol("_defaultFlag"),Ts=Symbol("_errored"),Ki=class extends aR{static{o(this,"ReadStream")}constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Ts]=!1,this[D]=typeof t.fd=="number"?t.fd:null,this[gt]=e,this[Qd]=t.readSize||16*1024*1024,this[It]=!1,this[ep]=typeof t.size=="number"?t.size:1/0,this[Gi]=this[ep],this[Cs]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[D]=="number"?this[vs]():this[Ct]()}get fd(){return this[D]}get path(){return this[gt]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ct](){de.open(this[gt],"r",(e,t)=>this[As](e,t))}[As](e,t){e?this[Is](e):(this[D]=t,this.emit("open",t),this[vs]())}[Ya](){return Buffer.allocUnsafe(Math.min(this[Qd],this[Gi]))}[vs](){if(!this[It]){this[It]=!0;let e=this[Ya]();if(e.length===0)return process.nextTick(()=>this[Za](null,0,e));de.read(this[D],e,0,e.length,null,(t,r,i)=>this[Za](t,r,i))}}[Za](e,t,r){this[It]=!1,e?this[Is](e):this[Ka](t,r)&&this[vs]()}[Fe](){if(this[Cs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,de.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Is](e){this[It]=!0,this[Fe](),this.emit("error",e)}[Ka](e,t){let r=!1;return this[Gi]-=e,e>0&&(r=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Gi]<=0)&&(r=!1,this[Fe](),super.end()),r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[D]=="number"&&this[vs]();break;case"error":return this[Ts]?void 0:(this[Ts]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Xa=class extends Ki{static{o(this,"ReadStreamSync")}[Ct](){let e=!0;try{this[As](null,de.openSync(this[gt],"r")),e=!1}finally{e&&this[Fe]()}}[vs](){let e=!0;try{if(!this[It]){this[It]=!0;do{let t=this[Ya](),r=t.length===0?0:de.readSync(this[D],t,0,t.length,null);if(!this[Ka](r,t))break}while(!0);this[It]=!1}e=!1}finally{e&&this[Fe]()}}[Fe](){if(this[Cs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,de.closeSync(e),this.emit("close")}}},Yi=class extends cR{static{o(this,"WriteStream")}constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Ts]=!1,this[zt]=!1,this[Er]=!1,this[zi]=!1,this[Ze]=[],this[gt]=e,this[D]=typeof t.fd=="number"?t.fd:null,this[Zi]=t.mode===void 0?438:t.mode,this[Gt]=typeof t.start=="number"?t.start:null,this[Cs]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Gt]!==null?"r+":"w";this[Wi]=t.flags===void 0,this[Tt]=this[Wi]?r:t.flags,this[D]===null&&this[Ct]()}emit(e,t){if(e==="error"){if(this[Ts])return;this[Ts]=!0}return super.emit(e,t)}get fd(){return this[D]}get path(){return this[gt]}[Is](e){this[Fe](),this[zt]=!0,this.emit("error",e)}[Ct](){de.open(this[gt],this[Tt],this[Zi],(e,t)=>this[As](e,t))}[As](e,t){this[Wi]&&this[Tt]==="r+"&&e&&e.code==="ENOENT"?(this[Tt]="w",this[Ct]()):e?this[Is](e):(this[D]=t,this.emit("open",t),this[zt]||this[Wa]())}end(e,t){return e&&this.write(e,t),this[Er]=!0,!this[zt]&&!this[Ze].length&&typeof this[D]=="number"&&this[Os](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Er]?(this.emit("error",new Error("write() after end()")),!1):this[D]===null||this[zt]||this[Ze].length?(this[Ze].push(e),this[zi]=!0,!1):(this[zt]=!0,this[Vi](e),!0)}[Vi](e){de.write(this[D],e,0,e.length,this[Gt],(t,r)=>this[Os](t,r))}[Os](e,t){e?this[Is](e):(this[Gt]!==null&&(this[Gt]+=t),this[Ze].length?this[Wa]():(this[zt]=!1,this[Er]&&!this[Jd]?(this[Jd]=!0,this[Fe](),this.emit("finish")):this[zi]&&(this[zi]=!1,this.emit("drain"))))}[Wa](){if(this[Ze].length===0)this[Er]&&this[Os](null,0);else if(this[Ze].length===1)this[Vi](this[Ze].pop());else{let e=this[Ze];this[Ze]=[],hR(this[D],e,this[Gt],(t,r)=>this[Os](t,r))}}[Fe](){if(this[Cs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,de.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Ja=class extends Yi{static{o(this,"WriteStreamSync")}[Ct](){let e;if(this[Wi]&&this[Tt]==="r+")try{e=de.openSync(this[gt],this[Tt],this[Zi])}catch(t){if(t.code==="ENOENT")return this[Tt]="w",this[Ct]();throw t}else e=de.openSync(this[gt],this[Tt],this[Zi]);this[As](null,e)}[Fe](){if(this[Cs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,de.closeSync(e),this.emit("close")}}[Vi](e){let t=!0;try{this[Os](null,de.writeSync(this[D],e,0,e.length,this[Gt])),t=!1}finally{if(t)try{this[Fe]()}catch{}}}};wr.ReadStream=Ki;wr.ReadStreamSync=Xa;wr.WriteStream=Yi;wr.WriteStreamSync=Ja});var ec=m((QB,xs)=>{"use strict";var Sr=require("fs/promises"),uR=Xi(),Qa=Ot(),lR=gs(),tp=ms();xs.exports=fR;var sp=64*1024*1024;async function fR(s,e,t={}){let{size:r}=t,{stat:i,cpath:n,sri:a}=await _r(s,e,async(h,u)=>({stat:r?{size:r}:await Sr.stat(h),cpath:h,sri:u}));if(i.size>sp)return rp(n,i.size,a,new tp).concat();let c=await Sr.readFile(n,{encoding:null});if(i.size!==c.length)throw mR(i.size,c.length);if(!Qa.checkData(c,a))throw gR(a,n);return c}o(fR,"read");var rp=o((s,e,t,r)=>(r.push(new uR.ReadStream(s,{size:e,readSize:sp}),Qa.integrityStream({integrity:t,size:e})),r),"readPipeline");xs.exports.stream=ip;xs.exports.readStream=ip;function ip(s,e,t={}){let{size:r}=t,i=new tp;return Promise.resolve().then(async()=>{let{stat:n,cpath:a,sri:c}=await _r(s,e,async(h,u)=>({stat:r?{size:r}:await Sr.stat(h),cpath:h,sri:u}));return rp(a,n.size,c,i)}).catch(n=>i.emit("error",n)),i}o(ip,"readStream");xs.exports.copy=dR;function dR(s,e,t){return _r(s,e,r=>Sr.copyFile(r,t))}o(dR,"copy");xs.exports.hasContent=pR;async function pR(s,e){if(!e)return!1;try{return await _r(s,e,async(t,r)=>{let i=await Sr.stat(t);return{size:i.size,sri:r,stat:i}})}catch(t){if(t.code==="ENOENT")return!1;if(t.code==="EPERM"){if(process.platform!=="win32")throw t;return!1}}}o(pR,"hasContent");async function _r(s,e,t){let r=Qa.parse(e),i=r.pickAlgorithm(),n=r[i];if(n.length<=1){let a=lR(s,n[0]);return t(a,n[0])}else{let a=await Promise.all(n.map(async u=>{try{return await _r(s,u,t)}catch(l){return l.code==="ENOENT"?Object.assign(new Error("No matching content found for "+r.toString()),{code:"ENOENT"}):l}})),c=a.find(u=>!(u instanceof Error));if(c)return c;let h=a.find(u=>u.code==="ENOENT");throw h||a.find(u=>u instanceof Error)}}o(_r,"withContentSri");function mR(s,e){let t=new Error(`Bad data size: expected inserted data to be ${s} bytes, but got ${e} instead`);return t.expected=s,t.found=e,t.code="EBADSIZE",t}o(mR,"sizeError");function gR(s,e){let t=new Error(`Integrity verification failed for ${s} (${e})`);return t.code="EINTEGRITY",t.sri=s,t.path=e,t}o(gR,"integrityError")});var cp=m((tN,Et)=>{"use strict";var np=na(),{Minipass:op}=ee(),ap=ms(),Vt=Ss(),yt=yr(),Wt=ec();async function yR(s,e,t={}){let{integrity:r,memoize:i,size:n}=t,a=yt.get(s,e,t);if(a&&i!==!1)return{metadata:a.entry.metadata,data:a.data,integrity:a.entry.integrity,size:a.entry.size};let c=await Vt.find(s,e,t);if(!c)throw new Vt.NotFoundError(s,e);let h=await Wt(s,c.integrity,{integrity:r,size:n});return i&&yt.put(s,c,h,t),{data:h,metadata:c.metadata,size:c.size,integrity:c.integrity}}o(yR,"getData");Et.exports=yR;async function ER(s,e,t={}){let{integrity:r,memoize:i,size:n}=t,a=yt.get.byDigest(s,e,t);if(a&&i!==!1)return a;let c=await Wt(s,e,{integrity:r,size:n});return i&&yt.put.byDigest(s,e,c,t),c}o(ER,"getDataByDigest");Et.exports.byDigest=ER;var wR=o(s=>{let e=new op;return e.on("newListener",function(t,r){t==="metadata"&&r(s.entry.metadata),t==="integrity"&&r(s.entry.integrity),t==="size"&&r(s.entry.size)}),e.end(s.data),e},"getMemoizedStream");function SR(s,e,t={}){let{memoize:r,size:i}=t,n=yt.get(s,e,t);if(n&&r!==!1)return wR(n);let a=new ap;return Promise.resolve().then(async()=>{let c=await Vt.find(s,e);if(!c)throw new Vt.NotFoundError(s,e);a.emit("metadata",c.metadata),a.emit("integrity",c.integrity),a.emit("size",c.size),a.on("newListener",function(u,l){u==="metadata"&&l(c.metadata),u==="integrity"&&l(c.integrity),u==="size"&&l(c.size)});let h=Wt.readStream(s,c.integrity,{...t,size:typeof i!="number"?c.size:i});if(r){let u=new np.PassThrough;u.on("collect",l=>yt.put(s,c,l,t)),a.unshift(u)}return a.unshift(h),a}).catch(c=>a.emit("error",c)),a}o(SR,"getStream");Et.exports.stream=SR;function _R(s,e,t={}){let{memoize:r}=t,i=yt.get.byDigest(s,e,t);if(i&&r!==!1){let n=new op;return n.end(i),n}else{let n=Wt.readStream(s,e,t);if(!r)return n;let a=new np.PassThrough;return a.on("collect",c=>yt.put.byDigest(s,e,c,t)),new ap(n,a)}}o(_R,"getStreamDigest");Et.exports.stream.byDigest=_R;function bR(s,e,t={}){let{memoize:r}=t,i=yt.get(s,e,t);return i&&r!==!1?Promise.resolve(i.entry):Vt.find(s,e)}o(bR,"info");Et.exports.info=bR;async function RR(s,e,t,r={}){let i=await Vt.find(s,e,r);if(!i)throw new Vt.NotFoundError(s,e);return await Wt.copy(s,i.integrity,t,r),{metadata:i.metadata,size:i.size,integrity:i.integrity}}o(RR,"copy");Et.exports.copy=RR;async function OR(s,e,t,r={}){return await Wt.copy(s,e,t,r),e}o(OR,"copyByDigest");Et.exports.copy.byDigest=OR;Et.exports.hasContent=Wt.hasContent});var dp=m((rN,ic)=>{"use strict";var hp=require("events"),vR=gs(),Rr=require("fs/promises"),{moveFile:IR}=Li(),{Minipass:TR}=ee(),up=ms(),CR=yi(),tc=require("path"),sc=Ot(),AR=fa(),xR=Xi();ic.exports=BR;var br=new Map;async function BR(s,e,t={}){let{algorithms:r,size:i,integrity:n}=t;if(typeof i=="number"&&e.length!==i)throw kR(i,e.length);let a=sc.fromData(e,r?{algorithms:r}:{});if(n&&!sc.checkData(e,n,t))throw DR(n,a);for(let c in a){let h=await lp(s,t),u=a[c].toString();try{await Rr.writeFile(h.target,e,{flag:"wx"}),await fp(h,s,u,t)}finally{h.moved||await Rr.rm(h.target,{recursive:!0,force:!0})}}return{integrity:a,size:e.length}}o(BR,"write");ic.exports.stream=NR;var rc=class extends CR{static{o(this,"CacacheWriteStream")}constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new TR,this.inputStream.on("error",r=>this.emit("error",r)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(e,t,r){return this.handleContentP||(this.handleContentP=PR(this.inputStream,this.cache,this.opts),this.handleContentP.catch(i=>this.emit("error",i))),this.inputStream.write(e,t,r)}flush(e){this.inputStream.end(()=>{if(!this.handleContentP){let t=new Error("Cache input stream was empty");return t.code="ENODATA",Promise.reject(t).catch(e)}this.handleContentP.then(t=>{t.integrity&&this.emit("integrity",t.integrity),t.size!==null&&this.emit("size",t.size),e()},t=>e(t))})}};function NR(s,e={}){return new rc(s,e)}o(NR,"writeStream");async function PR(s,e,t){let r=await lp(e,t);try{let i=await LR(s,e,r.target,t);return await fp(r,e,i.integrity,t),i}finally{r.moved||await Rr.rm(r.target,{recursive:!0,force:!0})}}o(PR,"handleContent");async function LR(s,e,t,r){let i=new xR.WriteStream(t,{flags:"wx"});if(r.integrityEmitter){let[u,l]=await Promise.all([hp.once(r.integrityEmitter,"integrity").then(f=>f[0]),hp.once(r.integrityEmitter,"size").then(f=>f[0]),new up(s,i).promise()]);return{integrity:u,size:l}}let n,a,c=sc.integrityStream({integrity:r.integrity,algorithms:r.algorithms,size:r.size});return c.on("integrity",u=>{n=u}),c.on("size",u=>{a=u}),await new up(s,c,i).promise(),{integrity:n,size:a}}o(LR,"pipeToTmp");async function lp(s,e){let t=AR(tc.join(s,"tmp"),e.tmpPrefix);return await Rr.mkdir(tc.dirname(t),{recursive:!0}),{target:t,moved:!1}}o(lp,"makeTmp");async function fp(s,e,t){let r=vR(e,t),i=tc.dirname(r);return br.has(r)||br.set(r,Rr.mkdir(i,{recursive:!0}).then(async()=>(await IR(s.target,r,{overwrite:!1}),s.moved=!0,s.moved)).catch(n=>{if(!n.message.startsWith("The destination file exists"))throw Object.assign(n,{code:"EEXIST"})}).finally(()=>{br.delete(r)})),br.get(r)}o(fp,"moveToDestination");function kR(s,e){let t=new Error(`Bad data size: expected inserted data to be ${s} bytes, but got ${e} instead`);return t.expected=s,t.found=e,t.code="EBADSIZE",t}o(kR,"sizeError");function DR(s,e){let t=new Error(`Integrity check failed:
|
|
9
|
+
Found: ${s.length}`);throw c.code="EBADSIZE",c.found=s.length,c.expected=t.size,c.sri=e,c}else{let c=new Error(`Integrity checksum failed when using ${r}: Wanted ${e}, but got ${n}. (${s.length} bytes)`);throw c.code="EINTEGRITY",c.found=n,c.expected=e,c.algorithm=r,c.sri=e,c}}o(HE,"checkData");qe.exports.checkStream=zE;function zE(s,e,t){if(t=t||Object.create(null),t.integrity=e,e=me(e,t),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let r=Fo(t);return new Promise((i,n)=>{s.pipe(r),s.on("error",n),r.on("error",n);let a;r.on("verified",c=>{a=c}),r.on("end",()=>i(a)),r.resume()})}o(zE,"checkStream");qe.exports.integrityStream=Fo;function Fo(s=Object.create(null)){return new Mo(s)}o(Fo,"integrityStream");qe.exports.create=GE;function GE(s){let e=s?.algorithms||[...$o],t=Ys(s?.options),r=e.map(Ks.createHash);return{update:o(function(i,n){return r.forEach(a=>a.update(i,n)),this},"update"),digest:o(function(){return e.reduce((n,a)=>{let c=r.shift().digest("base64"),h=new ht(`${a}-${c}${t}`,s);if(h.algorithm&&h.digest){let u=h.algorithm;n[u]||(n[u]=[]),n[u].push(h)}return n},new Dt)},"digest")}}o(GE,"createIntegrity");var VE=Ks.getHashes(),Tu=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(s=>VE.includes(s));function WE(s,e){return Tu.indexOf(s.toLowerCase())>=Tu.indexOf(e.toLowerCase())?s:e}o(WE,"getPrioritizedHash")});var Uo=m((Bx,Nu)=>{var Au=nu(),xu=Iu(),ZE=St(),Cu={shared:!1,ignoreCargoCult:!0},KE={status:200,headers:{}},os=o(s=>{let e={method:s.method,url:s.url,headers:{},compress:s.compress};return s.headers.forEach((t,r)=>{e.headers[r]=t}),e},"requestObject"),Bu=o(s=>{let e={status:s.status,headers:{}};return s.headers.forEach((t,r)=>{e.headers[r]=t}),e},"responseObject"),qo=class{static{o(this,"CachePolicy")}constructor({entry:e,request:t,response:r,options:i}){this.entry=e,this.request=os(t),this.response=Bu(r),this.options=i,this.policy=new Au(this.request,this.response,Cu),this.entry&&(this.policy._responseTime=this.entry.metadata.time)}static storable(e,t){return!t.cachePath||t.cache==="no-store"||!["GET","HEAD"].includes(e.method)?!1:new Au(os(e),KE,Cu).storable()}satisfies(e){let t=os(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let r=new xu(this.request),i=new xu(t);return JSON.stringify(r.mediaTypes())!==JSON.stringify(i.mediaTypes())||JSON.stringify(r.languages())!==JSON.stringify(i.languages())||JSON.stringify(r.encodings())!==JSON.stringify(i.encodings())?!1:this.options.integrity?ZE.parse(this.options.integrity).match(this.entry.integrity):!0}storable(){return this.policy.storable()}get mustRevalidate(){return!!this.policy._rescc["must-revalidate"]}needsRevalidation(e){let t=os(e);return t.method="GET",!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=os(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let r=os(e),i=Bu(t);return!this.policy.revalidatedPolicy(r,i).modified}};Nu.exports=qo});var Lu=m((Px,Pu)=>{var jo=class extends Error{static{o(this,"NotCachedError")}constructor(e){super(`request to ${e} failed: cache mode is 'only-if-cached' but no cached response is available.`),this.code="ENOTCACHED"}};Pu.exports={NotCachedError:jo}});var hi=m((kx,$u)=>{var YE=Qr(),ku=Symbol("_flush"),Du=Symbol("_flushed"),Mu=Symbol("_flushing"),Ho=class extends YE{static{o(this,"Flush")}constructor(e={}){if(typeof e=="function"&&(e={flush:e}),super(e),typeof e.flush!="function"&&typeof this.flush!="function")throw new TypeError("must provide flush function in options");this[ku]=e.flush||this.flush}emit(e,...t){if(e!=="end"&&e!=="finish"||this[Du])return super.emit(e,...t);if(this[Mu])return;this[Mu]=!0;let r=o(n=>{this[Du]=!0,n?super.emit("error",n):super.emit("end")},"afterFlush"),i=this[ku](r);i&&i.then&&i.then(()=>r(),n=>r(n))}};$u.exports=Ho});var Wo=m((Mx,Vo)=>{var{Minipass:Fu}=J(),as=Symbol("_data"),cs=Symbol("_length"),zo=class extends Fu{static{o(this,"Collect")}constructor(e){super(e),this[as]=[],this[cs]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[as].push(i),this[cs]+=i.length,r&&r(),!0}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let i=Buffer.concat(this[as],this[cs]);return super.write(i),super.end(r)}};Vo.exports=zo;var Go=class extends Fu{static{o(this,"CollectPassThrough")}constructor(e){super(e),this[as]=[],this[cs]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[as].push(i),this[cs]+=i.length,super.write(e,t,r)}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let i=Buffer.concat(this[as],this[cs]);return this.emit("collect",i),super.end(r)}};Vo.exports.PassThrough=Go});var hs=m((Fx,Hu)=>{var XE=Qr(),JE=require("events"),QE=o(s=>s&&s instanceof JE&&(typeof s.pipe=="function"||typeof s.write=="function"&&typeof s.end=="function"),"isStream"),Mt=Symbol("_head"),ge=Symbol("_tail"),Zo=Symbol("_linkStreams"),Ko=Symbol("_setHead"),Yo=Symbol("_setTail"),qu=Symbol("_onError"),Uu=Symbol("_onData"),Xo=Symbol("_onEnd"),ju=Symbol("_onDrain"),ui=Symbol("_streams"),Jo=class extends XE{static{o(this,"Pipeline")}constructor(e,...t){QE(e)&&(t.unshift(e),e={}),super(e),this[ui]=[],t.length&&this.push(...t)}[Zo](e){return e.reduce((t,r)=>(t.on("error",i=>r.emit("error",i)),t.pipe(r),r))}push(...e){this[ui].push(...e),this[ge]&&e.unshift(this[ge]);let t=this[Zo](e);this[Yo](t),this[Mt]||this[Ko](e[0])}unshift(...e){this[ui].unshift(...e),this[Mt]&&e.push(this[Mt]);let t=this[Zo](e);this[Ko](e[0]),this[ge]||this[Yo](t)}destroy(e){return this[ui].forEach(t=>typeof t.destroy=="function"&&t.destroy()),super.destroy(e)}[Yo](e){this[ge]=e,e.on("error",t=>this[qu](e,t)),e.on("data",t=>this[Uu](e,t)),e.on("end",()=>this[Xo](e)),e.on("finish",()=>this[Xo](e))}[qu](e,t){e===this[ge]&&this.emit("error",t)}[Uu](e,t){e===this[ge]&&super.write(t)}[Xo](e){e===this[ge]&&super.end()}pause(){return super.pause(),this[ge]&&this[ge].pause&&this[ge].pause()}emit(e,...t){return e==="resume"&&this[ge]&&this[ge].resume&&this[ge].resume(),super.emit(e,...t)}[Ko](e){this[Mt]=e,e.on("drain",()=>this[ju](e))}[ju](e){e===this[Mt]&&this.emit("drain")}write(e,t,r){return this[Mt].write(e,t,r)&&(this.flowing||this.buffer.length===0)}end(e,t,r){return this[Mt].end(e,t,r),this}};Hu.exports=Jo});var zu=m((Ux,Qo)=>{(function(){var s;function e(t,r){var i=this instanceof e?this:s;if(i.reset(r),typeof t=="string"&&t.length>0&&i.hash(t),i!==this)return i}o(e,"MurmurHash3"),e.prototype.hash=function(t){var r,i,n,a,c;switch(c=t.length,this.len+=c,i=this.k1,n=0,this.rem){case 0:i^=c>n?t.charCodeAt(n++)&65535:0;case 1:i^=c>n?(t.charCodeAt(n++)&65535)<<8:0;case 2:i^=c>n?(t.charCodeAt(n++)&65535)<<16:0;case 3:i^=c>n?(t.charCodeAt(n)&255)<<24:0,i^=c>n?(t.charCodeAt(n++)&65280)>>8:0}if(this.rem=c+this.rem&3,c-=this.rem,c>0){for(r=this.h1;i=i*11601+(i&65535)*3432906752&4294967295,i=i<<15|i>>>17,i=i*13715+(i&65535)*461832192&4294967295,r^=i,r=r<<13|r>>>19,r=r*5+3864292196&4294967295,!(n>=c);)i=t.charCodeAt(n++)&65535^(t.charCodeAt(n++)&65535)<<8^(t.charCodeAt(n++)&65535)<<16,a=t.charCodeAt(n++),i^=(a&255)<<24^(a&65280)>>8;switch(i=0,this.rem){case 3:i^=(t.charCodeAt(n+2)&65535)<<16;case 2:i^=(t.charCodeAt(n+1)&65535)<<8;case 1:i^=t.charCodeAt(n)&65535}this.h1=r}return this.k1=i,this},e.prototype.result=function(){var t,r;return t=this.k1,r=this.h1,t>0&&(t=t*11601+(t&65535)*3432906752&4294967295,t=t<<15|t>>>17,t=t*13715+(t&65535)*461832192&4294967295,r^=t),r^=this.len,r^=r>>>16,r=r*51819+(r&65535)*2246770688&4294967295,r^=r>>>13,r=r*44597+(r&65535)*3266445312&4294967295,r^=r>>>16,r>>>0},e.prototype.reset=function(t){return this.h1=typeof t=="number"?t:0,this.rem=this.k1=this.len=0,this},s=new e,typeof Qo<"u"?Qo.exports=e:this.MurmurHash3=e})()});var Vu=m((Hx,Gu)=>{"use strict";var ew=zu();Gu.exports=function(s){if(s){var e=new ew(s);return("00000000"+e.result().toString(16)).slice(-8)}else return(Math.random().toString(16)+"0000000").slice(2,10)}});var ea=m((zx,Wu)=>{var tw=require("path"),sw=Vu();Wu.exports=function(s,e,t){return tw.join(s,(e?e+"-":"")+sw(t))}});var ta=m((Gx,rw)=>{rw.exports={name:"cacache",version:"20.0.1","cache-version":{content:"2",index:"5"},description:"Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",snap:"tap",coverage:"tap","test-docker":'docker run -it --rm --name pacotest -v "$PWD":/tmp -w /tmp node:latest npm test',lint:"npm run eslint",npmclilint:"npmcli-lint",lintfix:"npm run eslint -- --fix",postsnap:"npm run lintfix --",postlint:"template-oss-check",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},repository:{type:"git",url:"git+https://github.com/npm/cacache.git"},keywords:["cache","caching","content-addressable","sri","sri hash","subresource integrity","cache","storage","store","file store","filesystem","disk cache","disk storage"],license:"ISC",dependencies:{"@npmcli/fs":"^4.0.0","fs-minipass":"^3.0.0",glob:"^11.0.3","lru-cache":"^11.1.0",minipass:"^7.0.3","minipass-collect":"^2.0.1","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4","p-map":"^7.0.2",ssri:"^12.0.0","unique-filename":"^4.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",windowsCI:!1,version:"4.25.0",publish:"true"},author:"GitHub Inc.",tap:{"nyc-arg":["--exclude","tap-snapshots/**"]}}});var sa=m((Vx,Zu)=>{"use strict";Zu.exports=iw;function iw(s){return[s.slice(0,2),s.slice(2,4),s.slice(4)]}o(iw,"hashToSegments")});var us=m((Zx,ra)=>{"use strict";var nw=ta()["cache-version"].content,ow=sa(),Ku=require("path"),aw=St();ra.exports=cw;function cw(s,e){let t=aw.parse(e,{single:!0});return Ku.join(Yu(s),t.algorithm,...ow(t.hexDigest()))}o(cw,"contentPath");ra.exports.contentDir=Yu;function Yu(s){return Ku.join(s,`content-v${nw}`)}o(Yu,"contentDir")});var ia=m((Yx,Xu)=>{var hw=o((s,{copy:e,wrap:t})=>{let r={};if(s&&typeof s=="object")for(let i of e)s[i]!==void 0&&(r[i]=s[i]);else r[t]=s;return r},"getOptions");Xu.exports=hw});var Xs=m((Jx,Ju)=>{"use strict";var uw="2.0.0",lw=Number.MAX_SAFE_INTEGER||9007199254740991,fw=16,dw=250,pw=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Ju.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fw,MAX_SAFE_BUILD_LENGTH:dw,MAX_SAFE_INTEGER:lw,RELEASE_TYPES:pw,SEMVER_SPEC_VERSION:uw,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Js=m((Qx,Qu)=>{"use strict";var mw=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...s)=>{}:()=>{};Qu.exports=mw});var ls=m((Ue,el)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:na,MAX_SAFE_BUILD_LENGTH:gw,MAX_LENGTH:yw}=Xs(),Ew=Js();Ue=el.exports={};var ww=Ue.re=[],Sw=Ue.safeRe=[],_=Ue.src=[],_w=Ue.safeSrc=[],b=Ue.t={},bw=0,oa="[a-zA-Z0-9-]",Rw=[["\\s",1],["\\d",yw],[oa,gw]],Ow=o(s=>{for(let[e,t]of Rw)s=s.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return s},"makeSafeRegex"),A=o((s,e,t)=>{let r=Ow(e),i=bw++;Ew(s,i,e),b[s]=i,_[i]=e,_w[i]=r,ww[i]=new RegExp(e,t?"g":void 0),Sw[i]=new RegExp(r,t?"g":void 0)},"createToken");A("NUMERICIDENTIFIER","0|[1-9]\\d*");A("NUMERICIDENTIFIERLOOSE","\\d+");A("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${oa}*`);A("MAINVERSION",`(${_[b.NUMERICIDENTIFIER]})\\.(${_[b.NUMERICIDENTIFIER]})\\.(${_[b.NUMERICIDENTIFIER]})`);A("MAINVERSIONLOOSE",`(${_[b.NUMERICIDENTIFIERLOOSE]})\\.(${_[b.NUMERICIDENTIFIERLOOSE]})\\.(${_[b.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASEIDENTIFIER",`(?:${_[b.NONNUMERICIDENTIFIER]}|${_[b.NUMERICIDENTIFIER]})`);A("PRERELEASEIDENTIFIERLOOSE",`(?:${_[b.NONNUMERICIDENTIFIER]}|${_[b.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASE",`(?:-(${_[b.PRERELEASEIDENTIFIER]}(?:\\.${_[b.PRERELEASEIDENTIFIER]})*))`);A("PRERELEASELOOSE",`(?:-?(${_[b.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${_[b.PRERELEASEIDENTIFIERLOOSE]})*))`);A("BUILDIDENTIFIER",`${oa}+`);A("BUILD",`(?:\\+(${_[b.BUILDIDENTIFIER]}(?:\\.${_[b.BUILDIDENTIFIER]})*))`);A("FULLPLAIN",`v?${_[b.MAINVERSION]}${_[b.PRERELEASE]}?${_[b.BUILD]}?`);A("FULL",`^${_[b.FULLPLAIN]}$`);A("LOOSEPLAIN",`[v=\\s]*${_[b.MAINVERSIONLOOSE]}${_[b.PRERELEASELOOSE]}?${_[b.BUILD]}?`);A("LOOSE",`^${_[b.LOOSEPLAIN]}$`);A("GTLT","((?:<|>)?=?)");A("XRANGEIDENTIFIERLOOSE",`${_[b.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);A("XRANGEIDENTIFIER",`${_[b.NUMERICIDENTIFIER]}|x|X|\\*`);A("XRANGEPLAIN",`[v=\\s]*(${_[b.XRANGEIDENTIFIER]})(?:\\.(${_[b.XRANGEIDENTIFIER]})(?:\\.(${_[b.XRANGEIDENTIFIER]})(?:${_[b.PRERELEASE]})?${_[b.BUILD]}?)?)?`);A("XRANGEPLAINLOOSE",`[v=\\s]*(${_[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[b.XRANGEIDENTIFIERLOOSE]})(?:${_[b.PRERELEASELOOSE]})?${_[b.BUILD]}?)?)?`);A("XRANGE",`^${_[b.GTLT]}\\s*${_[b.XRANGEPLAIN]}$`);A("XRANGELOOSE",`^${_[b.GTLT]}\\s*${_[b.XRANGEPLAINLOOSE]}$`);A("COERCEPLAIN",`(^|[^\\d])(\\d{1,${na}})(?:\\.(\\d{1,${na}}))?(?:\\.(\\d{1,${na}}))?`);A("COERCE",`${_[b.COERCEPLAIN]}(?:$|[^\\d])`);A("COERCEFULL",_[b.COERCEPLAIN]+`(?:${_[b.PRERELEASE]})?(?:${_[b.BUILD]})?(?:$|[^\\d])`);A("COERCERTL",_[b.COERCE],!0);A("COERCERTLFULL",_[b.COERCEFULL],!0);A("LONETILDE","(?:~>?)");A("TILDETRIM",`(\\s*)${_[b.LONETILDE]}\\s+`,!0);Ue.tildeTrimReplace="$1~";A("TILDE",`^${_[b.LONETILDE]}${_[b.XRANGEPLAIN]}$`);A("TILDELOOSE",`^${_[b.LONETILDE]}${_[b.XRANGEPLAINLOOSE]}$`);A("LONECARET","(?:\\^)");A("CARETTRIM",`(\\s*)${_[b.LONECARET]}\\s+`,!0);Ue.caretTrimReplace="$1^";A("CARET",`^${_[b.LONECARET]}${_[b.XRANGEPLAIN]}$`);A("CARETLOOSE",`^${_[b.LONECARET]}${_[b.XRANGEPLAINLOOSE]}$`);A("COMPARATORLOOSE",`^${_[b.GTLT]}\\s*(${_[b.LOOSEPLAIN]})$|^$`);A("COMPARATOR",`^${_[b.GTLT]}\\s*(${_[b.FULLPLAIN]})$|^$`);A("COMPARATORTRIM",`(\\s*)${_[b.GTLT]}\\s*(${_[b.LOOSEPLAIN]}|${_[b.XRANGEPLAIN]})`,!0);Ue.comparatorTrimReplace="$1$2$3";A("HYPHENRANGE",`^\\s*(${_[b.XRANGEPLAIN]})\\s+-\\s+(${_[b.XRANGEPLAIN]})\\s*$`);A("HYPHENRANGELOOSE",`^\\s*(${_[b.XRANGEPLAINLOOSE]})\\s+-\\s+(${_[b.XRANGEPLAINLOOSE]})\\s*$`);A("STAR","(<|>)?=?\\s*\\*");A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var li=m((tC,tl)=>{"use strict";var Iw=Object.freeze({loose:!0}),vw=Object.freeze({}),Tw=o(s=>s?typeof s!="object"?Iw:s:vw,"parseOptions");tl.exports=Tw});var aa=m((rC,il)=>{"use strict";var sl=/^[0-9]+$/,rl=o((s,e)=>{let t=sl.test(s),r=sl.test(e);return t&&r&&(s=+s,e=+e),s===e?0:t&&!r?-1:r&&!t?1:s<e?-1:1},"compareIdentifiers"),Aw=o((s,e)=>rl(e,s),"rcompareIdentifiers");il.exports={compareIdentifiers:rl,rcompareIdentifiers:Aw}});var te=m((nC,ol)=>{"use strict";var fi=Js(),{MAX_LENGTH:nl,MAX_SAFE_INTEGER:di}=Xs(),{safeRe:pi,t:mi}=ls(),xw=li(),{compareIdentifiers:fs}=aa(),ca=class s{static{o(this,"SemVer")}constructor(e,t){if(t=xw(t),e instanceof s){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>nl)throw new TypeError(`version is longer than ${nl} characters`);fi("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?pi[mi.LOOSE]:pi[mi.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>di||this.major<0)throw new TypeError("Invalid major version");if(this.minor>di||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>di||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<di)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(fi("SemVer.compare",this.version,this.options,e),!(e instanceof s)){if(typeof e=="string"&&e===this.version)return 0;e=new s(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof s||(e=new s(e,this.options)),fs(this.major,e.major)||fs(this.minor,e.minor)||fs(this.patch,e.patch)}comparePre(e){if(e instanceof s||(e=new s(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(fi("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return fs(r,i)}while(++t)}compareBuild(e){e instanceof s||(e=new s(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(fi("build compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return fs(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?pi[mi.PRERELEASELOOSE]:pi[mi.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let n=[t,i];r===!1&&(n=[t]),fs(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};ol.exports=ca});var $t=m((aC,cl)=>{"use strict";var al=te(),Cw=o((s,e,t=!1)=>{if(s instanceof al)return s;try{return new al(s,e)}catch(r){if(!t)return null;throw r}},"parse");cl.exports=Cw});var ul=m((hC,hl)=>{"use strict";var Bw=$t(),Nw=o((s,e)=>{let t=Bw(s,e);return t?t.version:null},"valid");hl.exports=Nw});var fl=m((lC,ll)=>{"use strict";var Pw=$t(),Lw=o((s,e)=>{let t=Pw(s.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");ll.exports=Lw});var ml=m((dC,pl)=>{"use strict";var dl=te(),kw=o((s,e,t,r,i)=>{typeof t=="string"&&(i=r,r=t,t=void 0);try{return new dl(s instanceof dl?s.version:s,t).inc(e,r,i).version}catch{return null}},"inc");pl.exports=kw});var El=m((mC,yl)=>{"use strict";var gl=$t(),Dw=o((s,e)=>{let t=gl(s,null,!0),r=gl(e,null,!0),i=t.compare(r);if(i===0)return null;let n=i>0,a=n?t:r,c=n?r:t,h=!!a.prerelease.length;if(!!c.prerelease.length&&!h){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}let l=h?"pre":"";return t.major!==r.major?l+"major":t.minor!==r.minor?l+"minor":t.patch!==r.patch?l+"patch":"prerelease"},"diff");yl.exports=Dw});var Sl=m((yC,wl)=>{"use strict";var Mw=te(),$w=o((s,e)=>new Mw(s,e).major,"major");wl.exports=$w});var bl=m((wC,_l)=>{"use strict";var Fw=te(),qw=o((s,e)=>new Fw(s,e).minor,"minor");_l.exports=qw});var Ol=m((_C,Rl)=>{"use strict";var Uw=te(),jw=o((s,e)=>new Uw(s,e).patch,"patch");Rl.exports=jw});var vl=m((RC,Il)=>{"use strict";var Hw=$t(),zw=o((s,e)=>{let t=Hw(s,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");Il.exports=zw});var _e=m((IC,Al)=>{"use strict";var Tl=te(),Gw=o((s,e,t)=>new Tl(s,t).compare(new Tl(e,t)),"compare");Al.exports=Gw});var Cl=m((TC,xl)=>{"use strict";var Vw=_e(),Ww=o((s,e,t)=>Vw(e,s,t),"rcompare");xl.exports=Ww});var Nl=m((xC,Bl)=>{"use strict";var Zw=_e(),Kw=o((s,e)=>Zw(s,e,!0),"compareLoose");Bl.exports=Kw});var gi=m((BC,Ll)=>{"use strict";var Pl=te(),Yw=o((s,e,t)=>{let r=new Pl(s,t),i=new Pl(e,t);return r.compare(i)||r.compareBuild(i)},"compareBuild");Ll.exports=Yw});var Dl=m((PC,kl)=>{"use strict";var Xw=gi(),Jw=o((s,e)=>s.sort((t,r)=>Xw(t,r,e)),"sort");kl.exports=Jw});var $l=m((kC,Ml)=>{"use strict";var Qw=gi(),eS=o((s,e)=>s.sort((t,r)=>Qw(r,t,e)),"rsort");Ml.exports=eS});var Qs=m((MC,Fl)=>{"use strict";var tS=_e(),sS=o((s,e,t)=>tS(s,e,t)>0,"gt");Fl.exports=sS});var yi=m((FC,ql)=>{"use strict";var rS=_e(),iS=o((s,e,t)=>rS(s,e,t)<0,"lt");ql.exports=iS});var ha=m((UC,Ul)=>{"use strict";var nS=_e(),oS=o((s,e,t)=>nS(s,e,t)===0,"eq");Ul.exports=oS});var ua=m((HC,jl)=>{"use strict";var aS=_e(),cS=o((s,e,t)=>aS(s,e,t)!==0,"neq");jl.exports=cS});var Ei=m((GC,Hl)=>{"use strict";var hS=_e(),uS=o((s,e,t)=>hS(s,e,t)>=0,"gte");Hl.exports=uS});var wi=m((WC,zl)=>{"use strict";var lS=_e(),fS=o((s,e,t)=>lS(s,e,t)<=0,"lte");zl.exports=fS});var la=m((KC,Gl)=>{"use strict";var dS=ha(),pS=ua(),mS=Qs(),gS=Ei(),yS=yi(),ES=wi(),wS=o((s,e,t,r)=>{switch(e){case"===":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s===t;case"!==":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s!==t;case"":case"=":case"==":return dS(s,t,r);case"!=":return pS(s,t,r);case">":return mS(s,t,r);case">=":return gS(s,t,r);case"<":return yS(s,t,r);case"<=":return ES(s,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");Gl.exports=wS});var Wl=m((XC,Vl)=>{"use strict";var SS=te(),_S=$t(),{safeRe:Si,t:_i}=ls(),bS=o((s,e)=>{if(s instanceof SS)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;e=e||{};let t=null;if(!e.rtl)t=s.match(e.includePrerelease?Si[_i.COERCEFULL]:Si[_i.COERCE]);else{let h=e.includePrerelease?Si[_i.COERCERTLFULL]:Si[_i.COERCERTL],u;for(;(u=h.exec(s))&&(!t||t.index+t[0].length!==s.length);)(!t||u.index+u[0].length!==t.index+t[0].length)&&(t=u),h.lastIndex=u.index+u[1].length+u[2].length;h.lastIndex=-1}if(t===null)return null;let r=t[2],i=t[3]||"0",n=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return _S(`${r}.${i}.${n}${a}${c}`,e)},"coerce");Vl.exports=bS});var Kl=m((QC,Zl)=>{"use strict";var fa=class{static{o(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};Zl.exports=fa});var be=m((tB,Ql)=>{"use strict";var RS=/\s+/g,da=class s{static{o(this,"Range")}constructor(e,t){if(t=IS(t),e instanceof s)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new s(e.raw,t);if(e instanceof pa)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(RS," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!Xl(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&NS(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&CS)|(this.options.loose&&BS))+":"+e,i=Yl.get(r);if(i)return i;let n=this.options.loose,a=n?he[ne.HYPHENRANGELOOSE]:he[ne.HYPHENRANGE];e=e.replace(a,jS(this.options.includePrerelease)),q("hyphen replace",e),e=e.replace(he[ne.COMPARATORTRIM],TS),q("comparator trim",e),e=e.replace(he[ne.TILDETRIM],AS),q("tilde trim",e),e=e.replace(he[ne.CARETTRIM],xS),q("caret trim",e);let c=e.split(" ").map(f=>PS(f,this.options)).join(" ").split(/\s+/).map(f=>US(f,this.options));n&&(c=c.filter(f=>(q("loose invalid filter",f,this.options),!!f.match(he[ne.COMPARATORLOOSE])))),q("range list",c);let h=new Map,u=c.map(f=>new pa(f,this.options));for(let f of u){if(Xl(f))return[f];h.set(f.value,f)}h.size>1&&h.has("")&&h.delete("");let l=[...h.values()];return Yl.set(r,l),l}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Range is required");return this.set.some(r=>Jl(r,t)&&e.set.some(i=>Jl(i,t)&&r.every(n=>i.every(a=>n.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new vS(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(HS(this.set[t],e,this.options))return!0;return!1}};Ql.exports=da;var OS=Kl(),Yl=new OS,IS=li(),pa=er(),q=Js(),vS=te(),{safeRe:he,t:ne,comparatorTrimReplace:TS,tildeTrimReplace:AS,caretTrimReplace:xS}=ls(),{FLAG_INCLUDE_PRERELEASE:CS,FLAG_LOOSE:BS}=Xs(),Xl=o(s=>s.value==="<0.0.0-0","isNullSet"),NS=o(s=>s.value==="","isAny"),Jl=o((s,e)=>{let t=!0,r=s.slice(),i=r.pop();for(;t&&r.length;)t=r.every(n=>i.intersects(n,e)),i=r.pop();return t},"isSatisfiable"),PS=o((s,e)=>(q("comp",s,e),s=DS(s,e),q("caret",s),s=LS(s,e),q("tildes",s),s=$S(s,e),q("xrange",s),s=qS(s,e),q("stars",s),s),"parseComparator"),oe=o(s=>!s||s.toLowerCase()==="x"||s==="*","isX"),LS=o((s,e)=>s.trim().split(/\s+/).map(t=>kS(t,e)).join(" "),"replaceTildes"),kS=o((s,e)=>{let t=e.loose?he[ne.TILDELOOSE]:he[ne.TILDE];return s.replace(t,(r,i,n,a,c)=>{q("tilde",s,r,i,n,a,c);let h;return oe(i)?h="":oe(n)?h=`>=${i}.0.0 <${+i+1}.0.0-0`:oe(a)?h=`>=${i}.${n}.0 <${i}.${+n+1}.0-0`:c?(q("replaceTilde pr",c),h=`>=${i}.${n}.${a}-${c} <${i}.${+n+1}.0-0`):h=`>=${i}.${n}.${a} <${i}.${+n+1}.0-0`,q("tilde return",h),h})},"replaceTilde"),DS=o((s,e)=>s.trim().split(/\s+/).map(t=>MS(t,e)).join(" "),"replaceCarets"),MS=o((s,e)=>{q("caret",s,e);let t=e.loose?he[ne.CARETLOOSE]:he[ne.CARET],r=e.includePrerelease?"-0":"";return s.replace(t,(i,n,a,c,h)=>{q("caret",s,i,n,a,c,h);let u;return oe(n)?u="":oe(a)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:oe(c)?n==="0"?u=`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:h?(q("replaceCaret pr",h),n==="0"?a==="0"?u=`>=${n}.${a}.${c}-${h} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}-${h} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c}-${h} <${+n+1}.0.0-0`):(q("no pr"),n==="0"?a==="0"?u=`>=${n}.${a}.${c}${r} <${n}.${a}.${+c+1}-0`:u=`>=${n}.${a}.${c}${r} <${n}.${+a+1}.0-0`:u=`>=${n}.${a}.${c} <${+n+1}.0.0-0`),q("caret return",u),u})},"replaceCaret"),$S=o((s,e)=>(q("replaceXRanges",s,e),s.split(/\s+/).map(t=>FS(t,e)).join(" ")),"replaceXRanges"),FS=o((s,e)=>{s=s.trim();let t=e.loose?he[ne.XRANGELOOSE]:he[ne.XRANGE];return s.replace(t,(r,i,n,a,c,h)=>{q("xRange",s,r,i,n,a,c,h);let u=oe(n),l=u||oe(a),f=l||oe(c),d=f;return i==="="&&d&&(i=""),h=e.includePrerelease?"-0":"",u?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&d?(l&&(a=0),c=0,i===">"?(i=">=",l?(n=+n+1,a=0,c=0):(a=+a+1,c=0)):i==="<="&&(i="<",l?n=+n+1:a=+a+1),i==="<"&&(h="-0"),r=`${i+n}.${a}.${c}${h}`):l?r=`>=${n}.0.0${h} <${+n+1}.0.0-0`:f&&(r=`>=${n}.${a}.0${h} <${n}.${+a+1}.0-0`),q("xRange return",r),r})},"replaceXRange"),qS=o((s,e)=>(q("replaceStars",s,e),s.trim().replace(he[ne.STAR],"")),"replaceStars"),US=o((s,e)=>(q("replaceGTE0",s,e),s.trim().replace(he[e.includePrerelease?ne.GTE0PRE:ne.GTE0],"")),"replaceGTE0"),jS=o(s=>(e,t,r,i,n,a,c,h,u,l,f,d)=>(oe(r)?t="":oe(i)?t=`>=${r}.0.0${s?"-0":""}`:oe(n)?t=`>=${r}.${i}.0${s?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${s?"-0":""}`,oe(u)?h="":oe(l)?h=`<${+u+1}.0.0-0`:oe(f)?h=`<${u}.${+l+1}.0-0`:d?h=`<=${u}.${l}.${f}-${d}`:s?h=`<${u}.${l}.${+f+1}-0`:h=`<=${h}`,`${t} ${h}`.trim()),"hyphenReplace"),HS=o((s,e,t)=>{for(let r=0;r<s.length;r++)if(!s[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<s.length;r++)if(q(s[r].semver),s[r].semver!==pa.ANY&&s[r].semver.prerelease.length>0){let i=s[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0},"testSet")});var er=m((rB,of)=>{"use strict";var tr=Symbol("SemVer ANY"),ya=class s{static{o(this,"Comparator")}static get ANY(){return tr}constructor(e,t){if(t=ef(t),e instanceof s){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),ga("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===tr?this.value="":this.value=this.operator+this.semver.version,ga("comp",this)}parse(e){let t=this.options.loose?tf[sf.COMPARATORLOOSE]:tf[sf.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new rf(r[2],this.options.loose):this.semver=tr}toString(){return this.value}test(e){if(ga("Comparator.test",e,this.options.loose),this.semver===tr||e===tr)return!0;if(typeof e=="string")try{e=new rf(e,this.options)}catch{return!1}return ma(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new nf(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new nf(this.value,t).test(e.semver):(t=ef(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||ma(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||ma(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};of.exports=ya;var ef=li(),{safeRe:tf,t:sf}=ls(),ma=la(),ga=Js(),rf=te(),nf=be()});var sr=m((nB,af)=>{"use strict";var zS=be(),GS=o((s,e,t)=>{try{e=new zS(e,t)}catch{return!1}return e.test(s)},"satisfies");af.exports=GS});var hf=m((aB,cf)=>{"use strict";var VS=be(),WS=o((s,e)=>new VS(s,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" ")),"toComparators");cf.exports=WS});var lf=m((hB,uf)=>{"use strict";var ZS=te(),KS=be(),YS=o((s,e,t)=>{let r=null,i=null,n=null;try{n=new KS(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===-1)&&(r=a,i=new ZS(r,t))}),r},"maxSatisfying");uf.exports=YS});var df=m((lB,ff)=>{"use strict";var XS=te(),JS=be(),QS=o((s,e,t)=>{let r=null,i=null,n=null;try{n=new JS(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===1)&&(r=a,i=new XS(r,t))}),r},"minSatisfying");ff.exports=QS});var gf=m((dB,mf)=>{"use strict";var Ea=te(),e_=be(),pf=Qs(),t_=o((s,e)=>{s=new e_(s,e);let t=new Ea("0.0.0");if(s.test(t)||(t=new Ea("0.0.0-0"),s.test(t)))return t;t=null;for(let r=0;r<s.set.length;++r){let i=s.set[r],n=null;i.forEach(a=>{let c=new Ea(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!n||pf(c,n))&&(n=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!t||pf(t,n))&&(t=n)}return t&&s.test(t)?t:null},"minVersion");mf.exports=t_});var Ef=m((mB,yf)=>{"use strict";var s_=be(),r_=o((s,e)=>{try{return new s_(s,e).range||"*"}catch{return null}},"validRange");yf.exports=r_});var bi=m((yB,bf)=>{"use strict";var i_=te(),_f=er(),{ANY:n_}=_f,o_=be(),a_=sr(),wf=Qs(),Sf=yi(),c_=wi(),h_=Ei(),u_=o((s,e,t,r)=>{s=new i_(s,r),e=new o_(e,r);let i,n,a,c,h;switch(t){case">":i=wf,n=c_,a=Sf,c=">",h=">=";break;case"<":i=Sf,n=h_,a=wf,c="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a_(s,e,r))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],f=null,d=null;if(l.forEach(p=>{p.semver===n_&&(p=new _f(">=0.0.0")),f=f||p,d=d||p,i(p.semver,f.semver,r)?f=p:a(p.semver,d.semver,r)&&(d=p)}),f.operator===c||f.operator===h||(!d.operator||d.operator===c)&&n(s,d.semver))return!1;if(d.operator===h&&a(s,d.semver))return!1}return!0},"outside");bf.exports=u_});var Of=m((wB,Rf)=>{"use strict";var l_=bi(),f_=o((s,e,t)=>l_(s,e,">",t),"gtr");Rf.exports=f_});var vf=m((_B,If)=>{"use strict";var d_=bi(),p_=o((s,e,t)=>d_(s,e,"<",t),"ltr");If.exports=p_});var xf=m((RB,Af)=>{"use strict";var Tf=be(),m_=o((s,e,t)=>(s=new Tf(s,t),e=new Tf(e,t),s.intersects(e,t)),"intersects");Af.exports=m_});var Bf=m((IB,Cf)=>{"use strict";var g_=sr(),y_=_e();Cf.exports=(s,e,t)=>{let r=[],i=null,n=null,a=s.sort((l,f)=>y_(l,f,t));for(let l of a)g_(l,e,t)?(n=l,i||(i=l)):(n&&r.push([i,n]),n=null,i=null);i&&r.push([i,null]);let c=[];for(let[l,f]of r)l===f?c.push(l):!f&&l===a[0]?c.push("*"):f?l===a[0]?c.push(`<=${f}`):c.push(`${l} - ${f}`):c.push(`>=${l}`);let h=c.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return h.length<u.length?h:e}});var Mf=m((vB,Df)=>{"use strict";var Nf=be(),Sa=er(),{ANY:wa}=Sa,rr=sr(),_a=_e(),E_=o((s,e,t={})=>{if(s===e)return!0;s=new Nf(s,t),e=new Nf(e,t);let r=!1;e:for(let i of s.set){for(let n of e.set){let a=S_(i,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},"subset"),w_=[new Sa(">=0.0.0-0")],Pf=[new Sa(">=0.0.0")],S_=o((s,e,t)=>{if(s===e)return!0;if(s.length===1&&s[0].semver===wa){if(e.length===1&&e[0].semver===wa)return!0;t.includePrerelease?s=w_:s=Pf}if(e.length===1&&e[0].semver===wa){if(t.includePrerelease)return!0;e=Pf}let r=new Set,i,n;for(let p of s)p.operator===">"||p.operator===">="?i=Lf(i,p,t):p.operator==="<"||p.operator==="<="?n=kf(n,p,t):r.add(p.semver);if(r.size>1)return null;let a;if(i&&n){if(a=_a(i.semver,n.semver,t),a>0)return null;if(a===0&&(i.operator!==">="||n.operator!=="<="))return null}for(let p of r){if(i&&!rr(p,String(i),t)||n&&!rr(p,String(n),t))return null;for(let g of e)if(!rr(p,String(g),t))return!1;return!0}let c,h,u,l,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,d=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&n.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let p of e){if(l=l||p.operator===">"||p.operator===">=",u=u||p.operator==="<"||p.operator==="<=",i){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator===">"||p.operator===">="){if(c=Lf(i,p,t),c===p&&c!==i)return!1}else if(i.operator===">="&&!rr(i.semver,String(p),t))return!1}if(n){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator==="<"||p.operator==="<="){if(h=kf(n,p,t),h===p&&h!==n)return!1}else if(n.operator==="<="&&!rr(n.semver,String(p),t))return!1}if(!p.operator&&(n||i)&&a!==0)return!1}return!(i&&u&&!n&&a!==0||n&&l&&!i&&a!==0||d||f)},"simpleSubset"),Lf=o((s,e,t)=>{if(!s)return e;let r=_a(s.semver,e.semver,t);return r>0?s:r<0||e.operator===">"&&s.operator===">="?e:s},"higherGT"),kf=o((s,e,t)=>{if(!s)return e;let r=_a(s.semver,e.semver,t);return r<0?s:r>0||e.operator==="<"&&s.operator==="<="?e:s},"lowerLT");Df.exports=E_});var Uf=m((AB,qf)=>{"use strict";var ba=ls(),$f=Xs(),__=te(),Ff=aa(),b_=$t(),R_=ul(),O_=fl(),I_=ml(),v_=El(),T_=Sl(),A_=bl(),x_=Ol(),C_=vl(),B_=_e(),N_=Cl(),P_=Nl(),L_=gi(),k_=Dl(),D_=$l(),M_=Qs(),$_=yi(),F_=ha(),q_=ua(),U_=Ei(),j_=wi(),H_=la(),z_=Wl(),G_=er(),V_=be(),W_=sr(),Z_=hf(),K_=lf(),Y_=df(),X_=gf(),J_=Ef(),Q_=bi(),e0=Of(),t0=vf(),s0=xf(),r0=Bf(),i0=Mf();qf.exports={parse:b_,valid:R_,clean:O_,inc:I_,diff:v_,major:T_,minor:A_,patch:x_,prerelease:C_,compare:B_,rcompare:N_,compareLoose:P_,compareBuild:L_,sort:k_,rsort:D_,gt:M_,lt:$_,eq:F_,neq:q_,gte:U_,lte:j_,cmp:H_,coerce:z_,Comparator:G_,Range:V_,satisfies:W_,toComparators:Z_,maxSatisfying:K_,minSatisfying:Y_,minVersion:X_,validRange:J_,outside:Q_,gtr:e0,ltr:t0,intersects:s0,simplifyRange:r0,subset:i0,SemVer:__,re:ba.re,src:ba.src,tokens:ba.t,SEMVER_SPEC_VERSION:$f.SEMVER_SPEC_VERSION,RELEASE_TYPES:$f.RELEASE_TYPES,compareIdentifiers:Ff.compareIdentifiers,rcompareIdentifiers:Ff.rcompareIdentifiers}});var Hf=m((xB,jf)=>{var n0=Uf(),o0=o(s=>n0.satisfies(process.version,s,{includePrerelease:!0}),"satisfies");jf.exports={satisfies:o0}});var zf=m((PB,Oa)=>{"use strict";var{inspect:a0}=require("util"),Ra=class{static{o(this,"SystemError")}constructor(e,t,r){let i=`${t}: ${r.syscall} returned ${r.code} (${r.message})`;r.path!==void 0&&(i+=` ${r.path}`),r.dest!==void 0&&(i+=` => ${r.dest}`),this.code=e,Object.defineProperties(this,{name:{value:"SystemError",enumerable:!1,writable:!0,configurable:!0},message:{value:i,enumerable:!1,writable:!0,configurable:!0},info:{value:r,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return r.errno},set(n){r.errno=n},enumerable:!0,configurable:!0},syscall:{get(){return r.syscall},set(n){r.syscall=n},enumerable:!0,configurable:!0}}),r.path!==void 0&&Object.defineProperty(this,"path",{get(){return r.path},set(n){r.path=n},enumerable:!0,configurable:!0}),r.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return r.dest},set(n){r.dest=n},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return a0(this,{...t,getters:!0,customInspect:!1})}};function ut(s,e){Oa.exports[s]=class extends Ra{static{o(this,"NodeError")}constructor(r){super(s,e,r)}}}o(ut,"E");ut("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory");ut("ERR_FS_CP_EEXIST","Target already exists");ut("ERR_FS_CP_EINVAL","Invalid src or dest");ut("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe");ut("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory");ut("ERR_FS_CP_SOCKET","Cannot copy a socket file");ut("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self");ut("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type");ut("ERR_FS_EISDIR","Path is a directory");Oa.exports.ERR_INVALID_ARG_TYPE=class extends Error{static{o(this,"ERR_INVALID_ARG_TYPE")}constructor(e,t,r){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${e} argument must be ${t}. Received ${typeof r}`}}});var hd=m((kB,cd)=>{"use strict";var{ERR_FS_CP_DIR_TO_NON_DIR:c0,ERR_FS_CP_EEXIST:h0,ERR_FS_CP_EINVAL:Ri,ERR_FS_CP_FIFO_PIPE:u0,ERR_FS_CP_NON_DIR_TO_DIR:l0,ERR_FS_CP_SOCKET:f0,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:d0,ERR_FS_CP_UNKNOWN:p0,ERR_FS_EISDIR:m0,ERR_INVALID_ARG_TYPE:g0}=zf(),{constants:{errno:{EEXIST:y0,EISDIR:E0,EINVAL:lt,ENOTDIR:w0}}}=require("os"),{chmod:S0,copyFile:_0,lstat:Qf,mkdir:ed,readdir:b0,readlink:Gf,stat:ds,symlink:Ia,unlink:td,utimes:R0}=require("fs/promises"),{dirname:ir,isAbsolute:Vf,join:Wf,parse:O0,resolve:nr,sep:I0,toNamespacedPath:Zf}=require("path"),{fileURLToPath:v0}=require("url"),T0={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function A0(s,e,t){if(t!=null&&typeof t!="object")throw new g0("options",["Object"],t);return x0(Zf(Kf(s)),Zf(Kf(e)),{...T0,...t})}o(A0,"cp");function Kf(s){return s!=null&&s.href&&s.origin?v0(s):s}o(Kf,"getValidatedPath");async function x0(s,e,t){t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended","TimestampPrecisionWarning");let r=await sd(s,e,t),{srcStat:i,destStat:n}=r;return await id(s,i,e),t.filter?nd(Yf,n,s,e,t):Yf(n,s,e,t)}o(x0,"cpFn");async function sd(s,e,t){let{0:r,1:i}=await C0(s,e,t);if(i){if(rd(r,i))throw new Ri({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:lt});if(r.isDirectory()&&!i.isDirectory())throw new c0({message:`cannot overwrite directory ${s} with non-directory ${e}`,path:e,syscall:"cp",errno:E0});if(!r.isDirectory()&&i.isDirectory())throw new l0({message:`cannot overwrite non-directory ${s} with directory ${e}`,path:e,syscall:"cp",errno:w0})}if(r.isDirectory()&&va(s,e))throw new Ri({message:`cannot copy ${s} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:lt});return{srcStat:r,destStat:i}}o(sd,"checkPaths");function rd(s,e){return e.ino&&e.dev&&e.ino===s.ino&&e.dev===s.dev}o(rd,"areIdentical");function C0(s,e,t){let r=t.dereference?i=>ds(i,{bigint:!0}):i=>Qf(i,{bigint:!0});return Promise.all([r(s),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})])}o(C0,"getStats");async function Yf(s,e,t,r){let i=ir(t);return await B0(i)||await ed(i,{recursive:!0}),Oi(s,e,t,r)}o(Yf,"checkParentDir");function B0(s){return ds(s).then(()=>!0,e=>e.code==="ENOENT"?!1:Promise.reject(e))}o(B0,"pathExists");async function id(s,e,t){let r=nr(ir(s)),i=nr(ir(t));if(i===r||i===O0(i).root)return;let n;try{n=await ds(i,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(rd(e,n))throw new Ri({message:`cannot copy ${s} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:lt});return id(s,e,i)}o(id,"checkParentPaths");var Xf=o(s=>nr(s).split(I0).filter(Boolean),"normalizePathToArray");function va(s,e){let t=Xf(s),r=Xf(e);return t.every((i,n)=>r[n]===i)}o(va,"isSrcSubdir");async function nd(s,e,t,r,i,n){if(await i.filter(t,r))return s(e,t,r,i,n)}o(nd,"handleFilter");function N0(s,e,t,r){return r.filter?nd(Oi,s,e,t,r):Oi(s,e,t,r)}o(N0,"startCopy");async function Oi(s,e,t,r){let n=await(r.dereference?ds:Qf)(e);if(n.isDirectory()&&r.recursive)return F0(n,s,e,t,r);if(n.isDirectory())throw new m0({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:lt});if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return P0(n,s,e,t,r);if(n.isSymbolicLink())return U0(s,e,t);throw n.isSocket()?new f0({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:lt}):n.isFIFO()?new u0({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:lt}):new p0({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:lt})}o(Oi,"getStatsForCopy");function P0(s,e,t,r,i){return e?L0(s,t,r,i):od(s,t,r,i)}o(P0,"onFile");async function L0(s,e,t,r){if(r.force)return await td(t),od(s,e,t,r);if(r.errorOnExist)throw new h0({message:`${t} already exists`,path:t,syscall:"cp",errno:y0})}o(L0,"mayCopyFile");async function od(s,e,t,r){return await _0(e,t),r.preserveTimestamps?k0(s.mode,e,t):Ii(t,s.mode)}o(od,"_copyFile");async function k0(s,e,t){return D0(s)&&await M0(t,s),Jf(s,e,t)}o(k0,"handleTimestampsAndMode");function D0(s){return(s&128)===0}o(D0,"fileIsNotWritable");function M0(s,e){return Ii(s,e|128)}o(M0,"makeFileWritable");async function Jf(s,e,t){return await $0(e,t),Ii(t,s)}o(Jf,"setDestTimestampsAndMode");function Ii(s,e){return S0(s,e)}o(Ii,"setDestMode");async function $0(s,e){let t=await ds(s);return R0(e,t.atime,t.mtime)}o($0,"setDestTimestamps");function F0(s,e,t,r,i){return e?ad(t,r,i):q0(s.mode,t,r,i)}o(F0,"onDir");async function q0(s,e,t,r){return await ed(t),await ad(e,t,r),Ii(t,s)}o(q0,"mkDirAndCopy");async function ad(s,e,t){let r=await b0(s);for(let i=0;i<r.length;i++){let n=r[i],a=Wf(s,n),c=Wf(e,n),{destStat:h}=await sd(a,c,t);await N0(h,a,c,t)}}o(ad,"copyDir");async function U0(s,e,t){let r=await Gf(e);if(Vf(r)||(r=nr(ir(e),r)),!s)return Ia(r,t);let i;try{i=await Gf(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return Ia(r,t);throw a}if(Vf(i)||(i=nr(ir(t),i)),va(r,i))throw new Ri({message:`cannot copy ${r} to a subdirectory of self ${i}`,path:t,syscall:"cp",errno:lt});if((await ds(e)).isDirectory()&&va(i,r))throw new d0({message:`cannot overwrite ${i} with ${r}`,path:t,syscall:"cp",errno:lt});return j0(r,t)}o(U0,"onLink");async function j0(s,e){return await td(e),Ia(s,e)}o(j0,"copyLink");cd.exports=A0});var ld=m((MB,ud)=>{var H0=require("fs/promises"),z0=ia(),G0=Hf(),V0=hd(),W0=G0.satisfies(">=16.7.0"),Z0=o(async(s,e,t)=>{let r=z0(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return W0?H0.cp(s,e,r):V0(s,e,r)},"cp");ud.exports=Z0});var dd=m((FB,fd)=>{var{join:K0,sep:Y0}=require("path"),X0=ia(),{mkdir:J0,mkdtemp:Q0,rm:eb}=require("fs/promises"),tb=o(async(s,e,t)=>{let r=X0(t,{copy:["tmpPrefix"]});await J0(s,{recursive:!0});let i=await Q0(K0(`${s}${Y0}`,r.tmpPrefix||"")),n,a;try{a=await e(i)}catch(c){n=c}try{await eb(i,{force:!0,recursive:!0})}catch{}if(n)throw n;return a},"withTempDir");fd.exports=tb});var yd=m((UB,gd)=>{var{readdir:pd}=require("fs/promises"),{join:md}=require("path"),sb=o(async s=>{let e=[];for(let t of await pd(s))if(t.startsWith("@"))for(let r of await pd(md(s,t)))e.push(md(t,r));else e.push(t);return e},"readdirScoped");gd.exports=sb});var Rd=m((HB,bd)=>{var{dirname:Ed,join:wd,resolve:Sd,relative:rb,isAbsolute:ib}=require("path"),je=require("fs/promises"),nb=o(async s=>{try{return await je.access(s),!0}catch(e){return e.code!=="ENOENT"}},"pathExists"),_d=o(async(s,e,t={},r=!0,i=[])=>{if(!s||!e)throw new TypeError("`source` and `destination` file required");if(t={overwrite:!0,...t},!t.overwrite&&await nb(e))throw new Error(`The destination file exists: ${e}`);await je.mkdir(Ed(e),{recursive:!0});try{await je.rename(s,e)}catch(n){if(n.code==="EXDEV"||n.code==="EPERM"){let a=await je.lstat(s);if(a.isDirectory()){let c=await je.readdir(s);await Promise.all(c.map(h=>_d(wd(s,h),wd(e,h),t,!1,i)))}else a.isSymbolicLink()?i.push({source:s,destination:e}):await je.copyFile(s,e)}else throw n}r&&(await Promise.all(i.map(async({source:n,destination:a})=>{let c=await je.readlink(n);ib(c)&&(c=Sd(a,rb(n,c)));let h="file";try{h=await je.stat(Sd(Ed(n),c)),h.isDirectory()&&(h="junction")}catch{}await je.symlink(c,a,h)})),await je.rm(s,{recursive:!0,force:!0}))},"moveFile");bd.exports=_d});var vi=m((GB,Od)=>{"use strict";var ob=ld(),ab=dd(),cb=yd(),hb=Rd();Od.exports={cp:ob,withTempDir:ab,readdirScoped:cb,moveFile:hb}});var Ti={};Jg(Ti,{default:()=>Id,pMapIterable:()=>ub,pMapSkip:()=>or});async function Id(s,e,{concurrency:t=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:i}={}){return new Promise((n,a)=>{if(s[Symbol.iterator]===void 0&&s[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof s})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);let c=[],h=[],u=new Map,l=!1,f=!1,d=!1,p=0,g=0,y=s[Symbol.iterator]===void 0?s[Symbol.asyncIterator]():s[Symbol.iterator](),S=o(()=>{v(i.reason)},"signalListener"),w=o(()=>{i?.removeEventListener("abort",S)},"cleanup"),T=o(I=>{n(I),w()},"resolve"),v=o(I=>{l=!0,f=!0,a(I),w()},"reject");i&&(i.aborted&&v(i.reason),i.addEventListener("abort",S,{once:!0}));let R=o(async()=>{if(f)return;let I=await y.next(),C=g;if(g++,I.done){if(d=!0,p===0&&!f){if(!r&&h.length>0){v(new AggregateError(h));return}if(f=!0,u.size===0){T(c);return}let P=[];for(let[Y,Se]of c.entries())u.get(Y)!==or&&P.push(Se);T(P)}return}p++,(async()=>{try{let P=await I.value;if(f)return;let Y=await e(P,C);Y===or&&u.set(C,Y),c[C]=Y,p--,await R()}catch(P){if(r)v(P);else{h.push(P),p--;try{await R()}catch(Y){v(Y)}}}})()},"next");(async()=>{for(let I=0;I<t;I++){try{await R()}catch(C){v(C);break}if(d||l)break}})()})}function ub(s,e,{concurrency:t=Number.POSITIVE_INFINITY,backpressure:r=t}={}){if(s[Symbol.iterator]===void 0&&s[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof s})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);if(!(Number.isSafeInteger(r)&&r>=t||r===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${t}) and up or \`Infinity\`, got \`${r}\` (${typeof r})`);return{async*[Symbol.asyncIterator](){let i=s[Symbol.asyncIterator]===void 0?s[Symbol.iterator]():s[Symbol.asyncIterator](),n=[],a=0,c=!1,h=0;function u(){if(c||!(a<t&&n.length<r))return;let l=(async()=>{let{done:f,value:d}=await i.next();if(f)return{done:!0};a++,u();try{let p=await e(await d,h++);if(a--,p===or){let g=n.indexOf(l);g>0&&n.splice(g,1)}return u(),{done:!1,value:p}}catch(p){return c=!0,{error:p}}})();n.push(l)}for(o(u,"trySpawn"),u();n.length>0;){let{error:l,done:f,value:d}=await n[0];if(n.shift(),l)throw l;if(f)return;u(),d!==or&&(yield d)}}}}var or,Ai=Xg(()=>{o(Id,"pMap");o(ub,"pMapIterable");or=Symbol("skip")});var ps=m((ZB,ye)=>{"use strict";var lb=require("crypto"),{appendFile:fb,mkdir:xa,readFile:db,readdir:pb,rm:vd,writeFile:mb}=require("fs/promises"),{Minipass:gb}=J(),He=require("path"),yb=St(),Eb=ea(),wb=us(),Sb=sa(),_b=ta()["cache-version"].index,{moveFile:bb}=vi(),Ta=5;ye.exports.NotFoundError=class extends Error{static{o(this,"NotFoundError")}constructor(e,t){super(`No cache entry for ${t} found in ${e}`),this.code="ENOENT",this.cache=e,this.key=t}};ye.exports.compact=Rb;async function Rb(s,e,t,r={}){let i=ar(s,e),n=await xi(i),a=[];for(let d=n.length-1;d>=0;--d){let p=n[d];if(p.integrity===null&&!r.validateEntry)break;(!r.validateEntry||r.validateEntry(p)===!0)&&(a.length===0||!a.find(g=>t(g,p)))&&a.unshift(p)}let c=`
|
|
10
|
+
`+a.map(d=>{let p=JSON.stringify(d);return`${Ci(p)} ${p}`}).join(`
|
|
11
|
+
`),h=o(async()=>{let d=Eb(He.join(s,"tmp"),r.tmpPrefix);return await xa(He.dirname(d),{recursive:!0}),{target:d,moved:!1}},"setup"),u=o(async d=>{if(!d.moved)return vd(d.target,{recursive:!0,force:!0})},"teardown"),l=o(async d=>{await mb(d.target,c,{flag:"wx"}),await xa(He.dirname(i),{recursive:!0}),await bb(d.target,i),d.moved=!0},"write"),f=await h();try{await l(f)}finally{await u(f)}return a.reverse().map(d=>Bi(s,d,!0))}o(Rb,"compact");ye.exports.insert=Td;async function Td(s,e,t,r={}){let{metadata:i,size:n,time:a}=r,c=ar(s,e),h={key:e,integrity:t&&yb.stringify(t),time:a||Date.now(),size:n,metadata:i};try{await xa(He.dirname(c),{recursive:!0});let u=JSON.stringify(h);await fb(c,`
|
|
12
|
+
${Ci(u)} ${u}`)}catch(u){if(u.code==="ENOENT")return;throw u}return Bi(s,h)}o(Td,"insert");ye.exports.find=Ob;async function Ob(s,e){let t=ar(s,e);try{return(await xi(t)).reduce((i,n)=>n&&n.key===e?Bi(s,n):i,null)}catch(r){if(r.code==="ENOENT")return null;throw r}}o(Ob,"find");ye.exports.delete=Ib;function Ib(s,e,t={}){if(!t.removeFully)return Td(s,e,null,t);let r=ar(s,e);return vd(r,{recursive:!0,force:!0})}o(Ib,"del");ye.exports.lsStream=Ad;function Ad(s){let e=Ca(s),t=new gb({objectMode:!0});return Promise.resolve().then(async()=>{let{default:r}=await Promise.resolve().then(()=>(Ai(),Ti)),i=await Aa(e);return await r(i,async n=>{let a=He.join(e,n),c=await Aa(a);await r(c,async h=>{let u=He.join(a,h),l=await Aa(u);await r(l,async f=>{let d=He.join(u,f);try{let g=(await xi(d)).reduce((y,S)=>(y.set(S.key,S),y),new Map);for(let y of g.values()){let S=Bi(s,y);S&&t.write(S)}}catch(p){if(p.code==="ENOENT")return;throw p}},{concurrency:Ta})},{concurrency:Ta})},{concurrency:Ta}),t.end(),t}).catch(r=>t.emit("error",r)),t}o(Ad,"lsStream");ye.exports.ls=vb;async function vb(s){return(await Ad(s).collect()).reduce((t,r)=>(t[r.key]=r,t),{})}o(vb,"ls");ye.exports.bucketEntries=xi;async function xi(s,e){let t=await db(s,"utf8");return Tb(t,e)}o(xi,"bucketEntries");function Tb(s){let e=[];return s.split(`
|
|
13
|
+
`).forEach(t=>{if(!t)return;let r=t.split(" ");if(!r[1]||Ci(r[1])!==r[0])return;let i;try{i=JSON.parse(r[1])}catch{}i&&e.push(i)}),e}o(Tb,"_bucketEntries");ye.exports.bucketDir=Ca;function Ca(s){return He.join(s,`index-v${_b}`)}o(Ca,"bucketDir");ye.exports.bucketPath=ar;function ar(s,e){let t=xd(e);return He.join.apply(He,[Ca(s)].concat(Sb(t)))}o(ar,"bucketPath");ye.exports.hashKey=xd;function xd(s){return Cd(s,"sha256")}o(xd,"hashKey");ye.exports.hashEntry=Ci;function Ci(s){return Cd(s,"sha1")}o(Ci,"hashEntry");function Cd(s,e){return lb.createHash(e).update(s).digest("hex")}o(Cd,"hash");function Bi(s,e,t){return!e.integrity&&!t?null:{key:e.key,integrity:e.integrity,path:e.integrity?wb(s,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}}o(Bi,"formatEntry");function Aa(s){return pb(s).catch(e=>{if(e.code==="ENOENT"||e.code==="ENOTDIR")return[];throw e})}o(Aa,"readdirOrEmpty")});var gs=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.LRUCache=void 0;var Ab=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nd=new Set,Ba=typeof process=="object"&&process?process:{},Pd=o((s,e,t,r)=>{typeof Ba.emitWarning=="function"&&Ba.emitWarning(s,e,t,r)},"emitWarning"),Ni=globalThis.AbortController,Bd=globalThis.AbortSignal;if(typeof Ni>"u"){Bd=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Ni=class{static{o(this,"AbortController")}constructor(){e()}signal=new Bd;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let s=Ba.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{s&&(s=!1,Pd("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var xb=o(s=>!Nd.has(s),"shouldWarn"),JB=Symbol("type"),_t=o(s=>s&&s===Math.floor(s)&&s>0&&isFinite(s),"isPosInt"),Ld=o(s=>_t(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?ms:null:null,"getUintArray"),ms=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Na=class s{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=Ld(e);if(!t)return[];s.#e=!0;let r=new s(e,t);return s.#e=!1,r}constructor(e,t){if(!s.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Pa=class s{static{o(this,"LRUCache")}#e;#t;#s;#r;#i;#a;#l;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#p;#d;#h;#n;#g;#_;#S;#y;#A;#E;#R;#v;#w;#b;#T;#m;#o;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#w,sizes:e.#R,keyMap:e.#d,keyList:e.#h,valList:e.#n,next:e.#g,prev:e.#_,get head(){return e.#S},get tail(){return e.#y},free:e.#A,isBackgroundFetch:o(t=>e.#u(t),"isBackgroundFetch"),backgroundFetch:o((t,r,i,n)=>e.#H(t,r,i,n),"backgroundFetch"),moveToTail:o(t=>e.#M(t),"moveToTail"),indexes:o(t=>e.#C(t),"indexes"),rindexes:o(t=>e.#N(t),"rindexes"),isStale:o(t=>e.#I(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#p}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#l}get dispose(){return this.#s}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:h,dispose:u,onInsert:l,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:S,fetchMethod:w,memoMethod:T,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:C,ignoreFetchAbort:P,perf:Y}=e;if(Y!==void 0&&typeof Y?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=Y??Ab,t!==0&&!_t(t))throw new TypeError("max option must be a nonnegative integer");let Se=t?Ld(t):Array;if(!Se)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=g,this.maxEntrySize=y||this.#t,this.sizeCalculation=S,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#l=T,w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=w,this.#T=!!w,this.#d=new Map,this.#h=new Array(t).fill(void 0),this.#n=new Array(t).fill(void 0),this.#g=new Se(t),this.#_=new Se(t),this.#S=0,this.#y=0,this.#A=Na.create(t),this.#c=0,this.#p=0,typeof u=="function"&&(this.#s=u),typeof l=="function"&&(this.#r=l),typeof f=="function"?(this.#i=f,this.#E=[]):(this.#i=void 0,this.#E=void 0),this.#b=!!this.#s,this.#o=!!this.#r,this.#m=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#t!==0&&!_t(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!_t(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=_t(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!_t(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let Xe="LRU_CACHE_UNBOUNDED";xb(Xe)&&(Nd.add(Xe),Pd("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Xe,s))}}getRemainingTTL(e){return this.#d.has(e)?1/0:0}#P(){let e=new ms(this.#e),t=new ms(this.#e);this.#w=e,this.#v=t,this.#U=(n,a,c=this.#f.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#I(n)&&this.#B(this.#h[n],"expire")},a+1);h.unref&&h.unref()}},this.#x=n=>{t[n]=e[n]!==0?this.#f.now():0},this.#O=(n,a)=>{if(e[a]){let c=e[a],h=t[a];if(!c||!h)return;n.ttl=c,n.start=h,n.now=r||i();let u=n.now-h;n.remainingTTL=c-u}};let r=0,i=o(()=>{let n=this.#f.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#d.get(n);if(a===void 0)return 0;let c=e[a],h=t[a];if(!c||!h)return 1/0;let u=(r||i())-h;return c-u},this.#I=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||i())-a>c}}#x=o(()=>{},"#updateItemAge");#O=o(()=>{},"#statusTTL");#U=o(()=>{},"#setItemTTL");#I=o(()=>!1,"#isStale");#$(){let e=new ms(this.#e);this.#p=0,this.#R=e,this.#L=t=>{this.#p-=e[t],e[t]=0},this.#k=(t,r,i,n)=>{if(this.#u(r))return 0;if(!_t(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(r,t),!_t(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#F=(t,r,i)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#p>n;)this.#D(!0)}this.#p+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#p)}}#L=o(e=>{},"#removeItemSize");#F=o((e,t,r)=>{},"#addItemSize");#k=o((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#C({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;!(!this.#j(t)||((e||!this.#I(t))&&(yield t),t===this.#S));)t=this.#_[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;!(!this.#j(t)||((e||!this.#I(t))&&(yield t),t===this.#y));)t=this.#g[t]}#j(e){return e!==void 0&&this.#d.get(this.#h[e])===e}*entries(){for(let e of this.#C())this.#n[e]!==void 0&&this.#h[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#h[e],this.#n[e]])}*rentries(){for(let e of this.#N())this.#n[e]!==void 0&&this.#h[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#h[e],this.#n[e]])}*keys(){for(let e of this.#C()){let t=this.#h[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#h[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*values(){for(let e of this.#C())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#N())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#C()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;if(n!==void 0&&e(n,this.#h[r],this))return this.get(this.#h[r],t)}}forEach(e,t=this){for(let r of this.#C()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#h[r],this)}}rforEach(e,t=this){for(let r of this.#N()){let i=this.#n[r],n=this.#u(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#h[r],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#I(t)&&(this.#B(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#d.get(e);if(t===void 0)return;let r=this.#n[t],i=this.#u(r)?r.__staleWhileFetching:r;if(i===void 0)return;let n={value:i};if(this.#w&&this.#v){let a=this.#w[t],c=this.#v[t];if(a&&c){let h=a-(this.#f.now()-c);n.ttl=h,n.start=Date.now()}}return this.#R&&(n.size=this.#R[t]),n}dump(){let e=[];for(let t of this.#C({allowStale:!0})){let r=this.#h[t],i=this.#n[t],n=this.#u(i)?i.__staleWhileFetching:i;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#w&&this.#v){a.ttl=this.#w[t];let c=this.#f.now()-this.#v[t];a.start=Math.floor(Date.now()-c)}this.#R&&(a.size=this.#R[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=this.#f.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:h}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,l=this.#k(e,t,r.size||0,c);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#B(e,"set"),this;let f=this.#c===0?void 0:this.#d.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#A.length!==0?this.#A.pop():this.#c===this.#e?this.#D(!1):this.#c,this.#h[f]=e,this.#n[f]=t,this.#d.set(e,f),this.#g[this.#y]=f,this.#_[f]=this.#y,this.#y=f,this.#c++,this.#F(f,l,h),h&&(h.set="add"),u=!1,this.#o&&this.#r?.(t,e,"add");else{this.#M(f);let d=this.#n[f];if(t!==d){if(this.#T&&this.#u(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=d;p!==void 0&&!a&&(this.#b&&this.#s?.(p,e,"set"),this.#m&&this.#E?.push([p,e,"set"]))}else a||(this.#b&&this.#s?.(d,e,"set"),this.#m&&this.#E?.push([d,e,"set"]));if(this.#L(f),this.#F(f,l,h),this.#n[f]=t,h){h.set="replace";let p=d&&this.#u(d)?d.__staleWhileFetching:d;p!==void 0&&(h.oldValue=p)}}else h&&(h.set="update");this.#o&&this.onInsert?.(t,e,t===d?"update":"replace")}if(i!==0&&!this.#w&&this.#P(),this.#w&&(u||this.#U(f,i,n),h&&this.#O(h,f)),!a&&this.#m&&this.#E){let d=this.#E,p;for(;p=d?.shift();)this.#i?.(...p)}return this}pop(){try{for(;this.#c;){let e=this.#n[this.#S];if(this.#D(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#m&&this.#E){let e=this.#E,t;for(;t=e?.shift();)this.#i?.(...t)}}}#D(e){let t=this.#S,r=this.#h[t],i=this.#n[t];return this.#T&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#b||this.#m)&&(this.#b&&this.#s?.(i,r,"evict"),this.#m&&this.#E?.push([i,r,"evict"])),this.#L(t),e&&(this.#h[t]=void 0,this.#n[t]=void 0,this.#A.push(t)),this.#c===1?(this.#S=this.#y=0,this.#A.length=0):this.#S=this.#g[t],this.#d.delete(r),this.#c--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,n=this.#d.get(e);if(n!==void 0){let a=this.#n[n];if(this.#u(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#I(n))i&&(i.has="stale",this.#O(i,n));else return r&&this.#x(n),i&&(i.has="hit",this.#O(i,n)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#d.get(e);if(i===void 0||!r&&this.#I(i))return;let n=this.#n[i];return this.#u(n)?n.__staleWhileFetching:n}#H(e,t,r,i){let n=t===void 0?void 0:this.#n[t];if(this.#u(n))return n;let a=new Ni,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let h={signal:a.signal,options:r,context:i},u=o((y,S=!1)=>{let{aborted:w}=a.signal,T=r.ignoreFetchAbort&&y!==void 0;if(r.status&&(w&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),w&&!T&&!S)return f(a.signal.reason);let v=p,R=this.#n[t];return(R===p||T&&S&&R===void 0)&&(y===void 0?v.__staleWhileFetching!==void 0?this.#n[t]=v.__staleWhileFetching:this.#B(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,h.options))),y},"cb"),l=o(y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),f(y)),"eb"),f=o(y=>{let{aborted:S}=a.signal,w=S&&r.allowStaleOnFetchAbort,T=w||r.allowStaleOnFetchRejection,v=T||r.noDeleteOnFetchRejection,R=p;if(this.#n[t]===p&&(!v||R.__staleWhileFetching===void 0?this.#B(e,"fetch"):w||(this.#n[t]=R.__staleWhileFetching)),T)return r.status&&R.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw y},"fetchFail"),d=o((y,S)=>{let w=this.#a?.(e,n,h);w&&w instanceof Promise&&w.then(T=>y(T===void 0?void 0:T),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(void 0),r.allowStaleOnFetchAbort&&(y=o(T=>u(T,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,l),g=Object.assign(p,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,g,{...h.options,status:void 0}),t=this.#d.get(e)):this.#n[t]=g,g}#u(e){if(!this.#T)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ni}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:h=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:y,forceRefresh:S=!1,status:w,signal:T}=t;if(!this.#T)return w&&(w.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:w});let v={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:h,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:w,signal:T},R=this.#d.get(e);if(R===void 0){w&&(w.fetch="miss");let I=this.#H(e,R,v,y);return I.__returned=I}else{let I=this.#n[R];if(this.#u(I)){let Xe=r&&I.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",Xe&&(w.returnedStale=!0)),Xe?I.__staleWhileFetching:I.__returned=I}let C=this.#I(R);if(!S&&!C)return w&&(w.fetch="hit"),this.#M(R),i&&this.#x(R),w&&this.#O(w,R),I;let P=this.#H(e,R,v,y),Se=P.__staleWhileFetching!==void 0&&r;return w&&(w.fetch=C?"stale":"refresh",Se&&C&&(w.returnedStale=!0)),Se?P.__staleWhileFetching:P.__returned=P}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#l;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let h=r(e,c,{options:a,context:i});return this.set(e,h,a),h}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#d.get(e);if(c!==void 0){let h=this.#n[c],u=this.#u(h);return a&&this.#O(a,c),this.#I(c)?(a&&(a.get="stale"),u?(a&&r&&h.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?h.__staleWhileFetching:void 0):(n||this.#B(e,"expire"),a&&r&&(a.returnedStale=!0),r?h:void 0)):(a&&(a.get="hit"),u?h.__staleWhileFetching:(this.#M(c),i&&this.#x(c),h))}else a&&(a.get="miss")}#z(e,t){this.#_[t]=e,this.#g[e]=t}#M(e){e!==this.#y&&(e===this.#S?this.#S=this.#g[e]:this.#z(this.#_[e],this.#g[e]),this.#z(this.#y,e),this.#y=e)}delete(e){return this.#B(e,"delete")}#B(e,t){let r=!1;if(this.#c!==0){let i=this.#d.get(e);if(i!==void 0)if(r=!0,this.#c===1)this.#q(t);else{this.#L(i);let n=this.#n[i];if(this.#u(n)?n.__abortController.abort(new Error("deleted")):(this.#b||this.#m)&&(this.#b&&this.#s?.(n,e,t),this.#m&&this.#E?.push([n,e,t])),this.#d.delete(e),this.#h[i]=void 0,this.#n[i]=void 0,i===this.#y)this.#y=this.#_[i];else if(i===this.#S)this.#S=this.#g[i];else{let a=this.#_[i];this.#g[a]=this.#g[i];let c=this.#g[i];this.#_[c]=this.#_[i]}this.#c--,this.#A.push(i)}}if(this.#m&&this.#E?.length){let i=this.#E,n;for(;n=i?.shift();)this.#i?.(...n)}return r}clear(){return this.#q("delete")}#q(e){for(let t of this.#N({allowStale:!0})){let r=this.#n[t];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#h[t];this.#b&&this.#s?.(r,i,e),this.#m&&this.#E?.push([r,i,e])}}if(this.#d.clear(),this.#n.fill(void 0),this.#h.fill(void 0),this.#w&&this.#v&&(this.#w.fill(0),this.#v.fill(0)),this.#R&&this.#R.fill(0),this.#S=0,this.#y=0,this.#A.length=0,this.#p=0,this.#c=0,this.#m&&this.#E){let t=this.#E,r;for(;r=t?.shift();)this.#i?.(...r)}}};Pi.LRUCache=Pa});var cr=m((t1,ys)=>{"use strict";var{LRUCache:Cb}=gs(),Li=new Cb({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:o((s,e)=>e.startsWith("key:")?s.data.length:s.length,"sizeCalculation")});ys.exports.clearMemoized=Bb;function Bb(){let s={};return Li.forEach((e,t)=>{s[t]=e}),Li.clear(),s}o(Bb,"clearMemoized");ys.exports.put=Nb;function Nb(s,e,t,r){ki(r).set(`key:${s}:${e.key}`,{entry:e,data:t}),kd(s,e.integrity,t,r)}o(Nb,"put");ys.exports.put.byDigest=kd;function kd(s,e,t,r){ki(r).set(`digest:${s}:${e}`,t)}o(kd,"putDigest");ys.exports.get=Pb;function Pb(s,e,t){return ki(t).get(`key:${s}:${e}`)}o(Pb,"get");ys.exports.get.byDigest=Lb;function Lb(s,e,t){return ki(t).get(`digest:${s}:${e}`)}o(Lb,"getDigest");var La=class{static{o(this,"ObjProxy")}constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function ki(s){return!s||!s.memoize?Li:s.memoize.get&&s.memoize.set?s.memoize:typeof s.memoize=="object"?new La(s.memoize):Li}o(ki,"pickMem")});var Hi=m(ur=>{"use strict";var{Minipass:kb}=J(),Db=require("events").EventEmitter,ue=require("fs"),Mb=ue.writev,bs=Symbol("_autoClose"),Pe=Symbol("_close"),hr=Symbol("_ended"),D=Symbol("_fd"),Dd=Symbol("_finished"),Rt=Symbol("_flags"),ka=Symbol("_flush"),Ma=Symbol("_handleChunk"),$a=Symbol("_makeBuf"),qi=Symbol("_mode"),Di=Symbol("_needDrain"),Ss=Symbol("_onerror"),Rs=Symbol("_onopen"),Da=Symbol("_onread"),Es=Symbol("_onwrite"),Ot=Symbol("_open"),ft=Symbol("_path"),qt=Symbol("_pos"),ze=Symbol("_queue"),ws=Symbol("_read"),Md=Symbol("_readSize"),bt=Symbol("_reading"),Mi=Symbol("_remain"),$d=Symbol("_size"),$i=Symbol("_write"),Ft=Symbol("_writing"),Fi=Symbol("_defaultFlag"),_s=Symbol("_errored"),Ui=class extends kb{static{o(this,"ReadStream")}constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[_s]=!1,this[D]=typeof t.fd=="number"?t.fd:null,this[ft]=e,this[Md]=t.readSize||16*1024*1024,this[bt]=!1,this[$d]=typeof t.size=="number"?t.size:1/0,this[Mi]=this[$d],this[bs]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[D]=="number"?this[ws]():this[Ot]()}get fd(){return this[D]}get path(){return this[ft]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ot](){ue.open(this[ft],"r",(e,t)=>this[Rs](e,t))}[Rs](e,t){e?this[Ss](e):(this[D]=t,this.emit("open",t),this[ws]())}[$a](){return Buffer.allocUnsafe(Math.min(this[Md],this[Mi]))}[ws](){if(!this[bt]){this[bt]=!0;let e=this[$a]();if(e.length===0)return process.nextTick(()=>this[Da](null,0,e));ue.read(this[D],e,0,e.length,null,(t,r,i)=>this[Da](t,r,i))}}[Da](e,t,r){this[bt]=!1,e?this[Ss](e):this[Ma](t,r)&&this[ws]()}[Pe](){if(this[bs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,ue.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ss](e){this[bt]=!0,this[Pe](),this.emit("error",e)}[Ma](e,t){let r=!1;return this[Mi]-=e,e>0&&(r=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Mi]<=0)&&(r=!1,this[Pe](),super.end()),r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[D]=="number"&&this[ws]();break;case"error":return this[_s]?void 0:(this[_s]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Fa=class extends Ui{static{o(this,"ReadStreamSync")}[Ot](){let e=!0;try{this[Rs](null,ue.openSync(this[ft],"r")),e=!1}finally{e&&this[Pe]()}}[ws](){let e=!0;try{if(!this[bt]){this[bt]=!0;do{let t=this[$a](),r=t.length===0?0:ue.readSync(this[D],t,0,t.length,null);if(!this[Ma](r,t))break}while(!0);this[bt]=!1}e=!1}finally{e&&this[Pe]()}}[Pe](){if(this[bs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,ue.closeSync(e),this.emit("close")}}},ji=class extends Db{static{o(this,"WriteStream")}constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[_s]=!1,this[Ft]=!1,this[hr]=!1,this[Di]=!1,this[ze]=[],this[ft]=e,this[D]=typeof t.fd=="number"?t.fd:null,this[qi]=t.mode===void 0?438:t.mode,this[qt]=typeof t.start=="number"?t.start:null,this[bs]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[qt]!==null?"r+":"w";this[Fi]=t.flags===void 0,this[Rt]=this[Fi]?r:t.flags,this[D]===null&&this[Ot]()}emit(e,t){if(e==="error"){if(this[_s])return;this[_s]=!0}return super.emit(e,t)}get fd(){return this[D]}get path(){return this[ft]}[Ss](e){this[Pe](),this[Ft]=!0,this.emit("error",e)}[Ot](){ue.open(this[ft],this[Rt],this[qi],(e,t)=>this[Rs](e,t))}[Rs](e,t){this[Fi]&&this[Rt]==="r+"&&e&&e.code==="ENOENT"?(this[Rt]="w",this[Ot]()):e?this[Ss](e):(this[D]=t,this.emit("open",t),this[Ft]||this[ka]())}end(e,t){return e&&this.write(e,t),this[hr]=!0,!this[Ft]&&!this[ze].length&&typeof this[D]=="number"&&this[Es](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[hr]?(this.emit("error",new Error("write() after end()")),!1):this[D]===null||this[Ft]||this[ze].length?(this[ze].push(e),this[Di]=!0,!1):(this[Ft]=!0,this[$i](e),!0)}[$i](e){ue.write(this[D],e,0,e.length,this[qt],(t,r)=>this[Es](t,r))}[Es](e,t){e?this[Ss](e):(this[qt]!==null&&(this[qt]+=t),this[ze].length?this[ka]():(this[Ft]=!1,this[hr]&&!this[Dd]?(this[Dd]=!0,this[Pe](),this.emit("finish")):this[Di]&&(this[Di]=!1,this.emit("drain"))))}[ka](){if(this[ze].length===0)this[hr]&&this[Es](null,0);else if(this[ze].length===1)this[$i](this[ze].pop());else{let e=this[ze];this[ze]=[],Mb(this[D],e,this[qt],(t,r)=>this[Es](t,r))}}[Pe](){if(this[bs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,ue.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},qa=class extends ji{static{o(this,"WriteStreamSync")}[Ot](){let e;if(this[Fi]&&this[Rt]==="r+")try{e=ue.openSync(this[ft],this[Rt],this[qi])}catch(t){if(t.code==="ENOENT")return this[Rt]="w",this[Ot]();throw t}else e=ue.openSync(this[ft],this[Rt],this[qi]);this[Rs](null,e)}[Pe](){if(this[bs]&&typeof this[D]=="number"){let e=this[D];this[D]=null,ue.closeSync(e),this.emit("close")}}[$i](e){let t=!0;try{this[Es](null,ue.writeSync(this[D],e,0,e.length,this[qt])),t=!1}finally{if(t)try{this[Pe]()}catch{}}}};ur.ReadStream=Ui;ur.ReadStreamSync=Fa;ur.WriteStream=ji;ur.WriteStreamSync=qa});var ja=m((n1,Os)=>{"use strict";var lr=require("fs/promises"),$b=Hi(),Ua=St(),Fb=us(),Fd=hs();Os.exports=qb;var qd=64*1024*1024;async function qb(s,e,t={}){let{size:r}=t,{stat:i,cpath:n,sri:a}=await fr(s,e,async(h,u)=>({stat:r?{size:r}:await lr.stat(h),cpath:h,sri:u}));if(i.size>qd)return Ud(n,i.size,a,new Fd).concat();let c=await lr.readFile(n,{encoding:null});if(i.size!==c.length)throw Hb(i.size,c.length);if(!Ua.checkData(c,a))throw zb(a,n);return c}o(qb,"read");var Ud=o((s,e,t,r)=>(r.push(new $b.ReadStream(s,{size:e,readSize:qd}),Ua.integrityStream({integrity:t,size:e})),r),"readPipeline");Os.exports.stream=jd;Os.exports.readStream=jd;function jd(s,e,t={}){let{size:r}=t,i=new Fd;return Promise.resolve().then(async()=>{let{stat:n,cpath:a,sri:c}=await fr(s,e,async(h,u)=>({stat:r?{size:r}:await lr.stat(h),cpath:h,sri:u}));return Ud(a,n.size,c,i)}).catch(n=>i.emit("error",n)),i}o(jd,"readStream");Os.exports.copy=Ub;function Ub(s,e,t){return fr(s,e,r=>lr.copyFile(r,t))}o(Ub,"copy");Os.exports.hasContent=jb;async function jb(s,e){if(!e)return!1;try{return await fr(s,e,async(t,r)=>{let i=await lr.stat(t);return{size:i.size,sri:r,stat:i}})}catch(t){if(t.code==="ENOENT")return!1;if(t.code==="EPERM"){if(process.platform!=="win32")throw t;return!1}}}o(jb,"hasContent");async function fr(s,e,t){let r=Ua.parse(e),i=r.pickAlgorithm(),n=r[i];if(n.length<=1){let a=Fb(s,n[0]);return t(a,n[0])}else{let a=await Promise.all(n.map(async u=>{try{return await fr(s,u,t)}catch(l){return l.code==="ENOENT"?Object.assign(new Error("No matching content found for "+r.toString()),{code:"ENOENT"}):l}})),c=a.find(u=>!(u instanceof Error));if(c)return c;let h=a.find(u=>u.code==="ENOENT");throw h||a.find(u=>u instanceof Error)}}o(fr,"withContentSri");function Hb(s,e){let t=new Error(`Bad data size: expected inserted data to be ${s} bytes, but got ${e} instead`);return t.expected=s,t.found=e,t.code="EBADSIZE",t}o(Hb,"sizeError");function zb(s,e){let t=new Error(`Integrity verification failed for ${s} (${e})`);return t.code="EINTEGRITY",t.sri=s,t.path=e,t}o(zb,"integrityError")});var Vd=m((a1,pt)=>{"use strict";var Hd=Wo(),{Minipass:zd}=J(),Gd=hs(),Ut=ps(),dt=cr(),jt=ja();async function Gb(s,e,t={}){let{integrity:r,memoize:i,size:n}=t,a=dt.get(s,e,t);if(a&&i!==!1)return{metadata:a.entry.metadata,data:a.data,integrity:a.entry.integrity,size:a.entry.size};let c=await Ut.find(s,e,t);if(!c)throw new Ut.NotFoundError(s,e);let h=await jt(s,c.integrity,{integrity:r,size:n});return i&&dt.put(s,c,h,t),{data:h,metadata:c.metadata,size:c.size,integrity:c.integrity}}o(Gb,"getData");pt.exports=Gb;async function Vb(s,e,t={}){let{integrity:r,memoize:i,size:n}=t,a=dt.get.byDigest(s,e,t);if(a&&i!==!1)return a;let c=await jt(s,e,{integrity:r,size:n});return i&&dt.put.byDigest(s,e,c,t),c}o(Vb,"getDataByDigest");pt.exports.byDigest=Vb;var Wb=o(s=>{let e=new zd;return e.on("newListener",function(t,r){t==="metadata"&&r(s.entry.metadata),t==="integrity"&&r(s.entry.integrity),t==="size"&&r(s.entry.size)}),e.end(s.data),e},"getMemoizedStream");function Zb(s,e,t={}){let{memoize:r,size:i}=t,n=dt.get(s,e,t);if(n&&r!==!1)return Wb(n);let a=new Gd;return Promise.resolve().then(async()=>{let c=await Ut.find(s,e);if(!c)throw new Ut.NotFoundError(s,e);a.emit("metadata",c.metadata),a.emit("integrity",c.integrity),a.emit("size",c.size),a.on("newListener",function(u,l){u==="metadata"&&l(c.metadata),u==="integrity"&&l(c.integrity),u==="size"&&l(c.size)});let h=jt.readStream(s,c.integrity,{...t,size:typeof i!="number"?c.size:i});if(r){let u=new Hd.PassThrough;u.on("collect",l=>dt.put(s,c,l,t)),a.unshift(u)}return a.unshift(h),a}).catch(c=>a.emit("error",c)),a}o(Zb,"getStream");pt.exports.stream=Zb;function Kb(s,e,t={}){let{memoize:r}=t,i=dt.get.byDigest(s,e,t);if(i&&r!==!1){let n=new zd;return n.end(i),n}else{let n=jt.readStream(s,e,t);if(!r)return n;let a=new Hd.PassThrough;return a.on("collect",c=>dt.put.byDigest(s,e,c,t)),new Gd(n,a)}}o(Kb,"getStreamDigest");pt.exports.stream.byDigest=Kb;function Yb(s,e,t={}){let{memoize:r}=t,i=dt.get(s,e,t);return i&&r!==!1?Promise.resolve(i.entry):Ut.find(s,e)}o(Yb,"info");pt.exports.info=Yb;async function Xb(s,e,t,r={}){let i=await Ut.find(s,e,r);if(!i)throw new Ut.NotFoundError(s,e);return await jt.copy(s,i.integrity,t,r),{metadata:i.metadata,size:i.size,integrity:i.integrity}}o(Xb,"copy");pt.exports.copy=Xb;async function Jb(s,e,t,r={}){return await jt.copy(s,e,t,r),e}o(Jb,"copyByDigest");pt.exports.copy.byDigest=Jb;pt.exports.hasContent=jt.hasContent});var Xd=m((h1,Va)=>{"use strict";var Wd=require("events"),Qb=us(),pr=require("fs/promises"),{moveFile:eR}=vi(),{Minipass:tR}=J(),Zd=hs(),sR=hi(),Ha=require("path"),za=St(),rR=ea(),iR=Hi();Va.exports=nR;var dr=new Map;async function nR(s,e,t={}){let{algorithms:r,size:i,integrity:n}=t;if(typeof i=="number"&&e.length!==i)throw hR(i,e.length);let a=za.fromData(e,r?{algorithms:r}:{});if(n&&!za.checkData(e,n,t))throw uR(n,a);for(let c in a){let h=await Kd(s,t),u=a[c].toString();try{await pr.writeFile(h.target,e,{flag:"wx"}),await Yd(h,s,u,t)}finally{h.moved||await pr.rm(h.target,{recursive:!0,force:!0})}}return{integrity:a,size:e.length}}o(nR,"write");Va.exports.stream=oR;var Ga=class extends sR{static{o(this,"CacacheWriteStream")}constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new tR,this.inputStream.on("error",r=>this.emit("error",r)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(e,t,r){return this.handleContentP||(this.handleContentP=aR(this.inputStream,this.cache,this.opts),this.handleContentP.catch(i=>this.emit("error",i))),this.inputStream.write(e,t,r)}flush(e){this.inputStream.end(()=>{if(!this.handleContentP){let t=new Error("Cache input stream was empty");return t.code="ENODATA",Promise.reject(t).catch(e)}this.handleContentP.then(t=>{t.integrity&&this.emit("integrity",t.integrity),t.size!==null&&this.emit("size",t.size),e()},t=>e(t))})}};function oR(s,e={}){return new Ga(s,e)}o(oR,"writeStream");async function aR(s,e,t){let r=await Kd(e,t);try{let i=await cR(s,e,r.target,t);return await Yd(r,e,i.integrity,t),i}finally{r.moved||await pr.rm(r.target,{recursive:!0,force:!0})}}o(aR,"handleContent");async function cR(s,e,t,r){let i=new iR.WriteStream(t,{flags:"wx"});if(r.integrityEmitter){let[u,l]=await Promise.all([Wd.once(r.integrityEmitter,"integrity").then(f=>f[0]),Wd.once(r.integrityEmitter,"size").then(f=>f[0]),new Zd(s,i).promise()]);return{integrity:u,size:l}}let n,a,c=za.integrityStream({integrity:r.integrity,algorithms:r.algorithms,size:r.size});return c.on("integrity",u=>{n=u}),c.on("size",u=>{a=u}),await new Zd(s,c,i).promise(),{integrity:n,size:a}}o(cR,"pipeToTmp");async function Kd(s,e){let t=rR(Ha.join(s,"tmp"),e.tmpPrefix);return await pr.mkdir(Ha.dirname(t),{recursive:!0}),{target:t,moved:!1}}o(Kd,"makeTmp");async function Yd(s,e,t){let r=Qb(e,t),i=Ha.dirname(r);return dr.has(r)||dr.set(r,pr.mkdir(i,{recursive:!0}).then(async()=>(await eR(s.target,r,{overwrite:!1}),s.moved=!0,s.moved)).catch(n=>{if(!n.message.startsWith("The destination file exists"))throw Object.assign(n,{code:"EEXIST"})}).finally(()=>{dr.delete(r)})),dr.get(r)}o(Yd,"moveToDestination");function hR(s,e){let t=new Error(`Bad data size: expected inserted data to be ${s} bytes, but got ${e} instead`);return t.expected=s,t.found=e,t.code="EBADSIZE",t}o(hR,"sizeError");function uR(s,e){let t=new Error(`Integrity check failed:
|
|
14
14
|
Wanted: ${s}
|
|
15
|
-
Found: ${e}`);return t.code="EINTEGRITY",t.expected=s,t.found=e,t}o(DR,"checksumError")});var Ep=m((nN,nc)=>{"use strict";var pp=Ss(),mp=yr(),gp=dp(),FR=yi(),{PassThrough:MR}=na(),$R=ms(),yp=o(s=>({algorithms:["sha512"],...s}),"putOpts");nc.exports=qR;async function qR(s,e,t,r={}){let{memoize:i}=r;r=yp(r);let n=await gp(s,t,r),a=await pp.insert(s,e,n.integrity,{...r,size:n.size});return i&&mp.put(s,a,t,r),n.integrity}o(qR,"putData");nc.exports.stream=UR;function UR(s,e,t={}){let{memoize:r}=t;t=yp(t);let i,n,a,c,h=new $R;if(r){let l=new MR().on("collect",f=>{c=f});h.push(l)}let u=gp.stream(s,t).on("integrity",l=>{i=l}).on("size",l=>{n=l}).on("error",l=>{a=l});return h.push(u),h.push(new FR({async flush(){if(!a){let l=await pp.insert(s,e,i,{...t,size:n});r&&c&&mp.put(s,l,c,t),h.emit("integrity",i),h.emit("size",n)}}})),h}o(UR,"putStream")});var Sp=m(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.range=Zt.balanced=void 0;var jR=o((s,e,t)=>{let r=s instanceof RegExp?wp(s,t):s,i=e instanceof RegExp?wp(e,t):e,n=r!==null&&i!=null&&(0,Zt.range)(r,i,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+i.length)}},"balanced");Zt.balanced=jR;var wp=o((s,e)=>{let t=e.match(s);return t?t[0]:null},"maybeMatch"),HR=o((s,e,t)=>{let r,i,n,a,c,h=t.indexOf(s),u=t.indexOf(e,h+1),l=h;if(h>=0&&u>0){if(s===e)return[h,u];for(r=[],n=t.length;l>=0&&!c;){if(l===h)r.push(l),h=t.indexOf(s,l+1);else if(r.length===1){let f=r.pop();f!==void 0&&(c=[f,u])}else i=r.pop(),i!==void 0&&i<n&&(n=i,a=u),u=t.indexOf(e,l+1);l=h<u&&h>=0?h:u}r.length&&a!==void 0&&(c=[n,a])}return c},"range");Zt.range=HR});var Tp=m(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.expand=sO;var _p=Sp(),bp="\0SLASH"+Math.random()+"\0",Rp="\0OPEN"+Math.random()+"\0",ac="\0CLOSE"+Math.random()+"\0",Op="\0COMMA"+Math.random()+"\0",vp="\0PERIOD"+Math.random()+"\0",zR=new RegExp(bp,"g"),GR=new RegExp(Rp,"g"),VR=new RegExp(ac,"g"),WR=new RegExp(Op,"g"),ZR=new RegExp(vp,"g"),KR=/\\\\/g,YR=/\\{/g,XR=/\\}/g,JR=/\\,/g,QR=/\\./g;function oc(s){return isNaN(s)?s.charCodeAt(0):parseInt(s,10)}o(oc,"numeric");function eO(s){return s.replace(KR,bp).replace(YR,Rp).replace(XR,ac).replace(JR,Op).replace(QR,vp)}o(eO,"escapeBraces");function tO(s){return s.replace(zR,"\\").replace(GR,"{").replace(VR,"}").replace(WR,",").replace(ZR,".")}o(tO,"unescapeBraces");function Ip(s){if(!s)return[""];let e=[],t=(0,_p.balanced)("{","}",s);if(!t)return s.split(",");let{pre:r,body:i,post:n}=t,a=r.split(",");a[a.length-1]+="{"+i+"}";let c=Ip(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(Ip,"parseCommaParts");function sO(s){return s?(s.slice(0,2)==="{}"&&(s="\\{\\}"+s.slice(2)),Or(eO(s),!0).map(tO)):[]}o(sO,"expand");function rO(s){return"{"+s+"}"}o(rO,"embrace");function iO(s){return/^-?0\d/.test(s)}o(iO,"isPadded");function nO(s,e){return s<=e}o(nO,"lte");function oO(s,e){return s>=e}o(oO,"gte");function Or(s,e){let t=[],r=(0,_p.balanced)("{","}",s);if(!r)return[s];let i=r.pre,n=r.post.length?Or(r.post,!1):[""];if(/\$$/.test(r.pre))for(let a=0;a<n.length;a++){let c=i+"{"+r.body+"}"+n[a];t.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),h=a||c,u=r.body.indexOf(",")>=0;if(!h&&!u)return r.post.match(/,(?!,).*\}/)?(s=r.pre+"{"+r.body+ac+r.post,Or(s)):[s];let l;if(h)l=r.body.split(/\.\./);else if(l=Ip(r.body),l.length===1&&l[0]!==void 0&&(l=Or(l[0],!1).map(rO),l.length===1))return n.map(d=>r.pre+l[0]+d);let f;if(h&&l[0]!==void 0&&l[1]!==void 0){let d=oc(l[0]),p=oc(l[1]),y=Math.max(l[0].length,l[1].length),g=l.length===3&&l[2]!==void 0?Math.abs(oc(l[2])):1,w=nO;p<d&&(g*=-1,w=oO);let I=l.some(iO);f=[];for(let T=d;w(T,p);T+=g){let _;if(c)_=String.fromCharCode(T),_==="\\"&&(_="");else if(_=String(T),I){let O=y-_.length;if(O>0){let A=new Array(O+1).join("0");T<0?_="-"+A+_.slice(1):_=A+_}}f.push(_)}}else{f=[];for(let d=0;d<l.length;d++)f.push.apply(f,Or(l[d],!1))}for(let d=0;d<f.length;d++)for(let p=0;p<n.length;p++){let y=i+f[d]+n[p];(!e||h||y)&&t.push(y)}}return t}o(Or,"expand_")});var Cp=m(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.assertValidPattern=void 0;var aO=1024*64,cO=o(s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>aO)throw new TypeError("pattern is too long")},"assertValidPattern");Ji.assertValidPattern=cO});var xp=m(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.parseClass=void 0;var hO={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},vr=o(s=>s.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),uO=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),Ap=o(s=>s.join(""),"rangesToString"),lO=o((s,e)=>{let t=e;if(s.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],n=t+1,a=!1,c=!1,h=!1,u=!1,l=t,f="";e:for(;n<s.length;){let g=s.charAt(n);if((g==="!"||g==="^")&&n===t+1){u=!0,n++;continue}if(g==="]"&&a&&!h){l=n+1;break}if(a=!0,g==="\\"&&!h){h=!0,n++;continue}if(g==="["&&!h){for(let[w,[S,I,T]]of Object.entries(hO))if(s.startsWith(w,n)){if(f)return["$.",!1,s.length-t,!0];n+=w.length,T?i.push(S):r.push(S),c=c||I;continue e}}if(h=!1,f){g>f?r.push(vr(f)+"-"+vr(g)):g===f&&r.push(vr(g)),f="",n++;continue}if(s.startsWith("-]",n+1)){r.push(vr(g+"-")),n+=2;continue}if(s.startsWith("-",n+1)){f=g,n+=2;continue}r.push(vr(g)),n++}if(l<n)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,s.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let g=r[0].length===2?r[0].slice(-1):r[0];return[uO(g),!1,l-t,!1]}let d="["+(u?"^":"")+Ap(r)+"]",p="["+(u?"":"^")+Ap(i)+"]";return[r.length&&i.length?"("+d+"|"+p+")":r.length?d:p,c,l-t,!0]},"parseClass");Qi.parseClass=lO});var tn=m(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.unescape=void 0;var fO=o((s,{windowsPathsNoEscape:e=!1}={})=>e?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");en.unescape=fO});var lc=m(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.AST=void 0;var dO=xp(),sn=tn(),pO=new Set(["!","?","+","*","@"]),Bp=o(s=>pO.has(s),"isExtglobType"),mO="(?!(?:^|/)\\.\\.?(?:$|/))",rn="(?!\\.)",gO=new Set(["[","."]),yO=new Set(["..","."]),EO=new Set("().*{}+?[]^$\\!"),wO=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),uc="[^/]",Np=uc+"*?",Pp=uc+"+?",hc=class s{static{o(this,"AST")}type;#e;#t;#s=!1;#r=[];#i;#a;#l;#f=!1;#c;#p;#d=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?r:this.#e.#c,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#f&&this.#l.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#p!==void 0?this.#p:this.type?this.#p=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#p=this.#r.map(e=>String(e)).join("")}#h(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,r=t.#i;for(;r;){for(let i=t.#a+1;!r.type&&i<r.#r.length;i++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[i])}t=r,r=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof s&&t.#i===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let r=e.#r[t];if(!(r instanceof s&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new s(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#n(e,t,r,i){let n=!1,a=!1,c=-1,h=!1;if(t.type===null){let p=r,y="";for(;p<e.length;){let g=e.charAt(p++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){p===c+1?(g==="^"||g==="!")&&(h=!0):g==="]"&&!(p===c+2&&h)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=p,h=!1,y+=g;continue}if(!i.noext&&Bp(g)&&e.charAt(p)==="("){t.push(y),y="";let w=new s(g,t);p=s.#n(e,w,p,i),t.push(w);continue}y+=g}return t.push(y),p}let u=r+1,l=new s(null,t),f=[],d="";for(;u<e.length;){let p=e.charAt(u++);if(n||p==="\\"){n=!n,d+=p;continue}if(a){u===c+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(u===c+2&&h)&&(a=!1),d+=p;continue}else if(p==="["){a=!0,c=u,h=!1,d+=p;continue}if(Bp(p)&&e.charAt(u)==="("){l.push(d),d="";let y=new s(p,l);l.push(y),u=s.#n(e,y,u,i);continue}if(p==="|"){l.push(d),d="",f.push(l),l=new s(null,t);continue}if(p===")")return d===""&&t.#r.length===0&&(t.#d=!0),l.push(d),d="",t.push(...f,l),u;d+=p}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],u}static fromGlob(e,t={}){let r=new s(null,void 0,t);return s.#n(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,i,n]=this.toRegExpSource();if(!(i||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#c.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&this.#h(),!this.type){let h=this.isStart()&&this.isEnd(),u=this.#r.map(p=>{let[y,g,w,S]=typeof p=="string"?s.#_(p,this.#t,h):p.toRegExpSource(e);return this.#t=this.#t||w,this.#s=this.#s||S,y}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&yO.has(this.#r[0]))){let y=gO,g=t&&y.has(u.charAt(0))||u.startsWith("\\.")&&y.has(u.charAt(2))||u.startsWith("\\.\\.")&&y.has(u.charAt(4)),w=!t&&!e&&y.has(u.charAt(0));l=g?mO:w?rn:""}let f="";return this.isEnd()&&this.#e.#f&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[l+u+f,(0,sn.unescape)(u),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#g(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let h=this.toString();return this.#r=[h],this.type=null,this.#t=void 0,[h,(0,sn.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!rn?"":this.#g(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#d)c=(this.isStart()&&!t?rn:"")+Pp;else{let h=this.type==="!"?"))"+(this.isStart()&&!t&&!e?rn:"")+Np+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=i+n+h}return[c,(0,sn.unescape)(n),this.#t=!!this.#t,this.#s]}#g(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,n,a]=t.toRegExpSource(e);return this.#s=this.#s||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#_(e,t,r=!1){let i=!1,n="",a=!1;for(let c=0;c<e.length;c++){let h=e.charAt(c);if(i){i=!1,n+=(EO.has(h)?"\\":"")+h;continue}if(h==="\\"){c===e.length-1?n+="\\\\":i=!0;continue}if(h==="["){let[u,l,f,d]=(0,dO.parseClass)(e,c);if(f){n+=u,a=a||l,c+=f-1,t=t||d;continue}}if(h==="*"){r&&e==="*"?n+=Pp:n+=Np,t=!0;continue}if(h==="?"){n+=uc,t=!0;continue}n+=wO(h)}return[n,(0,sn.unescape)(e),!!t,a]}};nn.AST=hc});var fc=m(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.escape=void 0;var SO=o((s,{windowsPathsNoEscape:e=!1}={})=>e?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),"escape");on.escape=SO});var At=m(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.unescape=v.escape=v.AST=v.Minimatch=v.match=v.makeRe=v.braceExpand=v.defaults=v.filter=v.GLOBSTAR=v.sep=v.minimatch=void 0;var _O=Tp(),an=Cp(),Dp=lc(),bO=fc(),RO=tn(),OO=o((s,e,t={})=>((0,an.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Kt(e,t).match(s)),"minimatch");v.minimatch=OO;var vO=/^\*+([^+@!?\*\[\(]*)$/,IO=o(s=>e=>!e.startsWith(".")&&e.endsWith(s),"starDotExtTest"),TO=o(s=>e=>e.endsWith(s),"starDotExtTestDot"),CO=o(s=>(s=s.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(s)),"starDotExtTestNocase"),AO=o(s=>(s=s.toLowerCase(),e=>e.toLowerCase().endsWith(s)),"starDotExtTestNocaseDot"),xO=/^\*+\.\*+$/,BO=o(s=>!s.startsWith(".")&&s.includes("."),"starDotStarTest"),NO=o(s=>s!=="."&&s!==".."&&s.includes("."),"starDotStarTestDot"),PO=/^\.\*+$/,LO=o(s=>s!=="."&&s!==".."&&s.startsWith("."),"dotStarTest"),kO=/^\*+$/,DO=o(s=>s.length!==0&&!s.startsWith("."),"starTest"),FO=o(s=>s.length!==0&&s!=="."&&s!=="..","starTestDot"),MO=/^\?+([^+@!?\*\[\(]*)?$/,$O=o(([s,e=""])=>{let t=Fp([s]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),qO=o(([s,e=""])=>{let t=Mp([s]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),UO=o(([s,e=""])=>{let t=Mp([s]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),jO=o(([s,e=""])=>{let t=Fp([s]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),Fp=o(([s])=>{let e=s.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),Mp=o(([s])=>{let e=s.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),$p=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Lp={win32:{sep:"\\"},posix:{sep:"/"}};v.sep=$p==="win32"?Lp.win32.sep:Lp.posix.sep;v.minimatch.sep=v.sep;v.GLOBSTAR=Symbol("globstar **");v.minimatch.GLOBSTAR=v.GLOBSTAR;var HO="[^/]",zO=HO+"*?",GO="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VO="(?:(?!(?:\\/|^)\\.).)*?",WO=o((s,e={})=>t=>(0,v.minimatch)(t,s,e),"filter");v.filter=WO;v.minimatch.filter=v.filter;var Ie=o((s,e={})=>Object.assign({},s,e),"ext"),ZO=o(s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return v.minimatch;let e=v.minimatch;return Object.assign(o((r,i,n={})=>e(r,i,Ie(s,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(i,n={}){super(i,Ie(s,n))}static defaults(i){return e.defaults(Ie(s,i)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(i,n,a={}){super(i,n,Ie(s,a))}static fromGlob(i,n={}){return e.AST.fromGlob(i,Ie(s,n))}},unescape:o((r,i={})=>e.unescape(r,Ie(s,i)),"unescape"),escape:o((r,i={})=>e.escape(r,Ie(s,i)),"escape"),filter:o((r,i={})=>e.filter(r,Ie(s,i)),"filter"),defaults:o(r=>e.defaults(Ie(s,r)),"defaults"),makeRe:o((r,i={})=>e.makeRe(r,Ie(s,i)),"makeRe"),braceExpand:o((r,i={})=>e.braceExpand(r,Ie(s,i)),"braceExpand"),match:o((r,i,n={})=>e.match(r,i,Ie(s,n)),"match"),sep:e.sep,GLOBSTAR:v.GLOBSTAR})},"defaults");v.defaults=ZO;v.minimatch.defaults=v.defaults;var KO=o((s,e={})=>((0,an.assertValidPattern)(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:(0,_O.expand)(s)),"braceExpand");v.braceExpand=KO;v.minimatch.braceExpand=v.braceExpand;var YO=o((s,e={})=>new Kt(s,e).makeRe(),"makeRe");v.makeRe=YO;v.minimatch.makeRe=v.makeRe;var XO=o((s,e,t={})=>{let r=new Kt(e,t);return s=s.filter(i=>r.match(i)),r.options.nonull&&!s.length&&s.push(e),s},"match");v.match=XO;v.minimatch.match=v.match;var kp=/[?*]|[+@!]\(.*?\)|\[|\]/,JO=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Kt=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,an.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||$p,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=n[0]===""&&n[1]===""&&(n[2]==="?"||!kp.test(n[2]))&&!kp.test(n[3]),u=/^[a-z]:/i.test(n[0]);if(h)return[...n.slice(0,4),...n.slice(4).map(l=>this.parse(l))];if(u)return[n[0],...n.slice(1).map(l=>this.parse(l))]}return n.map(h=>this.parse(h))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let n=r[r.length-1];return i==="**"&&n==="**"?r:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let n=e[i];i===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let c=r[i+1],h=r[i+2],u=r[i+3];if(c!==".."||!h||h==="."||h===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let h=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...h),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,n=0,a=[],c="";for(;i<e.length&&n<t.length;)if(e[i]===t[n])a.push(c==="b"?t[n]:e[i]),i++,n++;else if(r&&e[i]==="**"&&t[n]===e[i+1])a.push(e[i]),i++;else if(r&&t[n]==="**"&&e[i]===t[n+1])a.push(t[n]),n++;else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[i]),i++,n++}else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),i++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),S=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),I=!S&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),T=w?3:g?0:void 0,_=I?3:S?0:void 0;if(typeof T=="number"&&typeof _=="number"){let[O,A]=[e[T],t[_]];O.toLowerCase()===A.toLowerCase()&&(t[_]=O,_>T?t=t.slice(_):T>_&&(e=e.slice(T)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var a=0,c=0,h=e.length,u=t.length;a<h&&c<u;a++,c++){this.debug("matchOne loop");var l=t[c],f=e[a];if(this.debug(t,l,f),l===!1)return!1;if(l===v.GLOBSTAR){this.debug("GLOBSTAR",[t,l,f]);var d=a,p=c+1;if(p===u){for(this.debug("** at the end");a<h;a++)if(e[a]==="."||e[a]===".."||!i.dot&&e[a].charAt(0)===".")return!1;return!0}for(;d<h;){var y=e[d];if(this.debug(`
|
|
16
|
-
globstar while`,e,d,t,p,
|
|
17
|
-
>>> no match, partial?`,e,d,t,p),d===h))}let g;if(typeof l=="string"?(g=f===l,this.debug("string match",l,f,g)):(g=l.test(f),this.debug("pattern match",l,f,g)),!g)return!1}if(a===h&&c===u)return!0;if(a===h)return r;if(c===u)return a===h-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,v.braceExpand)(this.pattern,this.options)}parse(e){(0,an.assertValidPattern)(e);let t=this.options;if(e==="**")return v.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(kO))?i=t.dot?FO:DO:(r=e.match(vO))?i=(t.nocase?t.dot?AO:CO:t.dot?TO:IO)(r[1]):(r=e.match(MO))?i=(t.nocase?t.dot?qO:$O:t.dot?UO:jO)(r):(r=e.match(xO))?i=t.dot?NO:BO:(r=e.match(PO))&&(i=LO);let n=Dp.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?zO:t.dot?GO:VO,i=new Set(t.nocase?["i"]:[]),n=e.map(h=>{let u=h.map(l=>{if(l instanceof RegExp)for(let f of l.flags.split(""))i.add(f);return typeof l=="string"?JO(l):l===v.GLOBSTAR?v.GLOBSTAR:l._src});return u.forEach((l,f)=>{let d=u[f+1],p=u[f-1];l!==v.GLOBSTAR||p===v.GLOBSTAR||(p===void 0?d!==void 0&&d!==v.GLOBSTAR?u[f+1]="(?:\\/|"+r+"\\/)?"+d:u[f]=r:d===void 0?u[f-1]=p+"(?:\\/|"+r+")?":d!==v.GLOBSTAR&&(u[f-1]=p+"(?:\\/|\\/"+r+"\\/)"+d,u[f+1]=v.GLOBSTAR))}),u.filter(l=>l!==v.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let a=i[i.length-1];if(!a)for(let c=i.length-2;!a&&c>=0;c--)a=i[c];for(let c=0;c<n.length;c++){let h=n[c],u=i;if(r.matchBase&&h.length===1&&(u=[a]),this.matchOne(u,h,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return v.minimatch.defaults(e).Minimatch}};v.Minimatch=Kt;var QO=lc();Object.defineProperty(v,"AST",{enumerable:!0,get:o(function(){return QO.AST},"get")});var ev=fc();Object.defineProperty(v,"escape",{enumerable:!0,get:o(function(){return ev.escape},"get")});var tv=tn();Object.defineProperty(v,"unescape",{enumerable:!0,get:o(function(){return tv.unescape},"get")});v.minimatch.AST=Dp.AST;v.minimatch.Minimatch=Kt;v.minimatch.escape=bO.escape;v.minimatch.unescape=RO.unescape});var em=m(L=>{"use strict";var sv=L&&L.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),rv=L&&L.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),iv=L&&L.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&sv(e,s,t);return rv(e,s),e};Object.defineProperty(L,"__esModule",{value:!0});L.PathScurry=L.Path=L.PathScurryDarwin=L.PathScurryPosix=L.PathScurryWin32=L.PathScurryBase=L.PathPosix=L.PathWin32=L.PathBase=L.ChildrenCache=L.ResolveCache=void 0;var Gp=bs(),fn=require("node:path"),nv=require("node:url"),Tr=require("fs"),ov=iv(require("node:fs")),av=Tr.realpathSync.native,cn=require("node:fs/promises"),qp=ee(),Cr={lstatSync:Tr.lstatSync,readdir:Tr.readdir,readdirSync:Tr.readdirSync,readlinkSync:Tr.readlinkSync,realpathSync:av,promises:{lstat:cn.lstat,readdir:cn.readdir,readlink:cn.readlink,realpath:cn.realpath}},Vp=o(s=>!s||s===Cr||s===ov?Cr:{...Cr,...s,promises:{...Cr.promises,...s.promises||{}}},"fsFromOption"),Wp=/^\\\\\?\\([a-z]:)\\?$/i,cv=o(s=>s.replace(/\//g,"\\").replace(Wp,"$1\\"),"uncToDrive"),hv=/[\\\/]/,Ce=0,Zp=1,Kp=2,Ke=4,Yp=6,Xp=8,Yt=10,Jp=12,Te=15,Ir=~Te,dc=16,Up=32,Ar=64,Me=128,hn=256,ln=512,jp=Ar|Me|ln,uv=1023,pc=o(s=>s.isFile()?Xp:s.isDirectory()?Ke:s.isSymbolicLink()?Yt:s.isCharacterDevice()?Kp:s.isBlockDevice()?Yp:s.isSocket()?Jp:s.isFIFO()?Zp:Ce,"entToType"),Hp=new Map,xr=o(s=>{let e=Hp.get(s);if(e)return e;let t=s.normalize("NFKD");return Hp.set(s,t),t},"normalize"),zp=new Map,un=o(s=>{let e=zp.get(s);if(e)return e;let t=xr(s.toLowerCase());return zp.set(s,t),t},"normalizeNocase"),Br=class extends Gp.LRUCache{static{o(this,"ResolveCache")}constructor(){super({max:256})}};L.ResolveCache=Br;var dn=class extends Gp.LRUCache{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}};L.ChildrenCache=dn;var Qp=Symbol("PathScurry setAsCwd"),J=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#c;get ino(){return this.#c}#p;get size(){return this.#p}#d;get blocks(){return this.#d}#h;get atimeMs(){return this.#h}#n;get mtimeMs(){return this.#n}#g;get ctimeMs(){return this.#g}#_;get birthtimeMs(){return this.#_}#S;get atime(){return this.#S}#y;get mtime(){return this.#y}#C;get ctime(){return this.#C}#E;get birthtime(){return this.#E}#R;#I;#w;#b;#T;#m;#o;#P;#A;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Ce,r,i,n,a,c){this.name=e,this.#R=n?un(e):xr(e),this.#o=t&uv,this.nocase=n,this.roots=i,this.root=r||this,this.#P=a,this.#w=c.fullpath,this.#T=c.relative,this.#m=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=Vp(c.fs)}depth(){return this.#I!==void 0?this.#I:this.parent?this.#I=this.parent.depth()+1:this.#I=0}childrenCache(){return this.#P}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#U(i):this.#U(i)}#U(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#P.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#P.set(this,t),this.#o&=~dc,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?un(e):xr(e);for(let h of r)if(h.#R===i)return h;let n=this.parent?this.sep:"",a=this.#w?this.#w+n+e:void 0,c=this.newChild(e,Ce,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#o|=Me),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#T!==void 0)return this.#T;let e=this.name,t=this.parent;if(!t)return this.#T=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#w=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#o&Te)===Ce}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&Te)===Xp}isDirectory(){return(this.#o&Te)===Ke}isCharacterDevice(){return(this.#o&Te)===Kp}isBlockDevice(){return(this.#o&Te)===Yp}isFIFO(){return(this.#o&Te)===Zp}isSocket(){return(this.#o&Te)===Jp}isSymbolicLink(){return(this.#o&Yt)===Yt}lstatCached(){return this.#o&Up?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#A)return!0;if(!this.parent)return!1;let e=this.#o&Te;return!(e!==Ce&&e!==Yt||this.#o&hn||this.#o&Me)}calledReaddir(){return!!(this.#o&dc)}isENOENT(){return!!(this.#o&Me)}isNamed(e){return this.nocase?this.#R===un(e):this.#R===xr(e)}async readlink(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#A=r}catch(t){this.#j(t.code);return}}readlinkSync(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#A=r}catch(t){this.#j(t.code);return}}#v(e){this.#o|=dc;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#M()}}#M(){this.#o&Me||(this.#o=(this.#o|Me)&Ir,this.#L())}#L(){let e=this.children();e.provisional=0;for(let t of e)t.#M()}#$(){this.#o|=ln,this.#k()}#k(){if(this.#o&Ar)return;let e=this.#o;(e&Te)===Ke&&(e&=Ir),this.#o=e|Ar,this.#L()}#x(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#M():this.children().provisional=0}#N(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#M()}#j(e=""){let t=this.#o;t|=hn,e==="ENOENT"&&(t|=Me),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ir),this.#o=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#D(e,t){return this.#u(e,t)||this.#H(e,t)}#H(e,t){let r=pc(e),i=this.newChild(e.name,r,{parent:this}),n=i.#o&Te;return n!==Ke&&n!==Yt&&n!==Ce&&(i.#o|=Ar),t.unshift(i),t.provisional++,i}#u(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?un(e.name):xr(e.name))===i.#R)return this.#z(e,i,r,t)}}#z(e,t,r,i){let n=t.name;return t.#o=t.#o&Ir|pc(e),n!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#o&Me)===0)try{return this.#F(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#N(e.code)}}lstatSync(){if((this.#o&Me)===0)try{return this.#F(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#N(e.code)}}#F(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:n,blksize:a,blocks:c,ctime:h,ctimeMs:u,dev:l,gid:f,ino:d,mode:p,mtime:y,mtimeMs:g,nlink:w,rdev:S,size:I,uid:T}=e;this.#S=t,this.#h=r,this.#E=i,this.#_=n,this.#f=a,this.#d=c,this.#C=h,this.#g=u,this.#t=l,this.#a=f,this.#c=d,this.#s=p,this.#y=y,this.#n=g,this.#r=w,this.#l=S,this.#p=I,this.#i=T;let _=pc(e);this.#o=this.#o&Ir|_|Up,_!==Ce&&_!==Ke&&_!==Yt&&(this.#o|=Ar)}#B=[];#q=!1;#V(e){this.#q=!1;let t=this.#B.slice();this.#B.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let n=r.slice(0,r.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#B.push(e),this.#q)return;this.#q=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(n,a)=>{if(n)this.#x(n.code),r.provisional=0;else{for(let c of a)this.#D(c,r);this.#v(r)}this.#V(r.slice(0,r.provisional))})}#G;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#G)await this.#G;else{let r=o(()=>{},"resolve");this.#G=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#D(i,e);this.#v(e)}catch(i){this.#x(i.code),e.provisional=0}this.#G=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#D(r,e);this.#v(e)}catch(r){this.#x(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#o&jp)return!1;let e=Te&this.#o;return e===Ce||e===Ke||e===Yt}shouldWalk(e,t){return(this.#o&Ke)===Ke&&!(this.#o&jp)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((ln|hn|Me)&this.#o))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#$()}}realpathSync(){if(this.#O)return this.#O;if(!((ln|hn|Me)&this.#o))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#$()}}[Qp](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],i=this;for(;i&&i.parent;)t.add(i),i.#T=r.join(this.sep),i.#m=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#T=void 0,i.#m=void 0,i=i.parent}};L.PathBase=J;var Nr=class s extends J{static{o(this,"PathWin32")}sep="\\";splitSep=hv;constructor(e,t=Ce,r,i,n,a,c){super(e,t,r,i,n,a,c)}newChild(e,t=Ce,r={}){return new s(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return fn.win32.parse(e).root}getRoot(e){if(e=cv(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new kr(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Wp,"$1\\"),e===t}};L.PathWin32=Nr;var Pr=class s extends J{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=Ce,r,i,n,a,c){super(e,t,r,i,n,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Ce,r={}){return new s(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}};L.PathPosix=Pr;var Lr=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:n=16*1024,fs:a=Cr}={}){this.#r=Vp(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,nv.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Br,this.#t=new Br,this.#s=new dn(n);let h=c.substring(this.rootPath.length).split(r);if(h.length===1&&!h[0]&&h.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let u=this.root,l=h.length-1,f=t.sep,d=this.rootPath,p=!1;for(let y of h){let g=l--;u=u.child(y,{relative:new Array(g).fill("..").join(f),relativePosix:new Array(g).fill("..").join("/"),fullpath:d+=(p?"":f)+y}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#t.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let h=new Set,u=o((f,d)=>{h.add(f),f.readdirCB((p,y)=>{if(p)return d(p);let g=y.length;if(!g)return d();let w=o(()=>{--g===0&&d()},"next");for(let S of y)(!n||n(S))&&c.push(r?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(I=>I?.isUnknown()?I.lstat():I).then(I=>I?.shouldWalk(h,a)?u(I,w):w()):S.shouldWalk(h,a)?u(S,w):w()},!0)},"walk"),l=e;return new Promise((f,d)=>{u(l,p=>{if(p)return d(p);f(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let h=new Set([e]);for(let u of h){let l=u.readdirSync();for(let f of l){(!n||n(f))&&c.push(r?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(h,a)&&h.add(d)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t;(!n||n(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let h of c){let u=h.readdirSync();for(let l of u){(!n||n(l))&&(yield r?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(i&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,a)&&c.add(f)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=new qp.Minipass({objectMode:!0});(!n||n(e))&&c.write(r?e:e.fullpath());let h=new Set,u=[e],l=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){l===0&&c.end();return}l++,h.add(p);let y=o((w,S,I=!1)=>{if(w)return c.emit("error",w);if(i&&!I){let T=[];for(let _ of S)_.isSymbolicLink()&&T.push(_.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(T.length){Promise.all(T).then(()=>y(null,S,!0));return}}for(let T of S)T&&(!n||n(T))&&(c.write(r?T:T.fullpath())||(d=!0));l--;for(let T of S){let _=T.realpathCached()||T;_.shouldWalk(h,a)&&u.push(_)}d&&!c.flowing?c.once("drain",f):g||f()},"onReaddir"),g=!0;p.readdirCB(y,!0),g=!1}},"process");return f(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof J||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=new qp.Minipass({objectMode:!0}),h=new Set;(!n||n(e))&&c.write(r?e:e.fullpath());let u=[e],l=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){l===0&&c.end();return}l++,h.add(p);let y=p.readdirSync();for(let g of y)(!n||n(g))&&(c.write(r?g:g.fullpath())||(d=!0));l--;for(let g of y){let w=g;if(g.isSymbolicLink()){if(!(i&&(w=g.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(h,a)&&u.push(w)}}d&&!c.flowing&&c.once("drain",f)},"process");return f(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Qp](t)}};L.PathScurryBase=Lr;var kr=class extends Lr{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,fn.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return fn.win32.parse(e).root.toUpperCase()}newRoot(e){return new Nr(this.rootPath,Ke,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};L.PathScurryWin32=kr;var Dr=class extends Lr{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,fn.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Pr(this.rootPath,Ke,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};L.PathScurryPosix=Dr;var pn=class extends Dr{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}};L.PathScurryDarwin=pn;L.Path=process.platform==="win32"?Nr:Pr;L.PathScurry=process.platform==="win32"?kr:process.platform==="darwin"?pn:Dr});var gc=m(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.Pattern=void 0;var lv=At(),fv=o(s=>s.length>=1,"isPatternList"),dv=o(s=>s.length>=1,"isGlobList"),mc=class s{static{o(this,"Pattern")}#e;#t;#s;length;#r;#i;#a;#l;#f;#c;#p=!0;constructor(e,t,r,i){if(!fv(e))throw new TypeError("empty pattern list");if(!dv(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#s=r,this.#r=i,this.#s===0){if(this.isUNC()){let[n,a,c,h,...u]=this.#e,[l,f,d,p,...y]=this.#t;u[0]===""&&(u.shift(),y.shift());let g=[n,a,c,h,""].join("/"),w=[l,f,d,p,""].join("/");this.#e=[g,...u],this.#t=[w,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#e,[c,...h]=this.#t;a[0]===""&&(a.shift(),h.shift());let u=n+"/",l=c+"/";this.#e=[u,...a],this.#t=[l,...h],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===lv.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#a=this.#a||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new s(this.#e,this.#t,this.#s+1,this.#r),this.#i.#c=this.#c,this.#i.#f=this.#f,this.#i.#l=this.#l,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#r==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#r==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#p)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#p?!1:(this.#p=!1,!0)}};mn.Pattern=mc});var Ec=m(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.Ignore=void 0;var tm=At(),pv=gc(),mv=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",yc=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:n,platform:a=mv}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new tm.Minimatch(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],n=t.globParts[r];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let a=new pv.Pattern(i,n,0,this.platform),c=new tm.Minimatch(a.globString(),this.mmopts),h=n[n.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),h&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",n=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(n))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};gn.Ignore=yc});var rm=m(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Processor=Ye.SubWalks=Ye.MatchRecord=Ye.HasWalkedCache=void 0;var sm=At(),yn=class s{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new s(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}};Ye.HasWalkedCache=yn;var En=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),n=this.store.get(e);this.store.set(e,n===void 0?i:i&n)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};Ye.MatchRecord=En;var wn=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};Ye.SubWalks=wn;var wc=class s{static{o(this,"Processor")}hasWalkedCache;matches=new En;subwalks=new wn;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new yn}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,n]of r){this.hasWalkedCache.storeWalked(i,n);let a=n.root(),c=n.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=n.rest();if(f)n=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let h,u,l=!1;for(;typeof(h=n.pattern())=="string"&&(u=n.rest());)i=i.resolve(h),n=u,l=!0;if(h=n.pattern(),u=n.rest(),l){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof h=="string"){let f=h===".."||h===""||h===".";this.matches.add(i.resolve(h),c,f);continue}else if(h===sm.GLOBSTAR){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let f=u?.pattern(),d=u?.rest();if(!u||(f===""||f===".")&&!d)this.matches.add(i,c,f===""||f===".");else if(f===".."){let p=i.parent||i;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,c,!0)}}else h instanceof RegExp&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new s(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),i=this.child();for(let n of t)for(let a of r){let c=a.isAbsolute(),h=a.pattern(),u=a.rest();h===sm.GLOBSTAR?i.testGlobstar(n,a,u,c):h instanceof RegExp?i.testRegExp(n,h,u,c):i.testString(n,h,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let n=r.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,r.rest(),i);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,r)}else n instanceof RegExp&&this.testRegExp(e,n,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};Ye.Processor=wc});var om=m(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.GlobStream=xt.GlobWalker=xt.GlobUtil=void 0;var gv=ee(),im=Ec(),nm=rm(),yv=o((s,e)=>typeof s=="string"?new im.Ignore([s],e):Array.isArray(s)?new im.Ignore(s,e):s,"makeIgnore"),Fr=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=yv(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(n?a+n+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new nm.Processor(this.opts),r)}walkCB2(e,t,r,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||(n++,this.match(c,h,u).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let h=c.readdirCached();c.calledReaddir()?this.walkCB3(c,h,r,a):c.readdirCB((u,l)=>this.walkCB3(c,l,r,a),!0)}a()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||(n++,this.match(c,h,u).then(()=>a()));for(let[c,h]of r.subwalks.entries())n++,this.walkCB2(c,h,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new nm.Processor(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||this.matchSync(c,h,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let h=c.readdirSync();this.walkCB3Sync(c,h,r,a)}a()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||this.matchSync(c,h,u);for(let[c,h]of r.subwalks.entries())n++,this.walkCB2Sync(c,h,r.child(),a);a()}};xt.GlobUtil=Fr;var Sc=class extends Fr{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};xt.GlobWalker=Sc;var _c=class extends Fr{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new gv.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};xt.GlobStream=_c});var Rc=m(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.Glob=void 0;var Ev=At(),wv=require("node:url"),Sn=em(),Sv=gc(),_n=om(),_v=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",bc=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,wv.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=e,this.platform=t.platform||_v,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=t.platform==="win32"?Sn.PathScurryWin32:t.platform==="darwin"?Sn.PathScurryDarwin:t.platform?Sn.PathScurryPosix:Sn.PathScurry;this.scurry=new h(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(h=>new Ev.Minimatch(h,i)),[a,c]=n.reduce((h,u)=>(h[0].push(...u.set),h[1].push(...u.globParts),h),[[],[]]);this.patterns=a.map((h,u)=>{let l=c[u];if(!l)throw new Error("invalid pattern object");return new Sv.Pattern(h,l,0,this.platform)})}async walk(){return[...await new _n.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new _n.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new _n.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new _n.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};bn.Glob=bc});var Oc=m(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.hasMagic=void 0;var bv=At(),Rv=o((s,e={})=>{Array.isArray(s)||(s=[s]);for(let t of s)if(new bv.Minimatch(t,e).hasMagic())return!0;return!1},"hasMagic");Rn.hasMagic=Rv});var um=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.glob=N.sync=N.iterate=N.iterateSync=N.stream=N.streamSync=N.Ignore=N.hasMagic=N.Glob=N.unescape=N.escape=void 0;N.globStreamSync=Mr;N.globStream=vc;N.globSync=Ic;N.globIterateSync=$r;N.globIterate=Tc;var am=At(),Xt=Rc(),Ov=Oc(),hm=At();Object.defineProperty(N,"escape",{enumerable:!0,get:o(function(){return hm.escape},"get")});Object.defineProperty(N,"unescape",{enumerable:!0,get:o(function(){return hm.unescape},"get")});var vv=Rc();Object.defineProperty(N,"Glob",{enumerable:!0,get:o(function(){return vv.Glob},"get")});var Iv=Oc();Object.defineProperty(N,"hasMagic",{enumerable:!0,get:o(function(){return Iv.hasMagic},"get")});var Tv=Ec();Object.defineProperty(N,"Ignore",{enumerable:!0,get:o(function(){return Tv.Ignore},"get")});function Mr(s,e={}){return new Xt.Glob(s,e).streamSync()}o(Mr,"globStreamSync");function vc(s,e={}){return new Xt.Glob(s,e).stream()}o(vc,"globStream");function Ic(s,e={}){return new Xt.Glob(s,e).walkSync()}o(Ic,"globSync");async function cm(s,e={}){return new Xt.Glob(s,e).walk()}o(cm,"glob_");function $r(s,e={}){return new Xt.Glob(s,e).iterateSync()}o($r,"globIterateSync");function Tc(s,e={}){return new Xt.Glob(s,e).iterate()}o(Tc,"globIterate");N.streamSync=Mr;N.stream=Object.assign(vc,{sync:Mr});N.iterateSync=$r;N.iterate=Object.assign(Tc,{sync:$r});N.sync=Object.assign(Ic,{stream:Mr,iterate:$r});N.glob=Object.assign(cm,{glob:cm,globSync:Ic,sync:N.sync,globStream:vc,stream:N.stream,globStreamSync:Mr,streamSync:N.streamSync,globIterate:Tc,iterate:N.iterate,globIterateSync:$r,iterateSync:N.iterateSync,Glob:Xt.Glob,hasMagic:Ov.hasMagic,escape:am.escape,unescape:am.unescape});N.glob.glob=N.glob});var Cc=m((UN,fm)=>{"use strict";var{glob:Cv}=um(),lm=require("path"),Av=o(s=>s.split(lm.win32.sep).join(lm.posix.sep),"globify");fm.exports=(s,e)=>Cv(Av(s),e)});var pm=m((HN,dm)=>{"use strict";var xv=require("fs/promises"),Bv=gs(),{hasContent:Nv}=ec();dm.exports=Pv;async function Pv(s,e){let t=await Nv(s,e);return t&&t.sri?(await xv.rm(Bv(s,t.sri),{recursive:!0,force:!0}),!0):!1}o(Pv,"rm")});var gm=m((GN,qr)=>{"use strict";var{rm:Lv}=require("fs/promises"),kv=Cc(),Dv=Ss(),Ac=yr(),Fv=require("path"),Mv=pm();qr.exports=mm;qr.exports.entry=mm;function mm(s,e,t){return Ac.clearMemoized(),Dv.delete(s,e,t)}o(mm,"entry");qr.exports.content=$v;function $v(s,e){return Ac.clearMemoized(),Mv(s,e)}o($v,"content");qr.exports.all=qv;async function qv(s){Ac.clearMemoized();let e=await kv(Fv.join(s,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(t=>Lv(t,{recursive:!0,force:!0})))}o(qv,"all")});var Em=m((WN,Pc)=>{"use strict";var{mkdir:Uv,readFile:jv,rm:Bc,stat:Nc,truncate:Hv,writeFile:zv}=require("fs/promises"),ym=gs(),Gv=Xi(),Vv=Cc(),Bs=Ss(),On=require("path"),xc=Ot(),Wv=o((s,e)=>Object.prototype.hasOwnProperty.call(s,e),"hasOwnProperty"),Zv=o(s=>({concurrency:20,log:{silly(){}},...s}),"verifyOpts");Pc.exports=Kv;async function Kv(s,e){e=Zv(e),e.log.silly("verify","verifying cache at",s);let t=[Yv,Jv,Qv,tI,rI,iI,Xv],r={};for(let i of t){let n=i.name,a=new Date,c=await i(s,e);c&&Object.keys(c).forEach(u=>{r[u]=c[u]});let h=new Date;r.runTime||(r.runTime={}),r.runTime[n]=h-a}return r.runTime.total=r.endTime-r.startTime,e.log.silly("verify","verification finished for",s,"in",`${r.runTime.total}ms`),r}o(Kv,"verify");async function Yv(){return{startTime:new Date}}o(Yv,"markStartTime");async function Xv(){return{endTime:new Date}}o(Xv,"markEndTime");async function Jv(s,e){return e.log.silly("verify","fixing cache permissions"),await Uv(s,{recursive:!0}),null}o(Jv,"fixPerms");async function Qv(s,e){e.log.silly("verify","garbage collecting content");let{default:t}=await Promise.resolve().then(()=>(Di(),ki)),r=Bs.lsStream(s),i=new Set;r.on("data",h=>{if(e.filter&&!e.filter(h))return;let u=xc.parse(h.integrity);for(let l in u)i.add(u[l].toString())}),await new Promise((h,u)=>{r.on("end",h).on("error",u)});let n=ym.contentDir(s),a=await Vv(On.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),c={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await t(a,async h=>{let u=h.split(/[/\\]/),l=u.slice(u.length-3).join(""),f=u[u.length-4],d=xc.fromHex(l,f);if(i.has(d.toString())){let p=await eI(h,d);p.valid?(c.verifiedContent++,c.keptSize+=p.size):(c.reclaimedCount++,c.badContentCount++,c.reclaimedSize+=p.size)}else{c.reclaimedCount++;let p=await Nc(h);await Bc(h,{recursive:!0,force:!0}),c.reclaimedSize+=p.size}return c},{concurrency:e.concurrency}),c}o(Qv,"garbageCollect");async function eI(s,e){let t={};try{let{size:r}=await Nc(s);t.size=r,t.valid=!0,await xc.checkStream(new Gv.ReadStream(s),e)}catch(r){if(r.code==="ENOENT")return{size:0,valid:!1};if(r.code!=="EINTEGRITY")throw r;await Bc(s,{recursive:!0,force:!0}),t.valid=!1}return t}o(eI,"verifyContent");async function tI(s,e){e.log.silly("verify","rebuilding index");let{default:t}=await Promise.resolve().then(()=>(Di(),ki)),r=await Bs.ls(s),i={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(let a in r)if(Wv(r,a)){let c=Bs.hashKey(a),h=r[a],u=e.filter&&!e.filter(h);u&&i.rejectedEntries++,n[c]&&!u?n[c].push(h):n[c]&&u||(u?(n[c]=[],n[c]._path=Bs.bucketPath(s,a)):(n[c]=[h],n[c]._path=Bs.bucketPath(s,a)))}return await t(Object.keys(n),a=>sI(s,n[a],i,e),{concurrency:e.concurrency}),i}o(tI,"rebuildIndex");async function sI(s,e,t){await Hv(e._path);for(let r of e){let i=ym(s,r.integrity);try{await Nc(i),await Bs.insert(s,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),t.totalEntries++}catch(n){if(n.code==="ENOENT")t.rejectedEntries++,t.missingContent++;else throw n}}}o(sI,"rebuildBucket");function rI(s,e){return e.log.silly("verify","cleaning tmp directory"),Bc(On.join(s,"tmp"),{recursive:!0,force:!0})}o(rI,"cleanTmp");async function iI(s,e){let t=On.join(s,"_lastverified");return e.log.silly("verify","writing verifile to "+t),zv(t,`${Date.now()}`)}o(iI,"writeVerifile");Pc.exports.lastRun=nI;async function nI(s){let e=await jv(On.join(s,"_lastverified"),{encoding:"utf8"});return new Date(+e)}o(nI,"lastRun")});var Sm=m((KN,kc)=>{"use strict";var{withTempDir:oI}=Li(),wm=require("fs/promises"),Lc=require("path");kc.exports.mkdir=aI;async function aI(s,e={}){let{tmpPrefix:t}=e,r=Lc.join(s,"tmp");await wm.mkdir(r,{recursive:!0,owner:"inherit"});let i=`${r}${Lc.sep}${t||""}`;return wm.mkdtemp(i,{owner:"inherit"})}o(aI,"mktmpdir");kc.exports.withTmp=cI;function cI(s,e,t){return t||(t=e,e={}),oI(Lc.join(s,"tmp"),t,e)}o(cI,"withTmp")});var Om=m((XN,F)=>{"use strict";var Bt=cp(),_m=Ep(),Dc=gm(),bm=Em(),{clearMemoized:hI}=yr(),Rm=Sm(),vn=Ss();F.exports.index={};F.exports.index.compact=vn.compact;F.exports.index.insert=vn.insert;F.exports.ls=vn.ls;F.exports.ls.stream=vn.lsStream;F.exports.get=Bt;F.exports.get.byDigest=Bt.byDigest;F.exports.get.stream=Bt.stream;F.exports.get.stream.byDigest=Bt.stream.byDigest;F.exports.get.copy=Bt.copy;F.exports.get.copy.byDigest=Bt.copy.byDigest;F.exports.get.info=Bt.info;F.exports.get.hasContent=Bt.hasContent;F.exports.put=_m;F.exports.put.stream=_m.stream;F.exports.rm=Dc.entry;F.exports.rm.all=Dc.all;F.exports.rm.entry=F.exports.rm;F.exports.rm.content=Dc.content;F.exports.clearMemoized=hI;F.exports.tmp={};F.exports.tmp.mkdir=Rm.mkdir;F.exports.tmp.withTmp=Rm.withTmp;F.exports.verify=bm;F.exports.verify.lastRun=bm.lastRun});var Mc=m((JN,vm)=>{"use strict";var uI=ms(),Fc=class extends uI{static{o(this,"CachingMinipassPipeline")}#e=[];#t=new Map;constructor(e,...t){super(),this.#e=e.events,t.length&&this.push(...t)}on(e,t){return this.#e.includes(e)&&this.#t.has(e)?t(...this.#t.get(e)):super.on(e,t)}emit(e,...t){return this.#e.includes(e)&&this.#t.set(e,t),super.emit(e,...t)}};vm.exports=Fc});var Tm=m((eP,Im)=>{var{URL:lI,format:fI}=require("url"),dI={auth:!1,fragment:!1,search:!0,unicode:!1},pI=o(s=>{let e=new lI(s.url);return`make-fetch-happen:request-cache:${fI(e,dI)}`},"cacheKey");Im.exports=pI});var xm=m((sP,Am)=>{"use strict";function Cm(s,e){for(let t in e)Object.defineProperty(s,t,{value:e[t],enumerable:!0,configurable:!0});return s}o(Cm,"assign");function mI(s,e,t){if(!s||typeof s=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=void 0),e!=null&&(t.code=e);try{return Cm(s,t)}catch{t.message=s.message,t.stack=s.stack;let i=o(function(){},"ErrClass");return i.prototype=Object.create(Object.getPrototypeOf(s)),Cm(new i,t)}}o(mI,"createError");Am.exports=mI});var Nm=m((iP,Bm)=>{function Ae(s,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(s)),this._timeouts=s,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._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o(Ae,"RetryOperation");Bm.exports=Ae;Ae.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Ae.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Ae.prototype.retry=function(s){if(this._timeout&&clearTimeout(this._timeout),!s)return!1;var e=new Date().getTime();if(s&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(s);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift();else return!1;var r=this,i=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&i.unref(),!0};Ae.prototype.attempt=function(s,e){this._fn=s,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Ae.prototype.try=function(s){this.attempt(s)};Ae.prototype.start=function(s){this.attempt(s)};Ae.prototype.start=Ae.prototype.try;Ae.prototype.errors=function(){return this._errors};Ae.prototype.attempts=function(){return this._attempts};Ae.prototype.mainError=function(){if(this._errors.length===0)return null;for(var s={},e=null,t=0,r=0;r<this._errors.length;r++){var i=this._errors[r],n=i.message,a=(s[n]||0)+1;s[n]=a,a>=t&&(e=i,t=a)}return e}});var Pm=m(Jt=>{var gI=Nm();Jt.operation=function(s){var e=Jt.timeouts(s);return new gI(e,{forever:s&&s.forever,unref:s&&s.unref,maxRetryTime:s&&s.maxRetryTime})};Jt.timeouts=function(s){if(s instanceof Array)return[].concat(s);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in s)e[t]=s[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],i=0;i<e.retries;i++)r.push(this.createTimeout(i,e));return s&&s.forever&&!r.length&&r.push(this.createTimeout(i,e)),r.sort(function(n,a){return n-a}),r};Jt.createTimeout=function(s,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*e.minTimeout*Math.pow(e.factor,s));return r=Math.min(r,e.maxTimeout),r};Jt.wrap=function(s,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in s)typeof s[r]=="function"&&t.push(r)}for(var i=0;i<t.length;i++){var n=t[i],a=s[n];s[n]=o(function(h){var u=Jt.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(d){u.retry(d)||(d&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){h.apply(s,l)})},"retryWrapper").bind(s,a),s[n].options=e}}});var km=m((cP,Lm)=>{Lm.exports=Pm()});var Mm=m((hP,Fm)=>{"use strict";var yI=xm(),EI=km(),wI=Object.prototype.hasOwnProperty;function Dm(s){return s&&s.code==="EPROMISERETRY"&&wI.call(s,"retried")}o(Dm,"isRetryError");function SI(s,e){var t,r;return typeof s=="object"&&typeof e=="function"&&(t=e,e=s,s=t),r=EI.operation(e),new Promise(function(i,n){r.attempt(function(a){Promise.resolve().then(function(){return s(function(c){throw Dm(c)&&(c=c.retried),yI(new Error("Retrying"),"EPROMISERETRY",{retried:c})},a)}).then(i,function(c){Dm(c)&&(c=c.retried,r.retry(c||new Error))||n(c)})})})}o(SI,"promiseRetry");Fm.exports=SI});var qm=m((lP,$m)=>{var _I=Symbol("proc-log.meta");$m.exports={META:_I,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:o(function(...s){return process.emit("output","standard",...s)},"standard"),error:o(function(...s){return process.emit("output","error",...s)},"error"),buffer:o(function(...s){return process.emit("output","buffer",...s)},"buffer"),flush:o(function(...s){return process.emit("output","flush",...s)},"flush")},log:{LEVELS:["notice","error","warn","info","verbose","http","silly","timing","pause","resume"],KEYS:{notice:"notice",error:"error",warn:"warn",info:"info",verbose:"verbose",http:"http",silly:"silly",timing:"timing",pause:"pause",resume:"resume"},error:o(function(...s){return process.emit("log","error",...s)},"error"),notice:o(function(...s){return process.emit("log","notice",...s)},"notice"),warn:o(function(...s){return process.emit("log","warn",...s)},"warn"),info:o(function(...s){return process.emit("log","info",...s)},"info"),verbose:o(function(...s){return process.emit("log","verbose",...s)},"verbose"),http:o(function(...s){return process.emit("log","http",...s)},"http"),silly:o(function(...s){return process.emit("log","silly",...s)},"silly"),timing:o(function(...s){return process.emit("log","timing",...s)},"timing"),pause:o(function(){return process.emit("log","pause")},"pause"),resume:o(function(){return process.emit("log","resume")},"resume")},time:{LEVELS:["start","end"],KEYS:{start:"start",end:"end"},start:o(function(s,e){process.emit("time","start",s);function t(){return process.emit("time","end",s)}if(o(t,"end"),typeof e=="function"){let r=e();return r&&r.finally?r.finally(t):(t(),r)}return t},"start"),end:o(function(s){return process.emit("time","end",s)},"end")},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:o(function(s){process.emit("input","start");function e(){return process.emit("input","end")}if(o(e,"end"),typeof s=="function"){let t=s();return t&&t.finally?t.finally(e):(e(),t)}return e},"start"),end:o(function(){return process.emit("input","end")},"end"),read:o(function(...s){let e,t,r=new Promise((i,n)=>{e=i,t=n});return process.emit("input","read",e,t,...s),r},"read")}}});var $c=m((dP,jm)=>{"use strict";var{LRUCache:bI}=bs(),Um=require("dns"),In=new bI({max:50}),RI=o(({family:s=0,hints:e=Um.ADDRCONFIG,all:t=!1,verbatim:r=void 0,ttl:i=300*1e3,lookup:n=Um.lookup})=>({hints:e,lookup:o((a,...c)=>{let h=c.pop(),u=c[0]??{},l={family:s,hints:e,all:t,verbatim:r,...typeof u=="number"?{family:u}:u},f=JSON.stringify({hostname:a,...l});if(In.has(f)){let d=In.get(f);return process.nextTick(h,null,...d)}n(a,l,(d,...p)=>d?h(d):(In.set(f,p,{ttl:i}),h(null,...p)))},"lookup")}),"getOptions");jm.exports={cache:In,getOptions:RI}});var qc=m((mP,zm)=>{"use strict";var OI=$c(),vI=o(s=>{let e=parseInt(s.family??"0",10),t=s.keepAlive??!0,r={keepAliveMsecs:t?1e3:void 0,maxSockets:s.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...s,family:e,keepAlive:t,timeouts:{idle:s.timeout??0,connection:0,response:0,transfer:0,...s.timeouts},...OI.getOptions({family:e,...s.dns})};return delete r.timeout,r},"normalizeOptions"),Hm=o(s=>{let e="",t=Object.entries(s).sort((r,i)=>r[0]-i[0]);for(let[r,i]of t)i==null?i="null":i instanceof URL?i=i.toString():typeof i=="object"&&(i=Hm(i)),e+=`${r}:${i}:`;return e},"createKey"),II=o(({secureEndpoint:s,...e})=>Hm({secureEndpoint:!!s,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:s?!!e.rejectUnauthorized:!1,ca:s?e.ca:null,cert:s?e.cert:null,key:s?e.key:null,keepAlive:e.keepAlive,keepAliveMsecs:e.keepAliveMsecs,maxSockets:e.maxSockets,maxTotalSockets:e.maxTotalSockets,maxFreeSockets:e.maxFreeSockets,scheduling:e.scheduling,timeouts:e.timeouts,proxy:e.proxy}),"cacheOptions");zm.exports={normalizeOptions:vI,cacheOptions:II}});var Vm=m((yP,Gm)=>{var Ns=1e3,Ps=Ns*60,Ls=Ps*60,Qt=Ls*24,TI=Qt*7,CI=Qt*365.25;Gm.exports=function(s,e){e=e||{};var t=typeof s;if(t==="string"&&s.length>0)return AI(s);if(t==="number"&&isFinite(s))return e.long?BI(s):xI(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};function AI(s){if(s=String(s),!(s.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*CI;case"weeks":case"week":case"w":return t*TI;case"days":case"day":case"d":return t*Qt;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Ls;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ps;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ns;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}o(AI,"parse");function xI(s){var e=Math.abs(s);return e>=Qt?Math.round(s/Qt)+"d":e>=Ls?Math.round(s/Ls)+"h":e>=Ps?Math.round(s/Ps)+"m":e>=Ns?Math.round(s/Ns)+"s":s+"ms"}o(xI,"fmtShort");function BI(s){var e=Math.abs(s);return e>=Qt?Tn(s,e,Qt,"day"):e>=Ls?Tn(s,e,Ls,"hour"):e>=Ps?Tn(s,e,Ps,"minute"):e>=Ns?Tn(s,e,Ns,"second"):s+" ms"}o(BI,"fmtLong");function Tn(s,e,t,r){var i=e>=t*1.5;return Math.round(s/t)+" "+r+(i?"s":"")}o(Tn,"plural")});var Uc=m((wP,Wm)=>{function NI(s){t.debug=t,t.default=t,t.coerce=h,t.disable=a,t.enable=i,t.enabled=c,t.humanize=Vm(),t.destroy=u,Object.keys(s).forEach(l=>{t[l]=s[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let f=0;for(let d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return t.colors[Math.abs(f)%t.colors.length]}o(e,"selectColor"),t.selectColor=e;function t(l){let f,d=null,p,y;function g(...w){if(!g.enabled)return;let S=g,I=Number(new Date),T=I-(f||I);S.diff=T,S.prev=f,S.curr=I,f=I,w[0]=t.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let _=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(A,P)=>{if(A==="%%")return"%";_++;let z=t.formatters[P];if(typeof z=="function"){let ue=w[_];A=z.call(S,ue),w.splice(_,1),_--}return A}),t.formatArgs.call(S,w),(S.log||t.log).apply(S,w)}return o(g,"debug"),g.namespace=l,g.useColors=t.useColors(),g.color=t.selectColor(l),g.extend=r,g.destroy=t.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:o(()=>d!==null?d:(p!==t.namespaces&&(p=t.namespaces,y=t.enabled(l)),y),"get"),set:o(w=>{d=w},"set")}),typeof t.init=="function"&&t.init(g),g}o(t,"createDebug");function r(l,f){let d=t(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}o(r,"extend");function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let f=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?t.skips.push(d.slice(1)):t.names.push(d)}o(i,"enable");function n(l,f){let d=0,p=0,y=-1,g=0;for(;d<l.length;)if(p<f.length&&(f[p]===l[d]||f[p]==="*"))f[p]==="*"?(y=p,g=d,p++):(d++,p++);else if(y!==-1)p=y+1,g++,d=g;else return!1;for(;p<f.length&&f[p]==="*";)p++;return p===f.length}o(n,"matchesTemplate");function a(){let l=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),l}o(a,"disable");function c(l){for(let f of t.skips)if(n(l,f))return!1;for(let f of t.names)if(n(l,f))return!0;return!1}o(c,"enabled");function h(l){return l instanceof Error?l.stack||l.message:l}o(h,"coerce");function u(){}return o(u,"destroy"),t.enable(t.load()),t}o(NI,"setup");Wm.exports=NI});var Zm=m((pe,Cn)=>{pe.formatArgs=LI;pe.save=kI;pe.load=DI;pe.useColors=PI;pe.storage=FI();pe.destroy=(()=>{let s=!1;return()=>{s||(s=!0)}})();pe.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function PI(){let s;return!1}o(PI,"useColors");function LI(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+Cn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;s.splice(1,0,e,"color: inherit");let t=0,r=0;s[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(r=t))}),s.splice(r,0,e)}o(LI,"formatArgs");pe.log=console.debug||console.log||(()=>{});function kI(s){try{s?pe.storage.setItem("debug",s):pe.storage.removeItem("debug")}catch{}}o(kI,"save");function DI(){let s;try{s=pe.storage.getItem("debug")||pe.storage.getItem("DEBUG")}catch{}return!s&&typeof process<"u"&&"env"in process&&(s=void 0),s}o(DI,"load");function FI(){try{return}catch{}}o(FI,"localstorage");Cn.exports=Uc()(pe);var{formatters:MI}=Cn.exports;MI.j=function(s){try{return JSON.stringify(s)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ym=m((bP,Km)=>{"use strict";Km.exports=(s,e=process.argv)=>{let t=s.startsWith("-")?"":s.length===1?"-":"--",r=e.indexOf(t+s),i=e.indexOf("--");return r!==-1&&(i===-1||r<i)}});var Qm=m((RP,Jm)=>{"use strict";var $I=require("os"),Xm=require("tty"),xe=Ym(),{env:K}=process,Nt;xe("no-color")||xe("no-colors")||xe("color=false")||xe("color=never")?Nt=0:(xe("color")||xe("colors")||xe("color=true")||xe("color=always"))&&(Nt=1);"FORCE_COLOR"in K&&(K.FORCE_COLOR==="true"?Nt=1:K.FORCE_COLOR==="false"?Nt=0:Nt=K.FORCE_COLOR.length===0?1:Math.min(parseInt(K.FORCE_COLOR,10),3));function jc(s){return s===0?!1:{level:s,hasBasic:!0,has256:s>=2,has16m:s>=3}}o(jc,"translateLevel");function Hc(s,e){if(Nt===0)return 0;if(xe("color=16m")||xe("color=full")||xe("color=truecolor"))return 3;if(xe("color=256"))return 2;if(s&&!e&&Nt===void 0)return 0;let t=Nt||0;if(K.TERM==="dumb")return t;if(process.platform==="win32"){let r=$I.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in K)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in K)||K.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in K)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(K.TEAMCITY_VERSION)?1:0;if(K.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in K){let r=parseInt((K.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(K.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(K.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(K.TERM)||"COLORTERM"in K?1:t}o(Hc,"supportsColor");function qI(s){let e=Hc(s,s&&s.isTTY);return jc(e)}o(qI,"getSupportLevel");Jm.exports={supportsColor:qI,stdout:jc(Hc(!0,Xm.isatty(1))),stderr:jc(Hc(!0,Xm.isatty(2)))}});var tg=m((Y,xn)=>{var UI=require("tty"),An=require("util");Y.init=ZI;Y.log=GI;Y.formatArgs=HI;Y.save=VI;Y.load=WI;Y.useColors=jI;Y.destroy=An.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Y.colors=[6,2,3,4,5,1];try{let s=Qm();s&&(s.stderr||s).level>=2&&(Y.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Y.inspectOpts=Object.keys(process.env).filter(s=>/^debug_/i.test(s)).reduce((s,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,n)=>n.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),s[t]=r,s},{});function jI(){return"colors"in Y.inspectOpts?!!Y.inspectOpts.colors:UI.isatty(process.stderr.fd)}o(jI,"useColors");function HI(s){let{namespace:e,useColors:t}=this;if(t){let r=this.color,i="\x1B[3"+(r<8?r:"8;5;"+r),n=` ${i};1m${e} \x1B[0m`;s[0]=n+s[0].split(`
|
|
18
|
-
`).
|
|
19
|
-
`+n),s.push(i+"m+"+xn.exports.humanize(this.diff)+"\x1B[0m")}else s[0]=zI()+e+" "+s[0]}o(HI,"formatArgs");function zI(){return Y.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(zI,"getDate");function GI(...s){return process.stderr.write(An.formatWithOptions(Y.inspectOpts,...s)+`
|
|
20
|
-
`)}o(GI,"log");function VI(s){s?process.env.DEBUG=s:delete void 0}o(VI,"save");function WI(){}o(WI,"load");function ZI(s){s.inspectOpts={};let e=Object.keys(Y.inspectOpts);for(let t=0;t<e.length;t++)s.inspectOpts[e[t]]=Y.inspectOpts[e[t]]}o(ZI,"init");xn.exports=Uc()(Y);var{formatters:eg}=xn.exports;eg.o=function(s){return this.inspectOpts.colors=this.useColors,An.inspect(s,this.inspectOpts).split(`
|
|
21
|
-
`).map(e=>e.trim()).join(" ")};eg.O=function(s){return this.inspectOpts.colors=this.useColors,An.inspect(s,this.inspectOpts)}});var Ur=m((IP,zc)=>{typeof process>"u"||process.type==="renderer"||process.__nwjs?zc.exports=Zm():zc.exports=tg()});var ig=m(me=>{"use strict";var KI=me&&me.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),YI=me&&me.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),sg=me&&me.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&KI(e,s,t);return YI(e,s),e};Object.defineProperty(me,"__esModule",{value:!0});me.req=me.json=me.toBuffer=void 0;var XI=sg(require("http")),JI=sg(require("https"));async function rg(s){let e=0,t=[];for await(let r of s)e+=r.length,t.push(r);return Buffer.concat(t,e)}o(rg,"toBuffer");me.toBuffer=rg;async function QI(s){let t=(await rg(s)).toString("utf8");try{return JSON.parse(t)}catch(r){let i=r;throw i.message+=` (input: ${t})`,i}}o(QI,"json");me.json=QI;function eT(s,e={}){let r=((typeof s=="string"?s:s.href).startsWith("https:")?JI:XI).request(s,e),i=new Promise((n,a)=>{r.once("response",n).once("error",a).end()});return r.then=i.then.bind(i),r}o(eT,"req");me.req=eT});var jr=m(be=>{"use strict";var og=be&&be.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),tT=be&&be.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),ag=be&&be.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&og(e,s,t);return tT(e,s),e},sT=be&&be.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&og(e,s,t)};Object.defineProperty(be,"__esModule",{value:!0});be.Agent=void 0;var rT=ag(require("net")),ng=ag(require("http")),iT=require("https");sT(ig(),be);var Xe=Symbol("AgentBaseInternalState"),Gc=class extends ng.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Xe]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
|
|
22
|
-
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new rT.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],i=r.indexOf(t);i!==-1&&(r.splice(i,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?iT.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){let i={...t,secureEndpoint:this.isSecureEndpoint(t)},n=this.getName(i),a=this.incrementSockets(n);Promise.resolve().then(()=>this.connect(e,i)).then(c=>{if(this.decrementSockets(n,a),c instanceof ng.Agent)try{return c.addRequest(e,i)}catch(h){return r(h)}this[Xe].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(n,a),r(c)})}createConnection(){let e=this[Xe].currentSocket;if(this[Xe].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Xe].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Xe]&&(this[Xe].defaultPort=e)}get protocol(){return this[Xe].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Xe]&&(this[Xe].protocol=e)}};be.Agent=Gc});var ug=m(Be=>{"use strict";var nT=Be&&Be.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),oT=Be&&Be.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),hg=Be&&Be.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&nT(e,s,t);return oT(e,s),e},aT=Be&&Be.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Be,"__esModule",{value:!0});Be.HttpProxyAgent=void 0;var cT=hg(require("net")),hT=hg(require("tls")),uT=aT(Ur()),lT=require("events"),fT=jr(),cg=require("url"),ks=(0,uT.default)("http-proxy-agent"),Bn=class extends fT.Agent{static{o(this,"HttpProxyAgent")}constructor(e,t){super(t),this.proxy=typeof e=="string"?new cg.URL(e):e,this.proxyHeaders=t?.headers??{},ks("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...t?dT(t,"headers"):null,host:r,port:i}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:r}=this,i=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",a=`${i}//${n}`,c=new cg.URL(e.path,a);t.port!==80&&(c.port=String(t.port)),e.path=String(c);let h=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let u=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;h["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}h["Proxy-Connection"]||(h["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(h)){let l=h[u];l&&e.setHeader(u,l)}}async connect(e,t){e._header=null,e.path.includes("://")||this.setRequestProps(e,t);let r,i;ks("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(ks("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,i=r.indexOf(`\r
|
|
15
|
+
Found: ${e}`);return t.code="EINTEGRITY",t.expected=s,t.found=e,t}o(uR,"checksumError")});var sp=m((l1,Wa)=>{"use strict";var Jd=ps(),Qd=cr(),ep=Xd(),lR=hi(),{PassThrough:fR}=Wo(),dR=hs(),tp=o(s=>({algorithms:["sha512"],...s}),"putOpts");Wa.exports=pR;async function pR(s,e,t,r={}){let{memoize:i}=r;r=tp(r);let n=await ep(s,t,r),a=await Jd.insert(s,e,n.integrity,{...r,size:n.size});return i&&Qd.put(s,a,t,r),n.integrity}o(pR,"putData");Wa.exports.stream=mR;function mR(s,e,t={}){let{memoize:r}=t;t=tp(t);let i,n,a,c,h=new dR;if(r){let l=new fR().on("collect",f=>{c=f});h.push(l)}let u=ep.stream(s,t).on("integrity",l=>{i=l}).on("size",l=>{n=l}).on("error",l=>{a=l});return h.push(u),h.push(new lR({async flush(){if(!a){let l=await Jd.insert(s,e,i,{...t,size:n});r&&c&&Qd.put(s,l,c,t),h.emit("integrity",i),h.emit("size",n)}}})),h}o(mR,"putStream")});var ip=m(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.range=Ht.balanced=void 0;var gR=o((s,e,t)=>{let r=s instanceof RegExp?rp(s,t):s,i=e instanceof RegExp?rp(e,t):e,n=r!==null&&i!=null&&(0,Ht.range)(r,i,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+i.length)}},"balanced");Ht.balanced=gR;var rp=o((s,e)=>{let t=e.match(s);return t?t[0]:null},"maybeMatch"),yR=o((s,e,t)=>{let r,i,n,a,c,h=t.indexOf(s),u=t.indexOf(e,h+1),l=h;if(h>=0&&u>0){if(s===e)return[h,u];for(r=[],n=t.length;l>=0&&!c;){if(l===h)r.push(l),h=t.indexOf(s,l+1);else if(r.length===1){let f=r.pop();f!==void 0&&(c=[f,u])}else i=r.pop(),i!==void 0&&i<n&&(n=i,a=u),u=t.indexOf(e,l+1);l=h<u&&h>=0?h:u}r.length&&a!==void 0&&(c=[n,a])}return c},"range");Ht.range=yR});var lp=m(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.expand=CR;var np=ip(),op="\0SLASH"+Math.random()+"\0",ap="\0OPEN"+Math.random()+"\0",Ka="\0CLOSE"+Math.random()+"\0",cp="\0COMMA"+Math.random()+"\0",hp="\0PERIOD"+Math.random()+"\0",ER=new RegExp(op,"g"),wR=new RegExp(ap,"g"),SR=new RegExp(Ka,"g"),_R=new RegExp(cp,"g"),bR=new RegExp(hp,"g"),RR=/\\\\/g,OR=/\\{/g,IR=/\\}/g,vR=/\\,/g,TR=/\\./g;function Za(s){return isNaN(s)?s.charCodeAt(0):parseInt(s,10)}o(Za,"numeric");function AR(s){return s.replace(RR,op).replace(OR,ap).replace(IR,Ka).replace(vR,cp).replace(TR,hp)}o(AR,"escapeBraces");function xR(s){return s.replace(ER,"\\").replace(wR,"{").replace(SR,"}").replace(_R,",").replace(bR,".")}o(xR,"unescapeBraces");function up(s){if(!s)return[""];let e=[],t=(0,np.balanced)("{","}",s);if(!t)return s.split(",");let{pre:r,body:i,post:n}=t,a=r.split(",");a[a.length-1]+="{"+i+"}";let c=up(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(up,"parseCommaParts");function CR(s){return s?(s.slice(0,2)==="{}"&&(s="\\{\\}"+s.slice(2)),mr(AR(s),!0).map(xR)):[]}o(CR,"expand");function BR(s){return"{"+s+"}"}o(BR,"embrace");function NR(s){return/^-?0\d/.test(s)}o(NR,"isPadded");function PR(s,e){return s<=e}o(PR,"lte");function LR(s,e){return s>=e}o(LR,"gte");function mr(s,e){let t=[],r=(0,np.balanced)("{","}",s);if(!r)return[s];let i=r.pre,n=r.post.length?mr(r.post,!1):[""];if(/\$$/.test(r.pre))for(let a=0;a<n.length;a++){let c=i+"{"+r.body+"}"+n[a];t.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),h=a||c,u=r.body.indexOf(",")>=0;if(!h&&!u)return r.post.match(/,(?!,).*\}/)?(s=r.pre+"{"+r.body+Ka+r.post,mr(s)):[s];let l;if(h)l=r.body.split(/\.\./);else if(l=up(r.body),l.length===1&&l[0]!==void 0&&(l=mr(l[0],!1).map(BR),l.length===1))return n.map(d=>r.pre+l[0]+d);let f;if(h&&l[0]!==void 0&&l[1]!==void 0){let d=Za(l[0]),p=Za(l[1]),g=Math.max(l[0].length,l[1].length),y=l.length===3&&l[2]!==void 0?Math.abs(Za(l[2])):1,S=PR;p<d&&(y*=-1,S=LR);let T=l.some(NR);f=[];for(let v=d;S(v,p);v+=y){let R;if(c)R=String.fromCharCode(v),R==="\\"&&(R="");else if(R=String(v),T){let I=g-R.length;if(I>0){let C=new Array(I+1).join("0");v<0?R="-"+C+R.slice(1):R=C+R}}f.push(R)}}else{f=[];for(let d=0;d<l.length;d++)f.push.apply(f,mr(l[d],!1))}for(let d=0;d<f.length;d++)for(let p=0;p<n.length;p++){let g=i+f[d]+n[p];(!e||h||g)&&t.push(g)}}return t}o(mr,"expand_")});var fp=m(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.assertValidPattern=void 0;var kR=1024*64,DR=o(s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>kR)throw new TypeError("pattern is too long")},"assertValidPattern");zi.assertValidPattern=DR});var pp=m(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.parseClass=void 0;var MR={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},gr=o(s=>s.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),$R=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),dp=o(s=>s.join(""),"rangesToString"),FR=o((s,e)=>{let t=e;if(s.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],n=t+1,a=!1,c=!1,h=!1,u=!1,l=t,f="";e:for(;n<s.length;){let y=s.charAt(n);if((y==="!"||y==="^")&&n===t+1){u=!0,n++;continue}if(y==="]"&&a&&!h){l=n+1;break}if(a=!0,y==="\\"&&!h){h=!0,n++;continue}if(y==="["&&!h){for(let[S,[w,T,v]]of Object.entries(MR))if(s.startsWith(S,n)){if(f)return["$.",!1,s.length-t,!0];n+=S.length,v?i.push(w):r.push(w),c=c||T;continue e}}if(h=!1,f){y>f?r.push(gr(f)+"-"+gr(y)):y===f&&r.push(gr(y)),f="",n++;continue}if(s.startsWith("-]",n+1)){r.push(gr(y+"-")),n+=2;continue}if(s.startsWith("-",n+1)){f=y,n+=2;continue}r.push(gr(y)),n++}if(l<n)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,s.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[$R(y),!1,l-t,!1]}let d="["+(u?"^":"")+dp(r)+"]",p="["+(u?"":"^")+dp(i)+"]";return[r.length&&i.length?"("+d+"|"+p+")":r.length?d:p,c,l-t,!0]},"parseClass");Gi.parseClass=FR});var Wi=m(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.unescape=void 0;var qR=o((s,{windowsPathsNoEscape:e=!1}={})=>e?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");Vi.unescape=qR});var Qa=m(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.AST=void 0;var UR=pp(),Zi=Wi(),jR=new Set(["!","?","+","*","@"]),mp=o(s=>jR.has(s),"isExtglobType"),HR="(?!(?:^|/)\\.\\.?(?:$|/))",Ki="(?!\\.)",zR=new Set(["[","."]),GR=new Set(["..","."]),VR=new Set("().*{}+?[]^$\\!"),WR=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Ja="[^/]",gp=Ja+"*?",yp=Ja+"+?",Xa=class s{static{o(this,"AST")}type;#e;#t;#s=!1;#r=[];#i;#a;#l;#f=!1;#c;#p;#d=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?r:this.#e.#c,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#f&&this.#l.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#p!==void 0?this.#p:this.type?this.#p=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#p=this.#r.map(e=>String(e)).join("")}#h(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,r=t.#i;for(;r;){for(let i=t.#a+1;!r.type&&i<r.#r.length;i++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[i])}t=r,r=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof s&&t.#i===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let r=e.#r[t];if(!(r instanceof s&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new s(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#n(e,t,r,i){let n=!1,a=!1,c=-1,h=!1;if(t.type===null){let p=r,g="";for(;p<e.length;){let y=e.charAt(p++);if(n||y==="\\"){n=!n,g+=y;continue}if(a){p===c+1?(y==="^"||y==="!")&&(h=!0):y==="]"&&!(p===c+2&&h)&&(a=!1),g+=y;continue}else if(y==="["){a=!0,c=p,h=!1,g+=y;continue}if(!i.noext&&mp(y)&&e.charAt(p)==="("){t.push(g),g="";let S=new s(y,t);p=s.#n(e,S,p,i),t.push(S);continue}g+=y}return t.push(g),p}let u=r+1,l=new s(null,t),f=[],d="";for(;u<e.length;){let p=e.charAt(u++);if(n||p==="\\"){n=!n,d+=p;continue}if(a){u===c+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(u===c+2&&h)&&(a=!1),d+=p;continue}else if(p==="["){a=!0,c=u,h=!1,d+=p;continue}if(mp(p)&&e.charAt(u)==="("){l.push(d),d="";let g=new s(p,l);l.push(g),u=s.#n(e,g,u,i);continue}if(p==="|"){l.push(d),d="",f.push(l),l=new s(null,t);continue}if(p===")")return d===""&&t.#r.length===0&&(t.#d=!0),l.push(d),d="",t.push(...f,l),u;d+=p}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],u}static fromGlob(e,t={}){let r=new s(null,void 0,t);return s.#n(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,i,n]=this.toRegExpSource();if(!(i||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#c.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&this.#h(),!this.type){let h=this.isStart()&&this.isEnd(),u=this.#r.map(p=>{let[g,y,S,w]=typeof p=="string"?s.#_(p,this.#t,h):p.toRegExpSource(e);return this.#t=this.#t||S,this.#s=this.#s||w,g}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&GR.has(this.#r[0]))){let g=zR,y=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),S=!t&&!e&&g.has(u.charAt(0));l=y?HR:S?Ki:""}let f="";return this.isEnd()&&this.#e.#f&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[l+u+f,(0,Zi.unescape)(u),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#g(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let h=this.toString();return this.#r=[h],this.type=null,this.#t=void 0,[h,(0,Zi.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!Ki?"":this.#g(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#d)c=(this.isStart()&&!t?Ki:"")+yp;else{let h=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Ki:"")+gp+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=i+n+h}return[c,(0,Zi.unescape)(n),this.#t=!!this.#t,this.#s]}#g(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,n,a]=t.toRegExpSource(e);return this.#s=this.#s||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#_(e,t,r=!1){let i=!1,n="",a=!1;for(let c=0;c<e.length;c++){let h=e.charAt(c);if(i){i=!1,n+=(VR.has(h)?"\\":"")+h;continue}if(h==="\\"){c===e.length-1?n+="\\\\":i=!0;continue}if(h==="["){let[u,l,f,d]=(0,UR.parseClass)(e,c);if(f){n+=u,a=a||l,c+=f-1,t=t||d;continue}}if(h==="*"){r&&e==="*"?n+=yp:n+=gp,t=!0;continue}if(h==="?"){n+=Ja,t=!0;continue}n+=WR(h)}return[n,(0,Zi.unescape)(e),!!t,a]}};Yi.AST=Xa});var ec=m(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.escape=void 0;var ZR=o((s,{windowsPathsNoEscape:e=!1}={})=>e?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),"escape");Xi.escape=ZR});var It=m(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.unescape=O.escape=O.AST=O.Minimatch=O.match=O.makeRe=O.braceExpand=O.defaults=O.filter=O.GLOBSTAR=O.sep=O.minimatch=void 0;var KR=lp(),Ji=fp(),Sp=Qa(),YR=ec(),XR=Wi(),JR=o((s,e,t={})=>((0,Ji.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new zt(e,t).match(s)),"minimatch");O.minimatch=JR;var QR=/^\*+([^+@!?\*\[\(]*)$/,eO=o(s=>e=>!e.startsWith(".")&&e.endsWith(s),"starDotExtTest"),tO=o(s=>e=>e.endsWith(s),"starDotExtTestDot"),sO=o(s=>(s=s.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(s)),"starDotExtTestNocase"),rO=o(s=>(s=s.toLowerCase(),e=>e.toLowerCase().endsWith(s)),"starDotExtTestNocaseDot"),iO=/^\*+\.\*+$/,nO=o(s=>!s.startsWith(".")&&s.includes("."),"starDotStarTest"),oO=o(s=>s!=="."&&s!==".."&&s.includes("."),"starDotStarTestDot"),aO=/^\.\*+$/,cO=o(s=>s!=="."&&s!==".."&&s.startsWith("."),"dotStarTest"),hO=/^\*+$/,uO=o(s=>s.length!==0&&!s.startsWith("."),"starTest"),lO=o(s=>s.length!==0&&s!=="."&&s!=="..","starTestDot"),fO=/^\?+([^+@!?\*\[\(]*)?$/,dO=o(([s,e=""])=>{let t=_p([s]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),pO=o(([s,e=""])=>{let t=bp([s]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),mO=o(([s,e=""])=>{let t=bp([s]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),gO=o(([s,e=""])=>{let t=_p([s]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),_p=o(([s])=>{let e=s.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),bp=o(([s])=>{let e=s.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),Rp=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ep={win32:{sep:"\\"},posix:{sep:"/"}};O.sep=Rp==="win32"?Ep.win32.sep:Ep.posix.sep;O.minimatch.sep=O.sep;O.GLOBSTAR=Symbol("globstar **");O.minimatch.GLOBSTAR=O.GLOBSTAR;var yO="[^/]",EO=yO+"*?",wO="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",SO="(?:(?!(?:\\/|^)\\.).)*?",_O=o((s,e={})=>t=>(0,O.minimatch)(t,s,e),"filter");O.filter=_O;O.minimatch.filter=O.filter;var Re=o((s,e={})=>Object.assign({},s,e),"ext"),bO=o(s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return O.minimatch;let e=O.minimatch;return Object.assign(o((r,i,n={})=>e(r,i,Re(s,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(i,n={}){super(i,Re(s,n))}static defaults(i){return e.defaults(Re(s,i)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(i,n,a={}){super(i,n,Re(s,a))}static fromGlob(i,n={}){return e.AST.fromGlob(i,Re(s,n))}},unescape:o((r,i={})=>e.unescape(r,Re(s,i)),"unescape"),escape:o((r,i={})=>e.escape(r,Re(s,i)),"escape"),filter:o((r,i={})=>e.filter(r,Re(s,i)),"filter"),defaults:o(r=>e.defaults(Re(s,r)),"defaults"),makeRe:o((r,i={})=>e.makeRe(r,Re(s,i)),"makeRe"),braceExpand:o((r,i={})=>e.braceExpand(r,Re(s,i)),"braceExpand"),match:o((r,i,n={})=>e.match(r,i,Re(s,n)),"match"),sep:e.sep,GLOBSTAR:O.GLOBSTAR})},"defaults");O.defaults=bO;O.minimatch.defaults=O.defaults;var RO=o((s,e={})=>((0,Ji.assertValidPattern)(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:(0,KR.expand)(s)),"braceExpand");O.braceExpand=RO;O.minimatch.braceExpand=O.braceExpand;var OO=o((s,e={})=>new zt(s,e).makeRe(),"makeRe");O.makeRe=OO;O.minimatch.makeRe=O.makeRe;var IO=o((s,e,t={})=>{let r=new zt(e,t);return s=s.filter(i=>r.match(i)),r.options.nonull&&!s.length&&s.push(e),s},"match");O.match=IO;O.minimatch.match=O.match;var wp=/[?*]|[+@!]\(.*?\)|\[|\]/,vO=o(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),zt=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,Ji.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Rp,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=n[0]===""&&n[1]===""&&(n[2]==="?"||!wp.test(n[2]))&&!wp.test(n[3]),u=/^[a-z]:/i.test(n[0]);if(h)return[...n.slice(0,4),...n.slice(4).map(l=>this.parse(l))];if(u)return[n[0],...n.slice(1).map(l=>this.parse(l))]}return n.map(h=>this.parse(h))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let n=r[r.length-1];return i==="**"&&n==="**"?r:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let n=e[i];i===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let c=r[i+1],h=r[i+2],u=r[i+3];if(c!==".."||!h||h==="."||h===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let h=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...h),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,n=0,a=[],c="";for(;i<e.length&&n<t.length;)if(e[i]===t[n])a.push(c==="b"?t[n]:e[i]),i++,n++;else if(r&&e[i]==="**"&&t[n]===e[i+1])a.push(e[i]),i++;else if(r&&t[n]==="**"&&e[i]===t[n+1])a.push(t[n]),n++;else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[i]),i++,n++}else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),i++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=this.options;if(this.isWindows){let y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),v=S?3:y?0:void 0,R=T?3:w?0:void 0;if(typeof v=="number"&&typeof R=="number"){let[I,C]=[e[v],t[R]];I.toLowerCase()===C.toLowerCase()&&(t[R]=I,R>v?t=t.slice(R):v>R&&(e=e.slice(v)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var a=0,c=0,h=e.length,u=t.length;a<h&&c<u;a++,c++){this.debug("matchOne loop");var l=t[c],f=e[a];if(this.debug(t,l,f),l===!1)return!1;if(l===O.GLOBSTAR){this.debug("GLOBSTAR",[t,l,f]);var d=a,p=c+1;if(p===u){for(this.debug("** at the end");a<h;a++)if(e[a]==="."||e[a]===".."||!i.dot&&e[a].charAt(0)===".")return!1;return!0}for(;d<h;){var g=e[d];if(this.debug(`
|
|
16
|
+
globstar while`,e,d,t,p,g),this.matchOne(e.slice(d),t.slice(p),r))return this.debug("globstar found match!",d,h,g),!0;if(g==="."||g===".."||!i.dot&&g.charAt(0)==="."){this.debug("dot detected!",e,d,t,p);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(r&&(this.debug(`
|
|
17
|
+
>>> no match, partial?`,e,d,t,p),d===h))}let y;if(typeof l=="string"?(y=f===l,this.debug("string match",l,f,y)):(y=l.test(f),this.debug("pattern match",l,f,y)),!y)return!1}if(a===h&&c===u)return!0;if(a===h)return r;if(c===u)return a===h-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,O.braceExpand)(this.pattern,this.options)}parse(e){(0,Ji.assertValidPattern)(e);let t=this.options;if(e==="**")return O.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(hO))?i=t.dot?lO:uO:(r=e.match(QR))?i=(t.nocase?t.dot?rO:sO:t.dot?tO:eO)(r[1]):(r=e.match(fO))?i=(t.nocase?t.dot?pO:dO:t.dot?mO:gO)(r):(r=e.match(iO))?i=t.dot?oO:nO:(r=e.match(aO))&&(i=cO);let n=Sp.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?EO:t.dot?wO:SO,i=new Set(t.nocase?["i"]:[]),n=e.map(h=>{let u=h.map(l=>{if(l instanceof RegExp)for(let f of l.flags.split(""))i.add(f);return typeof l=="string"?vO(l):l===O.GLOBSTAR?O.GLOBSTAR:l._src});return u.forEach((l,f)=>{let d=u[f+1],p=u[f-1];l!==O.GLOBSTAR||p===O.GLOBSTAR||(p===void 0?d!==void 0&&d!==O.GLOBSTAR?u[f+1]="(?:\\/|"+r+"\\/)?"+d:u[f]=r:d===void 0?u[f-1]=p+"(?:\\/|"+r+")?":d!==O.GLOBSTAR&&(u[f-1]=p+"(?:\\/|\\/"+r+"\\/)"+d,u[f+1]=O.GLOBSTAR))}),u.filter(l=>l!==O.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let a=i[i.length-1];if(!a)for(let c=i.length-2;!a&&c>=0;c--)a=i[c];for(let c=0;c<n.length;c++){let h=n[c],u=i;if(r.matchBase&&h.length===1&&(u=[a]),this.matchOne(u,h,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return O.minimatch.defaults(e).Minimatch}};O.Minimatch=zt;var TO=Qa();Object.defineProperty(O,"AST",{enumerable:!0,get:o(function(){return TO.AST},"get")});var AO=ec();Object.defineProperty(O,"escape",{enumerable:!0,get:o(function(){return AO.escape},"get")});var xO=Wi();Object.defineProperty(O,"unescape",{enumerable:!0,get:o(function(){return xO.unescape},"get")});O.minimatch.AST=Sp.AST;O.minimatch.Minimatch=zt;O.minimatch.escape=YR.escape;O.minimatch.unescape=XR.unescape});var $p=m(L=>{"use strict";var CO=L&&L.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),BO=L&&L.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),NO=L&&L.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&CO(e,s,t);return BO(e,s),e};Object.defineProperty(L,"__esModule",{value:!0});L.PathScurry=L.Path=L.PathScurryDarwin=L.PathScurryPosix=L.PathScurryWin32=L.PathScurryBase=L.PathPosix=L.PathWin32=L.PathBase=L.ChildrenCache=L.ResolveCache=void 0;var xp=gs(),rn=require("node:path"),PO=require("node:url"),Er=require("fs"),LO=NO(require("node:fs")),kO=Er.realpathSync.native,Qi=require("node:fs/promises"),Op=J(),wr={lstatSync:Er.lstatSync,readdir:Er.readdir,readdirSync:Er.readdirSync,readlinkSync:Er.readlinkSync,realpathSync:kO,promises:{lstat:Qi.lstat,readdir:Qi.readdir,readlink:Qi.readlink,realpath:Qi.realpath}},Cp=o(s=>!s||s===wr||s===LO?wr:{...wr,...s,promises:{...wr.promises,...s.promises||{}}},"fsFromOption"),Bp=/^\\\\\?\\([a-z]:)\\?$/i,DO=o(s=>s.replace(/\//g,"\\").replace(Bp,"$1\\"),"uncToDrive"),MO=/[\\\/]/,Ie=0,Np=1,Pp=2,Ge=4,Lp=6,kp=8,Gt=10,Dp=12,Oe=15,yr=~Oe,tc=16,Ip=32,Sr=64,Le=128,en=256,sn=512,vp=Sr|Le|sn,$O=1023,sc=o(s=>s.isFile()?kp:s.isDirectory()?Ge:s.isSymbolicLink()?Gt:s.isCharacterDevice()?Pp:s.isBlockDevice()?Lp:s.isSocket()?Dp:s.isFIFO()?Np:Ie,"entToType"),Tp=new Map,_r=o(s=>{let e=Tp.get(s);if(e)return e;let t=s.normalize("NFKD");return Tp.set(s,t),t},"normalize"),Ap=new Map,tn=o(s=>{let e=Ap.get(s);if(e)return e;let t=_r(s.toLowerCase());return Ap.set(s,t),t},"normalizeNocase"),br=class extends xp.LRUCache{static{o(this,"ResolveCache")}constructor(){super({max:256})}};L.ResolveCache=br;var nn=class extends xp.LRUCache{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}};L.ChildrenCache=nn;var Mp=Symbol("PathScurry setAsCwd"),K=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#c;get ino(){return this.#c}#p;get size(){return this.#p}#d;get blocks(){return this.#d}#h;get atimeMs(){return this.#h}#n;get mtimeMs(){return this.#n}#g;get ctimeMs(){return this.#g}#_;get birthtimeMs(){return this.#_}#S;get atime(){return this.#S}#y;get mtime(){return this.#y}#A;get ctime(){return this.#A}#E;get birthtime(){return this.#E}#R;#v;#w;#b;#T;#m;#o;#P;#x;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Ie,r,i,n,a,c){this.name=e,this.#R=n?tn(e):_r(e),this.#o=t&$O,this.nocase=n,this.roots=i,this.root=r||this,this.#P=a,this.#w=c.fullpath,this.#T=c.relative,this.#m=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=Cp(c.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=0}childrenCache(){return this.#P}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#U(i):this.#U(i)}#U(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#P.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#P.set(this,t),this.#o&=~tc,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?tn(e):_r(e);for(let h of r)if(h.#R===i)return h;let n=this.parent?this.sep:"",a=this.#w?this.#w+n+e:void 0,c=this.newChild(e,Ie,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#o|=Le),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#T!==void 0)return this.#T;let e=this.name,t=this.parent;if(!t)return this.#T=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#w=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#o&Oe)===Ie}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&Oe)===kp}isDirectory(){return(this.#o&Oe)===Ge}isCharacterDevice(){return(this.#o&Oe)===Pp}isBlockDevice(){return(this.#o&Oe)===Lp}isFIFO(){return(this.#o&Oe)===Np}isSocket(){return(this.#o&Oe)===Dp}isSymbolicLink(){return(this.#o&Gt)===Gt}lstatCached(){return this.#o&Ip?this:void 0}readlinkCached(){return this.#x}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#x)return!0;if(!this.parent)return!1;let e=this.#o&Oe;return!(e!==Ie&&e!==Gt||this.#o&en||this.#o&Le)}calledReaddir(){return!!(this.#o&tc)}isENOENT(){return!!(this.#o&Le)}isNamed(e){return this.nocase?this.#R===tn(e):this.#R===_r(e)}async readlink(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#x=r}catch(t){this.#j(t.code);return}}readlinkSync(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#x=r}catch(t){this.#j(t.code);return}}#I(e){this.#o|=tc;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#$()}}#$(){this.#o&Le||(this.#o=(this.#o|Le)&yr,this.#L())}#L(){let e=this.children();e.provisional=0;for(let t of e)t.#$()}#F(){this.#o|=sn,this.#k()}#k(){if(this.#o&Sr)return;let e=this.#o;(e&Oe)===Ge&&(e&=yr),this.#o=e|Sr,this.#L()}#C(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#$():this.children().provisional=0}#N(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#$()}#j(e=""){let t=this.#o;t|=en,e==="ENOENT"&&(t|=Le),(e==="EINVAL"||e==="UNKNOWN")&&(t&=yr),this.#o=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#D(e,t){return this.#u(e,t)||this.#H(e,t)}#H(e,t){let r=sc(e),i=this.newChild(e.name,r,{parent:this}),n=i.#o&Oe;return n!==Ge&&n!==Gt&&n!==Ie&&(i.#o|=Sr),t.unshift(i),t.provisional++,i}#u(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?tn(e.name):_r(e.name))===i.#R)return this.#z(e,i,r,t)}}#z(e,t,r,i){let n=t.name;return t.#o=t.#o&yr|sc(e),n!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#o&Le)===0)try{return this.#M(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#N(e.code)}}lstatSync(){if((this.#o&Le)===0)try{return this.#M(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#N(e.code)}}#M(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:n,blksize:a,blocks:c,ctime:h,ctimeMs:u,dev:l,gid:f,ino:d,mode:p,mtime:g,mtimeMs:y,nlink:S,rdev:w,size:T,uid:v}=e;this.#S=t,this.#h=r,this.#E=i,this.#_=n,this.#f=a,this.#d=c,this.#A=h,this.#g=u,this.#t=l,this.#a=f,this.#c=d,this.#s=p,this.#y=g,this.#n=y,this.#r=S,this.#l=w,this.#p=T,this.#i=v;let R=sc(e);this.#o=this.#o&yr|R|Ip,R!==Ie&&R!==Ge&&R!==Gt&&(this.#o|=Sr)}#B=[];#q=!1;#V(e){this.#q=!1;let t=this.#B.slice();this.#B.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let n=r.slice(0,r.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#B.push(e),this.#q)return;this.#q=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(n,a)=>{if(n)this.#C(n.code),r.provisional=0;else{for(let c of a)this.#D(c,r);this.#I(r)}this.#V(r.slice(0,r.provisional))})}#G;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#G)await this.#G;else{let r=o(()=>{},"resolve");this.#G=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#D(i,e);this.#I(e)}catch(i){this.#C(i.code),e.provisional=0}this.#G=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#D(r,e);this.#I(e)}catch(r){this.#C(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#o&vp)return!1;let e=Oe&this.#o;return e===Ie||e===Ge||e===Gt}shouldWalk(e,t){return(this.#o&Ge)===Ge&&!(this.#o&vp)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((sn|en|Le)&this.#o))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#F()}}realpathSync(){if(this.#O)return this.#O;if(!((sn|en|Le)&this.#o))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#F()}}[Mp](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],i=this;for(;i&&i.parent;)t.add(i),i.#T=r.join(this.sep),i.#m=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#T=void 0,i.#m=void 0,i=i.parent}};L.PathBase=K;var Rr=class s extends K{static{o(this,"PathWin32")}sep="\\";splitSep=MO;constructor(e,t=Ie,r,i,n,a,c){super(e,t,r,i,n,a,c)}newChild(e,t=Ie,r={}){return new s(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return rn.win32.parse(e).root}getRoot(e){if(e=DO(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new vr(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Bp,"$1\\"),e===t}};L.PathWin32=Rr;var Or=class s extends K{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=Ie,r,i,n,a,c){super(e,t,r,i,n,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Ie,r={}){return new s(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}};L.PathPosix=Or;var Ir=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:n=16*1024,fs:a=wr}={}){this.#r=Cp(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,PO.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new br,this.#t=new br,this.#s=new nn(n);let h=c.substring(this.rootPath.length).split(r);if(h.length===1&&!h[0]&&h.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let u=this.root,l=h.length-1,f=t.sep,d=this.rootPath,p=!1;for(let g of h){let y=l--;u=u.child(g,{relative:new Array(y).fill("..").join(f),relativePosix:new Array(y).fill("..").join("/"),fullpath:d+=(p?"":f)+g}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#t.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let h=new Set,u=o((f,d)=>{h.add(f),f.readdirCB((p,g)=>{if(p)return d(p);let y=g.length;if(!y)return d();let S=o(()=>{--y===0&&d()},"next");for(let w of g)(!n||n(w))&&c.push(r?w:w.fullpath()),i&&w.isSymbolicLink()?w.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(h,a)?u(T,S):S()):w.shouldWalk(h,a)?u(w,S):S()},!0)},"walk"),l=e;return new Promise((f,d)=>{u(l,p=>{if(p)return d(p);f(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let h=new Set([e]);for(let u of h){let l=u.readdirSync();for(let f of l){(!n||n(f))&&c.push(r?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(h,a)&&h.add(d)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t;(!n||n(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let h of c){let u=h.readdirSync();for(let l of u){(!n||n(l))&&(yield r?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(i&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,a)&&c.add(f)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=new Op.Minipass({objectMode:!0});(!n||n(e))&&c.write(r?e:e.fullpath());let h=new Set,u=[e],l=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){l===0&&c.end();return}l++,h.add(p);let g=o((S,w,T=!1)=>{if(S)return c.emit("error",S);if(i&&!T){let v=[];for(let R of w)R.isSymbolicLink()&&v.push(R.realpath().then(I=>I?.isUnknown()?I.lstat():I));if(v.length){Promise.all(v).then(()=>g(null,w,!0));return}}for(let v of w)v&&(!n||n(v))&&(c.write(r?v:v.fullpath())||(d=!0));l--;for(let v of w){let R=v.realpathCached()||v;R.shouldWalk(h,a)&&u.push(R)}d&&!c.flowing?c.once("drain",f):y||f()},"onReaddir"),y=!0;p.readdirCB(g,!0),y=!1}},"process");return f(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof K||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:n,walkFilter:a}=t,c=new Op.Minipass({objectMode:!0}),h=new Set;(!n||n(e))&&c.write(r?e:e.fullpath());let u=[e],l=0,f=o(()=>{let d=!1;for(;!d;){let p=u.shift();if(!p){l===0&&c.end();return}l++,h.add(p);let g=p.readdirSync();for(let y of g)(!n||n(y))&&(c.write(r?y:y.fullpath())||(d=!0));l--;for(let y of g){let S=y;if(y.isSymbolicLink()){if(!(i&&(S=y.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(h,a)&&u.push(S)}}d&&!c.flowing&&c.once("drain",f)},"process");return f(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Mp](t)}};L.PathScurryBase=Ir;var vr=class extends Ir{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,rn.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return rn.win32.parse(e).root.toUpperCase()}newRoot(e){return new Rr(this.rootPath,Ge,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};L.PathScurryWin32=vr;var Tr=class extends Ir{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,rn.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Or(this.rootPath,Ge,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};L.PathScurryPosix=Tr;var on=class extends Tr{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}};L.PathScurryDarwin=on;L.Path=process.platform==="win32"?Rr:Or;L.PathScurry=process.platform==="win32"?vr:process.platform==="darwin"?on:Tr});var ic=m(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.Pattern=void 0;var FO=It(),qO=o(s=>s.length>=1,"isPatternList"),UO=o(s=>s.length>=1,"isGlobList"),rc=class s{static{o(this,"Pattern")}#e;#t;#s;length;#r;#i;#a;#l;#f;#c;#p=!0;constructor(e,t,r,i){if(!qO(e))throw new TypeError("empty pattern list");if(!UO(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#s=r,this.#r=i,this.#s===0){if(this.isUNC()){let[n,a,c,h,...u]=this.#e,[l,f,d,p,...g]=this.#t;u[0]===""&&(u.shift(),g.shift());let y=[n,a,c,h,""].join("/"),S=[l,f,d,p,""].join("/");this.#e=[y,...u],this.#t=[S,...g],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#e,[c,...h]=this.#t;a[0]===""&&(a.shift(),h.shift());let u=n+"/",l=c+"/";this.#e=[u,...a],this.#t=[l,...h],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===FO.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#a=this.#a||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new s(this.#e,this.#t,this.#s+1,this.#r),this.#i.#c=this.#c,this.#i.#f=this.#f,this.#i.#l=this.#l,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#r==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#r==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#p)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#p?!1:(this.#p=!1,!0)}};an.Pattern=rc});var oc=m(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.Ignore=void 0;var Fp=It(),jO=ic(),HO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",nc=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:n,platform:a=HO}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new Fp.Minimatch(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],n=t.globParts[r];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let a=new jO.Pattern(i,n,0,this.platform),c=new Fp.Minimatch(a.globString(),this.mmopts),h=n[n.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),h&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",n=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(n))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};cn.Ignore=nc});var Up=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Processor=Ve.SubWalks=Ve.MatchRecord=Ve.HasWalkedCache=void 0;var qp=It(),hn=class s{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new s(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}};Ve.HasWalkedCache=hn;var un=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),n=this.store.get(e);this.store.set(e,n===void 0?i:i&n)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};Ve.MatchRecord=un;var ln=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};Ve.SubWalks=ln;var ac=class s{static{o(this,"Processor")}hasWalkedCache;matches=new un;subwalks=new ln;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new hn}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,n]of r){this.hasWalkedCache.storeWalked(i,n);let a=n.root(),c=n.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=n.rest();if(f)n=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let h,u,l=!1;for(;typeof(h=n.pattern())=="string"&&(u=n.rest());)i=i.resolve(h),n=u,l=!0;if(h=n.pattern(),u=n.rest(),l){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof h=="string"){let f=h===".."||h===""||h===".";this.matches.add(i.resolve(h),c,f);continue}else if(h===qp.GLOBSTAR){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let f=u?.pattern(),d=u?.rest();if(!u||(f===""||f===".")&&!d)this.matches.add(i,c,f===""||f===".");else if(f===".."){let p=i.parent||i;d?this.hasWalkedCache.hasWalked(p,d)||this.subwalks.add(p,d):this.matches.add(p,c,!0)}}else h instanceof RegExp&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new s(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),i=this.child();for(let n of t)for(let a of r){let c=a.isAbsolute(),h=a.pattern(),u=a.rest();h===qp.GLOBSTAR?i.testGlobstar(n,a,u,c):h instanceof RegExp?i.testRegExp(n,h,u,c):i.testString(n,h,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let n=r.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,r.rest(),i);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,r)}else n instanceof RegExp&&this.testRegExp(e,n,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};Ve.Processor=ac});var zp=m(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.GlobStream=vt.GlobWalker=vt.GlobUtil=void 0;var zO=J(),jp=oc(),Hp=Up(),GO=o((s,e)=>typeof s=="string"?new jp.Ignore([s],e):Array.isArray(s)?new jp.Ignore(s,e):s,"makeIgnore"),Ar=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=GO(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(n?a+n+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new Hp.Processor(this.opts),r)}walkCB2(e,t,r,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||(n++,this.match(c,h,u).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let h=c.readdirCached();c.calledReaddir()?this.walkCB3(c,h,r,a):c.readdirCB((u,l)=>this.walkCB3(c,l,r,a),!0)}a()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||(n++,this.match(c,h,u).then(()=>a()));for(let[c,h]of r.subwalks.entries())n++,this.walkCB2(c,h,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new Hp.Processor(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||this.matchSync(c,h,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let h=c.readdirSync();this.walkCB3Sync(c,h,r,a)}a()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&i()},"next");for(let[c,h,u]of r.matches.entries())this.#r(c)||this.matchSync(c,h,u);for(let[c,h]of r.subwalks.entries())n++,this.walkCB2Sync(c,h,r.child(),a);a()}};vt.GlobUtil=Ar;var cc=class extends Ar{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};vt.GlobWalker=cc;var hc=class extends Ar{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new zO.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};vt.GlobStream=hc});var lc=m(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.Glob=void 0;var VO=It(),WO=require("node:url"),fn=$p(),ZO=ic(),dn=zp(),KO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",uc=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,WO.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=e,this.platform=t.platform||KO,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=t.platform==="win32"?fn.PathScurryWin32:t.platform==="darwin"?fn.PathScurryDarwin:t.platform?fn.PathScurryPosix:fn.PathScurry;this.scurry=new h(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(h=>new VO.Minimatch(h,i)),[a,c]=n.reduce((h,u)=>(h[0].push(...u.set),h[1].push(...u.globParts),h),[[],[]]);this.patterns=a.map((h,u)=>{let l=c[u];if(!l)throw new Error("invalid pattern object");return new ZO.Pattern(h,l,0,this.platform)})}async walk(){return[...await new dn.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new dn.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new dn.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new dn.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};pn.Glob=uc});var fc=m(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.hasMagic=void 0;var YO=It(),XO=o((s,e={})=>{Array.isArray(s)||(s=[s]);for(let t of s)if(new YO.Minimatch(t,e).hasMagic())return!0;return!1},"hasMagic");mn.hasMagic=XO});var Zp=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.glob=N.sync=N.iterate=N.iterateSync=N.stream=N.streamSync=N.Ignore=N.hasMagic=N.Glob=N.unescape=N.escape=void 0;N.globStreamSync=xr;N.globStream=dc;N.globSync=pc;N.globIterateSync=Cr;N.globIterate=mc;var Gp=It(),Vt=lc(),JO=fc(),Wp=It();Object.defineProperty(N,"escape",{enumerable:!0,get:o(function(){return Wp.escape},"get")});Object.defineProperty(N,"unescape",{enumerable:!0,get:o(function(){return Wp.unescape},"get")});var QO=lc();Object.defineProperty(N,"Glob",{enumerable:!0,get:o(function(){return QO.Glob},"get")});var eI=fc();Object.defineProperty(N,"hasMagic",{enumerable:!0,get:o(function(){return eI.hasMagic},"get")});var tI=oc();Object.defineProperty(N,"Ignore",{enumerable:!0,get:o(function(){return tI.Ignore},"get")});function xr(s,e={}){return new Vt.Glob(s,e).streamSync()}o(xr,"globStreamSync");function dc(s,e={}){return new Vt.Glob(s,e).stream()}o(dc,"globStream");function pc(s,e={}){return new Vt.Glob(s,e).walkSync()}o(pc,"globSync");async function Vp(s,e={}){return new Vt.Glob(s,e).walk()}o(Vp,"glob_");function Cr(s,e={}){return new Vt.Glob(s,e).iterateSync()}o(Cr,"globIterateSync");function mc(s,e={}){return new Vt.Glob(s,e).iterate()}o(mc,"globIterate");N.streamSync=xr;N.stream=Object.assign(dc,{sync:xr});N.iterateSync=Cr;N.iterate=Object.assign(mc,{sync:Cr});N.sync=Object.assign(pc,{stream:xr,iterate:Cr});N.glob=Object.assign(Vp,{glob:Vp,globSync:pc,sync:N.sync,globStream:dc,stream:N.stream,globStreamSync:xr,streamSync:N.streamSync,globIterate:mc,iterate:N.iterate,globIterateSync:Cr,iterateSync:N.iterateSync,Glob:Vt.Glob,hasMagic:JO.hasMagic,escape:Gp.escape,unescape:Gp.unescape});N.glob.glob=N.glob});var gc=m((W1,Yp)=>{"use strict";var{glob:sI}=Zp(),Kp=require("path"),rI=o(s=>s.split(Kp.win32.sep).join(Kp.posix.sep),"globify");Yp.exports=(s,e)=>sI(rI(s),e)});var Jp=m((K1,Xp)=>{"use strict";var iI=require("fs/promises"),nI=us(),{hasContent:oI}=ja();Xp.exports=aI;async function aI(s,e){let t=await oI(s,e);return t&&t.sri?(await iI.rm(nI(s,t.sri),{recursive:!0,force:!0}),!0):!1}o(aI,"rm")});var em=m((X1,Br)=>{"use strict";var{rm:cI}=require("fs/promises"),hI=gc(),uI=ps(),yc=cr(),lI=require("path"),fI=Jp();Br.exports=Qp;Br.exports.entry=Qp;function Qp(s,e,t){return yc.clearMemoized(),uI.delete(s,e,t)}o(Qp,"entry");Br.exports.content=dI;function dI(s,e){return yc.clearMemoized(),fI(s,e)}o(dI,"content");Br.exports.all=pI;async function pI(s){yc.clearMemoized();let e=await hI(lI.join(s,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(t=>cI(t,{recursive:!0,force:!0})))}o(pI,"all")});var sm=m((Q1,_c)=>{"use strict";var{mkdir:mI,readFile:gI,rm:wc,stat:Sc,truncate:yI,writeFile:EI}=require("fs/promises"),tm=us(),wI=Hi(),SI=gc(),Is=ps(),gn=require("path"),Ec=St(),_I=o((s,e)=>Object.prototype.hasOwnProperty.call(s,e),"hasOwnProperty"),bI=o(s=>({concurrency:20,log:{silly(){}},...s}),"verifyOpts");_c.exports=RI;async function RI(s,e){e=bI(e),e.log.silly("verify","verifying cache at",s);let t=[OI,vI,TI,xI,BI,NI,II],r={};for(let i of t){let n=i.name,a=new Date,c=await i(s,e);c&&Object.keys(c).forEach(u=>{r[u]=c[u]});let h=new Date;r.runTime||(r.runTime={}),r.runTime[n]=h-a}return r.runTime.total=r.endTime-r.startTime,e.log.silly("verify","verification finished for",s,"in",`${r.runTime.total}ms`),r}o(RI,"verify");async function OI(){return{startTime:new Date}}o(OI,"markStartTime");async function II(){return{endTime:new Date}}o(II,"markEndTime");async function vI(s,e){return e.log.silly("verify","fixing cache permissions"),await mI(s,{recursive:!0}),null}o(vI,"fixPerms");async function TI(s,e){e.log.silly("verify","garbage collecting content");let{default:t}=await Promise.resolve().then(()=>(Ai(),Ti)),r=Is.lsStream(s),i=new Set;r.on("data",h=>{if(e.filter&&!e.filter(h))return;let u=Ec.parse(h.integrity);for(let l in u)i.add(u[l].toString())}),await new Promise((h,u)=>{r.on("end",h).on("error",u)});let n=tm.contentDir(s),a=await SI(gn.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),c={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await t(a,async h=>{let u=h.split(/[/\\]/),l=u.slice(u.length-3).join(""),f=u[u.length-4],d=Ec.fromHex(l,f);if(i.has(d.toString())){let p=await AI(h,d);p.valid?(c.verifiedContent++,c.keptSize+=p.size):(c.reclaimedCount++,c.badContentCount++,c.reclaimedSize+=p.size)}else{c.reclaimedCount++;let p=await Sc(h);await wc(h,{recursive:!0,force:!0}),c.reclaimedSize+=p.size}return c},{concurrency:e.concurrency}),c}o(TI,"garbageCollect");async function AI(s,e){let t={};try{let{size:r}=await Sc(s);t.size=r,t.valid=!0,await Ec.checkStream(new wI.ReadStream(s),e)}catch(r){if(r.code==="ENOENT")return{size:0,valid:!1};if(r.code!=="EINTEGRITY")throw r;await wc(s,{recursive:!0,force:!0}),t.valid=!1}return t}o(AI,"verifyContent");async function xI(s,e){e.log.silly("verify","rebuilding index");let{default:t}=await Promise.resolve().then(()=>(Ai(),Ti)),r=await Is.ls(s),i={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(let a in r)if(_I(r,a)){let c=Is.hashKey(a),h=r[a],u=e.filter&&!e.filter(h);u&&i.rejectedEntries++,n[c]&&!u?n[c].push(h):n[c]&&u||(u?(n[c]=[],n[c]._path=Is.bucketPath(s,a)):(n[c]=[h],n[c]._path=Is.bucketPath(s,a)))}return await t(Object.keys(n),a=>CI(s,n[a],i,e),{concurrency:e.concurrency}),i}o(xI,"rebuildIndex");async function CI(s,e,t){await yI(e._path);for(let r of e){let i=tm(s,r.integrity);try{await Sc(i),await Is.insert(s,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),t.totalEntries++}catch(n){if(n.code==="ENOENT")t.rejectedEntries++,t.missingContent++;else throw n}}}o(CI,"rebuildBucket");function BI(s,e){return e.log.silly("verify","cleaning tmp directory"),wc(gn.join(s,"tmp"),{recursive:!0,force:!0})}o(BI,"cleanTmp");async function NI(s,e){let t=gn.join(s,"_lastverified");return e.log.silly("verify","writing verifile to "+t),EI(t,`${Date.now()}`)}o(NI,"writeVerifile");_c.exports.lastRun=PI;async function PI(s){let e=await gI(gn.join(s,"_lastverified"),{encoding:"utf8"});return new Date(+e)}o(PI,"lastRun")});var im=m((tN,Rc)=>{"use strict";var{withTempDir:LI}=vi(),rm=require("fs/promises"),bc=require("path");Rc.exports.mkdir=kI;async function kI(s,e={}){let{tmpPrefix:t}=e,r=bc.join(s,"tmp");await rm.mkdir(r,{recursive:!0,owner:"inherit"});let i=`${r}${bc.sep}${t||""}`;return rm.mkdtemp(i,{owner:"inherit"})}o(kI,"mktmpdir");Rc.exports.withTmp=DI;function DI(s,e,t){return t||(t=e,e={}),LI(bc.join(s,"tmp"),t,e)}o(DI,"withTmp")});var cm=m((rN,M)=>{"use strict";var Tt=Vd(),nm=sp(),Oc=em(),om=sm(),{clearMemoized:MI}=cr(),am=im(),yn=ps();M.exports.index={};M.exports.index.compact=yn.compact;M.exports.index.insert=yn.insert;M.exports.ls=yn.ls;M.exports.ls.stream=yn.lsStream;M.exports.get=Tt;M.exports.get.byDigest=Tt.byDigest;M.exports.get.stream=Tt.stream;M.exports.get.stream.byDigest=Tt.stream.byDigest;M.exports.get.copy=Tt.copy;M.exports.get.copy.byDigest=Tt.copy.byDigest;M.exports.get.info=Tt.info;M.exports.get.hasContent=Tt.hasContent;M.exports.put=nm;M.exports.put.stream=nm.stream;M.exports.rm=Oc.entry;M.exports.rm.all=Oc.all;M.exports.rm.entry=M.exports.rm;M.exports.rm.content=Oc.content;M.exports.clearMemoized=MI;M.exports.tmp={};M.exports.tmp.mkdir=am.mkdir;M.exports.tmp.withTmp=am.withTmp;M.exports.verify=om;M.exports.verify.lastRun=om.lastRun});var vc=m((iN,hm)=>{"use strict";var $I=hs(),Ic=class extends $I{static{o(this,"CachingMinipassPipeline")}#e=[];#t=new Map;constructor(e,...t){super(),this.#e=e.events,t.length&&this.push(...t)}on(e,t){return this.#e.includes(e)&&this.#t.has(e)?t(...this.#t.get(e)):super.on(e,t)}emit(e,...t){return this.#e.includes(e)&&this.#t.set(e,t),super.emit(e,...t)}};hm.exports=Ic});var lm=m((oN,um)=>{var{URL:FI,format:qI}=require("url"),UI={auth:!1,fragment:!1,search:!0,unicode:!1},jI=o(s=>{let e=new FI(s.url);return`make-fetch-happen:request-cache:${qI(e,UI)}`},"cacheKey");um.exports=jI});var pm=m((cN,dm)=>{"use strict";function fm(s,e){for(let t in e)Object.defineProperty(s,t,{value:e[t],enumerable:!0,configurable:!0});return s}o(fm,"assign");function HI(s,e,t){if(!s||typeof s=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=void 0),e!=null&&(t.code=e);try{return fm(s,t)}catch{t.message=s.message,t.stack=s.stack;let i=o(function(){},"ErrClass");return i.prototype=Object.create(Object.getPrototypeOf(s)),fm(new i,t)}}o(HI,"createError");dm.exports=HI});var gm=m((uN,mm)=>{function ve(s,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(s)),this._timeouts=s,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._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o(ve,"RetryOperation");mm.exports=ve;ve.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};ve.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};ve.prototype.retry=function(s){if(this._timeout&&clearTimeout(this._timeout),!s)return!1;var e=new Date().getTime();if(s&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(s);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift();else return!1;var r=this,i=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&i.unref(),!0};ve.prototype.attempt=function(s,e){this._fn=s,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};ve.prototype.try=function(s){this.attempt(s)};ve.prototype.start=function(s){this.attempt(s)};ve.prototype.start=ve.prototype.try;ve.prototype.errors=function(){return this._errors};ve.prototype.attempts=function(){return this._attempts};ve.prototype.mainError=function(){if(this._errors.length===0)return null;for(var s={},e=null,t=0,r=0;r<this._errors.length;r++){var i=this._errors[r],n=i.message,a=(s[n]||0)+1;s[n]=a,a>=t&&(e=i,t=a)}return e}});var ym=m(Wt=>{var zI=gm();Wt.operation=function(s){var e=Wt.timeouts(s);return new zI(e,{forever:s&&s.forever,unref:s&&s.unref,maxRetryTime:s&&s.maxRetryTime})};Wt.timeouts=function(s){if(s instanceof Array)return[].concat(s);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in s)e[t]=s[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],i=0;i<e.retries;i++)r.push(this.createTimeout(i,e));return s&&s.forever&&!r.length&&r.push(this.createTimeout(i,e)),r.sort(function(n,a){return n-a}),r};Wt.createTimeout=function(s,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*e.minTimeout*Math.pow(e.factor,s));return r=Math.min(r,e.maxTimeout),r};Wt.wrap=function(s,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in s)typeof s[r]=="function"&&t.push(r)}for(var i=0;i<t.length;i++){var n=t[i],a=s[n];s[n]=o(function(h){var u=Wt.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(d){u.retry(d)||(d&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){h.apply(s,l)})},"retryWrapper").bind(s,a),s[n].options=e}}});var wm=m((pN,Em)=>{Em.exports=ym()});var bm=m((mN,_m)=>{"use strict";var GI=pm(),VI=wm(),WI=Object.prototype.hasOwnProperty;function Sm(s){return s&&s.code==="EPROMISERETRY"&&WI.call(s,"retried")}o(Sm,"isRetryError");function ZI(s,e){var t,r;return typeof s=="object"&&typeof e=="function"&&(t=e,e=s,s=t),r=VI.operation(e),new Promise(function(i,n){r.attempt(function(a){Promise.resolve().then(function(){return s(function(c){throw Sm(c)&&(c=c.retried),GI(new Error("Retrying"),"EPROMISERETRY",{retried:c})},a)}).then(i,function(c){Sm(c)&&(c=c.retried,r.retry(c||new Error))||n(c)})})})}o(ZI,"promiseRetry");_m.exports=ZI});var Om=m((yN,Rm)=>{var KI=Symbol("proc-log.meta");Rm.exports={META:KI,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:o(function(...s){return process.emit("output","standard",...s)},"standard"),error:o(function(...s){return process.emit("output","error",...s)},"error"),buffer:o(function(...s){return process.emit("output","buffer",...s)},"buffer"),flush:o(function(...s){return process.emit("output","flush",...s)},"flush")},log:{LEVELS:["notice","error","warn","info","verbose","http","silly","timing","pause","resume"],KEYS:{notice:"notice",error:"error",warn:"warn",info:"info",verbose:"verbose",http:"http",silly:"silly",timing:"timing",pause:"pause",resume:"resume"},error:o(function(...s){return process.emit("log","error",...s)},"error"),notice:o(function(...s){return process.emit("log","notice",...s)},"notice"),warn:o(function(...s){return process.emit("log","warn",...s)},"warn"),info:o(function(...s){return process.emit("log","info",...s)},"info"),verbose:o(function(...s){return process.emit("log","verbose",...s)},"verbose"),http:o(function(...s){return process.emit("log","http",...s)},"http"),silly:o(function(...s){return process.emit("log","silly",...s)},"silly"),timing:o(function(...s){return process.emit("log","timing",...s)},"timing"),pause:o(function(){return process.emit("log","pause")},"pause"),resume:o(function(){return process.emit("log","resume")},"resume")},time:{LEVELS:["start","end"],KEYS:{start:"start",end:"end"},start:o(function(s,e){process.emit("time","start",s);function t(){return process.emit("time","end",s)}if(o(t,"end"),typeof e=="function"){let r=e();return r&&r.finally?r.finally(t):(t(),r)}return t},"start"),end:o(function(s){return process.emit("time","end",s)},"end")},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:o(function(s){process.emit("input","start");function e(){return process.emit("input","end")}if(o(e,"end"),typeof s=="function"){let t=s();return t&&t.finally?t.finally(e):(e(),t)}return e},"start"),end:o(function(){return process.emit("input","end")},"end"),read:o(function(...s){let e,t,r=new Promise((i,n)=>{e=i,t=n});return process.emit("input","read",e,t,...s),r},"read")}}});var Tc=m((wN,vm)=>{"use strict";var{LRUCache:YI}=gs(),Im=require("dns"),En=new YI({max:50}),XI=o(({family:s=0,hints:e=Im.ADDRCONFIG,all:t=!1,verbatim:r=void 0,ttl:i=300*1e3,lookup:n=Im.lookup})=>({hints:e,lookup:o((a,...c)=>{let h=c.pop(),u=c[0]??{},l={family:s,hints:e,all:t,verbatim:r,...typeof u=="number"?{family:u}:u},f=JSON.stringify({hostname:a,...l});if(En.has(f)){let d=En.get(f);return process.nextTick(h,null,...d)}n(a,l,(d,...p)=>d?h(d):(En.set(f,p,{ttl:i}),h(null,...p)))},"lookup")}),"getOptions");vm.exports={cache:En,getOptions:XI}});var Ac=m((_N,Am)=>{"use strict";var JI=Tc(),QI=o(s=>{let e=parseInt(s.family??"0",10),t=s.keepAlive??!0,r={keepAliveMsecs:t?1e3:void 0,maxSockets:s.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...s,family:e,keepAlive:t,timeouts:{idle:s.timeout??0,connection:0,response:0,transfer:0,...s.timeouts},...JI.getOptions({family:e,...s.dns})};return delete r.timeout,r},"normalizeOptions"),Tm=o(s=>{let e="",t=Object.entries(s).sort((r,i)=>r[0]-i[0]);for(let[r,i]of t)i==null?i="null":i instanceof URL?i=i.toString():typeof i=="object"&&(i=Tm(i)),e+=`${r}:${i}:`;return e},"createKey"),ev=o(({secureEndpoint:s,...e})=>Tm({secureEndpoint:!!s,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:s?!!e.rejectUnauthorized:!1,ca:s?e.ca:null,cert:s?e.cert:null,key:s?e.key:null,keepAlive:e.keepAlive,keepAliveMsecs:e.keepAliveMsecs,maxSockets:e.maxSockets,maxTotalSockets:e.maxTotalSockets,maxFreeSockets:e.maxFreeSockets,scheduling:e.scheduling,timeouts:e.timeouts,proxy:e.proxy}),"cacheOptions");Am.exports={normalizeOptions:QI,cacheOptions:ev}});var Pr=m((RN,xm)=>{"use strict";function Nr(){return o(function(){},"noop")}o(Nr,"debug");Nr.enabled=!1;Nr.names=[];Nr.skips=[];Nr.formatters={};xm.exports=Nr});var Nm=m(le=>{"use strict";var tv=le&&le.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),sv=le&&le.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Cm=le&&le.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&tv(e,s,t);return sv(e,s),e};Object.defineProperty(le,"__esModule",{value:!0});le.req=le.json=le.toBuffer=void 0;var rv=Cm(require("http")),iv=Cm(require("https"));async function Bm(s){let e=0,t=[];for await(let r of s)e+=r.length,t.push(r);return Buffer.concat(t,e)}o(Bm,"toBuffer");le.toBuffer=Bm;async function nv(s){let t=(await Bm(s)).toString("utf8");try{return JSON.parse(t)}catch(r){let i=r;throw i.message+=` (input: ${t})`,i}}o(nv,"json");le.json=nv;function ov(s,e={}){let r=((typeof s=="string"?s:s.href).startsWith("https:")?iv:rv).request(s,e),i=new Promise((n,a)=>{r.once("response",n).once("error",a).end()});return r.then=i.then.bind(i),r}o(ov,"req");le.req=ov});var Lr=m(Ee=>{"use strict";var Lm=Ee&&Ee.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),av=Ee&&Ee.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),km=Ee&&Ee.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Lm(e,s,t);return av(e,s),e},cv=Ee&&Ee.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Lm(e,s,t)};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.Agent=void 0;var hv=km(require("net")),Pm=km(require("http")),uv=require("https");cv(Nm(),Ee);var We=Symbol("AgentBaseInternalState"),xc=class extends Pm.Agent{static{o(this,"Agent")}constructor(e){super(e),this[We]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
|
|
18
|
+
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new hv.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],i=r.indexOf(t);i!==-1&&(r.splice(i,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?uv.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){let i={...t,secureEndpoint:this.isSecureEndpoint(t)},n=this.getName(i),a=this.incrementSockets(n);Promise.resolve().then(()=>this.connect(e,i)).then(c=>{if(this.decrementSockets(n,a),c instanceof Pm.Agent)try{return c.addRequest(e,i)}catch(h){return r(h)}this[We].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(n,a),r(c)})}createConnection(){let e=this[We].currentSocket;if(this[We].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[We].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[We]&&(this[We].defaultPort=e)}get protocol(){return this[We].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[We]&&(this[We].protocol=e)}};Ee.Agent=xc});var $m=m(Te=>{"use strict";var lv=Te&&Te.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),fv=Te&&Te.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Mm=Te&&Te.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&lv(e,s,t);return fv(e,s),e},dv=Te&&Te.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Te,"__esModule",{value:!0});Te.HttpProxyAgent=void 0;var pv=Mm(require("net")),mv=Mm(require("tls")),gv=dv(Pr()),yv=require("events"),Ev=Lr(),Dm=require("url"),vs=(0,gv.default)("http-proxy-agent"),wn=class extends Ev.Agent{static{o(this,"HttpProxyAgent")}constructor(e,t){super(t),this.proxy=typeof e=="string"?new Dm.URL(e):e,this.proxyHeaders=t?.headers??{},vs("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...t?wv(t,"headers"):null,host:r,port:i}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:r}=this,i=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",a=`${i}//${n}`,c=new Dm.URL(e.path,a);t.port!==80&&(c.port=String(t.port)),e.path=String(c);let h=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let u=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;h["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}h["Proxy-Connection"]||(h["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(h)){let l=h[u];l&&e.setHeader(u,l)}}async connect(e,t){e._header=null,e.path.includes("://")||this.setRequestProps(e,t);let r,i;vs("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(vs("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,i=r.indexOf(`\r
|
|
23
19
|
\r
|
|
24
|
-
`)+4,e.outputData[0].data=e._header+r.substring(i),
|
|
20
|
+
`)+4,e.outputData[0].data=e._header+r.substring(i),vs("Output buffer: %o",e.outputData[0].data));let n;return this.proxy.protocol==="https:"?(vs("Creating `tls.Socket`: %o",this.connectOpts),n=mv.connect(this.connectOpts)):(vs("Creating `net.Socket`: %o",this.connectOpts),n=pv.connect(this.connectOpts)),await(0,yv.once)(n,"connect"),n}};wn.protocols=["http","https"];Te.HttpProxyAgent=wn;function wv(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(wv,"omit")});var Fm=m(Ts=>{"use strict";var Sv=Ts&&Ts.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.parseProxyResponse=void 0;var _v=Sv(Pr()),Sn=(0,_v.default)("https-proxy-agent:parse-proxy-response");function bv(s){return new Promise((e,t)=>{let r=0,i=[];function n(){let l=s.read();l?u(l):s.once("readable",n)}o(n,"read");function a(){s.removeListener("end",c),s.removeListener("error",h),s.removeListener("readable",n)}o(a,"cleanup");function c(){a(),Sn("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}o(c,"onend");function h(l){a(),Sn("onerror %o",l),t(l)}o(h,"onerror");function u(l){i.push(l),r+=l.length;let f=Buffer.concat(i,r),d=f.indexOf(`\r
|
|
25
21
|
\r
|
|
26
|
-
`);if(d===-1){
|
|
27
|
-
`),
|
|
22
|
+
`);if(d===-1){Sn("have not received end of HTTP headers yet..."),n();return}let p=f.slice(0,d).toString("ascii").split(`\r
|
|
23
|
+
`),g=p.shift();if(!g)return s.destroy(),t(new Error("No header received from proxy CONNECT response"));let y=g.split(" "),S=+y[1],w=y.slice(2).join(" "),T={};for(let v of p){if(!v)continue;let R=v.indexOf(":");if(R===-1)return s.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${v}"`));let I=v.slice(0,R).toLowerCase(),C=v.slice(R+1).trimStart(),P=T[I];typeof P=="string"?T[I]=[P,C]:Array.isArray(P)?P.push(C):T[I]=C}Sn("got proxy server response: %o %o",g,T),a(),e({connect:{statusCode:S,statusText:w,headers:T},buffered:f})}o(u,"ondata"),s.on("error",h),s.on("end",c),n()})}o(bv,"parseProxyResponse");Ts.parseProxyResponse=bv});var Gm=m(Ae=>{"use strict";var Rv=Ae&&Ae.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),Ov=Ae&&Ae.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Hm=Ae&&Ae.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Rv(e,s,t);return Ov(e,s),e},zm=Ae&&Ae.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.HttpsProxyAgent=void 0;var _n=Hm(require("net")),qm=Hm(require("tls")),Iv=zm(require("assert")),vv=zm(Pr()),Tv=Lr(),Av=require("url"),xv=Fm(),kr=(0,vv.default)("https-proxy-agent"),Um=o(s=>s.servername===void 0&&s.host&&!_n.isIP(s.host)?{...s,servername:s.host}:s,"setServernameFromNonIpHost"),bn=class extends Tv.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new Av.URL(e):e,this.proxyHeaders=t?.headers??{},kr("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?jm(t,"headers"):null,host:r,port:i}}async connect(e,t){let{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let i;r.protocol==="https:"?(kr("Creating `tls.Socket`: %o",this.connectOpts),i=qm.connect(Um(this.connectOpts))):(kr("Creating `net.Socket`: %o",this.connectOpts),i=_n.connect(this.connectOpts));let n=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=_n.isIPv6(t.host)?`[${t.host}]`:t.host,c=`CONNECT ${a}:${t.port} HTTP/1.1\r
|
|
28
24
|
`;if(r.username||r.password){let d=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;n["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}n.Host=`${a}:${t.port}`,n["Proxy-Connection"]||(n["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(n))c+=`${d}: ${n[d]}\r
|
|
29
|
-
`;let h=(0,
|
|
30
|
-
`);let{connect:u,buffered:l}=await h;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",OT),t.secureEndpoint?(Hr("Upgrading socket connection to TLS"),fg.connect({...pg(dg(t),"host","path","port"),socket:i})):i;i.destroy();let f=new Pn.Socket({writable:!1});return f.readable=!0,e.once("socket",d=>{Hr("Replaying proxy buffer for failed request"),(0,wT.default)(d.listenerCount("data")>0),d.push(l),d.push(null)}),f}};Ln.protocols=["http","https"];Ne.HttpsProxyAgent=Ln;function OT(s){s.resume()}o(OT,"resume");function pg(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(pg,"omit")});var _g=m(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});var Eg=require("buffer"),es={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};wt.ERRORS=es;function vT(s){if(!Eg.Buffer.isEncoding(s))throw new Error(es.INVALID_ENCODING)}o(vT,"checkEncoding");wt.checkEncoding=vT;function wg(s){return typeof s=="number"&&isFinite(s)&&AT(s)}o(wg,"isFiniteInteger");wt.isFiniteInteger=wg;function Sg(s,e){if(typeof s=="number"){if(!wg(s)||s<0)throw new Error(e?es.INVALID_OFFSET:es.INVALID_LENGTH)}else throw new Error(e?es.INVALID_OFFSET_NON_NUMBER:es.INVALID_LENGTH_NON_NUMBER)}o(Sg,"checkOffsetOrLengthValue");function IT(s){Sg(s,!1)}o(IT,"checkLengthValue");wt.checkLengthValue=IT;function TT(s){Sg(s,!0)}o(TT,"checkOffsetValue");wt.checkOffsetValue=TT;function CT(s,e){if(s<0||s>e.length)throw new Error(es.INVALID_TARGET_OFFSET)}o(CT,"checkTargetOffset");wt.checkTargetOffset=CT;function AT(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}o(AT,"isInteger");function xT(s){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof Eg.Buffer.prototype[s]>"u")throw new Error(`Platform does not support Buffer.prototype.${s}.`)}o(xT,"bigIntAndBufferInt64Check");wt.bigIntAndBufferInt64Check=xT});var Rg=m(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});var x=_g(),bg=4096,BT="utf8",Vc=class s{static{o(this,"SmartBuffer")}constructor(e){if(this.length=0,this._encoding=BT,this._writeOffset=0,this._readOffset=0,s.isSmartBufferOptions(e))if(e.encoding&&(x.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(x.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(x.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(e.buff)if(Buffer.isBuffer(e.buff))this._buff=e.buff,this.length=e.buff.length;else throw new Error(x.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(bg);else{if(typeof e<"u")throw new Error(x.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(bg)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let t=e;return t&&(t.encoding!==void 0||t.size!==void 0||t.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return x.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return x.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t),this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return x.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return x.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}writeUInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}insertUInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}writeUInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}insertUInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}writeUInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}insertUInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}writeBigUInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,t){let r;typeof e=="number"?(x.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(t=e,r=this.length-this._readOffset),typeof t<"u"&&x.checkEncoding(t);let i=this._buff.slice(this._readOffset,this._readOffset+r).toString(t||this._encoding);return this._readOffset+=r,i}insertString(e,t,r){return x.checkOffsetValue(t),this._handleString(e,!0,t,r)}writeString(e,t,r){return this._handleString(e,!1,t,r)}readStringNT(e){typeof e<"u"&&x.checkEncoding(e);let t=this.length;for(let i=this._readOffset;i<this.length;i++)if(this._buff[i]===0){t=i;break}let r=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,r.toString(e||this._encoding)}insertStringNT(e,t,r){return x.checkOffsetValue(t),this.insertString(e,t,r),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,r){return this.writeString(e,t,r),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e<"u"&&x.checkLengthValue(e);let t=typeof e=="number"?e:this.length,r=Math.min(this.length,this._readOffset+t),i=this._buff.slice(this._readOffset,r);return this._readOffset=r,i}insertBuffer(e,t){return x.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let r=this._readOffset;r<this.length;r++)if(this._buff[r]===0){e=r;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return x.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t<"u"&&x.checkOffsetValue(t),this.writeBuffer(e,t),this.writeUInt8(0,typeof t=="number"?t+e.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(e){x.checkOffsetValue(e),x.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){x.checkOffsetValue(e),x.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){x.checkEncoding(e),this._encoding=e}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(e){let t=typeof e=="string"?e:this._encoding;return x.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,r,i){let n=this._writeOffset,a=this._encoding;typeof r=="number"?n=r:typeof r=="string"&&(x.checkEncoding(r),a=r),typeof i=="string"&&(x.checkEncoding(i),a=i);let c=Buffer.byteLength(e,a);return t?this.ensureInsertable(c,n):this._ensureWriteable(c,n),this._buff.write(e,n,c,a),t?this._writeOffset+=c:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,n+c):this._writeOffset+=c,this}_handleBuffer(e,t,r){let i=typeof r=="number"?r:this._writeOffset;return t?this.ensureInsertable(e.length,i):this._ensureWriteable(e.length,i),e.copy(this._buff,i),t?this._writeOffset+=e.length:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,i+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let r=this._readOffset;if(typeof t<"u"&&(x.checkOffsetValue(t),r=t),r<0||r+e>this.length)throw new Error(x.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){x.checkOffsetValue(t),this._ensureCapacity(this.length+e),t<this.length&&this._buff.copy(this._buff,t+e,t,this._buff.length),t+e>this.length?this.length=t+e:this.length+=e}_ensureWriteable(e,t){let r=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let r=this._buff,i=t*3/2+1;i<e&&(i=e),this._buff=Buffer.allocUnsafe(i),r.copy(this._buff,0,0,t)}}_readNumberValue(e,t,r){this.ensureReadable(t,r);let i=e.call(this._buff,typeof r=="number"?r:this._readOffset);return typeof r>"u"&&(this._readOffset+=t),i}_insertNumberValue(e,t,r,i){return x.checkOffsetValue(i),this.ensureInsertable(t,i),e.call(this._buff,r,i),this._writeOffset+=t,this}_writeNumberValue(e,t,r,i){if(typeof i=="number"){if(i<0)throw new Error(x.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);x.checkOffsetValue(i)}let n=typeof i=="number"?i:this._writeOffset;return this._ensureWriteable(t,n),e.call(this._buff,r,n),typeof i=="number"?this._writeOffset=Math.max(this._writeOffset,n+t):this._writeOffset+=t,this}};Wc.SmartBuffer=Vc});var Zc=m(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.SOCKS5_NO_ACCEPTABLE_AUTH=M.SOCKS5_CUSTOM_AUTH_END=M.SOCKS5_CUSTOM_AUTH_START=M.SOCKS_INCOMING_PACKET_SIZES=M.SocksClientState=M.Socks5Response=M.Socks5HostType=M.Socks5Auth=M.Socks4Response=M.SocksCommand=M.ERRORS=M.DEFAULT_TIMEOUT=void 0;var NT=3e4;M.DEFAULT_TIMEOUT=NT;var PT={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};M.ERRORS=PT;var LT={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:o(s=>s+7,"Socks5ResponseHostname"),Socks4Response:8};M.SOCKS_INCOMING_PACKET_SIZES=LT;var Og;(function(s){s[s.connect=1]="connect",s[s.bind=2]="bind",s[s.associate=3]="associate"})(Og||(M.SocksCommand=Og={}));var vg;(function(s){s[s.Granted=90]="Granted",s[s.Failed=91]="Failed",s[s.Rejected=92]="Rejected",s[s.RejectedIdent=93]="RejectedIdent"})(vg||(M.Socks4Response=vg={}));var Ig;(function(s){s[s.NoAuth=0]="NoAuth",s[s.GSSApi=1]="GSSApi",s[s.UserPass=2]="UserPass"})(Ig||(M.Socks5Auth=Ig={}));var kT=128;M.SOCKS5_CUSTOM_AUTH_START=kT;var DT=254;M.SOCKS5_CUSTOM_AUTH_END=DT;var FT=255;M.SOCKS5_NO_ACCEPTABLE_AUTH=FT;var Tg;(function(s){s[s.Granted=0]="Granted",s[s.Failure=1]="Failure",s[s.NotAllowed=2]="NotAllowed",s[s.NetworkUnreachable=3]="NetworkUnreachable",s[s.HostUnreachable=4]="HostUnreachable",s[s.ConnectionRefused=5]="ConnectionRefused",s[s.TTLExpired=6]="TTLExpired",s[s.CommandNotSupported=7]="CommandNotSupported",s[s.AddressNotSupported=8]="AddressNotSupported"})(Tg||(M.Socks5Response=Tg={}));var Cg;(function(s){s[s.IPv4=1]="IPv4",s[s.Hostname=3]="Hostname",s[s.IPv6=4]="IPv6"})(Cg||(M.Socks5HostType=Cg={}));var Ag;(function(s){s[s.Created=0]="Created",s[s.Connecting=1]="Connecting",s[s.Connected=2]="Connected",s[s.SentInitialHandshake=3]="SentInitialHandshake",s[s.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",s[s.SentAuthentication=5]="SentAuthentication",s[s.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",s[s.SentFinalHandshake=7]="SentFinalHandshake",s[s.ReceivedFinalResponse=8]="ReceivedFinalResponse",s[s.BoundWaitingForConnection=9]="BoundWaitingForConnection",s[s.Established=10]="Established",s[s.Disconnected=11]="Disconnected",s[s.Error=99]="Error"})(Ag||(M.SocksClientState=Ag={}))});var Yc=m(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.shuffleArray=Fs.SocksClientError=void 0;var Kc=class extends Error{static{o(this,"SocksClientError")}constructor(e,t){super(e),this.options=t}};Fs.SocksClientError=Kc;function MT(s){for(let e=s.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[s[e],s[t]]=[s[t],s[e]]}}o(MT,"shuffleArray");Fs.shuffleArray=MT});var kn=m(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.isInSubnet=$T;ts.isCorrect=qT;ts.numberToPaddedHex=xg;ts.stringToPaddedHex=UT;ts.testBit=jT;function $T(s){return this.subnetMask<s.subnetMask?!1:this.mask(s.subnetMask)===s.mask()}o($T,"isInSubnet");function qT(s){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===s&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}o(qT,"isCorrect");function xg(s){return s.toString(16).padStart(2,"0")}o(xg,"numberToPaddedHex");function UT(s){return xg(parseInt(s,10))}o(UT,"stringToPaddedHex");function jT(s,e){let{length:t}=s;if(e>t)return!1;let r=t-e;return s.substring(r,r+1)==="1"}o(jT,"testBit")});var Xc=m(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.RE_SUBNET_STRING=Je.RE_ADDRESS=Je.GROUPS=Je.BITS=void 0;Je.BITS=32;Je.GROUPS=4;Je.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;Je.RE_SUBNET_STRING=/\/\d{1,2}$/});var Fn=m(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.AddressError=void 0;var Jc=class extends Error{static{o(this,"AddressError")}constructor(e,t){super(e),this.name="AddressError",this.parseMessage=t}};Dn.AddressError=Jc});var eh=m(Qe=>{"use strict";var HT=Qe&&Qe.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),zT=Qe&&Qe.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Ng=Qe&&Qe.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&HT(e,s,t);return zT(e,s),e};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.Address4=void 0;var Ms=Ng(kn()),$e=Ng(Xc()),Bg=Fn(),Qc=class s{static{o(this,"Address4")}constructor(e){this.groups=$e.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Ms.isCorrect($e.BITS),this.isInSubnet=Ms.isInSubnet,this.address=e;let t=$e.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>$e.BITS)throw new Bg.AddressError("Invalid subnet mask.");e=e.replace($e.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new s(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match($e.RE_ADDRESS))throw new Bg.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],i;for(i=0;i<8;i+=2){let n=t.slice(i,i+2);r.push(parseInt(n,16))}return new s(r.join("."))}static fromInteger(e){return s.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new s(r)}toHex(){return this.parsedAddress.map(e=>Ms.stringToPaddedHex(e)).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<$e.GROUPS;t+=2)e.push(`${Ms.stringToPaddedHex(this.parsedAddress[t])}${Ms.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>Ms.stringToPaddedHex(e)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat($e.BITS-this.subnetMask)}`)}startAddress(){return s.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat($e.BITS-this.subnetMask)}`)}endAddress(){return s.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._endAddress()-e)}static fromBigInt(e){return s.fromHex(e.toString(16))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||(e={});let t=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?t:`${t}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(new s("224.0.0.0/4"))}binaryZeroPad(){return this.bigInt().toString(2).padStart($e.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace($e.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${e.slice(0,2).join(".")}</span>.<span class="hover-group group-v4 group-7">${e.slice(2,4).join(".")}</span>`)}};Qe.Address4=Qc});var th=m(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.RE_URL_WITH_PORT=U.RE_URL=U.RE_ZONE_STRING=U.RE_SUBNET_STRING=U.RE_BAD_ADDRESS=U.RE_BAD_CHARACTERS=U.TYPES=U.SCOPES=U.GROUPS=U.BITS=void 0;U.BITS=128;U.GROUPS=8;U.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};U.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};U.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;U.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;U.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;U.RE_ZONE_STRING=/%.*$/;U.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/;U.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/});var sh=m($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.spanAllZeroes=Pg;$s.spanAll=GT;$s.spanLeadingZeroes=VT;$s.simpleGroup=WT;function Pg(s){return s.replace(/(0+)/g,'<span class="zero">$1</span>')}o(Pg,"spanAllZeroes");function GT(s,e=0){return s.split("").map((r,i)=>`<span class="digit value-${r} position-${i+e}">${Pg(r)}</span>`).join("")}o(GT,"spanAll");function Lg(s){return s.replace(/^(0+)/,'<span class="zero">$1</span>')}o(Lg,"spanLeadingZeroesSimple");function VT(s){return s.split(":").map(t=>Lg(t)).join(":")}o(VT,"spanLeadingZeroes");function WT(s,e=0){return s.split(":").map((r,i)=>/group-v4/.test(r)?r:`<span class="hover-group group-${i+e}">${Lg(r)}</span>`)}o(WT,"simpleGroup")});var kg=m(ge=>{"use strict";var ZT=ge&&ge.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),KT=ge&&ge.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),YT=ge&&ge.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&ZT(e,s,t);return KT(e,s),e};Object.defineProperty(ge,"__esModule",{value:!0});ge.ADDRESS_BOUNDARY=void 0;ge.groupPossibilities=$n;ge.padGroup=Mn;ge.simpleRegularExpression=JT;ge.possibleElisions=QT;var XT=YT(th());function $n(s){return`(${s.join("|")})`}o($n,"groupPossibilities");function Mn(s){return s.length<4?`0{0,${4-s.length}}${s}`:s}o(Mn,"padGroup");ge.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function JT(s){let e=[];s.forEach((r,i)=>{parseInt(r,16)===0&&e.push(i)});let t=e.map(r=>s.map((i,n)=>{if(n===r){let a=n===0||n===XT.GROUPS-1?":":"";return $n([Mn(i),a])}return Mn(i)}).join(":"));return t.push(s.map(Mn).join(":")),$n(t)}o(JT,"simpleRegularExpression");function QT(s,e,t){let r=e?"":":",i=t?"":":",n=[];!e&&!t&&n.push("::"),e&&t&&n.push(""),(t&&!e||!t&&e)&&n.push(":"),n.push(`${r}(:0{1,4}){1,${s-1}}`),n.push(`(0{1,4}:){1,${s-1}}${i}`),n.push(`(0{1,4}:){${s-1}}0{1,4}`);for(let a=1;a<s-1;a++)for(let c=1;c<s-a;c++)n.push(`(0{1,4}:){${c}}:(0{1,4}:){${s-c-a-1}}0{1,4}`);return $n(n)}o(QT,"possibleElisions")});var $g=m(et=>{"use strict";var eC=et&&et.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),tC=et&&et.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),jn=et&&et.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&eC(e,s,t);return tC(e,s),e};Object.defineProperty(et,"__esModule",{value:!0});et.Address6=void 0;var Dg=jn(kn()),rh=jn(Xc()),$=jn(th()),ih=jn(sh()),ss=eh(),rs=kg(),St=Fn(),qn=kn();function Un(s){if(!s)throw new Error("Assertion failed.")}o(Un,"assert");function sC(s){let e=/(\d+)(\d{3})/;for(;e.test(s);)s=s.replace(e,"$1,$2");return s}o(sC,"addCommas");function rC(s){return s=s.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),s=s.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),s}o(rC,"spanLeadingZeroes4");function iC(s,e){let t=[],r=[],i;for(i=0;i<s.length;i++)i<e[0]?t.push(s[i]):i>e[1]&&r.push(s[i]);return t.concat(["compact"]).concat(r)}o(iC,"compact");function Fg(s){return parseInt(s,16).toString(16).padStart(4,"0")}o(Fg,"paddedHex");function Mg(s){return s&255}o(Mg,"unsignByte");var nh=class s{static{o(this,"Address6")}constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=Dg.isInSubnet,this.isCorrect=Dg.isCorrect($.BITS),t===void 0?this.groups=$.GROUPS:this.groups=t,this.address=e;let r=$.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>$.BITS)throw new St.AddressError("Invalid subnet mask.");e=e.replace($.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new St.AddressError("Invalid subnet mask.");let i=$.RE_ZONE_STRING.exec(e);i&&(this.zone=i[0],e=e.replace($.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new s(e),!0}catch{return!1}}static fromBigInt(e){let t=e.toString(16).padStart(32,"0"),r=[],i;for(i=0;i<$.GROUPS;i++)r.push(t.slice(i*4,(i+1)*4));return new s(r.join(":"))}static fromURL(e){let t,r=null,i;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(i=$.RE_URL_WITH_PORT.exec(e),i===null)return{error:"failed to parse address with port",address:null,port:null};t=i[1],r=i[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),i=$.RE_URL.exec(e),i===null)return{error:"failed to parse address from URL",address:null,port:null};t=i[1]}else t=e;return r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new s(t),port:r}}static fromAddress4(e){let t=new ss.Address4(e),r=$.BITS-(rh.BITS-t.subnetMask);return new s(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new St.AddressError("Invalid 'ip6.arpa' form.");let i=t.split(".").reverse();for(let n=r;n>0;n--){let a=n*4;i.splice(a,0,":")}return t=i.join(""),new s(t)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=$.BITS-this.subnetMask,r=Math.abs(e-$.BITS),i=t-r;return i<0?"0":sC((BigInt("2")**BigInt(i)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat($.BITS-this.subnetMask)}`)}startAddress(){return s.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat($.BITS-this.subnetMask)}`)}endAddress(){return s.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._endAddress()-e)}getScope(){let e=$.SCOPES[parseInt(this.getBits(12,16).toString(10),10)];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"}getType(){for(let e of Object.keys($.TYPES))if(this.isInSubnet(new s(e)))return $.TYPES[e];return"Global unicast"}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,$.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:`${r}.ip6.arpa.`:e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,i=[];for(e=0;e<this.parsedAddress.length;e++){let c=parseInt(this.parsedAddress[e],16);c===0&&r++,c!==0&&r>0&&(r>1&&i.push([e-r,e-1]),r=0)}r>1&&i.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);let n=i.map(c=>c[1]-c[0]+1);if(i.length>0){let c=n.indexOf(Math.max(...n));t=iC(this.parsedAddress,i[c])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!=="compact"&&(t[e]=parseInt(t[e],16).toString(16));let a=t.join(":");return a=a.replace(/^compact$/,"::"),a=a.replace(/(^compact)|(compact$)/,":"),a=a.replace(/compact/,""),a}binaryZeroPad(){return this.bigInt().toString(2).padStart($.BITS,"0")}parse4in6(e){let t=e.split(":"),i=t.slice(-1)[0].match(rh.RE_ADDRESS);if(i){this.parsedAddress4=i[0],this.address4=new ss.Address4(this.parsedAddress4);for(let n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new St.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(rh.RE_ADDRESS,this.address4.parsedAddress.map(rC).join(".")));this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(":")}return e}parse(e){e=this.parse4in6(e);let t=e.match($.RE_BAD_CHARACTERS);if(t)throw new St.AddressError(`Bad character${t.length>1?"s":""} detected in address: ${t.join("")}`,e.replace($.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let r=e.match($.RE_BAD_ADDRESS);if(r)throw new St.AddressError(`Address failed regex: ${r.join("")}`,e.replace($.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let i=[],n=e.split("::");if(n.length===2){let a=n[0].split(":"),c=n[1].split(":");a.length===1&&a[0]===""&&(a=[]),c.length===1&&c[0]===""&&(c=[]);let h=this.groups-(a.length+c.length);if(!h)throw new St.AddressError("Error parsing groups");this.elidedGroups=h,this.elisionBegin=a.length,this.elisionEnd=a.length+this.elidedGroups,i=i.concat(a);for(let u=0;u<h;u++)i.push("0");i=i.concat(c)}else if(n.length===1)i=e.split(":"),this.elidedGroups=0;else throw new St.AddressError("Too many :: groups found");if(i=i.map(a=>parseInt(a,16).toString(16)),i.length!==this.groups)throw new St.AddressError("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(Fg).join(":")}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(Fg).join("")}`)}to4(){let e=this.binaryZeroPad().split("");return ss.Address4.fromHex(BigInt(`0b${e.slice(96,128).join("")}`).toString(16))}to4in6(){let e=this.to4(),r=new s(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),i="";return/:$/.test(r)||(i=":"),r+i+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),r=(this.getBits(80,96)^BigInt("0xffff")).toString(),i=ss.Address4.fromHex(this.getBitsBase16(32,64)),n=this.getBits(96,128),a=ss.Address4.fromHex((n^BigInt("0xffffffff")).toString(16)),c=this.getBitsBase2(64,80),h=(0,qn.testBit)(c,15),u=(0,qn.testBit)(c,14),l=(0,qn.testBit)(c,8),f=(0,qn.testBit)(c,9),d=BigInt(`0b${c.slice(2,6)+c.slice(8,16)}`).toString(10);return{prefix:`${e.slice(0,4)}:${e.slice(4,8)}`,server4:i.address,client4:a.address,flags:c,coneNat:h,microsoft:{reserved:u,universalLocal:f,groupIndividual:l,nonce:d},udpPort:r}}inspect6to4(){let e=this.getBitsBase16(0,16),t=ss.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:e.slice(0,4),gateway:t.address}}to6to4(){if(!this.is4())return null;let e=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new s(e)}toByteArray(){let e=this.bigInt().toString(16),r=`${"0".repeat(e.length%2)}${e}`,i=[];for(let n=0,a=r.length;n<a;n+=2)i.push(parseInt(r.substring(n,n+2),16));return i}toUnsignedByteArray(){return this.toByteArray().map(Mg)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(Mg))}static fromUnsignedByteArray(e){let t=BigInt("256"),r=BigInt("0"),i=BigInt("1");for(let n=e.length-1;n>=0;n--)r+=i*BigInt(e[n].toString(10)),i*=t;return s.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new s("2001::/32"))}is6to4(){return this.isInSubnet(new s("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let r=t.call(this);return e.className?`<a href="${e.prefix}${r}" class="${e.className}">${r}</a>`:`<a href="${e.prefix}${r}">${r}</a>`}group(){if(this.elidedGroups===0)return ih.simpleGroup(this.address).join(":");Un(typeof this.elidedGroups=="number"),Un(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...ih.simpleGroup(t)):e.push("");let i=["hover-group"];for(let n=this.elisionBegin;n<this.elisionBegin+this.elidedGroups;n++)i.push(`group-${n}`);return e.push(`<span class="${i.join(" ")}"></span>`),r.length?e.push(...ih.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(Un(this.address4 instanceof ss.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new s(this.correctForm());if(r.elidedGroups===0)t.push((0,rs.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===$.GROUPS)t.push((0,rs.possibleElisions)($.GROUPS));else{let i=r.address.split("::");i[0].length&&t.push((0,rs.simpleRegularExpression)(i[0].split(":"))),Un(typeof r.elidedGroups=="number"),t.push((0,rs.possibleElisions)(r.elidedGroups,i[0].length!==0,i[1].length!==0)),i[1].length&&t.push((0,rs.simpleRegularExpression)(i[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",rs.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",rs.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};et.Address6=nh});var oh=m(ie=>{"use strict";var nC=ie&&ie.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),oC=ie&&ie.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),aC=ie&&ie.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&nC(e,s,t);return oC(e,s),e};Object.defineProperty(ie,"__esModule",{value:!0});ie.v6=ie.AddressError=ie.Address6=ie.Address4=void 0;var cC=eh();Object.defineProperty(ie,"Address4",{enumerable:!0,get:o(function(){return cC.Address4},"get")});var hC=$g();Object.defineProperty(ie,"Address6",{enumerable:!0,get:o(function(){return hC.Address6},"get")});var uC=Fn();Object.defineProperty(ie,"AddressError",{enumerable:!0,get:o(function(){return uC.AddressError},"get")});var lC=aC(sh());ie.v6={helpers:lC}});var Gg=m(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.ipToBuffer=Pe.int32ToIpv4=Pe.ipv4ToInt32=Pe.validateSocksClientChainOptions=Pe.validateSocksClientOptions=void 0;var he=Yc(),X=Zc(),fC=require("stream"),ah=oh(),qg=require("net");function dC(s,e=["connect","bind","associate"]){if(!X.SocksCommand[s.command])throw new he.SocksClientError(X.ERRORS.InvalidSocksCommand,s);if(e.indexOf(s.command)===-1)throw new he.SocksClientError(X.ERRORS.InvalidSocksCommandForOperation,s);if(!jg(s.destination))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsDestination,s);if(!Hg(s.proxy))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsProxy,s);if(Ug(s.proxy,s),s.timeout&&!zg(s.timeout))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsTimeout,s);if(s.existing_socket&&!(s.existing_socket instanceof fC.Duplex))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsExistingSocket,s)}o(dC,"validateSocksClientOptions");Pe.validateSocksClientOptions=dC;function pC(s){if(s.command!=="connect")throw new he.SocksClientError(X.ERRORS.InvalidSocksCommandChain,s);if(!jg(s.destination))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsDestination,s);if(!(s.proxies&&Array.isArray(s.proxies)&&s.proxies.length>=2))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsProxiesLength,s);if(s.proxies.forEach(e=>{if(!Hg(e))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsProxy,s);Ug(e,s)}),s.timeout&&!zg(s.timeout))throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsTimeout,s)}o(pC,"validateSocksClientChainOptions");Pe.validateSocksClientChainOptions=pC;function Ug(s,e){if(s.custom_auth_method!==void 0){if(s.custom_auth_method<X.SOCKS5_CUSTOM_AUTH_START||s.custom_auth_method>X.SOCKS5_CUSTOM_AUTH_END)throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(s.custom_auth_request_handler===void 0||typeof s.custom_auth_request_handler!="function")throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(s.custom_auth_response_size===void 0)throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(s.custom_auth_response_handler===void 0||typeof s.custom_auth_response_handler!="function")throw new he.SocksClientError(X.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}o(Ug,"validateCustomProxyAuth");function jg(s){return s&&typeof s.host=="string"&&Buffer.byteLength(s.host)<256&&typeof s.port=="number"&&s.port>=0&&s.port<=65535}o(jg,"isValidSocksRemoteHost");function Hg(s){return s&&(typeof s.host=="string"||typeof s.ipaddress=="string")&&typeof s.port=="number"&&s.port>=0&&s.port<=65535&&(s.type===4||s.type===5)}o(Hg,"isValidSocksProxy");function zg(s){return typeof s=="number"&&s>0}o(zg,"isValidTimeoutValue");function mC(s){return new ah.Address4(s).toArray().reduce((t,r)=>(t<<8)+r,0)>>>0}o(mC,"ipv4ToInt32");Pe.ipv4ToInt32=mC;function gC(s){let e=s>>>24&255,t=s>>>16&255,r=s>>>8&255,i=s&255;return[e,t,r,i].join(".")}o(gC,"int32ToIpv4");Pe.int32ToIpv4=gC;function yC(s){if(qg.isIPv4(s)){let e=new ah.Address4(s);return Buffer.from(e.toArray())}else if(qg.isIPv6(s)){let e=new ah.Address6(s);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}o(yC,"ipToBuffer");Pe.ipToBuffer=yC});var Vg=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ReceiveBuffer=void 0;var ch=class{static{o(this,"ReceiveBuffer")}constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}};Hn.ReceiveBuffer=ch});var Wg=m(Pt=>{"use strict";var qs=Pt&&Pt.__awaiter||function(s,e,t,r){function i(n){return n instanceof t?n:new t(function(a){a(n)})}return o(i,"adopt"),new(t||(t=Promise))(function(n,a){function c(l){try{u(r.next(l))}catch(f){a(f)}}o(c,"fulfilled");function h(l){try{u(r.throw(l))}catch(f){a(f)}}o(h,"rejected");function u(l){l.done?n(l.value):i(l.value).then(c,h)}o(u,"step"),u((r=r.apply(s,e||[])).next())})};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.SocksClientError=Pt.SocksClient=void 0;var EC=require("events"),Us=require("net"),ye=Rg(),E=Zc(),Re=Gg(),wC=Vg(),uh=Yc();Object.defineProperty(Pt,"SocksClientError",{enumerable:!0,get:o(function(){return uh.SocksClientError},"get")});var hh=oh(),lh=class s extends EC.EventEmitter{static{o(this,"SocksClient")}constructor(e){super(),this.options=Object.assign({},e),(0,Re.validateSocksClientOptions)(e),this.setState(E.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,i)=>{try{(0,Re.validateSocksClientOptions)(e,["connect"])}catch(a){return typeof t=="function"?(t(a),r(a)):i(a)}let n=new s(e);n.connect(e.existing_socket),n.once("established",a=>{n.removeAllListeners(),typeof t=="function"&&t(null,a),r(a)}),n.once("error",a=>{n.removeAllListeners(),typeof t=="function"?(t(a),r(a)):i(a)})})}static createConnectionChain(e,t){return new Promise((r,i)=>qs(this,void 0,void 0,function*(){try{(0,Re.validateSocksClientChainOptions)(e)}catch(n){return typeof t=="function"?(t(n),r(n)):i(n)}e.randomizeChain&&(0,uh.shuffleArray)(e.proxies);try{let n;for(let a=0;a<e.proxies.length;a++){let c=e.proxies[a],h=a===e.proxies.length-1?e.destination:{host:e.proxies[a+1].host||e.proxies[a+1].ipaddress,port:e.proxies[a+1].port},u=yield s.createConnection({command:"connect",proxy:c,destination:h,existing_socket:n});n=n||u.socket}typeof t=="function"?(t(null,{socket:n}),r({socket:n})):r({socket:n})}catch(n){typeof t=="function"?(t(n),r(n)):i(n)}}))}static createUDPFrame(e){let t=new ye.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),Us.isIPv4(e.remoteHost.host)?(t.writeUInt8(E.Socks5HostType.IPv4),t.writeUInt32BE((0,Re.ipv4ToInt32)(e.remoteHost.host))):Us.isIPv6(e.remoteHost.host)?(t.writeUInt8(E.Socks5HostType.IPv6),t.writeBuffer((0,Re.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(E.Socks5HostType.Hostname),t.writeUInt8(Buffer.byteLength(e.remoteHost.host)),t.writeString(e.remoteHost.host)),t.writeUInt16BE(e.remoteHost.port),t.writeBuffer(e.data),t.toBuffer()}static parseUDPFrame(e){let t=ye.SmartBuffer.fromBuffer(e);t.readOffset=2;let r=t.readUInt8(),i=t.readUInt8(),n;i===E.Socks5HostType.IPv4?n=(0,Re.int32ToIpv4)(t.readUInt32BE()):i===E.Socks5HostType.IPv6?n=hh.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():n=t.readString(t.readUInt8());let a=t.readUInt16BE();return{frameNumber:r,remoteHost:{host:n,port:a},data:t.readBuffer()}}setState(e){this.state!==E.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=r=>this.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||E.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new Us.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(E.SocksClientState.Connecting),this.receiveBuffer=new wC.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let i=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",i)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==E.SocksClientState.Established&&this.state!==E.SocksClientState.BoundWaitingForConnection&&this.closeSocket(E.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(E.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(E.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==E.SocksClientState.Established&&this.state!==E.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===E.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===E.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===E.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===E.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(E.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(E.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==E.SocksClientState.Error&&(this.setState(E.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new uh.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new ye.SmartBuffer;t.writeUInt8(4),t.writeUInt8(E.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),Us.isIPv4(this.options.destination.host)?(t.writeBuffer((0,Re.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==E.Socks4Response.Granted)this.closeSocket(`${E.ERRORS.Socks4ProxyRejectedConnection} - (${E.Socks4Response[e[1]]})`);else if(E.SocksCommand[this.options.command]===E.SocksCommand.bind){let t=ye.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,Re.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(E.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==E.Socks4Response.Granted)this.closeSocket(`${E.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${E.Socks4Response[e[1]]})`);else{let t=ye.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,Re.int32ToIpv4)(t.readUInt32BE())};this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new ye.SmartBuffer,t=[E.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(E.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(E.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(E.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===E.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(E.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===E.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=E.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===E.Socks5Auth.UserPass?(this.socks5ChosenAuthType=E.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(E.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new ye.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(E.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return qs(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(E.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return qs(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return qs(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return qs(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return qs(this,void 0,void 0,function*(){this.setState(E.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===E.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===E.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(E.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new ye.SmartBuffer;e.writeUInt8(5),e.writeUInt8(E.SocksCommand[this.options.command]),e.writeUInt8(0),Us.isIPv4(this.options.destination.host)?(e.writeUInt8(E.Socks5HostType.IPv4),e.writeBuffer((0,Re.ipToBuffer)(this.options.destination.host))):Us.isIPv6(this.options.destination.host)?(e.writeUInt8(E.Socks5HostType.IPv6),e.writeBuffer((0,Re.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(E.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(E.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==E.Socks5Response.Granted)this.closeSocket(`${E.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${E.Socks5Response[e[1]]}`);else{let t=e[3],r,i;if(t===E.Socks5HostType.IPv4){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,Re.int32ToIpv4)(i.readUInt32BE()),port:i.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===E.Socks5HostType.Hostname){let n=e[4],a=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:i.readString(n),port:i.readUInt16BE()}}else if(t===E.Socks5HostType.IPv6){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:hh.Address6.fromByteArray(Array.from(i.readBuffer(16))).canonicalForm(),port:i.readUInt16BE()}}this.setState(E.SocksClientState.ReceivedFinalResponse),E.SocksCommand[this.options.command]===E.SocksCommand.connect?(this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})):E.SocksCommand[this.options.command]===E.SocksCommand.bind?(this.setState(E.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:r,socket:this.socket})):E.SocksCommand[this.options.command]===E.SocksCommand.associate&&(this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==E.Socks5Response.Granted)this.closeSocket(`${E.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${E.Socks5Response[e[1]]}`);else{let t=e[3],r,i;if(t===E.Socks5HostType.IPv4){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,Re.int32ToIpv4)(i.readUInt32BE()),port:i.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===E.Socks5HostType.Hostname){let n=e[4],a=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:i.readString(n),port:i.readUInt16BE()}}else if(t===E.Socks5HostType.IPv6){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=ye.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:hh.Address6.fromByteArray(Array.from(i.readBuffer(16))).canonicalForm(),port:i.readUInt16BE()}}this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};Pt.SocksClient=lh});var Zg=m(is=>{"use strict";var SC=is&&is.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),_C=is&&is.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&SC(e,s,t)};Object.defineProperty(is,"__esModule",{value:!0});_C(Wg(),is)});var Kg=m(Le=>{"use strict";var bC=Le&&Le.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),RC=Le&&Le.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),fh=Le&&Le.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&bC(e,s,t);return RC(e,s),e},OC=Le&&Le.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Le,"__esModule",{value:!0});Le.SocksProxyAgent=void 0;var vC=Zg(),IC=jr(),TC=OC(Ur()),CC=fh(require("dns")),AC=fh(require("net")),xC=fh(require("tls")),BC=require("url"),zn=(0,TC.default)("socks-proxy-agent"),NC=o(s=>s.servername===void 0&&s.host&&!AC.isIP(s.host)?{...s,servername:s.host}:s,"setServernameFromNonIpHost");function PC(s){let e=!1,t=5,r=s.hostname,i=parseInt(s.port,10)||1080;switch(s.protocol.replace(":","")){case"socks4":e=!0,t=4;break;case"socks4a":t=4;break;case"socks5":e=!0,t=5;break;case"socks":t=5;break;case"socks5h":t=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${String(s.protocol)}`)}let n={host:r,port:i,type:t};return s.username&&Object.defineProperty(n,"userId",{value:decodeURIComponent(s.username),enumerable:!1}),s.password!=null&&Object.defineProperty(n,"password",{value:decodeURIComponent(s.password),enumerable:!1}),{lookup:e,proxy:n}}o(PC,"parseSocksURL");var Gn=class extends IC.Agent{static{o(this,"SocksProxyAgent")}constructor(e,t){super(t);let r=typeof e=="string"?new BC.URL(e):e,{proxy:i,lookup:n}=PC(r);this.shouldLookup=n,this.proxy=i,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:r,proxy:i,timeout:n}=this;if(!t.host)throw new Error("No `host` defined!");let{host:a}=t,{port:c,lookup:h=CC.lookup}=t;r&&(a=await new Promise((d,p)=>{h(a,{},(y,g)=>{y?p(y):d(g)})}));let u={proxy:i,destination:{host:a,port:typeof c=="number"?c:parseInt(c,10)},command:"connect",timeout:n??void 0,socket_options:this.socketOptions??void 0},l=o(d=>{e.destroy(),f.destroy(),d&&d.destroy()},"cleanup");zn("Creating socks proxy connection: %o",u);let{socket:f}=await vC.SocksClient.createConnection(u);if(zn("Successfully created socks proxy connection"),n!==null&&(f.setTimeout(n),f.on("timeout",()=>l())),t.secureEndpoint){zn("Upgrading socket connection to TLS");let d=xC.connect({...LC(NC(t),"host","path","port"),socket:f});return d.once("error",p=>{zn("Socket TLS error",p.message),l(d)}),d}return f}};Gn.protocols=["socks","socks4","socks4a","socks5","socks5h"];Le.SocksProxyAgent=Gn;function LC(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(LC,"omit")});var Eh=m((yL,Yg)=>{"use strict";var dh=class extends Error{static{o(this,"InvalidProxyProtocolError")}constructor(e){super(`Invalid protocol \`${e.protocol}\` connecting to proxy \`${e.host}\``),this.code="EINVALIDPROXY",this.proxy=e}},ph=class extends Error{static{o(this,"ConnectionTimeoutError")}constructor(e){super(`Timeout connecting to host \`${e}\``),this.code="ECONNECTIONTIMEOUT",this.host=e}},mh=class extends Error{static{o(this,"IdleTimeoutError")}constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code="EIDLETIMEOUT",this.host=e}},gh=class extends Error{static{o(this,"ResponseTimeoutError")}constructor(e,t){let r="Response timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`connecting to host \`${e.host}\``,super(r),this.code="ERESPONSETIMEOUT",this.proxy=t,this.request=e}},yh=class extends Error{static{o(this,"TransferTimeoutError")}constructor(e,t){let r="Transfer timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`for \`${e.host}\``,super(r),this.code="ETRANSFERTIMEOUT",this.proxy=t,this.request=e}};Yg.exports={InvalidProxyProtocolError:dh,ConnectionTimeoutError:ph,IdleTimeoutError:mh,ResponseTimeoutError:gh,TransferTimeoutError:yh}});var wh=m((wL,Jg)=>{"use strict";var{HttpProxyAgent:kC}=ug(),{HttpsProxyAgent:DC}=yg(),{SocksProxyAgent:Xg}=Kg(),{LRUCache:FC}=bs(),{InvalidProxyProtocolError:MC}=Eh(),$C=new FC({max:20}),qC=new Set(Xg.protocols),UC=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),zr=Object.entries(process.env).reduce((s,[e,t])=>(e=e.toLowerCase(),UC.has(e)&&(s[e]=t),s),{}),jC=o(s=>{s=new URL(s);let e=s.protocol.slice(0,-1);if(qC.has(e))return Xg;if(e==="https"||e==="http")return[kC,DC];throw new MC(s)},"getProxyAgent"),HC=o((s,e)=>{if(typeof e=="string"&&(e=e.split(",").map(r=>r.trim()).filter(Boolean)),!e||!e.length)return!1;let t=s.hostname.split(".").reverse();return e.some(r=>{let i=r.split(".").filter(Boolean).reverse();if(!i.length)return!1;for(let n=0;n<i.length;n++)if(t[n]!==i[n])return!1;return!0})},"isNoProxy"),zC=o((s,{proxy:e,noProxy:t})=>(s=new URL(s),e||(e=s.protocol==="https:"?zr.https_proxy:zr.https_proxy||zr.http_proxy||zr.proxy),t||(t=zr.no_proxy),!e||HC(s,t)?null:new URL(e)),"getProxy");Jg.exports={getProxyAgent:jC,getProxy:zC,proxyCache:$C}});var ty=m((bL,ey)=>{"use strict";var GC=require("net"),VC=require("tls"),{once:Qg}=require("events"),WC=require("timers/promises"),{normalizeOptions:ZC,cacheOptions:KC}=qc(),{getProxy:YC,getProxyAgent:XC,proxyCache:Sh}=wh(),Vn=Eh(),{Agent:JC}=jr();ey.exports=class extends JC{static{o(this,"Agent")}#e;#t;#s;#r;#i;constructor(e={}){let{timeouts:t,proxy:r,noProxy:i,...n}=ZC(e);super(n),this.#e=n,this.#t=t,r&&(this.#s=new URL(r),this.#r=i,this.#i=XC(r))}get proxy(){return this.#s?{url:this.#s}:{}}#a(e){if(!this.#s)return;let t=YC(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#s,noProxy:this.#r});if(!t)return;let r=KC({...e,...this.#e,timeouts:this.#t,proxy:t});if(Sh.has(r))return Sh.get(r);let i=this.#i;Array.isArray(i)&&(i=this.isSecureEndpoint(e)?i[1]:i[0]);let n=new i(t,{...this.#e,socketOptions:{family:this.#e.family}});return Sh.set(r,n),n}async#l({promises:e,options:t,timeout:r},i=new AbortController){if(r){let a=WC.setTimeout(r,null,{signal:i.signal}).then(()=>{throw new Vn.ConnectionTimeoutError(`${t.host}:${t.port}`)}).catch(c=>{if(c.name!=="AbortError")throw c});e.push(a)}let n;try{n=await Promise.race(e),i.abort()}catch(a){throw i.abort(),a}return n}async connect(e,t){t.lookup??=this.#e.lookup;let r,i=this.#t.connection,n=this.isSecureEndpoint(t),a=this.#a(t);if(a){let l=Date.now();r=await this.#l({options:t,timeout:i,promises:[a.connect(e,t)]}),i&&(i=i-(Date.now()-l))}else r=(n?VC:GC).connect(t);r.setKeepAlive(this.keepAlive,this.keepAliveMsecs),r.setNoDelay(this.keepAlive);let c=new AbortController,{signal:h}=c,u=r[n?"secureConnecting":"connecting"]?Qg(r,n?"secureConnect":"connect",{signal:h}):Promise.resolve();return await this.#l({options:t,timeout:i,promises:[u,Qg(r,"error",{signal:h}).then(l=>{throw l[0]})]},c),this.#t.idle&&r.setTimeout(this.#t.idle,()=>{r.destroy(new Vn.IdleTimeoutError(`${t.host}:${t.port}`))}),r}addRequest(e,t){let r=this.#a(t);if(r?.setRequestProps&&r.setRequestProps(e,t),e.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#t.response){let i;e.once("finish",()=>{setTimeout(()=>{e.destroy(new Vn.ResponseTimeoutError(e,this.#s))},this.#t.response)}),e.once("response",()=>{clearTimeout(i)})}if(this.#t.transfer){let i;e.once("response",n=>{setTimeout(()=>{n.destroy(new Vn.TransferTimeoutError(e,this.#s))},this.#t.transfer),n.once("close",()=>{clearTimeout(i)})})}return super.addRequest(e,t)}}});var ny=m((OL,iy)=>{"use strict";var{LRUCache:QC}=bs(),{normalizeOptions:eA,cacheOptions:tA}=qc(),{getProxy:sA,proxyCache:sy}=wh(),ry=$c(),Wn=ty(),Gr=new QC({max:20}),rA=o((s,{agent:e,proxy:t,noProxy:r,...i}={})=>{if(e!=null)return e;s=new URL(s);let n=sA(s,{proxy:t,noProxy:r}),a={...eA(i),proxy:n},c=tA({...a,secureEndpoint:s.protocol==="https:"});if(Gr.has(c))return Gr.get(c);let h=new Wn(a);return Gr.set(c,h),h},"getAgent");iy.exports={getAgent:rA,Agent:Wn,HttpAgent:Wn,HttpsAgent:Wn,cache:{proxy:sy,agent:Gr,dns:ry.cache,clear:o(()=>{sy.clear(),Gr.clear(),ry.cache.clear()},"clear")}}});var oy=m((IL,iA)=>{iA.exports={name:"make-fetch-happen",version:"15.0.2",description:"Opinionated, caching, retrying fetch client",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",posttest:"npm run lint",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"',lint:"npm run eslint",lintfix:"npm run eslint -- --fix",postlint:"template-oss-check",snap:"tap","template-oss-apply":"template-oss-apply --force"},repository:{type:"git",url:"git+https://github.com/npm/make-fetch-happen.git"},keywords:["http","request","fetch","mean girls","caching","cache","subresource integrity"],author:"GitHub Inc.",license:"ISC",dependencies:{"@npmcli/agent":"^4.0.0",cacache:"^20.0.1","http-cache-semantics":"^4.1.1",minipass:"^7.0.2","minipass-fetch":"^4.0.0","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4",negotiator:"^1.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",ssri:"^12.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",nock:"^13.2.4","safe-buffer":"^5.2.1","standard-version":"^9.3.2",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},tap:{color:1,files:"test/*.js","check-coverage":!0,timeout:60,"nyc-arg":["--exclude","tap-snapshots/**"]},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.25.0",publish:"true"}}});var Kn=m((TL,cy)=>{var{Minipass:nA}=ee(),Zn=sr(),oA=Mm(),aA=Ot(),{log:ay}=qm(),cA=Mc(),{getAgent:hA}=ny(),_h=oy(),uA=`${_h.name}/${_h.version} (+https://npm.im/${_h.name})`,lA=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],fA=["request-timeout"],dA=o((s,e)=>{let t=hA(s.url,{...e,signal:void 0});s.headers.has("connection")||s.headers.set("connection",t?"keep-alive":"close"),s.headers.has("user-agent")||s.headers.set("user-agent",uA);let r={...e,agent:t,redirect:"manual"};return oA(async(i,n)=>{let a=new Zn.Request(s,r);try{let c=await Zn(a,r);if(r.integrity&&c.status===200){let l=aA.integrityStream({algorithms:r.algorithms,integrity:r.integrity,size:r.size}),f=new cA({events:["integrity","size"]},c.body,l);l.on("integrity",d=>f.emit("integrity",d)),l.on("size",d=>f.emit("size",d)),c=new Zn.Response(f,c),c.body.hasIntegrityEmitter=!0}c.headers.set("x-fetch-attempts",n);let h=nA.isStream(a.body);return a.method!=="POST"&&!h&&([408,420,429].includes(c.status)||c.status>=500)?(typeof e.onRetry=="function"&&e.onRetry(c),ay.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.status}`),i(c)):c}catch(c){let h=c.code==="EPROMISERETRY"?c.retried.code:c.code,u=c.retried instanceof Zn.Response||lA.includes(h)&&fA.includes(c.type);if(a.method==="POST"||u)throw c;return typeof e.onRetry=="function"&&e.onRetry(c),ay.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.code}`),i(c)}},e.retry).catch(i=>{if(i.status>=400&&i.type!=="system")return i;throw i})},"remoteFetch");cy.exports=dA});var py=m((AL,dy)=>{var{Request:hy,Response:bh}=sr(),{Minipass:uy}=ee(),pA=yi(),ns=Om(),mA=require("url"),gA=Mc(),yA=Qo(),Rh=Tm(),EA=Kn(),Vr=o((s,e)=>Object.prototype.hasOwnProperty.call(s,e),"hasOwnProperty"),wA=["accept-charset","accept-encoding","accept-language","accept","cache-control"],fy=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],ly=o((s,e,t)=>{let r={time:Date.now(),url:s.url,reqHeaders:{},resHeaders:{},options:{compress:t.compress!=null?t.compress:s.compress}};e.status!==200&&e.status!==304&&(r.status=e.status);for(let a of wA)s.headers.has(a)&&(r.reqHeaders[a]=s.headers.get(a));let i=s.headers.get("host"),n=new mA.URL(s.url);if(i&&n.host!==i&&(r.reqHeaders.host=i),e.headers.has("vary")){let a=e.headers.get("vary");if(a!=="*"){let c=a.trim().toLowerCase().split(/\s*,\s*/);for(let h of c)s.headers.has(h)&&(r.reqHeaders[h]=s.headers.get(h))}}for(let a of fy)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));for(let a of t.cacheAdditionalHeaders)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));return r},"getMetadata"),Yn=Symbol("request"),Xn=Symbol("response"),Jn=Symbol("policy"),Oh=class s{static{o(this,"CacheEntry")}constructor({entry:e,request:t,response:r,options:i}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=Rh(t),this.options=i,this[Yn]=t,this[Xn]=r,this[Jn]=null}static async find(e,t){try{var r=await ns.index.compact(t.cachePath,Rh(e),(n,a)=>{let c=new s({entry:n,options:t}),h=new s({entry:a,options:t});return c.policy.satisfies(h.request)},{validateEntry:o(n=>n.metadata&&n.metadata.resHeaders&&n.metadata.resHeaders["content-encoding"]===null?!1:n.integrity===null?!!(n.metadata&&n.metadata.status):!0,"validateEntry")})}catch{return}if(t.cache==="reload")return;let i;for(let n of r){let a=new s({entry:n,options:t});if(a.policy.satisfies(e)){i=a;break}}return i}static async invalidate(e,t){let r=Rh(e);try{await ns.rm.entry(t.cachePath,r,{removeFully:!0})}catch{}}get request(){return this[Yn]||(this[Yn]=new hy(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[Yn]}get response(){return this[Xn]||(this[Xn]=new bh(null,{url:this.entry.metadata.url,counter:this.options.counter,status:this.entry.metadata.status||200,headers:{...this.entry.metadata.resHeaders,"content-length":this.entry.size}})),this[Xn]}get policy(){return this[Jn]||(this[Jn]=new yA({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[Jn]}async store(e){if(this.request.method!=="GET"||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set("x-local-cache-status","skip"),this.response;let t=this.response.headers.get("content-length"),r={algorithms:this.options.algorithms,metadata:ly(this.request,this.response,this.options),size:t,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body},i=null;if(this.response.status===200){let a,c,h=new Promise((l,f)=>{a=l,c=f}).catch(l=>{i.emit("error",l)});i=new gA({events:["integrity","size"]},new pA({flush(){return h}})),i.hasIntegrityEmitter=!0;let u=o(()=>{let l=new uy,f=ns.put.stream(this.options.cachePath,this.key,r);f.on("integrity",d=>i.emit("integrity",d)),f.on("size",d=>i.emit("size",d)),l.pipe(f),f.promise().then(a,c),i.unshift(l),i.unshift(this.response.body)},"onResume");i.once("resume",u),i.once("end",()=>i.removeListener("resume",u))}else await ns.index.insert(this.options.cachePath,this.key,null,r);return this.response.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),this.response.headers.set("x-local-cache-key",encodeURIComponent(this.key)),this.response.headers.set("x-local-cache-mode","stream"),this.response.headers.set("x-local-cache-status",e),this.response.headers.set("x-local-cache-time",new Date().toISOString()),new bh(i,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(e,t,r){let i;if(e==="HEAD"||[301,308].includes(this.response.status))i=this.response;else{let n=new uy,a={...this.policy.responseHeaders()},c=o(()=>{let h=ns.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});h.on("error",async u=>{h.pause(),u.code==="EINTEGRITY"&&await ns.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(u.code==="ENOENT"||u.code==="EINTEGRITY")&&await s.invalidate(this.request,this.options),n.emit("error",u),h.resume()}),n.emit("integrity",this.entry.integrity),n.emit("size",Number(a["content-length"])),h.pipe(n)},"onResume");n.once("resume",c),n.once("end",()=>n.removeListener("resume",c)),i=new bh(n,{url:this.entry.metadata.url,counter:t.counter,status:200,headers:a})}return i.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),i.headers.set("x-local-cache-hash",encodeURIComponent(this.entry.integrity)),i.headers.set("x-local-cache-key",encodeURIComponent(this.key)),i.headers.set("x-local-cache-mode","stream"),i.headers.set("x-local-cache-status",r),i.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),i}async revalidate(e,t){let r=new hy(e,{headers:this.policy.revalidationHeaders(e)});try{var i=await EA(r,{...t,headers:void 0})}catch(a){if(!this.policy.mustRevalidate)return this.respond(e.method,t,"stale");throw a}if(this.policy.revalidated(r,i)){let a=ly(e,i,t);for(let c of fy)!Vr(a.resHeaders,c)&&Vr(this.entry.metadata.resHeaders,c)&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]);for(let c of t.cacheAdditionalHeaders){let h=Vr(a.resHeaders,c),u=Vr(this.entry.metadata.resHeaders,c),l=Vr(this.policy.response.headers,c);!h&&u&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]),!l&&h&&(this.policy.response.headers[c]=a.resHeaders[c])}try{await ns.index.insert(t.cachePath,this.key,this.entry.integrity,{size:this.entry.size,metadata:a})}catch{}return this.respond(e.method,t,"revalidated")}return new s({request:e,response:i,options:t}).store("updated")}};dy.exports=Oh});var yy=m((BL,gy)=>{var{NotCachedError:SA}=Yu(),vh=py(),_A=Kn(),my=o(async(s,e)=>{let t=await vh.find(s,e);if(!t){if(e.cache==="only-if-cached")throw new SA(s.url);let i=await _A(s,e);return new vh({request:s,response:i,options:e}).store("miss")}if(e.cache==="no-cache")return t.revalidate(s,e);let r=t.policy.needsRevalidation(s);return e.cache==="force-cache"||e.cache==="only-if-cached"||!r?t.respond(s.method,e,r?"stale":"hit"):t.revalidate(s,e)},"cacheFetch");my.invalidate=async(s,e)=>{if(e.cachePath)return vh.invalidate(s,e)};gy.exports=my});var _y=m((PL,Sy)=>{"use strict";var{FetchError:Ih,Request:bA,isRedirect:RA}=sr(),Th=require("url"),OA=Qo(),Ey=yy(),vA=Kn(),IA=o((s,e,t)=>{if(!RA(e.status)||t.redirect==="manual")return!1;if(t.redirect==="error")throw new Ih(`redirect mode is set to error: ${s.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new Ih(`redirect location header missing for: ${s.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(s.counter>=s.follow)throw new Ih(`maximum redirect reached at: ${s.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0},"canFollowRedirect"),TA=o((s,e,t)=>{let r={...t},i=e.headers.get("location"),n=new Th.URL(i,/^https?:/.test(i)?void 0:s.url);return new Th.URL(s.url).hostname!==n.hostname&&(s.headers.delete("authorization"),s.headers.delete("cookie")),(e.status===303||s.method==="POST"&&[301,302].includes(e.status))&&(r.method="GET",r.body=null,s.headers.delete("content-length")),r.headers={},s.headers.forEach((c,h)=>{r.headers[h]=c}),r.counter=++s.counter,{request:new bA(Th.format(n),r),options:r}},"getRedirect"),wy=o(async(s,e)=>{let t=OA.storable(s,e)?await Ey(s,e):await vA(s,e);if(!["GET","HEAD"].includes(s.method)&&t.status>=200&&t.status<=399&&await Ey.invalidate(s,e),!IA(s,t,e))return t;let r=TA(s,t,e);return wy(r.request,r.options)},"fetch");Sy.exports=wy});var{FetchError:CA,Headers:AA,Request:by,Response:xA}=sr(),BA=wu(),NA=_y(),Qn=o((s,e)=>{let t=BA(e),r=new by(s,t);return NA(r,t)},"makeFetchHappen");Qn.defaults=(s,e={},t=Qn)=>{typeof s=="object"&&(e=s,s=null);let r=o((i,n={})=>{let a=i||s,c={...e,...n,headers:{...e.headers,...n.headers}};return t(a,c)},"defaultedFetch");return r.defaults=(i,n={})=>Qn.defaults(i,n,r),r};module.exports=Qn;module.exports.FetchError=CA;module.exports.Headers=AA;module.exports.Request=by;module.exports.Response=xA;
|
|
25
|
+
`;let h=(0,xv.parseProxyResponse)(i);i.write(`${c}\r
|
|
26
|
+
`);let{connect:u,buffered:l}=await h;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",Cv),t.secureEndpoint?(kr("Upgrading socket connection to TLS"),qm.connect({...jm(Um(t),"host","path","port"),socket:i})):i;i.destroy();let f=new _n.Socket({writable:!1});return f.readable=!0,e.once("socket",d=>{kr("Replaying proxy buffer for failed request"),(0,Iv.default)(d.listenerCount("data")>0),d.push(l),d.push(null)}),f}};bn.protocols=["http","https"];Ae.HttpsProxyAgent=bn;function Cv(s){s.resume()}o(Cv,"resume");function jm(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(jm,"omit")});var Km=m(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});var Vm=require("buffer"),Zt={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};mt.ERRORS=Zt;function Bv(s){if(!Vm.Buffer.isEncoding(s))throw new Error(Zt.INVALID_ENCODING)}o(Bv,"checkEncoding");mt.checkEncoding=Bv;function Wm(s){return typeof s=="number"&&isFinite(s)&&kv(s)}o(Wm,"isFiniteInteger");mt.isFiniteInteger=Wm;function Zm(s,e){if(typeof s=="number"){if(!Wm(s)||s<0)throw new Error(e?Zt.INVALID_OFFSET:Zt.INVALID_LENGTH)}else throw new Error(e?Zt.INVALID_OFFSET_NON_NUMBER:Zt.INVALID_LENGTH_NON_NUMBER)}o(Zm,"checkOffsetOrLengthValue");function Nv(s){Zm(s,!1)}o(Nv,"checkLengthValue");mt.checkLengthValue=Nv;function Pv(s){Zm(s,!0)}o(Pv,"checkOffsetValue");mt.checkOffsetValue=Pv;function Lv(s,e){if(s<0||s>e.length)throw new Error(Zt.INVALID_TARGET_OFFSET)}o(Lv,"checkTargetOffset");mt.checkTargetOffset=Lv;function kv(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}o(kv,"isInteger");function Dv(s){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof Vm.Buffer.prototype[s]>"u")throw new Error(`Platform does not support Buffer.prototype.${s}.`)}o(Dv,"bigIntAndBufferInt64Check");mt.bigIntAndBufferInt64Check=Dv});var Xm=m(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});var x=Km(),Ym=4096,Mv="utf8",Cc=class s{static{o(this,"SmartBuffer")}constructor(e){if(this.length=0,this._encoding=Mv,this._writeOffset=0,this._readOffset=0,s.isSmartBufferOptions(e))if(e.encoding&&(x.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(x.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(x.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(e.buff)if(Buffer.isBuffer(e.buff))this._buff=e.buff,this.length=e.buff.length;else throw new Error(x.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(Ym);else{if(typeof e<"u")throw new Error(x.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(Ym)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let t=e;return t&&(t.encoding!==void 0||t.size!==void 0||t.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return x.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return x.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t),this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return x.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return x.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}writeUInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}insertUInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}writeUInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}insertUInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}writeUInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}insertUInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}writeBigUInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return x.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,t){let r;typeof e=="number"?(x.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(t=e,r=this.length-this._readOffset),typeof t<"u"&&x.checkEncoding(t);let i=this._buff.slice(this._readOffset,this._readOffset+r).toString(t||this._encoding);return this._readOffset+=r,i}insertString(e,t,r){return x.checkOffsetValue(t),this._handleString(e,!0,t,r)}writeString(e,t,r){return this._handleString(e,!1,t,r)}readStringNT(e){typeof e<"u"&&x.checkEncoding(e);let t=this.length;for(let i=this._readOffset;i<this.length;i++)if(this._buff[i]===0){t=i;break}let r=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,r.toString(e||this._encoding)}insertStringNT(e,t,r){return x.checkOffsetValue(t),this.insertString(e,t,r),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,r){return this.writeString(e,t,r),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e<"u"&&x.checkLengthValue(e);let t=typeof e=="number"?e:this.length,r=Math.min(this.length,this._readOffset+t),i=this._buff.slice(this._readOffset,r);return this._readOffset=r,i}insertBuffer(e,t){return x.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let r=this._readOffset;r<this.length;r++)if(this._buff[r]===0){e=r;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return x.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t<"u"&&x.checkOffsetValue(t),this.writeBuffer(e,t),this.writeUInt8(0,typeof t=="number"?t+e.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(e){x.checkOffsetValue(e),x.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){x.checkOffsetValue(e),x.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){x.checkEncoding(e),this._encoding=e}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(e){let t=typeof e=="string"?e:this._encoding;return x.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,r,i){let n=this._writeOffset,a=this._encoding;typeof r=="number"?n=r:typeof r=="string"&&(x.checkEncoding(r),a=r),typeof i=="string"&&(x.checkEncoding(i),a=i);let c=Buffer.byteLength(e,a);return t?this.ensureInsertable(c,n):this._ensureWriteable(c,n),this._buff.write(e,n,c,a),t?this._writeOffset+=c:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,n+c):this._writeOffset+=c,this}_handleBuffer(e,t,r){let i=typeof r=="number"?r:this._writeOffset;return t?this.ensureInsertable(e.length,i):this._ensureWriteable(e.length,i),e.copy(this._buff,i),t?this._writeOffset+=e.length:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,i+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let r=this._readOffset;if(typeof t<"u"&&(x.checkOffsetValue(t),r=t),r<0||r+e>this.length)throw new Error(x.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){x.checkOffsetValue(t),this._ensureCapacity(this.length+e),t<this.length&&this._buff.copy(this._buff,t+e,t,this._buff.length),t+e>this.length?this.length=t+e:this.length+=e}_ensureWriteable(e,t){let r=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let r=this._buff,i=t*3/2+1;i<e&&(i=e),this._buff=Buffer.allocUnsafe(i),r.copy(this._buff,0,0,t)}}_readNumberValue(e,t,r){this.ensureReadable(t,r);let i=e.call(this._buff,typeof r=="number"?r:this._readOffset);return typeof r>"u"&&(this._readOffset+=t),i}_insertNumberValue(e,t,r,i){return x.checkOffsetValue(i),this.ensureInsertable(t,i),e.call(this._buff,r,i),this._writeOffset+=t,this}_writeNumberValue(e,t,r,i){if(typeof i=="number"){if(i<0)throw new Error(x.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);x.checkOffsetValue(i)}let n=typeof i=="number"?i:this._writeOffset;return this._ensureWriteable(t,n),e.call(this._buff,r,n),typeof i=="number"?this._writeOffset=Math.max(this._writeOffset,n+t):this._writeOffset+=t,this}};Bc.SmartBuffer=Cc});var Nc=m($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.SOCKS5_NO_ACCEPTABLE_AUTH=$.SOCKS5_CUSTOM_AUTH_END=$.SOCKS5_CUSTOM_AUTH_START=$.SOCKS_INCOMING_PACKET_SIZES=$.SocksClientState=$.Socks5Response=$.Socks5HostType=$.Socks5Auth=$.Socks4Response=$.SocksCommand=$.ERRORS=$.DEFAULT_TIMEOUT=void 0;var $v=3e4;$.DEFAULT_TIMEOUT=$v;var Fv={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};$.ERRORS=Fv;var qv={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:o(s=>s+7,"Socks5ResponseHostname"),Socks4Response:8};$.SOCKS_INCOMING_PACKET_SIZES=qv;var Jm;(function(s){s[s.connect=1]="connect",s[s.bind=2]="bind",s[s.associate=3]="associate"})(Jm||($.SocksCommand=Jm={}));var Qm;(function(s){s[s.Granted=90]="Granted",s[s.Failed=91]="Failed",s[s.Rejected=92]="Rejected",s[s.RejectedIdent=93]="RejectedIdent"})(Qm||($.Socks4Response=Qm={}));var eg;(function(s){s[s.NoAuth=0]="NoAuth",s[s.GSSApi=1]="GSSApi",s[s.UserPass=2]="UserPass"})(eg||($.Socks5Auth=eg={}));var Uv=128;$.SOCKS5_CUSTOM_AUTH_START=Uv;var jv=254;$.SOCKS5_CUSTOM_AUTH_END=jv;var Hv=255;$.SOCKS5_NO_ACCEPTABLE_AUTH=Hv;var tg;(function(s){s[s.Granted=0]="Granted",s[s.Failure=1]="Failure",s[s.NotAllowed=2]="NotAllowed",s[s.NetworkUnreachable=3]="NetworkUnreachable",s[s.HostUnreachable=4]="HostUnreachable",s[s.ConnectionRefused=5]="ConnectionRefused",s[s.TTLExpired=6]="TTLExpired",s[s.CommandNotSupported=7]="CommandNotSupported",s[s.AddressNotSupported=8]="AddressNotSupported"})(tg||($.Socks5Response=tg={}));var sg;(function(s){s[s.IPv4=1]="IPv4",s[s.Hostname=3]="Hostname",s[s.IPv6=4]="IPv6"})(sg||($.Socks5HostType=sg={}));var rg;(function(s){s[s.Created=0]="Created",s[s.Connecting=1]="Connecting",s[s.Connected=2]="Connected",s[s.SentInitialHandshake=3]="SentInitialHandshake",s[s.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",s[s.SentAuthentication=5]="SentAuthentication",s[s.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",s[s.SentFinalHandshake=7]="SentFinalHandshake",s[s.ReceivedFinalResponse=8]="ReceivedFinalResponse",s[s.BoundWaitingForConnection=9]="BoundWaitingForConnection",s[s.Established=10]="Established",s[s.Disconnected=11]="Disconnected",s[s.Error=99]="Error"})(rg||($.SocksClientState=rg={}))});var Lc=m(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.shuffleArray=As.SocksClientError=void 0;var Pc=class extends Error{static{o(this,"SocksClientError")}constructor(e,t){super(e),this.options=t}};As.SocksClientError=Pc;function zv(s){for(let e=s.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[s[e],s[t]]=[s[t],s[e]]}}o(zv,"shuffleArray");As.shuffleArray=zv});var Rn=m(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.isInSubnet=Gv;Kt.isCorrect=Vv;Kt.numberToPaddedHex=ig;Kt.stringToPaddedHex=Wv;Kt.testBit=Zv;function Gv(s){return this.subnetMask<s.subnetMask?!1:this.mask(s.subnetMask)===s.mask()}o(Gv,"isInSubnet");function Vv(s){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===s&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}o(Vv,"isCorrect");function ig(s){return s.toString(16).padStart(2,"0")}o(ig,"numberToPaddedHex");function Wv(s){return ig(parseInt(s,10))}o(Wv,"stringToPaddedHex");function Zv(s,e){let{length:t}=s;if(e>t)return!1;let r=t-e;return s.substring(r,r+1)==="1"}o(Zv,"testBit")});var kc=m(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.RE_SUBNET_STRING=Ze.RE_ADDRESS=Ze.GROUPS=Ze.BITS=void 0;Ze.BITS=32;Ze.GROUPS=4;Ze.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;Ze.RE_SUBNET_STRING=/\/\d{1,2}$/});var In=m(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.AddressError=void 0;var Dc=class extends Error{static{o(this,"AddressError")}constructor(e,t){super(e),this.name="AddressError",this.parseMessage=t}};On.AddressError=Dc});var $c=m(Ke=>{"use strict";var Kv=Ke&&Ke.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),Yv=Ke&&Ke.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),og=Ke&&Ke.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&Kv(e,s,t);return Yv(e,s),e};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Address4=void 0;var xs=og(Rn()),ke=og(kc()),ng=In(),Mc=class s{static{o(this,"Address4")}constructor(e){this.groups=ke.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=xs.isCorrect(ke.BITS),this.isInSubnet=xs.isInSubnet,this.address=e;let t=ke.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>ke.BITS)throw new ng.AddressError("Invalid subnet mask.");e=e.replace(ke.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new s(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match(ke.RE_ADDRESS))throw new ng.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],i;for(i=0;i<8;i+=2){let n=t.slice(i,i+2);r.push(parseInt(n,16))}return new s(r.join("."))}static fromInteger(e){return s.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new s(r)}toHex(){return this.parsedAddress.map(e=>xs.stringToPaddedHex(e)).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<ke.GROUPS;t+=2)e.push(`${xs.stringToPaddedHex(this.parsedAddress[t])}${xs.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>xs.stringToPaddedHex(e)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(ke.BITS-this.subnetMask)}`)}startAddress(){return s.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(ke.BITS-this.subnetMask)}`)}endAddress(){return s.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._endAddress()-e)}static fromBigInt(e){return s.fromHex(e.toString(16))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||(e={});let t=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?t:`${t}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(new s("224.0.0.0/4"))}binaryZeroPad(){return this.bigInt().toString(2).padStart(ke.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(ke.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${e.slice(0,2).join(".")}</span>.<span class="hover-group group-v4 group-7">${e.slice(2,4).join(".")}</span>`)}};Ke.Address4=Mc});var Fc=m(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.RE_URL_WITH_PORT=U.RE_URL=U.RE_ZONE_STRING=U.RE_SUBNET_STRING=U.RE_BAD_ADDRESS=U.RE_BAD_CHARACTERS=U.TYPES=U.SCOPES=U.GROUPS=U.BITS=void 0;U.BITS=128;U.GROUPS=8;U.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};U.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};U.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;U.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;U.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;U.RE_ZONE_STRING=/%.*$/;U.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/;U.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/});var qc=m(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.spanAllZeroes=ag;Cs.spanAll=Xv;Cs.spanLeadingZeroes=Jv;Cs.simpleGroup=Qv;function ag(s){return s.replace(/(0+)/g,'<span class="zero">$1</span>')}o(ag,"spanAllZeroes");function Xv(s,e=0){return s.split("").map((r,i)=>`<span class="digit value-${r} position-${i+e}">${ag(r)}</span>`).join("")}o(Xv,"spanAll");function cg(s){return s.replace(/^(0+)/,'<span class="zero">$1</span>')}o(cg,"spanLeadingZeroesSimple");function Jv(s){return s.split(":").map(t=>cg(t)).join(":")}o(Jv,"spanLeadingZeroes");function Qv(s,e=0){return s.split(":").map((r,i)=>/group-v4/.test(r)?r:`<span class="hover-group group-${i+e}">${cg(r)}</span>`)}o(Qv,"simpleGroup")});var hg=m(fe=>{"use strict";var eT=fe&&fe.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),tT=fe&&fe.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),sT=fe&&fe.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&eT(e,s,t);return tT(e,s),e};Object.defineProperty(fe,"__esModule",{value:!0});fe.ADDRESS_BOUNDARY=void 0;fe.groupPossibilities=Tn;fe.padGroup=vn;fe.simpleRegularExpression=iT;fe.possibleElisions=nT;var rT=sT(Fc());function Tn(s){return`(${s.join("|")})`}o(Tn,"groupPossibilities");function vn(s){return s.length<4?`0{0,${4-s.length}}${s}`:s}o(vn,"padGroup");fe.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function iT(s){let e=[];s.forEach((r,i)=>{parseInt(r,16)===0&&e.push(i)});let t=e.map(r=>s.map((i,n)=>{if(n===r){let a=n===0||n===rT.GROUPS-1?":":"";return Tn([vn(i),a])}return vn(i)}).join(":"));return t.push(s.map(vn).join(":")),Tn(t)}o(iT,"simpleRegularExpression");function nT(s,e,t){let r=e?"":":",i=t?"":":",n=[];!e&&!t&&n.push("::"),e&&t&&n.push(""),(t&&!e||!t&&e)&&n.push(":"),n.push(`${r}(:0{1,4}){1,${s-1}}`),n.push(`(0{1,4}:){1,${s-1}}${i}`),n.push(`(0{1,4}:){${s-1}}0{1,4}`);for(let a=1;a<s-1;a++)for(let c=1;c<s-a;c++)n.push(`(0{1,4}:){${c}}:(0{1,4}:){${s-c-a-1}}0{1,4}`);return Tn(n)}o(nT,"possibleElisions")});var dg=m(Ye=>{"use strict";var oT=Ye&&Ye.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),aT=Ye&&Ye.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Cn=Ye&&Ye.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&oT(e,s,t);return aT(e,s),e};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Address6=void 0;var ug=Cn(Rn()),Uc=Cn(kc()),F=Cn(Fc()),jc=Cn(qc()),Yt=$c(),Xt=hg(),gt=In(),An=Rn();function xn(s){if(!s)throw new Error("Assertion failed.")}o(xn,"assert");function cT(s){let e=/(\d+)(\d{3})/;for(;e.test(s);)s=s.replace(e,"$1,$2");return s}o(cT,"addCommas");function hT(s){return s=s.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),s=s.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),s}o(hT,"spanLeadingZeroes4");function uT(s,e){let t=[],r=[],i;for(i=0;i<s.length;i++)i<e[0]?t.push(s[i]):i>e[1]&&r.push(s[i]);return t.concat(["compact"]).concat(r)}o(uT,"compact");function lg(s){return parseInt(s,16).toString(16).padStart(4,"0")}o(lg,"paddedHex");function fg(s){return s&255}o(fg,"unsignByte");var Hc=class s{static{o(this,"Address6")}constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=ug.isInSubnet,this.isCorrect=ug.isCorrect(F.BITS),t===void 0?this.groups=F.GROUPS:this.groups=t,this.address=e;let r=F.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>F.BITS)throw new gt.AddressError("Invalid subnet mask.");e=e.replace(F.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new gt.AddressError("Invalid subnet mask.");let i=F.RE_ZONE_STRING.exec(e);i&&(this.zone=i[0],e=e.replace(F.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new s(e),!0}catch{return!1}}static fromBigInt(e){let t=e.toString(16).padStart(32,"0"),r=[],i;for(i=0;i<F.GROUPS;i++)r.push(t.slice(i*4,(i+1)*4));return new s(r.join(":"))}static fromURL(e){let t,r=null,i;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(i=F.RE_URL_WITH_PORT.exec(e),i===null)return{error:"failed to parse address with port",address:null,port:null};t=i[1],r=i[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),i=F.RE_URL.exec(e),i===null)return{error:"failed to parse address from URL",address:null,port:null};t=i[1]}else t=e;return r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new s(t),port:r}}static fromAddress4(e){let t=new Yt.Address4(e),r=F.BITS-(Uc.BITS-t.subnetMask);return new s(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new gt.AddressError("Invalid 'ip6.arpa' form.");let i=t.split(".").reverse();for(let n=r;n>0;n--){let a=n*4;i.splice(a,0,":")}return t=i.join(""),new s(t)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=F.BITS-this.subnetMask,r=Math.abs(e-F.BITS),i=t-r;return i<0?"0":cT((BigInt("2")**BigInt(i)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(F.BITS-this.subnetMask)}`)}startAddress(){return s.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(F.BITS-this.subnetMask)}`)}endAddress(){return s.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return s.fromBigInt(this._endAddress()-e)}getScope(){let e=F.SCOPES[parseInt(this.getBits(12,16).toString(10),10)];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"}getType(){for(let e of Object.keys(F.TYPES))if(this.isInSubnet(new s(e)))return F.TYPES[e];return"Global unicast"}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,F.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:`${r}.ip6.arpa.`:e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,i=[];for(e=0;e<this.parsedAddress.length;e++){let c=parseInt(this.parsedAddress[e],16);c===0&&r++,c!==0&&r>0&&(r>1&&i.push([e-r,e-1]),r=0)}r>1&&i.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);let n=i.map(c=>c[1]-c[0]+1);if(i.length>0){let c=n.indexOf(Math.max(...n));t=uT(this.parsedAddress,i[c])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!=="compact"&&(t[e]=parseInt(t[e],16).toString(16));let a=t.join(":");return a=a.replace(/^compact$/,"::"),a=a.replace(/(^compact)|(compact$)/,":"),a=a.replace(/compact/,""),a}binaryZeroPad(){return this.bigInt().toString(2).padStart(F.BITS,"0")}parse4in6(e){let t=e.split(":"),i=t.slice(-1)[0].match(Uc.RE_ADDRESS);if(i){this.parsedAddress4=i[0],this.address4=new Yt.Address4(this.parsedAddress4);for(let n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new gt.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(Uc.RE_ADDRESS,this.address4.parsedAddress.map(hT).join(".")));this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(":")}return e}parse(e){e=this.parse4in6(e);let t=e.match(F.RE_BAD_CHARACTERS);if(t)throw new gt.AddressError(`Bad character${t.length>1?"s":""} detected in address: ${t.join("")}`,e.replace(F.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let r=e.match(F.RE_BAD_ADDRESS);if(r)throw new gt.AddressError(`Address failed regex: ${r.join("")}`,e.replace(F.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let i=[],n=e.split("::");if(n.length===2){let a=n[0].split(":"),c=n[1].split(":");a.length===1&&a[0]===""&&(a=[]),c.length===1&&c[0]===""&&(c=[]);let h=this.groups-(a.length+c.length);if(!h)throw new gt.AddressError("Error parsing groups");this.elidedGroups=h,this.elisionBegin=a.length,this.elisionEnd=a.length+this.elidedGroups,i=i.concat(a);for(let u=0;u<h;u++)i.push("0");i=i.concat(c)}else if(n.length===1)i=e.split(":"),this.elidedGroups=0;else throw new gt.AddressError("Too many :: groups found");if(i=i.map(a=>parseInt(a,16).toString(16)),i.length!==this.groups)throw new gt.AddressError("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(lg).join(":")}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(lg).join("")}`)}to4(){let e=this.binaryZeroPad().split("");return Yt.Address4.fromHex(BigInt(`0b${e.slice(96,128).join("")}`).toString(16))}to4in6(){let e=this.to4(),r=new s(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),i="";return/:$/.test(r)||(i=":"),r+i+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),r=(this.getBits(80,96)^BigInt("0xffff")).toString(),i=Yt.Address4.fromHex(this.getBitsBase16(32,64)),n=this.getBits(96,128),a=Yt.Address4.fromHex((n^BigInt("0xffffffff")).toString(16)),c=this.getBitsBase2(64,80),h=(0,An.testBit)(c,15),u=(0,An.testBit)(c,14),l=(0,An.testBit)(c,8),f=(0,An.testBit)(c,9),d=BigInt(`0b${c.slice(2,6)+c.slice(8,16)}`).toString(10);return{prefix:`${e.slice(0,4)}:${e.slice(4,8)}`,server4:i.address,client4:a.address,flags:c,coneNat:h,microsoft:{reserved:u,universalLocal:f,groupIndividual:l,nonce:d},udpPort:r}}inspect6to4(){let e=this.getBitsBase16(0,16),t=Yt.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:e.slice(0,4),gateway:t.address}}to6to4(){if(!this.is4())return null;let e=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new s(e)}toByteArray(){let e=this.bigInt().toString(16),r=`${"0".repeat(e.length%2)}${e}`,i=[];for(let n=0,a=r.length;n<a;n+=2)i.push(parseInt(r.substring(n,n+2),16));return i}toUnsignedByteArray(){return this.toByteArray().map(fg)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(fg))}static fromUnsignedByteArray(e){let t=BigInt("256"),r=BigInt("0"),i=BigInt("1");for(let n=e.length-1;n>=0;n--)r+=i*BigInt(e[n].toString(10)),i*=t;return s.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new s("2001::/32"))}is6to4(){return this.isInSubnet(new s("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let r=t.call(this);return e.className?`<a href="${e.prefix}${r}" class="${e.className}">${r}</a>`:`<a href="${e.prefix}${r}">${r}</a>`}group(){if(this.elidedGroups===0)return jc.simpleGroup(this.address).join(":");xn(typeof this.elidedGroups=="number"),xn(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...jc.simpleGroup(t)):e.push("");let i=["hover-group"];for(let n=this.elisionBegin;n<this.elisionBegin+this.elidedGroups;n++)i.push(`group-${n}`);return e.push(`<span class="${i.join(" ")}"></span>`),r.length?e.push(...jc.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(xn(this.address4 instanceof Yt.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new s(this.correctForm());if(r.elidedGroups===0)t.push((0,Xt.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===F.GROUPS)t.push((0,Xt.possibleElisions)(F.GROUPS));else{let i=r.address.split("::");i[0].length&&t.push((0,Xt.simpleRegularExpression)(i[0].split(":"))),xn(typeof r.elidedGroups=="number"),t.push((0,Xt.possibleElisions)(r.elidedGroups,i[0].length!==0,i[1].length!==0)),i[1].length&&t.push((0,Xt.simpleRegularExpression)(i[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",Xt.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",Xt.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};Ye.Address6=Hc});var zc=m(se=>{"use strict";var lT=se&&se.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),fT=se&&se.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),dT=se&&se.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&lT(e,s,t);return fT(e,s),e};Object.defineProperty(se,"__esModule",{value:!0});se.v6=se.AddressError=se.Address6=se.Address4=void 0;var pT=$c();Object.defineProperty(se,"Address4",{enumerable:!0,get:o(function(){return pT.Address4},"get")});var mT=dg();Object.defineProperty(se,"Address6",{enumerable:!0,get:o(function(){return mT.Address6},"get")});var gT=In();Object.defineProperty(se,"AddressError",{enumerable:!0,get:o(function(){return gT.AddressError},"get")});var yT=dT(qc());se.v6={helpers:yT}});var wg=m(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.ipToBuffer=xe.int32ToIpv4=xe.ipv4ToInt32=xe.validateSocksClientChainOptions=xe.validateSocksClientOptions=void 0;var ae=Lc(),Z=Nc(),ET=require("stream"),Gc=zc(),pg=require("net");function wT(s,e=["connect","bind","associate"]){if(!Z.SocksCommand[s.command])throw new ae.SocksClientError(Z.ERRORS.InvalidSocksCommand,s);if(e.indexOf(s.command)===-1)throw new ae.SocksClientError(Z.ERRORS.InvalidSocksCommandForOperation,s);if(!gg(s.destination))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsDestination,s);if(!yg(s.proxy))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsProxy,s);if(mg(s.proxy,s),s.timeout&&!Eg(s.timeout))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsTimeout,s);if(s.existing_socket&&!(s.existing_socket instanceof ET.Duplex))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsExistingSocket,s)}o(wT,"validateSocksClientOptions");xe.validateSocksClientOptions=wT;function ST(s){if(s.command!=="connect")throw new ae.SocksClientError(Z.ERRORS.InvalidSocksCommandChain,s);if(!gg(s.destination))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsDestination,s);if(!(s.proxies&&Array.isArray(s.proxies)&&s.proxies.length>=2))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsProxiesLength,s);if(s.proxies.forEach(e=>{if(!yg(e))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsProxy,s);mg(e,s)}),s.timeout&&!Eg(s.timeout))throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsTimeout,s)}o(ST,"validateSocksClientChainOptions");xe.validateSocksClientChainOptions=ST;function mg(s,e){if(s.custom_auth_method!==void 0){if(s.custom_auth_method<Z.SOCKS5_CUSTOM_AUTH_START||s.custom_auth_method>Z.SOCKS5_CUSTOM_AUTH_END)throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(s.custom_auth_request_handler===void 0||typeof s.custom_auth_request_handler!="function")throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(s.custom_auth_response_size===void 0)throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(s.custom_auth_response_handler===void 0||typeof s.custom_auth_response_handler!="function")throw new ae.SocksClientError(Z.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}o(mg,"validateCustomProxyAuth");function gg(s){return s&&typeof s.host=="string"&&Buffer.byteLength(s.host)<256&&typeof s.port=="number"&&s.port>=0&&s.port<=65535}o(gg,"isValidSocksRemoteHost");function yg(s){return s&&(typeof s.host=="string"||typeof s.ipaddress=="string")&&typeof s.port=="number"&&s.port>=0&&s.port<=65535&&(s.type===4||s.type===5)}o(yg,"isValidSocksProxy");function Eg(s){return typeof s=="number"&&s>0}o(Eg,"isValidTimeoutValue");function _T(s){return new Gc.Address4(s).toArray().reduce((t,r)=>(t<<8)+r,0)>>>0}o(_T,"ipv4ToInt32");xe.ipv4ToInt32=_T;function bT(s){let e=s>>>24&255,t=s>>>16&255,r=s>>>8&255,i=s&255;return[e,t,r,i].join(".")}o(bT,"int32ToIpv4");xe.int32ToIpv4=bT;function RT(s){if(pg.isIPv4(s)){let e=new Gc.Address4(s);return Buffer.from(e.toArray())}else if(pg.isIPv6(s)){let e=new Gc.Address6(s);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}o(RT,"ipToBuffer");xe.ipToBuffer=RT});var Sg=m(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.ReceiveBuffer=void 0;var Vc=class{static{o(this,"ReceiveBuffer")}constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}};Bn.ReceiveBuffer=Vc});var _g=m(At=>{"use strict";var Bs=At&&At.__awaiter||function(s,e,t,r){function i(n){return n instanceof t?n:new t(function(a){a(n)})}return o(i,"adopt"),new(t||(t=Promise))(function(n,a){function c(l){try{u(r.next(l))}catch(f){a(f)}}o(c,"fulfilled");function h(l){try{u(r.throw(l))}catch(f){a(f)}}o(h,"rejected");function u(l){l.done?n(l.value):i(l.value).then(c,h)}o(u,"step"),u((r=r.apply(s,e||[])).next())})};Object.defineProperty(At,"__esModule",{value:!0});At.SocksClientError=At.SocksClient=void 0;var OT=require("events"),Ns=require("net"),de=Xm(),E=Nc(),we=wg(),IT=Sg(),Zc=Lc();Object.defineProperty(At,"SocksClientError",{enumerable:!0,get:o(function(){return Zc.SocksClientError},"get")});var Wc=zc(),Kc=class s extends OT.EventEmitter{static{o(this,"SocksClient")}constructor(e){super(),this.options=Object.assign({},e),(0,we.validateSocksClientOptions)(e),this.setState(E.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,i)=>{try{(0,we.validateSocksClientOptions)(e,["connect"])}catch(a){return typeof t=="function"?(t(a),r(a)):i(a)}let n=new s(e);n.connect(e.existing_socket),n.once("established",a=>{n.removeAllListeners(),typeof t=="function"&&t(null,a),r(a)}),n.once("error",a=>{n.removeAllListeners(),typeof t=="function"?(t(a),r(a)):i(a)})})}static createConnectionChain(e,t){return new Promise((r,i)=>Bs(this,void 0,void 0,function*(){try{(0,we.validateSocksClientChainOptions)(e)}catch(n){return typeof t=="function"?(t(n),r(n)):i(n)}e.randomizeChain&&(0,Zc.shuffleArray)(e.proxies);try{let n;for(let a=0;a<e.proxies.length;a++){let c=e.proxies[a],h=a===e.proxies.length-1?e.destination:{host:e.proxies[a+1].host||e.proxies[a+1].ipaddress,port:e.proxies[a+1].port},u=yield s.createConnection({command:"connect",proxy:c,destination:h,existing_socket:n});n=n||u.socket}typeof t=="function"?(t(null,{socket:n}),r({socket:n})):r({socket:n})}catch(n){typeof t=="function"?(t(n),r(n)):i(n)}}))}static createUDPFrame(e){let t=new de.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),Ns.isIPv4(e.remoteHost.host)?(t.writeUInt8(E.Socks5HostType.IPv4),t.writeUInt32BE((0,we.ipv4ToInt32)(e.remoteHost.host))):Ns.isIPv6(e.remoteHost.host)?(t.writeUInt8(E.Socks5HostType.IPv6),t.writeBuffer((0,we.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(E.Socks5HostType.Hostname),t.writeUInt8(Buffer.byteLength(e.remoteHost.host)),t.writeString(e.remoteHost.host)),t.writeUInt16BE(e.remoteHost.port),t.writeBuffer(e.data),t.toBuffer()}static parseUDPFrame(e){let t=de.SmartBuffer.fromBuffer(e);t.readOffset=2;let r=t.readUInt8(),i=t.readUInt8(),n;i===E.Socks5HostType.IPv4?n=(0,we.int32ToIpv4)(t.readUInt32BE()):i===E.Socks5HostType.IPv6?n=Wc.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():n=t.readString(t.readUInt8());let a=t.readUInt16BE();return{frameNumber:r,remoteHost:{host:n,port:a},data:t.readBuffer()}}setState(e){this.state!==E.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=r=>this.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||E.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new Ns.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(E.SocksClientState.Connecting),this.receiveBuffer=new IT.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let i=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",i)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==E.SocksClientState.Established&&this.state!==E.SocksClientState.BoundWaitingForConnection&&this.closeSocket(E.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(E.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(E.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==E.SocksClientState.Established&&this.state!==E.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===E.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===E.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===E.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===E.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(E.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(E.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==E.SocksClientState.Error&&(this.setState(E.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new Zc.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new de.SmartBuffer;t.writeUInt8(4),t.writeUInt8(E.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),Ns.isIPv4(this.options.destination.host)?(t.writeBuffer((0,we.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==E.Socks4Response.Granted)this.closeSocket(`${E.ERRORS.Socks4ProxyRejectedConnection} - (${E.Socks4Response[e[1]]})`);else if(E.SocksCommand[this.options.command]===E.SocksCommand.bind){let t=de.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,we.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(E.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==E.Socks4Response.Granted)this.closeSocket(`${E.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${E.Socks4Response[e[1]]})`);else{let t=de.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,we.int32ToIpv4)(t.readUInt32BE())};this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new de.SmartBuffer,t=[E.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(E.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(E.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(E.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===E.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(E.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===E.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=E.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===E.Socks5Auth.UserPass?(this.socks5ChosenAuthType=E.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(E.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new de.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(E.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return Bs(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(E.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return Bs(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return Bs(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return Bs(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return Bs(this,void 0,void 0,function*(){this.setState(E.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===E.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===E.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(E.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new de.SmartBuffer;e.writeUInt8(5),e.writeUInt8(E.SocksCommand[this.options.command]),e.writeUInt8(0),Ns.isIPv4(this.options.destination.host)?(e.writeUInt8(E.Socks5HostType.IPv4),e.writeBuffer((0,we.ipToBuffer)(this.options.destination.host))):Ns.isIPv6(this.options.destination.host)?(e.writeUInt8(E.Socks5HostType.IPv6),e.writeBuffer((0,we.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(E.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(E.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==E.Socks5Response.Granted)this.closeSocket(`${E.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${E.Socks5Response[e[1]]}`);else{let t=e[3],r,i;if(t===E.Socks5HostType.IPv4){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,we.int32ToIpv4)(i.readUInt32BE()),port:i.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===E.Socks5HostType.Hostname){let n=e[4],a=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:i.readString(n),port:i.readUInt16BE()}}else if(t===E.Socks5HostType.IPv6){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:Wc.Address6.fromByteArray(Array.from(i.readBuffer(16))).canonicalForm(),port:i.readUInt16BE()}}this.setState(E.SocksClientState.ReceivedFinalResponse),E.SocksCommand[this.options.command]===E.SocksCommand.connect?(this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})):E.SocksCommand[this.options.command]===E.SocksCommand.bind?(this.setState(E.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:r,socket:this.socket})):E.SocksCommand[this.options.command]===E.SocksCommand.associate&&(this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==E.Socks5Response.Granted)this.closeSocket(`${E.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${E.Socks5Response[e[1]]}`);else{let t=e[3],r,i;if(t===E.Socks5HostType.IPv4){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,we.int32ToIpv4)(i.readUInt32BE()),port:i.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===E.Socks5HostType.Hostname){let n=e[4],a=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:i.readString(n),port:i.readUInt16BE()}}else if(t===E.Socks5HostType.IPv6){let n=E.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}i=de.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:Wc.Address6.fromByteArray(Array.from(i.readBuffer(16))).canonicalForm(),port:i.readUInt16BE()}}this.setState(E.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};At.SocksClient=Kc});var bg=m(Jt=>{"use strict";var vT=Jt&&Jt.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),TT=Jt&&Jt.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&vT(e,s,t)};Object.defineProperty(Jt,"__esModule",{value:!0});TT(_g(),Jt)});var Rg=m(Ce=>{"use strict";var AT=Ce&&Ce.__createBinding||(Object.create?(function(s,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(s,r,i)}):(function(s,e,t,r){r===void 0&&(r=t),s[r]=e[t]})),xT=Ce&&Ce.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Yc=Ce&&Ce.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&AT(e,s,t);return xT(e,s),e},CT=Ce&&Ce.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.SocksProxyAgent=void 0;var BT=bg(),NT=Lr(),PT=CT(Pr()),LT=Yc(require("dns")),kT=Yc(require("net")),DT=Yc(require("tls")),MT=require("url"),Nn=(0,PT.default)("socks-proxy-agent"),$T=o(s=>s.servername===void 0&&s.host&&!kT.isIP(s.host)?{...s,servername:s.host}:s,"setServernameFromNonIpHost");function FT(s){let e=!1,t=5,r=s.hostname,i=parseInt(s.port,10)||1080;switch(s.protocol.replace(":","")){case"socks4":e=!0,t=4;break;case"socks4a":t=4;break;case"socks5":e=!0,t=5;break;case"socks":t=5;break;case"socks5h":t=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${String(s.protocol)}`)}let n={host:r,port:i,type:t};return s.username&&Object.defineProperty(n,"userId",{value:decodeURIComponent(s.username),enumerable:!1}),s.password!=null&&Object.defineProperty(n,"password",{value:decodeURIComponent(s.password),enumerable:!1}),{lookup:e,proxy:n}}o(FT,"parseSocksURL");var Pn=class extends NT.Agent{static{o(this,"SocksProxyAgent")}constructor(e,t){super(t);let r=typeof e=="string"?new MT.URL(e):e,{proxy:i,lookup:n}=FT(r);this.shouldLookup=n,this.proxy=i,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:r,proxy:i,timeout:n}=this;if(!t.host)throw new Error("No `host` defined!");let{host:a}=t,{port:c,lookup:h=LT.lookup}=t;r&&(a=await new Promise((d,p)=>{h(a,{},(g,y)=>{g?p(g):d(y)})}));let u={proxy:i,destination:{host:a,port:typeof c=="number"?c:parseInt(c,10)},command:"connect",timeout:n??void 0,socket_options:this.socketOptions??void 0},l=o(d=>{e.destroy(),f.destroy(),d&&d.destroy()},"cleanup");Nn("Creating socks proxy connection: %o",u);let{socket:f}=await BT.SocksClient.createConnection(u);if(Nn("Successfully created socks proxy connection"),n!==null&&(f.setTimeout(n),f.on("timeout",()=>l())),t.secureEndpoint){Nn("Upgrading socket connection to TLS");let d=DT.connect({...qT($T(t),"host","path","port"),socket:f});return d.once("error",p=>{Nn("Socket TLS error",p.message),l(d)}),d}return f}};Pn.protocols=["socks","socks4","socks4a","socks5","socks5h"];Ce.SocksProxyAgent=Pn;function qT(s,...e){let t={},r;for(r in s)e.includes(r)||(t[r]=s[r]);return t}o(qT,"omit")});var sh=m((mP,Og)=>{"use strict";var Xc=class extends Error{static{o(this,"InvalidProxyProtocolError")}constructor(e){super(`Invalid protocol \`${e.protocol}\` connecting to proxy \`${e.host}\``),this.code="EINVALIDPROXY",this.proxy=e}},Jc=class extends Error{static{o(this,"ConnectionTimeoutError")}constructor(e){super(`Timeout connecting to host \`${e}\``),this.code="ECONNECTIONTIMEOUT",this.host=e}},Qc=class extends Error{static{o(this,"IdleTimeoutError")}constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code="EIDLETIMEOUT",this.host=e}},eh=class extends Error{static{o(this,"ResponseTimeoutError")}constructor(e,t){let r="Response timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`connecting to host \`${e.host}\``,super(r),this.code="ERESPONSETIMEOUT",this.proxy=t,this.request=e}},th=class extends Error{static{o(this,"TransferTimeoutError")}constructor(e,t){let r="Transfer timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`for \`${e.host}\``,super(r),this.code="ETRANSFERTIMEOUT",this.proxy=t,this.request=e}};Og.exports={InvalidProxyProtocolError:Xc,ConnectionTimeoutError:Jc,IdleTimeoutError:Qc,ResponseTimeoutError:eh,TransferTimeoutError:th}});var rh=m((yP,vg)=>{"use strict";var{HttpProxyAgent:UT}=$m(),{HttpsProxyAgent:jT}=Gm(),{SocksProxyAgent:Ig}=Rg(),{LRUCache:HT}=gs(),{InvalidProxyProtocolError:zT}=sh(),GT=new HT({max:20}),VT=new Set(Ig.protocols),WT=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),Dr=Object.entries(process.env).reduce((s,[e,t])=>(e=e.toLowerCase(),WT.has(e)&&(s[e]=t),s),{}),ZT=o(s=>{s=new URL(s);let e=s.protocol.slice(0,-1);if(VT.has(e))return Ig;if(e==="https"||e==="http")return[UT,jT];throw new zT(s)},"getProxyAgent"),KT=o((s,e)=>{if(typeof e=="string"&&(e=e.split(",").map(r=>r.trim()).filter(Boolean)),!e||!e.length)return!1;let t=s.hostname.split(".").reverse();return e.some(r=>{let i=r.split(".").filter(Boolean).reverse();if(!i.length)return!1;for(let n=0;n<i.length;n++)if(t[n]!==i[n])return!1;return!0})},"isNoProxy"),YT=o((s,{proxy:e,noProxy:t})=>(s=new URL(s),e||(e=s.protocol==="https:"?Dr.https_proxy:Dr.https_proxy||Dr.http_proxy||Dr.proxy),t||(t=Dr.no_proxy),!e||KT(s,t)?null:new URL(e)),"getProxy");vg.exports={getProxyAgent:ZT,getProxy:YT,proxyCache:GT}});var xg=m((SP,Ag)=>{"use strict";var XT=require("net"),JT=require("tls"),{once:Tg}=require("events"),QT=require("timers/promises"),{normalizeOptions:eA,cacheOptions:tA}=Ac(),{getProxy:sA,getProxyAgent:rA,proxyCache:ih}=rh(),Ln=sh(),{Agent:iA}=Lr();Ag.exports=class extends iA{static{o(this,"Agent")}#e;#t;#s;#r;#i;constructor(e={}){let{timeouts:t,proxy:r,noProxy:i,...n}=eA(e);super(n),this.#e=n,this.#t=t,r&&(this.#s=new URL(r),this.#r=i,this.#i=rA(r))}get proxy(){return this.#s?{url:this.#s}:{}}#a(e){if(!this.#s)return;let t=sA(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#s,noProxy:this.#r});if(!t)return;let r=tA({...e,...this.#e,timeouts:this.#t,proxy:t});if(ih.has(r))return ih.get(r);let i=this.#i;Array.isArray(i)&&(i=this.isSecureEndpoint(e)?i[1]:i[0]);let n=new i(t,{...this.#e,socketOptions:{family:this.#e.family}});return ih.set(r,n),n}async#l({promises:e,options:t,timeout:r},i=new AbortController){if(r){let a=QT.setTimeout(r,null,{signal:i.signal}).then(()=>{throw new Ln.ConnectionTimeoutError(`${t.host}:${t.port}`)}).catch(c=>{if(c.name!=="AbortError")throw c});e.push(a)}let n;try{n=await Promise.race(e),i.abort()}catch(a){throw i.abort(),a}return n}async connect(e,t){t.lookup??=this.#e.lookup;let r,i=this.#t.connection,n=this.isSecureEndpoint(t),a=this.#a(t);if(a){let l=Date.now();r=await this.#l({options:t,timeout:i,promises:[a.connect(e,t)]}),i&&(i=i-(Date.now()-l))}else r=(n?JT:XT).connect(t);r.setKeepAlive(this.keepAlive,this.keepAliveMsecs),r.setNoDelay(this.keepAlive);let c=new AbortController,{signal:h}=c,u=r[n?"secureConnecting":"connecting"]?Tg(r,n?"secureConnect":"connect",{signal:h}):Promise.resolve();return await this.#l({options:t,timeout:i,promises:[u,Tg(r,"error",{signal:h}).then(l=>{throw l[0]})]},c),this.#t.idle&&r.setTimeout(this.#t.idle,()=>{r.destroy(new Ln.IdleTimeoutError(`${t.host}:${t.port}`))}),r}addRequest(e,t){let r=this.#a(t);if(r?.setRequestProps&&r.setRequestProps(e,t),e.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#t.response){let i;e.once("finish",()=>{setTimeout(()=>{e.destroy(new Ln.ResponseTimeoutError(e,this.#s))},this.#t.response)}),e.once("response",()=>{clearTimeout(i)})}if(this.#t.transfer){let i;e.once("response",n=>{setTimeout(()=>{n.destroy(new Ln.TransferTimeoutError(e,this.#s))},this.#t.transfer),n.once("close",()=>{clearTimeout(i)})})}return super.addRequest(e,t)}}});var Pg=m((bP,Ng)=>{"use strict";var{LRUCache:nA}=gs(),{normalizeOptions:oA,cacheOptions:aA}=Ac(),{getProxy:cA,proxyCache:Cg}=rh(),Bg=Tc(),kn=xg(),Mr=new nA({max:20}),hA=o((s,{agent:e,proxy:t,noProxy:r,...i}={})=>{if(e!=null)return e;s=new URL(s);let n=cA(s,{proxy:t,noProxy:r}),a={...oA(i),proxy:n},c=aA({...a,secureEndpoint:s.protocol==="https:"});if(Mr.has(c))return Mr.get(c);let h=new kn(a);return Mr.set(c,h),h},"getAgent");Ng.exports={getAgent:hA,Agent:kn,HttpAgent:kn,HttpsAgent:kn,cache:{proxy:Cg,agent:Mr,dns:Bg.cache,clear:o(()=>{Cg.clear(),Mr.clear(),Bg.cache.clear()},"clear")}}});var Lg=m((OP,uA)=>{uA.exports={name:"make-fetch-happen",version:"15.0.2",description:"Opinionated, caching, retrying fetch client",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",posttest:"npm run lint",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"',lint:"npm run eslint",lintfix:"npm run eslint -- --fix",postlint:"template-oss-check",snap:"tap","template-oss-apply":"template-oss-apply --force"},repository:{type:"git",url:"git+https://github.com/npm/make-fetch-happen.git"},keywords:["http","request","fetch","mean girls","caching","cache","subresource integrity"],author:"GitHub Inc.",license:"ISC",dependencies:{"@npmcli/agent":"^4.0.0",cacache:"^20.0.1","http-cache-semantics":"^4.1.1",minipass:"^7.0.2","minipass-fetch":"^4.0.0","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4",negotiator:"^1.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",ssri:"^12.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",nock:"^13.2.4","safe-buffer":"^5.2.1","standard-version":"^9.3.2",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},tap:{color:1,files:"test/*.js","check-coverage":!0,timeout:60,"nyc-arg":["--exclude","tap-snapshots/**"]},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.25.0",publish:"true"}}});var Mn=m((IP,Dg)=>{var{Minipass:lA}=J(),Dn=Ws(),fA=bm(),dA=St(),{log:kg}=Om(),pA=vc(),{getAgent:mA}=Pg(),nh=Lg(),gA=`${nh.name}/${nh.version} (+https://npm.im/${nh.name})`,yA=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],EA=["request-timeout"],wA=o((s,e)=>{let t=mA(s.url,{...e,signal:void 0});s.headers.has("connection")||s.headers.set("connection",t?"keep-alive":"close"),s.headers.has("user-agent")||s.headers.set("user-agent",gA);let r={...e,agent:t,redirect:"manual"};return fA(async(i,n)=>{let a=new Dn.Request(s,r);try{let c=await Dn(a,r);if(r.integrity&&c.status===200){let l=dA.integrityStream({algorithms:r.algorithms,integrity:r.integrity,size:r.size}),f=new pA({events:["integrity","size"]},c.body,l);l.on("integrity",d=>f.emit("integrity",d)),l.on("size",d=>f.emit("size",d)),c=new Dn.Response(f,c),c.body.hasIntegrityEmitter=!0}c.headers.set("x-fetch-attempts",n);let h=lA.isStream(a.body);return a.method!=="POST"&&!h&&([408,420,429].includes(c.status)||c.status>=500)?(typeof e.onRetry=="function"&&e.onRetry(c),kg.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.status}`),i(c)):c}catch(c){let h=c.code==="EPROMISERETRY"?c.retried.code:c.code,u=c.retried instanceof Dn.Response||yA.includes(h)&&EA.includes(c.type);if(a.method==="POST"||u)throw c;return typeof e.onRetry=="function"&&e.onRetry(c),kg.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.code}`),i(c)}},e.retry).catch(i=>{if(i.status>=400&&i.type!=="system")return i;throw i})},"remoteFetch");Dg.exports=wA});var jg=m((TP,Ug)=>{var{Request:Mg,Response:oh}=Ws(),{Minipass:$g}=J(),SA=hi(),Qt=cm(),_A=require("url"),bA=vc(),RA=Uo(),ah=lm(),OA=Mn(),$r=o((s,e)=>Object.prototype.hasOwnProperty.call(s,e),"hasOwnProperty"),IA=["accept-charset","accept-encoding","accept-language","accept","cache-control"],qg=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],Fg=o((s,e,t)=>{let r={time:Date.now(),url:s.url,reqHeaders:{},resHeaders:{},options:{compress:t.compress!=null?t.compress:s.compress}};e.status!==200&&e.status!==304&&(r.status=e.status);for(let a of IA)s.headers.has(a)&&(r.reqHeaders[a]=s.headers.get(a));let i=s.headers.get("host"),n=new _A.URL(s.url);if(i&&n.host!==i&&(r.reqHeaders.host=i),e.headers.has("vary")){let a=e.headers.get("vary");if(a!=="*"){let c=a.trim().toLowerCase().split(/\s*,\s*/);for(let h of c)s.headers.has(h)&&(r.reqHeaders[h]=s.headers.get(h))}}for(let a of qg)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));for(let a of t.cacheAdditionalHeaders)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));return r},"getMetadata"),$n=Symbol("request"),Fn=Symbol("response"),qn=Symbol("policy"),ch=class s{static{o(this,"CacheEntry")}constructor({entry:e,request:t,response:r,options:i}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=ah(t),this.options=i,this[$n]=t,this[Fn]=r,this[qn]=null}static async find(e,t){try{var r=await Qt.index.compact(t.cachePath,ah(e),(n,a)=>{let c=new s({entry:n,options:t}),h=new s({entry:a,options:t});return c.policy.satisfies(h.request)},{validateEntry:o(n=>n.metadata&&n.metadata.resHeaders&&n.metadata.resHeaders["content-encoding"]===null?!1:n.integrity===null?!!(n.metadata&&n.metadata.status):!0,"validateEntry")})}catch{return}if(t.cache==="reload")return;let i;for(let n of r){let a=new s({entry:n,options:t});if(a.policy.satisfies(e)){i=a;break}}return i}static async invalidate(e,t){let r=ah(e);try{await Qt.rm.entry(t.cachePath,r,{removeFully:!0})}catch{}}get request(){return this[$n]||(this[$n]=new Mg(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[$n]}get response(){return this[Fn]||(this[Fn]=new oh(null,{url:this.entry.metadata.url,counter:this.options.counter,status:this.entry.metadata.status||200,headers:{...this.entry.metadata.resHeaders,"content-length":this.entry.size}})),this[Fn]}get policy(){return this[qn]||(this[qn]=new RA({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[qn]}async store(e){if(this.request.method!=="GET"||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set("x-local-cache-status","skip"),this.response;let t=this.response.headers.get("content-length"),r={algorithms:this.options.algorithms,metadata:Fg(this.request,this.response,this.options),size:t,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body},i=null;if(this.response.status===200){let a,c,h=new Promise((l,f)=>{a=l,c=f}).catch(l=>{i.emit("error",l)});i=new bA({events:["integrity","size"]},new SA({flush(){return h}})),i.hasIntegrityEmitter=!0;let u=o(()=>{let l=new $g,f=Qt.put.stream(this.options.cachePath,this.key,r);f.on("integrity",d=>i.emit("integrity",d)),f.on("size",d=>i.emit("size",d)),l.pipe(f),f.promise().then(a,c),i.unshift(l),i.unshift(this.response.body)},"onResume");i.once("resume",u),i.once("end",()=>i.removeListener("resume",u))}else await Qt.index.insert(this.options.cachePath,this.key,null,r);return this.response.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),this.response.headers.set("x-local-cache-key",encodeURIComponent(this.key)),this.response.headers.set("x-local-cache-mode","stream"),this.response.headers.set("x-local-cache-status",e),this.response.headers.set("x-local-cache-time",new Date().toISOString()),new oh(i,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(e,t,r){let i;if(e==="HEAD"||[301,308].includes(this.response.status))i=this.response;else{let n=new $g,a={...this.policy.responseHeaders()},c=o(()=>{let h=Qt.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});h.on("error",async u=>{h.pause(),u.code==="EINTEGRITY"&&await Qt.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(u.code==="ENOENT"||u.code==="EINTEGRITY")&&await s.invalidate(this.request,this.options),n.emit("error",u),h.resume()}),n.emit("integrity",this.entry.integrity),n.emit("size",Number(a["content-length"])),h.pipe(n)},"onResume");n.once("resume",c),n.once("end",()=>n.removeListener("resume",c)),i=new oh(n,{url:this.entry.metadata.url,counter:t.counter,status:200,headers:a})}return i.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),i.headers.set("x-local-cache-hash",encodeURIComponent(this.entry.integrity)),i.headers.set("x-local-cache-key",encodeURIComponent(this.key)),i.headers.set("x-local-cache-mode","stream"),i.headers.set("x-local-cache-status",r),i.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),i}async revalidate(e,t){let r=new Mg(e,{headers:this.policy.revalidationHeaders(e)});try{var i=await OA(r,{...t,headers:void 0})}catch(a){if(!this.policy.mustRevalidate)return this.respond(e.method,t,"stale");throw a}if(this.policy.revalidated(r,i)){let a=Fg(e,i,t);for(let c of qg)!$r(a.resHeaders,c)&&$r(this.entry.metadata.resHeaders,c)&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]);for(let c of t.cacheAdditionalHeaders){let h=$r(a.resHeaders,c),u=$r(this.entry.metadata.resHeaders,c),l=$r(this.policy.response.headers,c);!h&&u&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]),!l&&h&&(this.policy.response.headers[c]=a.resHeaders[c])}try{await Qt.index.insert(t.cachePath,this.key,this.entry.integrity,{size:this.entry.size,metadata:a})}catch{}return this.respond(e.method,t,"revalidated")}return new s({request:e,response:i,options:t}).store("updated")}};Ug.exports=ch});var Gg=m((xP,zg)=>{var{NotCachedError:vA}=Lu(),hh=jg(),TA=Mn(),Hg=o(async(s,e)=>{let t=await hh.find(s,e);if(!t){if(e.cache==="only-if-cached")throw new vA(s.url);let i=await TA(s,e);return new hh({request:s,response:i,options:e}).store("miss")}if(e.cache==="no-cache")return t.revalidate(s,e);let r=t.policy.needsRevalidation(s);return e.cache==="force-cache"||e.cache==="only-if-cached"||!r?t.respond(s.method,e,r?"stale":"hit"):t.revalidate(s,e)},"cacheFetch");Hg.invalidate=async(s,e)=>{if(e.cachePath)return hh.invalidate(s,e)};zg.exports=Hg});var Kg=m((BP,Zg)=>{"use strict";var{FetchError:uh,Request:AA,isRedirect:xA}=Ws(),lh=require("url"),CA=Uo(),Vg=Gg(),BA=Mn(),NA=o((s,e,t)=>{if(!xA(e.status)||t.redirect==="manual")return!1;if(t.redirect==="error")throw new uh(`redirect mode is set to error: ${s.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new uh(`redirect location header missing for: ${s.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(s.counter>=s.follow)throw new uh(`maximum redirect reached at: ${s.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0},"canFollowRedirect"),PA=o((s,e,t)=>{let r={...t},i=e.headers.get("location"),n=new lh.URL(i,/^https?:/.test(i)?void 0:s.url);return new lh.URL(s.url).hostname!==n.hostname&&(s.headers.delete("authorization"),s.headers.delete("cookie")),(e.status===303||s.method==="POST"&&[301,302].includes(e.status))&&(r.method="GET",r.body=null,s.headers.delete("content-length")),r.headers={},s.headers.forEach((c,h)=>{r.headers[h]=c}),r.counter=++s.counter,{request:new AA(lh.format(n),r),options:r}},"getRedirect"),Wg=o(async(s,e)=>{let t=CA.storable(s,e)?await Vg(s,e):await BA(s,e);if(!["GET","HEAD"].includes(s.method)&&t.status>=200&&t.status<=399&&await Vg.invalidate(s,e),!NA(s,t,e))return t;let r=PA(s,t,e);return Wg(r.request,r.options)},"fetch");Zg.exports=Wg});var{FetchError:LA,Headers:kA,Request:Yg,Response:DA}=Ws(),MA=ru(),$A=Kg(),Un=o((s,e)=>{let t=MA(e),r=new Yg(s,t);return $A(r,t)},"makeFetchHappen");Un.defaults=(s,e={},t=Un)=>{typeof s=="object"&&(e=s,s=null);let r=o((i,n={})=>{let a=i||s,c={...e,...n,headers:{...e.headers,...n.headers}};return t(a,c)},"defaultedFetch");return r.defaults=(i,n={})=>Un.defaults(i,n,r),r};module.exports=Un;module.exports.FetchError=LA;module.exports.Headers=kA;module.exports.Request=Yg;module.exports.Response=DA;
|
|
31
27
|
/*! Bundled license information:
|
|
32
28
|
|
|
33
29
|
negotiator/index.js:
|