@storybook/core-server 7.6.18 → 7.6.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -19,13 +19,13 @@ Content-Type: ${v.type||"application/octet-stream"}\r
19
19
  `,v,`\r
20
20
  `)),c.push(`--${b}--`),new B(c,{type:"multipart/form-data; boundary="+b})}var t,i,h,r,m,f,e,x,FormData,init_esm_min=__esm({"../../node_modules/formdata-polyfill/esm.min.js"(){"use strict";init_fetch_blob();init_file();({toStringTag:t,iterator:i,hasInstance:h}=Symbol),r=Math.random,m="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),f=(a,b,c)=>(a+="",/^(Blob|File)$/.test(b&&b[t])?[(c=c!==void 0?c+"":b[t]=="File"?b.name:"blob",a),b.name!==c||b[t]=="blob"?new file_default([b],c,b):b]:[a,b+""]),e=(c,f3)=>(f3?c:c.replace(/\r?\n|\r/g,`\r
21
21
  `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),x=(n,a,e2)=>{if(a.length<e2)throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e2} arguments required, but only ${a.length} present.`)},FormData=class{#d=[];constructor(...a){if(a.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[t](){return"FormData"}[i](){return this.entries()}static[h](o){return o&&typeof o=="object"&&o[t]==="FormData"&&!m.some(m2=>typeof o[m2]!="function")}append(...a){x("append",arguments,2),this.#d.push(f(...a))}delete(a){x("delete",arguments,1),a+="",this.#d=this.#d.filter(([b])=>b!==a)}get(a){x("get",arguments,1),a+="";for(var b=this.#d,l=b.length,c=0;c<l;c++)if(b[c][0]===a)return b[c][1];return null}getAll(a,b){return x("getAll",arguments,1),b=[],a+="",this.#d.forEach(c=>c[0]===a&&b.push(c[1])),b}has(a){return x("has",arguments,1),a+="",this.#d.some(b=>b[0]===a)}forEach(a,b){x("forEach",arguments,1);for(var[c,d]of this)a.call(b,d,c,this)}set(...a){x("set",arguments,2);var b=[],c=!0;a=f(...a),this.#d.forEach(d=>{d[0]===a[0]?c&&(c=!b.push(a)):b.push(d)}),c&&b.push(a),this.#d=b}*entries(){yield*this.#d}*keys(){for(var[a]of this)yield a}*values(){for(var[,a]of this)yield a}}}});var require_node_domexception=__commonJS({"../../node_modules/node-domexception/index.js"(exports,module2){"use strict";if(!globalThis.DOMException)try{let{MessageChannel}=require("worker_threads"),port=new MessageChannel().port1,ab=new ArrayBuffer;port.postMessage(ab,[ab,ab])}catch(err){err.constructor.name==="DOMException"&&(globalThis.DOMException=err.constructor)}module2.exports=globalThis.DOMException}});var import_node_fs,import_node_path,import_node_domexception,stat,BlobDataItem,init_from=__esm({"../../node_modules/fetch-blob/from.js"(){"use strict";import_node_fs=require("fs"),import_node_path=require("path"),import_node_domexception=__toESM(require_node_domexception(),1);init_file();init_fetch_blob();({stat}=import_node_fs.promises),BlobDataItem=class _BlobDataItem{#path;#start;constructor(options){this.#path=options.path,this.#start=options.start,this.size=options.size,this.lastModified=options.lastModified}slice(start,end){return new _BlobDataItem({path:this.#path,lastModified:this.lastModified,size:end-start,start:this.#start+start})}async*stream(){let{mtimeMs}=await stat(this.#path);if(mtimeMs>this.lastModified)throw new import_node_domexception.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,import_node_fs.createReadStream)(this.#path,{start:this.#start,end:this.#start+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}}});var multipart_parser_exports={};__export(multipart_parser_exports,{toFormData:()=>toFormData});function _fileName(headerValue){let m2=headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!m2)return;let match=m2[2]||m2[3]||"",filename=match.slice(match.lastIndexOf("\\")+1);return filename=filename.replace(/%22/g,'"'),filename=filename.replace(/&#(\d{4});/g,(m3,code)=>String.fromCharCode(code)),filename}async function toFormData(Body2,ct){if(!/multipart/i.test(ct))throw new TypeError("Failed to fetch");let m2=ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!m2)throw new TypeError("no or bad content-type header, no multipart boundary");let parser=new MultipartParser(m2[1]||m2[2]),headerField,headerValue,entryValue,entryName,contentType,filename,entryChunks=[],formData=new FormData,onPartData=ui8a=>{entryValue+=decoder.decode(ui8a,{stream:!0})},appendToFile=ui8a=>{entryChunks.push(ui8a)},appendFileToFormData=()=>{let file=new file_default(entryChunks,filename,{type:contentType});formData.append(entryName,file)},appendEntryToFormData=()=>{formData.append(entryName,entryValue)},decoder=new TextDecoder("utf-8");decoder.decode(),parser.onPartBegin=function(){parser.onPartData=onPartData,parser.onPartEnd=appendEntryToFormData,headerField="",headerValue="",entryValue="",entryName="",contentType="",filename=null,entryChunks.length=0},parser.onHeaderField=function(ui8a){headerField+=decoder.decode(ui8a,{stream:!0})},parser.onHeaderValue=function(ui8a){headerValue+=decoder.decode(ui8a,{stream:!0})},parser.onHeaderEnd=function(){if(headerValue+=decoder.decode(),headerField=headerField.toLowerCase(),headerField==="content-disposition"){let m3=headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);m3&&(entryName=m3[2]||m3[3]||""),filename=_fileName(headerValue),filename&&(parser.onPartData=appendToFile,parser.onPartEnd=appendFileToFormData)}else headerField==="content-type"&&(contentType=headerValue);headerValue="",headerField=""};for await(let chunk of Body2)parser.write(chunk);return parser.end(),formData}var s,S,f2,F,LF,CR,SPACE,HYPHEN,COLON,A,Z,lower,noop,MultipartParser,init_multipart_parser=__esm({"node_modules/node-fetch/src/utils/multipart-parser.js"(){"use strict";init_from();init_esm_min();s=0,S={START_BOUNDARY:s++,HEADER_FIELD_START:s++,HEADER_FIELD:s++,HEADER_VALUE_START:s++,HEADER_VALUE:s++,HEADER_VALUE_ALMOST_DONE:s++,HEADERS_ALMOST_DONE:s++,PART_DATA_START:s++,PART_DATA:s++,END:s++},f2=1,F={PART_BOUNDARY:f2,LAST_BOUNDARY:f2*=2},LF=10,CR=13,SPACE=32,HYPHEN=45,COLON=58,A=97,Z=122,lower=c=>c|32,noop=()=>{},MultipartParser=class{constructor(boundary){this.index=0,this.flags=0,this.onHeaderEnd=noop,this.onHeaderField=noop,this.onHeadersEnd=noop,this.onHeaderValue=noop,this.onPartBegin=noop,this.onPartData=noop,this.onPartEnd=noop,this.boundaryChars={},boundary=`\r
22
- --`+boundary;let ui8a=new Uint8Array(boundary.length);for(let i2=0;i2<boundary.length;i2++)ui8a[i2]=boundary.charCodeAt(i2),this.boundaryChars[ui8a[i2]]=!0;this.boundary=ui8a,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=S.START_BOUNDARY}write(data){let i2=0,length_=data.length,previousIndex=this.index,{lookbehind,boundary,boundaryChars,index,state,flags}=this,boundaryLength=this.boundary.length,boundaryEnd=boundaryLength-1,bufferLength=data.length,c,cl,mark=name=>{this[name+"Mark"]=i2},clear=name=>{delete this[name+"Mark"]},callback=(callbackSymbol,start,end,ui8a)=>{(start===void 0||start!==end)&&this[callbackSymbol](ui8a&&ui8a.subarray(start,end))},dataCallback=(name,clear2)=>{let markSymbol=name+"Mark";markSymbol in this&&(clear2?(callback(name,this[markSymbol],i2,data),delete this[markSymbol]):(callback(name,this[markSymbol],data.length,data),this[markSymbol]=0))};for(i2=0;i2<length_;i2++)switch(c=data[i2],state){case S.START_BOUNDARY:if(index===boundary.length-2){if(c===HYPHEN)flags|=F.LAST_BOUNDARY;else if(c!==CR)return;index++;break}else if(index-1===boundary.length-2){if(flags&F.LAST_BOUNDARY&&c===HYPHEN)state=S.END,flags=0;else if(!(flags&F.LAST_BOUNDARY)&&c===LF)index=0,callback("onPartBegin"),state=S.HEADER_FIELD_START;else return;break}c!==boundary[index+2]&&(index=-2),c===boundary[index+2]&&index++;break;case S.HEADER_FIELD_START:state=S.HEADER_FIELD,mark("onHeaderField"),index=0;case S.HEADER_FIELD:if(c===CR){clear("onHeaderField"),state=S.HEADERS_ALMOST_DONE;break}if(index++,c===HYPHEN)break;if(c===COLON){if(index===1)return;dataCallback("onHeaderField",!0),state=S.HEADER_VALUE_START;break}if(cl=lower(c),cl<A||cl>Z)return;break;case S.HEADER_VALUE_START:if(c===SPACE)break;mark("onHeaderValue"),state=S.HEADER_VALUE;case S.HEADER_VALUE:c===CR&&(dataCallback("onHeaderValue",!0),callback("onHeaderEnd"),state=S.HEADER_VALUE_ALMOST_DONE);break;case S.HEADER_VALUE_ALMOST_DONE:if(c!==LF)return;state=S.HEADER_FIELD_START;break;case S.HEADERS_ALMOST_DONE:if(c!==LF)return;callback("onHeadersEnd"),state=S.PART_DATA_START;break;case S.PART_DATA_START:state=S.PART_DATA,mark("onPartData");case S.PART_DATA:if(previousIndex=index,index===0){for(i2+=boundaryEnd;i2<bufferLength&&!(data[i2]in boundaryChars);)i2+=boundaryLength;i2-=boundaryEnd,c=data[i2]}if(index<boundary.length)boundary[index]===c?(index===0&&dataCallback("onPartData",!0),index++):index=0;else if(index===boundary.length)index++,c===CR?flags|=F.PART_BOUNDARY:c===HYPHEN?flags|=F.LAST_BOUNDARY:index=0;else if(index-1===boundary.length)if(flags&F.PART_BOUNDARY){if(index=0,c===LF){flags&=~F.PART_BOUNDARY,callback("onPartEnd"),callback("onPartBegin"),state=S.HEADER_FIELD_START;break}}else flags&F.LAST_BOUNDARY&&c===HYPHEN?(callback("onPartEnd"),state=S.END,flags=0):index=0;if(index>0)lookbehind[index-1]=c;else if(previousIndex>0){let _lookbehind=new Uint8Array(lookbehind.buffer,lookbehind.byteOffset,lookbehind.byteLength);callback("onPartData",0,previousIndex,_lookbehind),previousIndex=0,mark("onPartData"),i2--}break;case S.END:break;default:throw new Error(`Unexpected state entered: ${state}`)}dataCallback("onHeaderField"),dataCallback("onHeaderValue"),dataCallback("onPartData"),this.index=index,this.state=state,this.flags=flags}end(){if(this.state===S.HEADER_FIELD_START&&this.index===0||this.state===S.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==S.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}}});var require_crypto_random_string=__commonJS({"../../node_modules/crypto-random-string/index.js"(exports,module2){"use strict";var crypto3=require("crypto");module2.exports=length=>{if(!Number.isFinite(length))throw new TypeError("Expected a finite number");return crypto3.randomBytes(Math.ceil(length/2)).toString("hex").slice(0,length)}}});var require_unique_string=__commonJS({"../../node_modules/unique-string/index.js"(exports,module2){"use strict";var cryptoRandomString=require_crypto_random_string();module2.exports=()=>cryptoRandomString(32)}});var require_temp_dir=__commonJS({"../../node_modules/temp-dir/index.js"(exports,module2){"use strict";var fs9=require("fs"),os2=require("os"),tempDirectorySymbol=Symbol.for("__RESOLVED_TEMP_DIRECTORY__");global[tempDirectorySymbol]||Object.defineProperty(global,tempDirectorySymbol,{value:fs9.realpathSync(os2.tmpdir())});module2.exports=global[tempDirectorySymbol]}});var require_is_stream=__commonJS({"../../node_modules/is-stream/index.js"(exports,module2){"use strict";var isStream=stream2=>stream2!==null&&typeof stream2=="object"&&typeof stream2.pipe=="function";isStream.writable=stream2=>isStream(stream2)&&stream2.writable!==!1&&typeof stream2._write=="function"&&typeof stream2._writableState=="object";isStream.readable=stream2=>isStream(stream2)&&stream2.readable!==!1&&typeof stream2._read=="function"&&typeof stream2._readableState=="object";isStream.duplex=stream2=>isStream.writable(stream2)&&isStream.readable(stream2);isStream.transform=stream2=>isStream.duplex(stream2)&&typeof stream2._transform=="function";module2.exports=isStream}});var require_is_extglob=__commonJS({"../../node_modules/is-extglob/index.js"(exports,module2){"use strict";module2.exports=function(str){if(typeof str!="string"||str==="")return!1;for(var match;match=/(\\).|([@?!+*]\(.*\))/g.exec(str);){if(match[2])return!0;str=str.slice(match.index+match[0].length)}return!1}}});var require_is_glob=__commonJS({"../../node_modules/is-glob/index.js"(exports,module2){"use strict";var isExtglob=require_is_extglob(),chars={"{":"}","(":")","[":"]"},strictCheck=function(str){if(str[0]==="!")return!0;for(var index=0,pipeIndex=-2,closeSquareIndex=-2,closeCurlyIndex=-2,closeParenIndex=-2,backSlashIndex=-2;index<str.length;){if(str[index]==="*"||str[index+1]==="?"&&/[\].+)]/.test(str[index])||closeSquareIndex!==-1&&str[index]==="["&&str[index+1]!=="]"&&(closeSquareIndex<index&&(closeSquareIndex=str.indexOf("]",index)),closeSquareIndex>index&&(backSlashIndex===-1||backSlashIndex>closeSquareIndex||(backSlashIndex=str.indexOf("\\",index),backSlashIndex===-1||backSlashIndex>closeSquareIndex)))||closeCurlyIndex!==-1&&str[index]==="{"&&str[index+1]!=="}"&&(closeCurlyIndex=str.indexOf("}",index),closeCurlyIndex>index&&(backSlashIndex=str.indexOf("\\",index),backSlashIndex===-1||backSlashIndex>closeCurlyIndex))||closeParenIndex!==-1&&str[index]==="("&&str[index+1]==="?"&&/[:!=]/.test(str[index+2])&&str[index+3]!==")"&&(closeParenIndex=str.indexOf(")",index),closeParenIndex>index&&(backSlashIndex=str.indexOf("\\",index),backSlashIndex===-1||backSlashIndex>closeParenIndex))||pipeIndex!==-1&&str[index]==="("&&str[index+1]!=="|"&&(pipeIndex<index&&(pipeIndex=str.indexOf("|",index)),pipeIndex!==-1&&str[pipeIndex+1]!==")"&&(closeParenIndex=str.indexOf(")",pipeIndex),closeParenIndex>pipeIndex&&(backSlashIndex=str.indexOf("\\",pipeIndex),backSlashIndex===-1||backSlashIndex>closeParenIndex))))return!0;if(str[index]==="\\"){var open2=str[index+1];index+=2;var close=chars[open2];if(close){var n=str.indexOf(close,index);n!==-1&&(index=n+1)}if(str[index]==="!")return!0}else index++}return!1},relaxedCheck=function(str){if(str[0]==="!")return!0;for(var index=0;index<str.length;){if(/[*?{}()[\]]/.test(str[index]))return!0;if(str[index]==="\\"){var open2=str[index+1];index+=2;var close=chars[open2];if(close){var n=str.indexOf(close,index);n!==-1&&(index=n+1)}if(str[index]==="!")return!0}else index++}return!1};module2.exports=function(str,options){if(typeof str!="string"||str==="")return!1;if(isExtglob(str))return!0;var check=strictCheck;return options&&options.strict===!1&&(check=relaxedCheck),check(str)}}});var require_slash=__commonJS({"../../node_modules/del/node_modules/slash/index.js"(exports,module2){"use strict";module2.exports=path13=>{let isExtendedLengthPath=/^\\\\\?\\/.test(path13),hasNonAscii=/[^\u0000-\u0080]+/.test(path13);return isExtendedLengthPath||hasNonAscii?path13:path13.replace(/\\/g,"/")}}});var require_polyfills=__commonJS({"../../node_modules/graceful-fs/polyfills.js"(exports,module2){"use strict";var constants=require("constants"),origCwd=process.cwd,cwd=null,platform2=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cwd||(cwd=origCwd.call(process)),cwd};try{process.cwd()}catch{}typeof process.chdir=="function"&&(chdir=process.chdir,process.chdir=function(d){cwd=null,chdir.call(process,d)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,chdir));var chdir;module2.exports=patch;function patch(fs9){constants.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&patchLchmod(fs9),fs9.lutimes||patchLutimes(fs9),fs9.chown=chownFix(fs9.chown),fs9.fchown=chownFix(fs9.fchown),fs9.lchown=chownFix(fs9.lchown),fs9.chmod=chmodFix(fs9.chmod),fs9.fchmod=chmodFix(fs9.fchmod),fs9.lchmod=chmodFix(fs9.lchmod),fs9.chownSync=chownFixSync(fs9.chownSync),fs9.fchownSync=chownFixSync(fs9.fchownSync),fs9.lchownSync=chownFixSync(fs9.lchownSync),fs9.chmodSync=chmodFixSync(fs9.chmodSync),fs9.fchmodSync=chmodFixSync(fs9.fchmodSync),fs9.lchmodSync=chmodFixSync(fs9.lchmodSync),fs9.stat=statFix(fs9.stat),fs9.fstat=statFix(fs9.fstat),fs9.lstat=statFix(fs9.lstat),fs9.statSync=statFixSync(fs9.statSync),fs9.fstatSync=statFixSync(fs9.fstatSync),fs9.lstatSync=statFixSync(fs9.lstatSync),fs9.chmod&&!fs9.lchmod&&(fs9.lchmod=function(path13,mode,cb){cb&&process.nextTick(cb)},fs9.lchmodSync=function(){}),fs9.chown&&!fs9.lchown&&(fs9.lchown=function(path13,uid,gid,cb){cb&&process.nextTick(cb)},fs9.lchownSync=function(){}),platform2==="win32"&&(fs9.rename=typeof fs9.rename!="function"?fs9.rename:function(fs$rename){function rename(from,to,cb){var start=Date.now(),backoff=0;fs$rename(from,to,function CB(er){if(er&&(er.code==="EACCES"||er.code==="EPERM"||er.code==="EBUSY")&&Date.now()-start<6e4){setTimeout(function(){fs9.stat(to,function(stater,st){stater&&stater.code==="ENOENT"?fs$rename(from,to,CB):cb(er)})},backoff),backoff<100&&(backoff+=10);return}cb&&cb(er)})}return Object.setPrototypeOf&&Object.setPrototypeOf(rename,fs$rename),rename}(fs9.rename)),fs9.read=typeof fs9.read!="function"?fs9.read:function(fs$read){function read(fd,buffer,offset,length,position,callback_){var callback;if(callback_&&typeof callback_=="function"){var eagCounter=0;callback=function(er,_,__){if(er&&er.code==="EAGAIN"&&eagCounter<10)return eagCounter++,fs$read.call(fs9,fd,buffer,offset,length,position,callback);callback_.apply(this,arguments)}}return fs$read.call(fs9,fd,buffer,offset,length,position,callback)}return Object.setPrototypeOf&&Object.setPrototypeOf(read,fs$read),read}(fs9.read),fs9.readSync=typeof fs9.readSync!="function"?fs9.readSync:function(fs$readSync){return function(fd,buffer,offset,length,position){for(var eagCounter=0;;)try{return fs$readSync.call(fs9,fd,buffer,offset,length,position)}catch(er){if(er.code==="EAGAIN"&&eagCounter<10){eagCounter++;continue}throw er}}}(fs9.readSync);function patchLchmod(fs10){fs10.lchmod=function(path13,mode,callback){fs10.open(path13,constants.O_WRONLY|constants.O_SYMLINK,mode,function(err,fd){if(err){callback&&callback(err);return}fs10.fchmod(fd,mode,function(err2){fs10.close(fd,function(err22){callback&&callback(err2||err22)})})})},fs10.lchmodSync=function(path13,mode){var fd=fs10.openSync(path13,constants.O_WRONLY|constants.O_SYMLINK,mode),threw=!0,ret;try{ret=fs10.fchmodSync(fd,mode),threw=!1}finally{if(threw)try{fs10.closeSync(fd)}catch{}else fs10.closeSync(fd)}return ret}}function patchLutimes(fs10){constants.hasOwnProperty("O_SYMLINK")&&fs10.futimes?(fs10.lutimes=function(path13,at,mt,cb){fs10.open(path13,constants.O_SYMLINK,function(er,fd){if(er){cb&&cb(er);return}fs10.futimes(fd,at,mt,function(er2){fs10.close(fd,function(er22){cb&&cb(er2||er22)})})})},fs10.lutimesSync=function(path13,at,mt){var fd=fs10.openSync(path13,constants.O_SYMLINK),ret,threw=!0;try{ret=fs10.futimesSync(fd,at,mt),threw=!1}finally{if(threw)try{fs10.closeSync(fd)}catch{}else fs10.closeSync(fd)}return ret}):fs10.futimes&&(fs10.lutimes=function(_a,_b,_c,cb){cb&&process.nextTick(cb)},fs10.lutimesSync=function(){})}function chmodFix(orig){return orig&&function(target,mode,cb){return orig.call(fs9,target,mode,function(er){chownErOk(er)&&(er=null),cb&&cb.apply(this,arguments)})}}function chmodFixSync(orig){return orig&&function(target,mode){try{return orig.call(fs9,target,mode)}catch(er){if(!chownErOk(er))throw er}}}function chownFix(orig){return orig&&function(target,uid,gid,cb){return orig.call(fs9,target,uid,gid,function(er){chownErOk(er)&&(er=null),cb&&cb.apply(this,arguments)})}}function chownFixSync(orig){return orig&&function(target,uid,gid){try{return orig.call(fs9,target,uid,gid)}catch(er){if(!chownErOk(er))throw er}}}function statFix(orig){return orig&&function(target,options,cb){typeof options=="function"&&(cb=options,options=null);function callback(er,stats){stats&&(stats.uid<0&&(stats.uid+=4294967296),stats.gid<0&&(stats.gid+=4294967296)),cb&&cb.apply(this,arguments)}return options?orig.call(fs9,target,options,callback):orig.call(fs9,target,callback)}}function statFixSync(orig){return orig&&function(target,options){var stats=options?orig.call(fs9,target,options):orig.call(fs9,target);return stats&&(stats.uid<0&&(stats.uid+=4294967296),stats.gid<0&&(stats.gid+=4294967296)),stats}}function chownErOk(er){if(!er||er.code==="ENOSYS")return!0;var nonroot=!process.getuid||process.getuid()!==0;return!!(nonroot&&(er.code==="EINVAL"||er.code==="EPERM"))}}}});var require_legacy_streams=__commonJS({"../../node_modules/graceful-fs/legacy-streams.js"(exports,module2){"use strict";var Stream3=require("stream").Stream;module2.exports=legacy;function legacy(fs9){return{ReadStream,WriteStream};function ReadStream(path13,options){if(!(this instanceof ReadStream))return new ReadStream(path13,options);Stream3.call(this);var self2=this;this.path=path13,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,options=options||{};for(var keys=Object.keys(options),index=0,length=keys.length;index<length;index++){var key=keys[index];this[key]=options[key]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){self2._read()});return}fs9.open(this.path,this.flags,this.mode,function(err,fd){if(err){self2.emit("error",err),self2.readable=!1;return}self2.fd=fd,self2.emit("open",fd),self2._read()})}function WriteStream(path13,options){if(!(this instanceof WriteStream))return new WriteStream(path13,options);Stream3.call(this),this.path=path13,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,options=options||{};for(var keys=Object.keys(options),index=0,length=keys.length;index<length;index++){var key=keys[index];this[key]=options[key]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=fs9.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}});var require_clone=__commonJS({"../../node_modules/graceful-fs/clone.js"(exports,module2){"use strict";module2.exports=clone2;var getPrototypeOf=Object.getPrototypeOf||function(obj){return obj.__proto__};function clone2(obj){if(obj===null||typeof obj!="object")return obj;if(obj instanceof Object)var copy2={__proto__:getPrototypeOf(obj)};else var copy2=Object.create(null);return Object.getOwnPropertyNames(obj).forEach(function(key){Object.defineProperty(copy2,key,Object.getOwnPropertyDescriptor(obj,key))}),copy2}}});var require_graceful_fs=__commonJS({"../../node_modules/graceful-fs/graceful-fs.js"(exports,module2){"use strict";var fs9=require("fs"),polyfills=require_polyfills(),legacy=require_legacy_streams(),clone2=require_clone(),util=require("util"),gracefulQueue,previousSymbol;typeof Symbol=="function"&&typeof Symbol.for=="function"?(gracefulQueue=Symbol.for("graceful-fs.queue"),previousSymbol=Symbol.for("graceful-fs.previous")):(gracefulQueue="___graceful-fs.queue",previousSymbol="___graceful-fs.previous");function noop3(){}function publishQueue(context,queue2){Object.defineProperty(context,gracefulQueue,{get:function(){return queue2}})}var debug=noop3;util.debuglog?debug=util.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(debug=function(){var m2=util.format.apply(util,arguments);m2="GFS4: "+m2.split(/\n/).join(`
22
+ --`+boundary;let ui8a=new Uint8Array(boundary.length);for(let i2=0;i2<boundary.length;i2++)ui8a[i2]=boundary.charCodeAt(i2),this.boundaryChars[ui8a[i2]]=!0;this.boundary=ui8a,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=S.START_BOUNDARY}write(data){let i2=0,length_=data.length,previousIndex=this.index,{lookbehind,boundary,boundaryChars,index,state,flags}=this,boundaryLength=this.boundary.length,boundaryEnd=boundaryLength-1,bufferLength=data.length,c,cl,mark=name=>{this[name+"Mark"]=i2},clear=name=>{delete this[name+"Mark"]},callback=(callbackSymbol,start,end,ui8a)=>{(start===void 0||start!==end)&&this[callbackSymbol](ui8a&&ui8a.subarray(start,end))},dataCallback=(name,clear2)=>{let markSymbol=name+"Mark";markSymbol in this&&(clear2?(callback(name,this[markSymbol],i2,data),delete this[markSymbol]):(callback(name,this[markSymbol],data.length,data),this[markSymbol]=0))};for(i2=0;i2<length_;i2++)switch(c=data[i2],state){case S.START_BOUNDARY:if(index===boundary.length-2){if(c===HYPHEN)flags|=F.LAST_BOUNDARY;else if(c!==CR)return;index++;break}else if(index-1===boundary.length-2){if(flags&F.LAST_BOUNDARY&&c===HYPHEN)state=S.END,flags=0;else if(!(flags&F.LAST_BOUNDARY)&&c===LF)index=0,callback("onPartBegin"),state=S.HEADER_FIELD_START;else return;break}c!==boundary[index+2]&&(index=-2),c===boundary[index+2]&&index++;break;case S.HEADER_FIELD_START:state=S.HEADER_FIELD,mark("onHeaderField"),index=0;case S.HEADER_FIELD:if(c===CR){clear("onHeaderField"),state=S.HEADERS_ALMOST_DONE;break}if(index++,c===HYPHEN)break;if(c===COLON){if(index===1)return;dataCallback("onHeaderField",!0),state=S.HEADER_VALUE_START;break}if(cl=lower(c),cl<A||cl>Z)return;break;case S.HEADER_VALUE_START:if(c===SPACE)break;mark("onHeaderValue"),state=S.HEADER_VALUE;case S.HEADER_VALUE:c===CR&&(dataCallback("onHeaderValue",!0),callback("onHeaderEnd"),state=S.HEADER_VALUE_ALMOST_DONE);break;case S.HEADER_VALUE_ALMOST_DONE:if(c!==LF)return;state=S.HEADER_FIELD_START;break;case S.HEADERS_ALMOST_DONE:if(c!==LF)return;callback("onHeadersEnd"),state=S.PART_DATA_START;break;case S.PART_DATA_START:state=S.PART_DATA,mark("onPartData");case S.PART_DATA:if(previousIndex=index,index===0){for(i2+=boundaryEnd;i2<bufferLength&&!(data[i2]in boundaryChars);)i2+=boundaryLength;i2-=boundaryEnd,c=data[i2]}if(index<boundary.length)boundary[index]===c?(index===0&&dataCallback("onPartData",!0),index++):index=0;else if(index===boundary.length)index++,c===CR?flags|=F.PART_BOUNDARY:c===HYPHEN?flags|=F.LAST_BOUNDARY:index=0;else if(index-1===boundary.length)if(flags&F.PART_BOUNDARY){if(index=0,c===LF){flags&=~F.PART_BOUNDARY,callback("onPartEnd"),callback("onPartBegin"),state=S.HEADER_FIELD_START;break}}else flags&F.LAST_BOUNDARY&&c===HYPHEN?(callback("onPartEnd"),state=S.END,flags=0):index=0;if(index>0)lookbehind[index-1]=c;else if(previousIndex>0){let _lookbehind=new Uint8Array(lookbehind.buffer,lookbehind.byteOffset,lookbehind.byteLength);callback("onPartData",0,previousIndex,_lookbehind),previousIndex=0,mark("onPartData"),i2--}break;case S.END:break;default:throw new Error(`Unexpected state entered: ${state}`)}dataCallback("onHeaderField"),dataCallback("onHeaderValue"),dataCallback("onPartData"),this.index=index,this.state=state,this.flags=flags}end(){if(this.state===S.HEADER_FIELD_START&&this.index===0||this.state===S.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==S.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}}});var require_crypto_random_string=__commonJS({"../../node_modules/crypto-random-string/index.js"(exports,module2){"use strict";var crypto3=require("crypto");module2.exports=length=>{if(!Number.isFinite(length))throw new TypeError("Expected a finite number");return crypto3.randomBytes(Math.ceil(length/2)).toString("hex").slice(0,length)}}});var require_unique_string=__commonJS({"../../node_modules/unique-string/index.js"(exports,module2){"use strict";var cryptoRandomString=require_crypto_random_string();module2.exports=()=>cryptoRandomString(32)}});var require_temp_dir=__commonJS({"../../node_modules/temp-dir/index.js"(exports,module2){"use strict";var fs9=require("fs"),os3=require("os"),tempDirectorySymbol=Symbol.for("__RESOLVED_TEMP_DIRECTORY__");global[tempDirectorySymbol]||Object.defineProperty(global,tempDirectorySymbol,{value:fs9.realpathSync(os3.tmpdir())});module2.exports=global[tempDirectorySymbol]}});var require_is_stream=__commonJS({"../../node_modules/is-stream/index.js"(exports,module2){"use strict";var isStream=stream2=>stream2!==null&&typeof stream2=="object"&&typeof stream2.pipe=="function";isStream.writable=stream2=>isStream(stream2)&&stream2.writable!==!1&&typeof stream2._write=="function"&&typeof stream2._writableState=="object";isStream.readable=stream2=>isStream(stream2)&&stream2.readable!==!1&&typeof stream2._read=="function"&&typeof stream2._readableState=="object";isStream.duplex=stream2=>isStream.writable(stream2)&&isStream.readable(stream2);isStream.transform=stream2=>isStream.duplex(stream2)&&typeof stream2._transform=="function";module2.exports=isStream}});var require_is_extglob=__commonJS({"../../node_modules/is-extglob/index.js"(exports,module2){"use strict";module2.exports=function(str){if(typeof str!="string"||str==="")return!1;for(var match;match=/(\\).|([@?!+*]\(.*\))/g.exec(str);){if(match[2])return!0;str=str.slice(match.index+match[0].length)}return!1}}});var require_is_glob=__commonJS({"../../node_modules/is-glob/index.js"(exports,module2){"use strict";var isExtglob=require_is_extglob(),chars={"{":"}","(":")","[":"]"},strictCheck=function(str){if(str[0]==="!")return!0;for(var index=0,pipeIndex=-2,closeSquareIndex=-2,closeCurlyIndex=-2,closeParenIndex=-2,backSlashIndex=-2;index<str.length;){if(str[index]==="*"||str[index+1]==="?"&&/[\].+)]/.test(str[index])||closeSquareIndex!==-1&&str[index]==="["&&str[index+1]!=="]"&&(closeSquareIndex<index&&(closeSquareIndex=str.indexOf("]",index)),closeSquareIndex>index&&(backSlashIndex===-1||backSlashIndex>closeSquareIndex||(backSlashIndex=str.indexOf("\\",index),backSlashIndex===-1||backSlashIndex>closeSquareIndex)))||closeCurlyIndex!==-1&&str[index]==="{"&&str[index+1]!=="}"&&(closeCurlyIndex=str.indexOf("}",index),closeCurlyIndex>index&&(backSlashIndex=str.indexOf("\\",index),backSlashIndex===-1||backSlashIndex>closeCurlyIndex))||closeParenIndex!==-1&&str[index]==="("&&str[index+1]==="?"&&/[:!=]/.test(str[index+2])&&str[index+3]!==")"&&(closeParenIndex=str.indexOf(")",index),closeParenIndex>index&&(backSlashIndex=str.indexOf("\\",index),backSlashIndex===-1||backSlashIndex>closeParenIndex))||pipeIndex!==-1&&str[index]==="("&&str[index+1]!=="|"&&(pipeIndex<index&&(pipeIndex=str.indexOf("|",index)),pipeIndex!==-1&&str[pipeIndex+1]!==")"&&(closeParenIndex=str.indexOf(")",pipeIndex),closeParenIndex>pipeIndex&&(backSlashIndex=str.indexOf("\\",pipeIndex),backSlashIndex===-1||backSlashIndex>closeParenIndex))))return!0;if(str[index]==="\\"){var open2=str[index+1];index+=2;var close=chars[open2];if(close){var n=str.indexOf(close,index);n!==-1&&(index=n+1)}if(str[index]==="!")return!0}else index++}return!1},relaxedCheck=function(str){if(str[0]==="!")return!0;for(var index=0;index<str.length;){if(/[*?{}()[\]]/.test(str[index]))return!0;if(str[index]==="\\"){var open2=str[index+1];index+=2;var close=chars[open2];if(close){var n=str.indexOf(close,index);n!==-1&&(index=n+1)}if(str[index]==="!")return!0}else index++}return!1};module2.exports=function(str,options){if(typeof str!="string"||str==="")return!1;if(isExtglob(str))return!0;var check=strictCheck;return options&&options.strict===!1&&(check=relaxedCheck),check(str)}}});var require_slash=__commonJS({"../../node_modules/del/node_modules/slash/index.js"(exports,module2){"use strict";module2.exports=path13=>{let isExtendedLengthPath=/^\\\\\?\\/.test(path13),hasNonAscii=/[^\u0000-\u0080]+/.test(path13);return isExtendedLengthPath||hasNonAscii?path13:path13.replace(/\\/g,"/")}}});var require_polyfills=__commonJS({"../../node_modules/graceful-fs/polyfills.js"(exports,module2){"use strict";var constants=require("constants"),origCwd=process.cwd,cwd=null,platform2=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cwd||(cwd=origCwd.call(process)),cwd};try{process.cwd()}catch{}typeof process.chdir=="function"&&(chdir=process.chdir,process.chdir=function(d){cwd=null,chdir.call(process,d)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,chdir));var chdir;module2.exports=patch;function patch(fs9){constants.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&patchLchmod(fs9),fs9.lutimes||patchLutimes(fs9),fs9.chown=chownFix(fs9.chown),fs9.fchown=chownFix(fs9.fchown),fs9.lchown=chownFix(fs9.lchown),fs9.chmod=chmodFix(fs9.chmod),fs9.fchmod=chmodFix(fs9.fchmod),fs9.lchmod=chmodFix(fs9.lchmod),fs9.chownSync=chownFixSync(fs9.chownSync),fs9.fchownSync=chownFixSync(fs9.fchownSync),fs9.lchownSync=chownFixSync(fs9.lchownSync),fs9.chmodSync=chmodFixSync(fs9.chmodSync),fs9.fchmodSync=chmodFixSync(fs9.fchmodSync),fs9.lchmodSync=chmodFixSync(fs9.lchmodSync),fs9.stat=statFix(fs9.stat),fs9.fstat=statFix(fs9.fstat),fs9.lstat=statFix(fs9.lstat),fs9.statSync=statFixSync(fs9.statSync),fs9.fstatSync=statFixSync(fs9.fstatSync),fs9.lstatSync=statFixSync(fs9.lstatSync),fs9.chmod&&!fs9.lchmod&&(fs9.lchmod=function(path13,mode,cb){cb&&process.nextTick(cb)},fs9.lchmodSync=function(){}),fs9.chown&&!fs9.lchown&&(fs9.lchown=function(path13,uid,gid,cb){cb&&process.nextTick(cb)},fs9.lchownSync=function(){}),platform2==="win32"&&(fs9.rename=typeof fs9.rename!="function"?fs9.rename:function(fs$rename){function rename(from,to,cb){var start=Date.now(),backoff=0;fs$rename(from,to,function CB(er){if(er&&(er.code==="EACCES"||er.code==="EPERM"||er.code==="EBUSY")&&Date.now()-start<6e4){setTimeout(function(){fs9.stat(to,function(stater,st){stater&&stater.code==="ENOENT"?fs$rename(from,to,CB):cb(er)})},backoff),backoff<100&&(backoff+=10);return}cb&&cb(er)})}return Object.setPrototypeOf&&Object.setPrototypeOf(rename,fs$rename),rename}(fs9.rename)),fs9.read=typeof fs9.read!="function"?fs9.read:function(fs$read){function read(fd,buffer,offset,length,position,callback_){var callback;if(callback_&&typeof callback_=="function"){var eagCounter=0;callback=function(er,_,__){if(er&&er.code==="EAGAIN"&&eagCounter<10)return eagCounter++,fs$read.call(fs9,fd,buffer,offset,length,position,callback);callback_.apply(this,arguments)}}return fs$read.call(fs9,fd,buffer,offset,length,position,callback)}return Object.setPrototypeOf&&Object.setPrototypeOf(read,fs$read),read}(fs9.read),fs9.readSync=typeof fs9.readSync!="function"?fs9.readSync:function(fs$readSync){return function(fd,buffer,offset,length,position){for(var eagCounter=0;;)try{return fs$readSync.call(fs9,fd,buffer,offset,length,position)}catch(er){if(er.code==="EAGAIN"&&eagCounter<10){eagCounter++;continue}throw er}}}(fs9.readSync);function patchLchmod(fs10){fs10.lchmod=function(path13,mode,callback){fs10.open(path13,constants.O_WRONLY|constants.O_SYMLINK,mode,function(err,fd){if(err){callback&&callback(err);return}fs10.fchmod(fd,mode,function(err2){fs10.close(fd,function(err22){callback&&callback(err2||err22)})})})},fs10.lchmodSync=function(path13,mode){var fd=fs10.openSync(path13,constants.O_WRONLY|constants.O_SYMLINK,mode),threw=!0,ret;try{ret=fs10.fchmodSync(fd,mode),threw=!1}finally{if(threw)try{fs10.closeSync(fd)}catch{}else fs10.closeSync(fd)}return ret}}function patchLutimes(fs10){constants.hasOwnProperty("O_SYMLINK")&&fs10.futimes?(fs10.lutimes=function(path13,at,mt,cb){fs10.open(path13,constants.O_SYMLINK,function(er,fd){if(er){cb&&cb(er);return}fs10.futimes(fd,at,mt,function(er2){fs10.close(fd,function(er22){cb&&cb(er2||er22)})})})},fs10.lutimesSync=function(path13,at,mt){var fd=fs10.openSync(path13,constants.O_SYMLINK),ret,threw=!0;try{ret=fs10.futimesSync(fd,at,mt),threw=!1}finally{if(threw)try{fs10.closeSync(fd)}catch{}else fs10.closeSync(fd)}return ret}):fs10.futimes&&(fs10.lutimes=function(_a,_b,_c,cb){cb&&process.nextTick(cb)},fs10.lutimesSync=function(){})}function chmodFix(orig){return orig&&function(target,mode,cb){return orig.call(fs9,target,mode,function(er){chownErOk(er)&&(er=null),cb&&cb.apply(this,arguments)})}}function chmodFixSync(orig){return orig&&function(target,mode){try{return orig.call(fs9,target,mode)}catch(er){if(!chownErOk(er))throw er}}}function chownFix(orig){return orig&&function(target,uid,gid,cb){return orig.call(fs9,target,uid,gid,function(er){chownErOk(er)&&(er=null),cb&&cb.apply(this,arguments)})}}function chownFixSync(orig){return orig&&function(target,uid,gid){try{return orig.call(fs9,target,uid,gid)}catch(er){if(!chownErOk(er))throw er}}}function statFix(orig){return orig&&function(target,options,cb){typeof options=="function"&&(cb=options,options=null);function callback(er,stats){stats&&(stats.uid<0&&(stats.uid+=4294967296),stats.gid<0&&(stats.gid+=4294967296)),cb&&cb.apply(this,arguments)}return options?orig.call(fs9,target,options,callback):orig.call(fs9,target,callback)}}function statFixSync(orig){return orig&&function(target,options){var stats=options?orig.call(fs9,target,options):orig.call(fs9,target);return stats&&(stats.uid<0&&(stats.uid+=4294967296),stats.gid<0&&(stats.gid+=4294967296)),stats}}function chownErOk(er){if(!er||er.code==="ENOSYS")return!0;var nonroot=!process.getuid||process.getuid()!==0;return!!(nonroot&&(er.code==="EINVAL"||er.code==="EPERM"))}}}});var require_legacy_streams=__commonJS({"../../node_modules/graceful-fs/legacy-streams.js"(exports,module2){"use strict";var Stream3=require("stream").Stream;module2.exports=legacy;function legacy(fs9){return{ReadStream,WriteStream};function ReadStream(path13,options){if(!(this instanceof ReadStream))return new ReadStream(path13,options);Stream3.call(this);var self2=this;this.path=path13,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,options=options||{};for(var keys=Object.keys(options),index=0,length=keys.length;index<length;index++){var key=keys[index];this[key]=options[key]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){self2._read()});return}fs9.open(this.path,this.flags,this.mode,function(err,fd){if(err){self2.emit("error",err),self2.readable=!1;return}self2.fd=fd,self2.emit("open",fd),self2._read()})}function WriteStream(path13,options){if(!(this instanceof WriteStream))return new WriteStream(path13,options);Stream3.call(this),this.path=path13,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,options=options||{};for(var keys=Object.keys(options),index=0,length=keys.length;index<length;index++){var key=keys[index];this[key]=options[key]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=fs9.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}});var require_clone=__commonJS({"../../node_modules/graceful-fs/clone.js"(exports,module2){"use strict";module2.exports=clone2;var getPrototypeOf=Object.getPrototypeOf||function(obj){return obj.__proto__};function clone2(obj){if(obj===null||typeof obj!="object")return obj;if(obj instanceof Object)var copy2={__proto__:getPrototypeOf(obj)};else var copy2=Object.create(null);return Object.getOwnPropertyNames(obj).forEach(function(key){Object.defineProperty(copy2,key,Object.getOwnPropertyDescriptor(obj,key))}),copy2}}});var require_graceful_fs=__commonJS({"../../node_modules/graceful-fs/graceful-fs.js"(exports,module2){"use strict";var fs9=require("fs"),polyfills=require_polyfills(),legacy=require_legacy_streams(),clone2=require_clone(),util=require("util"),gracefulQueue,previousSymbol;typeof Symbol=="function"&&typeof Symbol.for=="function"?(gracefulQueue=Symbol.for("graceful-fs.queue"),previousSymbol=Symbol.for("graceful-fs.previous")):(gracefulQueue="___graceful-fs.queue",previousSymbol="___graceful-fs.previous");function noop3(){}function publishQueue(context,queue2){Object.defineProperty(context,gracefulQueue,{get:function(){return queue2}})}var debug=noop3;util.debuglog?debug=util.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(debug=function(){var m2=util.format.apply(util,arguments);m2="GFS4: "+m2.split(/\n/).join(`
23
23
  GFS4: `),console.error(m2)});fs9[gracefulQueue]||(queue=global[gracefulQueue]||[],publishQueue(fs9,queue),fs9.close=function(fs$close){function close(fd,cb){return fs$close.call(fs9,fd,function(err){err||resetQueue(),typeof cb=="function"&&cb.apply(this,arguments)})}return Object.defineProperty(close,previousSymbol,{value:fs$close}),close}(fs9.close),fs9.closeSync=function(fs$closeSync){function closeSync(fd){fs$closeSync.apply(fs9,arguments),resetQueue()}return Object.defineProperty(closeSync,previousSymbol,{value:fs$closeSync}),closeSync}(fs9.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){debug(fs9[gracefulQueue]),require("assert").equal(fs9[gracefulQueue].length,0)}));var queue;global[gracefulQueue]||publishQueue(global,fs9[gracefulQueue]);module2.exports=patch(clone2(fs9));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!fs9.__patched&&(module2.exports=patch(fs9),fs9.__patched=!0);function patch(fs10){polyfills(fs10),fs10.gracefulify=patch,fs10.createReadStream=createReadStream2,fs10.createWriteStream=createWriteStream2;var fs$readFile=fs10.readFile;fs10.readFile=readFile5;function readFile5(path13,options,cb){return typeof options=="function"&&(cb=options,options=null),go$readFile(path13,options,cb);function go$readFile(path14,options2,cb2,startTime){return fs$readFile(path14,options2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$readFile,[path14,options2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$writeFile=fs10.writeFile;fs10.writeFile=writeFile3;function writeFile3(path13,data,options,cb){return typeof options=="function"&&(cb=options,options=null),go$writeFile(path13,data,options,cb);function go$writeFile(path14,data2,options2,cb2,startTime){return fs$writeFile(path14,data2,options2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$writeFile,[path14,data2,options2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$appendFile=fs10.appendFile;fs$appendFile&&(fs10.appendFile=appendFile);function appendFile(path13,data,options,cb){return typeof options=="function"&&(cb=options,options=null),go$appendFile(path13,data,options,cb);function go$appendFile(path14,data2,options2,cb2,startTime){return fs$appendFile(path14,data2,options2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$appendFile,[path14,data2,options2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$copyFile=fs10.copyFile;fs$copyFile&&(fs10.copyFile=copyFile);function copyFile(src,dest,flags,cb){return typeof flags=="function"&&(cb=flags,flags=0),go$copyFile(src,dest,flags,cb);function go$copyFile(src2,dest2,flags2,cb2,startTime){return fs$copyFile(src2,dest2,flags2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$copyFile,[src2,dest2,flags2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$readdir=fs10.readdir;fs10.readdir=readdir;var noReaddirOptionVersions=/^v[0-5]\./;function readdir(path13,options,cb){typeof options=="function"&&(cb=options,options=null);var go$readdir=noReaddirOptionVersions.test(process.version)?function(path14,options2,cb2,startTime){return fs$readdir(path14,fs$readdirCallback(path14,options2,cb2,startTime))}:function(path14,options2,cb2,startTime){return fs$readdir(path14,options2,fs$readdirCallback(path14,options2,cb2,startTime))};return go$readdir(path13,options,cb);function fs$readdirCallback(path14,options2,cb2,startTime){return function(err,files){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$readdir,[path14,options2,cb2],err,startTime||Date.now(),Date.now()]):(files&&files.sort&&files.sort(),typeof cb2=="function"&&cb2.call(this,err,files))}}}if(process.version.substr(0,4)==="v0.8"){var legStreams=legacy(fs10);ReadStream=legStreams.ReadStream,WriteStream=legStreams.WriteStream}var fs$ReadStream=fs10.ReadStream;fs$ReadStream&&(ReadStream.prototype=Object.create(fs$ReadStream.prototype),ReadStream.prototype.open=ReadStream$open);var fs$WriteStream=fs10.WriteStream;fs$WriteStream&&(WriteStream.prototype=Object.create(fs$WriteStream.prototype),WriteStream.prototype.open=WriteStream$open),Object.defineProperty(fs10,"ReadStream",{get:function(){return ReadStream},set:function(val){ReadStream=val},enumerable:!0,configurable:!0}),Object.defineProperty(fs10,"WriteStream",{get:function(){return WriteStream},set:function(val){WriteStream=val},enumerable:!0,configurable:!0});var FileReadStream=ReadStream;Object.defineProperty(fs10,"FileReadStream",{get:function(){return FileReadStream},set:function(val){FileReadStream=val},enumerable:!0,configurable:!0});var FileWriteStream=WriteStream;Object.defineProperty(fs10,"FileWriteStream",{get:function(){return FileWriteStream},set:function(val){FileWriteStream=val},enumerable:!0,configurable:!0});function ReadStream(path13,options){return this instanceof ReadStream?(fs$ReadStream.apply(this,arguments),this):ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var that=this;open2(that.path,that.flags,that.mode,function(err,fd){err?(that.autoClose&&that.destroy(),that.emit("error",err)):(that.fd=fd,that.emit("open",fd),that.read())})}function WriteStream(path13,options){return this instanceof WriteStream?(fs$WriteStream.apply(this,arguments),this):WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var that=this;open2(that.path,that.flags,that.mode,function(err,fd){err?(that.destroy(),that.emit("error",err)):(that.fd=fd,that.emit("open",fd))})}function createReadStream2(path13,options){return new fs10.ReadStream(path13,options)}function createWriteStream2(path13,options){return new fs10.WriteStream(path13,options)}var fs$open=fs10.open;fs10.open=open2;function open2(path13,flags,mode,cb){return typeof mode=="function"&&(cb=mode,mode=null),go$open(path13,flags,mode,cb);function go$open(path14,flags2,mode2,cb2,startTime){return fs$open(path14,flags2,mode2,function(err,fd){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$open,[path14,flags2,mode2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}return fs10}function enqueue(elem){debug("ENQUEUE",elem[0].name,elem[1]),fs9[gracefulQueue].push(elem),retry()}var retryTimer;function resetQueue(){for(var now=Date.now(),i2=0;i2<fs9[gracefulQueue].length;++i2)fs9[gracefulQueue][i2].length>2&&(fs9[gracefulQueue][i2][3]=now,fs9[gracefulQueue][i2][4]=now);retry()}function retry(){if(clearTimeout(retryTimer),retryTimer=void 0,fs9[gracefulQueue].length!==0){var elem=fs9[gracefulQueue].shift(),fn=elem[0],args=elem[1],err=elem[2],startTime=elem[3],lastTime=elem[4];if(startTime===void 0)debug("RETRY",fn.name,args),fn.apply(null,args);else if(Date.now()-startTime>=6e4){debug("TIMEOUT",fn.name,args);var cb=args.pop();typeof cb=="function"&&cb.call(null,err)}else{var sinceAttempt=Date.now()-lastTime,sinceStart=Math.max(lastTime-startTime,1),desiredDelay=Math.min(sinceStart*1.2,100);sinceAttempt>=desiredDelay?(debug("RETRY",fn.name,args),fn.apply(null,args.concat([startTime]))):fs9[gracefulQueue].push(elem)}retryTimer===void 0&&(retryTimer=setTimeout(retry,0))}}}});var require_is_path_cwd=__commonJS({"../../node_modules/is-path-cwd/index.js"(exports,module2){"use strict";var path13=require("path");module2.exports=path_=>{let cwd=process.cwd();return path_=path13.resolve(path_),process.platform==="win32"&&(cwd=cwd.toLowerCase(),path_=path_.toLowerCase()),path_===cwd}}});var require_is_path_inside=__commonJS({"../../node_modules/is-path-inside/index.js"(exports,module2){"use strict";var path13=require("path");module2.exports=(childPath,parentPath)=>{let relation=path13.relative(parentPath,childPath);return!!(relation&&relation!==".."&&!relation.startsWith(`..${path13.sep}`)&&relation!==path13.resolve(childPath))}}});var require_old=__commonJS({"../../node_modules/fs.realpath/old.js"(exports){"use strict";var pathModule=require("path"),isWindows=process.platform==="win32",fs9=require("fs"),DEBUG=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var callback;if(DEBUG){var backtrace=new Error;callback=debugCallback}else callback=missingCallback;return callback;function debugCallback(err){err&&(backtrace.message=err.message,err=backtrace,missingCallback(err))}function missingCallback(err){if(err){if(process.throwDeprecation)throw err;if(!process.noDeprecation){var msg="fs: missing callback "+(err.stack||err.message);process.traceDeprecation?console.trace(msg):console.error(msg)}}}}function maybeCallback(cb){return typeof cb=="function"?cb:rethrow()}var normalize=pathModule.normalize;isWindows?nextPartRe=/(.*?)(?:[\/\\]+|$)/g:nextPartRe=/(.*?)(?:[\/]+|$)/g;var nextPartRe;isWindows?splitRootRe=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/:splitRootRe=/^[\/]*/;var splitRootRe;exports.realpathSync=function(p,cache3){if(p=pathModule.resolve(p),cache3&&Object.prototype.hasOwnProperty.call(cache3,p))return cache3[p];var original=p,seenLinks={},knownHard={},pos,current,base,previous;start();function start(){var m2=splitRootRe.exec(p);pos=m2[0].length,current=m2[0],base=m2[0],previous="",isWindows&&!knownHard[base]&&(fs9.lstatSync(base),knownHard[base]=!0)}for(;pos<p.length;){nextPartRe.lastIndex=pos;var result=nextPartRe.exec(p);if(previous=current,current+=result[0],base=previous+result[1],pos=nextPartRe.lastIndex,!(knownHard[base]||cache3&&cache3[base]===base)){var resolvedLink;if(cache3&&Object.prototype.hasOwnProperty.call(cache3,base))resolvedLink=cache3[base];else{var stat2=fs9.lstatSync(base);if(!stat2.isSymbolicLink()){knownHard[base]=!0,cache3&&(cache3[base]=base);continue}var linkTarget=null;if(!isWindows){var id=stat2.dev.toString(32)+":"+stat2.ino.toString(32);seenLinks.hasOwnProperty(id)&&(linkTarget=seenLinks[id])}linkTarget===null&&(fs9.statSync(base),linkTarget=fs9.readlinkSync(base)),resolvedLink=pathModule.resolve(previous,linkTarget),cache3&&(cache3[base]=resolvedLink),isWindows||(seenLinks[id]=linkTarget)}p=pathModule.resolve(resolvedLink,p.slice(pos)),start()}}return cache3&&(cache3[original]=p),p};exports.realpath=function(p,cache3,cb){if(typeof cb!="function"&&(cb=maybeCallback(cache3),cache3=null),p=pathModule.resolve(p),cache3&&Object.prototype.hasOwnProperty.call(cache3,p))return process.nextTick(cb.bind(null,null,cache3[p]));var original=p,seenLinks={},knownHard={},pos,current,base,previous;start();function start(){var m2=splitRootRe.exec(p);pos=m2[0].length,current=m2[0],base=m2[0],previous="",isWindows&&!knownHard[base]?fs9.lstat(base,function(err){if(err)return cb(err);knownHard[base]=!0,LOOP()}):process.nextTick(LOOP)}function LOOP(){if(pos>=p.length)return cache3&&(cache3[original]=p),cb(null,p);nextPartRe.lastIndex=pos;var result=nextPartRe.exec(p);return previous=current,current+=result[0],base=previous+result[1],pos=nextPartRe.lastIndex,knownHard[base]||cache3&&cache3[base]===base?process.nextTick(LOOP):cache3&&Object.prototype.hasOwnProperty.call(cache3,base)?gotResolvedLink(cache3[base]):fs9.lstat(base,gotStat)}function gotStat(err,stat2){if(err)return cb(err);if(!stat2.isSymbolicLink())return knownHard[base]=!0,cache3&&(cache3[base]=base),process.nextTick(LOOP);if(!isWindows){var id=stat2.dev.toString(32)+":"+stat2.ino.toString(32);if(seenLinks.hasOwnProperty(id))return gotTarget(null,seenLinks[id],base)}fs9.stat(base,function(err2){if(err2)return cb(err2);fs9.readlink(base,function(err3,target){isWindows||(seenLinks[id]=target),gotTarget(err3,target)})})}function gotTarget(err,target,base2){if(err)return cb(err);var resolvedLink=pathModule.resolve(previous,target);cache3&&(cache3[base2]=resolvedLink),gotResolvedLink(resolvedLink)}function gotResolvedLink(resolvedLink){p=pathModule.resolve(resolvedLink,p.slice(pos)),start()}}}});var require_fs=__commonJS({"../../node_modules/fs.realpath/index.js"(exports,module2){"use strict";module2.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var fs9=require("fs"),origRealpath=fs9.realpath,origRealpathSync=fs9.realpathSync,version=process.version,ok=/^v[0-5]\./.test(version),old=require_old();function newError(er){return er&&er.syscall==="realpath"&&(er.code==="ELOOP"||er.code==="ENOMEM"||er.code==="ENAMETOOLONG")}function realpath(p,cache3,cb){if(ok)return origRealpath(p,cache3,cb);typeof cache3=="function"&&(cb=cache3,cache3=null),origRealpath(p,cache3,function(er,result){newError(er)?old.realpath(p,cache3,cb):cb(er,result)})}function realpathSync(p,cache3){if(ok)return origRealpathSync(p,cache3);try{return origRealpathSync(p,cache3)}catch(er){if(newError(er))return old.realpathSync(p,cache3);throw er}}function monkeypatch(){fs9.realpath=realpath,fs9.realpathSync=realpathSync}function unmonkeypatch(){fs9.realpath=origRealpath,fs9.realpathSync=origRealpathSync}}});var require_concat_map=__commonJS({"../../node_modules/concat-map/index.js"(exports,module2){"use strict";module2.exports=function(xs,fn){for(var res=[],i2=0;i2<xs.length;i2++){var x2=fn(xs[i2],i2);isArray(x2)?res.push.apply(res,x2):res.push(x2)}return res};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}}});var require_balanced_match=__commonJS({"../../node_modules/balanced-match/index.js"(exports,module2){"use strict";module2.exports=balanced;function balanced(a,b,str){a instanceof RegExp&&(a=maybeMatch(a,str)),b instanceof RegExp&&(b=maybeMatch(b,str));var r2=range(a,b,str);return r2&&{start:r2[0],end:r2[1],pre:str.slice(0,r2[0]),body:str.slice(r2[0]+a.length,r2[1]),post:str.slice(r2[1]+b.length)}}function maybeMatch(reg,str){var m2=str.match(reg);return m2?m2[0]:null}balanced.range=range;function range(a,b,str){var begs,beg,left,right,result,ai=str.indexOf(a),bi=str.indexOf(b,ai+1),i2=ai;if(ai>=0&&bi>0){if(a===b)return[ai,bi];for(begs=[],left=str.length;i2>=0&&!result;)i2==ai?(begs.push(i2),ai=str.indexOf(a,i2+1)):begs.length==1?result=[begs.pop(),bi]:(beg=begs.pop(),beg<left&&(left=beg,right=bi),bi=str.indexOf(b,i2+1)),i2=ai<bi&&ai>=0?ai:bi;begs.length&&(result=[left,right])}return result}}});var require_brace_expansion=__commonJS({"../../node_modules/brace-expansion/index.js"(exports,module2){"use strict";var concatMap=require_concat_map(),balanced=require_balanced_match();module2.exports=expandTop;var escSlash="\0SLASH"+Math.random()+"\0",escOpen="\0OPEN"+Math.random()+"\0",escClose="\0CLOSE"+Math.random()+"\0",escComma="\0COMMA"+Math.random()+"\0",escPeriod="\0PERIOD"+Math.random()+"\0";function numeric(str){return parseInt(str,10)==str?parseInt(str,10):str.charCodeAt(0)}function escapeBraces(str){return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(str){return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(str){if(!str)return[""];var parts=[],m2=balanced("{","}",str);if(!m2)return str.split(",");var pre=m2.pre,body=m2.body,post=m2.post,p=pre.split(",");p[p.length-1]+="{"+body+"}";var postParts=parseCommaParts(post);return post.length&&(p[p.length-1]+=postParts.shift(),p.push.apply(p,postParts)),parts.push.apply(parts,p),parts}function expandTop(str){return str?(str.substr(0,2)==="{}"&&(str="\\{\\}"+str.substr(2)),expand(escapeBraces(str),!0).map(unescapeBraces)):[]}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i2,y){return i2<=y}function gte(i2,y){return i2>=y}function expand(str,isTop){var expansions=[],m2=balanced("{","}",str);if(!m2||/\$$/.test(m2.pre))return[str];var isNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m2.body),isAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m2.body),isSequence=isNumericSequence||isAlphaSequence,isOptions=m2.body.indexOf(",")>=0;if(!isSequence&&!isOptions)return m2.post.match(/,.*\}/)?(str=m2.pre+"{"+m2.body+escClose+m2.post,expand(str)):[str];var n;if(isSequence)n=m2.body.split(/\.\./);else if(n=parseCommaParts(m2.body),n.length===1&&(n=expand(n[0],!1).map(embrace),n.length===1)){var post=m2.post.length?expand(m2.post,!1):[""];return post.map(function(p){return m2.pre+n[0]+p})}var pre=m2.pre,post=m2.post.length?expand(m2.post,!1):[""],N;if(isSequence){var x2=numeric(n[0]),y=numeric(n[1]),width=Math.max(n[0].length,n[1].length),incr=n.length==3?Math.abs(numeric(n[2])):1,test=lte,reverse=y<x2;reverse&&(incr*=-1,test=gte);var pad=n.some(isPadded);N=[];for(var i2=x2;test(i2,y);i2+=incr){var c;if(isAlphaSequence)c=String.fromCharCode(i2),c==="\\"&&(c="");else if(c=String(i2),pad){var need=width-c.length;if(need>0){var z=new Array(need+1).join("0");i2<0?c="-"+z+c.slice(1):c=z+c}}N.push(c)}}else N=concatMap(n,function(el){return expand(el,!1)});for(var j=0;j<N.length;j++)for(var k=0;k<post.length;k++){var expansion=pre+N[j]+post[k];(!isTop||isSequence||expansion)&&expansions.push(expansion)}return expansions}}});var require_minimatch=__commonJS({"../../node_modules/minimatch/minimatch.js"(exports,module2){"use strict";module2.exports=minimatch;minimatch.Minimatch=Minimatch;var path13=function(){try{return require("path")}catch{}}()||{sep:"/"};minimatch.sep=path13.sep;var GLOBSTAR=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={},expand=require_brace_expansion(),plTypes={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s2){return s2.split("").reduce(function(set,c){return set[c]=!0,set},{})}var slashSplit=/\/+/;minimatch.filter=filter;function filter(pattern,options){return options=options||{},function(p,i2,list){return minimatch(p,pattern,options)}}function ext(a,b){b=b||{};var t2={};return Object.keys(a).forEach(function(k){t2[k]=a[k]}),Object.keys(b).forEach(function(k){t2[k]=b[k]}),t2}minimatch.defaults=function(def){if(!def||typeof def!="object"||!Object.keys(def).length)return minimatch;var orig=minimatch,m2=function(p,pattern,options){return orig(p,pattern,ext(def,options))};return m2.Minimatch=function(pattern,options){return new orig.Minimatch(pattern,ext(def,options))},m2.Minimatch.defaults=function(options){return orig.defaults(ext(def,options)).Minimatch},m2.filter=function(pattern,options){return orig.filter(pattern,ext(def,options))},m2.defaults=function(options){return orig.defaults(ext(def,options))},m2.makeRe=function(pattern,options){return orig.makeRe(pattern,ext(def,options))},m2.braceExpand=function(pattern,options){return orig.braceExpand(pattern,ext(def,options))},m2.match=function(list,pattern,options){return orig.match(list,pattern,ext(def,options))},m2};Minimatch.defaults=function(def){return minimatch.defaults(def).Minimatch};function minimatch(p,pattern,options){return assertValidPattern(pattern),options||(options={}),!options.nocomment&&pattern.charAt(0)==="#"?!1:new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch))return new Minimatch(pattern,options);assertValidPattern(pattern),options||(options={}),pattern=pattern.trim(),!options.allowWindowsEscape&&path13.sep!=="/"&&(pattern=pattern.split(path13.sep).join("/")),this.options=options,this.set=[],this.pattern=pattern,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!options.partial,this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var pattern=this.pattern,options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=!0;return}if(!pattern){this.empty=!0;return}this.parseNegate();var set=this.globSet=this.braceExpand();options.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,set),set=this.globParts=set.map(function(s2){return s2.split(slashSplit)}),this.debug(this.pattern,set),set=set.map(function(s2,si,set2){return s2.map(this.parse,this)},this),this.debug(this.pattern,set),set=set.filter(function(s2){return s2.indexOf(!1)===-1}),this.debug(this.pattern,set),this.set=set}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern,negate=!1,options=this.options,negateOffset=0;if(!options.nonegate){for(var i2=0,l=pattern.length;i2<l&&pattern.charAt(i2)==="!";i2++)negate=!negate,negateOffset++;negateOffset&&(this.pattern=pattern.substr(negateOffset)),this.negate=negate}}minimatch.braceExpand=function(pattern,options){return braceExpand(pattern,options)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){return options||(this instanceof Minimatch?options=this.options:options={}),pattern=typeof pattern>"u"?this.pattern:pattern,assertValidPattern(pattern),options.nobrace||!/\{(?:(?!\{).)*\}/.test(pattern)?[pattern]:expand(pattern)}var MAX_PATTERN_LENGTH=1024*64,assertValidPattern=function(pattern){if(typeof pattern!="string")throw new TypeError("invalid pattern");if(pattern.length>MAX_PATTERN_LENGTH)throw new TypeError("pattern is too long")};Minimatch.prototype.parse=parse2;var SUBPARSE={};function parse2(pattern,isSub){assertValidPattern(pattern);var options=this.options;if(pattern==="**")if(options.noglobstar)pattern="*";else return GLOBSTAR;if(pattern==="")return"";var re="",hasMagic=!!options.nocase,escaping=!1,patternListStack=[],negativeLists=[],stateChar,inClass=!1,reClassStart=-1,classStart=-1,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",self2=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star,hasMagic=!0;break;case"?":re+=qmark,hasMagic=!0;break;default:re+="\\"+stateChar;break}self2.debug("clearStateChar %j %j",stateChar,re),stateChar=!1}}for(var i2=0,len=pattern.length,c;i2<len&&(c=pattern.charAt(i2));i2++){if(this.debug("%s %s %s %j",pattern,i2,re,c),escaping&&reSpecials[c]){re+="\\"+c,escaping=!1;continue}switch(c){case"/":return!1;case"\\":clearStateChar(),escaping=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",pattern,i2,re,c),inClass){this.debug(" in class"),c==="!"&&i2===classStart+1&&(c="^"),re+=c;continue}self2.debug("call clearStateChar %j",stateChar),clearStateChar(),stateChar=c,options.noext&&clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}patternListStack.push({type:stateChar,start:i2-1,reStart:re.length,open:plTypes[stateChar].open,close:plTypes[stateChar].close}),re+=stateChar==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",stateChar,re),stateChar=!1;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar(),hasMagic=!0;var pl=patternListStack.pop();re+=pl.close,pl.type==="!"&&negativeLists.push(pl),pl.reEnd=re.length;continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|",escaping=!1;continue}clearStateChar(),re+="|";continue;case"[":if(clearStateChar(),inClass){re+="\\"+c;continue}inClass=!0,classStart=i2,reClassStart=re.length,re+=c;continue;case"]":if(i2===classStart+1||!inClass){re+="\\"+c,escaping=!1;continue}var cs=pattern.substring(classStart+1,i2);try{RegExp("["+cs+"]")}catch{var sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0]+"\\]",hasMagic=hasMagic||sp[1],inClass=!1;continue}hasMagic=!0,inClass=!1,re+=c;continue;default:clearStateChar(),escaping?escaping=!1:reSpecials[c]&&!(c==="^"&&inClass)&&(re+="\\"),re+=c}}for(inClass&&(cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE),re=re.substr(0,reClassStart)+"\\["+sp[0],hasMagic=hasMagic||sp[1]),pl=patternListStack.pop();pl;pl=patternListStack.pop()){var tail=re.slice(pl.reStart+pl.open.length);this.debug("setting tail",re,pl),tail=tail.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(_,$1,$2){return $2||($2="\\"),$1+$1+$2+"|"}),this.debug(`tail=%j
24
24
  %s`,tail,tail,pl,re);var t2=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=!0,re=re.slice(0,pl.reStart)+t2+"\\("+tail}clearStateChar(),escaping&&(re+="\\\\");var addPatternStart=!1;switch(re.charAt(0)){case"[":case".":case"(":addPatternStart=!0}for(var n=negativeLists.length-1;n>-1;n--){var nl=negativeLists[n],nlBefore=re.slice(0,nl.reStart),nlFirst=re.slice(nl.reStart,nl.reEnd-8),nlLast=re.slice(nl.reEnd-8,nl.reEnd),nlAfter=re.slice(nl.reEnd);nlLast+=nlAfter;var openParensBefore=nlBefore.split("(").length-1,cleanAfter=nlAfter;for(i2=0;i2<openParensBefore;i2++)cleanAfter=cleanAfter.replace(/\)[+*?]?/,"");nlAfter=cleanAfter;var dollar="";nlAfter===""&&isSub!==SUBPARSE&&(dollar="$");var newRe=nlBefore+nlFirst+nlAfter+dollar+nlLast;re=newRe}if(re!==""&&hasMagic&&(re="(?=.)"+re),addPatternStart&&(re=patternStart+re),isSub===SUBPARSE)return[re,hasMagic];if(!hasMagic)return globUnescape(pattern);var flags=options.nocase?"i":"";try{var regExp=new RegExp("^"+re+"$",flags)}catch{return new RegExp("$.")}return regExp._glob=pattern,regExp._src=re,regExp}minimatch.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;var set=this.set;if(!set.length)return this.regexp=!1,this.regexp;var options=this.options,twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"",re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p=="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$",this.negate&&(re="^(?!"+re+").*$");try{this.regexp=new RegExp(re,flags)}catch{this.regexp=!1}return this.regexp}minimatch.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);return list=list.filter(function(f3){return mm.match(f3)}),mm.options.nonull&&!list.length&&list.push(pattern),list};Minimatch.prototype.match=function(f3,partial){if(typeof partial>"u"&&(partial=this.partial),this.debug("match",f3,this.pattern),this.comment)return!1;if(this.empty)return f3==="";if(f3==="/"&&partial)return!0;var options=this.options;path13.sep!=="/"&&(f3=f3.split(path13.sep).join("/")),f3=f3.split(slashSplit),this.debug(this.pattern,"split",f3);var set=this.set;this.debug(this.pattern,"set",set);var filename,i2;for(i2=f3.length-1;i2>=0&&(filename=f3[i2],!filename);i2--);for(i2=0;i2<set.length;i2++){var pattern=set[i2],file=f3;options.matchBase&&pattern.length===1&&(file=[filename]);var hit=this.matchOne(file,pattern,partial);if(hit)return options.flipNegate?!0:!this.negate}return options.flipNegate?!1:this.negate};Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{this:this,file,pattern}),this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f3=file[fi];if(this.debug(pattern,p,f3),p===!1)return!1;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f3]);var fr=fi,pr=pi+1;if(pr===pl){for(this.debug("** at the end");fi<fl;fi++)if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return!1;return!0}for(;fr<fl;){var swallowee=file[fr];if(this.debug(`
25
25
  globstar while`,file,fr,pattern,pr,swallowee),this.matchOne(file.slice(fr),pattern.slice(pr),partial))return this.debug("globstar found match!",fr,fl,swallowee),!0;if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break}this.debug("globstar swallow a segment, and continue"),fr++}return!!(partial&&(this.debug(`
26
26
  >>> no match, partial?`,file,fr,pattern,pr),fr===fl))}var hit;if(typeof p=="string"?(hit=f3===p,this.debug("string match",p,f3,hit)):(hit=f3.match(p),this.debug("pattern match",p,f3,hit)),!hit)return!1}if(fi===fl&&pi===pl)return!0;if(fi===fl)return partial;if(pi===pl)return fi===fl-1&&file[fi]==="";throw new Error("wtf?")};function globUnescape(s2){return s2.replace(/\\(.)/g,"$1")}function regExpEscape(s2){return s2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}}});var require_inherits_browser=__commonJS({"../../node_modules/inherits/inherits_browser.js"(exports,module2){"use strict";typeof Object.create=="function"?module2.exports=function(ctor,superCtor){superCtor&&(ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}}))}:module2.exports=function(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}}}});var require_inherits=__commonJS({"../../node_modules/inherits/inherits.js"(exports,module2){"use strict";try{if(util=require("util"),typeof util.inherits!="function")throw"";module2.exports=util.inherits}catch{module2.exports=require_inherits_browser()}var util}});var require_path_is_absolute=__commonJS({"../../node_modules/path-is-absolute/index.js"(exports,module2){"use strict";function posix(path13){return path13.charAt(0)==="/"}function win32(path13){var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,result=splitDeviceRe.exec(path13),device=result[1]||"",isUnc=!!(device&&device.charAt(1)!==":");return!!(result[2]||isUnc)}module2.exports=process.platform==="win32"?win32:posix;module2.exports.posix=posix;module2.exports.win32=win32}});var require_common=__commonJS({"../../node_modules/rimraf/node_modules/glob/common.js"(exports){"use strict";exports.setopts=setopts;exports.ownProp=ownProp;exports.makeAbs=makeAbs;exports.finish=finish;exports.mark=mark;exports.isIgnored=isIgnored;exports.childrenIgnored=childrenIgnored;function ownProp(obj,field){return Object.prototype.hasOwnProperty.call(obj,field)}var fs9=require("fs"),path13=require("path"),minimatch=require_minimatch(),isAbsolute3=require_path_is_absolute(),Minimatch=minimatch.Minimatch;function alphasort(a,b){return a.localeCompare(b,"en")}function setupIgnores(self2,options){self2.ignore=options.ignore||[],Array.isArray(self2.ignore)||(self2.ignore=[self2.ignore]),self2.ignore.length&&(self2.ignore=self2.ignore.map(ignoreMap))}function ignoreMap(pattern){var gmatcher=null;if(pattern.slice(-3)==="/**"){var gpattern=pattern.replace(/(\/\*\*)+$/,"");gmatcher=new Minimatch(gpattern,{dot:!0})}return{matcher:new Minimatch(pattern,{dot:!0}),gmatcher}}function setopts(self2,pattern,options){if(options||(options={}),options.matchBase&&pattern.indexOf("/")===-1){if(options.noglobstar)throw new Error("base matching requires globstar");pattern="**/"+pattern}self2.silent=!!options.silent,self2.pattern=pattern,self2.strict=options.strict!==!1,self2.realpath=!!options.realpath,self2.realpathCache=options.realpathCache||Object.create(null),self2.follow=!!options.follow,self2.dot=!!options.dot,self2.mark=!!options.mark,self2.nodir=!!options.nodir,self2.nodir&&(self2.mark=!0),self2.sync=!!options.sync,self2.nounique=!!options.nounique,self2.nonull=!!options.nonull,self2.nosort=!!options.nosort,self2.nocase=!!options.nocase,self2.stat=!!options.stat,self2.noprocess=!!options.noprocess,self2.absolute=!!options.absolute,self2.fs=options.fs||fs9,self2.maxLength=options.maxLength||1/0,self2.cache=options.cache||Object.create(null),self2.statCache=options.statCache||Object.create(null),self2.symlinks=options.symlinks||Object.create(null),setupIgnores(self2,options),self2.changedCwd=!1;var cwd=process.cwd();ownProp(options,"cwd")?(self2.cwd=path13.resolve(options.cwd),self2.changedCwd=self2.cwd!==cwd):self2.cwd=cwd,self2.root=options.root||path13.resolve(self2.cwd,"/"),self2.root=path13.resolve(self2.root),process.platform==="win32"&&(self2.root=self2.root.replace(/\\/g,"/")),self2.cwdAbs=isAbsolute3(self2.cwd)?self2.cwd:makeAbs(self2,self2.cwd),process.platform==="win32"&&(self2.cwdAbs=self2.cwdAbs.replace(/\\/g,"/")),self2.nomount=!!options.nomount,options.nonegate=!0,options.nocomment=!0,options.allowWindowsEscape=!1,self2.minimatch=new Minimatch(pattern,options),self2.options=self2.minimatch.options}function finish(self2){for(var nou=self2.nounique,all2=nou?[]:Object.create(null),i2=0,l=self2.matches.length;i2<l;i2++){var matches=self2.matches[i2];if(!matches||Object.keys(matches).length===0){if(self2.nonull){var literal=self2.minimatch.globSet[i2];nou?all2.push(literal):all2[literal]=!0}}else{var m2=Object.keys(matches);nou?all2.push.apply(all2,m2):m2.forEach(function(m3){all2[m3]=!0})}}if(nou||(all2=Object.keys(all2)),self2.nosort||(all2=all2.sort(alphasort)),self2.mark){for(var i2=0;i2<all2.length;i2++)all2[i2]=self2._mark(all2[i2]);self2.nodir&&(all2=all2.filter(function(e2){var notDir=!/\/$/.test(e2),c=self2.cache[e2]||self2.cache[makeAbs(self2,e2)];return notDir&&c&&(notDir=c!=="DIR"&&!Array.isArray(c)),notDir}))}self2.ignore.length&&(all2=all2.filter(function(m3){return!isIgnored(self2,m3)})),self2.found=all2}function mark(self2,p){var abs=makeAbs(self2,p),c=self2.cache[abs],m2=p;if(c){var isDir=c==="DIR"||Array.isArray(c),slash2=p.slice(-1)==="/";if(isDir&&!slash2?m2+="/":!isDir&&slash2&&(m2=m2.slice(0,-1)),m2!==p){var mabs=makeAbs(self2,m2);self2.statCache[mabs]=self2.statCache[abs],self2.cache[mabs]=self2.cache[abs]}}return m2}function makeAbs(self2,f3){var abs=f3;return f3.charAt(0)==="/"?abs=path13.join(self2.root,f3):isAbsolute3(f3)||f3===""?abs=f3:self2.changedCwd?abs=path13.resolve(self2.cwd,f3):abs=path13.resolve(f3),process.platform==="win32"&&(abs=abs.replace(/\\/g,"/")),abs}function isIgnored(self2,path14){return self2.ignore.length?self2.ignore.some(function(item){return item.matcher.match(path14)||!!(item.gmatcher&&item.gmatcher.match(path14))}):!1}function childrenIgnored(self2,path14){return self2.ignore.length?self2.ignore.some(function(item){return!!(item.gmatcher&&item.gmatcher.match(path14))}):!1}}});var require_sync=__commonJS({"../../node_modules/rimraf/node_modules/glob/sync.js"(exports,module2){"use strict";module2.exports=globSync;globSync.GlobSync=GlobSync;var rp=require_fs(),minimatch=require_minimatch(),Minimatch=minimatch.Minimatch,Glob=require_glob().Glob,util=require("util"),path13=require("path"),assert2=require("assert"),isAbsolute3=require_path_is_absolute(),common=require_common(),setopts=common.setopts,ownProp=common.ownProp,childrenIgnored=common.childrenIgnored,isIgnored=common.isIgnored;function globSync(pattern,options){if(typeof options=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
27
27
  See: https://github.com/isaacs/node-glob/issues/167`);return new GlobSync(pattern,options).found}function GlobSync(pattern,options){if(!pattern)throw new Error("must provide pattern");if(typeof options=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
28
- See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof GlobSync))return new GlobSync(pattern,options);if(setopts(this,pattern,options),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var i2=0;i2<n;i2++)this._process(this.minimatch.set[i2],i2,!1);this._finish()}GlobSync.prototype._finish=function(){if(assert2.ok(this instanceof GlobSync),this.realpath){var self2=this;this.matches.forEach(function(matchset,index){var set=self2.matches[index]=Object.create(null);for(var p in matchset)try{p=self2._makeAbs(p);var real=rp.realpathSync(p,self2.realpathCache);set[real]=!0}catch(er){if(er.syscall==="stat")set[self2._makeAbs(p)]=!0;else throw er}})}common.finish(this)};GlobSync.prototype._process=function(pattern,index,inGlobStar){assert2.ok(this instanceof GlobSync);for(var n=0;typeof pattern[n]=="string";)n++;var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n),read;prefix===null?read=".":((isAbsolute3(prefix)||isAbsolute3(pattern.map(function(p){return typeof p=="string"?p:"[*]"}).join("/")))&&(!prefix||!isAbsolute3(prefix))&&(prefix="/"+prefix),read=prefix);var abs=this._makeAbs(read);if(!childrenIgnored(this,read)){var isGlobStar=remain[0]===minimatch.GLOBSTAR;isGlobStar?this._processGlobStar(prefix,read,abs,remain,index,inGlobStar):this._processReaddir(prefix,read,abs,remain,index,inGlobStar)}};GlobSync.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar){var entries2=this._readdir(abs,inGlobStar);if(entries2){for(var pn=remain[0],negate=!!this.minimatch.negate,rawGlob=pn._glob,dotOk=this.dot||rawGlob.charAt(0)===".",matchedEntries=[],i2=0;i2<entries2.length;i2++){var e2=entries2[i2];if(e2.charAt(0)!=="."||dotOk){var m2;negate&&!prefix?m2=!e2.match(pn):m2=e2.match(pn),m2&&matchedEntries.push(e2)}}var len=matchedEntries.length;if(len!==0){if(remain.length===1&&!this.mark&&!this.stat){this.matches[index]||(this.matches[index]=Object.create(null));for(var i2=0;i2<len;i2++){var e2=matchedEntries[i2];prefix&&(prefix.slice(-1)!=="/"?e2=prefix+"/"+e2:e2=prefix+e2),e2.charAt(0)==="/"&&!this.nomount&&(e2=path13.join(this.root,e2)),this._emitMatch(index,e2)}return}remain.shift();for(var i2=0;i2<len;i2++){var e2=matchedEntries[i2],newPattern;prefix?newPattern=[prefix,e2]:newPattern=[e2],this._process(newPattern.concat(remain),index,inGlobStar)}}}};GlobSync.prototype._emitMatch=function(index,e2){if(!isIgnored(this,e2)){var abs=this._makeAbs(e2);if(this.mark&&(e2=this._mark(e2)),this.absolute&&(e2=abs),!this.matches[index][e2]){if(this.nodir){var c=this.cache[abs];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e2]=!0,this.stat&&this._stat(e2)}}};GlobSync.prototype._readdirInGlobStar=function(abs){if(this.follow)return this._readdir(abs,!1);var entries2,lstat,stat2;try{lstat=this.fs.lstatSync(abs)}catch(er){if(er.code==="ENOENT")return null}var isSym=lstat&&lstat.isSymbolicLink();return this.symlinks[abs]=isSym,!isSym&&lstat&&!lstat.isDirectory()?this.cache[abs]="FILE":entries2=this._readdir(abs,!1),entries2};GlobSync.prototype._readdir=function(abs,inGlobStar){var entries2;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return null;if(Array.isArray(c))return c}try{return this._readdirEntries(abs,this.fs.readdirSync(abs))}catch(er){return this._readdirError(abs,er),null}};GlobSync.prototype._readdirEntries=function(abs,entries2){if(!this.mark&&!this.stat)for(var i2=0;i2<entries2.length;i2++){var e2=entries2[i2];abs==="/"?e2=abs+e2:e2=abs+"/"+e2,this.cache[e2]=!0}return this.cache[abs]=entries2,entries2};GlobSync.prototype._readdirError=function(f3,er){switch(er.code){case"ENOTSUP":case"ENOTDIR":var abs=this._makeAbs(f3);if(this.cache[abs]="FILE",abs===this.cwdAbs){var error=new Error(er.code+" invalid cwd "+this.cwd);throw error.path=this.cwd,error.code=er.code,error}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(f3)]=!1;break;default:if(this.cache[this._makeAbs(f3)]=!1,this.strict)throw er;this.silent||console.error("glob error",er);break}};GlobSync.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar){var entries2=this._readdir(abs,inGlobStar);if(entries2){var remainWithoutGlobStar=remain.slice(1),gspref=prefix?[prefix]:[],noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,!1);var len=entries2.length,isSym=this.symlinks[abs];if(!(isSym&&inGlobStar))for(var i2=0;i2<len;i2++){var e2=entries2[i2];if(!(e2.charAt(0)==="."&&!this.dot)){var instead=gspref.concat(entries2[i2],remainWithoutGlobStar);this._process(instead,index,!0);var below=gspref.concat(entries2[i2],remain);this._process(below,index,!0)}}}};GlobSync.prototype._processSimple=function(prefix,index){var exists=this._stat(prefix);if(this.matches[index]||(this.matches[index]=Object.create(null)),!!exists){if(prefix&&isAbsolute3(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);prefix.charAt(0)==="/"?prefix=path13.join(this.root,prefix):(prefix=path13.resolve(this.root,prefix),trail&&(prefix+="/"))}process.platform==="win32"&&(prefix=prefix.replace(/\\/g,"/")),this._emitMatch(index,prefix)}};GlobSync.prototype._stat=function(f3){var abs=this._makeAbs(f3),needDir=f3.slice(-1)==="/";if(f3.length>this.maxLength)return!1;if(!this.stat&&ownProp(this.cache,abs)){var c=this.cache[abs];if(Array.isArray(c)&&(c="DIR"),!needDir||c==="DIR")return c;if(needDir&&c==="FILE")return!1}var exists,stat2=this.statCache[abs];if(!stat2){var lstat;try{lstat=this.fs.lstatSync(abs)}catch(er){if(er&&(er.code==="ENOENT"||er.code==="ENOTDIR"))return this.statCache[abs]=!1,!1}if(lstat&&lstat.isSymbolicLink())try{stat2=this.fs.statSync(abs)}catch{stat2=lstat}else stat2=lstat}this.statCache[abs]=stat2;var c=!0;return stat2&&(c=stat2.isDirectory()?"DIR":"FILE"),this.cache[abs]=this.cache[abs]||c,needDir&&c==="FILE"?!1:c};GlobSync.prototype._mark=function(p){return common.mark(this,p)};GlobSync.prototype._makeAbs=function(f3){return common.makeAbs(this,f3)}}});var require_wrappy=__commonJS({"../../node_modules/wrappy/wrappy.js"(exports,module2){"use strict";module2.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!="function")throw new TypeError("need wrapper function");return Object.keys(fn).forEach(function(k){wrapper[k]=fn[k]}),wrapper;function wrapper(){for(var args=new Array(arguments.length),i2=0;i2<args.length;i2++)args[i2]=arguments[i2];var ret=fn.apply(this,args),cb2=args[args.length-1];return typeof ret=="function"&&ret!==cb2&&Object.keys(cb2).forEach(function(k){ret[k]=cb2[k]}),ret}}}});var require_once=__commonJS({"../../node_modules/once/once.js"(exports,module2){"use strict";var wrappy=require_wrappy();module2.exports=wrappy(once2);module2.exports.strict=wrappy(onceStrict);once2.proto=once2(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once2(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:!0})});function once2(fn){var f3=function(){return f3.called?f3.value:(f3.called=!0,f3.value=fn.apply(this,arguments))};return f3.called=!1,f3}function onceStrict(fn){var f3=function(){if(f3.called)throw new Error(f3.onceError);return f3.called=!0,f3.value=fn.apply(this,arguments)},name=fn.name||"Function wrapped with `once`";return f3.onceError=name+" shouldn't be called more than once",f3.called=!1,f3}}});var require_inflight=__commonJS({"../../node_modules/inflight/inflight.js"(exports,module2){"use strict";var wrappy=require_wrappy(),reqs=Object.create(null),once2=require_once();module2.exports=wrappy(inflight);function inflight(key,cb){return reqs[key]?(reqs[key].push(cb),null):(reqs[key]=[cb],makeres(key))}function makeres(key){return once2(function RES(){var cbs=reqs[key],len=cbs.length,args=slice(arguments);try{for(var i2=0;i2<len;i2++)cbs[i2].apply(null,args)}finally{cbs.length>len?(cbs.splice(0,len),process.nextTick(function(){RES.apply(null,args)})):delete reqs[key]}})}function slice(args){for(var length=args.length,array=[],i2=0;i2<length;i2++)array[i2]=args[i2];return array}}});var require_glob=__commonJS({"../../node_modules/rimraf/node_modules/glob/glob.js"(exports,module2){"use strict";module2.exports=glob3;var rp=require_fs(),minimatch=require_minimatch(),Minimatch=minimatch.Minimatch,inherits=require_inherits(),EE=require("events").EventEmitter,path13=require("path"),assert2=require("assert"),isAbsolute3=require_path_is_absolute(),globSync=require_sync(),common=require_common(),setopts=common.setopts,ownProp=common.ownProp,inflight=require_inflight(),util=require("util"),childrenIgnored=common.childrenIgnored,isIgnored=common.isIgnored,once2=require_once();function glob3(pattern,options,cb){if(typeof options=="function"&&(cb=options,options={}),options||(options={}),options.sync){if(cb)throw new TypeError("callback provided to sync glob");return globSync(pattern,options)}return new Glob(pattern,options,cb)}glob3.sync=globSync;var GlobSync=glob3.GlobSync=globSync.GlobSync;glob3.glob=glob3;function extend(origin,add){if(add===null||typeof add!="object")return origin;for(var keys=Object.keys(add),i2=keys.length;i2--;)origin[keys[i2]]=add[keys[i2]];return origin}glob3.hasMagic=function(pattern,options_){var options=extend({},options_);options.noprocess=!0;var g=new Glob(pattern,options),set=g.minimatch.set;if(!pattern)return!1;if(set.length>1)return!0;for(var j=0;j<set[0].length;j++)if(typeof set[0][j]!="string")return!0;return!1};glob3.Glob=Glob;inherits(Glob,EE);function Glob(pattern,options,cb){if(typeof options=="function"&&(cb=options,options=null),options&&options.sync){if(cb)throw new TypeError("callback provided to sync glob");return new GlobSync(pattern,options)}if(!(this instanceof Glob))return new Glob(pattern,options,cb);setopts(this,pattern,options),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),typeof cb=="function"&&(cb=once2(cb),this.on("error",cb),this.on("end",function(matches){cb(null,matches)}));var self2=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(n===0)return done();for(var sync=!0,i2=0;i2<n;i2++)this._process(this.minimatch.set[i2],i2,!1,done);sync=!1;function done(){--self2._processing,self2._processing<=0&&(sync?process.nextTick(function(){self2._finish()}):self2._finish())}}Glob.prototype._finish=function(){if(assert2(this instanceof Glob),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();common.finish(this),this.emit("end",this.found)}};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var n=this.matches.length;if(n===0)return this._finish();for(var self2=this,i2=0;i2<this.matches.length;i2++)this._realpathSet(i2,next);function next(){--n===0&&self2._finish()}};Glob.prototype._realpathSet=function(index,cb){var matchset=this.matches[index];if(!matchset)return cb();var found=Object.keys(matchset),self2=this,n=found.length;if(n===0)return cb();var set=this.matches[index]=Object.create(null);found.forEach(function(p,i2){p=self2._makeAbs(p),rp.realpath(p,self2.realpathCache,function(er,real){er?er.syscall==="stat"?set[p]=!0:self2.emit("error",er):set[real]=!0,--n===0&&(self2.matches[index]=set,cb())})})};Glob.prototype._mark=function(p){return common.mark(this,p)};Glob.prototype._makeAbs=function(f3){return common.makeAbs(this,f3)};Glob.prototype.abort=function(){this.aborted=!0,this.emit("abort")};Glob.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};Glob.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var eq=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i2=0;i2<eq.length;i2++){var e2=eq[i2];this._emitMatch(e2[0],e2[1])}}if(this._processQueue.length){var pq=this._processQueue.slice(0);this._processQueue.length=0;for(var i2=0;i2<pq.length;i2++){var p=pq[i2];this._processing--,this._process(p[0],p[1],p[2],p[3])}}}};Glob.prototype._process=function(pattern,index,inGlobStar,cb){if(assert2(this instanceof Glob),assert2(typeof cb=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([pattern,index,inGlobStar,cb]);return}for(var n=0;typeof pattern[n]=="string";)n++;var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index,cb);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n),read;prefix===null?read=".":((isAbsolute3(prefix)||isAbsolute3(pattern.map(function(p){return typeof p=="string"?p:"[*]"}).join("/")))&&(!prefix||!isAbsolute3(prefix))&&(prefix="/"+prefix),read=prefix);var abs=this._makeAbs(read);if(childrenIgnored(this,read))return cb();var isGlobStar=remain[0]===minimatch.GLOBSTAR;isGlobStar?this._processGlobStar(prefix,read,abs,remain,index,inGlobStar,cb):this._processReaddir(prefix,read,abs,remain,index,inGlobStar,cb)}};Glob.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar,cb){var self2=this;this._readdir(abs,inGlobStar,function(er,entries2){return self2._processReaddir2(prefix,read,abs,remain,index,inGlobStar,entries2,cb)})};Glob.prototype._processReaddir2=function(prefix,read,abs,remain,index,inGlobStar,entries2,cb){if(!entries2)return cb();for(var pn=remain[0],negate=!!this.minimatch.negate,rawGlob=pn._glob,dotOk=this.dot||rawGlob.charAt(0)===".",matchedEntries=[],i2=0;i2<entries2.length;i2++){var e2=entries2[i2];if(e2.charAt(0)!=="."||dotOk){var m2;negate&&!prefix?m2=!e2.match(pn):m2=e2.match(pn),m2&&matchedEntries.push(e2)}}var len=matchedEntries.length;if(len===0)return cb();if(remain.length===1&&!this.mark&&!this.stat){this.matches[index]||(this.matches[index]=Object.create(null));for(var i2=0;i2<len;i2++){var e2=matchedEntries[i2];prefix&&(prefix!=="/"?e2=prefix+"/"+e2:e2=prefix+e2),e2.charAt(0)==="/"&&!this.nomount&&(e2=path13.join(this.root,e2)),this._emitMatch(index,e2)}return cb()}remain.shift();for(var i2=0;i2<len;i2++){var e2=matchedEntries[i2],newPattern;prefix&&(prefix!=="/"?e2=prefix+"/"+e2:e2=prefix+e2),this._process([e2].concat(remain),index,inGlobStar,cb)}cb()};Glob.prototype._emitMatch=function(index,e2){if(!this.aborted&&!isIgnored(this,e2)){if(this.paused){this._emitQueue.push([index,e2]);return}var abs=isAbsolute3(e2)?e2:this._makeAbs(e2);if(this.mark&&(e2=this._mark(e2)),this.absolute&&(e2=abs),!this.matches[index][e2]){if(this.nodir){var c=this.cache[abs];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e2]=!0;var st=this.statCache[abs];st&&this.emit("stat",e2,st),this.emit("match",e2)}}};Glob.prototype._readdirInGlobStar=function(abs,cb){if(this.aborted)return;if(this.follow)return this._readdir(abs,!1,cb);var lstatkey="lstat\0"+abs,self2=this,lstatcb=inflight(lstatkey,lstatcb_);lstatcb&&self2.fs.lstat(abs,lstatcb);function lstatcb_(er,lstat){if(er&&er.code==="ENOENT")return cb();var isSym=lstat&&lstat.isSymbolicLink();self2.symlinks[abs]=isSym,!isSym&&lstat&&!lstat.isDirectory()?(self2.cache[abs]="FILE",cb()):self2._readdir(abs,!1,cb)}};Glob.prototype._readdir=function(abs,inGlobStar,cb){if(!this.aborted&&(cb=inflight("readdir\0"+abs+"\0"+inGlobStar,cb),!!cb)){if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs,cb);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return cb();if(Array.isArray(c))return cb(null,c)}var self2=this;self2.fs.readdir(abs,readdirCb(this,abs,cb))}};function readdirCb(self2,abs,cb){return function(er,entries2){er?self2._readdirError(abs,er,cb):self2._readdirEntries(abs,entries2,cb)}}Glob.prototype._readdirEntries=function(abs,entries2,cb){if(!this.aborted){if(!this.mark&&!this.stat)for(var i2=0;i2<entries2.length;i2++){var e2=entries2[i2];abs==="/"?e2=abs+e2:e2=abs+"/"+e2,this.cache[e2]=!0}return this.cache[abs]=entries2,cb(null,entries2)}};Glob.prototype._readdirError=function(f3,er,cb){if(!this.aborted){switch(er.code){case"ENOTSUP":case"ENOTDIR":var abs=this._makeAbs(f3);if(this.cache[abs]="FILE",abs===this.cwdAbs){var error=new Error(er.code+" invalid cwd "+this.cwd);error.path=this.cwd,error.code=er.code,this.emit("error",error),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(f3)]=!1;break;default:this.cache[this._makeAbs(f3)]=!1,this.strict&&(this.emit("error",er),this.abort()),this.silent||console.error("glob error",er);break}return cb()}};Glob.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar,cb){var self2=this;this._readdir(abs,inGlobStar,function(er,entries2){self2._processGlobStar2(prefix,read,abs,remain,index,inGlobStar,entries2,cb)})};Glob.prototype._processGlobStar2=function(prefix,read,abs,remain,index,inGlobStar,entries2,cb){if(!entries2)return cb();var remainWithoutGlobStar=remain.slice(1),gspref=prefix?[prefix]:[],noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,!1,cb);var isSym=this.symlinks[abs],len=entries2.length;if(isSym&&inGlobStar)return cb();for(var i2=0;i2<len;i2++){var e2=entries2[i2];if(!(e2.charAt(0)==="."&&!this.dot)){var instead=gspref.concat(entries2[i2],remainWithoutGlobStar);this._process(instead,index,!0,cb);var below=gspref.concat(entries2[i2],remain);this._process(below,index,!0,cb)}}cb()};Glob.prototype._processSimple=function(prefix,index,cb){var self2=this;this._stat(prefix,function(er,exists){self2._processSimple2(prefix,index,er,exists,cb)})};Glob.prototype._processSimple2=function(prefix,index,er,exists,cb){if(this.matches[index]||(this.matches[index]=Object.create(null)),!exists)return cb();if(prefix&&isAbsolute3(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);prefix.charAt(0)==="/"?prefix=path13.join(this.root,prefix):(prefix=path13.resolve(this.root,prefix),trail&&(prefix+="/"))}process.platform==="win32"&&(prefix=prefix.replace(/\\/g,"/")),this._emitMatch(index,prefix),cb()};Glob.prototype._stat=function(f3,cb){var abs=this._makeAbs(f3),needDir=f3.slice(-1)==="/";if(f3.length>this.maxLength)return cb();if(!this.stat&&ownProp(this.cache,abs)){var c=this.cache[abs];if(Array.isArray(c)&&(c="DIR"),!needDir||c==="DIR")return cb(null,c);if(needDir&&c==="FILE")return cb()}var exists,stat2=this.statCache[abs];if(stat2!==void 0){if(stat2===!1)return cb(null,stat2);var type=stat2.isDirectory()?"DIR":"FILE";return needDir&&type==="FILE"?cb():cb(null,type,stat2)}var self2=this,statcb=inflight("stat\0"+abs,lstatcb_);statcb&&self2.fs.lstat(abs,statcb);function lstatcb_(er,lstat){if(lstat&&lstat.isSymbolicLink())return self2.fs.stat(abs,function(er2,stat3){er2?self2._stat2(f3,abs,null,lstat,cb):self2._stat2(f3,abs,er2,stat3,cb)});self2._stat2(f3,abs,er,lstat,cb)}};Glob.prototype._stat2=function(f3,abs,er,stat2,cb){if(er&&(er.code==="ENOENT"||er.code==="ENOTDIR"))return this.statCache[abs]=!1,cb();var needDir=f3.slice(-1)==="/";if(this.statCache[abs]=stat2,abs.slice(-1)==="/"&&stat2&&!stat2.isDirectory())return cb(null,!1,stat2);var c=!0;return stat2&&(c=stat2.isDirectory()?"DIR":"FILE"),this.cache[abs]=this.cache[abs]||c,needDir&&c==="FILE"?cb():cb(null,c,stat2)}}});var require_rimraf=__commonJS({"../../node_modules/rimraf/rimraf.js"(exports,module2){"use strict";var assert2=require("assert"),path13=require("path"),fs9=require("fs"),glob3;try{glob3=require_glob()}catch{}var defaultGlobOpts={nosort:!0,silent:!0},timeout=0,isWindows=process.platform==="win32",defaults2=options=>{if(["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(m2=>{options[m2]=options[m2]||fs9[m2],m2=m2+"Sync",options[m2]=options[m2]||fs9[m2]}),options.maxBusyTries=options.maxBusyTries||3,options.emfileWait=options.emfileWait||1e3,options.glob===!1&&(options.disableGlob=!0),options.disableGlob!==!0&&glob3===void 0)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");options.disableGlob=options.disableGlob||!1,options.glob=options.glob||defaultGlobOpts},rimraf=(p,options,cb)=>{typeof options=="function"&&(cb=options,options={}),assert2(p,"rimraf: missing path"),assert2.equal(typeof p,"string","rimraf: path should be a string"),assert2.equal(typeof cb,"function","rimraf: callback function required"),assert2(options,"rimraf: invalid options argument provided"),assert2.equal(typeof options,"object","rimraf: options should be object"),defaults2(options);let busyTries=0,errState=null,n=0,next=er=>{errState=errState||er,--n===0&&cb(errState)},afterGlob=(er,results)=>{if(er)return cb(er);if(n=results.length,n===0)return cb();results.forEach(p2=>{let CB=er2=>{if(er2){if((er2.code==="EBUSY"||er2.code==="ENOTEMPTY"||er2.code==="EPERM")&&busyTries<options.maxBusyTries)return busyTries++,setTimeout(()=>rimraf_(p2,options,CB),busyTries*100);if(er2.code==="EMFILE"&&timeout<options.emfileWait)return setTimeout(()=>rimraf_(p2,options,CB),timeout++);er2.code==="ENOENT"&&(er2=null)}timeout=0,next(er2)};rimraf_(p2,options,CB)})};if(options.disableGlob||!glob3.hasMagic(p))return afterGlob(null,[p]);options.lstat(p,(er,stat2)=>{if(!er)return afterGlob(null,[p]);glob3(p,options.glob,afterGlob)})},rimraf_=(p,options,cb)=>{assert2(p),assert2(options),assert2(typeof cb=="function"),options.lstat(p,(er,st)=>{if(er&&er.code==="ENOENT")return cb(null);if(er&&er.code==="EPERM"&&isWindows&&fixWinEPERM(p,options,er,cb),st&&st.isDirectory())return rmdir(p,options,er,cb);options.unlink(p,er2=>{if(er2){if(er2.code==="ENOENT")return cb(null);if(er2.code==="EPERM")return isWindows?fixWinEPERM(p,options,er2,cb):rmdir(p,options,er2,cb);if(er2.code==="EISDIR")return rmdir(p,options,er2,cb)}return cb(er2)})})},fixWinEPERM=(p,options,er,cb)=>{assert2(p),assert2(options),assert2(typeof cb=="function"),options.chmod(p,438,er2=>{er2?cb(er2.code==="ENOENT"?null:er):options.stat(p,(er3,stats)=>{er3?cb(er3.code==="ENOENT"?null:er):stats.isDirectory()?rmdir(p,options,er,cb):options.unlink(p,cb)})})},fixWinEPERMSync=(p,options,er)=>{assert2(p),assert2(options);try{options.chmodSync(p,438)}catch(er2){if(er2.code==="ENOENT")return;throw er}let stats;try{stats=options.statSync(p)}catch(er3){if(er3.code==="ENOENT")return;throw er}stats.isDirectory()?rmdirSync(p,options,er):options.unlinkSync(p)},rmdir=(p,options,originalEr,cb)=>{assert2(p),assert2(options),assert2(typeof cb=="function"),options.rmdir(p,er=>{er&&(er.code==="ENOTEMPTY"||er.code==="EEXIST"||er.code==="EPERM")?rmkids(p,options,cb):er&&er.code==="ENOTDIR"?cb(originalEr):cb(er)})},rmkids=(p,options,cb)=>{assert2(p),assert2(options),assert2(typeof cb=="function"),options.readdir(p,(er,files)=>{if(er)return cb(er);let n=files.length;if(n===0)return options.rmdir(p,cb);let errState;files.forEach(f3=>{rimraf(path13.join(p,f3),options,er2=>{if(!errState){if(er2)return cb(errState=er2);--n===0&&options.rmdir(p,cb)}})})})},rimrafSync=(p,options)=>{options=options||{},defaults2(options),assert2(p,"rimraf: missing path"),assert2.equal(typeof p,"string","rimraf: path should be a string"),assert2(options,"rimraf: missing options"),assert2.equal(typeof options,"object","rimraf: options should be object");let results;if(options.disableGlob||!glob3.hasMagic(p))results=[p];else try{options.lstatSync(p),results=[p]}catch{results=glob3.sync(p,options.glob)}if(results.length)for(let i2=0;i2<results.length;i2++){let p2=results[i2],st;try{st=options.lstatSync(p2)}catch(er){if(er.code==="ENOENT")return;er.code==="EPERM"&&isWindows&&fixWinEPERMSync(p2,options,er)}try{st&&st.isDirectory()?rmdirSync(p2,options,null):options.unlinkSync(p2)}catch(er){if(er.code==="ENOENT")return;if(er.code==="EPERM")return isWindows?fixWinEPERMSync(p2,options,er):rmdirSync(p2,options,er);if(er.code!=="EISDIR")throw er;rmdirSync(p2,options,er)}}},rmdirSync=(p,options,originalEr)=>{assert2(p),assert2(options);try{options.rmdirSync(p)}catch(er){if(er.code==="ENOENT")return;if(er.code==="ENOTDIR")throw originalEr;(er.code==="ENOTEMPTY"||er.code==="EEXIST"||er.code==="EPERM")&&rmkidsSync(p,options)}},rmkidsSync=(p,options)=>{assert2(p),assert2(options),options.readdirSync(p).forEach(f3=>rimrafSync(path13.join(p,f3),options));let retries=isWindows?100:1,i2=0;do{let threw=!0;try{let ret=options.rmdirSync(p,options);return threw=!1,ret}finally{if(++i2<retries&&threw)continue}}while(!0)};module2.exports=rimraf;rimraf.sync=rimrafSync}});var require_indent_string=__commonJS({"../../node_modules/indent-string/index.js"(exports,module2){"use strict";module2.exports=(string,count=1,options)=>{if(options={indent:" ",includeEmptyLines:!1,...options},typeof string!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof string}\``);if(typeof count!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``);if(typeof options.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``);if(count===0)return string;let regex=options.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return string.replace(regex,options.indent.repeat(count))}}});var require_clean_stack=__commonJS({"../../node_modules/clean-stack/index.js"(exports,module2){"use strict";var os2=require("os"),extractPathRegex=/\s+at.*(?:\(|\s)(.*)\)?/,pathRegex=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,homeDir=typeof os2.homedir>"u"?"":os2.homedir();module2.exports=(stack,options)=>(options=Object.assign({pretty:!1},options),stack.replace(/\\/g,"/").split(`
28
+ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof GlobSync))return new GlobSync(pattern,options);if(setopts(this,pattern,options),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var i2=0;i2<n;i2++)this._process(this.minimatch.set[i2],i2,!1);this._finish()}GlobSync.prototype._finish=function(){if(assert2.ok(this instanceof GlobSync),this.realpath){var self2=this;this.matches.forEach(function(matchset,index){var set=self2.matches[index]=Object.create(null);for(var p in matchset)try{p=self2._makeAbs(p);var real=rp.realpathSync(p,self2.realpathCache);set[real]=!0}catch(er){if(er.syscall==="stat")set[self2._makeAbs(p)]=!0;else throw er}})}common.finish(this)};GlobSync.prototype._process=function(pattern,index,inGlobStar){assert2.ok(this instanceof GlobSync);for(var n=0;typeof pattern[n]=="string";)n++;var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n),read;prefix===null?read=".":((isAbsolute3(prefix)||isAbsolute3(pattern.map(function(p){return typeof p=="string"?p:"[*]"}).join("/")))&&(!prefix||!isAbsolute3(prefix))&&(prefix="/"+prefix),read=prefix);var abs=this._makeAbs(read);if(!childrenIgnored(this,read)){var isGlobStar=remain[0]===minimatch.GLOBSTAR;isGlobStar?this._processGlobStar(prefix,read,abs,remain,index,inGlobStar):this._processReaddir(prefix,read,abs,remain,index,inGlobStar)}};GlobSync.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar){var entries2=this._readdir(abs,inGlobStar);if(entries2){for(var pn=remain[0],negate=!!this.minimatch.negate,rawGlob=pn._glob,dotOk=this.dot||rawGlob.charAt(0)===".",matchedEntries=[],i2=0;i2<entries2.length;i2++){var e2=entries2[i2];if(e2.charAt(0)!=="."||dotOk){var m2;negate&&!prefix?m2=!e2.match(pn):m2=e2.match(pn),m2&&matchedEntries.push(e2)}}var len=matchedEntries.length;if(len!==0){if(remain.length===1&&!this.mark&&!this.stat){this.matches[index]||(this.matches[index]=Object.create(null));for(var i2=0;i2<len;i2++){var e2=matchedEntries[i2];prefix&&(prefix.slice(-1)!=="/"?e2=prefix+"/"+e2:e2=prefix+e2),e2.charAt(0)==="/"&&!this.nomount&&(e2=path13.join(this.root,e2)),this._emitMatch(index,e2)}return}remain.shift();for(var i2=0;i2<len;i2++){var e2=matchedEntries[i2],newPattern;prefix?newPattern=[prefix,e2]:newPattern=[e2],this._process(newPattern.concat(remain),index,inGlobStar)}}}};GlobSync.prototype._emitMatch=function(index,e2){if(!isIgnored(this,e2)){var abs=this._makeAbs(e2);if(this.mark&&(e2=this._mark(e2)),this.absolute&&(e2=abs),!this.matches[index][e2]){if(this.nodir){var c=this.cache[abs];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e2]=!0,this.stat&&this._stat(e2)}}};GlobSync.prototype._readdirInGlobStar=function(abs){if(this.follow)return this._readdir(abs,!1);var entries2,lstat,stat2;try{lstat=this.fs.lstatSync(abs)}catch(er){if(er.code==="ENOENT")return null}var isSym=lstat&&lstat.isSymbolicLink();return this.symlinks[abs]=isSym,!isSym&&lstat&&!lstat.isDirectory()?this.cache[abs]="FILE":entries2=this._readdir(abs,!1),entries2};GlobSync.prototype._readdir=function(abs,inGlobStar){var entries2;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return null;if(Array.isArray(c))return c}try{return this._readdirEntries(abs,this.fs.readdirSync(abs))}catch(er){return this._readdirError(abs,er),null}};GlobSync.prototype._readdirEntries=function(abs,entries2){if(!this.mark&&!this.stat)for(var i2=0;i2<entries2.length;i2++){var e2=entries2[i2];abs==="/"?e2=abs+e2:e2=abs+"/"+e2,this.cache[e2]=!0}return this.cache[abs]=entries2,entries2};GlobSync.prototype._readdirError=function(f3,er){switch(er.code){case"ENOTSUP":case"ENOTDIR":var abs=this._makeAbs(f3);if(this.cache[abs]="FILE",abs===this.cwdAbs){var error=new Error(er.code+" invalid cwd "+this.cwd);throw error.path=this.cwd,error.code=er.code,error}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(f3)]=!1;break;default:if(this.cache[this._makeAbs(f3)]=!1,this.strict)throw er;this.silent||console.error("glob error",er);break}};GlobSync.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar){var entries2=this._readdir(abs,inGlobStar);if(entries2){var remainWithoutGlobStar=remain.slice(1),gspref=prefix?[prefix]:[],noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,!1);var len=entries2.length,isSym=this.symlinks[abs];if(!(isSym&&inGlobStar))for(var i2=0;i2<len;i2++){var e2=entries2[i2];if(!(e2.charAt(0)==="."&&!this.dot)){var instead=gspref.concat(entries2[i2],remainWithoutGlobStar);this._process(instead,index,!0);var below=gspref.concat(entries2[i2],remain);this._process(below,index,!0)}}}};GlobSync.prototype._processSimple=function(prefix,index){var exists=this._stat(prefix);if(this.matches[index]||(this.matches[index]=Object.create(null)),!!exists){if(prefix&&isAbsolute3(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);prefix.charAt(0)==="/"?prefix=path13.join(this.root,prefix):(prefix=path13.resolve(this.root,prefix),trail&&(prefix+="/"))}process.platform==="win32"&&(prefix=prefix.replace(/\\/g,"/")),this._emitMatch(index,prefix)}};GlobSync.prototype._stat=function(f3){var abs=this._makeAbs(f3),needDir=f3.slice(-1)==="/";if(f3.length>this.maxLength)return!1;if(!this.stat&&ownProp(this.cache,abs)){var c=this.cache[abs];if(Array.isArray(c)&&(c="DIR"),!needDir||c==="DIR")return c;if(needDir&&c==="FILE")return!1}var exists,stat2=this.statCache[abs];if(!stat2){var lstat;try{lstat=this.fs.lstatSync(abs)}catch(er){if(er&&(er.code==="ENOENT"||er.code==="ENOTDIR"))return this.statCache[abs]=!1,!1}if(lstat&&lstat.isSymbolicLink())try{stat2=this.fs.statSync(abs)}catch{stat2=lstat}else stat2=lstat}this.statCache[abs]=stat2;var c=!0;return stat2&&(c=stat2.isDirectory()?"DIR":"FILE"),this.cache[abs]=this.cache[abs]||c,needDir&&c==="FILE"?!1:c};GlobSync.prototype._mark=function(p){return common.mark(this,p)};GlobSync.prototype._makeAbs=function(f3){return common.makeAbs(this,f3)}}});var require_wrappy=__commonJS({"../../node_modules/wrappy/wrappy.js"(exports,module2){"use strict";module2.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!="function")throw new TypeError("need wrapper function");return Object.keys(fn).forEach(function(k){wrapper[k]=fn[k]}),wrapper;function wrapper(){for(var args=new Array(arguments.length),i2=0;i2<args.length;i2++)args[i2]=arguments[i2];var ret=fn.apply(this,args),cb2=args[args.length-1];return typeof ret=="function"&&ret!==cb2&&Object.keys(cb2).forEach(function(k){ret[k]=cb2[k]}),ret}}}});var require_once=__commonJS({"../../node_modules/once/once.js"(exports,module2){"use strict";var wrappy=require_wrappy();module2.exports=wrappy(once2);module2.exports.strict=wrappy(onceStrict);once2.proto=once2(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once2(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:!0})});function once2(fn){var f3=function(){return f3.called?f3.value:(f3.called=!0,f3.value=fn.apply(this,arguments))};return f3.called=!1,f3}function onceStrict(fn){var f3=function(){if(f3.called)throw new Error(f3.onceError);return f3.called=!0,f3.value=fn.apply(this,arguments)},name=fn.name||"Function wrapped with `once`";return f3.onceError=name+" shouldn't be called more than once",f3.called=!1,f3}}});var require_inflight=__commonJS({"../../node_modules/inflight/inflight.js"(exports,module2){"use strict";var wrappy=require_wrappy(),reqs=Object.create(null),once2=require_once();module2.exports=wrappy(inflight);function inflight(key,cb){return reqs[key]?(reqs[key].push(cb),null):(reqs[key]=[cb],makeres(key))}function makeres(key){return once2(function RES(){var cbs=reqs[key],len=cbs.length,args=slice(arguments);try{for(var i2=0;i2<len;i2++)cbs[i2].apply(null,args)}finally{cbs.length>len?(cbs.splice(0,len),process.nextTick(function(){RES.apply(null,args)})):delete reqs[key]}})}function slice(args){for(var length=args.length,array=[],i2=0;i2<length;i2++)array[i2]=args[i2];return array}}});var require_glob=__commonJS({"../../node_modules/rimraf/node_modules/glob/glob.js"(exports,module2){"use strict";module2.exports=glob3;var rp=require_fs(),minimatch=require_minimatch(),Minimatch=minimatch.Minimatch,inherits=require_inherits(),EE=require("events").EventEmitter,path13=require("path"),assert2=require("assert"),isAbsolute3=require_path_is_absolute(),globSync=require_sync(),common=require_common(),setopts=common.setopts,ownProp=common.ownProp,inflight=require_inflight(),util=require("util"),childrenIgnored=common.childrenIgnored,isIgnored=common.isIgnored,once2=require_once();function glob3(pattern,options,cb){if(typeof options=="function"&&(cb=options,options={}),options||(options={}),options.sync){if(cb)throw new TypeError("callback provided to sync glob");return globSync(pattern,options)}return new Glob(pattern,options,cb)}glob3.sync=globSync;var GlobSync=glob3.GlobSync=globSync.GlobSync;glob3.glob=glob3;function extend(origin,add){if(add===null||typeof add!="object")return origin;for(var keys=Object.keys(add),i2=keys.length;i2--;)origin[keys[i2]]=add[keys[i2]];return origin}glob3.hasMagic=function(pattern,options_){var options=extend({},options_);options.noprocess=!0;var g=new Glob(pattern,options),set=g.minimatch.set;if(!pattern)return!1;if(set.length>1)return!0;for(var j=0;j<set[0].length;j++)if(typeof set[0][j]!="string")return!0;return!1};glob3.Glob=Glob;inherits(Glob,EE);function Glob(pattern,options,cb){if(typeof options=="function"&&(cb=options,options=null),options&&options.sync){if(cb)throw new TypeError("callback provided to sync glob");return new GlobSync(pattern,options)}if(!(this instanceof Glob))return new Glob(pattern,options,cb);setopts(this,pattern,options),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),typeof cb=="function"&&(cb=once2(cb),this.on("error",cb),this.on("end",function(matches){cb(null,matches)}));var self2=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(n===0)return done();for(var sync=!0,i2=0;i2<n;i2++)this._process(this.minimatch.set[i2],i2,!1,done);sync=!1;function done(){--self2._processing,self2._processing<=0&&(sync?process.nextTick(function(){self2._finish()}):self2._finish())}}Glob.prototype._finish=function(){if(assert2(this instanceof Glob),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();common.finish(this),this.emit("end",this.found)}};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var n=this.matches.length;if(n===0)return this._finish();for(var self2=this,i2=0;i2<this.matches.length;i2++)this._realpathSet(i2,next);function next(){--n===0&&self2._finish()}};Glob.prototype._realpathSet=function(index,cb){var matchset=this.matches[index];if(!matchset)return cb();var found=Object.keys(matchset),self2=this,n=found.length;if(n===0)return cb();var set=this.matches[index]=Object.create(null);found.forEach(function(p,i2){p=self2._makeAbs(p),rp.realpath(p,self2.realpathCache,function(er,real){er?er.syscall==="stat"?set[p]=!0:self2.emit("error",er):set[real]=!0,--n===0&&(self2.matches[index]=set,cb())})})};Glob.prototype._mark=function(p){return common.mark(this,p)};Glob.prototype._makeAbs=function(f3){return common.makeAbs(this,f3)};Glob.prototype.abort=function(){this.aborted=!0,this.emit("abort")};Glob.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};Glob.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var eq=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i2=0;i2<eq.length;i2++){var e2=eq[i2];this._emitMatch(e2[0],e2[1])}}if(this._processQueue.length){var pq=this._processQueue.slice(0);this._processQueue.length=0;for(var i2=0;i2<pq.length;i2++){var p=pq[i2];this._processing--,this._process(p[0],p[1],p[2],p[3])}}}};Glob.prototype._process=function(pattern,index,inGlobStar,cb){if(assert2(this instanceof Glob),assert2(typeof cb=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([pattern,index,inGlobStar,cb]);return}for(var n=0;typeof pattern[n]=="string";)n++;var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index,cb);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n),read;prefix===null?read=".":((isAbsolute3(prefix)||isAbsolute3(pattern.map(function(p){return typeof p=="string"?p:"[*]"}).join("/")))&&(!prefix||!isAbsolute3(prefix))&&(prefix="/"+prefix),read=prefix);var abs=this._makeAbs(read);if(childrenIgnored(this,read))return cb();var isGlobStar=remain[0]===minimatch.GLOBSTAR;isGlobStar?this._processGlobStar(prefix,read,abs,remain,index,inGlobStar,cb):this._processReaddir(prefix,read,abs,remain,index,inGlobStar,cb)}};Glob.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar,cb){var self2=this;this._readdir(abs,inGlobStar,function(er,entries2){return self2._processReaddir2(prefix,read,abs,remain,index,inGlobStar,entries2,cb)})};Glob.prototype._processReaddir2=function(prefix,read,abs,remain,index,inGlobStar,entries2,cb){if(!entries2)return cb();for(var pn=remain[0],negate=!!this.minimatch.negate,rawGlob=pn._glob,dotOk=this.dot||rawGlob.charAt(0)===".",matchedEntries=[],i2=0;i2<entries2.length;i2++){var e2=entries2[i2];if(e2.charAt(0)!=="."||dotOk){var m2;negate&&!prefix?m2=!e2.match(pn):m2=e2.match(pn),m2&&matchedEntries.push(e2)}}var len=matchedEntries.length;if(len===0)return cb();if(remain.length===1&&!this.mark&&!this.stat){this.matches[index]||(this.matches[index]=Object.create(null));for(var i2=0;i2<len;i2++){var e2=matchedEntries[i2];prefix&&(prefix!=="/"?e2=prefix+"/"+e2:e2=prefix+e2),e2.charAt(0)==="/"&&!this.nomount&&(e2=path13.join(this.root,e2)),this._emitMatch(index,e2)}return cb()}remain.shift();for(var i2=0;i2<len;i2++){var e2=matchedEntries[i2],newPattern;prefix&&(prefix!=="/"?e2=prefix+"/"+e2:e2=prefix+e2),this._process([e2].concat(remain),index,inGlobStar,cb)}cb()};Glob.prototype._emitMatch=function(index,e2){if(!this.aborted&&!isIgnored(this,e2)){if(this.paused){this._emitQueue.push([index,e2]);return}var abs=isAbsolute3(e2)?e2:this._makeAbs(e2);if(this.mark&&(e2=this._mark(e2)),this.absolute&&(e2=abs),!this.matches[index][e2]){if(this.nodir){var c=this.cache[abs];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e2]=!0;var st=this.statCache[abs];st&&this.emit("stat",e2,st),this.emit("match",e2)}}};Glob.prototype._readdirInGlobStar=function(abs,cb){if(this.aborted)return;if(this.follow)return this._readdir(abs,!1,cb);var lstatkey="lstat\0"+abs,self2=this,lstatcb=inflight(lstatkey,lstatcb_);lstatcb&&self2.fs.lstat(abs,lstatcb);function lstatcb_(er,lstat){if(er&&er.code==="ENOENT")return cb();var isSym=lstat&&lstat.isSymbolicLink();self2.symlinks[abs]=isSym,!isSym&&lstat&&!lstat.isDirectory()?(self2.cache[abs]="FILE",cb()):self2._readdir(abs,!1,cb)}};Glob.prototype._readdir=function(abs,inGlobStar,cb){if(!this.aborted&&(cb=inflight("readdir\0"+abs+"\0"+inGlobStar,cb),!!cb)){if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs,cb);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return cb();if(Array.isArray(c))return cb(null,c)}var self2=this;self2.fs.readdir(abs,readdirCb(this,abs,cb))}};function readdirCb(self2,abs,cb){return function(er,entries2){er?self2._readdirError(abs,er,cb):self2._readdirEntries(abs,entries2,cb)}}Glob.prototype._readdirEntries=function(abs,entries2,cb){if(!this.aborted){if(!this.mark&&!this.stat)for(var i2=0;i2<entries2.length;i2++){var e2=entries2[i2];abs==="/"?e2=abs+e2:e2=abs+"/"+e2,this.cache[e2]=!0}return this.cache[abs]=entries2,cb(null,entries2)}};Glob.prototype._readdirError=function(f3,er,cb){if(!this.aborted){switch(er.code){case"ENOTSUP":case"ENOTDIR":var abs=this._makeAbs(f3);if(this.cache[abs]="FILE",abs===this.cwdAbs){var error=new Error(er.code+" invalid cwd "+this.cwd);error.path=this.cwd,error.code=er.code,this.emit("error",error),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(f3)]=!1;break;default:this.cache[this._makeAbs(f3)]=!1,this.strict&&(this.emit("error",er),this.abort()),this.silent||console.error("glob error",er);break}return cb()}};Glob.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar,cb){var self2=this;this._readdir(abs,inGlobStar,function(er,entries2){self2._processGlobStar2(prefix,read,abs,remain,index,inGlobStar,entries2,cb)})};Glob.prototype._processGlobStar2=function(prefix,read,abs,remain,index,inGlobStar,entries2,cb){if(!entries2)return cb();var remainWithoutGlobStar=remain.slice(1),gspref=prefix?[prefix]:[],noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,!1,cb);var isSym=this.symlinks[abs],len=entries2.length;if(isSym&&inGlobStar)return cb();for(var i2=0;i2<len;i2++){var e2=entries2[i2];if(!(e2.charAt(0)==="."&&!this.dot)){var instead=gspref.concat(entries2[i2],remainWithoutGlobStar);this._process(instead,index,!0,cb);var below=gspref.concat(entries2[i2],remain);this._process(below,index,!0,cb)}}cb()};Glob.prototype._processSimple=function(prefix,index,cb){var self2=this;this._stat(prefix,function(er,exists){self2._processSimple2(prefix,index,er,exists,cb)})};Glob.prototype._processSimple2=function(prefix,index,er,exists,cb){if(this.matches[index]||(this.matches[index]=Object.create(null)),!exists)return cb();if(prefix&&isAbsolute3(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);prefix.charAt(0)==="/"?prefix=path13.join(this.root,prefix):(prefix=path13.resolve(this.root,prefix),trail&&(prefix+="/"))}process.platform==="win32"&&(prefix=prefix.replace(/\\/g,"/")),this._emitMatch(index,prefix),cb()};Glob.prototype._stat=function(f3,cb){var abs=this._makeAbs(f3),needDir=f3.slice(-1)==="/";if(f3.length>this.maxLength)return cb();if(!this.stat&&ownProp(this.cache,abs)){var c=this.cache[abs];if(Array.isArray(c)&&(c="DIR"),!needDir||c==="DIR")return cb(null,c);if(needDir&&c==="FILE")return cb()}var exists,stat2=this.statCache[abs];if(stat2!==void 0){if(stat2===!1)return cb(null,stat2);var type=stat2.isDirectory()?"DIR":"FILE";return needDir&&type==="FILE"?cb():cb(null,type,stat2)}var self2=this,statcb=inflight("stat\0"+abs,lstatcb_);statcb&&self2.fs.lstat(abs,statcb);function lstatcb_(er,lstat){if(lstat&&lstat.isSymbolicLink())return self2.fs.stat(abs,function(er2,stat3){er2?self2._stat2(f3,abs,null,lstat,cb):self2._stat2(f3,abs,er2,stat3,cb)});self2._stat2(f3,abs,er,lstat,cb)}};Glob.prototype._stat2=function(f3,abs,er,stat2,cb){if(er&&(er.code==="ENOENT"||er.code==="ENOTDIR"))return this.statCache[abs]=!1,cb();var needDir=f3.slice(-1)==="/";if(this.statCache[abs]=stat2,abs.slice(-1)==="/"&&stat2&&!stat2.isDirectory())return cb(null,!1,stat2);var c=!0;return stat2&&(c=stat2.isDirectory()?"DIR":"FILE"),this.cache[abs]=this.cache[abs]||c,needDir&&c==="FILE"?cb():cb(null,c,stat2)}}});var require_rimraf=__commonJS({"../../node_modules/rimraf/rimraf.js"(exports,module2){"use strict";var assert2=require("assert"),path13=require("path"),fs9=require("fs"),glob3;try{glob3=require_glob()}catch{}var defaultGlobOpts={nosort:!0,silent:!0},timeout=0,isWindows=process.platform==="win32",defaults2=options=>{if(["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(m2=>{options[m2]=options[m2]||fs9[m2],m2=m2+"Sync",options[m2]=options[m2]||fs9[m2]}),options.maxBusyTries=options.maxBusyTries||3,options.emfileWait=options.emfileWait||1e3,options.glob===!1&&(options.disableGlob=!0),options.disableGlob!==!0&&glob3===void 0)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");options.disableGlob=options.disableGlob||!1,options.glob=options.glob||defaultGlobOpts},rimraf=(p,options,cb)=>{typeof options=="function"&&(cb=options,options={}),assert2(p,"rimraf: missing path"),assert2.equal(typeof p,"string","rimraf: path should be a string"),assert2.equal(typeof cb,"function","rimraf: callback function required"),assert2(options,"rimraf: invalid options argument provided"),assert2.equal(typeof options,"object","rimraf: options should be object"),defaults2(options);let busyTries=0,errState=null,n=0,next=er=>{errState=errState||er,--n===0&&cb(errState)},afterGlob=(er,results)=>{if(er)return cb(er);if(n=results.length,n===0)return cb();results.forEach(p2=>{let CB=er2=>{if(er2){if((er2.code==="EBUSY"||er2.code==="ENOTEMPTY"||er2.code==="EPERM")&&busyTries<options.maxBusyTries)return busyTries++,setTimeout(()=>rimraf_(p2,options,CB),busyTries*100);if(er2.code==="EMFILE"&&timeout<options.emfileWait)return setTimeout(()=>rimraf_(p2,options,CB),timeout++);er2.code==="ENOENT"&&(er2=null)}timeout=0,next(er2)};rimraf_(p2,options,CB)})};if(options.disableGlob||!glob3.hasMagic(p))return afterGlob(null,[p]);options.lstat(p,(er,stat2)=>{if(!er)return afterGlob(null,[p]);glob3(p,options.glob,afterGlob)})},rimraf_=(p,options,cb)=>{assert2(p),assert2(options),assert2(typeof cb=="function"),options.lstat(p,(er,st)=>{if(er&&er.code==="ENOENT")return cb(null);if(er&&er.code==="EPERM"&&isWindows&&fixWinEPERM(p,options,er,cb),st&&st.isDirectory())return rmdir(p,options,er,cb);options.unlink(p,er2=>{if(er2){if(er2.code==="ENOENT")return cb(null);if(er2.code==="EPERM")return isWindows?fixWinEPERM(p,options,er2,cb):rmdir(p,options,er2,cb);if(er2.code==="EISDIR")return rmdir(p,options,er2,cb)}return cb(er2)})})},fixWinEPERM=(p,options,er,cb)=>{assert2(p),assert2(options),assert2(typeof cb=="function"),options.chmod(p,438,er2=>{er2?cb(er2.code==="ENOENT"?null:er):options.stat(p,(er3,stats)=>{er3?cb(er3.code==="ENOENT"?null:er):stats.isDirectory()?rmdir(p,options,er,cb):options.unlink(p,cb)})})},fixWinEPERMSync=(p,options,er)=>{assert2(p),assert2(options);try{options.chmodSync(p,438)}catch(er2){if(er2.code==="ENOENT")return;throw er}let stats;try{stats=options.statSync(p)}catch(er3){if(er3.code==="ENOENT")return;throw er}stats.isDirectory()?rmdirSync(p,options,er):options.unlinkSync(p)},rmdir=(p,options,originalEr,cb)=>{assert2(p),assert2(options),assert2(typeof cb=="function"),options.rmdir(p,er=>{er&&(er.code==="ENOTEMPTY"||er.code==="EEXIST"||er.code==="EPERM")?rmkids(p,options,cb):er&&er.code==="ENOTDIR"?cb(originalEr):cb(er)})},rmkids=(p,options,cb)=>{assert2(p),assert2(options),assert2(typeof cb=="function"),options.readdir(p,(er,files)=>{if(er)return cb(er);let n=files.length;if(n===0)return options.rmdir(p,cb);let errState;files.forEach(f3=>{rimraf(path13.join(p,f3),options,er2=>{if(!errState){if(er2)return cb(errState=er2);--n===0&&options.rmdir(p,cb)}})})})},rimrafSync=(p,options)=>{options=options||{},defaults2(options),assert2(p,"rimraf: missing path"),assert2.equal(typeof p,"string","rimraf: path should be a string"),assert2(options,"rimraf: missing options"),assert2.equal(typeof options,"object","rimraf: options should be object");let results;if(options.disableGlob||!glob3.hasMagic(p))results=[p];else try{options.lstatSync(p),results=[p]}catch{results=glob3.sync(p,options.glob)}if(results.length)for(let i2=0;i2<results.length;i2++){let p2=results[i2],st;try{st=options.lstatSync(p2)}catch(er){if(er.code==="ENOENT")return;er.code==="EPERM"&&isWindows&&fixWinEPERMSync(p2,options,er)}try{st&&st.isDirectory()?rmdirSync(p2,options,null):options.unlinkSync(p2)}catch(er){if(er.code==="ENOENT")return;if(er.code==="EPERM")return isWindows?fixWinEPERMSync(p2,options,er):rmdirSync(p2,options,er);if(er.code!=="EISDIR")throw er;rmdirSync(p2,options,er)}}},rmdirSync=(p,options,originalEr)=>{assert2(p),assert2(options);try{options.rmdirSync(p)}catch(er){if(er.code==="ENOENT")return;if(er.code==="ENOTDIR")throw originalEr;(er.code==="ENOTEMPTY"||er.code==="EEXIST"||er.code==="EPERM")&&rmkidsSync(p,options)}},rmkidsSync=(p,options)=>{assert2(p),assert2(options),options.readdirSync(p).forEach(f3=>rimrafSync(path13.join(p,f3),options));let retries=isWindows?100:1,i2=0;do{let threw=!0;try{let ret=options.rmdirSync(p,options);return threw=!1,ret}finally{if(++i2<retries&&threw)continue}}while(!0)};module2.exports=rimraf;rimraf.sync=rimrafSync}});var require_indent_string=__commonJS({"../../node_modules/indent-string/index.js"(exports,module2){"use strict";module2.exports=(string,count=1,options)=>{if(options={indent:" ",includeEmptyLines:!1,...options},typeof string!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof string}\``);if(typeof count!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``);if(typeof options.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``);if(count===0)return string;let regex=options.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return string.replace(regex,options.indent.repeat(count))}}});var require_clean_stack=__commonJS({"../../node_modules/clean-stack/index.js"(exports,module2){"use strict";var os3=require("os"),extractPathRegex=/\s+at.*(?:\(|\s)(.*)\)?/,pathRegex=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,homeDir=typeof os3.homedir>"u"?"":os3.homedir();module2.exports=(stack,options)=>(options=Object.assign({pretty:!1},options),stack.replace(/\\/g,"/").split(`
29
29
  `).filter(line=>{let pathMatches=line.match(extractPathRegex);if(pathMatches===null||!pathMatches[1])return!0;let match=pathMatches[1];return match.includes(".app/Contents/Resources/electron.asar")||match.includes(".app/Contents/Resources/default_app.asar")?!1:!pathRegex.test(match)}).filter(line=>line.trim()!=="").map(line=>options.pretty?line.replace(extractPathRegex,(m2,p1)=>m2.replace(p1,p1.replace(homeDir,"~"))):line).join(`
30
30
  `))}});var require_aggregate_error=__commonJS({"../../node_modules/aggregate-error/index.js"(exports,module2){"use strict";var indentString=require_indent_string(),cleanStack=require_clean_stack(),cleanInternalStack=stack=>stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),AggregateError=class extends Error{constructor(errors){if(!Array.isArray(errors))throw new TypeError(`Expected input to be an Array, got ${typeof errors}`);errors=[...errors].map(error=>error instanceof Error?error:error!==null&&typeof error=="object"?Object.assign(new Error(error.message),error):new Error(error));let message=errors.map(error=>typeof error.stack=="string"?cleanInternalStack(cleanStack(error.stack)):String(error)).join(`
31
31
  `);message=`
@@ -33,12 +33,12 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof GlobS
33
33
  `:`
34
34
  `.charCodeAt(),CR2=typeof input=="string"?"\r":"\r".charCodeAt();return input[input.length-1]===LF2&&(input=input.slice(0,input.length-1)),input[input.length-1]===CR2&&(input=input.slice(0,input.length-1)),input}}});var require_npm_run_path=__commonJS({"../../node_modules/npm-run-path/index.js"(exports,module2){"use strict";var path13=require("path"),pathKey=require_path_key(),npmRunPath=options=>{options={cwd:process.cwd(),path:process.env[pathKey()],execPath:process.execPath,...options};let previous,cwdPath=path13.resolve(options.cwd),result=[];for(;previous!==cwdPath;)result.push(path13.join(cwdPath,"node_modules/.bin")),previous=cwdPath,cwdPath=path13.resolve(cwdPath,"..");let execPathDir=path13.resolve(options.cwd,options.execPath,"..");return result.push(execPathDir),result.concat(options.path).join(path13.delimiter)};module2.exports=npmRunPath;module2.exports.default=npmRunPath;module2.exports.env=options=>{options={env:process.env,...options};let env={...options.env},path14=pathKey({env});return options.path=env[path14],env[path14]=module2.exports(options),env}}});var require_mimic_fn=__commonJS({"../../node_modules/mimic-fn/index.js"(exports,module2){"use strict";var mimicFn=(to,from)=>{for(let prop of Reflect.ownKeys(from))Object.defineProperty(to,prop,Object.getOwnPropertyDescriptor(from,prop));return to};module2.exports=mimicFn;module2.exports.default=mimicFn}});var require_onetime=__commonJS({"../../node_modules/onetime/index.js"(exports,module2){"use strict";var mimicFn=require_mimic_fn(),calledFunctions=new WeakMap,onetime=(function_,options={})=>{if(typeof function_!="function")throw new TypeError("Expected a function");let returnValue,callCount=0,functionName=function_.displayName||function_.name||"<anonymous>",onetime2=function(...arguments_){if(calledFunctions.set(onetime2,++callCount),callCount===1)returnValue=function_.apply(this,arguments_),function_=null;else if(options.throw===!0)throw new Error(`Function \`${functionName}\` can only be called once`);return returnValue};return mimicFn(onetime2,function_),calledFunctions.set(onetime2,callCount),onetime2};module2.exports=onetime;module2.exports.default=onetime;module2.exports.callCount=function_=>{if(!calledFunctions.has(function_))throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);return calledFunctions.get(function_)}}});var require_core=__commonJS({"../../node_modules/execa/node_modules/human-signals/build/src/core.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.SIGNALS=void 0;var SIGNALS=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];exports.SIGNALS=SIGNALS}});var require_realtime=__commonJS({"../../node_modules/execa/node_modules/human-signals/build/src/realtime.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.SIGRTMAX=exports.getRealtimeSignals=void 0;var getRealtimeSignals=function(){let length=SIGRTMAX-SIGRTMIN+1;return Array.from({length},getRealtimeSignal)};exports.getRealtimeSignals=getRealtimeSignals;var getRealtimeSignal=function(value,index){return{name:`SIGRT${index+1}`,number:SIGRTMIN+index,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},SIGRTMIN=34,SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX}});var require_signals=__commonJS({"../../node_modules/execa/node_modules/human-signals/build/src/signals.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.getSignals=void 0;var _os=require("os"),_core=require_core(),_realtime=require_realtime(),getSignals=function(){let realtimeSignals=(0,_realtime.getRealtimeSignals)();return[..._core.SIGNALS,...realtimeSignals].map(normalizeSignal)};exports.getSignals=getSignals;var normalizeSignal=function({name,number:defaultNumber,description,action,forced=!1,standard}){let{signals:{[name]:constantSignal}}=_os.constants,supported=constantSignal!==void 0;return{name,number:supported?constantSignal:defaultNumber,description,supported,action,forced,standard}}}});var require_main=__commonJS({"../../node_modules/execa/node_modules/human-signals/build/src/main.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.signalsByNumber=exports.signalsByName=void 0;var _os=require("os"),_signals=require_signals(),_realtime=require_realtime(),getSignalsByName=function(){return(0,_signals.getSignals)().reduce(getSignalByName,{})},getSignalByName=function(signalByNameMemo,{name,number,description,supported,action,forced,standard}){return{...signalByNameMemo,[name]:{name,number,description,supported,action,forced,standard}}},signalsByName=getSignalsByName();exports.signalsByName=signalsByName;var getSignalsByNumber=function(){let signals=(0,_signals.getSignals)(),length=_realtime.SIGRTMAX+1,signalsA=Array.from({length},(value,number)=>getSignalByNumber(number,signals));return Object.assign({},...signalsA)},getSignalByNumber=function(number,signals){let signal=findSignalByNumber(number,signals);if(signal===void 0)return{};let{name,description,supported,action,forced,standard}=signal;return{[number]:{name,number,description,supported,action,forced,standard}}},findSignalByNumber=function(number,signals){let signal=signals.find(({name})=>_os.constants.signals[name]===number);return signal!==void 0?signal:signals.find(signalA=>signalA.number===number)},signalsByNumber=getSignalsByNumber();exports.signalsByNumber=signalsByNumber}});var require_error=__commonJS({"../../node_modules/execa/lib/error.js"(exports,module2){"use strict";var{signalsByName}=require_main(),getErrorPrefix=({timedOut:timedOut2,timeout,errorCode,signal,signalDescription,exitCode,isCanceled})=>timedOut2?`timed out after ${timeout} milliseconds`:isCanceled?"was canceled":errorCode!==void 0?`failed with ${errorCode}`:signal!==void 0?`was killed with ${signal} (${signalDescription})`:exitCode!==void 0?`failed with exit code ${exitCode}`:"failed",makeError=({stdout,stderr,all:all2,error,signal,exitCode,command,escapedCommand,timedOut:timedOut2,isCanceled,killed,parsed:{options:{timeout}}})=>{exitCode=exitCode===null?void 0:exitCode,signal=signal===null?void 0:signal;let signalDescription=signal===void 0?void 0:signalsByName[signal].description,errorCode=error&&error.code,execaMessage=`Command ${getErrorPrefix({timedOut:timedOut2,timeout,errorCode,signal,signalDescription,exitCode,isCanceled})}: ${command}`,isError=Object.prototype.toString.call(error)==="[object Error]",shortMessage=isError?`${execaMessage}
35
35
  ${error.message}`:execaMessage,message=[shortMessage,stderr,stdout].filter(Boolean).join(`
36
- `);return isError?(error.originalMessage=error.message,error.message=message):error=new Error(message),error.shortMessage=shortMessage,error.command=command,error.escapedCommand=escapedCommand,error.exitCode=exitCode,error.signal=signal,error.signalDescription=signalDescription,error.stdout=stdout,error.stderr=stderr,all2!==void 0&&(error.all=all2),"bufferedData"in error&&delete error.bufferedData,error.failed=!0,error.timedOut=!!timedOut2,error.isCanceled=isCanceled,error.killed=killed&&!timedOut2,error};module2.exports=makeError}});var require_stdio=__commonJS({"../../node_modules/execa/lib/stdio.js"(exports,module2){"use strict";var aliases2=["stdin","stdout","stderr"],hasAlias=options=>aliases2.some(alias=>options[alias]!==void 0),normalizeStdio=options=>{if(!options)return;let{stdio}=options;if(stdio===void 0)return aliases2.map(alias=>options[alias]);if(hasAlias(options))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases2.map(alias=>`\`${alias}\``).join(", ")}`);if(typeof stdio=="string")return stdio;if(!Array.isArray(stdio))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);let length=Math.max(stdio.length,aliases2.length);return Array.from({length},(value,index)=>stdio[index])};module2.exports=normalizeStdio;module2.exports.node=options=>{let stdio=normalizeStdio(options);return stdio==="ipc"?"ipc":stdio===void 0||typeof stdio=="string"?[stdio,stdio,stdio,"ipc"]:stdio.includes("ipc")?stdio:[...stdio,"ipc"]}}});var require_signals2=__commonJS({"../../node_modules/signal-exit/signals.js"(exports,module2){"use strict";module2.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&module2.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&module2.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}});var require_signal_exit=__commonJS({"../../node_modules/signal-exit/index.js"(exports,module2){"use strict";var process4=global.process,processOk=function(process5){return process5&&typeof process5=="object"&&typeof process5.removeListener=="function"&&typeof process5.emit=="function"&&typeof process5.reallyExit=="function"&&typeof process5.listeners=="function"&&typeof process5.kill=="function"&&typeof process5.pid=="number"&&typeof process5.on=="function"};processOk(process4)?(assert2=require("assert"),signals=require_signals2(),isWin=/^win/i.test(process4.platform),EE=require("events"),typeof EE!="function"&&(EE=EE.EventEmitter),process4.__signal_exit_emitter__?emitter=process4.__signal_exit_emitter__:(emitter=process4.__signal_exit_emitter__=new EE,emitter.count=0,emitter.emitted={}),emitter.infinite||(emitter.setMaxListeners(1/0),emitter.infinite=!0),module2.exports=function(cb,opts){if(!processOk(global.process))return function(){};assert2.equal(typeof cb,"function","a callback must be provided for exit handler"),loaded===!1&&load();var ev="exit";opts&&opts.alwaysLast&&(ev="afterexit");var remove2=function(){emitter.removeListener(ev,cb),emitter.listeners("exit").length===0&&emitter.listeners("afterexit").length===0&&unload()};return emitter.on(ev,cb),remove2},unload=function(){!loaded||!processOk(global.process)||(loaded=!1,signals.forEach(function(sig){try{process4.removeListener(sig,sigListeners[sig])}catch{}}),process4.emit=originalProcessEmit,process4.reallyExit=originalProcessReallyExit,emitter.count-=1)},module2.exports.unload=unload,emit=function(event,code,signal){emitter.emitted[event]||(emitter.emitted[event]=!0,emitter.emit(event,code,signal))},sigListeners={},signals.forEach(function(sig){sigListeners[sig]=function(){if(processOk(global.process)){var listeners=process4.listeners(sig);listeners.length===emitter.count&&(unload(),emit("exit",null,sig),emit("afterexit",null,sig),isWin&&sig==="SIGHUP"&&(sig="SIGINT"),process4.kill(process4.pid,sig))}}}),module2.exports.signals=function(){return signals},loaded=!1,load=function(){loaded||!processOk(global.process)||(loaded=!0,emitter.count+=1,signals=signals.filter(function(sig){try{return process4.on(sig,sigListeners[sig]),!0}catch{return!1}}),process4.emit=processEmit,process4.reallyExit=processReallyExit)},module2.exports.load=load,originalProcessReallyExit=process4.reallyExit,processReallyExit=function(code){processOk(global.process)&&(process4.exitCode=code||0,emit("exit",process4.exitCode,null),emit("afterexit",process4.exitCode,null),originalProcessReallyExit.call(process4,process4.exitCode))},originalProcessEmit=process4.emit,processEmit=function(ev,arg){if(ev==="exit"&&processOk(global.process)){arg!==void 0&&(process4.exitCode=arg);var ret=originalProcessEmit.apply(this,arguments);return emit("exit",process4.exitCode,null),emit("afterexit",process4.exitCode,null),ret}else return originalProcessEmit.apply(this,arguments)}):module2.exports=function(){return function(){}};var assert2,signals,isWin,EE,emitter,unload,emit,sigListeners,loaded,load,originalProcessReallyExit,processReallyExit,originalProcessEmit,processEmit}});var require_kill=__commonJS({"../../node_modules/execa/lib/kill.js"(exports,module2){"use strict";var os2=require("os"),onExit=require_signal_exit(),DEFAULT_FORCE_KILL_TIMEOUT=1e3*5,spawnedKill=(kill,signal="SIGTERM",options={})=>{let killResult=kill(signal);return setKillTimeout(kill,signal,options,killResult),killResult},setKillTimeout=(kill,signal,options,killResult)=>{if(!shouldForceKill(signal,options,killResult))return;let timeout=getForceKillAfterTimeout(options),t2=setTimeout(()=>{kill("SIGKILL")},timeout);t2.unref&&t2.unref()},shouldForceKill=(signal,{forceKillAfterTimeout},killResult)=>isSigterm(signal)&&forceKillAfterTimeout!==!1&&killResult,isSigterm=signal=>signal===os2.constants.signals.SIGTERM||typeof signal=="string"&&signal.toUpperCase()==="SIGTERM",getForceKillAfterTimeout=({forceKillAfterTimeout=!0})=>{if(forceKillAfterTimeout===!0)return DEFAULT_FORCE_KILL_TIMEOUT;if(!Number.isFinite(forceKillAfterTimeout)||forceKillAfterTimeout<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);return forceKillAfterTimeout},spawnedCancel=(spawned,context)=>{spawned.kill()&&(context.isCanceled=!0)},timeoutKill=(spawned,signal,reject)=>{spawned.kill(signal),reject(Object.assign(new Error("Timed out"),{timedOut:!0,signal}))},setupTimeout=(spawned,{timeout,killSignal="SIGTERM"},spawnedPromise)=>{if(timeout===0||timeout===void 0)return spawnedPromise;let timeoutId,timeoutPromise=new Promise((resolve3,reject)=>{timeoutId=setTimeout(()=>{timeoutKill(spawned,killSignal,reject)},timeout)}),safeSpawnedPromise=spawnedPromise.finally(()=>{clearTimeout(timeoutId)});return Promise.race([timeoutPromise,safeSpawnedPromise])},validateTimeout=({timeout})=>{if(timeout!==void 0&&(!Number.isFinite(timeout)||timeout<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`)},setExitHandler=async(spawned,{cleanup,detached},timedPromise)=>{if(!cleanup||detached)return timedPromise;let removeExitHandler=onExit(()=>{spawned.kill()});return timedPromise.finally(()=>{removeExitHandler()})};module2.exports={spawnedKill,spawnedCancel,setupTimeout,validateTimeout,setExitHandler}}});var require_buffer_stream=__commonJS({"../../node_modules/execa/node_modules/get-stream/buffer-stream.js"(exports,module2){"use strict";var{PassThrough:PassThroughStream2}=require("stream");module2.exports=options=>{options={...options};let{array}=options,{encoding}=options,isBuffer=encoding==="buffer",objectMode=!1;array?objectMode=!(encoding||isBuffer):encoding=encoding||"utf8",isBuffer&&(encoding=null);let stream2=new PassThroughStream2({objectMode});encoding&&stream2.setEncoding(encoding);let length=0,chunks=[];return stream2.on("data",chunk=>{chunks.push(chunk),objectMode?length=chunks.length:length+=chunk.length}),stream2.getBufferedValue=()=>array?chunks:isBuffer?Buffer.concat(chunks,length):chunks.join(""),stream2.getBufferedLength=()=>length,stream2}}});var require_get_stream=__commonJS({"../../node_modules/execa/node_modules/get-stream/index.js"(exports,module2){"use strict";var{constants:BufferConstants}=require("buffer"),stream2=require("stream"),{promisify:promisify4}=require("util"),bufferStream=require_buffer_stream(),streamPipelinePromisified=promisify4(stream2.pipeline),MaxBufferError=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function getStream(inputStream,options){if(!inputStream)throw new Error("Expected a stream");options={maxBuffer:1/0,...options};let{maxBuffer}=options,stream3=bufferStream(options);return await new Promise((resolve3,reject)=>{let rejectPromise=error=>{error&&stream3.getBufferedLength()<=BufferConstants.MAX_LENGTH&&(error.bufferedData=stream3.getBufferedValue()),reject(error)};(async()=>{try{await streamPipelinePromisified(inputStream,stream3),resolve3()}catch(error){rejectPromise(error)}})(),stream3.on("data",()=>{stream3.getBufferedLength()>maxBuffer&&rejectPromise(new MaxBufferError)})}),stream3.getBufferedValue()}module2.exports=getStream;module2.exports.buffer=(stream3,options)=>getStream(stream3,{...options,encoding:"buffer"});module2.exports.array=(stream3,options)=>getStream(stream3,{...options,array:!0});module2.exports.MaxBufferError=MaxBufferError}});var require_merge_stream=__commonJS({"../../node_modules/merge-stream/index.js"(exports,module2){"use strict";var{PassThrough:PassThrough3}=require("stream");module2.exports=function(){var sources=[],output=new PassThrough3({objectMode:!0});return output.setMaxListeners(0),output.add=add,output.isEmpty=isEmpty,output.on("unpipe",remove2),Array.prototype.slice.call(arguments).forEach(add),output;function add(source){return Array.isArray(source)?(source.forEach(add),this):(sources.push(source),source.once("end",remove2.bind(null,source)),source.once("error",output.emit.bind(output,"error")),source.pipe(output,{end:!1}),this)}function isEmpty(){return sources.length==0}function remove2(source){sources=sources.filter(function(it){return it!==source}),!sources.length&&output.readable&&output.end()}}}});var require_stream=__commonJS({"../../node_modules/execa/lib/stream.js"(exports,module2){"use strict";var isStream=require_is_stream(),getStream=require_get_stream(),mergeStream=require_merge_stream(),handleInput=(spawned,input)=>{input===void 0||spawned.stdin===void 0||(isStream(input)?input.pipe(spawned.stdin):spawned.stdin.end(input))},makeAllStream=(spawned,{all:all2})=>{if(!all2||!spawned.stdout&&!spawned.stderr)return;let mixed=mergeStream();return spawned.stdout&&mixed.add(spawned.stdout),spawned.stderr&&mixed.add(spawned.stderr),mixed},getBufferedData=async(stream2,streamPromise)=>{if(stream2){stream2.destroy();try{return await streamPromise}catch(error){return error.bufferedData}}},getStreamPromise=(stream2,{encoding,buffer,maxBuffer})=>{if(!(!stream2||!buffer))return encoding?getStream(stream2,{encoding,maxBuffer}):getStream.buffer(stream2,{maxBuffer})},getSpawnedResult=async({stdout,stderr,all:all2},{encoding,buffer,maxBuffer},processDone)=>{let stdoutPromise=getStreamPromise(stdout,{encoding,buffer,maxBuffer}),stderrPromise=getStreamPromise(stderr,{encoding,buffer,maxBuffer}),allPromise=getStreamPromise(all2,{encoding,buffer,maxBuffer:maxBuffer*2});try{return await Promise.all([processDone,stdoutPromise,stderrPromise,allPromise])}catch(error){return Promise.all([{error,signal:error.signal,timedOut:error.timedOut},getBufferedData(stdout,stdoutPromise),getBufferedData(stderr,stderrPromise),getBufferedData(all2,allPromise)])}},validateInputSync=({input})=>{if(isStream(input))throw new TypeError("The `input` option cannot be a stream in sync mode")};module2.exports={handleInput,makeAllStream,getSpawnedResult,validateInputSync}}});var require_promise=__commonJS({"../../node_modules/execa/lib/promise.js"(exports,module2){"use strict";var nativePromisePrototype=(async()=>{})().constructor.prototype,descriptors=["then","catch","finally"].map(property=>[property,Reflect.getOwnPropertyDescriptor(nativePromisePrototype,property)]),mergePromise=(spawned,promise)=>{for(let[property,descriptor]of descriptors){let value=typeof promise=="function"?(...args)=>Reflect.apply(descriptor.value,promise(),args):descriptor.value.bind(promise);Reflect.defineProperty(spawned,property,{...descriptor,value})}return spawned},getSpawnedPromise=spawned=>new Promise((resolve3,reject)=>{spawned.on("exit",(exitCode,signal)=>{resolve3({exitCode,signal})}),spawned.on("error",error=>{reject(error)}),spawned.stdin&&spawned.stdin.on("error",error=>{reject(error)})});module2.exports={mergePromise,getSpawnedPromise}}});var require_command=__commonJS({"../../node_modules/execa/lib/command.js"(exports,module2){"use strict";var normalizeArgs=(file,args=[])=>Array.isArray(args)?[file,...args]:[file],NO_ESCAPE_REGEXP=/^[\w.-]+$/,DOUBLE_QUOTES_REGEXP=/"/g,escapeArg=arg=>typeof arg!="string"||NO_ESCAPE_REGEXP.test(arg)?arg:`"${arg.replace(DOUBLE_QUOTES_REGEXP,'\\"')}"`,joinCommand=(file,args)=>normalizeArgs(file,args).join(" "),getEscapedCommand=(file,args)=>normalizeArgs(file,args).map(arg=>escapeArg(arg)).join(" "),SPACES_REGEXP=/ +/g,parseCommand=command=>{let tokens=[];for(let token of command.trim().split(SPACES_REGEXP)){let previousToken=tokens[tokens.length-1];previousToken&&previousToken.endsWith("\\")?tokens[tokens.length-1]=`${previousToken.slice(0,-1)} ${token}`:tokens.push(token)}return tokens};module2.exports={joinCommand,getEscapedCommand,parseCommand}}});var require_execa=__commonJS({"../../node_modules/execa/index.js"(exports,module2){"use strict";var path13=require("path"),childProcess=require("child_process"),crossSpawn=require_cross_spawn(),stripFinalNewline=require_strip_final_newline(),npmRunPath=require_npm_run_path(),onetime=require_onetime(),makeError=require_error(),normalizeStdio=require_stdio(),{spawnedKill,spawnedCancel,setupTimeout,validateTimeout,setExitHandler}=require_kill(),{handleInput,getSpawnedResult,makeAllStream,validateInputSync}=require_stream(),{mergePromise,getSpawnedPromise}=require_promise(),{joinCommand,parseCommand,getEscapedCommand}=require_command(),DEFAULT_MAX_BUFFER=1e3*1e3*100,getEnv=({env:envOption,extendEnv,preferLocal,localDir,execPath})=>{let env=extendEnv?{...process.env,...envOption}:envOption;return preferLocal?npmRunPath.env({env,cwd:localDir,execPath}):env},handleArguments=(file,args,options={})=>{let parsed=crossSpawn._parse(file,args,options);return file=parsed.command,args=parsed.args,options=parsed.options,options={maxBuffer:DEFAULT_MAX_BUFFER,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:options.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...options},options.env=getEnv(options),options.stdio=normalizeStdio(options),process.platform==="win32"&&path13.basename(file,".exe")==="cmd"&&args.unshift("/q"),{file,args,options,parsed}},handleOutput=(options,value,error)=>typeof value!="string"&&!Buffer.isBuffer(value)?error===void 0?void 0:"":options.stripFinalNewline?stripFinalNewline(value):value,execa=(file,args,options)=>{let parsed=handleArguments(file,args,options),command=joinCommand(file,args),escapedCommand=getEscapedCommand(file,args);validateTimeout(parsed.options);let spawned;try{spawned=childProcess.spawn(parsed.file,parsed.args,parsed.options)}catch(error){let dummySpawned=new childProcess.ChildProcess,errorPromise=Promise.reject(makeError({error,stdout:"",stderr:"",all:"",command,escapedCommand,parsed,timedOut:!1,isCanceled:!1,killed:!1}));return mergePromise(dummySpawned,errorPromise)}let spawnedPromise=getSpawnedPromise(spawned),timedPromise=setupTimeout(spawned,parsed.options,spawnedPromise),processDone=setExitHandler(spawned,parsed.options,timedPromise),context={isCanceled:!1};spawned.kill=spawnedKill.bind(null,spawned.kill.bind(spawned)),spawned.cancel=spawnedCancel.bind(null,spawned,context);let handlePromiseOnce=onetime(async()=>{let[{error,exitCode,signal,timedOut:timedOut2},stdoutResult,stderrResult,allResult]=await getSpawnedResult(spawned,parsed.options,processDone),stdout=handleOutput(parsed.options,stdoutResult),stderr=handleOutput(parsed.options,stderrResult),all2=handleOutput(parsed.options,allResult);if(error||exitCode!==0||signal!==null){let returnedError=makeError({error,exitCode,signal,stdout,stderr,all:all2,command,escapedCommand,parsed,timedOut:timedOut2,isCanceled:context.isCanceled,killed:spawned.killed});if(!parsed.options.reject)return returnedError;throw returnedError}return{command,escapedCommand,exitCode:0,stdout,stderr,all:all2,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return handleInput(spawned,parsed.options.input),spawned.all=makeAllStream(spawned,parsed.options),mergePromise(spawned,handlePromiseOnce)};module2.exports=execa;module2.exports.sync=(file,args,options)=>{let parsed=handleArguments(file,args,options),command=joinCommand(file,args),escapedCommand=getEscapedCommand(file,args);validateInputSync(parsed.options);let result;try{result=childProcess.spawnSync(parsed.file,parsed.args,parsed.options)}catch(error){throw makeError({error,stdout:"",stderr:"",all:"",command,escapedCommand,parsed,timedOut:!1,isCanceled:!1,killed:!1})}let stdout=handleOutput(parsed.options,result.stdout,result.error),stderr=handleOutput(parsed.options,result.stderr,result.error);if(result.error||result.status!==0||result.signal!==null){let error=makeError({stdout,stderr,error:result.error,signal:result.signal,exitCode:result.status,command,escapedCommand,parsed,timedOut:result.error&&result.error.code==="ETIMEDOUT",isCanceled:!1,killed:result.signal!==null});if(!parsed.options.reject)return error;throw error}return{command,escapedCommand,exitCode:0,stdout,stderr,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};module2.exports.command=(command,options)=>{let[file,...args]=parseCommand(command);return execa(file,args,options)};module2.exports.commandSync=(command,options)=>{let[file,...args]=parseCommand(command);return execa.sync(file,args,options)};module2.exports.node=(scriptPath,args,options={})=>{args&&!Array.isArray(args)&&typeof args=="object"&&(options=args,args=[]);let stdio=normalizeStdio.node(options),defaultExecArgv=process.execArgv.filter(arg=>!arg.startsWith("--inspect")),{nodePath=process.execPath,nodeOptions=defaultExecArgv}=options;return execa(nodePath,[...nodeOptions,scriptPath,...Array.isArray(args)?args:[]],{...options,stdin:void 0,stdout:void 0,stderr:void 0,stdio,shell:!1})}}});var require_strip_json_comments=__commonJS({"../../node_modules/strip-json-comments/index.js"(exports,module2){"use strict";var singleComment=Symbol("singleComment"),multiComment=Symbol("multiComment"),stripWithoutWhitespace=()=>"",stripWithWhitespace=(string,start,end)=>string.slice(start,end).replace(/\S/g," "),isEscaped=(jsonString,quotePosition)=>{let index=quotePosition-1,backslashCount=0;for(;jsonString[index]==="\\";)index-=1,backslashCount+=1;return!!(backslashCount%2)};module2.exports=(jsonString,options={})=>{if(typeof jsonString!="string")throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``);let strip=options.whitespace===!1?stripWithoutWhitespace:stripWithWhitespace,insideString=!1,insideComment=!1,offset=0,result="";for(let i2=0;i2<jsonString.length;i2++){let currentCharacter=jsonString[i2],nextCharacter=jsonString[i2+1];if(!insideComment&&currentCharacter==='"'&&(isEscaped(jsonString,i2)||(insideString=!insideString)),!insideString){if(!insideComment&&currentCharacter+nextCharacter==="//")result+=jsonString.slice(offset,i2),offset=i2,insideComment=singleComment,i2++;else if(insideComment===singleComment&&currentCharacter+nextCharacter===`\r
36
+ `);return isError?(error.originalMessage=error.message,error.message=message):error=new Error(message),error.shortMessage=shortMessage,error.command=command,error.escapedCommand=escapedCommand,error.exitCode=exitCode,error.signal=signal,error.signalDescription=signalDescription,error.stdout=stdout,error.stderr=stderr,all2!==void 0&&(error.all=all2),"bufferedData"in error&&delete error.bufferedData,error.failed=!0,error.timedOut=!!timedOut2,error.isCanceled=isCanceled,error.killed=killed&&!timedOut2,error};module2.exports=makeError}});var require_stdio=__commonJS({"../../node_modules/execa/lib/stdio.js"(exports,module2){"use strict";var aliases2=["stdin","stdout","stderr"],hasAlias=options=>aliases2.some(alias=>options[alias]!==void 0),normalizeStdio=options=>{if(!options)return;let{stdio}=options;if(stdio===void 0)return aliases2.map(alias=>options[alias]);if(hasAlias(options))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases2.map(alias=>`\`${alias}\``).join(", ")}`);if(typeof stdio=="string")return stdio;if(!Array.isArray(stdio))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);let length=Math.max(stdio.length,aliases2.length);return Array.from({length},(value,index)=>stdio[index])};module2.exports=normalizeStdio;module2.exports.node=options=>{let stdio=normalizeStdio(options);return stdio==="ipc"?"ipc":stdio===void 0||typeof stdio=="string"?[stdio,stdio,stdio,"ipc"]:stdio.includes("ipc")?stdio:[...stdio,"ipc"]}}});var require_signals2=__commonJS({"../../node_modules/signal-exit/signals.js"(exports,module2){"use strict";module2.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&module2.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&module2.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}});var require_signal_exit=__commonJS({"../../node_modules/signal-exit/index.js"(exports,module2){"use strict";var process4=global.process,processOk=function(process5){return process5&&typeof process5=="object"&&typeof process5.removeListener=="function"&&typeof process5.emit=="function"&&typeof process5.reallyExit=="function"&&typeof process5.listeners=="function"&&typeof process5.kill=="function"&&typeof process5.pid=="number"&&typeof process5.on=="function"};processOk(process4)?(assert2=require("assert"),signals=require_signals2(),isWin=/^win/i.test(process4.platform),EE=require("events"),typeof EE!="function"&&(EE=EE.EventEmitter),process4.__signal_exit_emitter__?emitter=process4.__signal_exit_emitter__:(emitter=process4.__signal_exit_emitter__=new EE,emitter.count=0,emitter.emitted={}),emitter.infinite||(emitter.setMaxListeners(1/0),emitter.infinite=!0),module2.exports=function(cb,opts){if(!processOk(global.process))return function(){};assert2.equal(typeof cb,"function","a callback must be provided for exit handler"),loaded===!1&&load();var ev="exit";opts&&opts.alwaysLast&&(ev="afterexit");var remove2=function(){emitter.removeListener(ev,cb),emitter.listeners("exit").length===0&&emitter.listeners("afterexit").length===0&&unload()};return emitter.on(ev,cb),remove2},unload=function(){!loaded||!processOk(global.process)||(loaded=!1,signals.forEach(function(sig){try{process4.removeListener(sig,sigListeners[sig])}catch{}}),process4.emit=originalProcessEmit,process4.reallyExit=originalProcessReallyExit,emitter.count-=1)},module2.exports.unload=unload,emit=function(event,code,signal){emitter.emitted[event]||(emitter.emitted[event]=!0,emitter.emit(event,code,signal))},sigListeners={},signals.forEach(function(sig){sigListeners[sig]=function(){if(processOk(global.process)){var listeners=process4.listeners(sig);listeners.length===emitter.count&&(unload(),emit("exit",null,sig),emit("afterexit",null,sig),isWin&&sig==="SIGHUP"&&(sig="SIGINT"),process4.kill(process4.pid,sig))}}}),module2.exports.signals=function(){return signals},loaded=!1,load=function(){loaded||!processOk(global.process)||(loaded=!0,emitter.count+=1,signals=signals.filter(function(sig){try{return process4.on(sig,sigListeners[sig]),!0}catch{return!1}}),process4.emit=processEmit,process4.reallyExit=processReallyExit)},module2.exports.load=load,originalProcessReallyExit=process4.reallyExit,processReallyExit=function(code){processOk(global.process)&&(process4.exitCode=code||0,emit("exit",process4.exitCode,null),emit("afterexit",process4.exitCode,null),originalProcessReallyExit.call(process4,process4.exitCode))},originalProcessEmit=process4.emit,processEmit=function(ev,arg){if(ev==="exit"&&processOk(global.process)){arg!==void 0&&(process4.exitCode=arg);var ret=originalProcessEmit.apply(this,arguments);return emit("exit",process4.exitCode,null),emit("afterexit",process4.exitCode,null),ret}else return originalProcessEmit.apply(this,arguments)}):module2.exports=function(){return function(){}};var assert2,signals,isWin,EE,emitter,unload,emit,sigListeners,loaded,load,originalProcessReallyExit,processReallyExit,originalProcessEmit,processEmit}});var require_kill=__commonJS({"../../node_modules/execa/lib/kill.js"(exports,module2){"use strict";var os3=require("os"),onExit=require_signal_exit(),DEFAULT_FORCE_KILL_TIMEOUT=1e3*5,spawnedKill=(kill,signal="SIGTERM",options={})=>{let killResult=kill(signal);return setKillTimeout(kill,signal,options,killResult),killResult},setKillTimeout=(kill,signal,options,killResult)=>{if(!shouldForceKill(signal,options,killResult))return;let timeout=getForceKillAfterTimeout(options),t2=setTimeout(()=>{kill("SIGKILL")},timeout);t2.unref&&t2.unref()},shouldForceKill=(signal,{forceKillAfterTimeout},killResult)=>isSigterm(signal)&&forceKillAfterTimeout!==!1&&killResult,isSigterm=signal=>signal===os3.constants.signals.SIGTERM||typeof signal=="string"&&signal.toUpperCase()==="SIGTERM",getForceKillAfterTimeout=({forceKillAfterTimeout=!0})=>{if(forceKillAfterTimeout===!0)return DEFAULT_FORCE_KILL_TIMEOUT;if(!Number.isFinite(forceKillAfterTimeout)||forceKillAfterTimeout<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);return forceKillAfterTimeout},spawnedCancel=(spawned,context)=>{spawned.kill()&&(context.isCanceled=!0)},timeoutKill=(spawned,signal,reject)=>{spawned.kill(signal),reject(Object.assign(new Error("Timed out"),{timedOut:!0,signal}))},setupTimeout=(spawned,{timeout,killSignal="SIGTERM"},spawnedPromise)=>{if(timeout===0||timeout===void 0)return spawnedPromise;let timeoutId,timeoutPromise=new Promise((resolve3,reject)=>{timeoutId=setTimeout(()=>{timeoutKill(spawned,killSignal,reject)},timeout)}),safeSpawnedPromise=spawnedPromise.finally(()=>{clearTimeout(timeoutId)});return Promise.race([timeoutPromise,safeSpawnedPromise])},validateTimeout=({timeout})=>{if(timeout!==void 0&&(!Number.isFinite(timeout)||timeout<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`)},setExitHandler=async(spawned,{cleanup,detached},timedPromise)=>{if(!cleanup||detached)return timedPromise;let removeExitHandler=onExit(()=>{spawned.kill()});return timedPromise.finally(()=>{removeExitHandler()})};module2.exports={spawnedKill,spawnedCancel,setupTimeout,validateTimeout,setExitHandler}}});var require_buffer_stream=__commonJS({"../../node_modules/execa/node_modules/get-stream/buffer-stream.js"(exports,module2){"use strict";var{PassThrough:PassThroughStream2}=require("stream");module2.exports=options=>{options={...options};let{array}=options,{encoding}=options,isBuffer=encoding==="buffer",objectMode=!1;array?objectMode=!(encoding||isBuffer):encoding=encoding||"utf8",isBuffer&&(encoding=null);let stream2=new PassThroughStream2({objectMode});encoding&&stream2.setEncoding(encoding);let length=0,chunks=[];return stream2.on("data",chunk=>{chunks.push(chunk),objectMode?length=chunks.length:length+=chunk.length}),stream2.getBufferedValue=()=>array?chunks:isBuffer?Buffer.concat(chunks,length):chunks.join(""),stream2.getBufferedLength=()=>length,stream2}}});var require_get_stream=__commonJS({"../../node_modules/execa/node_modules/get-stream/index.js"(exports,module2){"use strict";var{constants:BufferConstants}=require("buffer"),stream2=require("stream"),{promisify:promisify4}=require("util"),bufferStream=require_buffer_stream(),streamPipelinePromisified=promisify4(stream2.pipeline),MaxBufferError=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function getStream(inputStream,options){if(!inputStream)throw new Error("Expected a stream");options={maxBuffer:1/0,...options};let{maxBuffer}=options,stream3=bufferStream(options);return await new Promise((resolve3,reject)=>{let rejectPromise=error=>{error&&stream3.getBufferedLength()<=BufferConstants.MAX_LENGTH&&(error.bufferedData=stream3.getBufferedValue()),reject(error)};(async()=>{try{await streamPipelinePromisified(inputStream,stream3),resolve3()}catch(error){rejectPromise(error)}})(),stream3.on("data",()=>{stream3.getBufferedLength()>maxBuffer&&rejectPromise(new MaxBufferError)})}),stream3.getBufferedValue()}module2.exports=getStream;module2.exports.buffer=(stream3,options)=>getStream(stream3,{...options,encoding:"buffer"});module2.exports.array=(stream3,options)=>getStream(stream3,{...options,array:!0});module2.exports.MaxBufferError=MaxBufferError}});var require_merge_stream=__commonJS({"../../node_modules/merge-stream/index.js"(exports,module2){"use strict";var{PassThrough:PassThrough3}=require("stream");module2.exports=function(){var sources=[],output=new PassThrough3({objectMode:!0});return output.setMaxListeners(0),output.add=add,output.isEmpty=isEmpty,output.on("unpipe",remove2),Array.prototype.slice.call(arguments).forEach(add),output;function add(source){return Array.isArray(source)?(source.forEach(add),this):(sources.push(source),source.once("end",remove2.bind(null,source)),source.once("error",output.emit.bind(output,"error")),source.pipe(output,{end:!1}),this)}function isEmpty(){return sources.length==0}function remove2(source){sources=sources.filter(function(it){return it!==source}),!sources.length&&output.readable&&output.end()}}}});var require_stream=__commonJS({"../../node_modules/execa/lib/stream.js"(exports,module2){"use strict";var isStream=require_is_stream(),getStream=require_get_stream(),mergeStream=require_merge_stream(),handleInput=(spawned,input)=>{input===void 0||spawned.stdin===void 0||(isStream(input)?input.pipe(spawned.stdin):spawned.stdin.end(input))},makeAllStream=(spawned,{all:all2})=>{if(!all2||!spawned.stdout&&!spawned.stderr)return;let mixed=mergeStream();return spawned.stdout&&mixed.add(spawned.stdout),spawned.stderr&&mixed.add(spawned.stderr),mixed},getBufferedData=async(stream2,streamPromise)=>{if(stream2){stream2.destroy();try{return await streamPromise}catch(error){return error.bufferedData}}},getStreamPromise=(stream2,{encoding,buffer,maxBuffer})=>{if(!(!stream2||!buffer))return encoding?getStream(stream2,{encoding,maxBuffer}):getStream.buffer(stream2,{maxBuffer})},getSpawnedResult=async({stdout,stderr,all:all2},{encoding,buffer,maxBuffer},processDone)=>{let stdoutPromise=getStreamPromise(stdout,{encoding,buffer,maxBuffer}),stderrPromise=getStreamPromise(stderr,{encoding,buffer,maxBuffer}),allPromise=getStreamPromise(all2,{encoding,buffer,maxBuffer:maxBuffer*2});try{return await Promise.all([processDone,stdoutPromise,stderrPromise,allPromise])}catch(error){return Promise.all([{error,signal:error.signal,timedOut:error.timedOut},getBufferedData(stdout,stdoutPromise),getBufferedData(stderr,stderrPromise),getBufferedData(all2,allPromise)])}},validateInputSync=({input})=>{if(isStream(input))throw new TypeError("The `input` option cannot be a stream in sync mode")};module2.exports={handleInput,makeAllStream,getSpawnedResult,validateInputSync}}});var require_promise=__commonJS({"../../node_modules/execa/lib/promise.js"(exports,module2){"use strict";var nativePromisePrototype=(async()=>{})().constructor.prototype,descriptors=["then","catch","finally"].map(property=>[property,Reflect.getOwnPropertyDescriptor(nativePromisePrototype,property)]),mergePromise=(spawned,promise)=>{for(let[property,descriptor]of descriptors){let value=typeof promise=="function"?(...args)=>Reflect.apply(descriptor.value,promise(),args):descriptor.value.bind(promise);Reflect.defineProperty(spawned,property,{...descriptor,value})}return spawned},getSpawnedPromise=spawned=>new Promise((resolve3,reject)=>{spawned.on("exit",(exitCode,signal)=>{resolve3({exitCode,signal})}),spawned.on("error",error=>{reject(error)}),spawned.stdin&&spawned.stdin.on("error",error=>{reject(error)})});module2.exports={mergePromise,getSpawnedPromise}}});var require_command=__commonJS({"../../node_modules/execa/lib/command.js"(exports,module2){"use strict";var normalizeArgs=(file,args=[])=>Array.isArray(args)?[file,...args]:[file],NO_ESCAPE_REGEXP=/^[\w.-]+$/,DOUBLE_QUOTES_REGEXP=/"/g,escapeArg=arg=>typeof arg!="string"||NO_ESCAPE_REGEXP.test(arg)?arg:`"${arg.replace(DOUBLE_QUOTES_REGEXP,'\\"')}"`,joinCommand=(file,args)=>normalizeArgs(file,args).join(" "),getEscapedCommand=(file,args)=>normalizeArgs(file,args).map(arg=>escapeArg(arg)).join(" "),SPACES_REGEXP=/ +/g,parseCommand=command=>{let tokens=[];for(let token of command.trim().split(SPACES_REGEXP)){let previousToken=tokens[tokens.length-1];previousToken&&previousToken.endsWith("\\")?tokens[tokens.length-1]=`${previousToken.slice(0,-1)} ${token}`:tokens.push(token)}return tokens};module2.exports={joinCommand,getEscapedCommand,parseCommand}}});var require_execa=__commonJS({"../../node_modules/execa/index.js"(exports,module2){"use strict";var path13=require("path"),childProcess=require("child_process"),crossSpawn=require_cross_spawn(),stripFinalNewline=require_strip_final_newline(),npmRunPath=require_npm_run_path(),onetime=require_onetime(),makeError=require_error(),normalizeStdio=require_stdio(),{spawnedKill,spawnedCancel,setupTimeout,validateTimeout,setExitHandler}=require_kill(),{handleInput,getSpawnedResult,makeAllStream,validateInputSync}=require_stream(),{mergePromise,getSpawnedPromise}=require_promise(),{joinCommand,parseCommand,getEscapedCommand}=require_command(),DEFAULT_MAX_BUFFER=1e3*1e3*100,getEnv=({env:envOption,extendEnv,preferLocal,localDir,execPath})=>{let env=extendEnv?{...process.env,...envOption}:envOption;return preferLocal?npmRunPath.env({env,cwd:localDir,execPath}):env},handleArguments=(file,args,options={})=>{let parsed=crossSpawn._parse(file,args,options);return file=parsed.command,args=parsed.args,options=parsed.options,options={maxBuffer:DEFAULT_MAX_BUFFER,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:options.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...options},options.env=getEnv(options),options.stdio=normalizeStdio(options),process.platform==="win32"&&path13.basename(file,".exe")==="cmd"&&args.unshift("/q"),{file,args,options,parsed}},handleOutput=(options,value,error)=>typeof value!="string"&&!Buffer.isBuffer(value)?error===void 0?void 0:"":options.stripFinalNewline?stripFinalNewline(value):value,execa=(file,args,options)=>{let parsed=handleArguments(file,args,options),command=joinCommand(file,args),escapedCommand=getEscapedCommand(file,args);validateTimeout(parsed.options);let spawned;try{spawned=childProcess.spawn(parsed.file,parsed.args,parsed.options)}catch(error){let dummySpawned=new childProcess.ChildProcess,errorPromise=Promise.reject(makeError({error,stdout:"",stderr:"",all:"",command,escapedCommand,parsed,timedOut:!1,isCanceled:!1,killed:!1}));return mergePromise(dummySpawned,errorPromise)}let spawnedPromise=getSpawnedPromise(spawned),timedPromise=setupTimeout(spawned,parsed.options,spawnedPromise),processDone=setExitHandler(spawned,parsed.options,timedPromise),context={isCanceled:!1};spawned.kill=spawnedKill.bind(null,spawned.kill.bind(spawned)),spawned.cancel=spawnedCancel.bind(null,spawned,context);let handlePromiseOnce=onetime(async()=>{let[{error,exitCode,signal,timedOut:timedOut2},stdoutResult,stderrResult,allResult]=await getSpawnedResult(spawned,parsed.options,processDone),stdout=handleOutput(parsed.options,stdoutResult),stderr=handleOutput(parsed.options,stderrResult),all2=handleOutput(parsed.options,allResult);if(error||exitCode!==0||signal!==null){let returnedError=makeError({error,exitCode,signal,stdout,stderr,all:all2,command,escapedCommand,parsed,timedOut:timedOut2,isCanceled:context.isCanceled,killed:spawned.killed});if(!parsed.options.reject)return returnedError;throw returnedError}return{command,escapedCommand,exitCode:0,stdout,stderr,all:all2,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return handleInput(spawned,parsed.options.input),spawned.all=makeAllStream(spawned,parsed.options),mergePromise(spawned,handlePromiseOnce)};module2.exports=execa;module2.exports.sync=(file,args,options)=>{let parsed=handleArguments(file,args,options),command=joinCommand(file,args),escapedCommand=getEscapedCommand(file,args);validateInputSync(parsed.options);let result;try{result=childProcess.spawnSync(parsed.file,parsed.args,parsed.options)}catch(error){throw makeError({error,stdout:"",stderr:"",all:"",command,escapedCommand,parsed,timedOut:!1,isCanceled:!1,killed:!1})}let stdout=handleOutput(parsed.options,result.stdout,result.error),stderr=handleOutput(parsed.options,result.stderr,result.error);if(result.error||result.status!==0||result.signal!==null){let error=makeError({stdout,stderr,error:result.error,signal:result.signal,exitCode:result.status,command,escapedCommand,parsed,timedOut:result.error&&result.error.code==="ETIMEDOUT",isCanceled:!1,killed:result.signal!==null});if(!parsed.options.reject)return error;throw error}return{command,escapedCommand,exitCode:0,stdout,stderr,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};module2.exports.command=(command,options)=>{let[file,...args]=parseCommand(command);return execa(file,args,options)};module2.exports.commandSync=(command,options)=>{let[file,...args]=parseCommand(command);return execa.sync(file,args,options)};module2.exports.node=(scriptPath,args,options={})=>{args&&!Array.isArray(args)&&typeof args=="object"&&(options=args,args=[]);let stdio=normalizeStdio.node(options),defaultExecArgv=process.execArgv.filter(arg=>!arg.startsWith("--inspect")),{nodePath=process.execPath,nodeOptions=defaultExecArgv}=options;return execa(nodePath,[...nodeOptions,scriptPath,...Array.isArray(args)?args:[]],{...options,stdin:void 0,stdout:void 0,stderr:void 0,stdio,shell:!1})}}});var require_strip_json_comments=__commonJS({"../../node_modules/strip-json-comments/index.js"(exports,module2){"use strict";var singleComment=Symbol("singleComment"),multiComment=Symbol("multiComment"),stripWithoutWhitespace=()=>"",stripWithWhitespace=(string,start,end)=>string.slice(start,end).replace(/\S/g," "),isEscaped=(jsonString,quotePosition)=>{let index=quotePosition-1,backslashCount=0;for(;jsonString[index]==="\\";)index-=1,backslashCount+=1;return!!(backslashCount%2)};module2.exports=(jsonString,options={})=>{if(typeof jsonString!="string")throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``);let strip=options.whitespace===!1?stripWithoutWhitespace:stripWithWhitespace,insideString=!1,insideComment=!1,offset=0,result="";for(let i2=0;i2<jsonString.length;i2++){let currentCharacter=jsonString[i2],nextCharacter=jsonString[i2+1];if(!insideComment&&currentCharacter==='"'&&(isEscaped(jsonString,i2)||(insideString=!insideString)),!insideString){if(!insideComment&&currentCharacter+nextCharacter==="//")result+=jsonString.slice(offset,i2),offset=i2,insideComment=singleComment,i2++;else if(insideComment===singleComment&&currentCharacter+nextCharacter===`\r
37
37
  `){i2++,insideComment=!1,result+=strip(jsonString,offset,i2),offset=i2;continue}else if(insideComment===singleComment&&currentCharacter===`
38
38
  `)insideComment=!1,result+=strip(jsonString,offset,i2),offset=i2;else if(!insideComment&&currentCharacter+nextCharacter==="/*"){result+=jsonString.slice(offset,i2),offset=i2,insideComment=multiComment,i2++;continue}else if(insideComment===multiComment&&currentCharacter+nextCharacter==="*/"){i2++,insideComment=!1,result+=strip(jsonString,offset,i2+1),offset=i2+1;continue}}}return result+(insideComment?strip(jsonString.slice(offset)):jsonString.slice(offset))}}});var require_end_of_stream=__commonJS({"../../node_modules/end-of-stream/index.js"(exports,module2){"use strict";var once2=require_once(),noop3=function(){},isRequest3=function(stream2){return stream2.setHeader&&typeof stream2.abort=="function"},isChildProcess=function(stream2){return stream2.stdio&&Array.isArray(stream2.stdio)&&stream2.stdio.length===3},eos=function(stream2,opts,callback){if(typeof opts=="function")return eos(stream2,null,opts);opts||(opts={}),callback=once2(callback||noop3);var ws=stream2._writableState,rs=stream2._readableState,readable=opts.readable||opts.readable!==!1&&stream2.readable,writable=opts.writable||opts.writable!==!1&&stream2.writable,cancelled=!1,onlegacyfinish=function(){stream2.writable||onfinish()},onfinish=function(){writable=!1,readable||callback.call(stream2)},onend=function(){readable=!1,writable||callback.call(stream2)},onexit=function(exitCode){callback.call(stream2,exitCode?new Error("exited with error code: "+exitCode):null)},onerror=function(err){callback.call(stream2,err)},onclose=function(){process.nextTick(onclosenexttick)},onclosenexttick=function(){if(!cancelled){if(readable&&!(rs&&rs.ended&&!rs.destroyed))return callback.call(stream2,new Error("premature close"));if(writable&&!(ws&&ws.ended&&!ws.destroyed))return callback.call(stream2,new Error("premature close"))}},onrequest=function(){stream2.req.on("finish",onfinish)};return isRequest3(stream2)?(stream2.on("complete",onfinish),stream2.on("abort",onclose),stream2.req?onrequest():stream2.on("request",onrequest)):writable&&!ws&&(stream2.on("end",onlegacyfinish),stream2.on("close",onlegacyfinish)),isChildProcess(stream2)&&stream2.on("exit",onexit),stream2.on("end",onend),stream2.on("finish",onfinish),opts.error!==!1&&stream2.on("error",onerror),stream2.on("close",onclose),function(){cancelled=!0,stream2.removeListener("complete",onfinish),stream2.removeListener("abort",onclose),stream2.removeListener("request",onrequest),stream2.req&&stream2.req.removeListener("finish",onfinish),stream2.removeListener("end",onlegacyfinish),stream2.removeListener("close",onlegacyfinish),stream2.removeListener("finish",onfinish),stream2.removeListener("exit",onexit),stream2.removeListener("end",onend),stream2.removeListener("error",onerror),stream2.removeListener("close",onclose)}};module2.exports=eos}});var require_pump=__commonJS({"../../node_modules/pump/index.js"(exports,module2){"use strict";var once2=require_once(),eos=require_end_of_stream(),fs9=require("fs"),noop3=function(){},ancient=/^v?\.0/.test(process.version),isFn=function(fn){return typeof fn=="function"},isFS=function(stream2){return!ancient||!fs9?!1:(stream2 instanceof(fs9.ReadStream||noop3)||stream2 instanceof(fs9.WriteStream||noop3))&&isFn(stream2.close)},isRequest3=function(stream2){return stream2.setHeader&&isFn(stream2.abort)},destroyer=function(stream2,reading,writing,callback){callback=once2(callback);var closed=!1;stream2.on("close",function(){closed=!0}),eos(stream2,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed){if(destroyed=!0,isFS(stream2))return stream2.close(noop3);if(isRequest3(stream2))return stream2.abort();if(isFn(stream2.destroy))return stream2.destroy();callback(err||new Error("stream was destroyed"))}}},call=function(fn){fn()},pipe2=function(from,to){return from.pipe(to)},pump2=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop3)&&streams.pop()||noop3;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream2,i2){var reading=i2<streams.length-1,writing=i2>0;return destroyer(stream2,reading,writing,function(err){error||(error=err),err&&destroys.forEach(call),!reading&&(destroys.forEach(call),callback(error))})});return streams.reduce(pipe2)};module2.exports=pump2}});var require_chownr=__commonJS({"../../node_modules/tar-fs/node_modules/chownr/chownr.js"(exports,module2){"use strict";var fs9=require("fs"),path13=require("path"),LCHOWN=fs9.lchown?"lchown":"chown",LCHOWNSYNC=fs9.lchownSync?"lchownSync":"chownSync",needEISDIRHandled=fs9.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),lchownSync=(path14,uid,gid)=>{try{return fs9[LCHOWNSYNC](path14,uid,gid)}catch(er){if(er.code!=="ENOENT")throw er}},chownSync=(path14,uid,gid)=>{try{return fs9.chownSync(path14,uid,gid)}catch(er){if(er.code!=="ENOENT")throw er}},handleEISDIR=needEISDIRHandled?(path14,uid,gid,cb)=>er=>{!er||er.code!=="EISDIR"?cb(er):fs9.chown(path14,uid,gid,cb)}:(_,__,___,cb)=>cb,handleEISDirSync=needEISDIRHandled?(path14,uid,gid)=>{try{return lchownSync(path14,uid,gid)}catch(er){if(er.code!=="EISDIR")throw er;chownSync(path14,uid,gid)}}:(path14,uid,gid)=>lchownSync(path14,uid,gid),nodeVersion=process.version,readdir=(path14,options,cb)=>fs9.readdir(path14,options,cb),readdirSync=(path14,options)=>fs9.readdirSync(path14,options);/^v4\./.test(nodeVersion)&&(readdir=(path14,options,cb)=>fs9.readdir(path14,cb));var chown=(cpath,uid,gid,cb)=>{fs9[LCHOWN](cpath,uid,gid,handleEISDIR(cpath,uid,gid,er=>{cb(er&&er.code!=="ENOENT"?er:null)}))},chownrKid=(p,child,uid,gid,cb)=>{if(typeof child=="string")return fs9.lstat(path13.resolve(p,child),(er,stats)=>{if(er)return cb(er.code!=="ENOENT"?er:null);stats.name=child,chownrKid(p,stats,uid,gid,cb)});if(child.isDirectory())chownr(path13.resolve(p,child.name),uid,gid,er=>{if(er)return cb(er);let cpath=path13.resolve(p,child.name);chown(cpath,uid,gid,cb)});else{let cpath=path13.resolve(p,child.name);chown(cpath,uid,gid,cb)}},chownr=(p,uid,gid,cb)=>{readdir(p,{withFileTypes:!0},(er,children)=>{if(er){if(er.code==="ENOENT")return cb();if(er.code!=="ENOTDIR"&&er.code!=="ENOTSUP")return cb(er)}if(er||!children.length)return chown(p,uid,gid,cb);let len=children.length,errState=null,then=er2=>{if(!errState){if(er2)return cb(errState=er2);if(--len===0)return chown(p,uid,gid,cb)}};children.forEach(child=>chownrKid(p,child,uid,gid,then))})},chownrKidSync=(p,child,uid,gid)=>{if(typeof child=="string")try{let stats=fs9.lstatSync(path13.resolve(p,child));stats.name=child,child=stats}catch(er){if(er.code==="ENOENT")return;throw er}child.isDirectory()&&chownrSync(path13.resolve(p,child.name),uid,gid),handleEISDirSync(path13.resolve(p,child.name),uid,gid)},chownrSync=(p,uid,gid)=>{let children;try{children=readdirSync(p,{withFileTypes:!0})}catch(er){if(er.code==="ENOENT")return;if(er.code==="ENOTDIR"||er.code==="ENOTSUP")return handleEISDirSync(p,uid,gid);throw er}return children&&children.length&&children.forEach(child=>chownrKidSync(p,child,uid,gid)),handleEISDirSync(p,uid,gid)};module2.exports=chownr;chownr.sync=chownrSync}});var require_stream2=__commonJS({"../../node_modules/readable-stream/lib/internal/streams/stream.js"(exports,module2){"use strict";module2.exports=require("stream")}});var require_buffer_list=__commonJS({"../../node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports,module2){"use strict";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i2=1;i2<arguments.length;i2++){var source=arguments[i2]!=null?arguments[i2]:{};i2%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i2=0;i2<props.length;i2++){var descriptor=props[i2];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Constructor}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key=="symbol"?key:String(key)}function _toPrimitive(input,hint){if(typeof input!="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if(typeof res!="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return(hint==="string"?String:Number)(input)}var _require=require("buffer"),Buffer4=_require.Buffer,_require2=require("util"),inspect2=_require2.inspect,custom=inspect2&&inspect2.custom||"inspect";function copyBuffer(src,target,offset){Buffer4.prototype.copy.call(src,target,offset)}module2.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return _createClass(BufferList,[{key:"push",value:function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length}},{key:"unshift",value:function(v){var entry={data:v,next:this.head};this.length===0&&(this.tail=entry),this.head=entry,++this.length}},{key:"shift",value:function(){if(this.length!==0){var ret=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(s2){if(this.length===0)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s2+p.data;return ret}},{key:"concat",value:function(n){if(this.length===0)return Buffer4.alloc(0);for(var ret=Buffer4.allocUnsafe(n>>>0),p=this.head,i2=0;p;)copyBuffer(p.data,ret,i2),i2+=p.data.length,p=p.next;return ret}},{key:"consume",value:function(n,hasStrings){var ret;return n<this.head.data.length?(ret=this.head.data.slice(0,n),this.head.data=this.head.data.slice(n)):n===this.head.data.length?ret=this.shift():ret=hasStrings?this._getString(n):this._getBuffer(n),ret}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(n){var p=this.head,c=1,ret=p.data;for(n-=ret.length;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),n-=nb,n===0){nb===str.length?(++c,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=str.slice(nb));break}++c}return this.length-=c,ret}},{key:"_getBuffer",value:function(n){var ret=Buffer4.allocUnsafe(n),p=this.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),n-=nb,n===0){nb===buf.length?(++c,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=buf.slice(nb));break}++c}return this.length-=c,ret}},{key:custom,value:function(_,options){return inspect2(this,_objectSpread(_objectSpread({},options),{},{depth:0,customInspect:!1}))}}]),BufferList}()}});var require_destroy=__commonJS({"../../node_modules/readable-stream/lib/internal/streams/destroy.js"(exports,module2){"use strict";function destroy(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):err&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(emitErrorNT,this,err)):process.nextTick(emitErrorNT,this,err)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err2){!cb&&err2?_this._writableState?_this._writableState.errorEmitted?process.nextTick(emitCloseNT,_this):(_this._writableState.errorEmitted=!0,process.nextTick(emitErrorAndCloseNT,_this,err2)):process.nextTick(emitErrorAndCloseNT,_this,err2):cb?(process.nextTick(emitCloseNT,_this),cb(err2)):process.nextTick(emitCloseNT,_this)}),this)}function emitErrorAndCloseNT(self2,err){emitErrorNT(self2,err),emitCloseNT(self2)}function emitCloseNT(self2){self2._writableState&&!self2._writableState.emitClose||self2._readableState&&!self2._readableState.emitClose||self2.emit("close")}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(self2,err){self2.emit("error",err)}function errorOrDestroy(stream2,err){var rState=stream2._readableState,wState=stream2._writableState;rState&&rState.autoDestroy||wState&&wState.autoDestroy?stream2.destroy(err):stream2.emit("error",err)}module2.exports={destroy,undestroy,errorOrDestroy}}});var require_errors=__commonJS({"../../node_modules/readable-stream/errors.js"(exports,module2){"use strict";var codes={};function createErrorType(code,message,Base){Base||(Base=Error);function getMessage(arg1,arg2,arg3){return typeof message=="string"?message:message(arg1,arg2,arg3)}class NodeError extends Base{constructor(arg1,arg2,arg3){super(getMessage(arg1,arg2,arg3))}}NodeError.prototype.name=Base.name,NodeError.prototype.code=code,codes[code]=NodeError}function oneOf(expected,thing){if(Array.isArray(expected)){let len=expected.length;return expected=expected.map(i2=>String(i2)),len>2?`one of ${thing} ${expected.slice(0,len-1).join(", ")}, or `+expected[len-1]:len===2?`one of ${thing} ${expected[0]} or ${expected[1]}`:`of ${thing} ${expected[0]}`}else return`of ${thing} ${String(expected)}`}function startsWith(str,search,pos){return str.substr(!pos||pos<0?0:+pos,search.length)===search}function endsWith(str,search,this_len){return(this_len===void 0||this_len>str.length)&&(this_len=str.length),str.substring(this_len-search.length,this_len)===search}function includes(str,search,start){return typeof start!="number"&&(start=0),start+search.length>str.length?!1:str.indexOf(search,start)!==-1}createErrorType("ERR_INVALID_OPT_VALUE",function(name,value){return'The value "'+value+'" is invalid for option "'+name+'"'},TypeError);createErrorType("ERR_INVALID_ARG_TYPE",function(name,expected,actual){let determiner;typeof expected=="string"&&startsWith(expected,"not ")?(determiner="must not be",expected=expected.replace(/^not /,"")):determiner="must be";let msg;if(endsWith(name," argument"))msg=`The ${name} ${determiner} ${oneOf(expected,"type")}`;else{let type=includes(name,".")?"property":"argument";msg=`The "${name}" ${type} ${determiner} ${oneOf(expected,"type")}`}return msg+=`. Received type ${typeof actual}`,msg},TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(name){return"The "+name+" method is not implemented"});createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",function(name){return"Cannot call "+name+" after a stream was destroyed"});createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",function(arg){return"Unknown encoding: "+arg},TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");module2.exports.codes=codes}});var require_state=__commonJS({"../../node_modules/readable-stream/lib/internal/streams/state.js"(exports,module2){"use strict";var ERR_INVALID_OPT_VALUE=require_errors().codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(options,isDuplex,duplexKey){return options.highWaterMark!=null?options.highWaterMark:isDuplex?options[duplexKey]:null}function getHighWaterMark(state,options,duplexKey,isDuplex){var hwm=highWaterMarkFrom(options,isDuplex,duplexKey);if(hwm!=null){if(!(isFinite(hwm)&&Math.floor(hwm)===hwm)||hwm<0){var name=isDuplex?duplexKey:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(name,hwm)}return Math.floor(hwm)}return state.objectMode?16:16*1024}module2.exports={getHighWaterMark}}});var require_stream_writable=__commonJS({"../../node_modules/readable-stream/lib/_stream_writable.js"(exports,module2){"use strict";module2.exports=Writable;function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}var Duplex2;Writable.WritableState=WritableState;var internalUtil={deprecate:require("util-deprecate")},Stream3=require_stream2(),Buffer4=require("buffer").Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var destroyImpl=require_destroy(),_require=require_state(),getHighWaterMark=_require.getHighWaterMark,_require$codes=require_errors().codes,ERR_INVALID_ARG_TYPE=_require$codes.ERR_INVALID_ARG_TYPE,ERR_METHOD_NOT_IMPLEMENTED=_require$codes.ERR_METHOD_NOT_IMPLEMENTED,ERR_MULTIPLE_CALLBACK=_require$codes.ERR_MULTIPLE_CALLBACK,ERR_STREAM_CANNOT_PIPE=_require$codes.ERR_STREAM_CANNOT_PIPE,ERR_STREAM_DESTROYED=_require$codes.ERR_STREAM_DESTROYED,ERR_STREAM_NULL_VALUES=_require$codes.ERR_STREAM_NULL_VALUES,ERR_STREAM_WRITE_AFTER_END=_require$codes.ERR_STREAM_WRITE_AFTER_END,ERR_UNKNOWN_ENCODING=_require$codes.ERR_UNKNOWN_ENCODING,errorOrDestroy=destroyImpl.errorOrDestroy;require_inherits()(Writable,Stream3);function nop(){}function WritableState(options,stream2,isDuplex){Duplex2=Duplex2||require_stream_duplex(),options=options||{},typeof isDuplex!="boolean"&&(isDuplex=stream2 instanceof Duplex2),this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode),this.highWaterMark=getHighWaterMark(this,options,"writableHighWaterMark",isDuplex),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream2,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=options.emitClose!==!1,this.autoDestroy=!!options.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var realHasInstance;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return realHasInstance.call(this,object)?!0:this!==Writable?!1:object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this};function Writable(options){Duplex2=Duplex2||require_stream_duplex();var isDuplex=this instanceof Duplex2;if(!isDuplex&&!realHasInstance.call(Writable,this))return new Writable(options);this._writableState=new WritableState(options,this,isDuplex),this.writable=!0,options&&(typeof options.write=="function"&&(this._write=options.write),typeof options.writev=="function"&&(this._writev=options.writev),typeof options.destroy=="function"&&(this._destroy=options.destroy),typeof options.final=="function"&&(this._final=options.final)),Stream3.call(this)}Writable.prototype.pipe=function(){errorOrDestroy(this,new ERR_STREAM_CANNOT_PIPE)};function writeAfterEnd(stream2,cb){var er=new ERR_STREAM_WRITE_AFTER_END;errorOrDestroy(stream2,er),process.nextTick(cb,er)}function validChunk(stream2,state,chunk,cb){var er;return chunk===null?er=new ERR_STREAM_NULL_VALUES:typeof chunk!="string"&&!state.objectMode&&(er=new ERR_INVALID_ARG_TYPE("chunk",["string","Buffer"],chunk)),er?(errorOrDestroy(stream2,er),process.nextTick(cb,er),!1):!0}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&_isUint8Array(chunk);return isBuf&&!Buffer4.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),typeof encoding=="function"&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),typeof cb!="function"&&(cb=nop),state.ending?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,!state.writing&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(this,state))};Writable.prototype.setDefaultEncoding=function(encoding){if(typeof encoding=="string"&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new ERR_UNKNOWN_ENCODING(encoding);return this._writableState.defaultEncoding=encoding,this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(state,chunk,encoding){return!state.objectMode&&state.decodeStrings!==!1&&typeof chunk=="string"&&(chunk=Buffer4.from(chunk,encoding)),chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(stream2,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(ret||(state.needDrain=!0),state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk,encoding,isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream2,state,!1,len,chunk,encoding,cb);return ret}function doWrite(stream2,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,state.destroyed?state.onwrite(new ERR_STREAM_DESTROYED("write")):writev?stream2._writev(chunk,state.onwrite):stream2._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream2,state,sync,er,cb){--state.pendingcb,sync?(process.nextTick(cb,er),process.nextTick(finishMaybe,stream2,state),stream2._writableState.errorEmitted=!0,errorOrDestroy(stream2,er)):(cb(er),stream2._writableState.errorEmitted=!0,errorOrDestroy(stream2,er),finishMaybe(stream2,state))}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream2,er){var state=stream2._writableState,sync=state.sync,cb=state.writecb;if(typeof cb!="function")throw new ERR_MULTIPLE_CALLBACK;if(onwriteStateUpdate(state),er)onwriteError(stream2,state,sync,er,cb);else{var finished=needFinish(state)||stream2.destroyed;!finished&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(stream2,state),sync?process.nextTick(afterWrite,stream2,state,finished,cb):afterWrite(stream2,state,finished,cb)}}function afterWrite(stream2,state,finished,cb){finished||onwriteDrain(stream2,state),state.pendingcb--,cb(),finishMaybe(stream2,state)}function onwriteDrain(stream2,state){state.length===0&&state.needDrain&&(state.needDrain=!1,stream2.emit("drain"))}function clearBuffer(stream2,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream2._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream2,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback,len=state.objectMode?1:chunk.length;if(doWrite(stream2,state,!1,len,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}entry===null&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}Writable.prototype._write=function(chunk,encoding,cb){cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"))};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;return typeof chunk=="function"?(cb=chunk,chunk=null,encoding=null):typeof encoding=="function"&&(cb=encoding,encoding=null),chunk!=null&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||endWritable(this,state,cb),this};Object.defineProperty(Writable.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing}function callFinal(stream2,state){stream2._final(function(err){state.pendingcb--,err&&errorOrDestroy(stream2,err),state.prefinished=!0,stream2.emit("prefinish"),finishMaybe(stream2,state)})}function prefinish(stream2,state){!state.prefinished&&!state.finalCalled&&(typeof stream2._final=="function"&&!state.destroyed?(state.pendingcb++,state.finalCalled=!0,process.nextTick(callFinal,stream2,state)):(state.prefinished=!0,stream2.emit("prefinish")))}function finishMaybe(stream2,state){var need=needFinish(state);if(need&&(prefinish(stream2,state),state.pendingcb===0&&(state.finished=!0,stream2.emit("finish"),state.autoDestroy))){var rState=stream2._readableState;(!rState||rState.autoDestroy&&rState.endEmitted)&&stream2.destroy()}return need}function endWritable(stream2,state,cb){state.ending=!0,finishMaybe(stream2,state),cb&&(state.finished?process.nextTick(cb):stream2.once("finish",cb)),state.ended=!0,stream2.writable=!1}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;for(corkReq.entry=null;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree.next=corkReq}Object.defineProperty(Writable.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){cb(err)}}});var require_stream_duplex=__commonJS({"../../node_modules/readable-stream/lib/_stream_duplex.js"(exports,module2){"use strict";var objectKeys=Object.keys||function(obj){var keys2=[];for(var key in obj)keys2.push(key);return keys2};module2.exports=Duplex2;var Readable=require_stream_readable(),Writable=require_stream_writable();require_inherits()(Duplex2,Readable);for(keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++)method=keys[v],Duplex2.prototype[method]||(Duplex2.prototype[method]=Writable.prototype[method]);var keys,method,v;function Duplex2(options){if(!(this instanceof Duplex2))return new Duplex2(options);Readable.call(this,options),Writable.call(this,options),this.allowHalfOpen=!0,options&&(options.readable===!1&&(this.readable=!1),options.writable===!1&&(this.writable=!1),options.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",onend)))}Object.defineProperty(Duplex2.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Duplex2.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Duplex2.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function onend(){this._writableState.ended||process.nextTick(onEndNT,this)}function onEndNT(self2){self2.end()}Object.defineProperty(Duplex2.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(value){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=value,this._writableState.destroyed=value)}})}});var require_safe_buffer=__commonJS({"../../node_modules/safe-buffer/index.js"(exports,module2){"use strict";var buffer=require("buffer"),Buffer4=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}Buffer4.from&&Buffer4.alloc&&Buffer4.allocUnsafe&&Buffer4.allocUnsafeSlow?module2.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer);function SafeBuffer(arg,encodingOrOffset,length){return Buffer4(arg,encodingOrOffset,length)}SafeBuffer.prototype=Object.create(Buffer4.prototype);copyProps(Buffer4,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg=="number")throw new TypeError("Argument must not be a number");return Buffer4(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!="number")throw new TypeError("Argument must be a number");var buf=Buffer4(size);return fill!==void 0?typeof encoding=="string"?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return Buffer4(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}}});var require_string_decoder=__commonJS({"../../node_modules/string_decoder/lib/string_decoder.js"(exports){"use strict";var Buffer4=require_safe_buffer().Buffer,isEncoding=Buffer4.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!="string"&&(Buffer4.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:this.write=simpleWrite,this.end=simpleEnd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer4.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r2,i2;if(this.lastNeed){if(r2=this.fillLast(buf),r2===void 0)return"";i2=this.lastNeed,this.lastNeed=0}else i2=0;return i2<buf.length?r2?r2+this.text(buf,i2):this.text(buf,i2):r2||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length};function utf8CheckByte(byte){return byte<=127?0:byte>>5===6?2:byte>>4===14?3:byte>>3===30?4:byte>>6===2?-1:-2}function utf8CheckIncomplete(self2,buf,i2){var j=buf.length-1;if(j<i2)return 0;var nb=utf8CheckByte(buf[j]);return nb>=0?(nb>0&&(self2.lastNeed=nb-1),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(self2.lastNeed=nb-2),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(nb===2?nb=0:self2.lastNeed=nb-3),nb):0))}function utf8CheckExtraBytes(self2,buf,p){if((buf[0]&192)!==128)return self2.lastNeed=0,"\uFFFD";if(self2.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128)return self2.lastNeed=1,"\uFFFD";if(self2.lastNeed>2&&buf.length>2&&(buf[2]&192)!==128)return self2.lastNeed=2,"\uFFFD"}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r2=utf8CheckExtraBytes(this,buf,p);if(r2!==void 0)return r2;if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,p,0,buf.length),this.lastNeed-=buf.length}function utf8Text(buf,i2){var total=utf8CheckIncomplete(this,buf,i2);if(!this.lastNeed)return buf.toString("utf8",i2);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i2,end)}function utf8End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+"\uFFFD":r2}function utf16Text(buf,i2){if((buf.length-i2)%2===0){var r2=buf.toString("utf16le",i2);if(r2){var c=r2.charCodeAt(r2.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r2.slice(0,-1)}return r2}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i2,buf.length-1)}function utf16End(buf){var r2=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r2+this.lastChar.toString("utf16le",0,end)}return r2}function base64Text(buf,i2){var n=(buf.length-i2)%3;return n===0?buf.toString("base64",i2):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i2,buf.length-n))}function base64End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+this.lastChar.toString("base64",0,3-this.lastNeed):r2}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}}});var require_end_of_stream2=__commonJS({"../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports,module2){"use strict";var ERR_STREAM_PREMATURE_CLOSE=require_errors().codes.ERR_STREAM_PREMATURE_CLOSE;function once2(callback){var called=!1;return function(){if(!called){called=!0;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];callback.apply(this,args)}}}function noop3(){}function isRequest3(stream2){return stream2.setHeader&&typeof stream2.abort=="function"}function eos(stream2,opts,callback){if(typeof opts=="function")return eos(stream2,null,opts);opts||(opts={}),callback=once2(callback||noop3);var readable=opts.readable||opts.readable!==!1&&stream2.readable,writable=opts.writable||opts.writable!==!1&&stream2.writable,onlegacyfinish=function(){stream2.writable||onfinish()},writableEnded=stream2._writableState&&stream2._writableState.finished,onfinish=function(){writable=!1,writableEnded=!0,readable||callback.call(stream2)},readableEnded=stream2._readableState&&stream2._readableState.endEmitted,onend=function(){readable=!1,readableEnded=!0,writable||callback.call(stream2)},onerror=function(err){callback.call(stream2,err)},onclose=function(){var err;if(readable&&!readableEnded)return(!stream2._readableState||!stream2._readableState.ended)&&(err=new ERR_STREAM_PREMATURE_CLOSE),callback.call(stream2,err);if(writable&&!writableEnded)return(!stream2._writableState||!stream2._writableState.ended)&&(err=new ERR_STREAM_PREMATURE_CLOSE),callback.call(stream2,err)},onrequest=function(){stream2.req.on("finish",onfinish)};return isRequest3(stream2)?(stream2.on("complete",onfinish),stream2.on("abort",onclose),stream2.req?onrequest():stream2.on("request",onrequest)):writable&&!stream2._writableState&&(stream2.on("end",onlegacyfinish),stream2.on("close",onlegacyfinish)),stream2.on("end",onend),stream2.on("finish",onfinish),opts.error!==!1&&stream2.on("error",onerror),stream2.on("close",onclose),function(){stream2.removeListener("complete",onfinish),stream2.removeListener("abort",onclose),stream2.removeListener("request",onrequest),stream2.req&&stream2.req.removeListener("finish",onfinish),stream2.removeListener("end",onlegacyfinish),stream2.removeListener("close",onlegacyfinish),stream2.removeListener("finish",onfinish),stream2.removeListener("end",onend),stream2.removeListener("error",onerror),stream2.removeListener("close",onclose)}}module2.exports=eos}});var require_async_iterator=__commonJS({"../../node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports,module2){"use strict";var _Object$setPrototypeO;function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key=="symbol"?key:String(key)}function _toPrimitive(input,hint){if(typeof input!="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if(typeof res!="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return(hint==="string"?String:Number)(input)}var finished=require_end_of_stream2(),kLastResolve=Symbol("lastResolve"),kLastReject=Symbol("lastReject"),kError=Symbol("error"),kEnded=Symbol("ended"),kLastPromise=Symbol("lastPromise"),kHandlePromise=Symbol("handlePromise"),kStream=Symbol("stream");function createIterResult(value,done){return{value,done}}function readAndResolve(iter){var resolve3=iter[kLastResolve];if(resolve3!==null){var data=iter[kStream].read();data!==null&&(iter[kLastPromise]=null,iter[kLastResolve]=null,iter[kLastReject]=null,resolve3(createIterResult(data,!1)))}}function onReadable(iter){process.nextTick(readAndResolve,iter)}function wrapForNext(lastPromise,iter){return function(resolve3,reject){lastPromise.then(function(){if(iter[kEnded]){resolve3(createIterResult(void 0,!0));return}iter[kHandlePromise](resolve3,reject)},reject)}}var AsyncIteratorPrototype=Object.getPrototypeOf(function(){}),ReadableStreamAsyncIteratorPrototype=Object.setPrototypeOf((_Object$setPrototypeO={get stream(){return this[kStream]},next:function(){var _this=this,error=this[kError];if(error!==null)return Promise.reject(error);if(this[kEnded])return Promise.resolve(createIterResult(void 0,!0));if(this[kStream].destroyed)return new Promise(function(resolve3,reject){process.nextTick(function(){_this[kError]?reject(_this[kError]):resolve3(createIterResult(void 0,!0))})});var lastPromise=this[kLastPromise],promise;if(lastPromise)promise=new Promise(wrapForNext(lastPromise,this));else{var data=this[kStream].read();if(data!==null)return Promise.resolve(createIterResult(data,!1));promise=new Promise(this[kHandlePromise])}return this[kLastPromise]=promise,promise}},_defineProperty(_Object$setPrototypeO,Symbol.asyncIterator,function(){return this}),_defineProperty(_Object$setPrototypeO,"return",function(){var _this2=this;return new Promise(function(resolve3,reject){_this2[kStream].destroy(null,function(err){if(err){reject(err);return}resolve3(createIterResult(void 0,!0))})})}),_Object$setPrototypeO),AsyncIteratorPrototype),createReadableStreamAsyncIterator=function(stream2){var _Object$create,iterator=Object.create(ReadableStreamAsyncIteratorPrototype,(_Object$create={},_defineProperty(_Object$create,kStream,{value:stream2,writable:!0}),_defineProperty(_Object$create,kLastResolve,{value:null,writable:!0}),_defineProperty(_Object$create,kLastReject,{value:null,writable:!0}),_defineProperty(_Object$create,kError,{value:null,writable:!0}),_defineProperty(_Object$create,kEnded,{value:stream2._readableState.endEmitted,writable:!0}),_defineProperty(_Object$create,kHandlePromise,{value:function(resolve3,reject){var data=iterator[kStream].read();data?(iterator[kLastPromise]=null,iterator[kLastResolve]=null,iterator[kLastReject]=null,resolve3(createIterResult(data,!1))):(iterator[kLastResolve]=resolve3,iterator[kLastReject]=reject)},writable:!0}),_Object$create));return iterator[kLastPromise]=null,finished(stream2,function(err){if(err&&err.code!=="ERR_STREAM_PREMATURE_CLOSE"){var reject=iterator[kLastReject];reject!==null&&(iterator[kLastPromise]=null,iterator[kLastResolve]=null,iterator[kLastReject]=null,reject(err)),iterator[kError]=err;return}var resolve3=iterator[kLastResolve];resolve3!==null&&(iterator[kLastPromise]=null,iterator[kLastResolve]=null,iterator[kLastReject]=null,resolve3(createIterResult(void 0,!0))),iterator[kEnded]=!0}),stream2.on("readable",onReadable.bind(null,iterator)),iterator};module2.exports=createReadableStreamAsyncIterator}});var require_from=__commonJS({"../../node_modules/readable-stream/lib/internal/streams/from.js"(exports,module2){"use strict";function asyncGeneratorStep(gen,resolve3,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve3(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self2=this,args=arguments;return new Promise(function(resolve3,reject){var gen=fn.apply(self2,args);function _next(value){asyncGeneratorStep(gen,resolve3,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve3,reject,_next,_throw,"throw",err)}_next(void 0)})}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i2=1;i2<arguments.length;i2++){var source=arguments[i2]!=null?arguments[i2]:{};i2%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key=="symbol"?key:String(key)}function _toPrimitive(input,hint){if(typeof input!="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if(typeof res!="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return(hint==="string"?String:Number)(input)}var ERR_INVALID_ARG_TYPE=require_errors().codes.ERR_INVALID_ARG_TYPE;function from(Readable,iterable,opts){var iterator;if(iterable&&typeof iterable.next=="function")iterator=iterable;else if(iterable&&iterable[Symbol.asyncIterator])iterator=iterable[Symbol.asyncIterator]();else if(iterable&&iterable[Symbol.iterator])iterator=iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE("iterable",["Iterable"],iterable);var readable=new Readable(_objectSpread({objectMode:!0},opts)),reading=!1;readable._read=function(){reading||(reading=!0,next())};function next(){return _next2.apply(this,arguments)}function _next2(){return _next2=_asyncToGenerator(function*(){try{var _yield$iterator$next=yield iterator.next(),value=_yield$iterator$next.value,done=_yield$iterator$next.done;done?readable.push(null):readable.push(yield value)?next():reading=!1}catch(err){readable.destroy(err)}}),_next2.apply(this,arguments)}return readable}module2.exports=from}});var require_stream_readable=__commonJS({"../../node_modules/readable-stream/lib/_stream_readable.js"(exports,module2){"use strict";module2.exports=Readable;var Duplex2;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream3=require_stream2(),Buffer4=require("buffer").Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var debugUtil=require("util"),debug;debugUtil&&debugUtil.debuglog?debug=debugUtil.debuglog("stream"):debug=function(){};var BufferList=require_buffer_list(),destroyImpl=require_destroy(),_require=require_state(),getHighWaterMark=_require.getHighWaterMark,_require$codes=require_errors().codes,ERR_INVALID_ARG_TYPE=_require$codes.ERR_INVALID_ARG_TYPE,ERR_STREAM_PUSH_AFTER_EOF=_require$codes.ERR_STREAM_PUSH_AFTER_EOF,ERR_METHOD_NOT_IMPLEMENTED=_require$codes.ERR_METHOD_NOT_IMPLEMENTED,ERR_STREAM_UNSHIFT_AFTER_END_EVENT=_require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,StringDecoder,createReadableStreamAsyncIterator,from;require_inherits()(Readable,Stream3);var errorOrDestroy=destroyImpl.errorOrDestroy,kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(emitter,event,fn){if(typeof emitter.prependListener=="function")return emitter.prependListener(event,fn);!emitter._events||!emitter._events[event]?emitter.on(event,fn):Array.isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]}function ReadableState(options,stream2,isDuplex){Duplex2=Duplex2||require_stream_duplex(),options=options||{},typeof isDuplex!="boolean"&&(isDuplex=stream2 instanceof Duplex2),this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode),this.highWaterMark=getHighWaterMark(this,options,"readableHighWaterMark",isDuplex),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=options.emitClose!==!1,this.autoDestroy=!!options.autoDestroy,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require_string_decoder().StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex2=Duplex2||require_stream_duplex(),!(this instanceof Readable))return new Readable(options);var isDuplex=this instanceof Duplex2;this._readableState=new ReadableState(options,this,isDuplex),this.readable=!0,options&&(typeof options.read=="function"&&(this._read=options.read),typeof options.destroy=="function"&&(this._destroy=options.destroy)),Stream3.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}});Readable.prototype.destroy=destroyImpl.destroy;Readable.prototype._undestroy=destroyImpl.undestroy;Readable.prototype._destroy=function(err,cb){cb(err)};Readable.prototype.push=function(chunk,encoding){var state=this._readableState,skipChunkCheck;return state.objectMode?skipChunkCheck=!0:typeof chunk=="string"&&(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=Buffer4.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)};Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)};function readableAddChunk(stream2,chunk,encoding,addToFront,skipChunkCheck){debug("readableAddChunk",chunk);var state=stream2._readableState;if(chunk===null)state.reading=!1,onEofChunk(stream2,state);else{var er;if(skipChunkCheck||(er=chunkInvalid(state,chunk)),er)errorOrDestroy(stream2,er);else if(state.objectMode||chunk&&chunk.length>0)if(typeof chunk!="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer4.prototype&&(chunk=_uint8ArrayToBuffer(chunk)),addToFront)state.endEmitted?errorOrDestroy(stream2,new ERR_STREAM_UNSHIFT_AFTER_END_EVENT):addChunk(stream2,state,chunk,!0);else if(state.ended)errorOrDestroy(stream2,new ERR_STREAM_PUSH_AFTER_EOF);else{if(state.destroyed)return!1;state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||chunk.length!==0?addChunk(stream2,state,chunk,!1):maybeReadMore(stream2,state)):addChunk(stream2,state,chunk,!1)}else addToFront||(state.reading=!1,maybeReadMore(stream2,state))}return!state.ended&&(state.length<state.highWaterMark||state.length===0)}function addChunk(stream2,state,chunk,addToFront){state.flowing&&state.length===0&&!state.sync?(state.awaitDrain=0,stream2.emit("data",chunk)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream2)),maybeReadMore(stream2,state)}function chunkInvalid(state,chunk){var er;return!_isUint8Array(chunk)&&typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new ERR_INVALID_ARG_TYPE("chunk",["string","Buffer","Uint8Array"],chunk)),er}Readable.prototype.isPaused=function(){return this._readableState.flowing===!1};Readable.prototype.setEncoding=function(enc){StringDecoder||(StringDecoder=require_string_decoder().StringDecoder);var decoder=new StringDecoder(enc);this._readableState.decoder=decoder,this._readableState.encoding=this._readableState.decoder.encoding;for(var p=this._readableState.buffer.head,content="";p!==null;)content+=decoder.write(p.data),p=p.next;return this._readableState.buffer.clear(),content!==""&&this._readableState.buffer.push(content),this._readableState.length=content.length,this};var MAX_HWM=1073741824;function computeNewHighWaterMark(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||state.length===0&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(n!==0&&(state.emittedReadable=!1),n===0&&state.needReadable&&((state.highWaterMark!==0?state.length>=state.highWaterMark:state.length>0)||state.ended))return debug("read: emitReadable",state.length,state.ended),state.length===0&&state.ended?endReadable(this):emitReadable(this),null;if(n=howMuchToRead(n,state),n===0&&state.ended)return state.length===0&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(state.length===0||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),state.ended||state.reading?(doRead=!1,debug("reading or ended",doRead)):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,state.length===0&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state)));var ret;return n>0?ret=fromList(n,state):ret=null,ret===null?(state.needReadable=state.length<=state.highWaterMark,n=0):(state.length-=n,state.awaitDrain=0),state.length===0&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),ret!==null&&this.emit("data",ret),ret};function onEofChunk(stream2,state){if(debug("onEofChunk"),!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,state.sync?emitReadable(stream2):(state.needReadable=!1,state.emittedReadable||(state.emittedReadable=!0,emitReadable_(stream2)))}}function emitReadable(stream2){var state=stream2._readableState;debug("emitReadable",state.needReadable,state.emittedReadable),state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,process.nextTick(emitReadable_,stream2))}function emitReadable_(stream2){var state=stream2._readableState;debug("emitReadable_",state.destroyed,state.length,state.ended),!state.destroyed&&(state.length||state.ended)&&(stream2.emit("readable"),state.emittedReadable=!1),state.needReadable=!state.flowing&&!state.ended&&state.length<=state.highWaterMark,flow(stream2)}function maybeReadMore(stream2,state){state.readingMore||(state.readingMore=!0,process.nextTick(maybeReadMore_,stream2,state))}function maybeReadMore_(stream2,state){for(;!state.reading&&!state.ended&&(state.length<state.highWaterMark||state.flowing&&state.length===0);){var len=state.length;if(debug("maybeReadMore read 0"),stream2.read(0),len===state.length)break}state.readingMore=!1}Readable.prototype._read=function(n){errorOrDestroy(this,new ERR_METHOD_NOT_IMPLEMENTED("_read()"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?process.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1;function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain)&&ondrain()}src.on("data",ondata);function ondata(chunk){debug("ondata");var ret=dest.write(chunk);debug("dest.write",ret),ret===!1&&((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",state.awaitDrain),state.awaitDrain++),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),EElistenerCount(dest,"error")===0&&errorOrDestroy(dest,er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish),unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe"),src.unpipe(dest)}return dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,state.awaitDrain===0&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(state.pipesCount===0)return this;if(state.pipesCount===1)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i2=0;i2<len;i2++)dests[i2].emit("unpipe",this,{hasUnpiped:!1});return this}var index=indexOf(state.pipes,dest);return index===-1?this:(state.pipes.splice(index,1),state.pipesCount-=1,state.pipesCount===1&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)};Readable.prototype.on=function(ev,fn){var res=Stream3.prototype.on.call(this,ev,fn),state=this._readableState;return ev==="data"?(state.readableListening=this.listenerCount("readable")>0,state.flowing!==!1&&this.resume()):ev==="readable"&&!state.endEmitted&&!state.readableListening&&(state.readableListening=state.needReadable=!0,state.flowing=!1,state.emittedReadable=!1,debug("on readable",state.length,state.reading),state.length?emitReadable(this):state.reading||process.nextTick(nReadingNextTick,this)),res};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(ev,fn){var res=Stream3.prototype.removeListener.call(this,ev,fn);return ev==="readable"&&process.nextTick(updateReadableListening,this),res};Readable.prototype.removeAllListeners=function(ev){var res=Stream3.prototype.removeAllListeners.apply(this,arguments);return(ev==="readable"||ev===void 0)&&process.nextTick(updateReadableListening,this),res};function updateReadableListening(self2){var state=self2._readableState;state.readableListening=self2.listenerCount("readable")>0,state.resumeScheduled&&!state.paused?state.flowing=!0:self2.listenerCount("data")>0&&self2.resume()}function nReadingNextTick(self2){debug("readable nexttick read 0"),self2.read(0)}Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!state.readableListening,resume(this,state)),state.paused=!1,this};function resume(stream2,state){state.resumeScheduled||(state.resumeScheduled=!0,process.nextTick(resume_,stream2,state))}function resume_(stream2,state){debug("resume",state.reading),state.reading||stream2.read(0),state.resumeScheduled=!1,stream2.emit("resume"),flow(stream2),state.flowing&&!state.reading&&stream2.read(0)}Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function flow(stream2){var state=stream2._readableState;for(debug("flow",state.flowing);state.flowing&&stream2.read()!==null;);}Readable.prototype.wrap=function(stream2){var _this=this,state=this._readableState,paused=!1;stream2.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream2.on("data",function(chunk){if(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!(state.objectMode&&chunk==null)&&!(!state.objectMode&&(!chunk||!chunk.length))){var ret=_this.push(chunk);ret||(paused=!0,stream2.pause())}});for(var i2 in stream2)this[i2]===void 0&&typeof stream2[i2]=="function"&&(this[i2]=function(method){return function(){return stream2[method].apply(stream2,arguments)}}(i2));for(var n=0;n<kProxyEvents.length;n++)stream2.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n2){debug("wrapped _read",n2),paused&&(paused=!1,stream2.resume())},this};typeof Symbol=="function"&&(Readable.prototype[Symbol.asyncIterator]=function(){return createReadableStreamAsyncIterator===void 0&&(createReadableStreamAsyncIterator=require_async_iterator()),createReadableStreamAsyncIterator(this)});Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Readable.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Readable.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(state){this._readableState&&(this._readableState.flowing=state)}});Readable._fromList=fromList;Object.defineProperty(Readable.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function fromList(n,state){if(state.length===0)return null;var ret;return state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(state.decoder?ret=state.buffer.join(""):state.buffer.length===1?ret=state.buffer.first():ret=state.buffer.concat(state.length),state.buffer.clear()):ret=state.buffer.consume(n,state.decoder),ret}function endReadable(stream2){var state=stream2._readableState;debug("endReadable",state.endEmitted),state.endEmitted||(state.ended=!0,process.nextTick(endReadableNT,state,stream2))}function endReadableNT(state,stream2){if(debug("endReadableNT",state.endEmitted,state.length),!state.endEmitted&&state.length===0&&(state.endEmitted=!0,stream2.readable=!1,stream2.emit("end"),state.autoDestroy)){var wState=stream2._writableState;(!wState||wState.autoDestroy&&wState.finished)&&stream2.destroy()}}typeof Symbol=="function"&&(Readable.from=function(iterable,opts){return from===void 0&&(from=require_from()),from(Readable,iterable,opts)});function indexOf(xs,x2){for(var i2=0,l=xs.length;i2<l;i2++)if(xs[i2]===x2)return i2;return-1}}});var require_stream_transform=__commonJS({"../../node_modules/readable-stream/lib/_stream_transform.js"(exports,module2){"use strict";module2.exports=Transform;var _require$codes=require_errors().codes,ERR_METHOD_NOT_IMPLEMENTED=_require$codes.ERR_METHOD_NOT_IMPLEMENTED,ERR_MULTIPLE_CALLBACK=_require$codes.ERR_MULTIPLE_CALLBACK,ERR_TRANSFORM_ALREADY_TRANSFORMING=_require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,ERR_TRANSFORM_WITH_LENGTH_0=_require$codes.ERR_TRANSFORM_WITH_LENGTH_0,Duplex2=require_stream_duplex();require_inherits()(Transform,Duplex2);function afterTransform(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(cb===null)return this.emit("error",new ERR_MULTIPLE_CALLBACK);ts.writechunk=null,ts.writecb=null,data!=null&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex2.call(this,options),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&(typeof options.transform=="function"&&(this._transform=options.transform),typeof options.flush=="function"&&(this._flush=options.flush)),this.on("prefinish",prefinish)}function prefinish(){var _this=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex2.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"))};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;ts.writechunk!==null&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0};Transform.prototype._destroy=function(err,cb){Duplex2.prototype._destroy.call(this,err,function(err2){cb(err2)})};function done(stream2,er,data){if(er)return stream2.emit("error",er);if(data!=null&&stream2.push(data),stream2._writableState.length)throw new ERR_TRANSFORM_WITH_LENGTH_0;if(stream2._transformState.transforming)throw new ERR_TRANSFORM_ALREADY_TRANSFORMING;return stream2.push(null)}}});var require_stream_passthrough=__commonJS({"../../node_modules/readable-stream/lib/_stream_passthrough.js"(exports,module2){"use strict";module2.exports=PassThrough3;var Transform=require_stream_transform();require_inherits()(PassThrough3,Transform);function PassThrough3(options){if(!(this instanceof PassThrough3))return new PassThrough3(options);Transform.call(this,options)}PassThrough3.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}}});var require_pipeline=__commonJS({"../../node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports,module2){"use strict";var eos;function once2(callback){var called=!1;return function(){called||(called=!0,callback.apply(void 0,arguments))}}var _require$codes=require_errors().codes,ERR_MISSING_ARGS=_require$codes.ERR_MISSING_ARGS,ERR_STREAM_DESTROYED=_require$codes.ERR_STREAM_DESTROYED;function noop3(err){if(err)throw err}function isRequest3(stream2){return stream2.setHeader&&typeof stream2.abort=="function"}function destroyer(stream2,reading,writing,callback){callback=once2(callback);var closed=!1;stream2.on("close",function(){closed=!0}),eos===void 0&&(eos=require_end_of_stream2()),eos(stream2,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed){if(destroyed=!0,isRequest3(stream2))return stream2.abort();if(typeof stream2.destroy=="function")return stream2.destroy();callback(err||new ERR_STREAM_DESTROYED("pipe"))}}}function call(fn){fn()}function pipe2(from,to){return from.pipe(to)}function popCallback(streams){return!streams.length||typeof streams[streams.length-1]!="function"?noop3:streams.pop()}function pipeline2(){for(var _len=arguments.length,streams=new Array(_len),_key=0;_key<_len;_key++)streams[_key]=arguments[_key];var callback=popCallback(streams);if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new ERR_MISSING_ARGS("streams");var error,destroys=streams.map(function(stream2,i2){var reading=i2<streams.length-1,writing=i2>0;return destroyer(stream2,reading,writing,function(err){error||(error=err),err&&destroys.forEach(call),!reading&&(destroys.forEach(call),callback(error))})});return streams.reduce(pipe2)}module2.exports=pipeline2}});var require_readable=__commonJS({"../../node_modules/readable-stream/readable.js"(exports,module2){"use strict";var Stream3=require("stream");process.env.READABLE_STREAM==="disable"&&Stream3?(module2.exports=Stream3.Readable,Object.assign(module2.exports,Stream3),module2.exports.Stream=Stream3):(exports=module2.exports=require_stream_readable(),exports.Stream=Stream3||exports,exports.Readable=exports,exports.Writable=require_stream_writable(),exports.Duplex=require_stream_duplex(),exports.Transform=require_stream_transform(),exports.PassThrough=require_stream_passthrough(),exports.finished=require_end_of_stream2(),exports.pipeline=require_pipeline())}});var require_BufferList=__commonJS({"../../node_modules/bl/BufferList.js"(exports,module2){"use strict";var{Buffer:Buffer4}=require("buffer"),symbol=Symbol.for("BufferList");function BufferList(buf){if(!(this instanceof BufferList))return new BufferList(buf);BufferList._init.call(this,buf)}BufferList._init=function(buf){Object.defineProperty(this,symbol,{value:!0}),this._bufs=[],this.length=0,buf&&this.append(buf)};BufferList.prototype._new=function(buf){return new BufferList(buf)};BufferList.prototype._offset=function(offset){if(offset===0)return[0,0];let tot=0;for(let i2=0;i2<this._bufs.length;i2++){let _t=tot+this._bufs[i2].length;if(offset<_t||i2===this._bufs.length-1)return[i2,offset-tot];tot=_t}};BufferList.prototype._reverseOffset=function(blOffset){let bufferId=blOffset[0],offset=blOffset[1];for(let i2=0;i2<bufferId;i2++)offset+=this._bufs[i2].length;return offset};BufferList.prototype.get=function(index){if(index>this.length||index<0)return;let offset=this._offset(index);return this._bufs[offset[0]][offset[1]]};BufferList.prototype.slice=function(start,end){return typeof start=="number"&&start<0&&(start+=this.length),typeof end=="number"&&end<0&&(end+=this.length),this.copy(null,0,start,end)};BufferList.prototype.copy=function(dst,dstStart,srcStart,srcEnd){if((typeof srcStart!="number"||srcStart<0)&&(srcStart=0),(typeof srcEnd!="number"||srcEnd>this.length)&&(srcEnd=this.length),srcStart>=this.length||srcEnd<=0)return dst||Buffer4.alloc(0);let copy3=!!dst,off=this._offset(srcStart),len=srcEnd-srcStart,bytes=len,bufoff=copy3&&dstStart||0,start=off[1];if(srcStart===0&&srcEnd===this.length){if(!copy3)return this._bufs.length===1?this._bufs[0]:Buffer4.concat(this._bufs,this.length);for(let i2=0;i2<this._bufs.length;i2++)this._bufs[i2].copy(dst,bufoff),bufoff+=this._bufs[i2].length;return dst}if(bytes<=this._bufs[off[0]].length-start)return copy3?this._bufs[off[0]].copy(dst,dstStart,start,start+bytes):this._bufs[off[0]].slice(start,start+bytes);copy3||(dst=Buffer4.allocUnsafe(len));for(let i2=off[0];i2<this._bufs.length;i2++){let l=this._bufs[i2].length-start;if(bytes>l)this._bufs[i2].copy(dst,bufoff,start),bufoff+=l;else{this._bufs[i2].copy(dst,bufoff,start,start+bytes),bufoff+=l;break}bytes-=l,start&&(start=0)}return dst.length>bufoff?dst.slice(0,bufoff):dst};BufferList.prototype.shallowSlice=function(start,end){if(start=start||0,end=typeof end!="number"?this.length:end,start<0&&(start+=this.length),end<0&&(end+=this.length),start===end)return this._new();let startOffset=this._offset(start),endOffset=this._offset(end),buffers=this._bufs.slice(startOffset[0],endOffset[0]+1);return endOffset[1]===0?buffers.pop():buffers[buffers.length-1]=buffers[buffers.length-1].slice(0,endOffset[1]),startOffset[1]!==0&&(buffers[0]=buffers[0].slice(startOffset[1])),this._new(buffers)};BufferList.prototype.toString=function(encoding,start,end){return this.slice(start,end).toString(encoding)};BufferList.prototype.consume=function(bytes){if(bytes=Math.trunc(bytes),Number.isNaN(bytes)||bytes<=0)return this;for(;this._bufs.length;)if(bytes>=this._bufs[0].length)bytes-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(bytes),this.length-=bytes;break}return this};BufferList.prototype.duplicate=function(){let copy2=this._new();for(let i2=0;i2<this._bufs.length;i2++)copy2.append(this._bufs[i2]);return copy2};BufferList.prototype.append=function(buf){if(buf==null)return this;if(buf.buffer)this._appendBuffer(Buffer4.from(buf.buffer,buf.byteOffset,buf.byteLength));else if(Array.isArray(buf))for(let i2=0;i2<buf.length;i2++)this.append(buf[i2]);else if(this._isBufferList(buf))for(let i2=0;i2<buf._bufs.length;i2++)this.append(buf._bufs[i2]);else typeof buf=="number"&&(buf=buf.toString()),this._appendBuffer(Buffer4.from(buf));return this};BufferList.prototype._appendBuffer=function(buf){this._bufs.push(buf),this.length+=buf.length};BufferList.prototype.indexOf=function(search,offset,encoding){if(encoding===void 0&&typeof offset=="string"&&(encoding=offset,offset=void 0),typeof search=="function"||Array.isArray(search))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof search=="number"?search=Buffer4.from([search]):typeof search=="string"?search=Buffer4.from(search,encoding):this._isBufferList(search)?search=search.slice():Array.isArray(search.buffer)?search=Buffer4.from(search.buffer,search.byteOffset,search.byteLength):Buffer4.isBuffer(search)||(search=Buffer4.from(search)),offset=Number(offset||0),isNaN(offset)&&(offset=0),offset<0&&(offset=this.length+offset),offset<0&&(offset=0),search.length===0)return offset>this.length?this.length:offset;let blOffset=this._offset(offset),blIndex=blOffset[0],buffOffset=blOffset[1];for(;blIndex<this._bufs.length;blIndex++){let buff=this._bufs[blIndex];for(;buffOffset<buff.length;)if(buff.length-buffOffset>=search.length){let nativeSearchResult=buff.indexOf(search,buffOffset);if(nativeSearchResult!==-1)return this._reverseOffset([blIndex,nativeSearchResult]);buffOffset=buff.length-search.length+1}else{let revOffset=this._reverseOffset([blIndex,buffOffset]);if(this._match(revOffset,search))return revOffset;buffOffset++}buffOffset=0}return-1};BufferList.prototype._match=function(offset,search){if(this.length-offset<search.length)return!1;for(let searchOffset=0;searchOffset<search.length;searchOffset++)if(this.get(offset+searchOffset)!==search[searchOffset])return!1;return!0};(function(){let methods={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let m2 in methods)(function(m3){methods[m3]===null?BufferList.prototype[m3]=function(offset,byteLength){return this.slice(offset,offset+byteLength)[m3](0,byteLength)}:BufferList.prototype[m3]=function(offset=0){return this.slice(offset,offset+methods[m3])[m3](0)}})(m2)})();BufferList.prototype._isBufferList=function(b){return b instanceof BufferList||BufferList.isBufferList(b)};BufferList.isBufferList=function(b){return b!=null&&b[symbol]};module2.exports=BufferList}});var require_bl=__commonJS({"../../node_modules/bl/bl.js"(exports,module2){"use strict";var DuplexStream=require_readable().Duplex,inherits=require_inherits(),BufferList=require_BufferList();function BufferListStream(callback){if(!(this instanceof BufferListStream))return new BufferListStream(callback);if(typeof callback=="function"){this._callback=callback;let piper=function(err){this._callback&&(this._callback(err),this._callback=null)}.bind(this);this.on("pipe",function(src){src.on("error",piper)}),this.on("unpipe",function(src){src.removeListener("error",piper)}),callback=null}BufferList._init.call(this,callback),DuplexStream.call(this)}inherits(BufferListStream,DuplexStream);Object.assign(BufferListStream.prototype,BufferList.prototype);BufferListStream.prototype._new=function(callback){return new BufferListStream(callback)};BufferListStream.prototype._write=function(buf,encoding,callback){this._appendBuffer(buf),typeof callback=="function"&&callback()};BufferListStream.prototype._read=function(size){if(!this.length)return this.push(null);size=Math.min(size,this.length),this.push(this.slice(0,size)),this.consume(size)};BufferListStream.prototype.end=function(chunk){DuplexStream.prototype.end.call(this,chunk),this._callback&&(this._callback(null,this.slice()),this._callback=null)};BufferListStream.prototype._destroy=function(err,cb){this._bufs.length=0,this.length=0,cb(err)};BufferListStream.prototype._isBufferList=function(b){return b instanceof BufferListStream||b instanceof BufferList||BufferListStream.isBufferList(b)};BufferListStream.isBufferList=BufferList.isBufferList;module2.exports=BufferListStream;module2.exports.BufferListStream=BufferListStream;module2.exports.BufferList=BufferList}});var require_headers=__commonJS({"../../node_modules/tar-stream/headers.js"(exports){"use strict";var alloc=Buffer.alloc,ZEROS="0000000000000000000",SEVENS="7777777777777777777",ZERO_OFFSET="0".charCodeAt(0),USTAR_MAGIC=Buffer.from("ustar\0","binary"),USTAR_VER=Buffer.from("00","binary"),GNU_MAGIC=Buffer.from("ustar ","binary"),GNU_VER=Buffer.from(" \0","binary"),MASK=parseInt("7777",8),MAGIC_OFFSET=257,VERSION_OFFSET=263,clamp=function(index,len,defaultValue){return typeof index!="number"?defaultValue:(index=~~index,index>=len?len:index>=0||(index+=len,index>=0)?index:0)},toType=function(flag){switch(flag){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},toTypeflag=function(flag){switch(flag){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},indexOf=function(block,num,offset,end){for(;offset<end;offset++)if(block[offset]===num)return offset;return end},cksum=function(block){for(var sum=256,i2=0;i2<148;i2++)sum+=block[i2];for(var j=156;j<512;j++)sum+=block[j];return sum},encodeOct=function(val,n){return val=val.toString(8),val.length>n?SEVENS.slice(0,n)+" ":ZEROS.slice(0,n-val.length)+val+" "};function parse256(buf){var positive;if(buf[0]===128)positive=!0;else if(buf[0]===255)positive=!1;else return null;for(var tuple=[],i2=buf.length-1;i2>0;i2--){var byte=buf[i2];positive?tuple.push(byte):tuple.push(255-byte)}var sum=0,l=tuple.length;for(i2=0;i2<l;i2++)sum+=tuple[i2]*Math.pow(256,i2);return positive?sum:-1*sum}var decodeOct=function(val,offset,length){if(val=val.slice(offset,offset+length),offset=0,val[offset]&128)return parse256(val);for(;offset<val.length&&val[offset]===32;)offset++;for(var end=clamp(indexOf(val,32,offset,val.length),val.length,val.length);offset<end&&val[offset]===0;)offset++;return end===offset?0:parseInt(val.slice(offset,end).toString(),8)},decodeStr=function(val,offset,length,encoding){return val.slice(offset,indexOf(val,0,offset,offset+length)).toString(encoding)},addLength=function(str){var len=Buffer.byteLength(str),digits=Math.floor(Math.log(len)/Math.log(10))+1;return len+digits>=Math.pow(10,digits)&&digits++,len+digits+str};exports.decodeLongPath=function(buf,encoding){return decodeStr(buf,0,buf.length,encoding)};exports.encodePax=function(opts){var result="";opts.name&&(result+=addLength(" path="+opts.name+`
39
39
  `)),opts.linkname&&(result+=addLength(" linkpath="+opts.linkname+`
40
40
  `));var pax=opts.pax;if(pax)for(var key in pax)result+=addLength(" "+key+"="+pax[key]+`
41
- `);return Buffer.from(result)};exports.decodePax=function(buf){for(var result={};buf.length;){for(var i2=0;i2<buf.length&&buf[i2]!==32;)i2++;var len=parseInt(buf.slice(0,i2).toString(),10);if(!len)return result;var b=buf.slice(i2+1,len-1).toString(),keyIndex=b.indexOf("=");if(keyIndex===-1)return result;result[b.slice(0,keyIndex)]=b.slice(keyIndex+1),buf=buf.slice(len)}return result};exports.encode=function(opts){var buf=alloc(512),name=opts.name,prefix="";if(opts.typeflag===5&&name[name.length-1]!=="/"&&(name+="/"),Buffer.byteLength(name)!==name.length)return null;for(;Buffer.byteLength(name)>100;){var i2=name.indexOf("/");if(i2===-1)return null;prefix+=prefix?"/"+name.slice(0,i2):name.slice(0,i2),name=name.slice(i2+1)}return Buffer.byteLength(name)>100||Buffer.byteLength(prefix)>155||opts.linkname&&Buffer.byteLength(opts.linkname)>100?null:(buf.write(name),buf.write(encodeOct(opts.mode&MASK,6),100),buf.write(encodeOct(opts.uid,6),108),buf.write(encodeOct(opts.gid,6),116),buf.write(encodeOct(opts.size,11),124),buf.write(encodeOct(opts.mtime.getTime()/1e3|0,11),136),buf[156]=ZERO_OFFSET+toTypeflag(opts.type),opts.linkname&&buf.write(opts.linkname,157),USTAR_MAGIC.copy(buf,MAGIC_OFFSET),USTAR_VER.copy(buf,VERSION_OFFSET),opts.uname&&buf.write(opts.uname,265),opts.gname&&buf.write(opts.gname,297),buf.write(encodeOct(opts.devmajor||0,6),329),buf.write(encodeOct(opts.devminor||0,6),337),prefix&&buf.write(prefix,345),buf.write(encodeOct(cksum(buf),6),148),buf)};exports.decode=function(buf,filenameEncoding,allowUnknownFormat){var typeflag=buf[156]===0?0:buf[156]-ZERO_OFFSET,name=decodeStr(buf,0,100,filenameEncoding),mode=decodeOct(buf,100,8),uid=decodeOct(buf,108,8),gid=decodeOct(buf,116,8),size=decodeOct(buf,124,12),mtime=decodeOct(buf,136,12),type=toType(typeflag),linkname=buf[157]===0?null:decodeStr(buf,157,100,filenameEncoding),uname=decodeStr(buf,265,32),gname=decodeStr(buf,297,32),devmajor=decodeOct(buf,329,8),devminor=decodeOct(buf,337,8),c=cksum(buf);if(c===8*32)return null;if(c!==decodeOct(buf,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(USTAR_MAGIC.compare(buf,MAGIC_OFFSET,MAGIC_OFFSET+6)===0)buf[345]&&(name=decodeStr(buf,345,155,filenameEncoding)+"/"+name);else if(!(GNU_MAGIC.compare(buf,MAGIC_OFFSET,MAGIC_OFFSET+6)===0&&GNU_VER.compare(buf,VERSION_OFFSET,VERSION_OFFSET+2)===0)){if(!allowUnknownFormat)throw new Error("Invalid tar header: unknown format.")}return typeflag===0&&name&&name[name.length-1]==="/"&&(typeflag=5),{name,mode,uid,gid,size,mtime:new Date(1e3*mtime),type,linkname,uname,gname,devmajor,devminor}}}});var require_extract=__commonJS({"../../node_modules/tar-stream/extract.js"(exports,module2){"use strict";var util=require("util"),bl=require_bl(),headers=require_headers(),Writable=require_readable().Writable,PassThrough3=require_readable().PassThrough,noop3=function(){},overflow=function(size){return size&=511,size&&512-size},emptyStream=function(self2,offset){var s2=new Source(self2,offset);return s2.end(),s2},mixinPax=function(header,pax){return pax.path&&(header.name=pax.path),pax.linkpath&&(header.linkname=pax.linkpath),pax.size&&(header.size=parseInt(pax.size,10)),header.pax=pax,header},Source=function(self2,offset){this._parent=self2,this.offset=offset,PassThrough3.call(this,{autoDestroy:!1})};util.inherits(Source,PassThrough3);Source.prototype.destroy=function(err){this._parent.destroy(err)};var Extract=function(opts){if(!(this instanceof Extract))return new Extract(opts);Writable.call(this,opts),opts=opts||{},this._offset=0,this._buffer=bl(),this._missing=0,this._partial=!1,this._onparse=noop3,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var self2=this,b=self2._buffer,oncontinue=function(){self2._continue()},onunlock=function(err){if(self2._locked=!1,err)return self2.destroy(err);self2._stream||oncontinue()},onstreamend=function(){self2._stream=null;var drain=overflow(self2._header.size);drain?self2._parse(drain,ondrain):self2._parse(512,onheader),self2._locked||oncontinue()},ondrain=function(){self2._buffer.consume(overflow(self2._header.size)),self2._parse(512,onheader),oncontinue()},onpaxglobalheader=function(){var size=self2._header.size;self2._paxGlobal=headers.decodePax(b.slice(0,size)),b.consume(size),onstreamend()},onpaxheader=function(){var size=self2._header.size;self2._pax=headers.decodePax(b.slice(0,size)),self2._paxGlobal&&(self2._pax=Object.assign({},self2._paxGlobal,self2._pax)),b.consume(size),onstreamend()},ongnulongpath=function(){var size=self2._header.size;this._gnuLongPath=headers.decodeLongPath(b.slice(0,size),opts.filenameEncoding),b.consume(size),onstreamend()},ongnulonglinkpath=function(){var size=self2._header.size;this._gnuLongLinkPath=headers.decodeLongPath(b.slice(0,size),opts.filenameEncoding),b.consume(size),onstreamend()},onheader=function(){var offset=self2._offset,header;try{header=self2._header=headers.decode(b.slice(0,512),opts.filenameEncoding,opts.allowUnknownFormat)}catch(err){self2.emit("error",err)}if(b.consume(512),!header){self2._parse(512,onheader),oncontinue();return}if(header.type==="gnu-long-path"){self2._parse(header.size,ongnulongpath),oncontinue();return}if(header.type==="gnu-long-link-path"){self2._parse(header.size,ongnulonglinkpath),oncontinue();return}if(header.type==="pax-global-header"){self2._parse(header.size,onpaxglobalheader),oncontinue();return}if(header.type==="pax-header"){self2._parse(header.size,onpaxheader),oncontinue();return}if(self2._gnuLongPath&&(header.name=self2._gnuLongPath,self2._gnuLongPath=null),self2._gnuLongLinkPath&&(header.linkname=self2._gnuLongLinkPath,self2._gnuLongLinkPath=null),self2._pax&&(self2._header=header=mixinPax(header,self2._pax),self2._pax=null),self2._locked=!0,!header.size||header.type==="directory"){self2._parse(512,onheader),self2.emit("entry",header,emptyStream(self2,offset),onunlock);return}self2._stream=new Source(self2,offset),self2.emit("entry",header,self2._stream,onunlock),self2._parse(header.size,onstreamend),oncontinue()};this._onheader=onheader,this._parse(512,onheader)};util.inherits(Extract,Writable);Extract.prototype.destroy=function(err){this._destroyed||(this._destroyed=!0,err&&this.emit("error",err),this.emit("close"),this._stream&&this._stream.emit("close"))};Extract.prototype._parse=function(size,onparse){this._destroyed||(this._offset+=size,this._missing=size,onparse===this._onheader&&(this._partial=!1),this._onparse=onparse)};Extract.prototype._continue=function(){if(!this._destroyed){var cb=this._cb;this._cb=noop3,this._overflow?this._write(this._overflow,void 0,cb):cb()}};Extract.prototype._write=function(data,enc,cb){if(!this._destroyed){var s2=this._stream,b=this._buffer,missing=this._missing;if(data.length&&(this._partial=!0),data.length<missing)return this._missing-=data.length,this._overflow=null,s2?s2.write(data,cb):(b.append(data),cb());this._cb=cb,this._missing=0;var overflow2=null;data.length>missing&&(overflow2=data.slice(missing),data=data.slice(0,missing)),s2?s2.end(data):b.append(data),this._overflow=overflow2,this._onparse()}};Extract.prototype._final=function(cb){if(this._partial)return this.destroy(new Error("Unexpected end of data"));cb()};module2.exports=Extract}});var require_fs_constants=__commonJS({"../../node_modules/fs-constants/index.js"(exports,module2){"use strict";module2.exports=require("fs").constants||require("constants")}});var require_pack=__commonJS({"../../node_modules/tar-stream/pack.js"(exports,module2){"use strict";var constants=require_fs_constants(),eos=require_end_of_stream(),inherits=require_inherits(),alloc=Buffer.alloc,Readable=require_readable().Readable,Writable=require_readable().Writable,StringDecoder=require("string_decoder").StringDecoder,headers=require_headers(),DMODE=parseInt("755",8),FMODE=parseInt("644",8),END_OF_TAR=alloc(1024),noop3=function(){},overflow=function(self2,size){size&=511,size&&self2.push(END_OF_TAR.slice(0,512-size))};function modeToType(mode){switch(mode&constants.S_IFMT){case constants.S_IFBLK:return"block-device";case constants.S_IFCHR:return"character-device";case constants.S_IFDIR:return"directory";case constants.S_IFIFO:return"fifo";case constants.S_IFLNK:return"symlink"}return"file"}var Sink=function(to){Writable.call(this),this.written=0,this._to=to,this._destroyed=!1};inherits(Sink,Writable);Sink.prototype._write=function(data,enc,cb){if(this.written+=data.length,this._to.push(data))return cb();this._to._drain=cb};Sink.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var LinkSink=function(){Writable.call(this),this.linkname="",this._decoder=new StringDecoder("utf-8"),this._destroyed=!1};inherits(LinkSink,Writable);LinkSink.prototype._write=function(data,enc,cb){this.linkname+=this._decoder.write(data),cb()};LinkSink.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Void=function(){Writable.call(this),this._destroyed=!1};inherits(Void,Writable);Void.prototype._write=function(data,enc,cb){cb(new Error("No body allowed for this entry"))};Void.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Pack=function(opts){if(!(this instanceof Pack))return new Pack(opts);Readable.call(this,opts),this._drain=noop3,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};inherits(Pack,Readable);Pack.prototype.entry=function(header,buffer,callback){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof buffer=="function"&&(callback=buffer,buffer=null),callback||(callback=noop3);var self2=this;if((!header.size||header.type==="symlink")&&(header.size=0),header.type||(header.type=modeToType(header.mode)),header.mode||(header.mode=header.type==="directory"?DMODE:FMODE),header.uid||(header.uid=0),header.gid||(header.gid=0),header.mtime||(header.mtime=new Date),typeof buffer=="string"&&(buffer=Buffer.from(buffer)),Buffer.isBuffer(buffer)){header.size=buffer.length,this._encode(header);var ok=this.push(buffer);return overflow(self2,header.size),ok?process.nextTick(callback):this._drain=callback,new Void}if(header.type==="symlink"&&!header.linkname){var linkSink=new LinkSink;return eos(linkSink,function(err){if(err)return self2.destroy(),callback(err);header.linkname=linkSink.linkname,self2._encode(header),callback()}),linkSink}if(this._encode(header),header.type!=="file"&&header.type!=="contiguous-file")return process.nextTick(callback),new Void;var sink=new Sink(this);return this._stream=sink,eos(sink,function(err){if(self2._stream=null,err)return self2.destroy(),callback(err);if(sink.written!==header.size)return self2.destroy(),callback(new Error("size mismatch"));overflow(self2,header.size),self2._finalizing&&self2.finalize(),callback()}),sink}};Pack.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(END_OF_TAR),this.push(null))};Pack.prototype.destroy=function(err){this._destroyed||(this._destroyed=!0,err&&this.emit("error",err),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Pack.prototype._encode=function(header){if(!header.pax){var buf=headers.encode(header);if(buf){this.push(buf);return}}this._encodePax(header)};Pack.prototype._encodePax=function(header){var paxHeader=headers.encodePax({name:header.name,linkname:header.linkname,pax:header.pax}),newHeader={name:"PaxHeader",mode:header.mode,uid:header.uid,gid:header.gid,size:paxHeader.length,mtime:header.mtime,type:"pax-header",linkname:header.linkname&&"PaxHeader",uname:header.uname,gname:header.gname,devmajor:header.devmajor,devminor:header.devminor};this.push(headers.encode(newHeader)),this.push(paxHeader),overflow(this,paxHeader.length),newHeader.size=header.size,newHeader.type=header.type,this.push(headers.encode(newHeader))};Pack.prototype._read=function(n){var drain=this._drain;this._drain=noop3,drain()};module2.exports=Pack}});var require_tar_stream=__commonJS({"../../node_modules/tar-stream/index.js"(exports){"use strict";exports.extract=require_extract();exports.pack=require_pack()}});var require_mkdirp_classic=__commonJS({"../../node_modules/mkdirp-classic/index.js"(exports,module2){"use strict";var path13=require("path"),fs9=require("fs"),_0777=parseInt("0777",8);module2.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(p,opts,f3,made){typeof opts=="function"?(f3=opts,opts={}):(!opts||typeof opts!="object")&&(opts={mode:opts});var mode=opts.mode,xfs=opts.fs||fs9;mode===void 0&&(mode=_0777&~process.umask()),made||(made=null);var cb=f3||function(){};p=path13.resolve(p),xfs.mkdir(p,mode,function(er){if(!er)return made=made||p,cb(null,made);switch(er.code){case"ENOENT":mkdirP(path13.dirname(p),opts,function(er2,made2){er2?cb(er2,made2):mkdirP(p,opts,cb,made2)});break;default:xfs.stat(p,function(er2,stat2){er2||!stat2.isDirectory()?cb(er,made):cb(null,made)});break}})}mkdirP.sync=function sync(p,opts,made){(!opts||typeof opts!="object")&&(opts={mode:opts});var mode=opts.mode,xfs=opts.fs||fs9;mode===void 0&&(mode=_0777&~process.umask()),made||(made=null),p=path13.resolve(p);try{xfs.mkdirSync(p,mode),made=made||p}catch(err0){switch(err0.code){case"ENOENT":made=sync(path13.dirname(p),opts,made),sync(p,opts,made);break;default:var stat2;try{stat2=xfs.statSync(p)}catch{throw err0}if(!stat2.isDirectory())throw err0;break}}return made}}});var require_tar_fs=__commonJS({"../../node_modules/tar-fs/index.js"(exports){"use strict";var chownr=require_chownr(),tar=require_tar_stream(),pump2=require_pump(),mkdirp=require_mkdirp_classic(),fs9=require("fs"),path13=require("path"),os2=require("os"),win32=os2.platform()==="win32",noop3=function(){},echo=function(name){return name},normalize=win32?function(name){return name.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:echo,statAll=function(fs10,stat2,cwd,ignore,entries2,sort2){var queue=entries2||["."];return function(callback){if(!queue.length)return callback();var next=queue.shift(),nextAbs=path13.join(cwd,next);stat2.call(fs10,nextAbs,function(err,stat3){if(err)return callback(err);if(!stat3.isDirectory())return callback(null,next,stat3);fs10.readdir(nextAbs,function(err2,files){if(err2)return callback(err2);sort2&&files.sort();for(var i2=0;i2<files.length;i2++)ignore(path13.join(cwd,next,files[i2]))||queue.push(path13.join(next,files[i2]));callback(null,next,stat3)})})}},strip=function(map,level){return function(header){header.name=header.name.split("/").slice(level).join("/");var linkname=header.linkname;return linkname&&(header.type==="link"||path13.isAbsolute(linkname))&&(header.linkname=linkname.split("/").slice(level).join("/")),map(header)}};exports.pack=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs9,ignore=opts.ignore||opts.filter||noop3,map=opts.map||noop3,mapStream=opts.mapStream||echo,statNext=statAll(xfs,opts.dereference?xfs.stat:xfs.lstat,cwd,ignore,opts.entries,opts.sort),strict=opts.strict!==!1,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,pack=opts.pack||tar.pack(),finish=opts.finish||noop3;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var onsymlink=function(filename,header){xfs.readlink(path13.join(cwd,filename),function(err,linkname){if(err)return pack.destroy(err);header.linkname=normalize(linkname),pack.entry(header,onnextentry)})},onstat=function(err,filename,stat2){if(err)return pack.destroy(err);if(!filename)return opts.finalize!==!1&&pack.finalize(),finish(pack);if(stat2.isSocket())return onnextentry();var header={name:normalize(filename),mode:(stat2.mode|(stat2.isDirectory()?dmode:fmode))&umask,mtime:stat2.mtime,size:stat2.size,type:"file",uid:stat2.uid,gid:stat2.gid};if(stat2.isDirectory())return header.size=0,header.type="directory",header=map(header)||header,pack.entry(header,onnextentry);if(stat2.isSymbolicLink())return header.size=0,header.type="symlink",header=map(header)||header,onsymlink(filename,header);if(header=map(header)||header,!stat2.isFile())return strict?pack.destroy(new Error("unsupported type for "+filename)):onnextentry();var entry=pack.entry(header,onnextentry);if(entry){var rs=mapStream(xfs.createReadStream(path13.join(cwd,filename),{start:0,end:header.size>0?header.size-1:header.size}),header);rs.on("error",function(err2){entry.destroy(err2)}),pump2(rs,entry)}},onnextentry=function(err){if(err)return pack.destroy(err);statNext(onstat)};return onnextentry(),pack};var head=function(list){return list.length?list[list.length-1]:null},processGetuid=function(){return process.getuid?process.getuid():-1},processUmask=function(){return process.umask?process.umask():0};exports.extract=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs9,ignore=opts.ignore||opts.filter||noop3,map=opts.map||noop3,mapStream=opts.mapStream||echo,own=opts.chown!==!1&&!win32&&processGetuid()===0,extract2=opts.extract||tar.extract(),stack=[],now=new Date,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,strict=opts.strict!==!1;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var utimesParent=function(name,cb){for(var top;(top=head(stack))&&name.slice(0,top[0].length)!==top[0];)stack.pop();if(!top)return cb();xfs.utimes(top[0],now,top[1],cb)},utimes=function(name,header,cb){if(opts.utimes===!1)return cb();if(header.type==="directory")return xfs.utimes(name,now,header.mtime,cb);if(header.type==="symlink")return utimesParent(name,cb);xfs.utimes(name,now,header.mtime,function(err){if(err)return cb(err);utimesParent(name,cb)})},chperm=function(name,header,cb){var link=header.type==="symlink",chmod=link?xfs.lchmod:xfs.chmod,chown=link?xfs.lchown:xfs.chown;if(!chmod)return cb();var mode=(header.mode|(header.type==="directory"?dmode:fmode))&umask;chown&&own?chown.call(xfs,name,header.uid,header.gid,onchown):onchown(null);function onchown(err){if(err)return cb(err);if(!chmod)return cb();chmod.call(xfs,name,mode,cb)}};return extract2.on("entry",function(header,stream2,next){header=map(header)||header,header.name=normalize(header.name);var name=path13.join(cwd,path13.join("/",header.name));if(ignore(name,header))return stream2.resume(),next();var stat2=function(err){if(err)return next(err);utimes(name,header,function(err2){if(err2)return next(err2);if(win32)return next();chperm(name,header,next)})},onsymlink=function(){if(win32)return next();xfs.unlink(name,function(){xfs.symlink(header.linkname,name,stat2)})},onlink=function(){if(win32)return next();xfs.unlink(name,function(){var srcpath=path13.join(cwd,path13.join("/",header.linkname));xfs.link(srcpath,name,function(err){if(err&&err.code==="EPERM"&&opts.hardlinkAsFilesFallback)return stream2=xfs.createReadStream(srcpath),onfile();stat2(err)})})},onfile=function(){var ws=xfs.createWriteStream(name),rs=mapStream(stream2,header);ws.on("error",function(err){rs.destroy(err)}),pump2(rs,ws,function(err){if(err)return next(err);ws.on("close",stat2)})};if(header.type==="directory")return stack.push([name,header.mtime]),mkdirfix(name,{fs:xfs,own,uid:header.uid,gid:header.gid},stat2);var dir=path13.dirname(name);validate(xfs,dir,path13.join(cwd,"."),function(err,valid){if(err)return next(err);if(!valid)return next(new Error(dir+" is not a valid path"));mkdirfix(dir,{fs:xfs,own,uid:header.uid,gid:header.gid},function(err2){if(err2)return next(err2);switch(header.type){case"file":return onfile();case"link":return onlink();case"symlink":return onsymlink()}if(strict)return next(new Error("unsupported type for "+name+" ("+header.type+")"));stream2.resume(),next()})})}),opts.finish&&extract2.on("finish",opts.finish),extract2};function validate(fs10,name,root,cb){if(name===root)return cb(null,!0);fs10.lstat(name,function(err,st){if(err&&err.code!=="ENOENT")return cb(err);if(err||st.isDirectory())return validate(fs10,path13.join(name,".."),root,cb);cb(null,!1)})}function mkdirfix(name,opts,cb){mkdirp(name,{fs:opts.fs},function(err,made){!err&&made&&opts.own?chownr(made,opts.uid,opts.gid,cb):cb(err)})}}});var require_process_nextick_args=__commonJS({"../../node_modules/process-nextick-args/index.js"(exports,module2){"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?module2.exports={nextTick}:module2.exports=process;function nextTick(fn,arg1,arg2,arg3){if(typeof fn!="function")throw new TypeError('"callback" argument must be a function');var len=arguments.length,args,i2;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function(){fn.call(null,arg1)});case 3:return process.nextTick(function(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function(){fn.call(null,arg1,arg2,arg3)});default:for(args=new Array(len-1),i2=0;i2<args.length;)args[i2++]=arguments[i2];return process.nextTick(function(){fn.apply(null,args)})}}}});var require_isarray=__commonJS({"../../node_modules/peek-stream/node_modules/isarray/index.js"(exports,module2){"use strict";var toString2={}.toString;module2.exports=Array.isArray||function(arr){return toString2.call(arr)=="[object Array]"}}});var require_stream3=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/internal/streams/stream.js"(exports,module2){"use strict";module2.exports=require("stream")}});var require_safe_buffer2=__commonJS({"../../node_modules/peek-stream/node_modules/safe-buffer/index.js"(exports,module2){"use strict";var buffer=require("buffer"),Buffer4=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}Buffer4.from&&Buffer4.alloc&&Buffer4.allocUnsafe&&Buffer4.allocUnsafeSlow?module2.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer);function SafeBuffer(arg,encodingOrOffset,length){return Buffer4(arg,encodingOrOffset,length)}copyProps(Buffer4,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg=="number")throw new TypeError("Argument must not be a number");return Buffer4(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!="number")throw new TypeError("Argument must be a number");var buf=Buffer4(size);return fill!==void 0?typeof encoding=="string"?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return Buffer4(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}}});var require_util=__commonJS({"../../node_modules/core-util-is/lib/util.js"(exports){"use strict";function isArray(arg){return Array.isArray?Array.isArray(arg):objectToString(arg)==="[object Array]"}exports.isArray=isArray;function isBoolean(arg){return typeof arg=="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg=="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg=="string"}exports.isString=isString;function isSymbol(arg){return typeof arg=="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg=="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e2){return objectToString(e2)==="[object Error]"||e2 instanceof Error}exports.isError=isError;function isFunction2(arg){return typeof arg=="function"}exports.isFunction=isFunction2;function isPrimitive(arg){return arg===null||typeof arg=="boolean"||typeof arg=="number"||typeof arg=="string"||typeof arg=="symbol"||typeof arg>"u"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("buffer").Buffer.isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}});var require_BufferList2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports,module2){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var Buffer4=require_safe_buffer2().Buffer,util=require("util");function copyBuffer(src,target,offset){src.copy(target,offset)}module2.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};this.length===0&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(this.length!==0){var ret=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s2){if(this.length===0)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s2+p.data;return ret},BufferList.prototype.concat=function(n){if(this.length===0)return Buffer4.alloc(0);for(var ret=Buffer4.allocUnsafe(n>>>0),p=this.head,i2=0;p;)copyBuffer(p.data,ret,i2),i2+=p.data.length,p=p.next;return ret},BufferList}();util&&util.inspect&&util.inspect.custom&&(module2.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})}});var require_destroy2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports,module2){"use strict";var pna=require_process_nextick_args();function destroy(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):err&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,this,err)):pna.nextTick(emitErrorNT,this,err)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err2){!cb&&err2?_this._writableState?_this._writableState.errorEmitted||(_this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,_this,err2)):pna.nextTick(emitErrorNT,_this,err2):cb&&cb(err2)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(self2,err){self2.emit("error",err)}module2.exports={destroy,undestroy}}});var require_stream_writable2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_writable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Writable;function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}var asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick,Duplex2;Writable.WritableState=WritableState;var util=Object.create(require_util());util.inherits=require_inherits();var internalUtil={deprecate:require("util-deprecate")},Stream3=require_stream3(),Buffer4=require_safe_buffer2().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var destroyImpl=require_destroy2();util.inherits(Writable,Stream3);function nop(){}function WritableState(options,stream2){Duplex2=Duplex2||require_stream_duplex2(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,writableHwm=options.writableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(writableHwm||writableHwm===0)?this.highWaterMark=writableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream2,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var realHasInstance;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return realHasInstance.call(this,object)?!0:this!==Writable?!1:object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this};function Writable(options){if(Duplex2=Duplex2||require_stream_duplex2(),!realHasInstance.call(Writable,this)&&!(this instanceof Duplex2))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&(typeof options.write=="function"&&(this._write=options.write),typeof options.writev=="function"&&(this._writev=options.writev),typeof options.destroy=="function"&&(this._destroy=options.destroy),typeof options.final=="function"&&(this._final=options.final)),Stream3.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream2,cb){var er=new Error("write after end");stream2.emit("error",er),pna.nextTick(cb,er)}function validChunk(stream2,state,chunk,cb){var valid=!0,er=!1;return chunk===null?er=new TypeError("May not write null values to stream"):typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream2.emit("error",er),pna.nextTick(cb,er),valid=!1),valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&_isUint8Array(chunk);return isBuf&&!Buffer4.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),typeof encoding=="function"&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),typeof cb!="function"&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,!state.writing&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(this,state))};Writable.prototype.setDefaultEncoding=function(encoding){if(typeof encoding=="string"&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this};function decodeChunk(state,chunk,encoding){return!state.objectMode&&state.decodeStrings!==!1&&typeof chunk=="string"&&(chunk=Buffer4.from(chunk,encoding)),chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(stream2,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(ret||(state.needDrain=!0),state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk,encoding,isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream2,state,!1,len,chunk,encoding,cb);return ret}function doWrite(stream2,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream2._writev(chunk,state.onwrite):stream2._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream2,state,sync,er,cb){--state.pendingcb,sync?(pna.nextTick(cb,er),pna.nextTick(finishMaybe,stream2,state),stream2._writableState.errorEmitted=!0,stream2.emit("error",er)):(cb(er),stream2._writableState.errorEmitted=!0,stream2.emit("error",er),finishMaybe(stream2,state))}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream2,er){var state=stream2._writableState,sync=state.sync,cb=state.writecb;if(onwriteStateUpdate(state),er)onwriteError(stream2,state,sync,er,cb);else{var finished=needFinish(state);!finished&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(stream2,state),sync?asyncWrite(afterWrite,stream2,state,finished,cb):afterWrite(stream2,state,finished,cb)}}function afterWrite(stream2,state,finished,cb){finished||onwriteDrain(stream2,state),state.pendingcb--,cb(),finishMaybe(stream2,state)}function onwriteDrain(stream2,state){state.length===0&&state.needDrain&&(state.needDrain=!1,stream2.emit("drain"))}function clearBuffer(stream2,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream2._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream2,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback,len=state.objectMode?1:chunk.length;if(doWrite(stream2,state,!1,len,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}entry===null&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;typeof chunk=="function"?(cb=chunk,chunk=null,encoding=null):typeof encoding=="function"&&(cb=encoding,encoding=null),chunk!=null&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||endWritable(this,state,cb)};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing}function callFinal(stream2,state){stream2._final(function(err){state.pendingcb--,err&&stream2.emit("error",err),state.prefinished=!0,stream2.emit("prefinish"),finishMaybe(stream2,state)})}function prefinish(stream2,state){!state.prefinished&&!state.finalCalled&&(typeof stream2._final=="function"?(state.pendingcb++,state.finalCalled=!0,pna.nextTick(callFinal,stream2,state)):(state.prefinished=!0,stream2.emit("prefinish")))}function finishMaybe(stream2,state){var need=needFinish(state);return need&&(prefinish(stream2,state),state.pendingcb===0&&(state.finished=!0,stream2.emit("finish"))),need}function endWritable(stream2,state,cb){state.ending=!0,finishMaybe(stream2,state),cb&&(state.finished?pna.nextTick(cb):stream2.once("finish",cb)),state.ended=!0,stream2.writable=!1}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;for(corkReq.entry=null;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree.next=corkReq}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}});var require_stream_duplex2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_duplex.js"(exports,module2){"use strict";var pna=require_process_nextick_args(),objectKeys=Object.keys||function(obj){var keys2=[];for(var key in obj)keys2.push(key);return keys2};module2.exports=Duplex2;var util=Object.create(require_util());util.inherits=require_inherits();var Readable=require_stream_readable2(),Writable=require_stream_writable2();util.inherits(Duplex2,Readable);for(keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++)method=keys[v],Duplex2.prototype[method]||(Duplex2.prototype[method]=Writable.prototype[method]);var keys,method,v;function Duplex2(options){if(!(this instanceof Duplex2))return new Duplex2(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}Object.defineProperty(Duplex2.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(self2){self2.end()}Object.defineProperty(Duplex2.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(value){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=value,this._writableState.destroyed=value)}});Duplex2.prototype._destroy=function(err,cb){this.push(null),this.end(),pna.nextTick(cb,err)}}});var require_string_decoder2=__commonJS({"../../node_modules/peek-stream/node_modules/string_decoder/lib/string_decoder.js"(exports){"use strict";var Buffer4=require_safe_buffer2().Buffer,isEncoding=Buffer4.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!="string"&&(Buffer4.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:this.write=simpleWrite,this.end=simpleEnd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer4.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r2,i2;if(this.lastNeed){if(r2=this.fillLast(buf),r2===void 0)return"";i2=this.lastNeed,this.lastNeed=0}else i2=0;return i2<buf.length?r2?r2+this.text(buf,i2):this.text(buf,i2):r2||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length};function utf8CheckByte(byte){return byte<=127?0:byte>>5===6?2:byte>>4===14?3:byte>>3===30?4:byte>>6===2?-1:-2}function utf8CheckIncomplete(self2,buf,i2){var j=buf.length-1;if(j<i2)return 0;var nb=utf8CheckByte(buf[j]);return nb>=0?(nb>0&&(self2.lastNeed=nb-1),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(self2.lastNeed=nb-2),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(nb===2?nb=0:self2.lastNeed=nb-3),nb):0))}function utf8CheckExtraBytes(self2,buf,p){if((buf[0]&192)!==128)return self2.lastNeed=0,"\uFFFD";if(self2.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128)return self2.lastNeed=1,"\uFFFD";if(self2.lastNeed>2&&buf.length>2&&(buf[2]&192)!==128)return self2.lastNeed=2,"\uFFFD"}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r2=utf8CheckExtraBytes(this,buf,p);if(r2!==void 0)return r2;if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,p,0,buf.length),this.lastNeed-=buf.length}function utf8Text(buf,i2){var total=utf8CheckIncomplete(this,buf,i2);if(!this.lastNeed)return buf.toString("utf8",i2);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i2,end)}function utf8End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+"\uFFFD":r2}function utf16Text(buf,i2){if((buf.length-i2)%2===0){var r2=buf.toString("utf16le",i2);if(r2){var c=r2.charCodeAt(r2.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r2.slice(0,-1)}return r2}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i2,buf.length-1)}function utf16End(buf){var r2=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r2+this.lastChar.toString("utf16le",0,end)}return r2}function base64Text(buf,i2){var n=(buf.length-i2)%3;return n===0?buf.toString("base64",i2):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i2,buf.length-n))}function base64End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+this.lastChar.toString("base64",0,3-this.lastNeed):r2}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}}});var require_stream_readable2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_readable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Readable;var isArray=require_isarray(),Duplex2;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream3=require_stream3(),Buffer4=require_safe_buffer2().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var util=Object.create(require_util());util.inherits=require_inherits();var debugUtil=require("util"),debug=void 0;debugUtil&&debugUtil.debuglog?debug=debugUtil.debuglog("stream"):debug=function(){};var BufferList=require_BufferList2(),destroyImpl=require_destroy2(),StringDecoder;util.inherits(Readable,Stream3);var kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(emitter,event,fn){if(typeof emitter.prependListener=="function")return emitter.prependListener(event,fn);!emitter._events||!emitter._events[event]?emitter.on(event,fn):isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]}function ReadableState(options,stream2){Duplex2=Duplex2||require_stream_duplex2(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,readableHwm=options.readableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(readableHwm||readableHwm===0)?this.highWaterMark=readableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require_string_decoder2().StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex2=Duplex2||require_stream_duplex2(),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&(typeof options.read=="function"&&(this._read=options.read),typeof options.destroy=="function"&&(this._destroy=options.destroy)),Stream3.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}});Readable.prototype.destroy=destroyImpl.destroy;Readable.prototype._undestroy=destroyImpl.undestroy;Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)};Readable.prototype.push=function(chunk,encoding){var state=this._readableState,skipChunkCheck;return state.objectMode?skipChunkCheck=!0:typeof chunk=="string"&&(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=Buffer4.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)};Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)};function readableAddChunk(stream2,chunk,encoding,addToFront,skipChunkCheck){var state=stream2._readableState;if(chunk===null)state.reading=!1,onEofChunk(stream2,state);else{var er;skipChunkCheck||(er=chunkInvalid(state,chunk)),er?stream2.emit("error",er):state.objectMode||chunk&&chunk.length>0?(typeof chunk!="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer4.prototype&&(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream2.emit("error",new Error("stream.unshift() after end event")):addChunk(stream2,state,chunk,!0):state.ended?stream2.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||chunk.length!==0?addChunk(stream2,state,chunk,!1):maybeReadMore(stream2,state)):addChunk(stream2,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream2,state,chunk,addToFront){state.flowing&&state.length===0&&!state.sync?(stream2.emit("data",chunk),stream2.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream2)),maybeReadMore(stream2,state)}function chunkInvalid(state,chunk){var er;return!_isUint8Array(chunk)&&typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===!1};Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=require_string_decoder2().StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;function computeNewHighWaterMark(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||state.length===0&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(n!==0&&(state.emittedReadable=!1),n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),state.length===0&&state.ended?endReadable(this):emitReadable(this),null;if(n=howMuchToRead(n,state),n===0&&state.ended)return state.length===0&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(state.length===0||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),state.ended||state.reading?(doRead=!1,debug("reading or ended",doRead)):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,state.length===0&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state)));var ret;return n>0?ret=fromList(n,state):ret=null,ret===null?(state.needReadable=!0,n=0):state.length-=n,state.length===0&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),ret!==null&&this.emit("data",ret),ret};function onEofChunk(stream2,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream2)}}function emitReadable(stream2){var state=stream2._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream2):emitReadable_(stream2))}function emitReadable_(stream2){debug("emit readable"),stream2.emit("readable"),flow(stream2)}function maybeReadMore(stream2,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream2,state))}function maybeReadMore_(stream2,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream2.read(0),len!==state.length);)len=state.length;state.readingMore=!1}Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1;function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain)&&ondrain()}var increasedAwaitDrain=!1;src.on("data",ondata);function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1;var ret=dest.write(chunk);ret===!1&&!increasedAwaitDrain&&((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",state.awaitDrain),state.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),EElistenerCount(dest,"error")===0&&dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish),unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe"),src.unpipe(dest)}return dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,state.awaitDrain===0&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(state.pipesCount===0)return this;if(state.pipesCount===1)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i2=0;i2<len;i2++)dests[i2].emit("unpipe",this,{hasUnpiped:!1});return this}var index=indexOf(state.pipes,dest);return index===-1?this:(state.pipes.splice(index,1),state.pipesCount-=1,state.pipesCount===1&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)};Readable.prototype.on=function(ev,fn){var res=Stream3.prototype.on.call(this,ev,fn);if(ev==="data")this._readableState.flowing!==!1&&this.resume();else if(ev==="readable"){var state=this._readableState;!state.endEmitted&&!state.readableListening&&(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return res};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(self2){debug("readable nexttick read 0"),self2.read(0)}Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,resume(this,state)),this};function resume(stream2,state){state.resumeScheduled||(state.resumeScheduled=!0,pna.nextTick(resume_,stream2,state))}function resume_(stream2,state){state.reading||(debug("resume read 0"),stream2.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream2.emit("resume"),flow(stream2),state.flowing&&!state.reading&&stream2.read(0)}Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function flow(stream2){var state=stream2._readableState;for(debug("flow",state.flowing);state.flowing&&stream2.read()!==null;);}Readable.prototype.wrap=function(stream2){var _this=this,state=this._readableState,paused=!1;stream2.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream2.on("data",function(chunk){if(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!(state.objectMode&&chunk==null)&&!(!state.objectMode&&(!chunk||!chunk.length))){var ret=_this.push(chunk);ret||(paused=!0,stream2.pause())}});for(var i2 in stream2)this[i2]===void 0&&typeof stream2[i2]=="function"&&(this[i2]=function(method){return function(){return stream2[method].apply(stream2,arguments)}}(i2));for(var n=0;n<kProxyEvents.length;n++)stream2.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n2){debug("wrapped _read",n2),paused&&(paused=!1,stream2.resume())},this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(n,state){if(state.length===0)return null;var ret;return state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(state.decoder?ret=state.buffer.join(""):state.buffer.length===1?ret=state.buffer.head.data:ret=state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):n===list.head.data.length?ret=list.shift():ret=hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list),ret}function copyFromBufferString(n,list){var p=list.head,c=1,ret=p.data;for(n-=ret.length;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),n-=nb,n===0){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer4.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),n-=nb,n===0){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream2){var state=stream2._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream2))}function endReadableNT(state,stream2){!state.endEmitted&&state.length===0&&(state.endEmitted=!0,stream2.readable=!1,stream2.emit("end"))}function indexOf(xs,x2){for(var i2=0,l=xs.length;i2<l;i2++)if(xs[i2]===x2)return i2;return-1}}});var require_stream_transform2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_transform.js"(exports,module2){"use strict";module2.exports=Transform;var Duplex2=require_stream_duplex2(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(Transform,Duplex2);function afterTransform(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return this.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,data!=null&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex2.call(this,options),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&(typeof options.transform=="function"&&(this._transform=options.transform),typeof options.flush=="function"&&(this._flush=options.flush)),this.on("prefinish",prefinish)}function prefinish(){var _this=this;typeof this._flush=="function"?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex2.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;ts.writechunk!==null&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0};Transform.prototype._destroy=function(err,cb){var _this2=this;Duplex2.prototype._destroy.call(this,err,function(err2){cb(err2),_this2.emit("close")})};function done(stream2,er,data){if(er)return stream2.emit("error",er);if(data!=null&&stream2.push(data),stream2._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(stream2._transformState.transforming)throw new Error("Calling transform done when still transforming");return stream2.push(null)}}});var require_stream_passthrough2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_passthrough.js"(exports,module2){"use strict";module2.exports=PassThrough3;var Transform=require_stream_transform2(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(PassThrough3,Transform);function PassThrough3(options){if(!(this instanceof PassThrough3))return new PassThrough3(options);Transform.call(this,options)}PassThrough3.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}}});var require_readable2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/readable.js"(exports,module2){"use strict";var Stream3=require("stream");process.env.READABLE_STREAM==="disable"&&Stream3?(module2.exports=Stream3,exports=module2.exports=Stream3.Readable,exports.Readable=Stream3.Readable,exports.Writable=Stream3.Writable,exports.Duplex=Stream3.Duplex,exports.Transform=Stream3.Transform,exports.PassThrough=Stream3.PassThrough,exports.Stream=Stream3):(exports=module2.exports=require_stream_readable2(),exports.Stream=Stream3||exports,exports.Readable=exports,exports.Writable=require_stream_writable2(),exports.Duplex=require_stream_duplex2(),exports.Transform=require_stream_transform2(),exports.PassThrough=require_stream_passthrough2())}});var require_stream_shift=__commonJS({"../../node_modules/stream-shift/index.js"(exports,module2){"use strict";module2.exports=shift;function shift(stream2){var rs=stream2._readableState;return rs?rs.objectMode||typeof stream2._duplexState=="number"?stream2.read():stream2.read(getStateLength(rs)):null}function getStateLength(state){return state.buffer.length?state.buffer.head?state.buffer.head.data.length:state.buffer[0].length:state.length}}});var require_duplexify=__commonJS({"../../node_modules/peek-stream/node_modules/duplexify/index.js"(exports,module2){"use strict";var stream2=require_readable2(),eos=require_end_of_stream(),inherits=require_inherits(),shift=require_stream_shift(),SIGNAL_FLUSH=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),onuncork=function(self2,fn){self2._corked?self2.once("uncork",fn):fn()},autoDestroy=function(self2,err){self2._autoDestroy&&self2.destroy(err)},destroyer=function(self2,end2){return function(err){err?autoDestroy(self2,err.message==="premature close"?null:err):end2&&!self2._ended&&self2.end()}},end=function(ws,fn){if(!ws||ws._writableState&&ws._writableState.finished)return fn();if(ws._writableState)return ws.end(fn);ws.end(),fn()},toStreams2=function(rs){return new stream2.Readable({objectMode:!0,highWaterMark:16}).wrap(rs)},Duplexify=function(writable,readable,opts){if(!(this instanceof Duplexify))return new Duplexify(writable,readable,opts);stream2.Duplex.call(this,opts),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!opts||opts.autoDestroy!==!1,this._forwardDestroy=!opts||opts.destroy!==!1,this._forwardEnd=!opts||opts.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,writable&&this.setWritable(writable),readable&&this.setReadable(readable)};inherits(Duplexify,stream2.Duplex);Duplexify.obj=function(writable,readable,opts){return opts||(opts={}),opts.objectMode=!0,opts.highWaterMark=16,new Duplexify(writable,readable,opts)};Duplexify.prototype.cork=function(){++this._corked===1&&this.emit("cork")};Duplexify.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};Duplexify.prototype.setWritable=function(writable){if(this._unwrite&&this._unwrite(),this.destroyed){writable&&writable.destroy&&writable.destroy();return}if(writable===null||writable===!1){this.end();return}var self2=this,unend=eos(writable,{writable:!0,readable:!1},destroyer(this,this._forwardEnd)),ondrain=function(){var ondrain2=self2._ondrain;self2._ondrain=null,ondrain2&&ondrain2()},clear=function(){self2._writable.removeListener("drain",ondrain),unend()};this._unwrite&&process.nextTick(ondrain),this._writable=writable,this._writable.on("drain",ondrain),this._unwrite=clear,this.uncork()};Duplexify.prototype.setReadable=function(readable){if(this._unread&&this._unread(),this.destroyed){readable&&readable.destroy&&readable.destroy();return}if(readable===null||readable===!1){this.push(null),this.resume();return}var self2=this,unend=eos(readable,{writable:!1,readable:!0},destroyer(this)),onreadable=function(){self2._forward()},onend=function(){self2.push(null)},clear=function(){self2._readable2.removeListener("readable",onreadable),self2._readable2.removeListener("end",onend),unend()};this._drained=!0,this._readable=readable,this._readable2=readable._readableState?readable:toStreams2(readable),this._readable2.on("readable",onreadable),this._readable2.on("end",onend),this._unread=clear,this._forward()};Duplexify.prototype._read=function(){this._drained=!0,this._forward()};Duplexify.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var data;this._drained&&(data=shift(this._readable2))!==null;)this.destroyed||(this._drained=this.push(data));this._forwarding=!1}};Duplexify.prototype.destroy=function(err){if(!this.destroyed){this.destroyed=!0;var self2=this;process.nextTick(function(){self2._destroy(err)})}};Duplexify.prototype._destroy=function(err){if(err){var ondrain=this._ondrain;this._ondrain=null,ondrain?ondrain(err):this.emit("error",err)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};Duplexify.prototype._write=function(data,enc,cb){if(this.destroyed)return cb();if(this._corked)return onuncork(this,this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return this._finish(cb);if(!this._writable)return cb();this._writable.write(data)===!1?this._ondrain=cb:cb()};Duplexify.prototype._finish=function(cb){var self2=this;this.emit("preend"),onuncork(this,function(){end(self2._forwardEnd&&self2._writable,function(){self2._writableState.prefinished===!1&&(self2._writableState.prefinished=!0),self2.emit("prefinish"),onuncork(self2,cb)})})};Duplexify.prototype.end=function(data,enc,cb){return typeof data=="function"?this.end(null,null,data):typeof enc=="function"?this.end(data,null,enc):(this._ended=!0,data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream2.Writable.prototype.end.call(this,cb))};module2.exports=Duplexify}});var require_isarray2=__commonJS({"../../node_modules/through2/node_modules/isarray/index.js"(exports,module2){"use strict";var toString2={}.toString;module2.exports=Array.isArray||function(arr){return toString2.call(arr)=="[object Array]"}}});var require_stream4=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream.js"(exports,module2){"use strict";module2.exports=require("stream")}});var require_safe_buffer3=__commonJS({"../../node_modules/through2/node_modules/safe-buffer/index.js"(exports,module2){"use strict";var buffer=require("buffer"),Buffer4=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}Buffer4.from&&Buffer4.alloc&&Buffer4.allocUnsafe&&Buffer4.allocUnsafeSlow?module2.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer);function SafeBuffer(arg,encodingOrOffset,length){return Buffer4(arg,encodingOrOffset,length)}copyProps(Buffer4,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg=="number")throw new TypeError("Argument must not be a number");return Buffer4(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!="number")throw new TypeError("Argument must be a number");var buf=Buffer4(size);return fill!==void 0?typeof encoding=="string"?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return Buffer4(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}}});var require_BufferList3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports,module2){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var Buffer4=require_safe_buffer3().Buffer,util=require("util");function copyBuffer(src,target,offset){src.copy(target,offset)}module2.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};this.length===0&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(this.length!==0){var ret=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s2){if(this.length===0)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s2+p.data;return ret},BufferList.prototype.concat=function(n){if(this.length===0)return Buffer4.alloc(0);for(var ret=Buffer4.allocUnsafe(n>>>0),p=this.head,i2=0;p;)copyBuffer(p.data,ret,i2),i2+=p.data.length,p=p.next;return ret},BufferList}();util&&util.inspect&&util.inspect.custom&&(module2.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})}});var require_destroy3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports,module2){"use strict";var pna=require_process_nextick_args();function destroy(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):err&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,this,err)):pna.nextTick(emitErrorNT,this,err)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err2){!cb&&err2?_this._writableState?_this._writableState.errorEmitted||(_this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,_this,err2)):pna.nextTick(emitErrorNT,_this,err2):cb&&cb(err2)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(self2,err){self2.emit("error",err)}module2.exports={destroy,undestroy}}});var require_stream_writable3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Writable;function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}var asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick,Duplex2;Writable.WritableState=WritableState;var util=Object.create(require_util());util.inherits=require_inherits();var internalUtil={deprecate:require("util-deprecate")},Stream3=require_stream4(),Buffer4=require_safe_buffer3().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var destroyImpl=require_destroy3();util.inherits(Writable,Stream3);function nop(){}function WritableState(options,stream2){Duplex2=Duplex2||require_stream_duplex3(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,writableHwm=options.writableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(writableHwm||writableHwm===0)?this.highWaterMark=writableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream2,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var realHasInstance;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return realHasInstance.call(this,object)?!0:this!==Writable?!1:object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this};function Writable(options){if(Duplex2=Duplex2||require_stream_duplex3(),!realHasInstance.call(Writable,this)&&!(this instanceof Duplex2))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&(typeof options.write=="function"&&(this._write=options.write),typeof options.writev=="function"&&(this._writev=options.writev),typeof options.destroy=="function"&&(this._destroy=options.destroy),typeof options.final=="function"&&(this._final=options.final)),Stream3.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream2,cb){var er=new Error("write after end");stream2.emit("error",er),pna.nextTick(cb,er)}function validChunk(stream2,state,chunk,cb){var valid=!0,er=!1;return chunk===null?er=new TypeError("May not write null values to stream"):typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream2.emit("error",er),pna.nextTick(cb,er),valid=!1),valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&_isUint8Array(chunk);return isBuf&&!Buffer4.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),typeof encoding=="function"&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),typeof cb!="function"&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,!state.writing&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(this,state))};Writable.prototype.setDefaultEncoding=function(encoding){if(typeof encoding=="string"&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this};function decodeChunk(state,chunk,encoding){return!state.objectMode&&state.decodeStrings!==!1&&typeof chunk=="string"&&(chunk=Buffer4.from(chunk,encoding)),chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(stream2,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(ret||(state.needDrain=!0),state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk,encoding,isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream2,state,!1,len,chunk,encoding,cb);return ret}function doWrite(stream2,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream2._writev(chunk,state.onwrite):stream2._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream2,state,sync,er,cb){--state.pendingcb,sync?(pna.nextTick(cb,er),pna.nextTick(finishMaybe,stream2,state),stream2._writableState.errorEmitted=!0,stream2.emit("error",er)):(cb(er),stream2._writableState.errorEmitted=!0,stream2.emit("error",er),finishMaybe(stream2,state))}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream2,er){var state=stream2._writableState,sync=state.sync,cb=state.writecb;if(onwriteStateUpdate(state),er)onwriteError(stream2,state,sync,er,cb);else{var finished=needFinish(state);!finished&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(stream2,state),sync?asyncWrite(afterWrite,stream2,state,finished,cb):afterWrite(stream2,state,finished,cb)}}function afterWrite(stream2,state,finished,cb){finished||onwriteDrain(stream2,state),state.pendingcb--,cb(),finishMaybe(stream2,state)}function onwriteDrain(stream2,state){state.length===0&&state.needDrain&&(state.needDrain=!1,stream2.emit("drain"))}function clearBuffer(stream2,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream2._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream2,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback,len=state.objectMode?1:chunk.length;if(doWrite(stream2,state,!1,len,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}entry===null&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;typeof chunk=="function"?(cb=chunk,chunk=null,encoding=null):typeof encoding=="function"&&(cb=encoding,encoding=null),chunk!=null&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||endWritable(this,state,cb)};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing}function callFinal(stream2,state){stream2._final(function(err){state.pendingcb--,err&&stream2.emit("error",err),state.prefinished=!0,stream2.emit("prefinish"),finishMaybe(stream2,state)})}function prefinish(stream2,state){!state.prefinished&&!state.finalCalled&&(typeof stream2._final=="function"?(state.pendingcb++,state.finalCalled=!0,pna.nextTick(callFinal,stream2,state)):(state.prefinished=!0,stream2.emit("prefinish")))}function finishMaybe(stream2,state){var need=needFinish(state);return need&&(prefinish(stream2,state),state.pendingcb===0&&(state.finished=!0,stream2.emit("finish"))),need}function endWritable(stream2,state,cb){state.ending=!0,finishMaybe(stream2,state),cb&&(state.finished?pna.nextTick(cb):stream2.once("finish",cb)),state.ended=!0,stream2.writable=!1}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;for(corkReq.entry=null;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree.next=corkReq}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}});var require_stream_duplex3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js"(exports,module2){"use strict";var pna=require_process_nextick_args(),objectKeys=Object.keys||function(obj){var keys2=[];for(var key in obj)keys2.push(key);return keys2};module2.exports=Duplex2;var util=Object.create(require_util());util.inherits=require_inherits();var Readable=require_stream_readable3(),Writable=require_stream_writable3();util.inherits(Duplex2,Readable);for(keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++)method=keys[v],Duplex2.prototype[method]||(Duplex2.prototype[method]=Writable.prototype[method]);var keys,method,v;function Duplex2(options){if(!(this instanceof Duplex2))return new Duplex2(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}Object.defineProperty(Duplex2.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(self2){self2.end()}Object.defineProperty(Duplex2.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(value){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=value,this._writableState.destroyed=value)}});Duplex2.prototype._destroy=function(err,cb){this.push(null),this.end(),pna.nextTick(cb,err)}}});var require_string_decoder3=__commonJS({"../../node_modules/through2/node_modules/string_decoder/lib/string_decoder.js"(exports){"use strict";var Buffer4=require_safe_buffer3().Buffer,isEncoding=Buffer4.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!="string"&&(Buffer4.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:this.write=simpleWrite,this.end=simpleEnd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer4.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r2,i2;if(this.lastNeed){if(r2=this.fillLast(buf),r2===void 0)return"";i2=this.lastNeed,this.lastNeed=0}else i2=0;return i2<buf.length?r2?r2+this.text(buf,i2):this.text(buf,i2):r2||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length};function utf8CheckByte(byte){return byte<=127?0:byte>>5===6?2:byte>>4===14?3:byte>>3===30?4:byte>>6===2?-1:-2}function utf8CheckIncomplete(self2,buf,i2){var j=buf.length-1;if(j<i2)return 0;var nb=utf8CheckByte(buf[j]);return nb>=0?(nb>0&&(self2.lastNeed=nb-1),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(self2.lastNeed=nb-2),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(nb===2?nb=0:self2.lastNeed=nb-3),nb):0))}function utf8CheckExtraBytes(self2,buf,p){if((buf[0]&192)!==128)return self2.lastNeed=0,"\uFFFD";if(self2.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128)return self2.lastNeed=1,"\uFFFD";if(self2.lastNeed>2&&buf.length>2&&(buf[2]&192)!==128)return self2.lastNeed=2,"\uFFFD"}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r2=utf8CheckExtraBytes(this,buf,p);if(r2!==void 0)return r2;if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,p,0,buf.length),this.lastNeed-=buf.length}function utf8Text(buf,i2){var total=utf8CheckIncomplete(this,buf,i2);if(!this.lastNeed)return buf.toString("utf8",i2);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i2,end)}function utf8End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+"\uFFFD":r2}function utf16Text(buf,i2){if((buf.length-i2)%2===0){var r2=buf.toString("utf16le",i2);if(r2){var c=r2.charCodeAt(r2.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r2.slice(0,-1)}return r2}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i2,buf.length-1)}function utf16End(buf){var r2=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r2+this.lastChar.toString("utf16le",0,end)}return r2}function base64Text(buf,i2){var n=(buf.length-i2)%3;return n===0?buf.toString("base64",i2):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i2,buf.length-n))}function base64End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+this.lastChar.toString("base64",0,3-this.lastNeed):r2}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}}});var require_stream_readable3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Readable;var isArray=require_isarray2(),Duplex2;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream3=require_stream4(),Buffer4=require_safe_buffer3().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var util=Object.create(require_util());util.inherits=require_inherits();var debugUtil=require("util"),debug=void 0;debugUtil&&debugUtil.debuglog?debug=debugUtil.debuglog("stream"):debug=function(){};var BufferList=require_BufferList3(),destroyImpl=require_destroy3(),StringDecoder;util.inherits(Readable,Stream3);var kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(emitter,event,fn){if(typeof emitter.prependListener=="function")return emitter.prependListener(event,fn);!emitter._events||!emitter._events[event]?emitter.on(event,fn):isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]}function ReadableState(options,stream2){Duplex2=Duplex2||require_stream_duplex3(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,readableHwm=options.readableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(readableHwm||readableHwm===0)?this.highWaterMark=readableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require_string_decoder3().StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex2=Duplex2||require_stream_duplex3(),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&(typeof options.read=="function"&&(this._read=options.read),typeof options.destroy=="function"&&(this._destroy=options.destroy)),Stream3.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}});Readable.prototype.destroy=destroyImpl.destroy;Readable.prototype._undestroy=destroyImpl.undestroy;Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)};Readable.prototype.push=function(chunk,encoding){var state=this._readableState,skipChunkCheck;return state.objectMode?skipChunkCheck=!0:typeof chunk=="string"&&(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=Buffer4.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)};Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)};function readableAddChunk(stream2,chunk,encoding,addToFront,skipChunkCheck){var state=stream2._readableState;if(chunk===null)state.reading=!1,onEofChunk(stream2,state);else{var er;skipChunkCheck||(er=chunkInvalid(state,chunk)),er?stream2.emit("error",er):state.objectMode||chunk&&chunk.length>0?(typeof chunk!="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer4.prototype&&(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream2.emit("error",new Error("stream.unshift() after end event")):addChunk(stream2,state,chunk,!0):state.ended?stream2.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||chunk.length!==0?addChunk(stream2,state,chunk,!1):maybeReadMore(stream2,state)):addChunk(stream2,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream2,state,chunk,addToFront){state.flowing&&state.length===0&&!state.sync?(stream2.emit("data",chunk),stream2.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream2)),maybeReadMore(stream2,state)}function chunkInvalid(state,chunk){var er;return!_isUint8Array(chunk)&&typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===!1};Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=require_string_decoder3().StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;function computeNewHighWaterMark(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||state.length===0&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(n!==0&&(state.emittedReadable=!1),n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),state.length===0&&state.ended?endReadable(this):emitReadable(this),null;if(n=howMuchToRead(n,state),n===0&&state.ended)return state.length===0&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(state.length===0||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),state.ended||state.reading?(doRead=!1,debug("reading or ended",doRead)):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,state.length===0&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state)));var ret;return n>0?ret=fromList(n,state):ret=null,ret===null?(state.needReadable=!0,n=0):state.length-=n,state.length===0&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),ret!==null&&this.emit("data",ret),ret};function onEofChunk(stream2,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream2)}}function emitReadable(stream2){var state=stream2._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream2):emitReadable_(stream2))}function emitReadable_(stream2){debug("emit readable"),stream2.emit("readable"),flow(stream2)}function maybeReadMore(stream2,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream2,state))}function maybeReadMore_(stream2,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream2.read(0),len!==state.length);)len=state.length;state.readingMore=!1}Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1;function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain)&&ondrain()}var increasedAwaitDrain=!1;src.on("data",ondata);function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1;var ret=dest.write(chunk);ret===!1&&!increasedAwaitDrain&&((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",state.awaitDrain),state.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),EElistenerCount(dest,"error")===0&&dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish),unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe"),src.unpipe(dest)}return dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,state.awaitDrain===0&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(state.pipesCount===0)return this;if(state.pipesCount===1)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i2=0;i2<len;i2++)dests[i2].emit("unpipe",this,{hasUnpiped:!1});return this}var index=indexOf(state.pipes,dest);return index===-1?this:(state.pipes.splice(index,1),state.pipesCount-=1,state.pipesCount===1&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)};Readable.prototype.on=function(ev,fn){var res=Stream3.prototype.on.call(this,ev,fn);if(ev==="data")this._readableState.flowing!==!1&&this.resume();else if(ev==="readable"){var state=this._readableState;!state.endEmitted&&!state.readableListening&&(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return res};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(self2){debug("readable nexttick read 0"),self2.read(0)}Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,resume(this,state)),this};function resume(stream2,state){state.resumeScheduled||(state.resumeScheduled=!0,pna.nextTick(resume_,stream2,state))}function resume_(stream2,state){state.reading||(debug("resume read 0"),stream2.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream2.emit("resume"),flow(stream2),state.flowing&&!state.reading&&stream2.read(0)}Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function flow(stream2){var state=stream2._readableState;for(debug("flow",state.flowing);state.flowing&&stream2.read()!==null;);}Readable.prototype.wrap=function(stream2){var _this=this,state=this._readableState,paused=!1;stream2.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream2.on("data",function(chunk){if(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!(state.objectMode&&chunk==null)&&!(!state.objectMode&&(!chunk||!chunk.length))){var ret=_this.push(chunk);ret||(paused=!0,stream2.pause())}});for(var i2 in stream2)this[i2]===void 0&&typeof stream2[i2]=="function"&&(this[i2]=function(method){return function(){return stream2[method].apply(stream2,arguments)}}(i2));for(var n=0;n<kProxyEvents.length;n++)stream2.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n2){debug("wrapped _read",n2),paused&&(paused=!1,stream2.resume())},this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(n,state){if(state.length===0)return null;var ret;return state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(state.decoder?ret=state.buffer.join(""):state.buffer.length===1?ret=state.buffer.head.data:ret=state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):n===list.head.data.length?ret=list.shift():ret=hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list),ret}function copyFromBufferString(n,list){var p=list.head,c=1,ret=p.data;for(n-=ret.length;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),n-=nb,n===0){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer4.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),n-=nb,n===0){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream2){var state=stream2._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream2))}function endReadableNT(state,stream2){!state.endEmitted&&state.length===0&&(state.endEmitted=!0,stream2.readable=!1,stream2.emit("end"))}function indexOf(xs,x2){for(var i2=0,l=xs.length;i2<l;i2++)if(xs[i2]===x2)return i2;return-1}}});var require_stream_transform3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js"(exports,module2){"use strict";module2.exports=Transform;var Duplex2=require_stream_duplex3(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(Transform,Duplex2);function afterTransform(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return this.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,data!=null&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex2.call(this,options),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&(typeof options.transform=="function"&&(this._transform=options.transform),typeof options.flush=="function"&&(this._flush=options.flush)),this.on("prefinish",prefinish)}function prefinish(){var _this=this;typeof this._flush=="function"?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex2.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;ts.writechunk!==null&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0};Transform.prototype._destroy=function(err,cb){var _this2=this;Duplex2.prototype._destroy.call(this,err,function(err2){cb(err2),_this2.emit("close")})};function done(stream2,er,data){if(er)return stream2.emit("error",er);if(data!=null&&stream2.push(data),stream2._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(stream2._transformState.transforming)throw new Error("Calling transform done when still transforming");return stream2.push(null)}}});var require_stream_passthrough3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js"(exports,module2){"use strict";module2.exports=PassThrough3;var Transform=require_stream_transform3(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(PassThrough3,Transform);function PassThrough3(options){if(!(this instanceof PassThrough3))return new PassThrough3(options);Transform.call(this,options)}PassThrough3.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}}});var require_readable3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/readable.js"(exports,module2){"use strict";var Stream3=require("stream");process.env.READABLE_STREAM==="disable"&&Stream3?(module2.exports=Stream3,exports=module2.exports=Stream3.Readable,exports.Readable=Stream3.Readable,exports.Writable=Stream3.Writable,exports.Duplex=Stream3.Duplex,exports.Transform=Stream3.Transform,exports.PassThrough=Stream3.PassThrough,exports.Stream=Stream3):(exports=module2.exports=require_stream_readable3(),exports.Stream=Stream3||exports,exports.Readable=exports,exports.Writable=require_stream_writable3(),exports.Duplex=require_stream_duplex3(),exports.Transform=require_stream_transform3(),exports.PassThrough=require_stream_passthrough3())}});var require_immutable=__commonJS({"../../node_modules/xtend/immutable.js"(exports,module2){"use strict";module2.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){for(var target={},i2=0;i2<arguments.length;i2++){var source=arguments[i2];for(var key in source)hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target}}});var require_through2=__commonJS({"../../node_modules/through2/through2.js"(exports,module2){"use strict";var Transform=require_readable3().Transform,inherits=require("util").inherits,xtend=require_immutable();function DestroyableTransform(opts){Transform.call(this,opts),this._destroyed=!1}inherits(DestroyableTransform,Transform);DestroyableTransform.prototype.destroy=function(err){if(!this._destroyed){this._destroyed=!0;var self2=this;process.nextTick(function(){err&&self2.emit("error",err),self2.emit("close")})}};function noop3(chunk,enc,callback){callback(null,chunk)}function through2(construct){return function(options,transform,flush){return typeof options=="function"&&(flush=transform,transform=options,options={}),typeof transform!="function"&&(transform=noop3),typeof flush!="function"&&(flush=null),construct(options,transform,flush)}}module2.exports=through2(function(options,transform,flush){var t2=new DestroyableTransform(options);return t2._transform=transform,flush&&(t2._flush=flush),t2});module2.exports.ctor=through2(function(options,transform,flush){function Through2(override){if(!(this instanceof Through2))return new Through2(override);this.options=xtend(options,override),DestroyableTransform.call(this,this.options)}return inherits(Through2,DestroyableTransform),Through2.prototype._transform=transform,flush&&(Through2.prototype._flush=flush),Through2});module2.exports.obj=through2(function(options,transform,flush){var t2=new DestroyableTransform(xtend({objectMode:!0,highWaterMark:16},options));return t2._transform=transform,flush&&(t2._flush=flush),t2})}});var require_buffer_from=__commonJS({"../../node_modules/buffer-from/index.js"(exports,module2){"use strict";var toString2=Object.prototype.toString,isModern=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function isArrayBuffer(input){return toString2.call(input).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(obj,byteOffset,length){byteOffset>>>=0;var maxLength=obj.byteLength-byteOffset;if(maxLength<0)throw new RangeError("'offset' is out of bounds");if(length===void 0)length=maxLength;else if(length>>>=0,length>maxLength)throw new RangeError("'length' is out of bounds");return isModern?Buffer.from(obj.slice(byteOffset,byteOffset+length)):new Buffer(new Uint8Array(obj.slice(byteOffset,byteOffset+length)))}function fromString(string,encoding){if((typeof encoding!="string"||encoding==="")&&(encoding="utf8"),!Buffer.isEncoding(encoding))throw new TypeError('"encoding" must be a valid string encoding');return isModern?Buffer.from(string,encoding):new Buffer(string,encoding)}function bufferFrom(value,encodingOrOffset,length){if(typeof value=="number")throw new TypeError('"value" argument must not be a number');return isArrayBuffer(value)?fromArrayBuffer(value,encodingOrOffset,length):typeof value=="string"?fromString(value,encodingOrOffset):isModern?Buffer.from(value):new Buffer(value)}module2.exports=bufferFrom}});var require_peek_stream=__commonJS({"../../node_modules/peek-stream/index.js"(exports,module2){"use strict";var duplexify=require_duplexify(),through=require_through2(),bufferFrom=require_buffer_from(),isObject=function(data){return!Buffer.isBuffer(data)&&typeof data!="string"},peek=function(opts,onpeek){if(typeof opts=="number"&&(opts={maxBuffer:opts}),typeof opts=="function")return peek(null,opts);opts||(opts={});var maxBuffer=typeof opts.maxBuffer=="number"?opts.maxBuffer:65535,strict=opts.strict,newline=opts.newline!==!1,buffer=[],bufferSize=0,dup=duplexify.obj(),peeker=through.obj({highWaterMark:1},function(data,enc,cb){if(isObject(data))return ready(data,null,cb);if(Buffer.isBuffer(data)||(data=bufferFrom(data)),newline){var nl=Array.prototype.indexOf.call(data,10);if(nl>0&&data[nl-1]===13&&nl--,nl>-1)return buffer.push(data.slice(0,nl)),ready(Buffer.concat(buffer),data.slice(nl),cb)}if(buffer.push(data),bufferSize+=data.length,bufferSize<maxBuffer)return cb();if(strict)return cb(new Error("No newline found"));ready(Buffer.concat(buffer),null,cb)}),onpreend=function(){if(strict)return dup.destroy(new Error("No newline found"));dup.cork(),ready(Buffer.concat(buffer),null,function(err){if(err)return dup.destroy(err);dup.uncork()})},ready=function(data,overflow,cb){dup.removeListener("preend",onpreend),onpeek(data,function(err,parser){if(err)return cb(err);dup.setWritable(parser),dup.setReadable(parser),data&&parser.write(data),overflow&&parser.write(overflow),overflow=buffer=peeker=null,cb()})};return dup.on("preend",onpreend),dup.setWritable(peeker),dup};module2.exports=peek}});var require_pump2=__commonJS({"../../node_modules/pumpify/node_modules/pump/index.js"(exports,module2){"use strict";var once2=require_once(),eos=require_end_of_stream(),fs9=require("fs"),noop3=function(){},ancient=/^v?\.0/.test(process.version),isFn=function(fn){return typeof fn=="function"},isFS=function(stream2){return!ancient||!fs9?!1:(stream2 instanceof(fs9.ReadStream||noop3)||stream2 instanceof(fs9.WriteStream||noop3))&&isFn(stream2.close)},isRequest3=function(stream2){return stream2.setHeader&&isFn(stream2.abort)},destroyer=function(stream2,reading,writing,callback){callback=once2(callback);var closed=!1;stream2.on("close",function(){closed=!0}),eos(stream2,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed){if(destroyed=!0,isFS(stream2))return stream2.close(noop3);if(isRequest3(stream2))return stream2.abort();if(isFn(stream2.destroy))return stream2.destroy();callback(err||new Error("stream was destroyed"))}}},call=function(fn){fn()},pipe2=function(from,to){return from.pipe(to)},pump2=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop3)&&streams.pop()||noop3;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream2,i2){var reading=i2<streams.length-1,writing=i2>0;return destroyer(stream2,reading,writing,function(err){error||(error=err),err&&destroys.forEach(call),!reading&&(destroys.forEach(call),callback(error))})});streams.reduce(pipe2)};module2.exports=pump2}});var require_isarray3=__commonJS({"../../node_modules/pumpify/node_modules/isarray/index.js"(exports,module2){"use strict";var toString2={}.toString;module2.exports=Array.isArray||function(arr){return toString2.call(arr)=="[object Array]"}}});var require_stream5=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/internal/streams/stream.js"(exports,module2){"use strict";module2.exports=require("stream")}});var require_safe_buffer4=__commonJS({"../../node_modules/pumpify/node_modules/safe-buffer/index.js"(exports,module2){"use strict";var buffer=require("buffer"),Buffer4=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}Buffer4.from&&Buffer4.alloc&&Buffer4.allocUnsafe&&Buffer4.allocUnsafeSlow?module2.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer);function SafeBuffer(arg,encodingOrOffset,length){return Buffer4(arg,encodingOrOffset,length)}copyProps(Buffer4,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg=="number")throw new TypeError("Argument must not be a number");return Buffer4(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!="number")throw new TypeError("Argument must be a number");var buf=Buffer4(size);return fill!==void 0?typeof encoding=="string"?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return Buffer4(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}}});var require_BufferList4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports,module2){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var Buffer4=require_safe_buffer4().Buffer,util=require("util");function copyBuffer(src,target,offset){src.copy(target,offset)}module2.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};this.length===0&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(this.length!==0){var ret=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s2){if(this.length===0)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s2+p.data;return ret},BufferList.prototype.concat=function(n){if(this.length===0)return Buffer4.alloc(0);for(var ret=Buffer4.allocUnsafe(n>>>0),p=this.head,i2=0;p;)copyBuffer(p.data,ret,i2),i2+=p.data.length,p=p.next;return ret},BufferList}();util&&util.inspect&&util.inspect.custom&&(module2.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})}});var require_destroy4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports,module2){"use strict";var pna=require_process_nextick_args();function destroy(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):err&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,this,err)):pna.nextTick(emitErrorNT,this,err)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err2){!cb&&err2?_this._writableState?_this._writableState.errorEmitted||(_this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,_this,err2)):pna.nextTick(emitErrorNT,_this,err2):cb&&cb(err2)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(self2,err){self2.emit("error",err)}module2.exports={destroy,undestroy}}});var require_stream_writable4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_writable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Writable;function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}var asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick,Duplex2;Writable.WritableState=WritableState;var util=Object.create(require_util());util.inherits=require_inherits();var internalUtil={deprecate:require("util-deprecate")},Stream3=require_stream5(),Buffer4=require_safe_buffer4().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var destroyImpl=require_destroy4();util.inherits(Writable,Stream3);function nop(){}function WritableState(options,stream2){Duplex2=Duplex2||require_stream_duplex4(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,writableHwm=options.writableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(writableHwm||writableHwm===0)?this.highWaterMark=writableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream2,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var realHasInstance;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return realHasInstance.call(this,object)?!0:this!==Writable?!1:object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this};function Writable(options){if(Duplex2=Duplex2||require_stream_duplex4(),!realHasInstance.call(Writable,this)&&!(this instanceof Duplex2))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&(typeof options.write=="function"&&(this._write=options.write),typeof options.writev=="function"&&(this._writev=options.writev),typeof options.destroy=="function"&&(this._destroy=options.destroy),typeof options.final=="function"&&(this._final=options.final)),Stream3.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream2,cb){var er=new Error("write after end");stream2.emit("error",er),pna.nextTick(cb,er)}function validChunk(stream2,state,chunk,cb){var valid=!0,er=!1;return chunk===null?er=new TypeError("May not write null values to stream"):typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream2.emit("error",er),pna.nextTick(cb,er),valid=!1),valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&_isUint8Array(chunk);return isBuf&&!Buffer4.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),typeof encoding=="function"&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),typeof cb!="function"&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,!state.writing&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(this,state))};Writable.prototype.setDefaultEncoding=function(encoding){if(typeof encoding=="string"&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this};function decodeChunk(state,chunk,encoding){return!state.objectMode&&state.decodeStrings!==!1&&typeof chunk=="string"&&(chunk=Buffer4.from(chunk,encoding)),chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(stream2,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(ret||(state.needDrain=!0),state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk,encoding,isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream2,state,!1,len,chunk,encoding,cb);return ret}function doWrite(stream2,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream2._writev(chunk,state.onwrite):stream2._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream2,state,sync,er,cb){--state.pendingcb,sync?(pna.nextTick(cb,er),pna.nextTick(finishMaybe,stream2,state),stream2._writableState.errorEmitted=!0,stream2.emit("error",er)):(cb(er),stream2._writableState.errorEmitted=!0,stream2.emit("error",er),finishMaybe(stream2,state))}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream2,er){var state=stream2._writableState,sync=state.sync,cb=state.writecb;if(onwriteStateUpdate(state),er)onwriteError(stream2,state,sync,er,cb);else{var finished=needFinish(state);!finished&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(stream2,state),sync?asyncWrite(afterWrite,stream2,state,finished,cb):afterWrite(stream2,state,finished,cb)}}function afterWrite(stream2,state,finished,cb){finished||onwriteDrain(stream2,state),state.pendingcb--,cb(),finishMaybe(stream2,state)}function onwriteDrain(stream2,state){state.length===0&&state.needDrain&&(state.needDrain=!1,stream2.emit("drain"))}function clearBuffer(stream2,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream2._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream2,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback,len=state.objectMode?1:chunk.length;if(doWrite(stream2,state,!1,len,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}entry===null&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;typeof chunk=="function"?(cb=chunk,chunk=null,encoding=null):typeof encoding=="function"&&(cb=encoding,encoding=null),chunk!=null&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||endWritable(this,state,cb)};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing}function callFinal(stream2,state){stream2._final(function(err){state.pendingcb--,err&&stream2.emit("error",err),state.prefinished=!0,stream2.emit("prefinish"),finishMaybe(stream2,state)})}function prefinish(stream2,state){!state.prefinished&&!state.finalCalled&&(typeof stream2._final=="function"?(state.pendingcb++,state.finalCalled=!0,pna.nextTick(callFinal,stream2,state)):(state.prefinished=!0,stream2.emit("prefinish")))}function finishMaybe(stream2,state){var need=needFinish(state);return need&&(prefinish(stream2,state),state.pendingcb===0&&(state.finished=!0,stream2.emit("finish"))),need}function endWritable(stream2,state,cb){state.ending=!0,finishMaybe(stream2,state),cb&&(state.finished?pna.nextTick(cb):stream2.once("finish",cb)),state.ended=!0,stream2.writable=!1}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;for(corkReq.entry=null;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree.next=corkReq}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}});var require_stream_duplex4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_duplex.js"(exports,module2){"use strict";var pna=require_process_nextick_args(),objectKeys=Object.keys||function(obj){var keys2=[];for(var key in obj)keys2.push(key);return keys2};module2.exports=Duplex2;var util=Object.create(require_util());util.inherits=require_inherits();var Readable=require_stream_readable4(),Writable=require_stream_writable4();util.inherits(Duplex2,Readable);for(keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++)method=keys[v],Duplex2.prototype[method]||(Duplex2.prototype[method]=Writable.prototype[method]);var keys,method,v;function Duplex2(options){if(!(this instanceof Duplex2))return new Duplex2(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}Object.defineProperty(Duplex2.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(self2){self2.end()}Object.defineProperty(Duplex2.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(value){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=value,this._writableState.destroyed=value)}});Duplex2.prototype._destroy=function(err,cb){this.push(null),this.end(),pna.nextTick(cb,err)}}});var require_string_decoder4=__commonJS({"../../node_modules/pumpify/node_modules/string_decoder/lib/string_decoder.js"(exports){"use strict";var Buffer4=require_safe_buffer4().Buffer,isEncoding=Buffer4.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!="string"&&(Buffer4.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:this.write=simpleWrite,this.end=simpleEnd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer4.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r2,i2;if(this.lastNeed){if(r2=this.fillLast(buf),r2===void 0)return"";i2=this.lastNeed,this.lastNeed=0}else i2=0;return i2<buf.length?r2?r2+this.text(buf,i2):this.text(buf,i2):r2||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length};function utf8CheckByte(byte){return byte<=127?0:byte>>5===6?2:byte>>4===14?3:byte>>3===30?4:byte>>6===2?-1:-2}function utf8CheckIncomplete(self2,buf,i2){var j=buf.length-1;if(j<i2)return 0;var nb=utf8CheckByte(buf[j]);return nb>=0?(nb>0&&(self2.lastNeed=nb-1),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(self2.lastNeed=nb-2),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(nb===2?nb=0:self2.lastNeed=nb-3),nb):0))}function utf8CheckExtraBytes(self2,buf,p){if((buf[0]&192)!==128)return self2.lastNeed=0,"\uFFFD";if(self2.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128)return self2.lastNeed=1,"\uFFFD";if(self2.lastNeed>2&&buf.length>2&&(buf[2]&192)!==128)return self2.lastNeed=2,"\uFFFD"}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r2=utf8CheckExtraBytes(this,buf,p);if(r2!==void 0)return r2;if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,p,0,buf.length),this.lastNeed-=buf.length}function utf8Text(buf,i2){var total=utf8CheckIncomplete(this,buf,i2);if(!this.lastNeed)return buf.toString("utf8",i2);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i2,end)}function utf8End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+"\uFFFD":r2}function utf16Text(buf,i2){if((buf.length-i2)%2===0){var r2=buf.toString("utf16le",i2);if(r2){var c=r2.charCodeAt(r2.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r2.slice(0,-1)}return r2}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i2,buf.length-1)}function utf16End(buf){var r2=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r2+this.lastChar.toString("utf16le",0,end)}return r2}function base64Text(buf,i2){var n=(buf.length-i2)%3;return n===0?buf.toString("base64",i2):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i2,buf.length-n))}function base64End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+this.lastChar.toString("base64",0,3-this.lastNeed):r2}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}}});var require_stream_readable4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_readable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Readable;var isArray=require_isarray3(),Duplex2;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream3=require_stream5(),Buffer4=require_safe_buffer4().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var util=Object.create(require_util());util.inherits=require_inherits();var debugUtil=require("util"),debug=void 0;debugUtil&&debugUtil.debuglog?debug=debugUtil.debuglog("stream"):debug=function(){};var BufferList=require_BufferList4(),destroyImpl=require_destroy4(),StringDecoder;util.inherits(Readable,Stream3);var kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(emitter,event,fn){if(typeof emitter.prependListener=="function")return emitter.prependListener(event,fn);!emitter._events||!emitter._events[event]?emitter.on(event,fn):isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]}function ReadableState(options,stream2){Duplex2=Duplex2||require_stream_duplex4(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,readableHwm=options.readableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(readableHwm||readableHwm===0)?this.highWaterMark=readableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require_string_decoder4().StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex2=Duplex2||require_stream_duplex4(),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&(typeof options.read=="function"&&(this._read=options.read),typeof options.destroy=="function"&&(this._destroy=options.destroy)),Stream3.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}});Readable.prototype.destroy=destroyImpl.destroy;Readable.prototype._undestroy=destroyImpl.undestroy;Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)};Readable.prototype.push=function(chunk,encoding){var state=this._readableState,skipChunkCheck;return state.objectMode?skipChunkCheck=!0:typeof chunk=="string"&&(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=Buffer4.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)};Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)};function readableAddChunk(stream2,chunk,encoding,addToFront,skipChunkCheck){var state=stream2._readableState;if(chunk===null)state.reading=!1,onEofChunk(stream2,state);else{var er;skipChunkCheck||(er=chunkInvalid(state,chunk)),er?stream2.emit("error",er):state.objectMode||chunk&&chunk.length>0?(typeof chunk!="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer4.prototype&&(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream2.emit("error",new Error("stream.unshift() after end event")):addChunk(stream2,state,chunk,!0):state.ended?stream2.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||chunk.length!==0?addChunk(stream2,state,chunk,!1):maybeReadMore(stream2,state)):addChunk(stream2,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream2,state,chunk,addToFront){state.flowing&&state.length===0&&!state.sync?(stream2.emit("data",chunk),stream2.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream2)),maybeReadMore(stream2,state)}function chunkInvalid(state,chunk){var er;return!_isUint8Array(chunk)&&typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===!1};Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=require_string_decoder4().StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;function computeNewHighWaterMark(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||state.length===0&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(n!==0&&(state.emittedReadable=!1),n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),state.length===0&&state.ended?endReadable(this):emitReadable(this),null;if(n=howMuchToRead(n,state),n===0&&state.ended)return state.length===0&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(state.length===0||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),state.ended||state.reading?(doRead=!1,debug("reading or ended",doRead)):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,state.length===0&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state)));var ret;return n>0?ret=fromList(n,state):ret=null,ret===null?(state.needReadable=!0,n=0):state.length-=n,state.length===0&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),ret!==null&&this.emit("data",ret),ret};function onEofChunk(stream2,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream2)}}function emitReadable(stream2){var state=stream2._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream2):emitReadable_(stream2))}function emitReadable_(stream2){debug("emit readable"),stream2.emit("readable"),flow(stream2)}function maybeReadMore(stream2,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream2,state))}function maybeReadMore_(stream2,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream2.read(0),len!==state.length);)len=state.length;state.readingMore=!1}Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1;function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain)&&ondrain()}var increasedAwaitDrain=!1;src.on("data",ondata);function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1;var ret=dest.write(chunk);ret===!1&&!increasedAwaitDrain&&((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",state.awaitDrain),state.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),EElistenerCount(dest,"error")===0&&dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish),unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe"),src.unpipe(dest)}return dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,state.awaitDrain===0&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(state.pipesCount===0)return this;if(state.pipesCount===1)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i2=0;i2<len;i2++)dests[i2].emit("unpipe",this,{hasUnpiped:!1});return this}var index=indexOf(state.pipes,dest);return index===-1?this:(state.pipes.splice(index,1),state.pipesCount-=1,state.pipesCount===1&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)};Readable.prototype.on=function(ev,fn){var res=Stream3.prototype.on.call(this,ev,fn);if(ev==="data")this._readableState.flowing!==!1&&this.resume();else if(ev==="readable"){var state=this._readableState;!state.endEmitted&&!state.readableListening&&(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return res};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(self2){debug("readable nexttick read 0"),self2.read(0)}Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,resume(this,state)),this};function resume(stream2,state){state.resumeScheduled||(state.resumeScheduled=!0,pna.nextTick(resume_,stream2,state))}function resume_(stream2,state){state.reading||(debug("resume read 0"),stream2.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream2.emit("resume"),flow(stream2),state.flowing&&!state.reading&&stream2.read(0)}Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function flow(stream2){var state=stream2._readableState;for(debug("flow",state.flowing);state.flowing&&stream2.read()!==null;);}Readable.prototype.wrap=function(stream2){var _this=this,state=this._readableState,paused=!1;stream2.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream2.on("data",function(chunk){if(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!(state.objectMode&&chunk==null)&&!(!state.objectMode&&(!chunk||!chunk.length))){var ret=_this.push(chunk);ret||(paused=!0,stream2.pause())}});for(var i2 in stream2)this[i2]===void 0&&typeof stream2[i2]=="function"&&(this[i2]=function(method){return function(){return stream2[method].apply(stream2,arguments)}}(i2));for(var n=0;n<kProxyEvents.length;n++)stream2.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n2){debug("wrapped _read",n2),paused&&(paused=!1,stream2.resume())},this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(n,state){if(state.length===0)return null;var ret;return state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(state.decoder?ret=state.buffer.join(""):state.buffer.length===1?ret=state.buffer.head.data:ret=state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):n===list.head.data.length?ret=list.shift():ret=hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list),ret}function copyFromBufferString(n,list){var p=list.head,c=1,ret=p.data;for(n-=ret.length;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),n-=nb,n===0){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer4.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),n-=nb,n===0){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream2){var state=stream2._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream2))}function endReadableNT(state,stream2){!state.endEmitted&&state.length===0&&(state.endEmitted=!0,stream2.readable=!1,stream2.emit("end"))}function indexOf(xs,x2){for(var i2=0,l=xs.length;i2<l;i2++)if(xs[i2]===x2)return i2;return-1}}});var require_stream_transform4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_transform.js"(exports,module2){"use strict";module2.exports=Transform;var Duplex2=require_stream_duplex4(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(Transform,Duplex2);function afterTransform(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return this.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,data!=null&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex2.call(this,options),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&(typeof options.transform=="function"&&(this._transform=options.transform),typeof options.flush=="function"&&(this._flush=options.flush)),this.on("prefinish",prefinish)}function prefinish(){var _this=this;typeof this._flush=="function"?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex2.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;ts.writechunk!==null&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0};Transform.prototype._destroy=function(err,cb){var _this2=this;Duplex2.prototype._destroy.call(this,err,function(err2){cb(err2),_this2.emit("close")})};function done(stream2,er,data){if(er)return stream2.emit("error",er);if(data!=null&&stream2.push(data),stream2._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(stream2._transformState.transforming)throw new Error("Calling transform done when still transforming");return stream2.push(null)}}});var require_stream_passthrough4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_passthrough.js"(exports,module2){"use strict";module2.exports=PassThrough3;var Transform=require_stream_transform4(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(PassThrough3,Transform);function PassThrough3(options){if(!(this instanceof PassThrough3))return new PassThrough3(options);Transform.call(this,options)}PassThrough3.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}}});var require_readable4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/readable.js"(exports,module2){"use strict";var Stream3=require("stream");process.env.READABLE_STREAM==="disable"&&Stream3?(module2.exports=Stream3,exports=module2.exports=Stream3.Readable,exports.Readable=Stream3.Readable,exports.Writable=Stream3.Writable,exports.Duplex=Stream3.Duplex,exports.Transform=Stream3.Transform,exports.PassThrough=Stream3.PassThrough,exports.Stream=Stream3):(exports=module2.exports=require_stream_readable4(),exports.Stream=Stream3||exports,exports.Readable=exports,exports.Writable=require_stream_writable4(),exports.Duplex=require_stream_duplex4(),exports.Transform=require_stream_transform4(),exports.PassThrough=require_stream_passthrough4())}});var require_duplexify2=__commonJS({"../../node_modules/pumpify/node_modules/duplexify/index.js"(exports,module2){"use strict";var stream2=require_readable4(),eos=require_end_of_stream(),inherits=require_inherits(),shift=require_stream_shift(),SIGNAL_FLUSH=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),onuncork=function(self2,fn){self2._corked?self2.once("uncork",fn):fn()},autoDestroy=function(self2,err){self2._autoDestroy&&self2.destroy(err)},destroyer=function(self2,end2){return function(err){err?autoDestroy(self2,err.message==="premature close"?null:err):end2&&!self2._ended&&self2.end()}},end=function(ws,fn){if(!ws||ws._writableState&&ws._writableState.finished)return fn();if(ws._writableState)return ws.end(fn);ws.end(),fn()},toStreams2=function(rs){return new stream2.Readable({objectMode:!0,highWaterMark:16}).wrap(rs)},Duplexify=function(writable,readable,opts){if(!(this instanceof Duplexify))return new Duplexify(writable,readable,opts);stream2.Duplex.call(this,opts),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!opts||opts.autoDestroy!==!1,this._forwardDestroy=!opts||opts.destroy!==!1,this._forwardEnd=!opts||opts.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,writable&&this.setWritable(writable),readable&&this.setReadable(readable)};inherits(Duplexify,stream2.Duplex);Duplexify.obj=function(writable,readable,opts){return opts||(opts={}),opts.objectMode=!0,opts.highWaterMark=16,new Duplexify(writable,readable,opts)};Duplexify.prototype.cork=function(){++this._corked===1&&this.emit("cork")};Duplexify.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};Duplexify.prototype.setWritable=function(writable){if(this._unwrite&&this._unwrite(),this.destroyed){writable&&writable.destroy&&writable.destroy();return}if(writable===null||writable===!1){this.end();return}var self2=this,unend=eos(writable,{writable:!0,readable:!1},destroyer(this,this._forwardEnd)),ondrain=function(){var ondrain2=self2._ondrain;self2._ondrain=null,ondrain2&&ondrain2()},clear=function(){self2._writable.removeListener("drain",ondrain),unend()};this._unwrite&&process.nextTick(ondrain),this._writable=writable,this._writable.on("drain",ondrain),this._unwrite=clear,this.uncork()};Duplexify.prototype.setReadable=function(readable){if(this._unread&&this._unread(),this.destroyed){readable&&readable.destroy&&readable.destroy();return}if(readable===null||readable===!1){this.push(null),this.resume();return}var self2=this,unend=eos(readable,{writable:!1,readable:!0},destroyer(this)),onreadable=function(){self2._forward()},onend=function(){self2.push(null)},clear=function(){self2._readable2.removeListener("readable",onreadable),self2._readable2.removeListener("end",onend),unend()};this._drained=!0,this._readable=readable,this._readable2=readable._readableState?readable:toStreams2(readable),this._readable2.on("readable",onreadable),this._readable2.on("end",onend),this._unread=clear,this._forward()};Duplexify.prototype._read=function(){this._drained=!0,this._forward()};Duplexify.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var data;this._drained&&(data=shift(this._readable2))!==null;)this.destroyed||(this._drained=this.push(data));this._forwarding=!1}};Duplexify.prototype.destroy=function(err){if(!this.destroyed){this.destroyed=!0;var self2=this;process.nextTick(function(){self2._destroy(err)})}};Duplexify.prototype._destroy=function(err){if(err){var ondrain=this._ondrain;this._ondrain=null,ondrain?ondrain(err):this.emit("error",err)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};Duplexify.prototype._write=function(data,enc,cb){if(this.destroyed)return cb();if(this._corked)return onuncork(this,this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return this._finish(cb);if(!this._writable)return cb();this._writable.write(data)===!1?this._ondrain=cb:cb()};Duplexify.prototype._finish=function(cb){var self2=this;this.emit("preend"),onuncork(this,function(){end(self2._forwardEnd&&self2._writable,function(){self2._writableState.prefinished===!1&&(self2._writableState.prefinished=!0),self2.emit("prefinish"),onuncork(self2,cb)})})};Duplexify.prototype.end=function(data,enc,cb){return typeof data=="function"?this.end(null,null,data):typeof enc=="function"?this.end(data,null,enc):(this._ended=!0,data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream2.Writable.prototype.end.call(this,cb))};module2.exports=Duplexify}});var require_pumpify=__commonJS({"../../node_modules/pumpify/index.js"(exports,module2){"use strict";var pump2=require_pump2(),inherits=require_inherits(),Duplexify=require_duplexify2(),toArray=function(args){return args.length?Array.isArray(args[0])?args[0]:Array.prototype.slice.call(args):[]},define2=function(opts){var Pumpify=function(){var streams=toArray(arguments);if(!(this instanceof Pumpify))return new Pumpify(streams);Duplexify.call(this,null,null,opts),streams.length&&this.setPipeline(streams)};return inherits(Pumpify,Duplexify),Pumpify.prototype.setPipeline=function(){var streams=toArray(arguments),self2=this,ended=!1,w=streams[0],r2=streams[streams.length-1];r2=r2.readable?r2:null,w=w.writable?w:null;var onclose=function(){streams[0].emit("error",new Error("stream was destroyed"))};if(this.on("close",onclose),this.on("prefinish",function(){ended||self2.cork()}),pump2(streams,function(err){if(self2.removeListener("close",onclose),err)return self2.destroy(err.message==="premature close"?null:err);ended=!0,self2._autoDestroy===!1&&(self2._autoDestroy=!0),self2.uncork()}),this.destroyed)return onclose();this.setWritable(w),this.setReadable(r2)},Pumpify};module2.exports=define2({autoDestroy:!1,destroy:!1});module2.exports.obj=define2({autoDestroy:!1,destroy:!1,objectMode:!0,highWaterMark:16});module2.exports.ctor=define2}});var require_is_gzip=__commonJS({"../../node_modules/is-gzip/index.js"(exports,module2){"use strict";module2.exports=function(buf){return!buf||buf.length<3?!1:buf[0]===31&&buf[1]===139&&buf[2]===8}}});var require_is_deflate=__commonJS({"../../node_modules/is-deflate/index.js"(exports,module2){"use strict";module2.exports=function(buf){return!buf||buf.length<2?!1:buf[0]===120&&(buf[1]===1||buf[1]===156||buf[1]===218)}}});var require_gunzip_maybe=__commonJS({"../../node_modules/gunzip-maybe/index.js"(exports,module2){"use strict";var zlib2=require("zlib"),peek=require_peek_stream(),through=require_through2(),pumpify=require_pumpify(),isGzip=require_is_gzip(),isDeflate=require_is_deflate(),isCompressed=function(data){return isGzip(data)?1:isDeflate(data)?2:0},gunzip=function(maxRecursion){return maxRecursion===void 0&&(maxRecursion=3),peek({newline:!1,maxBuffer:10},function(data,swap){if(maxRecursion<0)return swap(new Error("Maximum recursion reached"));switch(isCompressed(data)){case 1:swap(null,pumpify(zlib2.createGunzip(),gunzip(maxRecursion-1)));break;case 2:swap(null,pumpify(zlib2.createInflate(),gunzip(maxRecursion-1)));break;default:swap(null,through())}})};module2.exports=gunzip}});var require_lib=__commonJS({"../../node_modules/get-npm-tarball-url/lib/index.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});function default_1(pkgName,pkgVersion,opts){let registry;opts!=null&&opts.registry?registry=opts.registry.endsWith("/")?opts.registry:`${opts.registry}/`:registry="https://registry.npmjs.org/";let scopelessName=getScopelessName(pkgName);return`${registry}${pkgName}/-/${scopelessName}-${removeBuildMetadataFromVersion(pkgVersion)}.tgz`}exports.default=default_1;function removeBuildMetadataFromVersion(version){let plusPos=version.indexOf("+");return plusPos===-1?version:version.substring(0,plusPos)}function getScopelessName(name){return name[0]!=="@"?name:name.split("/")[1]}}});var tslib_es6_exports={};__export(tslib_es6_exports,{__assign:()=>__assign,__asyncDelegator:()=>__asyncDelegator,__asyncGenerator:()=>__asyncGenerator,__asyncValues:()=>__asyncValues,__await:()=>__await,__awaiter:()=>__awaiter,__classPrivateFieldGet:()=>__classPrivateFieldGet2,__classPrivateFieldSet:()=>__classPrivateFieldSet2,__createBinding:()=>__createBinding,__decorate:()=>__decorate,__exportStar:()=>__exportStar,__extends:()=>__extends,__generator:()=>__generator,__importDefault:()=>__importDefault,__importStar:()=>__importStar,__makeTemplateObject:()=>__makeTemplateObject,__metadata:()=>__metadata,__param:()=>__param,__read:()=>__read,__rest:()=>__rest,__spread:()=>__spread,__spreadArrays:()=>__spreadArrays,__values:()=>__values});function __extends(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}function __rest(s2,e2){var t2={};for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&e2.indexOf(p)<0&&(t2[p]=s2[p]);if(s2!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i2=0,p=Object.getOwnPropertySymbols(s2);i2<p.length;i2++)e2.indexOf(p[i2])<0&&Object.prototype.propertyIsEnumerable.call(s2,p[i2])&&(t2[p[i2]]=s2[p[i2]]);return t2}function __decorate(decorators,target,key,desc){var c=arguments.length,r2=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r2=Reflect.decorate(decorators,target,key,desc);else for(var i2=decorators.length-1;i2>=0;i2--)(d=decorators[i2])&&(r2=(c<3?d(r2):c>3?d(target,key,r2):d(target,key))||r2);return c>3&&r2&&Object.defineProperty(target,key,r2),r2}function __param(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}}function __metadata(metadataKey,metadataValue){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(metadataKey,metadataValue)}function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve3){resolve3(value)})}return new(P||(P=Promise))(function(resolve3,reject){function fulfilled(value){try{step(generator.next(value))}catch(e2){reject(e2)}}function rejected(value){try{step(generator.throw(value))}catch(e2){reject(e2)}}function step(result){result.done?resolve3(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})}function __generator(thisArg,body){var _={label:0,sent:function(){if(t2[0]&1)throw t2[1];return t2[1]},trys:[],ops:[]},f3,y,t2,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f3)throw new TypeError("Generator is already executing.");for(;_;)try{if(f3=1,y&&(t2=op[0]&2?y.return:op[0]?y.throw||((t2=y.return)&&t2.call(y),0):y.next)&&!(t2=t2.call(y,op[1])).done)return t2;switch(y=0,t2&&(op=[op[0]&2,t2.value]),op[0]){case 0:case 1:t2=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(t2=_.trys,!(t2=t2.length>0&&t2[t2.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t2||op[1]>t2[0]&&op[1]<t2[3])){_.label=op[1];break}if(op[0]===6&&_.label<t2[1]){_.label=t2[1],t2=op;break}if(t2&&_.label<t2[2]){_.label=t2[2],_.ops.push(op);break}t2[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e2){op=[6,e2],y=0}finally{f3=t2=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}}function __createBinding(o,m2,k,k2){k2===void 0&&(k2=k),o[k2]=m2[k]}function __exportStar(m2,exports){for(var p in m2)p!=="default"&&!exports.hasOwnProperty(p)&&(exports[p]=m2[p])}function __values(o){var s2=typeof Symbol=="function"&&Symbol.iterator,m2=s2&&o[s2],i2=0;if(m2)return m2.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&i2>=o.length&&(o=void 0),{value:o&&o[i2++],done:!o}}};throw new TypeError(s2?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(o,n){var m2=typeof Symbol=="function"&&o[Symbol.iterator];if(!m2)return o;var i2=m2.call(o),r2,ar=[],e2;try{for(;(n===void 0||n-- >0)&&!(r2=i2.next()).done;)ar.push(r2.value)}catch(error){e2={error}}finally{try{r2&&!r2.done&&(m2=i2.return)&&m2.call(i2)}finally{if(e2)throw e2.error}}return ar}function __spread(){for(var ar=[],i2=0;i2<arguments.length;i2++)ar=ar.concat(__read(arguments[i2]));return ar}function __spreadArrays(){for(var s2=0,i2=0,il=arguments.length;i2<il;i2++)s2+=arguments[i2].length;for(var r2=Array(s2),k=0,i2=0;i2<il;i2++)for(var a=arguments[i2],j=0,jl=a.length;j<jl;j++,k++)r2[k]=a[j];return r2}function __await(v){return this instanceof __await?(this.v=v,this):new __await(v)}function __asyncGenerator(thisArg,_arguments,generator){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),i2,q=[];return i2={},verb("next"),verb("throw"),verb("return"),i2[Symbol.asyncIterator]=function(){return this},i2;function verb(n){g[n]&&(i2[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})})}function resume(n,v){try{step(g[n](v))}catch(e2){settle(q[0][3],e2)}}function step(r2){r2.value instanceof __await?Promise.resolve(r2.value.v).then(fulfill,reject):settle(q[0][2],r2)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f3,v){f3(v),q.shift(),q.length&&resume(q[0][0],q[0][1])}}function __asyncDelegator(o){var i2,p;return i2={},verb("next"),verb("throw",function(e2){throw e2}),verb("return"),i2[Symbol.iterator]=function(){return this},i2;function verb(n,f3){i2[n]=o[n]?function(v){return(p=!p)?{value:__await(o[n](v)),done:n==="return"}:f3?f3(v):v}:f3}}function __asyncValues(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m2=o[Symbol.asyncIterator],i2;return m2?m2.call(o):(o=typeof __values=="function"?__values(o):o[Symbol.iterator](),i2={},verb("next"),verb("throw"),verb("return"),i2[Symbol.asyncIterator]=function(){return this},i2);function verb(n){i2[n]=o[n]&&function(v){return new Promise(function(resolve3,reject){v=o[n](v),settle(resolve3,reject,v.done,v.value)})}}function settle(resolve3,reject,d,v){Promise.resolve(v).then(function(v2){resolve3({value:v2,done:d})},reject)}}function __makeTemplateObject(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked}function __importStar(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)Object.hasOwnProperty.call(mod,k)&&(result[k]=mod[k]);return result.default=mod,result}function __importDefault(mod){return mod&&mod.__esModule?mod:{default:mod}}function __classPrivateFieldGet2(receiver,privateMap){if(!privateMap.has(receiver))throw new TypeError("attempted to get private field on non-instance");return privateMap.get(receiver)}function __classPrivateFieldSet2(receiver,privateMap,value){if(!privateMap.has(receiver))throw new TypeError("attempted to set private field on non-instance");return privateMap.set(receiver,value),value}var extendStatics,__assign,init_tslib_es6=__esm({"../../node_modules/@yarnpkg/fslib/node_modules/tslib/tslib.es6.js"(){"use strict";extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)b2.hasOwnProperty(p)&&(d2[p]=b2[p])},extendStatics(d,b)};__assign=function(){return __assign=Object.assign||function(t2){for(var s2,i2=1,n=arguments.length;i2<n;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign.apply(this,arguments)}}});var require_constants=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/constants.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.SAFE_TIME=exports.S_IFLNK=exports.S_IFREG=exports.S_IFDIR=exports.S_IFMT=void 0;exports.S_IFMT=61440;exports.S_IFDIR=16384;exports.S_IFREG=32768;exports.S_IFLNK=40960;exports.SAFE_TIME=456789e3}});var require_statUtils=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/statUtils.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.areStatsEqual=exports.convertToBigIntStats=exports.clearStats=exports.makeEmptyStats=exports.makeDefaultStats=exports.BigIntStatsEntry=exports.StatEntry=exports.DirEntry=exports.DEFAULT_MODE=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),nodeUtils=tslib_1.__importStar(require("util")),constants_1=require_constants();exports.DEFAULT_MODE=constants_1.S_IFREG|420;var DirEntry=class{constructor(){this.name="",this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFDIR}isFIFO(){return!1}isFile(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFREG}isSocket(){return!1}isSymbolicLink(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFLNK}};exports.DirEntry=DirEntry;var StatEntry=class{constructor(){this.uid=0,this.gid=0,this.size=0,this.blksize=0,this.atimeMs=0,this.mtimeMs=0,this.ctimeMs=0,this.birthtimeMs=0,this.atime=new Date(0),this.mtime=new Date(0),this.ctime=new Date(0),this.birthtime=new Date(0),this.dev=0,this.ino=0,this.mode=exports.DEFAULT_MODE,this.nlink=1,this.rdev=0,this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFDIR}isFIFO(){return!1}isFile(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFREG}isSocket(){return!1}isSymbolicLink(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFLNK}};exports.StatEntry=StatEntry;var BigIntStatsEntry=class{constructor(){this.uid=BigInt(0),this.gid=BigInt(0),this.size=BigInt(0),this.blksize=BigInt(0),this.atimeMs=BigInt(0),this.mtimeMs=BigInt(0),this.ctimeMs=BigInt(0),this.birthtimeMs=BigInt(0),this.atimeNs=BigInt(0),this.mtimeNs=BigInt(0),this.ctimeNs=BigInt(0),this.birthtimeNs=BigInt(0),this.atime=new Date(0),this.mtime=new Date(0),this.ctime=new Date(0),this.birthtime=new Date(0),this.dev=BigInt(0),this.ino=BigInt(0),this.mode=BigInt(exports.DEFAULT_MODE),this.nlink=BigInt(1),this.rdev=BigInt(0),this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&BigInt(constants_1.S_IFMT))===BigInt(constants_1.S_IFDIR)}isFIFO(){return!1}isFile(){return(this.mode&BigInt(constants_1.S_IFMT))===BigInt(constants_1.S_IFREG)}isSocket(){return!1}isSymbolicLink(){return(this.mode&BigInt(constants_1.S_IFMT))===BigInt(constants_1.S_IFLNK)}};exports.BigIntStatsEntry=BigIntStatsEntry;function makeDefaultStats(){return new StatEntry}exports.makeDefaultStats=makeDefaultStats;function makeEmptyStats(){return clearStats(makeDefaultStats())}exports.makeEmptyStats=makeEmptyStats;function clearStats(stats){for(let key in stats)if(Object.prototype.hasOwnProperty.call(stats,key)){let element=stats[key];typeof element=="number"?stats[key]=0:typeof element=="bigint"?stats[key]=BigInt(0):nodeUtils.types.isDate(element)&&(stats[key]=new Date(0))}return stats}exports.clearStats=clearStats;function convertToBigIntStats(stats){let bigintStats=new BigIntStatsEntry;for(let key in stats)if(Object.prototype.hasOwnProperty.call(stats,key)){let element=stats[key];typeof element=="number"?bigintStats[key]=BigInt(element):nodeUtils.types.isDate(element)&&(bigintStats[key]=new Date(element))}return bigintStats.atimeNs=bigintStats.atimeMs*BigInt(1e6),bigintStats.mtimeNs=bigintStats.mtimeMs*BigInt(1e6),bigintStats.ctimeNs=bigintStats.ctimeMs*BigInt(1e6),bigintStats.birthtimeNs=bigintStats.birthtimeMs*BigInt(1e6),bigintStats}exports.convertToBigIntStats=convertToBigIntStats;function areStatsEqual(a,b){if(a.atimeMs!==b.atimeMs||a.birthtimeMs!==b.birthtimeMs||a.blksize!==b.blksize||a.blocks!==b.blocks||a.ctimeMs!==b.ctimeMs||a.dev!==b.dev||a.gid!==b.gid||a.ino!==b.ino||a.isBlockDevice()!==b.isBlockDevice()||a.isCharacterDevice()!==b.isCharacterDevice()||a.isDirectory()!==b.isDirectory()||a.isFIFO()!==b.isFIFO()||a.isFile()!==b.isFile()||a.isSocket()!==b.isSocket()||a.isSymbolicLink()!==b.isSymbolicLink()||a.mode!==b.mode||a.mtimeMs!==b.mtimeMs||a.nlink!==b.nlink||a.rdev!==b.rdev||a.size!==b.size||a.uid!==b.uid)return!1;let aN=a,bN=b;return!(aN.atimeNs!==bN.atimeNs||aN.mtimeNs!==bN.mtimeNs||aN.ctimeNs!==bN.ctimeNs||aN.birthtimeNs!==bN.birthtimeNs)}exports.areStatsEqual=areStatsEqual}});var require_path=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/path.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.toFilename=exports.convertPath=exports.ppath=exports.npath=exports.Filename=exports.PortablePath=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),path_1=tslib_1.__importDefault(require("path")),PathType;(function(PathType2){PathType2[PathType2.File=0]="File",PathType2[PathType2.Portable=1]="Portable",PathType2[PathType2.Native=2]="Native"})(PathType||(PathType={}));exports.PortablePath={root:"/",dot:".",parent:".."};exports.Filename={nodeModules:"node_modules",manifest:"package.json",lockfile:"yarn.lock",virtual:"__virtual__",pnpJs:".pnp.js",pnpCjs:".pnp.cjs",rc:".yarnrc.yml"};exports.npath=Object.create(path_1.default);exports.ppath=Object.create(path_1.default.posix);exports.npath.cwd=()=>process.cwd();exports.ppath.cwd=()=>toPortablePath(process.cwd());exports.ppath.resolve=(...segments)=>segments.length>0&&exports.ppath.isAbsolute(segments[0])?path_1.default.posix.resolve(...segments):path_1.default.posix.resolve(exports.ppath.cwd(),...segments);var contains=function(pathUtils,from,to){return from=pathUtils.normalize(from),to=pathUtils.normalize(to),from===to?".":(from.endsWith(pathUtils.sep)||(from=from+pathUtils.sep),to.startsWith(from)?to.slice(from.length):null)};exports.npath.fromPortablePath=fromPortablePath;exports.npath.toPortablePath=toPortablePath;exports.npath.contains=(from,to)=>contains(exports.npath,from,to);exports.ppath.contains=(from,to)=>contains(exports.ppath,from,to);var WINDOWS_PATH_REGEXP=/^([a-zA-Z]:.*)$/,UNC_WINDOWS_PATH_REGEXP=/^\/\/(\.\/)?(.*)$/,PORTABLE_PATH_REGEXP=/^\/([a-zA-Z]:.*)$/,UNC_PORTABLE_PATH_REGEXP=/^\/unc\/(\.dot\/)?(.*)$/;function fromPortablePath(p){if(process.platform!=="win32")return p;let portablePathMatch,uncPortablePathMatch;if(portablePathMatch=p.match(PORTABLE_PATH_REGEXP))p=portablePathMatch[1];else if(uncPortablePathMatch=p.match(UNC_PORTABLE_PATH_REGEXP))p=`\\\\${uncPortablePathMatch[1]?".\\":""}${uncPortablePathMatch[2]}`;else return p;return p.replace(/\//g,"\\")}function toPortablePath(p){if(process.platform!=="win32")return p;p=p.replace(/\\/g,"/");let windowsPathMatch,uncWindowsPathMatch;return(windowsPathMatch=p.match(WINDOWS_PATH_REGEXP))?p=`/${windowsPathMatch[1]}`:(uncWindowsPathMatch=p.match(UNC_WINDOWS_PATH_REGEXP))&&(p=`/unc/${uncWindowsPathMatch[1]?".dot/":""}${uncWindowsPathMatch[2]}`),p}function convertPath(targetPathUtils,sourcePath){return targetPathUtils===exports.npath?fromPortablePath(sourcePath):toPortablePath(sourcePath)}exports.convertPath=convertPath;function toFilename(filename){if(exports.npath.parse(filename).dir!==""||exports.ppath.parse(filename).dir!=="")throw new Error(`Invalid filename: "${filename}"`);return filename}exports.toFilename=toFilename}});var require_copyPromise=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/algorithms/copyPromise.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.copyPromise=exports.LinkStrategy=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),fs_1=tslib_1.__importDefault(require("fs")),constants=tslib_1.__importStar(require_constants()),path_1=require_path(),defaultTime=new Date(constants.SAFE_TIME*1e3),LinkStrategy;(function(LinkStrategy2){LinkStrategy2.Allow="allow",LinkStrategy2.ReadOnly="readOnly"})(LinkStrategy=exports.LinkStrategy||(exports.LinkStrategy={}));async function copyPromise(destinationFs,destination,sourceFs,source,opts){let normalizedDestination=destinationFs.pathUtils.normalize(destination),normalizedSource=sourceFs.pathUtils.normalize(source),prelayout=[],postlayout=[],{atime,mtime}=opts.stableTime?{atime:defaultTime,mtime:defaultTime}:await sourceFs.lstatPromise(normalizedSource);await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination),{utimes:[atime,mtime]});let updateTime=typeof destinationFs.lutimesPromise=="function"?destinationFs.lutimesPromise.bind(destinationFs):destinationFs.utimesPromise.bind(destinationFs);await copyImpl(prelayout,postlayout,updateTime,destinationFs,normalizedDestination,sourceFs,normalizedSource,{...opts,didParentExist:!0});for(let operation of prelayout)await operation();await Promise.all(postlayout.map(operation=>operation()))}exports.copyPromise=copyPromise;async function copyImpl(prelayout,postlayout,updateTime,destinationFs,destination,sourceFs,source,opts){var _a,_b;let destinationStat=opts.didParentExist?await maybeLStat(destinationFs,destination):null,sourceStat=await sourceFs.lstatPromise(source),{atime,mtime}=opts.stableTime?{atime:defaultTime,mtime:defaultTime}:sourceStat,updated;switch(!0){case sourceStat.isDirectory():updated=await copyFolder(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts);break;case sourceStat.isFile():updated=await copyFile(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts);break;case sourceStat.isSymbolicLink():updated=await copySymlink(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts);break;default:throw new Error(`Unsupported file type (${sourceStat.mode})`)}return(updated||((_a=destinationStat==null?void 0:destinationStat.mtime)===null||_a===void 0?void 0:_a.getTime())!==mtime.getTime()||((_b=destinationStat==null?void 0:destinationStat.atime)===null||_b===void 0?void 0:_b.getTime())!==atime.getTime())&&(postlayout.push(()=>updateTime(destination,atime,mtime)),updated=!0),(destinationStat===null||(destinationStat.mode&511)!==(sourceStat.mode&511))&&(postlayout.push(()=>destinationFs.chmodPromise(destination,sourceStat.mode&511)),updated=!0),updated}async function maybeLStat(baseFs,p){try{return await baseFs.lstatPromise(p)}catch{return null}}async function copyFolder(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts){if(destinationStat!==null&&!destinationStat.isDirectory())if(opts.overwrite)prelayout.push(async()=>destinationFs.removePromise(destination)),destinationStat=null;else return!1;let updated=!1;destinationStat===null&&(prelayout.push(async()=>{try{await destinationFs.mkdirPromise(destination,{mode:sourceStat.mode})}catch(err){if(err.code!=="EEXIST")throw err}}),updated=!0);let entries2=await sourceFs.readdirPromise(source),nextOpts=opts.didParentExist&&!destinationStat?{...opts,didParentExist:!1}:opts;if(opts.stableSort)for(let entry of entries2.sort())await copyImpl(prelayout,postlayout,updateTime,destinationFs,destinationFs.pathUtils.join(destination,entry),sourceFs,sourceFs.pathUtils.join(source,entry),nextOpts)&&(updated=!0);else(await Promise.all(entries2.map(async entry=>{await copyImpl(prelayout,postlayout,updateTime,destinationFs,destinationFs.pathUtils.join(destination,entry),sourceFs,sourceFs.pathUtils.join(source,entry),nextOpts)}))).some(status=>status)&&(updated=!0);return updated}var isCloneSupportedCache=new WeakMap;function makeLinkOperation(opFs,destination,source,sourceStat,linkStrategy){return async()=>{await opFs.linkPromise(source,destination),linkStrategy===LinkStrategy.ReadOnly&&(sourceStat.mode&=-147,await opFs.chmodPromise(destination,sourceStat.mode))}}function makeCloneLinkOperation(opFs,destination,source,sourceStat,linkStrategy){let isCloneSupported=isCloneSupportedCache.get(opFs);return typeof isCloneSupported>"u"?async()=>{try{await opFs.copyFilePromise(source,destination,fs_1.default.constants.COPYFILE_FICLONE_FORCE),isCloneSupportedCache.set(opFs,!0)}catch(err){if(err.code==="ENOSYS"||err.code==="ENOTSUP")isCloneSupportedCache.set(opFs,!1),await makeLinkOperation(opFs,destination,source,sourceStat,linkStrategy)();else throw err}}:isCloneSupported?async()=>opFs.copyFilePromise(source,destination,fs_1.default.constants.COPYFILE_FICLONE_FORCE):makeLinkOperation(opFs,destination,source,sourceStat,linkStrategy)}async function copyFile(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts){var _a;if(destinationStat!==null)if(opts.overwrite)prelayout.push(async()=>destinationFs.removePromise(destination)),destinationStat=null;else return!1;let linkStrategy=(_a=opts.linkStrategy)!==null&&_a!==void 0?_a:null,op=destinationFs===sourceFs?linkStrategy!==null?makeCloneLinkOperation(destinationFs,destination,source,sourceStat,linkStrategy):async()=>destinationFs.copyFilePromise(source,destination,fs_1.default.constants.COPYFILE_FICLONE):linkStrategy!==null?makeLinkOperation(destinationFs,destination,source,sourceStat,linkStrategy):async()=>destinationFs.writeFilePromise(destination,await sourceFs.readFilePromise(source));return prelayout.push(async()=>op()),!0}async function copySymlink(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts){if(destinationStat!==null)if(opts.overwrite)prelayout.push(async()=>destinationFs.removePromise(destination)),destinationStat=null;else return!1;return prelayout.push(async()=>{await destinationFs.symlinkPromise((0,path_1.convertPath)(destinationFs.pathUtils,await sourceFs.readlinkPromise(source)),destination)}),!0}}});var require_errors3=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/errors.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.LibzipError=exports.ERR_DIR_CLOSED=exports.EOPNOTSUPP=exports.ENOTEMPTY=exports.EROFS=exports.EEXIST=exports.EISDIR=exports.ENOTDIR=exports.ENOENT=exports.EBADF=exports.EINVAL=exports.ENOSYS=exports.EBUSY=void 0;function makeError(code,message){return Object.assign(new Error(`${code}: ${message}`),{code})}function EBUSY(message){return makeError("EBUSY",message)}exports.EBUSY=EBUSY;function ENOSYS(message,reason){return makeError("ENOSYS",`${message}, ${reason}`)}exports.ENOSYS=ENOSYS;function EINVAL(reason){return makeError("EINVAL",`invalid argument, ${reason}`)}exports.EINVAL=EINVAL;function EBADF(reason){return makeError("EBADF",`bad file descriptor, ${reason}`)}exports.EBADF=EBADF;function ENOENT(reason){return makeError("ENOENT",`no such file or directory, ${reason}`)}exports.ENOENT=ENOENT;function ENOTDIR(reason){return makeError("ENOTDIR",`not a directory, ${reason}`)}exports.ENOTDIR=ENOTDIR;function EISDIR(reason){return makeError("EISDIR",`illegal operation on a directory, ${reason}`)}exports.EISDIR=EISDIR;function EEXIST(reason){return makeError("EEXIST",`file already exists, ${reason}`)}exports.EEXIST=EEXIST;function EROFS(reason){return makeError("EROFS",`read-only filesystem, ${reason}`)}exports.EROFS=EROFS;function ENOTEMPTY(reason){return makeError("ENOTEMPTY",`directory not empty, ${reason}`)}exports.ENOTEMPTY=ENOTEMPTY;function EOPNOTSUPP(reason){return makeError("EOPNOTSUPP",`operation not supported, ${reason}`)}exports.EOPNOTSUPP=EOPNOTSUPP;function ERR_DIR_CLOSED(){return makeError("ERR_DIR_CLOSED","Directory handle was closed")}exports.ERR_DIR_CLOSED=ERR_DIR_CLOSED;var LibzipError=class extends Error{constructor(message,code){super(message),this.name="Libzip Error",this.code=code}};exports.LibzipError=LibzipError}});var require_opendir=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/algorithms/opendir.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.opendir=exports.CustomDir=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),errors=tslib_1.__importStar(require_errors3()),CustomDir=class{constructor(path13,nextDirent,opts={}){this.path=path13,this.nextDirent=nextDirent,this.opts=opts,this.closed=!1}throwIfClosed(){if(this.closed)throw errors.ERR_DIR_CLOSED()}async*[Symbol.asyncIterator](){try{let dirent;for(;(dirent=await this.read())!==null;)yield dirent}finally{await this.close()}}read(cb){let dirent=this.readSync();return typeof cb<"u"?cb(null,dirent):Promise.resolve(dirent)}readSync(){return this.throwIfClosed(),this.nextDirent()}close(cb){return this.closeSync(),typeof cb<"u"?cb(null):Promise.resolve()}closeSync(){var _a,_b;this.throwIfClosed(),(_b=(_a=this.opts).onClose)===null||_b===void 0||_b.call(_a),this.closed=!0}};exports.CustomDir=CustomDir;function opendir(fakeFs,path13,entries2,opts){let nextDirent=()=>{let filename=entries2.shift();return typeof filename>"u"?null:Object.assign(fakeFs.statSync(fakeFs.pathUtils.join(path13,filename)),{name:filename})};return new CustomDir(path13,nextDirent,opts)}exports.opendir=opendir}});var require_FakeFS=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/FakeFS.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.normalizeLineEndings=exports.BasePortableFakeFS=exports.FakeFS=void 0;var os_1=require("os"),copyPromise_1=require_copyPromise(),path_1=require_path(),FakeFS=class{constructor(pathUtils){this.pathUtils=pathUtils}async*genTraversePromise(init2,{stableSort=!1}={}){let stack=[init2];for(;stack.length>0;){let p=stack.shift();if((await this.lstatPromise(p)).isDirectory()){let entries2=await this.readdirPromise(p);if(stableSort)for(let entry2 of entries2.sort())stack.push(this.pathUtils.join(p,entry2));else throw new Error("Not supported")}else yield p}}async removePromise(p,{recursive=!0,maxRetries=5}={}){let stat2;try{stat2=await this.lstatPromise(p)}catch(error){if(error.code==="ENOENT")return;throw error}if(stat2.isDirectory()){if(recursive){let entries2=await this.readdirPromise(p);await Promise.all(entries2.map(entry=>this.removePromise(this.pathUtils.resolve(p,entry))))}for(let t2=0;t2<=maxRetries;t2++)try{await this.rmdirPromise(p);break}catch(error){if(error.code!=="EBUSY"&&error.code!=="ENOTEMPTY")throw error;t2<maxRetries&&await new Promise(resolve3=>setTimeout(resolve3,t2*100))}}else await this.unlinkPromise(p)}removeSync(p,{recursive=!0}={}){let stat2;try{stat2=this.lstatSync(p)}catch(error){if(error.code==="ENOENT")return;throw error}if(stat2.isDirectory()){if(recursive)for(let entry of this.readdirSync(p))this.removeSync(this.pathUtils.resolve(p,entry));this.rmdirSync(p)}else this.unlinkSync(p)}async mkdirpPromise(p,{chmod,utimes}={}){if(p=this.resolve(p),p===this.pathUtils.dirname(p))return;let parts=p.split(this.pathUtils.sep),createdDirectory;for(let u=2;u<=parts.length;++u){let subPath=parts.slice(0,u).join(this.pathUtils.sep);if(!this.existsSync(subPath)){try{await this.mkdirPromise(subPath)}catch(error){if(error.code==="EEXIST")continue;throw error}if(createdDirectory??(createdDirectory=subPath),chmod!=null&&await this.chmodPromise(subPath,chmod),utimes!=null)await this.utimesPromise(subPath,utimes[0],utimes[1]);else{let parentStat=await this.statPromise(this.pathUtils.dirname(subPath));await this.utimesPromise(subPath,parentStat.atime,parentStat.mtime)}}}return createdDirectory}mkdirpSync(p,{chmod,utimes}={}){if(p=this.resolve(p),p===this.pathUtils.dirname(p))return;let parts=p.split(this.pathUtils.sep),createdDirectory;for(let u=2;u<=parts.length;++u){let subPath=parts.slice(0,u).join(this.pathUtils.sep);if(!this.existsSync(subPath)){try{this.mkdirSync(subPath)}catch(error){if(error.code==="EEXIST")continue;throw error}if(createdDirectory??(createdDirectory=subPath),chmod!=null&&this.chmodSync(subPath,chmod),utimes!=null)this.utimesSync(subPath,utimes[0],utimes[1]);else{let parentStat=this.statSync(this.pathUtils.dirname(subPath));this.utimesSync(subPath,parentStat.atime,parentStat.mtime)}}}return createdDirectory}async copyPromise(destination,source,{baseFs=this,overwrite=!0,stableSort=!1,stableTime=!1,linkStrategy=null}={}){return await(0,copyPromise_1.copyPromise)(this,destination,baseFs,source,{overwrite,stableSort,stableTime,linkStrategy})}copySync(destination,source,{baseFs=this,overwrite=!0}={}){let stat2=baseFs.lstatSync(source),exists=this.existsSync(destination);if(stat2.isDirectory()){this.mkdirpSync(destination);let directoryListing=baseFs.readdirSync(source);for(let entry of directoryListing)this.copySync(this.pathUtils.join(destination,entry),baseFs.pathUtils.join(source,entry),{baseFs,overwrite})}else if(stat2.isFile()){if(!exists||overwrite){exists&&this.removeSync(destination);let content=baseFs.readFileSync(source);this.writeFileSync(destination,content)}}else if(stat2.isSymbolicLink()){if(!exists||overwrite){exists&&this.removeSync(destination);let target=baseFs.readlinkSync(source);this.symlinkSync((0,path_1.convertPath)(this.pathUtils,target),destination)}}else throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat2.mode.toString(8).padStart(6,"0")})`);let mode=stat2.mode&511;this.chmodSync(destination,mode)}async changeFilePromise(p,content,opts={}){return Buffer.isBuffer(content)?this.changeFileBufferPromise(p,content,opts):this.changeFileTextPromise(p,content,opts)}async changeFileBufferPromise(p,content,{mode}={}){let current=Buffer.alloc(0);try{current=await this.readFilePromise(p)}catch{}Buffer.compare(current,content)!==0&&await this.writeFilePromise(p,content,{mode})}async changeFileTextPromise(p,content,{automaticNewlines,mode}={}){let current="";try{current=await this.readFilePromise(p,"utf8")}catch{}let normalizedContent=automaticNewlines?normalizeLineEndings(current,content):content;current!==normalizedContent&&await this.writeFilePromise(p,normalizedContent,{mode})}changeFileSync(p,content,opts={}){return Buffer.isBuffer(content)?this.changeFileBufferSync(p,content,opts):this.changeFileTextSync(p,content,opts)}changeFileBufferSync(p,content,{mode}={}){let current=Buffer.alloc(0);try{current=this.readFileSync(p)}catch{}Buffer.compare(current,content)!==0&&this.writeFileSync(p,content,{mode})}changeFileTextSync(p,content,{automaticNewlines=!1,mode}={}){let current="";try{current=this.readFileSync(p,"utf8")}catch{}let normalizedContent=automaticNewlines?normalizeLineEndings(current,content):content;current!==normalizedContent&&this.writeFileSync(p,normalizedContent,{mode})}async movePromise(fromP,toP){try{await this.renamePromise(fromP,toP)}catch(error){if(error.code==="EXDEV")await this.copyPromise(toP,fromP),await this.removePromise(fromP);else throw error}}moveSync(fromP,toP){try{this.renameSync(fromP,toP)}catch(error){if(error.code==="EXDEV")this.copySync(toP,fromP),this.removeSync(fromP);else throw error}}async lockPromise(affectedPath,callback){let lockPath=`${affectedPath}.flock`,interval=1e3/60,startTime=Date.now(),fd=null,isAlive=async()=>{let pid;try{[pid]=await this.readJsonPromise(lockPath)}catch{return Date.now()-startTime<500}try{return process.kill(pid,0),!0}catch{return!1}};for(;fd===null;)try{fd=await this.openPromise(lockPath,"wx")}catch(error){if(error.code==="EEXIST"){if(!await isAlive())try{await this.unlinkPromise(lockPath);continue}catch{}if(Date.now()-startTime<60*1e3)await new Promise(resolve3=>setTimeout(resolve3,interval));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`)}else throw error}await this.writePromise(fd,JSON.stringify([process.pid]));try{return await callback()}finally{try{await this.closePromise(fd),await this.unlinkPromise(lockPath)}catch{}}}async readJsonPromise(p){let content=await this.readFilePromise(p,"utf8");try{return JSON.parse(content)}catch(error){throw error.message+=` (in ${p})`,error}}readJsonSync(p){let content=this.readFileSync(p,"utf8");try{return JSON.parse(content)}catch(error){throw error.message+=` (in ${p})`,error}}async writeJsonPromise(p,data){return await this.writeFilePromise(p,`${JSON.stringify(data,null,2)}
41
+ `);return Buffer.from(result)};exports.decodePax=function(buf){for(var result={};buf.length;){for(var i2=0;i2<buf.length&&buf[i2]!==32;)i2++;var len=parseInt(buf.slice(0,i2).toString(),10);if(!len)return result;var b=buf.slice(i2+1,len-1).toString(),keyIndex=b.indexOf("=");if(keyIndex===-1)return result;result[b.slice(0,keyIndex)]=b.slice(keyIndex+1),buf=buf.slice(len)}return result};exports.encode=function(opts){var buf=alloc(512),name=opts.name,prefix="";if(opts.typeflag===5&&name[name.length-1]!=="/"&&(name+="/"),Buffer.byteLength(name)!==name.length)return null;for(;Buffer.byteLength(name)>100;){var i2=name.indexOf("/");if(i2===-1)return null;prefix+=prefix?"/"+name.slice(0,i2):name.slice(0,i2),name=name.slice(i2+1)}return Buffer.byteLength(name)>100||Buffer.byteLength(prefix)>155||opts.linkname&&Buffer.byteLength(opts.linkname)>100?null:(buf.write(name),buf.write(encodeOct(opts.mode&MASK,6),100),buf.write(encodeOct(opts.uid,6),108),buf.write(encodeOct(opts.gid,6),116),buf.write(encodeOct(opts.size,11),124),buf.write(encodeOct(opts.mtime.getTime()/1e3|0,11),136),buf[156]=ZERO_OFFSET+toTypeflag(opts.type),opts.linkname&&buf.write(opts.linkname,157),USTAR_MAGIC.copy(buf,MAGIC_OFFSET),USTAR_VER.copy(buf,VERSION_OFFSET),opts.uname&&buf.write(opts.uname,265),opts.gname&&buf.write(opts.gname,297),buf.write(encodeOct(opts.devmajor||0,6),329),buf.write(encodeOct(opts.devminor||0,6),337),prefix&&buf.write(prefix,345),buf.write(encodeOct(cksum(buf),6),148),buf)};exports.decode=function(buf,filenameEncoding,allowUnknownFormat){var typeflag=buf[156]===0?0:buf[156]-ZERO_OFFSET,name=decodeStr(buf,0,100,filenameEncoding),mode=decodeOct(buf,100,8),uid=decodeOct(buf,108,8),gid=decodeOct(buf,116,8),size=decodeOct(buf,124,12),mtime=decodeOct(buf,136,12),type=toType(typeflag),linkname=buf[157]===0?null:decodeStr(buf,157,100,filenameEncoding),uname=decodeStr(buf,265,32),gname=decodeStr(buf,297,32),devmajor=decodeOct(buf,329,8),devminor=decodeOct(buf,337,8),c=cksum(buf);if(c===8*32)return null;if(c!==decodeOct(buf,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(USTAR_MAGIC.compare(buf,MAGIC_OFFSET,MAGIC_OFFSET+6)===0)buf[345]&&(name=decodeStr(buf,345,155,filenameEncoding)+"/"+name);else if(!(GNU_MAGIC.compare(buf,MAGIC_OFFSET,MAGIC_OFFSET+6)===0&&GNU_VER.compare(buf,VERSION_OFFSET,VERSION_OFFSET+2)===0)){if(!allowUnknownFormat)throw new Error("Invalid tar header: unknown format.")}return typeflag===0&&name&&name[name.length-1]==="/"&&(typeflag=5),{name,mode,uid,gid,size,mtime:new Date(1e3*mtime),type,linkname,uname,gname,devmajor,devminor}}}});var require_extract=__commonJS({"../../node_modules/tar-stream/extract.js"(exports,module2){"use strict";var util=require("util"),bl=require_bl(),headers=require_headers(),Writable=require_readable().Writable,PassThrough3=require_readable().PassThrough,noop3=function(){},overflow=function(size){return size&=511,size&&512-size},emptyStream=function(self2,offset){var s2=new Source(self2,offset);return s2.end(),s2},mixinPax=function(header,pax){return pax.path&&(header.name=pax.path),pax.linkpath&&(header.linkname=pax.linkpath),pax.size&&(header.size=parseInt(pax.size,10)),header.pax=pax,header},Source=function(self2,offset){this._parent=self2,this.offset=offset,PassThrough3.call(this,{autoDestroy:!1})};util.inherits(Source,PassThrough3);Source.prototype.destroy=function(err){this._parent.destroy(err)};var Extract=function(opts){if(!(this instanceof Extract))return new Extract(opts);Writable.call(this,opts),opts=opts||{},this._offset=0,this._buffer=bl(),this._missing=0,this._partial=!1,this._onparse=noop3,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var self2=this,b=self2._buffer,oncontinue=function(){self2._continue()},onunlock=function(err){if(self2._locked=!1,err)return self2.destroy(err);self2._stream||oncontinue()},onstreamend=function(){self2._stream=null;var drain=overflow(self2._header.size);drain?self2._parse(drain,ondrain):self2._parse(512,onheader),self2._locked||oncontinue()},ondrain=function(){self2._buffer.consume(overflow(self2._header.size)),self2._parse(512,onheader),oncontinue()},onpaxglobalheader=function(){var size=self2._header.size;self2._paxGlobal=headers.decodePax(b.slice(0,size)),b.consume(size),onstreamend()},onpaxheader=function(){var size=self2._header.size;self2._pax=headers.decodePax(b.slice(0,size)),self2._paxGlobal&&(self2._pax=Object.assign({},self2._paxGlobal,self2._pax)),b.consume(size),onstreamend()},ongnulongpath=function(){var size=self2._header.size;this._gnuLongPath=headers.decodeLongPath(b.slice(0,size),opts.filenameEncoding),b.consume(size),onstreamend()},ongnulonglinkpath=function(){var size=self2._header.size;this._gnuLongLinkPath=headers.decodeLongPath(b.slice(0,size),opts.filenameEncoding),b.consume(size),onstreamend()},onheader=function(){var offset=self2._offset,header;try{header=self2._header=headers.decode(b.slice(0,512),opts.filenameEncoding,opts.allowUnknownFormat)}catch(err){self2.emit("error",err)}if(b.consume(512),!header){self2._parse(512,onheader),oncontinue();return}if(header.type==="gnu-long-path"){self2._parse(header.size,ongnulongpath),oncontinue();return}if(header.type==="gnu-long-link-path"){self2._parse(header.size,ongnulonglinkpath),oncontinue();return}if(header.type==="pax-global-header"){self2._parse(header.size,onpaxglobalheader),oncontinue();return}if(header.type==="pax-header"){self2._parse(header.size,onpaxheader),oncontinue();return}if(self2._gnuLongPath&&(header.name=self2._gnuLongPath,self2._gnuLongPath=null),self2._gnuLongLinkPath&&(header.linkname=self2._gnuLongLinkPath,self2._gnuLongLinkPath=null),self2._pax&&(self2._header=header=mixinPax(header,self2._pax),self2._pax=null),self2._locked=!0,!header.size||header.type==="directory"){self2._parse(512,onheader),self2.emit("entry",header,emptyStream(self2,offset),onunlock);return}self2._stream=new Source(self2,offset),self2.emit("entry",header,self2._stream,onunlock),self2._parse(header.size,onstreamend),oncontinue()};this._onheader=onheader,this._parse(512,onheader)};util.inherits(Extract,Writable);Extract.prototype.destroy=function(err){this._destroyed||(this._destroyed=!0,err&&this.emit("error",err),this.emit("close"),this._stream&&this._stream.emit("close"))};Extract.prototype._parse=function(size,onparse){this._destroyed||(this._offset+=size,this._missing=size,onparse===this._onheader&&(this._partial=!1),this._onparse=onparse)};Extract.prototype._continue=function(){if(!this._destroyed){var cb=this._cb;this._cb=noop3,this._overflow?this._write(this._overflow,void 0,cb):cb()}};Extract.prototype._write=function(data,enc,cb){if(!this._destroyed){var s2=this._stream,b=this._buffer,missing=this._missing;if(data.length&&(this._partial=!0),data.length<missing)return this._missing-=data.length,this._overflow=null,s2?s2.write(data,cb):(b.append(data),cb());this._cb=cb,this._missing=0;var overflow2=null;data.length>missing&&(overflow2=data.slice(missing),data=data.slice(0,missing)),s2?s2.end(data):b.append(data),this._overflow=overflow2,this._onparse()}};Extract.prototype._final=function(cb){if(this._partial)return this.destroy(new Error("Unexpected end of data"));cb()};module2.exports=Extract}});var require_fs_constants=__commonJS({"../../node_modules/fs-constants/index.js"(exports,module2){"use strict";module2.exports=require("fs").constants||require("constants")}});var require_pack=__commonJS({"../../node_modules/tar-stream/pack.js"(exports,module2){"use strict";var constants=require_fs_constants(),eos=require_end_of_stream(),inherits=require_inherits(),alloc=Buffer.alloc,Readable=require_readable().Readable,Writable=require_readable().Writable,StringDecoder=require("string_decoder").StringDecoder,headers=require_headers(),DMODE=parseInt("755",8),FMODE=parseInt("644",8),END_OF_TAR=alloc(1024),noop3=function(){},overflow=function(self2,size){size&=511,size&&self2.push(END_OF_TAR.slice(0,512-size))};function modeToType(mode){switch(mode&constants.S_IFMT){case constants.S_IFBLK:return"block-device";case constants.S_IFCHR:return"character-device";case constants.S_IFDIR:return"directory";case constants.S_IFIFO:return"fifo";case constants.S_IFLNK:return"symlink"}return"file"}var Sink=function(to){Writable.call(this),this.written=0,this._to=to,this._destroyed=!1};inherits(Sink,Writable);Sink.prototype._write=function(data,enc,cb){if(this.written+=data.length,this._to.push(data))return cb();this._to._drain=cb};Sink.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var LinkSink=function(){Writable.call(this),this.linkname="",this._decoder=new StringDecoder("utf-8"),this._destroyed=!1};inherits(LinkSink,Writable);LinkSink.prototype._write=function(data,enc,cb){this.linkname+=this._decoder.write(data),cb()};LinkSink.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Void=function(){Writable.call(this),this._destroyed=!1};inherits(Void,Writable);Void.prototype._write=function(data,enc,cb){cb(new Error("No body allowed for this entry"))};Void.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Pack=function(opts){if(!(this instanceof Pack))return new Pack(opts);Readable.call(this,opts),this._drain=noop3,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};inherits(Pack,Readable);Pack.prototype.entry=function(header,buffer,callback){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof buffer=="function"&&(callback=buffer,buffer=null),callback||(callback=noop3);var self2=this;if((!header.size||header.type==="symlink")&&(header.size=0),header.type||(header.type=modeToType(header.mode)),header.mode||(header.mode=header.type==="directory"?DMODE:FMODE),header.uid||(header.uid=0),header.gid||(header.gid=0),header.mtime||(header.mtime=new Date),typeof buffer=="string"&&(buffer=Buffer.from(buffer)),Buffer.isBuffer(buffer)){header.size=buffer.length,this._encode(header);var ok=this.push(buffer);return overflow(self2,header.size),ok?process.nextTick(callback):this._drain=callback,new Void}if(header.type==="symlink"&&!header.linkname){var linkSink=new LinkSink;return eos(linkSink,function(err){if(err)return self2.destroy(),callback(err);header.linkname=linkSink.linkname,self2._encode(header),callback()}),linkSink}if(this._encode(header),header.type!=="file"&&header.type!=="contiguous-file")return process.nextTick(callback),new Void;var sink=new Sink(this);return this._stream=sink,eos(sink,function(err){if(self2._stream=null,err)return self2.destroy(),callback(err);if(sink.written!==header.size)return self2.destroy(),callback(new Error("size mismatch"));overflow(self2,header.size),self2._finalizing&&self2.finalize(),callback()}),sink}};Pack.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(END_OF_TAR),this.push(null))};Pack.prototype.destroy=function(err){this._destroyed||(this._destroyed=!0,err&&this.emit("error",err),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Pack.prototype._encode=function(header){if(!header.pax){var buf=headers.encode(header);if(buf){this.push(buf);return}}this._encodePax(header)};Pack.prototype._encodePax=function(header){var paxHeader=headers.encodePax({name:header.name,linkname:header.linkname,pax:header.pax}),newHeader={name:"PaxHeader",mode:header.mode,uid:header.uid,gid:header.gid,size:paxHeader.length,mtime:header.mtime,type:"pax-header",linkname:header.linkname&&"PaxHeader",uname:header.uname,gname:header.gname,devmajor:header.devmajor,devminor:header.devminor};this.push(headers.encode(newHeader)),this.push(paxHeader),overflow(this,paxHeader.length),newHeader.size=header.size,newHeader.type=header.type,this.push(headers.encode(newHeader))};Pack.prototype._read=function(n){var drain=this._drain;this._drain=noop3,drain()};module2.exports=Pack}});var require_tar_stream=__commonJS({"../../node_modules/tar-stream/index.js"(exports){"use strict";exports.extract=require_extract();exports.pack=require_pack()}});var require_mkdirp_classic=__commonJS({"../../node_modules/mkdirp-classic/index.js"(exports,module2){"use strict";var path13=require("path"),fs9=require("fs"),_0777=parseInt("0777",8);module2.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(p,opts,f3,made){typeof opts=="function"?(f3=opts,opts={}):(!opts||typeof opts!="object")&&(opts={mode:opts});var mode=opts.mode,xfs=opts.fs||fs9;mode===void 0&&(mode=_0777&~process.umask()),made||(made=null);var cb=f3||function(){};p=path13.resolve(p),xfs.mkdir(p,mode,function(er){if(!er)return made=made||p,cb(null,made);switch(er.code){case"ENOENT":mkdirP(path13.dirname(p),opts,function(er2,made2){er2?cb(er2,made2):mkdirP(p,opts,cb,made2)});break;default:xfs.stat(p,function(er2,stat2){er2||!stat2.isDirectory()?cb(er,made):cb(null,made)});break}})}mkdirP.sync=function sync(p,opts,made){(!opts||typeof opts!="object")&&(opts={mode:opts});var mode=opts.mode,xfs=opts.fs||fs9;mode===void 0&&(mode=_0777&~process.umask()),made||(made=null),p=path13.resolve(p);try{xfs.mkdirSync(p,mode),made=made||p}catch(err0){switch(err0.code){case"ENOENT":made=sync(path13.dirname(p),opts,made),sync(p,opts,made);break;default:var stat2;try{stat2=xfs.statSync(p)}catch{throw err0}if(!stat2.isDirectory())throw err0;break}}return made}}});var require_tar_fs=__commonJS({"../../node_modules/tar-fs/index.js"(exports){"use strict";var chownr=require_chownr(),tar=require_tar_stream(),pump2=require_pump(),mkdirp=require_mkdirp_classic(),fs9=require("fs"),path13=require("path"),os3=require("os"),win32=os3.platform()==="win32",noop3=function(){},echo=function(name){return name},normalize=win32?function(name){return name.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:echo,statAll=function(fs10,stat2,cwd,ignore,entries2,sort2){var queue=entries2||["."];return function(callback){if(!queue.length)return callback();var next=queue.shift(),nextAbs=path13.join(cwd,next);stat2.call(fs10,nextAbs,function(err,stat3){if(err)return callback(err);if(!stat3.isDirectory())return callback(null,next,stat3);fs10.readdir(nextAbs,function(err2,files){if(err2)return callback(err2);sort2&&files.sort();for(var i2=0;i2<files.length;i2++)ignore(path13.join(cwd,next,files[i2]))||queue.push(path13.join(next,files[i2]));callback(null,next,stat3)})})}},strip=function(map,level){return function(header){header.name=header.name.split("/").slice(level).join("/");var linkname=header.linkname;return linkname&&(header.type==="link"||path13.isAbsolute(linkname))&&(header.linkname=linkname.split("/").slice(level).join("/")),map(header)}};exports.pack=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs9,ignore=opts.ignore||opts.filter||noop3,map=opts.map||noop3,mapStream=opts.mapStream||echo,statNext=statAll(xfs,opts.dereference?xfs.stat:xfs.lstat,cwd,ignore,opts.entries,opts.sort),strict=opts.strict!==!1,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,pack=opts.pack||tar.pack(),finish=opts.finish||noop3;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var onsymlink=function(filename,header){xfs.readlink(path13.join(cwd,filename),function(err,linkname){if(err)return pack.destroy(err);header.linkname=normalize(linkname),pack.entry(header,onnextentry)})},onstat=function(err,filename,stat2){if(err)return pack.destroy(err);if(!filename)return opts.finalize!==!1&&pack.finalize(),finish(pack);if(stat2.isSocket())return onnextentry();var header={name:normalize(filename),mode:(stat2.mode|(stat2.isDirectory()?dmode:fmode))&umask,mtime:stat2.mtime,size:stat2.size,type:"file",uid:stat2.uid,gid:stat2.gid};if(stat2.isDirectory())return header.size=0,header.type="directory",header=map(header)||header,pack.entry(header,onnextentry);if(stat2.isSymbolicLink())return header.size=0,header.type="symlink",header=map(header)||header,onsymlink(filename,header);if(header=map(header)||header,!stat2.isFile())return strict?pack.destroy(new Error("unsupported type for "+filename)):onnextentry();var entry=pack.entry(header,onnextentry);if(entry){var rs=mapStream(xfs.createReadStream(path13.join(cwd,filename),{start:0,end:header.size>0?header.size-1:header.size}),header);rs.on("error",function(err2){entry.destroy(err2)}),pump2(rs,entry)}},onnextentry=function(err){if(err)return pack.destroy(err);statNext(onstat)};return onnextentry(),pack};var head=function(list){return list.length?list[list.length-1]:null},processGetuid=function(){return process.getuid?process.getuid():-1},processUmask=function(){return process.umask?process.umask():0};exports.extract=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs9,ignore=opts.ignore||opts.filter||noop3,map=opts.map||noop3,mapStream=opts.mapStream||echo,own=opts.chown!==!1&&!win32&&processGetuid()===0,extract2=opts.extract||tar.extract(),stack=[],now=new Date,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,strict=opts.strict!==!1;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var utimesParent=function(name,cb){for(var top;(top=head(stack))&&name.slice(0,top[0].length)!==top[0];)stack.pop();if(!top)return cb();xfs.utimes(top[0],now,top[1],cb)},utimes=function(name,header,cb){if(opts.utimes===!1)return cb();if(header.type==="directory")return xfs.utimes(name,now,header.mtime,cb);if(header.type==="symlink")return utimesParent(name,cb);xfs.utimes(name,now,header.mtime,function(err){if(err)return cb(err);utimesParent(name,cb)})},chperm=function(name,header,cb){var link=header.type==="symlink",chmod=link?xfs.lchmod:xfs.chmod,chown=link?xfs.lchown:xfs.chown;if(!chmod)return cb();var mode=(header.mode|(header.type==="directory"?dmode:fmode))&umask;chown&&own?chown.call(xfs,name,header.uid,header.gid,onchown):onchown(null);function onchown(err){if(err)return cb(err);if(!chmod)return cb();chmod.call(xfs,name,mode,cb)}};return extract2.on("entry",function(header,stream2,next){header=map(header)||header,header.name=normalize(header.name);var name=path13.join(cwd,path13.join("/",header.name));if(ignore(name,header))return stream2.resume(),next();var stat2=function(err){if(err)return next(err);utimes(name,header,function(err2){if(err2)return next(err2);if(win32)return next();chperm(name,header,next)})},onsymlink=function(){if(win32)return next();xfs.unlink(name,function(){xfs.symlink(header.linkname,name,stat2)})},onlink=function(){if(win32)return next();xfs.unlink(name,function(){var srcpath=path13.join(cwd,path13.join("/",header.linkname));xfs.link(srcpath,name,function(err){if(err&&err.code==="EPERM"&&opts.hardlinkAsFilesFallback)return stream2=xfs.createReadStream(srcpath),onfile();stat2(err)})})},onfile=function(){var ws=xfs.createWriteStream(name),rs=mapStream(stream2,header);ws.on("error",function(err){rs.destroy(err)}),pump2(rs,ws,function(err){if(err)return next(err);ws.on("close",stat2)})};if(header.type==="directory")return stack.push([name,header.mtime]),mkdirfix(name,{fs:xfs,own,uid:header.uid,gid:header.gid},stat2);var dir=path13.dirname(name);validate(xfs,dir,path13.join(cwd,"."),function(err,valid){if(err)return next(err);if(!valid)return next(new Error(dir+" is not a valid path"));mkdirfix(dir,{fs:xfs,own,uid:header.uid,gid:header.gid},function(err2){if(err2)return next(err2);switch(header.type){case"file":return onfile();case"link":return onlink();case"symlink":return onsymlink()}if(strict)return next(new Error("unsupported type for "+name+" ("+header.type+")"));stream2.resume(),next()})})}),opts.finish&&extract2.on("finish",opts.finish),extract2};function validate(fs10,name,root,cb){if(name===root)return cb(null,!0);fs10.lstat(name,function(err,st){if(err&&err.code!=="ENOENT")return cb(err);if(err||st.isDirectory())return validate(fs10,path13.join(name,".."),root,cb);cb(null,!1)})}function mkdirfix(name,opts,cb){mkdirp(name,{fs:opts.fs},function(err,made){!err&&made&&opts.own?chownr(made,opts.uid,opts.gid,cb):cb(err)})}}});var require_process_nextick_args=__commonJS({"../../node_modules/process-nextick-args/index.js"(exports,module2){"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?module2.exports={nextTick}:module2.exports=process;function nextTick(fn,arg1,arg2,arg3){if(typeof fn!="function")throw new TypeError('"callback" argument must be a function');var len=arguments.length,args,i2;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function(){fn.call(null,arg1)});case 3:return process.nextTick(function(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function(){fn.call(null,arg1,arg2,arg3)});default:for(args=new Array(len-1),i2=0;i2<args.length;)args[i2++]=arguments[i2];return process.nextTick(function(){fn.apply(null,args)})}}}});var require_isarray=__commonJS({"../../node_modules/peek-stream/node_modules/isarray/index.js"(exports,module2){"use strict";var toString2={}.toString;module2.exports=Array.isArray||function(arr){return toString2.call(arr)=="[object Array]"}}});var require_stream3=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/internal/streams/stream.js"(exports,module2){"use strict";module2.exports=require("stream")}});var require_safe_buffer2=__commonJS({"../../node_modules/peek-stream/node_modules/safe-buffer/index.js"(exports,module2){"use strict";var buffer=require("buffer"),Buffer4=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}Buffer4.from&&Buffer4.alloc&&Buffer4.allocUnsafe&&Buffer4.allocUnsafeSlow?module2.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer);function SafeBuffer(arg,encodingOrOffset,length){return Buffer4(arg,encodingOrOffset,length)}copyProps(Buffer4,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg=="number")throw new TypeError("Argument must not be a number");return Buffer4(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!="number")throw new TypeError("Argument must be a number");var buf=Buffer4(size);return fill!==void 0?typeof encoding=="string"?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return Buffer4(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}}});var require_util=__commonJS({"../../node_modules/core-util-is/lib/util.js"(exports){"use strict";function isArray(arg){return Array.isArray?Array.isArray(arg):objectToString(arg)==="[object Array]"}exports.isArray=isArray;function isBoolean(arg){return typeof arg=="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg=="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg=="string"}exports.isString=isString;function isSymbol(arg){return typeof arg=="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg=="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e2){return objectToString(e2)==="[object Error]"||e2 instanceof Error}exports.isError=isError;function isFunction2(arg){return typeof arg=="function"}exports.isFunction=isFunction2;function isPrimitive(arg){return arg===null||typeof arg=="boolean"||typeof arg=="number"||typeof arg=="string"||typeof arg=="symbol"||typeof arg>"u"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("buffer").Buffer.isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}});var require_BufferList2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports,module2){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var Buffer4=require_safe_buffer2().Buffer,util=require("util");function copyBuffer(src,target,offset){src.copy(target,offset)}module2.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};this.length===0&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(this.length!==0){var ret=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s2){if(this.length===0)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s2+p.data;return ret},BufferList.prototype.concat=function(n){if(this.length===0)return Buffer4.alloc(0);for(var ret=Buffer4.allocUnsafe(n>>>0),p=this.head,i2=0;p;)copyBuffer(p.data,ret,i2),i2+=p.data.length,p=p.next;return ret},BufferList}();util&&util.inspect&&util.inspect.custom&&(module2.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})}});var require_destroy2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports,module2){"use strict";var pna=require_process_nextick_args();function destroy(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):err&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,this,err)):pna.nextTick(emitErrorNT,this,err)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err2){!cb&&err2?_this._writableState?_this._writableState.errorEmitted||(_this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,_this,err2)):pna.nextTick(emitErrorNT,_this,err2):cb&&cb(err2)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(self2,err){self2.emit("error",err)}module2.exports={destroy,undestroy}}});var require_stream_writable2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_writable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Writable;function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}var asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick,Duplex2;Writable.WritableState=WritableState;var util=Object.create(require_util());util.inherits=require_inherits();var internalUtil={deprecate:require("util-deprecate")},Stream3=require_stream3(),Buffer4=require_safe_buffer2().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var destroyImpl=require_destroy2();util.inherits(Writable,Stream3);function nop(){}function WritableState(options,stream2){Duplex2=Duplex2||require_stream_duplex2(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,writableHwm=options.writableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(writableHwm||writableHwm===0)?this.highWaterMark=writableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream2,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var realHasInstance;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return realHasInstance.call(this,object)?!0:this!==Writable?!1:object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this};function Writable(options){if(Duplex2=Duplex2||require_stream_duplex2(),!realHasInstance.call(Writable,this)&&!(this instanceof Duplex2))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&(typeof options.write=="function"&&(this._write=options.write),typeof options.writev=="function"&&(this._writev=options.writev),typeof options.destroy=="function"&&(this._destroy=options.destroy),typeof options.final=="function"&&(this._final=options.final)),Stream3.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream2,cb){var er=new Error("write after end");stream2.emit("error",er),pna.nextTick(cb,er)}function validChunk(stream2,state,chunk,cb){var valid=!0,er=!1;return chunk===null?er=new TypeError("May not write null values to stream"):typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream2.emit("error",er),pna.nextTick(cb,er),valid=!1),valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&_isUint8Array(chunk);return isBuf&&!Buffer4.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),typeof encoding=="function"&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),typeof cb!="function"&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,!state.writing&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(this,state))};Writable.prototype.setDefaultEncoding=function(encoding){if(typeof encoding=="string"&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this};function decodeChunk(state,chunk,encoding){return!state.objectMode&&state.decodeStrings!==!1&&typeof chunk=="string"&&(chunk=Buffer4.from(chunk,encoding)),chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(stream2,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(ret||(state.needDrain=!0),state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk,encoding,isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream2,state,!1,len,chunk,encoding,cb);return ret}function doWrite(stream2,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream2._writev(chunk,state.onwrite):stream2._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream2,state,sync,er,cb){--state.pendingcb,sync?(pna.nextTick(cb,er),pna.nextTick(finishMaybe,stream2,state),stream2._writableState.errorEmitted=!0,stream2.emit("error",er)):(cb(er),stream2._writableState.errorEmitted=!0,stream2.emit("error",er),finishMaybe(stream2,state))}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream2,er){var state=stream2._writableState,sync=state.sync,cb=state.writecb;if(onwriteStateUpdate(state),er)onwriteError(stream2,state,sync,er,cb);else{var finished=needFinish(state);!finished&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(stream2,state),sync?asyncWrite(afterWrite,stream2,state,finished,cb):afterWrite(stream2,state,finished,cb)}}function afterWrite(stream2,state,finished,cb){finished||onwriteDrain(stream2,state),state.pendingcb--,cb(),finishMaybe(stream2,state)}function onwriteDrain(stream2,state){state.length===0&&state.needDrain&&(state.needDrain=!1,stream2.emit("drain"))}function clearBuffer(stream2,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream2._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream2,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback,len=state.objectMode?1:chunk.length;if(doWrite(stream2,state,!1,len,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}entry===null&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;typeof chunk=="function"?(cb=chunk,chunk=null,encoding=null):typeof encoding=="function"&&(cb=encoding,encoding=null),chunk!=null&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||endWritable(this,state,cb)};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing}function callFinal(stream2,state){stream2._final(function(err){state.pendingcb--,err&&stream2.emit("error",err),state.prefinished=!0,stream2.emit("prefinish"),finishMaybe(stream2,state)})}function prefinish(stream2,state){!state.prefinished&&!state.finalCalled&&(typeof stream2._final=="function"?(state.pendingcb++,state.finalCalled=!0,pna.nextTick(callFinal,stream2,state)):(state.prefinished=!0,stream2.emit("prefinish")))}function finishMaybe(stream2,state){var need=needFinish(state);return need&&(prefinish(stream2,state),state.pendingcb===0&&(state.finished=!0,stream2.emit("finish"))),need}function endWritable(stream2,state,cb){state.ending=!0,finishMaybe(stream2,state),cb&&(state.finished?pna.nextTick(cb):stream2.once("finish",cb)),state.ended=!0,stream2.writable=!1}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;for(corkReq.entry=null;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree.next=corkReq}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}});var require_stream_duplex2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_duplex.js"(exports,module2){"use strict";var pna=require_process_nextick_args(),objectKeys=Object.keys||function(obj){var keys2=[];for(var key in obj)keys2.push(key);return keys2};module2.exports=Duplex2;var util=Object.create(require_util());util.inherits=require_inherits();var Readable=require_stream_readable2(),Writable=require_stream_writable2();util.inherits(Duplex2,Readable);for(keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++)method=keys[v],Duplex2.prototype[method]||(Duplex2.prototype[method]=Writable.prototype[method]);var keys,method,v;function Duplex2(options){if(!(this instanceof Duplex2))return new Duplex2(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}Object.defineProperty(Duplex2.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(self2){self2.end()}Object.defineProperty(Duplex2.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(value){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=value,this._writableState.destroyed=value)}});Duplex2.prototype._destroy=function(err,cb){this.push(null),this.end(),pna.nextTick(cb,err)}}});var require_string_decoder2=__commonJS({"../../node_modules/peek-stream/node_modules/string_decoder/lib/string_decoder.js"(exports){"use strict";var Buffer4=require_safe_buffer2().Buffer,isEncoding=Buffer4.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!="string"&&(Buffer4.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:this.write=simpleWrite,this.end=simpleEnd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer4.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r2,i2;if(this.lastNeed){if(r2=this.fillLast(buf),r2===void 0)return"";i2=this.lastNeed,this.lastNeed=0}else i2=0;return i2<buf.length?r2?r2+this.text(buf,i2):this.text(buf,i2):r2||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length};function utf8CheckByte(byte){return byte<=127?0:byte>>5===6?2:byte>>4===14?3:byte>>3===30?4:byte>>6===2?-1:-2}function utf8CheckIncomplete(self2,buf,i2){var j=buf.length-1;if(j<i2)return 0;var nb=utf8CheckByte(buf[j]);return nb>=0?(nb>0&&(self2.lastNeed=nb-1),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(self2.lastNeed=nb-2),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(nb===2?nb=0:self2.lastNeed=nb-3),nb):0))}function utf8CheckExtraBytes(self2,buf,p){if((buf[0]&192)!==128)return self2.lastNeed=0,"\uFFFD";if(self2.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128)return self2.lastNeed=1,"\uFFFD";if(self2.lastNeed>2&&buf.length>2&&(buf[2]&192)!==128)return self2.lastNeed=2,"\uFFFD"}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r2=utf8CheckExtraBytes(this,buf,p);if(r2!==void 0)return r2;if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,p,0,buf.length),this.lastNeed-=buf.length}function utf8Text(buf,i2){var total=utf8CheckIncomplete(this,buf,i2);if(!this.lastNeed)return buf.toString("utf8",i2);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i2,end)}function utf8End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+"\uFFFD":r2}function utf16Text(buf,i2){if((buf.length-i2)%2===0){var r2=buf.toString("utf16le",i2);if(r2){var c=r2.charCodeAt(r2.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r2.slice(0,-1)}return r2}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i2,buf.length-1)}function utf16End(buf){var r2=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r2+this.lastChar.toString("utf16le",0,end)}return r2}function base64Text(buf,i2){var n=(buf.length-i2)%3;return n===0?buf.toString("base64",i2):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i2,buf.length-n))}function base64End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+this.lastChar.toString("base64",0,3-this.lastNeed):r2}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}}});var require_stream_readable2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_readable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Readable;var isArray=require_isarray(),Duplex2;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream3=require_stream3(),Buffer4=require_safe_buffer2().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var util=Object.create(require_util());util.inherits=require_inherits();var debugUtil=require("util"),debug=void 0;debugUtil&&debugUtil.debuglog?debug=debugUtil.debuglog("stream"):debug=function(){};var BufferList=require_BufferList2(),destroyImpl=require_destroy2(),StringDecoder;util.inherits(Readable,Stream3);var kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(emitter,event,fn){if(typeof emitter.prependListener=="function")return emitter.prependListener(event,fn);!emitter._events||!emitter._events[event]?emitter.on(event,fn):isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]}function ReadableState(options,stream2){Duplex2=Duplex2||require_stream_duplex2(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,readableHwm=options.readableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(readableHwm||readableHwm===0)?this.highWaterMark=readableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require_string_decoder2().StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex2=Duplex2||require_stream_duplex2(),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&(typeof options.read=="function"&&(this._read=options.read),typeof options.destroy=="function"&&(this._destroy=options.destroy)),Stream3.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}});Readable.prototype.destroy=destroyImpl.destroy;Readable.prototype._undestroy=destroyImpl.undestroy;Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)};Readable.prototype.push=function(chunk,encoding){var state=this._readableState,skipChunkCheck;return state.objectMode?skipChunkCheck=!0:typeof chunk=="string"&&(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=Buffer4.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)};Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)};function readableAddChunk(stream2,chunk,encoding,addToFront,skipChunkCheck){var state=stream2._readableState;if(chunk===null)state.reading=!1,onEofChunk(stream2,state);else{var er;skipChunkCheck||(er=chunkInvalid(state,chunk)),er?stream2.emit("error",er):state.objectMode||chunk&&chunk.length>0?(typeof chunk!="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer4.prototype&&(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream2.emit("error",new Error("stream.unshift() after end event")):addChunk(stream2,state,chunk,!0):state.ended?stream2.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||chunk.length!==0?addChunk(stream2,state,chunk,!1):maybeReadMore(stream2,state)):addChunk(stream2,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream2,state,chunk,addToFront){state.flowing&&state.length===0&&!state.sync?(stream2.emit("data",chunk),stream2.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream2)),maybeReadMore(stream2,state)}function chunkInvalid(state,chunk){var er;return!_isUint8Array(chunk)&&typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===!1};Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=require_string_decoder2().StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;function computeNewHighWaterMark(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||state.length===0&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(n!==0&&(state.emittedReadable=!1),n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),state.length===0&&state.ended?endReadable(this):emitReadable(this),null;if(n=howMuchToRead(n,state),n===0&&state.ended)return state.length===0&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(state.length===0||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),state.ended||state.reading?(doRead=!1,debug("reading or ended",doRead)):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,state.length===0&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state)));var ret;return n>0?ret=fromList(n,state):ret=null,ret===null?(state.needReadable=!0,n=0):state.length-=n,state.length===0&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),ret!==null&&this.emit("data",ret),ret};function onEofChunk(stream2,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream2)}}function emitReadable(stream2){var state=stream2._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream2):emitReadable_(stream2))}function emitReadable_(stream2){debug("emit readable"),stream2.emit("readable"),flow(stream2)}function maybeReadMore(stream2,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream2,state))}function maybeReadMore_(stream2,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream2.read(0),len!==state.length);)len=state.length;state.readingMore=!1}Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1;function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain)&&ondrain()}var increasedAwaitDrain=!1;src.on("data",ondata);function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1;var ret=dest.write(chunk);ret===!1&&!increasedAwaitDrain&&((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",state.awaitDrain),state.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),EElistenerCount(dest,"error")===0&&dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish),unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe"),src.unpipe(dest)}return dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,state.awaitDrain===0&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(state.pipesCount===0)return this;if(state.pipesCount===1)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i2=0;i2<len;i2++)dests[i2].emit("unpipe",this,{hasUnpiped:!1});return this}var index=indexOf(state.pipes,dest);return index===-1?this:(state.pipes.splice(index,1),state.pipesCount-=1,state.pipesCount===1&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)};Readable.prototype.on=function(ev,fn){var res=Stream3.prototype.on.call(this,ev,fn);if(ev==="data")this._readableState.flowing!==!1&&this.resume();else if(ev==="readable"){var state=this._readableState;!state.endEmitted&&!state.readableListening&&(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return res};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(self2){debug("readable nexttick read 0"),self2.read(0)}Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,resume(this,state)),this};function resume(stream2,state){state.resumeScheduled||(state.resumeScheduled=!0,pna.nextTick(resume_,stream2,state))}function resume_(stream2,state){state.reading||(debug("resume read 0"),stream2.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream2.emit("resume"),flow(stream2),state.flowing&&!state.reading&&stream2.read(0)}Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function flow(stream2){var state=stream2._readableState;for(debug("flow",state.flowing);state.flowing&&stream2.read()!==null;);}Readable.prototype.wrap=function(stream2){var _this=this,state=this._readableState,paused=!1;stream2.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream2.on("data",function(chunk){if(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!(state.objectMode&&chunk==null)&&!(!state.objectMode&&(!chunk||!chunk.length))){var ret=_this.push(chunk);ret||(paused=!0,stream2.pause())}});for(var i2 in stream2)this[i2]===void 0&&typeof stream2[i2]=="function"&&(this[i2]=function(method){return function(){return stream2[method].apply(stream2,arguments)}}(i2));for(var n=0;n<kProxyEvents.length;n++)stream2.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n2){debug("wrapped _read",n2),paused&&(paused=!1,stream2.resume())},this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(n,state){if(state.length===0)return null;var ret;return state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(state.decoder?ret=state.buffer.join(""):state.buffer.length===1?ret=state.buffer.head.data:ret=state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):n===list.head.data.length?ret=list.shift():ret=hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list),ret}function copyFromBufferString(n,list){var p=list.head,c=1,ret=p.data;for(n-=ret.length;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),n-=nb,n===0){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer4.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),n-=nb,n===0){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream2){var state=stream2._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream2))}function endReadableNT(state,stream2){!state.endEmitted&&state.length===0&&(state.endEmitted=!0,stream2.readable=!1,stream2.emit("end"))}function indexOf(xs,x2){for(var i2=0,l=xs.length;i2<l;i2++)if(xs[i2]===x2)return i2;return-1}}});var require_stream_transform2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_transform.js"(exports,module2){"use strict";module2.exports=Transform;var Duplex2=require_stream_duplex2(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(Transform,Duplex2);function afterTransform(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return this.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,data!=null&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex2.call(this,options),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&(typeof options.transform=="function"&&(this._transform=options.transform),typeof options.flush=="function"&&(this._flush=options.flush)),this.on("prefinish",prefinish)}function prefinish(){var _this=this;typeof this._flush=="function"?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex2.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;ts.writechunk!==null&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0};Transform.prototype._destroy=function(err,cb){var _this2=this;Duplex2.prototype._destroy.call(this,err,function(err2){cb(err2),_this2.emit("close")})};function done(stream2,er,data){if(er)return stream2.emit("error",er);if(data!=null&&stream2.push(data),stream2._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(stream2._transformState.transforming)throw new Error("Calling transform done when still transforming");return stream2.push(null)}}});var require_stream_passthrough2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/lib/_stream_passthrough.js"(exports,module2){"use strict";module2.exports=PassThrough3;var Transform=require_stream_transform2(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(PassThrough3,Transform);function PassThrough3(options){if(!(this instanceof PassThrough3))return new PassThrough3(options);Transform.call(this,options)}PassThrough3.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}}});var require_readable2=__commonJS({"../../node_modules/peek-stream/node_modules/readable-stream/readable.js"(exports,module2){"use strict";var Stream3=require("stream");process.env.READABLE_STREAM==="disable"&&Stream3?(module2.exports=Stream3,exports=module2.exports=Stream3.Readable,exports.Readable=Stream3.Readable,exports.Writable=Stream3.Writable,exports.Duplex=Stream3.Duplex,exports.Transform=Stream3.Transform,exports.PassThrough=Stream3.PassThrough,exports.Stream=Stream3):(exports=module2.exports=require_stream_readable2(),exports.Stream=Stream3||exports,exports.Readable=exports,exports.Writable=require_stream_writable2(),exports.Duplex=require_stream_duplex2(),exports.Transform=require_stream_transform2(),exports.PassThrough=require_stream_passthrough2())}});var require_stream_shift=__commonJS({"../../node_modules/stream-shift/index.js"(exports,module2){"use strict";module2.exports=shift;function shift(stream2){var rs=stream2._readableState;return rs?rs.objectMode||typeof stream2._duplexState=="number"?stream2.read():stream2.read(getStateLength(rs)):null}function getStateLength(state){return state.buffer.length?state.buffer.head?state.buffer.head.data.length:state.buffer[0].length:state.length}}});var require_duplexify=__commonJS({"../../node_modules/peek-stream/node_modules/duplexify/index.js"(exports,module2){"use strict";var stream2=require_readable2(),eos=require_end_of_stream(),inherits=require_inherits(),shift=require_stream_shift(),SIGNAL_FLUSH=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),onuncork=function(self2,fn){self2._corked?self2.once("uncork",fn):fn()},autoDestroy=function(self2,err){self2._autoDestroy&&self2.destroy(err)},destroyer=function(self2,end2){return function(err){err?autoDestroy(self2,err.message==="premature close"?null:err):end2&&!self2._ended&&self2.end()}},end=function(ws,fn){if(!ws||ws._writableState&&ws._writableState.finished)return fn();if(ws._writableState)return ws.end(fn);ws.end(),fn()},toStreams2=function(rs){return new stream2.Readable({objectMode:!0,highWaterMark:16}).wrap(rs)},Duplexify=function(writable,readable,opts){if(!(this instanceof Duplexify))return new Duplexify(writable,readable,opts);stream2.Duplex.call(this,opts),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!opts||opts.autoDestroy!==!1,this._forwardDestroy=!opts||opts.destroy!==!1,this._forwardEnd=!opts||opts.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,writable&&this.setWritable(writable),readable&&this.setReadable(readable)};inherits(Duplexify,stream2.Duplex);Duplexify.obj=function(writable,readable,opts){return opts||(opts={}),opts.objectMode=!0,opts.highWaterMark=16,new Duplexify(writable,readable,opts)};Duplexify.prototype.cork=function(){++this._corked===1&&this.emit("cork")};Duplexify.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};Duplexify.prototype.setWritable=function(writable){if(this._unwrite&&this._unwrite(),this.destroyed){writable&&writable.destroy&&writable.destroy();return}if(writable===null||writable===!1){this.end();return}var self2=this,unend=eos(writable,{writable:!0,readable:!1},destroyer(this,this._forwardEnd)),ondrain=function(){var ondrain2=self2._ondrain;self2._ondrain=null,ondrain2&&ondrain2()},clear=function(){self2._writable.removeListener("drain",ondrain),unend()};this._unwrite&&process.nextTick(ondrain),this._writable=writable,this._writable.on("drain",ondrain),this._unwrite=clear,this.uncork()};Duplexify.prototype.setReadable=function(readable){if(this._unread&&this._unread(),this.destroyed){readable&&readable.destroy&&readable.destroy();return}if(readable===null||readable===!1){this.push(null),this.resume();return}var self2=this,unend=eos(readable,{writable:!1,readable:!0},destroyer(this)),onreadable=function(){self2._forward()},onend=function(){self2.push(null)},clear=function(){self2._readable2.removeListener("readable",onreadable),self2._readable2.removeListener("end",onend),unend()};this._drained=!0,this._readable=readable,this._readable2=readable._readableState?readable:toStreams2(readable),this._readable2.on("readable",onreadable),this._readable2.on("end",onend),this._unread=clear,this._forward()};Duplexify.prototype._read=function(){this._drained=!0,this._forward()};Duplexify.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var data;this._drained&&(data=shift(this._readable2))!==null;)this.destroyed||(this._drained=this.push(data));this._forwarding=!1}};Duplexify.prototype.destroy=function(err){if(!this.destroyed){this.destroyed=!0;var self2=this;process.nextTick(function(){self2._destroy(err)})}};Duplexify.prototype._destroy=function(err){if(err){var ondrain=this._ondrain;this._ondrain=null,ondrain?ondrain(err):this.emit("error",err)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};Duplexify.prototype._write=function(data,enc,cb){if(this.destroyed)return cb();if(this._corked)return onuncork(this,this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return this._finish(cb);if(!this._writable)return cb();this._writable.write(data)===!1?this._ondrain=cb:cb()};Duplexify.prototype._finish=function(cb){var self2=this;this.emit("preend"),onuncork(this,function(){end(self2._forwardEnd&&self2._writable,function(){self2._writableState.prefinished===!1&&(self2._writableState.prefinished=!0),self2.emit("prefinish"),onuncork(self2,cb)})})};Duplexify.prototype.end=function(data,enc,cb){return typeof data=="function"?this.end(null,null,data):typeof enc=="function"?this.end(data,null,enc):(this._ended=!0,data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream2.Writable.prototype.end.call(this,cb))};module2.exports=Duplexify}});var require_isarray2=__commonJS({"../../node_modules/through2/node_modules/isarray/index.js"(exports,module2){"use strict";var toString2={}.toString;module2.exports=Array.isArray||function(arr){return toString2.call(arr)=="[object Array]"}}});var require_stream4=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream.js"(exports,module2){"use strict";module2.exports=require("stream")}});var require_safe_buffer3=__commonJS({"../../node_modules/through2/node_modules/safe-buffer/index.js"(exports,module2){"use strict";var buffer=require("buffer"),Buffer4=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}Buffer4.from&&Buffer4.alloc&&Buffer4.allocUnsafe&&Buffer4.allocUnsafeSlow?module2.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer);function SafeBuffer(arg,encodingOrOffset,length){return Buffer4(arg,encodingOrOffset,length)}copyProps(Buffer4,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg=="number")throw new TypeError("Argument must not be a number");return Buffer4(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!="number")throw new TypeError("Argument must be a number");var buf=Buffer4(size);return fill!==void 0?typeof encoding=="string"?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return Buffer4(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}}});var require_BufferList3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports,module2){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var Buffer4=require_safe_buffer3().Buffer,util=require("util");function copyBuffer(src,target,offset){src.copy(target,offset)}module2.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};this.length===0&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(this.length!==0){var ret=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s2){if(this.length===0)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s2+p.data;return ret},BufferList.prototype.concat=function(n){if(this.length===0)return Buffer4.alloc(0);for(var ret=Buffer4.allocUnsafe(n>>>0),p=this.head,i2=0;p;)copyBuffer(p.data,ret,i2),i2+=p.data.length,p=p.next;return ret},BufferList}();util&&util.inspect&&util.inspect.custom&&(module2.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})}});var require_destroy3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports,module2){"use strict";var pna=require_process_nextick_args();function destroy(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):err&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,this,err)):pna.nextTick(emitErrorNT,this,err)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err2){!cb&&err2?_this._writableState?_this._writableState.errorEmitted||(_this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,_this,err2)):pna.nextTick(emitErrorNT,_this,err2):cb&&cb(err2)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(self2,err){self2.emit("error",err)}module2.exports={destroy,undestroy}}});var require_stream_writable3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Writable;function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}var asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick,Duplex2;Writable.WritableState=WritableState;var util=Object.create(require_util());util.inherits=require_inherits();var internalUtil={deprecate:require("util-deprecate")},Stream3=require_stream4(),Buffer4=require_safe_buffer3().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var destroyImpl=require_destroy3();util.inherits(Writable,Stream3);function nop(){}function WritableState(options,stream2){Duplex2=Duplex2||require_stream_duplex3(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,writableHwm=options.writableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(writableHwm||writableHwm===0)?this.highWaterMark=writableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream2,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var realHasInstance;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return realHasInstance.call(this,object)?!0:this!==Writable?!1:object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this};function Writable(options){if(Duplex2=Duplex2||require_stream_duplex3(),!realHasInstance.call(Writable,this)&&!(this instanceof Duplex2))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&(typeof options.write=="function"&&(this._write=options.write),typeof options.writev=="function"&&(this._writev=options.writev),typeof options.destroy=="function"&&(this._destroy=options.destroy),typeof options.final=="function"&&(this._final=options.final)),Stream3.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream2,cb){var er=new Error("write after end");stream2.emit("error",er),pna.nextTick(cb,er)}function validChunk(stream2,state,chunk,cb){var valid=!0,er=!1;return chunk===null?er=new TypeError("May not write null values to stream"):typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream2.emit("error",er),pna.nextTick(cb,er),valid=!1),valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&_isUint8Array(chunk);return isBuf&&!Buffer4.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),typeof encoding=="function"&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),typeof cb!="function"&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,!state.writing&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(this,state))};Writable.prototype.setDefaultEncoding=function(encoding){if(typeof encoding=="string"&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this};function decodeChunk(state,chunk,encoding){return!state.objectMode&&state.decodeStrings!==!1&&typeof chunk=="string"&&(chunk=Buffer4.from(chunk,encoding)),chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(stream2,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(ret||(state.needDrain=!0),state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk,encoding,isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream2,state,!1,len,chunk,encoding,cb);return ret}function doWrite(stream2,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream2._writev(chunk,state.onwrite):stream2._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream2,state,sync,er,cb){--state.pendingcb,sync?(pna.nextTick(cb,er),pna.nextTick(finishMaybe,stream2,state),stream2._writableState.errorEmitted=!0,stream2.emit("error",er)):(cb(er),stream2._writableState.errorEmitted=!0,stream2.emit("error",er),finishMaybe(stream2,state))}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream2,er){var state=stream2._writableState,sync=state.sync,cb=state.writecb;if(onwriteStateUpdate(state),er)onwriteError(stream2,state,sync,er,cb);else{var finished=needFinish(state);!finished&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(stream2,state),sync?asyncWrite(afterWrite,stream2,state,finished,cb):afterWrite(stream2,state,finished,cb)}}function afterWrite(stream2,state,finished,cb){finished||onwriteDrain(stream2,state),state.pendingcb--,cb(),finishMaybe(stream2,state)}function onwriteDrain(stream2,state){state.length===0&&state.needDrain&&(state.needDrain=!1,stream2.emit("drain"))}function clearBuffer(stream2,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream2._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream2,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback,len=state.objectMode?1:chunk.length;if(doWrite(stream2,state,!1,len,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}entry===null&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;typeof chunk=="function"?(cb=chunk,chunk=null,encoding=null):typeof encoding=="function"&&(cb=encoding,encoding=null),chunk!=null&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||endWritable(this,state,cb)};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing}function callFinal(stream2,state){stream2._final(function(err){state.pendingcb--,err&&stream2.emit("error",err),state.prefinished=!0,stream2.emit("prefinish"),finishMaybe(stream2,state)})}function prefinish(stream2,state){!state.prefinished&&!state.finalCalled&&(typeof stream2._final=="function"?(state.pendingcb++,state.finalCalled=!0,pna.nextTick(callFinal,stream2,state)):(state.prefinished=!0,stream2.emit("prefinish")))}function finishMaybe(stream2,state){var need=needFinish(state);return need&&(prefinish(stream2,state),state.pendingcb===0&&(state.finished=!0,stream2.emit("finish"))),need}function endWritable(stream2,state,cb){state.ending=!0,finishMaybe(stream2,state),cb&&(state.finished?pna.nextTick(cb):stream2.once("finish",cb)),state.ended=!0,stream2.writable=!1}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;for(corkReq.entry=null;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree.next=corkReq}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}});var require_stream_duplex3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js"(exports,module2){"use strict";var pna=require_process_nextick_args(),objectKeys=Object.keys||function(obj){var keys2=[];for(var key in obj)keys2.push(key);return keys2};module2.exports=Duplex2;var util=Object.create(require_util());util.inherits=require_inherits();var Readable=require_stream_readable3(),Writable=require_stream_writable3();util.inherits(Duplex2,Readable);for(keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++)method=keys[v],Duplex2.prototype[method]||(Duplex2.prototype[method]=Writable.prototype[method]);var keys,method,v;function Duplex2(options){if(!(this instanceof Duplex2))return new Duplex2(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}Object.defineProperty(Duplex2.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(self2){self2.end()}Object.defineProperty(Duplex2.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(value){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=value,this._writableState.destroyed=value)}});Duplex2.prototype._destroy=function(err,cb){this.push(null),this.end(),pna.nextTick(cb,err)}}});var require_string_decoder3=__commonJS({"../../node_modules/through2/node_modules/string_decoder/lib/string_decoder.js"(exports){"use strict";var Buffer4=require_safe_buffer3().Buffer,isEncoding=Buffer4.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!="string"&&(Buffer4.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:this.write=simpleWrite,this.end=simpleEnd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer4.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r2,i2;if(this.lastNeed){if(r2=this.fillLast(buf),r2===void 0)return"";i2=this.lastNeed,this.lastNeed=0}else i2=0;return i2<buf.length?r2?r2+this.text(buf,i2):this.text(buf,i2):r2||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length};function utf8CheckByte(byte){return byte<=127?0:byte>>5===6?2:byte>>4===14?3:byte>>3===30?4:byte>>6===2?-1:-2}function utf8CheckIncomplete(self2,buf,i2){var j=buf.length-1;if(j<i2)return 0;var nb=utf8CheckByte(buf[j]);return nb>=0?(nb>0&&(self2.lastNeed=nb-1),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(self2.lastNeed=nb-2),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(nb===2?nb=0:self2.lastNeed=nb-3),nb):0))}function utf8CheckExtraBytes(self2,buf,p){if((buf[0]&192)!==128)return self2.lastNeed=0,"\uFFFD";if(self2.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128)return self2.lastNeed=1,"\uFFFD";if(self2.lastNeed>2&&buf.length>2&&(buf[2]&192)!==128)return self2.lastNeed=2,"\uFFFD"}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r2=utf8CheckExtraBytes(this,buf,p);if(r2!==void 0)return r2;if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,p,0,buf.length),this.lastNeed-=buf.length}function utf8Text(buf,i2){var total=utf8CheckIncomplete(this,buf,i2);if(!this.lastNeed)return buf.toString("utf8",i2);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i2,end)}function utf8End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+"\uFFFD":r2}function utf16Text(buf,i2){if((buf.length-i2)%2===0){var r2=buf.toString("utf16le",i2);if(r2){var c=r2.charCodeAt(r2.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r2.slice(0,-1)}return r2}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i2,buf.length-1)}function utf16End(buf){var r2=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r2+this.lastChar.toString("utf16le",0,end)}return r2}function base64Text(buf,i2){var n=(buf.length-i2)%3;return n===0?buf.toString("base64",i2):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i2,buf.length-n))}function base64End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+this.lastChar.toString("base64",0,3-this.lastNeed):r2}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}}});var require_stream_readable3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Readable;var isArray=require_isarray2(),Duplex2;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream3=require_stream4(),Buffer4=require_safe_buffer3().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var util=Object.create(require_util());util.inherits=require_inherits();var debugUtil=require("util"),debug=void 0;debugUtil&&debugUtil.debuglog?debug=debugUtil.debuglog("stream"):debug=function(){};var BufferList=require_BufferList3(),destroyImpl=require_destroy3(),StringDecoder;util.inherits(Readable,Stream3);var kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(emitter,event,fn){if(typeof emitter.prependListener=="function")return emitter.prependListener(event,fn);!emitter._events||!emitter._events[event]?emitter.on(event,fn):isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]}function ReadableState(options,stream2){Duplex2=Duplex2||require_stream_duplex3(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,readableHwm=options.readableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(readableHwm||readableHwm===0)?this.highWaterMark=readableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require_string_decoder3().StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex2=Duplex2||require_stream_duplex3(),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&(typeof options.read=="function"&&(this._read=options.read),typeof options.destroy=="function"&&(this._destroy=options.destroy)),Stream3.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}});Readable.prototype.destroy=destroyImpl.destroy;Readable.prototype._undestroy=destroyImpl.undestroy;Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)};Readable.prototype.push=function(chunk,encoding){var state=this._readableState,skipChunkCheck;return state.objectMode?skipChunkCheck=!0:typeof chunk=="string"&&(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=Buffer4.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)};Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)};function readableAddChunk(stream2,chunk,encoding,addToFront,skipChunkCheck){var state=stream2._readableState;if(chunk===null)state.reading=!1,onEofChunk(stream2,state);else{var er;skipChunkCheck||(er=chunkInvalid(state,chunk)),er?stream2.emit("error",er):state.objectMode||chunk&&chunk.length>0?(typeof chunk!="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer4.prototype&&(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream2.emit("error",new Error("stream.unshift() after end event")):addChunk(stream2,state,chunk,!0):state.ended?stream2.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||chunk.length!==0?addChunk(stream2,state,chunk,!1):maybeReadMore(stream2,state)):addChunk(stream2,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream2,state,chunk,addToFront){state.flowing&&state.length===0&&!state.sync?(stream2.emit("data",chunk),stream2.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream2)),maybeReadMore(stream2,state)}function chunkInvalid(state,chunk){var er;return!_isUint8Array(chunk)&&typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===!1};Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=require_string_decoder3().StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;function computeNewHighWaterMark(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||state.length===0&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(n!==0&&(state.emittedReadable=!1),n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),state.length===0&&state.ended?endReadable(this):emitReadable(this),null;if(n=howMuchToRead(n,state),n===0&&state.ended)return state.length===0&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(state.length===0||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),state.ended||state.reading?(doRead=!1,debug("reading or ended",doRead)):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,state.length===0&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state)));var ret;return n>0?ret=fromList(n,state):ret=null,ret===null?(state.needReadable=!0,n=0):state.length-=n,state.length===0&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),ret!==null&&this.emit("data",ret),ret};function onEofChunk(stream2,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream2)}}function emitReadable(stream2){var state=stream2._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream2):emitReadable_(stream2))}function emitReadable_(stream2){debug("emit readable"),stream2.emit("readable"),flow(stream2)}function maybeReadMore(stream2,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream2,state))}function maybeReadMore_(stream2,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream2.read(0),len!==state.length);)len=state.length;state.readingMore=!1}Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1;function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain)&&ondrain()}var increasedAwaitDrain=!1;src.on("data",ondata);function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1;var ret=dest.write(chunk);ret===!1&&!increasedAwaitDrain&&((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",state.awaitDrain),state.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),EElistenerCount(dest,"error")===0&&dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish),unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe"),src.unpipe(dest)}return dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,state.awaitDrain===0&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(state.pipesCount===0)return this;if(state.pipesCount===1)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i2=0;i2<len;i2++)dests[i2].emit("unpipe",this,{hasUnpiped:!1});return this}var index=indexOf(state.pipes,dest);return index===-1?this:(state.pipes.splice(index,1),state.pipesCount-=1,state.pipesCount===1&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)};Readable.prototype.on=function(ev,fn){var res=Stream3.prototype.on.call(this,ev,fn);if(ev==="data")this._readableState.flowing!==!1&&this.resume();else if(ev==="readable"){var state=this._readableState;!state.endEmitted&&!state.readableListening&&(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return res};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(self2){debug("readable nexttick read 0"),self2.read(0)}Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,resume(this,state)),this};function resume(stream2,state){state.resumeScheduled||(state.resumeScheduled=!0,pna.nextTick(resume_,stream2,state))}function resume_(stream2,state){state.reading||(debug("resume read 0"),stream2.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream2.emit("resume"),flow(stream2),state.flowing&&!state.reading&&stream2.read(0)}Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function flow(stream2){var state=stream2._readableState;for(debug("flow",state.flowing);state.flowing&&stream2.read()!==null;);}Readable.prototype.wrap=function(stream2){var _this=this,state=this._readableState,paused=!1;stream2.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream2.on("data",function(chunk){if(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!(state.objectMode&&chunk==null)&&!(!state.objectMode&&(!chunk||!chunk.length))){var ret=_this.push(chunk);ret||(paused=!0,stream2.pause())}});for(var i2 in stream2)this[i2]===void 0&&typeof stream2[i2]=="function"&&(this[i2]=function(method){return function(){return stream2[method].apply(stream2,arguments)}}(i2));for(var n=0;n<kProxyEvents.length;n++)stream2.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n2){debug("wrapped _read",n2),paused&&(paused=!1,stream2.resume())},this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(n,state){if(state.length===0)return null;var ret;return state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(state.decoder?ret=state.buffer.join(""):state.buffer.length===1?ret=state.buffer.head.data:ret=state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):n===list.head.data.length?ret=list.shift():ret=hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list),ret}function copyFromBufferString(n,list){var p=list.head,c=1,ret=p.data;for(n-=ret.length;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),n-=nb,n===0){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer4.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),n-=nb,n===0){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream2){var state=stream2._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream2))}function endReadableNT(state,stream2){!state.endEmitted&&state.length===0&&(state.endEmitted=!0,stream2.readable=!1,stream2.emit("end"))}function indexOf(xs,x2){for(var i2=0,l=xs.length;i2<l;i2++)if(xs[i2]===x2)return i2;return-1}}});var require_stream_transform3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js"(exports,module2){"use strict";module2.exports=Transform;var Duplex2=require_stream_duplex3(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(Transform,Duplex2);function afterTransform(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return this.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,data!=null&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex2.call(this,options),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&(typeof options.transform=="function"&&(this._transform=options.transform),typeof options.flush=="function"&&(this._flush=options.flush)),this.on("prefinish",prefinish)}function prefinish(){var _this=this;typeof this._flush=="function"?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex2.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;ts.writechunk!==null&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0};Transform.prototype._destroy=function(err,cb){var _this2=this;Duplex2.prototype._destroy.call(this,err,function(err2){cb(err2),_this2.emit("close")})};function done(stream2,er,data){if(er)return stream2.emit("error",er);if(data!=null&&stream2.push(data),stream2._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(stream2._transformState.transforming)throw new Error("Calling transform done when still transforming");return stream2.push(null)}}});var require_stream_passthrough3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js"(exports,module2){"use strict";module2.exports=PassThrough3;var Transform=require_stream_transform3(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(PassThrough3,Transform);function PassThrough3(options){if(!(this instanceof PassThrough3))return new PassThrough3(options);Transform.call(this,options)}PassThrough3.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}}});var require_readable3=__commonJS({"../../node_modules/through2/node_modules/readable-stream/readable.js"(exports,module2){"use strict";var Stream3=require("stream");process.env.READABLE_STREAM==="disable"&&Stream3?(module2.exports=Stream3,exports=module2.exports=Stream3.Readable,exports.Readable=Stream3.Readable,exports.Writable=Stream3.Writable,exports.Duplex=Stream3.Duplex,exports.Transform=Stream3.Transform,exports.PassThrough=Stream3.PassThrough,exports.Stream=Stream3):(exports=module2.exports=require_stream_readable3(),exports.Stream=Stream3||exports,exports.Readable=exports,exports.Writable=require_stream_writable3(),exports.Duplex=require_stream_duplex3(),exports.Transform=require_stream_transform3(),exports.PassThrough=require_stream_passthrough3())}});var require_immutable=__commonJS({"../../node_modules/xtend/immutable.js"(exports,module2){"use strict";module2.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){for(var target={},i2=0;i2<arguments.length;i2++){var source=arguments[i2];for(var key in source)hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target}}});var require_through2=__commonJS({"../../node_modules/through2/through2.js"(exports,module2){"use strict";var Transform=require_readable3().Transform,inherits=require("util").inherits,xtend=require_immutable();function DestroyableTransform(opts){Transform.call(this,opts),this._destroyed=!1}inherits(DestroyableTransform,Transform);DestroyableTransform.prototype.destroy=function(err){if(!this._destroyed){this._destroyed=!0;var self2=this;process.nextTick(function(){err&&self2.emit("error",err),self2.emit("close")})}};function noop3(chunk,enc,callback){callback(null,chunk)}function through2(construct){return function(options,transform,flush){return typeof options=="function"&&(flush=transform,transform=options,options={}),typeof transform!="function"&&(transform=noop3),typeof flush!="function"&&(flush=null),construct(options,transform,flush)}}module2.exports=through2(function(options,transform,flush){var t2=new DestroyableTransform(options);return t2._transform=transform,flush&&(t2._flush=flush),t2});module2.exports.ctor=through2(function(options,transform,flush){function Through2(override){if(!(this instanceof Through2))return new Through2(override);this.options=xtend(options,override),DestroyableTransform.call(this,this.options)}return inherits(Through2,DestroyableTransform),Through2.prototype._transform=transform,flush&&(Through2.prototype._flush=flush),Through2});module2.exports.obj=through2(function(options,transform,flush){var t2=new DestroyableTransform(xtend({objectMode:!0,highWaterMark:16},options));return t2._transform=transform,flush&&(t2._flush=flush),t2})}});var require_buffer_from=__commonJS({"../../node_modules/buffer-from/index.js"(exports,module2){"use strict";var toString2=Object.prototype.toString,isModern=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function isArrayBuffer(input){return toString2.call(input).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(obj,byteOffset,length){byteOffset>>>=0;var maxLength=obj.byteLength-byteOffset;if(maxLength<0)throw new RangeError("'offset' is out of bounds");if(length===void 0)length=maxLength;else if(length>>>=0,length>maxLength)throw new RangeError("'length' is out of bounds");return isModern?Buffer.from(obj.slice(byteOffset,byteOffset+length)):new Buffer(new Uint8Array(obj.slice(byteOffset,byteOffset+length)))}function fromString(string,encoding){if((typeof encoding!="string"||encoding==="")&&(encoding="utf8"),!Buffer.isEncoding(encoding))throw new TypeError('"encoding" must be a valid string encoding');return isModern?Buffer.from(string,encoding):new Buffer(string,encoding)}function bufferFrom(value,encodingOrOffset,length){if(typeof value=="number")throw new TypeError('"value" argument must not be a number');return isArrayBuffer(value)?fromArrayBuffer(value,encodingOrOffset,length):typeof value=="string"?fromString(value,encodingOrOffset):isModern?Buffer.from(value):new Buffer(value)}module2.exports=bufferFrom}});var require_peek_stream=__commonJS({"../../node_modules/peek-stream/index.js"(exports,module2){"use strict";var duplexify=require_duplexify(),through=require_through2(),bufferFrom=require_buffer_from(),isObject=function(data){return!Buffer.isBuffer(data)&&typeof data!="string"},peek=function(opts,onpeek){if(typeof opts=="number"&&(opts={maxBuffer:opts}),typeof opts=="function")return peek(null,opts);opts||(opts={});var maxBuffer=typeof opts.maxBuffer=="number"?opts.maxBuffer:65535,strict=opts.strict,newline=opts.newline!==!1,buffer=[],bufferSize=0,dup=duplexify.obj(),peeker=through.obj({highWaterMark:1},function(data,enc,cb){if(isObject(data))return ready(data,null,cb);if(Buffer.isBuffer(data)||(data=bufferFrom(data)),newline){var nl=Array.prototype.indexOf.call(data,10);if(nl>0&&data[nl-1]===13&&nl--,nl>-1)return buffer.push(data.slice(0,nl)),ready(Buffer.concat(buffer),data.slice(nl),cb)}if(buffer.push(data),bufferSize+=data.length,bufferSize<maxBuffer)return cb();if(strict)return cb(new Error("No newline found"));ready(Buffer.concat(buffer),null,cb)}),onpreend=function(){if(strict)return dup.destroy(new Error("No newline found"));dup.cork(),ready(Buffer.concat(buffer),null,function(err){if(err)return dup.destroy(err);dup.uncork()})},ready=function(data,overflow,cb){dup.removeListener("preend",onpreend),onpeek(data,function(err,parser){if(err)return cb(err);dup.setWritable(parser),dup.setReadable(parser),data&&parser.write(data),overflow&&parser.write(overflow),overflow=buffer=peeker=null,cb()})};return dup.on("preend",onpreend),dup.setWritable(peeker),dup};module2.exports=peek}});var require_pump2=__commonJS({"../../node_modules/pumpify/node_modules/pump/index.js"(exports,module2){"use strict";var once2=require_once(),eos=require_end_of_stream(),fs9=require("fs"),noop3=function(){},ancient=/^v?\.0/.test(process.version),isFn=function(fn){return typeof fn=="function"},isFS=function(stream2){return!ancient||!fs9?!1:(stream2 instanceof(fs9.ReadStream||noop3)||stream2 instanceof(fs9.WriteStream||noop3))&&isFn(stream2.close)},isRequest3=function(stream2){return stream2.setHeader&&isFn(stream2.abort)},destroyer=function(stream2,reading,writing,callback){callback=once2(callback);var closed=!1;stream2.on("close",function(){closed=!0}),eos(stream2,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed){if(destroyed=!0,isFS(stream2))return stream2.close(noop3);if(isRequest3(stream2))return stream2.abort();if(isFn(stream2.destroy))return stream2.destroy();callback(err||new Error("stream was destroyed"))}}},call=function(fn){fn()},pipe2=function(from,to){return from.pipe(to)},pump2=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop3)&&streams.pop()||noop3;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream2,i2){var reading=i2<streams.length-1,writing=i2>0;return destroyer(stream2,reading,writing,function(err){error||(error=err),err&&destroys.forEach(call),!reading&&(destroys.forEach(call),callback(error))})});streams.reduce(pipe2)};module2.exports=pump2}});var require_isarray3=__commonJS({"../../node_modules/pumpify/node_modules/isarray/index.js"(exports,module2){"use strict";var toString2={}.toString;module2.exports=Array.isArray||function(arr){return toString2.call(arr)=="[object Array]"}}});var require_stream5=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/internal/streams/stream.js"(exports,module2){"use strict";module2.exports=require("stream")}});var require_safe_buffer4=__commonJS({"../../node_modules/pumpify/node_modules/safe-buffer/index.js"(exports,module2){"use strict";var buffer=require("buffer"),Buffer4=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}Buffer4.from&&Buffer4.alloc&&Buffer4.allocUnsafe&&Buffer4.allocUnsafeSlow?module2.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer);function SafeBuffer(arg,encodingOrOffset,length){return Buffer4(arg,encodingOrOffset,length)}copyProps(Buffer4,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg=="number")throw new TypeError("Argument must not be a number");return Buffer4(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!="number")throw new TypeError("Argument must be a number");var buf=Buffer4(size);return fill!==void 0?typeof encoding=="string"?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return Buffer4(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!="number")throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}}});var require_BufferList4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports,module2){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var Buffer4=require_safe_buffer4().Buffer,util=require("util");function copyBuffer(src,target,offset){src.copy(target,offset)}module2.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};this.length===0&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(this.length!==0){var ret=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s2){if(this.length===0)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s2+p.data;return ret},BufferList.prototype.concat=function(n){if(this.length===0)return Buffer4.alloc(0);for(var ret=Buffer4.allocUnsafe(n>>>0),p=this.head,i2=0;p;)copyBuffer(p.data,ret,i2),i2+=p.data.length,p=p.next;return ret},BufferList}();util&&util.inspect&&util.inspect.custom&&(module2.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})}});var require_destroy4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports,module2){"use strict";var pna=require_process_nextick_args();function destroy(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):err&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,this,err)):pna.nextTick(emitErrorNT,this,err)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err2){!cb&&err2?_this._writableState?_this._writableState.errorEmitted||(_this._writableState.errorEmitted=!0,pna.nextTick(emitErrorNT,_this,err2)):pna.nextTick(emitErrorNT,_this,err2):cb&&cb(err2)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(self2,err){self2.emit("error",err)}module2.exports={destroy,undestroy}}});var require_stream_writable4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_writable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Writable;function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}var asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick,Duplex2;Writable.WritableState=WritableState;var util=Object.create(require_util());util.inherits=require_inherits();var internalUtil={deprecate:require("util-deprecate")},Stream3=require_stream5(),Buffer4=require_safe_buffer4().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var destroyImpl=require_destroy4();util.inherits(Writable,Stream3);function nop(){}function WritableState(options,stream2){Duplex2=Duplex2||require_stream_duplex4(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,writableHwm=options.writableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(writableHwm||writableHwm===0)?this.highWaterMark=writableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=options.decodeStrings===!1;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream2,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var realHasInstance;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return realHasInstance.call(this,object)?!0:this!==Writable?!1:object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this};function Writable(options){if(Duplex2=Duplex2||require_stream_duplex4(),!realHasInstance.call(Writable,this)&&!(this instanceof Duplex2))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&(typeof options.write=="function"&&(this._write=options.write),typeof options.writev=="function"&&(this._writev=options.writev),typeof options.destroy=="function"&&(this._destroy=options.destroy),typeof options.final=="function"&&(this._final=options.final)),Stream3.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream2,cb){var er=new Error("write after end");stream2.emit("error",er),pna.nextTick(cb,er)}function validChunk(stream2,state,chunk,cb){var valid=!0,er=!1;return chunk===null?er=new TypeError("May not write null values to stream"):typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream2.emit("error",er),pna.nextTick(cb,er),valid=!1),valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&_isUint8Array(chunk);return isBuf&&!Buffer4.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),typeof encoding=="function"&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),typeof cb!="function"&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,!state.writing&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(this,state))};Writable.prototype.setDefaultEncoding=function(encoding){if(typeof encoding=="string"&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this};function decodeChunk(state,chunk,encoding){return!state.objectMode&&state.decodeStrings!==!1&&typeof chunk=="string"&&(chunk=Buffer4.from(chunk,encoding)),chunk}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(stream2,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(ret||(state.needDrain=!0),state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk,encoding,isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream2,state,!1,len,chunk,encoding,cb);return ret}function doWrite(stream2,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream2._writev(chunk,state.onwrite):stream2._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream2,state,sync,er,cb){--state.pendingcb,sync?(pna.nextTick(cb,er),pna.nextTick(finishMaybe,stream2,state),stream2._writableState.errorEmitted=!0,stream2.emit("error",er)):(cb(er),stream2._writableState.errorEmitted=!0,stream2.emit("error",er),finishMaybe(stream2,state))}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream2,er){var state=stream2._writableState,sync=state.sync,cb=state.writecb;if(onwriteStateUpdate(state),er)onwriteError(stream2,state,sync,er,cb);else{var finished=needFinish(state);!finished&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(stream2,state),sync?asyncWrite(afterWrite,stream2,state,finished,cb):afterWrite(stream2,state,finished,cb)}}function afterWrite(stream2,state,finished,cb){finished||onwriteDrain(stream2,state),state.pendingcb--,cb(),finishMaybe(stream2,state)}function onwriteDrain(stream2,state){state.length===0&&state.needDrain&&(state.needDrain=!1,stream2.emit("drain"))}function clearBuffer(stream2,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream2._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream2,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback,len=state.objectMode?1:chunk.length;if(doWrite(stream2,state,!1,len,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}entry===null&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;typeof chunk=="function"?(cb=chunk,chunk=null,encoding=null):typeof encoding=="function"&&(cb=encoding,encoding=null),chunk!=null&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||endWritable(this,state,cb)};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing}function callFinal(stream2,state){stream2._final(function(err){state.pendingcb--,err&&stream2.emit("error",err),state.prefinished=!0,stream2.emit("prefinish"),finishMaybe(stream2,state)})}function prefinish(stream2,state){!state.prefinished&&!state.finalCalled&&(typeof stream2._final=="function"?(state.pendingcb++,state.finalCalled=!0,pna.nextTick(callFinal,stream2,state)):(state.prefinished=!0,stream2.emit("prefinish")))}function finishMaybe(stream2,state){var need=needFinish(state);return need&&(prefinish(stream2,state),state.pendingcb===0&&(state.finished=!0,stream2.emit("finish"))),need}function endWritable(stream2,state,cb){state.ending=!0,finishMaybe(stream2,state),cb&&(state.finished?pna.nextTick(cb):stream2.once("finish",cb)),state.ended=!0,stream2.writable=!1}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;for(corkReq.entry=null;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree.next=corkReq}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}});var require_stream_duplex4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_duplex.js"(exports,module2){"use strict";var pna=require_process_nextick_args(),objectKeys=Object.keys||function(obj){var keys2=[];for(var key in obj)keys2.push(key);return keys2};module2.exports=Duplex2;var util=Object.create(require_util());util.inherits=require_inherits();var Readable=require_stream_readable4(),Writable=require_stream_writable4();util.inherits(Duplex2,Readable);for(keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++)method=keys[v],Duplex2.prototype[method]||(Duplex2.prototype[method]=Writable.prototype[method]);var keys,method,v;function Duplex2(options){if(!(this instanceof Duplex2))return new Duplex2(options);Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",onend)}Object.defineProperty(Duplex2.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(self2){self2.end()}Object.defineProperty(Duplex2.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(value){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=value,this._writableState.destroyed=value)}});Duplex2.prototype._destroy=function(err,cb){this.push(null),this.end(),pna.nextTick(cb,err)}}});var require_string_decoder4=__commonJS({"../../node_modules/pumpify/node_modules/string_decoder/lib/string_decoder.js"(exports){"use strict";var Buffer4=require_safe_buffer4().Buffer,isEncoding=Buffer4.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!="string"&&(Buffer4.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:this.write=simpleWrite,this.end=simpleEnd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer4.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r2,i2;if(this.lastNeed){if(r2=this.fillLast(buf),r2===void 0)return"";i2=this.lastNeed,this.lastNeed=0}else i2=0;return i2<buf.length?r2?r2+this.text(buf,i2):this.text(buf,i2):r2||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length};function utf8CheckByte(byte){return byte<=127?0:byte>>5===6?2:byte>>4===14?3:byte>>3===30?4:byte>>6===2?-1:-2}function utf8CheckIncomplete(self2,buf,i2){var j=buf.length-1;if(j<i2)return 0;var nb=utf8CheckByte(buf[j]);return nb>=0?(nb>0&&(self2.lastNeed=nb-1),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(self2.lastNeed=nb-2),nb):--j<i2||nb===-2?0:(nb=utf8CheckByte(buf[j]),nb>=0?(nb>0&&(nb===2?nb=0:self2.lastNeed=nb-3),nb):0))}function utf8CheckExtraBytes(self2,buf,p){if((buf[0]&192)!==128)return self2.lastNeed=0,"\uFFFD";if(self2.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128)return self2.lastNeed=1,"\uFFFD";if(self2.lastNeed>2&&buf.length>2&&(buf[2]&192)!==128)return self2.lastNeed=2,"\uFFFD"}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r2=utf8CheckExtraBytes(this,buf,p);if(r2!==void 0)return r2;if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,p,0,buf.length),this.lastNeed-=buf.length}function utf8Text(buf,i2){var total=utf8CheckIncomplete(this,buf,i2);if(!this.lastNeed)return buf.toString("utf8",i2);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i2,end)}function utf8End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+"\uFFFD":r2}function utf16Text(buf,i2){if((buf.length-i2)%2===0){var r2=buf.toString("utf16le",i2);if(r2){var c=r2.charCodeAt(r2.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r2.slice(0,-1)}return r2}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i2,buf.length-1)}function utf16End(buf){var r2=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r2+this.lastChar.toString("utf16le",0,end)}return r2}function base64Text(buf,i2){var n=(buf.length-i2)%3;return n===0?buf.toString("base64",i2):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i2,buf.length-n))}function base64End(buf){var r2=buf&&buf.length?this.write(buf):"";return this.lastNeed?r2+this.lastChar.toString("base64",0,3-this.lastNeed):r2}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}}});var require_stream_readable4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_readable.js"(exports,module2){"use strict";var pna=require_process_nextick_args();module2.exports=Readable;var isArray=require_isarray3(),Duplex2;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream3=require_stream5(),Buffer4=require_safe_buffer4().Buffer,OurUint8Array=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer4.from(chunk)}function _isUint8Array(obj){return Buffer4.isBuffer(obj)||obj instanceof OurUint8Array}var util=Object.create(require_util());util.inherits=require_inherits();var debugUtil=require("util"),debug=void 0;debugUtil&&debugUtil.debuglog?debug=debugUtil.debuglog("stream"):debug=function(){};var BufferList=require_BufferList4(),destroyImpl=require_destroy4(),StringDecoder;util.inherits(Readable,Stream3);var kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(emitter,event,fn){if(typeof emitter.prependListener=="function")return emitter.prependListener(event,fn);!emitter._events||!emitter._events[event]?emitter.on(event,fn):isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]}function ReadableState(options,stream2){Duplex2=Duplex2||require_stream_duplex4(),options=options||{};var isDuplex=stream2 instanceof Duplex2;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,readableHwm=options.readableHighWaterMark,defaultHwm=this.objectMode?16:16*1024;hwm||hwm===0?this.highWaterMark=hwm:isDuplex&&(readableHwm||readableHwm===0)?this.highWaterMark=readableHwm:this.highWaterMark=defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require_string_decoder4().StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex2=Duplex2||require_stream_duplex4(),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&(typeof options.read=="function"&&(this._read=options.read),typeof options.destroy=="function"&&(this._destroy=options.destroy)),Stream3.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}});Readable.prototype.destroy=destroyImpl.destroy;Readable.prototype._undestroy=destroyImpl.undestroy;Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)};Readable.prototype.push=function(chunk,encoding){var state=this._readableState,skipChunkCheck;return state.objectMode?skipChunkCheck=!0:typeof chunk=="string"&&(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=Buffer4.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)};Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)};function readableAddChunk(stream2,chunk,encoding,addToFront,skipChunkCheck){var state=stream2._readableState;if(chunk===null)state.reading=!1,onEofChunk(stream2,state);else{var er;skipChunkCheck||(er=chunkInvalid(state,chunk)),er?stream2.emit("error",er):state.objectMode||chunk&&chunk.length>0?(typeof chunk!="string"&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer4.prototype&&(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream2.emit("error",new Error("stream.unshift() after end event")):addChunk(stream2,state,chunk,!0):state.ended?stream2.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||chunk.length!==0?addChunk(stream2,state,chunk,!1):maybeReadMore(stream2,state)):addChunk(stream2,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream2,state,chunk,addToFront){state.flowing&&state.length===0&&!state.sync?(stream2.emit("data",chunk),stream2.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream2)),maybeReadMore(stream2,state)}function chunkInvalid(state,chunk){var er;return!_isUint8Array(chunk)&&typeof chunk!="string"&&chunk!==void 0&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===!1};Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=require_string_decoder4().StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;function computeNewHighWaterMark(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||state.length===0&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(n!==0&&(state.emittedReadable=!1),n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),state.length===0&&state.ended?endReadable(this):emitReadable(this),null;if(n=howMuchToRead(n,state),n===0&&state.ended)return state.length===0&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(state.length===0||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),state.ended||state.reading?(doRead=!1,debug("reading or ended",doRead)):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,state.length===0&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state)));var ret;return n>0?ret=fromList(n,state):ret=null,ret===null?(state.needReadable=!0,n=0):state.length-=n,state.length===0&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),ret!==null&&this.emit("data",ret),ret};function onEofChunk(stream2,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream2)}}function emitReadable(stream2){var state=stream2._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream2):emitReadable_(stream2))}function emitReadable_(stream2){debug("emit readable"),stream2.emit("readable"),flow(stream2)}function maybeReadMore(stream2,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream2,state))}function maybeReadMore_(stream2,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream2.read(0),len!==state.length);)len=state.length;state.readingMore=!1}Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1;function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain)&&ondrain()}var increasedAwaitDrain=!1;src.on("data",ondata);function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1;var ret=dest.write(chunk);ret===!1&&!increasedAwaitDrain&&((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",state.awaitDrain),state.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),EElistenerCount(dest,"error")===0&&dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish),unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe"),src.unpipe(dest)}return dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,state.awaitDrain===0&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(state.pipesCount===0)return this;if(state.pipesCount===1)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i2=0;i2<len;i2++)dests[i2].emit("unpipe",this,{hasUnpiped:!1});return this}var index=indexOf(state.pipes,dest);return index===-1?this:(state.pipes.splice(index,1),state.pipesCount-=1,state.pipesCount===1&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)};Readable.prototype.on=function(ev,fn){var res=Stream3.prototype.on.call(this,ev,fn);if(ev==="data")this._readableState.flowing!==!1&&this.resume();else if(ev==="readable"){var state=this._readableState;!state.endEmitted&&!state.readableListening&&(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return res};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(self2){debug("readable nexttick read 0"),self2.read(0)}Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,resume(this,state)),this};function resume(stream2,state){state.resumeScheduled||(state.resumeScheduled=!0,pna.nextTick(resume_,stream2,state))}function resume_(stream2,state){state.reading||(debug("resume read 0"),stream2.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream2.emit("resume"),flow(stream2),state.flowing&&!state.reading&&stream2.read(0)}Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function flow(stream2){var state=stream2._readableState;for(debug("flow",state.flowing);state.flowing&&stream2.read()!==null;);}Readable.prototype.wrap=function(stream2){var _this=this,state=this._readableState,paused=!1;stream2.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream2.on("data",function(chunk){if(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!(state.objectMode&&chunk==null)&&!(!state.objectMode&&(!chunk||!chunk.length))){var ret=_this.push(chunk);ret||(paused=!0,stream2.pause())}});for(var i2 in stream2)this[i2]===void 0&&typeof stream2[i2]=="function"&&(this[i2]=function(method){return function(){return stream2[method].apply(stream2,arguments)}}(i2));for(var n=0;n<kProxyEvents.length;n++)stream2.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n2){debug("wrapped _read",n2),paused&&(paused=!1,stream2.resume())},this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(n,state){if(state.length===0)return null;var ret;return state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(state.decoder?ret=state.buffer.join(""):state.buffer.length===1?ret=state.buffer.head.data:ret=state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):n===list.head.data.length?ret=list.shift():ret=hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list),ret}function copyFromBufferString(n,list){var p=list.head,c=1,ret=p.data;for(n-=ret.length;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),n-=nb,n===0){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer4.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),n-=nb,n===0){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream2){var state=stream2._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream2))}function endReadableNT(state,stream2){!state.endEmitted&&state.length===0&&(state.endEmitted=!0,stream2.readable=!1,stream2.emit("end"))}function indexOf(xs,x2){for(var i2=0,l=xs.length;i2<l;i2++)if(xs[i2]===x2)return i2;return-1}}});var require_stream_transform4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_transform.js"(exports,module2){"use strict";module2.exports=Transform;var Duplex2=require_stream_duplex4(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(Transform,Duplex2);function afterTransform(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return this.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,data!=null&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex2.call(this,options),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&(typeof options.transform=="function"&&(this._transform=options.transform),typeof options.flush=="function"&&(this._flush=options.flush)),this.on("prefinish",prefinish)}function prefinish(){var _this=this;typeof this._flush=="function"?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex2.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;ts.writechunk!==null&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0};Transform.prototype._destroy=function(err,cb){var _this2=this;Duplex2.prototype._destroy.call(this,err,function(err2){cb(err2),_this2.emit("close")})};function done(stream2,er,data){if(er)return stream2.emit("error",er);if(data!=null&&stream2.push(data),stream2._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(stream2._transformState.transforming)throw new Error("Calling transform done when still transforming");return stream2.push(null)}}});var require_stream_passthrough4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/lib/_stream_passthrough.js"(exports,module2){"use strict";module2.exports=PassThrough3;var Transform=require_stream_transform4(),util=Object.create(require_util());util.inherits=require_inherits();util.inherits(PassThrough3,Transform);function PassThrough3(options){if(!(this instanceof PassThrough3))return new PassThrough3(options);Transform.call(this,options)}PassThrough3.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}}});var require_readable4=__commonJS({"../../node_modules/pumpify/node_modules/readable-stream/readable.js"(exports,module2){"use strict";var Stream3=require("stream");process.env.READABLE_STREAM==="disable"&&Stream3?(module2.exports=Stream3,exports=module2.exports=Stream3.Readable,exports.Readable=Stream3.Readable,exports.Writable=Stream3.Writable,exports.Duplex=Stream3.Duplex,exports.Transform=Stream3.Transform,exports.PassThrough=Stream3.PassThrough,exports.Stream=Stream3):(exports=module2.exports=require_stream_readable4(),exports.Stream=Stream3||exports,exports.Readable=exports,exports.Writable=require_stream_writable4(),exports.Duplex=require_stream_duplex4(),exports.Transform=require_stream_transform4(),exports.PassThrough=require_stream_passthrough4())}});var require_duplexify2=__commonJS({"../../node_modules/pumpify/node_modules/duplexify/index.js"(exports,module2){"use strict";var stream2=require_readable4(),eos=require_end_of_stream(),inherits=require_inherits(),shift=require_stream_shift(),SIGNAL_FLUSH=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),onuncork=function(self2,fn){self2._corked?self2.once("uncork",fn):fn()},autoDestroy=function(self2,err){self2._autoDestroy&&self2.destroy(err)},destroyer=function(self2,end2){return function(err){err?autoDestroy(self2,err.message==="premature close"?null:err):end2&&!self2._ended&&self2.end()}},end=function(ws,fn){if(!ws||ws._writableState&&ws._writableState.finished)return fn();if(ws._writableState)return ws.end(fn);ws.end(),fn()},toStreams2=function(rs){return new stream2.Readable({objectMode:!0,highWaterMark:16}).wrap(rs)},Duplexify=function(writable,readable,opts){if(!(this instanceof Duplexify))return new Duplexify(writable,readable,opts);stream2.Duplex.call(this,opts),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!opts||opts.autoDestroy!==!1,this._forwardDestroy=!opts||opts.destroy!==!1,this._forwardEnd=!opts||opts.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,writable&&this.setWritable(writable),readable&&this.setReadable(readable)};inherits(Duplexify,stream2.Duplex);Duplexify.obj=function(writable,readable,opts){return opts||(opts={}),opts.objectMode=!0,opts.highWaterMark=16,new Duplexify(writable,readable,opts)};Duplexify.prototype.cork=function(){++this._corked===1&&this.emit("cork")};Duplexify.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};Duplexify.prototype.setWritable=function(writable){if(this._unwrite&&this._unwrite(),this.destroyed){writable&&writable.destroy&&writable.destroy();return}if(writable===null||writable===!1){this.end();return}var self2=this,unend=eos(writable,{writable:!0,readable:!1},destroyer(this,this._forwardEnd)),ondrain=function(){var ondrain2=self2._ondrain;self2._ondrain=null,ondrain2&&ondrain2()},clear=function(){self2._writable.removeListener("drain",ondrain),unend()};this._unwrite&&process.nextTick(ondrain),this._writable=writable,this._writable.on("drain",ondrain),this._unwrite=clear,this.uncork()};Duplexify.prototype.setReadable=function(readable){if(this._unread&&this._unread(),this.destroyed){readable&&readable.destroy&&readable.destroy();return}if(readable===null||readable===!1){this.push(null),this.resume();return}var self2=this,unend=eos(readable,{writable:!1,readable:!0},destroyer(this)),onreadable=function(){self2._forward()},onend=function(){self2.push(null)},clear=function(){self2._readable2.removeListener("readable",onreadable),self2._readable2.removeListener("end",onend),unend()};this._drained=!0,this._readable=readable,this._readable2=readable._readableState?readable:toStreams2(readable),this._readable2.on("readable",onreadable),this._readable2.on("end",onend),this._unread=clear,this._forward()};Duplexify.prototype._read=function(){this._drained=!0,this._forward()};Duplexify.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var data;this._drained&&(data=shift(this._readable2))!==null;)this.destroyed||(this._drained=this.push(data));this._forwarding=!1}};Duplexify.prototype.destroy=function(err){if(!this.destroyed){this.destroyed=!0;var self2=this;process.nextTick(function(){self2._destroy(err)})}};Duplexify.prototype._destroy=function(err){if(err){var ondrain=this._ondrain;this._ondrain=null,ondrain?ondrain(err):this.emit("error",err)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};Duplexify.prototype._write=function(data,enc,cb){if(this.destroyed)return cb();if(this._corked)return onuncork(this,this._write.bind(this,data,enc,cb));if(data===SIGNAL_FLUSH)return this._finish(cb);if(!this._writable)return cb();this._writable.write(data)===!1?this._ondrain=cb:cb()};Duplexify.prototype._finish=function(cb){var self2=this;this.emit("preend"),onuncork(this,function(){end(self2._forwardEnd&&self2._writable,function(){self2._writableState.prefinished===!1&&(self2._writableState.prefinished=!0),self2.emit("prefinish"),onuncork(self2,cb)})})};Duplexify.prototype.end=function(data,enc,cb){return typeof data=="function"?this.end(null,null,data):typeof enc=="function"?this.end(data,null,enc):(this._ended=!0,data&&this.write(data),this._writableState.ending||this.write(SIGNAL_FLUSH),stream2.Writable.prototype.end.call(this,cb))};module2.exports=Duplexify}});var require_pumpify=__commonJS({"../../node_modules/pumpify/index.js"(exports,module2){"use strict";var pump2=require_pump2(),inherits=require_inherits(),Duplexify=require_duplexify2(),toArray=function(args){return args.length?Array.isArray(args[0])?args[0]:Array.prototype.slice.call(args):[]},define2=function(opts){var Pumpify=function(){var streams=toArray(arguments);if(!(this instanceof Pumpify))return new Pumpify(streams);Duplexify.call(this,null,null,opts),streams.length&&this.setPipeline(streams)};return inherits(Pumpify,Duplexify),Pumpify.prototype.setPipeline=function(){var streams=toArray(arguments),self2=this,ended=!1,w=streams[0],r2=streams[streams.length-1];r2=r2.readable?r2:null,w=w.writable?w:null;var onclose=function(){streams[0].emit("error",new Error("stream was destroyed"))};if(this.on("close",onclose),this.on("prefinish",function(){ended||self2.cork()}),pump2(streams,function(err){if(self2.removeListener("close",onclose),err)return self2.destroy(err.message==="premature close"?null:err);ended=!0,self2._autoDestroy===!1&&(self2._autoDestroy=!0),self2.uncork()}),this.destroyed)return onclose();this.setWritable(w),this.setReadable(r2)},Pumpify};module2.exports=define2({autoDestroy:!1,destroy:!1});module2.exports.obj=define2({autoDestroy:!1,destroy:!1,objectMode:!0,highWaterMark:16});module2.exports.ctor=define2}});var require_is_gzip=__commonJS({"../../node_modules/is-gzip/index.js"(exports,module2){"use strict";module2.exports=function(buf){return!buf||buf.length<3?!1:buf[0]===31&&buf[1]===139&&buf[2]===8}}});var require_is_deflate=__commonJS({"../../node_modules/is-deflate/index.js"(exports,module2){"use strict";module2.exports=function(buf){return!buf||buf.length<2?!1:buf[0]===120&&(buf[1]===1||buf[1]===156||buf[1]===218)}}});var require_gunzip_maybe=__commonJS({"../../node_modules/gunzip-maybe/index.js"(exports,module2){"use strict";var zlib2=require("zlib"),peek=require_peek_stream(),through=require_through2(),pumpify=require_pumpify(),isGzip=require_is_gzip(),isDeflate=require_is_deflate(),isCompressed=function(data){return isGzip(data)?1:isDeflate(data)?2:0},gunzip=function(maxRecursion){return maxRecursion===void 0&&(maxRecursion=3),peek({newline:!1,maxBuffer:10},function(data,swap){if(maxRecursion<0)return swap(new Error("Maximum recursion reached"));switch(isCompressed(data)){case 1:swap(null,pumpify(zlib2.createGunzip(),gunzip(maxRecursion-1)));break;case 2:swap(null,pumpify(zlib2.createInflate(),gunzip(maxRecursion-1)));break;default:swap(null,through())}})};module2.exports=gunzip}});var require_lib=__commonJS({"../../node_modules/get-npm-tarball-url/lib/index.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});function default_1(pkgName,pkgVersion,opts){let registry;opts!=null&&opts.registry?registry=opts.registry.endsWith("/")?opts.registry:`${opts.registry}/`:registry="https://registry.npmjs.org/";let scopelessName=getScopelessName(pkgName);return`${registry}${pkgName}/-/${scopelessName}-${removeBuildMetadataFromVersion(pkgVersion)}.tgz`}exports.default=default_1;function removeBuildMetadataFromVersion(version){let plusPos=version.indexOf("+");return plusPos===-1?version:version.substring(0,plusPos)}function getScopelessName(name){return name[0]!=="@"?name:name.split("/")[1]}}});var tslib_es6_exports={};__export(tslib_es6_exports,{__assign:()=>__assign,__asyncDelegator:()=>__asyncDelegator,__asyncGenerator:()=>__asyncGenerator,__asyncValues:()=>__asyncValues,__await:()=>__await,__awaiter:()=>__awaiter,__classPrivateFieldGet:()=>__classPrivateFieldGet2,__classPrivateFieldSet:()=>__classPrivateFieldSet2,__createBinding:()=>__createBinding,__decorate:()=>__decorate,__exportStar:()=>__exportStar,__extends:()=>__extends,__generator:()=>__generator,__importDefault:()=>__importDefault,__importStar:()=>__importStar,__makeTemplateObject:()=>__makeTemplateObject,__metadata:()=>__metadata,__param:()=>__param,__read:()=>__read,__rest:()=>__rest,__spread:()=>__spread,__spreadArrays:()=>__spreadArrays,__values:()=>__values});function __extends(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}function __rest(s2,e2){var t2={};for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&e2.indexOf(p)<0&&(t2[p]=s2[p]);if(s2!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i2=0,p=Object.getOwnPropertySymbols(s2);i2<p.length;i2++)e2.indexOf(p[i2])<0&&Object.prototype.propertyIsEnumerable.call(s2,p[i2])&&(t2[p[i2]]=s2[p[i2]]);return t2}function __decorate(decorators,target,key,desc){var c=arguments.length,r2=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r2=Reflect.decorate(decorators,target,key,desc);else for(var i2=decorators.length-1;i2>=0;i2--)(d=decorators[i2])&&(r2=(c<3?d(r2):c>3?d(target,key,r2):d(target,key))||r2);return c>3&&r2&&Object.defineProperty(target,key,r2),r2}function __param(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}}function __metadata(metadataKey,metadataValue){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(metadataKey,metadataValue)}function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve3){resolve3(value)})}return new(P||(P=Promise))(function(resolve3,reject){function fulfilled(value){try{step(generator.next(value))}catch(e2){reject(e2)}}function rejected(value){try{step(generator.throw(value))}catch(e2){reject(e2)}}function step(result){result.done?resolve3(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})}function __generator(thisArg,body){var _={label:0,sent:function(){if(t2[0]&1)throw t2[1];return t2[1]},trys:[],ops:[]},f3,y,t2,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f3)throw new TypeError("Generator is already executing.");for(;_;)try{if(f3=1,y&&(t2=op[0]&2?y.return:op[0]?y.throw||((t2=y.return)&&t2.call(y),0):y.next)&&!(t2=t2.call(y,op[1])).done)return t2;switch(y=0,t2&&(op=[op[0]&2,t2.value]),op[0]){case 0:case 1:t2=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(t2=_.trys,!(t2=t2.length>0&&t2[t2.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t2||op[1]>t2[0]&&op[1]<t2[3])){_.label=op[1];break}if(op[0]===6&&_.label<t2[1]){_.label=t2[1],t2=op;break}if(t2&&_.label<t2[2]){_.label=t2[2],_.ops.push(op);break}t2[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e2){op=[6,e2],y=0}finally{f3=t2=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}}function __createBinding(o,m2,k,k2){k2===void 0&&(k2=k),o[k2]=m2[k]}function __exportStar(m2,exports){for(var p in m2)p!=="default"&&!exports.hasOwnProperty(p)&&(exports[p]=m2[p])}function __values(o){var s2=typeof Symbol=="function"&&Symbol.iterator,m2=s2&&o[s2],i2=0;if(m2)return m2.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&i2>=o.length&&(o=void 0),{value:o&&o[i2++],done:!o}}};throw new TypeError(s2?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(o,n){var m2=typeof Symbol=="function"&&o[Symbol.iterator];if(!m2)return o;var i2=m2.call(o),r2,ar=[],e2;try{for(;(n===void 0||n-- >0)&&!(r2=i2.next()).done;)ar.push(r2.value)}catch(error){e2={error}}finally{try{r2&&!r2.done&&(m2=i2.return)&&m2.call(i2)}finally{if(e2)throw e2.error}}return ar}function __spread(){for(var ar=[],i2=0;i2<arguments.length;i2++)ar=ar.concat(__read(arguments[i2]));return ar}function __spreadArrays(){for(var s2=0,i2=0,il=arguments.length;i2<il;i2++)s2+=arguments[i2].length;for(var r2=Array(s2),k=0,i2=0;i2<il;i2++)for(var a=arguments[i2],j=0,jl=a.length;j<jl;j++,k++)r2[k]=a[j];return r2}function __await(v){return this instanceof __await?(this.v=v,this):new __await(v)}function __asyncGenerator(thisArg,_arguments,generator){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),i2,q=[];return i2={},verb("next"),verb("throw"),verb("return"),i2[Symbol.asyncIterator]=function(){return this},i2;function verb(n){g[n]&&(i2[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})})}function resume(n,v){try{step(g[n](v))}catch(e2){settle(q[0][3],e2)}}function step(r2){r2.value instanceof __await?Promise.resolve(r2.value.v).then(fulfill,reject):settle(q[0][2],r2)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f3,v){f3(v),q.shift(),q.length&&resume(q[0][0],q[0][1])}}function __asyncDelegator(o){var i2,p;return i2={},verb("next"),verb("throw",function(e2){throw e2}),verb("return"),i2[Symbol.iterator]=function(){return this},i2;function verb(n,f3){i2[n]=o[n]?function(v){return(p=!p)?{value:__await(o[n](v)),done:n==="return"}:f3?f3(v):v}:f3}}function __asyncValues(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m2=o[Symbol.asyncIterator],i2;return m2?m2.call(o):(o=typeof __values=="function"?__values(o):o[Symbol.iterator](),i2={},verb("next"),verb("throw"),verb("return"),i2[Symbol.asyncIterator]=function(){return this},i2);function verb(n){i2[n]=o[n]&&function(v){return new Promise(function(resolve3,reject){v=o[n](v),settle(resolve3,reject,v.done,v.value)})}}function settle(resolve3,reject,d,v){Promise.resolve(v).then(function(v2){resolve3({value:v2,done:d})},reject)}}function __makeTemplateObject(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked}function __importStar(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)Object.hasOwnProperty.call(mod,k)&&(result[k]=mod[k]);return result.default=mod,result}function __importDefault(mod){return mod&&mod.__esModule?mod:{default:mod}}function __classPrivateFieldGet2(receiver,privateMap){if(!privateMap.has(receiver))throw new TypeError("attempted to get private field on non-instance");return privateMap.get(receiver)}function __classPrivateFieldSet2(receiver,privateMap,value){if(!privateMap.has(receiver))throw new TypeError("attempted to set private field on non-instance");return privateMap.set(receiver,value),value}var extendStatics,__assign,init_tslib_es6=__esm({"../../node_modules/@yarnpkg/fslib/node_modules/tslib/tslib.es6.js"(){"use strict";extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)b2.hasOwnProperty(p)&&(d2[p]=b2[p])},extendStatics(d,b)};__assign=function(){return __assign=Object.assign||function(t2){for(var s2,i2=1,n=arguments.length;i2<n;i2++){s2=arguments[i2];for(var p in s2)Object.prototype.hasOwnProperty.call(s2,p)&&(t2[p]=s2[p])}return t2},__assign.apply(this,arguments)}}});var require_constants=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/constants.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.SAFE_TIME=exports.S_IFLNK=exports.S_IFREG=exports.S_IFDIR=exports.S_IFMT=void 0;exports.S_IFMT=61440;exports.S_IFDIR=16384;exports.S_IFREG=32768;exports.S_IFLNK=40960;exports.SAFE_TIME=456789e3}});var require_statUtils=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/statUtils.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.areStatsEqual=exports.convertToBigIntStats=exports.clearStats=exports.makeEmptyStats=exports.makeDefaultStats=exports.BigIntStatsEntry=exports.StatEntry=exports.DirEntry=exports.DEFAULT_MODE=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),nodeUtils=tslib_1.__importStar(require("util")),constants_1=require_constants();exports.DEFAULT_MODE=constants_1.S_IFREG|420;var DirEntry=class{constructor(){this.name="",this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFDIR}isFIFO(){return!1}isFile(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFREG}isSocket(){return!1}isSymbolicLink(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFLNK}};exports.DirEntry=DirEntry;var StatEntry=class{constructor(){this.uid=0,this.gid=0,this.size=0,this.blksize=0,this.atimeMs=0,this.mtimeMs=0,this.ctimeMs=0,this.birthtimeMs=0,this.atime=new Date(0),this.mtime=new Date(0),this.ctime=new Date(0),this.birthtime=new Date(0),this.dev=0,this.ino=0,this.mode=exports.DEFAULT_MODE,this.nlink=1,this.rdev=0,this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFDIR}isFIFO(){return!1}isFile(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFREG}isSocket(){return!1}isSymbolicLink(){return(this.mode&constants_1.S_IFMT)===constants_1.S_IFLNK}};exports.StatEntry=StatEntry;var BigIntStatsEntry=class{constructor(){this.uid=BigInt(0),this.gid=BigInt(0),this.size=BigInt(0),this.blksize=BigInt(0),this.atimeMs=BigInt(0),this.mtimeMs=BigInt(0),this.ctimeMs=BigInt(0),this.birthtimeMs=BigInt(0),this.atimeNs=BigInt(0),this.mtimeNs=BigInt(0),this.ctimeNs=BigInt(0),this.birthtimeNs=BigInt(0),this.atime=new Date(0),this.mtime=new Date(0),this.ctime=new Date(0),this.birthtime=new Date(0),this.dev=BigInt(0),this.ino=BigInt(0),this.mode=BigInt(exports.DEFAULT_MODE),this.nlink=BigInt(1),this.rdev=BigInt(0),this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&BigInt(constants_1.S_IFMT))===BigInt(constants_1.S_IFDIR)}isFIFO(){return!1}isFile(){return(this.mode&BigInt(constants_1.S_IFMT))===BigInt(constants_1.S_IFREG)}isSocket(){return!1}isSymbolicLink(){return(this.mode&BigInt(constants_1.S_IFMT))===BigInt(constants_1.S_IFLNK)}};exports.BigIntStatsEntry=BigIntStatsEntry;function makeDefaultStats(){return new StatEntry}exports.makeDefaultStats=makeDefaultStats;function makeEmptyStats(){return clearStats(makeDefaultStats())}exports.makeEmptyStats=makeEmptyStats;function clearStats(stats){for(let key in stats)if(Object.prototype.hasOwnProperty.call(stats,key)){let element=stats[key];typeof element=="number"?stats[key]=0:typeof element=="bigint"?stats[key]=BigInt(0):nodeUtils.types.isDate(element)&&(stats[key]=new Date(0))}return stats}exports.clearStats=clearStats;function convertToBigIntStats(stats){let bigintStats=new BigIntStatsEntry;for(let key in stats)if(Object.prototype.hasOwnProperty.call(stats,key)){let element=stats[key];typeof element=="number"?bigintStats[key]=BigInt(element):nodeUtils.types.isDate(element)&&(bigintStats[key]=new Date(element))}return bigintStats.atimeNs=bigintStats.atimeMs*BigInt(1e6),bigintStats.mtimeNs=bigintStats.mtimeMs*BigInt(1e6),bigintStats.ctimeNs=bigintStats.ctimeMs*BigInt(1e6),bigintStats.birthtimeNs=bigintStats.birthtimeMs*BigInt(1e6),bigintStats}exports.convertToBigIntStats=convertToBigIntStats;function areStatsEqual(a,b){if(a.atimeMs!==b.atimeMs||a.birthtimeMs!==b.birthtimeMs||a.blksize!==b.blksize||a.blocks!==b.blocks||a.ctimeMs!==b.ctimeMs||a.dev!==b.dev||a.gid!==b.gid||a.ino!==b.ino||a.isBlockDevice()!==b.isBlockDevice()||a.isCharacterDevice()!==b.isCharacterDevice()||a.isDirectory()!==b.isDirectory()||a.isFIFO()!==b.isFIFO()||a.isFile()!==b.isFile()||a.isSocket()!==b.isSocket()||a.isSymbolicLink()!==b.isSymbolicLink()||a.mode!==b.mode||a.mtimeMs!==b.mtimeMs||a.nlink!==b.nlink||a.rdev!==b.rdev||a.size!==b.size||a.uid!==b.uid)return!1;let aN=a,bN=b;return!(aN.atimeNs!==bN.atimeNs||aN.mtimeNs!==bN.mtimeNs||aN.ctimeNs!==bN.ctimeNs||aN.birthtimeNs!==bN.birthtimeNs)}exports.areStatsEqual=areStatsEqual}});var require_path=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/path.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.toFilename=exports.convertPath=exports.ppath=exports.npath=exports.Filename=exports.PortablePath=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),path_1=tslib_1.__importDefault(require("path")),PathType;(function(PathType2){PathType2[PathType2.File=0]="File",PathType2[PathType2.Portable=1]="Portable",PathType2[PathType2.Native=2]="Native"})(PathType||(PathType={}));exports.PortablePath={root:"/",dot:".",parent:".."};exports.Filename={nodeModules:"node_modules",manifest:"package.json",lockfile:"yarn.lock",virtual:"__virtual__",pnpJs:".pnp.js",pnpCjs:".pnp.cjs",rc:".yarnrc.yml"};exports.npath=Object.create(path_1.default);exports.ppath=Object.create(path_1.default.posix);exports.npath.cwd=()=>process.cwd();exports.ppath.cwd=()=>toPortablePath(process.cwd());exports.ppath.resolve=(...segments)=>segments.length>0&&exports.ppath.isAbsolute(segments[0])?path_1.default.posix.resolve(...segments):path_1.default.posix.resolve(exports.ppath.cwd(),...segments);var contains=function(pathUtils,from,to){return from=pathUtils.normalize(from),to=pathUtils.normalize(to),from===to?".":(from.endsWith(pathUtils.sep)||(from=from+pathUtils.sep),to.startsWith(from)?to.slice(from.length):null)};exports.npath.fromPortablePath=fromPortablePath;exports.npath.toPortablePath=toPortablePath;exports.npath.contains=(from,to)=>contains(exports.npath,from,to);exports.ppath.contains=(from,to)=>contains(exports.ppath,from,to);var WINDOWS_PATH_REGEXP=/^([a-zA-Z]:.*)$/,UNC_WINDOWS_PATH_REGEXP=/^\/\/(\.\/)?(.*)$/,PORTABLE_PATH_REGEXP=/^\/([a-zA-Z]:.*)$/,UNC_PORTABLE_PATH_REGEXP=/^\/unc\/(\.dot\/)?(.*)$/;function fromPortablePath(p){if(process.platform!=="win32")return p;let portablePathMatch,uncPortablePathMatch;if(portablePathMatch=p.match(PORTABLE_PATH_REGEXP))p=portablePathMatch[1];else if(uncPortablePathMatch=p.match(UNC_PORTABLE_PATH_REGEXP))p=`\\\\${uncPortablePathMatch[1]?".\\":""}${uncPortablePathMatch[2]}`;else return p;return p.replace(/\//g,"\\")}function toPortablePath(p){if(process.platform!=="win32")return p;p=p.replace(/\\/g,"/");let windowsPathMatch,uncWindowsPathMatch;return(windowsPathMatch=p.match(WINDOWS_PATH_REGEXP))?p=`/${windowsPathMatch[1]}`:(uncWindowsPathMatch=p.match(UNC_WINDOWS_PATH_REGEXP))&&(p=`/unc/${uncWindowsPathMatch[1]?".dot/":""}${uncWindowsPathMatch[2]}`),p}function convertPath(targetPathUtils,sourcePath){return targetPathUtils===exports.npath?fromPortablePath(sourcePath):toPortablePath(sourcePath)}exports.convertPath=convertPath;function toFilename(filename){if(exports.npath.parse(filename).dir!==""||exports.ppath.parse(filename).dir!=="")throw new Error(`Invalid filename: "${filename}"`);return filename}exports.toFilename=toFilename}});var require_copyPromise=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/algorithms/copyPromise.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.copyPromise=exports.LinkStrategy=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),fs_1=tslib_1.__importDefault(require("fs")),constants=tslib_1.__importStar(require_constants()),path_1=require_path(),defaultTime=new Date(constants.SAFE_TIME*1e3),LinkStrategy;(function(LinkStrategy2){LinkStrategy2.Allow="allow",LinkStrategy2.ReadOnly="readOnly"})(LinkStrategy=exports.LinkStrategy||(exports.LinkStrategy={}));async function copyPromise(destinationFs,destination,sourceFs,source,opts){let normalizedDestination=destinationFs.pathUtils.normalize(destination),normalizedSource=sourceFs.pathUtils.normalize(source),prelayout=[],postlayout=[],{atime,mtime}=opts.stableTime?{atime:defaultTime,mtime:defaultTime}:await sourceFs.lstatPromise(normalizedSource);await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination),{utimes:[atime,mtime]});let updateTime=typeof destinationFs.lutimesPromise=="function"?destinationFs.lutimesPromise.bind(destinationFs):destinationFs.utimesPromise.bind(destinationFs);await copyImpl(prelayout,postlayout,updateTime,destinationFs,normalizedDestination,sourceFs,normalizedSource,{...opts,didParentExist:!0});for(let operation of prelayout)await operation();await Promise.all(postlayout.map(operation=>operation()))}exports.copyPromise=copyPromise;async function copyImpl(prelayout,postlayout,updateTime,destinationFs,destination,sourceFs,source,opts){var _a,_b;let destinationStat=opts.didParentExist?await maybeLStat(destinationFs,destination):null,sourceStat=await sourceFs.lstatPromise(source),{atime,mtime}=opts.stableTime?{atime:defaultTime,mtime:defaultTime}:sourceStat,updated;switch(!0){case sourceStat.isDirectory():updated=await copyFolder(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts);break;case sourceStat.isFile():updated=await copyFile(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts);break;case sourceStat.isSymbolicLink():updated=await copySymlink(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts);break;default:throw new Error(`Unsupported file type (${sourceStat.mode})`)}return(updated||((_a=destinationStat==null?void 0:destinationStat.mtime)===null||_a===void 0?void 0:_a.getTime())!==mtime.getTime()||((_b=destinationStat==null?void 0:destinationStat.atime)===null||_b===void 0?void 0:_b.getTime())!==atime.getTime())&&(postlayout.push(()=>updateTime(destination,atime,mtime)),updated=!0),(destinationStat===null||(destinationStat.mode&511)!==(sourceStat.mode&511))&&(postlayout.push(()=>destinationFs.chmodPromise(destination,sourceStat.mode&511)),updated=!0),updated}async function maybeLStat(baseFs,p){try{return await baseFs.lstatPromise(p)}catch{return null}}async function copyFolder(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts){if(destinationStat!==null&&!destinationStat.isDirectory())if(opts.overwrite)prelayout.push(async()=>destinationFs.removePromise(destination)),destinationStat=null;else return!1;let updated=!1;destinationStat===null&&(prelayout.push(async()=>{try{await destinationFs.mkdirPromise(destination,{mode:sourceStat.mode})}catch(err){if(err.code!=="EEXIST")throw err}}),updated=!0);let entries2=await sourceFs.readdirPromise(source),nextOpts=opts.didParentExist&&!destinationStat?{...opts,didParentExist:!1}:opts;if(opts.stableSort)for(let entry of entries2.sort())await copyImpl(prelayout,postlayout,updateTime,destinationFs,destinationFs.pathUtils.join(destination,entry),sourceFs,sourceFs.pathUtils.join(source,entry),nextOpts)&&(updated=!0);else(await Promise.all(entries2.map(async entry=>{await copyImpl(prelayout,postlayout,updateTime,destinationFs,destinationFs.pathUtils.join(destination,entry),sourceFs,sourceFs.pathUtils.join(source,entry),nextOpts)}))).some(status=>status)&&(updated=!0);return updated}var isCloneSupportedCache=new WeakMap;function makeLinkOperation(opFs,destination,source,sourceStat,linkStrategy){return async()=>{await opFs.linkPromise(source,destination),linkStrategy===LinkStrategy.ReadOnly&&(sourceStat.mode&=-147,await opFs.chmodPromise(destination,sourceStat.mode))}}function makeCloneLinkOperation(opFs,destination,source,sourceStat,linkStrategy){let isCloneSupported=isCloneSupportedCache.get(opFs);return typeof isCloneSupported>"u"?async()=>{try{await opFs.copyFilePromise(source,destination,fs_1.default.constants.COPYFILE_FICLONE_FORCE),isCloneSupportedCache.set(opFs,!0)}catch(err){if(err.code==="ENOSYS"||err.code==="ENOTSUP")isCloneSupportedCache.set(opFs,!1),await makeLinkOperation(opFs,destination,source,sourceStat,linkStrategy)();else throw err}}:isCloneSupported?async()=>opFs.copyFilePromise(source,destination,fs_1.default.constants.COPYFILE_FICLONE_FORCE):makeLinkOperation(opFs,destination,source,sourceStat,linkStrategy)}async function copyFile(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts){var _a;if(destinationStat!==null)if(opts.overwrite)prelayout.push(async()=>destinationFs.removePromise(destination)),destinationStat=null;else return!1;let linkStrategy=(_a=opts.linkStrategy)!==null&&_a!==void 0?_a:null,op=destinationFs===sourceFs?linkStrategy!==null?makeCloneLinkOperation(destinationFs,destination,source,sourceStat,linkStrategy):async()=>destinationFs.copyFilePromise(source,destination,fs_1.default.constants.COPYFILE_FICLONE):linkStrategy!==null?makeLinkOperation(destinationFs,destination,source,sourceStat,linkStrategy):async()=>destinationFs.writeFilePromise(destination,await sourceFs.readFilePromise(source));return prelayout.push(async()=>op()),!0}async function copySymlink(prelayout,postlayout,updateTime,destinationFs,destination,destinationStat,sourceFs,source,sourceStat,opts){if(destinationStat!==null)if(opts.overwrite)prelayout.push(async()=>destinationFs.removePromise(destination)),destinationStat=null;else return!1;return prelayout.push(async()=>{await destinationFs.symlinkPromise((0,path_1.convertPath)(destinationFs.pathUtils,await sourceFs.readlinkPromise(source)),destination)}),!0}}});var require_errors3=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/errors.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.LibzipError=exports.ERR_DIR_CLOSED=exports.EOPNOTSUPP=exports.ENOTEMPTY=exports.EROFS=exports.EEXIST=exports.EISDIR=exports.ENOTDIR=exports.ENOENT=exports.EBADF=exports.EINVAL=exports.ENOSYS=exports.EBUSY=void 0;function makeError(code,message){return Object.assign(new Error(`${code}: ${message}`),{code})}function EBUSY(message){return makeError("EBUSY",message)}exports.EBUSY=EBUSY;function ENOSYS(message,reason){return makeError("ENOSYS",`${message}, ${reason}`)}exports.ENOSYS=ENOSYS;function EINVAL(reason){return makeError("EINVAL",`invalid argument, ${reason}`)}exports.EINVAL=EINVAL;function EBADF(reason){return makeError("EBADF",`bad file descriptor, ${reason}`)}exports.EBADF=EBADF;function ENOENT(reason){return makeError("ENOENT",`no such file or directory, ${reason}`)}exports.ENOENT=ENOENT;function ENOTDIR(reason){return makeError("ENOTDIR",`not a directory, ${reason}`)}exports.ENOTDIR=ENOTDIR;function EISDIR(reason){return makeError("EISDIR",`illegal operation on a directory, ${reason}`)}exports.EISDIR=EISDIR;function EEXIST(reason){return makeError("EEXIST",`file already exists, ${reason}`)}exports.EEXIST=EEXIST;function EROFS(reason){return makeError("EROFS",`read-only filesystem, ${reason}`)}exports.EROFS=EROFS;function ENOTEMPTY(reason){return makeError("ENOTEMPTY",`directory not empty, ${reason}`)}exports.ENOTEMPTY=ENOTEMPTY;function EOPNOTSUPP(reason){return makeError("EOPNOTSUPP",`operation not supported, ${reason}`)}exports.EOPNOTSUPP=EOPNOTSUPP;function ERR_DIR_CLOSED(){return makeError("ERR_DIR_CLOSED","Directory handle was closed")}exports.ERR_DIR_CLOSED=ERR_DIR_CLOSED;var LibzipError=class extends Error{constructor(message,code){super(message),this.name="Libzip Error",this.code=code}};exports.LibzipError=LibzipError}});var require_opendir=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/algorithms/opendir.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.opendir=exports.CustomDir=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),errors=tslib_1.__importStar(require_errors3()),CustomDir=class{constructor(path13,nextDirent,opts={}){this.path=path13,this.nextDirent=nextDirent,this.opts=opts,this.closed=!1}throwIfClosed(){if(this.closed)throw errors.ERR_DIR_CLOSED()}async*[Symbol.asyncIterator](){try{let dirent;for(;(dirent=await this.read())!==null;)yield dirent}finally{await this.close()}}read(cb){let dirent=this.readSync();return typeof cb<"u"?cb(null,dirent):Promise.resolve(dirent)}readSync(){return this.throwIfClosed(),this.nextDirent()}close(cb){return this.closeSync(),typeof cb<"u"?cb(null):Promise.resolve()}closeSync(){var _a,_b;this.throwIfClosed(),(_b=(_a=this.opts).onClose)===null||_b===void 0||_b.call(_a),this.closed=!0}};exports.CustomDir=CustomDir;function opendir(fakeFs,path13,entries2,opts){let nextDirent=()=>{let filename=entries2.shift();return typeof filename>"u"?null:Object.assign(fakeFs.statSync(fakeFs.pathUtils.join(path13,filename)),{name:filename})};return new CustomDir(path13,nextDirent,opts)}exports.opendir=opendir}});var require_FakeFS=__commonJS({"../../node_modules/@yarnpkg/fslib/lib/FakeFS.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.normalizeLineEndings=exports.BasePortableFakeFS=exports.FakeFS=void 0;var os_1=require("os"),copyPromise_1=require_copyPromise(),path_1=require_path(),FakeFS=class{constructor(pathUtils){this.pathUtils=pathUtils}async*genTraversePromise(init2,{stableSort=!1}={}){let stack=[init2];for(;stack.length>0;){let p=stack.shift();if((await this.lstatPromise(p)).isDirectory()){let entries2=await this.readdirPromise(p);if(stableSort)for(let entry2 of entries2.sort())stack.push(this.pathUtils.join(p,entry2));else throw new Error("Not supported")}else yield p}}async removePromise(p,{recursive=!0,maxRetries=5}={}){let stat2;try{stat2=await this.lstatPromise(p)}catch(error){if(error.code==="ENOENT")return;throw error}if(stat2.isDirectory()){if(recursive){let entries2=await this.readdirPromise(p);await Promise.all(entries2.map(entry=>this.removePromise(this.pathUtils.resolve(p,entry))))}for(let t2=0;t2<=maxRetries;t2++)try{await this.rmdirPromise(p);break}catch(error){if(error.code!=="EBUSY"&&error.code!=="ENOTEMPTY")throw error;t2<maxRetries&&await new Promise(resolve3=>setTimeout(resolve3,t2*100))}}else await this.unlinkPromise(p)}removeSync(p,{recursive=!0}={}){let stat2;try{stat2=this.lstatSync(p)}catch(error){if(error.code==="ENOENT")return;throw error}if(stat2.isDirectory()){if(recursive)for(let entry of this.readdirSync(p))this.removeSync(this.pathUtils.resolve(p,entry));this.rmdirSync(p)}else this.unlinkSync(p)}async mkdirpPromise(p,{chmod,utimes}={}){if(p=this.resolve(p),p===this.pathUtils.dirname(p))return;let parts=p.split(this.pathUtils.sep),createdDirectory;for(let u=2;u<=parts.length;++u){let subPath=parts.slice(0,u).join(this.pathUtils.sep);if(!this.existsSync(subPath)){try{await this.mkdirPromise(subPath)}catch(error){if(error.code==="EEXIST")continue;throw error}if(createdDirectory??(createdDirectory=subPath),chmod!=null&&await this.chmodPromise(subPath,chmod),utimes!=null)await this.utimesPromise(subPath,utimes[0],utimes[1]);else{let parentStat=await this.statPromise(this.pathUtils.dirname(subPath));await this.utimesPromise(subPath,parentStat.atime,parentStat.mtime)}}}return createdDirectory}mkdirpSync(p,{chmod,utimes}={}){if(p=this.resolve(p),p===this.pathUtils.dirname(p))return;let parts=p.split(this.pathUtils.sep),createdDirectory;for(let u=2;u<=parts.length;++u){let subPath=parts.slice(0,u).join(this.pathUtils.sep);if(!this.existsSync(subPath)){try{this.mkdirSync(subPath)}catch(error){if(error.code==="EEXIST")continue;throw error}if(createdDirectory??(createdDirectory=subPath),chmod!=null&&this.chmodSync(subPath,chmod),utimes!=null)this.utimesSync(subPath,utimes[0],utimes[1]);else{let parentStat=this.statSync(this.pathUtils.dirname(subPath));this.utimesSync(subPath,parentStat.atime,parentStat.mtime)}}}return createdDirectory}async copyPromise(destination,source,{baseFs=this,overwrite=!0,stableSort=!1,stableTime=!1,linkStrategy=null}={}){return await(0,copyPromise_1.copyPromise)(this,destination,baseFs,source,{overwrite,stableSort,stableTime,linkStrategy})}copySync(destination,source,{baseFs=this,overwrite=!0}={}){let stat2=baseFs.lstatSync(source),exists=this.existsSync(destination);if(stat2.isDirectory()){this.mkdirpSync(destination);let directoryListing=baseFs.readdirSync(source);for(let entry of directoryListing)this.copySync(this.pathUtils.join(destination,entry),baseFs.pathUtils.join(source,entry),{baseFs,overwrite})}else if(stat2.isFile()){if(!exists||overwrite){exists&&this.removeSync(destination);let content=baseFs.readFileSync(source);this.writeFileSync(destination,content)}}else if(stat2.isSymbolicLink()){if(!exists||overwrite){exists&&this.removeSync(destination);let target=baseFs.readlinkSync(source);this.symlinkSync((0,path_1.convertPath)(this.pathUtils,target),destination)}}else throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat2.mode.toString(8).padStart(6,"0")})`);let mode=stat2.mode&511;this.chmodSync(destination,mode)}async changeFilePromise(p,content,opts={}){return Buffer.isBuffer(content)?this.changeFileBufferPromise(p,content,opts):this.changeFileTextPromise(p,content,opts)}async changeFileBufferPromise(p,content,{mode}={}){let current=Buffer.alloc(0);try{current=await this.readFilePromise(p)}catch{}Buffer.compare(current,content)!==0&&await this.writeFilePromise(p,content,{mode})}async changeFileTextPromise(p,content,{automaticNewlines,mode}={}){let current="";try{current=await this.readFilePromise(p,"utf8")}catch{}let normalizedContent=automaticNewlines?normalizeLineEndings(current,content):content;current!==normalizedContent&&await this.writeFilePromise(p,normalizedContent,{mode})}changeFileSync(p,content,opts={}){return Buffer.isBuffer(content)?this.changeFileBufferSync(p,content,opts):this.changeFileTextSync(p,content,opts)}changeFileBufferSync(p,content,{mode}={}){let current=Buffer.alloc(0);try{current=this.readFileSync(p)}catch{}Buffer.compare(current,content)!==0&&this.writeFileSync(p,content,{mode})}changeFileTextSync(p,content,{automaticNewlines=!1,mode}={}){let current="";try{current=this.readFileSync(p,"utf8")}catch{}let normalizedContent=automaticNewlines?normalizeLineEndings(current,content):content;current!==normalizedContent&&this.writeFileSync(p,normalizedContent,{mode})}async movePromise(fromP,toP){try{await this.renamePromise(fromP,toP)}catch(error){if(error.code==="EXDEV")await this.copyPromise(toP,fromP),await this.removePromise(fromP);else throw error}}moveSync(fromP,toP){try{this.renameSync(fromP,toP)}catch(error){if(error.code==="EXDEV")this.copySync(toP,fromP),this.removeSync(fromP);else throw error}}async lockPromise(affectedPath,callback){let lockPath=`${affectedPath}.flock`,interval=1e3/60,startTime=Date.now(),fd=null,isAlive=async()=>{let pid;try{[pid]=await this.readJsonPromise(lockPath)}catch{return Date.now()-startTime<500}try{return process.kill(pid,0),!0}catch{return!1}};for(;fd===null;)try{fd=await this.openPromise(lockPath,"wx")}catch(error){if(error.code==="EEXIST"){if(!await isAlive())try{await this.unlinkPromise(lockPath);continue}catch{}if(Date.now()-startTime<60*1e3)await new Promise(resolve3=>setTimeout(resolve3,interval));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`)}else throw error}await this.writePromise(fd,JSON.stringify([process.pid]));try{return await callback()}finally{try{await this.closePromise(fd),await this.unlinkPromise(lockPath)}catch{}}}async readJsonPromise(p){let content=await this.readFilePromise(p,"utf8");try{return JSON.parse(content)}catch(error){throw error.message+=` (in ${p})`,error}}readJsonSync(p){let content=this.readFileSync(p,"utf8");try{return JSON.parse(content)}catch(error){throw error.message+=` (in ${p})`,error}}async writeJsonPromise(p,data){return await this.writeFilePromise(p,`${JSON.stringify(data,null,2)}
42
42
  `)}writeJsonSync(p,data){return this.writeFileSync(p,`${JSON.stringify(data,null,2)}
43
43
  `)}async preserveTimePromise(p,cb){let stat2=await this.lstatPromise(p),result=await cb();typeof result<"u"&&(p=result),this.lutimesPromise?await this.lutimesPromise(p,stat2.atime,stat2.mtime):stat2.isSymbolicLink()||await this.utimesPromise(p,stat2.atime,stat2.mtime)}async preserveTimeSync(p,cb){let stat2=this.lstatSync(p),result=cb();typeof result<"u"&&(p=result),this.lutimesSync?this.lutimesSync(p,stat2.atime,stat2.mtime):stat2.isSymbolicLink()||this.utimesSync(p,stat2.atime,stat2.mtime)}};exports.FakeFS=FakeFS;var BasePortableFakeFS=class extends FakeFS{constructor(){super(path_1.ppath)}};exports.BasePortableFakeFS=BasePortableFakeFS;function getEndOfLine(content){let matches=content.match(/\r?\n/g);if(matches===null)return os_1.EOL;let crlf=matches.filter(nl=>nl===`\r
44
44
  `).length,lf=matches.length-crlf;return crlf>lf?`\r
@@ -58,7 +58,7 @@ ${this.indexingErrors.map(err=>`- ${err}`).join(`
58
58
  - If so, is it a CSF file (\`.stories.*\`)?
59
59
  - If so, is it matched by the \`stories\` glob in \`main.js\`?
60
60
  - If so, has the file successfully loaded in Storybook and are its stories visible?`)}dependencies.forEach(dep=>{dep.dependents.push(absolutePath)});let title=(csfEntry==null?void 0:csfEntry.title)||(0,import_preview_api.userOrAutoTitleFromSpecifier)(importPath,specifier,result.title);(0,import_tiny_invariant.default)(title,"makeTitle created an undefined title. This happens when a specifier's doesn't have any matches in its fileName");let defaultName=this.options.docs.defaultName??"Docs",name=result.name||(csfEntry?autoName(importPath,csfEntry.importPath,defaultName):defaultName);return{id:(0,import_csf.toId)((csfEntry==null?void 0:csfEntry.metaId)||title,name),title,name,importPath,storiesImports:sortedDependencies.map(dep=>dep.entries[0].importPath),type:"docs",tags:[...result.tags||[],csfEntry?"attached-mdx":"unattached-mdx","docs"]}}catch(err){throw err&&((_a=err.source)!=null&&_a.match(/mdast-util-mdx-jsx/g))&&import_node_logger4.logger.warn(`\u{1F4A1} This seems to be an MDX2 syntax error. Please refer to the MDX section in the following resource for assistance on how to fix this: ${import_chalk4.default.yellow("https://storybook.js.org/migration-guides/7.0")}`),err}}chooseDuplicate(firstEntry,secondEntry){var _a;if(firstEntry.importPath===secondEntry.importPath)return firstEntry;let firstIsBetter=!0;(secondEntry.type==="story"||isMdxEntry(secondEntry)&&firstEntry.type==="docs"&&!isMdxEntry(firstEntry))&&(firstIsBetter=!1);let betterEntry=firstIsBetter?firstEntry:secondEntry,worseEntry=firstIsBetter?secondEntry:firstEntry,changeDocsName='Use `<Meta of={} name="Other Name">` to distinguish them.';if(worseEntry.type==="story")throw new IndexingError(`Duplicate stories with id: ${firstEntry.id}`,[firstEntry.importPath,secondEntry.importPath]);if(betterEntry.type==="story"){let worseDescriptor=isMdxEntry(worseEntry)?"component docs page":"automatically generated docs page";throw betterEntry.name===this.options.docs.defaultName?new IndexingError(`You have a story for ${betterEntry.title} with the same name as your default docs entry name (${betterEntry.name}), so the docs page is being dropped. Consider changing the story name.`,[firstEntry.importPath,secondEntry.importPath]):new IndexingError(`You have a story for ${betterEntry.title} with the same name as your ${worseDescriptor} (${worseEntry.name}), so the docs page is being dropped. ${changeDocsName}`,[firstEntry.importPath,secondEntry.importPath])}else if(isMdxEntry(betterEntry)){if(isMdxEntry(worseEntry))throw new IndexingError(`You have two component docs pages with the same name ${betterEntry.title}:${betterEntry.name}. ${changeDocsName}`,[firstEntry.importPath,secondEntry.importPath]);if((_a=worseEntry.tags)!=null&&_a.includes(AUTODOCS_TAG)&&this.options.docs.autodocs!==!0)throw new IndexingError(`You created a component docs page for '${worseEntry.title}', but also tagged the CSF file with '${AUTODOCS_TAG}'. This is probably a mistake.`,[betterEntry.importPath,worseEntry.importPath])}else return{...betterEntry,storiesImports:[...betterEntry.storiesImports,worseEntry.importPath,...worseEntry.storiesImports]};return betterEntry}async sortStories(entries2){let sortableStories=Object.values(entries2);if(this.options.storyStoreV7){let storySortParameter=await this.getStorySortParameter(),fileNameOrder=this.storyFileNames();(0,import_preview_api.sortStoriesV7)(sortableStories,storySortParameter,fileNameOrder)}return sortableStories.reduce((acc,item)=>(acc[item.id]=item,acc),{})}async getIndex(){if(this.lastIndex)return this.lastIndex;if(this.lastError)throw this.lastError;let storiesList=await this.ensureExtracted();try{let errorEntries=storiesList.filter(entry=>entry.type==="error");if(errorEntries.length)throw new MultipleIndexingError(errorEntries.map(entry=>entry.err));let duplicateErrors=[],indexEntries={};if(storiesList.forEach(entry=>{try{let existing=indexEntries[entry.id];existing?indexEntries[entry.id]=this.chooseDuplicate(existing,entry):indexEntries[entry.id]=entry}catch(err){err instanceof IndexingError&&duplicateErrors.push(err)}}),duplicateErrors.length)throw new MultipleIndexingError(duplicateErrors);let sorted=await this.sortStories(indexEntries),compat=sorted;if(this.options.storiesV2Compatibility){let titleToStoryCount=Object.values(sorted).reduce((acc,story)=>(acc[story.title]=(acc[story.title]||0)+1,acc),{});compat=Object.entries(sorted).reduce((acc,entry)=>{let[id,story]=entry;return story.type==="docs"||(acc[id]={...story,kind:story.title,story:story.name,parameters:{__id:story.id,docsOnly:titleToStoryCount[story.title]===1&&story.name==="Page",fileName:story.importPath}}),acc},{})}return this.lastIndex={v:4,entries:compat},this.lastIndex}catch(err){throw this.lastError=err==null||err instanceof Error?err:void 0,(0,import_tiny_invariant.default)(this.lastError),import_node_logger4.logger.warn(`\u{1F6A8} ${this.lastError.toString()}`),this.lastError}}invalidate(specifier,importPath,removed){let absolutePath=slash(import_path7.default.resolve(this.options.workingDir,importPath)),cache3=this.specifierToCache.get(specifier);(0,import_tiny_invariant.default)(cache3,`specifier does not have a matching cache entry in specifierToCache: ${JSON.stringify(specifier)}`);let cacheEntry=cache3[absolutePath];if(cacheEntry&&cacheEntry.type==="stories"){let{dependents}=cacheEntry,invalidated=new Set;this.specifierToCache.forEach(otherCache=>{dependents.forEach(dep=>{otherCache[dep]&&(invalidated.add(dep),otherCache[dep]=!1)})})}if(removed){if(cacheEntry&&cacheEntry.type==="docs"){let absoluteImports=cacheEntry.storiesImports.map(p=>import_path7.default.resolve(this.options.workingDir,p));this.findDependencies(absoluteImports).forEach(dep=>dep.dependents.splice(dep.dependents.indexOf(absolutePath),1))}delete cache3[absolutePath]}else cache3[absolutePath]=!1;this.lastIndex=null,this.lastError=null}async getStorySortParameter(){let previewFile=["js","jsx","ts","tsx","mjs","cjs"].map(ext=>import_path7.default.join(this.options.configDir,`preview.${ext}`)).find(fname=>import_fs_extra6.default.existsSync(fname)),storySortParameter;if(previewFile){let previewCode=(await import_fs_extra6.default.readFile(previewFile,"utf-8")).toString();storySortParameter=await(0,import_csf_tools.getStorySortParameter)(previewCode)}return storySortParameter}storyFileNames(){return Array.from(this.specifierToCache.values()).flatMap(r2=>Object.keys(r2))}};var PAGE_REGEX=/(page|screen)/i,isPageStory=storyId=>PAGE_REGEX.test(storyId),isCLIExampleEntry=entry=>["example-introduction--docs","configure-your-project--docs","example-button--docs","example-button--primary","example-button--secondary","example-button--large","example-button--small","example-header--docs","example-header--logged-in","example-header--logged-out","example-page--logged-in","example-page--logged-out"].includes(entry.id),isAnyExampleEntry=entry=>entry.id.startsWith("example-button--")||entry.id.startsWith("example-header--")||entry.id.startsWith("example-page--");function summarizeIndex(storyIndex){let storyCount=0,componentTitles=new Set,exampleStoryCount=0,onboardingStoryCount=0,onboardingDocsCount=0,exampleDocsCount=0,pageStoryCount=0,playStoryCount=0,autodocsCount=0,storiesMdxCount=0,mdxCount=0;Object.values(storyIndex.entries).forEach(entry=>{var _a,_b,_c;isCLIExampleEntry(entry)?(entry.type==="story"&&(exampleStoryCount+=1),entry.type==="docs"&&(exampleDocsCount+=1)):isAnyExampleEntry(entry)?(entry.type==="story"&&(onboardingStoryCount+=1),entry.type==="docs"&&(onboardingDocsCount+=1)):entry.type==="story"?(storyCount+=1,componentTitles.add(entry.title),isPageStory(entry.title)&&(pageStoryCount+=1),(_a=entry.tags)!=null&&_a.includes(PLAY_FN_TAG)&&(playStoryCount+=1)):entry.type==="docs"&&(isMdxEntry(entry)?mdxCount+=1:(_b=entry.tags)!=null&&_b.includes(STORIES_MDX_TAG)?storiesMdxCount+=1:(_c=entry.tags)!=null&&_c.includes(AUTODOCS_TAG)&&(autodocsCount+=1))});let componentCount=componentTitles.size;return{storyCount,componentCount,pageStoryCount,playStoryCount,autodocsCount,storiesMdxCount,mdxCount,exampleStoryCount,exampleDocsCount,onboardingStoryCount,onboardingDocsCount,version:storyIndex.v}}var import_server_errors3=require("@storybook/core-events/server-errors");async function buildOrThrow(callback){try{return await callback()}catch(err){let builderErrors=err.errors;throw builderErrors&&builderErrors.find(er=>{var _a;return(_a=er.text)==null?void 0:_a.includes("No matching export")})?new import_server_errors3.NoMatchingExportError(err):err}}async function buildStaticStandalone(options){var _a;if(options.configType="PRODUCTION",options.outputDir==="")throw new Error("Won't remove current directory. Check your outputDir!");if((_a=options.staticDir)!=null&&_a.includes("/"))throw new Error("Won't copy root directory. Check your staticDirs!");if(options.outputDir=(0,import_path8.isAbsolute)(options.outputDir)?options.outputDir:(0,import_path8.join)(process.cwd(),options.outputDir),options.configDir=(0,import_path8.resolve)(options.configDir),import_node_logger5.logger.info(import_chalk5.default`=> Cleaning outputDir: {cyan ${options.outputDir.replace(process.cwd(),"")}}`),options.outputDir==="/")throw new Error("Won't remove directory '/'. Check your outputDir!");await(0,import_fs_extra7.emptyDir)(options.outputDir),await(0,import_fs_extra7.ensureDir)(options.outputDir);let config=await(0,import_core_common5.loadMainConfig)(options),{framework}=config,corePresets=[],frameworkName=typeof framework=="string"?framework:framework==null?void 0:framework.name;frameworkName?corePresets.push((0,import_path8.join)(frameworkName,"preset")):options.ignorePreview||import_node_logger5.logger.warn(`you have not specified a framework in your ${options.configDir}/main.js`),import_node_logger5.logger.info("=> Loading presets");let presets=await(0,import_core_common5.loadAllPresets)({corePresets:[require.resolve("@storybook/core-server/dist/presets/common-preset"),...corePresets],overridePresets:[require.resolve("@storybook/core-server/dist/presets/common-override-preset")],isCritical:!0,...options}),{renderer}=await presets.apply("core",{}),build2=await presets.apply("build",{}),[previewBuilder,managerBuilder]=await getBuilders({...options,presets,build:build2}),resolvedRenderer=renderer?(0,import_core_common5.resolveAddonName)(options.configDir,renderer,options):void 0;presets=await(0,import_core_common5.loadAllPresets)({corePresets:[require.resolve("@storybook/core-server/dist/presets/common-preset"),...managerBuilder.corePresets||[],...previewBuilder.corePresets||[],...resolvedRenderer?[resolvedRenderer]:[],...corePresets,require.resolve("@storybook/core-server/dist/presets/babel-cache-preset")],overridePresets:[...previewBuilder.overridePresets||[],require.resolve("@storybook/core-server/dist/presets/common-override-preset")],...options,build:build2});let[features,core,staticDirs,indexers,deprecatedStoryIndexers,stories,docsOptions]=await Promise.all([presets.apply("features"),presets.apply("core"),presets.apply("staticDirs"),presets.apply("experimental_indexers",[]),presets.apply("storyIndexers",[]),presets.apply("stories"),presets.apply("docs",{})]);(features==null?void 0:features.storyStoreV7)===!1&&(0,import_node_logger5.deprecate)(import_ts_dedent3.default`storyStoreV6 is deprecated, please migrate to storyStoreV7 instead.
61
- - Refer to the migration guide at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#storystorev6-and-storiesof-is-deprecated`);let fullOptions={...options,presets,features,build:build2};if(options.staticDir&&!(0,import_isEqual2.default)(staticDirs,defaultStaticDirs))throw new import_server_errors4.ConflictingStaticDirConfigError;let effects=[];import_global.global.FEATURES=features,await buildOrThrow(async()=>managerBuilder.build({startTime:process.hrtime(),options:fullOptions})),staticDirs&&effects.push(copyAllStaticFilesRelativeToMain(staticDirs,options.outputDir,options.configDir)),options.staticDir&&effects.push(copyAllStaticFiles(options.staticDir,options.outputDir));let coreServerPublicDir=(0,import_path8.join)((0,import_path8.dirname)(require.resolve("@storybook/core-server/package.json")),"public");effects.push((0,import_fs_extra7.copy)(coreServerPublicDir,options.outputDir));let initializedStoryIndexGenerator=Promise.resolve(void 0);if((features!=null&&features.buildStoriesJson||features!=null&&features.storyStoreV7)&&!options.ignorePreview){let workingDir=process.cwd(),directories={configDir:options.configDir,workingDir},normalizedStories=(0,import_core_common5.normalizeStories)(stories,directories),generator=new StoryIndexGenerator(normalizedStories,{...directories,storyIndexers:deprecatedStoryIndexers,indexers,docs:docsOptions,storiesV2Compatibility:!(features!=null&&features.storyStoreV7),storyStoreV7:!!(features!=null&&features.storyStoreV7),build:build2});initializedStoryIndexGenerator=generator.initialize().then(()=>generator),effects.push(extractStoriesJson((0,import_path8.join)(options.outputDir,"stories.json"),initializedStoryIndexGenerator,convertToIndexV3)),effects.push(extractStoriesJson((0,import_path8.join)(options.outputDir,"index.json"),initializedStoryIndexGenerator))}core!=null&&core.disableProjectJson||effects.push(extractStorybookMetadata((0,import_path8.join)(options.outputDir,"project.json"),options.configDir)),options.debugWebpack&&(0,import_core_common5.logConfig)("Preview webpack config",await previewBuilder.getConfig(fullOptions)),options.ignorePreview?import_node_logger5.logger.info("=> Not building preview"):import_node_logger5.logger.info("=> Building preview..");let startTime=process.hrtime();await Promise.all([...options.ignorePreview?[]:[previewBuilder.build({startTime,options:fullOptions}).then(async previewStats=>{if(import_node_logger5.logger.trace({message:"=> Preview built",time:process.hrtime(startTime)}),options.webpackStatsJson){let target=options.webpackStatsJson===!0?options.outputDir:options.webpackStatsJson;await outputStats(target,previewStats)}}).catch(error=>{throw import_node_logger5.logger.error("=> Failed to build the preview"),process.exitCode=1,error})],...effects]),core!=null&&core.disableTelemetry||effects.push(initializedStoryIndexGenerator.then(async generator=>{let storyIndex=await(generator==null?void 0:generator.getIndex()),payload={precedingUpgrade:await(0,import_telemetry2.getPrecedingUpgrade)()};storyIndex&&Object.assign(payload,{storyIndex:summarizeIndex(storyIndex)}),await(0,import_telemetry2.telemetry)("build",payload,{configDir:options.configDir})})),import_node_logger5.logger.info(`=> Output directory: ${options.outputDir}`)}var import_core_common12=require("@storybook/core-common"),import_prompts2=__toESM(require("prompts")),import_tiny_invariant4=__toESM(require("tiny-invariant")),import_global2=require("@storybook/global"),import_telemetry5=require("@storybook/telemetry"),import_path16=require("path"),import_node_logger15=require("@storybook/node-logger"),import_ts_dedent15=__toESM(require("ts-dedent")),import_fs_extra13=require("fs-extra"),import_server_errors6=require("@storybook/core-events/server-errors");var import_express3=__toESM(require("express")),import_compression=__toESM(require("compression")),import_tiny_invariant3=__toESM(require("tiny-invariant")),import_core_common8=require("@storybook/core-common"),import_node_logger10=require("@storybook/node-logger"),import_ts_dedent5=__toESM(require("ts-dedent")),import_server_errors5=require("@storybook/core-events/server-errors");var import_path9=__toESM(require("path")),import_fs2=__toESM(require("fs")),fileExists=basename4=>[".js",".cjs"].reduce((found,ext)=>{let filename=`${basename4}${ext}`;return!found&&import_fs2.default.existsSync(filename)?filename:found},"");function getMiddleware(configDir){let middlewarePath=fileExists(import_path9.default.resolve(configDir,"middleware"));if(middlewarePath){let middlewareModule=require(middlewarePath);return middlewareModule.__esModule&&(middlewareModule=middlewareModule.default),middlewareModule}return()=>{}}var import_ip=__toESM(require("ip")),import_node_logger6=require("@storybook/node-logger"),import_detect_port=__toESM(require("detect-port"));function getServerAddresses(port,host,proto,initialPath){let address=new URL(`${proto}://localhost:${port}/`),networkAddress=new URL(`${proto}://${host||import_ip.default.address()}:${port}/`);if(initialPath){let searchParams=`?path=${decodeURIComponent(initialPath.startsWith("/")?initialPath:`/${initialPath}`)}`;address.search=searchParams,networkAddress.search=searchParams}return{address:address.href,networkAddress:networkAddress.href}}var getServerPort=port=>(0,import_detect_port.default)(port).catch(error=>{import_node_logger6.logger.error(error),process.exit(-1)}),getServerChannelUrl=(port,{https:https4})=>`${https4?"wss":"ws"}://localhost:${port}/storybook-server-channel`;var import_node_logger7=require("@storybook/node-logger"),import_fs_extra8=require("fs-extra"),import_http=__toESM(require("http")),import_https=__toESM(require("https"));async function getServer(app,options){if(!options.https)return import_http.default.createServer(app);options.sslCert||(import_node_logger7.logger.error("Error: --ssl-cert is required with --https"),process.exit(-1)),options.sslKey||(import_node_logger7.logger.error("Error: --ssl-key is required with --https"),process.exit(-1));let sslOptions={ca:await Promise.all((options.sslCa||[]).map(ca=>(0,import_fs_extra8.readFile)(ca,"utf-8"))),cert:await(0,import_fs_extra8.readFile)(options.sslCert,"utf-8"),key:await(0,import_fs_extra8.readFile)(options.sslKey,"utf-8")};return import_https.default.createServer(sslOptions,app)}var import_ws=__toESM(require("ws")),import_telejson=require("telejson"),import_channels=require("@storybook/channels"),ServerChannelTransport=class{constructor(server){this.socket=new import_ws.WebSocketServer({noServer:!0}),server.on("upgrade",(request,socket,head)=>{request.url==="/storybook-server-channel"&&this.socket.handleUpgrade(request,socket,head,ws=>{this.socket.emit("connection",ws,request)})}),this.socket.on("connection",wss=>{wss.on("message",raw=>{var _a;let data=raw.toString(),event=typeof data=="string"&&(0,import_telejson.isJSON)(data)?(0,import_telejson.parse)(data,{allowFunction:!1,allowClass:!1}):data;(_a=this.handler)==null||_a.call(this,event)})})}setHandler(handler){this.handler=handler}send(event){let data=(0,import_telejson.stringify)(event,{maxDepth:15,allowFunction:!1,allowClass:!1});Array.from(this.socket.clients).filter(c=>c.readyState===import_ws.default.OPEN).forEach(client=>client.send(data))}};function getServerChannel(server){let transports=[new ServerChannelTransport(server)];return new import_channels.Channel({transports,async:!0})}var import_node_logger8=require("@storybook/node-logger"),import_better_opn=__toESM(require("better-opn")),import_open=__toESM(require("open")),import_x_default_browser=__toESM(require("@aw-web-design/x-default-browser")),import_ts_dedent4=require("ts-dedent");function openInBrowser(address){let browserEnvVar=process.env.BROWSER,userBrowserIsChrome=browserEnvVar==="chrome"||browserEnvVar==="chromium"||browserEnvVar==="brave"||browserEnvVar==="com.brave.browser",openOptions=browserEnvVar?{app:{name:browserEnvVar}}:{};(0,import_x_default_browser.default)(async(err,res)=>{try{res&&(res.isChrome||res.isChromium||res.identity==="com.brave.browser"||userBrowserIsChrome)?await(0,import_better_opn.default)(address):await(0,import_open.default)(address,openOptions)}catch{import_node_logger8.logger.error(import_ts_dedent4.dedent`
61
+ - Refer to the migration guide at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#storystorev6-and-storiesof-is-deprecated`);let fullOptions={...options,presets,features,build:build2};if(options.staticDir&&!(0,import_isEqual2.default)(staticDirs,defaultStaticDirs))throw new import_server_errors4.ConflictingStaticDirConfigError;let effects=[];import_global.global.FEATURES=features,await buildOrThrow(async()=>managerBuilder.build({startTime:process.hrtime(),options:fullOptions})),staticDirs&&effects.push(copyAllStaticFilesRelativeToMain(staticDirs,options.outputDir,options.configDir)),options.staticDir&&effects.push(copyAllStaticFiles(options.staticDir,options.outputDir));let coreServerPublicDir=(0,import_path8.join)((0,import_path8.dirname)(require.resolve("@storybook/core-server/package.json")),"public");effects.push((0,import_fs_extra7.copy)(coreServerPublicDir,options.outputDir));let initializedStoryIndexGenerator=Promise.resolve(void 0);if((features!=null&&features.buildStoriesJson||features!=null&&features.storyStoreV7)&&!options.ignorePreview){let workingDir=process.cwd(),directories={configDir:options.configDir,workingDir},normalizedStories=(0,import_core_common5.normalizeStories)(stories,directories),generator=new StoryIndexGenerator(normalizedStories,{...directories,storyIndexers:deprecatedStoryIndexers,indexers,docs:docsOptions,storiesV2Compatibility:!(features!=null&&features.storyStoreV7),storyStoreV7:!!(features!=null&&features.storyStoreV7),build:build2});initializedStoryIndexGenerator=generator.initialize().then(()=>generator),effects.push(extractStoriesJson((0,import_path8.join)(options.outputDir,"stories.json"),initializedStoryIndexGenerator,convertToIndexV3)),effects.push(extractStoriesJson((0,import_path8.join)(options.outputDir,"index.json"),initializedStoryIndexGenerator))}core!=null&&core.disableProjectJson||effects.push(extractStorybookMetadata((0,import_path8.join)(options.outputDir,"project.json"),options.configDir)),options.debugWebpack&&(0,import_core_common5.logConfig)("Preview webpack config",await previewBuilder.getConfig(fullOptions)),options.ignorePreview?import_node_logger5.logger.info("=> Not building preview"):import_node_logger5.logger.info("=> Building preview..");let startTime=process.hrtime();await Promise.all([...options.ignorePreview?[]:[previewBuilder.build({startTime,options:fullOptions}).then(async previewStats=>{if(import_node_logger5.logger.trace({message:"=> Preview built",time:process.hrtime(startTime)}),options.webpackStatsJson){let target=options.webpackStatsJson===!0?options.outputDir:options.webpackStatsJson;await outputStats(target,previewStats)}}).catch(error=>{throw import_node_logger5.logger.error("=> Failed to build the preview"),process.exitCode=1,error})],...effects]),core!=null&&core.disableTelemetry||effects.push(initializedStoryIndexGenerator.then(async generator=>{let storyIndex=await(generator==null?void 0:generator.getIndex()),payload={precedingUpgrade:await(0,import_telemetry2.getPrecedingUpgrade)()};storyIndex&&Object.assign(payload,{storyIndex:summarizeIndex(storyIndex)}),await(0,import_telemetry2.telemetry)("build",payload,{configDir:options.configDir})})),import_node_logger5.logger.info(`=> Output directory: ${options.outputDir}`)}var import_core_common12=require("@storybook/core-common"),import_prompts2=__toESM(require("prompts")),import_tiny_invariant4=__toESM(require("tiny-invariant")),import_global2=require("@storybook/global"),import_telemetry5=require("@storybook/telemetry"),import_path16=require("path"),import_node_logger15=require("@storybook/node-logger"),import_ts_dedent15=__toESM(require("ts-dedent")),import_fs_extra13=require("fs-extra"),import_server_errors6=require("@storybook/core-events/server-errors");var import_express3=__toESM(require("express")),import_compression=__toESM(require("compression")),import_tiny_invariant3=__toESM(require("tiny-invariant")),import_core_common8=require("@storybook/core-common"),import_node_logger10=require("@storybook/node-logger"),import_ts_dedent5=__toESM(require("ts-dedent")),import_server_errors5=require("@storybook/core-events/server-errors");var import_path9=__toESM(require("path")),import_fs2=__toESM(require("fs")),fileExists=basename4=>[".js",".cjs"].reduce((found,ext)=>{let filename=`${basename4}${ext}`;return!found&&import_fs2.default.existsSync(filename)?filename:found},"");function getMiddleware(configDir){let middlewarePath=fileExists(import_path9.default.resolve(configDir,"middleware"));if(middlewarePath){let middlewareModule=require(middlewarePath);return middlewareModule.__esModule&&(middlewareModule=middlewareModule.default),middlewareModule}return()=>{}}var import_os=__toESM(require("os")),import_node_logger6=require("@storybook/node-logger"),import_detect_port=__toESM(require("detect-port"));function getServerAddresses(port,host,proto,initialPath){let address=new URL(`${proto}://localhost:${port}/`),networkAddress=new URL(`${proto}://${host||getLocalIp()}:${port}/`);if(initialPath){let searchParams=`?path=${decodeURIComponent(initialPath.startsWith("/")?initialPath:`/${initialPath}`)}`;address.search=searchParams,networkAddress.search=searchParams}return{address:address.href,networkAddress:networkAddress.href}}var getServerPort=port=>(0,import_detect_port.default)(port).catch(error=>{import_node_logger6.logger.error(error),process.exit(-1)}),getServerChannelUrl=(port,{https:https4})=>`${https4?"wss":"ws"}://localhost:${port}/storybook-server-channel`,getLocalIp=()=>{var _a;let allFilteredIps=Object.values(import_os.default.networkInterfaces()).flat().filter(ip=>ip&&ip.family==="IPv4"&&!ip.internal);return allFilteredIps.length?(_a=allFilteredIps[0])==null?void 0:_a.address:"0.0.0.0"};var import_node_logger7=require("@storybook/node-logger"),import_fs_extra8=require("fs-extra"),import_http=__toESM(require("http")),import_https=__toESM(require("https"));async function getServer(app,options){if(!options.https)return import_http.default.createServer(app);options.sslCert||(import_node_logger7.logger.error("Error: --ssl-cert is required with --https"),process.exit(-1)),options.sslKey||(import_node_logger7.logger.error("Error: --ssl-key is required with --https"),process.exit(-1));let sslOptions={ca:await Promise.all((options.sslCa||[]).map(ca=>(0,import_fs_extra8.readFile)(ca,"utf-8"))),cert:await(0,import_fs_extra8.readFile)(options.sslCert,"utf-8"),key:await(0,import_fs_extra8.readFile)(options.sslKey,"utf-8")};return import_https.default.createServer(sslOptions,app)}var import_ws=__toESM(require("ws")),import_telejson=require("telejson"),import_channels=require("@storybook/channels"),ServerChannelTransport=class{constructor(server){this.socket=new import_ws.WebSocketServer({noServer:!0}),server.on("upgrade",(request,socket,head)=>{request.url==="/storybook-server-channel"&&this.socket.handleUpgrade(request,socket,head,ws=>{this.socket.emit("connection",ws,request)})}),this.socket.on("connection",wss=>{wss.on("message",raw=>{var _a;let data=raw.toString(),event=typeof data=="string"&&(0,import_telejson.isJSON)(data)?(0,import_telejson.parse)(data,{allowFunction:!1,allowClass:!1}):data;(_a=this.handler)==null||_a.call(this,event)})})}setHandler(handler){this.handler=handler}send(event){let data=(0,import_telejson.stringify)(event,{maxDepth:15,allowFunction:!1,allowClass:!1});Array.from(this.socket.clients).filter(c=>c.readyState===import_ws.default.OPEN).forEach(client=>client.send(data))}};function getServerChannel(server){let transports=[new ServerChannelTransport(server)];return new import_channels.Channel({transports,async:!0})}var import_node_logger8=require("@storybook/node-logger"),import_better_opn=__toESM(require("better-opn")),import_open=__toESM(require("open")),import_x_default_browser=__toESM(require("@aw-web-design/x-default-browser")),import_ts_dedent4=require("ts-dedent");function openInBrowser(address){let browserEnvVar=process.env.BROWSER,userBrowserIsChrome=browserEnvVar==="chrome"||browserEnvVar==="chromium"||browserEnvVar==="brave"||browserEnvVar==="com.brave.browser",openOptions=browserEnvVar?{app:{name:browserEnvVar}}:{};(0,import_x_default_browser.default)(async(err,res)=>{try{res&&(res.isChrome||res.isChromium||res.identity==="com.brave.browser"||userBrowserIsChrome)?await(0,import_better_opn.default)(address):await(0,import_open.default)(address,openOptions)}catch{import_node_logger8.logger.error(import_ts_dedent4.dedent`
62
62
  Could not open ${address} inside a browser. If you're running this command inside a
63
63
  docker container or on a CI, you need to pass the '--ci' flag to prevent opening a
64
64
  browser by default.
@@ -78,7 +78,7 @@ ${this.indexingErrors.map(err=>`- ${err}`).join(`
78
78
  ${serveMessage.toString()}${updateMessage?`
79
79
 
80
80
  ${updateMessage}`:""}
81
- `,{borderStyle:"round",padding:1,borderColor:"#F1618C"}))}var import_node_logger14=require("@storybook/node-logger"),import_chalk11=__toESM(require("chalk")),import_ts_dedent14=__toESM(require("ts-dedent"));var import_semver9=__toESM(require("semver"));var import_core_common11=require("@storybook/core-common"),import_csf_tools2=require("@storybook/csf-tools"),import_chalk8=__toESM(require("chalk")),import_ts_dedent8=__toESM(require("ts-dedent"));var import_fs_extra9=require("fs-extra"),import_path10=require("path"),import_tempy=__toESM(require_tempy()),import_core_common10=require("@storybook/core-common");var createLogStream=async(logFileName="storybook.log")=>{let finalLogPath=(0,import_path10.join)(process.cwd(),logFileName),temporaryLogPath=import_tempy.default.file({name:logFileName}),logStream=(0,import_fs_extra9.createWriteStream)(temporaryLogPath,{encoding:"utf8"});return new Promise((resolve3,reject)=>{logStream.once("open",()=>{resolve3({logStream,moveLogFile:async()=>(0,import_fs_extra9.move)(temporaryLogPath,finalLogPath,{overwrite:!0}),clearLogFile:async()=>(0,import_fs_extra9.writeFile)(temporaryLogPath,""),removeLogFile:async()=>(0,import_fs_extra9.remove)(temporaryLogPath),readLogFile:async()=>(0,import_fs_extra9.readFile)(temporaryLogPath,"utf8")})}),logStream.once("error",reject)})};var getAddonNames=mainConfig=>(mainConfig.addons||[]).map(addon=>{let name="";if(typeof addon=="string"?name=addon:typeof addon=="object"&&(name=addon.name),!name.startsWith("."))return name.replace(/\/dist\/.*/,"").replace(/\.[mc]?[tj]?s[x]?$/,"").replace(/\/register$/,"").replace(/\/manager$/,"").replace(/\/preset$/,"")}).filter(Boolean);var import_util_deprecate=__toESM(require("util-deprecate")),useNpmWarning=(0,import_util_deprecate.default)(()=>{},"`--use-npm` is deprecated and will be removed in Storybook 8.0. \nPlease use the `--package-manager=npm` option instead.\nRead more at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#cli-option---use-npm-deprecated");var import_node_path2=__toESM(require("path")),import_cross_spawn=__toESM(require_cross_spawn()),import_find_up6=__toESM(require_find_up());var import_sort=__toESM(require("semver/functions/sort")),import_os=require("os"),import_ts_dedent10=__toESM(require("ts-dedent")),import_find_up2=__toESM(require_find_up()),import_fs4=require("fs"),import_path12=__toESM(require("path")),import_semver5=__toESM(require("semver")),import_node_logger13=require("@storybook/node-logger");var import_chalk10=__toESM(require("chalk")),import_semver4=require("semver"),import_execa=__toESM(require_execa()),import_path11=__toESM(require("path")),import_fs3=__toESM(require("fs")),import_ts_dedent9=__toESM(require("ts-dedent")),import_fs_extra11=require("fs-extra");var import_chalk9=__toESM(require("chalk"));var import_fs_extra10=__toESM(require("fs-extra"));var import_semver3=require("semver"),import_strip_json_comments=__toESM(require_strip_json_comments()),import_find_up=__toESM(require_find_up());var import_http2=require("http"),import_https2=require("https"),import_node_events=require("events"),import_node_process=__toESM(require("process"),1),import_node_buffer3=require("buffer"),import_node_stream3=require("stream"),import_node_url3=require("url"),import_node_http3=__toESM(require("http"),1),import_events=require("events"),import_util=require("util"),import_node_events2=__toESM(require("events"),1),import_node_url4=__toESM(require("url"),1),import_node_crypto=__toESM(require("crypto"),1),import_node_stream4=__toESM(require("stream"),1),import_node_stream5=require("stream"),import_node_buffer4=require("buffer"),import_node_util4=require("util"),import_node_net2=__toESM(require("net"),1),import_node_process2=__toESM(require("process"),1),import_node_util5=require("util"),import_node_url5=require("url"),import_node_tls=require("tls"),import_node_http4=__toESM(require("http"),1),import_node_https2=__toESM(require("https"),1),import_node_dns=require("dns"),import_node_util6=require("util"),import_node_os=__toESM(require("os"),1),import_pump=__toESM(require_pump(),1),import_tar_fs=__toESM(require_tar_fs(),1),import_gunzip_maybe=__toESM(require_gunzip_maybe(),1),__create2=Object.create,__defProp2=Object.defineProperty,__getOwnPropDesc2=Object.getOwnPropertyDescriptor,__getOwnPropNames2=Object.getOwnPropertyNames,__getProtoOf2=Object.getPrototypeOf,__hasOwnProp2=Object.prototype.hasOwnProperty,__require=(x2=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x2,{get:(a,b)=>(typeof require<"u"?require:a)[b]}):x2)(function(x2){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+x2+'" is not supported')}),__commonJS2=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames2(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports},__copyProps2=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames2(from))!__hasOwnProp2.call(to,key)&&key!==except&&__defProp2(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc2(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create2(__getProtoOf2(mod)):{},__copyProps2(isNodeMode||!mod||!mod.__esModule?__defProp2(target,"default",{value:mod,enumerable:!0}):target,mod)),require_source=__commonJS2({"node_modules/.pnpm/defer-to-connect@2.0.1/node_modules/defer-to-connect/dist/source/index.js"(exports,module2){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});function isTLSSocket(socket){return socket.encrypted}var deferToConnect2=(socket,fn)=>{let listeners;typeof fn=="function"?listeners={connect:fn}:listeners=fn;let hasConnectListener=typeof listeners.connect=="function",hasSecureConnectListener=typeof listeners.secureConnect=="function",hasCloseListener=typeof listeners.close=="function",onConnect=()=>{hasConnectListener&&listeners.connect(),isTLSSocket(socket)&&hasSecureConnectListener&&(socket.authorized?listeners.secureConnect():socket.authorizationError||socket.once("secureConnect",listeners.secureConnect)),hasCloseListener&&socket.once("close",listeners.close)};socket.writable&&!socket.connecting?onConnect():socket.connecting?socket.once("connect",onConnect):socket.destroyed&&hasCloseListener&&listeners.close(socket._hadError)};exports.default=deferToConnect2,module2.exports=deferToConnect2,module2.exports.default=deferToConnect2}}),require_buffer_stream2=__commonJS2({"node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js"(exports,module2){"use strict";var{PassThrough:PassThroughStream2}=__require("stream");module2.exports=options=>{options={...options};let{array}=options,{encoding}=options,isBuffer=encoding==="buffer",objectMode=!1;array?objectMode=!(encoding||isBuffer):encoding=encoding||"utf8",isBuffer&&(encoding=null);let stream2=new PassThroughStream2({objectMode});encoding&&stream2.setEncoding(encoding);let length=0,chunks=[];return stream2.on("data",chunk=>{chunks.push(chunk),objectMode?length=chunks.length:length+=chunk.length}),stream2.getBufferedValue=()=>array?chunks:isBuffer?Buffer.concat(chunks,length):chunks.join(""),stream2.getBufferedLength=()=>length,stream2}}}),require_get_stream2=__commonJS2({"node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js"(exports,module2){"use strict";var{constants:BufferConstants}=__require("buffer"),stream2=__require("stream"),{promisify:promisify4}=__require("util"),bufferStream=require_buffer_stream2(),streamPipelinePromisified=promisify4(stream2.pipeline),MaxBufferError=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function getStream2(inputStream,options){if(!inputStream)throw new Error("Expected a stream");options={maxBuffer:1/0,...options};let{maxBuffer}=options,stream3=bufferStream(options);return await new Promise((resolve3,reject)=>{let rejectPromise=error=>{error&&stream3.getBufferedLength()<=BufferConstants.MAX_LENGTH&&(error.bufferedData=stream3.getBufferedValue()),reject(error)};(async()=>{try{await streamPipelinePromisified(inputStream,stream3),resolve3()}catch(error){rejectPromise(error)}})(),stream3.on("data",()=>{stream3.getBufferedLength()>maxBuffer&&rejectPromise(new MaxBufferError)})}),stream3.getBufferedValue()}module2.exports=getStream2,module2.exports.buffer=(stream3,options)=>getStream2(stream3,{...options,encoding:"buffer"}),module2.exports.array=(stream3,options)=>getStream2(stream3,{...options,array:!0}),module2.exports.MaxBufferError=MaxBufferError}}),require_http_cache_semantics=__commonJS2({"node_modules/.pnpm/http-cache-semantics@4.1.1/node_modules/http-cache-semantics/index.js"(exports,module2){"use strict";var statusCodeCacheableByDefault=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),understoodStatuses=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),errorStatusCodes=new Set([500,502,503,504]),hopByHopHeaders={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},excludedFromRevalidationUpdate={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function toNumberOrZero(s2){let n=parseInt(s2,10);return isFinite(n)?n:0}function isErrorResponse(response){return response?errorStatusCodes.has(response.status):!0}function parseCacheControl(header){let cc={};if(!header)return cc;let parts=header.trim().split(/,/);for(let part of parts){let[k,v]=part.split(/=/,2);cc[k.trim()]=v===void 0?!0:v.trim().replace(/^"|"$/g,"")}return cc}function formatCacheControl(cc){let parts=[];for(let k in cc){let v=cc[k];parts.push(v===!0?k:k+"="+v)}if(parts.length)return parts.join(", ")}module2.exports=class{constructor(req,res,{shared,cacheHeuristic,immutableMinTimeToLive,ignoreCargoCult,_fromObject}={}){if(_fromObject){this._fromObject(_fromObject);return}if(!res||!res.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(req),this._responseTime=this.now(),this._isShared=shared!==!1,this._cacheHeuristic=cacheHeuristic!==void 0?cacheHeuristic:.1,this._immutableMinTtl=immutableMinTimeToLive!==void 0?immutableMinTimeToLive:24*3600*1e3,this._status="status"in res?res.status:200,this._resHeaders=res.headers,this._rescc=parseCacheControl(res.headers["cache-control"]),this._method="method"in req?req.method:"GET",this._url=req.url,this._host=req.headers.host,this._noAuthorization=!req.headers.authorization,this._reqHeaders=res.headers.vary?req.headers:null,this._reqcc=parseCacheControl(req.headers["cache-control"]),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":formatCacheControl(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),res.headers["cache-control"]==null&&/no-cache/.test(res.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())&&understoodStatuses.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||statusCodeCacheableByDefault.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(req){if(!req||!req.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(req){this._assertRequestHasHeaders(req);let requestCC=parseCacheControl(req.headers["cache-control"]);return requestCC["no-cache"]||/no-cache/.test(req.headers.pragma)||requestCC["max-age"]&&this.age()>requestCC["max-age"]||requestCC["min-fresh"]&&this.timeToLive()<1e3*requestCC["min-fresh"]||this.stale()&&!(requestCC["max-stale"]&&!this._rescc["must-revalidate"]&&(requestCC["max-stale"]===!0||requestCC["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(req,!1)}_requestMatches(req,allowHeadMethod){return(!this._url||this._url===req.url)&&this._host===req.headers.host&&(!req.method||this._method===req.method||allowHeadMethod&&req.method==="HEAD")&&this._varyMatches(req)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(req){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let fields=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let name of fields)if(req.headers[name]!==this._reqHeaders[name])return!1;return!0}_copyWithoutHopByHopHeaders(inHeaders){let headers={};for(let name in inHeaders)hopByHopHeaders[name]||(headers[name]=inHeaders[name]);if(inHeaders.connection){let tokens=inHeaders.connection.trim().split(/\s*,\s*/);for(let name of tokens)delete headers[name]}if(headers.warning){let warnings=headers.warning.split(/,/).filter(warning=>!/^\s*1[0-9][0-9]/.test(warning));warnings.length?headers.warning=warnings.join(",").trim():delete headers.warning}return headers}responseHeaders(){let headers=this._copyWithoutHopByHopHeaders(this._resHeaders),age=this.age();return age>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(headers.warning=(headers.warning?`${headers.warning}, `:"")+'113 - "rfc7234 5.5.4"'),headers.age=`${Math.round(age)}`,headers.date=new Date(this.now()).toUTCString(),headers}date(){let serverDate=Date.parse(this._resHeaders.date);return isFinite(serverDate)?serverDate:this._responseTime}age(){let age=this._ageValue(),residentTime=(this.now()-this._responseTime)/1e3;return age+residentTime}_ageValue(){return toNumberOrZero(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 toNumberOrZero(this._rescc["s-maxage"])}if(this._rescc["max-age"])return toNumberOrZero(this._rescc["max-age"]);let defaultMinTtl=this._rescc.immutable?this._immutableMinTtl:0,serverDate=this.date();if(this._resHeaders.expires){let expires=Date.parse(this._resHeaders.expires);return Number.isNaN(expires)||expires<serverDate?0:Math.max(defaultMinTtl,(expires-serverDate)/1e3)}if(this._resHeaders["last-modified"]){let lastModified=Date.parse(this._resHeaders["last-modified"]);if(isFinite(lastModified)&&serverDate>lastModified)return Math.max(defaultMinTtl,(serverDate-lastModified)/1e3*this._cacheHeuristic)}return defaultMinTtl}timeToLive(){let age=this.maxAge()-this.age(),staleIfErrorAge=age+toNumberOrZero(this._rescc["stale-if-error"]),staleWhileRevalidateAge=age+toNumberOrZero(this._rescc["stale-while-revalidate"]);return Math.max(0,age,staleIfErrorAge,staleWhileRevalidateAge)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+toNumberOrZero(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+toNumberOrZero(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(obj){return new this(void 0,void 0,{_fromObject:obj})}_fromObject(obj){if(this._responseTime)throw Error("Reinitialized");if(!obj||obj.v!==1)throw Error("Invalid serialization");this._responseTime=obj.t,this._isShared=obj.sh,this._cacheHeuristic=obj.ch,this._immutableMinTtl=obj.imm!==void 0?obj.imm:24*3600*1e3,this._status=obj.st,this._resHeaders=obj.resh,this._rescc=obj.rescc,this._method=obj.m,this._url=obj.u,this._host=obj.h,this._noAuthorization=obj.a,this._reqHeaders=obj.reqh,this._reqcc=obj.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(incomingReq){this._assertRequestHasHeaders(incomingReq);let headers=this._copyWithoutHopByHopHeaders(incomingReq.headers);if(delete headers["if-range"],!this._requestMatches(incomingReq,!0)||!this.storable())return delete headers["if-none-match"],delete headers["if-modified-since"],headers;if(this._resHeaders.etag&&(headers["if-none-match"]=headers["if-none-match"]?`${headers["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),headers["accept-ranges"]||headers["if-match"]||headers["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete headers["if-modified-since"],headers["if-none-match"]){let etags=headers["if-none-match"].split(/,/).filter(etag=>!/^\s*W\//.test(etag));etags.length?headers["if-none-match"]=etags.join(",").trim():delete headers["if-none-match"]}}else this._resHeaders["last-modified"]&&!headers["if-modified-since"]&&(headers["if-modified-since"]=this._resHeaders["last-modified"]);return headers}revalidatedPolicy(request,response){if(this._assertRequestHasHeaders(request),this._useStaleIfError()&&isErrorResponse(response))return{modified:!1,matches:!1,policy:this};if(!response||!response.headers)throw Error("Response headers missing");let matches=!1;if(response.status!==void 0&&response.status!=304?matches=!1:response.headers.etag&&!/^\s*W\//.test(response.headers.etag)?matches=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===response.headers.etag:this._resHeaders.etag&&response.headers.etag?matches=this._resHeaders.etag.replace(/^\s*W\//,"")===response.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?matches=this._resHeaders["last-modified"]===response.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!response.headers.etag&&!response.headers["last-modified"]&&(matches=!0),!matches)return{policy:new this.constructor(request,response),modified:response.status!=304,matches:!1};let headers={};for(let k in this._resHeaders)headers[k]=k in response.headers&&!excludedFromRevalidationUpdate[k]?response.headers[k]:this._resHeaders[k];let newResponse=Object.assign({},response,{status:this._status,method:this._method,headers});return{policy:new this.constructor(request,newResponse,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}}),require_json_buffer=__commonJS2({"node_modules/.pnpm/json-buffer@3.0.1/node_modules/json-buffer/index.js"(exports){exports.stringify=function stringify2(o){if(typeof o>"u")return o;if(o&&Buffer.isBuffer(o))return JSON.stringify(":base64:"+o.toString("base64"));if(o&&o.toJSON&&(o=o.toJSON()),o&&typeof o=="object"){var s2="",array=Array.isArray(o);s2=array?"[":"{";var first=!0;for(var k in o){var ignore=typeof o[k]=="function"||!array&&typeof o[k]>"u";Object.hasOwnProperty.call(o,k)&&!ignore&&(first||(s2+=","),first=!1,array?o[k]==null?s2+="null":s2+=stringify2(o[k]):o[k]!==void 0&&(s2+=stringify2(k)+":"+stringify2(o[k])))}return s2+=array?"]":"}",s2}else return typeof o=="string"?JSON.stringify(/^:/.test(o)?":"+o:o):typeof o>"u"?"null":JSON.stringify(o)},exports.parse=function(s2){return JSON.parse(s2,function(key,value){return typeof value=="string"?/^:base64:/.test(value)?Buffer.from(value.substring(8),"base64"):/^:/.test(value)?value.substring(1):value:value})}}}),require_src=__commonJS2({"node_modules/.pnpm/keyv@4.5.2/node_modules/keyv/src/index.js"(exports,module2){"use strict";var EventEmitter3=__require("events"),JSONB=require_json_buffer(),loadStore=options=>{let adapters={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(options.adapter||options.uri){let adapter=options.adapter||/^[^:+]*/.exec(options.uri)[0];return new(__require(adapters[adapter]))(options)}return new Map},iterableAdapters=["sqlite","postgres","mysql","mongo","redis","tiered"],Keyv2=class extends EventEmitter3{constructor(uri,{emitErrors=!0,...options}={}){if(super(),this.opts={namespace:"keyv",serialize:JSONB.stringify,deserialize:JSONB.parse,...typeof uri=="string"?{uri}:uri,...options},!this.opts.store){let adapterOptions={...this.opts};this.opts.store=loadStore(adapterOptions)}if(this.opts.compression){let compression2=this.opts.compression;this.opts.serialize=compression2.serialize.bind(compression2),this.opts.deserialize=compression2.deserialize.bind(compression2)}typeof this.opts.store.on=="function"&&emitErrors&&this.opts.store.on("error",error=>this.emit("error",error)),this.opts.store.namespace=this.opts.namespace;let generateIterator=iterator=>async function*(){for await(let[key,raw]of typeof iterator=="function"?iterator(this.opts.store.namespace):iterator){let data=this.opts.deserialize(raw);if(!(this.opts.store.namespace&&!key.includes(this.opts.store.namespace))){if(typeof data.expires=="number"&&Date.now()>data.expires){this.delete(key);continue}yield[this._getKeyUnprefix(key),data.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=generateIterator(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=generateIterator(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return iterableAdapters.includes(this.opts.store.opts.dialect)||iterableAdapters.findIndex(element=>this.opts.store.opts.url.includes(element))>=0}_getKeyPrefix(key){return`${this.opts.namespace}:${key}`}_getKeyPrefixArray(keys){return keys.map(key=>`${this.opts.namespace}:${key}`)}_getKeyUnprefix(key){return key.split(":").splice(1).join(":")}get(key,options){let{store}=this.opts,isArray=Array.isArray(key),keyPrefixed=isArray?this._getKeyPrefixArray(key):this._getKeyPrefix(key);if(isArray&&store.getMany===void 0){let promises=[];for(let key2 of keyPrefixed)promises.push(Promise.resolve().then(()=>store.get(key2)).then(data=>typeof data=="string"?this.opts.deserialize(data):this.opts.compression?this.opts.deserialize(data):data).then(data=>{if(data!=null)return typeof data.expires=="number"&&Date.now()>data.expires?this.delete(key2).then(()=>{}):options&&options.raw?data:data.value}));return Promise.allSettled(promises).then(values=>{let data=[];for(let value of values)data.push(value.value);return data})}return Promise.resolve().then(()=>isArray?store.getMany(keyPrefixed):store.get(keyPrefixed)).then(data=>typeof data=="string"?this.opts.deserialize(data):this.opts.compression?this.opts.deserialize(data):data).then(data=>{if(data!=null){if(isArray){let result=[];for(let row of data){if(typeof row=="string"&&(row=this.opts.deserialize(row)),row==null){result.push(void 0);continue}typeof row.expires=="number"&&Date.now()>row.expires?(this.delete(key).then(()=>{}),result.push(void 0)):result.push(options&&options.raw?row:row.value)}return result}return typeof data.expires=="number"&&Date.now()>data.expires?this.delete(key).then(()=>{}):options&&options.raw?data:data.value}})}set(key,value,ttl2){let keyPrefixed=this._getKeyPrefix(key);typeof ttl2>"u"&&(ttl2=this.opts.ttl),ttl2===0&&(ttl2=void 0);let{store}=this.opts;return Promise.resolve().then(()=>{let expires=typeof ttl2=="number"?Date.now()+ttl2:null;return typeof value=="symbol"&&this.emit("error","symbol cannot be serialized"),value={value,expires},this.opts.serialize(value)}).then(value2=>store.set(keyPrefixed,value2,ttl2)).then(()=>!0)}delete(key){let{store}=this.opts;if(Array.isArray(key)){let keyPrefixed2=this._getKeyPrefixArray(key);if(store.deleteMany===void 0){let promises=[];for(let key2 of keyPrefixed2)promises.push(store.delete(key2));return Promise.allSettled(promises).then(values=>values.every(x2=>x2.value===!0))}return Promise.resolve().then(()=>store.deleteMany(keyPrefixed2))}let keyPrefixed=this._getKeyPrefix(key);return Promise.resolve().then(()=>store.delete(keyPrefixed))}clear(){let{store}=this.opts;return Promise.resolve().then(()=>store.clear())}has(key){let keyPrefixed=this._getKeyPrefix(key),{store}=this.opts;return Promise.resolve().then(async()=>typeof store.has=="function"?store.has(keyPrefixed):await store.get(keyPrefixed)!==void 0)}disconnect(){let{store}=this.opts;if(typeof store.disconnect=="function")return store.disconnect()}};module2.exports=Keyv2}}),require_mimic_response=__commonJS2({"node_modules/.pnpm/mimic-response@3.1.0/node_modules/mimic-response/index.js"(exports,module2){"use strict";var knownProperties2=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];module2.exports=(fromStream,toStream)=>{if(toStream._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let fromProperties=new Set(Object.keys(fromStream).concat(knownProperties2)),properties={};for(let property of fromProperties)property in toStream||(properties[property]={get(){let value=fromStream[property];return typeof value=="function"?value.bind(fromStream):value},set(value){fromStream[property]=value},enumerable:!0,configurable:!1});return Object.defineProperties(toStream,properties),fromStream.once("aborted",()=>{toStream.destroy(),toStream.emit("aborted")}),fromStream.once("close",()=>{fromStream.complete&&toStream.readable?toStream.once("end",()=>{toStream.emit("close")}):toStream.emit("close")}),toStream}}}),require_decompress_response=__commonJS2({"node_modules/.pnpm/decompress-response@6.0.0/node_modules/decompress-response/index.js"(exports,module2){"use strict";var{Transform,PassThrough:PassThrough3}=__require("stream"),zlib2=__require("zlib"),mimicResponse2=require_mimic_response();module2.exports=response=>{let contentEncoding=(response.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(contentEncoding))return response;let isBrotli=contentEncoding==="br";if(isBrotli&&typeof zlib2.createBrotliDecompress!="function")return response.destroy(new Error("Brotli is not supported on Node.js < 12")),response;let isEmpty=!0,checker=new Transform({transform(data,_encoding,callback){isEmpty=!1,callback(null,data)},flush(callback){callback()}}),finalStream=new PassThrough3({autoDestroy:!1,destroy(error,callback){response.destroy(),callback(error)}}),decompressStream=isBrotli?zlib2.createBrotliDecompress():zlib2.createUnzip();return decompressStream.once("error",error=>{if(isEmpty&&!response.readable){finalStream.end();return}finalStream.destroy(error)}),mimicResponse2(response,finalStream),response.pipe(checker).pipe(decompressStream).pipe(finalStream),finalStream}}}),require_quick_lru=__commonJS2({"node_modules/.pnpm/quick-lru@5.1.1/node_modules/quick-lru/index.js"(exports,module2){"use strict";var QuickLRU=class{constructor(options={}){if(!(options.maxSize&&options.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=options.maxSize,this.onEviction=options.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(key,value){if(this.cache.set(key,value),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[key2,value2]of this.oldCache.entries())this.onEviction(key2,value2);this.oldCache=this.cache,this.cache=new Map}}get(key){if(this.cache.has(key))return this.cache.get(key);if(this.oldCache.has(key)){let value=this.oldCache.get(key);return this.oldCache.delete(key),this._set(key,value),value}}set(key,value){return this.cache.has(key)?this.cache.set(key,value):this._set(key,value),this}has(key){return this.cache.has(key)||this.oldCache.has(key)}peek(key){if(this.cache.has(key))return this.cache.get(key);if(this.oldCache.has(key))return this.oldCache.get(key)}delete(key){let deleted=this.cache.delete(key);return deleted&&this._size--,this.oldCache.delete(key)||deleted}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[key]of this)yield key}*values(){for(let[,value]of this)yield value}*[Symbol.iterator](){for(let item of this.cache)yield item;for(let item of this.oldCache){let[key]=item;this.cache.has(key)||(yield item)}}get size(){let oldCacheSize=0;for(let key of this.oldCache.keys())this.cache.has(key)||oldCacheSize++;return Math.min(this._size+oldCacheSize,this.maxSize)}};module2.exports=QuickLRU}}),require_delay_async_destroy=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/delay-async-destroy.js"(exports,module2){"use strict";module2.exports=stream2=>{if(stream2.listenerCount("error")!==0)return stream2;stream2.__destroy=stream2._destroy,stream2._destroy=(...args)=>{let callback=args.pop();stream2.__destroy(...args,async error=>{await Promise.resolve(),callback(error)})};let onError=error=>{Promise.resolve().then(()=>{stream2.emit("error",error)})};return stream2.once("error",onError),Promise.resolve().then(()=>{stream2.off("error",onError)}),stream2}}}),require_agent=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/agent.js"(exports,module2){"use strict";var{URL:URL4}=__require("url"),EventEmitter3=__require("events"),tls=__require("tls"),http222=__require("http2"),QuickLRU=require_quick_lru(),delayAsyncDestroy=require_delay_async_destroy(),kCurrentStreamCount=Symbol("currentStreamCount"),kRequest=Symbol("request"),kOriginSet=Symbol("cachedOriginSet"),kGracefullyClosing=Symbol("gracefullyClosing"),kLength=Symbol("length"),nameKeys=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"],getSortedIndex=(array,value,compare)=>{let low=0,high=array.length;for(;low<high;){let mid=low+high>>>1;compare(array[mid],value)?low=mid+1:high=mid}return low},compareSessions=(a,b)=>a.remoteSettings.maxConcurrentStreams>b.remoteSettings.maxConcurrentStreams,closeCoveredSessions=(where,session)=>{for(let index=0;index<where.length;index++){let coveredSession=where[index];coveredSession[kOriginSet].length>0&&coveredSession[kOriginSet].length<session[kOriginSet].length&&coveredSession[kOriginSet].every(origin=>session[kOriginSet].includes(origin))&&coveredSession[kCurrentStreamCount]+session[kCurrentStreamCount]<=session.remoteSettings.maxConcurrentStreams&&gracefullyClose(coveredSession)}},closeSessionIfCovered=(where,coveredSession)=>{for(let index=0;index<where.length;index++){let session=where[index];if(coveredSession[kOriginSet].length>0&&coveredSession[kOriginSet].length<session[kOriginSet].length&&coveredSession[kOriginSet].every(origin=>session[kOriginSet].includes(origin))&&coveredSession[kCurrentStreamCount]+session[kCurrentStreamCount]<=session.remoteSettings.maxConcurrentStreams)return gracefullyClose(coveredSession),!0}return!1},gracefullyClose=session=>{session[kGracefullyClosing]=!0,session[kCurrentStreamCount]===0&&session.close()},Agent=class extends EventEmitter3{constructor({timeout=0,maxSessions=Number.POSITIVE_INFINITY,maxEmptySessions=10,maxCachedTlsSessions=100}={}){super(),this.sessions={},this.queue={},this.timeout=timeout,this.maxSessions=maxSessions,this.maxEmptySessions=maxEmptySessions,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new QuickLRU({maxSize:maxCachedTlsSessions})}get protocol(){return"https:"}normalizeOptions(options){let normalized="";for(let index=0;index<nameKeys.length;index++){let key=nameKeys[index];normalized+=":",options&&options[key]!==void 0&&(normalized+=options[key])}return normalized}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let normalizedOptions in this.queue)for(let normalizedOrigin in this.queue[normalizedOptions]){let item=this.queue[normalizedOptions][normalizedOrigin];item.completed||(item.completed=!0,item())}}_isBetterSession(thisStreamCount,thatStreamCount){return thisStreamCount>thatStreamCount}_accept(session,listeners,normalizedOrigin,options){let index=0;for(;index<listeners.length&&session[kCurrentStreamCount]<session.remoteSettings.maxConcurrentStreams;)listeners[index].resolve(session),index++;listeners.splice(0,index),listeners.length>0&&(this.getSession(normalizedOrigin,options,listeners),listeners.length=0)}getSession(origin,options,listeners){return new Promise((resolve3,reject)=>{Array.isArray(listeners)&&listeners.length>0?(listeners=[...listeners],resolve3()):listeners=[{resolve:resolve3,reject}];try{if(typeof origin=="string")origin=new URL4(origin);else if(!(origin instanceof URL4))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(options){let{servername}=options,{hostname}=origin;if(servername&&hostname!==servername)throw new Error(`Origin ${hostname} differs from servername ${servername}`)}}catch(error){for(let index=0;index<listeners.length;index++)listeners[index].reject(error);return}let normalizedOptions=this.normalizeOptions(options),normalizedOrigin=origin.origin;if(normalizedOptions in this.sessions){let sessions=this.sessions[normalizedOptions],maxConcurrentStreams=-1,currentStreamsCount=-1,optimalSession;for(let index=0;index<sessions.length;index++){let session=sessions[index],sessionMaxConcurrentStreams=session.remoteSettings.maxConcurrentStreams;if(sessionMaxConcurrentStreams<maxConcurrentStreams)break;if(!session[kOriginSet].includes(normalizedOrigin))continue;let sessionCurrentStreamsCount=session[kCurrentStreamCount];sessionCurrentStreamsCount>=sessionMaxConcurrentStreams||session[kGracefullyClosing]||session.destroyed||(optimalSession||(maxConcurrentStreams=sessionMaxConcurrentStreams),this._isBetterSession(sessionCurrentStreamsCount,currentStreamsCount)&&(optimalSession=session,currentStreamsCount=sessionCurrentStreamsCount))}if(optimalSession){this._accept(optimalSession,listeners,normalizedOrigin,options);return}}if(normalizedOptions in this.queue){if(normalizedOrigin in this.queue[normalizedOptions]){this.queue[normalizedOptions][normalizedOrigin].listeners.push(...listeners);return}}else this.queue[normalizedOptions]={[kLength]:0};let removeFromQueue=()=>{normalizedOptions in this.queue&&this.queue[normalizedOptions][normalizedOrigin]===entry&&(delete this.queue[normalizedOptions][normalizedOrigin],--this.queue[normalizedOptions][kLength]===0&&delete this.queue[normalizedOptions])},entry=async()=>{this._sessionCount++;let name=`${normalizedOrigin}:${normalizedOptions}`,receivedSettings=!1,socket;try{let computedOptions={...options};computedOptions.settings===void 0&&(computedOptions.settings=this.settings),computedOptions.session===void 0&&(computedOptions.session=this.tlsSessionCache.get(name)),socket=await(computedOptions.createConnection||this.createConnection).call(this,origin,computedOptions),computedOptions.createConnection=()=>socket;let session=http222.connect(origin,computedOptions);session[kCurrentStreamCount]=0,session[kGracefullyClosing]=!1;let getOriginSet=()=>{let{socket:socket2}=session,originSet;return socket2.servername===!1?(socket2.servername=socket2.remoteAddress,originSet=session.originSet,socket2.servername=!1):originSet=session.originSet,originSet},isFree=()=>session[kCurrentStreamCount]<session.remoteSettings.maxConcurrentStreams;session.socket.once("session",tlsSession=>{this.tlsSessionCache.set(name,tlsSession)}),session.once("error",error=>{for(let index=0;index<listeners.length;index++)listeners[index].reject(error);this.tlsSessionCache.delete(name)}),session.setTimeout(this.timeout,()=>{session.destroy()}),session.once("close",()=>{if(this._sessionCount--,receivedSettings){this._emptySessionCount--;let where=this.sessions[normalizedOptions];where.length===1?delete this.sessions[normalizedOptions]:where.splice(where.indexOf(session),1)}else{removeFromQueue();let error=new Error("Session closed without receiving a SETTINGS frame");error.code="HTTP2WRAPPER_NOSETTINGS";for(let index=0;index<listeners.length;index++)listeners[index].reject(error)}this._processQueue()});let processListeners=()=>{let queue=this.queue[normalizedOptions];if(!queue)return;let originSet=session[kOriginSet];for(let index=0;index<originSet.length;index++){let origin2=originSet[index];if(origin2 in queue){let{listeners:listeners2,completed}=queue[origin2],index2=0;for(;index2<listeners2.length&&isFree();)listeners2[index2].resolve(session),index2++;if(queue[origin2].listeners.splice(0,index2),queue[origin2].listeners.length===0&&!completed&&(delete queue[origin2],--queue[kLength]===0)){delete this.queue[normalizedOptions];break}if(!isFree())break}}};session.on("origin",()=>{session[kOriginSet]=getOriginSet()||[],session[kGracefullyClosing]=!1,closeSessionIfCovered(this.sessions[normalizedOptions],session),!(session[kGracefullyClosing]||!isFree())&&(processListeners(),isFree()&&closeCoveredSessions(this.sessions[normalizedOptions],session))}),session.once("remoteSettings",()=>{if(entry.destroyed){let error=new Error("Agent has been destroyed");for(let index=0;index<listeners.length;index++)listeners[index].reject(error);session.destroy();return}if(session.setLocalWindowSize&&session.setLocalWindowSize(1024*1024*4),session[kOriginSet]=getOriginSet()||[],session.socket.encrypted){let mainOrigin=session[kOriginSet][0];if(mainOrigin!==normalizedOrigin){let error=new Error(`Requested origin ${normalizedOrigin} does not match server ${mainOrigin}`);for(let index=0;index<listeners.length;index++)listeners[index].reject(error);session.destroy();return}}removeFromQueue();{let where=this.sessions;if(normalizedOptions in where){let sessions=where[normalizedOptions];sessions.splice(getSortedIndex(sessions,session,compareSessions),0,session)}else where[normalizedOptions]=[session]}receivedSettings=!0,this._emptySessionCount++,this.emit("session",session),this._accept(session,listeners,normalizedOrigin,options),session[kCurrentStreamCount]===0&&this._emptySessionCount>this.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),session.on("remoteSettings",()=>{isFree()&&(processListeners(),isFree()&&closeCoveredSessions(this.sessions[normalizedOptions],session))})}),session[kRequest]=session.request,session.request=(headers,streamOptions)=>{if(session[kGracefullyClosing])throw new Error("The session is gracefully closing. No new streams are allowed.");let stream2=session[kRequest](headers,streamOptions);return session.ref(),session[kCurrentStreamCount]++===0&&this._emptySessionCount--,stream2.once("close",()=>{if(--session[kCurrentStreamCount]===0&&(this._emptySessionCount++,session.unref(),this._emptySessionCount>this.maxEmptySessions||session[kGracefullyClosing])){session.close();return}session.destroyed||session.closed||isFree()&&!closeSessionIfCovered(this.sessions[normalizedOptions],session)&&(closeCoveredSessions(this.sessions[normalizedOptions],session),processListeners(),session[kCurrentStreamCount]===0&&this._processQueue())}),stream2}}catch(error){removeFromQueue(),this._sessionCount--;for(let index=0;index<listeners.length;index++)listeners[index].reject(error)}};entry.listeners=listeners,entry.completed=!1,entry.destroyed=!1,this.queue[normalizedOptions][normalizedOrigin]=entry,this.queue[normalizedOptions][kLength]++,this._processQueue()})}request(origin,options,headers,streamOptions){return new Promise((resolve3,reject)=>{this.getSession(origin,options,[{reject,resolve:session=>{try{let stream2=session.request(headers,streamOptions);delayAsyncDestroy(stream2),resolve3(stream2)}catch(error){reject(error)}}}])})}async createConnection(origin,options){return Agent.connect(origin,options)}static connect(origin,options){options.ALPNProtocols=["h2"];let port=origin.port||443,host=origin.hostname;typeof options.servername>"u"&&(options.servername=host);let socket=tls.connect(port,host,options);return options.socket&&(socket._peername={family:void 0,address:void 0,port}),socket}closeEmptySessions(maxCount=Number.POSITIVE_INFINITY){let closedCount=0,{sessions}=this;for(let key in sessions){let thisSessions=sessions[key];for(let index=0;index<thisSessions.length;index++){let session=thisSessions[index];if(session[kCurrentStreamCount]===0&&(closedCount++,session.close(),closedCount>=maxCount))return closedCount}}return closedCount}destroy(reason){let{sessions,queue}=this;for(let key in sessions){let thisSessions=sessions[key];for(let index=0;index<thisSessions.length;index++)thisSessions[index].destroy(reason)}for(let normalizedOptions in queue){let entries2=queue[normalizedOptions];for(let normalizedOrigin in entries2)entries2[normalizedOrigin].destroyed=!0}this.queue={},this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}};Agent.kCurrentStreamCount=kCurrentStreamCount,Agent.kGracefullyClosing=kGracefullyClosing,module2.exports={Agent,globalAgent:new Agent}}}),require_incoming_message=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/incoming-message.js"(exports,module2){"use strict";var{Readable}=__require("stream"),IncomingMessage=class extends Readable{constructor(socket,highWaterMark){super({emitClose:!1,autoDestroy:!0,highWaterMark}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=socket,this._dumped=!1}get connection(){return this.socket}set connection(value){this.socket=value}_destroy(error,callback){this.readableEnded||(this.aborted=!0),callback(),this.req._request.destroy(error)}setTimeout(ms,callback){return this.req.setTimeout(ms,callback),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};module2.exports=IncomingMessage}}),require_proxy_events=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/proxy-events.js"(exports,module2){"use strict";module2.exports=(from,to,events)=>{for(let event of events)from.on(event,(...args)=>to.emit(event,...args))}}}),require_errors2=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/errors.js"(exports,module2){"use strict";var makeError=(Base,key,getMessage)=>{module2.exports[key]=class extends Base{constructor(...args){super(typeof getMessage=="string"?getMessage:getMessage(args)),this.name=`${super.name} [${key}]`,this.code=key}}};makeError(TypeError,"ERR_INVALID_ARG_TYPE",args=>{let type=args[0].includes(".")?"property":"argument",valid=args[1],isManyTypes=Array.isArray(valid);return isManyTypes&&(valid=`${valid.slice(0,-1).join(", ")} or ${valid.slice(-1)}`),`The "${args[0]}" ${type} must be ${isManyTypes?"one of":"of"} type ${valid}. Received ${typeof args[2]}`}),makeError(TypeError,"ERR_INVALID_PROTOCOL",args=>`Protocol "${args[0]}" not supported. Expected "${args[1]}"`),makeError(Error,"ERR_HTTP_HEADERS_SENT",args=>`Cannot ${args[0]} headers after they are sent to the client`),makeError(TypeError,"ERR_INVALID_HTTP_TOKEN",args=>`${args[0]} must be a valid HTTP token [${args[1]}]`),makeError(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",args=>`Invalid value "${args[0]} for header "${args[1]}"`),makeError(TypeError,"ERR_INVALID_CHAR",args=>`Invalid character in ${args[0]} [${args[1]}]`),makeError(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")}}),require_is_request_pseudo_header=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js"(exports,module2){"use strict";module2.exports=header=>{switch(header){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}}}),require_validate_header_name=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/validate-header-name.js"(exports,module2){"use strict";var{ERR_INVALID_HTTP_TOKEN}=require_errors2(),isRequestPseudoHeader=require_is_request_pseudo_header(),isValidHttpToken=/^[\^`\-\w!#$%&*+.|~]+$/;module2.exports=name=>{if(typeof name!="string"||!isValidHttpToken.test(name)&&!isRequestPseudoHeader(name))throw new ERR_INVALID_HTTP_TOKEN("Header name",name)}}}),require_validate_header_value=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/validate-header-value.js"(exports,module2){"use strict";var{ERR_HTTP_INVALID_HEADER_VALUE,ERR_INVALID_CHAR}=require_errors2(),isInvalidHeaderValue=/[^\t\u0020-\u007E\u0080-\u00FF]/;module2.exports=(name,value)=>{if(typeof value>"u")throw new ERR_HTTP_INVALID_HEADER_VALUE(value,name);if(isInvalidHeaderValue.test(value))throw new ERR_INVALID_CHAR("header content",name)}}}),require_proxy_socket_handler=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js"(exports,module2){"use strict";var{ERR_HTTP2_NO_SOCKET_MANIPULATION}=require_errors2(),proxySocketHandler={has(stream2,property){let reference=stream2.session===void 0?stream2:stream2.session.socket;return property in stream2||property in reference},get(stream2,property){switch(property){case"on":case"once":case"end":case"emit":case"destroy":return stream2[property].bind(stream2);case"writable":case"destroyed":return stream2[property];case"readable":return stream2.destroyed?!1:stream2.readable;case"setTimeout":{let{session}=stream2;return session!==void 0?session.setTimeout.bind(session):stream2.setTimeout.bind(stream2)}case"write":case"read":case"pause":case"resume":throw new ERR_HTTP2_NO_SOCKET_MANIPULATION;default:{let reference=stream2.session===void 0?stream2:stream2.session.socket,value=reference[property];return typeof value=="function"?value.bind(reference):value}}},getPrototypeOf(stream2){return stream2.session!==void 0?Reflect.getPrototypeOf(stream2.session.socket):Reflect.getPrototypeOf(stream2)},set(stream2,property,value){switch(property){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return stream2[property]=value,!0;case"setTimeout":{let{session}=stream2;return session===void 0?stream2.setTimeout=value:session.setTimeout=value,!0}case"write":case"read":case"pause":case"resume":throw new ERR_HTTP2_NO_SOCKET_MANIPULATION;default:{let reference=stream2.session===void 0?stream2:stream2.session.socket;return reference[property]=value,!0}}}};module2.exports=proxySocketHandler}}),require_client_request=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/client-request.js"(exports,module2){"use strict";var{URL:URL4,urlToHttpOptions}=__require("url"),http222=__require("http2"),{Writable}=__require("stream"),{Agent,globalAgent}=require_agent(),IncomingMessage=require_incoming_message(),proxyEvents2=require_proxy_events(),{ERR_INVALID_ARG_TYPE,ERR_INVALID_PROTOCOL,ERR_HTTP_HEADERS_SENT}=require_errors2(),validateHeaderName2=require_validate_header_name(),validateHeaderValue2=require_validate_header_value(),proxySocketHandler=require_proxy_socket_handler(),{HTTP2_HEADER_STATUS,HTTP2_HEADER_METHOD,HTTP2_HEADER_PATH,HTTP2_HEADER_AUTHORITY,HTTP2_METHOD_CONNECT}=http222.constants,kHeaders=Symbol("headers"),kOrigin=Symbol("origin"),kSession=Symbol("session"),kOptions=Symbol("options"),kFlushedHeaders=Symbol("flushedHeaders"),kJobs=Symbol("jobs"),kPendingAgentPromise=Symbol("pendingAgentPromise"),ClientRequest=class extends Writable{constructor(input,options,callback){if(super({autoDestroy:!1,emitClose:!1}),typeof input=="string"?input=urlToHttpOptions(new URL4(input)):input instanceof URL4?input=urlToHttpOptions(input):input={...input},typeof options=="function"||options===void 0?(callback=options,options=input):options=Object.assign(input,options),options.h2session){if(this[kSession]=options.h2session,this[kSession].destroyed)throw new Error("The session has been closed already");this.protocol=this[kSession].socket.encrypted?"https:":"http:"}else if(options.agent===!1)this.agent=new Agent({maxEmptySessions:0});else if(typeof options.agent>"u"||options.agent===null)this.agent=globalAgent;else if(typeof options.agent.request=="function")this.agent=options.agent;else throw new ERR_INVALID_ARG_TYPE("options.agent",["http2wrapper.Agent-like Object","undefined","false"],options.agent);if(this.agent&&(this.protocol=this.agent.protocol),options.protocol&&options.protocol!==this.protocol)throw new ERR_INVALID_PROTOCOL(options.protocol,this.protocol);options.port||(options.port=options.defaultPort||this.agent&&this.agent.defaultPort||443),options.host=options.hostname||options.host||"localhost",delete options.hostname;let{timeout}=options;options.timeout=void 0,this[kHeaders]=Object.create(null),this[kJobs]=[],this[kPendingAgentPromise]=void 0,this.socket=null,this.connection=null,this.method=options.method||"GET",this.method==="CONNECT"&&(options.path==="/"||options.path===void 0)||(this.path=options.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers}=options;if(headers)for(let header in headers)this.setHeader(header,headers[header]);options.auth&&!("authorization"in this[kHeaders])&&(this[kHeaders].authorization="Basic "+Buffer.from(options.auth).toString("base64")),options.session=options.tlsSession,options.path=options.socketPath,this[kOptions]=options,this[kOrigin]=new URL4(`${this.protocol}//${options.servername||options.host}:${options.port}`);let reuseSocket=options._reuseSocket;reuseSocket&&(options.createConnection=(...args)=>reuseSocket.destroyed?this.agent.createConnection(...args):reuseSocket,this.agent.getSession(this[kOrigin],this[kOptions]).catch(()=>{})),timeout&&this.setTimeout(timeout),callback&&this.once("response",callback),this[kFlushedHeaders]=!1}get method(){return this[kHeaders][HTTP2_HEADER_METHOD]}set method(value){value&&(this[kHeaders][HTTP2_HEADER_METHOD]=value.toUpperCase())}get path(){let header=this.method==="CONNECT"?HTTP2_HEADER_AUTHORITY:HTTP2_HEADER_PATH;return this[kHeaders][header]}set path(value){if(value){let header=this.method==="CONNECT"?HTTP2_HEADER_AUTHORITY:HTTP2_HEADER_PATH;this[kHeaders][header]=value}}get host(){return this[kOrigin].hostname}set host(_value){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(chunk,encoding,callback){if(this._mustNotHaveABody){callback(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let callWrite=()=>this._request.write(chunk,encoding,callback);this._request?callWrite():this[kJobs].push(callWrite)}_final(callback){this.flushHeaders();let callEnd=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){callback();return}this._request.end(callback)};this._request?callEnd():this[kJobs].push(callEnd)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy(error,callback){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[kPendingAgentPromise]}catch(internalError){this.aborted&&(error=internalError)}callback(error)}async flushHeaders(){if(this[kFlushedHeaders]||this.destroyed)return;this[kFlushedHeaders]=!0;let isConnectMethod=this.method===HTTP2_METHOD_CONNECT,onStream=stream2=>{if(this._request=stream2,this.destroyed){stream2.destroy();return}isConnectMethod||proxyEvents2(stream2,this,["timeout","continue"]),stream2.once("error",error=>{this.destroy(error)}),stream2.once("aborted",()=>{let{res}=this;res?(res.aborted=!0,res.emit("aborted"),res.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let onResponse=(headers,flags,rawHeaders)=>{let response=new IncomingMessage(this.socket,stream2.readableHighWaterMark);this.res=response,response.url=`${this[kOrigin].origin}${this.path}`,response.req=this,response.statusCode=headers[HTTP2_HEADER_STATUS],response.headers=headers,response.rawHeaders=rawHeaders,response.once("end",()=>{response.complete=!0,response.socket=null,response.connection=null}),isConnectMethod?(response.upgrade=!0,this.emit("connect",response,stream2,Buffer.alloc(0))?this.emit("close"):stream2.destroy()):(stream2.on("data",chunk=>{!response._dumped&&!response.push(chunk)&&stream2.pause()}),stream2.once("end",()=>{this.aborted||response.push(null)}),this.emit("response",response)||response._dump())};stream2.once("response",onResponse),stream2.once("headers",headers=>this.emit("information",{statusCode:headers[HTTP2_HEADER_STATUS]})),stream2.once("trailers",(trailers,flags,rawTrailers)=>{let{res}=this;if(res===null){onResponse(trailers,flags,rawTrailers);return}res.trailers=trailers,res.rawTrailers=rawTrailers}),stream2.once("close",()=>{let{aborted,res}=this;if(res){aborted&&(res.aborted=!0,res.emit("aborted"),res.destroy());let finish=()=>{res.emit("close"),this.destroy(),this.emit("close")};res.readable?res.once("end",finish):finish();return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated")),this.emit("close");return}this.destroy(),this.emit("close")}),this.socket=new Proxy(stream2,proxySocketHandler);for(let job of this[kJobs])job();this[kJobs].length=0,this.emit("socket",this.socket)};if(!(HTTP2_HEADER_AUTHORITY in this[kHeaders])&&!isConnectMethod&&(this[kHeaders][HTTP2_HEADER_AUTHORITY]=this[kOrigin].host),this[kSession])try{onStream(this[kSession].request(this[kHeaders]))}catch(error){this.destroy(error)}else{this.reusedSocket=!0;try{let promise=this.agent.request(this[kOrigin],this[kOptions],this[kHeaders]);this[kPendingAgentPromise]=promise,onStream(await promise),this[kPendingAgentPromise]=!1}catch(error){this[kPendingAgentPromise]=!1,this.destroy(error)}}}get connection(){return this.socket}set connection(value){this.socket=value}getHeaderNames(){return Object.keys(this[kHeaders])}hasHeader(name){if(typeof name!="string")throw new ERR_INVALID_ARG_TYPE("name","string",name);return!!this[kHeaders][name.toLowerCase()]}getHeader(name){if(typeof name!="string")throw new ERR_INVALID_ARG_TYPE("name","string",name);return this[kHeaders][name.toLowerCase()]}get headersSent(){return this[kFlushedHeaders]}removeHeader(name){if(typeof name!="string")throw new ERR_INVALID_ARG_TYPE("name","string",name);if(this.headersSent)throw new ERR_HTTP_HEADERS_SENT("remove");delete this[kHeaders][name.toLowerCase()]}setHeader(name,value){if(this.headersSent)throw new ERR_HTTP_HEADERS_SENT("set");validateHeaderName2(name),validateHeaderValue2(name,value);let lowercased=name.toLowerCase();if(lowercased==="connection"){if(value.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${value}`)}lowercased==="host"&&this.method==="CONNECT"?this[kHeaders][HTTP2_HEADER_AUTHORITY]=value:this[kHeaders][lowercased]=value}setNoDelay(){}setSocketKeepAlive(){}setTimeout(ms,callback){let applyTimeout=()=>this._request.setTimeout(ms,callback);return this._request?applyTimeout():this[kJobs].push(applyTimeout),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(_value){}};module2.exports=ClientRequest}}),require_resolve_alpn=__commonJS2({"node_modules/.pnpm/resolve-alpn@1.2.1/node_modules/resolve-alpn/index.js"(exports,module2){"use strict";var tls=__require("tls");module2.exports=(options={},connect=tls.connect)=>new Promise((resolve3,reject)=>{let timeout=!1,socket,callback=async()=>{await socketPromise,socket.off("timeout",onTimeout),socket.off("error",reject),options.resolveSocket?(resolve3({alpnProtocol:socket.alpnProtocol,socket,timeout}),timeout&&(await Promise.resolve(),socket.emit("timeout"))):(socket.destroy(),resolve3({alpnProtocol:socket.alpnProtocol,timeout}))},onTimeout=async()=>{timeout=!0,callback()},socketPromise=(async()=>{try{socket=await connect(options,callback),socket.on("error",reject),socket.once("timeout",onTimeout)}catch(error){reject(error)}})()})}}),require_calculate_server_name=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/calculate-server-name.js"(exports,module2){"use strict";var{isIP:isIP2}=__require("net"),assert2=__require("assert"),getHost=host=>{if(host[0]==="["){let idx2=host.indexOf("]");return assert2(idx2!==-1),host.slice(1,idx2)}let idx=host.indexOf(":");return idx===-1?host:host.slice(0,idx)};module2.exports=host=>{let servername=getHost(host);return isIP2(servername)?"":servername}}}),require_auto=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/auto.js"(exports,module2){"use strict";var{URL:URL4,urlToHttpOptions}=__require("url"),http32=__require("http"),https22=__require("https"),resolveALPN=require_resolve_alpn(),QuickLRU=require_quick_lru(),{Agent,globalAgent}=require_agent(),Http2ClientRequest=require_client_request(),calculateServerName=require_calculate_server_name(),delayAsyncDestroy=require_delay_async_destroy(),cache3=new QuickLRU({maxSize:100}),queue=new Map,installSocket=(agent2,socket,options)=>{socket._httpMessage={shouldKeepAlive:!0};let onFree=()=>{agent2.emit("free",socket,options)};socket.on("free",onFree);let onClose=()=>{agent2.removeSocket(socket,options)};socket.on("close",onClose);let onTimeout=()=>{let{freeSockets}=agent2;for(let sockets of Object.values(freeSockets))if(sockets.includes(socket)){socket.destroy();return}};socket.on("timeout",onTimeout);let onRemove=()=>{agent2.removeSocket(socket,options),socket.off("close",onClose),socket.off("free",onFree),socket.off("timeout",onTimeout),socket.off("agentRemove",onRemove)};socket.on("agentRemove",onRemove),agent2.emit("free",socket,options)},createResolveProtocol=(cache22,queue2=new Map,connect=void 0)=>async options=>{let name=`${options.host}:${options.port}:${options.ALPNProtocols.sort()}`;if(!cache22.has(name)){if(queue2.has(name))return{alpnProtocol:(await queue2.get(name)).alpnProtocol};let{path:path13}=options;options.path=options.socketPath;let resultPromise=resolveALPN(options,connect);queue2.set(name,resultPromise);try{let result=await resultPromise;return cache22.set(name,result.alpnProtocol),queue2.delete(name),options.path=path13,result}catch(error){throw queue2.delete(name),options.path=path13,error}}return{alpnProtocol:cache22.get(name)}},defaultResolveProtocol=createResolveProtocol(cache3,queue);module2.exports=async(input,options,callback)=>{if(typeof input=="string"?input=urlToHttpOptions(new URL4(input)):input instanceof URL4?input=urlToHttpOptions(input):input={...input},typeof options=="function"||options===void 0?(callback=options,options=input):options=Object.assign(input,options),options.ALPNProtocols=options.ALPNProtocols||["h2","http/1.1"],!Array.isArray(options.ALPNProtocols)||options.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");options.protocol=options.protocol||"https:";let isHttps=options.protocol==="https:";options.host=options.hostname||options.host||"localhost",options.session=options.tlsSession,options.servername=options.servername||calculateServerName(options.headers&&options.headers.host||options.host),options.port=options.port||(isHttps?443:80),options._defaultAgent=isHttps?https22.globalAgent:http32.globalAgent;let resolveProtocol=options.resolveProtocol||defaultResolveProtocol,{agent:agent2}=options;if(agent2!==void 0&&agent2!==!1&&agent2.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(isHttps){options.resolveSocket=!0;let{socket,alpnProtocol,timeout}=await resolveProtocol(options);if(timeout){socket&&socket.destroy();let error=new Error(`Timed out resolving ALPN: ${options.timeout} ms`);throw error.code="ETIMEDOUT",error.ms=options.timeout,error}socket&&options.createConnection&&(socket.destroy(),socket=void 0),delete options.resolveSocket;let isHttp2=alpnProtocol==="h2";if(agent2&&(agent2=isHttp2?agent2.http2:agent2.https,options.agent=agent2),agent2===void 0&&(agent2=isHttp2?globalAgent:https22.globalAgent),socket)if(agent2===!1)socket.destroy();else{let defaultCreateConnection=(isHttp2?Agent:https22.Agent).prototype.createConnection;agent2.createConnection===defaultCreateConnection?isHttp2?options._reuseSocket=socket:installSocket(agent2,socket,options):socket.destroy()}if(isHttp2)return delayAsyncDestroy(new Http2ClientRequest(options,callback))}else agent2&&(options.agent=agent2.http);return delayAsyncDestroy(http32.request(options,callback))},module2.exports.protocolCache=cache3,module2.exports.resolveProtocol=defaultResolveProtocol,module2.exports.createResolveProtocol=createResolveProtocol}}),require_js_stream_socket=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/js-stream-socket.js"(exports,module2){"use strict";var stream2=__require("stream"),tls=__require("tls"),JSStreamSocket=new tls.TLSSocket(new stream2.PassThrough)._handle._parentWrap.constructor;module2.exports=JSStreamSocket}}),require_unexpected_status_code_error=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/unexpected-status-code-error.js"(exports,module2){"use strict";var UnexpectedStatusCodeError=class extends Error{constructor(statusCode,statusMessage=""){super(`The proxy server rejected the request with status code ${statusCode} (${statusMessage||"empty status message"})`),this.statusCode=statusCode,this.statusMessage=statusMessage}};module2.exports=UnexpectedStatusCodeError}}),require_check_type=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/check-type.js"(exports,module2){"use strict";var checkType=(name,value,types22)=>{if(!types22.some(type=>typeof type==="string"?typeof value===type:value instanceof type)){let names=types22.map(type=>typeof type=="string"?type:type.name);throw new TypeError(`Expected '${name}' to be a type of ${names.join(" or ")}, got ${typeof value}`)}};module2.exports=checkType}}),require_initialize=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/initialize.js"(exports,module2){"use strict";var{URL:URL4}=__require("url"),checkType=require_check_type();module2.exports=(self2,proxyOptions)=>{checkType("proxyOptions",proxyOptions,["object"]),checkType("proxyOptions.headers",proxyOptions.headers,["object","undefined"]),checkType("proxyOptions.raw",proxyOptions.raw,["boolean","undefined"]),checkType("proxyOptions.url",proxyOptions.url,[URL4,"string"]);let url=new URL4(proxyOptions.url);self2.proxyOptions={raw:!0,...proxyOptions,headers:{...proxyOptions.headers},url}}}}),require_get_auth_headers=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/get-auth-headers.js"(exports,module2){"use strict";module2.exports=self2=>{let{username,password}=self2.proxyOptions.url;if(username||password){let data=`${username}:${password}`,authorization=`Basic ${Buffer.from(data).toString("base64")}`;return{"proxy-authorization":authorization,authorization}}return{}}}}),require_h1_over_h2=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/h1-over-h2.js"(exports,module2){"use strict";var tls=__require("tls"),http32=__require("http"),https22=__require("https"),JSStreamSocket=require_js_stream_socket(),{globalAgent}=require_agent(),UnexpectedStatusCodeError=require_unexpected_status_code_error(),initialize=require_initialize(),getAuthorizationHeaders=require_get_auth_headers(),createConnection=(self2,options,callback)=>{(async()=>{try{let{proxyOptions}=self2,{url,headers,raw}=proxyOptions,stream2=await globalAgent.request(url,proxyOptions,{...getAuthorizationHeaders(self2),...headers,":method":"CONNECT",":authority":`${options.host}:${options.port}`});stream2.once("error",callback),stream2.once("response",headers2=>{let statusCode=headers2[":status"];if(statusCode!==200){callback(new UnexpectedStatusCodeError(statusCode,""));return}let encrypted=self2 instanceof https22.Agent;if(raw&&encrypted){options.socket=stream2;let secureStream=tls.connect(options);secureStream.once("close",()=>{stream2.destroy()}),callback(null,secureStream);return}let socket=new JSStreamSocket(stream2);socket.encrypted=!1,socket._handle.getpeername=out=>{out.family=void 0,out.address=void 0,out.port=void 0},callback(null,socket)})}catch(error){callback(error)}})()},HttpOverHttp2=class extends http32.Agent{constructor(options){super(options),initialize(this,options.proxyOptions)}createConnection(options,callback){createConnection(this,options,callback)}},HttpsOverHttp2=class extends https22.Agent{constructor(options){super(options),initialize(this,options.proxyOptions)}createConnection(options,callback){createConnection(this,options,callback)}};module2.exports={HttpOverHttp2,HttpsOverHttp2}}}),require_h2_over_hx=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/h2-over-hx.js"(exports,module2){"use strict";var{Agent}=require_agent(),JSStreamSocket=require_js_stream_socket(),UnexpectedStatusCodeError=require_unexpected_status_code_error(),initialize=require_initialize(),Http2OverHttpX=class extends Agent{constructor(options){super(options),initialize(this,options.proxyOptions)}async createConnection(origin,options){let authority=`${origin.hostname}:${origin.port||443}`,[stream2,statusCode,statusMessage]=await this._getProxyStream(authority);if(statusCode!==200)throw new UnexpectedStatusCodeError(statusCode,statusMessage);if(this.proxyOptions.raw)options.socket=stream2;else{let socket=new JSStreamSocket(stream2);return socket.encrypted=!1,socket._handle.getpeername=out=>{out.family=void 0,out.address=void 0,out.port=void 0},socket}return super.createConnection(origin,options)}};module2.exports=Http2OverHttpX}}),require_h2_over_h2=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/h2-over-h2.js"(exports,module2){"use strict";var{globalAgent}=require_agent(),Http2OverHttpX=require_h2_over_hx(),getAuthorizationHeaders=require_get_auth_headers(),getStatusCode=stream2=>new Promise((resolve3,reject)=>{stream2.once("error",reject),stream2.once("response",headers=>{stream2.off("error",reject),resolve3(headers[":status"])})}),Http2OverHttp2=class extends Http2OverHttpX{async _getProxyStream(authority){let{proxyOptions}=this,headers={...getAuthorizationHeaders(this),...proxyOptions.headers,":method":"CONNECT",":authority":authority},stream2=await globalAgent.request(proxyOptions.url,proxyOptions,headers),statusCode=await getStatusCode(stream2);return[stream2,statusCode,""]}};module2.exports=Http2OverHttp2}}),require_h2_over_h1=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/h2-over-h1.js"(exports,module2){"use strict";var http32=__require("http"),https22=__require("https"),Http2OverHttpX=require_h2_over_hx(),getAuthorizationHeaders=require_get_auth_headers(),getStream2=request=>new Promise((resolve3,reject)=>{let onConnect=(response,socket,head)=>{socket.unshift(head),request.off("error",reject),resolve3([socket,response.statusCode,response.statusMessage])};request.once("error",reject),request.once("connect",onConnect)}),Http2OverHttp=class extends Http2OverHttpX{async _getProxyStream(authority){let{proxyOptions}=this,{url,headers}=this.proxyOptions,request=(url.protocol==="https:"?https22:http32).request({...proxyOptions,hostname:url.hostname,port:url.port,path:authority,headers:{...getAuthorizationHeaders(this),...headers,host:authority},method:"CONNECT"}).end();return getStream2(request)}};module2.exports={Http2OverHttp,Http2OverHttps:Http2OverHttp}}}),require_source2=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/index.js"(exports,module2){"use strict";var http222=__require("http2"),{Agent,globalAgent}=require_agent(),ClientRequest=require_client_request(),IncomingMessage=require_incoming_message(),auto=require_auto(),{HttpOverHttp2,HttpsOverHttp2}=require_h1_over_h2(),Http2OverHttp2=require_h2_over_h2(),{Http2OverHttp,Http2OverHttps}=require_h2_over_h1(),validateHeaderName2=require_validate_header_name(),validateHeaderValue2=require_validate_header_value(),request=(url,options,callback)=>new ClientRequest(url,options,callback),get=(url,options,callback)=>{let req=new ClientRequest(url,options,callback);return req.end(),req};module2.exports={...http222,ClientRequest,IncomingMessage,Agent,globalAgent,request,get,auto,proxies:{HttpOverHttp2,HttpsOverHttp2,Http2OverHttp2,Http2OverHttp,Http2OverHttps},validateHeaderName:validateHeaderName2,validateHeaderValue:validateHeaderValue2}}}),typedArrayTypeNames=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(name){return typedArrayTypeNames.includes(name)}var objectTypeNames=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...typedArrayTypeNames];function isObjectTypeName(name){return objectTypeNames.includes(name)}var primitiveTypeNames=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(name){return primitiveTypeNames.includes(name)}function isOfType(type){return value=>typeof value===type}var{toString}=Object.prototype,getObjectType=value=>{let objectTypeName=toString.call(value).slice(8,-1);if(/HTML\w+Element/.test(objectTypeName)&&is.domElement(value))return"HTMLElement";if(isObjectTypeName(objectTypeName))return objectTypeName},isObjectOfType=type=>value=>getObjectType(value)===type;function is(value){if(value===null)return"null";switch(typeof value){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(value)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(value))return"Observable";if(is.array(value))return"Array";if(is.buffer(value))return"Buffer";let tagType=getObjectType(value);if(tagType)return tagType;if(value instanceof String||value instanceof Boolean||value instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");var isNumberType=isOfType("number");is.number=value=>isNumberType(value)&&!is.nan(value);is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=value=>value===null;is.class_=value=>is.function_(value)&&value.toString().startsWith("class ");is.boolean=value=>value===!0||value===!1;is.symbol=isOfType("symbol");is.numericString=value=>is.string(value)&&!is.emptyStringOrWhitespace(value)&&!Number.isNaN(Number(value));is.array=(value,assertion)=>Array.isArray(value)?is.function_(assertion)?value.every(element=>assertion(element)):!0:!1;is.buffer=value=>{var _a,_b;return((_b=(_a=value==null?void 0:value.constructor)==null?void 0:_a.isBuffer)==null?void 0:_b.call(_a,value))??!1};is.blob=value=>isObjectOfType("Blob")(value);is.nullOrUndefined=value=>is.null_(value)||is.undefined(value);is.object=value=>!is.null_(value)&&(typeof value=="object"||is.function_(value));is.iterable=value=>is.function_(value==null?void 0:value[Symbol.iterator]);is.asyncIterable=value=>is.function_(value==null?void 0:value[Symbol.asyncIterator]);is.generator=value=>is.iterable(value)&&is.function_(value==null?void 0:value.next)&&is.function_(value==null?void 0:value.throw);is.asyncGenerator=value=>is.asyncIterable(value)&&is.function_(value.next)&&is.function_(value.throw);is.nativePromise=value=>isObjectOfType("Promise")(value);var hasPromiseApi=value=>is.function_(value==null?void 0:value.then)&&is.function_(value==null?void 0:value.catch);is.promise=value=>is.nativePromise(value)||hasPromiseApi(value);is.generatorFunction=isObjectOfType("GeneratorFunction");is.asyncGeneratorFunction=value=>getObjectType(value)==="AsyncGeneratorFunction";is.asyncFunction=value=>getObjectType(value)==="AsyncFunction";is.boundFunction=value=>is.function_(value)&&!value.hasOwnProperty("prototype");is.regExp=isObjectOfType("RegExp");is.date=isObjectOfType("Date");is.error=isObjectOfType("Error");is.map=value=>isObjectOfType("Map")(value);is.set=value=>isObjectOfType("Set")(value);is.weakMap=value=>isObjectOfType("WeakMap")(value);is.weakSet=value=>isObjectOfType("WeakSet")(value);is.weakRef=value=>isObjectOfType("WeakRef")(value);is.int8Array=isObjectOfType("Int8Array");is.uint8Array=isObjectOfType("Uint8Array");is.uint8ClampedArray=isObjectOfType("Uint8ClampedArray");is.int16Array=isObjectOfType("Int16Array");is.uint16Array=isObjectOfType("Uint16Array");is.int32Array=isObjectOfType("Int32Array");is.uint32Array=isObjectOfType("Uint32Array");is.float32Array=isObjectOfType("Float32Array");is.float64Array=isObjectOfType("Float64Array");is.bigInt64Array=isObjectOfType("BigInt64Array");is.bigUint64Array=isObjectOfType("BigUint64Array");is.arrayBuffer=isObjectOfType("ArrayBuffer");is.sharedArrayBuffer=isObjectOfType("SharedArrayBuffer");is.dataView=isObjectOfType("DataView");is.enumCase=(value,targetEnum)=>Object.values(targetEnum).includes(value);is.directInstanceOf=(instance,class_)=>Object.getPrototypeOf(instance)===class_.prototype;is.urlInstance=value=>isObjectOfType("URL")(value);is.urlString=value=>{if(!is.string(value))return!1;try{return new URL(value),!0}catch{return!1}};is.truthy=value=>!!value;is.falsy=value=>!value;is.nan=value=>Number.isNaN(value);is.primitive=value=>is.null_(value)||isPrimitiveTypeName(typeof value);is.integer=value=>Number.isInteger(value);is.safeInteger=value=>Number.isSafeInteger(value);is.plainObject=value=>{if(typeof value!="object"||value===null)return!1;let prototype=Object.getPrototypeOf(value);return(prototype===null||prototype===Object.prototype||Object.getPrototypeOf(prototype)===null)&&!(Symbol.toStringTag in value)&&!(Symbol.iterator in value)};is.typedArray=value=>isTypedArrayName(getObjectType(value));var isValidLength=value=>is.safeInteger(value)&&value>=0;is.arrayLike=value=>!is.nullOrUndefined(value)&&!is.function_(value)&&isValidLength(value.length);is.inRange=(value,range)=>{if(is.number(range))return value>=Math.min(0,range)&&value<=Math.max(range,0);if(is.array(range)&&range.length===2)return value>=Math.min(...range)&&value<=Math.max(...range);throw new TypeError(`Invalid range: ${JSON.stringify(range)}`)};var NODE_TYPE_ELEMENT=1,DOM_PROPERTIES_TO_CHECK=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=value=>is.object(value)&&value.nodeType===NODE_TYPE_ELEMENT&&is.string(value.nodeName)&&!is.plainObject(value)&&DOM_PROPERTIES_TO_CHECK.every(property=>property in value);is.observable=value=>{var _a,_b;return value?value===((_a=value[Symbol.observable])==null?void 0:_a.call(value))||value===((_b=value["@@observable"])==null?void 0:_b.call(value)):!1};is.nodeStream=value=>is.object(value)&&is.function_(value.pipe)&&!is.observable(value);is.infinite=value=>value===Number.POSITIVE_INFINITY||value===Number.NEGATIVE_INFINITY;var isAbsoluteMod2=remainder=>value=>is.integer(value)&&Math.abs(value%2)===remainder;is.evenInteger=isAbsoluteMod2(0);is.oddInteger=isAbsoluteMod2(1);is.emptyArray=value=>is.array(value)&&value.length===0;is.nonEmptyArray=value=>is.array(value)&&value.length>0;is.emptyString=value=>is.string(value)&&value.length===0;var isWhiteSpaceString=value=>is.string(value)&&!/\S/.test(value);is.emptyStringOrWhitespace=value=>is.emptyString(value)||isWhiteSpaceString(value);is.nonEmptyString=value=>is.string(value)&&value.length>0;is.nonEmptyStringAndNotWhitespace=value=>is.string(value)&&!is.emptyStringOrWhitespace(value);is.emptyObject=value=>is.object(value)&&!is.map(value)&&!is.set(value)&&Object.keys(value).length===0;is.nonEmptyObject=value=>is.object(value)&&!is.map(value)&&!is.set(value)&&Object.keys(value).length>0;is.emptySet=value=>is.set(value)&&value.size===0;is.nonEmptySet=value=>is.set(value)&&value.size>0;is.emptyMap=value=>is.map(value)&&value.size===0;is.nonEmptyMap=value=>is.map(value)&&value.size>0;is.propertyKey=value=>is.any([is.string,is.number,is.symbol],value);is.formData=value=>isObjectOfType("FormData")(value);is.urlSearchParams=value=>isObjectOfType("URLSearchParams")(value);var predicateOnArray=(method,predicate,values)=>{if(!is.function_(predicate))throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);if(values.length===0)throw new TypeError("Invalid number of values");return method.call(values,predicate)};is.any=(predicate,...values)=>(is.array(predicate)?predicate:[predicate]).some(singlePredicate=>predicateOnArray(Array.prototype.some,singlePredicate,values));is.all=(predicate,...values)=>predicateOnArray(Array.prototype.every,predicate,values);var assertType=(condition,description,value,options={})=>{if(!condition){let{multipleValues}=options,valuesMessage=multipleValues?`received values of types ${[...new Set(value.map(singleValue=>`\`${is(singleValue)}\``))].join(", ")}`:`received value of type \`${is(value)}\``;throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`)}},assert={undefined:value=>assertType(is.undefined(value),"undefined",value),string:value=>assertType(is.string(value),"string",value),number:value=>assertType(is.number(value),"number",value),bigint:value=>assertType(is.bigint(value),"bigint",value),function_:value=>assertType(is.function_(value),"Function",value),null_:value=>assertType(is.null_(value),"null",value),class_:value=>assertType(is.class_(value),"Class",value),boolean:value=>assertType(is.boolean(value),"boolean",value),symbol:value=>assertType(is.symbol(value),"symbol",value),numericString:value=>assertType(is.numericString(value),"string with a number",value),array:(value,assertion)=>{assertType(is.array(value),"Array",value),assertion&&value.forEach(assertion)},buffer:value=>assertType(is.buffer(value),"Buffer",value),blob:value=>assertType(is.blob(value),"Blob",value),nullOrUndefined:value=>assertType(is.nullOrUndefined(value),"null or undefined",value),object:value=>assertType(is.object(value),"Object",value),iterable:value=>assertType(is.iterable(value),"Iterable",value),asyncIterable:value=>assertType(is.asyncIterable(value),"AsyncIterable",value),generator:value=>assertType(is.generator(value),"Generator",value),asyncGenerator:value=>assertType(is.asyncGenerator(value),"AsyncGenerator",value),nativePromise:value=>assertType(is.nativePromise(value),"native Promise",value),promise:value=>assertType(is.promise(value),"Promise",value),generatorFunction:value=>assertType(is.generatorFunction(value),"GeneratorFunction",value),asyncGeneratorFunction:value=>assertType(is.asyncGeneratorFunction(value),"AsyncGeneratorFunction",value),asyncFunction:value=>assertType(is.asyncFunction(value),"AsyncFunction",value),boundFunction:value=>assertType(is.boundFunction(value),"Function",value),regExp:value=>assertType(is.regExp(value),"RegExp",value),date:value=>assertType(is.date(value),"Date",value),error:value=>assertType(is.error(value),"Error",value),map:value=>assertType(is.map(value),"Map",value),set:value=>assertType(is.set(value),"Set",value),weakMap:value=>assertType(is.weakMap(value),"WeakMap",value),weakSet:value=>assertType(is.weakSet(value),"WeakSet",value),weakRef:value=>assertType(is.weakRef(value),"WeakRef",value),int8Array:value=>assertType(is.int8Array(value),"Int8Array",value),uint8Array:value=>assertType(is.uint8Array(value),"Uint8Array",value),uint8ClampedArray:value=>assertType(is.uint8ClampedArray(value),"Uint8ClampedArray",value),int16Array:value=>assertType(is.int16Array(value),"Int16Array",value),uint16Array:value=>assertType(is.uint16Array(value),"Uint16Array",value),int32Array:value=>assertType(is.int32Array(value),"Int32Array",value),uint32Array:value=>assertType(is.uint32Array(value),"Uint32Array",value),float32Array:value=>assertType(is.float32Array(value),"Float32Array",value),float64Array:value=>assertType(is.float64Array(value),"Float64Array",value),bigInt64Array:value=>assertType(is.bigInt64Array(value),"BigInt64Array",value),bigUint64Array:value=>assertType(is.bigUint64Array(value),"BigUint64Array",value),arrayBuffer:value=>assertType(is.arrayBuffer(value),"ArrayBuffer",value),sharedArrayBuffer:value=>assertType(is.sharedArrayBuffer(value),"SharedArrayBuffer",value),dataView:value=>assertType(is.dataView(value),"DataView",value),enumCase:(value,targetEnum)=>assertType(is.enumCase(value,targetEnum),"EnumCase",value),urlInstance:value=>assertType(is.urlInstance(value),"URL",value),urlString:value=>assertType(is.urlString(value),"string with a URL",value),truthy:value=>assertType(is.truthy(value),"truthy",value),falsy:value=>assertType(is.falsy(value),"falsy",value),nan:value=>assertType(is.nan(value),"NaN",value),primitive:value=>assertType(is.primitive(value),"primitive",value),integer:value=>assertType(is.integer(value),"integer",value),safeInteger:value=>assertType(is.safeInteger(value),"integer",value),plainObject:value=>assertType(is.plainObject(value),"plain object",value),typedArray:value=>assertType(is.typedArray(value),"TypedArray",value),arrayLike:value=>assertType(is.arrayLike(value),"array-like",value),domElement:value=>assertType(is.domElement(value),"HTMLElement",value),observable:value=>assertType(is.observable(value),"Observable",value),nodeStream:value=>assertType(is.nodeStream(value),"Node.js Stream",value),infinite:value=>assertType(is.infinite(value),"infinite number",value),emptyArray:value=>assertType(is.emptyArray(value),"empty array",value),nonEmptyArray:value=>assertType(is.nonEmptyArray(value),"non-empty array",value),emptyString:value=>assertType(is.emptyString(value),"empty string",value),emptyStringOrWhitespace:value=>assertType(is.emptyStringOrWhitespace(value),"empty string or whitespace",value),nonEmptyString:value=>assertType(is.nonEmptyString(value),"non-empty string",value),nonEmptyStringAndNotWhitespace:value=>assertType(is.nonEmptyStringAndNotWhitespace(value),"non-empty string and not whitespace",value),emptyObject:value=>assertType(is.emptyObject(value),"empty object",value),nonEmptyObject:value=>assertType(is.nonEmptyObject(value),"non-empty object",value),emptySet:value=>assertType(is.emptySet(value),"empty set",value),nonEmptySet:value=>assertType(is.nonEmptySet(value),"non-empty set",value),emptyMap:value=>assertType(is.emptyMap(value),"empty map",value),nonEmptyMap:value=>assertType(is.nonEmptyMap(value),"non-empty map",value),propertyKey:value=>assertType(is.propertyKey(value),"PropertyKey",value),formData:value=>assertType(is.formData(value),"FormData",value),urlSearchParams:value=>assertType(is.urlSearchParams(value),"URLSearchParams",value),evenInteger:value=>assertType(is.evenInteger(value),"even integer",value),oddInteger:value=>assertType(is.oddInteger(value),"odd integer",value),directInstanceOf:(instance,class_)=>assertType(is.directInstanceOf(instance,class_),"T",instance),inRange:(value,range)=>assertType(is.inRange(value,range),"in range",value),any:(predicate,...values)=>assertType(is.any(predicate,...values),"predicate returns truthy for any value",values,{multipleValues:!0}),all:(predicate,...values)=>assertType(is.all(predicate,...values),"predicate returns truthy for all values",values,{multipleValues:!0})};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(assert,{class:{value:assert.class_},function:{value:assert.function_},null:{value:assert.null_}});var dist_default2=is,CancelError=class extends Error{constructor(reason){super(reason||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},PCancelable=class{static fn(userFunction){return(...arguments_)=>new PCancelable((resolve3,reject,onCancel)=>{arguments_.push(onCancel),userFunction(...arguments_).then(resolve3,reject)})}constructor(executor){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((resolve3,reject)=>{this._reject=reject;let onResolve=value=>{(!this._isCanceled||!onCancel.shouldReject)&&(this._isPending=!1,resolve3(value))},onReject=error=>{this._isPending=!1,reject(error)},onCancel=handler=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(handler)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this._rejectOnCancel,set:boolean=>{this._rejectOnCancel=boolean}}}),executor(onResolve,onReject,onCancel)})}then(onFulfilled,onRejected){return this._promise.then(onFulfilled,onRejected)}catch(onRejected){return this._promise.catch(onRejected)}finally(onFinally){return this._promise.finally(onFinally)}cancel(reason){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let handler of this._cancelHandlers)handler()}catch(error){this._reject(error);return}this._rejectOnCancel&&this._reject(new CancelError(reason))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest2(x2){return dist_default2.object(x2)&&"_onResponse"in x2}var RequestError=class extends Error{constructor(message,error,self2){var _a;if(super(message),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=error.code??"ERR_GOT_REQUEST_ERROR",this.input=error.input,isRequest2(self2)?(Object.defineProperty(this,"request",{enumerable:!1,value:self2}),Object.defineProperty(this,"response",{enumerable:!1,value:self2.response}),this.options=self2.options):this.options=self2,this.timings=(_a=this.request)==null?void 0:_a.timings,dist_default2.string(error.stack)&&dist_default2.string(this.stack)){let indexOfMessage=this.stack.indexOf(this.message)+this.message.length,thisStackTrace=this.stack.slice(indexOfMessage).split(`
81
+ `,{borderStyle:"round",padding:1,borderColor:"#F1618C"}))}var import_node_logger14=require("@storybook/node-logger"),import_chalk11=__toESM(require("chalk")),import_ts_dedent14=__toESM(require("ts-dedent"));var import_semver9=__toESM(require("semver"));var import_core_common11=require("@storybook/core-common"),import_csf_tools2=require("@storybook/csf-tools"),import_chalk8=__toESM(require("chalk")),import_ts_dedent8=__toESM(require("ts-dedent"));var import_fs_extra9=require("fs-extra"),import_path10=require("path"),import_tempy=__toESM(require_tempy()),import_core_common10=require("@storybook/core-common");var createLogStream=async(logFileName="storybook.log")=>{let finalLogPath=(0,import_path10.join)(process.cwd(),logFileName),temporaryLogPath=import_tempy.default.file({name:logFileName}),logStream=(0,import_fs_extra9.createWriteStream)(temporaryLogPath,{encoding:"utf8"});return new Promise((resolve3,reject)=>{logStream.once("open",()=>{resolve3({logStream,moveLogFile:async()=>(0,import_fs_extra9.move)(temporaryLogPath,finalLogPath,{overwrite:!0}),clearLogFile:async()=>(0,import_fs_extra9.writeFile)(temporaryLogPath,""),removeLogFile:async()=>(0,import_fs_extra9.remove)(temporaryLogPath),readLogFile:async()=>(0,import_fs_extra9.readFile)(temporaryLogPath,"utf8")})}),logStream.once("error",reject)})};var getAddonNames=mainConfig=>(mainConfig.addons||[]).map(addon=>{let name="";if(typeof addon=="string"?name=addon:typeof addon=="object"&&(name=addon.name),!name.startsWith("."))return name.replace(/\/dist\/.*/,"").replace(/\.[mc]?[tj]?s[x]?$/,"").replace(/\/register$/,"").replace(/\/manager$/,"").replace(/\/preset$/,"")}).filter(Boolean);var import_util_deprecate=__toESM(require("util-deprecate")),useNpmWarning=(0,import_util_deprecate.default)(()=>{},"`--use-npm` is deprecated and will be removed in Storybook 8.0. \nPlease use the `--package-manager=npm` option instead.\nRead more at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#cli-option---use-npm-deprecated");var import_node_path2=__toESM(require("path")),import_cross_spawn=__toESM(require_cross_spawn()),import_find_up6=__toESM(require_find_up());var import_sort=__toESM(require("semver/functions/sort")),import_os2=require("os"),import_ts_dedent10=__toESM(require("ts-dedent")),import_find_up2=__toESM(require_find_up()),import_fs4=require("fs"),import_path12=__toESM(require("path")),import_semver5=__toESM(require("semver")),import_node_logger13=require("@storybook/node-logger");var import_chalk10=__toESM(require("chalk")),import_semver4=require("semver"),import_execa=__toESM(require_execa()),import_path11=__toESM(require("path")),import_fs3=__toESM(require("fs")),import_ts_dedent9=__toESM(require("ts-dedent")),import_fs_extra11=require("fs-extra");var import_chalk9=__toESM(require("chalk"));var import_fs_extra10=__toESM(require("fs-extra"));var import_semver3=require("semver"),import_strip_json_comments=__toESM(require_strip_json_comments()),import_find_up=__toESM(require_find_up());var import_http2=require("http"),import_https2=require("https"),import_node_events=require("events"),import_node_process=__toESM(require("process"),1),import_node_buffer3=require("buffer"),import_node_stream3=require("stream"),import_node_url3=require("url"),import_node_http3=__toESM(require("http"),1),import_events=require("events"),import_util=require("util"),import_node_events2=__toESM(require("events"),1),import_node_url4=__toESM(require("url"),1),import_node_crypto=__toESM(require("crypto"),1),import_node_stream4=__toESM(require("stream"),1),import_node_stream5=require("stream"),import_node_buffer4=require("buffer"),import_node_util4=require("util"),import_node_net2=__toESM(require("net"),1),import_node_process2=__toESM(require("process"),1),import_node_util5=require("util"),import_node_url5=require("url"),import_node_tls=require("tls"),import_node_http4=__toESM(require("http"),1),import_node_https2=__toESM(require("https"),1),import_node_dns=require("dns"),import_node_util6=require("util"),import_node_os=__toESM(require("os"),1),import_pump=__toESM(require_pump(),1),import_tar_fs=__toESM(require_tar_fs(),1),import_gunzip_maybe=__toESM(require_gunzip_maybe(),1),__create2=Object.create,__defProp2=Object.defineProperty,__getOwnPropDesc2=Object.getOwnPropertyDescriptor,__getOwnPropNames2=Object.getOwnPropertyNames,__getProtoOf2=Object.getPrototypeOf,__hasOwnProp2=Object.prototype.hasOwnProperty,__require=(x2=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x2,{get:(a,b)=>(typeof require<"u"?require:a)[b]}):x2)(function(x2){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+x2+'" is not supported')}),__commonJS2=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames2(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports},__copyProps2=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames2(from))!__hasOwnProp2.call(to,key)&&key!==except&&__defProp2(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc2(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create2(__getProtoOf2(mod)):{},__copyProps2(isNodeMode||!mod||!mod.__esModule?__defProp2(target,"default",{value:mod,enumerable:!0}):target,mod)),require_source=__commonJS2({"node_modules/.pnpm/defer-to-connect@2.0.1/node_modules/defer-to-connect/dist/source/index.js"(exports,module2){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});function isTLSSocket(socket){return socket.encrypted}var deferToConnect2=(socket,fn)=>{let listeners;typeof fn=="function"?listeners={connect:fn}:listeners=fn;let hasConnectListener=typeof listeners.connect=="function",hasSecureConnectListener=typeof listeners.secureConnect=="function",hasCloseListener=typeof listeners.close=="function",onConnect=()=>{hasConnectListener&&listeners.connect(),isTLSSocket(socket)&&hasSecureConnectListener&&(socket.authorized?listeners.secureConnect():socket.authorizationError||socket.once("secureConnect",listeners.secureConnect)),hasCloseListener&&socket.once("close",listeners.close)};socket.writable&&!socket.connecting?onConnect():socket.connecting?socket.once("connect",onConnect):socket.destroyed&&hasCloseListener&&listeners.close(socket._hadError)};exports.default=deferToConnect2,module2.exports=deferToConnect2,module2.exports.default=deferToConnect2}}),require_buffer_stream2=__commonJS2({"node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js"(exports,module2){"use strict";var{PassThrough:PassThroughStream2}=__require("stream");module2.exports=options=>{options={...options};let{array}=options,{encoding}=options,isBuffer=encoding==="buffer",objectMode=!1;array?objectMode=!(encoding||isBuffer):encoding=encoding||"utf8",isBuffer&&(encoding=null);let stream2=new PassThroughStream2({objectMode});encoding&&stream2.setEncoding(encoding);let length=0,chunks=[];return stream2.on("data",chunk=>{chunks.push(chunk),objectMode?length=chunks.length:length+=chunk.length}),stream2.getBufferedValue=()=>array?chunks:isBuffer?Buffer.concat(chunks,length):chunks.join(""),stream2.getBufferedLength=()=>length,stream2}}}),require_get_stream2=__commonJS2({"node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js"(exports,module2){"use strict";var{constants:BufferConstants}=__require("buffer"),stream2=__require("stream"),{promisify:promisify4}=__require("util"),bufferStream=require_buffer_stream2(),streamPipelinePromisified=promisify4(stream2.pipeline),MaxBufferError=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function getStream2(inputStream,options){if(!inputStream)throw new Error("Expected a stream");options={maxBuffer:1/0,...options};let{maxBuffer}=options,stream3=bufferStream(options);return await new Promise((resolve3,reject)=>{let rejectPromise=error=>{error&&stream3.getBufferedLength()<=BufferConstants.MAX_LENGTH&&(error.bufferedData=stream3.getBufferedValue()),reject(error)};(async()=>{try{await streamPipelinePromisified(inputStream,stream3),resolve3()}catch(error){rejectPromise(error)}})(),stream3.on("data",()=>{stream3.getBufferedLength()>maxBuffer&&rejectPromise(new MaxBufferError)})}),stream3.getBufferedValue()}module2.exports=getStream2,module2.exports.buffer=(stream3,options)=>getStream2(stream3,{...options,encoding:"buffer"}),module2.exports.array=(stream3,options)=>getStream2(stream3,{...options,array:!0}),module2.exports.MaxBufferError=MaxBufferError}}),require_http_cache_semantics=__commonJS2({"node_modules/.pnpm/http-cache-semantics@4.1.1/node_modules/http-cache-semantics/index.js"(exports,module2){"use strict";var statusCodeCacheableByDefault=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),understoodStatuses=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),errorStatusCodes=new Set([500,502,503,504]),hopByHopHeaders={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},excludedFromRevalidationUpdate={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function toNumberOrZero(s2){let n=parseInt(s2,10);return isFinite(n)?n:0}function isErrorResponse(response){return response?errorStatusCodes.has(response.status):!0}function parseCacheControl(header){let cc={};if(!header)return cc;let parts=header.trim().split(/,/);for(let part of parts){let[k,v]=part.split(/=/,2);cc[k.trim()]=v===void 0?!0:v.trim().replace(/^"|"$/g,"")}return cc}function formatCacheControl(cc){let parts=[];for(let k in cc){let v=cc[k];parts.push(v===!0?k:k+"="+v)}if(parts.length)return parts.join(", ")}module2.exports=class{constructor(req,res,{shared,cacheHeuristic,immutableMinTimeToLive,ignoreCargoCult,_fromObject}={}){if(_fromObject){this._fromObject(_fromObject);return}if(!res||!res.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(req),this._responseTime=this.now(),this._isShared=shared!==!1,this._cacheHeuristic=cacheHeuristic!==void 0?cacheHeuristic:.1,this._immutableMinTtl=immutableMinTimeToLive!==void 0?immutableMinTimeToLive:24*3600*1e3,this._status="status"in res?res.status:200,this._resHeaders=res.headers,this._rescc=parseCacheControl(res.headers["cache-control"]),this._method="method"in req?req.method:"GET",this._url=req.url,this._host=req.headers.host,this._noAuthorization=!req.headers.authorization,this._reqHeaders=res.headers.vary?req.headers:null,this._reqcc=parseCacheControl(req.headers["cache-control"]),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":formatCacheControl(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),res.headers["cache-control"]==null&&/no-cache/.test(res.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())&&understoodStatuses.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||statusCodeCacheableByDefault.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(req){if(!req||!req.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(req){this._assertRequestHasHeaders(req);let requestCC=parseCacheControl(req.headers["cache-control"]);return requestCC["no-cache"]||/no-cache/.test(req.headers.pragma)||requestCC["max-age"]&&this.age()>requestCC["max-age"]||requestCC["min-fresh"]&&this.timeToLive()<1e3*requestCC["min-fresh"]||this.stale()&&!(requestCC["max-stale"]&&!this._rescc["must-revalidate"]&&(requestCC["max-stale"]===!0||requestCC["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(req,!1)}_requestMatches(req,allowHeadMethod){return(!this._url||this._url===req.url)&&this._host===req.headers.host&&(!req.method||this._method===req.method||allowHeadMethod&&req.method==="HEAD")&&this._varyMatches(req)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(req){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let fields=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let name of fields)if(req.headers[name]!==this._reqHeaders[name])return!1;return!0}_copyWithoutHopByHopHeaders(inHeaders){let headers={};for(let name in inHeaders)hopByHopHeaders[name]||(headers[name]=inHeaders[name]);if(inHeaders.connection){let tokens=inHeaders.connection.trim().split(/\s*,\s*/);for(let name of tokens)delete headers[name]}if(headers.warning){let warnings=headers.warning.split(/,/).filter(warning=>!/^\s*1[0-9][0-9]/.test(warning));warnings.length?headers.warning=warnings.join(",").trim():delete headers.warning}return headers}responseHeaders(){let headers=this._copyWithoutHopByHopHeaders(this._resHeaders),age=this.age();return age>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(headers.warning=(headers.warning?`${headers.warning}, `:"")+'113 - "rfc7234 5.5.4"'),headers.age=`${Math.round(age)}`,headers.date=new Date(this.now()).toUTCString(),headers}date(){let serverDate=Date.parse(this._resHeaders.date);return isFinite(serverDate)?serverDate:this._responseTime}age(){let age=this._ageValue(),residentTime=(this.now()-this._responseTime)/1e3;return age+residentTime}_ageValue(){return toNumberOrZero(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 toNumberOrZero(this._rescc["s-maxage"])}if(this._rescc["max-age"])return toNumberOrZero(this._rescc["max-age"]);let defaultMinTtl=this._rescc.immutable?this._immutableMinTtl:0,serverDate=this.date();if(this._resHeaders.expires){let expires=Date.parse(this._resHeaders.expires);return Number.isNaN(expires)||expires<serverDate?0:Math.max(defaultMinTtl,(expires-serverDate)/1e3)}if(this._resHeaders["last-modified"]){let lastModified=Date.parse(this._resHeaders["last-modified"]);if(isFinite(lastModified)&&serverDate>lastModified)return Math.max(defaultMinTtl,(serverDate-lastModified)/1e3*this._cacheHeuristic)}return defaultMinTtl}timeToLive(){let age=this.maxAge()-this.age(),staleIfErrorAge=age+toNumberOrZero(this._rescc["stale-if-error"]),staleWhileRevalidateAge=age+toNumberOrZero(this._rescc["stale-while-revalidate"]);return Math.max(0,age,staleIfErrorAge,staleWhileRevalidateAge)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+toNumberOrZero(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+toNumberOrZero(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(obj){return new this(void 0,void 0,{_fromObject:obj})}_fromObject(obj){if(this._responseTime)throw Error("Reinitialized");if(!obj||obj.v!==1)throw Error("Invalid serialization");this._responseTime=obj.t,this._isShared=obj.sh,this._cacheHeuristic=obj.ch,this._immutableMinTtl=obj.imm!==void 0?obj.imm:24*3600*1e3,this._status=obj.st,this._resHeaders=obj.resh,this._rescc=obj.rescc,this._method=obj.m,this._url=obj.u,this._host=obj.h,this._noAuthorization=obj.a,this._reqHeaders=obj.reqh,this._reqcc=obj.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(incomingReq){this._assertRequestHasHeaders(incomingReq);let headers=this._copyWithoutHopByHopHeaders(incomingReq.headers);if(delete headers["if-range"],!this._requestMatches(incomingReq,!0)||!this.storable())return delete headers["if-none-match"],delete headers["if-modified-since"],headers;if(this._resHeaders.etag&&(headers["if-none-match"]=headers["if-none-match"]?`${headers["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),headers["accept-ranges"]||headers["if-match"]||headers["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete headers["if-modified-since"],headers["if-none-match"]){let etags=headers["if-none-match"].split(/,/).filter(etag=>!/^\s*W\//.test(etag));etags.length?headers["if-none-match"]=etags.join(",").trim():delete headers["if-none-match"]}}else this._resHeaders["last-modified"]&&!headers["if-modified-since"]&&(headers["if-modified-since"]=this._resHeaders["last-modified"]);return headers}revalidatedPolicy(request,response){if(this._assertRequestHasHeaders(request),this._useStaleIfError()&&isErrorResponse(response))return{modified:!1,matches:!1,policy:this};if(!response||!response.headers)throw Error("Response headers missing");let matches=!1;if(response.status!==void 0&&response.status!=304?matches=!1:response.headers.etag&&!/^\s*W\//.test(response.headers.etag)?matches=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===response.headers.etag:this._resHeaders.etag&&response.headers.etag?matches=this._resHeaders.etag.replace(/^\s*W\//,"")===response.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?matches=this._resHeaders["last-modified"]===response.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!response.headers.etag&&!response.headers["last-modified"]&&(matches=!0),!matches)return{policy:new this.constructor(request,response),modified:response.status!=304,matches:!1};let headers={};for(let k in this._resHeaders)headers[k]=k in response.headers&&!excludedFromRevalidationUpdate[k]?response.headers[k]:this._resHeaders[k];let newResponse=Object.assign({},response,{status:this._status,method:this._method,headers});return{policy:new this.constructor(request,newResponse,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}}),require_json_buffer=__commonJS2({"node_modules/.pnpm/json-buffer@3.0.1/node_modules/json-buffer/index.js"(exports){exports.stringify=function stringify2(o){if(typeof o>"u")return o;if(o&&Buffer.isBuffer(o))return JSON.stringify(":base64:"+o.toString("base64"));if(o&&o.toJSON&&(o=o.toJSON()),o&&typeof o=="object"){var s2="",array=Array.isArray(o);s2=array?"[":"{";var first=!0;for(var k in o){var ignore=typeof o[k]=="function"||!array&&typeof o[k]>"u";Object.hasOwnProperty.call(o,k)&&!ignore&&(first||(s2+=","),first=!1,array?o[k]==null?s2+="null":s2+=stringify2(o[k]):o[k]!==void 0&&(s2+=stringify2(k)+":"+stringify2(o[k])))}return s2+=array?"]":"}",s2}else return typeof o=="string"?JSON.stringify(/^:/.test(o)?":"+o:o):typeof o>"u"?"null":JSON.stringify(o)},exports.parse=function(s2){return JSON.parse(s2,function(key,value){return typeof value=="string"?/^:base64:/.test(value)?Buffer.from(value.substring(8),"base64"):/^:/.test(value)?value.substring(1):value:value})}}}),require_src=__commonJS2({"node_modules/.pnpm/keyv@4.5.2/node_modules/keyv/src/index.js"(exports,module2){"use strict";var EventEmitter3=__require("events"),JSONB=require_json_buffer(),loadStore=options=>{let adapters={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(options.adapter||options.uri){let adapter=options.adapter||/^[^:+]*/.exec(options.uri)[0];return new(__require(adapters[adapter]))(options)}return new Map},iterableAdapters=["sqlite","postgres","mysql","mongo","redis","tiered"],Keyv2=class extends EventEmitter3{constructor(uri,{emitErrors=!0,...options}={}){if(super(),this.opts={namespace:"keyv",serialize:JSONB.stringify,deserialize:JSONB.parse,...typeof uri=="string"?{uri}:uri,...options},!this.opts.store){let adapterOptions={...this.opts};this.opts.store=loadStore(adapterOptions)}if(this.opts.compression){let compression2=this.opts.compression;this.opts.serialize=compression2.serialize.bind(compression2),this.opts.deserialize=compression2.deserialize.bind(compression2)}typeof this.opts.store.on=="function"&&emitErrors&&this.opts.store.on("error",error=>this.emit("error",error)),this.opts.store.namespace=this.opts.namespace;let generateIterator=iterator=>async function*(){for await(let[key,raw]of typeof iterator=="function"?iterator(this.opts.store.namespace):iterator){let data=this.opts.deserialize(raw);if(!(this.opts.store.namespace&&!key.includes(this.opts.store.namespace))){if(typeof data.expires=="number"&&Date.now()>data.expires){this.delete(key);continue}yield[this._getKeyUnprefix(key),data.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=generateIterator(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=generateIterator(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return iterableAdapters.includes(this.opts.store.opts.dialect)||iterableAdapters.findIndex(element=>this.opts.store.opts.url.includes(element))>=0}_getKeyPrefix(key){return`${this.opts.namespace}:${key}`}_getKeyPrefixArray(keys){return keys.map(key=>`${this.opts.namespace}:${key}`)}_getKeyUnprefix(key){return key.split(":").splice(1).join(":")}get(key,options){let{store}=this.opts,isArray=Array.isArray(key),keyPrefixed=isArray?this._getKeyPrefixArray(key):this._getKeyPrefix(key);if(isArray&&store.getMany===void 0){let promises=[];for(let key2 of keyPrefixed)promises.push(Promise.resolve().then(()=>store.get(key2)).then(data=>typeof data=="string"?this.opts.deserialize(data):this.opts.compression?this.opts.deserialize(data):data).then(data=>{if(data!=null)return typeof data.expires=="number"&&Date.now()>data.expires?this.delete(key2).then(()=>{}):options&&options.raw?data:data.value}));return Promise.allSettled(promises).then(values=>{let data=[];for(let value of values)data.push(value.value);return data})}return Promise.resolve().then(()=>isArray?store.getMany(keyPrefixed):store.get(keyPrefixed)).then(data=>typeof data=="string"?this.opts.deserialize(data):this.opts.compression?this.opts.deserialize(data):data).then(data=>{if(data!=null){if(isArray){let result=[];for(let row of data){if(typeof row=="string"&&(row=this.opts.deserialize(row)),row==null){result.push(void 0);continue}typeof row.expires=="number"&&Date.now()>row.expires?(this.delete(key).then(()=>{}),result.push(void 0)):result.push(options&&options.raw?row:row.value)}return result}return typeof data.expires=="number"&&Date.now()>data.expires?this.delete(key).then(()=>{}):options&&options.raw?data:data.value}})}set(key,value,ttl2){let keyPrefixed=this._getKeyPrefix(key);typeof ttl2>"u"&&(ttl2=this.opts.ttl),ttl2===0&&(ttl2=void 0);let{store}=this.opts;return Promise.resolve().then(()=>{let expires=typeof ttl2=="number"?Date.now()+ttl2:null;return typeof value=="symbol"&&this.emit("error","symbol cannot be serialized"),value={value,expires},this.opts.serialize(value)}).then(value2=>store.set(keyPrefixed,value2,ttl2)).then(()=>!0)}delete(key){let{store}=this.opts;if(Array.isArray(key)){let keyPrefixed2=this._getKeyPrefixArray(key);if(store.deleteMany===void 0){let promises=[];for(let key2 of keyPrefixed2)promises.push(store.delete(key2));return Promise.allSettled(promises).then(values=>values.every(x2=>x2.value===!0))}return Promise.resolve().then(()=>store.deleteMany(keyPrefixed2))}let keyPrefixed=this._getKeyPrefix(key);return Promise.resolve().then(()=>store.delete(keyPrefixed))}clear(){let{store}=this.opts;return Promise.resolve().then(()=>store.clear())}has(key){let keyPrefixed=this._getKeyPrefix(key),{store}=this.opts;return Promise.resolve().then(async()=>typeof store.has=="function"?store.has(keyPrefixed):await store.get(keyPrefixed)!==void 0)}disconnect(){let{store}=this.opts;if(typeof store.disconnect=="function")return store.disconnect()}};module2.exports=Keyv2}}),require_mimic_response=__commonJS2({"node_modules/.pnpm/mimic-response@3.1.0/node_modules/mimic-response/index.js"(exports,module2){"use strict";var knownProperties2=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];module2.exports=(fromStream,toStream)=>{if(toStream._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let fromProperties=new Set(Object.keys(fromStream).concat(knownProperties2)),properties={};for(let property of fromProperties)property in toStream||(properties[property]={get(){let value=fromStream[property];return typeof value=="function"?value.bind(fromStream):value},set(value){fromStream[property]=value},enumerable:!0,configurable:!1});return Object.defineProperties(toStream,properties),fromStream.once("aborted",()=>{toStream.destroy(),toStream.emit("aborted")}),fromStream.once("close",()=>{fromStream.complete&&toStream.readable?toStream.once("end",()=>{toStream.emit("close")}):toStream.emit("close")}),toStream}}}),require_decompress_response=__commonJS2({"node_modules/.pnpm/decompress-response@6.0.0/node_modules/decompress-response/index.js"(exports,module2){"use strict";var{Transform,PassThrough:PassThrough3}=__require("stream"),zlib2=__require("zlib"),mimicResponse2=require_mimic_response();module2.exports=response=>{let contentEncoding=(response.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(contentEncoding))return response;let isBrotli=contentEncoding==="br";if(isBrotli&&typeof zlib2.createBrotliDecompress!="function")return response.destroy(new Error("Brotli is not supported on Node.js < 12")),response;let isEmpty=!0,checker=new Transform({transform(data,_encoding,callback){isEmpty=!1,callback(null,data)},flush(callback){callback()}}),finalStream=new PassThrough3({autoDestroy:!1,destroy(error,callback){response.destroy(),callback(error)}}),decompressStream=isBrotli?zlib2.createBrotliDecompress():zlib2.createUnzip();return decompressStream.once("error",error=>{if(isEmpty&&!response.readable){finalStream.end();return}finalStream.destroy(error)}),mimicResponse2(response,finalStream),response.pipe(checker).pipe(decompressStream).pipe(finalStream),finalStream}}}),require_quick_lru=__commonJS2({"node_modules/.pnpm/quick-lru@5.1.1/node_modules/quick-lru/index.js"(exports,module2){"use strict";var QuickLRU=class{constructor(options={}){if(!(options.maxSize&&options.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=options.maxSize,this.onEviction=options.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(key,value){if(this.cache.set(key,value),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[key2,value2]of this.oldCache.entries())this.onEviction(key2,value2);this.oldCache=this.cache,this.cache=new Map}}get(key){if(this.cache.has(key))return this.cache.get(key);if(this.oldCache.has(key)){let value=this.oldCache.get(key);return this.oldCache.delete(key),this._set(key,value),value}}set(key,value){return this.cache.has(key)?this.cache.set(key,value):this._set(key,value),this}has(key){return this.cache.has(key)||this.oldCache.has(key)}peek(key){if(this.cache.has(key))return this.cache.get(key);if(this.oldCache.has(key))return this.oldCache.get(key)}delete(key){let deleted=this.cache.delete(key);return deleted&&this._size--,this.oldCache.delete(key)||deleted}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[key]of this)yield key}*values(){for(let[,value]of this)yield value}*[Symbol.iterator](){for(let item of this.cache)yield item;for(let item of this.oldCache){let[key]=item;this.cache.has(key)||(yield item)}}get size(){let oldCacheSize=0;for(let key of this.oldCache.keys())this.cache.has(key)||oldCacheSize++;return Math.min(this._size+oldCacheSize,this.maxSize)}};module2.exports=QuickLRU}}),require_delay_async_destroy=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/delay-async-destroy.js"(exports,module2){"use strict";module2.exports=stream2=>{if(stream2.listenerCount("error")!==0)return stream2;stream2.__destroy=stream2._destroy,stream2._destroy=(...args)=>{let callback=args.pop();stream2.__destroy(...args,async error=>{await Promise.resolve(),callback(error)})};let onError=error=>{Promise.resolve().then(()=>{stream2.emit("error",error)})};return stream2.once("error",onError),Promise.resolve().then(()=>{stream2.off("error",onError)}),stream2}}}),require_agent=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/agent.js"(exports,module2){"use strict";var{URL:URL4}=__require("url"),EventEmitter3=__require("events"),tls=__require("tls"),http222=__require("http2"),QuickLRU=require_quick_lru(),delayAsyncDestroy=require_delay_async_destroy(),kCurrentStreamCount=Symbol("currentStreamCount"),kRequest=Symbol("request"),kOriginSet=Symbol("cachedOriginSet"),kGracefullyClosing=Symbol("gracefullyClosing"),kLength=Symbol("length"),nameKeys=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"],getSortedIndex=(array,value,compare)=>{let low=0,high=array.length;for(;low<high;){let mid=low+high>>>1;compare(array[mid],value)?low=mid+1:high=mid}return low},compareSessions=(a,b)=>a.remoteSettings.maxConcurrentStreams>b.remoteSettings.maxConcurrentStreams,closeCoveredSessions=(where,session)=>{for(let index=0;index<where.length;index++){let coveredSession=where[index];coveredSession[kOriginSet].length>0&&coveredSession[kOriginSet].length<session[kOriginSet].length&&coveredSession[kOriginSet].every(origin=>session[kOriginSet].includes(origin))&&coveredSession[kCurrentStreamCount]+session[kCurrentStreamCount]<=session.remoteSettings.maxConcurrentStreams&&gracefullyClose(coveredSession)}},closeSessionIfCovered=(where,coveredSession)=>{for(let index=0;index<where.length;index++){let session=where[index];if(coveredSession[kOriginSet].length>0&&coveredSession[kOriginSet].length<session[kOriginSet].length&&coveredSession[kOriginSet].every(origin=>session[kOriginSet].includes(origin))&&coveredSession[kCurrentStreamCount]+session[kCurrentStreamCount]<=session.remoteSettings.maxConcurrentStreams)return gracefullyClose(coveredSession),!0}return!1},gracefullyClose=session=>{session[kGracefullyClosing]=!0,session[kCurrentStreamCount]===0&&session.close()},Agent=class extends EventEmitter3{constructor({timeout=0,maxSessions=Number.POSITIVE_INFINITY,maxEmptySessions=10,maxCachedTlsSessions=100}={}){super(),this.sessions={},this.queue={},this.timeout=timeout,this.maxSessions=maxSessions,this.maxEmptySessions=maxEmptySessions,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new QuickLRU({maxSize:maxCachedTlsSessions})}get protocol(){return"https:"}normalizeOptions(options){let normalized="";for(let index=0;index<nameKeys.length;index++){let key=nameKeys[index];normalized+=":",options&&options[key]!==void 0&&(normalized+=options[key])}return normalized}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let normalizedOptions in this.queue)for(let normalizedOrigin in this.queue[normalizedOptions]){let item=this.queue[normalizedOptions][normalizedOrigin];item.completed||(item.completed=!0,item())}}_isBetterSession(thisStreamCount,thatStreamCount){return thisStreamCount>thatStreamCount}_accept(session,listeners,normalizedOrigin,options){let index=0;for(;index<listeners.length&&session[kCurrentStreamCount]<session.remoteSettings.maxConcurrentStreams;)listeners[index].resolve(session),index++;listeners.splice(0,index),listeners.length>0&&(this.getSession(normalizedOrigin,options,listeners),listeners.length=0)}getSession(origin,options,listeners){return new Promise((resolve3,reject)=>{Array.isArray(listeners)&&listeners.length>0?(listeners=[...listeners],resolve3()):listeners=[{resolve:resolve3,reject}];try{if(typeof origin=="string")origin=new URL4(origin);else if(!(origin instanceof URL4))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(options){let{servername}=options,{hostname}=origin;if(servername&&hostname!==servername)throw new Error(`Origin ${hostname} differs from servername ${servername}`)}}catch(error){for(let index=0;index<listeners.length;index++)listeners[index].reject(error);return}let normalizedOptions=this.normalizeOptions(options),normalizedOrigin=origin.origin;if(normalizedOptions in this.sessions){let sessions=this.sessions[normalizedOptions],maxConcurrentStreams=-1,currentStreamsCount=-1,optimalSession;for(let index=0;index<sessions.length;index++){let session=sessions[index],sessionMaxConcurrentStreams=session.remoteSettings.maxConcurrentStreams;if(sessionMaxConcurrentStreams<maxConcurrentStreams)break;if(!session[kOriginSet].includes(normalizedOrigin))continue;let sessionCurrentStreamsCount=session[kCurrentStreamCount];sessionCurrentStreamsCount>=sessionMaxConcurrentStreams||session[kGracefullyClosing]||session.destroyed||(optimalSession||(maxConcurrentStreams=sessionMaxConcurrentStreams),this._isBetterSession(sessionCurrentStreamsCount,currentStreamsCount)&&(optimalSession=session,currentStreamsCount=sessionCurrentStreamsCount))}if(optimalSession){this._accept(optimalSession,listeners,normalizedOrigin,options);return}}if(normalizedOptions in this.queue){if(normalizedOrigin in this.queue[normalizedOptions]){this.queue[normalizedOptions][normalizedOrigin].listeners.push(...listeners);return}}else this.queue[normalizedOptions]={[kLength]:0};let removeFromQueue=()=>{normalizedOptions in this.queue&&this.queue[normalizedOptions][normalizedOrigin]===entry&&(delete this.queue[normalizedOptions][normalizedOrigin],--this.queue[normalizedOptions][kLength]===0&&delete this.queue[normalizedOptions])},entry=async()=>{this._sessionCount++;let name=`${normalizedOrigin}:${normalizedOptions}`,receivedSettings=!1,socket;try{let computedOptions={...options};computedOptions.settings===void 0&&(computedOptions.settings=this.settings),computedOptions.session===void 0&&(computedOptions.session=this.tlsSessionCache.get(name)),socket=await(computedOptions.createConnection||this.createConnection).call(this,origin,computedOptions),computedOptions.createConnection=()=>socket;let session=http222.connect(origin,computedOptions);session[kCurrentStreamCount]=0,session[kGracefullyClosing]=!1;let getOriginSet=()=>{let{socket:socket2}=session,originSet;return socket2.servername===!1?(socket2.servername=socket2.remoteAddress,originSet=session.originSet,socket2.servername=!1):originSet=session.originSet,originSet},isFree=()=>session[kCurrentStreamCount]<session.remoteSettings.maxConcurrentStreams;session.socket.once("session",tlsSession=>{this.tlsSessionCache.set(name,tlsSession)}),session.once("error",error=>{for(let index=0;index<listeners.length;index++)listeners[index].reject(error);this.tlsSessionCache.delete(name)}),session.setTimeout(this.timeout,()=>{session.destroy()}),session.once("close",()=>{if(this._sessionCount--,receivedSettings){this._emptySessionCount--;let where=this.sessions[normalizedOptions];where.length===1?delete this.sessions[normalizedOptions]:where.splice(where.indexOf(session),1)}else{removeFromQueue();let error=new Error("Session closed without receiving a SETTINGS frame");error.code="HTTP2WRAPPER_NOSETTINGS";for(let index=0;index<listeners.length;index++)listeners[index].reject(error)}this._processQueue()});let processListeners=()=>{let queue=this.queue[normalizedOptions];if(!queue)return;let originSet=session[kOriginSet];for(let index=0;index<originSet.length;index++){let origin2=originSet[index];if(origin2 in queue){let{listeners:listeners2,completed}=queue[origin2],index2=0;for(;index2<listeners2.length&&isFree();)listeners2[index2].resolve(session),index2++;if(queue[origin2].listeners.splice(0,index2),queue[origin2].listeners.length===0&&!completed&&(delete queue[origin2],--queue[kLength]===0)){delete this.queue[normalizedOptions];break}if(!isFree())break}}};session.on("origin",()=>{session[kOriginSet]=getOriginSet()||[],session[kGracefullyClosing]=!1,closeSessionIfCovered(this.sessions[normalizedOptions],session),!(session[kGracefullyClosing]||!isFree())&&(processListeners(),isFree()&&closeCoveredSessions(this.sessions[normalizedOptions],session))}),session.once("remoteSettings",()=>{if(entry.destroyed){let error=new Error("Agent has been destroyed");for(let index=0;index<listeners.length;index++)listeners[index].reject(error);session.destroy();return}if(session.setLocalWindowSize&&session.setLocalWindowSize(1024*1024*4),session[kOriginSet]=getOriginSet()||[],session.socket.encrypted){let mainOrigin=session[kOriginSet][0];if(mainOrigin!==normalizedOrigin){let error=new Error(`Requested origin ${normalizedOrigin} does not match server ${mainOrigin}`);for(let index=0;index<listeners.length;index++)listeners[index].reject(error);session.destroy();return}}removeFromQueue();{let where=this.sessions;if(normalizedOptions in where){let sessions=where[normalizedOptions];sessions.splice(getSortedIndex(sessions,session,compareSessions),0,session)}else where[normalizedOptions]=[session]}receivedSettings=!0,this._emptySessionCount++,this.emit("session",session),this._accept(session,listeners,normalizedOrigin,options),session[kCurrentStreamCount]===0&&this._emptySessionCount>this.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),session.on("remoteSettings",()=>{isFree()&&(processListeners(),isFree()&&closeCoveredSessions(this.sessions[normalizedOptions],session))})}),session[kRequest]=session.request,session.request=(headers,streamOptions)=>{if(session[kGracefullyClosing])throw new Error("The session is gracefully closing. No new streams are allowed.");let stream2=session[kRequest](headers,streamOptions);return session.ref(),session[kCurrentStreamCount]++===0&&this._emptySessionCount--,stream2.once("close",()=>{if(--session[kCurrentStreamCount]===0&&(this._emptySessionCount++,session.unref(),this._emptySessionCount>this.maxEmptySessions||session[kGracefullyClosing])){session.close();return}session.destroyed||session.closed||isFree()&&!closeSessionIfCovered(this.sessions[normalizedOptions],session)&&(closeCoveredSessions(this.sessions[normalizedOptions],session),processListeners(),session[kCurrentStreamCount]===0&&this._processQueue())}),stream2}}catch(error){removeFromQueue(),this._sessionCount--;for(let index=0;index<listeners.length;index++)listeners[index].reject(error)}};entry.listeners=listeners,entry.completed=!1,entry.destroyed=!1,this.queue[normalizedOptions][normalizedOrigin]=entry,this.queue[normalizedOptions][kLength]++,this._processQueue()})}request(origin,options,headers,streamOptions){return new Promise((resolve3,reject)=>{this.getSession(origin,options,[{reject,resolve:session=>{try{let stream2=session.request(headers,streamOptions);delayAsyncDestroy(stream2),resolve3(stream2)}catch(error){reject(error)}}}])})}async createConnection(origin,options){return Agent.connect(origin,options)}static connect(origin,options){options.ALPNProtocols=["h2"];let port=origin.port||443,host=origin.hostname;typeof options.servername>"u"&&(options.servername=host);let socket=tls.connect(port,host,options);return options.socket&&(socket._peername={family:void 0,address:void 0,port}),socket}closeEmptySessions(maxCount=Number.POSITIVE_INFINITY){let closedCount=0,{sessions}=this;for(let key in sessions){let thisSessions=sessions[key];for(let index=0;index<thisSessions.length;index++){let session=thisSessions[index];if(session[kCurrentStreamCount]===0&&(closedCount++,session.close(),closedCount>=maxCount))return closedCount}}return closedCount}destroy(reason){let{sessions,queue}=this;for(let key in sessions){let thisSessions=sessions[key];for(let index=0;index<thisSessions.length;index++)thisSessions[index].destroy(reason)}for(let normalizedOptions in queue){let entries2=queue[normalizedOptions];for(let normalizedOrigin in entries2)entries2[normalizedOrigin].destroyed=!0}this.queue={},this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}};Agent.kCurrentStreamCount=kCurrentStreamCount,Agent.kGracefullyClosing=kGracefullyClosing,module2.exports={Agent,globalAgent:new Agent}}}),require_incoming_message=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/incoming-message.js"(exports,module2){"use strict";var{Readable}=__require("stream"),IncomingMessage=class extends Readable{constructor(socket,highWaterMark){super({emitClose:!1,autoDestroy:!0,highWaterMark}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=socket,this._dumped=!1}get connection(){return this.socket}set connection(value){this.socket=value}_destroy(error,callback){this.readableEnded||(this.aborted=!0),callback(),this.req._request.destroy(error)}setTimeout(ms,callback){return this.req.setTimeout(ms,callback),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};module2.exports=IncomingMessage}}),require_proxy_events=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/proxy-events.js"(exports,module2){"use strict";module2.exports=(from,to,events)=>{for(let event of events)from.on(event,(...args)=>to.emit(event,...args))}}}),require_errors2=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/errors.js"(exports,module2){"use strict";var makeError=(Base,key,getMessage)=>{module2.exports[key]=class extends Base{constructor(...args){super(typeof getMessage=="string"?getMessage:getMessage(args)),this.name=`${super.name} [${key}]`,this.code=key}}};makeError(TypeError,"ERR_INVALID_ARG_TYPE",args=>{let type=args[0].includes(".")?"property":"argument",valid=args[1],isManyTypes=Array.isArray(valid);return isManyTypes&&(valid=`${valid.slice(0,-1).join(", ")} or ${valid.slice(-1)}`),`The "${args[0]}" ${type} must be ${isManyTypes?"one of":"of"} type ${valid}. Received ${typeof args[2]}`}),makeError(TypeError,"ERR_INVALID_PROTOCOL",args=>`Protocol "${args[0]}" not supported. Expected "${args[1]}"`),makeError(Error,"ERR_HTTP_HEADERS_SENT",args=>`Cannot ${args[0]} headers after they are sent to the client`),makeError(TypeError,"ERR_INVALID_HTTP_TOKEN",args=>`${args[0]} must be a valid HTTP token [${args[1]}]`),makeError(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",args=>`Invalid value "${args[0]} for header "${args[1]}"`),makeError(TypeError,"ERR_INVALID_CHAR",args=>`Invalid character in ${args[0]} [${args[1]}]`),makeError(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")}}),require_is_request_pseudo_header=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js"(exports,module2){"use strict";module2.exports=header=>{switch(header){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}}}),require_validate_header_name=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/validate-header-name.js"(exports,module2){"use strict";var{ERR_INVALID_HTTP_TOKEN}=require_errors2(),isRequestPseudoHeader=require_is_request_pseudo_header(),isValidHttpToken=/^[\^`\-\w!#$%&*+.|~]+$/;module2.exports=name=>{if(typeof name!="string"||!isValidHttpToken.test(name)&&!isRequestPseudoHeader(name))throw new ERR_INVALID_HTTP_TOKEN("Header name",name)}}}),require_validate_header_value=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/validate-header-value.js"(exports,module2){"use strict";var{ERR_HTTP_INVALID_HEADER_VALUE,ERR_INVALID_CHAR}=require_errors2(),isInvalidHeaderValue=/[^\t\u0020-\u007E\u0080-\u00FF]/;module2.exports=(name,value)=>{if(typeof value>"u")throw new ERR_HTTP_INVALID_HEADER_VALUE(value,name);if(isInvalidHeaderValue.test(value))throw new ERR_INVALID_CHAR("header content",name)}}}),require_proxy_socket_handler=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js"(exports,module2){"use strict";var{ERR_HTTP2_NO_SOCKET_MANIPULATION}=require_errors2(),proxySocketHandler={has(stream2,property){let reference=stream2.session===void 0?stream2:stream2.session.socket;return property in stream2||property in reference},get(stream2,property){switch(property){case"on":case"once":case"end":case"emit":case"destroy":return stream2[property].bind(stream2);case"writable":case"destroyed":return stream2[property];case"readable":return stream2.destroyed?!1:stream2.readable;case"setTimeout":{let{session}=stream2;return session!==void 0?session.setTimeout.bind(session):stream2.setTimeout.bind(stream2)}case"write":case"read":case"pause":case"resume":throw new ERR_HTTP2_NO_SOCKET_MANIPULATION;default:{let reference=stream2.session===void 0?stream2:stream2.session.socket,value=reference[property];return typeof value=="function"?value.bind(reference):value}}},getPrototypeOf(stream2){return stream2.session!==void 0?Reflect.getPrototypeOf(stream2.session.socket):Reflect.getPrototypeOf(stream2)},set(stream2,property,value){switch(property){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return stream2[property]=value,!0;case"setTimeout":{let{session}=stream2;return session===void 0?stream2.setTimeout=value:session.setTimeout=value,!0}case"write":case"read":case"pause":case"resume":throw new ERR_HTTP2_NO_SOCKET_MANIPULATION;default:{let reference=stream2.session===void 0?stream2:stream2.session.socket;return reference[property]=value,!0}}}};module2.exports=proxySocketHandler}}),require_client_request=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/client-request.js"(exports,module2){"use strict";var{URL:URL4,urlToHttpOptions}=__require("url"),http222=__require("http2"),{Writable}=__require("stream"),{Agent,globalAgent}=require_agent(),IncomingMessage=require_incoming_message(),proxyEvents2=require_proxy_events(),{ERR_INVALID_ARG_TYPE,ERR_INVALID_PROTOCOL,ERR_HTTP_HEADERS_SENT}=require_errors2(),validateHeaderName2=require_validate_header_name(),validateHeaderValue2=require_validate_header_value(),proxySocketHandler=require_proxy_socket_handler(),{HTTP2_HEADER_STATUS,HTTP2_HEADER_METHOD,HTTP2_HEADER_PATH,HTTP2_HEADER_AUTHORITY,HTTP2_METHOD_CONNECT}=http222.constants,kHeaders=Symbol("headers"),kOrigin=Symbol("origin"),kSession=Symbol("session"),kOptions=Symbol("options"),kFlushedHeaders=Symbol("flushedHeaders"),kJobs=Symbol("jobs"),kPendingAgentPromise=Symbol("pendingAgentPromise"),ClientRequest=class extends Writable{constructor(input,options,callback){if(super({autoDestroy:!1,emitClose:!1}),typeof input=="string"?input=urlToHttpOptions(new URL4(input)):input instanceof URL4?input=urlToHttpOptions(input):input={...input},typeof options=="function"||options===void 0?(callback=options,options=input):options=Object.assign(input,options),options.h2session){if(this[kSession]=options.h2session,this[kSession].destroyed)throw new Error("The session has been closed already");this.protocol=this[kSession].socket.encrypted?"https:":"http:"}else if(options.agent===!1)this.agent=new Agent({maxEmptySessions:0});else if(typeof options.agent>"u"||options.agent===null)this.agent=globalAgent;else if(typeof options.agent.request=="function")this.agent=options.agent;else throw new ERR_INVALID_ARG_TYPE("options.agent",["http2wrapper.Agent-like Object","undefined","false"],options.agent);if(this.agent&&(this.protocol=this.agent.protocol),options.protocol&&options.protocol!==this.protocol)throw new ERR_INVALID_PROTOCOL(options.protocol,this.protocol);options.port||(options.port=options.defaultPort||this.agent&&this.agent.defaultPort||443),options.host=options.hostname||options.host||"localhost",delete options.hostname;let{timeout}=options;options.timeout=void 0,this[kHeaders]=Object.create(null),this[kJobs]=[],this[kPendingAgentPromise]=void 0,this.socket=null,this.connection=null,this.method=options.method||"GET",this.method==="CONNECT"&&(options.path==="/"||options.path===void 0)||(this.path=options.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers}=options;if(headers)for(let header in headers)this.setHeader(header,headers[header]);options.auth&&!("authorization"in this[kHeaders])&&(this[kHeaders].authorization="Basic "+Buffer.from(options.auth).toString("base64")),options.session=options.tlsSession,options.path=options.socketPath,this[kOptions]=options,this[kOrigin]=new URL4(`${this.protocol}//${options.servername||options.host}:${options.port}`);let reuseSocket=options._reuseSocket;reuseSocket&&(options.createConnection=(...args)=>reuseSocket.destroyed?this.agent.createConnection(...args):reuseSocket,this.agent.getSession(this[kOrigin],this[kOptions]).catch(()=>{})),timeout&&this.setTimeout(timeout),callback&&this.once("response",callback),this[kFlushedHeaders]=!1}get method(){return this[kHeaders][HTTP2_HEADER_METHOD]}set method(value){value&&(this[kHeaders][HTTP2_HEADER_METHOD]=value.toUpperCase())}get path(){let header=this.method==="CONNECT"?HTTP2_HEADER_AUTHORITY:HTTP2_HEADER_PATH;return this[kHeaders][header]}set path(value){if(value){let header=this.method==="CONNECT"?HTTP2_HEADER_AUTHORITY:HTTP2_HEADER_PATH;this[kHeaders][header]=value}}get host(){return this[kOrigin].hostname}set host(_value){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(chunk,encoding,callback){if(this._mustNotHaveABody){callback(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let callWrite=()=>this._request.write(chunk,encoding,callback);this._request?callWrite():this[kJobs].push(callWrite)}_final(callback){this.flushHeaders();let callEnd=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){callback();return}this._request.end(callback)};this._request?callEnd():this[kJobs].push(callEnd)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy(error,callback){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[kPendingAgentPromise]}catch(internalError){this.aborted&&(error=internalError)}callback(error)}async flushHeaders(){if(this[kFlushedHeaders]||this.destroyed)return;this[kFlushedHeaders]=!0;let isConnectMethod=this.method===HTTP2_METHOD_CONNECT,onStream=stream2=>{if(this._request=stream2,this.destroyed){stream2.destroy();return}isConnectMethod||proxyEvents2(stream2,this,["timeout","continue"]),stream2.once("error",error=>{this.destroy(error)}),stream2.once("aborted",()=>{let{res}=this;res?(res.aborted=!0,res.emit("aborted"),res.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let onResponse=(headers,flags,rawHeaders)=>{let response=new IncomingMessage(this.socket,stream2.readableHighWaterMark);this.res=response,response.url=`${this[kOrigin].origin}${this.path}`,response.req=this,response.statusCode=headers[HTTP2_HEADER_STATUS],response.headers=headers,response.rawHeaders=rawHeaders,response.once("end",()=>{response.complete=!0,response.socket=null,response.connection=null}),isConnectMethod?(response.upgrade=!0,this.emit("connect",response,stream2,Buffer.alloc(0))?this.emit("close"):stream2.destroy()):(stream2.on("data",chunk=>{!response._dumped&&!response.push(chunk)&&stream2.pause()}),stream2.once("end",()=>{this.aborted||response.push(null)}),this.emit("response",response)||response._dump())};stream2.once("response",onResponse),stream2.once("headers",headers=>this.emit("information",{statusCode:headers[HTTP2_HEADER_STATUS]})),stream2.once("trailers",(trailers,flags,rawTrailers)=>{let{res}=this;if(res===null){onResponse(trailers,flags,rawTrailers);return}res.trailers=trailers,res.rawTrailers=rawTrailers}),stream2.once("close",()=>{let{aborted,res}=this;if(res){aborted&&(res.aborted=!0,res.emit("aborted"),res.destroy());let finish=()=>{res.emit("close"),this.destroy(),this.emit("close")};res.readable?res.once("end",finish):finish();return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated")),this.emit("close");return}this.destroy(),this.emit("close")}),this.socket=new Proxy(stream2,proxySocketHandler);for(let job of this[kJobs])job();this[kJobs].length=0,this.emit("socket",this.socket)};if(!(HTTP2_HEADER_AUTHORITY in this[kHeaders])&&!isConnectMethod&&(this[kHeaders][HTTP2_HEADER_AUTHORITY]=this[kOrigin].host),this[kSession])try{onStream(this[kSession].request(this[kHeaders]))}catch(error){this.destroy(error)}else{this.reusedSocket=!0;try{let promise=this.agent.request(this[kOrigin],this[kOptions],this[kHeaders]);this[kPendingAgentPromise]=promise,onStream(await promise),this[kPendingAgentPromise]=!1}catch(error){this[kPendingAgentPromise]=!1,this.destroy(error)}}}get connection(){return this.socket}set connection(value){this.socket=value}getHeaderNames(){return Object.keys(this[kHeaders])}hasHeader(name){if(typeof name!="string")throw new ERR_INVALID_ARG_TYPE("name","string",name);return!!this[kHeaders][name.toLowerCase()]}getHeader(name){if(typeof name!="string")throw new ERR_INVALID_ARG_TYPE("name","string",name);return this[kHeaders][name.toLowerCase()]}get headersSent(){return this[kFlushedHeaders]}removeHeader(name){if(typeof name!="string")throw new ERR_INVALID_ARG_TYPE("name","string",name);if(this.headersSent)throw new ERR_HTTP_HEADERS_SENT("remove");delete this[kHeaders][name.toLowerCase()]}setHeader(name,value){if(this.headersSent)throw new ERR_HTTP_HEADERS_SENT("set");validateHeaderName2(name),validateHeaderValue2(name,value);let lowercased=name.toLowerCase();if(lowercased==="connection"){if(value.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${value}`)}lowercased==="host"&&this.method==="CONNECT"?this[kHeaders][HTTP2_HEADER_AUTHORITY]=value:this[kHeaders][lowercased]=value}setNoDelay(){}setSocketKeepAlive(){}setTimeout(ms,callback){let applyTimeout=()=>this._request.setTimeout(ms,callback);return this._request?applyTimeout():this[kJobs].push(applyTimeout),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(_value){}};module2.exports=ClientRequest}}),require_resolve_alpn=__commonJS2({"node_modules/.pnpm/resolve-alpn@1.2.1/node_modules/resolve-alpn/index.js"(exports,module2){"use strict";var tls=__require("tls");module2.exports=(options={},connect=tls.connect)=>new Promise((resolve3,reject)=>{let timeout=!1,socket,callback=async()=>{await socketPromise,socket.off("timeout",onTimeout),socket.off("error",reject),options.resolveSocket?(resolve3({alpnProtocol:socket.alpnProtocol,socket,timeout}),timeout&&(await Promise.resolve(),socket.emit("timeout"))):(socket.destroy(),resolve3({alpnProtocol:socket.alpnProtocol,timeout}))},onTimeout=async()=>{timeout=!0,callback()},socketPromise=(async()=>{try{socket=await connect(options,callback),socket.on("error",reject),socket.once("timeout",onTimeout)}catch(error){reject(error)}})()})}}),require_calculate_server_name=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/calculate-server-name.js"(exports,module2){"use strict";var{isIP:isIP2}=__require("net"),assert2=__require("assert"),getHost=host=>{if(host[0]==="["){let idx2=host.indexOf("]");return assert2(idx2!==-1),host.slice(1,idx2)}let idx=host.indexOf(":");return idx===-1?host:host.slice(0,idx)};module2.exports=host=>{let servername=getHost(host);return isIP2(servername)?"":servername}}}),require_auto=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/auto.js"(exports,module2){"use strict";var{URL:URL4,urlToHttpOptions}=__require("url"),http32=__require("http"),https22=__require("https"),resolveALPN=require_resolve_alpn(),QuickLRU=require_quick_lru(),{Agent,globalAgent}=require_agent(),Http2ClientRequest=require_client_request(),calculateServerName=require_calculate_server_name(),delayAsyncDestroy=require_delay_async_destroy(),cache3=new QuickLRU({maxSize:100}),queue=new Map,installSocket=(agent2,socket,options)=>{socket._httpMessage={shouldKeepAlive:!0};let onFree=()=>{agent2.emit("free",socket,options)};socket.on("free",onFree);let onClose=()=>{agent2.removeSocket(socket,options)};socket.on("close",onClose);let onTimeout=()=>{let{freeSockets}=agent2;for(let sockets of Object.values(freeSockets))if(sockets.includes(socket)){socket.destroy();return}};socket.on("timeout",onTimeout);let onRemove=()=>{agent2.removeSocket(socket,options),socket.off("close",onClose),socket.off("free",onFree),socket.off("timeout",onTimeout),socket.off("agentRemove",onRemove)};socket.on("agentRemove",onRemove),agent2.emit("free",socket,options)},createResolveProtocol=(cache22,queue2=new Map,connect=void 0)=>async options=>{let name=`${options.host}:${options.port}:${options.ALPNProtocols.sort()}`;if(!cache22.has(name)){if(queue2.has(name))return{alpnProtocol:(await queue2.get(name)).alpnProtocol};let{path:path13}=options;options.path=options.socketPath;let resultPromise=resolveALPN(options,connect);queue2.set(name,resultPromise);try{let result=await resultPromise;return cache22.set(name,result.alpnProtocol),queue2.delete(name),options.path=path13,result}catch(error){throw queue2.delete(name),options.path=path13,error}}return{alpnProtocol:cache22.get(name)}},defaultResolveProtocol=createResolveProtocol(cache3,queue);module2.exports=async(input,options,callback)=>{if(typeof input=="string"?input=urlToHttpOptions(new URL4(input)):input instanceof URL4?input=urlToHttpOptions(input):input={...input},typeof options=="function"||options===void 0?(callback=options,options=input):options=Object.assign(input,options),options.ALPNProtocols=options.ALPNProtocols||["h2","http/1.1"],!Array.isArray(options.ALPNProtocols)||options.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");options.protocol=options.protocol||"https:";let isHttps=options.protocol==="https:";options.host=options.hostname||options.host||"localhost",options.session=options.tlsSession,options.servername=options.servername||calculateServerName(options.headers&&options.headers.host||options.host),options.port=options.port||(isHttps?443:80),options._defaultAgent=isHttps?https22.globalAgent:http32.globalAgent;let resolveProtocol=options.resolveProtocol||defaultResolveProtocol,{agent:agent2}=options;if(agent2!==void 0&&agent2!==!1&&agent2.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(isHttps){options.resolveSocket=!0;let{socket,alpnProtocol,timeout}=await resolveProtocol(options);if(timeout){socket&&socket.destroy();let error=new Error(`Timed out resolving ALPN: ${options.timeout} ms`);throw error.code="ETIMEDOUT",error.ms=options.timeout,error}socket&&options.createConnection&&(socket.destroy(),socket=void 0),delete options.resolveSocket;let isHttp2=alpnProtocol==="h2";if(agent2&&(agent2=isHttp2?agent2.http2:agent2.https,options.agent=agent2),agent2===void 0&&(agent2=isHttp2?globalAgent:https22.globalAgent),socket)if(agent2===!1)socket.destroy();else{let defaultCreateConnection=(isHttp2?Agent:https22.Agent).prototype.createConnection;agent2.createConnection===defaultCreateConnection?isHttp2?options._reuseSocket=socket:installSocket(agent2,socket,options):socket.destroy()}if(isHttp2)return delayAsyncDestroy(new Http2ClientRequest(options,callback))}else agent2&&(options.agent=agent2.http);return delayAsyncDestroy(http32.request(options,callback))},module2.exports.protocolCache=cache3,module2.exports.resolveProtocol=defaultResolveProtocol,module2.exports.createResolveProtocol=createResolveProtocol}}),require_js_stream_socket=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/js-stream-socket.js"(exports,module2){"use strict";var stream2=__require("stream"),tls=__require("tls"),JSStreamSocket=new tls.TLSSocket(new stream2.PassThrough)._handle._parentWrap.constructor;module2.exports=JSStreamSocket}}),require_unexpected_status_code_error=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/unexpected-status-code-error.js"(exports,module2){"use strict";var UnexpectedStatusCodeError=class extends Error{constructor(statusCode,statusMessage=""){super(`The proxy server rejected the request with status code ${statusCode} (${statusMessage||"empty status message"})`),this.statusCode=statusCode,this.statusMessage=statusMessage}};module2.exports=UnexpectedStatusCodeError}}),require_check_type=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/utils/check-type.js"(exports,module2){"use strict";var checkType=(name,value,types22)=>{if(!types22.some(type=>typeof type==="string"?typeof value===type:value instanceof type)){let names=types22.map(type=>typeof type=="string"?type:type.name);throw new TypeError(`Expected '${name}' to be a type of ${names.join(" or ")}, got ${typeof value}`)}};module2.exports=checkType}}),require_initialize=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/initialize.js"(exports,module2){"use strict";var{URL:URL4}=__require("url"),checkType=require_check_type();module2.exports=(self2,proxyOptions)=>{checkType("proxyOptions",proxyOptions,["object"]),checkType("proxyOptions.headers",proxyOptions.headers,["object","undefined"]),checkType("proxyOptions.raw",proxyOptions.raw,["boolean","undefined"]),checkType("proxyOptions.url",proxyOptions.url,[URL4,"string"]);let url=new URL4(proxyOptions.url);self2.proxyOptions={raw:!0,...proxyOptions,headers:{...proxyOptions.headers},url}}}}),require_get_auth_headers=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/get-auth-headers.js"(exports,module2){"use strict";module2.exports=self2=>{let{username,password}=self2.proxyOptions.url;if(username||password){let data=`${username}:${password}`,authorization=`Basic ${Buffer.from(data).toString("base64")}`;return{"proxy-authorization":authorization,authorization}}return{}}}}),require_h1_over_h2=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/h1-over-h2.js"(exports,module2){"use strict";var tls=__require("tls"),http32=__require("http"),https22=__require("https"),JSStreamSocket=require_js_stream_socket(),{globalAgent}=require_agent(),UnexpectedStatusCodeError=require_unexpected_status_code_error(),initialize=require_initialize(),getAuthorizationHeaders=require_get_auth_headers(),createConnection=(self2,options,callback)=>{(async()=>{try{let{proxyOptions}=self2,{url,headers,raw}=proxyOptions,stream2=await globalAgent.request(url,proxyOptions,{...getAuthorizationHeaders(self2),...headers,":method":"CONNECT",":authority":`${options.host}:${options.port}`});stream2.once("error",callback),stream2.once("response",headers2=>{let statusCode=headers2[":status"];if(statusCode!==200){callback(new UnexpectedStatusCodeError(statusCode,""));return}let encrypted=self2 instanceof https22.Agent;if(raw&&encrypted){options.socket=stream2;let secureStream=tls.connect(options);secureStream.once("close",()=>{stream2.destroy()}),callback(null,secureStream);return}let socket=new JSStreamSocket(stream2);socket.encrypted=!1,socket._handle.getpeername=out=>{out.family=void 0,out.address=void 0,out.port=void 0},callback(null,socket)})}catch(error){callback(error)}})()},HttpOverHttp2=class extends http32.Agent{constructor(options){super(options),initialize(this,options.proxyOptions)}createConnection(options,callback){createConnection(this,options,callback)}},HttpsOverHttp2=class extends https22.Agent{constructor(options){super(options),initialize(this,options.proxyOptions)}createConnection(options,callback){createConnection(this,options,callback)}};module2.exports={HttpOverHttp2,HttpsOverHttp2}}}),require_h2_over_hx=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/h2-over-hx.js"(exports,module2){"use strict";var{Agent}=require_agent(),JSStreamSocket=require_js_stream_socket(),UnexpectedStatusCodeError=require_unexpected_status_code_error(),initialize=require_initialize(),Http2OverHttpX=class extends Agent{constructor(options){super(options),initialize(this,options.proxyOptions)}async createConnection(origin,options){let authority=`${origin.hostname}:${origin.port||443}`,[stream2,statusCode,statusMessage]=await this._getProxyStream(authority);if(statusCode!==200)throw new UnexpectedStatusCodeError(statusCode,statusMessage);if(this.proxyOptions.raw)options.socket=stream2;else{let socket=new JSStreamSocket(stream2);return socket.encrypted=!1,socket._handle.getpeername=out=>{out.family=void 0,out.address=void 0,out.port=void 0},socket}return super.createConnection(origin,options)}};module2.exports=Http2OverHttpX}}),require_h2_over_h2=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/h2-over-h2.js"(exports,module2){"use strict";var{globalAgent}=require_agent(),Http2OverHttpX=require_h2_over_hx(),getAuthorizationHeaders=require_get_auth_headers(),getStatusCode=stream2=>new Promise((resolve3,reject)=>{stream2.once("error",reject),stream2.once("response",headers=>{stream2.off("error",reject),resolve3(headers[":status"])})}),Http2OverHttp2=class extends Http2OverHttpX{async _getProxyStream(authority){let{proxyOptions}=this,headers={...getAuthorizationHeaders(this),...proxyOptions.headers,":method":"CONNECT",":authority":authority},stream2=await globalAgent.request(proxyOptions.url,proxyOptions,headers),statusCode=await getStatusCode(stream2);return[stream2,statusCode,""]}};module2.exports=Http2OverHttp2}}),require_h2_over_h1=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/proxies/h2-over-h1.js"(exports,module2){"use strict";var http32=__require("http"),https22=__require("https"),Http2OverHttpX=require_h2_over_hx(),getAuthorizationHeaders=require_get_auth_headers(),getStream2=request=>new Promise((resolve3,reject)=>{let onConnect=(response,socket,head)=>{socket.unshift(head),request.off("error",reject),resolve3([socket,response.statusCode,response.statusMessage])};request.once("error",reject),request.once("connect",onConnect)}),Http2OverHttp=class extends Http2OverHttpX{async _getProxyStream(authority){let{proxyOptions}=this,{url,headers}=this.proxyOptions,request=(url.protocol==="https:"?https22:http32).request({...proxyOptions,hostname:url.hostname,port:url.port,path:authority,headers:{...getAuthorizationHeaders(this),...headers,host:authority},method:"CONNECT"}).end();return getStream2(request)}};module2.exports={Http2OverHttp,Http2OverHttps:Http2OverHttp}}}),require_source2=__commonJS2({"node_modules/.pnpm/http2-wrapper@2.2.0/node_modules/http2-wrapper/source/index.js"(exports,module2){"use strict";var http222=__require("http2"),{Agent,globalAgent}=require_agent(),ClientRequest=require_client_request(),IncomingMessage=require_incoming_message(),auto=require_auto(),{HttpOverHttp2,HttpsOverHttp2}=require_h1_over_h2(),Http2OverHttp2=require_h2_over_h2(),{Http2OverHttp,Http2OverHttps}=require_h2_over_h1(),validateHeaderName2=require_validate_header_name(),validateHeaderValue2=require_validate_header_value(),request=(url,options,callback)=>new ClientRequest(url,options,callback),get=(url,options,callback)=>{let req=new ClientRequest(url,options,callback);return req.end(),req};module2.exports={...http222,ClientRequest,IncomingMessage,Agent,globalAgent,request,get,auto,proxies:{HttpOverHttp2,HttpsOverHttp2,Http2OverHttp2,Http2OverHttp,Http2OverHttps},validateHeaderName:validateHeaderName2,validateHeaderValue:validateHeaderValue2}}}),typedArrayTypeNames=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(name){return typedArrayTypeNames.includes(name)}var objectTypeNames=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...typedArrayTypeNames];function isObjectTypeName(name){return objectTypeNames.includes(name)}var primitiveTypeNames=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(name){return primitiveTypeNames.includes(name)}function isOfType(type){return value=>typeof value===type}var{toString}=Object.prototype,getObjectType=value=>{let objectTypeName=toString.call(value).slice(8,-1);if(/HTML\w+Element/.test(objectTypeName)&&is.domElement(value))return"HTMLElement";if(isObjectTypeName(objectTypeName))return objectTypeName},isObjectOfType=type=>value=>getObjectType(value)===type;function is(value){if(value===null)return"null";switch(typeof value){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(value)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(value))return"Observable";if(is.array(value))return"Array";if(is.buffer(value))return"Buffer";let tagType=getObjectType(value);if(tagType)return tagType;if(value instanceof String||value instanceof Boolean||value instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");var isNumberType=isOfType("number");is.number=value=>isNumberType(value)&&!is.nan(value);is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=value=>value===null;is.class_=value=>is.function_(value)&&value.toString().startsWith("class ");is.boolean=value=>value===!0||value===!1;is.symbol=isOfType("symbol");is.numericString=value=>is.string(value)&&!is.emptyStringOrWhitespace(value)&&!Number.isNaN(Number(value));is.array=(value,assertion)=>Array.isArray(value)?is.function_(assertion)?value.every(element=>assertion(element)):!0:!1;is.buffer=value=>{var _a,_b;return((_b=(_a=value==null?void 0:value.constructor)==null?void 0:_a.isBuffer)==null?void 0:_b.call(_a,value))??!1};is.blob=value=>isObjectOfType("Blob")(value);is.nullOrUndefined=value=>is.null_(value)||is.undefined(value);is.object=value=>!is.null_(value)&&(typeof value=="object"||is.function_(value));is.iterable=value=>is.function_(value==null?void 0:value[Symbol.iterator]);is.asyncIterable=value=>is.function_(value==null?void 0:value[Symbol.asyncIterator]);is.generator=value=>is.iterable(value)&&is.function_(value==null?void 0:value.next)&&is.function_(value==null?void 0:value.throw);is.asyncGenerator=value=>is.asyncIterable(value)&&is.function_(value.next)&&is.function_(value.throw);is.nativePromise=value=>isObjectOfType("Promise")(value);var hasPromiseApi=value=>is.function_(value==null?void 0:value.then)&&is.function_(value==null?void 0:value.catch);is.promise=value=>is.nativePromise(value)||hasPromiseApi(value);is.generatorFunction=isObjectOfType("GeneratorFunction");is.asyncGeneratorFunction=value=>getObjectType(value)==="AsyncGeneratorFunction";is.asyncFunction=value=>getObjectType(value)==="AsyncFunction";is.boundFunction=value=>is.function_(value)&&!value.hasOwnProperty("prototype");is.regExp=isObjectOfType("RegExp");is.date=isObjectOfType("Date");is.error=isObjectOfType("Error");is.map=value=>isObjectOfType("Map")(value);is.set=value=>isObjectOfType("Set")(value);is.weakMap=value=>isObjectOfType("WeakMap")(value);is.weakSet=value=>isObjectOfType("WeakSet")(value);is.weakRef=value=>isObjectOfType("WeakRef")(value);is.int8Array=isObjectOfType("Int8Array");is.uint8Array=isObjectOfType("Uint8Array");is.uint8ClampedArray=isObjectOfType("Uint8ClampedArray");is.int16Array=isObjectOfType("Int16Array");is.uint16Array=isObjectOfType("Uint16Array");is.int32Array=isObjectOfType("Int32Array");is.uint32Array=isObjectOfType("Uint32Array");is.float32Array=isObjectOfType("Float32Array");is.float64Array=isObjectOfType("Float64Array");is.bigInt64Array=isObjectOfType("BigInt64Array");is.bigUint64Array=isObjectOfType("BigUint64Array");is.arrayBuffer=isObjectOfType("ArrayBuffer");is.sharedArrayBuffer=isObjectOfType("SharedArrayBuffer");is.dataView=isObjectOfType("DataView");is.enumCase=(value,targetEnum)=>Object.values(targetEnum).includes(value);is.directInstanceOf=(instance,class_)=>Object.getPrototypeOf(instance)===class_.prototype;is.urlInstance=value=>isObjectOfType("URL")(value);is.urlString=value=>{if(!is.string(value))return!1;try{return new URL(value),!0}catch{return!1}};is.truthy=value=>!!value;is.falsy=value=>!value;is.nan=value=>Number.isNaN(value);is.primitive=value=>is.null_(value)||isPrimitiveTypeName(typeof value);is.integer=value=>Number.isInteger(value);is.safeInteger=value=>Number.isSafeInteger(value);is.plainObject=value=>{if(typeof value!="object"||value===null)return!1;let prototype=Object.getPrototypeOf(value);return(prototype===null||prototype===Object.prototype||Object.getPrototypeOf(prototype)===null)&&!(Symbol.toStringTag in value)&&!(Symbol.iterator in value)};is.typedArray=value=>isTypedArrayName(getObjectType(value));var isValidLength=value=>is.safeInteger(value)&&value>=0;is.arrayLike=value=>!is.nullOrUndefined(value)&&!is.function_(value)&&isValidLength(value.length);is.inRange=(value,range)=>{if(is.number(range))return value>=Math.min(0,range)&&value<=Math.max(range,0);if(is.array(range)&&range.length===2)return value>=Math.min(...range)&&value<=Math.max(...range);throw new TypeError(`Invalid range: ${JSON.stringify(range)}`)};var NODE_TYPE_ELEMENT=1,DOM_PROPERTIES_TO_CHECK=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=value=>is.object(value)&&value.nodeType===NODE_TYPE_ELEMENT&&is.string(value.nodeName)&&!is.plainObject(value)&&DOM_PROPERTIES_TO_CHECK.every(property=>property in value);is.observable=value=>{var _a,_b;return value?value===((_a=value[Symbol.observable])==null?void 0:_a.call(value))||value===((_b=value["@@observable"])==null?void 0:_b.call(value)):!1};is.nodeStream=value=>is.object(value)&&is.function_(value.pipe)&&!is.observable(value);is.infinite=value=>value===Number.POSITIVE_INFINITY||value===Number.NEGATIVE_INFINITY;var isAbsoluteMod2=remainder=>value=>is.integer(value)&&Math.abs(value%2)===remainder;is.evenInteger=isAbsoluteMod2(0);is.oddInteger=isAbsoluteMod2(1);is.emptyArray=value=>is.array(value)&&value.length===0;is.nonEmptyArray=value=>is.array(value)&&value.length>0;is.emptyString=value=>is.string(value)&&value.length===0;var isWhiteSpaceString=value=>is.string(value)&&!/\S/.test(value);is.emptyStringOrWhitespace=value=>is.emptyString(value)||isWhiteSpaceString(value);is.nonEmptyString=value=>is.string(value)&&value.length>0;is.nonEmptyStringAndNotWhitespace=value=>is.string(value)&&!is.emptyStringOrWhitespace(value);is.emptyObject=value=>is.object(value)&&!is.map(value)&&!is.set(value)&&Object.keys(value).length===0;is.nonEmptyObject=value=>is.object(value)&&!is.map(value)&&!is.set(value)&&Object.keys(value).length>0;is.emptySet=value=>is.set(value)&&value.size===0;is.nonEmptySet=value=>is.set(value)&&value.size>0;is.emptyMap=value=>is.map(value)&&value.size===0;is.nonEmptyMap=value=>is.map(value)&&value.size>0;is.propertyKey=value=>is.any([is.string,is.number,is.symbol],value);is.formData=value=>isObjectOfType("FormData")(value);is.urlSearchParams=value=>isObjectOfType("URLSearchParams")(value);var predicateOnArray=(method,predicate,values)=>{if(!is.function_(predicate))throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);if(values.length===0)throw new TypeError("Invalid number of values");return method.call(values,predicate)};is.any=(predicate,...values)=>(is.array(predicate)?predicate:[predicate]).some(singlePredicate=>predicateOnArray(Array.prototype.some,singlePredicate,values));is.all=(predicate,...values)=>predicateOnArray(Array.prototype.every,predicate,values);var assertType=(condition,description,value,options={})=>{if(!condition){let{multipleValues}=options,valuesMessage=multipleValues?`received values of types ${[...new Set(value.map(singleValue=>`\`${is(singleValue)}\``))].join(", ")}`:`received value of type \`${is(value)}\``;throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`)}},assert={undefined:value=>assertType(is.undefined(value),"undefined",value),string:value=>assertType(is.string(value),"string",value),number:value=>assertType(is.number(value),"number",value),bigint:value=>assertType(is.bigint(value),"bigint",value),function_:value=>assertType(is.function_(value),"Function",value),null_:value=>assertType(is.null_(value),"null",value),class_:value=>assertType(is.class_(value),"Class",value),boolean:value=>assertType(is.boolean(value),"boolean",value),symbol:value=>assertType(is.symbol(value),"symbol",value),numericString:value=>assertType(is.numericString(value),"string with a number",value),array:(value,assertion)=>{assertType(is.array(value),"Array",value),assertion&&value.forEach(assertion)},buffer:value=>assertType(is.buffer(value),"Buffer",value),blob:value=>assertType(is.blob(value),"Blob",value),nullOrUndefined:value=>assertType(is.nullOrUndefined(value),"null or undefined",value),object:value=>assertType(is.object(value),"Object",value),iterable:value=>assertType(is.iterable(value),"Iterable",value),asyncIterable:value=>assertType(is.asyncIterable(value),"AsyncIterable",value),generator:value=>assertType(is.generator(value),"Generator",value),asyncGenerator:value=>assertType(is.asyncGenerator(value),"AsyncGenerator",value),nativePromise:value=>assertType(is.nativePromise(value),"native Promise",value),promise:value=>assertType(is.promise(value),"Promise",value),generatorFunction:value=>assertType(is.generatorFunction(value),"GeneratorFunction",value),asyncGeneratorFunction:value=>assertType(is.asyncGeneratorFunction(value),"AsyncGeneratorFunction",value),asyncFunction:value=>assertType(is.asyncFunction(value),"AsyncFunction",value),boundFunction:value=>assertType(is.boundFunction(value),"Function",value),regExp:value=>assertType(is.regExp(value),"RegExp",value),date:value=>assertType(is.date(value),"Date",value),error:value=>assertType(is.error(value),"Error",value),map:value=>assertType(is.map(value),"Map",value),set:value=>assertType(is.set(value),"Set",value),weakMap:value=>assertType(is.weakMap(value),"WeakMap",value),weakSet:value=>assertType(is.weakSet(value),"WeakSet",value),weakRef:value=>assertType(is.weakRef(value),"WeakRef",value),int8Array:value=>assertType(is.int8Array(value),"Int8Array",value),uint8Array:value=>assertType(is.uint8Array(value),"Uint8Array",value),uint8ClampedArray:value=>assertType(is.uint8ClampedArray(value),"Uint8ClampedArray",value),int16Array:value=>assertType(is.int16Array(value),"Int16Array",value),uint16Array:value=>assertType(is.uint16Array(value),"Uint16Array",value),int32Array:value=>assertType(is.int32Array(value),"Int32Array",value),uint32Array:value=>assertType(is.uint32Array(value),"Uint32Array",value),float32Array:value=>assertType(is.float32Array(value),"Float32Array",value),float64Array:value=>assertType(is.float64Array(value),"Float64Array",value),bigInt64Array:value=>assertType(is.bigInt64Array(value),"BigInt64Array",value),bigUint64Array:value=>assertType(is.bigUint64Array(value),"BigUint64Array",value),arrayBuffer:value=>assertType(is.arrayBuffer(value),"ArrayBuffer",value),sharedArrayBuffer:value=>assertType(is.sharedArrayBuffer(value),"SharedArrayBuffer",value),dataView:value=>assertType(is.dataView(value),"DataView",value),enumCase:(value,targetEnum)=>assertType(is.enumCase(value,targetEnum),"EnumCase",value),urlInstance:value=>assertType(is.urlInstance(value),"URL",value),urlString:value=>assertType(is.urlString(value),"string with a URL",value),truthy:value=>assertType(is.truthy(value),"truthy",value),falsy:value=>assertType(is.falsy(value),"falsy",value),nan:value=>assertType(is.nan(value),"NaN",value),primitive:value=>assertType(is.primitive(value),"primitive",value),integer:value=>assertType(is.integer(value),"integer",value),safeInteger:value=>assertType(is.safeInteger(value),"integer",value),plainObject:value=>assertType(is.plainObject(value),"plain object",value),typedArray:value=>assertType(is.typedArray(value),"TypedArray",value),arrayLike:value=>assertType(is.arrayLike(value),"array-like",value),domElement:value=>assertType(is.domElement(value),"HTMLElement",value),observable:value=>assertType(is.observable(value),"Observable",value),nodeStream:value=>assertType(is.nodeStream(value),"Node.js Stream",value),infinite:value=>assertType(is.infinite(value),"infinite number",value),emptyArray:value=>assertType(is.emptyArray(value),"empty array",value),nonEmptyArray:value=>assertType(is.nonEmptyArray(value),"non-empty array",value),emptyString:value=>assertType(is.emptyString(value),"empty string",value),emptyStringOrWhitespace:value=>assertType(is.emptyStringOrWhitespace(value),"empty string or whitespace",value),nonEmptyString:value=>assertType(is.nonEmptyString(value),"non-empty string",value),nonEmptyStringAndNotWhitespace:value=>assertType(is.nonEmptyStringAndNotWhitespace(value),"non-empty string and not whitespace",value),emptyObject:value=>assertType(is.emptyObject(value),"empty object",value),nonEmptyObject:value=>assertType(is.nonEmptyObject(value),"non-empty object",value),emptySet:value=>assertType(is.emptySet(value),"empty set",value),nonEmptySet:value=>assertType(is.nonEmptySet(value),"non-empty set",value),emptyMap:value=>assertType(is.emptyMap(value),"empty map",value),nonEmptyMap:value=>assertType(is.nonEmptyMap(value),"non-empty map",value),propertyKey:value=>assertType(is.propertyKey(value),"PropertyKey",value),formData:value=>assertType(is.formData(value),"FormData",value),urlSearchParams:value=>assertType(is.urlSearchParams(value),"URLSearchParams",value),evenInteger:value=>assertType(is.evenInteger(value),"even integer",value),oddInteger:value=>assertType(is.oddInteger(value),"odd integer",value),directInstanceOf:(instance,class_)=>assertType(is.directInstanceOf(instance,class_),"T",instance),inRange:(value,range)=>assertType(is.inRange(value,range),"in range",value),any:(predicate,...values)=>assertType(is.any(predicate,...values),"predicate returns truthy for any value",values,{multipleValues:!0}),all:(predicate,...values)=>assertType(is.all(predicate,...values),"predicate returns truthy for all values",values,{multipleValues:!0})};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(assert,{class:{value:assert.class_},function:{value:assert.function_},null:{value:assert.null_}});var dist_default2=is,CancelError=class extends Error{constructor(reason){super(reason||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},PCancelable=class{static fn(userFunction){return(...arguments_)=>new PCancelable((resolve3,reject,onCancel)=>{arguments_.push(onCancel),userFunction(...arguments_).then(resolve3,reject)})}constructor(executor){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((resolve3,reject)=>{this._reject=reject;let onResolve=value=>{(!this._isCanceled||!onCancel.shouldReject)&&(this._isPending=!1,resolve3(value))},onReject=error=>{this._isPending=!1,reject(error)},onCancel=handler=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(handler)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this._rejectOnCancel,set:boolean=>{this._rejectOnCancel=boolean}}}),executor(onResolve,onReject,onCancel)})}then(onFulfilled,onRejected){return this._promise.then(onFulfilled,onRejected)}catch(onRejected){return this._promise.catch(onRejected)}finally(onFinally){return this._promise.finally(onFinally)}cancel(reason){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let handler of this._cancelHandlers)handler()}catch(error){this._reject(error);return}this._rejectOnCancel&&this._reject(new CancelError(reason))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest2(x2){return dist_default2.object(x2)&&"_onResponse"in x2}var RequestError=class extends Error{constructor(message,error,self2){var _a;if(super(message),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=error.code??"ERR_GOT_REQUEST_ERROR",this.input=error.input,isRequest2(self2)?(Object.defineProperty(this,"request",{enumerable:!1,value:self2}),Object.defineProperty(this,"response",{enumerable:!1,value:self2.response}),this.options=self2.options):this.options=self2,this.timings=(_a=this.request)==null?void 0:_a.timings,dist_default2.string(error.stack)&&dist_default2.string(this.stack)){let indexOfMessage=this.stack.indexOf(this.message)+this.message.length,thisStackTrace=this.stack.slice(indexOfMessage).split(`
82
82
  `).reverse(),errorStackTrace=error.stack.slice(error.stack.indexOf(error.message)+error.message.length).split(`
83
83
  `).reverse();for(;errorStackTrace.length>0&&errorStackTrace[0]===thisStackTrace[0];)thisStackTrace.shift();this.stack=`${this.stack.slice(0,indexOfMessage)}${thisStackTrace.reverse().join(`
84
84
  `)}${errorStackTrace.reverse().join(`
@@ -86,7 +86,7 @@ ${updateMessage}`:""}
86
86
  `||match===`
87
87
  `&&str[i2-1]!=="\r"?`\r
88
88
  `:match),getType=value=>Object.prototype.toString.call(value).slice(8,-1).toLowerCase();function isPlainObject(value){if(getType(value)!=="object")return!1;let pp=Object.getPrototypeOf(value);return pp==null?!0:(pp.constructor&&pp.constructor.toString())===Object.toString()}function getProperty(target,prop){if(typeof prop=="string"){for(let[name,value]of Object.entries(target))if(prop.toLowerCase()===name.toLowerCase())return value}}var proxyHeaders=object=>new Proxy(object,{get:(target,prop)=>getProperty(target,prop),has:(target,prop)=>getProperty(target,prop)!==void 0}),isFormData=value=>!!(value&&isFunction(value.constructor)&&value[Symbol.toStringTag]==="FormData"&&isFunction(value.append)&&isFunction(value.getAll)&&isFunction(value.entries)&&isFunction(value[Symbol.iterator])),escapeName=name=>String(name).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22"),isFile=value=>!!(value&&typeof value=="object"&&isFunction(value.constructor)&&value[Symbol.toStringTag]==="File"&&isFunction(value.stream)&&value.name!=null),__classPrivateFieldSet=function(receiver,state,value,kind,f3){if(kind==="m")throw new TypeError("Private method is not writable");if(kind==="a"&&!f3)throw new TypeError("Private accessor was defined without a setter");if(typeof state=="function"?receiver!==state||!f3:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return kind==="a"?f3.call(receiver,value):f3?f3.value=value:state.set(receiver,value),value},__classPrivateFieldGet=function(receiver,state,kind,f3){if(kind==="a"&&!f3)throw new TypeError("Private accessor was defined without a getter");if(typeof state=="function"?receiver!==state||!f3:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return kind==="m"?f3:kind==="a"?f3.call(receiver):f3?f3.value:state.get(receiver)},_FormDataEncoder_instances,_FormDataEncoder_CRLF,_FormDataEncoder_CRLF_BYTES,_FormDataEncoder_CRLF_BYTES_LENGTH,_FormDataEncoder_DASHES,_FormDataEncoder_encoder,_FormDataEncoder_footer,_FormDataEncoder_form,_FormDataEncoder_options,_FormDataEncoder_getFieldHeader,_FormDataEncoder_getContentLength,defaultOptions={enableAdditionalHeaders:!1},readonlyProp={writable:!1,configurable:!1},FormDataEncoder=class{constructor(form,boundaryOrOptions,options){if(_FormDataEncoder_instances.add(this),_FormDataEncoder_CRLF.set(this,`\r
89
- `),_FormDataEncoder_CRLF_BYTES.set(this,void 0),_FormDataEncoder_CRLF_BYTES_LENGTH.set(this,void 0),_FormDataEncoder_DASHES.set(this,"-".repeat(2)),_FormDataEncoder_encoder.set(this,new TextEncoder),_FormDataEncoder_footer.set(this,void 0),_FormDataEncoder_form.set(this,void 0),_FormDataEncoder_options.set(this,void 0),!isFormData(form))throw new TypeError("Expected first argument to be a FormData instance.");let boundary;if(isPlainObject(boundaryOrOptions)?options=boundaryOrOptions:boundary=boundaryOrOptions,boundary||(boundary=createBoundary()),typeof boundary!="string")throw new TypeError("Expected boundary argument to be a string.");if(options&&!isPlainObject(options))throw new TypeError("Expected options argument to be an object.");__classPrivateFieldSet(this,_FormDataEncoder_form,Array.from(form.entries()),"f"),__classPrivateFieldSet(this,_FormDataEncoder_options,{...defaultOptions,...options},"f"),__classPrivateFieldSet(this,_FormDataEncoder_CRLF_BYTES,__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f")),"f"),__classPrivateFieldSet(this,_FormDataEncoder_CRLF_BYTES_LENGTH,__classPrivateFieldGet(this,_FormDataEncoder_CRLF_BYTES,"f").byteLength,"f"),this.boundary=`form-data-boundary-${boundary}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,__classPrivateFieldSet(this,_FormDataEncoder_footer,__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(`${__classPrivateFieldGet(this,_FormDataEncoder_DASHES,"f")}${this.boundary}${__classPrivateFieldGet(this,_FormDataEncoder_DASHES,"f")}${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f").repeat(2)}`),"f");let headers={"Content-Type":this.contentType},contentLength=__classPrivateFieldGet(this,_FormDataEncoder_instances,"m",_FormDataEncoder_getContentLength).call(this);contentLength&&(this.contentLength=contentLength,headers["Content-Length"]=contentLength),this.headers=proxyHeaders(Object.freeze(headers)),Object.defineProperties(this,{boundary:readonlyProp,contentType:readonlyProp,contentLength:readonlyProp,headers:readonlyProp})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[name,raw]of __classPrivateFieldGet(this,_FormDataEncoder_form,"f")){let value=isFile(raw)?raw:__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(normalizeValue(raw));yield __classPrivateFieldGet(this,_FormDataEncoder_instances,"m",_FormDataEncoder_getFieldHeader).call(this,name,value),yield value,yield __classPrivateFieldGet(this,_FormDataEncoder_CRLF_BYTES,"f")}yield __classPrivateFieldGet(this,_FormDataEncoder_footer,"f")}async*encode(){for(let part of this.values())isFile(part)?yield*getStreamIterator(part.stream()):yield part}[(_FormDataEncoder_CRLF=new WeakMap,_FormDataEncoder_CRLF_BYTES=new WeakMap,_FormDataEncoder_CRLF_BYTES_LENGTH=new WeakMap,_FormDataEncoder_DASHES=new WeakMap,_FormDataEncoder_encoder=new WeakMap,_FormDataEncoder_footer=new WeakMap,_FormDataEncoder_form=new WeakMap,_FormDataEncoder_options=new WeakMap,_FormDataEncoder_instances=new WeakSet,_FormDataEncoder_getFieldHeader=function(name,value){let header="";header+=`${__classPrivateFieldGet(this,_FormDataEncoder_DASHES,"f")}${this.boundary}${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f")}`,header+=`Content-Disposition: form-data; name="${escapeName(name)}"`,isFile(value)&&(header+=`; filename="${escapeName(value.name)}"${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f")}`,header+=`Content-Type: ${value.type||"application/octet-stream"}`);let size=isFile(value)?value.size:value.byteLength;return __classPrivateFieldGet(this,_FormDataEncoder_options,"f").enableAdditionalHeaders===!0&&size!=null&&!isNaN(size)&&(header+=`${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f")}Content-Length: ${isFile(value)?value.size:value.byteLength}`),__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(`${header}${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f").repeat(2)}`)},_FormDataEncoder_getContentLength=function(){let length=0;for(let[name,raw]of __classPrivateFieldGet(this,_FormDataEncoder_form,"f")){let value=isFile(raw)?raw:__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(normalizeValue(raw)),size=isFile(value)?value.size:value.byteLength;if(size==null||isNaN(size))return;length+=__classPrivateFieldGet(this,_FormDataEncoder_instances,"m",_FormDataEncoder_getFieldHeader).call(this,name,value).byteLength,length+=size,length+=__classPrivateFieldGet(this,_FormDataEncoder_CRLF_BYTES_LENGTH,"f")}return String(length+__classPrivateFieldGet(this,_FormDataEncoder_footer,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};function isFormData2(body){return dist_default2.nodeStream(body)&&dist_default2.function_(body.getBoundary)}async function getBodySize(body,headers){if(headers&&"content-length"in headers)return Number(headers["content-length"]);if(!body)return 0;if(dist_default2.string(body))return import_node_buffer4.Buffer.byteLength(body);if(dist_default2.buffer(body))return body.length;if(isFormData2(body))return(0,import_node_util4.promisify)(body.getLength.bind(body))()}function proxyEvents(from,to,events){let eventFunctions={};for(let event of events){let eventFunction=(...args)=>{to.emit(event,...args)};eventFunctions[event]=eventFunction,from.on(event,eventFunction)}return()=>{for(let[event,eventFunction]of Object.entries(eventFunctions))from.off(event,eventFunction)}}function unhandle(){let handlers=[];return{once(origin,event,fn){origin.once(event,fn),handlers.push({origin,event,fn})},unhandleAll(){for(let handler of handlers){let{origin,event,fn}=handler;origin.removeListener(event,fn)}handlers.length=0}}}var reentry=Symbol("reentry"),noop2=()=>{},TimeoutError2=class extends Error{constructor(threshold,event){super(`Timeout awaiting '${event}' for ${threshold}ms`),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:event}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.code="ETIMEDOUT"}};function timedOut(request,delays,options){if(reentry in request)return noop2;request[reentry]=!0;let cancelers=[],{once:once2,unhandleAll}=unhandle(),addTimeout=(delay2,callback,event)=>{var _a;let timeout=setTimeout(callback,delay2,delay2,event);(_a=timeout.unref)==null||_a.call(timeout);let cancel=()=>{clearTimeout(timeout)};return cancelers.push(cancel),cancel},{host,hostname}=options,timeoutHandler=(delay2,event)=>{request.destroy(new TimeoutError2(delay2,event))},cancelTimeouts=()=>{for(let cancel of cancelers)cancel();unhandleAll()};if(request.once("error",error=>{if(cancelTimeouts(),request.listenerCount("error")===0)throw error}),typeof delays.request<"u"){let cancelTimeout=addTimeout(delays.request,timeoutHandler,"request");once2(request,"response",response=>{once2(response,"end",cancelTimeout)})}if(typeof delays.socket<"u"){let{socket}=delays,socketTimeoutHandler=()=>{timeoutHandler(socket,"socket")};request.setTimeout(socket,socketTimeoutHandler),cancelers.push(()=>{request.removeListener("timeout",socketTimeoutHandler)})}let hasLookup=typeof delays.lookup<"u",hasConnect=typeof delays.connect<"u",hasSecureConnect=typeof delays.secureConnect<"u",hasSend=typeof delays.send<"u";return(hasLookup||hasConnect||hasSecureConnect||hasSend)&&once2(request,"socket",socket=>{let{socketPath}=request;if(socket.connecting){let hasPath=!!(socketPath??import_node_net2.default.isIP(hostname??host??"")!==0);if(hasLookup&&!hasPath&&typeof socket.address().address>"u"){let cancelTimeout=addTimeout(delays.lookup,timeoutHandler,"lookup");once2(socket,"lookup",cancelTimeout)}if(hasConnect){let timeConnect=()=>addTimeout(delays.connect,timeoutHandler,"connect");hasPath?once2(socket,"connect",timeConnect()):once2(socket,"lookup",error=>{error===null&&once2(socket,"connect",timeConnect())})}hasSecureConnect&&options.protocol==="https:"&&once2(socket,"connect",()=>{let cancelTimeout=addTimeout(delays.secureConnect,timeoutHandler,"secureConnect");once2(socket,"secureConnect",cancelTimeout)})}if(hasSend){let timeRequest=()=>addTimeout(delays.send,timeoutHandler,"send");socket.connecting?once2(socket,"connect",()=>{once2(request,"upload-complete",timeRequest())}):once2(request,"upload-complete",timeRequest())}}),typeof delays.response<"u"&&once2(request,"upload-complete",()=>{let cancelTimeout=addTimeout(delays.response,timeoutHandler,"response");once2(request,"response",cancelTimeout)}),typeof delays.read<"u"&&once2(request,"response",response=>{let cancelTimeout=addTimeout(delays.read,timeoutHandler,"read");once2(response,"end",cancelTimeout)}),cancelTimeouts}function urlToOptions(url){url=url;let options={protocol:url.protocol,hostname:dist_default2.string(url.hostname)&&url.hostname.startsWith("[")?url.hostname.slice(1,-1):url.hostname,host:url.host,hash:url.hash,search:url.search,pathname:url.pathname,href:url.href,path:`${url.pathname||""}${url.search||""}`};return dist_default2.string(url.port)&&url.port.length>0&&(options.port=Number(url.port)),(url.username||url.password)&&(options.auth=`${url.username||""}:${url.password||""}`),options}var WeakableMap=class{constructor(){Object.defineProperty(this,"weakMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.weakMap=new WeakMap,this.map=new Map}set(key,value){typeof key=="object"?this.weakMap.set(key,value):this.map.set(key,value)}get(key){return typeof key=="object"?this.weakMap.get(key):this.map.get(key)}has(key){return typeof key=="object"?this.weakMap.has(key):this.map.has(key)}},calculateRetryDelay=({attemptCount,retryOptions,error,retryAfter,computedValue})=>{if(error.name==="RetryError")return 1;if(attemptCount>retryOptions.limit)return 0;let hasMethod=retryOptions.methods.includes(error.options.method),hasErrorCode=retryOptions.errorCodes.includes(error.code),hasStatusCode=error.response&&retryOptions.statusCodes.includes(error.response.statusCode);if(!hasMethod||!hasErrorCode&&!hasStatusCode)return 0;if(error.response){if(retryAfter)return retryAfter>computedValue?0:retryAfter;if(error.response.statusCode===413)return 0}let noise=Math.random()*retryOptions.noise;return Math.min(2**(attemptCount-1)*1e3,retryOptions.backoffLimit)+noise},calculate_retry_delay_default=calculateRetryDelay,{Resolver:AsyncResolver}=import_node_dns.promises,kCacheableLookupCreateConnection=Symbol("cacheableLookupCreateConnection"),kCacheableLookupInstance=Symbol("cacheableLookupInstance"),kExpires=Symbol("expires"),supportsALL=typeof import_node_dns.ALL=="number",verifyAgent=agent2=>{if(!(agent2&&typeof agent2.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},map4to6=entries2=>{for(let entry of entries2)entry.family!==6&&(entry.address=`::ffff:${entry.address}`,entry.family=6)},getIfaceInfo=()=>{let has4=!1,has6=!1;for(let device of Object.values(import_node_os.default.networkInterfaces()))for(let iface of device)if(!iface.internal&&(iface.family==="IPv6"?has6=!0:has4=!0,has4&&has6))return{has4,has6};return{has4,has6}},isIterable=map=>Symbol.iterator in map,ignoreNoResultErrors=dnsPromise=>dnsPromise.catch(error=>{if(error.code==="ENODATA"||error.code==="ENOTFOUND"||error.code==="ENOENT")return[];throw error}),ttl={ttl:!0},all={all:!0},all4={all:!0,family:4},all6={all:!0,family:6},CacheableLookup=class{constructor({cache:cache3=new Map,maxTtl=1/0,fallbackDuration=3600,errorTtl=.15,resolver=new AsyncResolver,lookup=import_node_dns.lookup}={}){if(this.maxTtl=maxTtl,this.errorTtl=errorTtl,this._cache=cache3,this._resolver=resolver,this._dnsLookup=lookup&&(0,import_node_util6.promisify)(lookup),this.stats={cache:0,query:0},this._resolver instanceof AsyncResolver?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=(0,import_node_util6.promisify)(this._resolver.resolve4.bind(this._resolver)),this._resolve6=(0,import_node_util6.promisify)(this._resolver.resolve6.bind(this._resolver))),this._iface=getIfaceInfo(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=fallbackDuration,fallbackDuration>0){let interval=setInterval(()=>{this._hostnamesToFallback.clear()},fallbackDuration*1e3);interval.unref&&interval.unref(),this._fallbackInterval=interval}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(servers){this.clear(),this._resolver.setServers(servers)}get servers(){return this._resolver.getServers()}lookup(hostname,options,callback){if(typeof options=="function"?(callback=options,options={}):typeof options=="number"&&(options={family:options}),!callback)throw new Error("Callback must be a function.");this.lookupAsync(hostname,options).then(result=>{options.all?callback(null,result):callback(null,result.address,result.family,result.expires,result.ttl,result.source)},callback)}async lookupAsync(hostname,options={}){typeof options=="number"&&(options={family:options});let cached=await this.query(hostname);if(options.family===6){let filtered=cached.filter(entry=>entry.family===6);options.hints&import_node_dns.V4MAPPED&&(supportsALL&&options.hints&import_node_dns.ALL||filtered.length===0)?map4to6(cached):cached=filtered}else options.family===4&&(cached=cached.filter(entry=>entry.family===4));if(options.hints&import_node_dns.ADDRCONFIG){let{_iface}=this;cached=cached.filter(entry=>entry.family===6?_iface.has6:_iface.has4)}if(cached.length===0){let error=new Error(`cacheableLookup ENOTFOUND ${hostname}`);throw error.code="ENOTFOUND",error.hostname=hostname,error}return options.all?cached:cached[0]}async query(hostname){let source="cache",cached=await this._cache.get(hostname);if(cached&&this.stats.cache++,!cached){let pending=this._pending[hostname];if(pending)this.stats.cache++,cached=await pending;else{source="query";let newPromise=this.queryAndCache(hostname);this._pending[hostname]=newPromise,this.stats.query++;try{cached=await newPromise}finally{delete this._pending[hostname]}}}return cached=cached.map(entry=>({...entry,source})),cached}async _resolve(hostname){let[A2,AAAA]=await Promise.all([ignoreNoResultErrors(this._resolve4(hostname,ttl)),ignoreNoResultErrors(this._resolve6(hostname,ttl))]),aTtl=0,aaaaTtl=0,cacheTtl=0,now=Date.now();for(let entry of A2)entry.family=4,entry.expires=now+entry.ttl*1e3,aTtl=Math.max(aTtl,entry.ttl);for(let entry of AAAA)entry.family=6,entry.expires=now+entry.ttl*1e3,aaaaTtl=Math.max(aaaaTtl,entry.ttl);return A2.length>0?AAAA.length>0?cacheTtl=Math.min(aTtl,aaaaTtl):cacheTtl=aTtl:cacheTtl=aaaaTtl,{entries:[...A2,...AAAA],cacheTtl}}async _lookup(hostname){try{let[A2,AAAA]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(hostname,all4)),ignoreNoResultErrors(this._dnsLookup(hostname,all6))]);return{entries:[...A2,...AAAA],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(hostname,data,cacheTtl){if(this.maxTtl>0&&cacheTtl>0){cacheTtl=Math.min(cacheTtl,this.maxTtl)*1e3,data[kExpires]=Date.now()+cacheTtl;try{await this._cache.set(hostname,data,cacheTtl)}catch(error){this.lookupAsync=async()=>{let cacheError=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw cacheError.cause=error,cacheError}}isIterable(this._cache)&&this._tick(cacheTtl)}}async queryAndCache(hostname){if(this._hostnamesToFallback.has(hostname))return this._dnsLookup(hostname,all);let query=await this._resolve(hostname);query.entries.length===0&&this._dnsLookup&&(query=await this._lookup(hostname),query.entries.length!==0&&this.fallbackDuration>0&&this._hostnamesToFallback.add(hostname));let cacheTtl=query.entries.length===0?this.errorTtl:query.cacheTtl;return await this._set(hostname,query.entries,cacheTtl),query.entries}_tick(ms){let nextRemovalTime=this._nextRemovalTime;(!nextRemovalTime||ms<nextRemovalTime)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=ms,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let nextExpiry=1/0,now=Date.now();for(let[hostname,entries2]of this._cache){let expires=entries2[kExpires];now>=expires?this._cache.delete(hostname):expires<nextExpiry&&(nextExpiry=expires)}nextExpiry!==1/0&&this._tick(nextExpiry-now)},ms),this._removalTimeout.unref&&this._removalTimeout.unref())}install(agent2){if(verifyAgent(agent2),kCacheableLookupCreateConnection in agent2)throw new Error("CacheableLookup has been already installed");agent2[kCacheableLookupCreateConnection]=agent2.createConnection,agent2[kCacheableLookupInstance]=this,agent2.createConnection=(options,callback)=>("lookup"in options||(options.lookup=this.lookup),agent2[kCacheableLookupCreateConnection](options,callback))}uninstall(agent2){if(verifyAgent(agent2),agent2[kCacheableLookupCreateConnection]){if(agent2[kCacheableLookupInstance]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");agent2.createConnection=agent2[kCacheableLookupCreateConnection],delete agent2[kCacheableLookupCreateConnection],delete agent2[kCacheableLookupInstance]}}updateInterfaceInfo(){let{_iface}=this;this._iface=getIfaceInfo(),(_iface.has4&&!this._iface.has4||_iface.has6&&!this._iface.has6)&&this._cache.clear()}clear(hostname){if(hostname){this._cache.delete(hostname);return}this._cache.clear()}},import_http2_wrapper=__toESM2(require_source2(),1);function parseLinkHeader(link){let parsed=[],items=link.split(",");for(let item of items){let[rawUriReference,...rawLinkParameters]=item.split(";"),trimmedUriReference=rawUriReference.trim();if(trimmedUriReference[0]!=="<"||trimmedUriReference[trimmedUriReference.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${trimmedUriReference}`);let reference=trimmedUriReference.slice(1,-1),parameters={};if(rawLinkParameters.length===0)throw new Error(`Unexpected end of Link header parameters: ${rawLinkParameters.join(";")}`);for(let rawParameter of rawLinkParameters){let trimmedRawParameter=rawParameter.trim(),center=trimmedRawParameter.indexOf("=");if(center===-1)throw new Error(`Failed to parse Link header: ${link}`);let name=trimmedRawParameter.slice(0,center).trim(),value=trimmedRawParameter.slice(center+1).trim();parameters[name]=value}parsed.push({reference,parameters})}return parsed}var[major,minor]=import_node_process2.default.versions.node.split(".").map(Number);function validateSearchParameters(searchParameters){for(let key in searchParameters){let value=searchParameters[key];assert.any([dist_default2.string,dist_default2.number,dist_default2.boolean,dist_default2.null_,dist_default2.undefined],value)}}var globalCache=new Map,globalDnsCache,getGlobalDnsCache=()=>globalDnsCache||(globalDnsCache=new CacheableLookup,globalDnsCache),defaultInternals={request:void 0,agent:{http:void 0,https:void 0,http2:void 0},h2session:void 0,decompress:!0,timeout:{connect:void 0,lookup:void 0,read:void 0,request:void 0,response:void 0,secureConnect:void 0,send:void 0,socket:void 0},prefixUrl:"",body:void 0,form:void 0,json:void 0,cookieJar:void 0,ignoreInvalidCookies:!1,searchParams:void 0,dnsLookup:void 0,dnsCache:void 0,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:!0,maxRedirects:10,cache:void 0,throwHttpErrors:!0,username:"",password:"",http2:!1,allowGetBody:!1,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:!1,dnsLookupIpVersion:void 0,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue})=>computedValue,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:void 0,method:"GET",createConnection:void 0,cacheOptions:{shared:void 0,cacheHeuristic:void 0,immutableMinTimeToLive:void 0,ignoreCargoCult:void 0},https:{alpnProtocols:void 0,rejectUnauthorized:void 0,checkServerIdentity:void 0,certificateAuthority:void 0,key:void 0,certificate:void 0,passphrase:void 0,pfx:void 0,ciphers:void 0,honorCipherOrder:void 0,minVersion:void 0,maxVersion:void 0,signatureAlgorithms:void 0,tlsSessionLifetime:void 0,dhparam:void 0,ecdhCurve:void 0,certificateRevocationLists:void 0},encoding:void 0,resolveBodyOnly:!1,isStream:!1,responseType:"text",url:void 0,pagination:{transform(response){return response.request.options.responseType==="json"?response.body:JSON.parse(response.body)},paginate({response}){let rawLinkHeader=response.headers.link;if(typeof rawLinkHeader!="string"||rawLinkHeader.trim()==="")return!1;let next=parseLinkHeader(rawLinkHeader).find(entry=>entry.parameters.rel==="next"||entry.parameters.rel==='"next"');return next?{url:new import_node_url5.URL(next.reference,response.url)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:!1},setHost:!0,maxHeaderSize:void 0,signal:void 0,enableUnixSockets:!0},cloneInternals=internals=>{let{hooks,retry}=internals,result={...internals,context:{...internals.context},cacheOptions:{...internals.cacheOptions},https:{...internals.https},agent:{...internals.agent},headers:{...internals.headers},retry:{...retry,errorCodes:[...retry.errorCodes],methods:[...retry.methods],statusCodes:[...retry.statusCodes]},timeout:{...internals.timeout},hooks:{init:[...hooks.init],beforeRequest:[...hooks.beforeRequest],beforeError:[...hooks.beforeError],beforeRedirect:[...hooks.beforeRedirect],beforeRetry:[...hooks.beforeRetry],afterResponse:[...hooks.afterResponse]},searchParams:internals.searchParams?new import_node_url5.URLSearchParams(internals.searchParams):void 0,pagination:{...internals.pagination}};return result.url!==void 0&&(result.prefixUrl=""),result},cloneRaw=raw=>{let{hooks,retry}=raw,result={...raw};return dist_default2.object(raw.context)&&(result.context={...raw.context}),dist_default2.object(raw.cacheOptions)&&(result.cacheOptions={...raw.cacheOptions}),dist_default2.object(raw.https)&&(result.https={...raw.https}),dist_default2.object(raw.cacheOptions)&&(result.cacheOptions={...result.cacheOptions}),dist_default2.object(raw.agent)&&(result.agent={...raw.agent}),dist_default2.object(raw.headers)&&(result.headers={...raw.headers}),dist_default2.object(retry)&&(result.retry={...retry},dist_default2.array(retry.errorCodes)&&(result.retry.errorCodes=[...retry.errorCodes]),dist_default2.array(retry.methods)&&(result.retry.methods=[...retry.methods]),dist_default2.array(retry.statusCodes)&&(result.retry.statusCodes=[...retry.statusCodes])),dist_default2.object(raw.timeout)&&(result.timeout={...raw.timeout}),dist_default2.object(hooks)&&(result.hooks={...hooks},dist_default2.array(hooks.init)&&(result.hooks.init=[...hooks.init]),dist_default2.array(hooks.beforeRequest)&&(result.hooks.beforeRequest=[...hooks.beforeRequest]),dist_default2.array(hooks.beforeError)&&(result.hooks.beforeError=[...hooks.beforeError]),dist_default2.array(hooks.beforeRedirect)&&(result.hooks.beforeRedirect=[...hooks.beforeRedirect]),dist_default2.array(hooks.beforeRetry)&&(result.hooks.beforeRetry=[...hooks.beforeRetry]),dist_default2.array(hooks.afterResponse)&&(result.hooks.afterResponse=[...hooks.afterResponse])),dist_default2.object(raw.pagination)&&(result.pagination={...raw.pagination}),result},getHttp2TimeoutOption=internals=>{let delays=[internals.timeout.socket,internals.timeout.connect,internals.timeout.lookup,internals.timeout.request,internals.timeout.secureConnect].filter(delay2=>typeof delay2=="number");if(delays.length>0)return Math.min(...delays)},init=(options,withOptions,self2)=>{var _a;let initHooks=(_a=options.hooks)==null?void 0:_a.init;if(initHooks)for(let hook of initHooks)hook(withOptions,self2)},Options=class{constructor(input,options,defaults2){if(Object.defineProperty(this,"_unixOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_internals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_merging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_init",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),assert.any([dist_default2.string,dist_default2.urlInstance,dist_default2.object,dist_default2.undefined],input),assert.any([dist_default2.object,dist_default2.undefined],options),assert.any([dist_default2.object,dist_default2.undefined],defaults2),input instanceof Options||options instanceof Options)throw new TypeError("The defaults must be passed as the third argument");this._internals=cloneInternals((defaults2==null?void 0:defaults2._internals)??defaults2??defaultInternals),this._init=[...(defaults2==null?void 0:defaults2._init)??[]],this._merging=!1,this._unixOptions=void 0;try{if(dist_default2.plainObject(input))try{this.merge(input),this.merge(options)}finally{this.url=input.url}else try{this.merge(options)}finally{if((options==null?void 0:options.url)!==void 0)if(input===void 0)this.url=options.url;else throw new TypeError("The `url` option is mutually exclusive with the `input` argument");else input!==void 0&&(this.url=input)}}catch(error){throw error.options=this,error}}merge(options){if(options){if(options instanceof Options){for(let init2 of options._init)this.merge(init2);return}options=cloneRaw(options),init(this,options,this),init(options,options,this),this._merging=!0,"isStream"in options&&(this.isStream=options.isStream);try{let push=!1;for(let key in options)if(!(key==="mutableDefaults"||key==="handlers")&&key!=="url"){if(!(key in this))throw new Error(`Unexpected option: ${key}`);this[key]=options[key],push=!0}push&&this._init.push(options)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(value){assert.any([dist_default2.function_,dist_default2.undefined],value),this._internals.request=value}get agent(){return this._internals.agent}set agent(value){assert.plainObject(value);for(let key in value){if(!(key in this._internals.agent))throw new TypeError(`Unexpected agent option: ${key}`);assert.any([dist_default2.object,dist_default2.undefined],value[key])}this._merging?Object.assign(this._internals.agent,value):this._internals.agent={...value}}get h2session(){return this._internals.h2session}set h2session(value){this._internals.h2session=value}get decompress(){return this._internals.decompress}set decompress(value){assert.boolean(value),this._internals.decompress=value}get timeout(){return this._internals.timeout}set timeout(value){assert.plainObject(value);for(let key in value){if(!(key in this._internals.timeout))throw new Error(`Unexpected timeout option: ${key}`);assert.any([dist_default2.number,dist_default2.undefined],value[key])}this._merging?Object.assign(this._internals.timeout,value):this._internals.timeout={...value}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(value){if(assert.any([dist_default2.string,dist_default2.urlInstance],value),value===""){this._internals.prefixUrl="";return}if(value=value.toString(),value.endsWith("/")||(value+="/"),this._internals.prefixUrl&&this._internals.url){let{href}=this._internals.url;this._internals.url.href=value+href.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=value}get body(){return this._internals.body}set body(value){assert.any([dist_default2.string,dist_default2.buffer,dist_default2.nodeStream,dist_default2.generator,dist_default2.asyncGenerator,isFormData,dist_default2.undefined],value),dist_default2.nodeStream(value)&&assert.truthy(value.readable),value!==void 0&&(assert.undefined(this._internals.form),assert.undefined(this._internals.json)),this._internals.body=value}get form(){return this._internals.form}set form(value){assert.any([dist_default2.plainObject,dist_default2.undefined],value),value!==void 0&&(assert.undefined(this._internals.body),assert.undefined(this._internals.json)),this._internals.form=value}get json(){return this._internals.json}set json(value){value!==void 0&&(assert.undefined(this._internals.body),assert.undefined(this._internals.form)),this._internals.json=value}get url(){return this._internals.url}set url(value){if(assert.any([dist_default2.string,dist_default2.urlInstance,dist_default2.undefined],value),value===void 0){this._internals.url=void 0;return}if(dist_default2.string(value)&&value.startsWith("/"))throw new Error("`url` must not start with a slash");let urlString=`${this.prefixUrl}${value.toString()}`,url=new import_node_url5.URL(urlString);if(this._internals.url=url,decodeURI(urlString),url.protocol==="unix:"&&(url.href=`http://unix${url.pathname}${url.search}`),url.protocol!=="http:"&&url.protocol!=="https:"){let error=new Error(`Unsupported protocol: ${url.protocol}`);throw error.code="ERR_UNSUPPORTED_PROTOCOL",error}if(this._internals.username&&(url.username=this._internals.username,this._internals.username=""),this._internals.password&&(url.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(url.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),url.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let matches=/(?<socketPath>.+?):(?<path>.+)/.exec(`${url.pathname}${url.search}`);if(matches!=null&&matches.groups){let{socketPath,path:path13}=matches.groups;this._unixOptions={socketPath,path:path13,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(value){if(assert.any([dist_default2.object,dist_default2.undefined],value),value===void 0){this._internals.cookieJar=void 0;return}let{setCookie,getCookieString}=value;assert.function_(setCookie),assert.function_(getCookieString),setCookie.length===4&&getCookieString.length===0?(setCookie=(0,import_node_util5.promisify)(setCookie.bind(value)),getCookieString=(0,import_node_util5.promisify)(getCookieString.bind(value)),this._internals.cookieJar={setCookie,getCookieString}):this._internals.cookieJar=value}get signal(){return this._internals.signal}set signal(value){assert.object(value),this._internals.signal=value}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(value){assert.boolean(value),this._internals.ignoreInvalidCookies=value}get searchParams(){return this._internals.url?this._internals.url.searchParams:(this._internals.searchParams===void 0&&(this._internals.searchParams=new import_node_url5.URLSearchParams),this._internals.searchParams)}set searchParams(value){assert.any([dist_default2.string,dist_default2.object,dist_default2.undefined],value);let url=this._internals.url;if(value===void 0){this._internals.searchParams=void 0,url&&(url.search="");return}let searchParameters=this.searchParams,updated;if(dist_default2.string(value))updated=new import_node_url5.URLSearchParams(value);else if(value instanceof import_node_url5.URLSearchParams)updated=value;else{validateSearchParameters(value),updated=new import_node_url5.URLSearchParams;for(let key in value){let entry=value[key];entry===null?updated.append(key,""):entry===void 0?searchParameters.delete(key):updated.append(key,entry)}}if(this._merging){for(let key of updated.keys())searchParameters.delete(key);for(let[key,value2]of updated)searchParameters.append(key,value2)}else url?url.search=searchParameters.toString():this._internals.searchParams=searchParameters}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(_value){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(value){assert.any([dist_default2.function_,dist_default2.undefined],value),this._internals.dnsLookup=value}get dnsCache(){return this._internals.dnsCache}set dnsCache(value){assert.any([dist_default2.object,dist_default2.boolean,dist_default2.undefined],value),value===!0?this._internals.dnsCache=getGlobalDnsCache():value===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=value}get context(){return this._internals.context}set context(value){assert.object(value),this._merging?Object.assign(this._internals.context,value):this._internals.context={...value}}get hooks(){return this._internals.hooks}set hooks(value){assert.object(value);for(let knownHookEvent in value){if(!(knownHookEvent in this._internals.hooks))throw new Error(`Unexpected hook event: ${knownHookEvent}`);let typedKnownHookEvent=knownHookEvent,hooks=value[typedKnownHookEvent];if(assert.any([dist_default2.array,dist_default2.undefined],hooks),hooks)for(let hook of hooks)assert.function_(hook);if(this._merging)hooks&&this._internals.hooks[typedKnownHookEvent].push(...hooks);else{if(!hooks)throw new Error(`Missing hook event: ${knownHookEvent}`);this._internals.hooks[knownHookEvent]=[...hooks]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(value){assert.boolean(value),this._internals.followRedirect=value}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(_value){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(value){assert.number(value),this._internals.maxRedirects=value}get cache(){return this._internals.cache}set cache(value){assert.any([dist_default2.object,dist_default2.string,dist_default2.boolean,dist_default2.undefined],value),value===!0?this._internals.cache=globalCache:value===!1?this._internals.cache=void 0:this._internals.cache=value}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(value){assert.boolean(value),this._internals.throwHttpErrors=value}get username(){let url=this._internals.url,value=url?url.username:this._internals.username;return decodeURIComponent(value)}set username(value){assert.string(value);let url=this._internals.url,fixedValue=encodeURIComponent(value);url?url.username=fixedValue:this._internals.username=fixedValue}get password(){let url=this._internals.url,value=url?url.password:this._internals.password;return decodeURIComponent(value)}set password(value){assert.string(value);let url=this._internals.url,fixedValue=encodeURIComponent(value);url?url.password=fixedValue:this._internals.password=fixedValue}get http2(){return this._internals.http2}set http2(value){assert.boolean(value),this._internals.http2=value}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(value){assert.boolean(value),this._internals.allowGetBody=value}get headers(){return this._internals.headers}set headers(value){assert.plainObject(value),this._merging?Object.assign(this._internals.headers,lowercaseKeys(value)):this._internals.headers=lowercaseKeys(value)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(value){assert.boolean(value),this._internals.methodRewriting=value}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(value){if(value!==void 0&&value!==4&&value!==6)throw new TypeError(`Invalid DNS lookup IP version: ${value}`);this._internals.dnsLookupIpVersion=value}get parseJson(){return this._internals.parseJson}set parseJson(value){assert.function_(value),this._internals.parseJson=value}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(value){assert.function_(value),this._internals.stringifyJson=value}get retry(){return this._internals.retry}set retry(value){if(assert.plainObject(value),assert.any([dist_default2.function_,dist_default2.undefined],value.calculateDelay),assert.any([dist_default2.number,dist_default2.undefined],value.maxRetryAfter),assert.any([dist_default2.number,dist_default2.undefined],value.limit),assert.any([dist_default2.array,dist_default2.undefined],value.methods),assert.any([dist_default2.array,dist_default2.undefined],value.statusCodes),assert.any([dist_default2.array,dist_default2.undefined],value.errorCodes),assert.any([dist_default2.number,dist_default2.undefined],value.noise),value.noise&&Math.abs(value.noise)>100)throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${value.noise}`);for(let key in value)if(!(key in this._internals.retry))throw new Error(`Unexpected retry option: ${key}`);this._merging?Object.assign(this._internals.retry,value):this._internals.retry={...value};let{retry}=this._internals;retry.methods=[...new Set(retry.methods.map(method=>method.toUpperCase()))],retry.statusCodes=[...new Set(retry.statusCodes)],retry.errorCodes=[...new Set(retry.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(value){assert.any([dist_default2.string,dist_default2.undefined],value),this._internals.localAddress=value}get method(){return this._internals.method}set method(value){assert.string(value),this._internals.method=value.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(value){assert.any([dist_default2.function_,dist_default2.undefined],value),this._internals.createConnection=value}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(value){assert.plainObject(value),assert.any([dist_default2.boolean,dist_default2.undefined],value.shared),assert.any([dist_default2.number,dist_default2.undefined],value.cacheHeuristic),assert.any([dist_default2.number,dist_default2.undefined],value.immutableMinTimeToLive),assert.any([dist_default2.boolean,dist_default2.undefined],value.ignoreCargoCult);for(let key in value)if(!(key in this._internals.cacheOptions))throw new Error(`Cache option \`${key}\` does not exist`);this._merging?Object.assign(this._internals.cacheOptions,value):this._internals.cacheOptions={...value}}get https(){return this._internals.https}set https(value){assert.plainObject(value),assert.any([dist_default2.boolean,dist_default2.undefined],value.rejectUnauthorized),assert.any([dist_default2.function_,dist_default2.undefined],value.checkServerIdentity),assert.any([dist_default2.string,dist_default2.object,dist_default2.array,dist_default2.undefined],value.certificateAuthority),assert.any([dist_default2.string,dist_default2.object,dist_default2.array,dist_default2.undefined],value.key),assert.any([dist_default2.string,dist_default2.object,dist_default2.array,dist_default2.undefined],value.certificate),assert.any([dist_default2.string,dist_default2.undefined],value.passphrase),assert.any([dist_default2.string,dist_default2.buffer,dist_default2.array,dist_default2.undefined],value.pfx),assert.any([dist_default2.array,dist_default2.undefined],value.alpnProtocols),assert.any([dist_default2.string,dist_default2.undefined],value.ciphers),assert.any([dist_default2.string,dist_default2.buffer,dist_default2.undefined],value.dhparam),assert.any([dist_default2.string,dist_default2.undefined],value.signatureAlgorithms),assert.any([dist_default2.string,dist_default2.undefined],value.minVersion),assert.any([dist_default2.string,dist_default2.undefined],value.maxVersion),assert.any([dist_default2.boolean,dist_default2.undefined],value.honorCipherOrder),assert.any([dist_default2.number,dist_default2.undefined],value.tlsSessionLifetime),assert.any([dist_default2.string,dist_default2.undefined],value.ecdhCurve),assert.any([dist_default2.string,dist_default2.buffer,dist_default2.array,dist_default2.undefined],value.certificateRevocationLists);for(let key in value)if(!(key in this._internals.https))throw new Error(`HTTPS option \`${key}\` does not exist`);this._merging?Object.assign(this._internals.https,value):this._internals.https={...value}}get encoding(){return this._internals.encoding}set encoding(value){if(value===null)throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");assert.any([dist_default2.string,dist_default2.undefined],value),this._internals.encoding=value}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(value){assert.boolean(value),this._internals.resolveBodyOnly=value}get isStream(){return this._internals.isStream}set isStream(value){assert.boolean(value),this._internals.isStream=value}get responseType(){return this._internals.responseType}set responseType(value){if(value===void 0){this._internals.responseType="text";return}if(value!=="text"&&value!=="buffer"&&value!=="json")throw new Error(`Invalid \`responseType\` option: ${value}`);this._internals.responseType=value}get pagination(){return this._internals.pagination}set pagination(value){assert.object(value),this._merging?Object.assign(this._internals.pagination,value):this._internals.pagination=value}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(_value){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(value){assert.boolean(value),this._internals.setHost=value}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(value){assert.any([dist_default2.number,dist_default2.undefined],value),this._internals.maxHeaderSize=value}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(value){assert.boolean(value),this._internals.enableUnixSockets=value}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](_depth,options){return(0,import_node_util5.inspect)(this._internals,options)}createNativeRequestOptions(){var _a;let internals=this._internals,url=internals.url,agent2;url.protocol==="https:"?agent2=internals.http2?internals.agent:internals.agent.https:agent2=internals.agent.http;let{https:https22}=internals,{pfx}=https22;return dist_default2.array(pfx)&&dist_default2.plainObject(pfx[0])&&(pfx=pfx.map(object=>({buf:object.buffer,passphrase:object.passphrase}))),{...internals.cacheOptions,...this._unixOptions,ALPNProtocols:https22.alpnProtocols,ca:https22.certificateAuthority,cert:https22.certificate,key:https22.key,passphrase:https22.passphrase,pfx:https22.pfx,rejectUnauthorized:https22.rejectUnauthorized,checkServerIdentity:https22.checkServerIdentity??import_node_tls.checkServerIdentity,ciphers:https22.ciphers,honorCipherOrder:https22.honorCipherOrder,minVersion:https22.minVersion,maxVersion:https22.maxVersion,sigalgs:https22.signatureAlgorithms,sessionTimeout:https22.tlsSessionLifetime,dhparam:https22.dhparam,ecdhCurve:https22.ecdhCurve,crl:https22.certificateRevocationLists,lookup:internals.dnsLookup??((_a=internals.dnsCache)==null?void 0:_a.lookup),family:internals.dnsLookupIpVersion,agent:agent2,setHost:internals.setHost,method:internals.method,maxHeaderSize:internals.maxHeaderSize,localAddress:internals.localAddress,headers:internals.headers,createConnection:internals.createConnection,timeout:internals.http2?getHttp2TimeoutOption(internals):void 0,h2session:internals.h2session}}getRequestFunction(){let url=this._internals.url,{request}=this._internals;return!request&&url?this.getFallbackRequestFunction():request}getFallbackRequestFunction(){let url=this._internals.url;if(url){if(url.protocol==="https:"){if(this._internals.http2){if(major<15||major===15&&minor<10){let error=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw error.code="EUNSUPPORTED",error}return import_http2_wrapper.default.auto}return import_node_https2.default.request}return import_node_http4.default.request}}freeze(){let options=this._internals;Object.freeze(options),Object.freeze(options.hooks),Object.freeze(options.hooks.afterResponse),Object.freeze(options.hooks.beforeError),Object.freeze(options.hooks.beforeRedirect),Object.freeze(options.hooks.beforeRequest),Object.freeze(options.hooks.beforeRetry),Object.freeze(options.hooks.init),Object.freeze(options.https),Object.freeze(options.cacheOptions),Object.freeze(options.agent),Object.freeze(options.headers),Object.freeze(options.timeout),Object.freeze(options.retry),Object.freeze(options.retry.errorCodes),Object.freeze(options.retry.methods),Object.freeze(options.retry.statusCodes)}},isResponseOk=response=>{let{statusCode}=response,limitStatusCode=response.request.options.followRedirect?299:399;return statusCode>=200&&statusCode<=limitStatusCode||statusCode===304},ParseError=class extends RequestError{constructor(error,response){let{options}=response.request;super(`${error.message} in "${options.url.toString()}"`,error,response.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},parseBody=(response,responseType,parseJson,encoding)=>{let{rawBody}=response;try{if(responseType==="text")return rawBody.toString(encoding);if(responseType==="json")return rawBody.length===0?"":parseJson(rawBody.toString(encoding));if(responseType==="buffer")return rawBody}catch(error){throw new ParseError(error,response)}throw new ParseError({message:`Unknown body type '${responseType}'`,name:"Error"},response)};function isClientRequest(clientRequest){return clientRequest.writable&&!clientRequest.writableEnded}var is_client_request_default=isClientRequest;function isUnixSocketURL(url){return url.protocol==="unix:"||url.hostname==="unix"}var supportsBrotli=dist_default2.string(import_node_process.default.versions.brotli),methodsWithoutBody=new Set(["GET","HEAD"]),cacheableStore=new WeakableMap,redirectCodes=new Set([300,301,302,303,304,307,308]),proxiedRequestEvents=["socket","connect","continue","information","upgrade"],noop22=()=>{},Request2=class extends import_node_stream3.Duplex{constructor(url,options,defaults2){super({autoDestroy:!1,highWaterMark:0}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_noPipe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"redirectUrls",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopRetry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downloadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_uploadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopReading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pipedServerResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_responseSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bodySize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_unproxyEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isFromCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cannotHaveBody",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_triggerRead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cancelTimeouts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_removeListeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nativeResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_flushed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aborted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_requestInitialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._downloadedSize=0,this._uploadedSize=0,this._stopReading=!1,this._pipedServerResponses=new Set,this._cannotHaveBody=!1,this._unproxyEvents=noop22,this._triggerRead=!1,this._cancelTimeouts=noop22,this._removeListeners=noop22,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=noop22,this.on("pipe",source=>{source.headers&&Object.assign(this.options.headers,source.headers)}),this.on("newListener",event=>{if(event==="retry"&&this.listenerCount("retry")>0)throw new Error("A retry listener has been attached already.")});try{if(this.options=new Options(url,options,defaults2),!this.options.url){if(this.options.prefixUrl==="")throw new TypeError("Missing `url` property");this.options.url=""}this.requestUrl=this.options.url}catch(error){let{options:options2}=error;options2&&(this.options=options2),this.flush=async()=>{this.flush=async()=>{},this.destroy(error)};return}let{body}=this.options;if(dist_default2.nodeStream(body)&&body.once("error",error=>{this._flushed?this._beforeError(new UploadError(error,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new UploadError(error,this))}}),this.options.signal){let abort=()=>{this.destroy(new AbortError2(this))};this.options.signal.aborted?abort():(this.options.signal.addEventListener("abort",abort),this._removeListeners=()=>{this.options.signal.removeEventListener("abort",abort)})}}async flush(){var _a;if(!this._flushed){this._flushed=!0;try{if(await this._finalizeBody(),this.destroyed)return;if(await this._makeRequest(),this.destroyed){(_a=this._request)==null||_a.destroy();return}for(let job of this._jobs)job();this._jobs.length=0,this._requestInitialized=!0}catch(error){this._beforeError(error)}}}_beforeError(error){if(this._stopReading)return;let{response,options}=this,attemptCount=this.retryCount+(error.name==="RetryError"?0:1);this._stopReading=!0,error instanceof RequestError||(error=new RequestError(error.message,error,this));let typedError=error;(async()=>{var _a,_b;if(response!=null&&response.readable&&!response.rawBody&&!((_b=(_a=this._request)==null?void 0:_a.socket)!=null&&_b.destroyed)&&(response.setEncoding(this.readableEncoding),await this._setRawBody(response)&&(response.body=response.rawBody.toString())),this.listenerCount("retry")!==0){let backoff;try{let retryAfter;response&&"retry-after"in response.headers&&(retryAfter=Number(response.headers["retry-after"]),Number.isNaN(retryAfter)?(retryAfter=Date.parse(response.headers["retry-after"])-Date.now(),retryAfter<=0&&(retryAfter=1)):retryAfter*=1e3);let retryOptions=options.retry;backoff=await retryOptions.calculateDelay({attemptCount,retryOptions,error:typedError,retryAfter,computedValue:calculate_retry_delay_default({attemptCount,retryOptions,error:typedError,retryAfter,computedValue:retryOptions.maxRetryAfter??options.timeout.request??Number.POSITIVE_INFINITY})})}catch(error_){this._error(new RequestError(error_.message,error_,this));return}if(backoff){if(await new Promise(resolve3=>{let timeout=setTimeout(resolve3,backoff);this._stopRetry=()=>{clearTimeout(timeout),resolve3()}}),this.destroyed)return;try{for(let hook of this.options.hooks.beforeRetry)await hook(typedError,this.retryCount+1)}catch(error_){this._error(new RequestError(error_.message,error,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,error,updatedOptions=>{let request=new Request2(options.url,updatedOptions,options);return request.retryCount=this.retryCount+1,import_node_process.default.nextTick(()=>{request.flush()}),request});return}}this._error(typedError)})()}_read(){this._triggerRead=!0;let{response}=this;if(response&&!this._stopReading){response.readableLength&&(this._triggerRead=!1);let data;for(;(data=response.read())!==null;){this._downloadedSize+=data.length;let progress=this.downloadProgress;progress.percent<1&&this.emit("downloadProgress",progress),this.push(data)}}}_write(chunk,encoding,callback){let write=()=>{this._writeRequest(chunk,encoding,callback)};this._requestInitialized?write():this._jobs.push(write)}_final(callback){let endRequest=()=>{if(!this._request||this._request.destroyed){callback();return}this._request.end(error=>{var _a;(_a=this._request._writableState)!=null&&_a.errored||(error||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),callback(error))})};this._requestInitialized?endRequest():this._jobs.push(endRequest)}_destroy(error,callback){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body}=this.options;dist_default2.nodeStream(body)&&body.destroy()}this._request&&this._request.destroy(),error!==null&&!dist_default2.undefined(error)&&!(error instanceof RequestError)&&(error=new RequestError(error.message,error,this)),callback(error)}pipe(destination,options){return destination instanceof import_node_http3.ServerResponse&&this._pipedServerResponses.add(destination),super.pipe(destination,options)}unpipe(destination){return destination instanceof import_node_http3.ServerResponse&&this._pipedServerResponses.delete(destination),super.unpipe(destination),this}async _finalizeBody(){let{options}=this,{headers}=options,isForm=!dist_default2.undefined(options.form),isJSON2=!dist_default2.undefined(options.json),isBody=!dist_default2.undefined(options.body),cannotHaveBody=methodsWithoutBody.has(options.method)&&!(options.method==="GET"&&options.allowGetBody);if(this._cannotHaveBody=cannotHaveBody,isForm||isJSON2||isBody){if(cannotHaveBody)throw new TypeError(`The \`${options.method}\` method cannot be used with a body`);let noContentType=!dist_default2.string(headers["content-type"]);if(isBody){if(isFormData(options.body)){let encoder=new FormDataEncoder(options.body);noContentType&&(headers["content-type"]=encoder.headers["Content-Type"]),"Content-Length"in encoder.headers&&(headers["content-length"]=encoder.headers["Content-Length"]),options.body=encoder.encode()}isFormData2(options.body)&&noContentType&&(headers["content-type"]=`multipart/form-data; boundary=${options.body.getBoundary()}`)}else if(isForm){noContentType&&(headers["content-type"]="application/x-www-form-urlencoded");let{form}=options;options.form=void 0,options.body=new import_node_url3.URLSearchParams(form).toString()}else{noContentType&&(headers["content-type"]="application/json");let{json}=options;options.json=void 0,options.body=options.stringifyJson(json)}let uploadBodySize=await getBodySize(options.body,options.headers);dist_default2.undefined(headers["content-length"])&&dist_default2.undefined(headers["transfer-encoding"])&&!cannotHaveBody&&!dist_default2.undefined(uploadBodySize)&&(headers["content-length"]=String(uploadBodySize))}options.responseType==="json"&&!("accept"in options.headers)&&(options.headers.accept="application/json"),this._bodySize=Number(headers["content-length"])||void 0}async _onResponseBase(response){if(this.isAborted)return;let{options}=this,{url}=options;this._nativeResponse=response,options.decompress&&(response=(0,import_decompress_response.default)(response));let statusCode=response.statusCode,typedResponse=response;typedResponse.statusMessage=typedResponse.statusMessage?typedResponse.statusMessage:import_node_http3.default.STATUS_CODES[statusCode],typedResponse.url=options.url.toString(),typedResponse.requestUrl=this.requestUrl,typedResponse.redirectUrls=this.redirectUrls,typedResponse.request=this,typedResponse.isFromCache=this._nativeResponse.fromCache??!1,typedResponse.ip=this.ip,typedResponse.retryCount=this.retryCount,typedResponse.ok=isResponseOk(typedResponse),this._isFromCache=typedResponse.isFromCache,this._responseSize=Number(response.headers["content-length"])||void 0,this.response=typedResponse,response.once("end",()=>{this._responseSize=this._downloadedSize,this.emit("downloadProgress",this.downloadProgress)}),response.once("error",error=>{this._aborted=!0,response.destroy(),this._beforeError(new ReadError(error,this))}),response.once("aborted",()=>{this._aborted=!0,this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let rawCookies=response.headers["set-cookie"];if(dist_default2.object(options.cookieJar)&&rawCookies){let promises=rawCookies.map(async rawCookie=>options.cookieJar.setCookie(rawCookie,url.toString()));options.ignoreInvalidCookies&&(promises=promises.map(async promise=>{try{await promise}catch{}}));try{await Promise.all(promises)}catch(error){this._beforeError(error);return}}if(!this.isAborted){if(options.followRedirect&&response.headers.location&&redirectCodes.has(statusCode)){if(response.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=options.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=void 0;let updatedOptions=new Options(void 0,void 0,this.options),serverRequestedGet=statusCode===303&&updatedOptions.method!=="GET"&&updatedOptions.method!=="HEAD",canRewrite=statusCode!==307&&statusCode!==308,userRequestedGet=updatedOptions.methodRewriting&&canRewrite;(serverRequestedGet||userRequestedGet)&&(updatedOptions.method="GET",updatedOptions.body=void 0,updatedOptions.json=void 0,updatedOptions.form=void 0,delete updatedOptions.headers["content-length"]);try{let redirectBuffer=import_node_buffer3.Buffer.from(response.headers.location,"binary").toString(),redirectUrl=new import_node_url3.URL(redirectBuffer,url);if(!isUnixSocketURL(url)&&isUnixSocketURL(redirectUrl)){this._beforeError(new RequestError("Cannot redirect to UNIX socket",{},this));return}redirectUrl.hostname!==url.hostname||redirectUrl.port!==url.port?("host"in updatedOptions.headers&&delete updatedOptions.headers.host,"cookie"in updatedOptions.headers&&delete updatedOptions.headers.cookie,"authorization"in updatedOptions.headers&&delete updatedOptions.headers.authorization,(updatedOptions.username||updatedOptions.password)&&(updatedOptions.username="",updatedOptions.password="")):(redirectUrl.username=updatedOptions.username,redirectUrl.password=updatedOptions.password),this.redirectUrls.push(redirectUrl),updatedOptions.prefixUrl="",updatedOptions.url=redirectUrl;for(let hook of updatedOptions.hooks.beforeRedirect)await hook(updatedOptions,typedResponse);this.emit("redirect",updatedOptions,typedResponse),this.options=updatedOptions,await this._makeRequest()}catch(error){this._beforeError(error);return}return}if(options.isStream&&options.throwHttpErrors&&!isResponseOk(typedResponse)){this._beforeError(new HTTPError(typedResponse));return}if(response.on("readable",()=>{this._triggerRead&&this._read()}),this.on("resume",()=>{response.resume()}),this.on("pause",()=>{response.pause()}),response.once("end",()=>{this.push(null)}),this._noPipe){await this._setRawBody()&&this.emit("response",response);return}this.emit("response",response);for(let destination of this._pipedServerResponses)if(!destination.headersSent){for(let key in response.headers){let isAllowed=options.decompress?key!=="content-encoding":!0,value=response.headers[key];isAllowed&&destination.setHeader(key,value)}destination.statusCode=statusCode}}}async _setRawBody(from=this){if(from.readableEnded)return!1;try{let rawBody=await(0,import_get_stream2.buffer)(from);if(!this.isAborted)return this.response.rawBody=rawBody,!0}catch{}return!1}async _onResponse(response){try{await this._onResponseBase(response)}catch(error){this._beforeError(error)}}_onRequest(request){let{options}=this,{timeout,url}=options;source_default(request),this.options.http2&&request.setTimeout(0),this._cancelTimeouts=timedOut(request,timeout,url);let responseEventName=options.cache?"cacheableResponse":"response";request.once(responseEventName,response=>{this._onResponse(response)}),request.once("error",error=>{this._aborted=!0,request.destroy(),error=error instanceof TimeoutError2?new TimeoutError(error,this.timings,this):new RequestError(error.message,error,this),this._beforeError(error)}),this._unproxyEvents=proxyEvents(request,this,proxiedRequestEvents),this._request=request,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",request)}async _asyncWrite(chunk){return new Promise((resolve3,reject)=>{super.write(chunk,error=>{if(error){reject(error);return}resolve3()})})}_sendBody(){let{body}=this.options,currentRequest=this.redirectUrls.length===0?this:this._request??this;dist_default2.nodeStream(body)?body.pipe(currentRequest):dist_default2.generator(body)||dist_default2.asyncGenerator(body)?(async()=>{try{for await(let chunk of body)await this._asyncWrite(chunk);super.end()}catch(error){this._beforeError(error)}})():dist_default2.undefined(body)?(this._cannotHaveBody||this._noPipe)&&currentRequest.end():(this._writeRequest(body,void 0,()=>{}),currentRequest.end())}_prepareCache(cache3){if(!cacheableStore.has(cache3)){let cacheableRequest=new dist_default22((requestOptions,handler)=>{let result=requestOptions._request(requestOptions,handler);return dist_default2.promise(result)&&(result.once=(event,handler2)=>{if(event==="error")(async()=>{try{await result}catch(error){handler2(error)}})();else if(event==="abort")(async()=>{try{(await result).once("abort",handler2)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${event}`);return result}),result},cache3);cacheableStore.set(cache3,cacheableRequest.request())}}async _createCacheableRequest(url,options){return new Promise((resolve3,reject)=>{Object.assign(options,urlToOptions(url));let request,cacheRequest=cacheableStore.get(options.cache)(options,async response=>{if(response._readableState.autoDestroy=!1,request){let fix=()=>{response.req&&(response.complete=response.req.res.complete)};response.prependOnceListener("end",fix),fix(),(await request).emit("cacheableResponse",response)}resolve3(response)});cacheRequest.once("error",reject),cacheRequest.once("request",async requestOrPromise=>{request=requestOrPromise,resolve3(request)})})}async _makeRequest(){let{options}=this,{headers,username,password}=options,cookieJar=options.cookieJar;for(let key in headers)if(dist_default2.undefined(headers[key]))delete headers[key];else if(dist_default2.null_(headers[key]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${key}\` header`);if(options.decompress&&dist_default2.undefined(headers["accept-encoding"])&&(headers["accept-encoding"]=supportsBrotli?"gzip, deflate, br":"gzip, deflate"),username||password){let credentials=import_node_buffer3.Buffer.from(`${username}:${password}`).toString("base64");headers.authorization=`Basic ${credentials}`}if(cookieJar){let cookieString=await cookieJar.getCookieString(options.url.toString());dist_default2.nonEmptyString(cookieString)&&(headers.cookie=cookieString)}options.prefixUrl="";let request;for(let hook of options.hooks.beforeRequest){let result=await hook(options);if(!dist_default2.undefined(result)){request=()=>result;break}}request||(request=options.getRequestFunction());let url=options.url;this._requestOptions=options.createNativeRequestOptions(),options.cache&&(this._requestOptions._request=request,this._requestOptions.cache=options.cache,this._requestOptions.body=options.body,this._prepareCache(options.cache));let fn=options.cache?this._createCacheableRequest:request;try{let requestOrResponse=fn(url,this._requestOptions);dist_default2.promise(requestOrResponse)&&(requestOrResponse=await requestOrResponse),dist_default2.undefined(requestOrResponse)&&(requestOrResponse=options.getFallbackRequestFunction()(url,this._requestOptions),dist_default2.promise(requestOrResponse)&&(requestOrResponse=await requestOrResponse)),is_client_request_default(requestOrResponse)?this._onRequest(requestOrResponse):this.writable?(this.once("finish",()=>{this._onResponse(requestOrResponse)}),this._sendBody()):this._onResponse(requestOrResponse)}catch(error){throw error instanceof CacheError2?new CacheError(error,this):error}}async _error(error){try{if(!(error instanceof HTTPError&&!this.options.throwHttpErrors))for(let hook of this.options.hooks.beforeError)error=await hook(error)}catch(error_){error=new RequestError(error_.message,error_,this)}this.destroy(error)}_writeRequest(chunk,encoding,callback){!this._request||this._request.destroyed||this._request.write(chunk,encoding,error=>{if(!error&&!this._request.destroyed){this._uploadedSize+=import_node_buffer3.Buffer.byteLength(chunk,encoding);let progress=this.uploadProgress;progress.percent<1&&this.emit("uploadProgress",progress)}callback(error)})}get ip(){var _a;return(_a=this.socket)==null?void 0:_a.remoteAddress}get isAborted(){return this._aborted}get socket(){var _a;return((_a=this._request)==null?void 0:_a.socket)??void 0}get downloadProgress(){let percent;return this._responseSize?percent=this._downloadedSize/this._responseSize:this._responseSize===this._downloadedSize?percent=1:percent=0,{percent,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let percent;return this._bodySize?percent=this._uploadedSize/this._bodySize:this._bodySize===this._uploadedSize?percent=1:percent=0,{percent,transferred:this._uploadedSize,total:this._bodySize}}get timings(){var _a;return(_a=this._request)==null?void 0:_a.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){var _a;return(_a=this._request)==null?void 0:_a.reusedSocket}},CancelError2=class extends RequestError{constructor(request){super("Promise was canceled",{},request),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},proxiedRequestEvents2=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(firstRequest){let globalRequest,globalResponse,normalizedOptions,emitter=new import_node_events.EventEmitter,promise=new PCancelable((resolve3,reject,onCancel)=>{onCancel(()=>{globalRequest.destroy()}),onCancel.shouldReject=!1,onCancel(()=>{reject(new CancelError2(globalRequest))});let makeRequest=retryCount=>{var _a;onCancel(()=>{});let request=firstRequest??new Request2(void 0,void 0,normalizedOptions);request.retryCount=retryCount,request._noPipe=!0,globalRequest=request,request.once("response",async response=>{let contentEncoding=(response.headers["content-encoding"]??"").toLowerCase(),isCompressed=contentEncoding==="gzip"||contentEncoding==="deflate"||contentEncoding==="br",{options}=request;if(isCompressed&&!options.decompress)response.body=response.rawBody;else try{response.body=parseBody(response,options.responseType,options.parseJson,options.encoding)}catch(error){if(response.body=response.rawBody.toString(),isResponseOk(response)){request._beforeError(error);return}}try{let hooks=options.hooks.afterResponse;for(let[index,hook]of hooks.entries())if(response=await hook(response,async updatedOptions=>{throw options.merge(updatedOptions),options.prefixUrl="",updatedOptions.url&&(options.url=updatedOptions.url),options.hooks.afterResponse=options.hooks.afterResponse.slice(0,index),new RetryError(request)}),!(dist_default2.object(response)&&dist_default2.number(response.statusCode)&&!dist_default2.nullOrUndefined(response.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(error){request._beforeError(error);return}if(globalResponse=response,!isResponseOk(response)){request._beforeError(new HTTPError(response));return}request.destroy(),resolve3(request.options.resolveBodyOnly?response.body:response)});let onError=error=>{if(promise.isCanceled)return;let{options}=request;if(error instanceof HTTPError&&!options.throwHttpErrors){let{response}=error;request.destroy(),resolve3(request.options.resolveBodyOnly?response.body:response);return}reject(error)};request.once("error",onError);let previousBody=(_a=request.options)==null?void 0:_a.body;request.once("retry",(newRetryCount,error)=>{firstRequest=void 0;let newBody=request.options.body;if(previousBody===newBody&&dist_default2.nodeStream(newBody)){error.message="Cannot retry with consumed body stream",onError(error);return}normalizedOptions=request.options,makeRequest(newRetryCount)}),proxyEvents(request,emitter,proxiedRequestEvents2),dist_default2.undefined(firstRequest)&&request.flush()};makeRequest(0)});promise.on=(event,fn)=>(emitter.on(event,fn),promise),promise.off=(event,fn)=>(emitter.off(event,fn),promise);let shortcut=responseType=>{let newPromise=(async()=>{await promise;let{options}=globalResponse.request;return parseBody(globalResponse,responseType,options.parseJson,options.encoding)})();return Object.defineProperties(newPromise,Object.getOwnPropertyDescriptors(promise)),newPromise};return promise.json=()=>{if(globalRequest.options){let{headers}=globalRequest.options;!globalRequest.writableFinished&&!("accept"in headers)&&(headers.accept="application/json")}return shortcut("json")},promise.buffer=()=>shortcut("buffer"),promise.text=()=>shortcut("text"),promise}var delay=async ms=>new Promise(resolve3=>{setTimeout(resolve3,ms)}),isGotInstance=value=>dist_default2.function_(value),aliases=["get","post","put","patch","head","delete"],create=defaults2=>{defaults2={options:new Options(void 0,void 0,defaults2.options),handlers:[...defaults2.handlers],mutableDefaults:defaults2.mutableDefaults},Object.defineProperty(defaults2,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let got2=(url,options,defaultOptions2=defaults2.options)=>{let request=new Request2(url,options,defaultOptions2),promise,lastHandler=normalized=>(request.options=normalized,request._noPipe=!normalized.isStream,request.flush(),normalized.isStream?request:(promise||(promise=asPromise(request)),promise)),iteration=0,iterateHandlers=newOptions=>{let result=(defaults2.handlers[iteration++]??lastHandler)(newOptions,iterateHandlers);if(dist_default2.promise(result)&&!request.options.isStream&&(promise||(promise=asPromise(request)),result!==promise)){let descriptors=Object.getOwnPropertyDescriptors(promise);for(let key in descriptors)key in result&&delete descriptors[key];Object.defineProperties(result,descriptors),result.cancel=promise.cancel}return result};return iterateHandlers(request.options)};got2.extend=(...instancesOrOptions)=>{let options=new Options(void 0,void 0,defaults2.options),handlers=[...defaults2.handlers],mutableDefaults;for(let value of instancesOrOptions)isGotInstance(value)?(options.merge(value.defaults.options),handlers.push(...value.defaults.handlers),mutableDefaults=value.defaults.mutableDefaults):(options.merge(value),value.handlers&&handlers.push(...value.handlers),mutableDefaults=value.mutableDefaults);return create({options,handlers,mutableDefaults:!!mutableDefaults})};let paginateEach=async function*(url,options){let normalizedOptions=new Options(url,options,defaults2.options);normalizedOptions.resolveBodyOnly=!1;let{pagination}=normalizedOptions;assert.function_(pagination.transform),assert.function_(pagination.shouldContinue),assert.function_(pagination.filter),assert.function_(pagination.paginate),assert.number(pagination.countLimit),assert.number(pagination.requestLimit),assert.number(pagination.backoff);let allItems=[],{countLimit}=pagination,numberOfRequests=0;for(;numberOfRequests<pagination.requestLimit;){numberOfRequests!==0&&await delay(pagination.backoff);let response=await got2(void 0,void 0,normalizedOptions),parsed=await pagination.transform(response),currentItems=[];assert.array(parsed);for(let item of parsed)if(pagination.filter({item,currentItems,allItems})&&(!pagination.shouldContinue({item,currentItems,allItems})||(yield item,pagination.stackAllItems&&allItems.push(item),currentItems.push(item),--countLimit<=0)))return;let optionsToMerge=pagination.paginate({response,currentItems,allItems});if(optionsToMerge===!1)return;optionsToMerge===response.request.options?normalizedOptions=response.request.options:(normalizedOptions.merge(optionsToMerge),assert.any([dist_default2.urlInstance,dist_default2.undefined],optionsToMerge.url),optionsToMerge.url!==void 0&&(normalizedOptions.prefixUrl="",normalizedOptions.url=optionsToMerge.url)),numberOfRequests++}};got2.paginate=paginateEach,got2.paginate.all=async(url,options)=>{let results=[];for await(let item of paginateEach(url,options))results.push(item);return results},got2.paginate.each=paginateEach,got2.stream=(url,options)=>got2(url,{...options,isStream:!0});for(let method of aliases)got2[method]=(url,options)=>got2(url,{...options,method}),got2.stream[method]=(url,options)=>got2(url,{...options,method,isStream:!0});return defaults2.mutableDefaults||(Object.freeze(defaults2.handlers),defaults2.options.freeze()),Object.defineProperty(got2,"defaults",{value:defaults2,writable:!1,configurable:!1,enumerable:!0}),got2},create_default=create,defaults={options:new Options,handlers:[],mutableDefaults:!1},got=create_default(defaults);var agentOpts={keepAlive:!0,maxSockets:20},agent={http:new import_http2.Agent(agentOpts),https:new import_https2.Agent(agentOpts)};var import_get_npm_tarball_url=__toESM(require_lib()),tempy2=__toESM(require_tempy());var import_semver2=require("semver");var ProjectType=(ProjectType2=>(ProjectType2.UNDETECTED="UNDETECTED",ProjectType2.UNSUPPORTED="UNSUPPORTED",ProjectType2.REACT="REACT",ProjectType2.REACT_SCRIPTS="REACT_SCRIPTS",ProjectType2.REACT_NATIVE="REACT_NATIVE",ProjectType2.REACT_PROJECT="REACT_PROJECT",ProjectType2.WEBPACK_REACT="WEBPACK_REACT",ProjectType2.NEXTJS="NEXTJS",ProjectType2.VUE="VUE",ProjectType2.VUE3="VUE3",ProjectType2.SFC_VUE="SFC_VUE",ProjectType2.ANGULAR="ANGULAR",ProjectType2.EMBER="EMBER",ProjectType2.WEB_COMPONENTS="WEB_COMPONENTS",ProjectType2.HTML="HTML",ProjectType2.QWIK="QWIK",ProjectType2.PREACT="PREACT",ProjectType2.SVELTE="SVELTE",ProjectType2.SVELTEKIT="SVELTEKIT",ProjectType2.SERVER="SERVER",ProjectType2.NX="NX",ProjectType2.SOLID="SOLID",ProjectType2))(ProjectType||{});var notInstallableProjectTypes=["UNDETECTED","UNSUPPORTED","NX"],installableProjectTypes=Object.values(ProjectType).filter(type=>!notInstallableProjectTypes.includes(type)).map(type=>type.toLowerCase());var versions_default={"@storybook/addon-a11y":"7.6.18","@storybook/addon-actions":"7.6.18","@storybook/addon-backgrounds":"7.6.18","@storybook/addon-controls":"7.6.18","@storybook/addon-docs":"7.6.18","@storybook/addon-essentials":"7.6.18","@storybook/addon-highlight":"7.6.18","@storybook/addon-interactions":"7.6.18","@storybook/addon-jest":"7.6.18","@storybook/addon-links":"7.6.18","@storybook/addon-mdx-gfm":"7.6.18","@storybook/addon-measure":"7.6.18","@storybook/addon-outline":"7.6.18","@storybook/addon-themes":"7.6.18","@storybook/addon-storyshots":"7.6.18","@storybook/addon-storyshots-puppeteer":"7.6.18","@storybook/addon-storysource":"7.6.18","@storybook/addon-toolbars":"7.6.18","@storybook/addon-viewport":"7.6.18","@storybook/addons":"7.6.18","@storybook/angular":"7.6.18","@storybook/api":"7.6.18","@storybook/blocks":"7.6.18","@storybook/builder-manager":"7.6.18","@storybook/builder-vite":"7.6.18","@storybook/builder-webpack5":"7.6.18","@storybook/channel-postmessage":"7.6.18","@storybook/channel-websocket":"7.6.18","@storybook/channels":"7.6.18","@storybook/cli":"7.6.18","@storybook/client-api":"7.6.18","@storybook/client-logger":"7.6.18","@storybook/codemod":"7.6.18","@storybook/components":"7.6.18","@storybook/core-client":"7.6.18","@storybook/core-common":"7.6.18","@storybook/core-events":"7.6.18","@storybook/core-server":"7.6.18","@storybook/core-webpack":"7.6.18","@storybook/csf-plugin":"7.6.18","@storybook/csf-tools":"7.6.18","@storybook/docs-tools":"7.6.18","@storybook/ember":"7.6.18","@storybook/html":"7.6.18","@storybook/html-vite":"7.6.18","@storybook/html-webpack5":"7.6.18","@storybook/instrumenter":"7.6.18","@storybook/manager":"7.6.18","@storybook/manager-api":"7.6.18","@storybook/nextjs":"7.6.18","@storybook/node-logger":"7.6.18","@storybook/postinstall":"7.6.18","@storybook/preact":"7.6.18","@storybook/preact-vite":"7.6.18","@storybook/preact-webpack5":"7.6.18","@storybook/preset-create-react-app":"7.6.18","@storybook/preset-html-webpack":"7.6.18","@storybook/preset-preact-webpack":"7.6.18","@storybook/preset-react-webpack":"7.6.18","@storybook/preset-server-webpack":"7.6.18","@storybook/preset-svelte-webpack":"7.6.18","@storybook/preset-vue-webpack":"7.6.18","@storybook/preset-vue3-webpack":"7.6.18","@storybook/preset-web-components-webpack":"7.6.18","@storybook/preview":"7.6.18","@storybook/preview-api":"7.6.18","@storybook/preview-web":"7.6.18","@storybook/react":"7.6.18","@storybook/react-dom-shim":"7.6.18","@storybook/react-vite":"7.6.18","@storybook/react-webpack5":"7.6.18","@storybook/router":"7.6.18","@storybook/server":"7.6.18","@storybook/server-webpack5":"7.6.18","@storybook/source-loader":"7.6.18","@storybook/store":"7.6.18","@storybook/svelte":"7.6.18","@storybook/svelte-vite":"7.6.18","@storybook/svelte-webpack5":"7.6.18","@storybook/sveltekit":"7.6.18","@storybook/telemetry":"7.6.18","@storybook/theming":"7.6.18","@storybook/types":"7.6.18","@storybook/test":"7.6.18","@storybook/vue":"7.6.18","@storybook/vue-vite":"7.6.18","@storybook/vue-webpack5":"7.6.18","@storybook/vue3":"7.6.18","@storybook/vue3-vite":"7.6.18","@storybook/vue3-webpack5":"7.6.18","@storybook/web-components":"7.6.18","@storybook/web-components-vite":"7.6.18","@storybook/web-components-webpack5":"7.6.18",sb:"7.6.18",storybook:"7.6.18"};var logger11=console;var commandLog=message=>(process.stdout.write(import_chalk9.default.cyan(" \u2022 ")+message),(errorMessage,errorInfo)=>{if(errorMessage){if(process.stdout.write(`. ${import_chalk9.default.red("\u2716")}
89
+ `),_FormDataEncoder_CRLF_BYTES.set(this,void 0),_FormDataEncoder_CRLF_BYTES_LENGTH.set(this,void 0),_FormDataEncoder_DASHES.set(this,"-".repeat(2)),_FormDataEncoder_encoder.set(this,new TextEncoder),_FormDataEncoder_footer.set(this,void 0),_FormDataEncoder_form.set(this,void 0),_FormDataEncoder_options.set(this,void 0),!isFormData(form))throw new TypeError("Expected first argument to be a FormData instance.");let boundary;if(isPlainObject(boundaryOrOptions)?options=boundaryOrOptions:boundary=boundaryOrOptions,boundary||(boundary=createBoundary()),typeof boundary!="string")throw new TypeError("Expected boundary argument to be a string.");if(options&&!isPlainObject(options))throw new TypeError("Expected options argument to be an object.");__classPrivateFieldSet(this,_FormDataEncoder_form,Array.from(form.entries()),"f"),__classPrivateFieldSet(this,_FormDataEncoder_options,{...defaultOptions,...options},"f"),__classPrivateFieldSet(this,_FormDataEncoder_CRLF_BYTES,__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f")),"f"),__classPrivateFieldSet(this,_FormDataEncoder_CRLF_BYTES_LENGTH,__classPrivateFieldGet(this,_FormDataEncoder_CRLF_BYTES,"f").byteLength,"f"),this.boundary=`form-data-boundary-${boundary}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,__classPrivateFieldSet(this,_FormDataEncoder_footer,__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(`${__classPrivateFieldGet(this,_FormDataEncoder_DASHES,"f")}${this.boundary}${__classPrivateFieldGet(this,_FormDataEncoder_DASHES,"f")}${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f").repeat(2)}`),"f");let headers={"Content-Type":this.contentType},contentLength=__classPrivateFieldGet(this,_FormDataEncoder_instances,"m",_FormDataEncoder_getContentLength).call(this);contentLength&&(this.contentLength=contentLength,headers["Content-Length"]=contentLength),this.headers=proxyHeaders(Object.freeze(headers)),Object.defineProperties(this,{boundary:readonlyProp,contentType:readonlyProp,contentLength:readonlyProp,headers:readonlyProp})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[name,raw]of __classPrivateFieldGet(this,_FormDataEncoder_form,"f")){let value=isFile(raw)?raw:__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(normalizeValue(raw));yield __classPrivateFieldGet(this,_FormDataEncoder_instances,"m",_FormDataEncoder_getFieldHeader).call(this,name,value),yield value,yield __classPrivateFieldGet(this,_FormDataEncoder_CRLF_BYTES,"f")}yield __classPrivateFieldGet(this,_FormDataEncoder_footer,"f")}async*encode(){for(let part of this.values())isFile(part)?yield*getStreamIterator(part.stream()):yield part}[(_FormDataEncoder_CRLF=new WeakMap,_FormDataEncoder_CRLF_BYTES=new WeakMap,_FormDataEncoder_CRLF_BYTES_LENGTH=new WeakMap,_FormDataEncoder_DASHES=new WeakMap,_FormDataEncoder_encoder=new WeakMap,_FormDataEncoder_footer=new WeakMap,_FormDataEncoder_form=new WeakMap,_FormDataEncoder_options=new WeakMap,_FormDataEncoder_instances=new WeakSet,_FormDataEncoder_getFieldHeader=function(name,value){let header="";header+=`${__classPrivateFieldGet(this,_FormDataEncoder_DASHES,"f")}${this.boundary}${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f")}`,header+=`Content-Disposition: form-data; name="${escapeName(name)}"`,isFile(value)&&(header+=`; filename="${escapeName(value.name)}"${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f")}`,header+=`Content-Type: ${value.type||"application/octet-stream"}`);let size=isFile(value)?value.size:value.byteLength;return __classPrivateFieldGet(this,_FormDataEncoder_options,"f").enableAdditionalHeaders===!0&&size!=null&&!isNaN(size)&&(header+=`${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f")}Content-Length: ${isFile(value)?value.size:value.byteLength}`),__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(`${header}${__classPrivateFieldGet(this,_FormDataEncoder_CRLF,"f").repeat(2)}`)},_FormDataEncoder_getContentLength=function(){let length=0;for(let[name,raw]of __classPrivateFieldGet(this,_FormDataEncoder_form,"f")){let value=isFile(raw)?raw:__classPrivateFieldGet(this,_FormDataEncoder_encoder,"f").encode(normalizeValue(raw)),size=isFile(value)?value.size:value.byteLength;if(size==null||isNaN(size))return;length+=__classPrivateFieldGet(this,_FormDataEncoder_instances,"m",_FormDataEncoder_getFieldHeader).call(this,name,value).byteLength,length+=size,length+=__classPrivateFieldGet(this,_FormDataEncoder_CRLF_BYTES_LENGTH,"f")}return String(length+__classPrivateFieldGet(this,_FormDataEncoder_footer,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};function isFormData2(body){return dist_default2.nodeStream(body)&&dist_default2.function_(body.getBoundary)}async function getBodySize(body,headers){if(headers&&"content-length"in headers)return Number(headers["content-length"]);if(!body)return 0;if(dist_default2.string(body))return import_node_buffer4.Buffer.byteLength(body);if(dist_default2.buffer(body))return body.length;if(isFormData2(body))return(0,import_node_util4.promisify)(body.getLength.bind(body))()}function proxyEvents(from,to,events){let eventFunctions={};for(let event of events){let eventFunction=(...args)=>{to.emit(event,...args)};eventFunctions[event]=eventFunction,from.on(event,eventFunction)}return()=>{for(let[event,eventFunction]of Object.entries(eventFunctions))from.off(event,eventFunction)}}function unhandle(){let handlers=[];return{once(origin,event,fn){origin.once(event,fn),handlers.push({origin,event,fn})},unhandleAll(){for(let handler of handlers){let{origin,event,fn}=handler;origin.removeListener(event,fn)}handlers.length=0}}}var reentry=Symbol("reentry"),noop2=()=>{},TimeoutError2=class extends Error{constructor(threshold,event){super(`Timeout awaiting '${event}' for ${threshold}ms`),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:event}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.code="ETIMEDOUT"}};function timedOut(request,delays,options){if(reentry in request)return noop2;request[reentry]=!0;let cancelers=[],{once:once2,unhandleAll}=unhandle(),addTimeout=(delay2,callback,event)=>{var _a;let timeout=setTimeout(callback,delay2,delay2,event);(_a=timeout.unref)==null||_a.call(timeout);let cancel=()=>{clearTimeout(timeout)};return cancelers.push(cancel),cancel},{host,hostname}=options,timeoutHandler=(delay2,event)=>{request.destroy(new TimeoutError2(delay2,event))},cancelTimeouts=()=>{for(let cancel of cancelers)cancel();unhandleAll()};if(request.once("error",error=>{if(cancelTimeouts(),request.listenerCount("error")===0)throw error}),typeof delays.request<"u"){let cancelTimeout=addTimeout(delays.request,timeoutHandler,"request");once2(request,"response",response=>{once2(response,"end",cancelTimeout)})}if(typeof delays.socket<"u"){let{socket}=delays,socketTimeoutHandler=()=>{timeoutHandler(socket,"socket")};request.setTimeout(socket,socketTimeoutHandler),cancelers.push(()=>{request.removeListener("timeout",socketTimeoutHandler)})}let hasLookup=typeof delays.lookup<"u",hasConnect=typeof delays.connect<"u",hasSecureConnect=typeof delays.secureConnect<"u",hasSend=typeof delays.send<"u";return(hasLookup||hasConnect||hasSecureConnect||hasSend)&&once2(request,"socket",socket=>{let{socketPath}=request;if(socket.connecting){let hasPath=!!(socketPath??import_node_net2.default.isIP(hostname??host??"")!==0);if(hasLookup&&!hasPath&&typeof socket.address().address>"u"){let cancelTimeout=addTimeout(delays.lookup,timeoutHandler,"lookup");once2(socket,"lookup",cancelTimeout)}if(hasConnect){let timeConnect=()=>addTimeout(delays.connect,timeoutHandler,"connect");hasPath?once2(socket,"connect",timeConnect()):once2(socket,"lookup",error=>{error===null&&once2(socket,"connect",timeConnect())})}hasSecureConnect&&options.protocol==="https:"&&once2(socket,"connect",()=>{let cancelTimeout=addTimeout(delays.secureConnect,timeoutHandler,"secureConnect");once2(socket,"secureConnect",cancelTimeout)})}if(hasSend){let timeRequest=()=>addTimeout(delays.send,timeoutHandler,"send");socket.connecting?once2(socket,"connect",()=>{once2(request,"upload-complete",timeRequest())}):once2(request,"upload-complete",timeRequest())}}),typeof delays.response<"u"&&once2(request,"upload-complete",()=>{let cancelTimeout=addTimeout(delays.response,timeoutHandler,"response");once2(request,"response",cancelTimeout)}),typeof delays.read<"u"&&once2(request,"response",response=>{let cancelTimeout=addTimeout(delays.read,timeoutHandler,"read");once2(response,"end",cancelTimeout)}),cancelTimeouts}function urlToOptions(url){url=url;let options={protocol:url.protocol,hostname:dist_default2.string(url.hostname)&&url.hostname.startsWith("[")?url.hostname.slice(1,-1):url.hostname,host:url.host,hash:url.hash,search:url.search,pathname:url.pathname,href:url.href,path:`${url.pathname||""}${url.search||""}`};return dist_default2.string(url.port)&&url.port.length>0&&(options.port=Number(url.port)),(url.username||url.password)&&(options.auth=`${url.username||""}:${url.password||""}`),options}var WeakableMap=class{constructor(){Object.defineProperty(this,"weakMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.weakMap=new WeakMap,this.map=new Map}set(key,value){typeof key=="object"?this.weakMap.set(key,value):this.map.set(key,value)}get(key){return typeof key=="object"?this.weakMap.get(key):this.map.get(key)}has(key){return typeof key=="object"?this.weakMap.has(key):this.map.has(key)}},calculateRetryDelay=({attemptCount,retryOptions,error,retryAfter,computedValue})=>{if(error.name==="RetryError")return 1;if(attemptCount>retryOptions.limit)return 0;let hasMethod=retryOptions.methods.includes(error.options.method),hasErrorCode=retryOptions.errorCodes.includes(error.code),hasStatusCode=error.response&&retryOptions.statusCodes.includes(error.response.statusCode);if(!hasMethod||!hasErrorCode&&!hasStatusCode)return 0;if(error.response){if(retryAfter)return retryAfter>computedValue?0:retryAfter;if(error.response.statusCode===413)return 0}let noise=Math.random()*retryOptions.noise;return Math.min(2**(attemptCount-1)*1e3,retryOptions.backoffLimit)+noise},calculate_retry_delay_default=calculateRetryDelay,{Resolver:AsyncResolver}=import_node_dns.promises,kCacheableLookupCreateConnection=Symbol("cacheableLookupCreateConnection"),kCacheableLookupInstance=Symbol("cacheableLookupInstance"),kExpires=Symbol("expires"),supportsALL=typeof import_node_dns.ALL=="number",verifyAgent=agent2=>{if(!(agent2&&typeof agent2.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},map4to6=entries2=>{for(let entry of entries2)entry.family!==6&&(entry.address=`::ffff:${entry.address}`,entry.family=6)},getIfaceInfo=()=>{let has4=!1,has6=!1;for(let device of Object.values(import_node_os.default.networkInterfaces()))for(let iface of device)if(!iface.internal&&(iface.family==="IPv6"?has6=!0:has4=!0,has4&&has6))return{has4,has6};return{has4,has6}},isIterable=map=>Symbol.iterator in map,ignoreNoResultErrors=dnsPromise=>dnsPromise.catch(error=>{if(error.code==="ENODATA"||error.code==="ENOTFOUND"||error.code==="ENOENT")return[];throw error}),ttl={ttl:!0},all={all:!0},all4={all:!0,family:4},all6={all:!0,family:6},CacheableLookup=class{constructor({cache:cache3=new Map,maxTtl=1/0,fallbackDuration=3600,errorTtl=.15,resolver=new AsyncResolver,lookup=import_node_dns.lookup}={}){if(this.maxTtl=maxTtl,this.errorTtl=errorTtl,this._cache=cache3,this._resolver=resolver,this._dnsLookup=lookup&&(0,import_node_util6.promisify)(lookup),this.stats={cache:0,query:0},this._resolver instanceof AsyncResolver?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=(0,import_node_util6.promisify)(this._resolver.resolve4.bind(this._resolver)),this._resolve6=(0,import_node_util6.promisify)(this._resolver.resolve6.bind(this._resolver))),this._iface=getIfaceInfo(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=fallbackDuration,fallbackDuration>0){let interval=setInterval(()=>{this._hostnamesToFallback.clear()},fallbackDuration*1e3);interval.unref&&interval.unref(),this._fallbackInterval=interval}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(servers){this.clear(),this._resolver.setServers(servers)}get servers(){return this._resolver.getServers()}lookup(hostname,options,callback){if(typeof options=="function"?(callback=options,options={}):typeof options=="number"&&(options={family:options}),!callback)throw new Error("Callback must be a function.");this.lookupAsync(hostname,options).then(result=>{options.all?callback(null,result):callback(null,result.address,result.family,result.expires,result.ttl,result.source)},callback)}async lookupAsync(hostname,options={}){typeof options=="number"&&(options={family:options});let cached=await this.query(hostname);if(options.family===6){let filtered=cached.filter(entry=>entry.family===6);options.hints&import_node_dns.V4MAPPED&&(supportsALL&&options.hints&import_node_dns.ALL||filtered.length===0)?map4to6(cached):cached=filtered}else options.family===4&&(cached=cached.filter(entry=>entry.family===4));if(options.hints&import_node_dns.ADDRCONFIG){let{_iface}=this;cached=cached.filter(entry=>entry.family===6?_iface.has6:_iface.has4)}if(cached.length===0){let error=new Error(`cacheableLookup ENOTFOUND ${hostname}`);throw error.code="ENOTFOUND",error.hostname=hostname,error}return options.all?cached:cached[0]}async query(hostname){let source="cache",cached=await this._cache.get(hostname);if(cached&&this.stats.cache++,!cached){let pending=this._pending[hostname];if(pending)this.stats.cache++,cached=await pending;else{source="query";let newPromise=this.queryAndCache(hostname);this._pending[hostname]=newPromise,this.stats.query++;try{cached=await newPromise}finally{delete this._pending[hostname]}}}return cached=cached.map(entry=>({...entry,source})),cached}async _resolve(hostname){let[A2,AAAA]=await Promise.all([ignoreNoResultErrors(this._resolve4(hostname,ttl)),ignoreNoResultErrors(this._resolve6(hostname,ttl))]),aTtl=0,aaaaTtl=0,cacheTtl=0,now=Date.now();for(let entry of A2)entry.family=4,entry.expires=now+entry.ttl*1e3,aTtl=Math.max(aTtl,entry.ttl);for(let entry of AAAA)entry.family=6,entry.expires=now+entry.ttl*1e3,aaaaTtl=Math.max(aaaaTtl,entry.ttl);return A2.length>0?AAAA.length>0?cacheTtl=Math.min(aTtl,aaaaTtl):cacheTtl=aTtl:cacheTtl=aaaaTtl,{entries:[...A2,...AAAA],cacheTtl}}async _lookup(hostname){try{let[A2,AAAA]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(hostname,all4)),ignoreNoResultErrors(this._dnsLookup(hostname,all6))]);return{entries:[...A2,...AAAA],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(hostname,data,cacheTtl){if(this.maxTtl>0&&cacheTtl>0){cacheTtl=Math.min(cacheTtl,this.maxTtl)*1e3,data[kExpires]=Date.now()+cacheTtl;try{await this._cache.set(hostname,data,cacheTtl)}catch(error){this.lookupAsync=async()=>{let cacheError=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw cacheError.cause=error,cacheError}}isIterable(this._cache)&&this._tick(cacheTtl)}}async queryAndCache(hostname){if(this._hostnamesToFallback.has(hostname))return this._dnsLookup(hostname,all);let query=await this._resolve(hostname);query.entries.length===0&&this._dnsLookup&&(query=await this._lookup(hostname),query.entries.length!==0&&this.fallbackDuration>0&&this._hostnamesToFallback.add(hostname));let cacheTtl=query.entries.length===0?this.errorTtl:query.cacheTtl;return await this._set(hostname,query.entries,cacheTtl),query.entries}_tick(ms){let nextRemovalTime=this._nextRemovalTime;(!nextRemovalTime||ms<nextRemovalTime)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=ms,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let nextExpiry=1/0,now=Date.now();for(let[hostname,entries2]of this._cache){let expires=entries2[kExpires];now>=expires?this._cache.delete(hostname):expires<nextExpiry&&(nextExpiry=expires)}nextExpiry!==1/0&&this._tick(nextExpiry-now)},ms),this._removalTimeout.unref&&this._removalTimeout.unref())}install(agent2){if(verifyAgent(agent2),kCacheableLookupCreateConnection in agent2)throw new Error("CacheableLookup has been already installed");agent2[kCacheableLookupCreateConnection]=agent2.createConnection,agent2[kCacheableLookupInstance]=this,agent2.createConnection=(options,callback)=>("lookup"in options||(options.lookup=this.lookup),agent2[kCacheableLookupCreateConnection](options,callback))}uninstall(agent2){if(verifyAgent(agent2),agent2[kCacheableLookupCreateConnection]){if(agent2[kCacheableLookupInstance]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");agent2.createConnection=agent2[kCacheableLookupCreateConnection],delete agent2[kCacheableLookupCreateConnection],delete agent2[kCacheableLookupInstance]}}updateInterfaceInfo(){let{_iface}=this;this._iface=getIfaceInfo(),(_iface.has4&&!this._iface.has4||_iface.has6&&!this._iface.has6)&&this._cache.clear()}clear(hostname){if(hostname){this._cache.delete(hostname);return}this._cache.clear()}},import_http2_wrapper=__toESM2(require_source2(),1);function parseLinkHeader(link){let parsed=[],items=link.split(",");for(let item of items){let[rawUriReference,...rawLinkParameters]=item.split(";"),trimmedUriReference=rawUriReference.trim();if(trimmedUriReference[0]!=="<"||trimmedUriReference[trimmedUriReference.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${trimmedUriReference}`);let reference=trimmedUriReference.slice(1,-1),parameters={};if(rawLinkParameters.length===0)throw new Error(`Unexpected end of Link header parameters: ${rawLinkParameters.join(";")}`);for(let rawParameter of rawLinkParameters){let trimmedRawParameter=rawParameter.trim(),center=trimmedRawParameter.indexOf("=");if(center===-1)throw new Error(`Failed to parse Link header: ${link}`);let name=trimmedRawParameter.slice(0,center).trim(),value=trimmedRawParameter.slice(center+1).trim();parameters[name]=value}parsed.push({reference,parameters})}return parsed}var[major,minor]=import_node_process2.default.versions.node.split(".").map(Number);function validateSearchParameters(searchParameters){for(let key in searchParameters){let value=searchParameters[key];assert.any([dist_default2.string,dist_default2.number,dist_default2.boolean,dist_default2.null_,dist_default2.undefined],value)}}var globalCache=new Map,globalDnsCache,getGlobalDnsCache=()=>globalDnsCache||(globalDnsCache=new CacheableLookup,globalDnsCache),defaultInternals={request:void 0,agent:{http:void 0,https:void 0,http2:void 0},h2session:void 0,decompress:!0,timeout:{connect:void 0,lookup:void 0,read:void 0,request:void 0,response:void 0,secureConnect:void 0,send:void 0,socket:void 0},prefixUrl:"",body:void 0,form:void 0,json:void 0,cookieJar:void 0,ignoreInvalidCookies:!1,searchParams:void 0,dnsLookup:void 0,dnsCache:void 0,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:!0,maxRedirects:10,cache:void 0,throwHttpErrors:!0,username:"",password:"",http2:!1,allowGetBody:!1,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:!1,dnsLookupIpVersion:void 0,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue})=>computedValue,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:void 0,method:"GET",createConnection:void 0,cacheOptions:{shared:void 0,cacheHeuristic:void 0,immutableMinTimeToLive:void 0,ignoreCargoCult:void 0},https:{alpnProtocols:void 0,rejectUnauthorized:void 0,checkServerIdentity:void 0,certificateAuthority:void 0,key:void 0,certificate:void 0,passphrase:void 0,pfx:void 0,ciphers:void 0,honorCipherOrder:void 0,minVersion:void 0,maxVersion:void 0,signatureAlgorithms:void 0,tlsSessionLifetime:void 0,dhparam:void 0,ecdhCurve:void 0,certificateRevocationLists:void 0},encoding:void 0,resolveBodyOnly:!1,isStream:!1,responseType:"text",url:void 0,pagination:{transform(response){return response.request.options.responseType==="json"?response.body:JSON.parse(response.body)},paginate({response}){let rawLinkHeader=response.headers.link;if(typeof rawLinkHeader!="string"||rawLinkHeader.trim()==="")return!1;let next=parseLinkHeader(rawLinkHeader).find(entry=>entry.parameters.rel==="next"||entry.parameters.rel==='"next"');return next?{url:new import_node_url5.URL(next.reference,response.url)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:!1},setHost:!0,maxHeaderSize:void 0,signal:void 0,enableUnixSockets:!0},cloneInternals=internals=>{let{hooks,retry}=internals,result={...internals,context:{...internals.context},cacheOptions:{...internals.cacheOptions},https:{...internals.https},agent:{...internals.agent},headers:{...internals.headers},retry:{...retry,errorCodes:[...retry.errorCodes],methods:[...retry.methods],statusCodes:[...retry.statusCodes]},timeout:{...internals.timeout},hooks:{init:[...hooks.init],beforeRequest:[...hooks.beforeRequest],beforeError:[...hooks.beforeError],beforeRedirect:[...hooks.beforeRedirect],beforeRetry:[...hooks.beforeRetry],afterResponse:[...hooks.afterResponse]},searchParams:internals.searchParams?new import_node_url5.URLSearchParams(internals.searchParams):void 0,pagination:{...internals.pagination}};return result.url!==void 0&&(result.prefixUrl=""),result},cloneRaw=raw=>{let{hooks,retry}=raw,result={...raw};return dist_default2.object(raw.context)&&(result.context={...raw.context}),dist_default2.object(raw.cacheOptions)&&(result.cacheOptions={...raw.cacheOptions}),dist_default2.object(raw.https)&&(result.https={...raw.https}),dist_default2.object(raw.cacheOptions)&&(result.cacheOptions={...result.cacheOptions}),dist_default2.object(raw.agent)&&(result.agent={...raw.agent}),dist_default2.object(raw.headers)&&(result.headers={...raw.headers}),dist_default2.object(retry)&&(result.retry={...retry},dist_default2.array(retry.errorCodes)&&(result.retry.errorCodes=[...retry.errorCodes]),dist_default2.array(retry.methods)&&(result.retry.methods=[...retry.methods]),dist_default2.array(retry.statusCodes)&&(result.retry.statusCodes=[...retry.statusCodes])),dist_default2.object(raw.timeout)&&(result.timeout={...raw.timeout}),dist_default2.object(hooks)&&(result.hooks={...hooks},dist_default2.array(hooks.init)&&(result.hooks.init=[...hooks.init]),dist_default2.array(hooks.beforeRequest)&&(result.hooks.beforeRequest=[...hooks.beforeRequest]),dist_default2.array(hooks.beforeError)&&(result.hooks.beforeError=[...hooks.beforeError]),dist_default2.array(hooks.beforeRedirect)&&(result.hooks.beforeRedirect=[...hooks.beforeRedirect]),dist_default2.array(hooks.beforeRetry)&&(result.hooks.beforeRetry=[...hooks.beforeRetry]),dist_default2.array(hooks.afterResponse)&&(result.hooks.afterResponse=[...hooks.afterResponse])),dist_default2.object(raw.pagination)&&(result.pagination={...raw.pagination}),result},getHttp2TimeoutOption=internals=>{let delays=[internals.timeout.socket,internals.timeout.connect,internals.timeout.lookup,internals.timeout.request,internals.timeout.secureConnect].filter(delay2=>typeof delay2=="number");if(delays.length>0)return Math.min(...delays)},init=(options,withOptions,self2)=>{var _a;let initHooks=(_a=options.hooks)==null?void 0:_a.init;if(initHooks)for(let hook of initHooks)hook(withOptions,self2)},Options=class{constructor(input,options,defaults2){if(Object.defineProperty(this,"_unixOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_internals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_merging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_init",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),assert.any([dist_default2.string,dist_default2.urlInstance,dist_default2.object,dist_default2.undefined],input),assert.any([dist_default2.object,dist_default2.undefined],options),assert.any([dist_default2.object,dist_default2.undefined],defaults2),input instanceof Options||options instanceof Options)throw new TypeError("The defaults must be passed as the third argument");this._internals=cloneInternals((defaults2==null?void 0:defaults2._internals)??defaults2??defaultInternals),this._init=[...(defaults2==null?void 0:defaults2._init)??[]],this._merging=!1,this._unixOptions=void 0;try{if(dist_default2.plainObject(input))try{this.merge(input),this.merge(options)}finally{this.url=input.url}else try{this.merge(options)}finally{if((options==null?void 0:options.url)!==void 0)if(input===void 0)this.url=options.url;else throw new TypeError("The `url` option is mutually exclusive with the `input` argument");else input!==void 0&&(this.url=input)}}catch(error){throw error.options=this,error}}merge(options){if(options){if(options instanceof Options){for(let init2 of options._init)this.merge(init2);return}options=cloneRaw(options),init(this,options,this),init(options,options,this),this._merging=!0,"isStream"in options&&(this.isStream=options.isStream);try{let push=!1;for(let key in options)if(!(key==="mutableDefaults"||key==="handlers")&&key!=="url"){if(!(key in this))throw new Error(`Unexpected option: ${key}`);this[key]=options[key],push=!0}push&&this._init.push(options)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(value){assert.any([dist_default2.function_,dist_default2.undefined],value),this._internals.request=value}get agent(){return this._internals.agent}set agent(value){assert.plainObject(value);for(let key in value){if(!(key in this._internals.agent))throw new TypeError(`Unexpected agent option: ${key}`);assert.any([dist_default2.object,dist_default2.undefined],value[key])}this._merging?Object.assign(this._internals.agent,value):this._internals.agent={...value}}get h2session(){return this._internals.h2session}set h2session(value){this._internals.h2session=value}get decompress(){return this._internals.decompress}set decompress(value){assert.boolean(value),this._internals.decompress=value}get timeout(){return this._internals.timeout}set timeout(value){assert.plainObject(value);for(let key in value){if(!(key in this._internals.timeout))throw new Error(`Unexpected timeout option: ${key}`);assert.any([dist_default2.number,dist_default2.undefined],value[key])}this._merging?Object.assign(this._internals.timeout,value):this._internals.timeout={...value}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(value){if(assert.any([dist_default2.string,dist_default2.urlInstance],value),value===""){this._internals.prefixUrl="";return}if(value=value.toString(),value.endsWith("/")||(value+="/"),this._internals.prefixUrl&&this._internals.url){let{href}=this._internals.url;this._internals.url.href=value+href.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=value}get body(){return this._internals.body}set body(value){assert.any([dist_default2.string,dist_default2.buffer,dist_default2.nodeStream,dist_default2.generator,dist_default2.asyncGenerator,isFormData,dist_default2.undefined],value),dist_default2.nodeStream(value)&&assert.truthy(value.readable),value!==void 0&&(assert.undefined(this._internals.form),assert.undefined(this._internals.json)),this._internals.body=value}get form(){return this._internals.form}set form(value){assert.any([dist_default2.plainObject,dist_default2.undefined],value),value!==void 0&&(assert.undefined(this._internals.body),assert.undefined(this._internals.json)),this._internals.form=value}get json(){return this._internals.json}set json(value){value!==void 0&&(assert.undefined(this._internals.body),assert.undefined(this._internals.form)),this._internals.json=value}get url(){return this._internals.url}set url(value){if(assert.any([dist_default2.string,dist_default2.urlInstance,dist_default2.undefined],value),value===void 0){this._internals.url=void 0;return}if(dist_default2.string(value)&&value.startsWith("/"))throw new Error("`url` must not start with a slash");let urlString=`${this.prefixUrl}${value.toString()}`,url=new import_node_url5.URL(urlString);if(this._internals.url=url,decodeURI(urlString),url.protocol==="unix:"&&(url.href=`http://unix${url.pathname}${url.search}`),url.protocol!=="http:"&&url.protocol!=="https:"){let error=new Error(`Unsupported protocol: ${url.protocol}`);throw error.code="ERR_UNSUPPORTED_PROTOCOL",error}if(this._internals.username&&(url.username=this._internals.username,this._internals.username=""),this._internals.password&&(url.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(url.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),url.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let matches=/(?<socketPath>.+?):(?<path>.+)/.exec(`${url.pathname}${url.search}`);if(matches!=null&&matches.groups){let{socketPath,path:path13}=matches.groups;this._unixOptions={socketPath,path:path13,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(value){if(assert.any([dist_default2.object,dist_default2.undefined],value),value===void 0){this._internals.cookieJar=void 0;return}let{setCookie,getCookieString}=value;assert.function_(setCookie),assert.function_(getCookieString),setCookie.length===4&&getCookieString.length===0?(setCookie=(0,import_node_util5.promisify)(setCookie.bind(value)),getCookieString=(0,import_node_util5.promisify)(getCookieString.bind(value)),this._internals.cookieJar={setCookie,getCookieString}):this._internals.cookieJar=value}get signal(){return this._internals.signal}set signal(value){assert.object(value),this._internals.signal=value}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(value){assert.boolean(value),this._internals.ignoreInvalidCookies=value}get searchParams(){return this._internals.url?this._internals.url.searchParams:(this._internals.searchParams===void 0&&(this._internals.searchParams=new import_node_url5.URLSearchParams),this._internals.searchParams)}set searchParams(value){assert.any([dist_default2.string,dist_default2.object,dist_default2.undefined],value);let url=this._internals.url;if(value===void 0){this._internals.searchParams=void 0,url&&(url.search="");return}let searchParameters=this.searchParams,updated;if(dist_default2.string(value))updated=new import_node_url5.URLSearchParams(value);else if(value instanceof import_node_url5.URLSearchParams)updated=value;else{validateSearchParameters(value),updated=new import_node_url5.URLSearchParams;for(let key in value){let entry=value[key];entry===null?updated.append(key,""):entry===void 0?searchParameters.delete(key):updated.append(key,entry)}}if(this._merging){for(let key of updated.keys())searchParameters.delete(key);for(let[key,value2]of updated)searchParameters.append(key,value2)}else url?url.search=searchParameters.toString():this._internals.searchParams=searchParameters}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(_value){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(value){assert.any([dist_default2.function_,dist_default2.undefined],value),this._internals.dnsLookup=value}get dnsCache(){return this._internals.dnsCache}set dnsCache(value){assert.any([dist_default2.object,dist_default2.boolean,dist_default2.undefined],value),value===!0?this._internals.dnsCache=getGlobalDnsCache():value===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=value}get context(){return this._internals.context}set context(value){assert.object(value),this._merging?Object.assign(this._internals.context,value):this._internals.context={...value}}get hooks(){return this._internals.hooks}set hooks(value){assert.object(value);for(let knownHookEvent in value){if(!(knownHookEvent in this._internals.hooks))throw new Error(`Unexpected hook event: ${knownHookEvent}`);let typedKnownHookEvent=knownHookEvent,hooks=value[typedKnownHookEvent];if(assert.any([dist_default2.array,dist_default2.undefined],hooks),hooks)for(let hook of hooks)assert.function_(hook);if(this._merging)hooks&&this._internals.hooks[typedKnownHookEvent].push(...hooks);else{if(!hooks)throw new Error(`Missing hook event: ${knownHookEvent}`);this._internals.hooks[knownHookEvent]=[...hooks]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(value){assert.boolean(value),this._internals.followRedirect=value}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(_value){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(value){assert.number(value),this._internals.maxRedirects=value}get cache(){return this._internals.cache}set cache(value){assert.any([dist_default2.object,dist_default2.string,dist_default2.boolean,dist_default2.undefined],value),value===!0?this._internals.cache=globalCache:value===!1?this._internals.cache=void 0:this._internals.cache=value}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(value){assert.boolean(value),this._internals.throwHttpErrors=value}get username(){let url=this._internals.url,value=url?url.username:this._internals.username;return decodeURIComponent(value)}set username(value){assert.string(value);let url=this._internals.url,fixedValue=encodeURIComponent(value);url?url.username=fixedValue:this._internals.username=fixedValue}get password(){let url=this._internals.url,value=url?url.password:this._internals.password;return decodeURIComponent(value)}set password(value){assert.string(value);let url=this._internals.url,fixedValue=encodeURIComponent(value);url?url.password=fixedValue:this._internals.password=fixedValue}get http2(){return this._internals.http2}set http2(value){assert.boolean(value),this._internals.http2=value}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(value){assert.boolean(value),this._internals.allowGetBody=value}get headers(){return this._internals.headers}set headers(value){assert.plainObject(value),this._merging?Object.assign(this._internals.headers,lowercaseKeys(value)):this._internals.headers=lowercaseKeys(value)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(value){assert.boolean(value),this._internals.methodRewriting=value}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(value){if(value!==void 0&&value!==4&&value!==6)throw new TypeError(`Invalid DNS lookup IP version: ${value}`);this._internals.dnsLookupIpVersion=value}get parseJson(){return this._internals.parseJson}set parseJson(value){assert.function_(value),this._internals.parseJson=value}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(value){assert.function_(value),this._internals.stringifyJson=value}get retry(){return this._internals.retry}set retry(value){if(assert.plainObject(value),assert.any([dist_default2.function_,dist_default2.undefined],value.calculateDelay),assert.any([dist_default2.number,dist_default2.undefined],value.maxRetryAfter),assert.any([dist_default2.number,dist_default2.undefined],value.limit),assert.any([dist_default2.array,dist_default2.undefined],value.methods),assert.any([dist_default2.array,dist_default2.undefined],value.statusCodes),assert.any([dist_default2.array,dist_default2.undefined],value.errorCodes),assert.any([dist_default2.number,dist_default2.undefined],value.noise),value.noise&&Math.abs(value.noise)>100)throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${value.noise}`);for(let key in value)if(!(key in this._internals.retry))throw new Error(`Unexpected retry option: ${key}`);this._merging?Object.assign(this._internals.retry,value):this._internals.retry={...value};let{retry}=this._internals;retry.methods=[...new Set(retry.methods.map(method=>method.toUpperCase()))],retry.statusCodes=[...new Set(retry.statusCodes)],retry.errorCodes=[...new Set(retry.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(value){assert.any([dist_default2.string,dist_default2.undefined],value),this._internals.localAddress=value}get method(){return this._internals.method}set method(value){assert.string(value),this._internals.method=value.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(value){assert.any([dist_default2.function_,dist_default2.undefined],value),this._internals.createConnection=value}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(value){assert.plainObject(value),assert.any([dist_default2.boolean,dist_default2.undefined],value.shared),assert.any([dist_default2.number,dist_default2.undefined],value.cacheHeuristic),assert.any([dist_default2.number,dist_default2.undefined],value.immutableMinTimeToLive),assert.any([dist_default2.boolean,dist_default2.undefined],value.ignoreCargoCult);for(let key in value)if(!(key in this._internals.cacheOptions))throw new Error(`Cache option \`${key}\` does not exist`);this._merging?Object.assign(this._internals.cacheOptions,value):this._internals.cacheOptions={...value}}get https(){return this._internals.https}set https(value){assert.plainObject(value),assert.any([dist_default2.boolean,dist_default2.undefined],value.rejectUnauthorized),assert.any([dist_default2.function_,dist_default2.undefined],value.checkServerIdentity),assert.any([dist_default2.string,dist_default2.object,dist_default2.array,dist_default2.undefined],value.certificateAuthority),assert.any([dist_default2.string,dist_default2.object,dist_default2.array,dist_default2.undefined],value.key),assert.any([dist_default2.string,dist_default2.object,dist_default2.array,dist_default2.undefined],value.certificate),assert.any([dist_default2.string,dist_default2.undefined],value.passphrase),assert.any([dist_default2.string,dist_default2.buffer,dist_default2.array,dist_default2.undefined],value.pfx),assert.any([dist_default2.array,dist_default2.undefined],value.alpnProtocols),assert.any([dist_default2.string,dist_default2.undefined],value.ciphers),assert.any([dist_default2.string,dist_default2.buffer,dist_default2.undefined],value.dhparam),assert.any([dist_default2.string,dist_default2.undefined],value.signatureAlgorithms),assert.any([dist_default2.string,dist_default2.undefined],value.minVersion),assert.any([dist_default2.string,dist_default2.undefined],value.maxVersion),assert.any([dist_default2.boolean,dist_default2.undefined],value.honorCipherOrder),assert.any([dist_default2.number,dist_default2.undefined],value.tlsSessionLifetime),assert.any([dist_default2.string,dist_default2.undefined],value.ecdhCurve),assert.any([dist_default2.string,dist_default2.buffer,dist_default2.array,dist_default2.undefined],value.certificateRevocationLists);for(let key in value)if(!(key in this._internals.https))throw new Error(`HTTPS option \`${key}\` does not exist`);this._merging?Object.assign(this._internals.https,value):this._internals.https={...value}}get encoding(){return this._internals.encoding}set encoding(value){if(value===null)throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");assert.any([dist_default2.string,dist_default2.undefined],value),this._internals.encoding=value}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(value){assert.boolean(value),this._internals.resolveBodyOnly=value}get isStream(){return this._internals.isStream}set isStream(value){assert.boolean(value),this._internals.isStream=value}get responseType(){return this._internals.responseType}set responseType(value){if(value===void 0){this._internals.responseType="text";return}if(value!=="text"&&value!=="buffer"&&value!=="json")throw new Error(`Invalid \`responseType\` option: ${value}`);this._internals.responseType=value}get pagination(){return this._internals.pagination}set pagination(value){assert.object(value),this._merging?Object.assign(this._internals.pagination,value):this._internals.pagination=value}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(_value){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(value){assert.boolean(value),this._internals.setHost=value}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(value){assert.any([dist_default2.number,dist_default2.undefined],value),this._internals.maxHeaderSize=value}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(value){assert.boolean(value),this._internals.enableUnixSockets=value}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](_depth,options){return(0,import_node_util5.inspect)(this._internals,options)}createNativeRequestOptions(){var _a;let internals=this._internals,url=internals.url,agent2;url.protocol==="https:"?agent2=internals.http2?internals.agent:internals.agent.https:agent2=internals.agent.http;let{https:https22}=internals,{pfx}=https22;return dist_default2.array(pfx)&&dist_default2.plainObject(pfx[0])&&(pfx=pfx.map(object=>({buf:object.buffer,passphrase:object.passphrase}))),{...internals.cacheOptions,...this._unixOptions,ALPNProtocols:https22.alpnProtocols,ca:https22.certificateAuthority,cert:https22.certificate,key:https22.key,passphrase:https22.passphrase,pfx:https22.pfx,rejectUnauthorized:https22.rejectUnauthorized,checkServerIdentity:https22.checkServerIdentity??import_node_tls.checkServerIdentity,ciphers:https22.ciphers,honorCipherOrder:https22.honorCipherOrder,minVersion:https22.minVersion,maxVersion:https22.maxVersion,sigalgs:https22.signatureAlgorithms,sessionTimeout:https22.tlsSessionLifetime,dhparam:https22.dhparam,ecdhCurve:https22.ecdhCurve,crl:https22.certificateRevocationLists,lookup:internals.dnsLookup??((_a=internals.dnsCache)==null?void 0:_a.lookup),family:internals.dnsLookupIpVersion,agent:agent2,setHost:internals.setHost,method:internals.method,maxHeaderSize:internals.maxHeaderSize,localAddress:internals.localAddress,headers:internals.headers,createConnection:internals.createConnection,timeout:internals.http2?getHttp2TimeoutOption(internals):void 0,h2session:internals.h2session}}getRequestFunction(){let url=this._internals.url,{request}=this._internals;return!request&&url?this.getFallbackRequestFunction():request}getFallbackRequestFunction(){let url=this._internals.url;if(url){if(url.protocol==="https:"){if(this._internals.http2){if(major<15||major===15&&minor<10){let error=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw error.code="EUNSUPPORTED",error}return import_http2_wrapper.default.auto}return import_node_https2.default.request}return import_node_http4.default.request}}freeze(){let options=this._internals;Object.freeze(options),Object.freeze(options.hooks),Object.freeze(options.hooks.afterResponse),Object.freeze(options.hooks.beforeError),Object.freeze(options.hooks.beforeRedirect),Object.freeze(options.hooks.beforeRequest),Object.freeze(options.hooks.beforeRetry),Object.freeze(options.hooks.init),Object.freeze(options.https),Object.freeze(options.cacheOptions),Object.freeze(options.agent),Object.freeze(options.headers),Object.freeze(options.timeout),Object.freeze(options.retry),Object.freeze(options.retry.errorCodes),Object.freeze(options.retry.methods),Object.freeze(options.retry.statusCodes)}},isResponseOk=response=>{let{statusCode}=response,limitStatusCode=response.request.options.followRedirect?299:399;return statusCode>=200&&statusCode<=limitStatusCode||statusCode===304},ParseError=class extends RequestError{constructor(error,response){let{options}=response.request;super(`${error.message} in "${options.url.toString()}"`,error,response.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},parseBody=(response,responseType,parseJson,encoding)=>{let{rawBody}=response;try{if(responseType==="text")return rawBody.toString(encoding);if(responseType==="json")return rawBody.length===0?"":parseJson(rawBody.toString(encoding));if(responseType==="buffer")return rawBody}catch(error){throw new ParseError(error,response)}throw new ParseError({message:`Unknown body type '${responseType}'`,name:"Error"},response)};function isClientRequest(clientRequest){return clientRequest.writable&&!clientRequest.writableEnded}var is_client_request_default=isClientRequest;function isUnixSocketURL(url){return url.protocol==="unix:"||url.hostname==="unix"}var supportsBrotli=dist_default2.string(import_node_process.default.versions.brotli),methodsWithoutBody=new Set(["GET","HEAD"]),cacheableStore=new WeakableMap,redirectCodes=new Set([300,301,302,303,304,307,308]),proxiedRequestEvents=["socket","connect","continue","information","upgrade"],noop22=()=>{},Request2=class extends import_node_stream3.Duplex{constructor(url,options,defaults2){super({autoDestroy:!1,highWaterMark:0}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_noPipe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"redirectUrls",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopRetry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downloadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_uploadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopReading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pipedServerResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_responseSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bodySize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_unproxyEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isFromCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cannotHaveBody",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_triggerRead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cancelTimeouts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_removeListeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nativeResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_flushed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aborted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_requestInitialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._downloadedSize=0,this._uploadedSize=0,this._stopReading=!1,this._pipedServerResponses=new Set,this._cannotHaveBody=!1,this._unproxyEvents=noop22,this._triggerRead=!1,this._cancelTimeouts=noop22,this._removeListeners=noop22,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=noop22,this.on("pipe",source=>{source.headers&&Object.assign(this.options.headers,source.headers)}),this.on("newListener",event=>{if(event==="retry"&&this.listenerCount("retry")>0)throw new Error("A retry listener has been attached already.")});try{if(this.options=new Options(url,options,defaults2),!this.options.url){if(this.options.prefixUrl==="")throw new TypeError("Missing `url` property");this.options.url=""}this.requestUrl=this.options.url}catch(error){let{options:options2}=error;options2&&(this.options=options2),this.flush=async()=>{this.flush=async()=>{},this.destroy(error)};return}let{body}=this.options;if(dist_default2.nodeStream(body)&&body.once("error",error=>{this._flushed?this._beforeError(new UploadError(error,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new UploadError(error,this))}}),this.options.signal){let abort=()=>{this.destroy(new AbortError2(this))};this.options.signal.aborted?abort():(this.options.signal.addEventListener("abort",abort),this._removeListeners=()=>{this.options.signal.removeEventListener("abort",abort)})}}async flush(){var _a;if(!this._flushed){this._flushed=!0;try{if(await this._finalizeBody(),this.destroyed)return;if(await this._makeRequest(),this.destroyed){(_a=this._request)==null||_a.destroy();return}for(let job of this._jobs)job();this._jobs.length=0,this._requestInitialized=!0}catch(error){this._beforeError(error)}}}_beforeError(error){if(this._stopReading)return;let{response,options}=this,attemptCount=this.retryCount+(error.name==="RetryError"?0:1);this._stopReading=!0,error instanceof RequestError||(error=new RequestError(error.message,error,this));let typedError=error;(async()=>{var _a,_b;if(response!=null&&response.readable&&!response.rawBody&&!((_b=(_a=this._request)==null?void 0:_a.socket)!=null&&_b.destroyed)&&(response.setEncoding(this.readableEncoding),await this._setRawBody(response)&&(response.body=response.rawBody.toString())),this.listenerCount("retry")!==0){let backoff;try{let retryAfter;response&&"retry-after"in response.headers&&(retryAfter=Number(response.headers["retry-after"]),Number.isNaN(retryAfter)?(retryAfter=Date.parse(response.headers["retry-after"])-Date.now(),retryAfter<=0&&(retryAfter=1)):retryAfter*=1e3);let retryOptions=options.retry;backoff=await retryOptions.calculateDelay({attemptCount,retryOptions,error:typedError,retryAfter,computedValue:calculate_retry_delay_default({attemptCount,retryOptions,error:typedError,retryAfter,computedValue:retryOptions.maxRetryAfter??options.timeout.request??Number.POSITIVE_INFINITY})})}catch(error_){this._error(new RequestError(error_.message,error_,this));return}if(backoff){if(await new Promise(resolve3=>{let timeout=setTimeout(resolve3,backoff);this._stopRetry=()=>{clearTimeout(timeout),resolve3()}}),this.destroyed)return;try{for(let hook of this.options.hooks.beforeRetry)await hook(typedError,this.retryCount+1)}catch(error_){this._error(new RequestError(error_.message,error,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,error,updatedOptions=>{let request=new Request2(options.url,updatedOptions,options);return request.retryCount=this.retryCount+1,import_node_process.default.nextTick(()=>{request.flush()}),request});return}}this._error(typedError)})()}_read(){this._triggerRead=!0;let{response}=this;if(response&&!this._stopReading){response.readableLength&&(this._triggerRead=!1);let data;for(;(data=response.read())!==null;){this._downloadedSize+=data.length;let progress=this.downloadProgress;progress.percent<1&&this.emit("downloadProgress",progress),this.push(data)}}}_write(chunk,encoding,callback){let write=()=>{this._writeRequest(chunk,encoding,callback)};this._requestInitialized?write():this._jobs.push(write)}_final(callback){let endRequest=()=>{if(!this._request||this._request.destroyed){callback();return}this._request.end(error=>{var _a;(_a=this._request._writableState)!=null&&_a.errored||(error||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),callback(error))})};this._requestInitialized?endRequest():this._jobs.push(endRequest)}_destroy(error,callback){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body}=this.options;dist_default2.nodeStream(body)&&body.destroy()}this._request&&this._request.destroy(),error!==null&&!dist_default2.undefined(error)&&!(error instanceof RequestError)&&(error=new RequestError(error.message,error,this)),callback(error)}pipe(destination,options){return destination instanceof import_node_http3.ServerResponse&&this._pipedServerResponses.add(destination),super.pipe(destination,options)}unpipe(destination){return destination instanceof import_node_http3.ServerResponse&&this._pipedServerResponses.delete(destination),super.unpipe(destination),this}async _finalizeBody(){let{options}=this,{headers}=options,isForm=!dist_default2.undefined(options.form),isJSON2=!dist_default2.undefined(options.json),isBody=!dist_default2.undefined(options.body),cannotHaveBody=methodsWithoutBody.has(options.method)&&!(options.method==="GET"&&options.allowGetBody);if(this._cannotHaveBody=cannotHaveBody,isForm||isJSON2||isBody){if(cannotHaveBody)throw new TypeError(`The \`${options.method}\` method cannot be used with a body`);let noContentType=!dist_default2.string(headers["content-type"]);if(isBody){if(isFormData(options.body)){let encoder=new FormDataEncoder(options.body);noContentType&&(headers["content-type"]=encoder.headers["Content-Type"]),"Content-Length"in encoder.headers&&(headers["content-length"]=encoder.headers["Content-Length"]),options.body=encoder.encode()}isFormData2(options.body)&&noContentType&&(headers["content-type"]=`multipart/form-data; boundary=${options.body.getBoundary()}`)}else if(isForm){noContentType&&(headers["content-type"]="application/x-www-form-urlencoded");let{form}=options;options.form=void 0,options.body=new import_node_url3.URLSearchParams(form).toString()}else{noContentType&&(headers["content-type"]="application/json");let{json}=options;options.json=void 0,options.body=options.stringifyJson(json)}let uploadBodySize=await getBodySize(options.body,options.headers);dist_default2.undefined(headers["content-length"])&&dist_default2.undefined(headers["transfer-encoding"])&&!cannotHaveBody&&!dist_default2.undefined(uploadBodySize)&&(headers["content-length"]=String(uploadBodySize))}options.responseType==="json"&&!("accept"in options.headers)&&(options.headers.accept="application/json"),this._bodySize=Number(headers["content-length"])||void 0}async _onResponseBase(response){if(this.isAborted)return;let{options}=this,{url}=options;this._nativeResponse=response,options.decompress&&(response=(0,import_decompress_response.default)(response));let statusCode=response.statusCode,typedResponse=response;typedResponse.statusMessage=typedResponse.statusMessage?typedResponse.statusMessage:import_node_http3.default.STATUS_CODES[statusCode],typedResponse.url=options.url.toString(),typedResponse.requestUrl=this.requestUrl,typedResponse.redirectUrls=this.redirectUrls,typedResponse.request=this,typedResponse.isFromCache=this._nativeResponse.fromCache??!1,typedResponse.ip=this.ip,typedResponse.retryCount=this.retryCount,typedResponse.ok=isResponseOk(typedResponse),this._isFromCache=typedResponse.isFromCache,this._responseSize=Number(response.headers["content-length"])||void 0,this.response=typedResponse,response.once("end",()=>{this._responseSize=this._downloadedSize,this.emit("downloadProgress",this.downloadProgress)}),response.once("error",error=>{this._aborted=!0,response.destroy(),this._beforeError(new ReadError(error,this))}),response.once("aborted",()=>{this._aborted=!0,this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let rawCookies=response.headers["set-cookie"];if(dist_default2.object(options.cookieJar)&&rawCookies){let promises=rawCookies.map(async rawCookie=>options.cookieJar.setCookie(rawCookie,url.toString()));options.ignoreInvalidCookies&&(promises=promises.map(async promise=>{try{await promise}catch{}}));try{await Promise.all(promises)}catch(error){this._beforeError(error);return}}if(!this.isAborted){if(options.followRedirect&&response.headers.location&&redirectCodes.has(statusCode)){if(response.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=options.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=void 0;let updatedOptions=new Options(void 0,void 0,this.options),serverRequestedGet=statusCode===303&&updatedOptions.method!=="GET"&&updatedOptions.method!=="HEAD",canRewrite=statusCode!==307&&statusCode!==308,userRequestedGet=updatedOptions.methodRewriting&&canRewrite;(serverRequestedGet||userRequestedGet)&&(updatedOptions.method="GET",updatedOptions.body=void 0,updatedOptions.json=void 0,updatedOptions.form=void 0,delete updatedOptions.headers["content-length"]);try{let redirectBuffer=import_node_buffer3.Buffer.from(response.headers.location,"binary").toString(),redirectUrl=new import_node_url3.URL(redirectBuffer,url);if(!isUnixSocketURL(url)&&isUnixSocketURL(redirectUrl)){this._beforeError(new RequestError("Cannot redirect to UNIX socket",{},this));return}redirectUrl.hostname!==url.hostname||redirectUrl.port!==url.port?("host"in updatedOptions.headers&&delete updatedOptions.headers.host,"cookie"in updatedOptions.headers&&delete updatedOptions.headers.cookie,"authorization"in updatedOptions.headers&&delete updatedOptions.headers.authorization,(updatedOptions.username||updatedOptions.password)&&(updatedOptions.username="",updatedOptions.password="")):(redirectUrl.username=updatedOptions.username,redirectUrl.password=updatedOptions.password),this.redirectUrls.push(redirectUrl),updatedOptions.prefixUrl="",updatedOptions.url=redirectUrl;for(let hook of updatedOptions.hooks.beforeRedirect)await hook(updatedOptions,typedResponse);this.emit("redirect",updatedOptions,typedResponse),this.options=updatedOptions,await this._makeRequest()}catch(error){this._beforeError(error);return}return}if(options.isStream&&options.throwHttpErrors&&!isResponseOk(typedResponse)){this._beforeError(new HTTPError(typedResponse));return}if(response.on("readable",()=>{this._triggerRead&&this._read()}),this.on("resume",()=>{response.resume()}),this.on("pause",()=>{response.pause()}),response.once("end",()=>{this.push(null)}),this._noPipe){await this._setRawBody()&&this.emit("response",response);return}this.emit("response",response);for(let destination of this._pipedServerResponses)if(!destination.headersSent){for(let key in response.headers){let isAllowed=options.decompress?key!=="content-encoding":!0,value=response.headers[key];isAllowed&&destination.setHeader(key,value)}destination.statusCode=statusCode}}}async _setRawBody(from=this){if(from.readableEnded)return!1;try{let rawBody=await(0,import_get_stream2.buffer)(from);if(!this.isAborted)return this.response.rawBody=rawBody,!0}catch{}return!1}async _onResponse(response){try{await this._onResponseBase(response)}catch(error){this._beforeError(error)}}_onRequest(request){let{options}=this,{timeout,url}=options;source_default(request),this.options.http2&&request.setTimeout(0),this._cancelTimeouts=timedOut(request,timeout,url);let responseEventName=options.cache?"cacheableResponse":"response";request.once(responseEventName,response=>{this._onResponse(response)}),request.once("error",error=>{this._aborted=!0,request.destroy(),error=error instanceof TimeoutError2?new TimeoutError(error,this.timings,this):new RequestError(error.message,error,this),this._beforeError(error)}),this._unproxyEvents=proxyEvents(request,this,proxiedRequestEvents),this._request=request,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",request)}async _asyncWrite(chunk){return new Promise((resolve3,reject)=>{super.write(chunk,error=>{if(error){reject(error);return}resolve3()})})}_sendBody(){let{body}=this.options,currentRequest=this.redirectUrls.length===0?this:this._request??this;dist_default2.nodeStream(body)?body.pipe(currentRequest):dist_default2.generator(body)||dist_default2.asyncGenerator(body)?(async()=>{try{for await(let chunk of body)await this._asyncWrite(chunk);super.end()}catch(error){this._beforeError(error)}})():dist_default2.undefined(body)?(this._cannotHaveBody||this._noPipe)&&currentRequest.end():(this._writeRequest(body,void 0,()=>{}),currentRequest.end())}_prepareCache(cache3){if(!cacheableStore.has(cache3)){let cacheableRequest=new dist_default22((requestOptions,handler)=>{let result=requestOptions._request(requestOptions,handler);return dist_default2.promise(result)&&(result.once=(event,handler2)=>{if(event==="error")(async()=>{try{await result}catch(error){handler2(error)}})();else if(event==="abort")(async()=>{try{(await result).once("abort",handler2)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${event}`);return result}),result},cache3);cacheableStore.set(cache3,cacheableRequest.request())}}async _createCacheableRequest(url,options){return new Promise((resolve3,reject)=>{Object.assign(options,urlToOptions(url));let request,cacheRequest=cacheableStore.get(options.cache)(options,async response=>{if(response._readableState.autoDestroy=!1,request){let fix=()=>{response.req&&(response.complete=response.req.res.complete)};response.prependOnceListener("end",fix),fix(),(await request).emit("cacheableResponse",response)}resolve3(response)});cacheRequest.once("error",reject),cacheRequest.once("request",async requestOrPromise=>{request=requestOrPromise,resolve3(request)})})}async _makeRequest(){let{options}=this,{headers,username,password}=options,cookieJar=options.cookieJar;for(let key in headers)if(dist_default2.undefined(headers[key]))delete headers[key];else if(dist_default2.null_(headers[key]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${key}\` header`);if(options.decompress&&dist_default2.undefined(headers["accept-encoding"])&&(headers["accept-encoding"]=supportsBrotli?"gzip, deflate, br":"gzip, deflate"),username||password){let credentials=import_node_buffer3.Buffer.from(`${username}:${password}`).toString("base64");headers.authorization=`Basic ${credentials}`}if(cookieJar){let cookieString=await cookieJar.getCookieString(options.url.toString());dist_default2.nonEmptyString(cookieString)&&(headers.cookie=cookieString)}options.prefixUrl="";let request;for(let hook of options.hooks.beforeRequest){let result=await hook(options);if(!dist_default2.undefined(result)){request=()=>result;break}}request||(request=options.getRequestFunction());let url=options.url;this._requestOptions=options.createNativeRequestOptions(),options.cache&&(this._requestOptions._request=request,this._requestOptions.cache=options.cache,this._requestOptions.body=options.body,this._prepareCache(options.cache));let fn=options.cache?this._createCacheableRequest:request;try{let requestOrResponse=fn(url,this._requestOptions);dist_default2.promise(requestOrResponse)&&(requestOrResponse=await requestOrResponse),dist_default2.undefined(requestOrResponse)&&(requestOrResponse=options.getFallbackRequestFunction()(url,this._requestOptions),dist_default2.promise(requestOrResponse)&&(requestOrResponse=await requestOrResponse)),is_client_request_default(requestOrResponse)?this._onRequest(requestOrResponse):this.writable?(this.once("finish",()=>{this._onResponse(requestOrResponse)}),this._sendBody()):this._onResponse(requestOrResponse)}catch(error){throw error instanceof CacheError2?new CacheError(error,this):error}}async _error(error){try{if(!(error instanceof HTTPError&&!this.options.throwHttpErrors))for(let hook of this.options.hooks.beforeError)error=await hook(error)}catch(error_){error=new RequestError(error_.message,error_,this)}this.destroy(error)}_writeRequest(chunk,encoding,callback){!this._request||this._request.destroyed||this._request.write(chunk,encoding,error=>{if(!error&&!this._request.destroyed){this._uploadedSize+=import_node_buffer3.Buffer.byteLength(chunk,encoding);let progress=this.uploadProgress;progress.percent<1&&this.emit("uploadProgress",progress)}callback(error)})}get ip(){var _a;return(_a=this.socket)==null?void 0:_a.remoteAddress}get isAborted(){return this._aborted}get socket(){var _a;return((_a=this._request)==null?void 0:_a.socket)??void 0}get downloadProgress(){let percent;return this._responseSize?percent=this._downloadedSize/this._responseSize:this._responseSize===this._downloadedSize?percent=1:percent=0,{percent,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let percent;return this._bodySize?percent=this._uploadedSize/this._bodySize:this._bodySize===this._uploadedSize?percent=1:percent=0,{percent,transferred:this._uploadedSize,total:this._bodySize}}get timings(){var _a;return(_a=this._request)==null?void 0:_a.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){var _a;return(_a=this._request)==null?void 0:_a.reusedSocket}},CancelError2=class extends RequestError{constructor(request){super("Promise was canceled",{},request),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},proxiedRequestEvents2=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(firstRequest){let globalRequest,globalResponse,normalizedOptions,emitter=new import_node_events.EventEmitter,promise=new PCancelable((resolve3,reject,onCancel)=>{onCancel(()=>{globalRequest.destroy()}),onCancel.shouldReject=!1,onCancel(()=>{reject(new CancelError2(globalRequest))});let makeRequest=retryCount=>{var _a;onCancel(()=>{});let request=firstRequest??new Request2(void 0,void 0,normalizedOptions);request.retryCount=retryCount,request._noPipe=!0,globalRequest=request,request.once("response",async response=>{let contentEncoding=(response.headers["content-encoding"]??"").toLowerCase(),isCompressed=contentEncoding==="gzip"||contentEncoding==="deflate"||contentEncoding==="br",{options}=request;if(isCompressed&&!options.decompress)response.body=response.rawBody;else try{response.body=parseBody(response,options.responseType,options.parseJson,options.encoding)}catch(error){if(response.body=response.rawBody.toString(),isResponseOk(response)){request._beforeError(error);return}}try{let hooks=options.hooks.afterResponse;for(let[index,hook]of hooks.entries())if(response=await hook(response,async updatedOptions=>{throw options.merge(updatedOptions),options.prefixUrl="",updatedOptions.url&&(options.url=updatedOptions.url),options.hooks.afterResponse=options.hooks.afterResponse.slice(0,index),new RetryError(request)}),!(dist_default2.object(response)&&dist_default2.number(response.statusCode)&&!dist_default2.nullOrUndefined(response.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(error){request._beforeError(error);return}if(globalResponse=response,!isResponseOk(response)){request._beforeError(new HTTPError(response));return}request.destroy(),resolve3(request.options.resolveBodyOnly?response.body:response)});let onError=error=>{if(promise.isCanceled)return;let{options}=request;if(error instanceof HTTPError&&!options.throwHttpErrors){let{response}=error;request.destroy(),resolve3(request.options.resolveBodyOnly?response.body:response);return}reject(error)};request.once("error",onError);let previousBody=(_a=request.options)==null?void 0:_a.body;request.once("retry",(newRetryCount,error)=>{firstRequest=void 0;let newBody=request.options.body;if(previousBody===newBody&&dist_default2.nodeStream(newBody)){error.message="Cannot retry with consumed body stream",onError(error);return}normalizedOptions=request.options,makeRequest(newRetryCount)}),proxyEvents(request,emitter,proxiedRequestEvents2),dist_default2.undefined(firstRequest)&&request.flush()};makeRequest(0)});promise.on=(event,fn)=>(emitter.on(event,fn),promise),promise.off=(event,fn)=>(emitter.off(event,fn),promise);let shortcut=responseType=>{let newPromise=(async()=>{await promise;let{options}=globalResponse.request;return parseBody(globalResponse,responseType,options.parseJson,options.encoding)})();return Object.defineProperties(newPromise,Object.getOwnPropertyDescriptors(promise)),newPromise};return promise.json=()=>{if(globalRequest.options){let{headers}=globalRequest.options;!globalRequest.writableFinished&&!("accept"in headers)&&(headers.accept="application/json")}return shortcut("json")},promise.buffer=()=>shortcut("buffer"),promise.text=()=>shortcut("text"),promise}var delay=async ms=>new Promise(resolve3=>{setTimeout(resolve3,ms)}),isGotInstance=value=>dist_default2.function_(value),aliases=["get","post","put","patch","head","delete"],create=defaults2=>{defaults2={options:new Options(void 0,void 0,defaults2.options),handlers:[...defaults2.handlers],mutableDefaults:defaults2.mutableDefaults},Object.defineProperty(defaults2,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let got2=(url,options,defaultOptions2=defaults2.options)=>{let request=new Request2(url,options,defaultOptions2),promise,lastHandler=normalized=>(request.options=normalized,request._noPipe=!normalized.isStream,request.flush(),normalized.isStream?request:(promise||(promise=asPromise(request)),promise)),iteration=0,iterateHandlers=newOptions=>{let result=(defaults2.handlers[iteration++]??lastHandler)(newOptions,iterateHandlers);if(dist_default2.promise(result)&&!request.options.isStream&&(promise||(promise=asPromise(request)),result!==promise)){let descriptors=Object.getOwnPropertyDescriptors(promise);for(let key in descriptors)key in result&&delete descriptors[key];Object.defineProperties(result,descriptors),result.cancel=promise.cancel}return result};return iterateHandlers(request.options)};got2.extend=(...instancesOrOptions)=>{let options=new Options(void 0,void 0,defaults2.options),handlers=[...defaults2.handlers],mutableDefaults;for(let value of instancesOrOptions)isGotInstance(value)?(options.merge(value.defaults.options),handlers.push(...value.defaults.handlers),mutableDefaults=value.defaults.mutableDefaults):(options.merge(value),value.handlers&&handlers.push(...value.handlers),mutableDefaults=value.mutableDefaults);return create({options,handlers,mutableDefaults:!!mutableDefaults})};let paginateEach=async function*(url,options){let normalizedOptions=new Options(url,options,defaults2.options);normalizedOptions.resolveBodyOnly=!1;let{pagination}=normalizedOptions;assert.function_(pagination.transform),assert.function_(pagination.shouldContinue),assert.function_(pagination.filter),assert.function_(pagination.paginate),assert.number(pagination.countLimit),assert.number(pagination.requestLimit),assert.number(pagination.backoff);let allItems=[],{countLimit}=pagination,numberOfRequests=0;for(;numberOfRequests<pagination.requestLimit;){numberOfRequests!==0&&await delay(pagination.backoff);let response=await got2(void 0,void 0,normalizedOptions),parsed=await pagination.transform(response),currentItems=[];assert.array(parsed);for(let item of parsed)if(pagination.filter({item,currentItems,allItems})&&(!pagination.shouldContinue({item,currentItems,allItems})||(yield item,pagination.stackAllItems&&allItems.push(item),currentItems.push(item),--countLimit<=0)))return;let optionsToMerge=pagination.paginate({response,currentItems,allItems});if(optionsToMerge===!1)return;optionsToMerge===response.request.options?normalizedOptions=response.request.options:(normalizedOptions.merge(optionsToMerge),assert.any([dist_default2.urlInstance,dist_default2.undefined],optionsToMerge.url),optionsToMerge.url!==void 0&&(normalizedOptions.prefixUrl="",normalizedOptions.url=optionsToMerge.url)),numberOfRequests++}};got2.paginate=paginateEach,got2.paginate.all=async(url,options)=>{let results=[];for await(let item of paginateEach(url,options))results.push(item);return results},got2.paginate.each=paginateEach,got2.stream=(url,options)=>got2(url,{...options,isStream:!0});for(let method of aliases)got2[method]=(url,options)=>got2(url,{...options,method}),got2.stream[method]=(url,options)=>got2(url,{...options,method,isStream:!0});return defaults2.mutableDefaults||(Object.freeze(defaults2.handlers),defaults2.options.freeze()),Object.defineProperty(got2,"defaults",{value:defaults2,writable:!1,configurable:!1,enumerable:!0}),got2},create_default=create,defaults={options:new Options,handlers:[],mutableDefaults:!1},got=create_default(defaults);var agentOpts={keepAlive:!0,maxSockets:20},agent={http:new import_http2.Agent(agentOpts),https:new import_https2.Agent(agentOpts)};var import_get_npm_tarball_url=__toESM(require_lib()),tempy2=__toESM(require_tempy());var import_semver2=require("semver");var ProjectType=(ProjectType2=>(ProjectType2.UNDETECTED="UNDETECTED",ProjectType2.UNSUPPORTED="UNSUPPORTED",ProjectType2.REACT="REACT",ProjectType2.REACT_SCRIPTS="REACT_SCRIPTS",ProjectType2.REACT_NATIVE="REACT_NATIVE",ProjectType2.REACT_PROJECT="REACT_PROJECT",ProjectType2.WEBPACK_REACT="WEBPACK_REACT",ProjectType2.NEXTJS="NEXTJS",ProjectType2.VUE="VUE",ProjectType2.VUE3="VUE3",ProjectType2.SFC_VUE="SFC_VUE",ProjectType2.ANGULAR="ANGULAR",ProjectType2.EMBER="EMBER",ProjectType2.WEB_COMPONENTS="WEB_COMPONENTS",ProjectType2.HTML="HTML",ProjectType2.QWIK="QWIK",ProjectType2.PREACT="PREACT",ProjectType2.SVELTE="SVELTE",ProjectType2.SVELTEKIT="SVELTEKIT",ProjectType2.SERVER="SERVER",ProjectType2.NX="NX",ProjectType2.SOLID="SOLID",ProjectType2))(ProjectType||{});var notInstallableProjectTypes=["UNDETECTED","UNSUPPORTED","NX"],installableProjectTypes=Object.values(ProjectType).filter(type=>!notInstallableProjectTypes.includes(type)).map(type=>type.toLowerCase());var versions_default={"@storybook/addon-a11y":"7.6.20","@storybook/addon-actions":"7.6.20","@storybook/addon-backgrounds":"7.6.20","@storybook/addon-controls":"7.6.20","@storybook/addon-docs":"7.6.20","@storybook/addon-essentials":"7.6.20","@storybook/addon-highlight":"7.6.20","@storybook/addon-interactions":"7.6.20","@storybook/addon-jest":"7.6.20","@storybook/addon-links":"7.6.20","@storybook/addon-mdx-gfm":"7.6.20","@storybook/addon-measure":"7.6.20","@storybook/addon-outline":"7.6.20","@storybook/addon-themes":"7.6.20","@storybook/addon-storyshots":"7.6.20","@storybook/addon-storyshots-puppeteer":"7.6.20","@storybook/addon-storysource":"7.6.20","@storybook/addon-toolbars":"7.6.20","@storybook/addon-viewport":"7.6.20","@storybook/addons":"7.6.20","@storybook/angular":"7.6.20","@storybook/api":"7.6.20","@storybook/blocks":"7.6.20","@storybook/builder-manager":"7.6.20","@storybook/builder-vite":"7.6.20","@storybook/builder-webpack5":"7.6.20","@storybook/channel-postmessage":"7.6.20","@storybook/channel-websocket":"7.6.20","@storybook/channels":"7.6.20","@storybook/cli":"7.6.20","@storybook/client-api":"7.6.20","@storybook/client-logger":"7.6.20","@storybook/codemod":"7.6.20","@storybook/components":"7.6.20","@storybook/core-client":"7.6.20","@storybook/core-common":"7.6.20","@storybook/core-events":"7.6.20","@storybook/core-server":"7.6.20","@storybook/core-webpack":"7.6.20","@storybook/csf-plugin":"7.6.20","@storybook/csf-tools":"7.6.20","@storybook/docs-tools":"7.6.20","@storybook/ember":"7.6.20","@storybook/html":"7.6.20","@storybook/html-vite":"7.6.20","@storybook/html-webpack5":"7.6.20","@storybook/instrumenter":"7.6.20","@storybook/manager":"7.6.20","@storybook/manager-api":"7.6.20","@storybook/nextjs":"7.6.20","@storybook/node-logger":"7.6.20","@storybook/postinstall":"7.6.20","@storybook/preact":"7.6.20","@storybook/preact-vite":"7.6.20","@storybook/preact-webpack5":"7.6.20","@storybook/preset-create-react-app":"7.6.20","@storybook/preset-html-webpack":"7.6.20","@storybook/preset-preact-webpack":"7.6.20","@storybook/preset-react-webpack":"7.6.20","@storybook/preset-server-webpack":"7.6.20","@storybook/preset-svelte-webpack":"7.6.20","@storybook/preset-vue-webpack":"7.6.20","@storybook/preset-vue3-webpack":"7.6.20","@storybook/preset-web-components-webpack":"7.6.20","@storybook/preview":"7.6.20","@storybook/preview-api":"7.6.20","@storybook/preview-web":"7.6.20","@storybook/react":"7.6.20","@storybook/react-dom-shim":"7.6.20","@storybook/react-vite":"7.6.20","@storybook/react-webpack5":"7.6.20","@storybook/router":"7.6.20","@storybook/server":"7.6.20","@storybook/server-webpack5":"7.6.20","@storybook/source-loader":"7.6.20","@storybook/store":"7.6.20","@storybook/svelte":"7.6.20","@storybook/svelte-vite":"7.6.20","@storybook/svelte-webpack5":"7.6.20","@storybook/sveltekit":"7.6.20","@storybook/telemetry":"7.6.20","@storybook/theming":"7.6.20","@storybook/types":"7.6.20","@storybook/test":"7.6.20","@storybook/vue":"7.6.20","@storybook/vue-vite":"7.6.20","@storybook/vue-webpack5":"7.6.20","@storybook/vue3":"7.6.20","@storybook/vue3-vite":"7.6.20","@storybook/vue3-webpack5":"7.6.20","@storybook/web-components":"7.6.20","@storybook/web-components-vite":"7.6.20","@storybook/web-components-webpack5":"7.6.20",sb:"7.6.20",storybook:"7.6.20"};var logger11=console;var commandLog=message=>(process.stdout.write(import_chalk9.default.cyan(" \u2022 ")+message),(errorMessage,errorInfo)=>{if(errorMessage){if(process.stdout.write(`. ${import_chalk9.default.red("\u2716")}
90
90
  `),logger11.error(`
91
91
  ${import_chalk9.default.red(errorMessage)}`),!errorInfo)return;let newErrorInfo=errorInfo.split(`
92
92
  `).map(line=>` ${import_chalk9.default.dim(line)}`).join(`
@@ -99,7 +99,7 @@ ${updateMessage}`:""}
99
99
  `)}return{...packageJson,dependencies:{...packageJson.dependencies},devDependencies:{...packageJson.devDependencies},peerDependencies:{...packageJson.peerDependencies}}}async getAllDependencies(){let{dependencies,devDependencies,peerDependencies}=await this.retrievePackageJson();return{...dependencies,...devDependencies,...peerDependencies}}async addDependencies(options,dependencies){let{skipInstall}=options;if(skipInstall){let{packageJson}=options,dependenciesMap=dependencies.reduce((acc,dep)=>{let[packageName,packageVersion]=getPackageDetails(dep);return{...acc,[packageName]:packageVersion}},{});options.installAsDevDependencies?packageJson.devDependencies={...packageJson.devDependencies,...dependenciesMap}:packageJson.dependencies={...packageJson.dependencies,...dependenciesMap},await this.writePackageJson(packageJson)}else try{await this.runAddDeps(dependencies,options.installAsDevDependencies)}catch(e2){throw logger12.error(`
100
100
  An error occurred while installing dependencies:`),logger12.log(e2.message),new HandledError(e2)}}async removeDependencies(options,dependencies){let{skipInstall}=options;if(skipInstall){let{packageJson}=options;dependencies.forEach(dep=>{packageJson.devDependencies&&delete packageJson.devDependencies[dep],packageJson.dependencies&&delete packageJson.dependencies[dep]}),await this.writePackageJson(packageJson)}else try{await this.runRemoveDeps(dependencies)}catch(e2){throw logger12.error("An error occurred while removing dependencies."),logger12.log(e2.message),new HandledError(e2)}}getVersionedPackages(packages){return Promise.all(packages.map(async pkg=>{let[packageName,packageVersion]=getPackageDetails(pkg),latestInRange=await this.latestVersion(packageName,packageVersion),currentVersion=versions_default[packageName];return currentVersion===latestInRange?`${packageName}`:currentVersion?`${packageName}@${currentVersion}`:`${packageName}@^${latestInRange}`}))}getVersions(...packageNames){return Promise.all(packageNames.map(packageName=>this.getVersion(packageName)))}async getVersion(packageName,constraint){let current;/(@storybook|^sb$|^storybook$)/.test(packageName)&&(current=versions_default[packageName]);let latest;try{latest=await this.latestVersion(packageName,constraint)}catch(e2){if(current)return logger12.warn(`
101
101
  ${import_chalk10.default.yellow(e2.message)}`),current;throw logger12.error(`
102
- ${import_chalk10.default.red(e2.message)}`),new HandledError(e2)}return`^${current&&(!constraint||(0,import_semver4.satisfies)(current,constraint))&&(0,import_semver4.gt)(current,latest)?current:latest}`}async latestVersion(packageName,constraint){return constraint?(await this.runGetVersions(packageName,!0)).reverse().find(version=>(0,import_semver4.satisfies)(version,constraint)):this.runGetVersions(packageName,!1)}async addStorybookCommandInScripts(options){let storybookCmd=`storybook dev -p ${(options==null?void 0:options.port)??6006}`,buildStorybookCmd="storybook build",preCommand=options!=null&&options.preCommand?this.getRunCommand(options.preCommand):void 0;await this.addScripts({storybook:[preCommand,storybookCmd].filter(Boolean).join(" && "),"build-storybook":[preCommand,buildStorybookCmd].filter(Boolean).join(" && ")})}async addScripts(scripts){let packageJson=await this.retrievePackageJson();await this.writePackageJson({...packageJson,scripts:{...packageJson.scripts,...scripts}})}async addPackageResolutions(versions){let packageJson=await this.retrievePackageJson(),resolutions=this.getResolutions(packageJson,versions);this.writePackageJson({...packageJson,...resolutions})}executeCommandSync({command,args=[],stdio,cwd,ignoreError=!1,env,...execaOptions}){try{return(0,import_execa.sync)(command,args,{cwd:cwd??this.cwd,stdio:stdio??"pipe",encoding:"utf-8",shell:!0,cleanup:!0,env,...execaOptions}).stdout??""}catch(err){if(ignoreError!==!0)throw err;return""}}async executeCommand({command,args=[],stdio,cwd,ignoreError=!1,env,...execaOptions}){try{return(await(0,import_execa.command)([command,...args].join(" "),{cwd:cwd??this.cwd,stdio:stdio??"pipe",encoding:"utf-8",shell:!0,cleanup:!0,env,...execaOptions})).stdout??""}catch(err){if(ignoreError!==!0)throw err;return""}}};var NPM_ERROR_REGEX=/npm ERR! code (\w+)/,NPM_ERROR_CODES={E401:"Authentication failed or is required.",E403:"Access to the resource is forbidden.",E404:"Requested resource not found.",EACCES:"Permission issue.",EAI_FAIL:"DNS lookup failed.",EBADENGINE:"Engine compatibility check failed.",EBADPLATFORM:"Platform not supported.",ECONNREFUSED:"Connection refused.",ECONNRESET:"Connection reset.",EEXIST:"File or directory already exists.",EINVALIDTYPE:"Invalid type encountered.",EISGIT:"Git operation failed or conflicts with an existing file.",EJSONPARSE:"Error parsing JSON data.",EMISSINGARG:"Required argument missing.",ENEEDAUTH:"Authentication needed.",ENOAUDIT:"No audit available.",ENOENT:"File or directory does not exist.",ENOGIT:"Git not found or failed to run.",ENOLOCK:"Lockfile missing.",ENOSPC:"Insufficient disk space.",ENOTFOUND:"Resource not found.",EOTP:"One-time password required.",EPERM:"Permission error.",EPUBLISHCONFLICT:"Conflict during package publishing.",ERESOLVE:"Dependency resolution error.",EROFS:"File system is read-only.",ERR_SOCKET_TIMEOUT:"Socket timed out.",ETARGET:"Package target not found.",ETIMEDOUT:"Operation timed out.",ETOOMANYARGS:"Too many arguments provided.",EUNKNOWNTYPE:"Unknown type encountered."},NPMProxy=class extends JsPackageManager{constructor(){super(...arguments);this.type="npm"}async initPackageJson(){await this.executeCommand({command:"npm",args:["init","-y"]})}getRunStorybookCommand(){return"npm run storybook"}getRunCommand(command){return`npm run ${command}`}async getNpmVersion(){return this.executeCommand({command:"npm",args:["--version"]})}async getPackageJSON(packageName,basePath=this.cwd){let packageJsonPath=await(0,import_find_up2.sync)(dir=>{let possiblePath=import_path12.default.join(dir,"node_modules",packageName,"package.json");return(0,import_fs4.existsSync)(possiblePath)?possiblePath:void 0},{cwd:basePath});return packageJsonPath?JSON.parse((0,import_fs4.readFileSync)(packageJsonPath,"utf-8")):null}async getPackageVersion(packageName,basePath=this.cwd){var _a;let packageJson=await this.getPackageJSON(packageName,basePath);return packageJson?((_a=import_semver5.default.coerce(packageJson.version))==null?void 0:_a.version)??null:null}getInstallArgs(){return this.installArgs||(this.installArgs=[]),this.installArgs}runPackageCommandSync(command,args,cwd,stdio){return this.executeCommandSync({command:"npm",args:["exec","--",command,...args],cwd,stdio})}async runPackageCommand(command,args,cwd){return this.executeCommand({command:"npm",args:["exec","--",command,...args],cwd})}async findInstallations(){let exec=async({depth})=>{let pipeToNull=(0,import_os.platform)()==="win32"?"2>NUL":"2>/dev/null";return this.executeCommand({command:"npm",args:["ls","--json",`--depth=${depth}`,pipeToNull],env:{FORCE_COLOR:"false"}})};try{let commandResult=await exec({depth:99}),parsedOutput=JSON.parse(commandResult);return this.mapDependencies(parsedOutput)}catch{try{let commandResult=await exec({depth:0}),parsedOutput=JSON.parse(commandResult);return this.mapDependencies(parsedOutput)}catch{import_node_logger13.logger.warn("An issue occurred while trying to find dependencies metadata using npm.");return}}}getResolutions(packageJson,versions){return{overrides:{...packageJson.overrides,...versions}}}async runInstall(){await this.executeCommand({command:"npm",args:["install",...this.getInstallArgs()],stdio:"inherit"})}async runAddDeps(dependencies,installAsDevDependencies){let{logStream,readLogFile,moveLogFile,removeLogFile}=await createLogStream(),args=[...dependencies];installAsDevDependencies&&(args=["-D",...args]);try{await this.executeCommand({command:"npm",args:["install",...args,...this.getInstallArgs()],stdio:process.env.CI?"inherit":["ignore",logStream,logStream]})}catch{let stdout=await readLogFile(),errorMessage=this.parseErrorFromLogs(stdout);throw await moveLogFile(),new Error(import_ts_dedent10.default`${errorMessage}
102
+ ${import_chalk10.default.red(e2.message)}`),new HandledError(e2)}return`^${current&&(!constraint||(0,import_semver4.satisfies)(current,constraint))&&(0,import_semver4.gt)(current,latest)?current:latest}`}async latestVersion(packageName,constraint){return constraint?(await this.runGetVersions(packageName,!0)).reverse().find(version=>(0,import_semver4.satisfies)(version,constraint)):this.runGetVersions(packageName,!1)}async addStorybookCommandInScripts(options){let storybookCmd=`storybook dev -p ${(options==null?void 0:options.port)??6006}`,buildStorybookCmd="storybook build",preCommand=options!=null&&options.preCommand?this.getRunCommand(options.preCommand):void 0;await this.addScripts({storybook:[preCommand,storybookCmd].filter(Boolean).join(" && "),"build-storybook":[preCommand,buildStorybookCmd].filter(Boolean).join(" && ")})}async addScripts(scripts){let packageJson=await this.retrievePackageJson();await this.writePackageJson({...packageJson,scripts:{...packageJson.scripts,...scripts}})}async addPackageResolutions(versions){let packageJson=await this.retrievePackageJson(),resolutions=this.getResolutions(packageJson,versions);this.writePackageJson({...packageJson,...resolutions})}executeCommandSync({command,args=[],stdio,cwd,ignoreError=!1,env,...execaOptions}){try{return(0,import_execa.sync)(command,args,{cwd:cwd??this.cwd,stdio:stdio??"pipe",encoding:"utf-8",shell:!0,cleanup:!0,env,...execaOptions}).stdout??""}catch(err){if(ignoreError!==!0)throw err;return""}}async executeCommand({command,args=[],stdio,cwd,ignoreError=!1,env,...execaOptions}){try{return(await(0,import_execa.command)([command,...args].join(" "),{cwd:cwd??this.cwd,stdio:stdio??"pipe",encoding:"utf-8",shell:!0,cleanup:!0,env,...execaOptions})).stdout??""}catch(err){if(ignoreError!==!0)throw err;return""}}};var NPM_ERROR_REGEX=/npm ERR! code (\w+)/,NPM_ERROR_CODES={E401:"Authentication failed or is required.",E403:"Access to the resource is forbidden.",E404:"Requested resource not found.",EACCES:"Permission issue.",EAI_FAIL:"DNS lookup failed.",EBADENGINE:"Engine compatibility check failed.",EBADPLATFORM:"Platform not supported.",ECONNREFUSED:"Connection refused.",ECONNRESET:"Connection reset.",EEXIST:"File or directory already exists.",EINVALIDTYPE:"Invalid type encountered.",EISGIT:"Git operation failed or conflicts with an existing file.",EJSONPARSE:"Error parsing JSON data.",EMISSINGARG:"Required argument missing.",ENEEDAUTH:"Authentication needed.",ENOAUDIT:"No audit available.",ENOENT:"File or directory does not exist.",ENOGIT:"Git not found or failed to run.",ENOLOCK:"Lockfile missing.",ENOSPC:"Insufficient disk space.",ENOTFOUND:"Resource not found.",EOTP:"One-time password required.",EPERM:"Permission error.",EPUBLISHCONFLICT:"Conflict during package publishing.",ERESOLVE:"Dependency resolution error.",EROFS:"File system is read-only.",ERR_SOCKET_TIMEOUT:"Socket timed out.",ETARGET:"Package target not found.",ETIMEDOUT:"Operation timed out.",ETOOMANYARGS:"Too many arguments provided.",EUNKNOWNTYPE:"Unknown type encountered."},NPMProxy=class extends JsPackageManager{constructor(){super(...arguments);this.type="npm"}async initPackageJson(){await this.executeCommand({command:"npm",args:["init","-y"]})}getRunStorybookCommand(){return"npm run storybook"}getRunCommand(command){return`npm run ${command}`}async getNpmVersion(){return this.executeCommand({command:"npm",args:["--version"]})}async getPackageJSON(packageName,basePath=this.cwd){let packageJsonPath=await(0,import_find_up2.sync)(dir=>{let possiblePath=import_path12.default.join(dir,"node_modules",packageName,"package.json");return(0,import_fs4.existsSync)(possiblePath)?possiblePath:void 0},{cwd:basePath});return packageJsonPath?JSON.parse((0,import_fs4.readFileSync)(packageJsonPath,"utf-8")):null}async getPackageVersion(packageName,basePath=this.cwd){var _a;let packageJson=await this.getPackageJSON(packageName,basePath);return packageJson?((_a=import_semver5.default.coerce(packageJson.version))==null?void 0:_a.version)??null:null}getInstallArgs(){return this.installArgs||(this.installArgs=[]),this.installArgs}runPackageCommandSync(command,args,cwd,stdio){return this.executeCommandSync({command:"npm",args:["exec","--",command,...args],cwd,stdio})}async runPackageCommand(command,args,cwd){return this.executeCommand({command:"npm",args:["exec","--",command,...args],cwd})}async findInstallations(){let exec=async({depth})=>{let pipeToNull=(0,import_os2.platform)()==="win32"?"2>NUL":"2>/dev/null";return this.executeCommand({command:"npm",args:["ls","--json",`--depth=${depth}`,pipeToNull],env:{FORCE_COLOR:"false"}})};try{let commandResult=await exec({depth:99}),parsedOutput=JSON.parse(commandResult);return this.mapDependencies(parsedOutput)}catch{try{let commandResult=await exec({depth:0}),parsedOutput=JSON.parse(commandResult);return this.mapDependencies(parsedOutput)}catch{import_node_logger13.logger.warn("An issue occurred while trying to find dependencies metadata using npm.");return}}}getResolutions(packageJson,versions){return{overrides:{...packageJson.overrides,...versions}}}async runInstall(){await this.executeCommand({command:"npm",args:["install",...this.getInstallArgs()],stdio:"inherit"})}async runAddDeps(dependencies,installAsDevDependencies){let{logStream,readLogFile,moveLogFile,removeLogFile}=await createLogStream(),args=[...dependencies];installAsDevDependencies&&(args=["-D",...args]);try{await this.executeCommand({command:"npm",args:["install",...args,...this.getInstallArgs()],stdio:process.env.CI?"inherit":["ignore",logStream,logStream]})}catch{let stdout=await readLogFile(),errorMessage=this.parseErrorFromLogs(stdout);throw await moveLogFile(),new Error(import_ts_dedent10.default`${errorMessage}
103
103
 
104
104
  Please check the logfile generated at ./storybook.log for troubleshooting and try again.`)}await removeLogFile()}async runRemoveDeps(dependencies){let args=[...dependencies];await this.executeCommand({command:"npm",args:["uninstall",...this.getInstallArgs(),...args],stdio:"inherit"})}async runGetVersions(packageName,fetchAllVersions){let args=[fetchAllVersions?"versions":"version","--json"],commandResult=await this.executeCommand({command:"npm",args:["info",packageName,...args]});try{let parsedOutput=JSON.parse(commandResult);if(parsedOutput.error)throw new Error(parsedOutput.error.summary);return parsedOutput}catch{throw new Error(`Unable to find versions of ${packageName} using npm`)}}mapDependencies(input){let acc={},existingVersions={},duplicatedDependencies={},recurse=([name,packageInfo])=>{var _a;if(!name||!name.includes("storybook"))return;let value={version:packageInfo.version,location:""};(_a=existingVersions[name])!=null&&_a.includes(value.version)||(acc[name]?acc[name].push(value):acc[name]=[value],existingVersions[name]=(0,import_sort.default)([...existingVersions[name]||[],value.version]),existingVersions[name].length>1&&(duplicatedDependencies[name]=existingVersions[name])),packageInfo.dependencies&&Object.entries(packageInfo.dependencies).forEach(recurse)};return Object.entries(input.dependencies).forEach(recurse),{dependencies:acc,duplicatedDependencies,infoCommand:"npm ls --depth=1",dedupeCommand:"npm dedupe"}}parseErrorFromLogs(logs){let finalMessage="NPM error",match=logs.match(NPM_ERROR_REGEX);if(match){let errorCode=match[1];errorCode&&(finalMessage=`${finalMessage} ${errorCode}`);let errorMessage=NPM_ERROR_CODES[errorCode];errorMessage&&(finalMessage=`${finalMessage} - ${errorMessage}`)}return finalMessage.trim()}};var import_fs_extra12=require("fs-extra"),import_ts_dedent11=__toESM(require("ts-dedent")),import_find_up3=__toESM(require_find_up()),import_path13=__toESM(require("path")),import_fs5=__toESM(require("fs")),import_semver6=__toESM(require("semver"));var PNPM_ERROR_REGEX=/(ELIFECYCLE|ERR_PNPM_[A-Z_]+)\s+(.*)/i,PNPMProxy=class extends JsPackageManager{constructor(){super(...arguments);this.type="pnpm"}detectWorkspaceRoot(){let pnpmWorkspaceYaml=`${process.cwd()}/pnpm-workspace.yaml`;return(0,import_fs_extra12.pathExistsSync)(pnpmWorkspaceYaml)}async initPackageJson(){await this.executeCommand({command:"pnpm",args:["init"]})}getRunStorybookCommand(){return"pnpm run storybook"}getRunCommand(command){return`pnpm run ${command}`}async getPnpmVersion(){return this.executeCommand({command:"pnpm",args:["--version"]})}getInstallArgs(){return this.installArgs||(this.installArgs=[],this.detectWorkspaceRoot()&&this.installArgs.push("-w")),this.installArgs}runPackageCommandSync(command,args,cwd,stdio){return this.executeCommandSync({command:"pnpm",args:["exec",command,...args],cwd,stdio})}async runPackageCommand(command,args,cwd){return this.executeCommand({command:"pnpm",args:["exec",command,...args],cwd})}async findInstallations(pattern){let commandResult=await this.executeCommand({command:"pnpm",args:["list",pattern.map(p=>`"${p}"`).join(" "),"--json","--depth=99"],env:{FORCE_COLOR:"false"}});try{let parsedOutput=JSON.parse(commandResult);return this.mapDependencies(parsedOutput)}catch{return}}async getPackageJSON(packageName,basePath=this.cwd){let pnpapiPath=(0,import_find_up3.sync)([".pnp.js",".pnp.cjs"],{cwd:basePath});if(pnpapiPath)try{let pnpApi=require(pnpapiPath),resolvedPath=await pnpApi.resolveToUnqualified(packageName,basePath,{considerBuiltins:!1}),pkgLocator=pnpApi.findPackageLocator(resolvedPath),pkg=pnpApi.getPackageInformation(pkgLocator);return JSON.parse(import_fs5.default.readFileSync(import_path13.default.join(pkg.packageLocation,"package.json"),"utf-8"))}catch(error){return error.code!=="MODULE_NOT_FOUND"&&console.error("Error while fetching package version in PNPM PnP mode:",error),null}let packageJsonPath=await(0,import_find_up3.sync)(dir=>{let possiblePath=import_path13.default.join(dir,"node_modules",packageName,"package.json");return import_fs5.default.existsSync(possiblePath)?possiblePath:void 0},{cwd:basePath});return packageJsonPath?JSON.parse(import_fs5.default.readFileSync(packageJsonPath,"utf-8")):null}async getPackageVersion(packageName,basePath=this.cwd){var _a;let packageJSON=await this.getPackageJSON(packageName,basePath);return packageJSON?((_a=import_semver6.default.coerce(packageJSON.version))==null?void 0:_a.version)??null:null}getResolutions(packageJson,versions){return{overrides:{...packageJson.overrides,...versions}}}async runInstall(){await this.executeCommand({command:"pnpm",args:["install",...this.getInstallArgs()],stdio:"inherit"})}async runAddDeps(dependencies,installAsDevDependencies){let args=[...dependencies];installAsDevDependencies&&(args=["-D",...args]);let{logStream,readLogFile,moveLogFile,removeLogFile}=await createLogStream();try{await this.executeCommand({command:"pnpm",args:["add",...args,...this.getInstallArgs()],stdio:process.env.CI?"inherit":["ignore",logStream,logStream]})}catch{let stdout=await readLogFile(),errorMessage=this.parseErrorFromLogs(stdout);throw await moveLogFile(),new Error(import_ts_dedent11.default`${errorMessage}
105
105