@abacus-ai/cli 1.105.14608 → 1.106.2403

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -23
  2. package/package.json +14 -5
package/dist/index.js CHANGED
@@ -1,25 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as DF}from"node:module";var t4=Object.create;var{getPrototypeOf:o4,defineProperty:$1,getOwnPropertyNames:r4}=Object;var e4=Object.prototype.hasOwnProperty;var KD=(D,u,_)=>{_=D!=null?t4(o4(D)):{};let F=u||!D||!D.__esModule?$1(_,"default",{value:D,enumerable:!0}):_;for(let q of r4(D))if(!e4.call(F,q))$1(F,q,{get:()=>D[q],enumerable:!0});return F};var G=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var T=DF(import.meta.url);var I3=G((K1)=>{Object.defineProperty(K1,"__esModule",{value:!0}),K1.DownloaderHelper=K1.DH_STATES=void 0;var P3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},uF=function(){function D(u,_){for(var F,q=0;q<_.length;q++)F=_[q],F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(u,F.key,F)}return function(u,_,F){return _&&D(u.prototype,_),F&&D(u,F),u}}(),_F=T("fs"),p=o2(_F),N0=T("url"),FF=T("path"),J0=o2(FF),qF=T("http"),Q1=o2(qF),CF=T("https"),J1=o2(CF),$F=T("events");function o2(D){if(D&&D.__esModule)return D;var u={};if(D!=null)for(var _ in D)Object.prototype.hasOwnProperty.call(D,_)&&(u[_]=D[_]);return u.default=D,u}function QF(D,u){if(!(D instanceof u))throw TypeError("Cannot call a class as a function")}function V1(D,u){if(!D)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:D}function JF(D,u){if(typeof u!="function"&&u!==null)throw TypeError("Super expression must either be null or a function, not "+typeof u);D.prototype=Object.create(u&&u.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(D,u):D.__proto__=u)}var Z1=K1.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"},rZ=K1.DownloaderHelper=function(D){function u(_,F){var q=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};QF(this,u);var C=V1(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,{captureRejections:!0}));return C.__validate(_,F)?(C.url=C.requestURL=_.trim(),C.state=Z1.IDLE,C.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1000,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},C.__opts=Object.assign({},C.__defaultOpts),C.__pipes=[],C.__total=0,C.__downloaded=0,C.__progress=0,C.__retryCount=0,C.__retryTimeout=null,C.__resumeRetryCount=0,C.__states=Z1,C.__promise=null,C.__request=null,C.__response=null,C.__isAborted=!1,C.__isResumed=!1,C.__isResumable=!1,C.__isRedirected=!1,C.__destFolder=F,C.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},C.__fileName="",C.__filePath="",C.updateOptions(q),C):V1(C)}return JF(u,D),uF(u,[{key:"start",value:function(){var F=this,q=function(){return new Promise(function(C,$){F.__promise={resolve:C,reject:$},F.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(C){var{name:$,total:Q}=C,J=F.__opts.override;if(F.__opts.override=!0,F.__filePath=F.__getFilePath($),F.__opts.override=J,F.__filePath&&p.existsSync(F.__filePath)){var Z=F.__getFilesizeInBytes(F.__filePath);return Z===Q?q():F.resumeFromFile(F.__filePath,{total:Q,fileName:$})}return q()}):q()}},{key:"pause",value:function(){var F=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(q){return q.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return F.__setState(F.__states.PAUSED),F.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var F=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var q=function(){return new Promise(function(C,$){p.access(F.__filePath,function(Q){return Q?(F.__emitStop(),C(!0)):void p.unlink(F.__filePath,function(J){return J?(F.__setState(F.__states.FAILED),F.emit("error",J),$(J)):(F.__emitStop(),void C(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return F.__opts.removeOnStop?q():(F.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(F){var q=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:F,options:q}),F}},{key:"unpipe",value:function(){var F=this,q=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,C=function(Q){return F.__response?F.__response.unpipe(Q):Q.unpipe()};if(q){var $=this.__pipes.find(function(Q){return Q.stream===q});return void($&&(C(q),this.__pipes=this.__pipes.filter(function(Q){return Q.stream!==q})))}this.__pipes.forEach(function(Q){return C(Q.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(F){var q=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,F),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=q||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var F=this;return new Promise(function(q,C){var $=function(J){F.__initProtocol(J);var Z=Object.assign({},F.__headers);Z.hasOwnProperty("range")&&delete Z.range;var V=F.__getReqOptions("HEAD",J,Z);return Object.assign({},F.__reqOptions,V)},Q=function(J,Z){var V=F.__protocol.request(Z,function(K){if(F.__isRequireRedirect(K)){var X=/^https?:\/\//.test(K.headers.location)?K.headers.location:new N0.URL(K.headers.location,J).href;return F.emit("redirected",X,J),Q(X,$(X))}return K.statusCode===200?void q({name:F.__getFileNameFromHeaders(K.headers,K),total:parseInt(K.headers["content-length"])||null}):C(Error("Response status was "+K.statusCode))});V.on("error",function(K){return C(K)}),V.on("timeout",function(){return C(Error("timeout"))}),V.on("uncaughtException",function(K){return C(K)}),V.end()};Q(F.url,$(F.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(F){var q=this,C=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=F,(C.total&&C.fileName?Promise.resolve({name:C.fileName,total:C.total}):this.getTotalSize()).then(function($){var{name:Q,total:J}=$;return q.__total=C.total||J,q.__fileName=C.fileName||Q,q.__downloaded=C.downloaded||q.__getFilesizeInBytes(q.__filePath),q.__reqOptions.headers.range="bytes="+q.__downloaded+"-",q.__isResumed=!0,q.__isResumable=!0,q.__setState(q.__states.RESUMED),q.emit("resume",q.__isResumed),new Promise(function(Z,V){q.__promise={resolve:Z,reject:V},q.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var F=this.__promise.resolve;return this.__promise=null,F(!0)}}},{key:"__downloadRequest",value:function(F,q){var C=this;return this.__protocol.request(this.__reqOptions,function($){if(C.__response=$,C.__isResumed||(C.__total=parseInt($.headers["content-length"])||null,C.__resetStats()),C.__isRequireRedirect($)){var Q=/^https?:\/\//.test($.headers.location)?$.headers.location:new N0.URL($.headers.location,C.url).href;return C.__isRedirected=!0,C.__initProtocol(Q),C.emit("redirected",Q,C.url),C.__start()}if($.statusCode!==200&&$.statusCode!==206){var J=Error("Response status was "+$.statusCode);return J.status=$.statusCode||0,J.body=$.body||"",C.__setState(C.__states.FAILED),C.emit("error",J),q(J)}C.__opts.forceResume?C.__isResumable=!0:$.headers.hasOwnProperty("accept-ranges")&&$.headers["accept-ranges"]!=="none"&&(C.__isResumable=!0),C.__startDownload($,F,q)})}},{key:"__startDownload",value:function(F,q,C){var $=this,Q=F;if(!this.__isResumed){var J=this.__getFileNameFromHeaders(F.headers);if(this.__filePath=this.__getFilePath(J),this.__fileName=this.__filePath.split(J0.sep).pop(),p.existsSync(this.__filePath)){var Z=this.__getFilesizeInBytes(this.__filePath),V=this.__total?this.__total:0;if(P3(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||Z>=V))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:Z}),this.__setState(this.__states.SKIPPED),q(!0)}this.__fileStream=p.createWriteStream(this.__filePath,{})}else this.__fileStream=p.createWriteStream(this.__filePath,{flags:"a"});this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,Q.on("data",function(K){return $.__calculateStats(K.length)}),this.__pipes.forEach(function(K){Q.pipe(K.stream,K.options),Q=K.stream}),Q.pipe(this.__fileStream),Q.on("error",this.__onError(q,C)),this.__fileStream.on("finish",this.__onFinished(q,C)),this.__fileStream.on("error",this.__onError(q,C))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(F){return 300<F.statusCode&&400>F.statusCode&&F.headers.hasOwnProperty("location")&&F.headers.location}},{key:"__onFinished",value:function(F,q){var C=this;return function(){C.__fileStream.close(function($){if($)return q($);if(C.__hasFinished()){var Q=!!C.__total&&C.__downloaded!==C.__total;if(Q&&C.__isResumable&&C.__opts.resumeOnIncomplete&&C.__resumeRetryCount<=C.__opts.resumeOnIncompleteMaxRetry)return C.__resumeRetryCount++,C.emit("warning",Error("uncomplete download, retrying")),C.resume();C.__setState(C.__states.FINISHED),C.__pipes=[],C.emit("end",{fileName:C.__fileName,filePath:C.__filePath,totalSize:C.__total,incomplete:Q,onDiskSize:C.__getFilesizeInBytes(C.__filePath),downloadedSize:C.__downloaded})}return F(C.__downloaded===C.__total)})}}},{key:"__closeFileStream",value:function(){var F=this;return this.__fileStream?new Promise(function(q,C){F.__fileStream.close(function($){return $?C($):q(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(F,q){var C=this,$=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function(Q){return C.__pipes=[],$&&C.__requestAbort(),C.state===C.__states.STOPPED||C.state===C.__states.FAILED?void 0:C.__opts.retry?C.__retry(Q).catch(function(J){C.__removeFile().finally(function(){C.__setState(C.__states.FAILED),C.emit("error",J?J:Q),q(J?J:Q)})}):C.__removeFile().finally(function(){C.__setState(C.__states.FAILED),C.emit("error",Q),q(Q)})}}},{key:"__retry",value:function(){var F=this,q=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||P3(this.__opts.retry)!=="object")return Promise.reject(q||Error("wrong retry options"));var C=this.__opts.retry,$=C.delay,Q=$===void 0?0:$,J=C.maxRetries,Z=J===void 0?999:J;return this.__retryCount>=Z?Promise.reject(q||Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,q),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(V){return V.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(V){return F.__retryTimeout=setTimeout(function(){return V(0<F.__downloaded?F.resume():F.__start())},Q)})}))}},{key:"__onTimeout",value:function(F,q){var C=this;return function(){return C.__requestAbort(),C.__opts.retry?C.__retry(Error("timeout")).catch(function($){C.__removeFile().finally(function(){C.__setState(C.__states.FAILED),$?q($):(C.emit("timeout"),q(Error("timeout")))})}):C.__removeFile().finally(function(){C.__setState(C.__states.FAILED),C.emit("timeout"),q(Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(F,q){var C="",$=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,Q=/.*filename="(.*?)";?/i,J=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,Z=F.hasOwnProperty("content-disposition"),V=Z?F["content-disposition"].match($):null,K=!Z||V?null:F["content-disposition"].match(Q),X=!Z||V||K?null:F["content-disposition"].match(J);return Z&&(V||K||X)?(C=F["content-disposition"],C=C.trim(),V?C=V[1]:K?C=K[1]:X&&(C=X[1]),C=C.replace(/[/\\]/g,"")):0<J0.basename(new N0.URL(this.requestURL).pathname).length?C=J0.basename(new N0.URL(this.requestURL).pathname):C=new N0.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(C,q):C.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(F){var q=J0.join(this.__destFolder,F),C=q;return this.__opts.override||this.state===this.__states.RESUMED||(C=this.__uniqFileNameSync(C),q!==C&&this.emit("renamed",{path:C,fileName:C.split(J0.sep).pop(),prevPath:q,prevFileName:q.split(J0.sep).pop()})),C}},{key:"__getFileNameFromOpts",value:function(F,q){if(!this.__opts.fileName)return F;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var C=J0.join(this.__destFolder,F);return q&&q.headers||this.__response&&this.__response.headers?this.__opts.fileName(F,C,(q?q:this.__response).headers["content-type"]):this.__opts.fileName(F,C)}if(P3(this.__opts.fileName)==="object"){var $=this.__opts.fileName,Q=$.name,J=!!$.hasOwnProperty("ext")&&$.ext;if(typeof J=="string")return Q+"."+J;if(typeof J=="boolean"){if(J)return Q;var Z=F.includes(".")?F.split(".").pop():"";return Z===""?Q:Q+"."+Z}}return F}},{key:"__calculateStats",value:function(F){var q=new Date,C=q-this.__statsEstimate.time,$=q-this.__statsEstimate.throttleTime,Q=this.__total||0;F&&(this.__downloaded+=F,this.__progress=Q===0?0:100*(this.__downloaded/Q),(this.__downloaded===Q||1000<C)&&(this.__statsEstimate.time=q,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===Q||$>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=q,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(F){this.state=F,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(F,q){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},$=new N0.URL(q),Q={protocol:$.protocol,host:$.hostname,port:$.port,path:$.pathname+$.search,method:F};return C&&(Q.headers=C),Q}},{key:"__getFilesizeInBytes",value:function(F){try{var q=p.statSync(F,{throwIfNoEntry:!1}),C=q.size||0;return C}catch($){this.emit("warning",$)}return 0}},{key:"__validate",value:function(F,q){if(typeof F!="string")throw Error("URL should be an string");if(F.trim()==="")throw Error("URL couldn't be empty");if(typeof q!="string")throw Error("Destination Folder should be an string");if(q.trim()==="")throw Error("Destination Folder couldn't be empty");if(!p.existsSync(q))throw Error("Destination Folder must exist");var C=p.statSync(q);if(!C.isDirectory())throw Error("Destination Folder must be a directory");try{p.accessSync(q,p.constants.W_OK)}catch($){throw Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(F){var q=this.__getReqOptions(this.__opts.method,F,this.__headers);this.requestURL=F,-1<F.indexOf("https://")?(this.__protocol=J1,q.agent=new J1.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},q,this.__opts.httpsRequestOptions)):(this.__protocol=Q1,q.agent=new Q1.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},q,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(F){if(typeof F!="string"||F==="")return F;try{p.accessSync(F,p.F_OK);var q=F.match(/(.*)(\([0-9]+\))(\..*)$/),C=q?q[1].trim():F,$=q?parseInt(q[2].replace(/\(|\)/,"")):0,Q=F.split(".").pop();return Q!==F&&0<Q.length?(Q="."+Q,C=C.replace(Q,"")):Q="",this.__uniqFileNameSync(C+" ("+ ++$+")"+Q)}catch(J){return F}}},{key:"__removeFile",value:function(){var F=this;return new Promise(function(q){return F.__fileStream?void F.__fileStream.close(function(C){return C&&F.emit("warning",C),F.__opts.removeOnFail?p.access(F.__filePath,function($){return $?q():void p.unlink(F.__filePath,function(Q){Q&&F.emit("warning",C),q()})}):void q()}):q()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),u}($F.EventEmitter)});var A_=G((RB,W_)=>{var a0=1000,n0=a0*60,s0=n0*60,j0=s0*24,nq=j0*7,sq=j0*365.25;W_.exports=function(D,u){u=u||{};var _=typeof D;if(_==="string"&&D.length>0)return tq(D);else if(_==="number"&&isFinite(D))return u.long?rq(D):oq(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function tq(D){if(D=String(D),D.length>100)return;var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(D);if(!u)return;var _=parseFloat(u[1]),F=(u[2]||"ms").toLowerCase();switch(F){case"years":case"year":case"yrs":case"yr":case"y":return _*sq;case"weeks":case"week":case"w":return _*nq;case"days":case"day":case"d":return _*j0;case"hours":case"hour":case"hrs":case"hr":case"h":return _*s0;case"minutes":case"minute":case"mins":case"min":case"m":return _*n0;case"seconds":case"second":case"secs":case"sec":case"s":return _*a0;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return _;default:return}}function oq(D){var u=Math.abs(D);if(u>=j0)return Math.round(D/j0)+"d";if(u>=s0)return Math.round(D/s0)+"h";if(u>=n0)return Math.round(D/n0)+"m";if(u>=a0)return Math.round(D/a0)+"s";return D+"ms"}function rq(D){var u=Math.abs(D);if(u>=j0)return yu(D,u,j0,"day");if(u>=s0)return yu(D,u,s0,"hour");if(u>=n0)return yu(D,u,n0,"minute");if(u>=a0)return yu(D,u,a0,"second");return D+" ms"}function yu(D,u,_,F){var q=u>=_*1.5;return Math.round(D/_)+" "+F+(q?"s":"")}});var l8=G((NB,z_)=>{function eq(D){_.debug=_,_.default=_,_.coerce=J,_.disable=$,_.enable=q,_.enabled=Q,_.humanize=A_(),_.destroy=Z,Object.keys(D).forEach((V)=>{_[V]=D[V]}),_.names=[],_.skips=[],_.formatters={};function u(V){let K=0;for(let X=0;X<V.length;X++)K=(K<<5)-K+V.charCodeAt(X),K|=0;return _.colors[Math.abs(K)%_.colors.length]}_.selectColor=u;function _(V){let K,X=null,B,L;function z(...j){if(!z.enabled)return;let E=z,c=Number(new Date),m=c-(K||c);if(E.diff=m,E.prev=K,E.curr=c,K=c,j[0]=_.coerce(j[0]),typeof j[0]!=="string")j.unshift("%O");let lD=0;j[0]=j[0].replace(/%([a-zA-Z%])/g,(t,t2)=>{if(t==="%%")return"%";lD++;let C1=_.formatters[t2];if(typeof C1==="function"){let s4=j[lD];t=C1.call(E,s4),j.splice(lD,1),lD--}return t}),_.formatArgs.call(E,j),(E.log||_.log).apply(E,j)}if(z.namespace=V,z.useColors=_.useColors(),z.color=_.selectColor(V),z.extend=F,z.destroy=_.destroy,Object.defineProperty(z,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(X!==null)return X;if(B!==_.namespaces)B=_.namespaces,L=_.enabled(V);return L},set:(j)=>{X=j}}),typeof _.init==="function")_.init(z);return z}function F(V,K){let X=_(this.namespace+(typeof K>"u"?":":K)+V);return X.log=this.log,X}function q(V){_.save(V),_.namespaces=V,_.names=[],_.skips=[];let K=(typeof V==="string"?V:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let X of K)if(X[0]==="-")_.skips.push(X.slice(1));else _.names.push(X)}function C(V,K){let X=0,B=0,L=-1,z=0;while(X<V.length)if(B<K.length&&(K[B]===V[X]||K[B]==="*"))if(K[B]==="*")L=B,z=X,B++;else X++,B++;else if(L!==-1)B=L+1,z++,X=z;else return!1;while(B<K.length&&K[B]==="*")B++;return B===K.length}function $(){let V=[..._.names,..._.skips.map((K)=>"-"+K)].join(",");return _.enable(""),V}function Q(V){for(let K of _.skips)if(C(V,K))return!1;for(let K of _.names)if(C(V,K))return!0;return!1}function J(V){if(V instanceof Error)return V.stack||V.message;return V}function Z(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return _.enable(_.load()),_}z_.exports=eq});var U_=G((L_,hu)=>{L_.formatArgs=uC;L_.save=_C;L_.load=FC;L_.useColors=DC;L_.storage=qC();L_.destroy=(()=>{let D=!1;return()=>{if(!D)D=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();L_.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function DC(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let D;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(D=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(D[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function uC(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+hu.exports.humanize(this.diff),!this.useColors)return;let u="color: "+this.color;D.splice(1,0,u,"color: inherit");let _=0,F=0;D[0].replace(/%[a-zA-Z%]/g,(q)=>{if(q==="%%")return;if(_++,q==="%c")F=_}),D.splice(F,0,u)}L_.log=console.debug||console.log||(()=>{});function _C(D){try{if(D)L_.storage.setItem("debug",D);else L_.storage.removeItem("debug")}catch(u){}}function FC(){let D;try{D=L_.storage.getItem("debug")||L_.storage.getItem("DEBUG")}catch(u){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function qC(){try{return localStorage}catch(D){}}hu.exports=l8()(L_);var{formatters:CC}=hu.exports;CC.j=function(D){try{return JSON.stringify(D)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}});var I_=G((j_,gu)=>{var BC=T("tty"),bu=T("util");j_.init=zC;j_.log=xC;j_.formatArgs=YC;j_.save=WC;j_.load=AC;j_.useColors=GC;j_.destroy=bu.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");j_.colors=[6,2,3,4,5,1];try{let D=(()=>{throw new Error("Cannot require module "+"supports-color");})();if(D&&(D.stderr||D).level>=2)j_.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(D){}j_.inspectOpts=Object.keys(process.env).filter((D)=>{return/^debug_/i.test(D)}).reduce((D,u)=>{let _=u.substring(6).toLowerCase().replace(/_([a-z])/g,(q,C)=>{return C.toUpperCase()}),F=process.env[u];if(/^(yes|on|true|enabled)$/i.test(F))F=!0;else if(/^(no|off|false|disabled)$/i.test(F))F=!1;else if(F==="null")F=null;else F=Number(F);return D[_]=F,D},{});function GC(){return"colors"in j_.inspectOpts?Boolean(j_.inspectOpts.colors):BC.isatty(process.stderr.fd)}function YC(D){let{namespace:u,useColors:_}=this;if(_){let F=this.color,q="\x1B[3"+(F<8?F:"8;5;"+F),C=` ${q};1m${u} \x1B[0m`;D[0]=C+D[0].split(`
2
+ import{createRequire as I4}from"node:module";var M4=Object.create;var{getPrototypeOf:U4,defineProperty:y_,getOwnPropertyNames:C3,getOwnPropertyDescriptor:O4}=Object,I3=Object.prototype.hasOwnProperty;var v6=(_,q,$)=>{$=_!=null?M4(U4(_)):{};let Q=q||!_||!_.__esModule?y_($,"default",{value:_,enumerable:!0}):$;for(let x of C3(_))if(!I3.call(Q,x))y_(Q,x,{get:()=>_[x],enumerable:!0});return Q},B3=new WeakMap,j4=(_)=>{var q=B3.get(_),$;if(q)return q;if(q=y_({},"__esModule",{value:!0}),_&&typeof _==="object"||typeof _==="function")C3(_).map((Q)=>!I3.call(q,Q)&&y_(q,Q,{get:()=>_[Q],enumerable:!($=O4(_,Q))||$.enumerable}));return B3.set(_,q),q},I=(_,q)=>()=>(q||_((q={exports:{}}).exports,q),q.exports);var B4=(_,q)=>{for(var $ in q)y_(_,$,{get:q[$],enumerable:!0,configurable:!0,set:(Q)=>q[$]=()=>Q})};var C4=(_,q)=>()=>(_&&(q=_(_=0)),q);var B=I4(import.meta.url);var S1=I((S3)=>{Object.defineProperty(S3,"__esModule",{value:!0}),S3.DownloaderHelper=S3.DH_STATES=void 0;var R1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},A4=function(){function _(q,$){for(var Q,x=0;x<$.length;x++)Q=$[x],Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(q,Q.key,Q)}return function(q,$,Q){return $&&_(q.prototype,$),Q&&_(q,Q),q}}(),T4=B("fs"),u=w6(T4),Z_=B("url"),F4=B("path"),c0=w6(F4),R4=B("http"),A3=w6(R4),S4=B("https"),T3=w6(S4),D4=B("events");function w6(_){if(_&&_.__esModule)return _;var q={};if(_!=null)for(var $ in _)Object.prototype.hasOwnProperty.call(_,$)&&(q[$]=_[$]);return q.default=_,q}function N4(_,q){if(!(_ instanceof q))throw TypeError("Cannot call a class as a function")}function F3(_,q){if(!_)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return q&&(typeof q=="object"||typeof q=="function")?q:_}function h4(_,q){if(typeof q!="function"&&q!==null)throw TypeError("Super expression must either be null or a function, not "+typeof q);_.prototype=Object.create(q&&q.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),q&&(Object.setPrototypeOf?Object.setPrototypeOf(_,q):_.__proto__=q)}var R3=S3.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"},_Q=S3.DownloaderHelper=function(_){function q($,Q){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};N4(this,q);var J=F3(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,{captureRejections:!0}));return J.__validate($,Q)?(J.url=J.requestURL=$.trim(),J.state=R3.IDLE,J.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1000,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},J.__opts=Object.assign({},J.__defaultOpts),J.__pipes=[],J.__total=0,J.__downloaded=0,J.__progress=0,J.__retryCount=0,J.__retryTimeout=null,J.__resumeRetryCount=0,J.__states=R3,J.__promise=null,J.__request=null,J.__response=null,J.__isAborted=!1,J.__isResumed=!1,J.__isResumable=!1,J.__isRedirected=!1,J.__destFolder=Q,J.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},J.__fileName="",J.__filePath="",J.updateOptions(x),J):F3(J)}return h4(q,_),A4(q,[{key:"start",value:function(){var Q=this,x=function(){return new Promise(function(J,X){Q.__promise={resolve:J,reject:X},Q.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(J){var{name:X,total:V}=J,K=Q.__opts.override;if(Q.__opts.override=!0,Q.__filePath=Q.__getFilePath(X),Q.__opts.override=K,Q.__filePath&&u.existsSync(Q.__filePath)){var G=Q.__getFilesizeInBytes(Q.__filePath);return G===V?x():Q.resumeFromFile(Q.__filePath,{total:V,fileName:X})}return x()}):x()}},{key:"pause",value:function(){var Q=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(x){return x.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return Q.__setState(Q.__states.PAUSED),Q.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var Q=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var x=function(){return new Promise(function(J,X){u.access(Q.__filePath,function(V){return V?(Q.__emitStop(),J(!0)):void u.unlink(Q.__filePath,function(K){return K?(Q.__setState(Q.__states.FAILED),Q.emit("error",K),X(K)):(Q.__emitStop(),void J(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return Q.__opts.removeOnStop?x():(Q.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(Q){var x=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:Q,options:x}),Q}},{key:"unpipe",value:function(){var Q=this,x=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,J=function(V){return Q.__response?Q.__response.unpipe(V):V.unpipe()};if(x){var X=this.__pipes.find(function(V){return V.stream===x});return void(X&&(J(x),this.__pipes=this.__pipes.filter(function(V){return V.stream!==x})))}this.__pipes.forEach(function(V){return J(V.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(Q){var x=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,Q),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=x||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var Q=this;return new Promise(function(x,J){var X=function(K){Q.__initProtocol(K);var G=Object.assign({},Q.__headers);G.hasOwnProperty("range")&&delete G.range;var Z=Q.__getReqOptions("HEAD",K,G);return Object.assign({},Q.__reqOptions,Z)},V=function(K,G){var Z=Q.__protocol.request(G,function(Y){if(Q.__isRequireRedirect(Y)){var H=/^https?:\/\//.test(Y.headers.location)?Y.headers.location:new Z_.URL(Y.headers.location,K).href;return Q.emit("redirected",H,K),V(H,X(H))}return Y.statusCode===200?void x({name:Q.__getFileNameFromHeaders(Y.headers,Y),total:parseInt(Y.headers["content-length"])||null}):J(Error("Response status was "+Y.statusCode))});Z.on("error",function(Y){return J(Y)}),Z.on("timeout",function(){return J(Error("timeout"))}),Z.on("uncaughtException",function(Y){return J(Y)}),Z.end()};V(Q.url,X(Q.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(Q){var x=this,J=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=Q,(J.total&&J.fileName?Promise.resolve({name:J.fileName,total:J.total}):this.getTotalSize()).then(function(X){var{name:V,total:K}=X;return x.__total=J.total||K,x.__fileName=J.fileName||V,x.__downloaded=J.downloaded||x.__getFilesizeInBytes(x.__filePath),x.__reqOptions.headers.range="bytes="+x.__downloaded+"-",x.__isResumed=!0,x.__isResumable=!0,x.__setState(x.__states.RESUMED),x.emit("resume",x.__isResumed),new Promise(function(G,Z){x.__promise={resolve:G,reject:Z},x.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var Q=this.__promise.resolve;return this.__promise=null,Q(!0)}}},{key:"__downloadRequest",value:function(Q,x){var J=this;return this.__protocol.request(this.__reqOptions,function(X){if(J.__response=X,J.__isResumed||(J.__total=parseInt(X.headers["content-length"])||null,J.__resetStats()),J.__isRequireRedirect(X)){var V=/^https?:\/\//.test(X.headers.location)?X.headers.location:new Z_.URL(X.headers.location,J.url).href;return J.__isRedirected=!0,J.__initProtocol(V),J.emit("redirected",V,J.url),J.__start()}if(X.statusCode!==200&&X.statusCode!==206){var K=Error("Response status was "+X.statusCode);return K.status=X.statusCode||0,K.body=X.body||"",J.__setState(J.__states.FAILED),J.emit("error",K),x(K)}J.__opts.forceResume?J.__isResumable=!0:X.headers.hasOwnProperty("accept-ranges")&&X.headers["accept-ranges"]!=="none"&&(J.__isResumable=!0),J.__startDownload(X,Q,x)})}},{key:"__startDownload",value:function(Q,x,J){var X=this,V=Q;if(!this.__isResumed){var K=this.__getFileNameFromHeaders(Q.headers);if(this.__filePath=this.__getFilePath(K),this.__fileName=this.__filePath.split(c0.sep).pop(),u.existsSync(this.__filePath)){var G=this.__getFilesizeInBytes(this.__filePath),Z=this.__total?this.__total:0;if(R1(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||G>=Z))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:G}),this.__setState(this.__states.SKIPPED),x(!0)}this.__fileStream=u.createWriteStream(this.__filePath,{})}else this.__fileStream=u.createWriteStream(this.__filePath,{flags:"a"});this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,V.on("data",function(Y){return X.__calculateStats(Y.length)}),this.__pipes.forEach(function(Y){V.pipe(Y.stream,Y.options),V=Y.stream}),V.pipe(this.__fileStream),V.on("error",this.__onError(x,J)),this.__fileStream.on("finish",this.__onFinished(x,J)),this.__fileStream.on("error",this.__onError(x,J))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(Q){return 300<Q.statusCode&&400>Q.statusCode&&Q.headers.hasOwnProperty("location")&&Q.headers.location}},{key:"__onFinished",value:function(Q,x){var J=this;return function(){J.__fileStream.close(function(X){if(X)return x(X);if(J.__hasFinished()){var V=!!J.__total&&J.__downloaded!==J.__total;if(V&&J.__isResumable&&J.__opts.resumeOnIncomplete&&J.__resumeRetryCount<=J.__opts.resumeOnIncompleteMaxRetry)return J.__resumeRetryCount++,J.emit("warning",Error("uncomplete download, retrying")),J.resume();J.__setState(J.__states.FINISHED),J.__pipes=[],J.emit("end",{fileName:J.__fileName,filePath:J.__filePath,totalSize:J.__total,incomplete:V,onDiskSize:J.__getFilesizeInBytes(J.__filePath),downloadedSize:J.__downloaded})}return Q(J.__downloaded===J.__total)})}}},{key:"__closeFileStream",value:function(){var Q=this;return this.__fileStream?new Promise(function(x,J){Q.__fileStream.close(function(X){return X?J(X):x(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(Q,x){var J=this,X=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function(V){return J.__pipes=[],X&&J.__requestAbort(),J.state===J.__states.STOPPED||J.state===J.__states.FAILED?void 0:J.__opts.retry?J.__retry(V).catch(function(K){J.__removeFile().finally(function(){J.__setState(J.__states.FAILED),J.emit("error",K?K:V),x(K?K:V)})}):J.__removeFile().finally(function(){J.__setState(J.__states.FAILED),J.emit("error",V),x(V)})}}},{key:"__retry",value:function(){var Q=this,x=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||R1(this.__opts.retry)!=="object")return Promise.reject(x||Error("wrong retry options"));var J=this.__opts.retry,X=J.delay,V=X===void 0?0:X,K=J.maxRetries,G=K===void 0?999:K;return this.__retryCount>=G?Promise.reject(x||Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,x),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(Z){return Z.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(Z){return Q.__retryTimeout=setTimeout(function(){return Z(0<Q.__downloaded?Q.resume():Q.__start())},V)})}))}},{key:"__onTimeout",value:function(Q,x){var J=this;return function(){return J.__requestAbort(),J.__opts.retry?J.__retry(Error("timeout")).catch(function(X){J.__removeFile().finally(function(){J.__setState(J.__states.FAILED),X?x(X):(J.emit("timeout"),x(Error("timeout")))})}):J.__removeFile().finally(function(){J.__setState(J.__states.FAILED),J.emit("timeout"),x(Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(Q,x){var J="",X=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,V=/.*filename="(.*?)";?/i,K=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,G=Q.hasOwnProperty("content-disposition"),Z=G?Q["content-disposition"].match(X):null,Y=!G||Z?null:Q["content-disposition"].match(V),H=!G||Z||Y?null:Q["content-disposition"].match(K);return G&&(Z||Y||H)?(J=Q["content-disposition"],J=J.trim(),Z?J=Z[1]:Y?J=Y[1]:H&&(J=H[1]),J=J.replace(/[/\\]/g,"")):0<c0.basename(new Z_.URL(this.requestURL).pathname).length?J=c0.basename(new Z_.URL(this.requestURL).pathname):J=new Z_.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(J,x):J.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(Q){var x=c0.join(this.__destFolder,Q),J=x;return this.__opts.override||this.state===this.__states.RESUMED||(J=this.__uniqFileNameSync(J),x!==J&&this.emit("renamed",{path:J,fileName:J.split(c0.sep).pop(),prevPath:x,prevFileName:x.split(c0.sep).pop()})),J}},{key:"__getFileNameFromOpts",value:function(Q,x){if(!this.__opts.fileName)return Q;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var J=c0.join(this.__destFolder,Q);return x&&x.headers||this.__response&&this.__response.headers?this.__opts.fileName(Q,J,(x?x:this.__response).headers["content-type"]):this.__opts.fileName(Q,J)}if(R1(this.__opts.fileName)==="object"){var X=this.__opts.fileName,V=X.name,K=!!X.hasOwnProperty("ext")&&X.ext;if(typeof K=="string")return V+"."+K;if(typeof K=="boolean"){if(K)return V;var G=Q.includes(".")?Q.split(".").pop():"";return G===""?V:V+"."+G}}return Q}},{key:"__calculateStats",value:function(Q){var x=new Date,J=x-this.__statsEstimate.time,X=x-this.__statsEstimate.throttleTime,V=this.__total||0;Q&&(this.__downloaded+=Q,this.__progress=V===0?0:100*(this.__downloaded/V),(this.__downloaded===V||1000<J)&&(this.__statsEstimate.time=x,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===V||X>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=x,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(Q){this.state=Q,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(Q,x){var J=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},X=new Z_.URL(x),V={protocol:X.protocol,host:X.hostname,port:X.port,path:X.pathname+X.search,method:Q};return J&&(V.headers=J),V}},{key:"__getFilesizeInBytes",value:function(Q){try{var x=u.statSync(Q,{throwIfNoEntry:!1}),J=x.size||0;return J}catch(X){this.emit("warning",X)}return 0}},{key:"__validate",value:function(Q,x){if(typeof Q!="string")throw Error("URL should be an string");if(Q.trim()==="")throw Error("URL couldn't be empty");if(typeof x!="string")throw Error("Destination Folder should be an string");if(x.trim()==="")throw Error("Destination Folder couldn't be empty");if(!u.existsSync(x))throw Error("Destination Folder must exist");var J=u.statSync(x);if(!J.isDirectory())throw Error("Destination Folder must be a directory");try{u.accessSync(x,u.constants.W_OK)}catch(X){throw Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(Q){var x=this.__getReqOptions(this.__opts.method,Q,this.__headers);this.requestURL=Q,-1<Q.indexOf("https://")?(this.__protocol=T3,x.agent=new T3.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},x,this.__opts.httpsRequestOptions)):(this.__protocol=A3,x.agent=new A3.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},x,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(Q){if(typeof Q!="string"||Q==="")return Q;try{u.accessSync(Q,u.F_OK);var x=Q.match(/(.*)(\([0-9]+\))(\..*)$/),J=x?x[1].trim():Q,X=x?parseInt(x[2].replace(/\(|\)/,"")):0,V=Q.split(".").pop();return V!==Q&&0<V.length?(V="."+V,J=J.replace(V,"")):V="",this.__uniqFileNameSync(J+" ("+ ++X+")"+V)}catch(K){return Q}}},{key:"__removeFile",value:function(){var Q=this;return new Promise(function(x){return Q.__fileStream?void Q.__fileStream.close(function(J){return J&&Q.emit("warning",J),Q.__opts.removeOnFail?u.access(Q.__filePath,function(X){return X?x():void u.unlink(Q.__filePath,function(V){V&&Q.emit("warning",J),x()})}):void x()}):x()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),q}(D4.EventEmitter)});var d9=I((cJ,l9)=>{var A_=1000,T_=A_*60,F_=T_*60,Q_=F_*24,C5=Q_*7,I5=Q_*365.25;l9.exports=function(_,q){q=q||{};var $=typeof _;if($==="string"&&_.length>0)return A5(_);else if($==="number"&&isFinite(_))return q.long?F5(_):T5(_);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function A5(_){if(_=String(_),_.length>100)return;var q=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(!q)return;var $=parseFloat(q[1]),Q=(q[2]||"ms").toLowerCase();switch(Q){case"years":case"year":case"yrs":case"yr":case"y":return $*I5;case"weeks":case"week":case"w":return $*C5;case"days":case"day":case"d":return $*Q_;case"hours":case"hour":case"hrs":case"hr":case"h":return $*F_;case"minutes":case"minute":case"mins":case"min":case"m":return $*T_;case"seconds":case"second":case"secs":case"sec":case"s":return $*A_;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return $;default:return}}function T5(_){var q=Math.abs(_);if(q>=Q_)return Math.round(_/Q_)+"d";if(q>=F_)return Math.round(_/F_)+"h";if(q>=T_)return Math.round(_/T_)+"m";if(q>=A_)return Math.round(_/A_)+"s";return _+"ms"}function F5(_){var q=Math.abs(_);if(q>=Q_)return x1(_,q,Q_,"day");if(q>=F_)return x1(_,q,F_,"hour");if(q>=T_)return x1(_,q,T_,"minute");if(q>=A_)return x1(_,q,A_,"second");return _+" ms"}function x1(_,q,$,Q){var x=q>=$*1.5;return Math.round(_/$)+" "+Q+(x?"s":"")}});var a2=I((lJ,f9)=>{function R5(_){$.debug=$,$.default=$,$.coerce=K,$.disable=X,$.enable=x,$.enabled=V,$.humanize=d9(),$.destroy=G,Object.keys(_).forEach((Z)=>{$[Z]=_[Z]}),$.names=[],$.skips=[],$.formatters={};function q(Z){let Y=0;for(let H=0;H<Z.length;H++)Y=(Y<<5)-Y+Z.charCodeAt(H),Y|=0;return $.colors[Math.abs(Y)%$.colors.length]}$.selectColor=q;function $(Z){let Y,H=null,w,U;function L(...M){if(!L.enabled)return;let E=L,$0=Number(new Date),H6=$0-(Y||$0);if(E.diff=H6,E.prev=Y,E.curr=$0,Y=$0,M[0]=$.coerce(M[0]),typeof M[0]!=="string")M.unshift("%O");let K_=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(Q0,W6)=>{if(Q0==="%%")return"%";K_++;let j3=$.formatters[W6];if(typeof j3==="function"){let P4=M[K_];Q0=j3.call(E,P4),M.splice(K_,1),K_--}return Q0}),$.formatArgs.call(E,M),(E.log||$.log).apply(E,M)}if(L.namespace=Z,L.useColors=$.useColors(),L.color=$.selectColor(Z),L.extend=Q,L.destroy=$.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(H!==null)return H;if(w!==$.namespaces)w=$.namespaces,U=$.enabled(Z);return U},set:(M)=>{H=M}}),typeof $.init==="function")$.init(L);return L}function Q(Z,Y){let H=$(this.namespace+(typeof Y>"u"?":":Y)+Z);return H.log=this.log,H}function x(Z){$.save(Z),$.namespaces=Z,$.names=[],$.skips=[];let Y=(typeof Z==="string"?Z:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let H of Y)if(H[0]==="-")$.skips.push(H.slice(1));else $.names.push(H)}function J(Z,Y){let H=0,w=0,U=-1,L=0;while(H<Z.length)if(w<Y.length&&(Y[w]===Z[H]||Y[w]==="*"))if(Y[w]==="*")U=w,L=H,w++;else H++,w++;else if(U!==-1)w=U+1,L++,H=L;else return!1;while(w<Y.length&&Y[w]==="*")w++;return w===Y.length}function X(){let Z=[...$.names,...$.skips.map((Y)=>"-"+Y)].join(",");return $.enable(""),Z}function V(Z){for(let Y of $.skips)if(J(Z,Y))return!1;for(let Y of $.names)if(J(Z,Y))return!0;return!1}function K(Z){if(Z instanceof Error)return Z.stack||Z.message;return Z}function G(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return $.enable($.load()),$}f9.exports=R5});var p9=I((i9,J1)=>{i9.formatArgs=D5;i9.save=N5;i9.load=h5;i9.useColors=S5;i9.storage=y5();i9.destroy=(()=>{let _=!1;return()=>{if(!_)_=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();i9.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function S5(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let _;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(_=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(_[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function D5(_){if(_[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+_[0]+(this.useColors?"%c ":" ")+"+"+J1.exports.humanize(this.diff),!this.useColors)return;let q="color: "+this.color;_.splice(1,0,q,"color: inherit");let $=0,Q=0;_[0].replace(/%[a-zA-Z%]/g,(x)=>{if(x==="%%")return;if($++,x==="%c")Q=$}),_.splice(Q,0,q)}i9.log=console.debug||console.log||(()=>{});function N5(_){try{if(_)i9.storage.setItem("debug",_);else i9.storage.removeItem("debug")}catch(q){}}function h5(){let _;try{_=i9.storage.getItem("debug")||i9.storage.getItem("DEBUG")}catch(q){}if(!_&&typeof process<"u"&&"env"in process)_=process.env.DEBUG;return _}function y5(){try{return localStorage}catch(_){}}J1.exports=a2()(i9);var{formatters:g5}=J1.exports;g5.j=function(_){try{return JSON.stringify(_)}catch(q){return"[UnexpectedJSONParseError]: "+q.message}}});var n9={};B4(n9,{default:()=>n5,createSupportsColor:()=>o2});import t2 from"node:process";import d5 from"node:os";import s9 from"node:tty";function n(_,q=globalThis.Deno?globalThis.Deno.args:t2.argv){let $=_.startsWith("-")?"":_.length===1?"-":"--",Q=q.indexOf($+_),x=q.indexOf("--");return Q!==-1&&(x===-1||Q<x)}function f5(){if("FORCE_COLOR"in A){if(A.FORCE_COLOR==="true")return 1;if(A.FORCE_COLOR==="false")return 0;return A.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(A.FORCE_COLOR,10),3)}}function i5(_){if(_===0)return!1;return{level:_,hasBasic:!0,has256:_>=2,has16m:_>=3}}function p5(_,{streamIsTTY:q,sniffFlags:$=!0}={}){let Q=f5();if(Q!==void 0)X1=Q;let x=$?X1:Q;if(x===0)return 0;if($){if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2}if("TF_BUILD"in A&&"AGENT_NAME"in A)return 1;if(_&&!q&&x===void 0)return 0;let J=x||0;if(A.TERM==="dumb")return J;if(t2.platform==="win32"){let X=d5.release().split(".");if(Number(X[0])>=10&&Number(X[2])>=10586)return Number(X[2])>=14931?3:2;return 1}if("CI"in A){if("GITHUB_ACTIONS"in A||"GITEA_ACTIONS"in A)return 3;if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((X)=>(X in A))||A.CI_NAME==="codeship")return 1;return J}if("TEAMCITY_VERSION"in A)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(A.TEAMCITY_VERSION)?1:0;if(A.COLORTERM==="truecolor")return 3;if(A.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in A){let X=Number.parseInt((A.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(A.TERM_PROGRAM){case"iTerm.app":return X>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(A.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(A.TERM))return 1;if("COLORTERM"in A)return 1;return J}function o2(_,q={}){let $=p5(_,{streamIsTTY:_&&_.isTTY,...q});return i5($)}var A,X1,s5,n5;var a9=C4(()=>{({env:A}=t2);if(n("no-color")||n("no-colors")||n("color=false")||n("color=never"))X1=0;else if(n("color")||n("colors")||n("color=true")||n("color=always"))X1=1;s5={stdout:o2({isTTY:s9.isatty(1)}),stderr:o2({isTTY:s9.isatty(2)})},n5=s5});var e9=I((t9,K1)=>{var a5=B("tty"),V1=B("util");t9.init=$q;t9.log=e5;t9.formatArgs=t5;t9.save=_q;t9.load=qq;t9.useColors=o5;t9.destroy=V1.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");t9.colors=[6,2,3,4,5,1];try{let _=(a9(),j4(n9));if(_&&(_.stderr||_).level>=2)t9.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(_){}t9.inspectOpts=Object.keys(process.env).filter((_)=>{return/^debug_/i.test(_)}).reduce((_,q)=>{let $=q.substring(6).toLowerCase().replace(/_([a-z])/g,(x,J)=>{return J.toUpperCase()}),Q=process.env[q];if(/^(yes|on|true|enabled)$/i.test(Q))Q=!0;else if(/^(no|off|false|disabled)$/i.test(Q))Q=!1;else if(Q==="null")Q=null;else Q=Number(Q);return _[$]=Q,_},{});function o5(){return"colors"in t9.inspectOpts?Boolean(t9.inspectOpts.colors):a5.isatty(process.stderr.fd)}function t5(_){let{namespace:q,useColors:$}=this;if($){let Q=this.color,x="\x1B[3"+(Q<8?Q:"8;5;"+Q),J=` ${x};1m${q} \x1B[0m`;_[0]=J+_[0].split(`
3
3
  `).join(`
4
- `+C),D.push(q+"m+"+gu.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=HC()+u+" "+D[0]}function HC(){if(j_.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function xC(...D){return process.stderr.write(bu.formatWithOptions(j_.inspectOpts,...D)+`
5
- `)}function WC(D){if(D)process.env.DEBUG=D;else delete process.env.DEBUG}function AC(){return process.env.DEBUG}function zC(D){D.inspectOpts={};let u=Object.keys(j_.inspectOpts);for(let _=0;_<u.length;_++)D.inspectOpts[u[_]]=j_.inspectOpts[u[_]]}gu.exports=l8()(j_);var{formatters:O_}=gu.exports;O_.o=function(D){return this.inspectOpts.colors=this.useColors,bu.inspect(D,this.inspectOpts).split(`
6
- `).map((u)=>u.trim()).join(" ")};O_.O=function(D){return this.inspectOpts.colors=this.useColors,bu.inspect(D,this.inspectOpts)}});var w_=G((kB,c8)=>{if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)c8.exports=U_();else c8.exports=I_()});var v_=G((yB,T_)=>{T_.exports=M_;function M_(D,u){if(D&&u)return M_(D)(u);if(typeof D!=="function")throw TypeError("need wrapper function");return Object.keys(D).forEach(function(F){_[F]=D[F]}),_;function _(){var F=Array(arguments.length);for(var q=0;q<F.length;q++)F[q]=arguments[q];var C=D.apply(this,F),$=F[F.length-1];if(typeof C==="function"&&C!==$)Object.keys($).forEach(function(Q){C[Q]=$[Q]});return C}}});var i8=G((hB,p8)=>{var R_=v_();p8.exports=R_(mu);p8.exports.strict=R_(N_);mu.proto=mu(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return mu(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return N_(this)},configurable:!0})});function mu(D){var u=function(){if(u.called)return u.value;return u.called=!0,u.value=D.apply(this,arguments)};return u.called=!1,u}function N_(D){var u=function(){if(u.called)throw Error(u.onceError);return u.called=!0,u.value=D.apply(this,arguments)},_=D.name||"Function wrapped with `once`";return u.onceError=_+" shouldn't be called more than once",u.called=!1,u}});var k_=G((bB,E_)=>{var MC=i8(),TC=function(){},vC=global.Bare?queueMicrotask:process.nextTick.bind(process),RC=function(D){return D.setHeader&&typeof D.abort==="function"},NC=function(D){return D.stdio&&Array.isArray(D.stdio)&&D.stdio.length===3},S_=function(D,u,_){if(typeof u==="function")return S_(D,null,u);if(!u)u={};_=MC(_||TC);var{_writableState:F,_readableState:q}=D,C=u.readable||u.readable!==!1&&D.readable,$=u.writable||u.writable!==!1&&D.writable,Q=!1,J=function(){if(!D.writable)Z()},Z=function(){if($=!1,!C)_.call(D)},V=function(){if(C=!1,!$)_.call(D)},K=function(j){_.call(D,j?Error("exited with error code: "+j):null)},X=function(j){_.call(D,j)},B=function(){vC(L)},L=function(){if(Q)return;if(C&&!(q&&(q.ended&&!q.destroyed)))return _.call(D,Error("premature close"));if($&&!(F&&(F.ended&&!F.destroyed)))return _.call(D,Error("premature close"))},z=function(){D.req.on("finish",Z)};if(RC(D))if(D.on("complete",Z),D.on("abort",B),D.req)z();else D.on("request",z);else if($&&!F)D.on("end",J),D.on("close",J);if(NC(D))D.on("exit",K);if(D.on("end",V),D.on("finish",Z),u.error!==!1)D.on("error",X);return D.on("close",B),function(){if(Q=!0,D.removeListener("complete",Z),D.removeListener("abort",B),D.removeListener("request",z),D.req)D.req.removeListener("finish",Z);D.removeListener("end",J),D.removeListener("close",J),D.removeListener("finish",Z),D.removeListener("exit",K),D.removeListener("end",V),D.removeListener("error",X),D.removeListener("close",B)}};E_.exports=S_});var b_=G((gB,h_)=>{var SC=i8(),EC=k_(),fu;try{fu=T("fs")}catch(D){}var R2=function(){},kC=typeof process>"u"?!1:/^v?\.0/.test(process.version),du=function(D){return typeof D==="function"},yC=function(D){if(!kC)return!1;if(!fu)return!1;return(D instanceof(fu.ReadStream||R2)||D instanceof(fu.WriteStream||R2))&&du(D.close)},hC=function(D){return D.setHeader&&du(D.abort)},bC=function(D,u,_,F){F=SC(F);var q=!1;D.on("close",function(){q=!0}),EC(D,{readable:u,writable:_},function($){if($)return F($);q=!0,F()});var C=!1;return function($){if(q)return;if(C)return;if(C=!0,yC(D))return D.close(R2);if(hC(D))return D.abort();if(du(D.destroy))return D.destroy();F($||Error("stream was destroyed"))}},y_=function(D){D()},gC=function(D,u){return D.pipe(u)},mC=function(){var D=Array.prototype.slice.call(arguments),u=du(D[D.length-1]||R2)&&D.pop()||R2;if(Array.isArray(D[0]))D=D[0];if(D.length<2)throw Error("pump requires two streams per minimum");var _,F=D.map(function(q,C){var $=C<D.length-1,Q=C>0;return bC(q,$,Q,function(J){if(!_)_=J;if(J)F.forEach(y_);if($)return;F.forEach(y_),u(_)})});return D.reduce(gC)};h_.exports=mC});var m_=G((mB,g_)=>{var{PassThrough:fC}=T("stream");g_.exports=(D)=>{D={...D};let{array:u}=D,{encoding:_}=D,F=_==="buffer",q=!1;if(u)q=!(_||F);else _=_||"utf8";if(F)_=null;let C=new fC({objectMode:q});if(_)C.setEncoding(_);let $=0,Q=[];return C.on("data",(J)=>{if(Q.push(J),q)$=Q.length;else $+=J.length}),C.getBufferedValue=()=>{if(u)return Q;return F?Buffer.concat(Q,$):Q.join("")},C.getBufferedLength=()=>$,C}});var f_=G((fB,t0)=>{var{constants:dC}=T("buffer"),lC=b_(),cC=m_();class a8 extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function lu(D,u){if(!D)return Promise.reject(Error("Expected a stream"));u={maxBuffer:1/0,...u};let{maxBuffer:_}=u,F;return await new Promise((q,C)=>{let $=(Q)=>{if(Q&&F.getBufferedLength()<=dC.MAX_LENGTH)Q.bufferedData=F.getBufferedValue();C(Q)};F=lC(D,cC(u),(Q)=>{if(Q){$(Q);return}q()}),F.on("data",()=>{if(F.getBufferedLength()>_)$(new a8)})}),F.getBufferedValue()}t0.exports=lu;t0.exports.default=lu;t0.exports.buffer=(D,u)=>lu(D,{...u,encoding:"buffer"});t0.exports.array=(D,u)=>lu(D,{...u,array:!0});t0.exports.MaxBufferError=a8});var p_=G((dB,c_)=>{c_.exports=cu;function cu(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}cu.prototype.go=function(D){if(this.pending<this.max)l_(this,D);else this.waiting.push(D)};cu.prototype.wait=function(D){if(this.pending===0)D(this.error);else this.listeners.push(D)};cu.prototype.hold=function(){return d_(this)};function d_(D){D.pending+=1;var u=!1;return _;function _(q){if(u)throw Error("callback called twice");if(u=!0,D.error=D.error||q,D.pending-=1,D.waiting.length>0&&D.pending<D.max)l_(D,D.waiting.shift());else if(D.pending===0){var C=D.listeners;D.listeners=[],C.forEach(F)}}function F(q){q(D.error)}}function l_(D,u){u(d_(D))}});var a_=G((sC)=>{var N2=T("fs"),pu=T("util"),n8=T("stream"),i_=n8.Readable,s8=n8.Writable,pC=n8.PassThrough,iC=p_(),iu=T("events").EventEmitter;sC.createFromBuffer=aC;sC.createFromFd=nC;sC.BufferSlicer=gD;sC.FdSlicer=bD;pu.inherits(bD,iu);function bD(D,u){u=u||{},iu.call(this),this.fd=D,this.pend=new iC,this.pend.max=1,this.refCount=0,this.autoClose=!!u.autoClose}bD.prototype.read=function(D,u,_,F,q){var C=this;C.pend.go(function($){N2.read(C.fd,D,u,_,F,function(Q,J,Z){$(),q(Q,J,Z)})})};bD.prototype.write=function(D,u,_,F,q){var C=this;C.pend.go(function($){N2.write(C.fd,D,u,_,F,function(Q,J,Z){$(),q(Q,J,Z)})})};bD.prototype.createReadStream=function(D){return new au(this,D)};bD.prototype.createWriteStream=function(D){return new nu(this,D)};bD.prototype.ref=function(){this.refCount+=1};bD.prototype.unref=function(){var D=this;if(D.refCount-=1,D.refCount>0)return;if(D.refCount<0)throw Error("invalid unref");if(D.autoClose)N2.close(D.fd,u);function u(_){if(_)D.emit("error",_);else D.emit("close")}};pu.inherits(au,i_);function au(D,u){u=u||{},i_.call(this,u),this.context=D,this.context.ref(),this.start=u.start||0,this.endOffset=u.end,this.pos=this.start,this.destroyed=!1}au.prototype._read=function(D){var u=this;if(u.destroyed)return;var _=Math.min(u._readableState.highWaterMark,D);if(u.endOffset!=null)_=Math.min(_,u.endOffset-u.pos);if(_<=0){u.destroyed=!0,u.push(null),u.context.unref();return}u.context.pend.go(function(F){if(u.destroyed)return F();var q=Buffer.allocUnsafe(_);N2.read(u.context.fd,q,0,_,u.pos,function(C,$){if(C)u.destroy(C);else if($===0)u.destroyed=!0,u.push(null),u.context.unref();else u.pos+=$,u.push(q.slice(0,$));F()})})};au.prototype.destroy=function(D){if(this.destroyed)return;D=D||Error("stream destroyed"),this.destroyed=!0,this.emit("error",D),this.context.unref()};pu.inherits(nu,s8);function nu(D,u){u=u||{},s8.call(this,u),this.context=D,this.context.ref(),this.start=u.start||0,this.endOffset=u.end==null?1/0:+u.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}nu.prototype._write=function(D,u,_){var F=this;if(F.destroyed)return;if(F.pos+D.length>F.endOffset){var q=Error("maximum file length exceeded");q.code="ETOOBIG",F.destroy(),_(q);return}F.context.pend.go(function(C){if(F.destroyed)return C();N2.write(F.context.fd,D,0,D.length,F.pos,function($,Q){if($)F.destroy(),C(),_($);else F.bytesWritten+=Q,F.pos+=Q,F.emit("progress"),C(),_()})})};nu.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=!0,this.context.unref()};pu.inherits(gD,iu);function gD(D,u){iu.call(this),u=u||{},this.refCount=0,this.buffer=D,this.maxChunkSize=u.maxChunkSize||Number.MAX_SAFE_INTEGER}gD.prototype.read=function(D,u,_,F,q){if(!(0<=u&&u<=D.length))throw RangeError("offset outside buffer: 0 <= "+u+" <= "+D.length);if(F<0)throw RangeError("position is negative: "+F);if(u+_>D.length)_=D.length-u;if(F+_>this.buffer.length)_=this.buffer.length-F;if(_<=0){setImmediate(function(){q(null,0)});return}this.buffer.copy(D,u,F,F+_),setImmediate(function(){q(null,_)})};gD.prototype.write=function(D,u,_,F,q){D.copy(this.buffer,F,u,u+_),setImmediate(function(){q(null,_,D)})};gD.prototype.createReadStream=function(D){D=D||{};var u=new pC(D);u.destroyed=!1,u.start=D.start||0,u.endOffset=D.end,u.pos=u.endOffset||this.buffer.length;var _=this.buffer.slice(u.start,u.pos),F=0;while(!0){var q=F+this.maxChunkSize;if(q>=_.length){if(F<_.length)u.write(_.slice(F,_.length));break}u.write(_.slice(F,q)),F=q}return u.end(),u.destroy=function(){u.destroyed=!0},u};gD.prototype.createWriteStream=function(D){var u=this;D=D||{};var _=new s8(D);return _.start=D.start||0,_.endOffset=D.end==null?this.buffer.length:+D.end,_.bytesWritten=0,_.pos=_.start,_.destroyed=!1,_._write=function(F,q,C){if(_.destroyed)return;var $=_.pos+F.length;if($>_.endOffset){var Q=Error("maximum file length exceeded");Q.code="ETOOBIG",_.destroyed=!0,C(Q);return}F.copy(u.buffer,_.pos,0,F.length),_.bytesWritten+=F.length,_.pos=$,_.emit("progress"),C()},_.destroy=function(){_.destroyed=!0},_};gD.prototype.ref=function(){this.refCount+=1};gD.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")};function aC(D,u){return new gD(D,u)}function nC(D,u){return new bD(D,u)}});var t_=G((cB,s_)=>{var $0=T("buffer").Buffer,t8=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array<"u")t8=new Int32Array(t8);function n_(D){if($0.isBuffer(D))return D;var u=typeof $0.alloc==="function"&&typeof $0.from==="function";if(typeof D==="number")return u?$0.alloc(D):new $0(D);else if(typeof D==="string")return u?$0.from(D):new $0(D);else throw Error("input must be buffer, number, or string, received "+typeof D)}function D$(D){var u=n_(4);return u.writeInt32BE(D,0),u}function o8(D,u){if(D=n_(D),$0.isBuffer(u))u=u.readUInt32BE(0);var _=~~u^-1;for(var F=0;F<D.length;F++)_=t8[(_^D[F])&255]^_>>>8;return _^-1}function r8(){return D$(o8.apply(null,arguments))}r8.signed=function(){return o8.apply(null,arguments)};r8.unsigned=function(){return o8.apply(null,arguments)>>>0};s_.exports=r8});var $5=G((Q$)=>{var e8=T("fs"),u$=T("zlib"),o_=a_(),_$=t_(),ou=T("util"),ru=T("events").EventEmitter,r_=T("stream").Transform,u6=T("stream").PassThrough,F$=T("stream").Writable;Q$.open=q$;Q$.fromFd=e_;Q$.fromBuffer=C$;Q$.fromRandomAccessReader=_6;Q$.dosDateTimeToDate=_5;Q$.getFileNameLowLevel=F5;Q$.validateFileName=q5;Q$.parseExtraFields=C5;Q$.ZipFile=wD;Q$.Entry=S2;Q$.LocalFileHeader=u5;Q$.RandomAccessReader=Q0;function q$(D,u,_){if(typeof u==="function")_=u,u=null;if(u==null)u={};if(u.autoClose==null)u.autoClose=!0;if(u.lazyEntries==null)u.lazyEntries=!1;if(u.decodeStrings==null)u.decodeStrings=!0;if(u.validateEntrySizes==null)u.validateEntrySizes=!0;if(u.strictFileNames==null)u.strictFileNames=!1;if(_==null)_=tu;e8.open(D,"r",function(F,q){if(F)return _(F);e_(q,u,function(C,$){if(C)e8.close(q,tu);_(C,$)})})}function e_(D,u,_){if(typeof u==="function")_=u,u=null;if(u==null)u={};if(u.autoClose==null)u.autoClose=!1;if(u.lazyEntries==null)u.lazyEntries=!1;if(u.decodeStrings==null)u.decodeStrings=!0;if(u.validateEntrySizes==null)u.validateEntrySizes=!0;if(u.strictFileNames==null)u.strictFileNames=!1;if(_==null)_=tu;e8.fstat(D,function(F,q){if(F)return _(F);var C=o_.createFromFd(D,{autoClose:!0});_6(C,q.size,u,_)})}function C$(D,u,_){if(typeof u==="function")_=u,u=null;if(u==null)u={};if(u.autoClose=!1,u.lazyEntries==null)u.lazyEntries=!1;if(u.decodeStrings==null)u.decodeStrings=!0;if(u.validateEntrySizes==null)u.validateEntrySizes=!0;if(u.strictFileNames==null)u.strictFileNames=!1;var F=o_.createFromBuffer(D,{maxChunkSize:65536});_6(F,D.length,u,_)}function _6(D,u,_,F){if(typeof _==="function")F=_,_=null;if(_==null)_={};if(_.autoClose==null)_.autoClose=!0;if(_.lazyEntries==null)_.lazyEntries=!1;if(_.decodeStrings==null)_.decodeStrings=!0;var q=!!_.decodeStrings;if(_.validateEntrySizes==null)_.validateEntrySizes=!0;if(_.strictFileNames==null)_.strictFileNames=!1;if(F==null)F=tu;if(typeof u!=="number")throw Error("expected totalSize parameter to be a number");if(u>Number.MAX_SAFE_INTEGER)throw Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");D.ref();var C=22,$=20,Q=65535,J=Math.min($+C+Q,u),Z=mD(J),V=u-Z.length;r0(D,Z,0,J,V,function(K){if(K)return F(K);for(var X=J-C;X>=0;X-=1){if(Z.readUInt32LE(X)!==101010256)continue;var B=Z.subarray(X),L=B.readUInt16LE(4),z=B.readUInt16LE(10),j=B.readUInt32LE(16),E=B.readUInt16LE(20),c=B.length-C;if(E!==c)return F(Error("Invalid comment length. Expected: "+c+". Found: "+E+". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK☺☻` in the comment?"));var m=q?su(B.subarray(22),!1):B.subarray(22);if(X-$>=0&&Z.readUInt32LE(X-$)===117853008){var lD=Z.subarray(X-$,X-$+$),s2=o0(lD,8),t=mD(56);return r0(D,t,0,t.length,s2,function(t2){if(t2)return F(t2);if(t.readUInt32LE(0)!==101075792)return F(Error("invalid zip64 end of central directory record signature"));if(L=t.readUInt32LE(16),L!==0)return F(Error("multi-disk zip files are not supported: found disk number: "+L));return z=o0(t,32),j=o0(t,48),F(null,new wD(D,j,u,z,m,_.autoClose,_.lazyEntries,q,_.validateEntrySizes,_.strictFileNames))})}if(L!==0)return F(Error("multi-disk zip files are not supported: found disk number: "+L));return F(null,new wD(D,j,u,z,m,_.autoClose,_.lazyEntries,q,_.validateEntrySizes,_.strictFileNames))}F(Error("End of central directory record signature not found. Either not a zip file, or file is truncated."))})}ou.inherits(wD,ru);function wD(D,u,_,F,q,C,$,Q,J,Z){var V=this;if(ru.call(V),V.reader=D,V.reader.on("error",function(K){D5(V,K)}),V.reader.once("close",function(){V.emit("close")}),V.readEntryCursor=u,V.fileSize=_,V.entryCount=F,V.comment=q,V.entriesRead=0,V.autoClose=!!C,V.lazyEntries=!!$,V.decodeStrings=!!Q,V.validateEntrySizes=!!J,V.strictFileNames=!!Z,V.isOpen=!0,V.emittedError=!1,!V.lazyEntries)V._readEntry()}wD.prototype.close=function(){if(!this.isOpen)return;this.isOpen=!1,this.reader.unref()};function ID(D,u){if(D.autoClose)D.close();D5(D,u)}function D5(D,u){if(D.emittedError)return;D.emittedError=!0,D.emit("error",u)}wD.prototype.readEntry=function(){if(!this.lazyEntries)throw Error("readEntry() called without lazyEntries:true");this._readEntry()};wD.prototype._readEntry=function(){var D=this;if(D.entryCount===D.entriesRead){setImmediate(function(){if(D.autoClose)D.close();if(D.emittedError)return;D.emit("end")});return}if(D.emittedError)return;var u=mD(46);r0(D.reader,u,0,u.length,D.readEntryCursor,function(_){if(_)return ID(D,_);if(D.emittedError)return;var F=new S2,q=u.readUInt32LE(0);if(q!==33639248)return ID(D,Error("invalid central directory file header signature: 0x"+q.toString(16)));if(F.versionMadeBy=u.readUInt16LE(4),F.versionNeededToExtract=u.readUInt16LE(6),F.generalPurposeBitFlag=u.readUInt16LE(8),F.compressionMethod=u.readUInt16LE(10),F.lastModFileTime=u.readUInt16LE(12),F.lastModFileDate=u.readUInt16LE(14),F.crc32=u.readUInt32LE(16),F.compressedSize=u.readUInt32LE(20),F.uncompressedSize=u.readUInt32LE(24),F.fileNameLength=u.readUInt16LE(28),F.extraFieldLength=u.readUInt16LE(30),F.fileCommentLength=u.readUInt16LE(32),F.internalFileAttributes=u.readUInt16LE(36),F.externalFileAttributes=u.readUInt32LE(38),F.relativeOffsetOfLocalHeader=u.readUInt32LE(42),F.generalPurposeBitFlag&64)return ID(D,Error("strong encryption is not supported"));D.readEntryCursor+=46,u=mD(F.fileNameLength+F.extraFieldLength+F.fileCommentLength),r0(D.reader,u,0,u.length,D.readEntryCursor,function(C){if(C)return ID(D,C);if(D.emittedError)return;F.fileNameRaw=u.subarray(0,F.fileNameLength);var $=F.fileNameLength+F.extraFieldLength;F.extraFieldRaw=u.subarray(F.fileNameLength,$),F.fileCommentRaw=u.subarray($,$+F.fileCommentLength);try{F.extraFields=C5(F.extraFieldRaw)}catch(z){return ID(D,z)}if(D.decodeStrings){var Q=(F.generalPurposeBitFlag&2048)!==0;F.fileComment=su(F.fileCommentRaw,Q),F.fileName=F5(F.generalPurposeBitFlag,F.fileNameRaw,F.extraFields,D.strictFileNames);var J=q5(F.fileName);if(J!=null)return ID(D,Error(J))}else F.fileComment=F.fileCommentRaw,F.fileName=F.fileNameRaw;F.comment=F.fileComment,D.readEntryCursor+=u.length,D.entriesRead+=1;for(var Z=0;Z<F.extraFields.length;Z++){var V=F.extraFields[Z];if(V.id!==1)continue;var K=V.data,X=0;if(F.uncompressedSize===4294967295){if(X+8>K.length)return ID(D,Error("zip64 extended information extra field does not include uncompressed size"));F.uncompressedSize=o0(K,X),X+=8}if(F.compressedSize===4294967295){if(X+8>K.length)return ID(D,Error("zip64 extended information extra field does not include compressed size"));F.compressedSize=o0(K,X),X+=8}if(F.relativeOffsetOfLocalHeader===4294967295){if(X+8>K.length)return ID(D,Error("zip64 extended information extra field does not include relative header offset"));F.relativeOffsetOfLocalHeader=o0(K,X),X+=8}break}if(D.validateEntrySizes&&F.compressionMethod===0){var B=F.uncompressedSize;if(F.isEncrypted())B+=12;if(F.compressedSize!==B){var L="compressed/uncompressed size mismatch for stored file: "+F.compressedSize+" != "+F.uncompressedSize;return ID(D,Error(L))}}if(D.emit("entry",F),!D.lazyEntries)D._readEntry()})})};wD.prototype.openReadStream=function(D,u,_){var F=this,q=0,C=D.compressedSize;if(_==null)_=u,u=null;if(u==null)u={};else{if(u.decrypt!=null){if(!D.isEncrypted())throw Error("options.decrypt can only be specified for encrypted entries");if(u.decrypt!==!1)throw Error("invalid options.decrypt value: "+u.decrypt);if(D.isCompressed()){if(u.decompress!==!1)throw Error("entry is encrypted and compressed, and options.decompress !== false")}}if(u.decompress!=null){if(!D.isCompressed())throw Error("options.decompress can only be specified for compressed entries");if(!(u.decompress===!1||u.decompress===!0))throw Error("invalid options.decompress value: "+u.decompress)}if(u.start!=null||u.end!=null){if(D.isCompressed()&&u.decompress!==!1)throw Error("start/end range not allowed for compressed entry without options.decompress === false");if(D.isEncrypted()&&u.decrypt!==!1)throw Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(u.start!=null){if(q=u.start,q<0)throw Error("options.start < 0");if(q>D.compressedSize)throw Error("options.start > entry.compressedSize")}if(u.end!=null){if(C=u.end,C<0)throw Error("options.end < 0");if(C>D.compressedSize)throw Error("options.end > entry.compressedSize");if(C<q)throw Error("options.end < options.start")}}if(!F.isOpen)return _(Error("closed"));if(D.isEncrypted()){if(u.decrypt!==!1)return _(Error("entry is encrypted, and options.decrypt !== false"))}var $;if(D.compressionMethod===0)$=!1;else if(D.compressionMethod===8)$=u.decompress!=null?u.decompress:!0;else return _(Error("unsupported compression method: "+D.compressionMethod));F.readLocalFileHeader(D,{minimal:!0},function(Q,J){if(Q)return _(Q);F.openReadStreamLowLevel(J.fileDataStart,D.compressedSize,q,C,$,D.uncompressedSize,_)})};wD.prototype.openReadStreamLowLevel=function(D,u,_,F,q,C,$){var Q=this,J=D+u,Z=Q.reader.createReadStream({start:D+_,end:D+F}),V=Z;if(q){var K=!1,X=u$.createInflateRaw();if(Z.on("error",function(B){setImmediate(function(){if(!K)X.emit("error",B)})}),Z.pipe(X),Q.validateEntrySizes)V=new E2(C),X.on("error",function(B){setImmediate(function(){if(!K)V.emit("error",B)})}),X.pipe(V);else V=X;D6(V,function(){if(K=!0,X!==V)X.unpipe(V);Z.unpipe(X),Z.destroy()})}$(null,V)};wD.prototype.readLocalFileHeader=function(D,u,_){var F=this;if(_==null)_=u,u=null;if(u==null)u={};F.reader.ref();var q=mD(30);r0(F.reader,q,0,q.length,D.relativeOffsetOfLocalHeader,function(C){try{if(C)return _(C);var $=q.readUInt32LE(0);if($!==67324752)return _(Error("invalid local file header signature: 0x"+$.toString(16)));var Q=q.readUInt16LE(26),J=q.readUInt16LE(28),Z=D.relativeOffsetOfLocalHeader+30+Q+J;if(Z+D.compressedSize>F.fileSize)return _(Error("file data overflows file bounds: "+Z+" + "+D.compressedSize+" > "+F.fileSize));if(u.minimal)return _(null,{fileDataStart:Z});var V=new u5;V.fileDataStart=Z,V.versionNeededToExtract=q.readUInt16LE(4),V.generalPurposeBitFlag=q.readUInt16LE(6),V.compressionMethod=q.readUInt16LE(8),V.lastModFileTime=q.readUInt16LE(10),V.lastModFileDate=q.readUInt16LE(12),V.crc32=q.readUInt32LE(14),V.compressedSize=q.readUInt32LE(18),V.uncompressedSize=q.readUInt32LE(22),V.fileNameLength=Q,V.extraFieldLength=J,q=mD(Q+J),F.reader.ref(),r0(F.reader,q,0,q.length,D.relativeOffsetOfLocalHeader+30,function(K){try{if(K)return _(K);return V.fileName=q.subarray(0,Q),V.extraField=q.subarray(Q),_(null,V)}finally{F.reader.unref()}})}finally{F.reader.unref()}})};function S2(){}S2.prototype.getLastModDate=function(D){if(D==null)D={};if(!D.forceDosFormat)for(var u=0;u<this.extraFields.length;u++){var _=this.extraFields[u];if(_.id===21589){var F=_.data;if(F.length<5)continue;var q=F[0],C=1;if(!(q&C))continue;var $=F.readInt32LE(1);return new Date($*1000)}else if(_.id===10){var F=_.data,Q=4;while(Q<F.length+4){var J=F.readUInt16LE(Q);Q+=2;var Z=F.readUInt16LE(Q);if(Q+=2,J!==1){Q+=Z;continue}if(Z<8||Q+Z>F.length)break;var V=4294967296*F.readInt32LE(Q+4)+F.readUInt32LE(Q),K=V/1e4-11644473600000;return new Date(K)}}}return _5(this.lastModFileDate,this.lastModFileTime,D.timezone)};S2.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};S2.prototype.isCompressed=function(){return this.compressionMethod===8};function u5(){}function _5(D,u,_){var F=D&31,q=(D>>5&15)-1,C=(D>>9&127)+1980,$=0,Q=(u&31)*2,J=u>>5&63,Z=u>>11&31;if(_==null||_==="local")return new Date(C,q,F,Z,J,Q,$);else if(_==="UTC")return new Date(Date.UTC(C,q,F,Z,J,Q,$));else throw Error("unrecognized options.timezone: "+options.timezone)}function F5(D,u,_,F){var q=null;for(var C=0;C<_.length;C++){var $=_[C];if($.id===28789){if($.data.length<6)continue;if($.data.readUInt8(0)!==1)continue;var Q=$.data.readUInt32LE(1);if(_$.unsigned(u)!==Q)continue;q=su($.data.subarray(5),!0);break}}if(q==null){var J=(D&2048)!==0;q=su(u,J)}if(!F)q=q.replace(/\\/g,"/");return q}function q5(D){if(D.indexOf("\\")!==-1)return"invalid characters in fileName: "+D;if(/^[a-zA-Z]:/.test(D)||/^\//.test(D))return"absolute path: "+D;if(D.split("/").indexOf("..")!==-1)return"invalid relative path: "+D;return null}function C5(D){var u=[],_=0;while(_<D.length-3){var F=D.readUInt16LE(_+0),q=D.readUInt16LE(_+2),C=_+4,$=C+q;if($>D.length)throw Error("extra field length exceeds extra field buffer size");var Q=D.subarray(C,$);u.push({id:F,data:Q}),_=$}return u}function r0(D,u,_,F,q,C){if(F===0)return setImmediate(function(){C(null,mD(0))});D.read(u,_,F,q,function($,Q){if($)return C($);if(Q<F)return C(Error("unexpected EOF"));C()})}ou.inherits(E2,r_);function E2(D){r_.call(this),this.actualByteCount=0,this.expectedByteCount=D}E2.prototype._transform=function(D,u,_){if(this.actualByteCount+=D.length,this.actualByteCount>this.expectedByteCount){var F="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return _(Error(F))}_(null,D)};E2.prototype._flush=function(D){if(this.actualByteCount<this.expectedByteCount){var u="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return D(Error(u))}D()};ou.inherits(Q0,ru);function Q0(){ru.call(this),this.refCount=0}Q0.prototype.ref=function(){this.refCount+=1};Q0.prototype.unref=function(){var D=this;if(D.refCount-=1,D.refCount>0)return;if(D.refCount<0)throw Error("invalid unref");D.close(u);function u(_){if(_)return D.emit("error",_);D.emit("close")}};Q0.prototype.createReadStream=function(D){if(D==null)D={};var{start:u,end:_}=D;if(u===_){var F=new u6;return setImmediate(function(){F.end()}),F}var q=this._readStreamForRange(u,_),C=!1,$=new eu(this);q.on("error",function(J){setImmediate(function(){if(!C)$.emit("error",J)})}),D6($,function(){q.unpipe($),$.unref(),q.destroy()});var Q=new E2(_-u);return $.on("error",function(J){setImmediate(function(){if(!C)Q.emit("error",J)})}),D6(Q,function(){C=!0,$.unpipe(Q),$.destroy()}),q.pipe($).pipe(Q)};Q0.prototype._readStreamForRange=function(D,u){throw Error("not implemented")};Q0.prototype.read=function(D,u,_,F,q){var C=this.createReadStream({start:F,end:F+_}),$=new F$,Q=0;$._write=function(J,Z,V){J.copy(D,u+Q,0,J.length),Q+=J.length,V()},$.on("finish",q),C.on("error",function(J){q(J)}),C.pipe($)};Q0.prototype.close=function(D){setImmediate(D)};ou.inherits(eu,u6);function eu(D){u6.call(this),this.context=D,this.context.ref(),this.unreffedYet=!1}eu.prototype._flush=function(D){this.unref(),D()};eu.prototype.unref=function(D){if(this.unreffedYet)return;this.unreffedYet=!0,this.context.unref()};var $$="\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function su(D,u){if(u)return D.toString("utf8");else{var _="";for(var F=0;F<D.length;F++)_+=$$[D[F]];return _}}function o0(D,u){var _=D.readUInt32LE(u),F=D.readUInt32LE(u+4);return F*4294967296+_}var mD;if(typeof Buffer.allocUnsafe==="function")mD=function(D){return Buffer.allocUnsafe(D)};else mD=function(D){return new Buffer(D)};function D6(D,u){if(typeof D.destroy==="function")D._destroy=function(_,F){if(u(),F!=null)F(_)};else D.destroy=u}function tu(D){if(D)throw D}});var V5=G((iB,J5)=>{var xD=w_()("extract-zip"),{createWriteStream:z$,promises:e0}=T("fs"),L$=f_(),I0=T("path"),{promisify:F6}=T("util"),U$=T("stream"),O$=$5(),j$=F6(O$.open),P$=F6(U$.pipeline);class Q5{constructor(D,u){this.zipPath=D,this.opts=u}async extract(){return xD("opening",this.zipPath,"with opts",this.opts),this.zipfile=await j$(this.zipPath,{lazyEntries:!0}),this.canceled=!1,new Promise((D,u)=>{this.zipfile.on("error",(_)=>{this.canceled=!0,u(_)}),this.zipfile.readEntry(),this.zipfile.on("close",()=>{if(!this.canceled)xD("zip extraction complete"),D()}),this.zipfile.on("entry",async(_)=>{if(this.canceled){xD("skipping entry",_.fileName,{cancelled:this.canceled});return}if(xD("zipfile entry",_.fileName),_.fileName.startsWith("__MACOSX/")){this.zipfile.readEntry();return}let F=I0.dirname(I0.join(this.opts.dir,_.fileName));try{await e0.mkdir(F,{recursive:!0});let q=await e0.realpath(F);if(I0.relative(this.opts.dir,q).split(I0.sep).includes(".."))throw Error(`Out of bound path "${q}" found while processing file ${_.fileName}`);await this.extractEntry(_),xD("finished processing",_.fileName),this.zipfile.readEntry()}catch(q){this.canceled=!0,this.zipfile.close(),u(q)}})})}async extractEntry(D){if(this.canceled){xD("skipping entry extraction",D.fileName,{cancelled:this.canceled});return}if(this.opts.onEntry)this.opts.onEntry(D,this.zipfile);let u=I0.join(this.opts.dir,D.fileName),_=D.externalFileAttributes>>16&65535,F=61440,q=16384,C=40960,$=(_&F)===C,Q=(_&F)===q;if(!Q&&D.fileName.endsWith("/"))Q=!0;let J=D.versionMadeBy>>8;if(!Q)Q=J===0&&D.externalFileAttributes===16;xD("extracting entry",{filename:D.fileName,isDir:Q,isSymlink:$});let Z=this.getExtractedMode(_,Q)&511,V=Q?u:I0.dirname(u),K={recursive:!0};if(Q)K.mode=Z;if(xD("mkdir",{dir:V,...K}),await e0.mkdir(V,K),Q)return;xD("opening read stream",u);let X=await F6(this.zipfile.openReadStream.bind(this.zipfile))(D);if($){let B=await L$(X);xD("creating symlink",B,u),await e0.symlink(B,u)}else await P$(X,z$(u,{mode:Z}))}getExtractedMode(D,u){let _=D;if(_===0)if(u){if(this.opts.defaultDirMode)_=parseInt(this.opts.defaultDirMode,10);if(!_)_=493}else{if(this.opts.defaultFileMode)_=parseInt(this.opts.defaultFileMode,10);if(!_)_=420}return _}}J5.exports=async function(D,u){if(xD("creating target directory",u.dir),!I0.isAbsolute(u.dir))throw Error("Target directory is expected to be absolute");return await e0.mkdir(u.dir,{recursive:!0}),u.dir=await e0.realpath(u.dir),new Q5(D,u).extract()}});var q6=G((aB,Z5)=>{var I$=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...D)=>console.error("SEMVER",...D):()=>{};Z5.exports=I$});var C6=G((nB,K5)=>{var w$=Number.MAX_SAFE_INTEGER||9007199254740991,M$=["major","premajor","minor","preminor","patch","prepatch","prerelease"];K5.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:w$,RELEASE_TYPES:M$,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var B5=G((MD,X5)=>{var{MAX_SAFE_COMPONENT_LENGTH:$6,MAX_SAFE_BUILD_LENGTH:T$,MAX_LENGTH:v$}=C6(),R$=q6();MD=X5.exports={};var N$=MD.re=[],S$=MD.safeRe=[],Y=MD.src=[],E$=MD.safeSrc=[],H=MD.t={},k$=0,Q6="[a-zA-Z0-9-]",y$=[["\\s",1],["\\d",v$],[Q6,T$]],h$=(D)=>{for(let[u,_]of y$)D=D.split(`${u}*`).join(`${u}{0,${_}}`).split(`${u}+`).join(`${u}{1,${_}}`);return D},U=(D,u,_)=>{let F=h$(u),q=k$++;R$(D,q,u),H[D]=q,Y[q]=u,E$[q]=F,N$[q]=new RegExp(u,_?"g":void 0),S$[q]=new RegExp(F,_?"g":void 0)};U("NUMERICIDENTIFIER","0|[1-9]\\d*");U("NUMERICIDENTIFIERLOOSE","\\d+");U("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Q6}*`);U("MAINVERSION",`(${Y[H.NUMERICIDENTIFIER]})\\.(${Y[H.NUMERICIDENTIFIER]})\\.(${Y[H.NUMERICIDENTIFIER]})`);U("MAINVERSIONLOOSE",`(${Y[H.NUMERICIDENTIFIERLOOSE]})\\.(${Y[H.NUMERICIDENTIFIERLOOSE]})\\.(${Y[H.NUMERICIDENTIFIERLOOSE]})`);U("PRERELEASEIDENTIFIER",`(?:${Y[H.NONNUMERICIDENTIFIER]}|${Y[H.NUMERICIDENTIFIER]})`);U("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[H.NONNUMERICIDENTIFIER]}|${Y[H.NUMERICIDENTIFIERLOOSE]})`);U("PRERELEASE",`(?:-(${Y[H.PRERELEASEIDENTIFIER]}(?:\\.${Y[H.PRERELEASEIDENTIFIER]})*))`);U("PRERELEASELOOSE",`(?:-?(${Y[H.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[H.PRERELEASEIDENTIFIERLOOSE]})*))`);U("BUILDIDENTIFIER",`${Q6}+`);U("BUILD",`(?:\\+(${Y[H.BUILDIDENTIFIER]}(?:\\.${Y[H.BUILDIDENTIFIER]})*))`);U("FULLPLAIN",`v?${Y[H.MAINVERSION]}${Y[H.PRERELEASE]}?${Y[H.BUILD]}?`);U("FULL",`^${Y[H.FULLPLAIN]}$`);U("LOOSEPLAIN",`[v=\\s]*${Y[H.MAINVERSIONLOOSE]}${Y[H.PRERELEASELOOSE]}?${Y[H.BUILD]}?`);U("LOOSE",`^${Y[H.LOOSEPLAIN]}$`);U("GTLT","((?:<|>)?=?)");U("XRANGEIDENTIFIERLOOSE",`${Y[H.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);U("XRANGEIDENTIFIER",`${Y[H.NUMERICIDENTIFIER]}|x|X|\\*`);U("XRANGEPLAIN",`[v=\\s]*(${Y[H.XRANGEIDENTIFIER]})(?:\\.(${Y[H.XRANGEIDENTIFIER]})(?:\\.(${Y[H.XRANGEIDENTIFIER]})(?:${Y[H.PRERELEASE]})?${Y[H.BUILD]}?)?)?`);U("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[H.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[H.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[H.XRANGEIDENTIFIERLOOSE]})(?:${Y[H.PRERELEASELOOSE]})?${Y[H.BUILD]}?)?)?`);U("XRANGE",`^${Y[H.GTLT]}\\s*${Y[H.XRANGEPLAIN]}$`);U("XRANGELOOSE",`^${Y[H.GTLT]}\\s*${Y[H.XRANGEPLAINLOOSE]}$`);U("COERCEPLAIN",`(^|[^\\d])(\\d{1,${$6}})(?:\\.(\\d{1,${$6}}))?(?:\\.(\\d{1,${$6}}))?`);U("COERCE",`${Y[H.COERCEPLAIN]}(?:$|[^\\d])`);U("COERCEFULL",Y[H.COERCEPLAIN]+`(?:${Y[H.PRERELEASE]})?(?:${Y[H.BUILD]})?(?:$|[^\\d])`);U("COERCERTL",Y[H.COERCE],!0);U("COERCERTLFULL",Y[H.COERCEFULL],!0);U("LONETILDE","(?:~>?)");U("TILDETRIM",`(\\s*)${Y[H.LONETILDE]}\\s+`,!0);MD.tildeTrimReplace="$1~";U("TILDE",`^${Y[H.LONETILDE]}${Y[H.XRANGEPLAIN]}$`);U("TILDELOOSE",`^${Y[H.LONETILDE]}${Y[H.XRANGEPLAINLOOSE]}$`);U("LONECARET","(?:\\^)");U("CARETTRIM",`(\\s*)${Y[H.LONECARET]}\\s+`,!0);MD.caretTrimReplace="$1^";U("CARET",`^${Y[H.LONECARET]}${Y[H.XRANGEPLAIN]}$`);U("CARETLOOSE",`^${Y[H.LONECARET]}${Y[H.XRANGEPLAINLOOSE]}$`);U("COMPARATORLOOSE",`^${Y[H.GTLT]}\\s*(${Y[H.LOOSEPLAIN]})$|^$`);U("COMPARATOR",`^${Y[H.GTLT]}\\s*(${Y[H.FULLPLAIN]})$|^$`);U("COMPARATORTRIM",`(\\s*)${Y[H.GTLT]}\\s*(${Y[H.LOOSEPLAIN]}|${Y[H.XRANGEPLAIN]})`,!0);MD.comparatorTrimReplace="$1$2$3";U("HYPHENRANGE",`^\\s*(${Y[H.XRANGEPLAIN]})\\s+-\\s+(${Y[H.XRANGEPLAIN]})\\s*$`);U("HYPHENRANGELOOSE",`^\\s*(${Y[H.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[H.XRANGEPLAINLOOSE]})\\s*$`);U("STAR","(<|>)?=?\\s*\\*");U("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");U("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Y5=G((sB,G5)=>{var b$=Object.freeze({loose:!0}),g$=Object.freeze({}),m$=(D)=>{if(!D)return g$;if(typeof D!=="object")return b$;return D};G5.exports=m$});var A5=G((tB,W5)=>{var H5=/^[0-9]+$/,x5=(D,u)=>{if(typeof D==="number"&&typeof u==="number")return D===u?0:D<u?-1:1;let _=H5.test(D),F=H5.test(u);if(_&&F)D=+D,u=+u;return D===u?0:_&&!F?-1:F&&!_?1:D<u?-1:1},f$=(D,u)=>x5(u,D);W5.exports={compareIdentifiers:x5,rcompareIdentifiers:f$}});var V6=G((oB,L5)=>{var D3=q6(),{MAX_LENGTH:z5,MAX_SAFE_INTEGER:u3}=C6(),{safeRe:_3,t:F3}=B5(),d$=Y5(),{compareIdentifiers:J6}=A5();class WD{constructor(D,u){if(u=d$(u),D instanceof WD)if(D.loose===!!u.loose&&D.includePrerelease===!!u.includePrerelease)return D;else D=D.version;else if(typeof D!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof D}".`);if(D.length>z5)throw TypeError(`version is longer than ${z5} characters`);D3("SemVer",D,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;let _=D.trim().match(u.loose?_3[F3.LOOSE]:_3[F3.FULL]);if(!_)throw TypeError(`Invalid Version: ${D}`);if(this.raw=D,this.major=+_[1],this.minor=+_[2],this.patch=+_[3],this.major>u3||this.major<0)throw TypeError("Invalid major version");if(this.minor>u3||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>u3||this.patch<0)throw TypeError("Invalid patch version");if(!_[4])this.prerelease=[];else this.prerelease=_[4].split(".").map((F)=>{if(/^[0-9]+$/.test(F)){let q=+F;if(q>=0&&q<u3)return q}return F});this.build=_[5]?_[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(D){if(D3("SemVer.compare",this.version,this.options,D),!(D instanceof WD)){if(typeof D==="string"&&D===this.version)return 0;D=new WD(D,this.options)}if(D.version===this.version)return 0;return this.compareMain(D)||this.comparePre(D)}compareMain(D){if(!(D instanceof WD))D=new WD(D,this.options);if(this.major<D.major)return-1;if(this.major>D.major)return 1;if(this.minor<D.minor)return-1;if(this.minor>D.minor)return 1;if(this.patch<D.patch)return-1;if(this.patch>D.patch)return 1;return 0}comparePre(D){if(!(D instanceof WD))D=new WD(D,this.options);if(this.prerelease.length&&!D.prerelease.length)return-1;else if(!this.prerelease.length&&D.prerelease.length)return 1;else if(!this.prerelease.length&&!D.prerelease.length)return 0;let u=0;do{let _=this.prerelease[u],F=D.prerelease[u];if(D3("prerelease compare",u,_,F),_===void 0&&F===void 0)return 0;else if(F===void 0)return 1;else if(_===void 0)return-1;else if(_===F)continue;else return J6(_,F)}while(++u)}compareBuild(D){if(!(D instanceof WD))D=new WD(D,this.options);let u=0;do{let _=this.build[u],F=D.build[u];if(D3("build compare",u,_,F),_===void 0&&F===void 0)return 0;else if(F===void 0)return 1;else if(_===void 0)return-1;else if(_===F)continue;else return J6(_,F)}while(++u)}inc(D,u,_){if(D.startsWith("pre")){if(!u&&_===!1)throw Error("invalid increment argument: identifier is empty");if(u){let F=`-${u}`.match(this.options.loose?_3[F3.PRERELEASELOOSE]:_3[F3.PRERELEASE]);if(!F||F[1]!==u)throw Error(`invalid identifier: ${u}`)}}switch(D){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,_);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,_);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,_),this.inc("pre",u,_);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",u,_);this.inc("pre",u,_);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let F=Number(_)?1:0;if(this.prerelease.length===0)this.prerelease=[F];else{let q=this.prerelease.length;while(--q>=0)if(typeof this.prerelease[q]==="number")this.prerelease[q]++,q=-2;if(q===-1){if(u===this.prerelease.join(".")&&_===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(F)}}if(u){let q=[u,F];if(_===!1)q=[u];if(J6(this.prerelease[0],u)===0){if(isNaN(this.prerelease[1]))this.prerelease=q}else this.prerelease=q}break}default:throw Error(`invalid increment argument: ${D}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}L5.exports=WD});var j5=G((rB,O5)=>{var U5=V6(),l$=(D,u,_)=>new U5(D,_).compare(new U5(u,_));O5.exports=l$});var Z6=G((eB,P5)=>{var c$=j5(),p$=(D,u,_)=>c$(D,u,_)<0;P5.exports=p$});var b5=G((TG,h5)=>{var qQ=T("node:tty"),CQ=qQ?.WriteStream?.prototype?.hasColors?.()??!1,w=(D,u)=>{if(!CQ)return(q)=>q;let _=`\x1B[${D}m`,F=`\x1B[${u}m`;return(q)=>{let C=q+"",$=C.indexOf(F);if($===-1)return _+C+F;let Q=_,J=0,V=(u===22?F:"")+_;while($!==-1)Q+=C.slice(J,$)+V,J=$+F.length,$=C.indexOf(F,J);return Q+=C.slice(J)+F,Q}},I={};I.reset=w(0,0);I.bold=w(1,22);I.dim=w(2,22);I.italic=w(3,23);I.underline=w(4,24);I.overline=w(53,55);I.inverse=w(7,27);I.hidden=w(8,28);I.strikethrough=w(9,29);I.black=w(30,39);I.red=w(31,39);I.green=w(32,39);I.yellow=w(33,39);I.blue=w(34,39);I.magenta=w(35,39);I.cyan=w(36,39);I.white=w(37,39);I.gray=w(90,39);I.bgBlack=w(40,49);I.bgRed=w(41,49);I.bgGreen=w(42,49);I.bgYellow=w(43,49);I.bgBlue=w(44,49);I.bgMagenta=w(45,49);I.bgCyan=w(46,49);I.bgWhite=w(47,49);I.bgGray=w(100,49);I.redBright=w(91,39);I.greenBright=w(92,39);I.yellowBright=w(93,39);I.blueBright=w(94,39);I.magentaBright=w(95,39);I.cyanBright=w(96,39);I.whiteBright=w(97,39);I.bgRedBright=w(101,49);I.bgGreenBright=w(102,49);I.bgYellowBright=w(103,49);I.bgBlueBright=w(104,49);I.bgMagentaBright=w(105,49);I.bgCyanBright=w(106,49);I.bgWhiteBright=w(107,49);h5.exports=I});var a5=G((aG,i5)=>{i5.exports=BQ;function XQ(D){let u={defaultWidth:0,output:process.stdout,tty:T("tty")};if(!D)return u;return Object.keys(u).forEach(function(_){if(!D[_])D[_]=u[_]}),D}function BQ(D){let u=XQ(D);if(u.output.getWindowSize)return u.output.getWindowSize()[0]||u.defaultWidth;if(u.tty.getWindowSize)return u.tty.getWindowSize()[1]||u.defaultWidth;if(u.output.columns)return u.output.columns;if(process.env.CLI_WIDTH){let _=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(_)&&_!==0)return _}return u.defaultWidth}});var s5=G((nG,n5)=>{n5.exports=({onlyFirst:D=!1}={})=>{let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,D?void 0:"g")}});var O6=G((sG,t5)=>{var GQ=s5();t5.exports=(D)=>typeof D==="string"?D.replace(GQ(),""):D});var r5=G((tG,j6)=>{var o5=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};j6.exports=o5;j6.exports.default=o5});var D9=G((oG,e5)=>{e5.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var _9=G((rG,P6)=>{var YQ=O6(),HQ=r5(),xQ=D9(),u9=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=YQ(D),D.length===0)return 0;D=D.replace(xQ()," ");let u=0;for(let _=0;_<D.length;_++){let F=D.codePointAt(_);if(F<=31||F>=127&&F<=159)continue;if(F>=768&&F<=879)continue;if(F>65535)_++;u+=HQ(F)?2:1}return u};P6.exports=u9;P6.exports.default=u9});var q9=G((eG,F9)=>{F9.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var I6=G((DY,$9)=>{var b2=q9(),C9={};for(let D of Object.keys(b2))C9[b2[D]]=D;var A={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};$9.exports=A;for(let D of Object.keys(A)){if(!("channels"in A[D]))throw Error("missing channels property: "+D);if(!("labels"in A[D]))throw Error("missing channel labels property: "+D);if(A[D].labels.length!==A[D].channels)throw Error("channel and label counts mismatch: "+D);let{channels:u,labels:_}=A[D];delete A[D].channels,delete A[D].labels,Object.defineProperty(A[D],"channels",{value:u}),Object.defineProperty(A[D],"labels",{value:_})}A.rgb.hsl=function(D){let u=D[0]/255,_=D[1]/255,F=D[2]/255,q=Math.min(u,_,F),C=Math.max(u,_,F),$=C-q,Q,J;if(C===q)Q=0;else if(u===C)Q=(_-F)/$;else if(_===C)Q=2+(F-u)/$;else if(F===C)Q=4+(u-_)/$;if(Q=Math.min(Q*60,360),Q<0)Q+=360;let Z=(q+C)/2;if(C===q)J=0;else if(Z<=0.5)J=$/(C+q);else J=$/(2-C-q);return[Q,J*100,Z*100]};A.rgb.hsv=function(D){let u,_,F,q,C,$=D[0]/255,Q=D[1]/255,J=D[2]/255,Z=Math.max($,Q,J),V=Z-Math.min($,Q,J),K=function(X){return(Z-X)/6/V+0.5};if(V===0)q=0,C=0;else{if(C=V/Z,u=K($),_=K(Q),F=K(J),$===Z)q=F-_;else if(Q===Z)q=0.3333333333333333+u-F;else if(J===Z)q=0.6666666666666666+_-u;if(q<0)q+=1;else if(q>1)q-=1}return[q*360,C*100,Z*100]};A.rgb.hwb=function(D){let u=D[0],_=D[1],F=D[2],q=A.rgb.hsl(D)[0],C=0.00392156862745098*Math.min(u,Math.min(_,F));return F=1-0.00392156862745098*Math.max(u,Math.max(_,F)),[q,C*100,F*100]};A.rgb.cmyk=function(D){let u=D[0]/255,_=D[1]/255,F=D[2]/255,q=Math.min(1-u,1-_,1-F),C=(1-u-q)/(1-q)||0,$=(1-_-q)/(1-q)||0,Q=(1-F-q)/(1-q)||0;return[C*100,$*100,Q*100,q*100]};function WQ(D,u){return(D[0]-u[0])**2+(D[1]-u[1])**2+(D[2]-u[2])**2}A.rgb.keyword=function(D){let u=C9[D];if(u)return u;let _=1/0,F;for(let q of Object.keys(b2)){let C=b2[q],$=WQ(D,C);if($<_)_=$,F=q}return F};A.keyword.rgb=function(D){return b2[D]};A.rgb.xyz=function(D){let u=D[0]/255,_=D[1]/255,F=D[2]/255;u=u>0.04045?((u+0.055)/1.055)**2.4:u/12.92,_=_>0.04045?((_+0.055)/1.055)**2.4:_/12.92,F=F>0.04045?((F+0.055)/1.055)**2.4:F/12.92;let q=u*0.4124+_*0.3576+F*0.1805,C=u*0.2126+_*0.7152+F*0.0722,$=u*0.0193+_*0.1192+F*0.9505;return[q*100,C*100,$*100]};A.rgb.lab=function(D){let u=A.rgb.xyz(D),_=u[0],F=u[1],q=u[2];_/=95.047,F/=100,q/=108.883,_=_>0.008856?_**0.3333333333333333:7.787*_+0.13793103448275862,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862,q=q>0.008856?q**0.3333333333333333:7.787*q+0.13793103448275862;let C=116*F-16,$=500*(_-F),Q=200*(F-q);return[C,$,Q]};A.hsl.rgb=function(D){let u=D[0]/360,_=D[1]/100,F=D[2]/100,q,C,$;if(_===0)return $=F*255,[$,$,$];if(F<0.5)q=F*(1+_);else q=F+_-F*_;let Q=2*F-q,J=[0,0,0];for(let Z=0;Z<3;Z++){if(C=u+0.3333333333333333*-(Z-1),C<0)C++;if(C>1)C--;if(6*C<1)$=Q+(q-Q)*6*C;else if(2*C<1)$=q;else if(3*C<2)$=Q+(q-Q)*(0.6666666666666666-C)*6;else $=Q;J[Z]=$*255}return J};A.hsl.hsv=function(D){let u=D[0],_=D[1]/100,F=D[2]/100,q=_,C=Math.max(F,0.01);F*=2,_*=F<=1?F:2-F,q*=C<=1?C:2-C;let $=(F+_)/2,Q=F===0?2*q/(C+q):2*_/(F+_);return[u,Q*100,$*100]};A.hsv.rgb=function(D){let u=D[0]/60,_=D[1]/100,F=D[2]/100,q=Math.floor(u)%6,C=u-Math.floor(u),$=255*F*(1-_),Q=255*F*(1-_*C),J=255*F*(1-_*(1-C));switch(F*=255,q){case 0:return[F,J,$];case 1:return[Q,F,$];case 2:return[$,F,J];case 3:return[$,Q,F];case 4:return[J,$,F];case 5:return[F,$,Q]}};A.hsv.hsl=function(D){let u=D[0],_=D[1]/100,F=D[2]/100,q=Math.max(F,0.01),C,$;$=(2-_)*F;let Q=(2-_)*q;return C=_*q,C/=Q<=1?Q:2-Q,C=C||0,$/=2,[u,C*100,$*100]};A.hwb.rgb=function(D){let u=D[0]/360,_=D[1]/100,F=D[2]/100,q=_+F,C;if(q>1)_/=q,F/=q;let $=Math.floor(6*u),Q=1-F;if(C=6*u-$,($&1)!==0)C=1-C;let J=_+C*(Q-_),Z,V,K;switch($){default:case 6:case 0:Z=Q,V=J,K=_;break;case 1:Z=J,V=Q,K=_;break;case 2:Z=_,V=Q,K=J;break;case 3:Z=_,V=J,K=Q;break;case 4:Z=J,V=_,K=Q;break;case 5:Z=Q,V=_,K=J;break}return[Z*255,V*255,K*255]};A.cmyk.rgb=function(D){let u=D[0]/100,_=D[1]/100,F=D[2]/100,q=D[3]/100,C=1-Math.min(1,u*(1-q)+q),$=1-Math.min(1,_*(1-q)+q),Q=1-Math.min(1,F*(1-q)+q);return[C*255,$*255,Q*255]};A.xyz.rgb=function(D){let u=D[0]/100,_=D[1]/100,F=D[2]/100,q,C,$;return q=u*3.2406+_*-1.5372+F*-0.4986,C=u*-0.9689+_*1.8758+F*0.0415,$=u*0.0557+_*-0.204+F*1.057,q=q>0.0031308?1.055*q**0.4166666666666667-0.055:q*12.92,C=C>0.0031308?1.055*C**0.4166666666666667-0.055:C*12.92,$=$>0.0031308?1.055*$**0.4166666666666667-0.055:$*12.92,q=Math.min(Math.max(0,q),1),C=Math.min(Math.max(0,C),1),$=Math.min(Math.max(0,$),1),[q*255,C*255,$*255]};A.xyz.lab=function(D){let u=D[0],_=D[1],F=D[2];u/=95.047,_/=100,F/=108.883,u=u>0.008856?u**0.3333333333333333:7.787*u+0.13793103448275862,_=_>0.008856?_**0.3333333333333333:7.787*_+0.13793103448275862,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862;let q=116*_-16,C=500*(u-_),$=200*(_-F);return[q,C,$]};A.lab.xyz=function(D){let u=D[0],_=D[1],F=D[2],q,C,$;C=(u+16)/116,q=_/500+C,$=C-F/200;let Q=C**3,J=q**3,Z=$**3;return C=Q>0.008856?Q:(C-0.13793103448275862)/7.787,q=J>0.008856?J:(q-0.13793103448275862)/7.787,$=Z>0.008856?Z:($-0.13793103448275862)/7.787,q*=95.047,C*=100,$*=108.883,[q,C,$]};A.lab.lch=function(D){let u=D[0],_=D[1],F=D[2],q;if(q=Math.atan2(F,_)*360/2/Math.PI,q<0)q+=360;let $=Math.sqrt(_*_+F*F);return[u,$,q]};A.lch.lab=function(D){let u=D[0],_=D[1],q=D[2]/360*2*Math.PI,C=_*Math.cos(q),$=_*Math.sin(q);return[u,C,$]};A.rgb.ansi16=function(D,u=null){let[_,F,q]=D,C=u===null?A.rgb.hsv(D)[2]:u;if(C=Math.round(C/50),C===0)return 30;let $=30+(Math.round(q/255)<<2|Math.round(F/255)<<1|Math.round(_/255));if(C===2)$+=60;return $};A.hsv.ansi16=function(D){return A.rgb.ansi16(A.hsv.rgb(D),D[2])};A.rgb.ansi256=function(D){let u=D[0],_=D[1],F=D[2];if(u===_&&_===F){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(_/255*5)+Math.round(F/255*5)};A.ansi16.rgb=function(D){let u=D%10;if(u===0||u===7){if(D>50)u+=3.5;return u=u/10.5*255,[u,u,u]}let _=(~~(D>50)+1)*0.5,F=(u&1)*_*255,q=(u>>1&1)*_*255,C=(u>>2&1)*_*255;return[F,q,C]};A.ansi256.rgb=function(D){if(D>=232){let C=(D-232)*10+8;return[C,C,C]}D-=16;let u,_=Math.floor(D/36)/5*255,F=Math.floor((u=D%36)/6)/5*255,q=u%6/5*255;return[_,F,q]};A.rgb.hex=function(D){let _=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring(_.length)+_};A.hex.rgb=function(D){let u=D.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!u)return[0,0,0];let _=u[0];if(u[0].length===3)_=_.split("").map((Q)=>{return Q+Q}).join("");let F=parseInt(_,16),q=F>>16&255,C=F>>8&255,$=F&255;return[q,C,$]};A.rgb.hcg=function(D){let u=D[0]/255,_=D[1]/255,F=D[2]/255,q=Math.max(Math.max(u,_),F),C=Math.min(Math.min(u,_),F),$=q-C,Q,J;if($<1)Q=C/(1-$);else Q=0;if($<=0)J=0;else if(q===u)J=(_-F)/$%6;else if(q===_)J=2+(F-u)/$;else J=4+(u-_)/$;return J/=6,J%=1,[J*360,$*100,Q*100]};A.hsl.hcg=function(D){let u=D[1]/100,_=D[2]/100,F=_<0.5?2*u*_:2*u*(1-_),q=0;if(F<1)q=(_-0.5*F)/(1-F);return[D[0],F*100,q*100]};A.hsv.hcg=function(D){let u=D[1]/100,_=D[2]/100,F=u*_,q=0;if(F<1)q=(_-F)/(1-F);return[D[0],F*100,q*100]};A.hcg.rgb=function(D){let u=D[0]/360,_=D[1]/100,F=D[2]/100;if(_===0)return[F*255,F*255,F*255];let q=[0,0,0],C=u%1*6,$=C%1,Q=1-$,J=0;switch(Math.floor(C)){case 0:q[0]=1,q[1]=$,q[2]=0;break;case 1:q[0]=Q,q[1]=1,q[2]=0;break;case 2:q[0]=0,q[1]=1,q[2]=$;break;case 3:q[0]=0,q[1]=Q,q[2]=1;break;case 4:q[0]=$,q[1]=0,q[2]=1;break;default:q[0]=1,q[1]=0,q[2]=Q}return J=(1-_)*F,[(_*q[0]+J)*255,(_*q[1]+J)*255,(_*q[2]+J)*255]};A.hcg.hsv=function(D){let u=D[1]/100,_=D[2]/100,F=u+_*(1-u),q=0;if(F>0)q=u/F;return[D[0],q*100,F*100]};A.hcg.hsl=function(D){let u=D[1]/100,F=D[2]/100*(1-u)+0.5*u,q=0;if(F>0&&F<0.5)q=u/(2*F);else if(F>=0.5&&F<1)q=u/(2*(1-F));return[D[0],q*100,F*100]};A.hcg.hwb=function(D){let u=D[1]/100,_=D[2]/100,F=u+_*(1-u);return[D[0],(F-u)*100,(1-F)*100]};A.hwb.hcg=function(D){let u=D[1]/100,F=1-D[2]/100,q=F-u,C=0;if(q<1)C=(F-q)/(1-q);return[D[0],q*100,C*100]};A.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};A.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};A.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};A.gray.hsl=function(D){return[0,0,D[0]]};A.gray.hsv=A.gray.hsl;A.gray.hwb=function(D){return[0,100,D[0]]};A.gray.cmyk=function(D){return[0,0,0,D[0]]};A.gray.lab=function(D){return[D[0],0,0]};A.gray.hex=function(D){let u=Math.round(D[0]/100*255)&255,F=((u<<16)+(u<<8)+u).toString(16).toUpperCase();return"000000".substring(F.length)+F};A.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var J9=G((uY,Q9)=>{var J3=I6();function AQ(){let D={},u=Object.keys(J3);for(let _=u.length,F=0;F<_;F++)D[u[F]]={distance:-1,parent:null};return D}function zQ(D){let u=AQ(),_=[D];u[D].distance=0;while(_.length){let F=_.pop(),q=Object.keys(J3[F]);for(let C=q.length,$=0;$<C;$++){let Q=q[$],J=u[Q];if(J.distance===-1)J.distance=u[F].distance+1,J.parent=F,_.unshift(Q)}}return u}function LQ(D,u){return function(_){return u(D(_))}}function UQ(D,u){let _=[u[D].parent,D],F=J3[u[D].parent][D],q=u[D].parent;while(u[q].parent)_.unshift(u[q].parent),F=LQ(J3[u[q].parent][q],F),q=u[q].parent;return F.conversion=_,F}Q9.exports=function(D){let u=zQ(D),_={},F=Object.keys(u);for(let q=F.length,C=0;C<q;C++){let $=F[C];if(u[$].parent===null)continue;_[$]=UQ($,u)}return _}});var Z9=G((_Y,V9)=>{var w6=I6(),OQ=J9(),D2={},jQ=Object.keys(w6);function PQ(D){let u=function(..._){let F=_[0];if(F===void 0||F===null)return F;if(F.length>1)_=F;return D(_)};if("conversion"in D)u.conversion=D.conversion;return u}function IQ(D){let u=function(..._){let F=_[0];if(F===void 0||F===null)return F;if(F.length>1)_=F;let q=D(_);if(typeof q==="object")for(let C=q.length,$=0;$<C;$++)q[$]=Math.round(q[$]);return q};if("conversion"in D)u.conversion=D.conversion;return u}jQ.forEach((D)=>{D2[D]={},Object.defineProperty(D2[D],"channels",{value:w6[D].channels}),Object.defineProperty(D2[D],"labels",{value:w6[D].labels});let u=OQ(D);Object.keys(u).forEach((F)=>{let q=u[F];D2[D][F]=IQ(q),D2[D][F].raw=PQ(q)})});V9.exports=D2});var H9=G((FY,Y9)=>{var K9=(D,u)=>(..._)=>{return`\x1B[${D(..._)+u}m`},X9=(D,u)=>(..._)=>{let F=D(..._);return`\x1B[${38+u};5;${F}m`},B9=(D,u)=>(..._)=>{let F=D(..._);return`\x1B[${38+u};2;${F[0]};${F[1]};${F[2]}m`},V3=(D)=>D,G9=(D,u,_)=>[D,u,_],u2=(D,u,_)=>{Object.defineProperty(D,u,{get:()=>{let F=_();return Object.defineProperty(D,u,{value:F,enumerable:!0,configurable:!0}),F},enumerable:!0,configurable:!0})},M6,_2=(D,u,_,F)=>{if(M6===void 0)M6=Z9();let q=F?10:0,C={};for(let[$,Q]of Object.entries(M6)){let J=$==="ansi16"?"ansi":$;if($===u)C[J]=D(_,q);else if(typeof Q==="object")C[J]=D(Q[u],q)}return C};function wQ(){let D=new Map,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(let[_,F]of Object.entries(u)){for(let[q,C]of Object.entries(F))u[q]={open:`\x1B[${C[0]}m`,close:`\x1B[${C[1]}m`},F[q]=u[q],D.set(C[0],C[1]);Object.defineProperty(u,_,{value:F,enumerable:!1})}return Object.defineProperty(u,"codes",{value:D,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u2(u.color,"ansi",()=>_2(K9,"ansi16",V3,!1)),u2(u.color,"ansi256",()=>_2(X9,"ansi256",V3,!1)),u2(u.color,"ansi16m",()=>_2(B9,"rgb",G9,!1)),u2(u.bgColor,"ansi",()=>_2(K9,"ansi16",V3,!0)),u2(u.bgColor,"ansi256",()=>_2(X9,"ansi256",V3,!0)),u2(u.bgColor,"ansi16m",()=>_2(B9,"rgb",G9,!0)),u}Object.defineProperty(Y9,"exports",{enumerable:!0,get:wQ})});var A9=G((qY,W9)=>{var g2=_9(),MQ=O6(),TQ=H9(),v6=new Set(["\x1B","›"]),x9=(D)=>`${v6.values().next().value}[${D}m`,vQ=(D)=>D.split(" ").map((u)=>g2(u)),T6=(D,u,_)=>{let F=[...u],q=!1,C=g2(MQ(D[D.length-1]));for(let[$,Q]of F.entries()){let J=g2(Q);if(C+J<=_)D[D.length-1]+=Q;else D.push(Q),C=0;if(v6.has(Q))q=!0;else if(q&&Q==="m"){q=!1;continue}if(q)continue;if(C+=J,C===_&&$<F.length-1)D.push(""),C=0}if(!C&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},RQ=(D)=>{let u=D.split(" "),_=u.length;while(_>0){if(g2(u[_-1])>0)break;_--}if(_===u.length)return D;return u.slice(0,_).join(" ")+u.slice(_).join("")},NQ=(D,u,_={})=>{if(_.trim!==!1&&D.trim()==="")return"";let F="",q="",C,$=vQ(D),Q=[""];for(let[J,Z]of D.split(" ").entries()){if(_.trim!==!1)Q[Q.length-1]=Q[Q.length-1].trimLeft();let V=g2(Q[Q.length-1]);if(J!==0){if(V>=u&&(_.wordWrap===!1||_.trim===!1))Q.push(""),V=0;if(V>0||_.trim===!1)Q[Q.length-1]+=" ",V++}if(_.hard&&$[J]>u){let K=u-V,X=1+Math.floor(($[J]-K-1)/u);if(Math.floor(($[J]-1)/u)<X)Q.push("");T6(Q,Z,u);continue}if(V+$[J]>u&&V>0&&$[J]>0){if(_.wordWrap===!1&&V<u){T6(Q,Z,u);continue}Q.push("")}if(V+$[J]>u&&_.wordWrap===!1){T6(Q,Z,u);continue}Q[Q.length-1]+=Z}if(_.trim!==!1)Q=Q.map(RQ);F=Q.join(`
7
- `);for(let[J,Z]of[...F].entries()){if(q+=Z,v6.has(Z)){let K=parseFloat(/\d[^m]*/.exec(F.slice(J,J+4)));C=K===39?null:K}let V=TQ.codes.get(Number(C));if(C&&V){if(F[J+1]===`
8
- `)q+=x9(V);else if(Z===`
9
- `)q+=x9(C)}}return q};W9.exports=(D,u,_)=>{return String(D).normalize().replace(/\r\n/g,`
10
- `).split(`
11
- `).map((F)=>NQ(F,u,_)).join(`
12
- `)}});var P9=G((QY,j9)=>{var SQ=T("stream");class O9 extends SQ{#D=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#_(D,u){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return u}#u(D,...u){if(typeof this._dest?.[D]==="function")this._dest[D](...u);if(typeof this._src?.[D]==="function")this._src[D](...u)}get isTTY(){if(this.#D!==null)return this.#D;return this.#_("isTTY",!1)}set isTTY(D){this.#D=D}get rows(){return this.#_("rows")}get columns(){return this.#_("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,u){return this._dest=D,super.pipe(D,u)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#u("destroy",...D)}destroySoon(...D){return this.#u("destroySoon",...D)}close(...D){return this.#u("close",...D)}}j9.exports=O9});var g9=G((lY,b9)=>{var h9=V6(),fQ=(D,u,_=!1)=>{if(D instanceof h9)return D;try{return new h9(D,u)}catch(F){if(!_)return null;throw F}};b9.exports=fQ});var f9=G((cY,m9)=>{var dQ=g9(),lQ=(D,u)=>{let _=dQ(D,u);return _?_.version:null};m9.exports=lQ});var m2=G((rY,a9)=>{var pQ=Number.MAX_SAFE_INTEGER||9007199254740991,iQ=["major","premajor","minor","preminor","patch","prepatch","prerelease"];a9.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:pQ,RELEASE_TYPES:iQ,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var f2=G((eY,n9)=>{var aQ=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...D)=>console.error("SEMVER",...D):()=>{};n9.exports=aQ});var F2=G((vD,s9)=>{var{MAX_SAFE_COMPONENT_LENGTH:c6,MAX_SAFE_BUILD_LENGTH:nQ,MAX_LENGTH:sQ}=m2(),tQ=f2();vD=s9.exports={};var oQ=vD.re=[],rQ=vD.safeRe=[],x=vD.src=[],eQ=vD.safeSrc=[],W=vD.t={},DJ=0,p6="[a-zA-Z0-9-]",uJ=[["\\s",1],["\\d",sQ],[p6,nQ]],_J=(D)=>{for(let[u,_]of uJ)D=D.split(`${u}*`).join(`${u}{0,${_}}`).split(`${u}+`).join(`${u}{1,${_}}`);return D},O=(D,u,_)=>{let F=_J(u),q=DJ++;tQ(D,q,u),W[D]=q,x[q]=u,eQ[q]=F,oQ[q]=new RegExp(u,_?"g":void 0),rQ[q]=new RegExp(F,_?"g":void 0)};O("NUMERICIDENTIFIER","0|[1-9]\\d*");O("NUMERICIDENTIFIERLOOSE","\\d+");O("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p6}*`);O("MAINVERSION",`(${x[W.NUMERICIDENTIFIER]})\\.(${x[W.NUMERICIDENTIFIER]})\\.(${x[W.NUMERICIDENTIFIER]})`);O("MAINVERSIONLOOSE",`(${x[W.NUMERICIDENTIFIERLOOSE]})\\.(${x[W.NUMERICIDENTIFIERLOOSE]})\\.(${x[W.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASEIDENTIFIER",`(?:${x[W.NONNUMERICIDENTIFIER]}|${x[W.NUMERICIDENTIFIER]})`);O("PRERELEASEIDENTIFIERLOOSE",`(?:${x[W.NONNUMERICIDENTIFIER]}|${x[W.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASE",`(?:-(${x[W.PRERELEASEIDENTIFIER]}(?:\\.${x[W.PRERELEASEIDENTIFIER]})*))`);O("PRERELEASELOOSE",`(?:-?(${x[W.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${x[W.PRERELEASEIDENTIFIERLOOSE]})*))`);O("BUILDIDENTIFIER",`${p6}+`);O("BUILD",`(?:\\+(${x[W.BUILDIDENTIFIER]}(?:\\.${x[W.BUILDIDENTIFIER]})*))`);O("FULLPLAIN",`v?${x[W.MAINVERSION]}${x[W.PRERELEASE]}?${x[W.BUILD]}?`);O("FULL",`^${x[W.FULLPLAIN]}$`);O("LOOSEPLAIN",`[v=\\s]*${x[W.MAINVERSIONLOOSE]}${x[W.PRERELEASELOOSE]}?${x[W.BUILD]}?`);O("LOOSE",`^${x[W.LOOSEPLAIN]}$`);O("GTLT","((?:<|>)?=?)");O("XRANGEIDENTIFIERLOOSE",`${x[W.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);O("XRANGEIDENTIFIER",`${x[W.NUMERICIDENTIFIER]}|x|X|\\*`);O("XRANGEPLAIN",`[v=\\s]*(${x[W.XRANGEIDENTIFIER]})(?:\\.(${x[W.XRANGEIDENTIFIER]})(?:\\.(${x[W.XRANGEIDENTIFIER]})(?:${x[W.PRERELEASE]})?${x[W.BUILD]}?)?)?`);O("XRANGEPLAINLOOSE",`[v=\\s]*(${x[W.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[W.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[W.XRANGEIDENTIFIERLOOSE]})(?:${x[W.PRERELEASELOOSE]})?${x[W.BUILD]}?)?)?`);O("XRANGE",`^${x[W.GTLT]}\\s*${x[W.XRANGEPLAIN]}$`);O("XRANGELOOSE",`^${x[W.GTLT]}\\s*${x[W.XRANGEPLAINLOOSE]}$`);O("COERCEPLAIN",`(^|[^\\d])(\\d{1,${c6}})(?:\\.(\\d{1,${c6}}))?(?:\\.(\\d{1,${c6}}))?`);O("COERCE",`${x[W.COERCEPLAIN]}(?:$|[^\\d])`);O("COERCEFULL",x[W.COERCEPLAIN]+`(?:${x[W.PRERELEASE]})?(?:${x[W.BUILD]})?(?:$|[^\\d])`);O("COERCERTL",x[W.COERCE],!0);O("COERCERTLFULL",x[W.COERCEFULL],!0);O("LONETILDE","(?:~>?)");O("TILDETRIM",`(\\s*)${x[W.LONETILDE]}\\s+`,!0);vD.tildeTrimReplace="$1~";O("TILDE",`^${x[W.LONETILDE]}${x[W.XRANGEPLAIN]}$`);O("TILDELOOSE",`^${x[W.LONETILDE]}${x[W.XRANGEPLAINLOOSE]}$`);O("LONECARET","(?:\\^)");O("CARETTRIM",`(\\s*)${x[W.LONECARET]}\\s+`,!0);vD.caretTrimReplace="$1^";O("CARET",`^${x[W.LONECARET]}${x[W.XRANGEPLAIN]}$`);O("CARETLOOSE",`^${x[W.LONECARET]}${x[W.XRANGEPLAINLOOSE]}$`);O("COMPARATORLOOSE",`^${x[W.GTLT]}\\s*(${x[W.LOOSEPLAIN]})$|^$`);O("COMPARATOR",`^${x[W.GTLT]}\\s*(${x[W.FULLPLAIN]})$|^$`);O("COMPARATORTRIM",`(\\s*)${x[W.GTLT]}\\s*(${x[W.LOOSEPLAIN]}|${x[W.XRANGEPLAIN]})`,!0);vD.comparatorTrimReplace="$1$2$3";O("HYPHENRANGE",`^\\s*(${x[W.XRANGEPLAIN]})\\s+-\\s+(${x[W.XRANGEPLAIN]})\\s*$`);O("HYPHENRANGELOOSE",`^\\s*(${x[W.XRANGEPLAINLOOSE]})\\s+-\\s+(${x[W.XRANGEPLAINLOOSE]})\\s*$`);O("STAR","(<|>)?=?\\s*\\*");O("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");O("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var X3=G((DH,t9)=>{var FJ=Object.freeze({loose:!0}),qJ=Object.freeze({}),CJ=(D)=>{if(!D)return qJ;if(typeof D!=="object")return FJ;return D};t9.exports=CJ});var i6=G((uH,e9)=>{var o9=/^[0-9]+$/,r9=(D,u)=>{let _=o9.test(D),F=o9.test(u);if(_&&F)D=+D,u=+u;return D===u?0:_&&!F?-1:F&&!_?1:D<u?-1:1},$J=(D,u)=>r9(u,D);e9.exports={compareIdentifiers:r9,rcompareIdentifiers:$J}});var l=G((_H,u7)=>{var B3=f2(),{MAX_LENGTH:D7,MAX_SAFE_INTEGER:G3}=m2(),{safeRe:Y3,t:H3}=F2(),QJ=X3(),{compareIdentifiers:q2}=i6();class AD{constructor(D,u){if(u=QJ(u),D instanceof AD)if(D.loose===!!u.loose&&D.includePrerelease===!!u.includePrerelease)return D;else D=D.version;else if(typeof D!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof D}".`);if(D.length>D7)throw TypeError(`version is longer than ${D7} characters`);B3("SemVer",D,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;let _=D.trim().match(u.loose?Y3[H3.LOOSE]:Y3[H3.FULL]);if(!_)throw TypeError(`Invalid Version: ${D}`);if(this.raw=D,this.major=+_[1],this.minor=+_[2],this.patch=+_[3],this.major>G3||this.major<0)throw TypeError("Invalid major version");if(this.minor>G3||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>G3||this.patch<0)throw TypeError("Invalid patch version");if(!_[4])this.prerelease=[];else this.prerelease=_[4].split(".").map((F)=>{if(/^[0-9]+$/.test(F)){let q=+F;if(q>=0&&q<G3)return q}return F});this.build=_[5]?_[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(D){if(B3("SemVer.compare",this.version,this.options,D),!(D instanceof AD)){if(typeof D==="string"&&D===this.version)return 0;D=new AD(D,this.options)}if(D.version===this.version)return 0;return this.compareMain(D)||this.comparePre(D)}compareMain(D){if(!(D instanceof AD))D=new AD(D,this.options);return q2(this.major,D.major)||q2(this.minor,D.minor)||q2(this.patch,D.patch)}comparePre(D){if(!(D instanceof AD))D=new AD(D,this.options);if(this.prerelease.length&&!D.prerelease.length)return-1;else if(!this.prerelease.length&&D.prerelease.length)return 1;else if(!this.prerelease.length&&!D.prerelease.length)return 0;let u=0;do{let _=this.prerelease[u],F=D.prerelease[u];if(B3("prerelease compare",u,_,F),_===void 0&&F===void 0)return 0;else if(F===void 0)return 1;else if(_===void 0)return-1;else if(_===F)continue;else return q2(_,F)}while(++u)}compareBuild(D){if(!(D instanceof AD))D=new AD(D,this.options);let u=0;do{let _=this.build[u],F=D.build[u];if(B3("build compare",u,_,F),_===void 0&&F===void 0)return 0;else if(F===void 0)return 1;else if(_===void 0)return-1;else if(_===F)continue;else return q2(_,F)}while(++u)}inc(D,u,_){if(D.startsWith("pre")){if(!u&&_===!1)throw Error("invalid increment argument: identifier is empty");if(u){let F=`-${u}`.match(this.options.loose?Y3[H3.PRERELEASELOOSE]:Y3[H3.PRERELEASE]);if(!F||F[1]!==u)throw Error(`invalid identifier: ${u}`)}}switch(D){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,_);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,_);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,_),this.inc("pre",u,_);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",u,_);this.inc("pre",u,_);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let F=Number(_)?1:0;if(this.prerelease.length===0)this.prerelease=[F];else{let q=this.prerelease.length;while(--q>=0)if(typeof this.prerelease[q]==="number")this.prerelease[q]++,q=-2;if(q===-1){if(u===this.prerelease.join(".")&&_===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(F)}}if(u){let q=[u,F];if(_===!1)q=[u];if(q2(this.prerelease[0],u)===0){if(isNaN(this.prerelease[1]))this.prerelease=q}else this.prerelease=q}break}default:throw Error(`invalid increment argument: ${D}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}u7.exports=AD});var R0=G((FH,F7)=>{var _7=l(),JJ=(D,u,_=!1)=>{if(D instanceof _7)return D;try{return new _7(D,u)}catch(F){if(!_)return null;throw F}};F7.exports=JJ});var C7=G((qH,q7)=>{var VJ=R0(),ZJ=(D,u)=>{let _=VJ(D,u);return _?_.version:null};q7.exports=ZJ});var Q7=G((CH,$7)=>{var KJ=R0(),XJ=(D,u)=>{let _=KJ(D.trim().replace(/^[=v]+/,""),u);return _?_.version:null};$7.exports=XJ});var Z7=G(($H,V7)=>{var J7=l(),BJ=(D,u,_,F,q)=>{if(typeof _==="string")q=F,F=_,_=void 0;try{return new J7(D instanceof J7?D.version:D,_).inc(u,F,q).version}catch(C){return null}};V7.exports=BJ});var B7=G((QH,X7)=>{var K7=R0(),GJ=(D,u)=>{let _=K7(D,null,!0),F=K7(u,null,!0),q=_.compare(F);if(q===0)return null;let C=q>0,$=C?_:F,Q=C?F:_,J=!!$.prerelease.length;if(!!Q.prerelease.length&&!J){if(!Q.patch&&!Q.minor)return"major";if(Q.compareMain($)===0){if(Q.minor&&!Q.patch)return"minor";return"patch"}}let V=J?"pre":"";if(_.major!==F.major)return V+"major";if(_.minor!==F.minor)return V+"minor";if(_.patch!==F.patch)return V+"patch";return"prerelease"};X7.exports=GJ});var Y7=G((JH,G7)=>{var YJ=l(),HJ=(D,u)=>new YJ(D,u).major;G7.exports=HJ});var x7=G((VH,H7)=>{var xJ=l(),WJ=(D,u)=>new xJ(D,u).minor;H7.exports=WJ});var A7=G((ZH,W7)=>{var AJ=l(),zJ=(D,u)=>new AJ(D,u).patch;W7.exports=zJ});var L7=G((KH,z7)=>{var LJ=R0(),UJ=(D,u)=>{let _=LJ(D,u);return _&&_.prerelease.length?_.prerelease:null};z7.exports=UJ});var VD=G((XH,O7)=>{var U7=l(),OJ=(D,u,_)=>new U7(D,_).compare(new U7(u,_));O7.exports=OJ});var P7=G((BH,j7)=>{var jJ=VD(),PJ=(D,u,_)=>jJ(u,D,_);j7.exports=PJ});var w7=G((GH,I7)=>{var IJ=VD(),wJ=(D,u)=>IJ(D,u,!0);I7.exports=wJ});var x3=G((YH,T7)=>{var M7=l(),MJ=(D,u,_)=>{let F=new M7(D,_),q=new M7(u,_);return F.compare(q)||F.compareBuild(q)};T7.exports=MJ});var R7=G((HH,v7)=>{var TJ=x3(),vJ=(D,u)=>D.sort((_,F)=>TJ(_,F,u));v7.exports=vJ});var S7=G((xH,N7)=>{var RJ=x3(),NJ=(D,u)=>D.sort((_,F)=>RJ(F,_,u));N7.exports=NJ});var d2=G((WH,E7)=>{var SJ=VD(),EJ=(D,u,_)=>SJ(D,u,_)>0;E7.exports=EJ});var W3=G((AH,k7)=>{var kJ=VD(),yJ=(D,u,_)=>kJ(D,u,_)<0;k7.exports=yJ});var a6=G((zH,y7)=>{var hJ=VD(),bJ=(D,u,_)=>hJ(D,u,_)===0;y7.exports=bJ});var n6=G((LH,h7)=>{var gJ=VD(),mJ=(D,u,_)=>gJ(D,u,_)!==0;h7.exports=mJ});var A3=G((UH,b7)=>{var fJ=VD(),dJ=(D,u,_)=>fJ(D,u,_)>=0;b7.exports=dJ});var z3=G((OH,g7)=>{var lJ=VD(),cJ=(D,u,_)=>lJ(D,u,_)<=0;g7.exports=cJ});var s6=G((jH,m7)=>{var pJ=a6(),iJ=n6(),aJ=d2(),nJ=A3(),sJ=W3(),tJ=z3(),oJ=(D,u,_,F)=>{switch(u){case"===":if(typeof D==="object")D=D.version;if(typeof _==="object")_=_.version;return D===_;case"!==":if(typeof D==="object")D=D.version;if(typeof _==="object")_=_.version;return D!==_;case"":case"=":case"==":return pJ(D,_,F);case"!=":return iJ(D,_,F);case">":return aJ(D,_,F);case">=":return nJ(D,_,F);case"<":return sJ(D,_,F);case"<=":return tJ(D,_,F);default:throw TypeError(`Invalid operator: ${u}`)}};m7.exports=oJ});var d7=G((PH,f7)=>{var rJ=l(),eJ=R0(),{safeRe:L3,t:U3}=F2(),DV=(D,u)=>{if(D instanceof rJ)return D;if(typeof D==="number")D=String(D);if(typeof D!=="string")return null;u=u||{};let _=null;if(!u.rtl)_=D.match(u.includePrerelease?L3[U3.COERCEFULL]:L3[U3.COERCE]);else{let J=u.includePrerelease?L3[U3.COERCERTLFULL]:L3[U3.COERCERTL],Z;while((Z=J.exec(D))&&(!_||_.index+_[0].length!==D.length)){if(!_||Z.index+Z[0].length!==_.index+_[0].length)_=Z;J.lastIndex=Z.index+Z[1].length+Z[2].length}J.lastIndex=-1}if(_===null)return null;let F=_[2],q=_[3]||"0",C=_[4]||"0",$=u.includePrerelease&&_[5]?`-${_[5]}`:"",Q=u.includePrerelease&&_[6]?`+${_[6]}`:"";return eJ(`${F}.${q}.${C}${$}${Q}`,u)};f7.exports=DV});var p7=G((IH,c7)=>{class l7{constructor(){this.max=1000,this.map=new Map}get(D){let u=this.map.get(D);if(u===void 0)return;else return this.map.delete(D),this.map.set(D,u),u}delete(D){return this.map.delete(D)}set(D,u){if(!this.delete(D)&&u!==void 0){if(this.map.size>=this.max){let F=this.map.keys().next().value;this.delete(F)}this.map.set(D,u)}return this}}c7.exports=l7});var ZD=G((wH,s7)=>{var uV=/\s+/g;class l2{constructor(D,u){if(u=FV(u),D instanceof l2)if(D.loose===!!u.loose&&D.includePrerelease===!!u.includePrerelease)return D;else return new l2(D.raw,u);if(D instanceof t6)return this.raw=D.value,this.set=[[D]],this.formatted=void 0,this;if(this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease,this.raw=D.trim().replace(uV," "),this.set=this.raw.split("||").map((_)=>this.parseRange(_.trim())).filter((_)=>_.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let _=this.set[0];if(this.set=this.set.filter((F)=>!a7(F[0])),this.set.length===0)this.set=[_];else if(this.set.length>1){for(let F of this.set)if(F.length===1&&ZV(F[0])){this.set=[F];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let D=0;D<this.set.length;D++){if(D>0)this.formatted+="||";let u=this.set[D];for(let _=0;_<u.length;_++){if(_>0)this.formatted+=" ";this.formatted+=u[_].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(D){let _=((this.options.includePrerelease&&JV)|(this.options.loose&&VV))+":"+D,F=i7.get(_);if(F)return F;let q=this.options.loose,C=q?r[n.HYPHENRANGELOOSE]:r[n.HYPHENRANGE];D=D.replace(C,zV(this.options.includePrerelease)),S("hyphen replace",D),D=D.replace(r[n.COMPARATORTRIM],CV),S("comparator trim",D),D=D.replace(r[n.TILDETRIM],$V),S("tilde trim",D),D=D.replace(r[n.CARETTRIM],QV),S("caret trim",D);let $=D.split(" ").map((V)=>KV(V,this.options)).join(" ").split(/\s+/).map((V)=>AV(V,this.options));if(q)$=$.filter((V)=>{return S("loose invalid filter",V,this.options),!!V.match(r[n.COMPARATORLOOSE])});S("range list",$);let Q=new Map,J=$.map((V)=>new t6(V,this.options));for(let V of J){if(a7(V))return[V];Q.set(V.value,V)}if(Q.size>1&&Q.has(""))Q.delete("");let Z=[...Q.values()];return i7.set(_,Z),Z}intersects(D,u){if(!(D instanceof l2))throw TypeError("a Range is required");return this.set.some((_)=>{return n7(_,u)&&D.set.some((F)=>{return n7(F,u)&&_.every((q)=>{return F.every((C)=>{return q.intersects(C,u)})})})})}test(D){if(!D)return!1;if(typeof D==="string")try{D=new qV(D,this.options)}catch(u){return!1}for(let u=0;u<this.set.length;u++)if(LV(this.set[u],D,this.options))return!0;return!1}}s7.exports=l2;var _V=p7(),i7=new _V,FV=X3(),t6=c2(),S=f2(),qV=l(),{safeRe:r,t:n,comparatorTrimReplace:CV,tildeTrimReplace:$V,caretTrimReplace:QV}=F2(),{FLAG_INCLUDE_PRERELEASE:JV,FLAG_LOOSE:VV}=m2(),a7=(D)=>D.value==="<0.0.0-0",ZV=(D)=>D.value==="",n7=(D,u)=>{let _=!0,F=D.slice(),q=F.pop();while(_&&F.length)_=F.every((C)=>{return q.intersects(C,u)}),q=F.pop();return _},KV=(D,u)=>{return S("comp",D,u),D=GV(D,u),S("caret",D),D=XV(D,u),S("tildes",D),D=HV(D,u),S("xrange",D),D=WV(D,u),S("stars",D),D},s=(D)=>!D||D.toLowerCase()==="x"||D==="*",XV=(D,u)=>{return D.trim().split(/\s+/).map((_)=>BV(_,u)).join(" ")},BV=(D,u)=>{let _=u.loose?r[n.TILDELOOSE]:r[n.TILDE];return D.replace(_,(F,q,C,$,Q)=>{S("tilde",D,F,q,C,$,Q);let J;if(s(q))J="";else if(s(C))J=`>=${q}.0.0 <${+q+1}.0.0-0`;else if(s($))J=`>=${q}.${C}.0 <${q}.${+C+1}.0-0`;else if(Q)S("replaceTilde pr",Q),J=`>=${q}.${C}.${$}-${Q} <${q}.${+C+1}.0-0`;else J=`>=${q}.${C}.${$} <${q}.${+C+1}.0-0`;return S("tilde return",J),J})},GV=(D,u)=>{return D.trim().split(/\s+/).map((_)=>YV(_,u)).join(" ")},YV=(D,u)=>{S("caret",D,u);let _=u.loose?r[n.CARETLOOSE]:r[n.CARET],F=u.includePrerelease?"-0":"";return D.replace(_,(q,C,$,Q,J)=>{S("caret",D,q,C,$,Q,J);let Z;if(s(C))Z="";else if(s($))Z=`>=${C}.0.0${F} <${+C+1}.0.0-0`;else if(s(Q))if(C==="0")Z=`>=${C}.${$}.0${F} <${C}.${+$+1}.0-0`;else Z=`>=${C}.${$}.0${F} <${+C+1}.0.0-0`;else if(J)if(S("replaceCaret pr",J),C==="0")if($==="0")Z=`>=${C}.${$}.${Q}-${J} <${C}.${$}.${+Q+1}-0`;else Z=`>=${C}.${$}.${Q}-${J} <${C}.${+$+1}.0-0`;else Z=`>=${C}.${$}.${Q}-${J} <${+C+1}.0.0-0`;else if(S("no pr"),C==="0")if($==="0")Z=`>=${C}.${$}.${Q}${F} <${C}.${$}.${+Q+1}-0`;else Z=`>=${C}.${$}.${Q}${F} <${C}.${+$+1}.0-0`;else Z=`>=${C}.${$}.${Q} <${+C+1}.0.0-0`;return S("caret return",Z),Z})},HV=(D,u)=>{return S("replaceXRanges",D,u),D.split(/\s+/).map((_)=>xV(_,u)).join(" ")},xV=(D,u)=>{D=D.trim();let _=u.loose?r[n.XRANGELOOSE]:r[n.XRANGE];return D.replace(_,(F,q,C,$,Q,J)=>{S("xRange",D,F,q,C,$,Q,J);let Z=s(C),V=Z||s($),K=V||s(Q),X=K;if(q==="="&&X)q="";if(J=u.includePrerelease?"-0":"",Z)if(q===">"||q==="<")F="<0.0.0-0";else F="*";else if(q&&X){if(V)$=0;if(Q=0,q===">")if(q=">=",V)C=+C+1,$=0,Q=0;else $=+$+1,Q=0;else if(q==="<=")if(q="<",V)C=+C+1;else $=+$+1;if(q==="<")J="-0";F=`${q+C}.${$}.${Q}${J}`}else if(V)F=`>=${C}.0.0${J} <${+C+1}.0.0-0`;else if(K)F=`>=${C}.${$}.0${J} <${C}.${+$+1}.0-0`;return S("xRange return",F),F})},WV=(D,u)=>{return S("replaceStars",D,u),D.trim().replace(r[n.STAR],"")},AV=(D,u)=>{return S("replaceGTE0",D,u),D.trim().replace(r[u.includePrerelease?n.GTE0PRE:n.GTE0],"")},zV=(D)=>(u,_,F,q,C,$,Q,J,Z,V,K,X)=>{if(s(F))_="";else if(s(q))_=`>=${F}.0.0${D?"-0":""}`;else if(s(C))_=`>=${F}.${q}.0${D?"-0":""}`;else if($)_=`>=${_}`;else _=`>=${_}${D?"-0":""}`;if(s(Z))J="";else if(s(V))J=`<${+Z+1}.0.0-0`;else if(s(K))J=`<${Z}.${+V+1}.0-0`;else if(X)J=`<=${Z}.${V}.${K}-${X}`;else if(D)J=`<${Z}.${V}.${+K+1}-0`;else J=`<=${J}`;return`${_} ${J}`.trim()},LV=(D,u,_)=>{for(let F=0;F<D.length;F++)if(!D[F].test(u))return!1;if(u.prerelease.length&&!_.includePrerelease){for(let F=0;F<D.length;F++){if(S(D[F].semver),D[F].semver===t6.ANY)continue;if(D[F].semver.prerelease.length>0){let q=D[F].semver;if(q.major===u.major&&q.minor===u.minor&&q.patch===u.patch)return!0}}return!1}return!0}});var c2=G((MH,u4)=>{var p2=Symbol("SemVer ANY");class O3{static get ANY(){return p2}constructor(D,u){if(u=t7(u),D instanceof O3)if(D.loose===!!u.loose)return D;else D=D.value;if(D=D.trim().split(/\s+/).join(" "),r6("comparator",D,u),this.options=u,this.loose=!!u.loose,this.parse(D),this.semver===p2)this.value="";else this.value=this.operator+this.semver.version;r6("comp",this)}parse(D){let u=this.options.loose?o7[r7.COMPARATORLOOSE]:o7[r7.COMPARATOR],_=D.match(u);if(!_)throw TypeError(`Invalid comparator: ${D}`);if(this.operator=_[1]!==void 0?_[1]:"",this.operator==="=")this.operator="";if(!_[2])this.semver=p2;else this.semver=new e7(_[2],this.options.loose)}toString(){return this.value}test(D){if(r6("Comparator.test",D,this.options.loose),this.semver===p2||D===p2)return!0;if(typeof D==="string")try{D=new e7(D,this.options)}catch(u){return!1}return o6(D,this.operator,this.semver,this.options)}intersects(D,u){if(!(D instanceof O3))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new D4(D.value,u).test(this.value)}else if(D.operator===""){if(D.value==="")return!0;return new D4(this.value,u).test(D.semver)}if(u=t7(u),u.includePrerelease&&(this.value==="<0.0.0-0"||D.value==="<0.0.0-0"))return!1;if(!u.includePrerelease&&(this.value.startsWith("<0.0.0")||D.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&D.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&D.operator.startsWith("<"))return!0;if(this.semver.version===D.semver.version&&this.operator.includes("=")&&D.operator.includes("="))return!0;if(o6(this.semver,"<",D.semver,u)&&this.operator.startsWith(">")&&D.operator.startsWith("<"))return!0;if(o6(this.semver,">",D.semver,u)&&this.operator.startsWith("<")&&D.operator.startsWith(">"))return!0;return!1}}u4.exports=O3;var t7=X3(),{safeRe:o7,t:r7}=F2(),o6=s6(),r6=f2(),e7=l(),D4=ZD()});var i2=G((TH,_4)=>{var UV=ZD(),OV=(D,u,_)=>{try{u=new UV(u,_)}catch(F){return!1}return u.test(D)};_4.exports=OV});var q4=G((vH,F4)=>{var jV=ZD(),PV=(D,u)=>new jV(D,u).set.map((_)=>_.map((F)=>F.value).join(" ").trim().split(" "));F4.exports=PV});var $4=G((RH,C4)=>{var IV=l(),wV=ZD(),MV=(D,u,_)=>{let F=null,q=null,C=null;try{C=new wV(u,_)}catch($){return null}return D.forEach(($)=>{if(C.test($)){if(!F||q.compare($)===-1)F=$,q=new IV(F,_)}}),F};C4.exports=MV});var J4=G((NH,Q4)=>{var TV=l(),vV=ZD(),RV=(D,u,_)=>{let F=null,q=null,C=null;try{C=new vV(u,_)}catch($){return null}return D.forEach(($)=>{if(C.test($)){if(!F||q.compare($)===1)F=$,q=new TV(F,_)}}),F};Q4.exports=RV});var K4=G((SH,Z4)=>{var e6=l(),NV=ZD(),V4=d2(),SV=(D,u)=>{D=new NV(D,u);let _=new e6("0.0.0");if(D.test(_))return _;if(_=new e6("0.0.0-0"),D.test(_))return _;_=null;for(let F=0;F<D.set.length;++F){let q=D.set[F],C=null;if(q.forEach(($)=>{let Q=new e6($.semver.version);switch($.operator){case">":if(Q.prerelease.length===0)Q.patch++;else Q.prerelease.push(0);Q.raw=Q.format();case"":case">=":if(!C||V4(Q,C))C=Q;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${$.operator}`)}}),C&&(!_||V4(_,C)))_=C}if(_&&D.test(_))return _;return null};Z4.exports=SV});var B4=G((EH,X4)=>{var EV=ZD(),kV=(D,u)=>{try{return new EV(D,u).range||"*"}catch(_){return null}};X4.exports=kV});var j3=G((kH,x4)=>{var yV=l(),H4=c2(),{ANY:hV}=H4,bV=ZD(),gV=i2(),G4=d2(),Y4=W3(),mV=z3(),fV=A3(),dV=(D,u,_,F)=>{D=new yV(D,F),u=new bV(u,F);let q,C,$,Q,J;switch(_){case">":q=G4,C=mV,$=Y4,Q=">",J=">=";break;case"<":q=Y4,C=fV,$=G4,Q="<",J="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(gV(D,u,F))return!1;for(let Z=0;Z<u.set.length;++Z){let V=u.set[Z],K=null,X=null;if(V.forEach((B)=>{if(B.semver===hV)B=new H4(">=0.0.0");if(K=K||B,X=X||B,q(B.semver,K.semver,F))K=B;else if($(B.semver,X.semver,F))X=B}),K.operator===Q||K.operator===J)return!1;if((!X.operator||X.operator===Q)&&C(D,X.semver))return!1;else if(X.operator===J&&$(D,X.semver))return!1}return!0};x4.exports=dV});var A4=G((yH,W4)=>{var lV=j3(),cV=(D,u,_)=>lV(D,u,">",_);W4.exports=cV});var L4=G((hH,z4)=>{var pV=j3(),iV=(D,u,_)=>pV(D,u,"<",_);z4.exports=iV});var j4=G((bH,O4)=>{var U4=ZD(),aV=(D,u,_)=>{return D=new U4(D,_),u=new U4(u,_),D.intersects(u,_)};O4.exports=aV});var I4=G((gH,P4)=>{var nV=i2(),sV=VD();P4.exports=(D,u,_)=>{let F=[],q=null,C=null,$=D.sort((V,K)=>sV(V,K,_));for(let V of $)if(nV(V,u,_)){if(C=V,!q)q=V}else{if(C)F.push([q,C]);C=null,q=null}if(q)F.push([q,null]);let Q=[];for(let[V,K]of F)if(V===K)Q.push(V);else if(!K&&V===$[0])Q.push("*");else if(!K)Q.push(`>=${V}`);else if(V===$[0])Q.push(`<=${K}`);else Q.push(`${V} - ${K}`);let J=Q.join(" || "),Z=typeof u.raw==="string"?u.raw:String(u);return J.length<Z.length?J:u}});var N4=G((mH,R4)=>{var w4=ZD(),u1=c2(),{ANY:D1}=u1,a2=i2(),_1=VD(),tV=(D,u,_={})=>{if(D===u)return!0;D=new w4(D,_),u=new w4(u,_);let F=!1;D:for(let q of D.set){for(let C of u.set){let $=rV(q,C,_);if(F=F||$!==null,$)continue D}if(F)return!1}return!0},oV=[new u1(">=0.0.0-0")],M4=[new u1(">=0.0.0")],rV=(D,u,_)=>{if(D===u)return!0;if(D.length===1&&D[0].semver===D1)if(u.length===1&&u[0].semver===D1)return!0;else if(_.includePrerelease)D=oV;else D=M4;if(u.length===1&&u[0].semver===D1)if(_.includePrerelease)return!0;else u=M4;let F=new Set,q,C;for(let B of D)if(B.operator===">"||B.operator===">=")q=T4(q,B,_);else if(B.operator==="<"||B.operator==="<=")C=v4(C,B,_);else F.add(B.semver);if(F.size>1)return null;let $;if(q&&C){if($=_1(q.semver,C.semver,_),$>0)return null;else if($===0&&(q.operator!==">="||C.operator!=="<="))return null}for(let B of F){if(q&&!a2(B,String(q),_))return null;if(C&&!a2(B,String(C),_))return null;for(let L of u)if(!a2(B,String(L),_))return!1;return!0}let Q,J,Z,V,K=C&&!_.includePrerelease&&C.semver.prerelease.length?C.semver:!1,X=q&&!_.includePrerelease&&q.semver.prerelease.length?q.semver:!1;if(K&&K.prerelease.length===1&&C.operator==="<"&&K.prerelease[0]===0)K=!1;for(let B of u){if(V=V||B.operator===">"||B.operator===">=",Z=Z||B.operator==="<"||B.operator==="<=",q){if(X){if(B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===X.major&&B.semver.minor===X.minor&&B.semver.patch===X.patch)X=!1}if(B.operator===">"||B.operator===">="){if(Q=T4(q,B,_),Q===B&&Q!==q)return!1}else if(q.operator===">="&&!a2(q.semver,String(B),_))return!1}if(C){if(K){if(B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===K.major&&B.semver.minor===K.minor&&B.semver.patch===K.patch)K=!1}if(B.operator==="<"||B.operator==="<="){if(J=v4(C,B,_),J===B&&J!==C)return!1}else if(C.operator==="<="&&!a2(C.semver,String(B),_))return!1}if(!B.operator&&(C||q)&&$!==0)return!1}if(q&&Z&&!C&&$!==0)return!1;if(C&&V&&!q&&$!==0)return!1;if(X||K)return!1;return!0},T4=(D,u,_)=>{if(!D)return u;let F=_1(D.semver,u.semver,_);return F>0?D:F<0?u:u.operator===">"&&D.operator===">="?u:D},v4=(D,u,_)=>{if(!D)return u;let F=_1(D.semver,u.semver,_);return F<0?D:F>0?u:u.operator==="<"&&D.operator==="<="?u:D};R4.exports=tV});var y4=G((fH,k4)=>{var F1=F2(),S4=m2(),eV=l(),E4=i6(),DZ=R0(),uZ=C7(),_Z=Q7(),FZ=Z7(),qZ=B7(),CZ=Y7(),$Z=x7(),QZ=A7(),JZ=L7(),VZ=VD(),ZZ=P7(),KZ=w7(),XZ=x3(),BZ=R7(),GZ=S7(),YZ=d2(),HZ=W3(),xZ=a6(),WZ=n6(),AZ=A3(),zZ=z3(),LZ=s6(),UZ=d7(),OZ=c2(),jZ=ZD(),PZ=i2(),IZ=q4(),wZ=$4(),MZ=J4(),TZ=K4(),vZ=B4(),RZ=j3(),NZ=A4(),SZ=L4(),EZ=j4(),kZ=I4(),yZ=N4();k4.exports={parse:DZ,valid:uZ,clean:_Z,inc:FZ,diff:qZ,major:CZ,minor:$Z,patch:QZ,prerelease:JZ,compare:VZ,rcompare:ZZ,compareLoose:KZ,compareBuild:XZ,sort:BZ,rsort:GZ,gt:YZ,lt:HZ,eq:xZ,neq:WZ,gte:AZ,lte:zZ,cmp:LZ,coerce:UZ,Comparator:OZ,Range:jZ,satisfies:PZ,toComparators:IZ,maxSatisfying:wZ,minSatisfying:MZ,minVersion:TZ,validRange:vZ,outside:RZ,gtr:NZ,ltr:SZ,intersects:EZ,simplifyRange:kZ,subset:yZ,SemVer:eV,re:F1.re,src:F1.src,tokens:F1.t,SEMVER_SPEC_VERSION:S4.SEMVER_SPEC_VERSION,RELEASE_TYPES:S4.RELEASE_TYPES,compareIdentifiers:E4.compareIdentifiers,rcompareIdentifiers:E4.rcompareIdentifiers}});import nZ from"child_process";var R5=KD(I3(),1);import v5 from"path";import r$ from"fs";import N5 from"fs/promises";import y2 from"os";import LF from"events";import o from"fs";import{EventEmitter as N3}from"node:events";import H1 from"node:stream";import{StringDecoder as KF}from"node:string_decoder";var X1=typeof process==="object"&&process?process:{stdout:null,stderr:null},XF=(D)=>!!D&&typeof D==="object"&&(D instanceof DD||D instanceof H1||BF(D)||GF(D)),BF=(D)=>!!D&&typeof D==="object"&&D instanceof N3&&typeof D.pipe==="function"&&D.pipe!==H1.Writable.prototype.pipe,GF=(D)=>!!D&&typeof D==="object"&&D instanceof N3&&typeof D.write==="function"&&typeof D.end==="function",RD=Symbol("EOF"),ND=Symbol("maybeEmitEnd"),cD=Symbol("emittedEnd"),r2=Symbol("emittingEnd"),C2=Symbol("emittedError"),e2=Symbol("closed"),B1=Symbol("read"),Du=Symbol("flush"),G1=Symbol("flushChunk"),XD=Symbol("encoding"),S0=Symbol("decoder"),h=Symbol("flowing"),$2=Symbol("paused"),E0=Symbol("resume"),b=Symbol("buffer"),i=Symbol("pipes"),g=Symbol("bufferLength"),w3=Symbol("bufferPush"),uu=Symbol("bufferShift"),f=Symbol("objectMode"),k=Symbol("destroyed"),M3=Symbol("error"),T3=Symbol("emitData"),Y1=Symbol("emitEnd"),v3=Symbol("emitEnd2"),zD=Symbol("async"),R3=Symbol("abort"),_u=Symbol("aborted"),Q2=Symbol("signal"),V0=Symbol("dataListeners"),e=Symbol("discarded"),J2=(D)=>Promise.resolve().then(D),YF=(D)=>D(),HF=(D)=>D==="end"||D==="finish"||D==="prefinish",xF=(D)=>D instanceof ArrayBuffer||!!D&&typeof D==="object"&&D.constructor&&D.constructor.name==="ArrayBuffer"&&D.byteLength>=0,WF=(D)=>!Buffer.isBuffer(D)&&ArrayBuffer.isView(D);class S3{src;dest;opts;ondrain;constructor(D,u,_){this.src=D,this.dest=u,this.opts=_,this.ondrain=()=>D[E0](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(D){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class x1 extends S3{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(D,u,_){super(D,u,_);this.proxyErrors=(F)=>u.emit("error",F),D.on("error",this.proxyErrors)}}var AF=(D)=>!!D.objectMode,zF=(D)=>!D.objectMode&&!!D.encoding&&D.encoding!=="buffer";class DD extends N3{[h]=!1;[$2]=!1;[i]=[];[b]=[];[f];[XD];[zD];[S0];[RD]=!1;[cD]=!1;[r2]=!1;[e2]=!1;[C2]=null;[g]=0;[k]=!1;[Q2];[_u]=!1;[V0]=0;[e]=!1;writable=!0;readable=!0;constructor(...D){let u=D[0]||{};super();if(u.objectMode&&typeof u.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(AF(u))this[f]=!0,this[XD]=null;else if(zF(u))this[XD]=u.encoding,this[f]=!1;else this[f]=!1,this[XD]=null;if(this[zD]=!!u.async,this[S0]=this[XD]?new KF(this[XD]):null,u&&u.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[b]});if(u&&u.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[i]});let{signal:_}=u;if(_)if(this[Q2]=_,_.aborted)this[R3]();else _.addEventListener("abort",()=>this[R3]())}get bufferLength(){return this[g]}get encoding(){return this[XD]}set encoding(D){throw Error("Encoding must be set at instantiation time")}setEncoding(D){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[f]}set objectMode(D){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[zD]}set["async"](D){this[zD]=this[zD]||!!D}[R3](){this[_u]=!0,this.emit("abort",this[Q2]?.reason),this.destroy(this[Q2]?.reason)}get aborted(){return this[_u]}set aborted(D){}write(D,u,_){if(this[_u])return!1;if(this[RD])throw Error("write after end");if(this[k])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof u==="function")_=u,u="utf8";if(!u)u="utf8";let F=this[zD]?J2:YF;if(!this[f]&&!Buffer.isBuffer(D)){if(WF(D))D=Buffer.from(D.buffer,D.byteOffset,D.byteLength);else if(xF(D))D=Buffer.from(D);else if(typeof D!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[f]){if(this[h]&&this[g]!==0)this[Du](!0);if(this[h])this.emit("data",D);else this[w3](D);if(this[g]!==0)this.emit("readable");if(_)F(_);return this[h]}if(!D.length){if(this[g]!==0)this.emit("readable");if(_)F(_);return this[h]}if(typeof D==="string"&&!(u===this[XD]&&!this[S0]?.lastNeed))D=Buffer.from(D,u);if(Buffer.isBuffer(D)&&this[XD])D=this[S0].write(D);if(this[h]&&this[g]!==0)this[Du](!0);if(this[h])this.emit("data",D);else this[w3](D);if(this[g]!==0)this.emit("readable");if(_)F(_);return this[h]}read(D){if(this[k])return null;if(this[e]=!1,this[g]===0||D===0||D&&D>this[g])return this[ND](),null;if(this[f])D=null;if(this[b].length>1&&!this[f])this[b]=[this[XD]?this[b].join(""):Buffer.concat(this[b],this[g])];let u=this[B1](D||null,this[b][0]);return this[ND](),u}[B1](D,u){if(this[f])this[uu]();else{let _=u;if(D===_.length||D===null)this[uu]();else if(typeof _==="string")this[b][0]=_.slice(D),u=_.slice(0,D),this[g]-=D;else this[b][0]=_.subarray(D),u=_.subarray(0,D),this[g]-=D}if(this.emit("data",u),!this[b].length&&!this[RD])this.emit("drain");return u}end(D,u,_){if(typeof D==="function")_=D,D=void 0;if(typeof u==="function")_=u,u="utf8";if(D!==void 0)this.write(D,u);if(_)this.once("end",_);if(this[RD]=!0,this.writable=!1,this[h]||!this[$2])this[ND]();return this}[E0](){if(this[k])return;if(!this[V0]&&!this[i].length)this[e]=!0;if(this[$2]=!1,this[h]=!0,this.emit("resume"),this[b].length)this[Du]();else if(this[RD])this[ND]();else this.emit("drain")}resume(){return this[E0]()}pause(){this[h]=!1,this[$2]=!0,this[e]=!1}get destroyed(){return this[k]}get flowing(){return this[h]}get paused(){return this[$2]}[w3](D){if(this[f])this[g]+=1;else this[g]+=D.length;this[b].push(D)}[uu](){if(this[f])this[g]-=1;else this[g]-=this[b][0].length;return this[b].shift()}[Du](D=!1){do;while(this[G1](this[uu]())&&this[b].length);if(!D&&!this[b].length&&!this[RD])this.emit("drain")}[G1](D){return this.emit("data",D),this[h]}pipe(D,u){if(this[k])return D;this[e]=!1;let _=this[cD];if(u=u||{},D===X1.stdout||D===X1.stderr)u.end=!1;else u.end=u.end!==!1;if(u.proxyErrors=!!u.proxyErrors,_){if(u.end)D.end()}else if(this[i].push(!u.proxyErrors?new S3(this,D,u):new x1(this,D,u)),this[zD])J2(()=>this[E0]());else this[E0]();return D}unpipe(D){let u=this[i].find((_)=>_.dest===D);if(u){if(this[i].length===1){if(this[h]&&this[V0]===0)this[h]=!1;this[i]=[]}else this[i].splice(this[i].indexOf(u),1);u.unpipe()}}addListener(D,u){return this.on(D,u)}on(D,u){let _=super.on(D,u);if(D==="data"){if(this[e]=!1,this[V0]++,!this[i].length&&!this[h])this[E0]()}else if(D==="readable"&&this[g]!==0)super.emit("readable");else if(HF(D)&&this[cD])super.emit(D),this.removeAllListeners(D);else if(D==="error"&&this[C2]){let F=u;if(this[zD])J2(()=>F.call(this,this[C2]));else F.call(this,this[C2])}return _}removeListener(D,u){return this.off(D,u)}off(D,u){let _=super.off(D,u);if(D==="data"){if(this[V0]=this.listeners("data").length,this[V0]===0&&!this[e]&&!this[i].length)this[h]=!1}return _}removeAllListeners(D){let u=super.removeAllListeners(D);if(D==="data"||D===void 0){if(this[V0]=0,!this[e]&&!this[i].length)this[h]=!1}return u}get emittedEnd(){return this[cD]}[ND](){if(!this[r2]&&!this[cD]&&!this[k]&&this[b].length===0&&this[RD]){if(this[r2]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[e2])this.emit("close");this[r2]=!1}}emit(D,...u){let _=u[0];if(D!=="error"&&D!=="close"&&D!==k&&this[k])return!1;else if(D==="data")return!this[f]&&!_?!1:this[zD]?(J2(()=>this[T3](_)),!0):this[T3](_);else if(D==="end")return this[Y1]();else if(D==="close"){if(this[e2]=!0,!this[cD]&&!this[k])return!1;let q=super.emit("close");return this.removeAllListeners("close"),q}else if(D==="error"){this[C2]=_,super.emit(M3,_);let q=!this[Q2]||this.listeners("error").length?super.emit("error",_):!1;return this[ND](),q}else if(D==="resume"){let q=super.emit("resume");return this[ND](),q}else if(D==="finish"||D==="prefinish"){let q=super.emit(D);return this.removeAllListeners(D),q}let F=super.emit(D,...u);return this[ND](),F}[T3](D){for(let _ of this[i])if(_.dest.write(D)===!1)this.pause();let u=this[e]?!1:super.emit("data",D);return this[ND](),u}[Y1](){if(this[cD])return!1;return this[cD]=!0,this.readable=!1,this[zD]?(J2(()=>this[v3]()),!0):this[v3]()}[v3](){if(this[S0]){let u=this[S0].end();if(u){for(let _ of this[i])_.dest.write(u);if(!this[e])super.emit("data",u)}}for(let u of this[i])u.end();let D=super.emit("end");return this.removeAllListeners("end"),D}async collect(){let D=Object.assign([],{dataLength:0});if(!this[f])D.dataLength=0;let u=this.promise();return this.on("data",(_)=>{if(D.push(_),!this[f])D.dataLength+=_.length}),await u,D}async concat(){if(this[f])throw Error("cannot concat in objectMode");let D=await this.collect();return this[XD]?D.join(""):Buffer.concat(D,D.dataLength)}async promise(){return new Promise((D,u)=>{this.on(k,()=>u(Error("stream destroyed"))),this.on("error",(_)=>u(_)),this.on("end",()=>D())})}[Symbol.asyncIterator](){this[e]=!1;let D=!1,u=async()=>{return this.pause(),D=!0,{value:void 0,done:!0}};return{next:()=>{if(D)return u();let F=this.read();if(F!==null)return Promise.resolve({done:!1,value:F});if(this[RD])return u();let q,C,$=(V)=>{this.off("data",Q),this.off("end",J),this.off(k,Z),u(),C(V)},Q=(V)=>{this.off("error",$),this.off("end",J),this.off(k,Z),this.pause(),q({value:V,done:!!this[RD]})},J=()=>{this.off("error",$),this.off("data",Q),this.off(k,Z),u(),q({done:!0,value:void 0})},Z=()=>$(Error("stream destroyed"));return new Promise((V,K)=>{C=K,q=V,this.once(k,Z),this.once("error",$),this.once("end",J),this.once("data",Q)})},throw:u,return:u,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[e]=!1;let D=!1,u=()=>{return this.pause(),this.off(M3,u),this.off(k,u),this.off("end",u),D=!0,{done:!0,value:void 0}},_=()=>{if(D)return u();let F=this.read();return F===null?u():{done:!1,value:F}};return this.once("end",u),this.once(M3,u),this.once(k,u),{next:_,throw:u,return:u,[Symbol.iterator](){return this}}}destroy(D){if(this[k]){if(D)this.emit("error",D);else this.emit(k);return this}this[k]=!0,this[e]=!0,this[b].length=0,this[g]=0;let u=this;if(typeof u.close==="function"&&!this[e2])u.close();if(D)this.emit("error",D);else this.emit(k);return this}static get isStream(){return XF}}var UF=o.writev,iD=Symbol("_autoClose"),GD=Symbol("_close"),V2=Symbol("_ended"),v=Symbol("_fd"),E3=Symbol("_finished"),ED=Symbol("_flags"),k3=Symbol("_flush"),g3=Symbol("_handleChunk"),m3=Symbol("_makeBuf"),K2=Symbol("_mode"),Fu=Symbol("_needDrain"),h0=Symbol("_onerror"),b0=Symbol("_onopen"),y3=Symbol("_onread"),k0=Symbol("_onwrite"),aD=Symbol("_open"),BD=Symbol("_path"),pD=Symbol("_pos"),LD=Symbol("_queue"),y0=Symbol("_read"),h3=Symbol("_readSize"),SD=Symbol("_reading"),Z2=Symbol("_remain"),b3=Symbol("_size"),qu=Symbol("_write"),Z0=Symbol("_writing"),Cu=Symbol("_defaultFlag"),K0=Symbol("_errored");class g0 extends DD{[K0]=!1;[v];[BD];[h3];[SD]=!1;[b3];[Z2];[iD];constructor(D,u){u=u||{};super(u);if(this.readable=!0,this.writable=!1,typeof D!=="string")throw TypeError("path must be a string");if(this[K0]=!1,this[v]=typeof u.fd==="number"?u.fd:void 0,this[BD]=D,this[h3]=u.readSize||16777216,this[SD]=!1,this[b3]=typeof u.size==="number"?u.size:1/0,this[Z2]=this[b3],this[iD]=typeof u.autoClose==="boolean"?u.autoClose:!0,typeof this[v]==="number")this[y0]();else this[aD]()}get fd(){return this[v]}get path(){return this[BD]}write(){throw TypeError("this is a readable stream")}end(){throw TypeError("this is a readable stream")}[aD](){o.open(this[BD],"r",(D,u)=>this[b0](D,u))}[b0](D,u){if(D)this[h0](D);else this[v]=u,this.emit("open",u),this[y0]()}[m3](){return Buffer.allocUnsafe(Math.min(this[h3],this[Z2]))}[y0](){if(!this[SD]){this[SD]=!0;let D=this[m3]();if(D.length===0)return process.nextTick(()=>this[y3](null,0,D));o.read(this[v],D,0,D.length,null,(u,_,F)=>this[y3](u,_,F))}}[y3](D,u,_){if(this[SD]=!1,D)this[h0](D);else if(this[g3](u,_))this[y0]()}[GD](){if(this[iD]&&typeof this[v]==="number"){let D=this[v];this[v]=void 0,o.close(D,(u)=>u?this.emit("error",u):this.emit("close"))}}[h0](D){this[SD]=!0,this[GD](),this.emit("error",D)}[g3](D,u){let _=!1;if(this[Z2]-=D,D>0)_=super.write(D<u.length?u.subarray(0,D):u);if(D===0||this[Z2]<=0)_=!1,this[GD](),super.end();return _}emit(D,...u){switch(D){case"prefinish":case"finish":return!1;case"drain":if(typeof this[v]==="number")this[y0]();return!1;case"error":if(this[K0])return!1;return this[K0]=!0,super.emit(D,...u);default:return super.emit(D,...u)}}}class f3 extends g0{[aD](){let D=!0;try{this[b0](null,o.openSync(this[BD],"r")),D=!1}finally{if(D)this[GD]()}}[y0](){let D=!0;try{if(!this[SD]){this[SD]=!0;do{let u=this[m3](),_=u.length===0?0:o.readSync(this[v],u,0,u.length,null);if(!this[g3](_,u))break}while(!0);this[SD]=!1}D=!1}finally{if(D)this[GD]()}}[GD](){if(this[iD]&&typeof this[v]==="number"){let D=this[v];this[v]=void 0,o.closeSync(D),this.emit("close")}}}class nD extends LF{readable=!1;writable=!0;[K0]=!1;[Z0]=!1;[V2]=!1;[LD]=[];[Fu]=!1;[BD];[K2];[iD];[v];[Cu];[ED];[E3]=!1;[pD];constructor(D,u){u=u||{};super(u);this[BD]=D,this[v]=typeof u.fd==="number"?u.fd:void 0,this[K2]=u.mode===void 0?438:u.mode,this[pD]=typeof u.start==="number"?u.start:void 0,this[iD]=typeof u.autoClose==="boolean"?u.autoClose:!0;let _=this[pD]!==void 0?"r+":"w";if(this[Cu]=u.flags===void 0,this[ED]=u.flags===void 0?_:u.flags,this[v]===void 0)this[aD]()}emit(D,...u){if(D==="error"){if(this[K0])return!1;this[K0]=!0}return super.emit(D,...u)}get fd(){return this[v]}get path(){return this[BD]}[h0](D){this[GD](),this[Z0]=!0,this.emit("error",D)}[aD](){o.open(this[BD],this[ED],this[K2],(D,u)=>this[b0](D,u))}[b0](D,u){if(this[Cu]&&this[ED]==="r+"&&D&&D.code==="ENOENT")this[ED]="w",this[aD]();else if(D)this[h0](D);else if(this[v]=u,this.emit("open",u),!this[Z0])this[k3]()}end(D,u){if(D)this.write(D,u);if(this[V2]=!0,!this[Z0]&&!this[LD].length&&typeof this[v]==="number")this[k0](null,0);return this}write(D,u){if(typeof D==="string")D=Buffer.from(D,u);if(this[V2])return this.emit("error",Error("write() after end()")),!1;if(this[v]===void 0||this[Z0]||this[LD].length)return this[LD].push(D),this[Fu]=!0,!1;return this[Z0]=!0,this[qu](D),!0}[qu](D){o.write(this[v],D,0,D.length,this[pD],(u,_)=>this[k0](u,_))}[k0](D,u){if(D)this[h0](D);else{if(this[pD]!==void 0&&typeof u==="number")this[pD]+=u;if(this[LD].length)this[k3]();else if(this[Z0]=!1,this[V2]&&!this[E3])this[E3]=!0,this[GD](),this.emit("finish");else if(this[Fu])this[Fu]=!1,this.emit("drain")}}[k3](){if(this[LD].length===0){if(this[V2])this[k0](null,0)}else if(this[LD].length===1)this[qu](this[LD].pop());else{let D=this[LD];this[LD]=[],UF(this[v],D,this[pD],(u,_)=>this[k0](u,_))}}[GD](){if(this[iD]&&typeof this[v]==="number"){let D=this[v];this[v]=void 0,o.close(D,(u)=>u?this.emit("error",u):this.emit("close"))}}}class X2 extends nD{[aD](){let D;if(this[Cu]&&this[ED]==="r+")try{D=o.openSync(this[BD],this[ED],this[K2])}catch(u){if(u?.code==="ENOENT")return this[ED]="w",this[aD]();else throw u}else D=o.openSync(this[BD],this[ED],this[K2]);this[b0](null,D)}[GD](){if(this[iD]&&typeof this[v]==="number"){let D=this[v];this[v]=void 0,o.closeSync(D),this.emit("close")}}[qu](D){let u=!0;try{this[k0](null,o.writeSync(this[v],D,0,D.length,this[pD])),u=!1}finally{if(u)try{this[GD]()}catch{}}}}import o1 from"node:path";import d0 from"node:fs";import{dirname as eF,parse as Dq}from"path";var OF=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),W1=(D)=>!!D.sync&&!!D.file,A1=(D)=>!D.sync&&!!D.file,z1=(D)=>!!D.sync&&!D.file,L1=(D)=>!D.sync&&!D.file;var U1=(D)=>!!D.file;var jF=(D)=>{let u=OF.get(D);if(u)return u;return D},B2=(D={})=>{if(!D)return{};let u={};for(let[_,F]of Object.entries(D)){let q=jF(_);u[q]=F}if(u.chmod===void 0&&u.noChmod===!1)u.chmod=!0;return delete u.noChmod,u};var UD=(D,u,_,F,q)=>{return Object.assign((C=[],$,Q)=>{if(Array.isArray(C))$=C,C={};if(typeof $==="function")Q=$,$=void 0;if(!$)$=[];else $=Array.from($);let J=B2(C);if(q?.(J,$),W1(J)){if(typeof Q==="function")throw TypeError("callback not supported for sync tar functions");return D(J,$)}else if(A1(J)){let Z=u(J,$),V=Q?Q:void 0;return V?Z.then(()=>V(),V):Z}else if(z1(J)){if(typeof Q==="function")throw TypeError("callback not supported for sync tar functions");return _(J,$)}else if(L1(J)){if(typeof Q==="function")throw TypeError("callback only supported with file option");return F(J,$)}else throw Error("impossible options??")},{syncFile:D,asyncFile:u,syncNoFile:_,asyncNoFile:F,validate:q})};import{EventEmitter as sF}from"events";import p3 from"assert";import{Buffer as X0}from"buffer";import*as O1 from"zlib";import PF from"zlib";var IF=PF.constants||{ZLIB_VERNUM:4736},qD=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},IF));var wF=X0.concat,j1=Object.getOwnPropertyDescriptor(X0,"concat"),MF=(D)=>D,l3=j1?.writable===!0||j1?.set!==void 0?(D)=>{X0.concat=D?MF:wF}:(D)=>{},B0=Symbol("_superWrite");class G2 extends Error{code;errno;constructor(D,u){super("zlib: "+D.message,{cause:D});if(this.code=D.code,this.errno=D.errno,!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+D.message,Error.captureStackTrace(this,u??this.constructor)}get name(){return"ZlibError"}}var c3=Symbol("flushFlag");class $u extends DD{#D=!1;#_=!1;#u;#$;#C;#F;#q;get sawError(){return this.#D}get handle(){return this.#F}get flushFlag(){return this.#u}constructor(D,u){if(!D||typeof D!=="object")throw TypeError("invalid options for ZlibBase constructor");super(D);if(this.#u=D.flush??0,this.#$=D.finishFlush??0,this.#C=D.fullFlushFlag??0,typeof O1[u]!=="function")throw TypeError("Compression method not supported: "+u);try{this.#F=new O1[u](D)}catch(_){throw new G2(_,this.constructor)}this.#q=(_)=>{if(this.#D)return;this.#D=!0,this.close(),this.emit("error",_)},this.#F?.on("error",(_)=>this.#q(new G2(_))),this.once("end",()=>this.close)}close(){if(this.#F)this.#F.close(),this.#F=void 0,this.emit("close")}reset(){if(!this.#D)return p3(this.#F,"zlib binding closed"),this.#F.reset?.()}flush(D){if(this.ended)return;if(typeof D!=="number")D=this.#C;this.write(Object.assign(X0.alloc(0),{[c3]:D}))}end(D,u,_){if(typeof D==="function")_=D,u=void 0,D=void 0;if(typeof u==="function")_=u,u=void 0;if(D)if(u)this.write(D,u);else this.write(D);return this.flush(this.#$),this.#_=!0,super.end(_)}get ended(){return this.#_}[B0](D){return super.write(D)}write(D,u,_){if(typeof u==="function")_=u,u="utf8";if(typeof D==="string")D=X0.from(D,u);if(this.#D)return;p3(this.#F,"zlib binding closed");let F=this.#F._handle,q=F.close;F.close=()=>{};let C=this.#F.close;this.#F.close=()=>{},l3(!0);let $=void 0;try{let J=typeof D[c3]==="number"?D[c3]:this.#u;$=this.#F._processChunk(D,J),l3(!1)}catch(J){l3(!1),this.#q(new G2(J,this.write))}finally{if(this.#F)this.#F._handle=F,F.close=q,this.#F.close=C,this.#F.removeAllListeners("error")}if(this.#F)this.#F.on("error",(J)=>this.#q(new G2(J,this.write)));let Q;if($)if(Array.isArray($)&&$.length>0){let J=$[0];Q=this[B0](X0.from(J));for(let Z=1;Z<$.length;Z++)Q=this[B0]($[Z])}else Q=this[B0](X0.from($));if(_)_();return Q}}class i3 extends $u{#D;#_;constructor(D,u){D=D||{},D.flush=D.flush||qD.Z_NO_FLUSH,D.finishFlush=D.finishFlush||qD.Z_FINISH,D.fullFlushFlag=qD.Z_FULL_FLUSH;super(D,u);this.#D=D.level,this.#_=D.strategy}params(D,u){if(this.sawError)return;if(!this.handle)throw Error("cannot switch params when binding is closed");if(!this.handle.params)throw Error("not supported in this implementation");if(this.#D!==D||this.#_!==u){this.flush(qD.Z_SYNC_FLUSH),p3(this.handle,"zlib binding closed");let _=this.handle.flush;this.handle.flush=(F,q)=>{if(typeof F==="function")q=F,F=this.flushFlag;this.flush(F),q?.()};try{this.handle.params(D,u)}finally{this.handle.flush=_}if(this.handle)this.#D=D,this.#_=u}}}class a3 extends i3{#D;constructor(D){super(D,"Gzip");this.#D=D&&!!D.portable}[B0](D){if(!this.#D)return super[B0](D);return this.#D=!1,D[9]=255,super[B0](D)}}class n3 extends i3{constructor(D){super(D,"Unzip")}}class s3 extends $u{constructor(D,u){D=D||{},D.flush=D.flush||qD.BROTLI_OPERATION_PROCESS,D.finishFlush=D.finishFlush||qD.BROTLI_OPERATION_FINISH,D.fullFlushFlag=qD.BROTLI_OPERATION_FLUSH;super(D,u)}}class t3 extends s3{constructor(D){super(D,"BrotliCompress")}}class o3 extends s3{constructor(D){super(D,"BrotliDecompress")}}class r3 extends $u{constructor(D,u){D=D||{},D.flush=D.flush||qD.ZSTD_e_continue,D.finishFlush=D.finishFlush||qD.ZSTD_e_end,D.fullFlushFlag=qD.ZSTD_e_flush;super(D,u)}}class e3 extends r3{constructor(D){super(D,"ZstdCompress")}}class D8 extends r3{constructor(D){super(D,"ZstdDecompress")}}import{posix as m0}from"node:path";var P1=(D,u)=>{if(!Number.isSafeInteger(D))throw Error("cannot encode number outside of javascript safe integer range");else if(D<0)RF(D,u);else vF(D,u);return u},vF=(D,u)=>{u[0]=128;for(var _=u.length;_>1;_--)u[_-1]=D&255,D=Math.floor(D/256)},RF=(D,u)=>{u[0]=255;var _=!1;D=D*-1;for(var F=u.length;F>1;F--){var q=D&255;if(D=Math.floor(D/256),_)u[F-1]=w1(q);else if(q===0)u[F-1]=0;else _=!0,u[F-1]=M1(q)}},I1=(D)=>{let u=D[0],_=u===128?SF(D.subarray(1,D.length)):u===255?NF(D):null;if(_===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(_))throw Error("parsed number outside of javascript safe integer range");return _},NF=(D)=>{var u=D.length,_=0,F=!1;for(var q=u-1;q>-1;q--){var C=Number(D[q]),$;if(F)$=w1(C);else if(C===0)$=C;else F=!0,$=M1(C);if($!==0)_-=$*Math.pow(256,u-q-1)}return _},SF=(D)=>{var u=D.length,_=0;for(var F=u-1;F>-1;F--){var q=Number(D[F]);if(q!==0)_+=q*Math.pow(256,u-F-1)}return _},w1=(D)=>(255^D)&255,M1=(D)=>(255^D)+1&255;var Qu=(D)=>Ju.has(D);var Ju=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),T1=new Map(Array.from(Ju).map((D)=>[D[1],D[0]]));class CD{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#D="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(D,u=0,_,F){if(Buffer.isBuffer(D))this.decode(D,u||0,_,F);else if(D)this.#_(D)}decode(D,u,_,F){if(!u)u=0;if(!D||!(D.length>=u+512))throw Error("need 512 bytes for header");if(this.path=_?.path??G0(D,u,100),this.mode=_?.mode??F?.mode??sD(D,u+100,8),this.uid=_?.uid??F?.uid??sD(D,u+108,8),this.gid=_?.gid??F?.gid??sD(D,u+116,8),this.size=_?.size??F?.size??sD(D,u+124,12),this.mtime=_?.mtime??F?.mtime??u8(D,u+136,12),this.cksum=sD(D,u+148,12),F)this.#_(F,!0);if(_)this.#_(_);let q=G0(D,u+156,1);if(Qu(q))this.#D=q||"0";if(this.#D==="0"&&this.path.slice(-1)==="/")this.#D="5";if(this.#D==="5")this.size=0;if(this.linkpath=G0(D,u+157,100),D.subarray(u+257,u+265).toString()==="ustar\x0000")if(this.uname=_?.uname??F?.uname??G0(D,u+265,32),this.gname=_?.gname??F?.gname??G0(D,u+297,32),this.devmaj=_?.devmaj??F?.devmaj??sD(D,u+329,8)??0,this.devmin=_?.devmin??F?.devmin??sD(D,u+337,8)??0,D[u+475]!==0){let $=G0(D,u+345,155);this.path=$+"/"+this.path}else{let $=G0(D,u+345,130);if($)this.path=$+"/"+this.path;this.atime=_?.atime??F?.atime??u8(D,u+476,12),this.ctime=_?.ctime??F?.ctime??u8(D,u+488,12)}let C=256;for(let $=u;$<u+148;$++)C+=D[$];for(let $=u+156;$<u+512;$++)C+=D[$];if(this.cksumValid=C===this.cksum,this.cksum===void 0&&C===256)this.nullBlock=!0}#_(D,u=!1){Object.assign(this,Object.fromEntries(Object.entries(D).filter(([_,F])=>{return!(F===null||F===void 0||_==="path"&&u||_==="linkpath"&&u||_==="global")})))}encode(D,u=0){if(!D)D=this.block=Buffer.alloc(512);if(this.#D==="Unsupported")this.#D="0";if(!(D.length>=u+512))throw Error("need 512 bytes for header");let _=this.ctime||this.atime?130:155,F=kF(this.path||"",_),q=F[0],C=F[1];if(this.needPax=!!F[2],this.needPax=Y0(D,u,100,q)||this.needPax,this.needPax=tD(D,u+100,8,this.mode)||this.needPax,this.needPax=tD(D,u+108,8,this.uid)||this.needPax,this.needPax=tD(D,u+116,8,this.gid)||this.needPax,this.needPax=tD(D,u+124,12,this.size)||this.needPax,this.needPax=_8(D,u+136,12,this.mtime)||this.needPax,D[u+156]=this.#D.charCodeAt(0),this.needPax=Y0(D,u+157,100,this.linkpath)||this.needPax,D.write("ustar\x0000",u+257,8),this.needPax=Y0(D,u+265,32,this.uname)||this.needPax,this.needPax=Y0(D,u+297,32,this.gname)||this.needPax,this.needPax=tD(D,u+329,8,this.devmaj)||this.needPax,this.needPax=tD(D,u+337,8,this.devmin)||this.needPax,this.needPax=Y0(D,u+345,_,C)||this.needPax,D[u+475]!==0)this.needPax=Y0(D,u+345,155,C)||this.needPax;else this.needPax=Y0(D,u+345,130,C)||this.needPax,this.needPax=_8(D,u+476,12,this.atime)||this.needPax,this.needPax=_8(D,u+488,12,this.ctime)||this.needPax;let $=256;for(let Q=u;Q<u+148;Q++)$+=D[Q];for(let Q=u+156;Q<u+512;Q++)$+=D[Q];return this.cksum=$,tD(D,u+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#D==="Unsupported"?this.#D:Ju.get(this.#D)}get typeKey(){return this.#D}set type(D){let u=String(T1.get(D));if(Qu(u)||u==="Unsupported")this.#D=u;else if(Qu(D))this.#D=D;else throw TypeError("invalid entry type: "+D)}}var kF=(D,u)=>{let F=D,q="",C=void 0,$=m0.parse(D).root||".";if(Buffer.byteLength(F)<100)C=[F,q,!1];else{q=m0.dirname(F),F=m0.basename(F);do if(Buffer.byteLength(F)<=100&&Buffer.byteLength(q)<=u)C=[F,q,!1];else if(Buffer.byteLength(F)>100&&Buffer.byteLength(q)<=u)C=[F.slice(0,99),q,!0];else F=m0.join(m0.basename(q),F),q=m0.dirname(q);while(q!==$&&C===void 0);if(!C)C=[D.slice(0,99),"",!0]}return C},G0=(D,u,_)=>D.subarray(u,u+_).toString("utf8").replace(/\0.*/,""),u8=(D,u,_)=>yF(sD(D,u,_)),yF=(D)=>D===void 0?void 0:new Date(D*1000),sD=(D,u,_)=>Number(D[u])&128?I1(D.subarray(u,u+_)):bF(D,u,_),hF=(D)=>isNaN(D)?void 0:D,bF=(D,u,_)=>hF(parseInt(D.subarray(u,u+_).toString("utf8").replace(/\0.*$/,"").trim(),8)),gF={12:8589934591,8:2097151},tD=(D,u,_,F)=>F===void 0?!1:F>gF[_]||F<0?(P1(F,D.subarray(u,u+_)),!0):(mF(D,u,_,F),!1),mF=(D,u,_,F)=>D.write(fF(F,_),u,_,"ascii"),fF=(D,u)=>dF(Math.floor(D).toString(8),u),dF=(D,u)=>(D.length===u-1?D:Array(u-D.length-1).join("0")+D+" ")+"\x00",_8=(D,u,_,F)=>F===void 0?!1:tD(D,u,_,F.getTime()/1000),lF=Array(156).join("\x00"),Y0=(D,u,_,F)=>F===void 0?!1:(D.write(F+lF,u,_,"utf8"),F.length!==Buffer.byteLength(F)||F.length>_);import{basename as cF}from"node:path";class oD{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(D,u=!1){this.atime=D.atime,this.charset=D.charset,this.comment=D.comment,this.ctime=D.ctime,this.dev=D.dev,this.gid=D.gid,this.global=u,this.gname=D.gname,this.ino=D.ino,this.linkpath=D.linkpath,this.mtime=D.mtime,this.nlink=D.nlink,this.path=D.path,this.size=D.size,this.uid=D.uid,this.uname=D.uname}encode(){let D=this.encodeBody();if(D==="")return Buffer.allocUnsafe(0);let u=Buffer.byteLength(D),_=512*Math.ceil(1+u/512),F=Buffer.allocUnsafe(_);for(let q=0;q<512;q++)F[q]=0;new CD({path:("PaxHeader/"+cF(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:u,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(F),F.write(D,512,u,"utf8");for(let q=u+512;q<F.length;q++)F[q]=0;return F}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(D){if(this[D]===void 0)return"";let u=this[D],_=u instanceof Date?u.getTime()/1000:u,F=" "+(D==="dev"||D==="ino"||D==="nlink"?"SCHILY.":"")+D+"="+_+`
13
- `,q=Buffer.byteLength(F),C=Math.floor(Math.log(q)/Math.log(10))+1;if(q+C>=Math.pow(10,C))C+=1;return C+q+F}static parse(D,u,_=!1){return new oD(pF(iF(D),u),_)}}var pF=(D,u)=>u?Object.assign({},u,D):D,iF=(D)=>D.replace(/\n$/,"").split(`
14
- `).reduce(aF,Object.create(null)),aF=(D,u)=>{let _=parseInt(u,10);if(_!==Buffer.byteLength(u)+1)return D;u=u.slice((_+" ").length);let F=u.split("="),q=F.shift();if(!q)return D;let C=q.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),$=F.join("=");return D[C]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(C)?new Date(Number($)*1000):/^[0-9]+$/.test($)?+$:$,D};var nF=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,P=nF!=="win32"?(D)=>D:(D)=>D&&D.replace(/\\/g,"/");class Y2 extends DD{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(D,u,_){super({});switch(this.pause(),this.extended=u,this.globalExtended=_,this.header=D,this.remain=D.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=D.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!D.path)throw Error("no path provided for tar.ReadEntry");if(this.path=P(D.path),this.mode=D.mode,this.mode)this.mode=this.mode&4095;if(this.uid=D.uid,this.gid=D.gid,this.uname=D.uname,this.gname=D.gname,this.size=this.remain,this.mtime=D.mtime,this.atime=D.atime,this.ctime=D.ctime,this.linkpath=D.linkpath?P(D.linkpath):void 0,this.uname=D.uname,this.gname=D.gname,u)this.#D(u);if(_)this.#D(_,!0)}write(D){let u=D.length;if(u>this.blockRemain)throw Error("writing more to entry than is appropriate");let _=this.remain,F=this.blockRemain;if(this.remain=Math.max(0,_-u),this.blockRemain=Math.max(0,F-u),this.ignore)return!0;if(_>=u)return super.write(D);return super.write(D.subarray(0,_))}#D(D,u=!1){if(D.path)D.path=P(D.path);if(D.linkpath)D.linkpath=P(D.linkpath);Object.assign(this,Object.fromEntries(Object.entries(D).filter(([_,F])=>{return!(F===null||F===void 0||_==="path"&&u)})))}}var H0=(D,u,_,F={})=>{if(D.file)F.file=D.file;if(D.cwd)F.cwd=D.cwd;if(F.code=_ instanceof Error&&_.code||u,F.tarCode=u,!D.strict&&F.recoverable!==!1){if(_ instanceof Error)F=Object.assign(_,F),_=_.message;D.emit("warn",u,_,F)}else if(_ instanceof Error)D.emit("error",Object.assign(_,F));else D.emit("error",Object.assign(Error(`${u}: ${_}`),F))};var tF=1048576,Q8=Buffer.from([31,139]),J8=Buffer.from([40,181,47,253]),oF=Math.max(Q8.length,J8.length),$D=Symbol("state"),x0=Symbol("writeEntry"),kD=Symbol("readEntry"),F8=Symbol("nextEntry"),R1=Symbol("processEntry"),OD=Symbol("extendedHeader"),H2=Symbol("globalExtendedHeader"),rD=Symbol("meta"),N1=Symbol("emitMeta"),N=Symbol("buffer"),yD=Symbol("queue"),eD=Symbol("ended"),q8=Symbol("emittedEnd"),W0=Symbol("emit"),y=Symbol("unzip"),Vu=Symbol("consumeChunk"),Zu=Symbol("consumeChunkSub"),C8=Symbol("consumeBody"),S1=Symbol("consumeMeta"),E1=Symbol("consumeHeader"),x2=Symbol("consuming"),$8=Symbol("bufferConcat"),Ku=Symbol("maybeEnd"),f0=Symbol("writing"),D0=Symbol("aborted"),Xu=Symbol("onDone"),A0=Symbol("sawValidEntry"),Bu=Symbol("sawNullBlock"),Gu=Symbol("sawEOF"),k1=Symbol("closeStream"),rF=()=>!0;class u0 extends sF{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[yD]=[];[N];[kD];[x0];[$D]="begin";[rD]="";[OD];[H2];[eD]=!1;[y];[D0]=!1;[A0];[Bu]=!1;[Gu]=!1;[f0]=!1;[x2]=!1;[q8]=!1;constructor(D={}){super();if(this.file=D.file||"",this.on(Xu,()=>{if(this[$D]==="begin"||this[A0]===!1)this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),D.ondone)this.on(Xu,D.ondone);else this.on(Xu,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")});this.strict=!!D.strict,this.maxMetaEntrySize=D.maxMetaEntrySize||tF,this.filter=typeof D.filter==="function"?D.filter:rF;let u=D.file&&(D.file.endsWith(".tar.br")||D.file.endsWith(".tbr"));this.brotli=!(D.gzip||D.zstd)&&D.brotli!==void 0?D.brotli:u?void 0:!1;let _=D.file&&(D.file.endsWith(".tar.zst")||D.file.endsWith(".tzst"));if(this.zstd=!(D.gzip||D.brotli)&&D.zstd!==void 0?D.zstd:_?!0:void 0,this.on("end",()=>this[k1]()),typeof D.onwarn==="function")this.on("warn",D.onwarn);if(typeof D.onReadEntry==="function")this.on("entry",D.onReadEntry)}warn(D,u,_={}){H0(this,D,u,_)}[E1](D,u){if(this[A0]===void 0)this[A0]=!1;let _;try{_=new CD(D,u,this[OD],this[H2])}catch(F){return this.warn("TAR_ENTRY_INVALID",F)}if(_.nullBlock)if(this[Bu]){if(this[Gu]=!0,this[$D]==="begin")this[$D]="header";this[W0]("eof")}else this[Bu]=!0,this[W0]("nullBlock");else if(this[Bu]=!1,!_.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:_});else if(!_.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:_});else{let F=_.type;if(/^(Symbolic)?Link$/.test(F)&&!_.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:_});else if(!/^(Symbolic)?Link$/.test(F)&&!/^(Global)?ExtendedHeader$/.test(F)&&_.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:_});else{let q=this[x0]=new Y2(_,this[OD],this[H2]);if(!this[A0])if(q.remain){let C=()=>{if(!q.invalid)this[A0]=!0};q.on("end",C)}else this[A0]=!0;if(q.meta){if(q.size>this.maxMetaEntrySize)q.ignore=!0,this[W0]("ignoredEntry",q),this[$D]="ignore",q.resume();else if(q.size>0)this[rD]="",q.on("data",(C)=>this[rD]+=C),this[$D]="meta"}else if(this[OD]=void 0,q.ignore=q.ignore||!this.filter(q.path,q),q.ignore)this[W0]("ignoredEntry",q),this[$D]=q.remain?"ignore":"header",q.resume();else{if(q.remain)this[$D]="body";else this[$D]="header",q.end();if(!this[kD])this[yD].push(q),this[F8]();else this[yD].push(q)}}}}[k1](){queueMicrotask(()=>this.emit("close"))}[R1](D){let u=!0;if(!D)this[kD]=void 0,u=!1;else if(Array.isArray(D)){let[_,...F]=D;this.emit(_,...F)}else if(this[kD]=D,this.emit("entry",D),!D.emittedEnd)D.on("end",()=>this[F8]()),u=!1;return u}[F8](){do;while(this[R1](this[yD].shift()));if(!this[yD].length){let D=this[kD];if(!D||D.flowing||D.size===D.remain){if(!this[f0])this.emit("drain")}else D.once("drain",()=>this.emit("drain"))}}[C8](D,u){let _=this[x0];if(!_)throw Error("attempt to consume body without entry??");let F=_.blockRemain??0,q=F>=D.length&&u===0?D:D.subarray(u,u+F);if(_.write(q),!_.blockRemain)this[$D]="header",this[x0]=void 0,_.end();return q.length}[S1](D,u){let _=this[x0],F=this[C8](D,u);if(!this[x0]&&_)this[N1](_);return F}[W0](D,u,_){if(!this[yD].length&&!this[kD])this.emit(D,u,_);else this[yD].push([D,u,_])}[N1](D){switch(this[W0]("meta",this[rD]),D.type){case"ExtendedHeader":case"OldExtendedHeader":this[OD]=oD.parse(this[rD],this[OD],!1);break;case"GlobalExtendedHeader":this[H2]=oD.parse(this[rD],this[H2],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let u=this[OD]??Object.create(null);this[OD]=u,u.path=this[rD].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let u=this[OD]||Object.create(null);this[OD]=u,u.linkpath=this[rD].replace(/\0.*/,"");break}default:throw Error("unknown meta: "+D.type)}}abort(D){this[D0]=!0,this.emit("abort",D),this.warn("TAR_ABORT",D,{recoverable:!1})}write(D,u,_){if(typeof u==="function")_=u,u=void 0;if(typeof D==="string")D=Buffer.from(D,typeof u==="string"?u:"utf8");if(this[D0])return _?.(),!1;if((this[y]===void 0||this.brotli===void 0&&this[y]===!1)&&D){if(this[N])D=Buffer.concat([this[N],D]),this[N]=void 0;if(D.length<oF)return this[N]=D,_?.(),!0;for(let Q=0;this[y]===void 0&&Q<Q8.length;Q++)if(D[Q]!==Q8[Q])this[y]=!1;let C=!1;if(this[y]===!1&&this.zstd!==!1){C=!0;for(let Q=0;Q<J8.length;Q++)if(D[Q]!==J8[Q]){C=!1;break}}let $=this.brotli===void 0&&!C;if(this[y]===!1&&$)if(D.length<512)if(this[eD])this.brotli=!0;else return this[N]=D,_?.(),!0;else try{new CD(D.subarray(0,512)),this.brotli=!1}catch(Q){this.brotli=!0}if(this[y]===void 0||this[y]===!1&&(this.brotli||C)){let Q=this[eD];this[eD]=!1,this[y]=this[y]===void 0?new n3({}):C?new D8({}):new o3({}),this[y].on("data",(Z)=>this[Vu](Z)),this[y].on("error",(Z)=>this.abort(Z)),this[y].on("end",()=>{this[eD]=!0,this[Vu]()}),this[f0]=!0;let J=!!this[y][Q?"end":"write"](D);return this[f0]=!1,_?.(),J}}if(this[f0]=!0,this[y])this[y].write(D);else this[Vu](D);this[f0]=!1;let q=this[yD].length?!1:this[kD]?this[kD].flowing:!0;if(!q&&!this[yD].length)this[kD]?.once("drain",()=>this.emit("drain"));return _?.(),q}[$8](D){if(D&&!this[D0])this[N]=this[N]?Buffer.concat([this[N],D]):D}[Ku](){if(this[eD]&&!this[q8]&&!this[D0]&&!this[x2]){this[q8]=!0;let D=this[x0];if(D&&D.blockRemain){let u=this[N]?this[N].length:0;if(this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${D.blockRemain} more bytes, only ${u} available)`,{entry:D}),this[N])D.write(this[N]);D.end()}this[W0](Xu)}}[Vu](D){if(this[x2]&&D)this[$8](D);else if(!D&&!this[N])this[Ku]();else if(D){if(this[x2]=!0,this[N]){this[$8](D);let u=this[N];this[N]=void 0,this[Zu](u)}else this[Zu](D);while(this[N]&&this[N]?.length>=512&&!this[D0]&&!this[Gu]){let u=this[N];this[N]=void 0,this[Zu](u)}this[x2]=!1}if(!this[N]||this[eD])this[Ku]()}[Zu](D){let u=0,_=D.length;while(u+512<=_&&!this[D0]&&!this[Gu])switch(this[$D]){case"begin":case"header":this[E1](D,u),u+=512;break;case"ignore":case"body":u+=this[C8](D,u);break;case"meta":u+=this[S1](D,u);break;default:throw Error("invalid state: "+this[$D])}if(u<_)if(this[N])this[N]=Buffer.concat([D.subarray(u),this[N]]);else this[N]=D.subarray(u)}end(D,u,_){if(typeof D==="function")_=D,u=void 0,D=void 0;if(typeof u==="function")_=u,u=void 0;if(typeof D==="string")D=Buffer.from(D,u);if(_)this.once("finish",_);if(!this[D0])if(this[y]){if(D)this[y].write(D);this[y].end()}else{if(this[eD]=!0,this.brotli===void 0||this.zstd===void 0)D=D||Buffer.alloc(0);if(D)this.write(D);this[Ku]()}return this}}var _0=(D)=>{let u=D.length-1,_=-1;while(u>-1&&D.charAt(u)==="/")_=u,u--;return _===-1?D:D.slice(0,_)};var uq=(D)=>{let u=D.onReadEntry;D.onReadEntry=u?(_)=>{u(_),_.resume()}:(_)=>_.resume()},V8=(D,u)=>{let _=new Map(u.map((C)=>[_0(C),!0])),F=D.filter,q=(C,$="")=>{let Q=$||Dq(C).root||".",J;if(C===Q)J=!1;else{let Z=_.get(C);if(Z!==void 0)J=Z;else J=q(eF(C),Q)}return _.set(C,J),J};D.filter=F?(C,$)=>F(C,$)&&q(_0(C)):(C)=>q(_0(C))},_q=(D)=>{let u=new u0(D),_=D.file,F;try{F=d0.openSync(_,"r");let q=d0.fstatSync(F),C=D.maxReadSize||16777216;if(q.size<C){let $=Buffer.allocUnsafe(q.size),Q=d0.readSync(F,$,0,q.size,0);u.end(Q===$.byteLength?$:$.subarray(0,Q))}else{let $=0,Q=Buffer.allocUnsafe(C);while($<q.size){let J=d0.readSync(F,Q,0,C,$);if(J===0)break;$+=J,u.write(Q.subarray(0,J))}u.end()}}finally{if(typeof F==="number")try{d0.closeSync(F)}catch(q){}}},Fq=(D,u)=>{let _=new u0(D),F=D.maxReadSize||16777216,q=D.file;return new Promise(($,Q)=>{_.on("error",Q),_.on("end",$),d0.stat(q,(J,Z)=>{if(J)Q(J);else{let V=new g0(q,{readSize:F,size:Z.size});V.on("error",Q),V.pipe(_)}})})},z0=UD(_q,Fq,(D)=>new u0(D),(D)=>new u0(D),(D,u)=>{if(u?.length)V8(D,u);if(!D.noResume)uq(D)});import Iu from"fs";import jD from"fs";import g1 from"path";var Z8=(D,u,_)=>{if(D&=4095,_)D=(D|384)&-19;if(u){if(D&256)D|=64;if(D&32)D|=8;if(D&4)D|=1}return D};import{win32 as qq}from"node:path";var{isAbsolute:Cq,parse:y1}=qq,W2=(D)=>{let u="",_=y1(D);while(Cq(D)||_.root){let F=D.charAt(0)==="/"&&D.slice(0,4)!=="//?/"?"/":_.root;D=D.slice(F.length),u+=F,_=y1(D)}return[u,D]};var Yu=["|","<",">","?",":"],K8=Yu.map((D)=>String.fromCharCode(61440+D.charCodeAt(0))),$q=new Map(Yu.map((D,u)=>[D,K8[u]])),Qq=new Map(K8.map((D,u)=>[D,Yu[u]])),X8=(D)=>Yu.reduce((u,_)=>u.split(_).join($q.get(_)),D),h1=(D)=>K8.reduce((u,_)=>u.split(_).join(Qq.get(_)),D);var c1=(D,u)=>{if(!u)return P(D);return D=P(D).replace(/^\.(\/|$)/,""),_0(u)+"/"+D},Jq=16777216,m1=Symbol("process"),f1=Symbol("file"),d1=Symbol("directory"),G8=Symbol("symlink"),l1=Symbol("hardlink"),A2=Symbol("header"),Hu=Symbol("read"),Y8=Symbol("lstat"),xu=Symbol("onlstat"),H8=Symbol("onread"),x8=Symbol("onreadlink"),W8=Symbol("openfile"),A8=Symbol("onopenfile"),F0=Symbol("close"),Wu=Symbol("mode"),z8=Symbol("awaitDrain"),B8=Symbol("ondrain"),PD=Symbol("prefix");class Au extends DD{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#D=!1;constructor(D,u={}){let _=B2(u);super();if(this.path=P(D),this.portable=!!_.portable,this.maxReadSize=_.maxReadSize||Jq,this.linkCache=_.linkCache||new Map,this.statCache=_.statCache||new Map,this.preservePaths=!!_.preservePaths,this.cwd=P(_.cwd||process.cwd()),this.strict=!!_.strict,this.noPax=!!_.noPax,this.noMtime=!!_.noMtime,this.mtime=_.mtime,this.prefix=_.prefix?P(_.prefix):void 0,this.onWriteEntry=_.onWriteEntry,typeof _.onwarn==="function")this.on("warn",_.onwarn);let F=!1;if(!this.preservePaths){let[C,$]=W2(this.path);if(C&&typeof $==="string")this.path=$,F=C}if(this.win32=!!_.win32||process.platform==="win32",this.win32)this.path=h1(this.path.replace(/\\/g,"/")),D=D.replace(/\\/g,"/");if(this.absolute=P(_.absolute||g1.resolve(this.cwd,D)),this.path==="")this.path="./";if(F)this.warn("TAR_ENTRY_INFO",`stripping ${F} from absolute path`,{entry:this,path:F+this.path});let q=this.statCache.get(this.absolute);if(q)this[xu](q);else this[Y8]()}warn(D,u,_={}){return H0(this,D,u,_)}emit(D,...u){if(D==="error")this.#D=!0;return super.emit(D,...u)}[Y8](){jD.lstat(this.absolute,(D,u)=>{if(D)return this.emit("error",D);this[xu](u)})}[xu](D){if(this.statCache.set(this.absolute,D),this.stat=D,!D.isFile())D.size=0;this.type=Vq(D),this.emit("stat",D),this[m1]()}[m1](){switch(this.type){case"File":return this[f1]();case"Directory":return this[d1]();case"SymbolicLink":return this[G8]();default:return this.end()}}[Wu](D){return Z8(D,this.type==="Directory",this.portable)}[PD](D){return c1(D,this.prefix)}[A2](){if(!this.stat)throw Error("cannot write header before stat");if(this.type==="Directory"&&this.portable)this.noMtime=!0;if(this.onWriteEntry?.(this),this.header=new CD({path:this[PD](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[PD](this.linkpath):this.linkpath,mode:this[Wu](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax)super.write(new oD({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[PD](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[PD](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let D=this.header?.block;if(!D)throw Error("failed to encode header");super.write(D)}[d1](){if(!this.stat)throw Error("cannot create directory entry without stat");if(this.path.slice(-1)!=="/")this.path+="/";this.stat.size=0,this[A2](),this.end()}[G8](){jD.readlink(this.absolute,(D,u)=>{if(D)return this.emit("error",D);this[x8](u)})}[x8](D){this.linkpath=P(D),this[A2](),this.end()}[l1](D){if(!this.stat)throw Error("cannot create link entry without stat");this.type="Link",this.linkpath=P(g1.relative(this.cwd,D)),this.stat.size=0,this[A2](),this.end()}[f1](){if(!this.stat)throw Error("cannot create file entry without stat");if(this.stat.nlink>1){let D=`${this.stat.dev}:${this.stat.ino}`,u=this.linkCache.get(D);if(u?.indexOf(this.cwd)===0)return this[l1](u);this.linkCache.set(D,this.absolute)}if(this[A2](),this.stat.size===0)return this.end();this[W8]()}[W8](){jD.open(this.absolute,"r",(D,u)=>{if(D)return this.emit("error",D);this[A8](u)})}[A8](D){if(this.fd=D,this.#D)return this[F0]();if(!this.stat)throw Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let u=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(u),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Hu]()}[Hu](){let{fd:D,buf:u,offset:_,length:F,pos:q}=this;if(D===void 0||u===void 0)throw Error("cannot read file without first opening");jD.read(D,u,_,F,q,(C,$)=>{if(C)return this[F0](()=>this.emit("error",C));this[H8]($)})}[F0](D=()=>{}){if(this.fd!==void 0)jD.close(this.fd,D)}[H8](D){if(D<=0&&this.remain>0){let F=Object.assign(Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[F0](()=>this.emit("error",F))}if(D>this.remain){let F=Object.assign(Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[F0](()=>this.emit("error",F))}if(!this.buf)throw Error("should have created buffer prior to reading");if(D===this.remain)for(let F=D;F<this.length&&D<this.blockRemain;F++)this.buf[F+this.offset]=0,D++,this.remain++;let u=this.offset===0&&D===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+D);if(!this.write(u))this[z8](()=>this[B8]());else this[B8]()}[z8](D){this.once("drain",D)}write(D,u,_){if(typeof u==="function")_=u,u=void 0;if(typeof D==="string")D=Buffer.from(D,typeof u==="string"?u:"utf8");if(this.blockRemain<D.length){let F=Object.assign(Error("writing more data than expected"),{path:this.absolute});return this.emit("error",F)}return this.remain-=D.length,this.blockRemain-=D.length,this.pos+=D.length,this.offset+=D.length,super.write(D,null,_)}[B8](){if(!this.remain){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));return this[F0]((D)=>D?this.emit("error",D):this.end())}if(!this.buf)throw Error("buffer lost somehow in ONDRAIN");if(this.offset>=this.length)this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0;this.length=this.buf.length-this.offset,this[Hu]()}}class L8 extends Au{sync=!0;[Y8](){this[xu](jD.lstatSync(this.absolute))}[G8](){this[x8](jD.readlinkSync(this.absolute))}[W8](){this[A8](jD.openSync(this.absolute,"r"))}[Hu](){let D=!0;try{let{fd:u,buf:_,offset:F,length:q,pos:C}=this;if(u===void 0||_===void 0)throw Error("fd and buf must be set in READ method");let $=jD.readSync(u,_,F,q,C);this[H8]($),D=!1}finally{if(D)try{this[F0](()=>{})}catch(u){}}}[z8](D){D()}[F0](D=()=>{}){if(this.fd!==void 0)jD.closeSync(this.fd);D()}}class U8 extends DD{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(D,u,_={}){return H0(this,D,u,_)}constructor(D,u={}){let _=B2(u);super();this.preservePaths=!!_.preservePaths,this.portable=!!_.portable,this.strict=!!_.strict,this.noPax=!!_.noPax,this.noMtime=!!_.noMtime,this.onWriteEntry=_.onWriteEntry,this.readEntry=D;let{type:F}=D;if(F==="Unsupported")throw Error("writing entry that should be ignored");if(this.type=F,this.type==="Directory"&&this.portable)this.noMtime=!0;if(this.prefix=_.prefix,this.path=P(D.path),this.mode=D.mode!==void 0?this[Wu](D.mode):void 0,this.uid=this.portable?void 0:D.uid,this.gid=this.portable?void 0:D.gid,this.uname=this.portable?void 0:D.uname,this.gname=this.portable?void 0:D.gname,this.size=D.size,this.mtime=this.noMtime?void 0:_.mtime||D.mtime,this.atime=this.portable?void 0:D.atime,this.ctime=this.portable?void 0:D.ctime,this.linkpath=D.linkpath!==void 0?P(D.linkpath):void 0,typeof _.onwarn==="function")this.on("warn",_.onwarn);let q=!1;if(!this.preservePaths){let[$,Q]=W2(this.path);if($&&typeof Q==="string")this.path=Q,q=$}if(this.remain=D.size,this.blockRemain=D.startBlockSize,this.onWriteEntry?.(this),this.header=new CD({path:this[PD](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[PD](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),q)this.warn("TAR_ENTRY_INFO",`stripping ${q} from absolute path`,{entry:this,path:q+this.path});if(this.header.encode()&&!this.noPax)super.write(new oD({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[PD](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[PD](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let C=this.header?.block;if(!C)throw Error("failed to encode header");super.write(C),D.pipe(this)}[PD](D){return c1(D,this.prefix)}[Wu](D){return Z8(D,this.type==="Directory",this.portable)}write(D,u,_){if(typeof u==="function")_=u,u=void 0;if(typeof D==="string")D=Buffer.from(D,typeof u==="string"?u:"utf8");let F=D.length;if(F>this.blockRemain)throw Error("writing more to entry than is appropriate");return this.blockRemain-=F,super.write(D,_)}end(D,u,_){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));if(typeof D==="function")_=D,u=void 0,D=void 0;if(typeof u==="function")_=u,u=void 0;if(typeof D==="string")D=Buffer.from(D,u??"utf8");if(_)this.once("finish",_);return D?super.end(D,_):super.end(_),this}}var Vq=(D)=>D.isFile()?"File":D.isDirectory()?"Directory":D.isSymbolicLink()?"SymbolicLink":"Unsupported";class q0{tail;head;length=0;static create(D=[]){return new q0(D)}constructor(D=[]){for(let u of D)this.push(u)}*[Symbol.iterator](){for(let D=this.head;D;D=D.next)yield D.value}removeNode(D){if(D.list!==this)throw Error("removing node which does not belong to this list");let{next:u,prev:_}=D;if(u)u.prev=_;if(_)_.next=u;if(D===this.head)this.head=u;if(D===this.tail)this.tail=_;return this.length--,D.next=void 0,D.prev=void 0,D.list=void 0,u}unshiftNode(D){if(D===this.head)return;if(D.list)D.list.removeNode(D);let u=this.head;if(D.list=this,D.next=u,u)u.prev=D;if(this.head=D,!this.tail)this.tail=D;this.length++}pushNode(D){if(D===this.tail)return;if(D.list)D.list.removeNode(D);let u=this.tail;if(D.list=this,D.prev=u,u)u.next=D;if(this.tail=D,!this.head)this.head=D;this.length++}push(...D){for(let u=0,_=D.length;u<_;u++)Kq(this,D[u]);return this.length}unshift(...D){for(var u=0,_=D.length;u<_;u++)Xq(this,D[u]);return this.length}pop(){if(!this.tail)return;let D=this.tail.value,u=this.tail;if(this.tail=this.tail.prev,this.tail)this.tail.next=void 0;else this.head=void 0;return u.list=void 0,this.length--,D}shift(){if(!this.head)return;let D=this.head.value,u=this.head;if(this.head=this.head.next,this.head)this.head.prev=void 0;else this.tail=void 0;return u.list=void 0,this.length--,D}forEach(D,u){u=u||this;for(let _=this.head,F=0;_;F++)D.call(u,_.value,F,this),_=_.next}forEachReverse(D,u){u=u||this;for(let _=this.tail,F=this.length-1;_;F--)D.call(u,_.value,F,this),_=_.prev}get(D){let u=0,_=this.head;for(;!!_&&u<D;u++)_=_.next;if(u===D&&!!_)return _.value}getReverse(D){let u=0,_=this.tail;for(;!!_&&u<D;u++)_=_.prev;if(u===D&&!!_)return _.value}map(D,u){u=u||this;let _=new q0;for(let F=this.head;F;)_.push(D.call(u,F.value,this)),F=F.next;return _}mapReverse(D,u){u=u||this;var _=new q0;for(let F=this.tail;F;)_.push(D.call(u,F.value,this)),F=F.prev;return _}reduce(D,u){let _,F=this.head;if(arguments.length>1)_=u;else if(this.head)F=this.head.next,_=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var q=0;F;q++)_=D(_,F.value,q),F=F.next;return _}reduceReverse(D,u){let _,F=this.tail;if(arguments.length>1)_=u;else if(this.tail)F=this.tail.prev,_=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(let q=this.length-1;F;q--)_=D(_,F.value,q),F=F.prev;return _}toArray(){let D=Array(this.length);for(let u=0,_=this.head;_;u++)D[u]=_.value,_=_.next;return D}toArrayReverse(){let D=Array(this.length);for(let u=0,_=this.tail;_;u++)D[u]=_.value,_=_.prev;return D}slice(D=0,u=this.length){if(u<0)u+=this.length;if(D<0)D+=this.length;let _=new q0;if(u<D||u<0)return _;if(D<0)D=0;if(u>this.length)u=this.length;let F=this.head,q=0;for(q=0;!!F&&q<D;q++)F=F.next;for(;!!F&&q<u;q++,F=F.next)_.push(F.value);return _}sliceReverse(D=0,u=this.length){if(u<0)u+=this.length;if(D<0)D+=this.length;let _=new q0;if(u<D||u<0)return _;if(D<0)D=0;if(u>this.length)u=this.length;let F=this.length,q=this.tail;for(;!!q&&F>u;F--)q=q.prev;for(;!!q&&F>D;F--,q=q.prev)_.push(q.value);return _}splice(D,u=0,..._){if(D>this.length)D=this.length-1;if(D<0)D=this.length+D;let F=this.head;for(let C=0;!!F&&C<D;C++)F=F.next;let q=[];for(let C=0;!!F&&C<u;C++)q.push(F.value),F=this.removeNode(F);if(!F)F=this.tail;else if(F!==this.tail)F=F.prev;for(let C of _)F=Zq(this,F,C);return q}reverse(){let D=this.head,u=this.tail;for(let _=D;_;_=_.prev){let F=_.prev;_.prev=_.next,_.next=F}return this.head=u,this.tail=D,this}}function Zq(D,u,_){let F=u,q=u?u.next:D.head,C=new zu(_,F,q,D);if(C.next===void 0)D.tail=C;if(C.prev===void 0)D.head=C;return D.length++,C}function Kq(D,u){if(D.tail=new zu(u,D.tail,void 0,D),!D.head)D.head=D.tail;D.length++}function Xq(D,u){if(D.head=new zu(u,void 0,D.head,D),!D.tail)D.tail=D.head;D.length++}class zu{list;next;prev;value;constructor(D,u,_,F){if(this.list=F,this.value=D,u)u.next=this,this.prev=u;else this.prev=void 0;if(_)_.prev=this,this.next=_;else this.next=void 0}}import s1 from"path";class I8{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(D,u){this.path=D||"./",this.absolute=u}}var p1=Buffer.alloc(1024),Lu=Symbol("onStat"),z2=Symbol("ended"),YD=Symbol("queue"),l0=Symbol("current"),L0=Symbol("process"),L2=Symbol("processing"),i1=Symbol("processJob"),HD=Symbol("jobs"),O8=Symbol("jobDone"),Uu=Symbol("addFSEntry"),a1=Symbol("addTarEntry"),w8=Symbol("stat"),M8=Symbol("readdir"),Ou=Symbol("onreaddir"),ju=Symbol("pipe"),n1=Symbol("entry"),j8=Symbol("entryOpt"),Pu=Symbol("writeEntryClass"),t1=Symbol("write"),P8=Symbol("ondrain");class U0 extends DD{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[Pu];onWriteEntry;[YD];[HD]=0;[L2]=!1;[z2]=!1;constructor(D={}){super();if(this.opt=D,this.file=D.file||"",this.cwd=D.cwd||process.cwd(),this.maxReadSize=D.maxReadSize,this.preservePaths=!!D.preservePaths,this.strict=!!D.strict,this.noPax=!!D.noPax,this.prefix=P(D.prefix||""),this.linkCache=D.linkCache||new Map,this.statCache=D.statCache||new Map,this.readdirCache=D.readdirCache||new Map,this.onWriteEntry=D.onWriteEntry,this[Pu]=Au,typeof D.onwarn==="function")this.on("warn",D.onwarn);if(this.portable=!!D.portable,D.gzip||D.brotli||D.zstd){if((D.gzip?1:0)+(D.brotli?1:0)+(D.zstd?1:0)>1)throw TypeError("gzip, brotli, zstd are mutually exclusive");if(D.gzip){if(typeof D.gzip!=="object")D.gzip={};if(this.portable)D.gzip.portable=!0;this.zip=new a3(D.gzip)}if(D.brotli){if(typeof D.brotli!=="object")D.brotli={};this.zip=new t3(D.brotli)}if(D.zstd){if(typeof D.zstd!=="object")D.zstd={};this.zip=new e3(D.zstd)}if(!this.zip)throw Error("impossible");let u=this.zip;u.on("data",(_)=>super.write(_)),u.on("end",()=>super.end()),u.on("drain",()=>this[P8]()),this.on("resume",()=>u.resume())}else this.on("drain",this[P8]);if(this.noDirRecurse=!!D.noDirRecurse,this.follow=!!D.follow,this.noMtime=!!D.noMtime,D.mtime)this.mtime=D.mtime;this.filter=typeof D.filter==="function"?D.filter:()=>!0,this[YD]=new q0,this[HD]=0,this.jobs=Number(D.jobs)||4,this[L2]=!1,this[z2]=!1}[t1](D){return super.write(D)}add(D){return this.write(D),this}end(D,u,_){if(typeof D==="function")_=D,D=void 0;if(typeof u==="function")_=u,u=void 0;if(D)this.add(D);if(this[z2]=!0,this[L0](),_)_();return this}write(D){if(this[z2])throw Error("write after end");if(D instanceof Y2)this[a1](D);else this[Uu](D);return this.flowing}[a1](D){let u=P(s1.resolve(this.cwd,D.path));if(!this.filter(D.path,D))D.resume();else{let _=new I8(D.path,u);_.entry=new U8(D,this[j8](_)),_.entry.on("end",()=>this[O8](_)),this[HD]+=1,this[YD].push(_)}this[L0]()}[Uu](D){let u=P(s1.resolve(this.cwd,D));this[YD].push(new I8(D,u)),this[L0]()}[w8](D){D.pending=!0,this[HD]+=1;let u=this.follow?"stat":"lstat";Iu[u](D.absolute,(_,F)=>{if(D.pending=!1,this[HD]-=1,_)this.emit("error",_);else this[Lu](D,F)})}[Lu](D,u){if(this.statCache.set(D.absolute,u),D.stat=u,!this.filter(D.path,u))D.ignore=!0;this[L0]()}[M8](D){D.pending=!0,this[HD]+=1,Iu.readdir(D.absolute,(u,_)=>{if(D.pending=!1,this[HD]-=1,u)return this.emit("error",u);this[Ou](D,_)})}[Ou](D,u){this.readdirCache.set(D.absolute,u),D.readdir=u,this[L0]()}[L0](){if(this[L2])return;this[L2]=!0;for(let D=this[YD].head;!!D&&this[HD]<this.jobs;D=D.next)if(this[i1](D.value),D.value.ignore){let u=D.next;this[YD].removeNode(D),D.next=u}if(this[L2]=!1,this[z2]&&!this[YD].length&&this[HD]===0)if(this.zip)this.zip.end(p1);else super.write(p1),super.end()}get[l0](){return this[YD]&&this[YD].head&&this[YD].head.value}[O8](D){this[YD].shift(),this[HD]-=1,this[L0]()}[i1](D){if(D.pending)return;if(D.entry){if(D===this[l0]&&!D.piped)this[ju](D);return}if(!D.stat){let u=this.statCache.get(D.absolute);if(u)this[Lu](D,u);else this[w8](D)}if(!D.stat)return;if(D.ignore)return;if(!this.noDirRecurse&&D.stat.isDirectory()&&!D.readdir){let u=this.readdirCache.get(D.absolute);if(u)this[Ou](D,u);else this[M8](D);if(!D.readdir)return}if(D.entry=this[n1](D),!D.entry){D.ignore=!0;return}if(D===this[l0]&&!D.piped)this[ju](D)}[j8](D){return{onwarn:(u,_,F)=>this.warn(u,_,F),noPax:this.noPax,cwd:this.cwd,absolute:D.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[n1](D){this[HD]+=1;try{return new this[Pu](D.path,this[j8](D)).on("end",()=>this[O8](D)).on("error",(_)=>this.emit("error",_))}catch(u){this.emit("error",u)}}[P8](){if(this[l0]&&this[l0].entry)this[l0].entry.resume()}[ju](D){if(D.piped=!0,D.readdir)D.readdir.forEach((F)=>{let q=D.path,C=q==="./"?"":q.replace(/\/*$/,"/");this[Uu](C+F)});let u=D.entry,_=this.zip;if(!u)throw Error("cannot pipe without source");if(_)u.on("data",(F)=>{if(!_.write(F))u.pause()});else u.on("data",(F)=>{if(!super.write(F))u.pause()})}pause(){if(this.zip)this.zip.pause();return super.pause()}warn(D,u,_={}){H0(this,D,u,_)}}class c0 extends U0{sync=!0;constructor(D){super(D);this[Pu]=L8}pause(){}resume(){}[w8](D){let u=this.follow?"statSync":"lstatSync";this[Lu](D,Iu[u](D.absolute))}[M8](D){this[Ou](D,Iu.readdirSync(D.absolute))}[ju](D){let u=D.entry,_=this.zip;if(D.readdir)D.readdir.forEach((F)=>{let q=D.path,C=q==="./"?"":q.replace(/\/*$/,"/");this[Uu](C+F)});if(!u)throw Error("Cannot pipe without source");if(_)u.on("data",(F)=>{_.write(F)});else u.on("data",(F)=>{super[t1](F)})}}var Bq=(D,u)=>{let _=new c0(D),F=new X2(D.file,{mode:D.mode||438});_.pipe(F),r1(_,u)},Gq=(D,u)=>{let _=new U0(D),F=new nD(D.file,{mode:D.mode||438});_.pipe(F);let q=new Promise((C,$)=>{F.on("error",$),F.on("close",C),_.on("error",$)});return e1(_,u),q},r1=(D,u)=>{u.forEach((_)=>{if(_.charAt(0)==="@")z0({file:o1.resolve(D.cwd,_.slice(1)),sync:!0,noResume:!0,onReadEntry:(F)=>D.add(F)});else D.add(_)}),D.end()},e1=async(D,u)=>{for(let _=0;_<u.length;_++){let F=String(u[_]);if(F.charAt(0)==="@")await z0({file:o1.resolve(String(D.cwd),F.slice(1)),noResume:!0,onReadEntry:(q)=>{D.add(q)}});else D.add(F)}D.end()},Yq=(D,u)=>{let _=new c0(D);return r1(_,u),_},Hq=(D,u)=>{let _=new U0(D);return e1(_,u),_},xq=UD(Bq,Gq,Yq,Hq,(D,u)=>{if(!u?.length)throw TypeError("no paths specified to add to archive")});import H_ from"node:fs";import Eq from"node:assert";import{randomBytes as Y_}from"node:crypto";import M from"node:fs";import hD from"node:path";import D_ from"fs";var Wq=process.env.__FAKE_PLATFORM__||process.platform,Aq=Wq==="win32",{O_CREAT:zq,O_TRUNC:Lq,O_WRONLY:Uq}=D_.constants,u_=Number(process.env.__FAKE_FS_O_FILENAME__)||D_.constants.UV_FS_O_FILEMAP||0,Oq=Aq&&!!u_,jq=524288,Pq=u_|Lq|zq|Uq,T8=!Oq?()=>"w":(D)=>D<jq?Pq:"w";import Mu from"node:fs";import U2 from"node:path";var v8=(D,u,_)=>{try{return Mu.lchownSync(D,u,_)}catch(F){if(F?.code!=="ENOENT")throw F}},wu=(D,u,_,F)=>{Mu.lchown(D,u,_,(q)=>{F(q&&q?.code!=="ENOENT"?q:null)})},Iq=(D,u,_,F,q)=>{if(u.isDirectory())R8(U2.resolve(D,u.name),_,F,(C)=>{if(C)return q(C);let $=U2.resolve(D,u.name);wu($,_,F,q)});else{let C=U2.resolve(D,u.name);wu(C,_,F,q)}},R8=(D,u,_,F)=>{Mu.readdir(D,{withFileTypes:!0},(q,C)=>{if(q){if(q.code==="ENOENT")return F();else if(q.code!=="ENOTDIR"&&q.code!=="ENOTSUP")return F(q)}if(q||!C.length)return wu(D,u,_,F);let $=C.length,Q=null,J=(Z)=>{if(Q)return;if(Z)return F(Q=Z);if(--$===0)return wu(D,u,_,F)};for(let Z of C)Iq(D,Z,u,_,J)})},wq=(D,u,_,F)=>{if(u.isDirectory())N8(U2.resolve(D,u.name),_,F);v8(U2.resolve(D,u.name),_,F)},N8=(D,u,_)=>{let F;try{F=Mu.readdirSync(D,{withFileTypes:!0})}catch(q){let C=q;if(C?.code==="ENOENT")return;else if(C?.code==="ENOTDIR"||C?.code==="ENOTSUP")return v8(D,u,_);else throw C}for(let q of F)wq(D,q,u,_);return v8(D,u,_)};import uD from"node:fs";import Mq from"node:fs/promises";import Ru from"node:path";class Tu extends Error{path;code;syscall="chdir";constructor(D,u){super(`${u}: Cannot cd into '${D}'`);this.path=D,this.code=u}get name(){return"CwdError"}}class vu extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(D,u){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link");this.symlink=D,this.path=u}get name(){return"SymlinkError"}}var Tq=(D,u)=>{uD.stat(D,(_,F)=>{if(_||!F.isDirectory())_=new Tu(D,_?.code||"ENOTDIR");u(_)})},__=(D,u,_)=>{D=P(D);let F=u.umask??18,q=u.mode|448,C=(q&F)!==0,$=u.uid,Q=u.gid,J=typeof $==="number"&&typeof Q==="number"&&($!==u.processUid||Q!==u.processGid),Z=u.preserve,V=u.unlink,K=P(u.cwd),X=(z,j)=>{if(z)_(z);else if(j&&J)R8(j,$,Q,(E)=>X(E));else if(C)uD.chmod(D,q,_);else _()};if(D===K)return Tq(D,X);if(Z)return Mq.mkdir(D,{mode:q,recursive:!0}).then((z)=>X(null,z??void 0),X);let L=P(Ru.relative(K,D)).split("/");S8(K,L,q,V,K,void 0,X)},S8=(D,u,_,F,q,C,$)=>{if(!u.length)return $(null,C);let Q=u.shift(),J=P(Ru.resolve(D+"/"+Q));uD.mkdir(J,_,F_(J,u,_,F,q,C,$))},F_=(D,u,_,F,q,C,$)=>(Q)=>{if(Q)uD.lstat(D,(J,Z)=>{if(J)J.path=J.path&&P(J.path),$(J);else if(Z.isDirectory())S8(D,u,_,F,q,C,$);else if(F)uD.unlink(D,(V)=>{if(V)return $(V);uD.mkdir(D,_,F_(D,u,_,F,q,C,$))});else if(Z.isSymbolicLink())return $(new vu(D,D+"/"+u.join("/")));else $(Q)});else C=C||D,S8(D,u,_,F,q,C,$)},vq=(D)=>{let u=!1,_=void 0;try{u=uD.statSync(D).isDirectory()}catch(F){_=F?.code}finally{if(!u)throw new Tu(D,_??"ENOTDIR")}},q_=(D,u)=>{D=P(D);let _=u.umask??18,F=u.mode|448,q=(F&_)!==0,C=u.uid,$=u.gid,Q=typeof C==="number"&&typeof $==="number"&&(C!==u.processUid||$!==u.processGid),J=u.preserve,Z=u.unlink,V=P(u.cwd),K=(z)=>{if(z&&Q)N8(z,C,$);if(q)uD.chmodSync(D,F)};if(D===V)return vq(V),K();if(J)return K(uD.mkdirSync(D,{mode:F,recursive:!0})??void 0);let B=P(Ru.relative(V,D)).split("/"),L=void 0;for(let z=B.shift(),j=V;z&&(j+="/"+z);z=B.shift()){j=P(Ru.resolve(j));try{uD.mkdirSync(j,F),L=L||j}catch(E){let c=uD.lstatSync(j);if(c.isDirectory())continue;else if(Z){uD.unlinkSync(j),uD.mkdirSync(j,F),L=L||j;continue}else if(c.isSymbolicLink())return new vu(j,j+"/"+B.join("/"))}}return K(L)};import{join as $_}from"node:path";var E8=Object.create(null);var p0=new Set,C_=(D)=>{if(!p0.has(D))E8[D]=D.normalize("NFD");else p0.delete(D);p0.add(D);let u=E8[D],_=p0.size-1e4;if(_>1000){for(let F of p0)if(p0.delete(F),delete E8[F],--_<=0)break}return u};var Rq=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Nq=Rq==="win32",Sq=(D)=>{return D.split("/").slice(0,-1).reduce((_,F)=>{let q=_[_.length-1];if(q!==void 0)F=$_(q,F);return _.push(F||"/"),_},[])};class k8{#D=new Map;#_=new Map;#u=new Set;reserve(D,u){D=Nq?["win32 parallelization disabled"]:D.map((F)=>{return _0($_(C_(F))).toLowerCase()});let _=new Set(D.map((F)=>Sq(F)).reduce((F,q)=>F.concat(q)));this.#_.set(u,{dirs:_,paths:D});for(let F of D){let q=this.#D.get(F);if(!q)this.#D.set(F,[u]);else q.push(u)}for(let F of _){let q=this.#D.get(F);if(!q)this.#D.set(F,[new Set([u])]);else{let C=q[q.length-1];if(C instanceof Set)C.add(u);else q.push(new Set([u]))}}return this.#C(u)}#$(D){let u=this.#_.get(D);if(!u)throw Error("function does not have any path reservations");return{paths:u.paths.map((_)=>this.#D.get(_)),dirs:[...u.dirs].map((_)=>this.#D.get(_))}}check(D){let{paths:u,dirs:_}=this.#$(D);return u.every((F)=>F&&F[0]===D)&&_.every((F)=>F&&F[0]instanceof Set&&F[0].has(D))}#C(D){if(this.#u.has(D)||!this.check(D))return!1;return this.#u.add(D),D(()=>this.#F(D)),!0}#F(D){if(!this.#u.has(D))return!1;let u=this.#_.get(D);if(!u)throw Error("invalid reservation");let{paths:_,dirs:F}=u,q=new Set;for(let C of _){let $=this.#D.get(C);if(!$||$?.[0]!==D)continue;let Q=$[1];if(!Q){this.#D.delete(C);continue}if($.shift(),typeof Q==="function")q.add(Q);else for(let J of Q)q.add(J)}for(let C of F){let $=this.#D.get(C),Q=$?.[0];if(!$||!(Q instanceof Set))continue;if(Q.size===1&&$.length===1){this.#D.delete(C);continue}else if(Q.size===1){$.shift();let J=$[0];if(typeof J==="function")q.add(J)}else Q.delete(D)}return this.#u.delete(D),q.forEach((C)=>this.#C(C)),!0}}var Q_=Symbol("onEntry"),b8=Symbol("checkFs"),J_=Symbol("checkFs2"),g8=Symbol("isReusable"),QD=Symbol("makeFs"),m8=Symbol("file"),f8=Symbol("directory"),Eu=Symbol("link"),V_=Symbol("symlink"),Z_=Symbol("hardlink"),K_=Symbol("unsupported"),X_=Symbol("checkPath"),C0=Symbol("mkdir"),d=Symbol("onError"),Nu=Symbol("pending"),B_=Symbol("pend"),i0=Symbol("unpend"),y8=Symbol("ended"),h8=Symbol("maybeClose"),d8=Symbol("skip"),O2=Symbol("doChown"),j2=Symbol("uid"),P2=Symbol("gid"),I2=Symbol("checkedCwd"),kq=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,w2=kq==="win32",yq=1024,hq=(D,u)=>{if(!w2)return M.unlink(D,u);let _=D+".DELETE."+Y_(16).toString("hex");M.rename(D,_,(F)=>{if(F)return u(F);M.unlink(_,u)})},bq=(D)=>{if(!w2)return M.unlinkSync(D);let u=D+".DELETE."+Y_(16).toString("hex");M.renameSync(D,u),M.unlinkSync(u)},G_=(D,u,_)=>D!==void 0&&D===D>>>0?D:u!==void 0&&u===u>>>0?u:_;class M2 extends u0{[y8]=!1;[I2]=!1;[Nu]=0;reservations=new k8;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(D={}){D.ondone=()=>{this[y8]=!0,this[h8]()};super(D);if(this.transform=D.transform,this.chmod=!!D.chmod,typeof D.uid==="number"||typeof D.gid==="number"){if(typeof D.uid!=="number"||typeof D.gid!=="number")throw TypeError("cannot set owner without number uid and gid");if(D.preserveOwner)throw TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=D.uid,this.gid=D.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;if(D.preserveOwner===void 0&&typeof D.uid!=="number")this.preserveOwner=!!(process.getuid&&process.getuid()===0);else this.preserveOwner=!!D.preserveOwner;this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof D.maxDepth==="number"?D.maxDepth:yq,this.forceChown=D.forceChown===!0,this.win32=!!D.win32||w2,this.newer=!!D.newer,this.keep=!!D.keep,this.noMtime=!!D.noMtime,this.preservePaths=!!D.preservePaths,this.unlink=!!D.unlink,this.cwd=P(hD.resolve(D.cwd||process.cwd())),this.strip=Number(D.strip)||0,this.processUmask=!this.chmod?0:typeof D.processUmask==="number"?D.processUmask:process.umask(),this.umask=typeof D.umask==="number"?D.umask:this.processUmask,this.dmode=D.dmode||511&~this.umask,this.fmode=D.fmode||438&~this.umask,this.on("entry",(u)=>this[Q_](u))}warn(D,u,_={}){if(D==="TAR_BAD_ARCHIVE"||D==="TAR_ABORT")_.recoverable=!1;return super.warn(D,u,_)}[h8](){if(this[y8]&&this[Nu]===0)this.emit("prefinish"),this.emit("finish"),this.emit("end")}[X_](D){let u=P(D.path),_=u.split("/");if(this.strip){if(_.length<this.strip)return!1;if(D.type==="Link"){let F=P(String(D.linkpath)).split("/");if(F.length>=this.strip)D.linkpath=F.slice(this.strip).join("/");else return!1}_.splice(0,this.strip),D.path=_.join("/")}if(isFinite(this.maxDepth)&&_.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:D,path:u,depth:_.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(_.includes("..")||w2&&/^[a-z]:\.\.$/i.test(_[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:D,path:u}),!1;let[F,q]=W2(u);if(F)D.path=String(q),this.warn("TAR_ENTRY_INFO",`stripping ${F} from absolute path`,{entry:D,path:u})}if(hD.isAbsolute(D.path))D.absolute=P(hD.resolve(D.path));else D.absolute=P(hD.resolve(this.cwd,D.path));if(!this.preservePaths&&typeof D.absolute==="string"&&D.absolute.indexOf(this.cwd+"/")!==0&&D.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:D,path:P(D.path),resolvedPath:D.absolute,cwd:this.cwd}),!1;if(D.absolute===this.cwd&&D.type!=="Directory"&&D.type!=="GNUDumpDir")return!1;if(this.win32){let{root:F}=hD.win32.parse(String(D.absolute));D.absolute=F+X8(String(D.absolute).slice(F.length));let{root:q}=hD.win32.parse(D.path);D.path=q+X8(D.path.slice(q.length))}return!0}[Q_](D){if(!this[X_](D))return D.resume();switch(Eq.equal(typeof D.absolute,"string"),D.type){case"Directory":case"GNUDumpDir":if(D.mode)D.mode=D.mode|448;case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[b8](D);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[K_](D)}}[d](D,u){if(D.name==="CwdError")this.emit("error",D);else this.warn("TAR_ENTRY_ERROR",D,{entry:u}),this[i0](),u.resume()}[C0](D,u,_){__(P(D),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:u},_)}[O2](D){return this.forceChown||this.preserveOwner&&(typeof D.uid==="number"&&D.uid!==this.processUid||typeof D.gid==="number"&&D.gid!==this.processGid)||typeof this.uid==="number"&&this.uid!==this.processUid||typeof this.gid==="number"&&this.gid!==this.processGid}[j2](D){return G_(this.uid,D.uid,this.processUid)}[P2](D){return G_(this.gid,D.gid,this.processGid)}[m8](D,u){let _=typeof D.mode==="number"?D.mode&4095:this.fmode,F=new nD(String(D.absolute),{flags:T8(D.size),mode:_,autoClose:!1});F.on("error",(Q)=>{if(F.fd)M.close(F.fd,()=>{});F.write=()=>!0,this[d](Q,D),u()});let q=1,C=(Q)=>{if(Q){if(F.fd)M.close(F.fd,()=>{});this[d](Q,D),u();return}if(--q===0){if(F.fd!==void 0)M.close(F.fd,(J)=>{if(J)this[d](J,D);else this[i0]();u()})}};F.on("finish",()=>{let Q=String(D.absolute),J=F.fd;if(typeof J==="number"&&D.mtime&&!this.noMtime){q++;let Z=D.atime||new Date,V=D.mtime;M.futimes(J,Z,V,(K)=>K?M.utimes(Q,Z,V,(X)=>C(X&&K)):C())}if(typeof J==="number"&&this[O2](D)){q++;let Z=this[j2](D),V=this[P2](D);if(typeof Z==="number"&&typeof V==="number")M.fchown(J,Z,V,(K)=>K?M.chown(Q,Z,V,(X)=>C(X&&K)):C())}C()});let $=this.transform?this.transform(D)||D:D;if($!==D)$.on("error",(Q)=>{this[d](Q,D),u()}),D.pipe($);$.pipe(F)}[f8](D,u){let _=typeof D.mode==="number"?D.mode&4095:this.dmode;this[C0](String(D.absolute),_,(F)=>{if(F){this[d](F,D),u();return}let q=1,C=()=>{if(--q===0)u(),this[i0](),D.resume()};if(D.mtime&&!this.noMtime)q++,M.utimes(String(D.absolute),D.atime||new Date,D.mtime,C);if(this[O2](D))q++,M.chown(String(D.absolute),Number(this[j2](D)),Number(this[P2](D)),C);C()})}[K_](D){D.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${D.type}`,{entry:D}),D.resume()}[V_](D,u){this[Eu](D,String(D.linkpath),"symlink",u)}[Z_](D,u){let _=P(hD.resolve(this.cwd,String(D.linkpath)));this[Eu](D,_,"link",u)}[B_](){this[Nu]++}[i0](){this[Nu]--,this[h8]()}[d8](D){this[i0](),D.resume()}[g8](D,u){return D.type==="File"&&!this.unlink&&u.isFile()&&u.nlink<=1&&!w2}[b8](D){this[B_]();let u=[D.path];if(D.linkpath)u.push(D.linkpath);this.reservations.reserve(u,(_)=>this[J_](D,_))}[J_](D,u){let _=($)=>{u($)},F=()=>{this[C0](this.cwd,this.dmode,($)=>{if($){this[d]($,D),_();return}this[I2]=!0,q()})},q=()=>{if(D.absolute!==this.cwd){let $=P(hD.dirname(String(D.absolute)));if($!==this.cwd)return this[C0]($,this.dmode,(Q)=>{if(Q){this[d](Q,D),_();return}C()})}C()},C=()=>{M.lstat(String(D.absolute),($,Q)=>{if(Q&&(this.keep||this.newer&&Q.mtime>(D.mtime??Q.mtime))){this[d8](D),_();return}if($||this[g8](D,Q))return this[QD](null,D,_);if(Q.isDirectory()){if(D.type==="Directory"){let J=this.chmod&&D.mode&&(Q.mode&4095)!==D.mode,Z=(V)=>this[QD](V??null,D,_);if(!J)return Z();return M.chmod(String(D.absolute),Number(D.mode),Z)}if(D.absolute!==this.cwd)return M.rmdir(String(D.absolute),(J)=>this[QD](J??null,D,_))}if(D.absolute===this.cwd)return this[QD](null,D,_);hq(String(D.absolute),(J)=>this[QD](J??null,D,_))})};if(this[I2])q();else F()}[QD](D,u,_){if(D){this[d](D,u),_();return}switch(u.type){case"File":case"OldFile":case"ContiguousFile":return this[m8](u,_);case"Link":return this[Z_](u,_);case"SymbolicLink":return this[V_](u,_);case"Directory":case"GNUDumpDir":return this[f8](u,_)}}[Eu](D,u,_,F){M[_](u,String(D.absolute),(q)=>{if(q)this[d](q,D);else this[i0](),D.resume();F()})}}var Su=(D)=>{try{return[null,D()]}catch(u){return[u,null]}};class ku extends M2{sync=!0;[QD](D,u){return super[QD](D,u,()=>{})}[b8](D){if(!this[I2]){let q=this[C0](this.cwd,this.dmode);if(q)return this[d](q,D);this[I2]=!0}if(D.absolute!==this.cwd){let q=P(hD.dirname(String(D.absolute)));if(q!==this.cwd){let C=this[C0](q,this.dmode);if(C)return this[d](C,D)}}let[u,_]=Su(()=>M.lstatSync(String(D.absolute)));if(_&&(this.keep||this.newer&&_.mtime>(D.mtime??_.mtime)))return this[d8](D);if(u||this[g8](D,_))return this[QD](null,D);if(_.isDirectory()){if(D.type==="Directory"){let C=this.chmod&&D.mode&&(_.mode&4095)!==D.mode,[$]=C?Su(()=>{M.chmodSync(String(D.absolute),Number(D.mode))}):[];return this[QD]($,D)}let[q]=Su(()=>M.rmdirSync(String(D.absolute)));this[QD](q,D)}let[F]=D.absolute===this.cwd?[]:Su(()=>bq(String(D.absolute)));this[QD](F,D)}[m8](D,u){let _=typeof D.mode==="number"?D.mode&4095:this.fmode,F=($)=>{let Q;try{M.closeSync(q)}catch(J){Q=J}if($||Q)this[d]($||Q,D);u()},q;try{q=M.openSync(String(D.absolute),T8(D.size),_)}catch($){return F($)}let C=this.transform?this.transform(D)||D:D;if(C!==D)C.on("error",($)=>this[d]($,D)),D.pipe(C);C.on("data",($)=>{try{M.writeSync(q,$,0,$.length)}catch(Q){F(Q)}}),C.on("end",()=>{let $=null;if(D.mtime&&!this.noMtime){let Q=D.atime||new Date,J=D.mtime;try{M.futimesSync(q,Q,J)}catch(Z){try{M.utimesSync(String(D.absolute),Q,J)}catch(V){$=Z}}}if(this[O2](D)){let Q=this[j2](D),J=this[P2](D);try{M.fchownSync(q,Number(Q),Number(J))}catch(Z){try{M.chownSync(String(D.absolute),Number(Q),Number(J))}catch(V){$=$||Z}}}F($)})}[f8](D,u){let _=typeof D.mode==="number"?D.mode&4095:this.dmode,F=this[C0](String(D.absolute),_);if(F){this[d](F,D),u();return}if(D.mtime&&!this.noMtime)try{M.utimesSync(String(D.absolute),D.atime||new Date,D.mtime)}catch(q){}if(this[O2](D))try{M.chownSync(String(D.absolute),Number(this[j2](D)),Number(this[P2](D)))}catch(q){}u(),D.resume()}[C0](D,u){try{return q_(P(D),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:u})}catch(_){return _}}[Eu](D,u,_,F){let q=`${_}Sync`;try{M[q](u,String(D.absolute)),F(),D.resume()}catch(C){return this[d](C,D)}}}var gq=(D)=>{let u=new ku(D),_=D.file,F=H_.statSync(_),q=D.maxReadSize||16777216;new f3(_,{readSize:q,size:F.size}).pipe(u)},mq=(D,u)=>{let _=new M2(D),F=D.maxReadSize||16777216,q=D.file;return new Promise(($,Q)=>{_.on("error",Q),_.on("close",$),H_.stat(q,(J,Z)=>{if(J)Q(J);else{let V=new g0(q,{readSize:F,size:Z.size});V.on("error",Q),V.pipe(_)}})})},T2=UD(gq,mq,(D)=>new ku(D),(D)=>new M2(D),(D,u)=>{if(u?.length)V8(D,u)});import _D from"node:fs";import x_ from"node:path";var fq=(D,u)=>{let _=new c0(D),F=!0,q,C;try{try{q=_D.openSync(D.file,"r+")}catch(J){if(J?.code==="ENOENT")q=_D.openSync(D.file,"w+");else throw J}let $=_D.fstatSync(q),Q=Buffer.alloc(512);D:for(C=0;C<$.size;C+=512){for(let V=0,K=0;V<512;V+=K){if(K=_D.readSync(q,Q,V,Q.length-V,C+V),C===0&&Q[0]===31&&Q[1]===139)throw Error("cannot append to compressed archives");if(!K)break D}let J=new CD(Q);if(!J.cksumValid)break;let Z=512*Math.ceil((J.size||0)/512);if(C+Z+512>$.size)break;if(C+=Z,D.mtimeCache&&J.mtime)D.mtimeCache.set(String(J.path),J.mtime)}F=!1,dq(D,_,C,q,u)}finally{if(F)try{_D.closeSync(q)}catch($){}}},dq=(D,u,_,F,q)=>{let C=new X2(D.file,{fd:F,start:_});u.pipe(C),cq(u,q)},lq=(D,u)=>{u=Array.from(u);let _=new U0(D),F=(C,$,Q)=>{let J=(B,L)=>{if(B)_D.close(C,(z)=>Q(B));else Q(null,L)},Z=0;if($===0)return J(null,0);let V=0,K=Buffer.alloc(512),X=(B,L)=>{if(B||typeof L>"u")return J(B);if(V+=L,V<512&&L)return _D.read(C,K,V,K.length-V,Z+V,X);if(Z===0&&K[0]===31&&K[1]===139)return J(Error("cannot append to compressed archives"));if(V<512)return J(null,Z);let z=new CD(K);if(!z.cksumValid)return J(null,Z);let j=512*Math.ceil((z.size??0)/512);if(Z+j+512>$)return J(null,Z);if(Z+=j+512,Z>=$)return J(null,Z);if(D.mtimeCache&&z.mtime)D.mtimeCache.set(String(z.path),z.mtime);V=0,_D.read(C,K,0,512,Z,X)};_D.read(C,K,0,512,Z,X)};return new Promise((C,$)=>{_.on("error",$);let Q="r+",J=(Z,V)=>{if(Z&&Z.code==="ENOENT"&&Q==="r+")return Q="w+",_D.open(D.file,Q,J);if(Z||!V)return $(Z);_D.fstat(V,(K,X)=>{if(K)return _D.close(V,()=>$(K));F(V,X.size,(B,L)=>{if(B)return $(B);let z=new nD(D.file,{fd:V,start:L});_.pipe(z),z.on("error",$),z.on("close",C),pq(_,u)})})};_D.open(D.file,Q,J)})},cq=(D,u)=>{u.forEach((_)=>{if(_.charAt(0)==="@")z0({file:x_.resolve(D.cwd,_.slice(1)),sync:!0,noResume:!0,onReadEntry:(F)=>D.add(F)});else D.add(_)}),D.end()},pq=async(D,u)=>{for(let _=0;_<u.length;_++){let F=String(u[_]);if(F.charAt(0)==="@")await z0({file:x_.resolve(String(D.cwd),F.slice(1)),noResume:!0,onReadEntry:(q)=>D.add(q)});else D.add(F)}D.end()},O0=UD(fq,lq,()=>{throw TypeError("file is required")},()=>{throw TypeError("file is required")},(D,u)=>{if(!U1(D))throw TypeError("file is required");if(D.gzip||D.brotli||D.zstd||D.file.endsWith(".br")||D.file.endsWith(".tbr"))throw TypeError("cannot append to compressed archives");if(!u?.length)throw TypeError("no paths specified to add/replace")});var iq=UD(O0.syncFile,O0.asyncFile,O0.syncNoFile,O0.asyncNoFile,(D,u=[])=>{O0.validate?.(D,u),aq(D)}),aq=(D)=>{let u=D.filter;if(!D.mtimeCache)D.mtimeCache=new Map;D.filter=u?(_,F)=>u(_,F)&&!((D.mtimeCache?.get(_)??F.mtime??0)>(F.mtime??0)):(_,F)=>!((D.mtimeCache?.get(_)??F.mtime??0)>(F.mtime??0))};var R={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"};var w5=KD(V5(),1),M5=KD(I3(),1),T5=KD(Z6(),1);import K6 from"fs";import k2 from"fs/promises";import w0 from"os";import X6 from"path";var I5={name:"@abacus-ai/cli",appName:"AbacusAI",binName:"abacusai",version:"1.105.14608",nodeVersion:"22.19.0",distro:"fb9b4b01c06699c1a80f26ca9de940a9aebb29e0",author:{name:"Abacus AI"},license:"Proprietary",main:"./dist/index.js",module:"./dist/index.js",source:"./src/index.ts",type:"module",homepage:"https://desktop.abacus.ai/",files:["dist"],bugs:{url:"mailto:support@abacus.ai"},bin:{abacusai:"./dist/index.js"},scripts:{build:"tsc && bun build ./src/index.ts --minify --target=node --outdir=dist"},devDependencies:{"@inquirer/prompts":"^7.9.0","@tsconfig/strictest":"^2.0.7","@types/node":"^24.9.2","@types/semver":"^7.7.1","extract-zip":"^2.0.1","node-downloader-helper":"^2.1.9",semver:"^7.7.3","simple-update-notifier":"^2.0.0",tar:"^7.5.2",typescript:"^6.0.0-dev.20251031"},overrides:{yauzl:"3.2.0"}};var a=I5;function a$(){let D=process.versions.node;if(T5.default(D,a.nodeVersion))return!1;return!0}function n$(D){let u=w0.platform(),_=w0.arch(),q={x64:"x64",arm64:"arm64",ia32:"x86"}[_]||_;if(u==="win32")return`https://nodejs.org/dist/v${D}/node-v${D}-win-${q}.${_==="x64"||_==="ia32"?"zip":"7z"}`;else if(u==="darwin")return`https://nodejs.org/dist/v${D}/node-v${D}-darwin-${q}.tar.gz`;else return`https://nodejs.org/dist/v${D}/node-v${D}-linux-${q}.tar.gz`}function s$(D){let u=w0.platform(),_=w0.arch(),q={x64:"x64",arm64:"arm64",ia32:"x86"}[_]||_;if(u==="win32")return`node-v${D}-win-${q}.${_==="x64"||_==="ia32"?"zip":"7z"}`;else if(u==="darwin")return`node-v${D}-darwin-${q}.tar.gz`;else return`node-v${D}-linux-${q}.tar.gz`}async function q3(D){try{if(a$())return;let _=w0.platform()==="win32"?"node.exe":"node",F=n$(a.nodeVersion),q=s$(a.nodeVersion),C=X6.join(D,_);if(K6.existsSync(C))return;let $=X6.join(w0.homedir(),`node-${a.nodeVersion}`),Q=X6.join($,"bin",_);if(K6.existsSync(Q)){await k2.copyFile(Q,C);return}console.log(`${R.dim}Downloading Node.js ${a.nodeVersion}...${R.reset}`);let J=new M5.DownloaderHelper(F,w0.tmpdir(),{fileName:q});J.on("error",async(V)=>{console.error(`${R.red}Failed to download Node.js from ${F}: ${V}${R.reset}`),await J.stop()}),await J.start();let Z=J.getDownloadPath();if(!K6.existsSync($))await k2.mkdir($);if(console.log(`${R.dim}Extracting Node.js ${a.nodeVersion} to ${$}...${R.reset}`),q.endsWith(".tar.gz"))await o$(Z,$);else await t$(Z,$);await k2.copyFile(Q,C)}catch(u){throw console.error(`${R.red}Failed to download Node.js: ${u instanceof Error?u.message:String(u)}${R.reset}`),console.error(`${R.yellow}Please download Node.js ${a.nodeVersion} manually from https://nodejs.org/${R.reset}`),u}}async function t$(D,u){await k2.mkdir(u,{recursive:!0}),await w5.default(D,{dir:u})}async function o$(D,u){await k2.mkdir(u,{recursive:!0}),await T2({file:D,cwd:u,strip:1})}async function S5({version:D,homepage:u,appName:_,binName:F}){try{let q=`${_.toLowerCase()}-agent-cli-${y2.platform()}-${y2.arch()}-${D}.tar.gz`,C=`https://static.abacus.ai/${F}/releases/${D}/${q}`,$=new R5.DownloaderHelper(C,y2.tmpdir(),{fileName:q});$.on("error",async(V)=>{console.error(`Failed to download ${C}: ${V}`),await $.stop()}),console.log(`${R.dim}Downloading ${_} ${D}...${R.reset}`),await $.start();let Q=$.getDownloadPath(),J=v5.join(y2.homedir(),`${F}-${D}`);console.log(`${R.dim}Extracting ${_} ${D} to ${J}...${R.reset}`),await e$(Q,J),await N5.rm(Q);let Z=v5.join(J,"bin",`${F}${y2.platform()==="win32"?".cmd":""}`);if(!r$.existsSync(Z)){let V=`${_} command not found at ${Z}}`;throw console.error(V),Error(V)}return console.log(`${R.dim}${_} ${D} downloaded to ${J}${R.reset}`),await q3(J),Z}catch(q){throw console.error(q instanceof Error?q.message:String(q)),Error(`Could not download ${_} ${D}. Please install ${_} from ${u} and re-run ${F}.`)}}async function e$(D,u){await N5.mkdir(u,{recursive:!0}),await T2({file:D,cwd:u,strip:1})}import d9 from"fs";import l6 from"fs/promises";import dD from"os";import FD from"path";var B6=(D)=>D.name==="tab";var G6=(D)=>D.name==="enter"||D.name==="return";class Y6 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class H6 extends Error{name="CancelPromptError";message="Prompt was canceled"}class C3 extends Error{name="ExitPromptError"}class x6 extends Error{name="HookError"}class W6 extends Error{name="ValidationError"}import{AsyncResource as FQ}from"node:async_hooks";import{AsyncLocalStorage as DQ,AsyncResource as uQ}from"node:async_hooks";var E5=new DQ;function _Q(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function k5(D,u){let _=_Q(D);return E5.run(_,()=>{function F(q){_.handleChange=()=>{_.index=0,q()},_.handleChange()}return u(F)})}function M0(){let D=E5.getStore();if(!D)throw new x6("[Inquirer] Hook functions can only be called from within a prompt");return D}function A6(){return M0().rl}function z6(D){let u=(..._)=>{let F=M0(),q=!1,C=F.handleChange;F.handleChange=()=>{q=!0};let $=D(..._);if(q)C();return F.handleChange=C,$};return uQ.bind(u)}function $3(D){let u=M0(),{index:_}=u,F={get(){return u.hooks[_]},set(C){u.hooks[_]=C},initialized:_ in u.hooks},q=D(F);return u.index++,q}function y5(){M0().handleChange()}var T0={queue(D){let u=M0(),{index:_}=u;u.hooksEffect.push(()=>{u.hooksCleanup[_]?.();let F=D(A6());if(F!=null&&typeof F!=="function")throw new W6("useEffect return value must be a cleanup function or nothing.");u.hooksCleanup[_]=F})},run(){let D=M0();z6(()=>{D.hooksEffect.forEach((u)=>{u()}),D.hooksEffect.length=0})()},clearAll(){let D=M0();D.hooksCleanup.forEach((u)=>{u?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function fD(D){return $3((u)=>{let _=FQ.bind(function(C){if(u.get()!==C)u.set(C),y5()});if(u.initialized)return[u.get(),_];let F=typeof D==="function"?D():D;return u.set(F),[F,_]})}function Q3(D,u){$3((_)=>{let F=_.get();if(!Array.isArray(F)||u.some((C,$)=>!Object.is(C,F[$])))T0.queue(D);_.set(u)})}var JD=KD(b5(),1);import TD from"node:process";function $Q(){if(TD.platform!=="win32")return TD.env.TERM!=="linux";return Boolean(TD.env.WT_SESSION)||Boolean(TD.env.TERMINUS_SUBLIME)||TD.env.ConEmuTask==="{cmd::Cmder}"||TD.env.TERM_PROGRAM==="Terminus-Sublime"||TD.env.TERM_PROGRAM==="vscode"||TD.env.TERM==="xterm-256color"||TD.env.TERM==="alacritty"||TD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var g5={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},m5={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},QQ={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},JQ={...g5,...m5},VQ={...g5,...QQ},ZQ=$Q(),KQ=ZQ?JQ:VQ,f5=KQ,RG=Object.entries(m5);var d5={prefix:{idle:JD.default.blue("?"),done:JD.default.green(f5.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map((D)=>JD.default.yellow(D))},style:{answer:JD.default.cyan,message:JD.default.bold,error:(D)=>JD.default.red(`> ${D}`),defaultAnswer:(D)=>JD.default.dim(`(${D})`),help:JD.default.dim,highlight:JD.default.cyan,key:(D)=>JD.default.cyan(JD.default.bold(`<${D}>`))}};function l5(D){if(typeof D!=="object"||D===null)return!1;let u=D;while(Object.getPrototypeOf(u)!==null)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(D)===u}function c5(...D){let u={};for(let _ of D)for(let[F,q]of Object.entries(_)){let C=u[F];u[F]=l5(C)&&l5(q)?c5(C,q):q}return u}function h2(...D){let u=[d5,...D.filter((_)=>_!=null)];return c5(...u)}function L6({status:D="idle",theme:u}){let[_,F]=fD(!1),[q,C]=fD(0),{prefix:$,spinner:Q}=h2(u);if(Q3(()=>{if(D==="loading"){let Z,V=-1,K=setTimeout(()=>{F(!0),Z=setInterval(()=>{V=V+1,C(V%Q.frames.length)},Q.interval)},300);return()=>{clearTimeout(K),clearInterval(Z)}}else F(!1)},[D]),_)return Q.frames[q];return typeof $==="string"?$:$[D==="loading"?"idle":D]??$.idle}function p5(D){return fD({current:D})[0]}function U6(D){let u=p5(D);u.current=D,Q3((_)=>{let F=!1,q=z6((C,$)=>{if(F)return;u.current($,_)});return _.input.on("keypress",q),()=>{F=!0,_.input.removeListener("keypress",q)}},[])}var z9=KD(a5(),1),L9=KD(A9(),1);function R6(D,u){return D.split(`
15
- `).flatMap((_)=>L9.default(_,u,{trim:!1,hard:!0}).split(`
16
- `).map((F)=>F.trimEnd())).join(`
17
- `)}function U9(){return z9.default({defaultWidth:80,output:A6().output})}var E9=KD(P9(),1);import*as S9 from"node:readline";import{AsyncResource as gQ}from"node:async_hooks";var v0=[];v0.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")v0.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")v0.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Z3=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",N6=Symbol.for("signal-exit emitter"),S6=globalThis,EQ=Object.defineProperty.bind(Object);class I9{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(S6[N6])return S6[N6];EQ(S6,N6,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,u){this.listeners[D].push(u)}removeListener(D,u){let _=this.listeners[D],F=_.indexOf(u);if(F===-1)return;if(F===0&&_.length===1)_.length=0;else _.splice(F,1)}emit(D,u,_){if(this.emitted[D])return!1;this.emitted[D]=!0;let F=!1;for(let q of this.listeners[D])F=q(u,_)===!0||F;if(D==="exit")F=this.emit("afterExit",u,_)||F;return F}}class k6{}var kQ=(D)=>{return{onExit(u,_){return D.onExit(u,_)},load(){return D.load()},unload(){return D.unload()}}};class w9 extends k6{onExit(){return()=>{}}load(){}unload(){}}class M9 extends k6{#D=E6.platform==="win32"?"SIGINT":"SIGHUP";#_=new I9;#u;#$;#C;#F={};#q=!1;constructor(D){super();this.#u=D,this.#F={};for(let u of v0)this.#F[u]=()=>{let _=this.#u.listeners(u),{count:F}=this.#_,q=D;if(typeof q.__signal_exit_emitter__==="object"&&typeof q.__signal_exit_emitter__.count==="number")F+=q.__signal_exit_emitter__.count;if(_.length===F){this.unload();let C=this.#_.emit("exit",null,u),$=u==="SIGHUP"?this.#D:u;if(!C)D.kill(D.pid,$)}};this.#C=D.reallyExit,this.#$=D.emit}onExit(D,u){if(!Z3(this.#u))return()=>{};if(this.#q===!1)this.load();let _=u?.alwaysLast?"afterExit":"exit";return this.#_.on(_,D),()=>{if(this.#_.removeListener(_,D),this.#_.listeners.exit.length===0&&this.#_.listeners.afterExit.length===0)this.unload()}}load(){if(this.#q)return;this.#q=!0,this.#_.count+=1;for(let D of v0)try{let u=this.#F[D];if(u)this.#u.on(D,u)}catch(u){}this.#u.emit=(D,...u)=>{return this.#J(D,...u)},this.#u.reallyExit=(D)=>{return this.#Q(D)}}unload(){if(!this.#q)return;this.#q=!1,v0.forEach((D)=>{let u=this.#F[D];if(!u)throw Error("Listener not defined for signal: "+D);try{this.#u.removeListener(D,u)}catch(_){}}),this.#u.emit=this.#$,this.#u.reallyExit=this.#C,this.#_.count-=1}#Q(D){if(!Z3(this.#u))return 0;return this.#u.exitCode=D||0,this.#_.emit("exit",this.#u.exitCode,null),this.#C.call(this.#u,this.#u.exitCode)}#J(D,...u){let _=this.#$;if(D==="exit"&&Z3(this.#u)){if(typeof u[0]==="number")this.#u.exitCode=u[0];let F=_.call(this.#u,D,...u);return this.#_.emit("exit",this.#u.exitCode,null),F}else return _.call(this.#u,D,...u)}}var E6=globalThis.process,{onExit:T9,load:ZY,unload:KY}=kQ(Z3(E6)?new M9(E6):new w9);import{stripVTControlCharacters as hQ}from"node:util";var yQ="\x1B[G";var R9="\x1B[?25h",y6=(D=1)=>D>0?`\x1B[${D}A`:"",h6=(D=1)=>D>0?`\x1B[${D}B`:"",b6=(D,u)=>{if(typeof u==="number"&&!Number.isNaN(u))return`\x1B[${u+1};${D+1}H`;return`\x1B[${D+1}G`},v9="\x1B[2K",g6=(D)=>D>0?(v9+y6(1)).repeat(D-1)+v9+yQ:"";var N9=(D)=>D.split(`
18
- `).length,bQ=(D)=>D.split(`
19
- `).pop()??"";class K3{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(D){this.rl=D,this.cursorPos=D.getCursorPos()}write(D){this.rl.output.unmute(),this.rl.output.write(D),this.rl.output.mute()}render(D,u=""){let _=bQ(D),F=hQ(_),q=F;if(this.rl.line.length>0)q=q.slice(0,-this.rl.line.length);this.rl.setPrompt(q),this.cursorPos=this.rl.getCursorPos();let C=U9();if(D=R6(D,C),u=R6(u,C),F.length%C===0)D+=`
20
- `;let $=D+(u?`
21
- `+u:""),J=Math.floor(F.length/C)-this.cursorPos.rows+(u?N9(u):0);if(J>0)$+=y6(J);$+=b6(this.cursorPos.cols),this.write(h6(this.extraLinesUnderPrompt)+g6(this.height)+$),this.extraLinesUnderPrompt=J,this.height=N9($)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(b6(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let u=h6(this.extraLinesUnderPrompt);u+=D?g6(this.height):`
22
- `,u+=R9,this.write(u),this.rl.close()}}class m6 extends Promise{static withResolver(){let D,u;return{promise:new Promise((F,q)=>{D=F,u=q}),resolve:D,reject:u}}}function mQ(){let D=Error.prepareStackTrace,u=[];try{Error.prepareStackTrace=(_,F)=>{let q=F.slice(1);return u=q,q},Error().stack}catch{return u}return Error.prepareStackTrace=D,u}function f6(D){let u=mQ();return(F,q={})=>{let{input:C=process.stdin,signal:$}=q,Q=new Set,J=new E9.default;J.pipe(q.output??process.stdout);let Z=S9.createInterface({terminal:!0,input:C,output:J}),V=new K3(Z),{promise:K,resolve:X,reject:B}=m6.withResolver(),L=()=>B(new H6);if($){let E=()=>B(new Y6({cause:$.reason}));if($.aborted)return E(),Object.assign(K,{cancel:L});$.addEventListener("abort",E),Q.add(()=>$.removeEventListener("abort",E))}Q.add(T9((E,c)=>{B(new C3(`User force closed the prompt with ${E} ${c}`))}));let z=()=>B(new C3("User force closed the prompt with SIGINT"));Z.on("SIGINT",z),Q.add(()=>Z.removeListener("SIGINT",z));let j=()=>V.checkCursorPos();return Z.input.on("keypress",j),Q.add(()=>Z.input.removeListener("keypress",j)),k5(Z,(E)=>{let c=gQ.bind(()=>T0.clearAll());return Z.on("close",c),Q.add(()=>Z.removeListener("close",c)),E(()=>{try{let m=D(F,(t)=>{setImmediate(()=>X(t))});if(m===void 0){let t=u[1]?.getFileName();throw Error(`Prompt functions must return a string.
23
- at ${t}`)}let[lD,s2]=typeof m==="string"?[m]:m;V.render(lD,s2),T0.run()}catch(m){B(m)}}),Object.assign(K.then((m)=>{return T0.clearAll(),m},(m)=>{throw T0.clearAll(),m}).finally(()=>{Q.forEach((m)=>m()),V.done({clearContent:Boolean(q.clearPromptOnDone)}),J.end()}).then(()=>K),{cancel:L})})}}function k9(D,u){let _=u!==!1;if(/^(y|yes)/i.test(D))_=!0;else if(/^(n|no)/i.test(D))_=!1;return _}function y9(D){return D?"Yes":"No"}var d6=f6((D,u)=>{let{transformer:_=y9}=D,[F,q]=fD("idle"),[C,$]=fD(""),Q=h2(D.theme),J=L6({status:F,theme:Q});U6((X,B)=>{if(F!=="idle")return;if(G6(X)){let L=k9(C,D.default);$(_(L)),q("done"),u(L)}else if(B6(X)){let L=y9(!k9(C,D.default));B.clearLine(0),B.write(L),$(L)}else $(B.line)});let Z=C,V="";if(F==="done")Z=Q.style.answer(C);else V=` ${Q.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let K=Q.style.message(D.message,F);return`${J} ${K}${V} ${Z}`});var l9=KD(Z6(),1),c9=KD(f9(),1);async function p9(D){try{let u=[FD.join(dD.homedir(),`${D.binName}-${D.version}`)];if(dD.platform()==="darwin")u.push(`/Applications/${D.appName}.app/Contents/Resources/app`,FD.join(dD.homedir(),`Applications/${D.appName}.app/Contents/Resources/app`));else if(dD.platform()==="win32"){let _=process.env.ProgramFiles||"C:\\Program Files",F=process.env["ProgramFiles(x86)"]||"C:\\Program Files (x86)",q=process.env.LOCALAPPDATA||FD.join(dD.homedir(),"AppData","Local"),C=process.env.APPDATA||FD.join(dD.homedir(),"AppData","Roaming");u.push(FD.join(_,D.appName),FD.join(F,D.appName),FD.join(q,"Programs",D.appName),FD.join(C,D.appName))}else u.push(`/usr/share/${D.appName.toLowerCase()}`);return await Promise.any(u.map(async(_)=>{try{let F=JSON.parse(await l6.readFile(FD.join(_,"package.json"),"utf8"));if(!("version"in F)||typeof F.version!=="string"||F.version!==D.version)throw Error(`Invalid version in package.json: ${F.version}`);let q=FD.join(_,"bin",`${D.binName}${dD.platform()==="win32"?".cmd":""}`);if(!d9.existsSync(q))throw Error(`${D.appName} command not found: ${q}`);return q}catch{throw Error(`${D.appName} not found in ${_}`)}}))}catch(u){let _=u instanceof Error?u.message:String(u);if(!_.includes("All promises were rejected"))console.log(`${R.dim}${_}${R.reset}`);return}}var cQ=new Set(["@abacus-ai/cli","abacusai-cli","@abacus-ai/deepagent","deepagent-cli","@abacus-ai/codellm","codellm-cli"]);async function i9(D,u){try{let _=FD.dirname(D),F=(await l6.readdir(dD.homedir())).filter((C)=>C.startsWith(u.binName)&&!_.includes(C)).map((C)=>FD.join(dD.homedir(),C)).filter((C)=>{try{let $=JSON.parse(d9.readFileSync(FD.join(C,"package.json"),"utf8"));if(!("name"in $)||typeof $.name!=="string"||!cQ.has($.name))return!1;if(!("version"in $)||typeof $.version!=="string"||!c9.default($.version)||!l9.default($.version,u.version))return!1;return!0}catch{return!1}});if(F.length===0)return;if(console.log(`${R.dim}Found old ${u.appName} installations at:
24
- ${F.join(`
25
- `)}${R.reset}`),!await d6({message:"Should we remove them?",default:!1}))return;await Promise.all(F.map(async(C)=>{try{await l6.rm(C,{recursive:!0,force:!0})}catch($){console.error(`Failed to remove old ${u.appName} installation at '${C}': ${$ instanceof Error?$.message:String($)}`);return}console.log(`${R.dim}Removed old ${u.appName} installation at '${C}'${R.reset}`)}))}catch(_){console.error(_ instanceof Error?_.message:String(_))}}import{execFile as dZ}from"child_process";import p4 from"process";var l4=KD(y4(),1);import hZ from"os";import h4 from"path";import n2 from"fs";var bZ=hZ.homedir(),q1=process.env.XDG_CONFIG_HOME||h4.join(bZ,".config","simple-update-notifier"),b4=(D)=>{return h4.join(q1,`${D.replace("@","").replace("/","__")}.json`)},g4=()=>{if(!n2.existsSync(q1))n2.mkdirSync(q1,{recursive:!0})},m4=(D)=>{let u=b4(D);try{if(!n2.existsSync(u))return;return JSON.parse(n2.readFileSync(u,"utf8")).lastUpdateCheck}catch{return}},f4=(D)=>{let u=b4(D);n2.writeFileSync(u,JSON.stringify({lastUpdateCheck:new Date().getTime()}))};import gZ from"https";var mZ=async(D,u)=>{let _=`https://registry.npmjs.org/-/package/${D}/dist-tags`;return new Promise((F,q)=>{gZ.get(_,(C)=>{let $="";C.on("data",(Q)=>$+=Q),C.on("end",()=>{try{let J=JSON.parse($)[u];if(!J)q(Error("Error getting version"));F(J)}catch{q(Error("Could not parse version response"))}})}).on("error",(C)=>q(C))})},d4=mZ;var fZ=async({pkg:D,updateCheckInterval:u=86400000,distTag:_="latest",alwaysRun:F,debug:q})=>{g4();let C=m4(D.name);if(F||!C||C<new Date().getTime()-u){let $=await d4(D.name,_);if(f4(D.name),l4.default.gt($,D.version))return $;else if(q)console.error(`Latest version (${$}) not newer than current version (${D.version})`)}else if(q)console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${u}ms but only ${new Date().getTime()-C}ms since last check.`);return!1},c4=fZ;import{promisify as lZ}from"util";var cZ=lZ(dZ),pZ=new Map([["@abacus-ai/deepagent","@abacus-ai/cli"],["deepagent-cli","abacusai-cli"],["@abacus-ai/codellm","@abacus-ai/cli"],["codellm-cli","abacusai-cli"]]);async function i4(D){try{let u=pZ.get(D.name)||D.name,_={...D,name:u};if(await c4({pkg:_}))await iZ(_)}catch(u){throw Error(`Failed to auto upgrade ${D.appName}. To update, install the latest version from ${D.homepage}`)}}async function iZ(D){try{let{command:u,args:_}=await aZ(D);console.log(`${R.dim}Upgrading ${D.appName} to ${D.version} via ${u}...${R.reset}`),await cZ(u,_),console.log(`${R.dim}${D.name}@${D.version} installed successfully${R.reset}`)}catch(u){throw Error(`Failed to install the ${D.appName}@${D.version}: ${u}. To update, install the latest version from ${D.homepage}`)}}async function aZ({name:D,version:u}){try{let _=p4.env.npm_package_json,F=p4.env.npm_config_user_agent;if(Boolean(F?.startsWith("npm"))||Boolean(_?.endsWith("package.json")))return{command:"npm",args:["install","-g",`${D}@${u}`]};if(Boolean(F?.startsWith("yarn")))return{command:"yarn",args:["global","add",`${D}@${u}`]};if(Boolean(F?.startsWith("pnpm")))return{command:"pnpm",args:["install","-g",`${D}@${u}`]};if(Boolean(F?.startsWith("bun")))return{command:"bun",args:["install","-g",`${D}@${u}`]}}catch(_){}return{command:"npm",args:["install","-g",`${D}@${u}`]}}import a4 from"path";async function sZ(){i4(a).catch((_)=>{console.error(_)});let D=await p9(a);if(process.on("beforeExit",async()=>{if(D===void 0)return;await i9(D,a)}),D!==void 0)return await q3(a4.dirname(a4.dirname(D))),n4(a,D);let u=await S5(a);return n4(a,u)}sZ().catch((D)=>{console.error(D),process.exit(1)});function n4(D,u){let _=process.platform==="win32",F=process.argv.slice(2),q=F.includes("--independent")?F:["--independent",...F],C=nZ.spawn(u,q,{stdio:"inherit",shell:_,windowsVerbatimArguments:_});C.on("error",($)=>{console.error(`Failed to start ${D.appName}:`,$),process.exit(1)}),C.on("exit",($,Q)=>{if(Q)process.kill(process.pid,Q);else process.exit($??1)})}
4
+ `+J),_.push(x+"m+"+K1.exports.humanize(this.diff)+"\x1B[0m")}else _[0]=r5()+q+" "+_[0]}function r5(){if(t9.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function e5(..._){return process.stderr.write(V1.formatWithOptions(t9.inspectOpts,..._)+`
5
+ `)}function _q(_){if(_)process.env.DEBUG=_;else delete process.env.DEBUG}function qq(){return process.env.DEBUG}function $q(_){_.inspectOpts={};let q=Object.keys(t9.inspectOpts);for(let $=0;$<q.length;$++)_.inspectOpts[q[$]]=t9.inspectOpts[q[$]]}K1.exports=a2()(t9);var{formatters:o9}=K1.exports;o9.o=function(_){return this.inspectOpts.colors=this.useColors,V1.inspect(_,this.inspectOpts).split(`
6
+ `).map((q)=>q.trim()).join(" ")};o9.O=function(_){return this.inspectOpts.colors=this.useColors,V1.inspect(_,this.inspectOpts)}});var _8=I((nJ,r2)=>{if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)r2.exports=p9();else r2.exports=e9()});var Q8=I((aJ,$8)=>{$8.exports=q8;function q8(_,q){if(_&&q)return q8(_)(q);if(typeof _!=="function")throw TypeError("need wrapper function");return Object.keys(_).forEach(function(Q){$[Q]=_[Q]}),$;function $(){var Q=Array(arguments.length);for(var x=0;x<Q.length;x++)Q[x]=arguments[x];var J=_.apply(this,Q),X=Q[Q.length-1];if(typeof J==="function"&&J!==X)Object.keys(X).forEach(function(V){J[V]=X[V]});return J}}});var _3=I((oJ,e2)=>{var x8=Q8();e2.exports=x8(Z1);e2.exports.strict=x8(J8);Z1.proto=Z1(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Z1(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return J8(this)},configurable:!0})});function Z1(_){var q=function(){if(q.called)return q.value;return q.called=!0,q.value=_.apply(this,arguments)};return q.called=!1,q}function J8(_){var q=function(){if(q.called)throw Error(q.onceError);return q.called=!0,q.value=_.apply(this,arguments)},$=_.name||"Function wrapped with `once`";return q.onceError=$+" shouldn't be called more than once",q.called=!1,q}});var K8=I((tJ,V8)=>{var Gq=_3(),Yq=function(){},Hq=global.Bare?queueMicrotask:process.nextTick.bind(process),Wq=function(_){return _.setHeader&&typeof _.abort==="function"},vq=function(_){return _.stdio&&Array.isArray(_.stdio)&&_.stdio.length===3},X8=function(_,q,$){if(typeof q==="function")return X8(_,null,q);if(!q)q={};$=Gq($||Yq);var{_writableState:Q,_readableState:x}=_,J=q.readable||q.readable!==!1&&_.readable,X=q.writable||q.writable!==!1&&_.writable,V=!1,K=function(){if(!_.writable)G()},G=function(){if(X=!1,!J)$.call(_)},Z=function(){if(J=!1,!X)$.call(_)},Y=function(M){$.call(_,M?Error("exited with error code: "+M):null)},H=function(M){$.call(_,M)},w=function(){Hq(U)},U=function(){if(V)return;if(J&&!(x&&(x.ended&&!x.destroyed)))return $.call(_,Error("premature close"));if(X&&!(Q&&(Q.ended&&!Q.destroyed)))return $.call(_,Error("premature close"))},L=function(){_.req.on("finish",G)};if(Wq(_))if(_.on("complete",G),_.on("abort",w),_.req)L();else _.on("request",L);else if(X&&!Q)_.on("end",K),_.on("close",K);if(vq(_))_.on("exit",Y);if(_.on("end",Z),_.on("finish",G),q.error!==!1)_.on("error",H);return _.on("close",w),function(){if(V=!0,_.removeListener("complete",G),_.removeListener("abort",w),_.removeListener("request",L),_.req)_.req.removeListener("finish",G);_.removeListener("end",K),_.removeListener("close",K),_.removeListener("finish",G),_.removeListener("exit",Y),_.removeListener("end",Z),_.removeListener("error",H),_.removeListener("close",w)}};V8.exports=X8});var Y8=I((rJ,G8)=>{var wq=_3(),Lq=K8(),G1;try{G1=B("fs")}catch(_){}var V6=function(){},zq=typeof process>"u"?!1:/^v?\.0/.test(process.version),Y1=function(_){return typeof _==="function"},Pq=function(_){if(!zq)return!1;if(!G1)return!1;return(_ instanceof(G1.ReadStream||V6)||_ instanceof(G1.WriteStream||V6))&&Y1(_.close)},Mq=function(_){return _.setHeader&&Y1(_.abort)},Uq=function(_,q,$,Q){Q=wq(Q);var x=!1;_.on("close",function(){x=!0}),Lq(_,{readable:q,writable:$},function(X){if(X)return Q(X);x=!0,Q()});var J=!1;return function(X){if(x)return;if(J)return;if(J=!0,Pq(_))return _.close(V6);if(Mq(_))return _.abort();if(Y1(_.destroy))return _.destroy();Q(X||Error("stream was destroyed"))}},Z8=function(_){_()},Oq=function(_,q){return _.pipe(q)},jq=function(){var _=Array.prototype.slice.call(arguments),q=Y1(_[_.length-1]||V6)&&_.pop()||V6;if(Array.isArray(_[0]))_=_[0];if(_.length<2)throw Error("pump requires two streams per minimum");var $,Q=_.map(function(x,J){var X=J<_.length-1,V=J>0;return Uq(x,X,V,function(K){if(!$)$=K;if(K)Q.forEach(Z8);if(X)return;Q.forEach(Z8),q($)})});return _.reduce(Oq)};G8.exports=jq});var W8=I((eJ,H8)=>{var{PassThrough:Bq}=B("stream");H8.exports=(_)=>{_={..._};let{array:q}=_,{encoding:$}=_,Q=$==="buffer",x=!1;if(q)x=!($||Q);else $=$||"utf8";if(Q)$=null;let J=new Bq({objectMode:x});if($)J.setEncoding($);let X=0,V=[];return J.on("data",(K)=>{if(V.push(K),x)X=V.length;else X+=K.length}),J.getBufferedValue=()=>{if(q)return V;return Q?Buffer.concat(V,X):V.join("")},J.getBufferedLength=()=>X,J}});var v8=I((_X,R_)=>{var{constants:Cq}=B("buffer"),Iq=Y8(),Aq=W8();class q3 extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function H1(_,q){if(!_)return Promise.reject(Error("Expected a stream"));q={maxBuffer:1/0,...q};let{maxBuffer:$}=q,Q;return await new Promise((x,J)=>{let X=(V)=>{if(V&&Q.getBufferedLength()<=Cq.MAX_LENGTH)V.bufferedData=Q.getBufferedValue();J(V)};Q=Iq(_,Aq(q),(V)=>{if(V){X(V);return}x()}),Q.on("data",()=>{if(Q.getBufferedLength()>$)X(new q3)})}),Q.getBufferedValue()}R_.exports=H1;R_.exports.default=H1;R_.exports.buffer=(_,q)=>H1(_,{...q,encoding:"buffer"});R_.exports.array=(_,q)=>H1(_,{...q,array:!0});R_.exports.MaxBufferError=q3});var P8=I((qX,z8)=>{z8.exports=W1;function W1(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}W1.prototype.go=function(_){if(this.pending<this.max)L8(this,_);else this.waiting.push(_)};W1.prototype.wait=function(_){if(this.pending===0)_(this.error);else this.listeners.push(_)};W1.prototype.hold=function(){return w8(this)};function w8(_){_.pending+=1;var q=!1;return $;function $(x){if(q)throw Error("callback called twice");if(q=!0,_.error=_.error||x,_.pending-=1,_.waiting.length>0&&_.pending<_.max)L8(_,_.waiting.shift());else if(_.pending===0){var J=_.listeners;_.listeners=[],J.forEach(Q)}}function Q(x){x(_.error)}}function L8(_,q){q(w8(_))}});var U8=I((Dq)=>{var K6=B("fs"),v1=B("util"),$3=B("stream"),M8=$3.Readable,Q3=$3.Writable,Tq=$3.PassThrough,Fq=P8(),w1=B("events").EventEmitter;Dq.createFromBuffer=Rq;Dq.createFromFd=Sq;Dq.BufferSlicer=O0;Dq.FdSlicer=U0;v1.inherits(U0,w1);function U0(_,q){q=q||{},w1.call(this),this.fd=_,this.pend=new Fq,this.pend.max=1,this.refCount=0,this.autoClose=!!q.autoClose}U0.prototype.read=function(_,q,$,Q,x){var J=this;J.pend.go(function(X){K6.read(J.fd,_,q,$,Q,function(V,K,G){X(),x(V,K,G)})})};U0.prototype.write=function(_,q,$,Q,x){var J=this;J.pend.go(function(X){K6.write(J.fd,_,q,$,Q,function(V,K,G){X(),x(V,K,G)})})};U0.prototype.createReadStream=function(_){return new L1(this,_)};U0.prototype.createWriteStream=function(_){return new z1(this,_)};U0.prototype.ref=function(){this.refCount+=1};U0.prototype.unref=function(){var _=this;if(_.refCount-=1,_.refCount>0)return;if(_.refCount<0)throw Error("invalid unref");if(_.autoClose)K6.close(_.fd,q);function q($){if($)_.emit("error",$);else _.emit("close")}};v1.inherits(L1,M8);function L1(_,q){q=q||{},M8.call(this,q),this.context=_,this.context.ref(),this.start=q.start||0,this.endOffset=q.end,this.pos=this.start,this.destroyed=!1}L1.prototype._read=function(_){var q=this;if(q.destroyed)return;var $=Math.min(q._readableState.highWaterMark,_);if(q.endOffset!=null)$=Math.min($,q.endOffset-q.pos);if($<=0){q.destroyed=!0,q.push(null),q.context.unref();return}q.context.pend.go(function(Q){if(q.destroyed)return Q();var x=Buffer.allocUnsafe($);K6.read(q.context.fd,x,0,$,q.pos,function(J,X){if(J)q.destroy(J);else if(X===0)q.destroyed=!0,q.push(null),q.context.unref();else q.pos+=X,q.push(x.slice(0,X));Q()})})};L1.prototype.destroy=function(_){if(this.destroyed)return;_=_||Error("stream destroyed"),this.destroyed=!0,this.emit("error",_),this.context.unref()};v1.inherits(z1,Q3);function z1(_,q){q=q||{},Q3.call(this,q),this.context=_,this.context.ref(),this.start=q.start||0,this.endOffset=q.end==null?1/0:+q.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}z1.prototype._write=function(_,q,$){var Q=this;if(Q.destroyed)return;if(Q.pos+_.length>Q.endOffset){var x=Error("maximum file length exceeded");x.code="ETOOBIG",Q.destroy(),$(x);return}Q.context.pend.go(function(J){if(Q.destroyed)return J();K6.write(Q.context.fd,_,0,_.length,Q.pos,function(X,V){if(X)Q.destroy(),J(),$(X);else Q.bytesWritten+=V,Q.pos+=V,Q.emit("progress"),J(),$()})})};z1.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=!0,this.context.unref()};v1.inherits(O0,w1);function O0(_,q){w1.call(this),q=q||{},this.refCount=0,this.buffer=_,this.maxChunkSize=q.maxChunkSize||Number.MAX_SAFE_INTEGER}O0.prototype.read=function(_,q,$,Q,x){if(!(0<=q&&q<=_.length))throw RangeError("offset outside buffer: 0 <= "+q+" <= "+_.length);if(Q<0)throw RangeError("position is negative: "+Q);if(q+$>_.length)$=_.length-q;if(Q+$>this.buffer.length)$=this.buffer.length-Q;if($<=0){setImmediate(function(){x(null,0)});return}this.buffer.copy(_,q,Q,Q+$),setImmediate(function(){x(null,$)})};O0.prototype.write=function(_,q,$,Q,x){_.copy(this.buffer,Q,q,q+$),setImmediate(function(){x(null,$,_)})};O0.prototype.createReadStream=function(_){_=_||{};var q=new Tq(_);q.destroyed=!1,q.start=_.start||0,q.endOffset=_.end,q.pos=q.endOffset||this.buffer.length;var $=this.buffer.slice(q.start,q.pos),Q=0;while(!0){var x=Q+this.maxChunkSize;if(x>=$.length){if(Q<$.length)q.write($.slice(Q,$.length));break}q.write($.slice(Q,x)),Q=x}return q.end(),q.destroy=function(){q.destroyed=!0},q};O0.prototype.createWriteStream=function(_){var q=this;_=_||{};var $=new Q3(_);return $.start=_.start||0,$.endOffset=_.end==null?this.buffer.length:+_.end,$.bytesWritten=0,$.pos=$.start,$.destroyed=!1,$._write=function(Q,x,J){if($.destroyed)return;var X=$.pos+Q.length;if(X>$.endOffset){var V=Error("maximum file length exceeded");V.code="ETOOBIG",$.destroyed=!0,J(V);return}Q.copy(q.buffer,$.pos,0,Q.length),$.bytesWritten+=Q.length,$.pos=X,$.emit("progress"),J()},$.destroy=function(){$.destroyed=!0},$};O0.prototype.ref=function(){this.refCount+=1};O0.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")};function Rq(_,q){return new O0(_,q)}function Sq(_,q){return new U0(_,q)}});var B8=I((QX,j8)=>{var E0=B("buffer").Buffer,x3=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array<"u")x3=new Int32Array(x3);function O8(_){if(E0.isBuffer(_))return _;var q=typeof E0.alloc==="function"&&typeof E0.from==="function";if(typeof _==="number")return q?E0.alloc(_):new E0(_);else if(typeof _==="string")return q?E0.from(_):new E0(_);else throw Error("input must be buffer, number, or string, received "+typeof _)}function uq(_){var q=O8(4);return q.writeInt32BE(_,0),q}function J3(_,q){if(_=O8(_),E0.isBuffer(q))q=q.readUInt32BE(0);var $=~~q^-1;for(var Q=0;Q<_.length;Q++)$=x3[($^_[Q])&255]^$>>>8;return $^-1}function X3(){return uq(J3.apply(null,arguments))}X3.signed=function(){return J3.apply(null,arguments)};X3.unsigned=function(){return J3.apply(null,arguments)>>>0};j8.exports=X3});var h8=I((dq)=>{var V3=B("fs"),kq=B("zlib"),C8=U8(),mq=B8(),U1=B("util"),O1=B("events").EventEmitter,I8=B("stream").Transform,Z3=B("stream").PassThrough,Eq=B("stream").Writable;dq.open=bq;dq.fromFd=A8;dq.fromBuffer=cq;dq.fromRandomAccessReader=G3;dq.dosDateTimeToDate=R8;dq.getFileNameLowLevel=S8;dq.validateFileName=D8;dq.parseExtraFields=N8;dq.ZipFile=Y0;dq.Entry=Z6;dq.LocalFileHeader=F8;dq.RandomAccessReader=b0;function bq(_,q,$){if(typeof q==="function")$=q,q=null;if(q==null)q={};if(q.autoClose==null)q.autoClose=!0;if(q.lazyEntries==null)q.lazyEntries=!1;if(q.decodeStrings==null)q.decodeStrings=!0;if(q.validateEntrySizes==null)q.validateEntrySizes=!0;if(q.strictFileNames==null)q.strictFileNames=!1;if($==null)$=M1;V3.open(_,"r",function(Q,x){if(Q)return $(Q);A8(x,q,function(J,X){if(J)V3.close(x,M1);$(J,X)})})}function A8(_,q,$){if(typeof q==="function")$=q,q=null;if(q==null)q={};if(q.autoClose==null)q.autoClose=!1;if(q.lazyEntries==null)q.lazyEntries=!1;if(q.decodeStrings==null)q.decodeStrings=!0;if(q.validateEntrySizes==null)q.validateEntrySizes=!0;if(q.strictFileNames==null)q.strictFileNames=!1;if($==null)$=M1;V3.fstat(_,function(Q,x){if(Q)return $(Q);var J=C8.createFromFd(_,{autoClose:!0});G3(J,x.size,q,$)})}function cq(_,q,$){if(typeof q==="function")$=q,q=null;if(q==null)q={};if(q.autoClose=!1,q.lazyEntries==null)q.lazyEntries=!1;if(q.decodeStrings==null)q.decodeStrings=!0;if(q.validateEntrySizes==null)q.validateEntrySizes=!0;if(q.strictFileNames==null)q.strictFileNames=!1;var Q=C8.createFromBuffer(_,{maxChunkSize:65536});G3(Q,_.length,q,$)}function G3(_,q,$,Q){if(typeof $==="function")Q=$,$=null;if($==null)$={};if($.autoClose==null)$.autoClose=!0;if($.lazyEntries==null)$.lazyEntries=!1;if($.decodeStrings==null)$.decodeStrings=!0;var x=!!$.decodeStrings;if($.validateEntrySizes==null)$.validateEntrySizes=!0;if($.strictFileNames==null)$.strictFileNames=!1;if(Q==null)Q=M1;if(typeof q!=="number")throw Error("expected totalSize parameter to be a number");if(q>Number.MAX_SAFE_INTEGER)throw Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");_.ref();var J=22,X=20,V=65535,K=Math.min(X+J+V,q),G=j0(K),Z=q-G.length;D_(_,G,0,K,Z,function(Y){if(Y)return Q(Y);for(var H=K-J;H>=0;H-=1){if(G.readUInt32LE(H)!==101010256)continue;var w=G.subarray(H),U=w.readUInt16LE(4),L=w.readUInt16LE(10),M=w.readUInt32LE(16),E=w.readUInt16LE(20),$0=w.length-J;if(E!==$0)return Q(Error("Invalid comment length. Expected: "+$0+". Found: "+E+". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK☺☻` in the comment?"));var H6=x?P1(w.subarray(22),!1):w.subarray(22);if(H-X>=0&&G.readUInt32LE(H-X)===117853008){var K_=G.subarray(H-X,H-X+X),O3=S_(K_,8),Q0=j0(56);return D_(_,Q0,0,Q0.length,O3,function(W6){if(W6)return Q(W6);if(Q0.readUInt32LE(0)!==101075792)return Q(Error("invalid zip64 end of central directory record signature"));if(U=Q0.readUInt32LE(16),U!==0)return Q(Error("multi-disk zip files are not supported: found disk number: "+U));return L=S_(Q0,32),M=S_(Q0,48),Q(null,new Y0(_,M,q,L,H6,$.autoClose,$.lazyEntries,x,$.validateEntrySizes,$.strictFileNames))})}if(U!==0)return Q(Error("multi-disk zip files are not supported: found disk number: "+U));return Q(null,new Y0(_,M,q,L,H6,$.autoClose,$.lazyEntries,x,$.validateEntrySizes,$.strictFileNames))}Q(Error("End of central directory record signature not found. Either not a zip file, or file is truncated."))})}U1.inherits(Y0,O1);function Y0(_,q,$,Q,x,J,X,V,K,G){var Z=this;if(O1.call(Z),Z.reader=_,Z.reader.on("error",function(Y){T8(Z,Y)}),Z.reader.once("close",function(){Z.emit("close")}),Z.readEntryCursor=q,Z.fileSize=$,Z.entryCount=Q,Z.comment=x,Z.entriesRead=0,Z.autoClose=!!J,Z.lazyEntries=!!X,Z.decodeStrings=!!V,Z.validateEntrySizes=!!K,Z.strictFileNames=!!G,Z.isOpen=!0,Z.emittedError=!1,!Z.lazyEntries)Z._readEntry()}Y0.prototype.close=function(){if(!this.isOpen)return;this.isOpen=!1,this.reader.unref()};function G0(_,q){if(_.autoClose)_.close();T8(_,q)}function T8(_,q){if(_.emittedError)return;_.emittedError=!0,_.emit("error",q)}Y0.prototype.readEntry=function(){if(!this.lazyEntries)throw Error("readEntry() called without lazyEntries:true");this._readEntry()};Y0.prototype._readEntry=function(){var _=this;if(_.entryCount===_.entriesRead){setImmediate(function(){if(_.autoClose)_.close();if(_.emittedError)return;_.emit("end")});return}if(_.emittedError)return;var q=j0(46);D_(_.reader,q,0,q.length,_.readEntryCursor,function($){if($)return G0(_,$);if(_.emittedError)return;var Q=new Z6,x=q.readUInt32LE(0);if(x!==33639248)return G0(_,Error("invalid central directory file header signature: 0x"+x.toString(16)));if(Q.versionMadeBy=q.readUInt16LE(4),Q.versionNeededToExtract=q.readUInt16LE(6),Q.generalPurposeBitFlag=q.readUInt16LE(8),Q.compressionMethod=q.readUInt16LE(10),Q.lastModFileTime=q.readUInt16LE(12),Q.lastModFileDate=q.readUInt16LE(14),Q.crc32=q.readUInt32LE(16),Q.compressedSize=q.readUInt32LE(20),Q.uncompressedSize=q.readUInt32LE(24),Q.fileNameLength=q.readUInt16LE(28),Q.extraFieldLength=q.readUInt16LE(30),Q.fileCommentLength=q.readUInt16LE(32),Q.internalFileAttributes=q.readUInt16LE(36),Q.externalFileAttributes=q.readUInt32LE(38),Q.relativeOffsetOfLocalHeader=q.readUInt32LE(42),Q.generalPurposeBitFlag&64)return G0(_,Error("strong encryption is not supported"));_.readEntryCursor+=46,q=j0(Q.fileNameLength+Q.extraFieldLength+Q.fileCommentLength),D_(_.reader,q,0,q.length,_.readEntryCursor,function(J){if(J)return G0(_,J);if(_.emittedError)return;Q.fileNameRaw=q.subarray(0,Q.fileNameLength);var X=Q.fileNameLength+Q.extraFieldLength;Q.extraFieldRaw=q.subarray(Q.fileNameLength,X),Q.fileCommentRaw=q.subarray(X,X+Q.fileCommentLength);try{Q.extraFields=N8(Q.extraFieldRaw)}catch(L){return G0(_,L)}if(_.decodeStrings){var V=(Q.generalPurposeBitFlag&2048)!==0;Q.fileComment=P1(Q.fileCommentRaw,V),Q.fileName=S8(Q.generalPurposeBitFlag,Q.fileNameRaw,Q.extraFields,_.strictFileNames);var K=D8(Q.fileName);if(K!=null)return G0(_,Error(K))}else Q.fileComment=Q.fileCommentRaw,Q.fileName=Q.fileNameRaw;Q.comment=Q.fileComment,_.readEntryCursor+=q.length,_.entriesRead+=1;for(var G=0;G<Q.extraFields.length;G++){var Z=Q.extraFields[G];if(Z.id!==1)continue;var Y=Z.data,H=0;if(Q.uncompressedSize===4294967295){if(H+8>Y.length)return G0(_,Error("zip64 extended information extra field does not include uncompressed size"));Q.uncompressedSize=S_(Y,H),H+=8}if(Q.compressedSize===4294967295){if(H+8>Y.length)return G0(_,Error("zip64 extended information extra field does not include compressed size"));Q.compressedSize=S_(Y,H),H+=8}if(Q.relativeOffsetOfLocalHeader===4294967295){if(H+8>Y.length)return G0(_,Error("zip64 extended information extra field does not include relative header offset"));Q.relativeOffsetOfLocalHeader=S_(Y,H),H+=8}break}if(_.validateEntrySizes&&Q.compressionMethod===0){var w=Q.uncompressedSize;if(Q.isEncrypted())w+=12;if(Q.compressedSize!==w){var U="compressed/uncompressed size mismatch for stored file: "+Q.compressedSize+" != "+Q.uncompressedSize;return G0(_,Error(U))}}if(_.emit("entry",Q),!_.lazyEntries)_._readEntry()})})};Y0.prototype.openReadStream=function(_,q,$){var Q=this,x=0,J=_.compressedSize;if($==null)$=q,q=null;if(q==null)q={};else{if(q.decrypt!=null){if(!_.isEncrypted())throw Error("options.decrypt can only be specified for encrypted entries");if(q.decrypt!==!1)throw Error("invalid options.decrypt value: "+q.decrypt);if(_.isCompressed()){if(q.decompress!==!1)throw Error("entry is encrypted and compressed, and options.decompress !== false")}}if(q.decompress!=null){if(!_.isCompressed())throw Error("options.decompress can only be specified for compressed entries");if(!(q.decompress===!1||q.decompress===!0))throw Error("invalid options.decompress value: "+q.decompress)}if(q.start!=null||q.end!=null){if(_.isCompressed()&&q.decompress!==!1)throw Error("start/end range not allowed for compressed entry without options.decompress === false");if(_.isEncrypted()&&q.decrypt!==!1)throw Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(q.start!=null){if(x=q.start,x<0)throw Error("options.start < 0");if(x>_.compressedSize)throw Error("options.start > entry.compressedSize")}if(q.end!=null){if(J=q.end,J<0)throw Error("options.end < 0");if(J>_.compressedSize)throw Error("options.end > entry.compressedSize");if(J<x)throw Error("options.end < options.start")}}if(!Q.isOpen)return $(Error("closed"));if(_.isEncrypted()){if(q.decrypt!==!1)return $(Error("entry is encrypted, and options.decrypt !== false"))}var X;if(_.compressionMethod===0)X=!1;else if(_.compressionMethod===8)X=q.decompress!=null?q.decompress:!0;else return $(Error("unsupported compression method: "+_.compressionMethod));Q.readLocalFileHeader(_,{minimal:!0},function(V,K){if(V)return $(V);Q.openReadStreamLowLevel(K.fileDataStart,_.compressedSize,x,J,X,_.uncompressedSize,$)})};Y0.prototype.openReadStreamLowLevel=function(_,q,$,Q,x,J,X){var V=this,K=_+q,G=V.reader.createReadStream({start:_+$,end:_+Q}),Z=G;if(x){var Y=!1,H=kq.createInflateRaw();if(G.on("error",function(w){setImmediate(function(){if(!Y)H.emit("error",w)})}),G.pipe(H),V.validateEntrySizes)Z=new G6(J),H.on("error",function(w){setImmediate(function(){if(!Y)Z.emit("error",w)})}),H.pipe(Z);else Z=H;K3(Z,function(){if(Y=!0,H!==Z)H.unpipe(Z);G.unpipe(H),G.destroy()})}X(null,Z)};Y0.prototype.readLocalFileHeader=function(_,q,$){var Q=this;if($==null)$=q,q=null;if(q==null)q={};Q.reader.ref();var x=j0(30);D_(Q.reader,x,0,x.length,_.relativeOffsetOfLocalHeader,function(J){try{if(J)return $(J);var X=x.readUInt32LE(0);if(X!==67324752)return $(Error("invalid local file header signature: 0x"+X.toString(16)));var V=x.readUInt16LE(26),K=x.readUInt16LE(28),G=_.relativeOffsetOfLocalHeader+30+V+K;if(G+_.compressedSize>Q.fileSize)return $(Error("file data overflows file bounds: "+G+" + "+_.compressedSize+" > "+Q.fileSize));if(q.minimal)return $(null,{fileDataStart:G});var Z=new F8;Z.fileDataStart=G,Z.versionNeededToExtract=x.readUInt16LE(4),Z.generalPurposeBitFlag=x.readUInt16LE(6),Z.compressionMethod=x.readUInt16LE(8),Z.lastModFileTime=x.readUInt16LE(10),Z.lastModFileDate=x.readUInt16LE(12),Z.crc32=x.readUInt32LE(14),Z.compressedSize=x.readUInt32LE(18),Z.uncompressedSize=x.readUInt32LE(22),Z.fileNameLength=V,Z.extraFieldLength=K,x=j0(V+K),Q.reader.ref(),D_(Q.reader,x,0,x.length,_.relativeOffsetOfLocalHeader+30,function(Y){try{if(Y)return $(Y);return Z.fileName=x.subarray(0,V),Z.extraField=x.subarray(V),$(null,Z)}finally{Q.reader.unref()}})}finally{Q.reader.unref()}})};function Z6(){}Z6.prototype.getLastModDate=function(_){if(_==null)_={};if(!_.forceDosFormat)for(var q=0;q<this.extraFields.length;q++){var $=this.extraFields[q];if($.id===21589){var Q=$.data;if(Q.length<5)continue;var x=Q[0],J=1;if(!(x&J))continue;var X=Q.readInt32LE(1);return new Date(X*1000)}else if($.id===10){var Q=$.data,V=4;while(V<Q.length+4){var K=Q.readUInt16LE(V);V+=2;var G=Q.readUInt16LE(V);if(V+=2,K!==1){V+=G;continue}if(G<8||V+G>Q.length)break;var Z=4294967296*Q.readInt32LE(V+4)+Q.readUInt32LE(V),Y=Z/1e4-11644473600000;return new Date(Y)}}}return R8(this.lastModFileDate,this.lastModFileTime,_.timezone)};Z6.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Z6.prototype.isCompressed=function(){return this.compressionMethod===8};function F8(){}function R8(_,q,$){var Q=_&31,x=(_>>5&15)-1,J=(_>>9&127)+1980,X=0,V=(q&31)*2,K=q>>5&63,G=q>>11&31;if($==null||$==="local")return new Date(J,x,Q,G,K,V,X);else if($==="UTC")return new Date(Date.UTC(J,x,Q,G,K,V,X));else throw Error("unrecognized options.timezone: "+options.timezone)}function S8(_,q,$,Q){var x=null;for(var J=0;J<$.length;J++){var X=$[J];if(X.id===28789){if(X.data.length<6)continue;if(X.data.readUInt8(0)!==1)continue;var V=X.data.readUInt32LE(1);if(mq.unsigned(q)!==V)continue;x=P1(X.data.subarray(5),!0);break}}if(x==null){var K=(_&2048)!==0;x=P1(q,K)}if(!Q)x=x.replace(/\\/g,"/");return x}function D8(_){if(_.indexOf("\\")!==-1)return"invalid characters in fileName: "+_;if(/^[a-zA-Z]:/.test(_)||/^\//.test(_))return"absolute path: "+_;if(_.split("/").indexOf("..")!==-1)return"invalid relative path: "+_;return null}function N8(_){var q=[],$=0;while($<_.length-3){var Q=_.readUInt16LE($+0),x=_.readUInt16LE($+2),J=$+4,X=J+x;if(X>_.length)throw Error("extra field length exceeds extra field buffer size");var V=_.subarray(J,X);q.push({id:Q,data:V}),$=X}return q}function D_(_,q,$,Q,x,J){if(Q===0)return setImmediate(function(){J(null,j0(0))});_.read(q,$,Q,x,function(X,V){if(X)return J(X);if(V<Q)return J(Error("unexpected EOF"));J()})}U1.inherits(G6,I8);function G6(_){I8.call(this),this.actualByteCount=0,this.expectedByteCount=_}G6.prototype._transform=function(_,q,$){if(this.actualByteCount+=_.length,this.actualByteCount>this.expectedByteCount){var Q="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return $(Error(Q))}$(null,_)};G6.prototype._flush=function(_){if(this.actualByteCount<this.expectedByteCount){var q="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return _(Error(q))}_()};U1.inherits(b0,O1);function b0(){O1.call(this),this.refCount=0}b0.prototype.ref=function(){this.refCount+=1};b0.prototype.unref=function(){var _=this;if(_.refCount-=1,_.refCount>0)return;if(_.refCount<0)throw Error("invalid unref");_.close(q);function q($){if($)return _.emit("error",$);_.emit("close")}};b0.prototype.createReadStream=function(_){if(_==null)_={};var{start:q,end:$}=_;if(q===$){var Q=new Z3;return setImmediate(function(){Q.end()}),Q}var x=this._readStreamForRange(q,$),J=!1,X=new j1(this);x.on("error",function(K){setImmediate(function(){if(!J)X.emit("error",K)})}),K3(X,function(){x.unpipe(X),X.unref(),x.destroy()});var V=new G6($-q);return X.on("error",function(K){setImmediate(function(){if(!J)V.emit("error",K)})}),K3(V,function(){J=!0,X.unpipe(V),X.destroy()}),x.pipe(X).pipe(V)};b0.prototype._readStreamForRange=function(_,q){throw Error("not implemented")};b0.prototype.read=function(_,q,$,Q,x){var J=this.createReadStream({start:Q,end:Q+$}),X=new Eq,V=0;X._write=function(K,G,Z){K.copy(_,q+V,0,K.length),V+=K.length,Z()},X.on("finish",x),J.on("error",function(K){x(K)}),J.pipe(X)};b0.prototype.close=function(_){setImmediate(_)};U1.inherits(j1,Z3);function j1(_){Z3.call(this),this.context=_,this.context.ref(),this.unreffedYet=!1}j1.prototype._flush=function(_){this.unref(),_()};j1.prototype.unref=function(_){if(this.unreffedYet)return;this.unreffedYet=!0,this.context.unref()};var lq="\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function P1(_,q){if(q)return _.toString("utf8");else{var $="";for(var Q=0;Q<_.length;Q++)$+=lq[_[Q]];return $}}function S_(_,q){var $=_.readUInt32LE(q),Q=_.readUInt32LE(q+4);return Q*4294967296+$}var j0;if(typeof Buffer.allocUnsafe==="function")j0=function(_){return Buffer.allocUnsafe(_)};else j0=function(_){return new Buffer(_)};function K3(_,q){if(typeof _.destroy==="function")_._destroy=function($,Q){if(q(),Q!=null)Q($)};else _.destroy=q}function M1(_){if(_)throw _}});var u8=I((JX,g8)=>{var _0=_8()("extract-zip"),{createWriteStream:$$,promises:N_}=B("fs"),Q$=v8(),J_=B("path"),{promisify:Y3}=B("util"),x$=B("stream"),J$=h8(),X$=Y3(J$.open),V$=Y3(x$.pipeline);class y8{constructor(_,q){this.zipPath=_,this.opts=q}async extract(){return _0("opening",this.zipPath,"with opts",this.opts),this.zipfile=await X$(this.zipPath,{lazyEntries:!0}),this.canceled=!1,new Promise((_,q)=>{this.zipfile.on("error",($)=>{this.canceled=!0,q($)}),this.zipfile.readEntry(),this.zipfile.on("close",()=>{if(!this.canceled)_0("zip extraction complete"),_()}),this.zipfile.on("entry",async($)=>{if(this.canceled){_0("skipping entry",$.fileName,{cancelled:this.canceled});return}if(_0("zipfile entry",$.fileName),$.fileName.startsWith("__MACOSX/")){this.zipfile.readEntry();return}let Q=J_.dirname(J_.join(this.opts.dir,$.fileName));try{await N_.mkdir(Q,{recursive:!0});let x=await N_.realpath(Q);if(J_.relative(this.opts.dir,x).split(J_.sep).includes(".."))throw Error(`Out of bound path "${x}" found while processing file ${$.fileName}`);await this.extractEntry($),_0("finished processing",$.fileName),this.zipfile.readEntry()}catch(x){this.canceled=!0,this.zipfile.close(),q(x)}})})}async extractEntry(_){if(this.canceled){_0("skipping entry extraction",_.fileName,{cancelled:this.canceled});return}if(this.opts.onEntry)this.opts.onEntry(_,this.zipfile);let q=J_.join(this.opts.dir,_.fileName),$=_.externalFileAttributes>>16&65535,Q=61440,x=16384,J=40960,X=($&Q)===J,V=($&Q)===x;if(!V&&_.fileName.endsWith("/"))V=!0;let K=_.versionMadeBy>>8;if(!V)V=K===0&&_.externalFileAttributes===16;_0("extracting entry",{filename:_.fileName,isDir:V,isSymlink:X});let G=this.getExtractedMode($,V)&511,Z=V?q:J_.dirname(q),Y={recursive:!0};if(V)Y.mode=G;if(_0("mkdir",{dir:Z,...Y}),await N_.mkdir(Z,Y),V)return;_0("opening read stream",q);let H=await Y3(this.zipfile.openReadStream.bind(this.zipfile))(_);if(X){let w=await Q$(H);_0("creating symlink",w,q),await N_.symlink(w,q)}else await V$(H,$$(q,{mode:G}))}getExtractedMode(_,q){let $=_;if($===0)if(q){if(this.opts.defaultDirMode)$=parseInt(this.opts.defaultDirMode,10);if(!$)$=493}else{if(this.opts.defaultFileMode)$=parseInt(this.opts.defaultFileMode,10);if(!$)$=420}return $}}g8.exports=async function(_,q){if(_0("creating target directory",q.dir),!J_.isAbsolute(q.dir))throw Error("Target directory is expected to be absolute");return await N_.mkdir(q.dir,{recursive:!0}),q.dir=await N_.realpath(q.dir),new y8(_,q).extract()}});var H3=I((XX,k8)=>{var K$=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(..._)=>console.error("SEMVER",..._):()=>{};k8.exports=K$});var W3=I((VX,m8)=>{var Z$=Number.MAX_SAFE_INTEGER||9007199254740991,G$=["major","premajor","minor","preminor","patch","prepatch","prerelease"];m8.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Z$,RELEASE_TYPES:G$,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var b8=I((H0,E8)=>{var{MAX_SAFE_COMPONENT_LENGTH:v3,MAX_SAFE_BUILD_LENGTH:Y$,MAX_LENGTH:H$}=W3(),W$=H3();H0=E8.exports={};var v$=H0.re=[],w$=H0.safeRe=[],W=H0.src=[],L$=H0.safeSrc=[],v=H0.t={},z$=0,w3="[a-zA-Z0-9-]",P$=[["\\s",1],["\\d",H$],[w3,Y$]],M$=(_)=>{for(let[q,$]of P$)_=_.split(`${q}*`).join(`${q}{0,${$}}`).split(`${q}+`).join(`${q}{1,${$}}`);return _},z=(_,q,$)=>{let Q=M$(q),x=z$++;W$(_,x,q),v[_]=x,W[x]=q,L$[x]=Q,v$[x]=new RegExp(q,$?"g":void 0),w$[x]=new RegExp(Q,$?"g":void 0)};z("NUMERICIDENTIFIER","0|[1-9]\\d*");z("NUMERICIDENTIFIERLOOSE","\\d+");z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w3}*`);z("MAINVERSION",`(${W[v.NUMERICIDENTIFIER]})\\.(${W[v.NUMERICIDENTIFIER]})\\.(${W[v.NUMERICIDENTIFIER]})`);z("MAINVERSIONLOOSE",`(${W[v.NUMERICIDENTIFIERLOOSE]})\\.(${W[v.NUMERICIDENTIFIERLOOSE]})\\.(${W[v.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASEIDENTIFIER",`(?:${W[v.NONNUMERICIDENTIFIER]}|${W[v.NUMERICIDENTIFIER]})`);z("PRERELEASEIDENTIFIERLOOSE",`(?:${W[v.NONNUMERICIDENTIFIER]}|${W[v.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASE",`(?:-(${W[v.PRERELEASEIDENTIFIER]}(?:\\.${W[v.PRERELEASEIDENTIFIER]})*))`);z("PRERELEASELOOSE",`(?:-?(${W[v.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${W[v.PRERELEASEIDENTIFIERLOOSE]})*))`);z("BUILDIDENTIFIER",`${w3}+`);z("BUILD",`(?:\\+(${W[v.BUILDIDENTIFIER]}(?:\\.${W[v.BUILDIDENTIFIER]})*))`);z("FULLPLAIN",`v?${W[v.MAINVERSION]}${W[v.PRERELEASE]}?${W[v.BUILD]}?`);z("FULL",`^${W[v.FULLPLAIN]}$`);z("LOOSEPLAIN",`[v=\\s]*${W[v.MAINVERSIONLOOSE]}${W[v.PRERELEASELOOSE]}?${W[v.BUILD]}?`);z("LOOSE",`^${W[v.LOOSEPLAIN]}$`);z("GTLT","((?:<|>)?=?)");z("XRANGEIDENTIFIERLOOSE",`${W[v.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);z("XRANGEIDENTIFIER",`${W[v.NUMERICIDENTIFIER]}|x|X|\\*`);z("XRANGEPLAIN",`[v=\\s]*(${W[v.XRANGEIDENTIFIER]})(?:\\.(${W[v.XRANGEIDENTIFIER]})(?:\\.(${W[v.XRANGEIDENTIFIER]})(?:${W[v.PRERELEASE]})?${W[v.BUILD]}?)?)?`);z("XRANGEPLAINLOOSE",`[v=\\s]*(${W[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${W[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${W[v.XRANGEIDENTIFIERLOOSE]})(?:${W[v.PRERELEASELOOSE]})?${W[v.BUILD]}?)?)?`);z("XRANGE",`^${W[v.GTLT]}\\s*${W[v.XRANGEPLAIN]}$`);z("XRANGELOOSE",`^${W[v.GTLT]}\\s*${W[v.XRANGEPLAINLOOSE]}$`);z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${v3}})(?:\\.(\\d{1,${v3}}))?(?:\\.(\\d{1,${v3}}))?`);z("COERCE",`${W[v.COERCEPLAIN]}(?:$|[^\\d])`);z("COERCEFULL",W[v.COERCEPLAIN]+`(?:${W[v.PRERELEASE]})?(?:${W[v.BUILD]})?(?:$|[^\\d])`);z("COERCERTL",W[v.COERCE],!0);z("COERCERTLFULL",W[v.COERCEFULL],!0);z("LONETILDE","(?:~>?)");z("TILDETRIM",`(\\s*)${W[v.LONETILDE]}\\s+`,!0);H0.tildeTrimReplace="$1~";z("TILDE",`^${W[v.LONETILDE]}${W[v.XRANGEPLAIN]}$`);z("TILDELOOSE",`^${W[v.LONETILDE]}${W[v.XRANGEPLAINLOOSE]}$`);z("LONECARET","(?:\\^)");z("CARETTRIM",`(\\s*)${W[v.LONECARET]}\\s+`,!0);H0.caretTrimReplace="$1^";z("CARET",`^${W[v.LONECARET]}${W[v.XRANGEPLAIN]}$`);z("CARETLOOSE",`^${W[v.LONECARET]}${W[v.XRANGEPLAINLOOSE]}$`);z("COMPARATORLOOSE",`^${W[v.GTLT]}\\s*(${W[v.LOOSEPLAIN]})$|^$`);z("COMPARATOR",`^${W[v.GTLT]}\\s*(${W[v.FULLPLAIN]})$|^$`);z("COMPARATORTRIM",`(\\s*)${W[v.GTLT]}\\s*(${W[v.LOOSEPLAIN]}|${W[v.XRANGEPLAIN]})`,!0);H0.comparatorTrimReplace="$1$2$3";z("HYPHENRANGE",`^\\s*(${W[v.XRANGEPLAIN]})\\s+-\\s+(${W[v.XRANGEPLAIN]})\\s*$`);z("HYPHENRANGELOOSE",`^\\s*(${W[v.XRANGEPLAINLOOSE]})\\s+-\\s+(${W[v.XRANGEPLAINLOOSE]})\\s*$`);z("STAR","(<|>)?=?\\s*\\*");z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var l8=I((KX,c8)=>{var U$=Object.freeze({loose:!0}),O$=Object.freeze({}),j$=(_)=>{if(!_)return O$;if(typeof _!=="object")return U$;return _};c8.exports=j$});var p8=I((ZX,i8)=>{var d8=/^[0-9]+$/,f8=(_,q)=>{if(typeof _==="number"&&typeof q==="number")return _===q?0:_<q?-1:1;let $=d8.test(_),Q=d8.test(q);if($&&Q)_=+_,q=+q;return _===q?0:$&&!Q?-1:Q&&!$?1:_<q?-1:1},B$=(_,q)=>f8(q,_);i8.exports={compareIdentifiers:f8,rcompareIdentifiers:B$}});var a8=I((GX,n8)=>{var B1=H3(),{MAX_LENGTH:s8,MAX_SAFE_INTEGER:C1}=W3(),{safeRe:I1,t:A1}=b8(),C$=l8(),{compareIdentifiers:L3}=p8();class q0{constructor(_,q){if(q=C$(q),_ instanceof q0)if(_.loose===!!q.loose&&_.includePrerelease===!!q.includePrerelease)return _;else _=_.version;else if(typeof _!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof _}".`);if(_.length>s8)throw TypeError(`version is longer than ${s8} characters`);B1("SemVer",_,q),this.options=q,this.loose=!!q.loose,this.includePrerelease=!!q.includePrerelease;let $=_.trim().match(q.loose?I1[A1.LOOSE]:I1[A1.FULL]);if(!$)throw TypeError(`Invalid Version: ${_}`);if(this.raw=_,this.major=+$[1],this.minor=+$[2],this.patch=+$[3],this.major>C1||this.major<0)throw TypeError("Invalid major version");if(this.minor>C1||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>C1||this.patch<0)throw TypeError("Invalid patch version");if(!$[4])this.prerelease=[];else this.prerelease=$[4].split(".").map((Q)=>{if(/^[0-9]+$/.test(Q)){let x=+Q;if(x>=0&&x<C1)return x}return Q});this.build=$[5]?$[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(_){if(B1("SemVer.compare",this.version,this.options,_),!(_ instanceof q0)){if(typeof _==="string"&&_===this.version)return 0;_=new q0(_,this.options)}if(_.version===this.version)return 0;return this.compareMain(_)||this.comparePre(_)}compareMain(_){if(!(_ instanceof q0))_=new q0(_,this.options);if(this.major<_.major)return-1;if(this.major>_.major)return 1;if(this.minor<_.minor)return-1;if(this.minor>_.minor)return 1;if(this.patch<_.patch)return-1;if(this.patch>_.patch)return 1;return 0}comparePre(_){if(!(_ instanceof q0))_=new q0(_,this.options);if(this.prerelease.length&&!_.prerelease.length)return-1;else if(!this.prerelease.length&&_.prerelease.length)return 1;else if(!this.prerelease.length&&!_.prerelease.length)return 0;let q=0;do{let $=this.prerelease[q],Q=_.prerelease[q];if(B1("prerelease compare",q,$,Q),$===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if($===void 0)return-1;else if($===Q)continue;else return L3($,Q)}while(++q)}compareBuild(_){if(!(_ instanceof q0))_=new q0(_,this.options);let q=0;do{let $=this.build[q],Q=_.build[q];if(B1("build compare",q,$,Q),$===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if($===void 0)return-1;else if($===Q)continue;else return L3($,Q)}while(++q)}inc(_,q,$){if(_.startsWith("pre")){if(!q&&$===!1)throw Error("invalid increment argument: identifier is empty");if(q){let Q=`-${q}`.match(this.options.loose?I1[A1.PRERELEASELOOSE]:I1[A1.PRERELEASE]);if(!Q||Q[1]!==q)throw Error(`invalid identifier: ${q}`)}}switch(_){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",q,$);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",q,$);break;case"prepatch":this.prerelease.length=0,this.inc("patch",q,$),this.inc("pre",q,$);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",q,$);this.inc("pre",q,$);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let Q=Number($)?1:0;if(this.prerelease.length===0)this.prerelease=[Q];else{let x=this.prerelease.length;while(--x>=0)if(typeof this.prerelease[x]==="number")this.prerelease[x]++,x=-2;if(x===-1){if(q===this.prerelease.join(".")&&$===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(Q)}}if(q){let x=[q,Q];if($===!1)x=[q];if(L3(this.prerelease[0],q)===0){if(isNaN(this.prerelease[1]))this.prerelease=x}else this.prerelease=x}break}default:throw Error(`invalid increment argument: ${_}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}n8.exports=q0});var r8=I((YX,t8)=>{var o8=a8(),I$=(_,q,$)=>new o8(_,$).compare(new o8(q,$));t8.exports=I$});var _4=I((HX,e8)=>{var A$=r8(),T$=(_,q,$)=>A$(_,q,$)<0;e8.exports=T$});import o$ from"child_process";var x4=v6(S1(),1);import h$ from"path";import y$ from"fs";import J4 from"fs/promises";import F1 from"os";import p4 from"events";import m from"fs";import{EventEmitter as u1}from"node:events";import g3 from"node:stream";import{StringDecoder as u4}from"node:string_decoder";var D3=typeof process==="object"&&process?process:{stdout:null,stderr:null},k4=(_)=>!!_&&typeof _==="object"&&(_ instanceof c||_ instanceof g3||m4(_)||E4(_)),m4=(_)=>!!_&&typeof _==="object"&&_ instanceof u1&&typeof _.pipe==="function"&&_.pipe!==g3.Writable.prototype.pipe,E4=(_)=>!!_&&typeof _==="object"&&_ instanceof u1&&typeof _.write==="function"&&typeof _.end==="function",W0=Symbol("EOF"),v0=Symbol("maybeEmitEnd"),B0=Symbol("emittedEnd"),L6=Symbol("emittingEnd"),g_=Symbol("emittedError"),z6=Symbol("closed"),N3=Symbol("read"),P6=Symbol("flush"),h3=Symbol("flushChunk"),a=Symbol("encoding"),G_=Symbol("decoder"),S=Symbol("flowing"),u_=Symbol("paused"),Y_=Symbol("resume"),D=Symbol("buffer"),k=Symbol("pipes"),N=Symbol("bufferLength"),D1=Symbol("bufferPush"),M6=Symbol("bufferShift"),y=Symbol("objectMode"),T=Symbol("destroyed"),N1=Symbol("error"),h1=Symbol("emitData"),y3=Symbol("emitEnd"),y1=Symbol("emitEnd2"),x0=Symbol("async"),g1=Symbol("abort"),U6=Symbol("aborted"),k_=Symbol("signal"),l0=Symbol("dataListeners"),b=Symbol("discarded"),m_=(_)=>Promise.resolve().then(_),b4=(_)=>_(),c4=(_)=>_==="end"||_==="finish"||_==="prefinish",l4=(_)=>_ instanceof ArrayBuffer||!!_&&typeof _==="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,d4=(_)=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_);class k1{src;dest;opts;ondrain;constructor(_,q,$){this.src=_,this.dest=q,this.opts=$,this.ondrain=()=>_[Y_](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(_){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class u3 extends k1{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(_,q,$){super(_,q,$);this.proxyErrors=(Q)=>q.emit("error",Q),_.on("error",this.proxyErrors)}}var f4=(_)=>!!_.objectMode,i4=(_)=>!_.objectMode&&!!_.encoding&&_.encoding!=="buffer";class c extends u1{[S]=!1;[u_]=!1;[k]=[];[D]=[];[y];[a];[x0];[G_];[W0]=!1;[B0]=!1;[L6]=!1;[z6]=!1;[g_]=null;[N]=0;[T]=!1;[k_];[U6]=!1;[l0]=0;[b]=!1;writable=!0;readable=!0;constructor(..._){let q=_[0]||{};super();if(q.objectMode&&typeof q.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(f4(q))this[y]=!0,this[a]=null;else if(i4(q))this[a]=q.encoding,this[y]=!1;else this[y]=!1,this[a]=null;if(this[x0]=!!q.async,this[G_]=this[a]?new u4(this[a]):null,q&&q.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[D]});if(q&&q.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[k]});let{signal:$}=q;if($)if(this[k_]=$,$.aborted)this[g1]();else $.addEventListener("abort",()=>this[g1]())}get bufferLength(){return this[N]}get encoding(){return this[a]}set encoding(_){throw Error("Encoding must be set at instantiation time")}setEncoding(_){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[y]}set objectMode(_){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[x0]}set["async"](_){this[x0]=this[x0]||!!_}[g1](){this[U6]=!0,this.emit("abort",this[k_]?.reason),this.destroy(this[k_]?.reason)}get aborted(){return this[U6]}set aborted(_){}write(_,q,$){if(this[U6])return!1;if(this[W0])throw Error("write after end");if(this[T])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof q==="function")$=q,q="utf8";if(!q)q="utf8";let Q=this[x0]?m_:b4;if(!this[y]&&!Buffer.isBuffer(_)){if(d4(_))_=Buffer.from(_.buffer,_.byteOffset,_.byteLength);else if(l4(_))_=Buffer.from(_);else if(typeof _!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[y]){if(this[S]&&this[N]!==0)this[P6](!0);if(this[S])this.emit("data",_);else this[D1](_);if(this[N]!==0)this.emit("readable");if($)Q($);return this[S]}if(!_.length){if(this[N]!==0)this.emit("readable");if($)Q($);return this[S]}if(typeof _==="string"&&!(q===this[a]&&!this[G_]?.lastNeed))_=Buffer.from(_,q);if(Buffer.isBuffer(_)&&this[a])_=this[G_].write(_);if(this[S]&&this[N]!==0)this[P6](!0);if(this[S])this.emit("data",_);else this[D1](_);if(this[N]!==0)this.emit("readable");if($)Q($);return this[S]}read(_){if(this[T])return null;if(this[b]=!1,this[N]===0||_===0||_&&_>this[N])return this[v0](),null;if(this[y])_=null;if(this[D].length>1&&!this[y])this[D]=[this[a]?this[D].join(""):Buffer.concat(this[D],this[N])];let q=this[N3](_||null,this[D][0]);return this[v0](),q}[N3](_,q){if(this[y])this[M6]();else{let $=q;if(_===$.length||_===null)this[M6]();else if(typeof $==="string")this[D][0]=$.slice(_),q=$.slice(0,_),this[N]-=_;else this[D][0]=$.subarray(_),q=$.subarray(0,_),this[N]-=_}if(this.emit("data",q),!this[D].length&&!this[W0])this.emit("drain");return q}end(_,q,$){if(typeof _==="function")$=_,_=void 0;if(typeof q==="function")$=q,q="utf8";if(_!==void 0)this.write(_,q);if($)this.once("end",$);if(this[W0]=!0,this.writable=!1,this[S]||!this[u_])this[v0]();return this}[Y_](){if(this[T])return;if(!this[l0]&&!this[k].length)this[b]=!0;if(this[u_]=!1,this[S]=!0,this.emit("resume"),this[D].length)this[P6]();else if(this[W0])this[v0]();else this.emit("drain")}resume(){return this[Y_]()}pause(){this[S]=!1,this[u_]=!0,this[b]=!1}get destroyed(){return this[T]}get flowing(){return this[S]}get paused(){return this[u_]}[D1](_){if(this[y])this[N]+=1;else this[N]+=_.length;this[D].push(_)}[M6](){if(this[y])this[N]-=1;else this[N]-=this[D][0].length;return this[D].shift()}[P6](_=!1){do;while(this[h3](this[M6]())&&this[D].length);if(!_&&!this[D].length&&!this[W0])this.emit("drain")}[h3](_){return this.emit("data",_),this[S]}pipe(_,q){if(this[T])return _;this[b]=!1;let $=this[B0];if(q=q||{},_===D3.stdout||_===D3.stderr)q.end=!1;else q.end=q.end!==!1;if(q.proxyErrors=!!q.proxyErrors,$){if(q.end)_.end()}else if(this[k].push(!q.proxyErrors?new k1(this,_,q):new u3(this,_,q)),this[x0])m_(()=>this[Y_]());else this[Y_]();return _}unpipe(_){let q=this[k].find(($)=>$.dest===_);if(q){if(this[k].length===1){if(this[S]&&this[l0]===0)this[S]=!1;this[k]=[]}else this[k].splice(this[k].indexOf(q),1);q.unpipe()}}addListener(_,q){return this.on(_,q)}on(_,q){let $=super.on(_,q);if(_==="data"){if(this[b]=!1,this[l0]++,!this[k].length&&!this[S])this[Y_]()}else if(_==="readable"&&this[N]!==0)super.emit("readable");else if(c4(_)&&this[B0])super.emit(_),this.removeAllListeners(_);else if(_==="error"&&this[g_]){let Q=q;if(this[x0])m_(()=>Q.call(this,this[g_]));else Q.call(this,this[g_])}return $}removeListener(_,q){return this.off(_,q)}off(_,q){let $=super.off(_,q);if(_==="data"){if(this[l0]=this.listeners("data").length,this[l0]===0&&!this[b]&&!this[k].length)this[S]=!1}return $}removeAllListeners(_){let q=super.removeAllListeners(_);if(_==="data"||_===void 0){if(this[l0]=0,!this[b]&&!this[k].length)this[S]=!1}return q}get emittedEnd(){return this[B0]}[v0](){if(!this[L6]&&!this[B0]&&!this[T]&&this[D].length===0&&this[W0]){if(this[L6]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[z6])this.emit("close");this[L6]=!1}}emit(_,...q){let $=q[0];if(_!=="error"&&_!=="close"&&_!==T&&this[T])return!1;else if(_==="data")return!this[y]&&!$?!1:this[x0]?(m_(()=>this[h1]($)),!0):this[h1]($);else if(_==="end")return this[y3]();else if(_==="close"){if(this[z6]=!0,!this[B0]&&!this[T])return!1;let x=super.emit("close");return this.removeAllListeners("close"),x}else if(_==="error"){this[g_]=$,super.emit(N1,$);let x=!this[k_]||this.listeners("error").length?super.emit("error",$):!1;return this[v0](),x}else if(_==="resume"){let x=super.emit("resume");return this[v0](),x}else if(_==="finish"||_==="prefinish"){let x=super.emit(_);return this.removeAllListeners(_),x}let Q=super.emit(_,...q);return this[v0](),Q}[h1](_){for(let $ of this[k])if($.dest.write(_)===!1)this.pause();let q=this[b]?!1:super.emit("data",_);return this[v0](),q}[y3](){if(this[B0])return!1;return this[B0]=!0,this.readable=!1,this[x0]?(m_(()=>this[y1]()),!0):this[y1]()}[y1](){if(this[G_]){let q=this[G_].end();if(q){for(let $ of this[k])$.dest.write(q);if(!this[b])super.emit("data",q)}}for(let q of this[k])q.end();let _=super.emit("end");return this.removeAllListeners("end"),_}async collect(){let _=Object.assign([],{dataLength:0});if(!this[y])_.dataLength=0;let q=this.promise();return this.on("data",($)=>{if(_.push($),!this[y])_.dataLength+=$.length}),await q,_}async concat(){if(this[y])throw Error("cannot concat in objectMode");let _=await this.collect();return this[a]?_.join(""):Buffer.concat(_,_.dataLength)}async promise(){return new Promise((_,q)=>{this.on(T,()=>q(Error("stream destroyed"))),this.on("error",($)=>q($)),this.on("end",()=>_())})}[Symbol.asyncIterator](){this[b]=!1;let _=!1,q=async()=>{return this.pause(),_=!0,{value:void 0,done:!0}};return{next:()=>{if(_)return q();let Q=this.read();if(Q!==null)return Promise.resolve({done:!1,value:Q});if(this[W0])return q();let x,J,X=(Z)=>{this.off("data",V),this.off("end",K),this.off(T,G),q(),J(Z)},V=(Z)=>{this.off("error",X),this.off("end",K),this.off(T,G),this.pause(),x({value:Z,done:!!this[W0]})},K=()=>{this.off("error",X),this.off("data",V),this.off(T,G),q(),x({done:!0,value:void 0})},G=()=>X(Error("stream destroyed"));return new Promise((Z,Y)=>{J=Y,x=Z,this.once(T,G),this.once("error",X),this.once("end",K),this.once("data",V)})},throw:q,return:q,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[b]=!1;let _=!1,q=()=>{return this.pause(),this.off(N1,q),this.off(T,q),this.off("end",q),_=!0,{done:!0,value:void 0}},$=()=>{if(_)return q();let Q=this.read();return Q===null?q():{done:!1,value:Q}};return this.once("end",q),this.once(N1,q),this.once(T,q),{next:$,throw:q,return:q,[Symbol.iterator](){return this}}}destroy(_){if(this[T]){if(_)this.emit("error",_);else this.emit(T);return this}this[T]=!0,this[b]=!0,this[D].length=0,this[N]=0;let q=this;if(typeof q.close==="function"&&!this[z6])q.close();if(_)this.emit("error",_);else this.emit(T);return this}static get isStream(){return k4}}var s4=m.writev,I0=Symbol("_autoClose"),t=Symbol("_close"),E_=Symbol("_ended"),j=Symbol("_fd"),m1=Symbol("_finished"),L0=Symbol("_flags"),E1=Symbol("_flush"),d1=Symbol("_handleChunk"),f1=Symbol("_makeBuf"),c_=Symbol("_mode"),O6=Symbol("_needDrain"),v_=Symbol("_onerror"),w_=Symbol("_onopen"),b1=Symbol("_onread"),H_=Symbol("_onwrite"),A0=Symbol("_open"),o=Symbol("_path"),C0=Symbol("_pos"),J0=Symbol("_queue"),W_=Symbol("_read"),c1=Symbol("_readSize"),w0=Symbol("_reading"),b_=Symbol("_remain"),l1=Symbol("_size"),j6=Symbol("_write"),d0=Symbol("_writing"),B6=Symbol("_defaultFlag"),f0=Symbol("_errored");class L_ extends c{[f0]=!1;[j];[o];[c1];[w0]=!1;[l1];[b_];[I0];constructor(_,q){q=q||{};super(q);if(this.readable=!0,this.writable=!1,typeof _!=="string")throw TypeError("path must be a string");if(this[f0]=!1,this[j]=typeof q.fd==="number"?q.fd:void 0,this[o]=_,this[c1]=q.readSize||16777216,this[w0]=!1,this[l1]=typeof q.size==="number"?q.size:1/0,this[b_]=this[l1],this[I0]=typeof q.autoClose==="boolean"?q.autoClose:!0,typeof this[j]==="number")this[W_]();else this[A0]()}get fd(){return this[j]}get path(){return this[o]}write(){throw TypeError("this is a readable stream")}end(){throw TypeError("this is a readable stream")}[A0](){m.open(this[o],"r",(_,q)=>this[w_](_,q))}[w_](_,q){if(_)this[v_](_);else this[j]=q,this.emit("open",q),this[W_]()}[f1](){return Buffer.allocUnsafe(Math.min(this[c1],this[b_]))}[W_](){if(!this[w0]){this[w0]=!0;let _=this[f1]();if(_.length===0)return process.nextTick(()=>this[b1](null,0,_));m.read(this[j],_,0,_.length,null,(q,$,Q)=>this[b1](q,$,Q))}}[b1](_,q,$){if(this[w0]=!1,_)this[v_](_);else if(this[d1](q,$))this[W_]()}[t](){if(this[I0]&&typeof this[j]==="number"){let _=this[j];this[j]=void 0,m.close(_,(q)=>q?this.emit("error",q):this.emit("close"))}}[v_](_){this[w0]=!0,this[t](),this.emit("error",_)}[d1](_,q){let $=!1;if(this[b_]-=_,_>0)$=super.write(_<q.length?q.subarray(0,_):q);if(_===0||this[b_]<=0)$=!1,this[t](),super.end();return $}emit(_,...q){switch(_){case"prefinish":case"finish":return!1;case"drain":if(typeof this[j]==="number")this[W_]();return!1;case"error":if(this[f0])return!1;return this[f0]=!0,super.emit(_,...q);default:return super.emit(_,...q)}}}class i1 extends L_{[A0](){let _=!0;try{this[w_](null,m.openSync(this[o],"r")),_=!1}finally{if(_)this[t]()}}[W_](){let _=!0;try{if(!this[w0]){this[w0]=!0;do{let q=this[f1](),$=q.length===0?0:m.readSync(this[j],q,0,q.length,null);if(!this[d1]($,q))break}while(!0);this[w0]=!1}_=!1}finally{if(_)this[t]()}}[t](){if(this[I0]&&typeof this[j]==="number"){let _=this[j];this[j]=void 0,m.closeSync(_),this.emit("close")}}}class T0 extends p4{readable=!1;writable=!0;[f0]=!1;[d0]=!1;[E_]=!1;[J0]=[];[O6]=!1;[o];[c_];[I0];[j];[B6];[L0];[m1]=!1;[C0];constructor(_,q){q=q||{};super(q);this[o]=_,this[j]=typeof q.fd==="number"?q.fd:void 0,this[c_]=q.mode===void 0?438:q.mode,this[C0]=typeof q.start==="number"?q.start:void 0,this[I0]=typeof q.autoClose==="boolean"?q.autoClose:!0;let $=this[C0]!==void 0?"r+":"w";if(this[B6]=q.flags===void 0,this[L0]=q.flags===void 0?$:q.flags,this[j]===void 0)this[A0]()}emit(_,...q){if(_==="error"){if(this[f0])return!1;this[f0]=!0}return super.emit(_,...q)}get fd(){return this[j]}get path(){return this[o]}[v_](_){this[t](),this[d0]=!0,this.emit("error",_)}[A0](){m.open(this[o],this[L0],this[c_],(_,q)=>this[w_](_,q))}[w_](_,q){if(this[B6]&&this[L0]==="r+"&&_&&_.code==="ENOENT")this[L0]="w",this[A0]();else if(_)this[v_](_);else if(this[j]=q,this.emit("open",q),!this[d0])this[E1]()}end(_,q){if(_)this.write(_,q);if(this[E_]=!0,!this[d0]&&!this[J0].length&&typeof this[j]==="number")this[H_](null,0);return this}write(_,q){if(typeof _==="string")_=Buffer.from(_,q);if(this[E_])return this.emit("error",Error("write() after end()")),!1;if(this[j]===void 0||this[d0]||this[J0].length)return this[J0].push(_),this[O6]=!0,!1;return this[d0]=!0,this[j6](_),!0}[j6](_){m.write(this[j],_,0,_.length,this[C0],(q,$)=>this[H_](q,$))}[H_](_,q){if(_)this[v_](_);else{if(this[C0]!==void 0&&typeof q==="number")this[C0]+=q;if(this[J0].length)this[E1]();else if(this[d0]=!1,this[E_]&&!this[m1])this[m1]=!0,this[t](),this.emit("finish");else if(this[O6])this[O6]=!1,this.emit("drain")}}[E1](){if(this[J0].length===0){if(this[E_])this[H_](null,0)}else if(this[J0].length===1)this[j6](this[J0].pop());else{let _=this[J0];this[J0]=[],s4(this[j],_,this[C0],(q,$)=>this[H_](q,$))}}[t](){if(this[I0]&&typeof this[j]==="number"){let _=this[j];this[j]=void 0,m.close(_,(q)=>q?this.emit("error",q):this.emit("close"))}}}class l_ extends T0{[A0](){let _;if(this[B6]&&this[L0]==="r+")try{_=m.openSync(this[o],this[L0],this[c_])}catch(q){if(q?.code==="ENOENT")return this[L0]="w",this[A0]();else throw q}else _=m.openSync(this[o],this[L0],this[c_]);this[w_](null,_)}[t](){if(this[I0]&&typeof this[j]==="number"){let _=this[j];this[j]=void 0,m.closeSync(_),this.emit("close")}}[j6](_){let q=!0;try{this[H_](null,m.writeSync(this[j],_,0,_.length,this[C0])),q=!1}finally{if(q)try{this[t]()}catch{}}}}import L9 from"node:path";import M_ from"node:fs";import{dirname as C7,parse as I7}from"path";var n4=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),k3=(_)=>!!_.sync&&!!_.file,m3=(_)=>!_.sync&&!!_.file,E3=(_)=>!!_.sync&&!_.file,b3=(_)=>!_.sync&&!_.file;var c3=(_)=>!!_.file;var a4=(_)=>{let q=n4.get(_);if(q)return q;return _},d_=(_={})=>{if(!_)return{};let q={};for(let[$,Q]of Object.entries(_)){let x=a4($);q[x]=Q}if(q.chmod===void 0&&q.noChmod===!1)q.chmod=!0;return delete q.noChmod,q};var X0=(_,q,$,Q,x)=>{return Object.assign((J=[],X,V)=>{if(Array.isArray(J))X=J,J={};if(typeof X==="function")V=X,X=void 0;if(!X)X=[];else X=Array.from(X);let K=d_(J);if(x?.(K,X),k3(K)){if(typeof V==="function")throw TypeError("callback not supported for sync tar functions");return _(K,X)}else if(m3(K)){let G=q(K,X),Z=V?V:void 0;return Z?G.then(()=>Z(),Z):G}else if(E3(K)){if(typeof V==="function")throw TypeError("callback not supported for sync tar functions");return $(K,X)}else if(b3(K)){if(typeof V==="function")throw TypeError("callback only supported with file option");return Q(K,X)}else throw Error("impossible options??")},{syncFile:_,asyncFile:q,syncNoFile:$,asyncNoFile:Q,validate:x})};import{EventEmitter as U7}from"events";import a1 from"assert";import{Buffer as i0}from"buffer";import*as l3 from"zlib";import o4 from"zlib";var t4=o4.constants||{ZLIB_VERNUM:4736},f=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},t4));var r4=i0.concat,d3=Object.getOwnPropertyDescriptor(i0,"concat"),e4=(_)=>_,s1=d3?.writable===!0||d3?.set!==void 0?(_)=>{i0.concat=_?e4:r4}:(_)=>{},p0=Symbol("_superWrite");class f_ extends Error{code;errno;constructor(_,q){super("zlib: "+_.message,{cause:_});if(this.code=_.code,this.errno=_.errno,!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+_.message,Error.captureStackTrace(this,q??this.constructor)}get name(){return"ZlibError"}}var n1=Symbol("flushFlag");class C6 extends c{#_=!1;#$=!1;#Q;#J;#x;#q;#X;get sawError(){return this.#_}get handle(){return this.#q}get flushFlag(){return this.#Q}constructor(_,q){if(!_||typeof _!=="object")throw TypeError("invalid options for ZlibBase constructor");super(_);if(this.#Q=_.flush??0,this.#J=_.finishFlush??0,this.#x=_.fullFlushFlag??0,typeof l3[q]!=="function")throw TypeError("Compression method not supported: "+q);try{this.#q=new l3[q](_)}catch($){throw new f_($,this.constructor)}this.#X=($)=>{if(this.#_)return;this.#_=!0,this.close(),this.emit("error",$)},this.#q?.on("error",($)=>this.#X(new f_($))),this.once("end",()=>this.close)}close(){if(this.#q)this.#q.close(),this.#q=void 0,this.emit("close")}reset(){if(!this.#_)return a1(this.#q,"zlib binding closed"),this.#q.reset?.()}flush(_){if(this.ended)return;if(typeof _!=="number")_=this.#x;this.write(Object.assign(i0.alloc(0),{[n1]:_}))}end(_,q,$){if(typeof _==="function")$=_,q=void 0,_=void 0;if(typeof q==="function")$=q,q=void 0;if(_)if(q)this.write(_,q);else this.write(_);return this.flush(this.#J),this.#$=!0,super.end($)}get ended(){return this.#$}[p0](_){return super.write(_)}write(_,q,$){if(typeof q==="function")$=q,q="utf8";if(typeof _==="string")_=i0.from(_,q);if(this.#_)return;a1(this.#q,"zlib binding closed");let Q=this.#q._handle,x=Q.close;Q.close=()=>{};let J=this.#q.close;this.#q.close=()=>{},s1(!0);let X=void 0;try{let K=typeof _[n1]==="number"?_[n1]:this.#Q;X=this.#q._processChunk(_,K),s1(!1)}catch(K){s1(!1),this.#X(new f_(K,this.write))}finally{if(this.#q)this.#q._handle=Q,Q.close=x,this.#q.close=J,this.#q.removeAllListeners("error")}if(this.#q)this.#q.on("error",(K)=>this.#X(new f_(K,this.write)));let V;if(X)if(Array.isArray(X)&&X.length>0){let K=X[0];V=this[p0](i0.from(K));for(let G=1;G<X.length;G++)V=this[p0](X[G])}else V=this[p0](i0.from(X));if($)$();return V}}class o1 extends C6{#_;#$;constructor(_,q){_=_||{},_.flush=_.flush||f.Z_NO_FLUSH,_.finishFlush=_.finishFlush||f.Z_FINISH,_.fullFlushFlag=f.Z_FULL_FLUSH;super(_,q);this.#_=_.level,this.#$=_.strategy}params(_,q){if(this.sawError)return;if(!this.handle)throw Error("cannot switch params when binding is closed");if(!this.handle.params)throw Error("not supported in this implementation");if(this.#_!==_||this.#$!==q){this.flush(f.Z_SYNC_FLUSH),a1(this.handle,"zlib binding closed");let $=this.handle.flush;this.handle.flush=(Q,x)=>{if(typeof Q==="function")x=Q,Q=this.flushFlag;this.flush(Q),x?.()};try{this.handle.params(_,q)}finally{this.handle.flush=$}if(this.handle)this.#_=_,this.#$=q}}}class t1 extends o1{#_;constructor(_){super(_,"Gzip");this.#_=_&&!!_.portable}[p0](_){if(!this.#_)return super[p0](_);return this.#_=!1,_[9]=255,super[p0](_)}}class r1 extends o1{constructor(_){super(_,"Unzip")}}class e1 extends C6{constructor(_,q){_=_||{},_.flush=_.flush||f.BROTLI_OPERATION_PROCESS,_.finishFlush=_.finishFlush||f.BROTLI_OPERATION_FINISH,_.fullFlushFlag=f.BROTLI_OPERATION_FLUSH;super(_,q)}}class _2 extends e1{constructor(_){super(_,"BrotliCompress")}}class q2 extends e1{constructor(_){super(_,"BrotliDecompress")}}class $2 extends C6{constructor(_,q){_=_||{},_.flush=_.flush||f.ZSTD_e_continue,_.finishFlush=_.finishFlush||f.ZSTD_e_end,_.fullFlushFlag=f.ZSTD_e_flush;super(_,q)}}class Q2 extends $2{constructor(_){super(_,"ZstdCompress")}}class x2 extends $2{constructor(_){super(_,"ZstdDecompress")}}import{posix as z_}from"node:path";var f3=(_,q)=>{if(!Number.isSafeInteger(_))throw Error("cannot encode number outside of javascript safe integer range");else if(_<0)$7(_,q);else q7(_,q);return q},q7=(_,q)=>{q[0]=128;for(var $=q.length;$>1;$--)q[$-1]=_&255,_=Math.floor(_/256)},$7=(_,q)=>{q[0]=255;var $=!1;_=_*-1;for(var Q=q.length;Q>1;Q--){var x=_&255;if(_=Math.floor(_/256),$)q[Q-1]=p3(x);else if(x===0)q[Q-1]=0;else $=!0,q[Q-1]=s3(x)}},i3=(_)=>{let q=_[0],$=q===128?x7(_.subarray(1,_.length)):q===255?Q7(_):null;if($===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger($))throw Error("parsed number outside of javascript safe integer range");return $},Q7=(_)=>{var q=_.length,$=0,Q=!1;for(var x=q-1;x>-1;x--){var J=Number(_[x]),X;if(Q)X=p3(J);else if(J===0)X=J;else Q=!0,X=s3(J);if(X!==0)$-=X*Math.pow(256,q-x-1)}return $},x7=(_)=>{var q=_.length,$=0;for(var Q=q-1;Q>-1;Q--){var x=Number(_[Q]);if(x!==0)$+=x*Math.pow(256,q-Q-1)}return $},p3=(_)=>(255^_)&255,s3=(_)=>(255^_)+1&255;var I6=(_)=>A6.has(_);var A6=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),n3=new Map(Array.from(A6).map((_)=>[_[1],_[0]]));class i{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#_="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(_,q=0,$,Q){if(Buffer.isBuffer(_))this.decode(_,q||0,$,Q);else if(_)this.#$(_)}decode(_,q,$,Q){if(!q)q=0;if(!_||!(_.length>=q+512))throw Error("need 512 bytes for header");if(this.path=$?.path??s0(_,q,100),this.mode=$?.mode??Q?.mode??F0(_,q+100,8),this.uid=$?.uid??Q?.uid??F0(_,q+108,8),this.gid=$?.gid??Q?.gid??F0(_,q+116,8),this.size=$?.size??Q?.size??F0(_,q+124,12),this.mtime=$?.mtime??Q?.mtime??J2(_,q+136,12),this.cksum=F0(_,q+148,12),Q)this.#$(Q,!0);if($)this.#$($);let x=s0(_,q+156,1);if(I6(x))this.#_=x||"0";if(this.#_==="0"&&this.path.slice(-1)==="/")this.#_="5";if(this.#_==="5")this.size=0;if(this.linkpath=s0(_,q+157,100),_.subarray(q+257,q+265).toString()==="ustar\x0000")if(this.uname=$?.uname??Q?.uname??s0(_,q+265,32),this.gname=$?.gname??Q?.gname??s0(_,q+297,32),this.devmaj=$?.devmaj??Q?.devmaj??F0(_,q+329,8)??0,this.devmin=$?.devmin??Q?.devmin??F0(_,q+337,8)??0,_[q+475]!==0){let X=s0(_,q+345,155);this.path=X+"/"+this.path}else{let X=s0(_,q+345,130);if(X)this.path=X+"/"+this.path;this.atime=$?.atime??Q?.atime??J2(_,q+476,12),this.ctime=$?.ctime??Q?.ctime??J2(_,q+488,12)}let J=256;for(let X=q;X<q+148;X++)J+=_[X];for(let X=q+156;X<q+512;X++)J+=_[X];if(this.cksumValid=J===this.cksum,this.cksum===void 0&&J===256)this.nullBlock=!0}#$(_,q=!1){Object.assign(this,Object.fromEntries(Object.entries(_).filter(([$,Q])=>{return!(Q===null||Q===void 0||$==="path"&&q||$==="linkpath"&&q||$==="global")})))}encode(_,q=0){if(!_)_=this.block=Buffer.alloc(512);if(this.#_==="Unsupported")this.#_="0";if(!(_.length>=q+512))throw Error("need 512 bytes for header");let $=this.ctime||this.atime?130:155,Q=X7(this.path||"",$),x=Q[0],J=Q[1];if(this.needPax=!!Q[2],this.needPax=n0(_,q,100,x)||this.needPax,this.needPax=R0(_,q+100,8,this.mode)||this.needPax,this.needPax=R0(_,q+108,8,this.uid)||this.needPax,this.needPax=R0(_,q+116,8,this.gid)||this.needPax,this.needPax=R0(_,q+124,12,this.size)||this.needPax,this.needPax=X2(_,q+136,12,this.mtime)||this.needPax,_[q+156]=this.#_.charCodeAt(0),this.needPax=n0(_,q+157,100,this.linkpath)||this.needPax,_.write("ustar\x0000",q+257,8),this.needPax=n0(_,q+265,32,this.uname)||this.needPax,this.needPax=n0(_,q+297,32,this.gname)||this.needPax,this.needPax=R0(_,q+329,8,this.devmaj)||this.needPax,this.needPax=R0(_,q+337,8,this.devmin)||this.needPax,this.needPax=n0(_,q+345,$,J)||this.needPax,_[q+475]!==0)this.needPax=n0(_,q+345,155,J)||this.needPax;else this.needPax=n0(_,q+345,130,J)||this.needPax,this.needPax=X2(_,q+476,12,this.atime)||this.needPax,this.needPax=X2(_,q+488,12,this.ctime)||this.needPax;let X=256;for(let V=q;V<q+148;V++)X+=_[V];for(let V=q+156;V<q+512;V++)X+=_[V];return this.cksum=X,R0(_,q+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#_==="Unsupported"?this.#_:A6.get(this.#_)}get typeKey(){return this.#_}set type(_){let q=String(n3.get(_));if(I6(q)||q==="Unsupported")this.#_=q;else if(I6(_))this.#_=_;else throw TypeError("invalid entry type: "+_)}}var X7=(_,q)=>{let Q=_,x="",J=void 0,X=z_.parse(_).root||".";if(Buffer.byteLength(Q)<100)J=[Q,x,!1];else{x=z_.dirname(Q),Q=z_.basename(Q);do if(Buffer.byteLength(Q)<=100&&Buffer.byteLength(x)<=q)J=[Q,x,!1];else if(Buffer.byteLength(Q)>100&&Buffer.byteLength(x)<=q)J=[Q.slice(0,99),x,!0];else Q=z_.join(z_.basename(x),Q),x=z_.dirname(x);while(x!==X&&J===void 0);if(!J)J=[_.slice(0,99),"",!0]}return J},s0=(_,q,$)=>_.subarray(q,q+$).toString("utf8").replace(/\0.*/,""),J2=(_,q,$)=>V7(F0(_,q,$)),V7=(_)=>_===void 0?void 0:new Date(_*1000),F0=(_,q,$)=>Number(_[q])&128?i3(_.subarray(q,q+$)):Z7(_,q,$),K7=(_)=>isNaN(_)?void 0:_,Z7=(_,q,$)=>K7(parseInt(_.subarray(q,q+$).toString("utf8").replace(/\0.*$/,"").trim(),8)),G7={12:8589934591,8:2097151},R0=(_,q,$,Q)=>Q===void 0?!1:Q>G7[$]||Q<0?(f3(Q,_.subarray(q,q+$)),!0):(Y7(_,q,$,Q),!1),Y7=(_,q,$,Q)=>_.write(H7(Q,$),q,$,"ascii"),H7=(_,q)=>W7(Math.floor(_).toString(8),q),W7=(_,q)=>(_.length===q-1?_:Array(q-_.length-1).join("0")+_+" ")+"\x00",X2=(_,q,$,Q)=>Q===void 0?!1:R0(_,q,$,Q.getTime()/1000),v7=Array(156).join("\x00"),n0=(_,q,$,Q)=>Q===void 0?!1:(_.write(Q+v7,q,$,"utf8"),Q.length!==Buffer.byteLength(Q)||Q.length>$);import{basename as w7}from"node:path";class S0{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(_,q=!1){this.atime=_.atime,this.charset=_.charset,this.comment=_.comment,this.ctime=_.ctime,this.dev=_.dev,this.gid=_.gid,this.global=q,this.gname=_.gname,this.ino=_.ino,this.linkpath=_.linkpath,this.mtime=_.mtime,this.nlink=_.nlink,this.path=_.path,this.size=_.size,this.uid=_.uid,this.uname=_.uname}encode(){let _=this.encodeBody();if(_==="")return Buffer.allocUnsafe(0);let q=Buffer.byteLength(_),$=512*Math.ceil(1+q/512),Q=Buffer.allocUnsafe($);for(let x=0;x<512;x++)Q[x]=0;new i({path:("PaxHeader/"+w7(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:q,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(Q),Q.write(_,512,q,"utf8");for(let x=q+512;x<Q.length;x++)Q[x]=0;return Q}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(_){if(this[_]===void 0)return"";let q=this[_],$=q instanceof Date?q.getTime()/1000:q,Q=" "+(_==="dev"||_==="ino"||_==="nlink"?"SCHILY.":"")+_+"="+$+`
7
+ `,x=Buffer.byteLength(Q),J=Math.floor(Math.log(x)/Math.log(10))+1;if(x+J>=Math.pow(10,J))J+=1;return J+x+Q}static parse(_,q,$=!1){return new S0(L7(z7(_),q),$)}}var L7=(_,q)=>q?Object.assign({},q,_):_,z7=(_)=>_.replace(/\n$/,"").split(`
8
+ `).reduce(P7,Object.create(null)),P7=(_,q)=>{let $=parseInt(q,10);if($!==Buffer.byteLength(q)+1)return _;q=q.slice(($+" ").length);let Q=q.split("="),x=Q.shift();if(!x)return _;let J=x.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),X=Q.join("=");return _[J]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(J)?new Date(Number(X)*1000):/^[0-9]+$/.test(X)?+X:X,_};var M7=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,P=M7!=="win32"?(_)=>_:(_)=>_&&_.replace(/\\/g,"/");class i_ extends c{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(_,q,$){super({});switch(this.pause(),this.extended=q,this.globalExtended=$,this.header=_,this.remain=_.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=_.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!_.path)throw Error("no path provided for tar.ReadEntry");if(this.path=P(_.path),this.mode=_.mode,this.mode)this.mode=this.mode&4095;if(this.uid=_.uid,this.gid=_.gid,this.uname=_.uname,this.gname=_.gname,this.size=this.remain,this.mtime=_.mtime,this.atime=_.atime,this.ctime=_.ctime,this.linkpath=_.linkpath?P(_.linkpath):void 0,this.uname=_.uname,this.gname=_.gname,q)this.#_(q);if($)this.#_($,!0)}write(_){let q=_.length;if(q>this.blockRemain)throw Error("writing more to entry than is appropriate");let $=this.remain,Q=this.blockRemain;if(this.remain=Math.max(0,$-q),this.blockRemain=Math.max(0,Q-q),this.ignore)return!0;if($>=q)return super.write(_);return super.write(_.subarray(0,$))}#_(_,q=!1){if(_.path)_.path=P(_.path);if(_.linkpath)_.linkpath=P(_.linkpath);Object.assign(this,Object.fromEntries(Object.entries(_).filter(([$,Q])=>{return!(Q===null||Q===void 0||$==="path"&&q)})))}}var a0=(_,q,$,Q={})=>{if(_.file)Q.file=_.file;if(_.cwd)Q.cwd=_.cwd;if(Q.code=$ instanceof Error&&$.code||q,Q.tarCode=q,!_.strict&&Q.recoverable!==!1){if($ instanceof Error)Q=Object.assign($,Q),$=$.message;_.emit("warn",q,$,Q)}else if($ instanceof Error)_.emit("error",Object.assign($,Q));else _.emit("error",Object.assign(Error(`${q}: ${$}`),Q))};var O7=1048576,Y2=Buffer.from([31,139]),H2=Buffer.from([40,181,47,253]),j7=Math.max(Y2.length,H2.length),p=Symbol("state"),o0=Symbol("writeEntry"),z0=Symbol("readEntry"),V2=Symbol("nextEntry"),o3=Symbol("processEntry"),V0=Symbol("extendedHeader"),p_=Symbol("globalExtendedHeader"),D0=Symbol("meta"),t3=Symbol("emitMeta"),C=Symbol("buffer"),P0=Symbol("queue"),N0=Symbol("ended"),K2=Symbol("emittedEnd"),t0=Symbol("emit"),F=Symbol("unzip"),T6=Symbol("consumeChunk"),F6=Symbol("consumeChunkSub"),Z2=Symbol("consumeBody"),r3=Symbol("consumeMeta"),e3=Symbol("consumeHeader"),s_=Symbol("consuming"),G2=Symbol("bufferConcat"),R6=Symbol("maybeEnd"),P_=Symbol("writing"),h0=Symbol("aborted"),S6=Symbol("onDone"),r0=Symbol("sawValidEntry"),D6=Symbol("sawNullBlock"),N6=Symbol("sawEOF"),_9=Symbol("closeStream"),B7=()=>!0;class y0 extends U7{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[P0]=[];[C];[z0];[o0];[p]="begin";[D0]="";[V0];[p_];[N0]=!1;[F];[h0]=!1;[r0];[D6]=!1;[N6]=!1;[P_]=!1;[s_]=!1;[K2]=!1;constructor(_={}){super();if(this.file=_.file||"",this.on(S6,()=>{if(this[p]==="begin"||this[r0]===!1)this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),_.ondone)this.on(S6,_.ondone);else this.on(S6,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")});this.strict=!!_.strict,this.maxMetaEntrySize=_.maxMetaEntrySize||O7,this.filter=typeof _.filter==="function"?_.filter:B7;let q=_.file&&(_.file.endsWith(".tar.br")||_.file.endsWith(".tbr"));this.brotli=!(_.gzip||_.zstd)&&_.brotli!==void 0?_.brotli:q?void 0:!1;let $=_.file&&(_.file.endsWith(".tar.zst")||_.file.endsWith(".tzst"));if(this.zstd=!(_.gzip||_.brotli)&&_.zstd!==void 0?_.zstd:$?!0:void 0,this.on("end",()=>this[_9]()),typeof _.onwarn==="function")this.on("warn",_.onwarn);if(typeof _.onReadEntry==="function")this.on("entry",_.onReadEntry)}warn(_,q,$={}){a0(this,_,q,$)}[e3](_,q){if(this[r0]===void 0)this[r0]=!1;let $;try{$=new i(_,q,this[V0],this[p_])}catch(Q){return this.warn("TAR_ENTRY_INVALID",Q)}if($.nullBlock)if(this[D6]){if(this[N6]=!0,this[p]==="begin")this[p]="header";this[t0]("eof")}else this[D6]=!0,this[t0]("nullBlock");else if(this[D6]=!1,!$.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:$});else if(!$.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:$});else{let Q=$.type;if(/^(Symbolic)?Link$/.test(Q)&&!$.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:$});else if(!/^(Symbolic)?Link$/.test(Q)&&!/^(Global)?ExtendedHeader$/.test(Q)&&$.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:$});else{let x=this[o0]=new i_($,this[V0],this[p_]);if(!this[r0])if(x.remain){let J=()=>{if(!x.invalid)this[r0]=!0};x.on("end",J)}else this[r0]=!0;if(x.meta){if(x.size>this.maxMetaEntrySize)x.ignore=!0,this[t0]("ignoredEntry",x),this[p]="ignore",x.resume();else if(x.size>0)this[D0]="",x.on("data",(J)=>this[D0]+=J),this[p]="meta"}else if(this[V0]=void 0,x.ignore=x.ignore||!this.filter(x.path,x),x.ignore)this[t0]("ignoredEntry",x),this[p]=x.remain?"ignore":"header",x.resume();else{if(x.remain)this[p]="body";else this[p]="header",x.end();if(!this[z0])this[P0].push(x),this[V2]();else this[P0].push(x)}}}}[_9](){queueMicrotask(()=>this.emit("close"))}[o3](_){let q=!0;if(!_)this[z0]=void 0,q=!1;else if(Array.isArray(_)){let[$,...Q]=_;this.emit($,...Q)}else if(this[z0]=_,this.emit("entry",_),!_.emittedEnd)_.on("end",()=>this[V2]()),q=!1;return q}[V2](){do;while(this[o3](this[P0].shift()));if(!this[P0].length){let _=this[z0];if(!_||_.flowing||_.size===_.remain){if(!this[P_])this.emit("drain")}else _.once("drain",()=>this.emit("drain"))}}[Z2](_,q){let $=this[o0];if(!$)throw Error("attempt to consume body without entry??");let Q=$.blockRemain??0,x=Q>=_.length&&q===0?_:_.subarray(q,q+Q);if($.write(x),!$.blockRemain)this[p]="header",this[o0]=void 0,$.end();return x.length}[r3](_,q){let $=this[o0],Q=this[Z2](_,q);if(!this[o0]&&$)this[t3]($);return Q}[t0](_,q,$){if(!this[P0].length&&!this[z0])this.emit(_,q,$);else this[P0].push([_,q,$])}[t3](_){switch(this[t0]("meta",this[D0]),_.type){case"ExtendedHeader":case"OldExtendedHeader":this[V0]=S0.parse(this[D0],this[V0],!1);break;case"GlobalExtendedHeader":this[p_]=S0.parse(this[D0],this[p_],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let q=this[V0]??Object.create(null);this[V0]=q,q.path=this[D0].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let q=this[V0]||Object.create(null);this[V0]=q,q.linkpath=this[D0].replace(/\0.*/,"");break}default:throw Error("unknown meta: "+_.type)}}abort(_){this[h0]=!0,this.emit("abort",_),this.warn("TAR_ABORT",_,{recoverable:!1})}write(_,q,$){if(typeof q==="function")$=q,q=void 0;if(typeof _==="string")_=Buffer.from(_,typeof q==="string"?q:"utf8");if(this[h0])return $?.(),!1;if((this[F]===void 0||this.brotli===void 0&&this[F]===!1)&&_){if(this[C])_=Buffer.concat([this[C],_]),this[C]=void 0;if(_.length<j7)return this[C]=_,$?.(),!0;for(let V=0;this[F]===void 0&&V<Y2.length;V++)if(_[V]!==Y2[V])this[F]=!1;let J=!1;if(this[F]===!1&&this.zstd!==!1){J=!0;for(let V=0;V<H2.length;V++)if(_[V]!==H2[V]){J=!1;break}}let X=this.brotli===void 0&&!J;if(this[F]===!1&&X)if(_.length<512)if(this[N0])this.brotli=!0;else return this[C]=_,$?.(),!0;else try{new i(_.subarray(0,512)),this.brotli=!1}catch(V){this.brotli=!0}if(this[F]===void 0||this[F]===!1&&(this.brotli||J)){let V=this[N0];this[N0]=!1,this[F]=this[F]===void 0?new r1({}):J?new x2({}):new q2({}),this[F].on("data",(G)=>this[T6](G)),this[F].on("error",(G)=>this.abort(G)),this[F].on("end",()=>{this[N0]=!0,this[T6]()}),this[P_]=!0;let K=!!this[F][V?"end":"write"](_);return this[P_]=!1,$?.(),K}}if(this[P_]=!0,this[F])this[F].write(_);else this[T6](_);this[P_]=!1;let x=this[P0].length?!1:this[z0]?this[z0].flowing:!0;if(!x&&!this[P0].length)this[z0]?.once("drain",()=>this.emit("drain"));return $?.(),x}[G2](_){if(_&&!this[h0])this[C]=this[C]?Buffer.concat([this[C],_]):_}[R6](){if(this[N0]&&!this[K2]&&!this[h0]&&!this[s_]){this[K2]=!0;let _=this[o0];if(_&&_.blockRemain){let q=this[C]?this[C].length:0;if(this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${_.blockRemain} more bytes, only ${q} available)`,{entry:_}),this[C])_.write(this[C]);_.end()}this[t0](S6)}}[T6](_){if(this[s_]&&_)this[G2](_);else if(!_&&!this[C])this[R6]();else if(_){if(this[s_]=!0,this[C]){this[G2](_);let q=this[C];this[C]=void 0,this[F6](q)}else this[F6](_);while(this[C]&&this[C]?.length>=512&&!this[h0]&&!this[N6]){let q=this[C];this[C]=void 0,this[F6](q)}this[s_]=!1}if(!this[C]||this[N0])this[R6]()}[F6](_){let q=0,$=_.length;while(q+512<=$&&!this[h0]&&!this[N6])switch(this[p]){case"begin":case"header":this[e3](_,q),q+=512;break;case"ignore":case"body":q+=this[Z2](_,q);break;case"meta":q+=this[r3](_,q);break;default:throw Error("invalid state: "+this[p])}if(q<$)if(this[C])this[C]=Buffer.concat([_.subarray(q),this[C]]);else this[C]=_.subarray(q)}end(_,q,$){if(typeof _==="function")$=_,q=void 0,_=void 0;if(typeof q==="function")$=q,q=void 0;if(typeof _==="string")_=Buffer.from(_,q);if($)this.once("finish",$);if(!this[h0])if(this[F]){if(_)this[F].write(_);this[F].end()}else{if(this[N0]=!0,this.brotli===void 0||this.zstd===void 0)_=_||Buffer.alloc(0);if(_)this.write(_);this[R6]()}return this}}var g0=(_)=>{let q=_.length-1,$=-1;while(q>-1&&_.charAt(q)==="/")$=q,q--;return $===-1?_:_.slice(0,$)};var A7=(_)=>{let q=_.onReadEntry;_.onReadEntry=q?($)=>{q($),$.resume()}:($)=>$.resume()},W2=(_,q)=>{let $=new Map(q.map((J)=>[g0(J),!0])),Q=_.filter,x=(J,X="")=>{let V=X||I7(J).root||".",K;if(J===V)K=!1;else{let G=$.get(J);if(G!==void 0)K=G;else K=x(C7(J),V)}return $.set(J,K),K};_.filter=Q?(J,X)=>Q(J,X)&&x(g0(J)):(J)=>x(g0(J))},T7=(_)=>{let q=new y0(_),$=_.file,Q;try{Q=M_.openSync($,"r");let x=M_.fstatSync(Q),J=_.maxReadSize||16777216;if(x.size<J){let X=Buffer.allocUnsafe(x.size),V=M_.readSync(Q,X,0,x.size,0);q.end(V===X.byteLength?X:X.subarray(0,V))}else{let X=0,V=Buffer.allocUnsafe(J);while(X<x.size){let K=M_.readSync(Q,V,0,J,X);if(K===0)break;X+=K,q.write(V.subarray(0,K))}q.end()}}finally{if(typeof Q==="number")try{M_.closeSync(Q)}catch(x){}}},F7=(_,q)=>{let $=new y0(_),Q=_.maxReadSize||16777216,x=_.file;return new Promise((X,V)=>{$.on("error",V),$.on("end",X),M_.stat(x,(K,G)=>{if(K)V(K);else{let Z=new L_(x,{readSize:Q,size:G.size});Z.on("error",V),Z.pipe($)}})})},e0=X0(T7,F7,(_)=>new y0(_),(_)=>new y0(_),(_,q)=>{if(q?.length)W2(_,q);if(!_.noResume)A7(_)});import f6 from"fs";import K0 from"fs";import x9 from"path";var v2=(_,q,$)=>{if(_&=4095,$)_=(_|384)&-19;if(q){if(_&256)_|=64;if(_&32)_|=8;if(_&4)_|=1}return _};import{win32 as R7}from"node:path";var{isAbsolute:S7,parse:q9}=R7,n_=(_)=>{let q="",$=q9(_);while(S7(_)||$.root){let Q=_.charAt(0)==="/"&&_.slice(0,4)!=="//?/"?"/":$.root;_=_.slice(Q.length),q+=Q,$=q9(_)}return[q,_]};var h6=["|","<",">","?",":"],w2=h6.map((_)=>String.fromCharCode(61440+_.charCodeAt(0))),D7=new Map(h6.map((_,q)=>[_,w2[q]])),N7=new Map(w2.map((_,q)=>[_,h6[q]])),L2=(_)=>h6.reduce((q,$)=>q.split($).join(D7.get($)),_),$9=(_)=>w2.reduce((q,$)=>q.split($).join(N7.get($)),_);var Z9=(_,q)=>{if(!q)return P(_);return _=P(_).replace(/^\.(\/|$)/,""),g0(q)+"/"+_},h7=16777216,J9=Symbol("process"),X9=Symbol("file"),V9=Symbol("directory"),P2=Symbol("symlink"),K9=Symbol("hardlink"),a_=Symbol("header"),y6=Symbol("read"),M2=Symbol("lstat"),g6=Symbol("onlstat"),U2=Symbol("onread"),O2=Symbol("onreadlink"),j2=Symbol("openfile"),B2=Symbol("onopenfile"),u0=Symbol("close"),u6=Symbol("mode"),C2=Symbol("awaitDrain"),z2=Symbol("ondrain"),Z0=Symbol("prefix");class k6 extends c{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#_=!1;constructor(_,q={}){let $=d_(q);super();if(this.path=P(_),this.portable=!!$.portable,this.maxReadSize=$.maxReadSize||h7,this.linkCache=$.linkCache||new Map,this.statCache=$.statCache||new Map,this.preservePaths=!!$.preservePaths,this.cwd=P($.cwd||process.cwd()),this.strict=!!$.strict,this.noPax=!!$.noPax,this.noMtime=!!$.noMtime,this.mtime=$.mtime,this.prefix=$.prefix?P($.prefix):void 0,this.onWriteEntry=$.onWriteEntry,typeof $.onwarn==="function")this.on("warn",$.onwarn);let Q=!1;if(!this.preservePaths){let[J,X]=n_(this.path);if(J&&typeof X==="string")this.path=X,Q=J}if(this.win32=!!$.win32||process.platform==="win32",this.win32)this.path=$9(this.path.replace(/\\/g,"/")),_=_.replace(/\\/g,"/");if(this.absolute=P($.absolute||x9.resolve(this.cwd,_)),this.path==="")this.path="./";if(Q)this.warn("TAR_ENTRY_INFO",`stripping ${Q} from absolute path`,{entry:this,path:Q+this.path});let x=this.statCache.get(this.absolute);if(x)this[g6](x);else this[M2]()}warn(_,q,$={}){return a0(this,_,q,$)}emit(_,...q){if(_==="error")this.#_=!0;return super.emit(_,...q)}[M2](){K0.lstat(this.absolute,(_,q)=>{if(_)return this.emit("error",_);this[g6](q)})}[g6](_){if(this.statCache.set(this.absolute,_),this.stat=_,!_.isFile())_.size=0;this.type=y7(_),this.emit("stat",_),this[J9]()}[J9](){switch(this.type){case"File":return this[X9]();case"Directory":return this[V9]();case"SymbolicLink":return this[P2]();default:return this.end()}}[u6](_){return v2(_,this.type==="Directory",this.portable)}[Z0](_){return Z9(_,this.prefix)}[a_](){if(!this.stat)throw Error("cannot write header before stat");if(this.type==="Directory"&&this.portable)this.noMtime=!0;if(this.onWriteEntry?.(this),this.header=new i({path:this[Z0](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Z0](this.linkpath):this.linkpath,mode:this[u6](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax)super.write(new S0({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[Z0](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Z0](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let _=this.header?.block;if(!_)throw Error("failed to encode header");super.write(_)}[V9](){if(!this.stat)throw Error("cannot create directory entry without stat");if(this.path.slice(-1)!=="/")this.path+="/";this.stat.size=0,this[a_](),this.end()}[P2](){K0.readlink(this.absolute,(_,q)=>{if(_)return this.emit("error",_);this[O2](q)})}[O2](_){this.linkpath=P(_),this[a_](),this.end()}[K9](_){if(!this.stat)throw Error("cannot create link entry without stat");this.type="Link",this.linkpath=P(x9.relative(this.cwd,_)),this.stat.size=0,this[a_](),this.end()}[X9](){if(!this.stat)throw Error("cannot create file entry without stat");if(this.stat.nlink>1){let _=`${this.stat.dev}:${this.stat.ino}`,q=this.linkCache.get(_);if(q?.indexOf(this.cwd)===0)return this[K9](q);this.linkCache.set(_,this.absolute)}if(this[a_](),this.stat.size===0)return this.end();this[j2]()}[j2](){K0.open(this.absolute,"r",(_,q)=>{if(_)return this.emit("error",_);this[B2](q)})}[B2](_){if(this.fd=_,this.#_)return this[u0]();if(!this.stat)throw Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let q=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(q),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[y6]()}[y6](){let{fd:_,buf:q,offset:$,length:Q,pos:x}=this;if(_===void 0||q===void 0)throw Error("cannot read file without first opening");K0.read(_,q,$,Q,x,(J,X)=>{if(J)return this[u0](()=>this.emit("error",J));this[U2](X)})}[u0](_=()=>{}){if(this.fd!==void 0)K0.close(this.fd,_)}[U2](_){if(_<=0&&this.remain>0){let Q=Object.assign(Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[u0](()=>this.emit("error",Q))}if(_>this.remain){let Q=Object.assign(Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[u0](()=>this.emit("error",Q))}if(!this.buf)throw Error("should have created buffer prior to reading");if(_===this.remain)for(let Q=_;Q<this.length&&_<this.blockRemain;Q++)this.buf[Q+this.offset]=0,_++,this.remain++;let q=this.offset===0&&_===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+_);if(!this.write(q))this[C2](()=>this[z2]());else this[z2]()}[C2](_){this.once("drain",_)}write(_,q,$){if(typeof q==="function")$=q,q=void 0;if(typeof _==="string")_=Buffer.from(_,typeof q==="string"?q:"utf8");if(this.blockRemain<_.length){let Q=Object.assign(Error("writing more data than expected"),{path:this.absolute});return this.emit("error",Q)}return this.remain-=_.length,this.blockRemain-=_.length,this.pos+=_.length,this.offset+=_.length,super.write(_,null,$)}[z2](){if(!this.remain){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));return this[u0]((_)=>_?this.emit("error",_):this.end())}if(!this.buf)throw Error("buffer lost somehow in ONDRAIN");if(this.offset>=this.length)this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0;this.length=this.buf.length-this.offset,this[y6]()}}class I2 extends k6{sync=!0;[M2](){this[g6](K0.lstatSync(this.absolute))}[P2](){this[O2](K0.readlinkSync(this.absolute))}[j2](){this[B2](K0.openSync(this.absolute,"r"))}[y6](){let _=!0;try{let{fd:q,buf:$,offset:Q,length:x,pos:J}=this;if(q===void 0||$===void 0)throw Error("fd and buf must be set in READ method");let X=K0.readSync(q,$,Q,x,J);this[U2](X),_=!1}finally{if(_)try{this[u0](()=>{})}catch(q){}}}[C2](_){_()}[u0](_=()=>{}){if(this.fd!==void 0)K0.closeSync(this.fd);_()}}class A2 extends c{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(_,q,$={}){return a0(this,_,q,$)}constructor(_,q={}){let $=d_(q);super();this.preservePaths=!!$.preservePaths,this.portable=!!$.portable,this.strict=!!$.strict,this.noPax=!!$.noPax,this.noMtime=!!$.noMtime,this.onWriteEntry=$.onWriteEntry,this.readEntry=_;let{type:Q}=_;if(Q==="Unsupported")throw Error("writing entry that should be ignored");if(this.type=Q,this.type==="Directory"&&this.portable)this.noMtime=!0;if(this.prefix=$.prefix,this.path=P(_.path),this.mode=_.mode!==void 0?this[u6](_.mode):void 0,this.uid=this.portable?void 0:_.uid,this.gid=this.portable?void 0:_.gid,this.uname=this.portable?void 0:_.uname,this.gname=this.portable?void 0:_.gname,this.size=_.size,this.mtime=this.noMtime?void 0:$.mtime||_.mtime,this.atime=this.portable?void 0:_.atime,this.ctime=this.portable?void 0:_.ctime,this.linkpath=_.linkpath!==void 0?P(_.linkpath):void 0,typeof $.onwarn==="function")this.on("warn",$.onwarn);let x=!1;if(!this.preservePaths){let[X,V]=n_(this.path);if(X&&typeof V==="string")this.path=V,x=X}if(this.remain=_.size,this.blockRemain=_.startBlockSize,this.onWriteEntry?.(this),this.header=new i({path:this[Z0](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Z0](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),x)this.warn("TAR_ENTRY_INFO",`stripping ${x} from absolute path`,{entry:this,path:x+this.path});if(this.header.encode()&&!this.noPax)super.write(new S0({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[Z0](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Z0](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let J=this.header?.block;if(!J)throw Error("failed to encode header");super.write(J),_.pipe(this)}[Z0](_){return Z9(_,this.prefix)}[u6](_){return v2(_,this.type==="Directory",this.portable)}write(_,q,$){if(typeof q==="function")$=q,q=void 0;if(typeof _==="string")_=Buffer.from(_,typeof q==="string"?q:"utf8");let Q=_.length;if(Q>this.blockRemain)throw Error("writing more to entry than is appropriate");return this.blockRemain-=Q,super.write(_,$)}end(_,q,$){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));if(typeof _==="function")$=_,q=void 0,_=void 0;if(typeof q==="function")$=q,q=void 0;if(typeof _==="string")_=Buffer.from(_,q??"utf8");if($)this.once("finish",$);return _?super.end(_,$):super.end($),this}}var y7=(_)=>_.isFile()?"File":_.isDirectory()?"Directory":_.isSymbolicLink()?"SymbolicLink":"Unsupported";class k0{tail;head;length=0;static create(_=[]){return new k0(_)}constructor(_=[]){for(let q of _)this.push(q)}*[Symbol.iterator](){for(let _=this.head;_;_=_.next)yield _.value}removeNode(_){if(_.list!==this)throw Error("removing node which does not belong to this list");let{next:q,prev:$}=_;if(q)q.prev=$;if($)$.next=q;if(_===this.head)this.head=q;if(_===this.tail)this.tail=$;return this.length--,_.next=void 0,_.prev=void 0,_.list=void 0,q}unshiftNode(_){if(_===this.head)return;if(_.list)_.list.removeNode(_);let q=this.head;if(_.list=this,_.next=q,q)q.prev=_;if(this.head=_,!this.tail)this.tail=_;this.length++}pushNode(_){if(_===this.tail)return;if(_.list)_.list.removeNode(_);let q=this.tail;if(_.list=this,_.prev=q,q)q.next=_;if(this.tail=_,!this.head)this.head=_;this.length++}push(..._){for(let q=0,$=_.length;q<$;q++)u7(this,_[q]);return this.length}unshift(..._){for(var q=0,$=_.length;q<$;q++)k7(this,_[q]);return this.length}pop(){if(!this.tail)return;let _=this.tail.value,q=this.tail;if(this.tail=this.tail.prev,this.tail)this.tail.next=void 0;else this.head=void 0;return q.list=void 0,this.length--,_}shift(){if(!this.head)return;let _=this.head.value,q=this.head;if(this.head=this.head.next,this.head)this.head.prev=void 0;else this.tail=void 0;return q.list=void 0,this.length--,_}forEach(_,q){q=q||this;for(let $=this.head,Q=0;$;Q++)_.call(q,$.value,Q,this),$=$.next}forEachReverse(_,q){q=q||this;for(let $=this.tail,Q=this.length-1;$;Q--)_.call(q,$.value,Q,this),$=$.prev}get(_){let q=0,$=this.head;for(;!!$&&q<_;q++)$=$.next;if(q===_&&!!$)return $.value}getReverse(_){let q=0,$=this.tail;for(;!!$&&q<_;q++)$=$.prev;if(q===_&&!!$)return $.value}map(_,q){q=q||this;let $=new k0;for(let Q=this.head;Q;)$.push(_.call(q,Q.value,this)),Q=Q.next;return $}mapReverse(_,q){q=q||this;var $=new k0;for(let Q=this.tail;Q;)$.push(_.call(q,Q.value,this)),Q=Q.prev;return $}reduce(_,q){let $,Q=this.head;if(arguments.length>1)$=q;else if(this.head)Q=this.head.next,$=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var x=0;Q;x++)$=_($,Q.value,x),Q=Q.next;return $}reduceReverse(_,q){let $,Q=this.tail;if(arguments.length>1)$=q;else if(this.tail)Q=this.tail.prev,$=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(let x=this.length-1;Q;x--)$=_($,Q.value,x),Q=Q.prev;return $}toArray(){let _=Array(this.length);for(let q=0,$=this.head;$;q++)_[q]=$.value,$=$.next;return _}toArrayReverse(){let _=Array(this.length);for(let q=0,$=this.tail;$;q++)_[q]=$.value,$=$.prev;return _}slice(_=0,q=this.length){if(q<0)q+=this.length;if(_<0)_+=this.length;let $=new k0;if(q<_||q<0)return $;if(_<0)_=0;if(q>this.length)q=this.length;let Q=this.head,x=0;for(x=0;!!Q&&x<_;x++)Q=Q.next;for(;!!Q&&x<q;x++,Q=Q.next)$.push(Q.value);return $}sliceReverse(_=0,q=this.length){if(q<0)q+=this.length;if(_<0)_+=this.length;let $=new k0;if(q<_||q<0)return $;if(_<0)_=0;if(q>this.length)q=this.length;let Q=this.length,x=this.tail;for(;!!x&&Q>q;Q--)x=x.prev;for(;!!x&&Q>_;Q--,x=x.prev)$.push(x.value);return $}splice(_,q=0,...$){if(_>this.length)_=this.length-1;if(_<0)_=this.length+_;let Q=this.head;for(let J=0;!!Q&&J<_;J++)Q=Q.next;let x=[];for(let J=0;!!Q&&J<q;J++)x.push(Q.value),Q=this.removeNode(Q);if(!Q)Q=this.tail;else if(Q!==this.tail)Q=Q.prev;for(let J of $)Q=g7(this,Q,J);return x}reverse(){let _=this.head,q=this.tail;for(let $=_;$;$=$.prev){let Q=$.prev;$.prev=$.next,$.next=Q}return this.head=q,this.tail=_,this}}function g7(_,q,$){let Q=q,x=q?q.next:_.head,J=new m6($,Q,x,_);if(J.next===void 0)_.tail=J;if(J.prev===void 0)_.head=J;return _.length++,J}function u7(_,q){if(_.tail=new m6(q,_.tail,void 0,_),!_.head)_.head=_.tail;_.length++}function k7(_,q){if(_.head=new m6(q,void 0,_.head,_),!_.tail)_.tail=_.head;_.length++}class m6{list;next;prev;value;constructor(_,q,$,Q){if(this.list=Q,this.value=_,q)q.next=this,this.prev=q;else this.prev=void 0;if($)$.prev=this,this.next=$;else this.next=void 0}}import v9 from"path";class S2{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(_,q){this.path=_||"./",this.absolute=q}}var G9=Buffer.alloc(1024),E6=Symbol("onStat"),o_=Symbol("ended"),r=Symbol("queue"),U_=Symbol("current"),__=Symbol("process"),t_=Symbol("processing"),Y9=Symbol("processJob"),e=Symbol("jobs"),T2=Symbol("jobDone"),b6=Symbol("addFSEntry"),H9=Symbol("addTarEntry"),D2=Symbol("stat"),N2=Symbol("readdir"),c6=Symbol("onreaddir"),l6=Symbol("pipe"),W9=Symbol("entry"),F2=Symbol("entryOpt"),d6=Symbol("writeEntryClass"),w9=Symbol("write"),R2=Symbol("ondrain");class q_ extends c{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[d6];onWriteEntry;[r];[e]=0;[t_]=!1;[o_]=!1;constructor(_={}){super();if(this.opt=_,this.file=_.file||"",this.cwd=_.cwd||process.cwd(),this.maxReadSize=_.maxReadSize,this.preservePaths=!!_.preservePaths,this.strict=!!_.strict,this.noPax=!!_.noPax,this.prefix=P(_.prefix||""),this.linkCache=_.linkCache||new Map,this.statCache=_.statCache||new Map,this.readdirCache=_.readdirCache||new Map,this.onWriteEntry=_.onWriteEntry,this[d6]=k6,typeof _.onwarn==="function")this.on("warn",_.onwarn);if(this.portable=!!_.portable,_.gzip||_.brotli||_.zstd){if((_.gzip?1:0)+(_.brotli?1:0)+(_.zstd?1:0)>1)throw TypeError("gzip, brotli, zstd are mutually exclusive");if(_.gzip){if(typeof _.gzip!=="object")_.gzip={};if(this.portable)_.gzip.portable=!0;this.zip=new t1(_.gzip)}if(_.brotli){if(typeof _.brotli!=="object")_.brotli={};this.zip=new _2(_.brotli)}if(_.zstd){if(typeof _.zstd!=="object")_.zstd={};this.zip=new Q2(_.zstd)}if(!this.zip)throw Error("impossible");let q=this.zip;q.on("data",($)=>super.write($)),q.on("end",()=>super.end()),q.on("drain",()=>this[R2]()),this.on("resume",()=>q.resume())}else this.on("drain",this[R2]);if(this.noDirRecurse=!!_.noDirRecurse,this.follow=!!_.follow,this.noMtime=!!_.noMtime,_.mtime)this.mtime=_.mtime;this.filter=typeof _.filter==="function"?_.filter:()=>!0,this[r]=new k0,this[e]=0,this.jobs=Number(_.jobs)||4,this[t_]=!1,this[o_]=!1}[w9](_){return super.write(_)}add(_){return this.write(_),this}end(_,q,$){if(typeof _==="function")$=_,_=void 0;if(typeof q==="function")$=q,q=void 0;if(_)this.add(_);if(this[o_]=!0,this[__](),$)$();return this}write(_){if(this[o_])throw Error("write after end");if(_ instanceof i_)this[H9](_);else this[b6](_);return this.flowing}[H9](_){let q=P(v9.resolve(this.cwd,_.path));if(!this.filter(_.path,_))_.resume();else{let $=new S2(_.path,q);$.entry=new A2(_,this[F2]($)),$.entry.on("end",()=>this[T2]($)),this[e]+=1,this[r].push($)}this[__]()}[b6](_){let q=P(v9.resolve(this.cwd,_));this[r].push(new S2(_,q)),this[__]()}[D2](_){_.pending=!0,this[e]+=1;let q=this.follow?"stat":"lstat";f6[q](_.absolute,($,Q)=>{if(_.pending=!1,this[e]-=1,$)this.emit("error",$);else this[E6](_,Q)})}[E6](_,q){if(this.statCache.set(_.absolute,q),_.stat=q,!this.filter(_.path,q))_.ignore=!0;this[__]()}[N2](_){_.pending=!0,this[e]+=1,f6.readdir(_.absolute,(q,$)=>{if(_.pending=!1,this[e]-=1,q)return this.emit("error",q);this[c6](_,$)})}[c6](_,q){this.readdirCache.set(_.absolute,q),_.readdir=q,this[__]()}[__](){if(this[t_])return;this[t_]=!0;for(let _=this[r].head;!!_&&this[e]<this.jobs;_=_.next)if(this[Y9](_.value),_.value.ignore){let q=_.next;this[r].removeNode(_),_.next=q}if(this[t_]=!1,this[o_]&&!this[r].length&&this[e]===0)if(this.zip)this.zip.end(G9);else super.write(G9),super.end()}get[U_](){return this[r]&&this[r].head&&this[r].head.value}[T2](_){this[r].shift(),this[e]-=1,this[__]()}[Y9](_){if(_.pending)return;if(_.entry){if(_===this[U_]&&!_.piped)this[l6](_);return}if(!_.stat){let q=this.statCache.get(_.absolute);if(q)this[E6](_,q);else this[D2](_)}if(!_.stat)return;if(_.ignore)return;if(!this.noDirRecurse&&_.stat.isDirectory()&&!_.readdir){let q=this.readdirCache.get(_.absolute);if(q)this[c6](_,q);else this[N2](_);if(!_.readdir)return}if(_.entry=this[W9](_),!_.entry){_.ignore=!0;return}if(_===this[U_]&&!_.piped)this[l6](_)}[F2](_){return{onwarn:(q,$,Q)=>this.warn(q,$,Q),noPax:this.noPax,cwd:this.cwd,absolute:_.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[W9](_){this[e]+=1;try{return new this[d6](_.path,this[F2](_)).on("end",()=>this[T2](_)).on("error",($)=>this.emit("error",$))}catch(q){this.emit("error",q)}}[R2](){if(this[U_]&&this[U_].entry)this[U_].entry.resume()}[l6](_){if(_.piped=!0,_.readdir)_.readdir.forEach((Q)=>{let x=_.path,J=x==="./"?"":x.replace(/\/*$/,"/");this[b6](J+Q)});let q=_.entry,$=this.zip;if(!q)throw Error("cannot pipe without source");if($)q.on("data",(Q)=>{if(!$.write(Q))q.pause()});else q.on("data",(Q)=>{if(!super.write(Q))q.pause()})}pause(){if(this.zip)this.zip.pause();return super.pause()}warn(_,q,$={}){a0(this,_,q,$)}}class O_ extends q_{sync=!0;constructor(_){super(_);this[d6]=I2}pause(){}resume(){}[D2](_){let q=this.follow?"statSync":"lstatSync";this[E6](_,f6[q](_.absolute))}[N2](_){this[c6](_,f6.readdirSync(_.absolute))}[l6](_){let q=_.entry,$=this.zip;if(_.readdir)_.readdir.forEach((Q)=>{let x=_.path,J=x==="./"?"":x.replace(/\/*$/,"/");this[b6](J+Q)});if(!q)throw Error("Cannot pipe without source");if($)q.on("data",(Q)=>{$.write(Q)});else q.on("data",(Q)=>{super[w9](Q)})}}var m7=(_,q)=>{let $=new O_(_),Q=new l_(_.file,{mode:_.mode||438});$.pipe(Q),z9($,q)},E7=(_,q)=>{let $=new q_(_),Q=new T0(_.file,{mode:_.mode||438});$.pipe(Q);let x=new Promise((J,X)=>{Q.on("error",X),Q.on("close",J),$.on("error",X)});return P9($,q),x},z9=(_,q)=>{q.forEach(($)=>{if($.charAt(0)==="@")e0({file:L9.resolve(_.cwd,$.slice(1)),sync:!0,noResume:!0,onReadEntry:(Q)=>_.add(Q)});else _.add($)}),_.end()},P9=async(_,q)=>{for(let $=0;$<q.length;$++){let Q=String(q[$]);if(Q.charAt(0)==="@")await e0({file:L9.resolve(String(_.cwd),Q.slice(1)),noResume:!0,onReadEntry:(x)=>{_.add(x)}});else _.add(Q)}_.end()},b7=(_,q)=>{let $=new O_(_);return z9($,q),$},c7=(_,q)=>{let $=new q_(_);return P9($,q),$},l7=X0(m7,E7,b7,c7,(_,q)=>{if(!q?.length)throw TypeError("no paths specified to add to archive")});import g9 from"node:fs";import J5 from"node:assert";import{randomBytes as y9}from"node:crypto";import O from"node:fs";import M0 from"node:path";import M9 from"fs";var d7=process.env.__FAKE_PLATFORM__||process.platform,f7=d7==="win32",{O_CREAT:i7,O_TRUNC:p7,O_WRONLY:s7}=M9.constants,U9=Number(process.env.__FAKE_FS_O_FILENAME__)||M9.constants.UV_FS_O_FILEMAP||0,n7=f7&&!!U9,a7=524288,o7=U9|p7|i7|s7,h2=!n7?()=>"w":(_)=>_<a7?o7:"w";import p6 from"node:fs";import r_ from"node:path";var y2=(_,q,$)=>{try{return p6.lchownSync(_,q,$)}catch(Q){if(Q?.code!=="ENOENT")throw Q}},i6=(_,q,$,Q)=>{p6.lchown(_,q,$,(x)=>{Q(x&&x?.code!=="ENOENT"?x:null)})},t7=(_,q,$,Q,x)=>{if(q.isDirectory())g2(r_.resolve(_,q.name),$,Q,(J)=>{if(J)return x(J);let X=r_.resolve(_,q.name);i6(X,$,Q,x)});else{let J=r_.resolve(_,q.name);i6(J,$,Q,x)}},g2=(_,q,$,Q)=>{p6.readdir(_,{withFileTypes:!0},(x,J)=>{if(x){if(x.code==="ENOENT")return Q();else if(x.code!=="ENOTDIR"&&x.code!=="ENOTSUP")return Q(x)}if(x||!J.length)return i6(_,q,$,Q);let X=J.length,V=null,K=(G)=>{if(V)return;if(G)return Q(V=G);if(--X===0)return i6(_,q,$,Q)};for(let G of J)t7(_,G,q,$,K)})},r7=(_,q,$,Q)=>{if(q.isDirectory())u2(r_.resolve(_,q.name),$,Q);y2(r_.resolve(_,q.name),$,Q)},u2=(_,q,$)=>{let Q;try{Q=p6.readdirSync(_,{withFileTypes:!0})}catch(x){let J=x;if(J?.code==="ENOENT")return;else if(J?.code==="ENOTDIR"||J?.code==="ENOTSUP")return y2(_,q,$);else throw J}for(let x of Q)r7(_,x,q,$);return y2(_,q,$)};import l from"node:fs";import e7 from"node:fs/promises";import a6 from"node:path";class s6 extends Error{path;code;syscall="chdir";constructor(_,q){super(`${q}: Cannot cd into '${_}'`);this.path=_,this.code=q}get name(){return"CwdError"}}class n6 extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(_,q){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link");this.symlink=_,this.path=q}get name(){return"SymlinkError"}}var _5=(_,q)=>{l.stat(_,($,Q)=>{if($||!Q.isDirectory())$=new s6(_,$?.code||"ENOTDIR");q($)})},O9=(_,q,$)=>{_=P(_);let Q=q.umask??18,x=q.mode|448,J=(x&Q)!==0,X=q.uid,V=q.gid,K=typeof X==="number"&&typeof V==="number"&&(X!==q.processUid||V!==q.processGid),G=q.preserve,Z=q.unlink,Y=P(q.cwd),H=(L,M)=>{if(L)$(L);else if(M&&K)g2(M,X,V,(E)=>H(E));else if(J)l.chmod(_,x,$);else $()};if(_===Y)return _5(_,H);if(G)return e7.mkdir(_,{mode:x,recursive:!0}).then((L)=>H(null,L??void 0),H);let U=P(a6.relative(Y,_)).split("/");k2(Y,U,x,Z,Y,void 0,H)},k2=(_,q,$,Q,x,J,X)=>{if(!q.length)return X(null,J);let V=q.shift(),K=P(a6.resolve(_+"/"+V));l.mkdir(K,$,j9(K,q,$,Q,x,J,X))},j9=(_,q,$,Q,x,J,X)=>(V)=>{if(V)l.lstat(_,(K,G)=>{if(K)K.path=K.path&&P(K.path),X(K);else if(G.isDirectory())k2(_,q,$,Q,x,J,X);else if(Q)l.unlink(_,(Z)=>{if(Z)return X(Z);l.mkdir(_,$,j9(_,q,$,Q,x,J,X))});else if(G.isSymbolicLink())return X(new n6(_,_+"/"+q.join("/")));else X(V)});else J=J||_,k2(_,q,$,Q,x,J,X)},q5=(_)=>{let q=!1,$=void 0;try{q=l.statSync(_).isDirectory()}catch(Q){$=Q?.code}finally{if(!q)throw new s6(_,$??"ENOTDIR")}},B9=(_,q)=>{_=P(_);let $=q.umask??18,Q=q.mode|448,x=(Q&$)!==0,J=q.uid,X=q.gid,V=typeof J==="number"&&typeof X==="number"&&(J!==q.processUid||X!==q.processGid),K=q.preserve,G=q.unlink,Z=P(q.cwd),Y=(L)=>{if(L&&V)u2(L,J,X);if(x)l.chmodSync(_,Q)};if(_===Z)return q5(Z),Y();if(K)return Y(l.mkdirSync(_,{mode:Q,recursive:!0})??void 0);let w=P(a6.relative(Z,_)).split("/"),U=void 0;for(let L=w.shift(),M=Z;L&&(M+="/"+L);L=w.shift()){M=P(a6.resolve(M));try{l.mkdirSync(M,Q),U=U||M}catch(E){let $0=l.lstatSync(M);if($0.isDirectory())continue;else if(G){l.unlinkSync(M),l.mkdirSync(M,Q),U=U||M;continue}else if($0.isSymbolicLink())return new n6(M,M+"/"+w.join("/"))}}return Y(U)};import{join as I9}from"node:path";var m2=Object.create(null);var j_=new Set,C9=(_)=>{if(!j_.has(_))m2[_]=_.normalize("NFD");else j_.delete(_);j_.add(_);let q=m2[_],$=j_.size-1e4;if($>1000){for(let Q of j_)if(j_.delete(Q),delete m2[Q],--$<=0)break}return q};var $5=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Q5=$5==="win32",x5=(_)=>{return _.split("/").slice(0,-1).reduce(($,Q)=>{let x=$[$.length-1];if(x!==void 0)Q=I9(x,Q);return $.push(Q||"/"),$},[])};class E2{#_=new Map;#$=new Map;#Q=new Set;reserve(_,q){_=Q5?["win32 parallelization disabled"]:_.map((Q)=>{return g0(I9(C9(Q))).toLowerCase()});let $=new Set(_.map((Q)=>x5(Q)).reduce((Q,x)=>Q.concat(x)));this.#$.set(q,{dirs:$,paths:_});for(let Q of _){let x=this.#_.get(Q);if(!x)this.#_.set(Q,[q]);else x.push(q)}for(let Q of $){let x=this.#_.get(Q);if(!x)this.#_.set(Q,[new Set([q])]);else{let J=x[x.length-1];if(J instanceof Set)J.add(q);else x.push(new Set([q]))}}return this.#x(q)}#J(_){let q=this.#$.get(_);if(!q)throw Error("function does not have any path reservations");return{paths:q.paths.map(($)=>this.#_.get($)),dirs:[...q.dirs].map(($)=>this.#_.get($))}}check(_){let{paths:q,dirs:$}=this.#J(_);return q.every((Q)=>Q&&Q[0]===_)&&$.every((Q)=>Q&&Q[0]instanceof Set&&Q[0].has(_))}#x(_){if(this.#Q.has(_)||!this.check(_))return!1;return this.#Q.add(_),_(()=>this.#q(_)),!0}#q(_){if(!this.#Q.has(_))return!1;let q=this.#$.get(_);if(!q)throw Error("invalid reservation");let{paths:$,dirs:Q}=q,x=new Set;for(let J of $){let X=this.#_.get(J);if(!X||X?.[0]!==_)continue;let V=X[1];if(!V){this.#_.delete(J);continue}if(X.shift(),typeof V==="function")x.add(V);else for(let K of V)x.add(K)}for(let J of Q){let X=this.#_.get(J),V=X?.[0];if(!X||!(V instanceof Set))continue;if(V.size===1&&X.length===1){this.#_.delete(J);continue}else if(V.size===1){X.shift();let K=X[0];if(typeof K==="function")x.add(K)}else V.delete(_)}return this.#Q.delete(_),x.forEach((J)=>this.#x(J)),!0}}var A9=Symbol("onEntry"),l2=Symbol("checkFs"),T9=Symbol("checkFs2"),d2=Symbol("isReusable"),s=Symbol("makeFs"),f2=Symbol("file"),i2=Symbol("directory"),r6=Symbol("link"),F9=Symbol("symlink"),R9=Symbol("hardlink"),S9=Symbol("unsupported"),D9=Symbol("checkPath"),m0=Symbol("mkdir"),g=Symbol("onError"),o6=Symbol("pending"),N9=Symbol("pend"),B_=Symbol("unpend"),b2=Symbol("ended"),c2=Symbol("maybeClose"),p2=Symbol("skip"),e_=Symbol("doChown"),_6=Symbol("uid"),q6=Symbol("gid"),$6=Symbol("checkedCwd"),X5=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Q6=X5==="win32",V5=1024,K5=(_,q)=>{if(!Q6)return O.unlink(_,q);let $=_+".DELETE."+y9(16).toString("hex");O.rename(_,$,(Q)=>{if(Q)return q(Q);O.unlink($,q)})},Z5=(_)=>{if(!Q6)return O.unlinkSync(_);let q=_+".DELETE."+y9(16).toString("hex");O.renameSync(_,q),O.unlinkSync(q)},h9=(_,q,$)=>_!==void 0&&_===_>>>0?_:q!==void 0&&q===q>>>0?q:$;class x6 extends y0{[b2]=!1;[$6]=!1;[o6]=0;reservations=new E2;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(_={}){_.ondone=()=>{this[b2]=!0,this[c2]()};super(_);if(this.transform=_.transform,this.chmod=!!_.chmod,typeof _.uid==="number"||typeof _.gid==="number"){if(typeof _.uid!=="number"||typeof _.gid!=="number")throw TypeError("cannot set owner without number uid and gid");if(_.preserveOwner)throw TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=_.uid,this.gid=_.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;if(_.preserveOwner===void 0&&typeof _.uid!=="number")this.preserveOwner=!!(process.getuid&&process.getuid()===0);else this.preserveOwner=!!_.preserveOwner;this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof _.maxDepth==="number"?_.maxDepth:V5,this.forceChown=_.forceChown===!0,this.win32=!!_.win32||Q6,this.newer=!!_.newer,this.keep=!!_.keep,this.noMtime=!!_.noMtime,this.preservePaths=!!_.preservePaths,this.unlink=!!_.unlink,this.cwd=P(M0.resolve(_.cwd||process.cwd())),this.strip=Number(_.strip)||0,this.processUmask=!this.chmod?0:typeof _.processUmask==="number"?_.processUmask:process.umask(),this.umask=typeof _.umask==="number"?_.umask:this.processUmask,this.dmode=_.dmode||511&~this.umask,this.fmode=_.fmode||438&~this.umask,this.on("entry",(q)=>this[A9](q))}warn(_,q,$={}){if(_==="TAR_BAD_ARCHIVE"||_==="TAR_ABORT")$.recoverable=!1;return super.warn(_,q,$)}[c2](){if(this[b2]&&this[o6]===0)this.emit("prefinish"),this.emit("finish"),this.emit("end")}[D9](_){let q=P(_.path),$=q.split("/");if(this.strip){if($.length<this.strip)return!1;if(_.type==="Link"){let Q=P(String(_.linkpath)).split("/");if(Q.length>=this.strip)_.linkpath=Q.slice(this.strip).join("/");else return!1}$.splice(0,this.strip),_.path=$.join("/")}if(isFinite(this.maxDepth)&&$.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:_,path:q,depth:$.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if($.includes("..")||Q6&&/^[a-z]:\.\.$/i.test($[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:_,path:q}),!1;let[Q,x]=n_(q);if(Q)_.path=String(x),this.warn("TAR_ENTRY_INFO",`stripping ${Q} from absolute path`,{entry:_,path:q})}if(M0.isAbsolute(_.path))_.absolute=P(M0.resolve(_.path));else _.absolute=P(M0.resolve(this.cwd,_.path));if(!this.preservePaths&&typeof _.absolute==="string"&&_.absolute.indexOf(this.cwd+"/")!==0&&_.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:_,path:P(_.path),resolvedPath:_.absolute,cwd:this.cwd}),!1;if(_.absolute===this.cwd&&_.type!=="Directory"&&_.type!=="GNUDumpDir")return!1;if(this.win32){let{root:Q}=M0.win32.parse(String(_.absolute));_.absolute=Q+L2(String(_.absolute).slice(Q.length));let{root:x}=M0.win32.parse(_.path);_.path=x+L2(_.path.slice(x.length))}return!0}[A9](_){if(!this[D9](_))return _.resume();switch(J5.equal(typeof _.absolute,"string"),_.type){case"Directory":case"GNUDumpDir":if(_.mode)_.mode=_.mode|448;case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[l2](_);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[S9](_)}}[g](_,q){if(_.name==="CwdError")this.emit("error",_);else this.warn("TAR_ENTRY_ERROR",_,{entry:q}),this[B_](),q.resume()}[m0](_,q,$){O9(P(_),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:q},$)}[e_](_){return this.forceChown||this.preserveOwner&&(typeof _.uid==="number"&&_.uid!==this.processUid||typeof _.gid==="number"&&_.gid!==this.processGid)||typeof this.uid==="number"&&this.uid!==this.processUid||typeof this.gid==="number"&&this.gid!==this.processGid}[_6](_){return h9(this.uid,_.uid,this.processUid)}[q6](_){return h9(this.gid,_.gid,this.processGid)}[f2](_,q){let $=typeof _.mode==="number"?_.mode&4095:this.fmode,Q=new T0(String(_.absolute),{flags:h2(_.size),mode:$,autoClose:!1});Q.on("error",(V)=>{if(Q.fd)O.close(Q.fd,()=>{});Q.write=()=>!0,this[g](V,_),q()});let x=1,J=(V)=>{if(V){if(Q.fd)O.close(Q.fd,()=>{});this[g](V,_),q();return}if(--x===0){if(Q.fd!==void 0)O.close(Q.fd,(K)=>{if(K)this[g](K,_);else this[B_]();q()})}};Q.on("finish",()=>{let V=String(_.absolute),K=Q.fd;if(typeof K==="number"&&_.mtime&&!this.noMtime){x++;let G=_.atime||new Date,Z=_.mtime;O.futimes(K,G,Z,(Y)=>Y?O.utimes(V,G,Z,(H)=>J(H&&Y)):J())}if(typeof K==="number"&&this[e_](_)){x++;let G=this[_6](_),Z=this[q6](_);if(typeof G==="number"&&typeof Z==="number")O.fchown(K,G,Z,(Y)=>Y?O.chown(V,G,Z,(H)=>J(H&&Y)):J())}J()});let X=this.transform?this.transform(_)||_:_;if(X!==_)X.on("error",(V)=>{this[g](V,_),q()}),_.pipe(X);X.pipe(Q)}[i2](_,q){let $=typeof _.mode==="number"?_.mode&4095:this.dmode;this[m0](String(_.absolute),$,(Q)=>{if(Q){this[g](Q,_),q();return}let x=1,J=()=>{if(--x===0)q(),this[B_](),_.resume()};if(_.mtime&&!this.noMtime)x++,O.utimes(String(_.absolute),_.atime||new Date,_.mtime,J);if(this[e_](_))x++,O.chown(String(_.absolute),Number(this[_6](_)),Number(this[q6](_)),J);J()})}[S9](_){_.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${_.type}`,{entry:_}),_.resume()}[F9](_,q){this[r6](_,String(_.linkpath),"symlink",q)}[R9](_,q){let $=P(M0.resolve(this.cwd,String(_.linkpath)));this[r6](_,$,"link",q)}[N9](){this[o6]++}[B_](){this[o6]--,this[c2]()}[p2](_){this[B_](),_.resume()}[d2](_,q){return _.type==="File"&&!this.unlink&&q.isFile()&&q.nlink<=1&&!Q6}[l2](_){this[N9]();let q=[_.path];if(_.linkpath)q.push(_.linkpath);this.reservations.reserve(q,($)=>this[T9](_,$))}[T9](_,q){let $=(X)=>{q(X)},Q=()=>{this[m0](this.cwd,this.dmode,(X)=>{if(X){this[g](X,_),$();return}this[$6]=!0,x()})},x=()=>{if(_.absolute!==this.cwd){let X=P(M0.dirname(String(_.absolute)));if(X!==this.cwd)return this[m0](X,this.dmode,(V)=>{if(V){this[g](V,_),$();return}J()})}J()},J=()=>{O.lstat(String(_.absolute),(X,V)=>{if(V&&(this.keep||this.newer&&V.mtime>(_.mtime??V.mtime))){this[p2](_),$();return}if(X||this[d2](_,V))return this[s](null,_,$);if(V.isDirectory()){if(_.type==="Directory"){let K=this.chmod&&_.mode&&(V.mode&4095)!==_.mode,G=(Z)=>this[s](Z??null,_,$);if(!K)return G();return O.chmod(String(_.absolute),Number(_.mode),G)}if(_.absolute!==this.cwd)return O.rmdir(String(_.absolute),(K)=>this[s](K??null,_,$))}if(_.absolute===this.cwd)return this[s](null,_,$);K5(String(_.absolute),(K)=>this[s](K??null,_,$))})};if(this[$6])x();else Q()}[s](_,q,$){if(_){this[g](_,q),$();return}switch(q.type){case"File":case"OldFile":case"ContiguousFile":return this[f2](q,$);case"Link":return this[R9](q,$);case"SymbolicLink":return this[F9](q,$);case"Directory":case"GNUDumpDir":return this[i2](q,$)}}[r6](_,q,$,Q){O[$](q,String(_.absolute),(x)=>{if(x)this[g](x,_);else this[B_](),_.resume();Q()})}}var t6=(_)=>{try{return[null,_()]}catch(q){return[q,null]}};class e6 extends x6{sync=!0;[s](_,q){return super[s](_,q,()=>{})}[l2](_){if(!this[$6]){let x=this[m0](this.cwd,this.dmode);if(x)return this[g](x,_);this[$6]=!0}if(_.absolute!==this.cwd){let x=P(M0.dirname(String(_.absolute)));if(x!==this.cwd){let J=this[m0](x,this.dmode);if(J)return this[g](J,_)}}let[q,$]=t6(()=>O.lstatSync(String(_.absolute)));if($&&(this.keep||this.newer&&$.mtime>(_.mtime??$.mtime)))return this[p2](_);if(q||this[d2](_,$))return this[s](null,_);if($.isDirectory()){if(_.type==="Directory"){let J=this.chmod&&_.mode&&($.mode&4095)!==_.mode,[X]=J?t6(()=>{O.chmodSync(String(_.absolute),Number(_.mode))}):[];return this[s](X,_)}let[x]=t6(()=>O.rmdirSync(String(_.absolute)));this[s](x,_)}let[Q]=_.absolute===this.cwd?[]:t6(()=>Z5(String(_.absolute)));this[s](Q,_)}[f2](_,q){let $=typeof _.mode==="number"?_.mode&4095:this.fmode,Q=(X)=>{let V;try{O.closeSync(x)}catch(K){V=K}if(X||V)this[g](X||V,_);q()},x;try{x=O.openSync(String(_.absolute),h2(_.size),$)}catch(X){return Q(X)}let J=this.transform?this.transform(_)||_:_;if(J!==_)J.on("error",(X)=>this[g](X,_)),_.pipe(J);J.on("data",(X)=>{try{O.writeSync(x,X,0,X.length)}catch(V){Q(V)}}),J.on("end",()=>{let X=null;if(_.mtime&&!this.noMtime){let V=_.atime||new Date,K=_.mtime;try{O.futimesSync(x,V,K)}catch(G){try{O.utimesSync(String(_.absolute),V,K)}catch(Z){X=G}}}if(this[e_](_)){let V=this[_6](_),K=this[q6](_);try{O.fchownSync(x,Number(V),Number(K))}catch(G){try{O.chownSync(String(_.absolute),Number(V),Number(K))}catch(Z){X=X||G}}}Q(X)})}[i2](_,q){let $=typeof _.mode==="number"?_.mode&4095:this.dmode,Q=this[m0](String(_.absolute),$);if(Q){this[g](Q,_),q();return}if(_.mtime&&!this.noMtime)try{O.utimesSync(String(_.absolute),_.atime||new Date,_.mtime)}catch(x){}if(this[e_](_))try{O.chownSync(String(_.absolute),Number(this[_6](_)),Number(this[q6](_)))}catch(x){}q(),_.resume()}[m0](_,q){try{return B9(P(_),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:q})}catch($){return $}}[r6](_,q,$,Q){let x=`${$}Sync`;try{O[x](q,String(_.absolute)),Q(),_.resume()}catch(J){return this[g](J,_)}}}var G5=(_)=>{let q=new e6(_),$=_.file,Q=g9.statSync($),x=_.maxReadSize||16777216;new i1($,{readSize:x,size:Q.size}).pipe(q)},Y5=(_,q)=>{let $=new x6(_),Q=_.maxReadSize||16777216,x=_.file;return new Promise((X,V)=>{$.on("error",V),$.on("close",X),g9.stat(x,(K,G)=>{if(K)V(K);else{let Z=new L_(x,{readSize:Q,size:G.size});Z.on("error",V),Z.pipe($)}})})},J6=X0(G5,Y5,(_)=>new e6(_),(_)=>new x6(_),(_,q)=>{if(q?.length)W2(_,q)});import d from"node:fs";import u9 from"node:path";var H5=(_,q)=>{let $=new O_(_),Q=!0,x,J;try{try{x=d.openSync(_.file,"r+")}catch(K){if(K?.code==="ENOENT")x=d.openSync(_.file,"w+");else throw K}let X=d.fstatSync(x),V=Buffer.alloc(512);_:for(J=0;J<X.size;J+=512){for(let Z=0,Y=0;Z<512;Z+=Y){if(Y=d.readSync(x,V,Z,V.length-Z,J+Z),J===0&&V[0]===31&&V[1]===139)throw Error("cannot append to compressed archives");if(!Y)break _}let K=new i(V);if(!K.cksumValid)break;let G=512*Math.ceil((K.size||0)/512);if(J+G+512>X.size)break;if(J+=G,_.mtimeCache&&K.mtime)_.mtimeCache.set(String(K.path),K.mtime)}Q=!1,W5(_,$,J,x,q)}finally{if(Q)try{d.closeSync(x)}catch(X){}}},W5=(_,q,$,Q,x)=>{let J=new l_(_.file,{fd:Q,start:$});q.pipe(J),w5(q,x)},v5=(_,q)=>{q=Array.from(q);let $=new q_(_),Q=(J,X,V)=>{let K=(w,U)=>{if(w)d.close(J,(L)=>V(w));else V(null,U)},G=0;if(X===0)return K(null,0);let Z=0,Y=Buffer.alloc(512),H=(w,U)=>{if(w||typeof U>"u")return K(w);if(Z+=U,Z<512&&U)return d.read(J,Y,Z,Y.length-Z,G+Z,H);if(G===0&&Y[0]===31&&Y[1]===139)return K(Error("cannot append to compressed archives"));if(Z<512)return K(null,G);let L=new i(Y);if(!L.cksumValid)return K(null,G);let M=512*Math.ceil((L.size??0)/512);if(G+M+512>X)return K(null,G);if(G+=M+512,G>=X)return K(null,G);if(_.mtimeCache&&L.mtime)_.mtimeCache.set(String(L.path),L.mtime);Z=0,d.read(J,Y,0,512,G,H)};d.read(J,Y,0,512,G,H)};return new Promise((J,X)=>{$.on("error",X);let V="r+",K=(G,Z)=>{if(G&&G.code==="ENOENT"&&V==="r+")return V="w+",d.open(_.file,V,K);if(G||!Z)return X(G);d.fstat(Z,(Y,H)=>{if(Y)return d.close(Z,()=>X(Y));Q(Z,H.size,(w,U)=>{if(w)return X(w);let L=new T0(_.file,{fd:Z,start:U});$.pipe(L),L.on("error",X),L.on("close",J),L5($,q)})})};d.open(_.file,V,K)})},w5=(_,q)=>{q.forEach(($)=>{if($.charAt(0)==="@")e0({file:u9.resolve(_.cwd,$.slice(1)),sync:!0,noResume:!0,onReadEntry:(Q)=>_.add(Q)});else _.add($)}),_.end()},L5=async(_,q)=>{for(let $=0;$<q.length;$++){let Q=String(q[$]);if(Q.charAt(0)==="@")await e0({file:u9.resolve(String(_.cwd),Q.slice(1)),noResume:!0,onReadEntry:(x)=>_.add(x)});else _.add(Q)}_.end()},$_=X0(H5,v5,()=>{throw TypeError("file is required")},()=>{throw TypeError("file is required")},(_,q)=>{if(!c3(_))throw TypeError("file is required");if(_.gzip||_.brotli||_.zstd||_.file.endsWith(".br")||_.file.endsWith(".tbr"))throw TypeError("cannot append to compressed archives");if(!q?.length)throw TypeError("no paths specified to add/replace")});var z5=X0($_.syncFile,$_.asyncFile,$_.syncNoFile,$_.asyncNoFile,(_,q=[])=>{$_.validate?.(_,q),P5(_)}),P5=(_)=>{let q=_.filter;if(!_.mtimeCache)_.mtimeCache=new Map;_.filter=q?($,Q)=>q($,Q)&&!((_.mtimeCache?.get($)??Q.mtime??0)>(Q.mtime??0)):($,Q)=>!((_.mtimeCache?.get($)??Q.mtime??0)>(Q.mtime??0))};var R={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"};import I_,{join as U5}from"path";var k9={name:"@abacus-ai/cli",appName:"AbacusAI",binName:"abacusai",version:"1.106.2403",nodeVersion:"22.19.0",author:{name:"Abacus AI"},license:"Proprietary",main:"./dist/index.js",module:"./dist/index.js",source:"./src/index.ts",type:"module",homepage:"https://desktop.abacus.ai/",files:["dist"],bugs:{url:"mailto:support@abacus.ai"},bin:{abacusai:"./dist/index.js"},scripts:{"build.tsc":"tsc --noEmit --pretty","build.bun":"bun build ./src/index.ts --minify --target=node --outdir=dist",build:"run-p build.*","watch.tsc":"tsc --watch --noEmit --pretty","watch.bun":"bun build ./src/index.ts --sourcemap --target=node --outdir=dist --watch --external=extract-zip --external=node-downloader-helper --external=semver --external=tar",watch:"run-p watch.*",test:"tsc -p ./test/tsconfig.json && bun test"},devDependencies:{"@inquirer/prompts":"^7.9.0","@tsconfig/strictest":"^2.0.7","@types/color-name":"^2.0.0","@types/glob":"^9.0.0","@types/minimatch":"^6.0.0","@types/node":"^24.9.2","@types/bun":"^1.2.2","@types/semver":"^7.7.1","extract-zip":"^2.0.1","node-downloader-helper":"^2.1.9",semver:"^7.7.3",tar:"^7.5.2",typescript:"^6.0.0-dev.20251031","npm-run-all2":"^8.0.4"},overrides:{yauzl:"3.2.0"}};import{fileURLToPath as O5}from"url";import q1 from"os";import C_ from"fs/promises";import j5 from"fs";var $1=I_.dirname(O5(import.meta.url)),_1=k9,s2=".abacusai-cli";async function Q1(_){return I_.join(await E9(),`${_.binName}-${_.version}-${q1.platform()}-${q1.arch()}`)}async function E9(){let _=I_.join($1,s2);if(await m9(_))return _;console.log(`Using home directory as ${_} is not writable.`);let q=I_.join(q1.homedir(),s2);if(await m9(q))return q;console.error(`No writable directory found under ${_} or ${q}. Using a temporary directory instead.`);let $=U5(q1.tmpdir(),s2);try{await C_.mkdir($,{recursive:!0})}catch{}return $}async function m9(_){let q=I_.join(_,`.writable-${process.pid}-${Date.now()}`);try{return await C_.mkdir(_,{recursive:!0}),await C_.writeFile(q,"true"),!0}catch($){return!1}finally{try{await C_.unlink(q)}catch{}}}async function b9(){try{let _=await c9(_1);if(!j5.existsSync(_))return await n2(_1,_),_1;return await B5(_)}catch{return _1}}async function n2(_,q){try{if(q===void 0)q=await c9(_);return await C_.writeFile(q,JSON.stringify(_,null,2)),q}catch($){return console.error(`Failed to write package data file ${q}: ${$ instanceof Error?$.message:String($)}`),null}}async function B5(_){return JSON.parse(await C_.readFile(_,"utf8"))}async function c9(_){return I_.join(await E9(),`${_.binName}-package.json`)}var q4=v6(u8(),1),$4=v6(S1(),1),Q4=v6(_4(),1);import z3 from"fs";import Y6 from"fs/promises";import X_ from"os";import P3 from"path";function F$(_){let q=process.versions.node;if(Q4.default(q,_))return!1;return!0}function R$(_){let q=X_.platform(),$=X_.arch(),x={x64:"x64",arm64:"arm64",ia32:"x86"}[$]||$;if(q==="win32")return`https://nodejs.org/dist/v${_}/node-v${_}-win-${x}.${$==="x64"||$==="ia32"?"zip":"7z"}`;else if(q==="darwin")return`https://nodejs.org/dist/v${_}/node-v${_}-darwin-${x}.tar.gz`;else return`https://nodejs.org/dist/v${_}/node-v${_}-linux-${x}.tar.gz`}function S$(_){let q=X_.platform(),$=X_.arch(),x={x64:"x64",arm64:"arm64",ia32:"x86"}[$]||$;if(q==="win32")return`node-v${_}-win-${x}.${$==="x64"||$==="ia32"?"zip":"7z"}`;else if(q==="darwin")return`node-v${_}-darwin-${x}.tar.gz`;else return`node-v${_}-linux-${x}.tar.gz`}async function T1(_,q,$=!1){try{if(!$){if(F$(q))return process.execPath}let Q=X_.platform()==="win32"?"node.exe":"node",x=P3.join(_,Q);if(z3.existsSync(x))return x;let J=P3.join(X_.homedir(),`node-${q}`),X=P3.join(J,"bin",Q);if(z3.existsSync(X))return await Y6.copyFile(X,x),x;console.log(`${R.dim}Downloading Node.js ${q}...${R.reset}`);let V=R$(q),K=S$(q),G=new $4.DownloaderHelper(V,X_.tmpdir(),{fileName:K});G.on("error",async(Y)=>{console.error(`${R.red}Failed to download Node.js from ${V}: ${Y}${R.reset}`),await G.stop()}),await G.start();let Z=G.getDownloadPath();if(!z3.existsSync(J))await Y6.mkdir(J);if(console.log(`${R.dim}Extracting Node.js ${q} to ${J}...${R.reset}`),K.endsWith(".tar.gz"))await N$(Z,J);else await D$(Z,J);return await Y6.copyFile(X,x),x}catch(Q){return console.error(`${R.red}Failed to download Node.js: ${Q instanceof Error?Q.message:String(Q)}
9
+ Please download and install Node.js ${q} from https://nodejs.org/`),process.execPath}}async function D$(_,q){await Y6.mkdir(q,{recursive:!0}),await q4.default(_,{dir:q})}async function N$(_,q){await Y6.mkdir(q,{recursive:!0}),await J6({file:_,cwd:q,strip:1})}function g$(_){let{appName:q,binName:$,version:Q}=_,x=`${q.toLowerCase()}-agent-cli-${F1.platform()}-${F1.arch()}-${Q}.tar.gz`;return{url:`https://static.abacus.ai/${$}/releases/${Q}/${x}`,fileName:x}}async function X4(_,q=!1){let{appName:$,binName:Q,version:x,homepage:J}=_;try{let{url:X,fileName:V}=g$(_),K=new x4.DownloaderHelper(X,F1.tmpdir(),{fileName:V});K.on("error",async(H)=>{console.error(`Failed to download ${X}: ${H}`),await K.stop()}),console.log(`${R.dim}Downloading ${$} ${x}...${R.reset}`),await K.start();let G=K.getDownloadPath(),Z=await Q1(_);console.log(`${R.dim}Extracting ${$} ${x} to ${Z}...${R.reset}`),await u$(G,Z),await J4.rm(G);let Y=h$.join(Z,"bin",`${Q}${F1.platform()==="win32"?".cmd":""}`);if(!y$.existsSync(Y)){let H=`${$} command not found at ${Y}}`;throw console.error(H),Error(H)}return console.log(`${R.dim}${$} ${x} downloaded to ${Z}${R.reset}`),await T1(Z,_.nodeVersion,q),Y}catch(X){throw console.error(X instanceof Error?X.message:String(X)),Error(`Could not download ${$}. Please install ${$} from ${J} and re-run ${Q}.`)}}async function u$(_,q){await J4.mkdir(q,{recursive:!0}),await J6({file:_,cwd:q,strip:1})}import h_ from"fs";import k$ from"fs/promises";import V_ from"os";import h from"path";function V4(_){let q=h.join(_,"packages","tui","package.json");try{let $=JSON.parse(h_.readFileSync(q,"utf8"));return $.name?.includes("codellm")||$.name?.includes("abacus")||!1}catch{return!1}}function K4(_,q){try{let $=JSON.parse(h_.readFileSync(h.join(_,"package.json"),"utf8"));return $.name===q.name||$.name===q.appName.toLowerCase()||$.name===`@abacus-ai/${q.binName}`||V4(_)}catch{return V4(_)}}function m$(_,q){let $=[],Q=h.resolve(q),x=h.parse(Q).root;while(Q!==x){let J=h.join(Q,"out","cli.js");if(h_.existsSync(J)&&K4(Q,_))$.push(Q);let X=h.dirname(Q);if(X===Q)break;Q=X}return $}function E$(_){if(V_.platform()==="darwin")return[`/Applications/${_.appName}.app/Contents/Resources/app`,h.join(V_.homedir(),`Applications/${_.appName}.app/Contents/Resources/app`)];if(V_.platform()==="win32"){let q=process.env.ProgramFiles||"C:\\Program Files",$=process.env["ProgramFiles(x86)"]||"C:\\Program Files (x86)",Q=process.env.LOCALAPPDATA||h.join(V_.homedir(),"AppData","Local"),x=process.env.APPDATA||h.join(V_.homedir(),"AppData","Roaming");return[h.join(q,_.appName),h.join($,_.appName),h.join(Q,"Programs",_.appName),h.join(x,_.appName)]}return[`/usr/share/${_.appName.toLowerCase()}`]}async function b$(_,q){if(!K4(_,q))throw Error("Not an AbacusAI directory");let $=h.join(_,"out","cli.js");if(h_.existsSync($)){let J=V_.platform()==="win32"?"node.exe":"node",X=h.join(_,J);return{command:h_.existsSync(X)?X:process.execPath,args:[$,_,"agent"],directory:_,isCommandNode:!0}}let Q=JSON.parse(await k$.readFile(h.join(_,"package.json"),"utf8"));if(Q.version!==q.version)throw Error(`Version mismatch: ${Q.version} !== ${q.version}`);let x=h.join(_,"bin",`${q.binName}${V_.platform()==="win32"?".cmd":""}`);if(h_.existsSync(x))return{command:x,args:[],directory:_,isCommandNode:!1};throw Error("No CLI found")}async function Z4(_){let q=[...m$(_,$1),h.join($1,"..","..",".."),await Q1(_),...E$(_)];try{return await Promise.any(q.map(($)=>b$($,_)))}catch{return}}import{execFile as d$}from"child_process";import v4 from"process";import{promisify as f$}from"util";import c$ from"https";import G4 from"os";async function Y4(){return new Promise((_,q)=>{try{let $=c$.get(`https://abacus.ai/api/v0/_getCodeLlmVersion?platform=${G4.platform()}-${G4.arch()}&quality=stable`);if($.on("error",(Q)=>{let x=Q instanceof Error?Q.message:String(Q);q(Error(`Failed to find latest version from API: ${x}`))}),$.errored||$.closed){q(Error("Failed to find latest version from API: request failed immediately"));return}$.on("response",(Q)=>{let x="";Q.on("data",(J)=>{x+=J}),Q.on("end",()=>{let{statusCode:J,statusMessage:X}=Q;if(J!==200){q(Error(`API request failed: ${J} ${X}`));return}try{let V=JSON.parse(x);_(V.result)}catch(V){let K=V instanceof Error?V.message:String(V);q(Error(`Failed to parse API response as JSON: ${K}`))}})})}catch($){let Q=$ instanceof Error?$.message:String($);q(Error(`Failed to find latest version from API: ${Q}`))}})}function H4(){return W4(process.env.ABACUSAI_CLI_ADD_INDEPENDENT_FLAG)}function M3(){return l$(process.env.ABACUSAI_CLI_FORCE_NODE_DOWNLOAD)}function U3(){return W4(process.env.ABACUSAI_CLI_AUTO_UPDATE)}function l$(_){return _==="true"||_==="1"}function W4(_){return _!=="false"&&_!=="0"}var i$=f$(d$),p$="@abacus-ai/cli";async function w4(_){try{let q={..._,name:p$},$=await s$(q);if($!==null)await n$(q,$)}catch(q){throw Error(`Failed to auto upgrade ${_.appName}. To update, install the latest version from ${_.homepage}`)}}async function s$(_){try{if(!U3())return null;let q=await Y4();if(q.productVersion!==_.version)return q.productVersion;return null}catch(q){return null}}async function n$(_,q="latest"){if(!U3())return;let $={..._,version:q};try{await n2($)}catch(Q){console.log(`Failed to update package data file: ${Q instanceof Error?Q.message:String(Q)}.`)}try{let{command:Q,args:x}=await a$($);console.log(`${R.dim}Upgrading ${$.appName} to ${$.version} via \`${Q} ${x.join(" ")}\`${R.reset}`);let{stdout:J,stderr:X}=await i$(Q,x);if(console.log(J),X)console.error(X);console.log(`${R.dim}${$.name}@${$.version} installed successfully${R.reset}`)}catch(Q){}}async function a$({name:_,version:q}){try{let $=v4.env.npm_package_json,Q=v4.env.npm_config_user_agent;if(Boolean(Q?.startsWith("npm"))||Boolean($?.endsWith("package.json")))return{command:"npm",args:["install","-g",`${_}@${q}`]};if(Boolean(Q?.startsWith("yarn")))return{command:"yarn",args:["global","add",`${_}@${q}`]};if(Boolean(Q?.startsWith("pnpm")))return{command:"pnpm",args:["install","-g",`${_}@${q}`]};if(Boolean(Q?.startsWith("bun")))return{command:"bun",args:["install","-g",`${_}@${q}`]}}catch($){}return{command:"npm",args:["install","-g",`${_}@${q}`]}}async function z4(){let _=await b9();w4(_).catch((Q)=>{console.error(Q)});let q=await Z4(_);if(q!==void 0){let Q=await T1(q.directory,_.nodeVersion,M3()),x=q.isCommandNode?Q:q.command,J=q.isCommandNode?{...process.env,VSCODE_DEV:"1"}:void 0;return L4(_,x,q.args,void 0,J)}let $=await X4(_,M3());return L4(_,$,[])}function t$(_){if(!H4())return _;return _.includes("--independent")?_:["--independent",..._]}function L4(_,q,$,Q,x){let J=process.platform==="win32",X=Q??process.argv.slice(2),V=[...$,...t$(X)],K=o$.spawn(q,V,{stdio:"inherit",shell:J,windowsVerbatimArguments:J,env:x??process.env});K.on("error",(G)=>{console.error(`Failed to start ${_.appName}:`,G),process.exit(1)}),K.on("exit",(G,Z)=>{if(Z)process.kill(process.pid,Z);else process.exit(G??1)})}z4().catch((_)=>{console.error(_),process.exit(1)});
package/package.json CHANGED
@@ -2,9 +2,8 @@
2
2
  "name": "@abacus-ai/cli",
3
3
  "appName": "AbacusAI",
4
4
  "binName": "abacusai",
5
- "version": "1.105.14608",
5
+ "version": "1.106.2403",
6
6
  "nodeVersion": "22.19.0",
7
- "distro": "fb9b4b01c06699c1a80f26ca9de940a9aebb29e0",
8
7
  "author": {
9
8
  "name": "Abacus AI"
10
9
  },
@@ -24,19 +23,29 @@
24
23
  "abacusai": "./dist/index.js"
25
24
  },
26
25
  "scripts": {
27
- "build": "tsc && bun build ./src/index.ts --minify --target=node --outdir=dist"
26
+ "build.tsc": "tsc --noEmit --pretty",
27
+ "build.bun": "bun build ./src/index.ts --minify --target=node --outdir=dist",
28
+ "build": "run-p build.*",
29
+ "watch.tsc": "tsc --watch --noEmit --pretty",
30
+ "watch.bun": "bun build ./src/index.ts --sourcemap --target=node --outdir=dist --watch --external=extract-zip --external=node-downloader-helper --external=semver --external=tar",
31
+ "watch": "run-p watch.*",
32
+ "test": "tsc -p ./test/tsconfig.json && bun test"
28
33
  },
29
34
  "devDependencies": {
30
35
  "@inquirer/prompts": "^7.9.0",
31
36
  "@tsconfig/strictest": "^2.0.7",
37
+ "@types/color-name": "^2.0.0",
38
+ "@types/glob": "^9.0.0",
39
+ "@types/minimatch": "^6.0.0",
32
40
  "@types/node": "^24.9.2",
41
+ "@types/bun": "^1.2.2",
33
42
  "@types/semver": "^7.7.1",
34
43
  "extract-zip": "^2.0.1",
35
44
  "node-downloader-helper": "^2.1.9",
36
45
  "semver": "^7.7.3",
37
- "simple-update-notifier": "^2.0.0",
38
46
  "tar": "^7.5.2",
39
- "typescript": "^6.0.0-dev.20251031"
47
+ "typescript": "^6.0.0-dev.20251031",
48
+ "npm-run-all2": "^8.0.4"
40
49
  },
41
50
  "overrides": {
42
51
  "yauzl": "3.2.0"