create-rock 0.11.14 → 0.12.1

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/src/bin.js +17 -17
  2. package/package.json +3 -3
package/dist/src/bin.js CHANGED
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import e,{copyFileSync as t,existsSync as i,readFileSync as r,renameSync as n,statSync as s,writeFileSync as o}from"node:fs";import u,{basename as a,dirname as l,extname as h,isAbsolute as c,join as d,posix as D,relative as f,win32 as p}from"node:path";import m,{stripVTControlCharacters as g}from"node:util";import E,{stdin as b,stdout as y}from"node:process";import F,{clearLine as C,createInterface as v,emitKeypressEvents as w,moveCursor as _}from"node:readline";import S,{Writable as A}from"node:stream";import R,{stat as O}from"node:fs/promises";import"fs/promises";import"child_process";import{fileURLToPath as B}from"node:url";import{spawn as x}from"node:child_process";import{EventEmitter as N,on as I,once as T}from"node:events";import{pipeline as L}from"node:stream/promises";import k,{EventEmitter as M}from"events";import{StringDecoder as $}from"node:string_decoder";import j from"assert";import{Buffer as P}from"buffer";import z from"node:assert";import{randomBytes as U}from"node:crypto";import{createRequire as H}from"node:module";import G from"node:os";import Z from"node:tty";import*as W from"crypto";import*as V from"fs";import*as Y from"path";import*as X from"zlib";var K,q,J,Q,ee={"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/adm-zip.js":function(e,t,i){let r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js"),n=i("path"),s=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipEntry.js"),o=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipFile.js"),u=(...e)=>r.findLast(e,e=>"boolean"==typeof e),a=(...e)=>r.findLast(e,e=>"string"==typeof e),l={noSort:!1,readEntries:!1,method:r.Constants.NONE,fs:null};e.exports=function(e,t){let i=null,h=Object.assign(Object.create(null),l);e&&"object"==typeof e&&(e instanceof Uint8Array||(Object.assign(h,e),e=h.input?h.input:void 0,h.input&&delete h.input),Buffer.isBuffer(e)&&(i=e,h.method=r.Constants.BUFFER,e=void 0)),Object.assign(h,t);let c=new r(h);if(("object"!=typeof h.decoder||"function"!=typeof h.decoder.encode||"function"!=typeof h.decoder.decode)&&(h.decoder=r.decoder),e&&"string"==typeof e)if(c.fs.existsSync(e))h.method=r.Constants.FILE,h.filename=e,i=c.fs.readFileSync(e);else throw r.Errors.INVALID_FILENAME();let d=new o(i,h),{canonical:D,sanitize:f,zipnamefix:p}=r;function m(e){if(e&&d){var t;if("string"==typeof e&&(t=d.getEntry(n.posix.normalize(e))),"object"==typeof e&&void 0!==e.entryName&&void 0!==e.header&&(t=d.getEntry(e.entryName)),t)return t}return null}function g(e){let{join:t,normalize:i,sep:r}=n.posix;return t(".",i(r+e.split("\\").join(r)+r))}function E(e){if(e instanceof RegExp)return function(t){return e.test(t)};return"function"!=typeof e?()=>!0:e}let b=(e,t)=>{let i=t.slice(-1);return i=i===c.sep?c.sep:"",n.relative(e,t)+i};return{readFile:function(e,t){var i=m(e);return i&&i.getData(t)||null},childCount:function(e){let t=m(e);if(t)return d.getChildCount(t)},readFileAsync:function(e,t){var i=m(e);i?i.getDataAsync(t):t(null,"getEntry failed for:"+e)},readAsText:function(e,t){var i=m(e);if(i){var r=i.getData();if(r&&r.length)return r.toString(t||"utf8")}return""},readAsTextAsync:function(e,t,i){var r=m(e);r?r.getDataAsync(function(e,r){if(r)return void t(e,r);e&&e.length?t(e.toString(i||"utf8")):t("")}):t("")},deleteFile:function(e,t=!0){var i=m(e);i&&d.deleteFile(i.entryName,t)},deleteEntry:function(e){var t=m(e);t&&d.deleteEntry(t.entryName)},addZipComment:function(e){d.comment=e},getZipComment:function(){return d.comment||""},addZipEntryComment:function(e,t){var i=m(e);i&&(i.comment=t)},getZipEntryComment:function(e){var t=m(e);return t&&t.comment||""},updateFile:function(e,t){var i=m(e);i&&i.setData(t)},addLocalFile:function(e,t,i,s){if(c.fs.existsSync(e)){t=t?g(t):"";let r=n.win32.basename(n.win32.normalize(e));t+=i||r;let o=c.fs.statSync(e),u=o.isFile()?c.fs.readFileSync(e):Buffer.alloc(0);o.isDirectory()&&(t+=c.sep),this.addFile(t,u,s,o)}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFileAsync:function(e,t){e="object"==typeof e?e:{localPath:e};let i=n.resolve(e.localPath),{comment:r}=e,{zipPath:s,zipName:o}=e,u=this;c.fs.stat(i,function(e,a){if(e)return t(e,!1);s=s?g(s):"";let l=n.win32.basename(n.win32.normalize(i));if(s+=o||l,a.isFile())c.fs.readFile(i,function(e,i){return e?t(e,!1):(u.addFile(s,i,r,a),setImmediate(t,void 0,!0))});else if(a.isDirectory())return s+=c.sep,u.addFile(s,Buffer.alloc(0),r,a),setImmediate(t,void 0,!0)})},addLocalFolder:function(e,t,i){if(i=E(i),t=t?g(t):"",e=n.normalize(e),c.fs.existsSync(e)){let r=c.findFiles(e);if(r.length)for(let s of r){let r=n.join(t,b(e,s));i(r)&&this.addLocalFile(s,n.dirname(r))}}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFolderAsync:function(e,t,i,s){s=E(s),i=i?g(i):"",e=n.normalize(e);var o=this;c.fs.open(e,"r",function(n){if(n&&"ENOENT"===n.code)t(void 0,r.Errors.FILE_NOT_FOUND(e));else if(n)t(void 0,n);else{var u=c.findFiles(e),a=-1,l=function(){if((a+=1)<u.length){var r=u[a],n=b(e,r).split("\\").join("/");n=n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),s(n)?c.fs.stat(r,function(e,s){e&&t(void 0,e),s.isFile()?c.fs.readFile(r,function(e,r){e?t(void 0,e):(o.addFile(i+n,r,"",s),l())}):(o.addFile(i+n+"/",Buffer.alloc(0),"",s),l())}):process.nextTick(()=>{l()})}else t(!0,void 0)};l()}})},addLocalFolderAsync2:function(e,t){let i=this;e="object"==typeof e?e:{localPath:e},localPath=n.resolve(g(e.localPath));let{zipPath:s,filter:o,namefix:u}=e;if(o instanceof RegExp){var a;a=o,o=function(e){return a.test(e)}}else"function"!=typeof o&&(o=function(){return!0});s=s?g(s):"","latin1"==u&&(u=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),"function"!=typeof u&&(u=e=>e);let l=e=>n.join(s,u(b(localPath,e)));c.fs.open(localPath,"r",function(e){e&&"ENOENT"===e.code?t(void 0,r.Errors.FILE_NOT_FOUND(localPath)):e?t(void 0,e):c.findFilesAsync(localPath,function(e,r){if(e)return t(e);(r=r.filter(e=>o(l(e)))).length||t(void 0,!1),setImmediate(r.reverse().reduce(function(e,t){return function(r,s){if(r||!1===s)return setImmediate(e,r,!1);i.addLocalFileAsync({localPath:t,zipPath:n.dirname(l(t)),zipName:n.win32.basename(n.win32.normalize(u(t)))},e)}},t))})})},addLocalFolderPromise:function(e,t){return new Promise((i,r)=>{this.addLocalFolderAsync2(Object.assign({localPath:e},t),(e,t)=>{e&&r(e),t&&i(this)})})},addFile:function(e,t,i,r){let n=m(e=p(e)),o=null!=n;o||((n=new s(h)).entryName=e),n.comment=i||"";let u="object"==typeof r&&r instanceof c.fs.Stats;u&&(n.header.time=r.mtime);var a=16*!!n.isDirectory;let l=n.isDirectory?16384:32768;return u?l|=4095&r.mode:"number"==typeof r?l|=4095&r:l|=n.isDirectory?493:420,a=(a|l<<16)>>>0,n.attr=a,n.setData(t),o||d.setEntry(n),n},getEntries:function(e){return d.password=e,d?d.entries:[]},getEntry:function(e){return m(e)},getEntryCount:function(){return d.getEntryCount()},forEach:function(e){return d.forEach(e)},extractEntryTo:function(e,t,i,s,o,l){s=u(!1,s),o=u(!1,o),i=u(!0,i),l=a(o,l);var h=m(e);if(!h)throw r.Errors.NO_ENTRY();var p=D(h.entryName),g=f(t,l&&!h.isDirectory?l:i?p:n.basename(p));if(h.isDirectory)return d.getEntryChildren(h).forEach(function(e){if(e.isDirectory)return;var u=e.getData();if(!u)throw r.Errors.CANT_EXTRACT_FILE();var a=D(e.entryName),l=f(t,i?a:n.basename(a));let h=o?e.header.fileAttr:void 0;c.writeFileTo(l,u,s,h)}),!0;var E=h.getData(d.password);if(!E)throw r.Errors.CANT_EXTRACT_FILE();if(c.fs.existsSync(g)&&!s)throw r.Errors.CANT_OVERRIDE();let b=o?e.header.fileAttr:void 0;return c.writeFileTo(g,E,s,b),!0},test:function(e){if(!d)return!1;for(var t in d.entries)try{if(t.isDirectory)continue;if(!d.entries[t].getData(e))return!1}catch(e){return!1}return!0},extractAllTo:function(e,t,i,n){if(n=a(i=u(!1,i),n),t=u(!1,t),!d)throw r.Errors.NO_ZIP();d.entries.forEach(function(s){var o=f(e,D(s.entryName));if(s.isDirectory)return void c.makeDir(o);var u=s.getData(n);if(!u)throw r.Errors.CANT_EXTRACT_FILE();let a=i?s.header.fileAttr:void 0;c.writeFileTo(o,u,t,a);try{c.fs.utimesSync(o,s.header.time,s.header.time)}catch(e){throw r.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(e,t,i,s){if(s=((...e)=>r.findLast(e,e=>"function"==typeof e))(t,i,s),i=u(!1,i),t=u(!1,t),!s)return new Promise((r,n)=>{this.extractAllToAsync(e,t,i,function(e){e?n(e):r(this)})});if(!d)return void s(r.Errors.NO_ZIP());e=n.resolve(e);let o=t=>f(e,n.normalize(D(t.entryName))),a=(e,t)=>Error(e+': "'+t+'"'),l=[],h=[];for(let e of(d.entries.forEach(e=>{e.isDirectory?l.push(e):h.push(e)}),l)){let t=o(e),r=i?e.header.fileAttr:void 0;try{c.makeDir(t),r&&c.fs.chmodSync(t,r),c.fs.utimesSync(t,e.header.time,e.header.time)}catch(e){s(a("Unable to create folder",t))}}h.reverse().reduce(function(s,o){return function(u){if(u)s(u);else{let u=n.normalize(D(o.entryName)),l=f(e,u);o.getDataAsync(function(e,n){if(n)s(n);else if(e){let r=i?o.header.fileAttr:void 0;c.writeFileToAsync(l,e,t,r,function(e){e||s(a("Unable to write file",l)),c.fs.utimes(l,o.header.time,o.header.time,function(e){e?s(a("Unable to set times",l)):s()})})}else s(r.Errors.CANT_EXTRACT_FILE())})}}},s)()},writeZip:function(e,t){if(1==arguments.length&&"function"==typeof e&&(t=e,e=""),!e&&h.filename&&(e=h.filename),e){var i=d.compressToBuffer();if(i){var r=c.writeFileTo(e,i,!0);"function"==typeof t&&t(r?null:Error("failed"),"")}}},writeZipPromise:function(e,t){let{overwrite:i,perm:r}=Object.assign({overwrite:!0},t);return new Promise((t,n)=>{!e&&h.filename&&(e=h.filename),e||n("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(s=>{c.writeFileToAsync(e,s,i,r,e=>e?t(e):n("ADM-ZIP: Wasn't able to write zip file"))},n)})},toBufferPromise:function(){return new Promise((e,t)=>{d.toAsyncBuffer(e,t)})},toBuffer:function(e,t,i,r){return"function"==typeof e?(d.toAsyncBuffer(e,t,i,r),null):d.compressToBuffer()}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/entryHeader.js":function(e,t,i){var r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js"),n=r.Constants;e.exports=function(){var e,t=10,i=0,s=0,o=0,u=0,a=0,l=0,h=0,c=0,d=0,D=0,f=0,p=0,m=0;e=20|(r.isWin?2560:768),i|=n.FLG_EFS;let g={extraLen:0},E=e=>Math.max(0,e)>>>0;return o=r.fromDate2DOS(new Date),{get made(){return e},set made(val){e=val},get version(){return t},set version(val){t=val},get flags(){return i},set flags(val){i=val},get flags_efs(){return(i&n.FLG_EFS)>0},set flags_efs(val){val?i|=n.FLG_EFS:i&=~n.FLG_EFS},get flags_desc(){return(i&n.FLG_DESC)>0},set flags_desc(val){val?i|=n.FLG_DESC:i&=~n.FLG_DESC},get method(){return s},set method(val){switch(val){case n.STORED:this.version=10;case n.DEFLATED:default:this.version=20}s=val},get time(){return r.fromDOS2Date(this.timeval)},set time(val){this.timeval=r.fromDate2DOS(val)},get timeval(){return o},set timeval(val){o=E(val)},get timeHighByte(){return 255&Math.max(0,o>>>8)},get crc(){return u},set crc(val){u=E(val)},get compressedSize(){return a},set compressedSize(val){a=E(val)},get size(){return l},set size(val){l=E(val)},get fileNameLength(){return h},set fileNameLength(val){h=val},get extraLength(){return c},set extraLength(val){c=val},get extraLocalLength(){return g.extraLen},set extraLocalLength(val){g.extraLen=val},get commentLength(){return d},set commentLength(val){d=val},get diskNumStart(){return D},set diskNumStart(val){D=E(val)},get inAttr(){return f},set inAttr(val){f=E(val)},get attr(){return p},set attr(val){p=E(val)},get fileAttr(){return(p||0)>>16&4095},get offset(){return m},set offset(val){m=E(val)},get encrypted(){return(i&n.FLG_ENC)===n.FLG_ENC},get centralHeaderSize(){return n.CENHDR+h+c+d},get realDataOffset(){return m+n.LOCHDR+g.fnameLen+g.extraLen},get localHeader(){return g},loadLocalHeaderFromBinary:function(e){var t=e.slice(m,m+n.LOCHDR);if(t.readUInt32LE(0)!==n.LOCSIG)throw r.Errors.INVALID_LOC();g.version=t.readUInt16LE(n.LOCVER),g.flags=t.readUInt16LE(n.LOCFLG),g.method=t.readUInt16LE(n.LOCHOW),g.time=t.readUInt32LE(n.LOCTIM),g.crc=t.readUInt32LE(n.LOCCRC),g.compressedSize=t.readUInt32LE(n.LOCSIZ),g.size=t.readUInt32LE(n.LOCLEN),g.fnameLen=t.readUInt16LE(n.LOCNAM),g.extraLen=t.readUInt16LE(n.LOCEXT);let i=m+n.LOCHDR+g.fnameLen,s=i+g.extraLen;return e.slice(i,s)},loadFromBinary:function(g){if(g.length!==n.CENHDR||g.readUInt32LE(0)!==n.CENSIG)throw r.Errors.INVALID_CEN();e=g.readUInt16LE(n.CENVEM),t=g.readUInt16LE(n.CENVER),i=g.readUInt16LE(n.CENFLG),s=g.readUInt16LE(n.CENHOW),o=g.readUInt32LE(n.CENTIM),u=g.readUInt32LE(n.CENCRC),a=g.readUInt32LE(n.CENSIZ),l=g.readUInt32LE(n.CENLEN),h=g.readUInt16LE(n.CENNAM),c=g.readUInt16LE(n.CENEXT),d=g.readUInt16LE(n.CENCOM),D=g.readUInt16LE(n.CENDSK),f=g.readUInt16LE(n.CENATT),p=g.readUInt32LE(n.CENATX),m=g.readUInt32LE(n.CENOFF)},localHeaderToBinary:function(){var e=Buffer.alloc(n.LOCHDR);return e.writeUInt32LE(n.LOCSIG,0),e.writeUInt16LE(t,n.LOCVER),e.writeUInt16LE(i,n.LOCFLG),e.writeUInt16LE(s,n.LOCHOW),e.writeUInt32LE(o,n.LOCTIM),e.writeUInt32LE(u,n.LOCCRC),e.writeUInt32LE(a,n.LOCSIZ),e.writeUInt32LE(l,n.LOCLEN),e.writeUInt16LE(h,n.LOCNAM),e.writeUInt16LE(g.extraLen,n.LOCEXT),e},centralHeaderToBinary:function(){var r=Buffer.alloc(n.CENHDR+h+c+d);return r.writeUInt32LE(n.CENSIG,0),r.writeUInt16LE(e,n.CENVEM),r.writeUInt16LE(t,n.CENVER),r.writeUInt16LE(i,n.CENFLG),r.writeUInt16LE(s,n.CENHOW),r.writeUInt32LE(o,n.CENTIM),r.writeUInt32LE(u,n.CENCRC),r.writeUInt32LE(a,n.CENSIZ),r.writeUInt32LE(l,n.CENLEN),r.writeUInt16LE(h,n.CENNAM),r.writeUInt16LE(c,n.CENEXT),r.writeUInt16LE(d,n.CENCOM),r.writeUInt16LE(D,n.CENDSK),r.writeUInt16LE(f,n.CENATT),r.writeUInt32LE(p,n.CENATX),r.writeUInt32LE(m,n.CENOFF),r},toJSON:function(){let o=function(e){return e+" bytes"};return{made:e,version:t,flags:i,method:r.methodToString(s),time:this.time,crc:"0x"+u.toString(16).toUpperCase(),compressedSize:o(a),size:o(l),fileNameLength:o(h),extraLength:o(c),commentLength:o(d),diskNumStart:D,inAttr:f,attr:p,offset:m,centralHeaderSize:o(n.CENHDR+h+c+d)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/index.js":function(e,t,i){t.EntryHeader=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/entryHeader.js"),t.MainHeader=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/mainHeader.js")},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/mainHeader.js":function(e,t,i){var r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js"),n=r.Constants;e.exports=function(){var e=0,t=0,i=0,s=0,o=0;return{get diskEntries(){return e},set diskEntries(val){e=t=val},get totalEntries(){return t},set totalEntries(val){t=e=val},get size(){return i},set size(val){i=val},get offset(){return s},set offset(val){s=val},get commentLength(){return o},set commentLength(val){o=val},get mainHeaderSize(){return n.ENDHDR+o},loadFromBinary:function(u){if((u.length!==n.ENDHDR||u.readUInt32LE(0)!==n.ENDSIG)&&(u.length<n.ZIP64HDR||u.readUInt32LE(0)!==n.ZIP64SIG))throw r.Errors.INVALID_END();u.readUInt32LE(0)===n.ENDSIG?(e=u.readUInt16LE(n.ENDSUB),t=u.readUInt16LE(n.ENDTOT),i=u.readUInt32LE(n.ENDSIZ),s=u.readUInt32LE(n.ENDOFF),o=u.readUInt16LE(n.ENDCOM)):(e=r.readBigUInt64LE(u,n.ZIP64SUB),t=r.readBigUInt64LE(u,n.ZIP64TOT),i=r.readBigUInt64LE(u,n.ZIP64SIZE),s=r.readBigUInt64LE(u,n.ZIP64OFF),o=0)},toBinary:function(){var r=Buffer.alloc(n.ENDHDR+o);return r.writeUInt32LE(n.ENDSIG,0),r.writeUInt32LE(0,4),r.writeUInt16LE(e,n.ENDSUB),r.writeUInt16LE(t,n.ENDTOT),r.writeUInt32LE(i,n.ENDSIZ),r.writeUInt32LE(s,n.ENDOFF),r.writeUInt16LE(o,n.ENDCOM),r.fill(" ",n.ENDHDR),r},toJSON:function(){return{diskEntries:e,totalEntries:t,size:i+" bytes",offset:function(e,t){let i=e.toString(16).toUpperCase();for(;i.length<4;)i="0"+i;return"0x"+i}(s,0),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/deflater.js":function(e,t,i){e.exports=function(e){var t=i("zlib"),r={chunkSize:(parseInt(e.length/1024)+1)*1024};return{deflate:function(){return t.deflateRawSync(e,r)},deflateAsync:function(i){var n=t.createDeflateRaw(r),s=[],o=0;n.on("data",function(e){s.push(e),o+=e.length}),n.on("end",function(){var e=Buffer.alloc(o),t=0;e.fill(0);for(var r=0;r<s.length;r++){var n=s[r];n.copy(e,t),t+=n.length}i&&i(e)}),n.end(e)}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/index.js":function(e,t,i){t.Deflater=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/deflater.js"),t.Inflater=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/inflater.js"),t.ZipCrypto=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/zipcrypto.js")},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/inflater.js":function(e,t,i){let r=+(process.versions?process.versions.node:"").split(".")[0]||0;e.exports=function(e,t){var n=i("zlib");let s=r>=15&&t>0?{maxOutputLength:t}:{};return{inflate:function(){return n.inflateRawSync(e,s)},inflateAsync:function(t){var i=n.createInflateRaw(s),r=[],o=0;i.on("data",function(e){r.push(e),o+=e.length}),i.on("end",function(){var e=Buffer.alloc(o),i=0;e.fill(0);for(var n=0;n<r.length;n++){var s=r[n];s.copy(e,i),i+=s.length}t&&t(e)}),i.end(e)}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/zipcrypto.js":function(e,t,i){let{randomFillSync:r}=i("crypto"),n=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js"),s=new Uint32Array(256).map((e,t)=>{for(let e=0;e<8;e++)0!=(1&t)?t=t>>>1^0xedb88320:t>>>=1;return t>>>0}),o=(e,t)=>Math.imul(e,t)>>>0,u=(e,t)=>s[(e^t)&255]^e>>>8,a=()=>"function"==typeof r?r(Buffer.alloc(12)):a.node();a.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let i=0;i<t;i++)e[i]=256*Math.random()&255;return e};let l={genSalt:a};function h(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([0x12345678,0x23456789,0x34567890]);for(let e=0;e<t.length;e++)this.updateKeys(t[e])}h.prototype.updateKeys=function(e){let t=this.keys;return t[0]=u(t[0],e),t[1]+=255&t[0],t[1]=o(t[1],0x8088405)+1,t[2]=u(t[2],t[1]>>>24),e},h.prototype.next=function(){let e=(2|this.keys[2])>>>0;return o(e,1^e)>>8&255},e.exports={decrypt:function(e,t,i){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=function(e){let t=new h(e);return function(e){let i=Buffer.alloc(e.length),r=0;for(let n of e)i[r++]=t.updateKeys(n^t.next());return i}}(i),s=r(e.slice(0,12)),o=(8&t.flags)==8?t.timeHighByte:t.crc>>>24;if(s[11]!==o)throw n.WRONG_PASSWORD();return r(e.slice(12))},encrypt:function(e,t,i,r=!1){null==e&&(e=Buffer.alloc(0)),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let n=function(e){let t=new h(e);return function(e,i,r=0){for(let n of(i||(i=Buffer.alloc(e.length)),e)){let e=t.next();i[r++]=n^e,t.updateKeys(n)}return i}}(i),s=l.genSalt();s[11]=t.crc>>>24&255,r&&(s[10]=t.crc>>>16&255);let o=Buffer.alloc(e.length+12);return n(s,o),n(e,o,12)},_salter:function(e){Buffer.isBuffer(e)&&e.length>=12?l.genSalt=function(){return e.slice(0,12)}:"node"===e?l.genSalt=a.node:l.genSalt=a}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/constants.js":function(e){e.exports={LOCHDR:30,LOCSIG:0x4034b50,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:0x8074b50,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:0x2014b50,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:0x6054b50,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:0x7064b50,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:0x6064b50,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:0xffffffff,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/decoder.js":function(e){e.exports={efs:!0,encode:e=>Buffer.from(e,"utf8"),decode:e=>e.toString("utf8")}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js":function(e,t){let i={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};for(let e of Object.keys(i))t[e]=function(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(e,i)=>t[i]||"")),Error("ADM-ZIP: "+e)}}(i[e])},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/fattr.js":function(e,t,i){let r=i("path");e.exports=function(e,{fs:t}){var i=e||"",n={directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0},s=null;return i&&t.existsSync(i)?(n.directory=(s=t.statSync(i)).isDirectory(),n.mtime=s.mtime,n.atime=s.atime,n.executable=(73&s.mode)!=0,n.readonly=(128&s.mode)==0,n.hidden="."===r.basename(i)[0]):console.warn("Invalid path: "+i),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:i,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js":function(e,t,i){e.exports=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/utils.js"),e.exports.Constants=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/constants.js"),e.exports.Errors=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js"),e.exports.FileAttr=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/fattr.js"),e.exports.decoder=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/decoder.js")},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/utils.js":function(e,t,i){let r=i("fs"),n=i("path"),s=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/constants.js"),o=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js"),u="object"==typeof process&&"win32"===process.platform,a=e=>"object"==typeof e&&null!==e,l=new Uint32Array(256).map((e,t)=>{for(let e=0;e<8;e++)(1&t)!=0?t=0xedb88320^t>>>1:t>>>=1;return t>>>0});function h(e){this.sep=n.sep,this.fs=r,a(e)&&a(e.fs)&&"function"==typeof e.fs.statSync&&(this.fs=e.fs)}e.exports=h,h.prototype.makeDir=function(e){let t,i=this;t=e.split(i.sep)[0],e.split(i.sep).forEach(function(e){var r;if(e&&":"!==e.substr(-1,1)){t+=i.sep+e;try{r=i.fs.statSync(t)}catch(e){i.fs.mkdirSync(t)}if(r&&r.isFile())throw o.FILE_IN_THE_WAY(`"${t}"`)}})},h.prototype.writeFileTo=function(e,t,i,r){if(this.fs.existsSync(e)){var s;if(!i||this.fs.statSync(e).isDirectory())return!1}var o=n.dirname(e);this.fs.existsSync(o)||this.makeDir(o);try{s=this.fs.openSync(e,"w",438)}catch(t){this.fs.chmodSync(e,438),s=this.fs.openSync(e,"w",438)}if(s)try{this.fs.writeSync(s,t,0,t.length,0)}finally{this.fs.closeSync(s)}return this.fs.chmodSync(e,r||438),!0},h.prototype.writeFileToAsync=function(e,t,i,r,s){"function"==typeof r&&(s=r,r=void 0);let o=this;o.fs.exists(e,function(u){if(u&&!i)return s(!1);o.fs.stat(e,function(i,a){if(u&&a.isDirectory())return s(!1);var l=n.dirname(e);o.fs.exists(l,function(i){i||o.makeDir(l),o.fs.open(e,"w",438,function(i,n){i?o.fs.chmod(e,438,function(){o.fs.open(e,"w",438,function(i,n){o.fs.write(n,t,0,t.length,0,function(){o.fs.close(n,function(){o.fs.chmod(e,r||438,function(){s(!0)})})})})}):n?o.fs.write(n,t,0,t.length,0,function(){o.fs.close(n,function(){o.fs.chmod(e,r||438,function(){s(!0)})})}):o.fs.chmod(e,r||438,function(){s(!0)})})})})})},h.prototype.findFiles=function(e){let t=this;return function e(i,r,s){"boolean"==typeof r&&(s=r,r=void 0);let o=[];return t.fs.readdirSync(i).forEach(function(u){let a=n.join(i,u),l=t.fs.statSync(a);(!r||r.test(a))&&o.push(n.normalize(a)+(l.isDirectory()?t.sep:"")),l.isDirectory()&&s&&(o=o.concat(e(a,r,s)))}),o}(e,void 0,!0)},h.prototype.findFilesAsync=function(e,t){let i=this,r=[];i.fs.readdir(e,function(s,o){if(s)return t(s);let u=o.length;if(!u)return t(null,r);o.forEach(function(s){s=n.join(e,s),i.fs.stat(s,function(e,o){if(e)return t(e);o&&(r.push(n.normalize(s)+(o.isDirectory()?i.sep:"")),o.isDirectory()?i.findFilesAsync(s,function(e,i){if(e)return t(e);r=r.concat(i),--u||t(null,r)}):--u||t(null,r))})})})},h.prototype.getAttributes=function(){},h.prototype.setAttributes=function(){},h.crc32update=function(e,t){return l[(e^t)&255]^e>>>8},h.crc32=function(e){"string"==typeof e&&(e=Buffer.from(e,"utf8"));let t=e.length,i=-1;for(let r=0;r<t;)i=h.crc32update(i,e[r++]);return~i>>>0},h.methodToString=function(e){switch(e){case s.STORED:return"STORED ("+e+")";case s.DEFLATED:return"DEFLATED ("+e+")";default:return"UNSUPPORTED ("+e+")"}},h.canonical=function(e){if(!e)return"";let t=n.posix.normalize("/"+e.split("\\").join("/"));return n.join(".",t)},h.zipnamefix=function(e){if(!e)return"";let t=n.posix.normalize("/"+e.split("\\").join("/"));return n.posix.join(".",t)},h.findLast=function(e,t){if(!Array.isArray(e))throw TypeError("arr is not array");let i=e.length>>>0;for(let r=i-1;r>=0;r--)if(t(e[r],r,e))return e[r]},h.sanitize=function(e,t){e=n.resolve(n.normalize(e));for(var i=t.split("/"),r=0,s=i.length;r<s;r++){var o=n.normalize(n.join(e,i.slice(r,s).join(n.sep)));if(0===o.indexOf(e))return o}return n.normalize(n.join(e,n.basename(t)))},h.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):"string"==typeof e?t(e):Buffer.alloc(0)},h.readBigUInt64LE=function(e,t){var i=Buffer.from(e.slice(t,t+8));return i.swap64(),parseInt(`0x${i.toString("hex")}`)},h.fromDOS2Date=function(e){return new Date((e>>25&127)+1980,Math.max((e>>21&15)-1,0),Math.max(e>>16&31,1),e>>11&31,e>>5&63,(31&e)<<1)},h.fromDate2DOS=function(e){let t=0,i=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),i=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|i},h.isWin=u,h.crcTable=l},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipEntry.js":function(e,t,i){var r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js"),n=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/index.js"),s=r.Constants,o=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/index.js");e.exports=function(e,t){var i=new n.EntryHeader,u=Buffer.alloc(0),a=Buffer.alloc(0),l=!1,h=null,c=Buffer.alloc(0),d=Buffer.alloc(0),D=!0;let f="object"==typeof e.decoder?e.decoder:r.decoder;function p(){return t&&t instanceof Uint8Array?(d=i.loadLocalHeaderFromBinary(t),t.slice(i.realDataOffset,i.realDataOffset+i.compressedSize)):Buffer.alloc(0)}function m(e){if(i.flags_desc){let n={},o=i.realDataOffset+i.compressedSize;if(t.readUInt32LE(o)==s.LOCSIG||t.readUInt32LE(o)==s.CENSIG)throw r.Errors.DESCRIPTOR_NOT_EXIST();if(t.readUInt32LE(o)==s.EXTSIG)n.crc=t.readUInt32LE(o+s.EXTCRC),n.compressedSize=t.readUInt32LE(o+s.EXTSIZ),n.size=t.readUInt32LE(o+s.EXTLEN);else if(19280===t.readUInt16LE(o+12))n.crc=t.readUInt32LE(o+s.EXTCRC-4),n.compressedSize=t.readUInt32LE(o+s.EXTSIZ-4),n.size=t.readUInt32LE(o+s.EXTLEN-4);else throw r.Errors.DESCRIPTOR_UNKNOWN();if(n.compressedSize!==i.compressedSize||n.size!==i.size||n.crc!==i.crc)throw r.Errors.DESCRIPTOR_FAULTY();if(r.crc32(e)!==n.crc)return!1}else if(r.crc32(e)!==i.localHeader.crc)return!1;return!0}function g(e,t,n){if(void 0===t&&"string"==typeof e&&(n=e,e=void 0),l)return e&&t&&t(Buffer.alloc(0),r.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var s=p();if(0===s.length)return e&&t&&t(s),s;if(i.encrypted){if("string"!=typeof n&&!Buffer.isBuffer(n))throw r.Errors.INVALID_PASS_PARAM();s=o.ZipCrypto.decrypt(s,i,n)}var a=Buffer.alloc(i.size);switch(i.method){case r.Constants.STORED:if(s.copy(a),m(a))return e&&t&&t(a),a;throw e&&t&&t(a,r.Errors.BAD_CRC()),r.Errors.BAD_CRC();case r.Constants.DEFLATED:var h=new o.Inflater(s,i.size);if(e)h.inflateAsync(function(e){e.copy(e,0),t&&(m(e)?t(e):t(e,r.Errors.BAD_CRC()))});else{if(h.inflate(a).copy(a,0),!m(a))throw r.Errors.BAD_CRC(`"${f.decode(u)}"`);return a}break;default:throw e&&t&&t(Buffer.alloc(0),r.Errors.UNKNOWN_METHOD()),r.Errors.UNKNOWN_METHOD()}}function E(e,n){if((!h||!h.length)&&Buffer.isBuffer(t))return e&&n&&n(p()),p();if(h.length&&!l){var s;switch(i.method){case r.Constants.STORED:return i.compressedSize=i.size,s=Buffer.alloc(h.length),h.copy(s),e&&n&&n(s),s;default:case r.Constants.DEFLATED:var u=new o.Deflater(h);if(e)u.deflateAsync(function(e){s=Buffer.alloc(e.length),i.compressedSize=e.length,e.copy(s),n&&n(s)});else{var a=u.deflate();return i.compressedSize=a.length,a}u=null}}else{if(!e||!n)return Buffer.alloc(0);n(Buffer.alloc(0))}}function b(e,t){return(e.readUInt32LE(t+4)<<4)+e.readUInt32LE(t)}return D=!!f.hasOwnProperty("efs")&&f.efs,{get entryName(){return f.decode(u)},get rawEntryName(){return u},set entryName(val){var y=(u=r.toBuffer(val,f.encode))[u.length-1];l=47===y||92===y,i.fileNameLength=u.length},get efs(){if("function"==typeof D)return D(this.entryName);return D},get extra(){return c},set extra(val){c=val,i.extraLength=val.length;try{for(var F,C,v,w=0;w+4<val.length;)F=val.readUInt16LE(w),w+=2,C=val.readUInt16LE(w),w+=2,v=val.slice(w,w+C),w+=C,s.ID_ZIP64===F&&function(e){var t,r,n,o;e.length>=s.EF_ZIP64_SCOMP&&(t=b(e,s.EF_ZIP64_SUNCOMP),i.size===s.EF_ZIP64_OR_32&&(i.size=t)),e.length>=s.EF_ZIP64_RHO&&(r=b(e,s.EF_ZIP64_SCOMP),i.compressedSize===s.EF_ZIP64_OR_32&&(i.compressedSize=r)),e.length>=s.EF_ZIP64_DSN&&(n=b(e,s.EF_ZIP64_RHO),i.offset===s.EF_ZIP64_OR_32&&(i.offset=n)),e.length>=s.EF_ZIP64_DSN+4&&(o=e.readUInt32LE(s.EF_ZIP64_DSN),i.diskNumStart===s.EF_ZIP64_OR_16&&(i.diskNumStart=o))}(v)}catch(e){throw r.Errors.EXTRA_FIELD_PARSE_ERROR()}},get comment(){return f.decode(a)},set comment(val){if(i.commentLength=(a=r.toBuffer(val,f.encode)).length,a.length>65535)throw r.Errors.COMMENT_TOO_LONG()},get name(){var _=f.decode(u);return l?_.substr(_.length-1).split("/").pop():_.split("/").pop()},get isDirectory(){return l},getCompressedData:function(){return E(!1,null)},getCompressedDataAsync:function(e){E(!0,e)},setData:function(e){h=r.toBuffer(e,r.decoder.encode),!l&&h.length?(i.size=h.length,i.method=r.Constants.DEFLATED,i.crc=r.crc32(e),i.changed=!0):i.method=r.Constants.STORED},getData:function(e){return i.changed?h:g(!1,null,e)},getDataAsync:function(e,t){i.changed?e(h):g(!0,e,t)},set attr(attr){i.attr=attr},get attr(){return i.attr},set header(data){i.loadFromBinary(data)},get header(){return i},packCentralHeader:function(){i.flags_efs=this.efs,i.extraLength=c.length;var e=i.centralHeaderToBinary(),t=r.Constants.CENHDR;return u.copy(e,t),t+=u.length,c.copy(e,t),t+=i.extraLength,a.copy(e,t),e},packLocalHeader:function(){let e=0;i.flags_efs=this.efs,i.extraLocalLength=d.length;let t=i.localHeaderToBinary(),r=Buffer.alloc(t.length+u.length+i.extraLocalLength);return t.copy(r,e),e+=t.length,u.copy(r,e),e+=u.length,d.copy(r,e),e+=d.length,r},toJSON:function(){let e=function(e){return"<"+(e&&e.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:i.toJSON(),compressedData:e(t),data:e(h)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipFile.js":function(e,t,i){let r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipEntry.js"),n=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/index.js"),s=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js");e.exports=function(e,t){var i=[],o={},u=Buffer.alloc(0),a=new n.MainHeader,l=!1;let h=new Set,{noSort:c,decoder:d}=t;function D(){if(l=!0,o={},a.diskEntries>(e.length-a.offset)/s.Constants.CENHDR)throw s.Errors.DISK_ENTRY_TOO_LARGE();i=Array(a.diskEntries);for(var n=a.offset,u=0;u<i.length;u++){var c=n,d=new r(t,e);d.header=e.slice(c,c+=s.Constants.CENHDR),d.entryName=e.slice(c,c+=d.header.fileNameLength),d.header.extraLength&&(d.extra=e.slice(c,c+=d.header.extraLength)),d.header.commentLength&&(d.comment=e.slice(c,c+d.header.commentLength)),n+=d.header.centralHeaderSize,i[u]=d,o[d.entryName]=d}h.clear(),function(){let e=new Set;for(let t of Object.keys(o)){let i=t.split("/");if(i.pop(),i.length)for(let t=0;t<i.length;t++){let r=i.slice(0,t+1).join("/")+"/";e.add(r)}}for(let n of e)if(!(n in o)){let e=new r(t);e.entryName=n,e.attr=16,e.temporary=!0,i.push(e),o[e.entryName]=e,h.add(e)}}()}function f(){i.length>1&&!c&&i.sort((e,t)=>e.entryName.toLowerCase().localeCompare(t.entryName.toLowerCase()))}return e?function(i){var r=e.length-s.Constants.ENDHDR,n=Math.max(0,r-65535),o=n,l=e.length,h=-1,c=0;for("boolean"==typeof t.trailingSpace&&t.trailingSpace&&(n=0);r>=o;r--)if(80===e[r]){if(e.readUInt32LE(r)===s.Constants.ENDSIG){h=r,c=r,l=r+s.Constants.ENDHDR,o=r-s.Constants.END64HDR;continue}if(e.readUInt32LE(r)===s.Constants.END64SIG){o=n;continue}if(e.readUInt32LE(r)===s.Constants.ZIP64SIG){h=r,l=r+s.readBigUInt64LE(e,r+s.Constants.ZIP64SIZE)+s.Constants.ZIP64LEAD;break}}if(-1==h)throw s.Errors.INVALID_FORMAT();a.loadFromBinary(e.slice(h,l)),a.commentLength&&(u=e.slice(c+s.Constants.ENDHDR)),i&&D()}(t.readEntries):l=!0,{get entries(){return l||D(),i.filter(e=>!h.has(e))},get comment(){return d.decode(u)},set comment(val){a.commentLength=(u=s.toBuffer(val,d.encode)).length},getEntryCount:function(){return l?i.length:a.diskEntries},forEach:function(e){this.entries.forEach(e)},getEntry:function(e){return l||D(),o[e]||null},setEntry:function(e){l||D(),i.push(e),o[e.entryName]=e,a.totalEntries=i.length},deleteFile:function(e,t=!0){l||D();let i=o[e];this.getEntryChildren(i,t).map(e=>e.entryName).forEach(this.deleteEntry)},deleteEntry:function(e){l||D();let t=o[e],r=i.indexOf(t);r>=0&&(i.splice(r,1),delete o[e],a.totalEntries=i.length)},getEntryChildren:function(e,t=!0){if(l||D(),"object"==typeof e)if(!e.isDirectory||!t)return[e];else{let t=[],r=e.entryName;for(let e of i)e.entryName.startsWith(r)&&t.push(e);return t}return[]},getChildCount:function(e){if(e&&e.isDirectory){let t=this.getEntryChildren(e);return t.includes(e)?t.length-1:t.length}return 0},compressToBuffer:function(){l||D(),f();let t=[],i=[],r=0,n=0;a.size=0,a.offset=0;let o=0;for(let e of this.entries){let s=e.getCompressedData();e.header.offset=n;let u=e.packLocalHeader(),l=u.length+s.length;n+=l,t.push(u),t.push(s);let h=e.packCentralHeader();i.push(h),a.size+=h.length,r+=l+h.length,o++}r+=a.mainHeaderSize,a.offset=n,a.totalEntries=o,n=0;let h=Buffer.alloc(r);for(let e of t)e.copy(h,n),n+=e.length;for(let e of i)e.copy(h,n),n+=e.length;let c=a.toBinary();return u&&u.copy(c,s.Constants.ENDHDR),c.copy(h,n),e=h,l=!1,h},toAsyncBuffer:function(t,i,r,n){try{l||D(),f();let i=[],o=[],h=0,c=0,d=0;a.size=0,a.offset=0;let p=function(D){if(D.length>0){let e=D.shift(),t=e.entryName+e.extra.toString();r&&r(t),e.getCompressedDataAsync(function(r){n&&n(t),e.header.offset=c;let s=e.packLocalHeader(),u=s.length+r.length;c+=u,i.push(s),i.push(r);let l=e.packCentralHeader();o.push(l),a.size+=l.length,h+=u+l.length,d++,p(D)})}else{h+=a.mainHeaderSize,a.offset=c,a.totalEntries=d,c=0;let r=Buffer.alloc(h);i.forEach(function(e){e.copy(r,c),c+=e.length}),o.forEach(function(e){e.copy(r,c),c+=e.length});let n=a.toBinary();u&&u.copy(n,s.Constants.ENDHDR),n.copy(r,c),e=r,l=!1,t(r)}};p(Array.from(this.entries))}catch(e){i(e)}}}}},"../../node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js":function(e){function t(e){return!!("number"==typeof e||/^0x[0-9a-f]+$/i.test(e))||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function i(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,r){r||(r={});var n={bools:{},strings:{},unknownFn:null};"function"==typeof r.unknown&&(n.unknownFn=r.unknown),"boolean"==typeof r.boolean&&r.boolean?n.allBools=!0:[].concat(r.boolean).filter(Boolean).forEach(function(e){n.bools[e]=!0});var s={};function o(e){return s[e].some(function(e){return n.bools[e]})}Object.keys(r.alias||{}).forEach(function(e){s[e]=[].concat(r.alias[e]),s[e].forEach(function(t){s[t]=[e].concat(s[e].filter(function(e){return t!==e}))})}),[].concat(r.string).filter(Boolean).forEach(function(e){n.strings[e]=!0,s[e]&&[].concat(s[e]).forEach(function(e){n.strings[e]=!0})});var u=r.default||{},a={_:[]};function l(e,t,r){for(var s=e,o=0;o<t.length-1;o++){var u=t[o];if(i(s,u))return;void 0===s[u]&&(s[u]={}),(s[u]===Object.prototype||s[u]===Number.prototype||s[u]===String.prototype)&&(s[u]={}),s[u]===Array.prototype&&(s[u]=[]),s=s[u]}var a=t[t.length-1];i(s,a)||((s===Object.prototype||s===Number.prototype||s===String.prototype)&&(s={}),s===Array.prototype&&(s=[]),void 0===s[a]||n.bools[a]||"boolean"==typeof s[a]?s[a]=r:Array.isArray(s[a])?s[a].push(r):s[a]=[s[a],r])}function h(e,i,r){if(!r||!n.unknownFn||n.allBools&&/^--[^=]+$/.test(r)||n.strings[e]||n.bools[e]||s[e]||!1!==n.unknownFn(r)){var o=!n.strings[e]&&t(i)?Number(i):i;l(a,e.split("."),o),(s[e]||[]).forEach(function(e){l(a,e.split("."),o)})}}Object.keys(n.bools).forEach(function(e){h(e,void 0!==u[e]&&u[e])});var c=[];-1!==e.indexOf("--")&&(c=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var d=0;d<e.length;d++){var D,f,p=e[d];if(/^--.+=/.test(p)){var m=p.match(/^--([^=]+)=([\s\S]*)$/);D=m[1];var g=m[2];n.bools[D]&&(g="false"!==g),h(D,g,p)}else if(/^--no-.+/.test(p))h(D=p.match(/^--no-(.+)/)[1],!1,p);else if(/^--.+/.test(p))D=p.match(/^--(.+)/)[1],void 0===(f=e[d+1])||/^(-|--)[^-]/.test(f)||n.bools[D]||n.allBools||s[D]&&o(D)?/^(true|false)$/.test(f)?(h(D,"true"===f,p),d+=1):h(D,!n.strings[D]||"",p):(h(D,f,p),d+=1);else if(/^-[^-]+/.test(p)){for(var E=p.slice(1,-1).split(""),b=!1,y=0;y<E.length;y++){if("-"===(f=p.slice(y+2))){h(E[y],f,p);continue}if(/[A-Za-z]/.test(E[y])&&"="===f[0]){h(E[y],f.slice(1),p),b=!0;break}if(/[A-Za-z]/.test(E[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(f)){h(E[y],f,p),b=!0;break}if(E[y+1]&&E[y+1].match(/\W/)){h(E[y],p.slice(y+2),p),b=!0;break}h(E[y],!n.strings[E[y]]||"",p)}D=p.slice(-1)[0],b||"-"===D||(!e[d+1]||/^(-|--)[^-]/.test(e[d+1])||n.bools[D]||s[D]&&o(D)?e[d+1]&&/^(true|false)$/.test(e[d+1])?(h(D,"true"===e[d+1],p),d+=1):h(D,!n.strings[D]||"",p):(h(D,e[d+1],p),d+=1))}else if(n.unknownFn&&!1===n.unknownFn(p)||a._.push(n.strings._||!t(p)?p:Number(p)),r.stopEarly){a._.push.apply(a._,e.slice(d+1));break}}return Object.keys(u).forEach(function(e){var t,i;t=e.split("."),i=a,t.slice(0,-1).forEach(function(e){i=i[e]||{}}),t[t.length-1]in i||(l(a,e.split("."),u[e]),(s[e]||[]).forEach(function(t){l(a,t.split("."),u[e])}))}),r["--"]?a["--"]=c.slice():c.forEach(function(e){a._.push(e)}),a}},"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js":function(e){let t=process||{},i=t.argv||[],r=t.env||{},n=!(r.NO_COLOR||i.includes("--no-color"))&&(!!r.FORCE_COLOR||i.includes("--color")||"win32"===t.platform||(t.stdout||{}).isTTY&&"dumb"!==r.TERM||!!r.CI),s=(e,t,i=e)=>r=>{let n=""+r,s=n.indexOf(t,e.length);return~s?e+o(n,t,i,s)+t:e+n+t},o=(e,t,i,r)=>{let n="",s=0;do n+=e.substring(s,r)+i,s=r+t.length,r=e.indexOf(t,s);while(~r);return n+e.substring(s)},u=(e=n)=>{let t=e?s:()=>String;return{isColorSupported:e,reset:t("\x1b[0m","\x1b[0m"),bold:t("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),dim:t("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),italic:t("\x1b[3m","\x1b[23m"),underline:t("\x1b[4m","\x1b[24m"),inverse:t("\x1b[7m","\x1b[27m"),hidden:t("\x1b[8m","\x1b[28m"),strikethrough:t("\x1b[9m","\x1b[29m"),black:t("\x1b[30m","\x1b[39m"),red:t("\x1b[31m","\x1b[39m"),green:t("\x1b[32m","\x1b[39m"),yellow:t("\x1b[33m","\x1b[39m"),blue:t("\x1b[34m","\x1b[39m"),magenta:t("\x1b[35m","\x1b[39m"),cyan:t("\x1b[36m","\x1b[39m"),white:t("\x1b[37m","\x1b[39m"),gray:t("\x1b[90m","\x1b[39m"),bgBlack:t("\x1b[40m","\x1b[49m"),bgRed:t("\x1b[41m","\x1b[49m"),bgGreen:t("\x1b[42m","\x1b[49m"),bgYellow:t("\x1b[43m","\x1b[49m"),bgBlue:t("\x1b[44m","\x1b[49m"),bgMagenta:t("\x1b[45m","\x1b[49m"),bgCyan:t("\x1b[46m","\x1b[49m"),bgWhite:t("\x1b[47m","\x1b[49m"),blackBright:t("\x1b[90m","\x1b[39m"),redBright:t("\x1b[91m","\x1b[39m"),greenBright:t("\x1b[92m","\x1b[39m"),yellowBright:t("\x1b[93m","\x1b[39m"),blueBright:t("\x1b[94m","\x1b[39m"),magentaBright:t("\x1b[95m","\x1b[39m"),cyanBright:t("\x1b[96m","\x1b[39m"),whiteBright:t("\x1b[97m","\x1b[39m"),bgBlackBright:t("\x1b[100m","\x1b[49m"),bgRedBright:t("\x1b[101m","\x1b[49m"),bgGreenBright:t("\x1b[102m","\x1b[49m"),bgYellowBright:t("\x1b[103m","\x1b[49m"),bgBlueBright:t("\x1b[104m","\x1b[49m"),bgMagentaBright:t("\x1b[105m","\x1b[49m"),bgCyanBright:t("\x1b[106m","\x1b[49m"),bgWhiteBright:t("\x1b[107m","\x1b[49m")}};e.exports=u(),e.exports.createColors=u},"../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js":function(e){let t=`\x1b[`,i={to:(e,i)=>i?`${t}${i+1};${e+1}H`:`${t}${e+1}G`,move(e,i){let r="";return e<0?r+=`${t}${-e}D`:e>0&&(r+=`${t}${e}C`),i<0?r+=`${t}${-i}A`:i>0&&(r+=`${t}${i}B`),r},up:(e=1)=>`${t}${e}A`,down:(e=1)=>`${t}${e}B`,forward:(e=1)=>`${t}${e}C`,backward:(e=1)=>`${t}${e}D`,nextLine:(e=1)=>`${t}E`.repeat(e),prevLine:(e=1)=>`${t}F`.repeat(e),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`\x1b7`,restore:`\x1b8`},r={screen:`${t}2J`,up:(e=1)=>`${t}1J`.repeat(e),down:(e=1)=>`${t}J`.repeat(e),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?i.up():"");return e&&(t+=i.left),t}};e.exports={cursor:i,scroll:{up:(e=1)=>`${t}S`.repeat(e),down:(e=1)=>`${t}T`.repeat(e)},erase:r,beep:"\x07"}},"../../node_modules/.pnpm/tinygradient@1.1.5/node_modules/tinygradient/index.js":function(e,t,i){let r=i("../../node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/cjs/tinycolor.js"),n={r:256,g:256,b:256,a:1},s={h:360,s:1,v:1,a:1};function o(e,t,i){let r={};for(let n in e)e.hasOwnProperty(n)&&(r[n]=0===i?0:(t[n]-e[n])/i);return r}function u(e,t,i,r){let n={};for(let s in t)t.hasOwnProperty(s)&&(n[s]=e[s]*i+t[s],n[s]=n[s]<0?n[s]+r[s]:1!==r[s]?n[s]%r[s]:n[s]);return n}function a(e,t,i){let s=e.color.toRgb(),a=o(s,t.color.toRgb(),i),l=[e.color];for(let e=1;e<i;e++){let t=u(a,s,e,n);l.push(r(t))}return l}function l(e,t,i,n){let l,h,c=e.color.toHsv(),d=t.color.toHsv();if(0===c.s||0===d.s)return a(e,t,i);if("boolean"==typeof n)l=n;else{let e=c.h<d.h&&d.h-c.h<180||c.h>d.h&&c.h-d.h>180;l="long"===n&&e||"short"===n&&!e}let D=o(c,d,i),f=[e.color];h=c.h<=d.h&&!l||c.h>=d.h&&l?d.h-c.h:l?360-d.h+c.h:360-c.h+d.h,D.h=Math.pow(-1,+!!l)*Math.abs(h)/i;for(let e=1;e<i;e++){let t=u(D,c,e,s);f.push(r(t))}return f}function h(e,t){let i=e.length;if(isNaN(t=parseInt(t,10))||t<2)throw Error("Invalid number of steps (< 2)");if(t<i)throw Error("Number of steps cannot be inferior to number of stops");let r=[];for(let n=1;n<i;n++){let i=(t-1)*(e[n].pos-e[n-1].pos);r.push(Math.max(1,Math.round(i)))}let n=1;for(let e=i-1;e--;)n+=r[e];for(;n!==t;)if(n<t){let e=Math.min.apply(null,r);r[r.indexOf(e)]++,n++}else{let e=Math.max.apply(null,r);r[r.indexOf(e)]--,n--}return r}function c(e,t,i,n){let s,a;if(t<0||t>1)throw Error("Position must be between 0 and 1");for(let i=0,r=e.length;i<r-1;i++)if(t>=e[i].pos&&t<e[i+1].pos){s=e[i],a=e[i+1];break}return s||(s=a=e[e.length-1]),r(u(o(s.color[i](),a.color[i](),(a.pos-s.pos)*100),s.color[i](),(t-s.pos)*100,n))}class d{constructor(e){if(e.length<2)throw Error("Invalid number of stops (< 2)");let t=void 0!==e[0].pos,i=e.length,n=-1,s=!1;this.stops=e.map((e,o)=>{let u=void 0!==e.pos;if(t^u)throw Error("Cannot mix positionned and not posionned color stops");if(u){let t=void 0!==e.color;if(!t&&(s||0===o||o===i-1))throw Error("Cannot define two consecutive position-only stops");if(s=!t,(e={color:t?r(e.color):null,colorLess:!t,pos:e.pos}).pos<0||e.pos>1)throw Error("Color stops positions must be between 0 and 1");if(e.pos<n)throw Error("Color stops positions are not ordered");n=e.pos}else e={color:r(void 0!==e.color?e.color:e),pos:o/(i-1)};return e}),0!==this.stops[0].pos&&(this.stops.unshift({color:this.stops[0].color,pos:0}),i++),1!==this.stops[i-1].pos&&this.stops.push({color:this.stops[i-1].color,pos:1})}reverse(){let e=[];return this.stops.forEach(function(t){e.push({color:t.color,pos:1-t.pos})}),new d(e.reverse())}loop(){let e=[],t=[];return this.stops.forEach(t=>{e.push({color:t.color,pos:t.pos/2})}),this.stops.slice(0,-1).forEach(e=>{t.push({color:e.color,pos:1-e.pos/2})}),new d(e.concat(t.reverse()))}rgb(e){let t=h(this.stops,e),i=[];this.stops.forEach((e,t)=>{e.colorLess&&(e.color=a(this.stops[t-1],this.stops[t+1],2)[1])});for(let e=0,r=this.stops.length;e<r-1;e++){let r=a(this.stops[e],this.stops[e+1],t[e]);i.splice(i.length,0,...r)}return i.push(this.stops[this.stops.length-1].color),i}hsv(e,t){let i=h(this.stops,e),r=[];this.stops.forEach((e,i)=>{e.colorLess&&(e.color=l(this.stops[i-1],this.stops[i+1],2,t)[1])});for(let e=0,n=this.stops.length;e<n-1;e++){let n=l(this.stops[e],this.stops[e+1],i[e],t);r.splice(r.length,0,...n)}return r.push(this.stops[this.stops.length-1].color),r}css(e,t){e=e||"linear",t=t||("linear"===e?"to right":"ellipse at center");let i=e+"-gradient("+t;return this.stops.forEach(function(e){i+=", "+(e.colorLess?"":e.color.toRgbString()+" ")+100*e.pos+"%"}),i+=")"}rgbAt(e){return c(this.stops,e,"toRgb",n)}hsvAt(e){return c(this.stops,e,"toHsv",s)}}e.exports=function(e){if(1==arguments.length){if(!Array.isArray(arguments[0]))throw Error('"stops" is not an array');e=arguments[0]}else e=Array.prototype.slice.call(arguments);return new d(e)}},"./src/bin.ts":function(e,t,i){i.a(e,async function(e,r){try{i.r(t);var n=i("./src/lib/bin.ts");try{await (0,n.e)()}catch(e){console.error("Error",e),process.exit(1)}r()}catch(e){r(e)}},1)},"./src/lib/bin.ts":function(W,V,Y){let X;Y.d(V,{e:()=>uf});var K=Y("../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"),q=Y("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"),J=Y.n(q);let Q=function({onlyFirst:e=!1}={}){return RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))",e?void 0:"g")}();function ee(e){if("string"!=typeof e)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Q,"")}function et(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ei={exports:{}},er={};function en(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}ei.exports=er,er.eastAsianWidth=function(e){var t=e.charCodeAt(0),i=2==e.length?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=i&&i<=57343&&(t&=1023,i&=1023,r=(t<<10|i)+65536),12288==r||65281<=r&&r<=65376||65504<=r&&r<=65510?"F":8361==r||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?"H":4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?"W":32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||172==r||175==r||10214<=r&&r<=10221||10629<=r&&r<=10630?"Na":161==r||164==r||167<=r&&r<=168||170==r||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||198==r||208==r||215<=r&&r<=216||222<=r&&r<=225||230==r||232<=r&&r<=234||236<=r&&r<=237||240==r||242<=r&&r<=243||247<=r&&r<=250||252==r||254==r||257==r||273==r||275==r||283==r||294<=r&&r<=295||299==r||305<=r&&r<=307||312==r||319<=r&&r<=322||324==r||328<=r&&r<=331||333==r||338<=r&&r<=339||358<=r&&r<=359||363==r||462==r||464==r||466==r||468==r||470==r||472==r||474==r||476==r||593==r||609==r||708==r||711==r||713<=r&&r<=715||717==r||720==r||728<=r&&r<=731||733==r||735==r||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||1025==r||1040<=r&&r<=1103||1105==r||8208==r||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||8240==r||8242<=r&&r<=8243||8245==r||8251==r||8254==r||8308==r||8319==r||8321<=r&&r<=8324||8364==r||8451==r||8453==r||8457==r||8467==r||8470==r||8481<=r&&r<=8482||8486==r||8491==r||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||8585==r||8592<=r&&r<=8601||8632<=r&&r<=8633||8658==r||8660==r||8679==r||8704==r||8706<=r&&r<=8707||8711<=r&&r<=8712||8715==r||8719==r||8721==r||8725==r||8730==r||8733<=r&&r<=8736||8739==r||8741==r||8743<=r&&r<=8748||8750==r||8756<=r&&r<=8759||8764<=r&&r<=8765||8776==r||8780==r||8786==r||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||8853==r||8857==r||8869==r||8895==r||8978==r||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||9675==r||9678<=r&&r<=9681||9698<=r&&r<=9701||9711==r||9733<=r&&r<=9734||9737==r||9742<=r&&r<=9743||9748<=r&&r<=9749||9756==r||9758==r||9792==r||9794==r||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||9839==r||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||9955==r||9960<=r&&r<=9983||10045==r||10071==r||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||65533==r||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?"A":"N"},er.characterLength=function(e){var t=this.eastAsianWidth(e);return"F"==t||"W"==t||"A"==t?2:1},er.length=function(e){for(var t=en(e),i=0,r=0;r<t.length;r++)i+=this.characterLength(t[r]);return i},er.slice=function(e,t,i){textLen=er.length(e),i=i||1,(t=t||0)<0&&(t=textLen+t),i<0&&(i=textLen+i);for(var r="",n=0,s=en(e),o=0;o<s.length;o++){var u=s[o],a=er.length(u);if(n>=t-(2==a))if(n+a<=i)r+=u;else break;n+=a}return r};let es=et(ei.exports),eo=et(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g});function eu(e,t={}){if("string"!=typeof e||0===e.length||(t={ambiguousIsNarrow:!0,...t},0===(e=ee(e)).length))return 0;e=e.replace(eo()," ");let i=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31)&&(!(e>=127)||!(e<=159))&&(!(e>=768)||!(e<=879)))switch(es.eastAsianWidth(t)){case"F":case"W":r+=2;break;case"A":r+=i;break;default:r+=1}}return r}let ea=(e=0)=>t=>`\x1b[${t+e}m`,el=(e=0)=>t=>`\x1b[${38+e};5;${t}m`,eh=(e=0)=>(t,i,r)=>`\x1b[${38+e};2;${t};${i};${r}m`,ec={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(ec.modifier),[...Object.keys(ec.color),...Object.keys(ec.bgColor)];let ed=function(){let e=new Map;for(let[t,i]of Object.entries(ec)){for(let[t,r]of Object.entries(i))ec[t]={open:`\x1b[${r[0]}m`,close:`\x1b[${r[1]}m`},i[t]=ec[t],e.set(r[0],r[1]);Object.defineProperty(ec,t,{value:i,enumerable:!1})}return Object.defineProperty(ec,"codes",{value:e,enumerable:!1}),ec.color.close="\x1b[39m",ec.bgColor.close="\x1b[49m",ec.color.ansi=ea(),ec.color.ansi256=el(),ec.color.ansi16m=eh(),ec.bgColor.ansi=ea(10),ec.bgColor.ansi256=el(10),ec.bgColor.ansi16m=eh(10),Object.defineProperties(ec,{rgbToAnsi256:{value:(e,t,i)=>e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[i]=t;3===i.length&&(i=[...i].map(e=>e+e).join(""));let r=Number.parseInt(i,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>ec.rgbToAnsi256(...ec.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{let t,i,r;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)i=t=((e-232)*10+8)/255,r=t;else{let n=(e-=16)%36;t=Math.floor(e/36)/5,i=Math.floor(n/6)/5,r=n%6/5}let n=2*Math.max(t,i,r);if(0===n)return 30;let s=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(t));return 2===n&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,i)=>ec.ansi256ToAnsi(ec.rgbToAnsi256(e,t,i)),enumerable:!1},hexToAnsi:{value:e=>ec.ansi256ToAnsi(ec.hexToAnsi256(e)),enumerable:!1}}),ec}(),eD=new Set(["\x1b","\x9b"]),ef="]8;;",ep=e=>`${eD.values().next().value}[${e}m`,em=e=>`${eD.values().next().value}${ef}${e}\x07`,eg=(e,t,i)=>{let r=[...t],n=!1,s=!1,o=eu(ee(e[e.length-1]));for(let[t,u]of r.entries()){let a=eu(u);if(o+a<=i?e[e.length-1]+=u:(e.push(u),o=0),eD.has(u)&&(n=!0,s=r.slice(t+1).join("").startsWith(ef)),n){s?"\x07"===u&&(n=!1,s=!1):"m"===u&&(n=!1);continue}(o+=a)===i&&t<r.length-1&&(e.push(""),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())};function eE(e,t,i){return String(e).normalize().replace(/\r\n/g,`
2
+ import e,{copyFileSync as t,existsSync as i,readFileSync as r,renameSync as n,statSync as s,writeFileSync as o}from"node:fs";import u,{basename as a,dirname as l,extname as h,isAbsolute as c,join as d,posix as D,relative as f,win32 as p}from"node:path";import m,{stripVTControlCharacters as E}from"node:util";import g,{stdin as b,stdout as y}from"node:process";import F,{clearLine as C,createInterface as v,emitKeypressEvents as w,moveCursor as _}from"node:readline";import S,{Writable as A}from"node:stream";import R,{stat as O}from"node:fs/promises";import"fs/promises";import"child_process";import{fileURLToPath as B}from"node:url";import{spawn as x}from"node:child_process";import{EventEmitter as N,on as I,once as T}from"node:events";import{pipeline as L}from"node:stream/promises";import k,{EventEmitter as M}from"events";import{StringDecoder as $}from"node:string_decoder";import j from"assert";import{Buffer as P}from"buffer";import z from"node:assert";import{randomBytes as U}from"node:crypto";import{createRequire as H}from"node:module";import G from"node:os";import Z from"node:tty";import*as W from"crypto";import*as V from"fs";import*as Y from"path";import*as X from"zlib";var K,q,J,Q,ee={"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/adm-zip.js":function(e,t,i){let r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js"),n=i("path"),s=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipEntry.js"),o=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipFile.js"),u=(...e)=>r.findLast(e,e=>"boolean"==typeof e),a=(...e)=>r.findLast(e,e=>"string"==typeof e),l={noSort:!1,readEntries:!1,method:r.Constants.NONE,fs:null};e.exports=function(e,t){let i=null,h=Object.assign(Object.create(null),l);e&&"object"==typeof e&&(e instanceof Uint8Array||(Object.assign(h,e),e=h.input?h.input:void 0,h.input&&delete h.input),Buffer.isBuffer(e)&&(i=e,h.method=r.Constants.BUFFER,e=void 0)),Object.assign(h,t);let c=new r(h);if(("object"!=typeof h.decoder||"function"!=typeof h.decoder.encode||"function"!=typeof h.decoder.decode)&&(h.decoder=r.decoder),e&&"string"==typeof e)if(c.fs.existsSync(e))h.method=r.Constants.FILE,h.filename=e,i=c.fs.readFileSync(e);else throw r.Errors.INVALID_FILENAME();let d=new o(i,h),{canonical:D,sanitize:f,zipnamefix:p}=r;function m(e){if(e&&d){var t;if("string"==typeof e&&(t=d.getEntry(n.posix.normalize(e))),"object"==typeof e&&void 0!==e.entryName&&void 0!==e.header&&(t=d.getEntry(e.entryName)),t)return t}return null}function E(e){let{join:t,normalize:i,sep:r}=n.posix;return t(".",i(r+e.split("\\").join(r)+r))}function g(e){if(e instanceof RegExp)return function(t){return e.test(t)};return"function"!=typeof e?()=>!0:e}let b=(e,t)=>{let i=t.slice(-1);return i=i===c.sep?c.sep:"",n.relative(e,t)+i};return{readFile:function(e,t){var i=m(e);return i&&i.getData(t)||null},childCount:function(e){let t=m(e);if(t)return d.getChildCount(t)},readFileAsync:function(e,t){var i=m(e);i?i.getDataAsync(t):t(null,"getEntry failed for:"+e)},readAsText:function(e,t){var i=m(e);if(i){var r=i.getData();if(r&&r.length)return r.toString(t||"utf8")}return""},readAsTextAsync:function(e,t,i){var r=m(e);r?r.getDataAsync(function(e,r){if(r)return void t(e,r);e&&e.length?t(e.toString(i||"utf8")):t("")}):t("")},deleteFile:function(e,t=!0){var i=m(e);i&&d.deleteFile(i.entryName,t)},deleteEntry:function(e){var t=m(e);t&&d.deleteEntry(t.entryName)},addZipComment:function(e){d.comment=e},getZipComment:function(){return d.comment||""},addZipEntryComment:function(e,t){var i=m(e);i&&(i.comment=t)},getZipEntryComment:function(e){var t=m(e);return t&&t.comment||""},updateFile:function(e,t){var i=m(e);i&&i.setData(t)},addLocalFile:function(e,t,i,s){if(c.fs.existsSync(e)){t=t?E(t):"";let r=n.win32.basename(n.win32.normalize(e));t+=i||r;let o=c.fs.statSync(e),u=o.isFile()?c.fs.readFileSync(e):Buffer.alloc(0);o.isDirectory()&&(t+=c.sep),this.addFile(t,u,s,o)}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFileAsync:function(e,t){e="object"==typeof e?e:{localPath:e};let i=n.resolve(e.localPath),{comment:r}=e,{zipPath:s,zipName:o}=e,u=this;c.fs.stat(i,function(e,a){if(e)return t(e,!1);s=s?E(s):"";let l=n.win32.basename(n.win32.normalize(i));if(s+=o||l,a.isFile())c.fs.readFile(i,function(e,i){return e?t(e,!1):(u.addFile(s,i,r,a),setImmediate(t,void 0,!0))});else if(a.isDirectory())return s+=c.sep,u.addFile(s,Buffer.alloc(0),r,a),setImmediate(t,void 0,!0)})},addLocalFolder:function(e,t,i){if(i=g(i),t=t?E(t):"",e=n.normalize(e),c.fs.existsSync(e)){let r=c.findFiles(e);if(r.length)for(let s of r){let r=n.join(t,b(e,s));i(r)&&this.addLocalFile(s,n.dirname(r))}}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFolderAsync:function(e,t,i,s){s=g(s),i=i?E(i):"",e=n.normalize(e);var o=this;c.fs.open(e,"r",function(n){if(n&&"ENOENT"===n.code)t(void 0,r.Errors.FILE_NOT_FOUND(e));else if(n)t(void 0,n);else{var u=c.findFiles(e),a=-1,l=function(){if((a+=1)<u.length){var r=u[a],n=b(e,r).split("\\").join("/");n=n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),s(n)?c.fs.stat(r,function(e,s){e&&t(void 0,e),s.isFile()?c.fs.readFile(r,function(e,r){e?t(void 0,e):(o.addFile(i+n,r,"",s),l())}):(o.addFile(i+n+"/",Buffer.alloc(0),"",s),l())}):process.nextTick(()=>{l()})}else t(!0,void 0)};l()}})},addLocalFolderAsync2:function(e,t){let i=this;e="object"==typeof e?e:{localPath:e},localPath=n.resolve(E(e.localPath));let{zipPath:s,filter:o,namefix:u}=e;if(o instanceof RegExp){var a;a=o,o=function(e){return a.test(e)}}else"function"!=typeof o&&(o=function(){return!0});s=s?E(s):"","latin1"==u&&(u=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),"function"!=typeof u&&(u=e=>e);let l=e=>n.join(s,u(b(localPath,e)));c.fs.open(localPath,"r",function(e){e&&"ENOENT"===e.code?t(void 0,r.Errors.FILE_NOT_FOUND(localPath)):e?t(void 0,e):c.findFilesAsync(localPath,function(e,r){if(e)return t(e);(r=r.filter(e=>o(l(e)))).length||t(void 0,!1),setImmediate(r.reverse().reduce(function(e,t){return function(r,s){if(r||!1===s)return setImmediate(e,r,!1);i.addLocalFileAsync({localPath:t,zipPath:n.dirname(l(t)),zipName:n.win32.basename(n.win32.normalize(u(t)))},e)}},t))})})},addLocalFolderPromise:function(e,t){return new Promise((i,r)=>{this.addLocalFolderAsync2(Object.assign({localPath:e},t),(e,t)=>{e&&r(e),t&&i(this)})})},addFile:function(e,t,i,r){let n=m(e=p(e)),o=null!=n;o||((n=new s(h)).entryName=e),n.comment=i||"";let u="object"==typeof r&&r instanceof c.fs.Stats;u&&(n.header.time=r.mtime);var a=16*!!n.isDirectory;let l=n.isDirectory?16384:32768;return u?l|=4095&r.mode:"number"==typeof r?l|=4095&r:l|=n.isDirectory?493:420,a=(a|l<<16)>>>0,n.attr=a,n.setData(t),o||d.setEntry(n),n},getEntries:function(e){return d.password=e,d?d.entries:[]},getEntry:function(e){return m(e)},getEntryCount:function(){return d.getEntryCount()},forEach:function(e){return d.forEach(e)},extractEntryTo:function(e,t,i,s,o,l){s=u(!1,s),o=u(!1,o),i=u(!0,i),l=a(o,l);var h=m(e);if(!h)throw r.Errors.NO_ENTRY();var p=D(h.entryName),E=f(t,l&&!h.isDirectory?l:i?p:n.basename(p));if(h.isDirectory)return d.getEntryChildren(h).forEach(function(e){if(e.isDirectory)return;var u=e.getData();if(!u)throw r.Errors.CANT_EXTRACT_FILE();var a=D(e.entryName),l=f(t,i?a:n.basename(a));let h=o?e.header.fileAttr:void 0;c.writeFileTo(l,u,s,h)}),!0;var g=h.getData(d.password);if(!g)throw r.Errors.CANT_EXTRACT_FILE();if(c.fs.existsSync(E)&&!s)throw r.Errors.CANT_OVERRIDE();let b=o?e.header.fileAttr:void 0;return c.writeFileTo(E,g,s,b),!0},test:function(e){if(!d)return!1;for(var t in d.entries)try{if(t.isDirectory)continue;if(!d.entries[t].getData(e))return!1}catch(e){return!1}return!0},extractAllTo:function(e,t,i,n){if(n=a(i=u(!1,i),n),t=u(!1,t),!d)throw r.Errors.NO_ZIP();d.entries.forEach(function(s){var o=f(e,D(s.entryName));if(s.isDirectory)return void c.makeDir(o);var u=s.getData(n);if(!u)throw r.Errors.CANT_EXTRACT_FILE();let a=i?s.header.fileAttr:void 0;c.writeFileTo(o,u,t,a);try{c.fs.utimesSync(o,s.header.time,s.header.time)}catch(e){throw r.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(e,t,i,s){if(s=((...e)=>r.findLast(e,e=>"function"==typeof e))(t,i,s),i=u(!1,i),t=u(!1,t),!s)return new Promise((r,n)=>{this.extractAllToAsync(e,t,i,function(e){e?n(e):r(this)})});if(!d)return void s(r.Errors.NO_ZIP());e=n.resolve(e);let o=t=>f(e,n.normalize(D(t.entryName))),a=(e,t)=>Error(e+': "'+t+'"'),l=[],h=[];for(let e of(d.entries.forEach(e=>{e.isDirectory?l.push(e):h.push(e)}),l)){let t=o(e),r=i?e.header.fileAttr:void 0;try{c.makeDir(t),r&&c.fs.chmodSync(t,r),c.fs.utimesSync(t,e.header.time,e.header.time)}catch(e){s(a("Unable to create folder",t))}}h.reverse().reduce(function(s,o){return function(u){if(u)s(u);else{let u=n.normalize(D(o.entryName)),l=f(e,u);o.getDataAsync(function(e,n){if(n)s(n);else if(e){let r=i?o.header.fileAttr:void 0;c.writeFileToAsync(l,e,t,r,function(e){e||s(a("Unable to write file",l)),c.fs.utimes(l,o.header.time,o.header.time,function(e){e?s(a("Unable to set times",l)):s()})})}else s(r.Errors.CANT_EXTRACT_FILE())})}}},s)()},writeZip:function(e,t){if(1==arguments.length&&"function"==typeof e&&(t=e,e=""),!e&&h.filename&&(e=h.filename),e){var i=d.compressToBuffer();if(i){var r=c.writeFileTo(e,i,!0);"function"==typeof t&&t(r?null:Error("failed"),"")}}},writeZipPromise:function(e,t){let{overwrite:i,perm:r}=Object.assign({overwrite:!0},t);return new Promise((t,n)=>{!e&&h.filename&&(e=h.filename),e||n("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(s=>{c.writeFileToAsync(e,s,i,r,e=>e?t(e):n("ADM-ZIP: Wasn't able to write zip file"))},n)})},toBufferPromise:function(){return new Promise((e,t)=>{d.toAsyncBuffer(e,t)})},toBuffer:function(e,t,i,r){return"function"==typeof e?(d.toAsyncBuffer(e,t,i,r),null):d.compressToBuffer()}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/entryHeader.js":function(e,t,i){var r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js"),n=r.Constants;e.exports=function(){var e,t=10,i=0,s=0,o=0,u=0,a=0,l=0,h=0,c=0,d=0,D=0,f=0,p=0,m=0;e=20|(r.isWin?2560:768),i|=n.FLG_EFS;let E={extraLen:0},g=e=>Math.max(0,e)>>>0;return o=r.fromDate2DOS(new Date),{get made(){return e},set made(val){e=val},get version(){return t},set version(val){t=val},get flags(){return i},set flags(val){i=val},get flags_efs(){return(i&n.FLG_EFS)>0},set flags_efs(val){val?i|=n.FLG_EFS:i&=~n.FLG_EFS},get flags_desc(){return(i&n.FLG_DESC)>0},set flags_desc(val){val?i|=n.FLG_DESC:i&=~n.FLG_DESC},get method(){return s},set method(val){switch(val){case n.STORED:this.version=10;case n.DEFLATED:default:this.version=20}s=val},get time(){return r.fromDOS2Date(this.timeval)},set time(val){this.timeval=r.fromDate2DOS(val)},get timeval(){return o},set timeval(val){o=g(val)},get timeHighByte(){return 255&Math.max(0,o>>>8)},get crc(){return u},set crc(val){u=g(val)},get compressedSize(){return a},set compressedSize(val){a=g(val)},get size(){return l},set size(val){l=g(val)},get fileNameLength(){return h},set fileNameLength(val){h=val},get extraLength(){return c},set extraLength(val){c=val},get extraLocalLength(){return E.extraLen},set extraLocalLength(val){E.extraLen=val},get commentLength(){return d},set commentLength(val){d=val},get diskNumStart(){return D},set diskNumStart(val){D=g(val)},get inAttr(){return f},set inAttr(val){f=g(val)},get attr(){return p},set attr(val){p=g(val)},get fileAttr(){return(p||0)>>16&4095},get offset(){return m},set offset(val){m=g(val)},get encrypted(){return(i&n.FLG_ENC)===n.FLG_ENC},get centralHeaderSize(){return n.CENHDR+h+c+d},get realDataOffset(){return m+n.LOCHDR+E.fnameLen+E.extraLen},get localHeader(){return E},loadLocalHeaderFromBinary:function(e){var t=e.slice(m,m+n.LOCHDR);if(t.readUInt32LE(0)!==n.LOCSIG)throw r.Errors.INVALID_LOC();E.version=t.readUInt16LE(n.LOCVER),E.flags=t.readUInt16LE(n.LOCFLG),E.method=t.readUInt16LE(n.LOCHOW),E.time=t.readUInt32LE(n.LOCTIM),E.crc=t.readUInt32LE(n.LOCCRC),E.compressedSize=t.readUInt32LE(n.LOCSIZ),E.size=t.readUInt32LE(n.LOCLEN),E.fnameLen=t.readUInt16LE(n.LOCNAM),E.extraLen=t.readUInt16LE(n.LOCEXT);let i=m+n.LOCHDR+E.fnameLen,s=i+E.extraLen;return e.slice(i,s)},loadFromBinary:function(E){if(E.length!==n.CENHDR||E.readUInt32LE(0)!==n.CENSIG)throw r.Errors.INVALID_CEN();e=E.readUInt16LE(n.CENVEM),t=E.readUInt16LE(n.CENVER),i=E.readUInt16LE(n.CENFLG),s=E.readUInt16LE(n.CENHOW),o=E.readUInt32LE(n.CENTIM),u=E.readUInt32LE(n.CENCRC),a=E.readUInt32LE(n.CENSIZ),l=E.readUInt32LE(n.CENLEN),h=E.readUInt16LE(n.CENNAM),c=E.readUInt16LE(n.CENEXT),d=E.readUInt16LE(n.CENCOM),D=E.readUInt16LE(n.CENDSK),f=E.readUInt16LE(n.CENATT),p=E.readUInt32LE(n.CENATX),m=E.readUInt32LE(n.CENOFF)},localHeaderToBinary:function(){var e=Buffer.alloc(n.LOCHDR);return e.writeUInt32LE(n.LOCSIG,0),e.writeUInt16LE(t,n.LOCVER),e.writeUInt16LE(i,n.LOCFLG),e.writeUInt16LE(s,n.LOCHOW),e.writeUInt32LE(o,n.LOCTIM),e.writeUInt32LE(u,n.LOCCRC),e.writeUInt32LE(a,n.LOCSIZ),e.writeUInt32LE(l,n.LOCLEN),e.writeUInt16LE(h,n.LOCNAM),e.writeUInt16LE(E.extraLen,n.LOCEXT),e},centralHeaderToBinary:function(){var r=Buffer.alloc(n.CENHDR+h+c+d);return r.writeUInt32LE(n.CENSIG,0),r.writeUInt16LE(e,n.CENVEM),r.writeUInt16LE(t,n.CENVER),r.writeUInt16LE(i,n.CENFLG),r.writeUInt16LE(s,n.CENHOW),r.writeUInt32LE(o,n.CENTIM),r.writeUInt32LE(u,n.CENCRC),r.writeUInt32LE(a,n.CENSIZ),r.writeUInt32LE(l,n.CENLEN),r.writeUInt16LE(h,n.CENNAM),r.writeUInt16LE(c,n.CENEXT),r.writeUInt16LE(d,n.CENCOM),r.writeUInt16LE(D,n.CENDSK),r.writeUInt16LE(f,n.CENATT),r.writeUInt32LE(p,n.CENATX),r.writeUInt32LE(m,n.CENOFF),r},toJSON:function(){let o=function(e){return e+" bytes"};return{made:e,version:t,flags:i,method:r.methodToString(s),time:this.time,crc:"0x"+u.toString(16).toUpperCase(),compressedSize:o(a),size:o(l),fileNameLength:o(h),extraLength:o(c),commentLength:o(d),diskNumStart:D,inAttr:f,attr:p,offset:m,centralHeaderSize:o(n.CENHDR+h+c+d)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/index.js":function(e,t,i){t.EntryHeader=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/entryHeader.js"),t.MainHeader=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/mainHeader.js")},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/mainHeader.js":function(e,t,i){var r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js"),n=r.Constants;e.exports=function(){var e=0,t=0,i=0,s=0,o=0;return{get diskEntries(){return e},set diskEntries(val){e=t=val},get totalEntries(){return t},set totalEntries(val){t=e=val},get size(){return i},set size(val){i=val},get offset(){return s},set offset(val){s=val},get commentLength(){return o},set commentLength(val){o=val},get mainHeaderSize(){return n.ENDHDR+o},loadFromBinary:function(u){if((u.length!==n.ENDHDR||u.readUInt32LE(0)!==n.ENDSIG)&&(u.length<n.ZIP64HDR||u.readUInt32LE(0)!==n.ZIP64SIG))throw r.Errors.INVALID_END();u.readUInt32LE(0)===n.ENDSIG?(e=u.readUInt16LE(n.ENDSUB),t=u.readUInt16LE(n.ENDTOT),i=u.readUInt32LE(n.ENDSIZ),s=u.readUInt32LE(n.ENDOFF),o=u.readUInt16LE(n.ENDCOM)):(e=r.readBigUInt64LE(u,n.ZIP64SUB),t=r.readBigUInt64LE(u,n.ZIP64TOT),i=r.readBigUInt64LE(u,n.ZIP64SIZE),s=r.readBigUInt64LE(u,n.ZIP64OFF),o=0)},toBinary:function(){var r=Buffer.alloc(n.ENDHDR+o);return r.writeUInt32LE(n.ENDSIG,0),r.writeUInt32LE(0,4),r.writeUInt16LE(e,n.ENDSUB),r.writeUInt16LE(t,n.ENDTOT),r.writeUInt32LE(i,n.ENDSIZ),r.writeUInt32LE(s,n.ENDOFF),r.writeUInt16LE(o,n.ENDCOM),r.fill(" ",n.ENDHDR),r},toJSON:function(){return{diskEntries:e,totalEntries:t,size:i+" bytes",offset:function(e,t){let i=e.toString(16).toUpperCase();for(;i.length<4;)i="0"+i;return"0x"+i}(s,0),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/deflater.js":function(e,t,i){e.exports=function(e){var t=i("zlib"),r={chunkSize:(parseInt(e.length/1024)+1)*1024};return{deflate:function(){return t.deflateRawSync(e,r)},deflateAsync:function(i){var n=t.createDeflateRaw(r),s=[],o=0;n.on("data",function(e){s.push(e),o+=e.length}),n.on("end",function(){var e=Buffer.alloc(o),t=0;e.fill(0);for(var r=0;r<s.length;r++){var n=s[r];n.copy(e,t),t+=n.length}i&&i(e)}),n.end(e)}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/index.js":function(e,t,i){t.Deflater=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/deflater.js"),t.Inflater=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/inflater.js"),t.ZipCrypto=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/zipcrypto.js")},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/inflater.js":function(e,t,i){let r=+(process.versions?process.versions.node:"").split(".")[0]||0;e.exports=function(e,t){var n=i("zlib");let s=r>=15&&t>0?{maxOutputLength:t}:{};return{inflate:function(){return n.inflateRawSync(e,s)},inflateAsync:function(t){var i=n.createInflateRaw(s),r=[],o=0;i.on("data",function(e){r.push(e),o+=e.length}),i.on("end",function(){var e=Buffer.alloc(o),i=0;e.fill(0);for(var n=0;n<r.length;n++){var s=r[n];s.copy(e,i),i+=s.length}t&&t(e)}),i.end(e)}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/zipcrypto.js":function(e,t,i){let{randomFillSync:r}=i("crypto"),n=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js"),s=new Uint32Array(256).map((e,t)=>{for(let e=0;e<8;e++)0!=(1&t)?t=t>>>1^0xedb88320:t>>>=1;return t>>>0}),o=(e,t)=>Math.imul(e,t)>>>0,u=(e,t)=>s[(e^t)&255]^e>>>8,a=()=>"function"==typeof r?r(Buffer.alloc(12)):a.node();a.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let i=0;i<t;i++)e[i]=256*Math.random()&255;return e};let l={genSalt:a};function h(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([0x12345678,0x23456789,0x34567890]);for(let e=0;e<t.length;e++)this.updateKeys(t[e])}h.prototype.updateKeys=function(e){let t=this.keys;return t[0]=u(t[0],e),t[1]+=255&t[0],t[1]=o(t[1],0x8088405)+1,t[2]=u(t[2],t[1]>>>24),e},h.prototype.next=function(){let e=(2|this.keys[2])>>>0;return o(e,1^e)>>8&255},e.exports={decrypt:function(e,t,i){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=function(e){let t=new h(e);return function(e){let i=Buffer.alloc(e.length),r=0;for(let n of e)i[r++]=t.updateKeys(n^t.next());return i}}(i),s=r(e.slice(0,12)),o=(8&t.flags)==8?t.timeHighByte:t.crc>>>24;if(s[11]!==o)throw n.WRONG_PASSWORD();return r(e.slice(12))},encrypt:function(e,t,i,r=!1){null==e&&(e=Buffer.alloc(0)),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let n=function(e){let t=new h(e);return function(e,i,r=0){for(let n of(i||(i=Buffer.alloc(e.length)),e)){let e=t.next();i[r++]=n^e,t.updateKeys(n)}return i}}(i),s=l.genSalt();s[11]=t.crc>>>24&255,r&&(s[10]=t.crc>>>16&255);let o=Buffer.alloc(e.length+12);return n(s,o),n(e,o,12)},_salter:function(e){Buffer.isBuffer(e)&&e.length>=12?l.genSalt=function(){return e.slice(0,12)}:"node"===e?l.genSalt=a.node:l.genSalt=a}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/constants.js":function(e){e.exports={LOCHDR:30,LOCSIG:0x4034b50,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:0x8074b50,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:0x2014b50,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:0x6054b50,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:0x7064b50,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:0x6064b50,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:0xffffffff,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/decoder.js":function(e){e.exports={efs:!0,encode:e=>Buffer.from(e,"utf8"),decode:e=>e.toString("utf8")}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js":function(e,t){let i={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};for(let e of Object.keys(i))t[e]=function(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(e,i)=>t[i]||"")),Error("ADM-ZIP: "+e)}}(i[e])},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/fattr.js":function(e,t,i){let r=i("path");e.exports=function(e,{fs:t}){var i=e||"",n={directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0},s=null;return i&&t.existsSync(i)?(n.directory=(s=t.statSync(i)).isDirectory(),n.mtime=s.mtime,n.atime=s.atime,n.executable=(73&s.mode)!=0,n.readonly=(128&s.mode)==0,n.hidden="."===r.basename(i)[0]):console.warn("Invalid path: "+i),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:i,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js":function(e,t,i){e.exports=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/utils.js"),e.exports.Constants=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/constants.js"),e.exports.Errors=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js"),e.exports.FileAttr=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/fattr.js"),e.exports.decoder=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/decoder.js")},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/utils.js":function(e,t,i){let r=i("fs"),n=i("path"),s=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/constants.js"),o=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js"),u="object"==typeof process&&"win32"===process.platform,a=e=>"object"==typeof e&&null!==e,l=new Uint32Array(256).map((e,t)=>{for(let e=0;e<8;e++)(1&t)!=0?t=0xedb88320^t>>>1:t>>>=1;return t>>>0});function h(e){this.sep=n.sep,this.fs=r,a(e)&&a(e.fs)&&"function"==typeof e.fs.statSync&&(this.fs=e.fs)}e.exports=h,h.prototype.makeDir=function(e){let t,i=this;t=e.split(i.sep)[0],e.split(i.sep).forEach(function(e){var r;if(e&&":"!==e.substr(-1,1)){t+=i.sep+e;try{r=i.fs.statSync(t)}catch(e){i.fs.mkdirSync(t)}if(r&&r.isFile())throw o.FILE_IN_THE_WAY(`"${t}"`)}})},h.prototype.writeFileTo=function(e,t,i,r){if(this.fs.existsSync(e)){var s;if(!i||this.fs.statSync(e).isDirectory())return!1}var o=n.dirname(e);this.fs.existsSync(o)||this.makeDir(o);try{s=this.fs.openSync(e,"w",438)}catch(t){this.fs.chmodSync(e,438),s=this.fs.openSync(e,"w",438)}if(s)try{this.fs.writeSync(s,t,0,t.length,0)}finally{this.fs.closeSync(s)}return this.fs.chmodSync(e,r||438),!0},h.prototype.writeFileToAsync=function(e,t,i,r,s){"function"==typeof r&&(s=r,r=void 0);let o=this;o.fs.exists(e,function(u){if(u&&!i)return s(!1);o.fs.stat(e,function(i,a){if(u&&a.isDirectory())return s(!1);var l=n.dirname(e);o.fs.exists(l,function(i){i||o.makeDir(l),o.fs.open(e,"w",438,function(i,n){i?o.fs.chmod(e,438,function(){o.fs.open(e,"w",438,function(i,n){o.fs.write(n,t,0,t.length,0,function(){o.fs.close(n,function(){o.fs.chmod(e,r||438,function(){s(!0)})})})})}):n?o.fs.write(n,t,0,t.length,0,function(){o.fs.close(n,function(){o.fs.chmod(e,r||438,function(){s(!0)})})}):o.fs.chmod(e,r||438,function(){s(!0)})})})})})},h.prototype.findFiles=function(e){let t=this;return function e(i,r,s){"boolean"==typeof r&&(s=r,r=void 0);let o=[];return t.fs.readdirSync(i).forEach(function(u){let a=n.join(i,u),l=t.fs.statSync(a);(!r||r.test(a))&&o.push(n.normalize(a)+(l.isDirectory()?t.sep:"")),l.isDirectory()&&s&&(o=o.concat(e(a,r,s)))}),o}(e,void 0,!0)},h.prototype.findFilesAsync=function(e,t){let i=this,r=[];i.fs.readdir(e,function(s,o){if(s)return t(s);let u=o.length;if(!u)return t(null,r);o.forEach(function(s){s=n.join(e,s),i.fs.stat(s,function(e,o){if(e)return t(e);o&&(r.push(n.normalize(s)+(o.isDirectory()?i.sep:"")),o.isDirectory()?i.findFilesAsync(s,function(e,i){if(e)return t(e);r=r.concat(i),--u||t(null,r)}):--u||t(null,r))})})})},h.prototype.getAttributes=function(){},h.prototype.setAttributes=function(){},h.crc32update=function(e,t){return l[(e^t)&255]^e>>>8},h.crc32=function(e){"string"==typeof e&&(e=Buffer.from(e,"utf8"));let t=e.length,i=-1;for(let r=0;r<t;)i=h.crc32update(i,e[r++]);return~i>>>0},h.methodToString=function(e){switch(e){case s.STORED:return"STORED ("+e+")";case s.DEFLATED:return"DEFLATED ("+e+")";default:return"UNSUPPORTED ("+e+")"}},h.canonical=function(e){if(!e)return"";let t=n.posix.normalize("/"+e.split("\\").join("/"));return n.join(".",t)},h.zipnamefix=function(e){if(!e)return"";let t=n.posix.normalize("/"+e.split("\\").join("/"));return n.posix.join(".",t)},h.findLast=function(e,t){if(!Array.isArray(e))throw TypeError("arr is not array");let i=e.length>>>0;for(let r=i-1;r>=0;r--)if(t(e[r],r,e))return e[r]},h.sanitize=function(e,t){e=n.resolve(n.normalize(e));for(var i=t.split("/"),r=0,s=i.length;r<s;r++){var o=n.normalize(n.join(e,i.slice(r,s).join(n.sep)));if(0===o.indexOf(e))return o}return n.normalize(n.join(e,n.basename(t)))},h.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):"string"==typeof e?t(e):Buffer.alloc(0)},h.readBigUInt64LE=function(e,t){var i=Buffer.from(e.slice(t,t+8));return i.swap64(),parseInt(`0x${i.toString("hex")}`)},h.fromDOS2Date=function(e){return new Date((e>>25&127)+1980,Math.max((e>>21&15)-1,0),Math.max(e>>16&31,1),e>>11&31,e>>5&63,(31&e)<<1)},h.fromDate2DOS=function(e){let t=0,i=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),i=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|i},h.isWin=u,h.crcTable=l},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipEntry.js":function(e,t,i){var r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js"),n=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/index.js"),s=r.Constants,o=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/index.js");e.exports=function(e,t){var i=new n.EntryHeader,u=Buffer.alloc(0),a=Buffer.alloc(0),l=!1,h=null,c=Buffer.alloc(0),d=Buffer.alloc(0),D=!0;let f="object"==typeof e.decoder?e.decoder:r.decoder;function p(){return t&&t instanceof Uint8Array?(d=i.loadLocalHeaderFromBinary(t),t.slice(i.realDataOffset,i.realDataOffset+i.compressedSize)):Buffer.alloc(0)}function m(e){if(i.flags_desc){let n={},o=i.realDataOffset+i.compressedSize;if(t.readUInt32LE(o)==s.LOCSIG||t.readUInt32LE(o)==s.CENSIG)throw r.Errors.DESCRIPTOR_NOT_EXIST();if(t.readUInt32LE(o)==s.EXTSIG)n.crc=t.readUInt32LE(o+s.EXTCRC),n.compressedSize=t.readUInt32LE(o+s.EXTSIZ),n.size=t.readUInt32LE(o+s.EXTLEN);else if(19280===t.readUInt16LE(o+12))n.crc=t.readUInt32LE(o+s.EXTCRC-4),n.compressedSize=t.readUInt32LE(o+s.EXTSIZ-4),n.size=t.readUInt32LE(o+s.EXTLEN-4);else throw r.Errors.DESCRIPTOR_UNKNOWN();if(n.compressedSize!==i.compressedSize||n.size!==i.size||n.crc!==i.crc)throw r.Errors.DESCRIPTOR_FAULTY();if(r.crc32(e)!==n.crc)return!1}else if(r.crc32(e)!==i.localHeader.crc)return!1;return!0}function E(e,t,n){if(void 0===t&&"string"==typeof e&&(n=e,e=void 0),l)return e&&t&&t(Buffer.alloc(0),r.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var s=p();if(0===s.length)return e&&t&&t(s),s;if(i.encrypted){if("string"!=typeof n&&!Buffer.isBuffer(n))throw r.Errors.INVALID_PASS_PARAM();s=o.ZipCrypto.decrypt(s,i,n)}var a=Buffer.alloc(i.size);switch(i.method){case r.Constants.STORED:if(s.copy(a),m(a))return e&&t&&t(a),a;throw e&&t&&t(a,r.Errors.BAD_CRC()),r.Errors.BAD_CRC();case r.Constants.DEFLATED:var h=new o.Inflater(s,i.size);if(e)h.inflateAsync(function(e){e.copy(e,0),t&&(m(e)?t(e):t(e,r.Errors.BAD_CRC()))});else{if(h.inflate(a).copy(a,0),!m(a))throw r.Errors.BAD_CRC(`"${f.decode(u)}"`);return a}break;default:throw e&&t&&t(Buffer.alloc(0),r.Errors.UNKNOWN_METHOD()),r.Errors.UNKNOWN_METHOD()}}function g(e,n){if((!h||!h.length)&&Buffer.isBuffer(t))return e&&n&&n(p()),p();if(h.length&&!l){var s;switch(i.method){case r.Constants.STORED:return i.compressedSize=i.size,s=Buffer.alloc(h.length),h.copy(s),e&&n&&n(s),s;default:case r.Constants.DEFLATED:var u=new o.Deflater(h);if(e)u.deflateAsync(function(e){s=Buffer.alloc(e.length),i.compressedSize=e.length,e.copy(s),n&&n(s)});else{var a=u.deflate();return i.compressedSize=a.length,a}u=null}}else{if(!e||!n)return Buffer.alloc(0);n(Buffer.alloc(0))}}function b(e,t){return(e.readUInt32LE(t+4)<<4)+e.readUInt32LE(t)}return D=!!f.hasOwnProperty("efs")&&f.efs,{get entryName(){return f.decode(u)},get rawEntryName(){return u},set entryName(val){var y=(u=r.toBuffer(val,f.encode))[u.length-1];l=47===y||92===y,i.fileNameLength=u.length},get efs(){if("function"==typeof D)return D(this.entryName);return D},get extra(){return c},set extra(val){c=val,i.extraLength=val.length;try{for(var F,C,v,w=0;w+4<val.length;)F=val.readUInt16LE(w),w+=2,C=val.readUInt16LE(w),w+=2,v=val.slice(w,w+C),w+=C,s.ID_ZIP64===F&&function(e){var t,r,n,o;e.length>=s.EF_ZIP64_SCOMP&&(t=b(e,s.EF_ZIP64_SUNCOMP),i.size===s.EF_ZIP64_OR_32&&(i.size=t)),e.length>=s.EF_ZIP64_RHO&&(r=b(e,s.EF_ZIP64_SCOMP),i.compressedSize===s.EF_ZIP64_OR_32&&(i.compressedSize=r)),e.length>=s.EF_ZIP64_DSN&&(n=b(e,s.EF_ZIP64_RHO),i.offset===s.EF_ZIP64_OR_32&&(i.offset=n)),e.length>=s.EF_ZIP64_DSN+4&&(o=e.readUInt32LE(s.EF_ZIP64_DSN),i.diskNumStart===s.EF_ZIP64_OR_16&&(i.diskNumStart=o))}(v)}catch(e){throw r.Errors.EXTRA_FIELD_PARSE_ERROR()}},get comment(){return f.decode(a)},set comment(val){if(i.commentLength=(a=r.toBuffer(val,f.encode)).length,a.length>65535)throw r.Errors.COMMENT_TOO_LONG()},get name(){var _=f.decode(u);return l?_.substr(_.length-1).split("/").pop():_.split("/").pop()},get isDirectory(){return l},getCompressedData:function(){return g(!1,null)},getCompressedDataAsync:function(e){g(!0,e)},setData:function(e){h=r.toBuffer(e,r.decoder.encode),!l&&h.length?(i.size=h.length,i.method=r.Constants.DEFLATED,i.crc=r.crc32(e),i.changed=!0):i.method=r.Constants.STORED},getData:function(e){return i.changed?h:E(!1,null,e)},getDataAsync:function(e,t){i.changed?e(h):E(!0,e,t)},set attr(attr){i.attr=attr},get attr(){return i.attr},set header(data){i.loadFromBinary(data)},get header(){return i},packCentralHeader:function(){i.flags_efs=this.efs,i.extraLength=c.length;var e=i.centralHeaderToBinary(),t=r.Constants.CENHDR;return u.copy(e,t),t+=u.length,c.copy(e,t),t+=i.extraLength,a.copy(e,t),e},packLocalHeader:function(){let e=0;i.flags_efs=this.efs,i.extraLocalLength=d.length;let t=i.localHeaderToBinary(),r=Buffer.alloc(t.length+u.length+i.extraLocalLength);return t.copy(r,e),e+=t.length,u.copy(r,e),e+=u.length,d.copy(r,e),e+=d.length,r},toJSON:function(){let e=function(e){return"<"+(e&&e.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:i.toJSON(),compressedData:e(t),data:e(h)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},"../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipFile.js":function(e,t,i){let r=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipEntry.js"),n=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/index.js"),s=i("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js");e.exports=function(e,t){var i=[],o={},u=Buffer.alloc(0),a=new n.MainHeader,l=!1;let h=new Set,{noSort:c,decoder:d}=t;function D(){if(l=!0,o={},a.diskEntries>(e.length-a.offset)/s.Constants.CENHDR)throw s.Errors.DISK_ENTRY_TOO_LARGE();i=Array(a.diskEntries);for(var n=a.offset,u=0;u<i.length;u++){var c=n,d=new r(t,e);d.header=e.slice(c,c+=s.Constants.CENHDR),d.entryName=e.slice(c,c+=d.header.fileNameLength),d.header.extraLength&&(d.extra=e.slice(c,c+=d.header.extraLength)),d.header.commentLength&&(d.comment=e.slice(c,c+d.header.commentLength)),n+=d.header.centralHeaderSize,i[u]=d,o[d.entryName]=d}h.clear(),function(){let e=new Set;for(let t of Object.keys(o)){let i=t.split("/");if(i.pop(),i.length)for(let t=0;t<i.length;t++){let r=i.slice(0,t+1).join("/")+"/";e.add(r)}}for(let n of e)if(!(n in o)){let e=new r(t);e.entryName=n,e.attr=16,e.temporary=!0,i.push(e),o[e.entryName]=e,h.add(e)}}()}function f(){i.length>1&&!c&&i.sort((e,t)=>e.entryName.toLowerCase().localeCompare(t.entryName.toLowerCase()))}return e?function(i){var r=e.length-s.Constants.ENDHDR,n=Math.max(0,r-65535),o=n,l=e.length,h=-1,c=0;for("boolean"==typeof t.trailingSpace&&t.trailingSpace&&(n=0);r>=o;r--)if(80===e[r]){if(e.readUInt32LE(r)===s.Constants.ENDSIG){h=r,c=r,l=r+s.Constants.ENDHDR,o=r-s.Constants.END64HDR;continue}if(e.readUInt32LE(r)===s.Constants.END64SIG){o=n;continue}if(e.readUInt32LE(r)===s.Constants.ZIP64SIG){h=r,l=r+s.readBigUInt64LE(e,r+s.Constants.ZIP64SIZE)+s.Constants.ZIP64LEAD;break}}if(-1==h)throw s.Errors.INVALID_FORMAT();a.loadFromBinary(e.slice(h,l)),a.commentLength&&(u=e.slice(c+s.Constants.ENDHDR)),i&&D()}(t.readEntries):l=!0,{get entries(){return l||D(),i.filter(e=>!h.has(e))},get comment(){return d.decode(u)},set comment(val){a.commentLength=(u=s.toBuffer(val,d.encode)).length},getEntryCount:function(){return l?i.length:a.diskEntries},forEach:function(e){this.entries.forEach(e)},getEntry:function(e){return l||D(),o[e]||null},setEntry:function(e){l||D(),i.push(e),o[e.entryName]=e,a.totalEntries=i.length},deleteFile:function(e,t=!0){l||D();let i=o[e];this.getEntryChildren(i,t).map(e=>e.entryName).forEach(this.deleteEntry)},deleteEntry:function(e){l||D();let t=o[e],r=i.indexOf(t);r>=0&&(i.splice(r,1),delete o[e],a.totalEntries=i.length)},getEntryChildren:function(e,t=!0){if(l||D(),"object"==typeof e)if(!e.isDirectory||!t)return[e];else{let t=[],r=e.entryName;for(let e of i)e.entryName.startsWith(r)&&t.push(e);return t}return[]},getChildCount:function(e){if(e&&e.isDirectory){let t=this.getEntryChildren(e);return t.includes(e)?t.length-1:t.length}return 0},compressToBuffer:function(){l||D(),f();let t=[],i=[],r=0,n=0;a.size=0,a.offset=0;let o=0;for(let e of this.entries){let s=e.getCompressedData();e.header.offset=n;let u=e.packLocalHeader(),l=u.length+s.length;n+=l,t.push(u),t.push(s);let h=e.packCentralHeader();i.push(h),a.size+=h.length,r+=l+h.length,o++}r+=a.mainHeaderSize,a.offset=n,a.totalEntries=o,n=0;let h=Buffer.alloc(r);for(let e of t)e.copy(h,n),n+=e.length;for(let e of i)e.copy(h,n),n+=e.length;let c=a.toBinary();return u&&u.copy(c,s.Constants.ENDHDR),c.copy(h,n),e=h,l=!1,h},toAsyncBuffer:function(t,i,r,n){try{l||D(),f();let i=[],o=[],h=0,c=0,d=0;a.size=0,a.offset=0;let p=function(D){if(D.length>0){let e=D.shift(),t=e.entryName+e.extra.toString();r&&r(t),e.getCompressedDataAsync(function(r){n&&n(t),e.header.offset=c;let s=e.packLocalHeader(),u=s.length+r.length;c+=u,i.push(s),i.push(r);let l=e.packCentralHeader();o.push(l),a.size+=l.length,h+=u+l.length,d++,p(D)})}else{h+=a.mainHeaderSize,a.offset=c,a.totalEntries=d,c=0;let r=Buffer.alloc(h);i.forEach(function(e){e.copy(r,c),c+=e.length}),o.forEach(function(e){e.copy(r,c),c+=e.length});let n=a.toBinary();u&&u.copy(n,s.Constants.ENDHDR),n.copy(r,c),e=r,l=!1,t(r)}};p(Array.from(this.entries))}catch(e){i(e)}}}}},"../../node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js":function(e){function t(e){return!!("number"==typeof e||/^0x[0-9a-f]+$/i.test(e))||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function i(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,r){r||(r={});var n={bools:{},strings:{},unknownFn:null};"function"==typeof r.unknown&&(n.unknownFn=r.unknown),"boolean"==typeof r.boolean&&r.boolean?n.allBools=!0:[].concat(r.boolean).filter(Boolean).forEach(function(e){n.bools[e]=!0});var s={};function o(e){return s[e].some(function(e){return n.bools[e]})}Object.keys(r.alias||{}).forEach(function(e){s[e]=[].concat(r.alias[e]),s[e].forEach(function(t){s[t]=[e].concat(s[e].filter(function(e){return t!==e}))})}),[].concat(r.string).filter(Boolean).forEach(function(e){n.strings[e]=!0,s[e]&&[].concat(s[e]).forEach(function(e){n.strings[e]=!0})});var u=r.default||{},a={_:[]};function l(e,t,r){for(var s=e,o=0;o<t.length-1;o++){var u=t[o];if(i(s,u))return;void 0===s[u]&&(s[u]={}),(s[u]===Object.prototype||s[u]===Number.prototype||s[u]===String.prototype)&&(s[u]={}),s[u]===Array.prototype&&(s[u]=[]),s=s[u]}var a=t[t.length-1];i(s,a)||((s===Object.prototype||s===Number.prototype||s===String.prototype)&&(s={}),s===Array.prototype&&(s=[]),void 0===s[a]||n.bools[a]||"boolean"==typeof s[a]?s[a]=r:Array.isArray(s[a])?s[a].push(r):s[a]=[s[a],r])}function h(e,i,r){if(!r||!n.unknownFn||n.allBools&&/^--[^=]+$/.test(r)||n.strings[e]||n.bools[e]||s[e]||!1!==n.unknownFn(r)){var o=!n.strings[e]&&t(i)?Number(i):i;l(a,e.split("."),o),(s[e]||[]).forEach(function(e){l(a,e.split("."),o)})}}Object.keys(n.bools).forEach(function(e){h(e,void 0!==u[e]&&u[e])});var c=[];-1!==e.indexOf("--")&&(c=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var d=0;d<e.length;d++){var D,f,p=e[d];if(/^--.+=/.test(p)){var m=p.match(/^--([^=]+)=([\s\S]*)$/);D=m[1];var E=m[2];n.bools[D]&&(E="false"!==E),h(D,E,p)}else if(/^--no-.+/.test(p))h(D=p.match(/^--no-(.+)/)[1],!1,p);else if(/^--.+/.test(p))D=p.match(/^--(.+)/)[1],void 0===(f=e[d+1])||/^(-|--)[^-]/.test(f)||n.bools[D]||n.allBools||s[D]&&o(D)?/^(true|false)$/.test(f)?(h(D,"true"===f,p),d+=1):h(D,!n.strings[D]||"",p):(h(D,f,p),d+=1);else if(/^-[^-]+/.test(p)){for(var g=p.slice(1,-1).split(""),b=!1,y=0;y<g.length;y++){if("-"===(f=p.slice(y+2))){h(g[y],f,p);continue}if(/[A-Za-z]/.test(g[y])&&"="===f[0]){h(g[y],f.slice(1),p),b=!0;break}if(/[A-Za-z]/.test(g[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(f)){h(g[y],f,p),b=!0;break}if(g[y+1]&&g[y+1].match(/\W/)){h(g[y],p.slice(y+2),p),b=!0;break}h(g[y],!n.strings[g[y]]||"",p)}D=p.slice(-1)[0],b||"-"===D||(!e[d+1]||/^(-|--)[^-]/.test(e[d+1])||n.bools[D]||s[D]&&o(D)?e[d+1]&&/^(true|false)$/.test(e[d+1])?(h(D,"true"===e[d+1],p),d+=1):h(D,!n.strings[D]||"",p):(h(D,e[d+1],p),d+=1))}else if(n.unknownFn&&!1===n.unknownFn(p)||a._.push(n.strings._||!t(p)?p:Number(p)),r.stopEarly){a._.push.apply(a._,e.slice(d+1));break}}return Object.keys(u).forEach(function(e){var t,i;t=e.split("."),i=a,t.slice(0,-1).forEach(function(e){i=i[e]||{}}),t[t.length-1]in i||(l(a,e.split("."),u[e]),(s[e]||[]).forEach(function(t){l(a,t.split("."),u[e])}))}),r["--"]?a["--"]=c.slice():c.forEach(function(e){a._.push(e)}),a}},"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js":function(e){let t=process||{},i=t.argv||[],r=t.env||{},n=!(r.NO_COLOR||i.includes("--no-color"))&&(!!r.FORCE_COLOR||i.includes("--color")||"win32"===t.platform||(t.stdout||{}).isTTY&&"dumb"!==r.TERM||!!r.CI),s=(e,t,i=e)=>r=>{let n=""+r,s=n.indexOf(t,e.length);return~s?e+o(n,t,i,s)+t:e+n+t},o=(e,t,i,r)=>{let n="",s=0;do n+=e.substring(s,r)+i,s=r+t.length,r=e.indexOf(t,s);while(~r);return n+e.substring(s)},u=(e=n)=>{let t=e?s:()=>String;return{isColorSupported:e,reset:t("\x1b[0m","\x1b[0m"),bold:t("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),dim:t("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),italic:t("\x1b[3m","\x1b[23m"),underline:t("\x1b[4m","\x1b[24m"),inverse:t("\x1b[7m","\x1b[27m"),hidden:t("\x1b[8m","\x1b[28m"),strikethrough:t("\x1b[9m","\x1b[29m"),black:t("\x1b[30m","\x1b[39m"),red:t("\x1b[31m","\x1b[39m"),green:t("\x1b[32m","\x1b[39m"),yellow:t("\x1b[33m","\x1b[39m"),blue:t("\x1b[34m","\x1b[39m"),magenta:t("\x1b[35m","\x1b[39m"),cyan:t("\x1b[36m","\x1b[39m"),white:t("\x1b[37m","\x1b[39m"),gray:t("\x1b[90m","\x1b[39m"),bgBlack:t("\x1b[40m","\x1b[49m"),bgRed:t("\x1b[41m","\x1b[49m"),bgGreen:t("\x1b[42m","\x1b[49m"),bgYellow:t("\x1b[43m","\x1b[49m"),bgBlue:t("\x1b[44m","\x1b[49m"),bgMagenta:t("\x1b[45m","\x1b[49m"),bgCyan:t("\x1b[46m","\x1b[49m"),bgWhite:t("\x1b[47m","\x1b[49m"),blackBright:t("\x1b[90m","\x1b[39m"),redBright:t("\x1b[91m","\x1b[39m"),greenBright:t("\x1b[92m","\x1b[39m"),yellowBright:t("\x1b[93m","\x1b[39m"),blueBright:t("\x1b[94m","\x1b[39m"),magentaBright:t("\x1b[95m","\x1b[39m"),cyanBright:t("\x1b[96m","\x1b[39m"),whiteBright:t("\x1b[97m","\x1b[39m"),bgBlackBright:t("\x1b[100m","\x1b[49m"),bgRedBright:t("\x1b[101m","\x1b[49m"),bgGreenBright:t("\x1b[102m","\x1b[49m"),bgYellowBright:t("\x1b[103m","\x1b[49m"),bgBlueBright:t("\x1b[104m","\x1b[49m"),bgMagentaBright:t("\x1b[105m","\x1b[49m"),bgCyanBright:t("\x1b[106m","\x1b[49m"),bgWhiteBright:t("\x1b[107m","\x1b[49m")}};e.exports=u(),e.exports.createColors=u},"../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js":function(e){let t=`\x1b[`,i={to:(e,i)=>i?`${t}${i+1};${e+1}H`:`${t}${e+1}G`,move(e,i){let r="";return e<0?r+=`${t}${-e}D`:e>0&&(r+=`${t}${e}C`),i<0?r+=`${t}${-i}A`:i>0&&(r+=`${t}${i}B`),r},up:(e=1)=>`${t}${e}A`,down:(e=1)=>`${t}${e}B`,forward:(e=1)=>`${t}${e}C`,backward:(e=1)=>`${t}${e}D`,nextLine:(e=1)=>`${t}E`.repeat(e),prevLine:(e=1)=>`${t}F`.repeat(e),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`\x1b7`,restore:`\x1b8`},r={screen:`${t}2J`,up:(e=1)=>`${t}1J`.repeat(e),down:(e=1)=>`${t}J`.repeat(e),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?i.up():"");return e&&(t+=i.left),t}};e.exports={cursor:i,scroll:{up:(e=1)=>`${t}S`.repeat(e),down:(e=1)=>`${t}T`.repeat(e)},erase:r,beep:"\x07"}},"../../node_modules/.pnpm/tinygradient@1.1.5/node_modules/tinygradient/index.js":function(e,t,i){let r=i("../../node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/cjs/tinycolor.js"),n={r:256,g:256,b:256,a:1},s={h:360,s:1,v:1,a:1};function o(e,t,i){let r={};for(let n in e)e.hasOwnProperty(n)&&(r[n]=0===i?0:(t[n]-e[n])/i);return r}function u(e,t,i,r){let n={};for(let s in t)t.hasOwnProperty(s)&&(n[s]=e[s]*i+t[s],n[s]=n[s]<0?n[s]+r[s]:1!==r[s]?n[s]%r[s]:n[s]);return n}function a(e,t,i){let s=e.color.toRgb(),a=o(s,t.color.toRgb(),i),l=[e.color];for(let e=1;e<i;e++){let t=u(a,s,e,n);l.push(r(t))}return l}function l(e,t,i,n){let l,h,c=e.color.toHsv(),d=t.color.toHsv();if(0===c.s||0===d.s)return a(e,t,i);if("boolean"==typeof n)l=n;else{let e=c.h<d.h&&d.h-c.h<180||c.h>d.h&&c.h-d.h>180;l="long"===n&&e||"short"===n&&!e}let D=o(c,d,i),f=[e.color];h=c.h<=d.h&&!l||c.h>=d.h&&l?d.h-c.h:l?360-d.h+c.h:360-c.h+d.h,D.h=Math.pow(-1,+!!l)*Math.abs(h)/i;for(let e=1;e<i;e++){let t=u(D,c,e,s);f.push(r(t))}return f}function h(e,t){let i=e.length;if(isNaN(t=parseInt(t,10))||t<2)throw Error("Invalid number of steps (< 2)");if(t<i)throw Error("Number of steps cannot be inferior to number of stops");let r=[];for(let n=1;n<i;n++){let i=(t-1)*(e[n].pos-e[n-1].pos);r.push(Math.max(1,Math.round(i)))}let n=1;for(let e=i-1;e--;)n+=r[e];for(;n!==t;)if(n<t){let e=Math.min.apply(null,r);r[r.indexOf(e)]++,n++}else{let e=Math.max.apply(null,r);r[r.indexOf(e)]--,n--}return r}function c(e,t,i,n){let s,a;if(t<0||t>1)throw Error("Position must be between 0 and 1");for(let i=0,r=e.length;i<r-1;i++)if(t>=e[i].pos&&t<e[i+1].pos){s=e[i],a=e[i+1];break}return s||(s=a=e[e.length-1]),r(u(o(s.color[i](),a.color[i](),(a.pos-s.pos)*100),s.color[i](),(t-s.pos)*100,n))}class d{constructor(e){if(e.length<2)throw Error("Invalid number of stops (< 2)");let t=void 0!==e[0].pos,i=e.length,n=-1,s=!1;this.stops=e.map((e,o)=>{let u=void 0!==e.pos;if(t^u)throw Error("Cannot mix positionned and not posionned color stops");if(u){let t=void 0!==e.color;if(!t&&(s||0===o||o===i-1))throw Error("Cannot define two consecutive position-only stops");if(s=!t,(e={color:t?r(e.color):null,colorLess:!t,pos:e.pos}).pos<0||e.pos>1)throw Error("Color stops positions must be between 0 and 1");if(e.pos<n)throw Error("Color stops positions are not ordered");n=e.pos}else e={color:r(void 0!==e.color?e.color:e),pos:o/(i-1)};return e}),0!==this.stops[0].pos&&(this.stops.unshift({color:this.stops[0].color,pos:0}),i++),1!==this.stops[i-1].pos&&this.stops.push({color:this.stops[i-1].color,pos:1})}reverse(){let e=[];return this.stops.forEach(function(t){e.push({color:t.color,pos:1-t.pos})}),new d(e.reverse())}loop(){let e=[],t=[];return this.stops.forEach(t=>{e.push({color:t.color,pos:t.pos/2})}),this.stops.slice(0,-1).forEach(e=>{t.push({color:e.color,pos:1-e.pos/2})}),new d(e.concat(t.reverse()))}rgb(e){let t=h(this.stops,e),i=[];this.stops.forEach((e,t)=>{e.colorLess&&(e.color=a(this.stops[t-1],this.stops[t+1],2)[1])});for(let e=0,r=this.stops.length;e<r-1;e++){let r=a(this.stops[e],this.stops[e+1],t[e]);i.splice(i.length,0,...r)}return i.push(this.stops[this.stops.length-1].color),i}hsv(e,t){let i=h(this.stops,e),r=[];this.stops.forEach((e,i)=>{e.colorLess&&(e.color=l(this.stops[i-1],this.stops[i+1],2,t)[1])});for(let e=0,n=this.stops.length;e<n-1;e++){let n=l(this.stops[e],this.stops[e+1],i[e],t);r.splice(r.length,0,...n)}return r.push(this.stops[this.stops.length-1].color),r}css(e,t){e=e||"linear",t=t||("linear"===e?"to right":"ellipse at center");let i=e+"-gradient("+t;return this.stops.forEach(function(e){i+=", "+(e.colorLess?"":e.color.toRgbString()+" ")+100*e.pos+"%"}),i+=")"}rgbAt(e){return c(this.stops,e,"toRgb",n)}hsvAt(e){return c(this.stops,e,"toHsv",s)}}e.exports=function(e){if(1==arguments.length){if(!Array.isArray(arguments[0]))throw Error('"stops" is not an array');e=arguments[0]}else e=Array.prototype.slice.call(arguments);return new d(e)}},"./src/bin.ts":function(e,t,i){i.a(e,async function(e,r){try{i.r(t);var n=i("./src/lib/bin.ts");try{await (0,n.e)()}catch(e){console.error("Error",e),process.exit(1)}r()}catch(e){r(e)}},1)},"./src/lib/bin.ts":function(W,V,Y){let X;Y.d(V,{e:()=>uf});var K=Y("../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"),q=Y("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"),J=Y.n(q);let Q=function({onlyFirst:e=!1}={}){return RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))",e?void 0:"g")}();function ee(e){if("string"!=typeof e)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Q,"")}function et(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ei={exports:{}},er={};function en(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}ei.exports=er,er.eastAsianWidth=function(e){var t=e.charCodeAt(0),i=2==e.length?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=i&&i<=57343&&(t&=1023,i&=1023,r=(t<<10|i)+65536),12288==r||65281<=r&&r<=65376||65504<=r&&r<=65510?"F":8361==r||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?"H":4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?"W":32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||172==r||175==r||10214<=r&&r<=10221||10629<=r&&r<=10630?"Na":161==r||164==r||167<=r&&r<=168||170==r||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||198==r||208==r||215<=r&&r<=216||222<=r&&r<=225||230==r||232<=r&&r<=234||236<=r&&r<=237||240==r||242<=r&&r<=243||247<=r&&r<=250||252==r||254==r||257==r||273==r||275==r||283==r||294<=r&&r<=295||299==r||305<=r&&r<=307||312==r||319<=r&&r<=322||324==r||328<=r&&r<=331||333==r||338<=r&&r<=339||358<=r&&r<=359||363==r||462==r||464==r||466==r||468==r||470==r||472==r||474==r||476==r||593==r||609==r||708==r||711==r||713<=r&&r<=715||717==r||720==r||728<=r&&r<=731||733==r||735==r||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||1025==r||1040<=r&&r<=1103||1105==r||8208==r||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||8240==r||8242<=r&&r<=8243||8245==r||8251==r||8254==r||8308==r||8319==r||8321<=r&&r<=8324||8364==r||8451==r||8453==r||8457==r||8467==r||8470==r||8481<=r&&r<=8482||8486==r||8491==r||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||8585==r||8592<=r&&r<=8601||8632<=r&&r<=8633||8658==r||8660==r||8679==r||8704==r||8706<=r&&r<=8707||8711<=r&&r<=8712||8715==r||8719==r||8721==r||8725==r||8730==r||8733<=r&&r<=8736||8739==r||8741==r||8743<=r&&r<=8748||8750==r||8756<=r&&r<=8759||8764<=r&&r<=8765||8776==r||8780==r||8786==r||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||8853==r||8857==r||8869==r||8895==r||8978==r||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||9675==r||9678<=r&&r<=9681||9698<=r&&r<=9701||9711==r||9733<=r&&r<=9734||9737==r||9742<=r&&r<=9743||9748<=r&&r<=9749||9756==r||9758==r||9792==r||9794==r||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||9839==r||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||9955==r||9960<=r&&r<=9983||10045==r||10071==r||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||65533==r||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?"A":"N"},er.characterLength=function(e){var t=this.eastAsianWidth(e);return"F"==t||"W"==t||"A"==t?2:1},er.length=function(e){for(var t=en(e),i=0,r=0;r<t.length;r++)i+=this.characterLength(t[r]);return i},er.slice=function(e,t,i){textLen=er.length(e),i=i||1,(t=t||0)<0&&(t=textLen+t),i<0&&(i=textLen+i);for(var r="",n=0,s=en(e),o=0;o<s.length;o++){var u=s[o],a=er.length(u);if(n>=t-(2==a))if(n+a<=i)r+=u;else break;n+=a}return r};let es=et(ei.exports),eo=et(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g});function eu(e,t={}){if("string"!=typeof e||0===e.length||(t={ambiguousIsNarrow:!0,...t},0===(e=ee(e)).length))return 0;e=e.replace(eo()," ");let i=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31)&&(!(e>=127)||!(e<=159))&&(!(e>=768)||!(e<=879)))switch(es.eastAsianWidth(t)){case"F":case"W":r+=2;break;case"A":r+=i;break;default:r+=1}}return r}let ea=(e=0)=>t=>`\x1b[${t+e}m`,el=(e=0)=>t=>`\x1b[${38+e};5;${t}m`,eh=(e=0)=>(t,i,r)=>`\x1b[${38+e};2;${t};${i};${r}m`,ec={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(ec.modifier),[...Object.keys(ec.color),...Object.keys(ec.bgColor)];let ed=function(){let e=new Map;for(let[t,i]of Object.entries(ec)){for(let[t,r]of Object.entries(i))ec[t]={open:`\x1b[${r[0]}m`,close:`\x1b[${r[1]}m`},i[t]=ec[t],e.set(r[0],r[1]);Object.defineProperty(ec,t,{value:i,enumerable:!1})}return Object.defineProperty(ec,"codes",{value:e,enumerable:!1}),ec.color.close="\x1b[39m",ec.bgColor.close="\x1b[49m",ec.color.ansi=ea(),ec.color.ansi256=el(),ec.color.ansi16m=eh(),ec.bgColor.ansi=ea(10),ec.bgColor.ansi256=el(10),ec.bgColor.ansi16m=eh(10),Object.defineProperties(ec,{rgbToAnsi256:{value:(e,t,i)=>e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[i]=t;3===i.length&&(i=[...i].map(e=>e+e).join(""));let r=Number.parseInt(i,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>ec.rgbToAnsi256(...ec.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{let t,i,r;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)i=t=((e-232)*10+8)/255,r=t;else{let n=(e-=16)%36;t=Math.floor(e/36)/5,i=Math.floor(n/6)/5,r=n%6/5}let n=2*Math.max(t,i,r);if(0===n)return 30;let s=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(t));return 2===n&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,i)=>ec.ansi256ToAnsi(ec.rgbToAnsi256(e,t,i)),enumerable:!1},hexToAnsi:{value:e=>ec.ansi256ToAnsi(ec.hexToAnsi256(e)),enumerable:!1}}),ec}(),eD=new Set(["\x1b","\x9b"]),ef="]8;;",ep=e=>`${eD.values().next().value}[${e}m`,em=e=>`${eD.values().next().value}${ef}${e}\x07`,eE=(e,t,i)=>{let r=[...t],n=!1,s=!1,o=eu(ee(e[e.length-1]));for(let[t,u]of r.entries()){let a=eu(u);if(o+a<=i?e[e.length-1]+=u:(e.push(u),o=0),eD.has(u)&&(n=!0,s=r.slice(t+1).join("").startsWith(ef)),n){s?"\x07"===u&&(n=!1,s=!1):"m"===u&&(n=!1);continue}(o+=a)===i&&t<r.length-1&&(e.push(""),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())};function eg(e,t,i){return String(e).normalize().replace(/\r\n/g,`
3
3
  `).split(`
4
- `).map(e=>((e,t,i={})=>{if(!1!==i.trim&&""===e.trim())return"";let r="",n,s,o=e.split(" ").map(e=>eu(e)),u=[""];for(let[r,n]of e.split(" ").entries()){!1!==i.trim&&(u[u.length-1]=u[u.length-1].trimStart());let e=eu(u[u.length-1]);if(0!==r&&(e>=t&&(!1===i.wordWrap||!1===i.trim)&&(u.push(""),e=0),(e>0||!1===i.trim)&&(u[u.length-1]+=" ",e++)),i.hard&&o[r]>t){let i=t-e,s=1+Math.floor((o[r]-i-1)/t);Math.floor((o[r]-1)/t)<s&&u.push(""),eg(u,n,t);continue}if(e+o[r]>t&&e>0&&o[r]>0){if(!1===i.wordWrap&&e<t){eg(u,n,t);continue}u.push("")}if(e+o[r]>t&&!1===i.wordWrap){eg(u,n,t);continue}u[u.length-1]+=n}!1!==i.trim&&(u=u.map(e=>(e=>{let t=e.split(" "),i=t.length;for(;i>0&&!(eu(t[i-1])>0);)i--;return i===t.length?e:t.slice(0,i).join(" ")+t.slice(i).join("")})(e)));let a=[...u.join(`
4
+ `).map(e=>((e,t,i={})=>{if(!1!==i.trim&&""===e.trim())return"";let r="",n,s,o=e.split(" ").map(e=>eu(e)),u=[""];for(let[r,n]of e.split(" ").entries()){!1!==i.trim&&(u[u.length-1]=u[u.length-1].trimStart());let e=eu(u[u.length-1]);if(0!==r&&(e>=t&&(!1===i.wordWrap||!1===i.trim)&&(u.push(""),e=0),(e>0||!1===i.trim)&&(u[u.length-1]+=" ",e++)),i.hard&&o[r]>t){let i=t-e,s=1+Math.floor((o[r]-i-1)/t);Math.floor((o[r]-1)/t)<s&&u.push(""),eE(u,n,t);continue}if(e+o[r]>t&&e>0&&o[r]>0){if(!1===i.wordWrap&&e<t){eE(u,n,t);continue}u.push("")}if(e+o[r]>t&&!1===i.wordWrap){eE(u,n,t);continue}u[u.length-1]+=n}!1!==i.trim&&(u=u.map(e=>(e=>{let t=e.split(" "),i=t.length;for(;i>0&&!(eu(t[i-1])>0);)i--;return i===t.length?e:t.slice(0,i).join(" ")+t.slice(i).join("")})(e)));let a=[...u.join(`
5
5
  `)];for(let[e,t]of a.entries()){if(r+=t,eD.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${ef}(?<uri>.*)\x07)`).exec(a.slice(e).join(""))||{groups:{}};if(void 0!==t.code){let e=Number.parseFloat(t.code);n=39===e?void 0:e}else void 0!==t.uri&&(s=0===t.uri.length?void 0:t.uri)}let i=ed.codes.get(Number(n));a[e+1]===`
6
6
  `?(s&&(r+=em("")),n&&i&&(r+=ep(i))):t===`
7
7
  `&&(n&&i&&(r+=ep(n)),s&&(r+=em(s)))}return r})(e,t,i)).join(`
8
8
  `)}let eb={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function ey(e,t){if("string"==typeof e)return eb.aliases.get(e)===t;for(let i of e)if(void 0!==i&&ey(i,t))return!0;return!1}let eF=globalThis.process.platform.startsWith("win"),eC=Symbol("clack:cancel");function ev(e,t){e.isTTY&&e.setRawMode(t)}var ew=Object.defineProperty,e_=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?ew(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,i};class eS{constructor(e,t=!0){e_(this,"input"),e_(this,"output"),e_(this,"_abortSignal"),e_(this,"rl"),e_(this,"opts"),e_(this,"_render"),e_(this,"_track",!1),e_(this,"_prevFrame",""),e_(this,"_subscribers",new Map),e_(this,"_cursor",0),e_(this,"state","initial"),e_(this,"error",""),e_(this,"value");let{input:i=b,output:r=y,render:n,signal:s,...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=t,this._abortSignal=s,this.input=i,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let i=this._subscribers.get(e)??[];i.push(t),this._subscribers.set(e,i)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let i=this._subscribers.get(e)??[],r=[];for(let e of i)e.cb(...t),e.once&&r.push(()=>i.splice(i.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(eC);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let i=new A;i._write=(e,t,i)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),i()},this.input.pipe(i),this.rl=F.createInterface({input:this.input,output:i,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),F.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),void 0!==this.opts.initialValue&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),ev(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(K.cursor.show),this.output.off("resize",this.render),ev(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(K.cursor.show),this.output.off("resize",this.render),ev(this.input,!1),e(eC)})})}onKeypress(e,t){if("error"===this.state&&(this.state="active"),t?.name&&(!this._track&&eb.aliases.has(t.name)&&this.emit("cursor",eb.aliases.get(t.name)),eb.actions.has(t.name)&&this.emit("cursor",t.name)),e&&("y"===e.toLowerCase()||"n"===e.toLowerCase())&&this.emit("confirm","y"===e.toLowerCase())," "===e&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),t?.name==="return"){if(this.opts.validate){let e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state="error",this.rl?.write(this.value))}"error"!==this.state&&(this.state="submit")}ey([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),("submit"===this.state||"cancel"===this.state)&&this.emit("finalize"),this.render(),("submit"===this.state||"cancel"===this.state)&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
9
- `),ev(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=eE(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
10
- `).length-1;this.output.write(K.cursor.move(-999,-1*e))}render(){let e=eE(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if("initial"===this.state)this.output.write(K.cursor.hide);else{let t=function(e,t){if(e===t)return;let i=e.split(`
9
+ `),ev(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=eg(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
10
+ `).length-1;this.output.write(K.cursor.move(-999,-1*e))}render(){let e=eg(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if("initial"===this.state)this.output.write(K.cursor.hide);else{let t=function(e,t){if(e===t)return;let i=e.split(`
11
11
  `),r=t.split(`
12
12
  `),n=[];for(let e=0;e<Math.max(i.length,r.length);e++)i[e]!==r[e]&&n.push(e);return n}(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let i=t[0];this.output.write(K.cursor.move(0,i)),this.output.write(K.erase.lines(1));let r=e.split(`
13
13
  `);this.output.write(r[i]),this._prevFrame=e,this.output.write(K.cursor.move(0,r.length-i-1));return}if(t&&t?.length>1){let i=t[0];this.output.write(K.cursor.move(0,i)),this.output.write(K.erase.down());let r=e.split(`
14
14
  `).slice(i);this.output.write(r.join(`
15
- `)),this._prevFrame=e;return}this.output.write(K.erase.down())}this.output.write(e),"initial"===this.state&&(this.state="active"),this._prevFrame=e}}}new WeakMap;var eA=Object.defineProperty,eR=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?eA(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,i};let eO=class extends eS{constructor(e){super(e,!1),eR(this,"options"),eR(this,"cursor",0),this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0),this.on("key",e=>{"a"===e&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}})}get _value(){return this.options[this.cursor].value}toggleAll(){let e=this.value.length===this.options.length;this.value=e?[]:this.options.map(e=>e.value)}toggleValue(){let e=this.value.includes(this._value);this.value=e?this.value.filter(e=>e!==this._value):[...this.value,this._value]}};var eB=Object.defineProperty,ex=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?eB(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,i};class eN extends eS{constructor(e){super(e,!1),ex(this,"options"),ex(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),-1===this.cursor&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class eI extends eS{get valueWithCursor(){if("submit"===this.state)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...i]=this.value.slice(this.cursor);return`${e}${q.inverse(t)}${i.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}}let eT="win32"!==E.platform?"linux"!==E.env.TERM:!!E.env.CI||!!E.env.WT_SESSION||!!E.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===E.env.ConEmuTask||"Terminus-Sublime"===E.env.TERM_PROGRAM||"vscode"===E.env.TERM_PROGRAM||"xterm-256color"===E.env.TERM||"alacritty"===E.env.TERM||"JetBrains-JediTerm"===E.env.TERMINAL_EMULATOR,eL=(e,t)=>eT?e:t,ek=eL("◆","*"),eM=eL("■","x"),e$=eL("▲","x"),ej=eL("◇","o"),eP=eL("┌","T"),ez=eL("│","|"),eU=eL("└","—"),eH=eL("●",">"),eG=eL("○"," "),eZ=eL("◻","[•]"),eW=eL("◼","[+]"),eV=eL("◻","[ ]"),eY=(eL("▪","•"),eL("─","-")),eX=eL("╮","+"),eK=eL("├","+"),eq=eL("╯","+"),eJ=eL("●","•"),eQ=eL("◆","*"),e0=eL("▲","!"),e1=eL("■","x"),e2=e=>{switch(e){case"initial":case"active":return q.cyan(ek);case"cancel":return q.red(eM);case"error":return q.yellow(e$);case"submit":return q.green(ej)}},e3=e=>{let{cursor:t,options:i,style:r}=e,n=e.maxItems??1/0,s=Math.min(Math.max(process.stdout.rows-4,0),Math.max(n,5)),o=0;t>=0+s-3?o=Math.max(Math.min(t-s+3,i.length-s),0):t<o+2&&(o=Math.max(t-2,0));let u=s<i.length&&o>0,a=s<i.length&&o+s<i.length;return i.slice(o,o+s).map((e,i,n)=>{let s=i===n.length-1&&a;return 0===i&&u||s?q.dim("..."):r(e,i+o===t)})},e8=e=>{let t=(e,t)=>{let i=e.label??String(e.value);switch(t){case"selected":return`${q.dim(i)}`;case"active":return`${q.green(eH)} ${i} ${e.hint?q.dim(`(${e.hint})`):""}`;case"cancelled":return`${q.strikethrough(q.dim(i))}`;default:return`${q.dim(eG)} ${q.dim(i)}`}};return new eN({options:e.options,initialValue:e.initialValue,render(){let i=`${q.gray(ez)}
15
+ `)),this._prevFrame=e;return}this.output.write(K.erase.down())}this.output.write(e),"initial"===this.state&&(this.state="active"),this._prevFrame=e}}}new WeakMap;var eA=Object.defineProperty,eR=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?eA(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,i};let eO=class extends eS{constructor(e){super(e,!1),eR(this,"options"),eR(this,"cursor",0),this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0),this.on("key",e=>{"a"===e&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}})}get _value(){return this.options[this.cursor].value}toggleAll(){let e=this.value.length===this.options.length;this.value=e?[]:this.options.map(e=>e.value)}toggleValue(){let e=this.value.includes(this._value);this.value=e?this.value.filter(e=>e!==this._value):[...this.value,this._value]}};var eB=Object.defineProperty,ex=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?eB(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,i};class eN extends eS{constructor(e){super(e,!1),ex(this,"options"),ex(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),-1===this.cursor&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class eI extends eS{get valueWithCursor(){if("submit"===this.state)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...i]=this.value.slice(this.cursor);return`${e}${q.inverse(t)}${i.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}}let eT="win32"!==g.platform?"linux"!==g.env.TERM:!!g.env.CI||!!g.env.WT_SESSION||!!g.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===g.env.ConEmuTask||"Terminus-Sublime"===g.env.TERM_PROGRAM||"vscode"===g.env.TERM_PROGRAM||"xterm-256color"===g.env.TERM||"alacritty"===g.env.TERM||"JetBrains-JediTerm"===g.env.TERMINAL_EMULATOR,eL=(e,t)=>eT?e:t,ek=eL("◆","*"),eM=eL("■","x"),e$=eL("▲","x"),ej=eL("◇","o"),eP=eL("┌","T"),ez=eL("│","|"),eU=eL("└","—"),eH=eL("●",">"),eG=eL("○"," "),eZ=eL("◻","[•]"),eW=eL("◼","[+]"),eV=eL("◻","[ ]"),eY=(eL("▪","•"),eL("─","-")),eX=eL("╮","+"),eK=eL("├","+"),eq=eL("╯","+"),eJ=eL("●","•"),eQ=eL("◆","*"),e0=eL("▲","!"),e1=eL("■","x"),e2=e=>{switch(e){case"initial":case"active":return q.cyan(ek);case"cancel":return q.red(eM);case"error":return q.yellow(e$);case"submit":return q.green(ej)}},e3=e=>{let{cursor:t,options:i,style:r}=e,n=e.maxItems??1/0,s=Math.min(Math.max(process.stdout.rows-4,0),Math.max(n,5)),o=0;t>=0+s-3?o=Math.max(Math.min(t-s+3,i.length-s),0):t<o+2&&(o=Math.max(t-2,0));let u=s<i.length&&o>0,a=s<i.length&&o+s<i.length;return i.slice(o,o+s).map((e,i,n)=>{let s=i===n.length-1&&a;return 0===i&&u||s?q.dim("..."):r(e,i+o===t)})},e8=e=>{let t=(e,t)=>{let i=e.label??String(e.value);switch(t){case"selected":return`${q.dim(i)}`;case"active":return`${q.green(eH)} ${i} ${e.hint?q.dim(`(${e.hint})`):""}`;case"cancelled":return`${q.strikethrough(q.dim(i))}`;default:return`${q.dim(eG)} ${q.dim(i)}`}};return new eN({options:e.options,initialValue:e.initialValue,render(){let i=`${q.gray(ez)}
16
16
  ${e2(this.state)} ${e.message}
17
17
  `;switch(this.state){case"submit":return`${i}${q.gray(ez)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${i}${q.gray(ez)} ${t(this.options[this.cursor],"cancelled")}
18
18
  ${q.gray(ez)}`;default:return`${i}${q.cyan(ez)} ${e3({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,i)=>t(e,i?"active":"inactive")}).join(`
@@ -21,13 +21,13 @@ ${q.cyan(eU)}
21
21
  `}}}).prompt()},e6={message:(e="",{symbol:t=q.gray(ez)}={})=>{let i=[`${q.gray(ez)}`];if(e){let[r,...n]=e.split(`
22
22
  `);i.push(`${t} ${r}`,...n.map(e=>`${q.gray(ez)} ${e}`))}process.stdout.write(`${i.join(`
23
23
  `)}
24
- `)},info:e=>{e6.message(e,{symbol:q.blue(eJ)})},success:e=>{e6.message(e,{symbol:q.green(eQ)})},step:e=>{e6.message(e,{symbol:q.green(ej)})},warn:e=>{e6.message(e,{symbol:q.yellow(e0)})},warning:e=>{e6.warn(e)},error:e=>{e6.message(e,{symbol:q.red(e1)})}},e5=(q.gray(ez),async(e,t)=>{let i={};for(let r of Object.keys(e)){let n=e[r],s=await n({results:i})?.catch(e=>{throw e});if("function"==typeof t?.onCancel&&s===eC){i[r]="canceled",t.onCancel({results:i});continue}i[r]=s}return i});function e4({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}class e9 extends Error{constructor(e,{cause:t}={}){super(e,{cause:t}),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor)}}let e7=function(){let{env:e}=E,{TERM:t,TERM_PROGRAM:i}=e;return"win32"!==E.platform?"linux"!==t:!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===i||"vscode"===i||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}()?"●":"•",te={info:(...e)=>{let t=m.format(...e);e6.info(t)},warn:(...e)=>{let t=m.format(...e);e6.warn(tt(t,J().yellow))},error:(...e)=>{let t=m.format(...e);e6.error(tt(t,J().red))},debug:(...e)=>{0},log:(...e)=>{let t=m.format(...e);e6.step(t)},isVerbose:()=>!e4()};function tt(e,t){return e.split("\n").map(t).join("\n")}function ti(e){return((e="")=>{process.stdout.write(`${q.gray(ez)}
24
+ `)},info:e=>{e6.message(e,{symbol:q.blue(eJ)})},success:e=>{e6.message(e,{symbol:q.green(eQ)})},step:e=>{e6.message(e,{symbol:q.green(ej)})},warn:e=>{e6.message(e,{symbol:q.yellow(e0)})},warning:e=>{e6.warn(e)},error:e=>{e6.message(e,{symbol:q.red(e1)})}},e5=(q.gray(ez),async(e,t)=>{let i={};for(let r of Object.keys(e)){let n=e[r],s=await n({results:i})?.catch(e=>{throw e});if("function"==typeof t?.onCancel&&s===eC){i[r]="canceled",t.onCancel({results:i});continue}i[r]=s}return i});function e4({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}class e9 extends Error{constructor(e,{cause:t}={}){super(e,{cause:t}),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor)}}let e7=function(){let{env:e}=g,{TERM:t,TERM_PROGRAM:i}=e;return"win32"!==g.platform?"linux"!==t:!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===i||"vscode"===i||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}()?"●":"•",te={info:(...e)=>{let t=m.format(...e);e6.info(t)},warn:(...e)=>{let t=m.format(...e);e6.warn(tt(t,J().yellow))},error:(...e)=>{let t=m.format(...e);e6.error(tt(t,J().red))},debug:(...e)=>{0},log:(...e)=>{let t=m.format(...e);e6.step(t)},isVerbose:()=>!e4()};function tt(e,t){return e.split("\n").map(t).join("\n")}function ti(e){return((e="")=>{process.stdout.write(`${q.gray(ez)}
25
25
  ${q.gray(eU)} ${e}
26
26
 
27
27
  `)})(e)}function tr(e,t){return((e="",t="")=>{let i=`
28
28
  ${e}
29
29
  `.split(`
30
- `),r=g(t).length,n=Math.max(i.reduce((e,t)=>{let i=g(t);return i.length>e?i.length:e},0),r)+2,s=i.map(e=>`${q.gray(ez)} ${q.dim(e)}${" ".repeat(n-g(e).length)}${q.gray(ez)}`).join(`
30
+ `),r=E(t).length,n=Math.max(i.reduce((e,t)=>{let i=E(t);return i.length>e?i.length:e},0),r)+2,s=i.map(e=>`${q.gray(ez)} ${q.dim(e)}${" ".repeat(n-E(e).length)}${q.gray(ez)}`).join(`
31
31
  `);process.stdout.write(`${q.gray(ez)}
32
32
  ${q.green(ej)} ${q.reset(t)} ${q.gray(eY.repeat(Math.max(n-r-1,1))+eX)}
33
33
  ${s}
@@ -57,12 +57,12 @@ ${q.cyan(eU)}
57
57
  `);process.stdout.write(K.cursor.move(-999,e.length-1)),process.stdout.write(K.erase.down(e.length))},f=e=>e.replace(/\.+$/,""),p=e=>{let t=(performance.now()-e)/1e3,i=Math.floor(t/60),r=Math.floor(t%60);return i>0?`[${i}m ${r}s]`:`[${r}s]`},m=(t="",i=0)=>{o=!1,clearInterval(s),D();let r=0===i?q.green(ej):1===i?q.red(eM):q.red(e$);u=f(t??u),"timer"===e?process.stdout.write(`${r} ${u} ${p(l)}
58
58
  `):process.stdout.write(`${r} ${u}
59
59
  `),process.removeListener("uncaughtExceptionMonitor",c),process.removeListener("unhandledRejection",c),process.removeListener("SIGINT",d),process.removeListener("SIGTERM",d),process.removeListener("exit",h),n()};return{start:(m="")=>{o=!0,n=function({input:e=b,output:t=y,overwrite:i=!0,hideCursor:r=!0}={}){let n=v({input:e,output:t,prompt:"",tabSize:1});w(e,n),e.isTTY&&e.setRawMode(!0);let s=(n,{name:o,sequence:u})=>{if(ey([String(n),o,u],"cancel")){r&&t.write(K.cursor.show),process.exit(0);return}i&&_(t,"return"===o?0:-1,"return"===o?-1:0,()=>{C(t,1,()=>{e.once("keypress",s)})})};return r&&t.write(K.cursor.hide),e.once("keypress",s),()=>{e.off("keypress",s),r&&t.write(K.cursor.show),e.isTTY&&!eF&&e.setRawMode(!1),n.terminal=!1,n.close()}}(),u=f(m),l=performance.now(),process.stdout.write(`${q.gray(ez)}
60
- `);let g=0,E=0;process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",d),process.on("SIGTERM",d),process.on("exit",h),s=setInterval(()=>{if(r&&u===a)return;D(),a=u;let i=q.magenta(t[g]);if(r)process.stdout.write(`${i} ${u}...`);else if("timer"===e)process.stdout.write(`${i} ${u} ${p(l)}`);else{let e=".".repeat(Math.floor(E)).slice(0,3);process.stdout.write(`${i} ${u}${e}`)}g=g+1<t.length?g+1:0,E=E<t.length?E+.125:0},i)},stop:m,message:(e="")=>{u=f(e??u)}}})(e);return{start:e=>{t.start(e)},stop:(e,i)=>{t.stop(e,i)},message:e=>{t.message(e)}}}function th(e){if(void 0===e)return;let t=e.replace(/\.+$/,"");return`${t}...`}function tc(e){((e="")=>{process.stdout.write(`${q.gray(eU)} ${q.red(e)}
60
+ `);let E=0,g=0;process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",d),process.on("SIGTERM",d),process.on("exit",h),s=setInterval(()=>{if(r&&u===a)return;D(),a=u;let i=q.magenta(t[E]);if(r)process.stdout.write(`${i} ${u}...`);else if("timer"===e)process.stdout.write(`${i} ${u} ${p(l)}`);else{let e=".".repeat(Math.floor(g)).slice(0,3);process.stdout.write(`${i} ${u}${e}`)}E=E+1<t.length?E+1:0,g=g<t.length?g+.125:0},i)},stop:m,message:(e="")=>{u=f(e??u)}}})(e);return{start:e=>{t.start(e)},stop:(e,i)=>{t.stop(e,i)},message:e=>{t.message(e)}}}function th(e){if(void 0===e)return;let t=e.replace(/\.+$/,"");return`${t}...`}function tc(e){((e="")=>{process.stdout.write(`${q.gray(eU)} ${q.red(e)}
61
61
 
62
- `)})(e??"Operation cancelled by user."),process.exit(0)}Y("crypto");var td=Y("path"),tD=Y("fs");let tf=(e,t)=>e.at(-1)===t?e:tf([...e,t],u.resolve(t,"..")),tp=async(e,t,i)=>await tm(e,i)?[tC(e),t.map(e=>tF(e)),{...i,shell:!0}]:[e,t,i],tm=async(e,{shell:t,cwd:i,env:r=E.env})=>"win32"===E.platform&&!t&&!await tg(e,i,r),tg=async(e,t,{Path:i="",PATH:r=i})=>ty.some(t=>e.toLowerCase().endsWith(t))||(tE[`${e}\0${t}\0${r}`]??=await tb(e,t,r)),tE={},tb=async(e,t,i)=>{let r=i.split(u.delimiter).filter(Boolean).map(e=>e.replace(/^"(.*)"$/,"$1"));try{await Promise.all(ty.flatMap(i=>[t,...r].map(t=>`${u.resolve(t,e)}${i}`)).map(async e=>{try{await O(e)}catch{return}throw 0}))}catch{return!0}return!1},ty=[".exe",".com"],tF=e=>tC(tC(`"${e.replaceAll(/(\\*)"/g,'$1$1\\"').replace(/(\\*)$/,"$1$1")}"`)),tC=e=>e.replaceAll(/([()\][%!^"`<>&|;, *?])/g,"^$1"),tv=async(e,{input:t},i)=>{let r=await e;void 0!==t&&r.stdin.end(t);let n=T(r,"close");try{return await Promise.race([n,...r.stdio.filter(Boolean).map(e=>tw(e))]),t_(i,tO(r)),tB(i)}catch(e){throw await Promise.allSettled([n]),tS(e,r,i)}},tw=async e=>{for await(let[t]of I(e,"error"))if(!["ERR_STREAM_PREMATURE_CLOSE","EPIPE"].includes(t?.code))throw t},t_=({command:e},{exitCode:t,signalName:i})=>{if(void 0!==i)throw new tR(`Command was terminated with ${i}: ${e}`);if(void 0!==t)throw new tR(`Command failed with exit code ${t}: ${e}`)},tS=(e,t,i)=>Object.assign(tA(e,i),tO(t),tB(i)),tA=(e,{command:t})=>e instanceof tR?e:new tR(`Command failed: ${t}`,{cause:e});class tR extends Error{name="SubprocessError"}let tO=({exitCode:e,signalCode:t})=>({...e<1?{}:{exitCode:e},...null===t?{}:{signalName:t}}),tB=({state:{stdout:e,stderr:t,output:i},command:r,start:n})=>({stdout:tx(e),stderr:tx(t),output:tx(i),command:r,durationMs:Number(E.hrtime.bigint()-n)/1e6}),tx=e=>"\n"===e.at(-1)?e.slice(0,"\r"===e.at(-2)?-2:-1):e,tN=async(e,t,i,r)=>{try{[e,t]=["node","node.exe"].includes(e.toLowerCase())?[E.execPath,[...E.execArgv.filter(e=>!e.startsWith("--inspect")),...t]]:[e,t],[e,t,i]=await tp(e,t,i),[e,t,i]=tI(e,t,i);let n=x(e,t,i);return tT(n.stdout,r,"stdout"),tT(n.stderr,r,"stderr"),n.once("error",()=>{}),await T(n,"spawn"),n}catch(e){throw tS(e,{},r)}},tI=(e,t,i)=>i.shell&&t.length>0?[[e,...t].join(" "),[],i]:[e,t,i],tT=(e,{state:t},i)=>{e&&(e.setEncoding("utf8"),t.isIterating||(t.isIterating=!1,e.on("data",e=>{t[i]+=e,t.output+=e})))},tL=async e=>{let[[t,i]]=await Promise.all([Promise.allSettled(e),tk(e)]);if(i.reason)throw i.reason.pipedFrom=t.reason??t.value,i.reason;if(t.reason)throw t.reason;return{...i.value,pipedFrom:t.value}},tk=async e=>{try{let[{stdout:t},{stdin:i}]=await Promise.all(e.map(({nodeChildProcess:e})=>e));if(null===i)throw Error('The "stdin" option must be set on the first "spawn()" call in the pipeline.');if(null===t)throw Error('The "stdout" option must be set on the last "spawn()" call in the pipeline.');L(t,i).catch(()=>{})}catch(t){throw await Promise.allSettled(e.map(({nodeChildProcess:e})=>tM(e))),t}},tM=async e=>{let{stdin:t}=await e;t.end()},t$=async function*(e,{state:t},i){if(!1===t.isIterating)throw Error(`The subprocess must be iterated right away, for example:
63
- for await (const line of spawn(...)) { ... }`);t.isIterating=!0;try{let{[i]:t}=await e.nodeChildProcess;if(!t)return;let r="";for await(let e of t.iterator({destroyOnReturn:!1})){let t=`${r}${e}`.split(/\r?\n/);r=t.pop(),yield*t}r&&(yield r)}finally{await e}},tj=async function*(...e){try{let t=[];for(;e.length>0;){t=e.map((e,i)=>t[i]??tP(e));let[{value:i,done:r},n]=await Promise.race(t.map((e,t)=>Promise.all([e,t]))),[s]=e.splice(n,1);t.splice(n,1),r||(e.push(s),yield i)}}finally{await Promise.all(e.map(e=>e.return()))}},tP=async e=>{try{return await e.next()}catch(t){await e.throw(t)}};function tz(e,t,i){let r=te.isVerbose()?"inherit":"pipe";te.debug(`Running: ${e}`,...t??[]);let n=function e(t,i,r,n){let s,[o=[],a={}]=Array.isArray(i)?[i,r]:[[],i],l=(s=[t,...o],{start:E.hrtime.bigint(),command:s.map(e=>{let t;return t=g(e),/[^\w./-]/.test(t)?`'${t.replaceAll("'","'\\''")}'`:t}).join(" "),state:{stdout:"",stderr:"",output:""}}),h=(({stdin:e,stdout:t,stderr:i,stdio:r=[e,t,i],env:n,preferLocal:s,cwd:o=".",...a})=>{let l=o instanceof URL?B(o):u.resolve(o),h=n?{...E.env,...n}:void 0,c=r[0]?.string;return{...a,input:c,stdio:void 0===c?r:["pipe",...r.slice(1)],env:s?(({Path:e="",PATH:t=e,...i},r)=>{let n=t.split(u.delimiter),s=tf([],u.resolve(r)).map(e=>u.join(e,"node_modules/.bin")).filter(e=>!n.includes(e));return{...i,PATH:[...s,t].filter(Boolean).join(u.delimiter)}})(h??E.env,l):h,cwd:l}})(a),c=tN(t,o,h,l),d=tv(c,h,l);Object.assign(d,{nodeChildProcess:c});let D=t$(d=n?tL([n,d]):d,l,"stdout"),f=t$(d,l,"stderr");return Object.assign(d,{nodeChildProcess:c,stdout:D,stderr:f,[Symbol.asyncIterator]:()=>tj(D,f),pipe:(t,i,r)=>e(t,i,r,d)})}(e,t,{stdin:r,stdout:r,stderr:"pipe",...i});return function(e){process.stdin.isTTY&&process.stdin.setRawMode(!1);let t=async()=>{try{(await e.nodeChildProcess).kill(),process.exit(1)}catch{}},i=()=>t(),r=()=>t();process.on("SIGINT",i),process.on("SIGTERM",r),e.nodeChildProcess.finally(()=>{process.off("SIGINT",i),process.off("SIGTERM",r)})}(n),n}function tU(e){return c(e)?e:d(process.cwd(),e)}Y("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/adm-zip.js");let tH="object"==typeof process&&process?process:{stdout:null,stderr:null},tG=e=>!!e&&"object"==typeof e&&(e instanceof iy||e instanceof S||tZ(e)||tW(e)),tZ=e=>!!e&&"object"==typeof e&&e instanceof N&&"function"==typeof e.pipe&&e.pipe!==S.Writable.prototype.pipe,tW=e=>!!e&&"object"==typeof e&&e instanceof N&&"function"==typeof e.write&&"function"==typeof e.end,tV=Symbol("EOF"),tY=Symbol("maybeEmitEnd"),tX=Symbol("emittedEnd"),tK=Symbol("emittingEnd"),tq=Symbol("emittedError"),tJ=Symbol("closed"),tQ=Symbol("read"),t0=Symbol("flush"),t1=Symbol("flushChunk"),t2=Symbol("encoding"),t3=Symbol("decoder"),t8=Symbol("flowing"),t6=Symbol("paused"),t5=Symbol("resume"),t4=Symbol("buffer"),t9=Symbol("pipes"),t7=Symbol("bufferLength"),ie=Symbol("bufferPush"),it=Symbol("bufferShift"),ii=Symbol("objectMode"),ir=Symbol("destroyed"),is=Symbol("error"),io=Symbol("emitData"),iu=Symbol("emitEnd"),ia=Symbol("emitEnd2"),il=Symbol("async"),ih=Symbol("abort"),ic=Symbol("aborted"),id=Symbol("signal"),iD=Symbol("dataListeners"),ip=Symbol("discarded"),im=e=>Promise.resolve().then(e),ig=e=>e();class iE{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[t5](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class ib extends iE{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=e=>t.emit("error",e),e.on("error",this.proxyErrors)}}class iy extends N{[t8]=!1;[t6]=!1;[t9]=[];[t4]=[];[ii];[t2];[il];[t3];[tV]=!1;[tX]=!1;[tK]=!1;[tJ]=!1;[tq]=null;[t7]=0;[ir]=!1;[id];[ic]=!1;[iD]=0;[ip]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&"string"==typeof t.encoding)throw TypeError("Encoding and objectMode may not be used together");if(t.objectMode)this[ii]=!0,this[t2]=null;else t.objectMode||!t.encoding||"buffer"===t.encoding?(this[ii]=!1,this[t2]=null):(this[t2]=t.encoding,this[ii]=!1);this[il]=!!t.async,this[t3]=this[t2]?new $(this[t2]):null,t&&!0===t.debugExposeBuffer&&Object.defineProperty(this,"buffer",{get:()=>this[t4]}),t&&!0===t.debugExposePipes&&Object.defineProperty(this,"pipes",{get:()=>this[t9]});let{signal:i}=t;i&&(this[id]=i,i.aborted?this[ih]():i.addEventListener("abort",()=>this[ih]()))}get bufferLength(){return this[t7]}get encoding(){return this[t2]}set encoding(e){throw Error("Encoding must be set at instantiation time")}setEncoding(e){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[ii]}set objectMode(e){throw Error("objectMode must be set at instantiation time")}get async(){return this[il]}set async(e){this[il]=this[il]||!!e}[ih](){this[ic]=!0,this.emit("abort",this[id]?.reason),this.destroy(this[id]?.reason)}get aborted(){return this[ic]}set aborted(e){}write(e,t,i){if(this[ic])return!1;if(this[tV])throw Error("write after end");if(this[ir])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;"function"==typeof t&&(i=t,t="utf8"),t||(t="utf8");let r=this[il]?im:ig;if(!this[ii]&&!Buffer.isBuffer(e)){let t;if(t=e,!Buffer.isBuffer(t)&&ArrayBuffer.isView(t))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else{let t;if((t=e)instanceof ArrayBuffer||t&&"object"==typeof t&&t.constructor&&"ArrayBuffer"===t.constructor.name&&t.byteLength>=0)e=Buffer.from(e);else if("string"!=typeof e)throw Error("Non-contiguous data written to non-objectMode stream")}}return this[ii]?(this[t8]&&0!==this[t7]&&this[t0](!0),this[t8]?this.emit("data",e):this[ie](e)):e.length&&("string"==typeof e&&(t!==this[t2]||this[t3]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[t2]&&(e=this[t3].write(e)),this[t8]&&0!==this[t7]&&this[t0](!0),this[t8]?this.emit("data",e):this[ie](e)),0!==this[t7]&&this.emit("readable"),i&&r(i),this[t8]}read(e){if(this[ir])return null;if(this[ip]=!1,0===this[t7]||0===e||e&&e>this[t7])return this[tY](),null;this[ii]&&(e=null),this[t4].length>1&&!this[ii]&&(this[t4]=[this[t2]?this[t4].join(""):Buffer.concat(this[t4],this[t7])]);let t=this[tQ](e||null,this[t4][0]);return this[tY](),t}[tQ](e,t){if(this[ii])this[it]();else{let i=t;e===i.length||null===e?this[it]():("string"==typeof i?(this[t4][0]=i.slice(e),t=i.slice(0,e)):(this[t4][0]=i.subarray(e),t=i.subarray(0,e)),this[t7]-=e)}return this.emit("data",t),this[t4].length||this[tV]||this.emit("drain"),t}end(e,t,i){return"function"==typeof e&&(i=e,e=void 0),"function"==typeof t&&(i=t,t="utf8"),void 0!==e&&this.write(e,t),i&&this.once("end",i),this[tV]=!0,this.writable=!1,(this[t8]||!this[t6])&&this[tY](),this}[t5](){this[ir]||(this[iD]||this[t9].length||(this[ip]=!0),this[t6]=!1,this[t8]=!0,this.emit("resume"),this[t4].length?this[t0]():this[tV]?this[tY]():this.emit("drain"))}resume(){return this[t5]()}pause(){this[t8]=!1,this[t6]=!0,this[ip]=!1}get destroyed(){return this[ir]}get flowing(){return this[t8]}get paused(){return this[t6]}[ie](e){this[ii]?this[t7]+=1:this[t7]+=e.length,this[t4].push(e)}[it](){return this[ii]?this[t7]-=1:this[t7]-=this[t4][0].length,this[t4].shift()}[t0](e=!1){do;while(this[t1](this[it]())&&this[t4].length);e||this[t4].length||this[tV]||this.emit("drain")}[t1](e){return this.emit("data",e),this[t8]}pipe(e,t){if(this[ir])return e;this[ip]=!1;let i=this[tX];return t=t||{},e===tH.stdout||e===tH.stderr?t.end=!1:t.end=!1!==t.end,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[t9].push(t.proxyErrors?new ib(this,e,t):new iE(this,e,t)),this[il]?im(()=>this[t5]()):this[t5]()),e}unpipe(e){let t=this[t9].find(t=>t.dest===e);t&&(1===this[t9].length?(this[t8]&&0===this[iD]&&(this[t8]=!1),this[t9]=[]):this[t9].splice(this[t9].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if("data"===e)this[ip]=!1,this[iD]++,this[t9].length||this[t8]||this[t5]();else if("readable"===e&&0!==this[t7])super.emit("readable");else("end"===e||"finish"===e||"prefinish"===e)&&this[tX]?(super.emit(e),this.removeAllListeners(e)):"error"===e&&this[tq]&&(this[il]?im(()=>t.call(this,this[tq])):t.call(this,this[tq]));return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return"data"===e&&(this[iD]=this.listeners("data").length,0!==this[iD]||this[ip]||this[t9].length||(this[t8]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return("data"===e||void 0===e)&&(this[iD]=0,this[ip]||this[t9].length||(this[t8]=!1)),t}get emittedEnd(){return this[tX]}[tY](){this[tK]||this[tX]||this[ir]||0!==this[t4].length||!this[tV]||(this[tK]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[tJ]&&this.emit("close"),this[tK]=!1)}emit(e,...t){let i=t[0];if("error"!==e&&"close"!==e&&e!==ir&&this[ir])return!1;if("data"===e)return(!!this[ii]||!!i)&&(this[il]?(im(()=>this[io](i)),!0):this[io](i));if("end"===e)return this[iu]();if("close"===e){if(this[tJ]=!0,!this[tX]&&!this[ir])return!1;let e=super.emit("close");return this.removeAllListeners("close"),e}if("error"===e){this[tq]=i,super.emit(is,i);let e=(!this[id]||!!this.listeners("error").length)&&super.emit("error",i);return this[tY](),e}else if("resume"===e){let e=super.emit("resume");return this[tY](),e}else if("finish"===e||"prefinish"===e){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[tY](),r}[io](e){for(let t of this[t9])!1===t.dest.write(e)&&this.pause();let t=!this[ip]&&super.emit("data",e);return this[tY](),t}[iu](){return!this[tX]&&(this[tX]=!0,this.readable=!1,this[il]?(im(()=>this[ia]()),!0):this[ia]())}[ia](){if(this[t3]){let e=this[t3].end();if(e){for(let t of this[t9])t.dest.write(e);this[ip]||super.emit("data",e)}}for(let e of this[t9])e.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ii]||(e.dataLength=0);let t=this.promise();return this.on("data",t=>{e.push(t),this[ii]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[ii])throw Error("cannot concat in objectMode");let e=await this.collect();return this[t2]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(ir,()=>t(Error("stream destroyed"))),this.on("error",e=>t(e)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ip]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{let i,r;if(e)return t();let n=this.read();if(null!==n)return Promise.resolve({done:!1,value:n});if(this[tV])return t();let s=e=>{this.off("data",o),this.off("end",u),this.off(ir,a),t(),r(e)},o=e=>{this.off("error",s),this.off("end",u),this.off(ir,a),this.pause(),i({value:e,done:!!this[tV]})},u=()=>{this.off("error",s),this.off("data",o),this.off(ir,a),t(),i({done:!0,value:void 0})},a=()=>s(Error("stream destroyed"));return new Promise((e,t)=>{r=t,i=e,this.once(ir,a),this.once("error",s),this.once("end",u),this.once("data",o)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ip]=!1;let e=!1,t=()=>(this.pause(),this.off(is,t),this.off(ir,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let i=this.read();return null===i?t():{done:!1,value:i}};return this.once("end",t),this.once(is,t),this.once(ir,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){return this[ir]||(this[ir]=!0,this[ip]=!0,this[t4].length=0,this[t7]=0,"function"!=typeof this.close||this[tJ]||this.close()),e?this.emit("error",e):this.emit(ir),this}static get isStream(){return tG}}let iF=tD.default.writev,iC=Symbol("_autoClose"),iv=Symbol("_close"),iw=Symbol("_ended"),i_=Symbol("_fd"),iS=Symbol("_finished"),iA=Symbol("_flags"),iR=Symbol("_flush"),iO=Symbol("_handleChunk"),iB=Symbol("_makeBuf"),ix=Symbol("_mode"),iN=Symbol("_needDrain"),iI=Symbol("_onerror"),iT=Symbol("_onopen"),iL=Symbol("_onread"),ik=Symbol("_onwrite"),iM=Symbol("_open"),i$=Symbol("_path"),ij=Symbol("_pos"),iP=Symbol("_queue"),iz=Symbol("_read"),iU=Symbol("_readSize"),iH=Symbol("_reading"),iG=Symbol("_remain"),iZ=Symbol("_size"),iW=Symbol("_write"),iV=Symbol("_writing"),iY=Symbol("_defaultFlag"),iX=Symbol("_errored");class iK extends iy{[iX]=!1;[i_];[i$];[iU];[iH]=!1;[iZ];[iG];[iC];constructor(e,t){if(super(t=t||{}),this.readable=!0,this.writable=!1,"string"!=typeof e)throw TypeError("path must be a string");this[iX]=!1,this[i_]="number"==typeof t.fd?t.fd:void 0,this[i$]=e,this[iU]=t.readSize||0x1000000,this[iH]=!1,this[iZ]="number"==typeof t.size?t.size:1/0,this[iG]=this[iZ],this[iC]="boolean"!=typeof t.autoClose||t.autoClose,"number"==typeof this[i_]?this[iz]():this[iM]()}get fd(){return this[i_]}get path(){return this[i$]}write(){throw TypeError("this is a readable stream")}end(){throw TypeError("this is a readable stream")}[iM](){tD.default.open(this[i$],"r",(e,t)=>this[iT](e,t))}[iT](e,t){e?this[iI](e):(this[i_]=t,this.emit("open",t),this[iz]())}[iB](){return Buffer.allocUnsafe(Math.min(this[iU],this[iG]))}[iz](){if(!this[iH]){this[iH]=!0;let e=this[iB]();if(0===e.length)return process.nextTick(()=>this[iL](null,0,e));tD.default.read(this[i_],e,0,e.length,null,(e,t,i)=>this[iL](e,t,i))}}[iL](e,t,i){this[iH]=!1,e?this[iI](e):this[iO](t,i)&&this[iz]()}[iv](){if(this[iC]&&"number"==typeof this[i_]){let e=this[i_];this[i_]=void 0,tD.default.close(e,e=>e?this.emit("error",e):this.emit("close"))}}[iI](e){this[iH]=!0,this[iv](),this.emit("error",e)}[iO](e,t){let i=!1;return this[iG]-=e,e>0&&(i=super.write(e<t.length?t.subarray(0,e):t)),(0===e||this[iG]<=0)&&(i=!1,this[iv](),super.end()),i}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return"number"==typeof this[i_]&&this[iz](),!1;case"error":if(this[iX])return!1;return this[iX]=!0,super.emit(e,...t);default:return super.emit(e,...t)}}}class iq extends iK{[iM](){let e=!0;try{this[iT](null,tD.default.openSync(this[i$],"r")),e=!1}finally{e&&this[iv]()}}[iz](){let e=!0;try{if(!this[iH]){for(this[iH]=!0;;){let e=this[iB](),t=0===e.length?0:tD.default.readSync(this[i_],e,0,e.length,null);if(!this[iO](t,e))break}this[iH]=!1}e=!1}finally{e&&this[iv]()}}[iv](){if(this[iC]&&"number"==typeof this[i_]){let e=this[i_];this[i_]=void 0,tD.default.closeSync(e),this.emit("close")}}}class iJ extends k{readable=!1;writable=!0;[iX]=!1;[iV]=!1;[iw]=!1;[iP]=[];[iN]=!1;[i$];[ix];[iC];[i_];[iY];[iA];[iS]=!1;[ij];constructor(e,t){super(t=t||{}),this[i$]=e,this[i_]="number"==typeof t.fd?t.fd:void 0,this[ix]=void 0===t.mode?438:t.mode,this[ij]="number"==typeof t.start?t.start:void 0,this[iC]="boolean"!=typeof t.autoClose||t.autoClose;let i=void 0!==this[ij]?"r+":"w";this[iY]=void 0===t.flags,this[iA]=void 0===t.flags?i:t.flags,void 0===this[i_]&&this[iM]()}emit(e,...t){if("error"===e){if(this[iX])return!1;this[iX]=!0}return super.emit(e,...t)}get fd(){return this[i_]}get path(){return this[i$]}[iI](e){this[iv](),this[iV]=!0,this.emit("error",e)}[iM](){tD.default.open(this[i$],this[iA],this[ix],(e,t)=>this[iT](e,t))}[iT](e,t){this[iY]&&"r+"===this[iA]&&e&&"ENOENT"===e.code?(this[iA]="w",this[iM]()):e?this[iI](e):(this[i_]=t,this.emit("open",t),this[iV]||this[iR]())}end(e,t){return e&&this.write(e,t),this[iw]=!0,this[iV]||this[iP].length||"number"!=typeof this[i_]||this[ik](null,0),this}write(e,t){return("string"==typeof e&&(e=Buffer.from(e,t)),this[iw])?(this.emit("error",Error("write() after end()")),!1):void 0===this[i_]||this[iV]||this[iP].length?(this[iP].push(e),this[iN]=!0,!1):(this[iV]=!0,this[iW](e),!0)}[iW](e){tD.default.write(this[i_],e,0,e.length,this[ij],(e,t)=>this[ik](e,t))}[ik](e,t){e?this[iI](e):(void 0!==this[ij]&&"number"==typeof t&&(this[ij]+=t),this[iP].length?this[iR]():(this[iV]=!1,this[iw]&&!this[iS]?(this[iS]=!0,this[iv](),this.emit("finish")):this[iN]&&(this[iN]=!1,this.emit("drain"))))}[iR](){if(0===this[iP].length)this[iw]&&this[ik](null,0);else if(1===this[iP].length)this[iW](this[iP].pop());else{let e=this[iP];this[iP]=[],iF(this[i_],e,this[ij],(e,t)=>this[ik](e,t))}}[iv](){if(this[iC]&&"number"==typeof this[i_]){let e=this[i_];this[i_]=void 0,tD.default.close(e,e=>e?this.emit("error",e):this.emit("close"))}}}class iQ extends iJ{[iM](){let e;if(this[iY]&&"r+"===this[iA])try{e=tD.default.openSync(this[i$],this[iA],this[ix])}catch(e){if(e?.code==="ENOENT")return this[iA]="w",this[iM]();throw e}else e=tD.default.openSync(this[i$],this[iA],this[ix]);this[iT](null,e)}[iv](){if(this[iC]&&"number"==typeof this[i_]){let e=this[i_];this[i_]=void 0,tD.default.closeSync(e),this.emit("close")}}[iW](e){let t=!0;try{this[ik](null,tD.default.writeSync(this[i_],e,0,e.length,this[ij])),t=!1}finally{if(t)try{this[iv]()}catch{}}}}let i0=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"]]),i1=e=>{let t=i0.get(e);return t||e},i2=(e={})=>{if(!e)return{};let t={};for(let[i,r]of Object.entries(e))t[i1(i)]=r;return void 0===t.chmod&&!1===t.noChmod&&(t.chmod=!0),delete t.noChmod,t},i3=(e,t,i,r,n)=>Object.assign((s=[],o,u)=>{Array.isArray(s)&&(o=s,s={}),"function"==typeof o&&(u=o,o=void 0),o=o?Array.from(o):[];let a=i2(s);if(n?.(a,o),!a.sync||!a.file){if(a.sync||!a.file){if(!a.sync||a.file){if(a.sync||a.file)throw Error("impossible options??");if("function"==typeof u)throw TypeError("callback only supported with file option");return r(a,o)}if("function"==typeof u)throw TypeError("callback not supported for sync tar functions");return i(a,o)}{let e=t(a,o),i=u||void 0;return i?e.then(()=>i(),i):e}}if("function"==typeof u)throw TypeError("callback not supported for sync tar functions");return e(a,o)},{syncFile:e,asyncFile:t,syncNoFile:i,asyncNoFile:r,validate:n});var i8=Y("zlib");let i6=i8.default.constants||{ZLIB_VERNUM:4736},i5=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},i6)),i4=P.concat,i9=Object.getOwnPropertyDescriptor(P,"concat"),i7=e=>e,re=i9?.writable===!0||i9?.set!==void 0?e=>{P.concat=e?i7:i4}:e=>{},rt=Symbol("_superWrite");class ri extends Error{code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}}let rr=Symbol("flushFlag");class rn extends iy{#e=!1;#t=!1;#i;#r;#n;#s;#o;get sawError(){return this.#e}get handle(){return this.#s}get flushFlag(){return this.#i}constructor(e,t){if(!e||"object"!=typeof e)throw TypeError("invalid options for ZlibBase constructor");if(super(e),this.#i=e.flush??0,this.#r=e.finishFlush??0,this.#n=e.fullFlushFlag??0,"function"!=typeof i8[t])throw TypeError("Compression method not supported: "+t);try{this.#s=new i8[t](e)}catch(e){throw new ri(e,this.constructor)}this.#o=e=>{this.#e||(this.#e=!0,this.close(),this.emit("error",e))},this.#s?.on("error",e=>this.#o(new ri(e))),this.once("end",()=>this.close)}close(){this.#s&&(this.#s.close(),this.#s=void 0,this.emit("close"))}reset(){if(!this.#e)return j(this.#s,"zlib binding closed"),this.#s.reset?.()}flush(e){this.ended||("number"!=typeof e&&(e=this.#n),this.write(Object.assign(P.alloc(0),{[rr]:e})))}end(e,t,i){return"function"==typeof e&&(i=e,t=void 0,e=void 0),"function"==typeof t&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(i)}get ended(){return this.#t}[rt](e){return super.write(e)}write(e,t,i){let r,n;if("function"==typeof t&&(i=t,t="utf8"),"string"==typeof e&&(e=P.from(e,t)),this.#e)return;j(this.#s,"zlib binding closed");let s=this.#s._handle,o=s.close;s.close=()=>{};let u=this.#s.close;this.#s.close=()=>{},re(!0);try{let t="number"==typeof e[rr]?e[rr]:this.#i;n=this.#s._processChunk(e,t),re(!1)}catch(e){re(!1),this.#o(new ri(e,this.write))}finally{this.#s&&(this.#s._handle=s,s.close=o,this.#s.close=u,this.#s.removeAllListeners("error"))}if(this.#s&&this.#s.on("error",e=>this.#o(new ri(e,this.write))),n)if(Array.isArray(n)&&n.length>0){let e=n[0];r=this[rt](P.from(e));for(let e=1;e<n.length;e++)r=this[rt](n[e])}else r=this[rt](P.from(n));return i&&i(),r}}class rs extends rn{#u;#a;constructor(e,t){(e=e||{}).flush=e.flush||i5.Z_NO_FLUSH,e.finishFlush=e.finishFlush||i5.Z_FINISH,e.fullFlushFlag=i5.Z_FULL_FLUSH,super(e,t),this.#u=e.level,this.#a=e.strategy}params(e,t){if(!this.sawError){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.#u!==e||this.#a!==t){this.flush(i5.Z_SYNC_FLUSH),j(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(e,t)=>{"function"==typeof e&&(t=e,e=this.flushFlag),this.flush(e),t?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#u=e,this.#a=t)}}}}class ro extends rs{#l;constructor(e){super(e,"Gzip"),this.#l=e&&!!e.portable}[rt](e){return this.#l&&(this.#l=!1,e[9]=255),super[rt](e)}}class ru extends rs{constructor(e){super(e,"Unzip")}}class ra extends rn{constructor(e,t){(e=e||{}).flush=e.flush||i5.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||i5.BROTLI_OPERATION_FINISH,e.fullFlushFlag=i5.BROTLI_OPERATION_FLUSH,super(e,t)}}class rl extends ra{constructor(e){super(e,"BrotliCompress")}}class rh extends ra{constructor(e){super(e,"BrotliDecompress")}}class rc extends rn{constructor(e,t){(e=e||{}).flush=e.flush||i5.ZSTD_e_continue,e.finishFlush=e.finishFlush||i5.ZSTD_e_end,e.fullFlushFlag=i5.ZSTD_e_flush,super(e,t)}}class rd extends rc{constructor(e){super(e,"ZstdCompress")}}class rD extends rc{constructor(e){super(e,"ZstdDecompress")}}let rf=e=>(255^e)&255,rp=e=>(255^e)+1&255,rm=e=>rg.has(e),rg=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"]]),rE=new Map(Array.from(rg).map(e=>[e[1],e[0]]));class rb{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#h="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,i,r){Buffer.isBuffer(e)?this.decode(e,t||0,i,r):e&&this.#c(e)}decode(e,t,i,r){if(t||(t=0),!e||!(e.length>=t+512))throw Error("need 512 bytes for header");this.path=rF(e,t,100),this.mode=rw(e,t+100,8),this.uid=rw(e,t+108,8),this.gid=rw(e,t+116,8),this.size=rw(e,t+124,12),this.mtime=rC(e,t+136,12),this.cksum=rw(e,t+148,12),r&&this.#c(r,!0),i&&this.#c(i);let n=rF(e,t+156,1);if(rm(n)&&(this.#h=n||"0"),"0"===this.#h&&"/"===this.path.slice(-1)&&(this.#h="5"),"5"===this.#h&&(this.size=0),this.linkpath=rF(e,t+157,100),"ustar\x0000"===e.subarray(t+257,t+265).toString())if(this.uname=rF(e,t+265,32),this.gname=rF(e,t+297,32),this.devmaj=rw(e,t+329,8)??0,this.devmin=rw(e,t+337,8)??0,0!==e[t+475]){let i=rF(e,t+345,155);this.path=i+"/"+this.path}else{let i=rF(e,t+345,130);i&&(this.path=i+"/"+this.path),this.atime=rC(e,t+476,12),this.ctime=rC(e,t+488,12)}let s=256;for(let i=t;i<t+148;i++)s+=e[i];for(let i=t+156;i<t+512;i++)s+=e[i];this.cksumValid=s===this.cksum,void 0===this.cksum&&256===s&&(this.nullBlock=!0)}#c(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([e,i])=>!(null==i||"path"===e&&t||"linkpath"===e&&t||"global"===e))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),"Unsupported"===this.#h&&(this.#h="0"),!(e.length>=t+512))throw Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,r=ry(this.path||"",i),n=r[0],s=r[1];this.needPax=!!r[2],this.needPax=rI(e,t,100,n)||this.needPax,this.needPax=rA(e,t+100,8,this.mode)||this.needPax,this.needPax=rA(e,t+108,8,this.uid)||this.needPax,this.needPax=rA(e,t+116,8,this.gid)||this.needPax,this.needPax=rA(e,t+124,12,this.size)||this.needPax,this.needPax=rx(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#h.charCodeAt(0),this.needPax=rI(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=rI(e,t+265,32,this.uname)||this.needPax,this.needPax=rI(e,t+297,32,this.gname)||this.needPax,this.needPax=rA(e,t+329,8,this.devmaj)||this.needPax,this.needPax=rA(e,t+337,8,this.devmin)||this.needPax,this.needPax=rI(e,t+345,i,s)||this.needPax,0!==e[t+475]?this.needPax=rI(e,t+345,155,s)||this.needPax:(this.needPax=rI(e,t+345,130,s)||this.needPax,this.needPax=rx(e,t+476,12,this.atime)||this.needPax,this.needPax=rx(e,t+488,12,this.ctime)||this.needPax);let o=256;for(let i=t;i<t+148;i++)o+=e[i];for(let i=t+156;i<t+512;i++)o+=e[i];return this.cksum=o,rA(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return"Unsupported"===this.#h?this.#h:rg.get(this.#h)}get typeKey(){return this.#h}set type(e){let t=String(rE.get(e));if(rm(t)||"Unsupported"===t)this.#h=t;else if(rm(e))this.#h=e;else throw TypeError("invalid entry type: "+e)}}let ry=(e,t)=>{let i,r=e,n="",s=D.parse(e).root||".";if(100>Buffer.byteLength(r))i=[r,n,!1];else{n=D.dirname(r),r=D.basename(r);do 100>=Buffer.byteLength(r)&&Buffer.byteLength(n)<=t?i=[r,n,!1]:Buffer.byteLength(r)>100&&Buffer.byteLength(n)<=t?i=[r.slice(0,99),n,!0]:(r=D.join(D.basename(n),r),n=D.dirname(n));while(n!==s&&void 0===i);i||(i=[e.slice(0,99),"",!0])}return i},rF=(e,t,i)=>e.subarray(t,t+i).toString("utf8").replace(/\0.*/,""),rC=(e,t,i)=>rv(rw(e,t,i)),rv=e=>void 0===e?void 0:new Date(1e3*e),rw=(e,t,i)=>128&Number(e[t])?(e=>{let t=e[0],i=128===t?(e=>{for(var t=e.length,i=0,r=t-1;r>-1;r--){var n=Number(e[r]);0!==n&&(i+=n*Math.pow(256,t-r-1))}return i})(e.subarray(1,e.length)):255===t?(e=>{for(var t=e.length,i=0,r=!1,n=t-1;n>-1;n--){var s,o=Number(e[n]);r?s=rf(o):0===o?s=o:(r=!0,s=rp(o)),0!==s&&(i-=s*Math.pow(256,t-n-1))}return i})(e):null;if(null===i)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i})(e.subarray(t,t+i)):r_(e,t,i),r_=(e,t,i)=>{let r;return isNaN(r=parseInt(e.subarray(t,t+i).toString("utf8").replace(/\0.*$/,"").trim(),8))?void 0:r},rS={12:0x1ffffffff,8:2097151},rA=(e,t,i,r)=>void 0!==r&&(r>rS[i]||r<0?(((e,t)=>{if(Number.isSafeInteger(e))e<0?((e,t)=>{t[0]=255;var i=!1;e*=-1;for(var r=t.length;r>1;r--){var n=255&e;e=Math.floor(e/256),i?t[r-1]=rf(n):0===n?t[r-1]=0:(i=!0,t[r-1]=rp(n))}})(e,t):((e,t)=>{t[0]=128;for(var i=t.length;i>1;i--)t[i-1]=255&e,e=Math.floor(e/256)})(e,t);else throw Error("cannot encode number outside of javascript safe integer range")})(r,e.subarray(t,t+i)),!0):(rR(e,t,i,r),!1)),rR=(e,t,i,r)=>e.write(rO(r,i),t,i,"ascii"),rO=(e,t)=>rB(Math.floor(e).toString(8),t),rB=(e,t)=>(e.length===t-1?e:Array(t-e.length-1).join("0")+e+" ")+"\0",rx=(e,t,i,r)=>void 0!==r&&rA(e,t,i,r.getTime()/1e3),rN=Array(156).join("\0"),rI=(e,t,i,r)=>void 0!==r&&(e.write(r+rN,t,i,"utf8"),r.length!==Buffer.byteLength(r)||r.length>i);class rT{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(""===e)return Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(i);for(let e=0;e<512;e++)r[e]=0;new rb({path:("PaxHeader/"+a(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,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(r),r.write(e,512,t,"utf8");for(let e=t+512;e<r.length;e++)r[e]=0;return r}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(void 0===this[e])return"";let t=this[e],i=" "+("dev"===e||"ino"===e||"nlink"===e?"SCHILY.":"")+e+"="+(t instanceof Date?t.getTime()/1e3:t)+"\n",r=Buffer.byteLength(i),n=Math.floor(Math.log(r)/Math.log(10))+1;return r+n>=Math.pow(10,n)&&(n+=1),n+r+i}static parse(e,t,i=!1){return new rT(rL(rk(e),t),i)}}let rL=(e,t)=>t?Object.assign({},t,e):e,rk=e=>e.replace(/\n$/,"").split("\n").reduce(rM,Object.create(null)),rM=(e,t)=>{let i=parseInt(t,10);if(i!==Buffer.byteLength(t)+1)return e;let r=(t=t.slice((i+" ").length)).split("="),n=r.shift();if(!n)return e;let s=n.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=r.join("=");return e[s]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(s)?new Date(1e3*Number(o)):/^[0-9]+$/.test(o)?+o:o,e},r$="win32"!==(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)?e=>e:e=>e&&e.replace(/\\/g,"/");class rj extends iy{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(e,t,i){switch(super({}),this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.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(!e.path)throw Error("no path provided for tar.ReadEntry");this.path=r$(e.path),this.mode=e.mode,this.mode&&(this.mode=4095&this.mode),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?r$(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#c(t),i&&this.#c(i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw Error("writing more to entry than is appropriate");let i=this.remain,r=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,r-t),!!this.ignore||(i>=t?super.write(e):super.write(e.subarray(0,i)))}#c(e,t=!1){e.path&&(e.path=r$(e.path)),e.linkpath&&(e.linkpath=r$(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([e,i])=>!(null==i||"path"===e&&t))))}}let rP=(e,t,i,r={})=>{e.file&&(r.file=e.file),e.cwd&&(r.cwd=e.cwd),r.code=i instanceof Error&&i.code||t,r.tarCode=t,e.strict||!1===r.recoverable?i instanceof Error?e.emit("error",Object.assign(i,r)):e.emit("error",Object.assign(Error(`${t}: ${i}`),r)):(i instanceof Error&&(r=Object.assign(i,r),i=i.message),e.emit("warn",t,i,r))},rz=Buffer.from([31,139]),rU=Buffer.from([40,181,47,253]),rH=Math.max(rz.length,rU.length),rG=Symbol("state"),rZ=Symbol("writeEntry"),rW=Symbol("readEntry"),rV=Symbol("nextEntry"),rY=Symbol("processEntry"),rX=Symbol("extendedHeader"),rK=Symbol("globalExtendedHeader"),rq=Symbol("meta"),rJ=Symbol("emitMeta"),rQ=Symbol("buffer"),r0=Symbol("queue"),r1=Symbol("ended"),r2=Symbol("emittedEnd"),r3=Symbol("emit"),r8=Symbol("unzip"),r6=Symbol("consumeChunk"),r5=Symbol("consumeChunkSub"),r4=Symbol("consumeBody"),r9=Symbol("consumeMeta"),r7=Symbol("consumeHeader"),ne=Symbol("consuming"),nt=Symbol("bufferConcat"),ni=Symbol("maybeEnd"),nr=Symbol("writing"),nn=Symbol("aborted"),ns=Symbol("onDone"),no=Symbol("sawValidEntry"),nu=Symbol("sawNullBlock"),na=Symbol("sawEOF"),nl=Symbol("closeStream"),nh=()=>!0;class nc extends M{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[r0]=[];[rQ];[rW];[rZ];[rG]="begin";[rq]="";[rX];[rK];[r1]=!1;[r8];[nn]=!1;[no];[nu]=!1;[na]=!1;[nr]=!1;[ne]=!1;[r2]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(ns,()=>{("begin"===this[rG]||!1===this[no])&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(ns,e.ondone):this.on(ns,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||1048576,this.filter="function"==typeof e.filter?e.filter:nh;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=e.gzip||e.zstd||void 0===e.brotli?!!t&&void 0:e.brotli;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=e.gzip||e.brotli||void 0===e.zstd?!!i||void 0:e.zstd,this.on("end",()=>this[nl]()),"function"==typeof e.onwarn&&this.on("warn",e.onwarn),"function"==typeof e.onReadEntry&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){rP(this,e,t,i)}[r7](e,t){let i;void 0===this[no]&&(this[no]=!1);try{i=new rb(e,t,this[rX],this[rK])}catch(e){return this.warn("TAR_ENTRY_INVALID",e)}if(i.nullBlock)this[nu]?(this[na]=!0,"begin"===this[rG]&&(this[rG]="header"),this[r3]("eof")):(this[nu]=!0,this[r3]("nullBlock"));else if(this[nu]=!1,i.cksumValid)if(i.path){let e=i.type;if(/^(Symbolic)?Link$/.test(e)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(/^(Symbolic)?Link$/.test(e)||/^(Global)?ExtendedHeader$/.test(e)||!i.linkpath){let e=this[rZ]=new rj(i,this[rX],this[rK]);if(!this[no])if(e.remain){let t=()=>{e.invalid||(this[no]=!0)};e.on("end",t)}else this[no]=!0;e.meta?e.size>this.maxMetaEntrySize?(e.ignore=!0,this[r3]("ignoredEntry",e),this[rG]="ignore",e.resume()):e.size>0&&(this[rq]="",e.on("data",e=>this[rq]+=e),this[rG]="meta"):(this[rX]=void 0,e.ignore=e.ignore||!this.filter(e.path,e),e.ignore?(this[r3]("ignoredEntry",e),this[rG]=e.remain?"ignore":"header",e.resume()):(e.remain?this[rG]="body":(this[rG]="header",e.end()),this[rW]?this[r0].push(e):(this[r0].push(e),this[rV]())))}else this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i})}else this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i})}[nl](){queueMicrotask(()=>this.emit("close"))}[rY](e){let t=!0;if(e)if(Array.isArray(e)){let[t,...i]=e;this.emit(t,...i)}else this[rW]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[rV]()),t=!1);else this[rW]=void 0,t=!1;return t}[rV](){do;while(this[rY](this[r0].shift()));if(!this[r0].length){let e=this[rW];!e||e.flowing||e.size===e.remain?this[nr]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[r4](e,t){let i=this[rZ];if(!i)throw Error("attempt to consume body without entry??");let r=i.blockRemain??0,n=r>=e.length&&0===t?e:e.subarray(t,t+r);return i.write(n),i.blockRemain||(this[rG]="header",this[rZ]=void 0,i.end()),n.length}[r9](e,t){let i=this[rZ],r=this[r4](e,t);return!this[rZ]&&i&&this[rJ](i),r}[r3](e,t,i){this[r0].length||this[rW]?this[r0].push([e,t,i]):this.emit(e,t,i)}[rJ](e){switch(this[r3]("meta",this[rq]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[rX]=rT.parse(this[rq],this[rX],!1);break;case"GlobalExtendedHeader":this[rK]=rT.parse(this[rq],this[rK],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let e=this[rX]??Object.create(null);this[rX]=e,e.path=this[rq].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let e=this[rX]||Object.create(null);this[rX]=e,e.linkpath=this[rq].replace(/\0.*/,"");break}default:throw Error("unknown meta: "+e.type)}}abort(e){this[nn]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,i){if("function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,"string"==typeof t?t:"utf8")),this[nn])return i?.(),!1;if((void 0===this[r8]||void 0===this.brotli&&!1===this[r8])&&e){if(this[rQ]&&(e=Buffer.concat([this[rQ],e]),this[rQ]=void 0),e.length<rH)return this[rQ]=e,i?.(),!0;for(let t=0;void 0===this[r8]&&t<rz.length;t++)e[t]!==rz[t]&&(this[r8]=!1);let t=!1;if(!1===this[r8]&&!1!==this.zstd){t=!0;for(let i=0;i<rU.length;i++)if(e[i]!==rU[i]){t=!1;break}}let r=void 0===this.brotli&&!t;if(!1===this[r8]&&r)if(e.length<512)if(!this[r1])return this[rQ]=e,i?.(),!0;else this.brotli=!0;else try{new rb(e.subarray(0,512)),this.brotli=!1}catch(e){this.brotli=!0}if(void 0===this[r8]||!1===this[r8]&&(this.brotli||t)){let r=this[r1];this[r1]=!1,this[r8]=void 0===this[r8]?new ru({}):t?new rD({}):new rh({}),this[r8].on("data",e=>this[r6](e)),this[r8].on("error",e=>this.abort(e)),this[r8].on("end",()=>{this[r1]=!0,this[r6]()}),this[nr]=!0;let n=!!this[r8][r?"end":"write"](e);return this[nr]=!1,i?.(),n}}this[nr]=!0,this[r8]?this[r8].write(e):this[r6](e),this[nr]=!1;let r=!this[r0].length&&(!this[rW]||this[rW].flowing);return r||this[r0].length||this[rW]?.once("drain",()=>this.emit("drain")),i?.(),r}[nt](e){e&&!this[nn]&&(this[rQ]=this[rQ]?Buffer.concat([this[rQ],e]):e)}[ni](){if(this[r1]&&!this[r2]&&!this[nn]&&!this[ne]){this[r2]=!0;let e=this[rZ];if(e&&e.blockRemain){let t=this[rQ]?this[rQ].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[rQ]&&e.write(this[rQ]),e.end()}this[r3](ns)}}[r6](e){if(this[ne]&&e)this[nt](e);else if(e||this[rQ]){if(e){if(this[ne]=!0,this[rQ]){this[nt](e);let t=this[rQ];this[rQ]=void 0,this[r5](t)}else this[r5](e);for(;this[rQ]&&this[rQ]?.length>=512&&!this[nn]&&!this[na];){let e=this[rQ];this[rQ]=void 0,this[r5](e)}this[ne]=!1}}else this[ni]();(!this[rQ]||this[r1])&&this[ni]()}[r5](e){let t=0,i=e.length;for(;t+512<=i&&!this[nn]&&!this[na];)switch(this[rG]){case"begin":case"header":this[r7](e,t),t+=512;break;case"ignore":case"body":t+=this[r4](e,t);break;case"meta":t+=this[r9](e,t);break;default:throw Error("invalid state: "+this[rG])}t<i&&(this[rQ]?this[rQ]=Buffer.concat([e.subarray(t),this[rQ]]):this[rQ]=e.subarray(t))}end(e,t,i){return"function"==typeof e&&(i=e,t=void 0,e=void 0),"function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,t)),i&&this.once("finish",i),this[nn]||(this[r8]?(e&&this[r8].write(e),this[r8].end()):(this[r1]=!0,(void 0===this.brotli||void 0===this.zstd)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[ni]())),this}}let nd=e=>{let t=e.length-1,i=-1;for(;t>-1&&"/"===e.charAt(t);)i=t,t--;return -1===i?e:e.slice(0,i)},nD=(e,t)=>{let i=new Map(t.map(e=>[nd(e),!0])),r=e.filter,n=(e,t="")=>{let r,s=t||(0,td.parse)(e).root||".";if(e===s)r=!1;else{let t=i.get(e);r=void 0!==t?t:n((0,td.dirname)(e),s)}return i.set(e,r),r};e.filter=r?(e,t)=>r(e,t)&&n(nd(e)):e=>n(nd(e))},nf=i3(t=>{let i,r=new nc(t),n=t.file;try{i=e.openSync(n,"r");let s=e.fstatSync(i),o=t.maxReadSize||0x1000000;if(s.size<o){let t=Buffer.allocUnsafe(s.size);e.readSync(i,t,0,s.size,0),r.end(t)}else{let t=0,n=Buffer.allocUnsafe(o);for(;t<s.size;){let s=e.readSync(i,n,0,o,t);t+=s,r.write(n.subarray(0,s))}r.end()}}finally{if("number"==typeof i)try{e.closeSync(i)}catch(e){}}},(t,i)=>{let r=new nc(t),n=t.maxReadSize||0x1000000,s=t.file;return new Promise((t,i)=>{r.on("error",i),r.on("end",t),e.stat(s,(e,t)=>{if(e)i(e);else{let e=new iK(s,{readSize:n,size:t.size});e.on("error",i),e.pipe(r)}})})},e=>new nc(e),e=>new nc(e),(e,t)=>{t?.length&&nD(e,t),e.noResume||(e=>{let t=e.onReadEntry;e.onReadEntry=t?e=>{t(e),e.resume()}:e=>e.resume()})(e)}),np=(e,t,i)=>(e&=4095,i&&(e=(384|e)&-19),t&&(256&e&&(e|=64),32&e&&(e|=8),4&e&&(e|=1)),e),{isAbsolute:nm,parse:ng}=p,nE=e=>{let t="",i=ng(e);for(;nm(e)||i.root;){let r="/"===e.charAt(0)&&"//?/"!==e.slice(0,4)?"/":i.root;e=e.slice(r.length),t+=r,i=ng(e)}return[t,e]},nb=["|","<",">","?",":"],ny=nb.map(e=>String.fromCharCode(61440+e.charCodeAt(0))),nF=new Map(nb.map((e,t)=>[e,ny[t]])),nC=new Map(ny.map((e,t)=>[e,nb[t]])),nv=e=>nb.reduce((e,t)=>e.split(t).join(nF.get(t)),e),nw=(e,t)=>t?(e=r$(e).replace(/^\.(\/|$)/,""),nd(t)+"/"+e):r$(e),n_=Symbol("process"),nS=Symbol("file"),nA=Symbol("directory"),nR=Symbol("symlink"),nO=Symbol("hardlink"),nB=Symbol("header"),nx=Symbol("read"),nN=Symbol("lstat"),nI=Symbol("onlstat"),nT=Symbol("onread"),nL=Symbol("onreadlink"),nk=Symbol("openfile"),nM=Symbol("onopenfile"),n$=Symbol("close"),nj=Symbol("mode"),nP=Symbol("awaitDrain"),nz=Symbol("ondrain"),nU=Symbol("prefix");class nH extends iy{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(e,t={}){let i=i2(t);super(),this.path=r$(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||0x1000000,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=r$(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?r$(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[e,t]=nE(this.path);e&&"string"==typeof t&&(this.path=t,r=e)}if(this.win32=!!i.win32||"win32"===process.platform,this.win32){let t;this.path=(t=this.path.replace(/\\/g,"/"),ny.reduce((e,t)=>e.split(t).join(nC.get(t)),t)),e=e.replace(/\\/g,"/")}this.absolute=r$(i.absolute||td.default.resolve(this.cwd,e)),""===this.path&&(this.path="./"),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path});let n=this.statCache.get(this.absolute);n?this[nI](n):this[nN]()}warn(e,t,i={}){return rP(this,e,t,i)}emit(e,...t){return"error"===e&&(this.#d=!0),super.emit(e,...t)}[nN](){tD.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[nI](t)})}[nI](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=nW(e),this.emit("stat",e),this[n_]()}[n_](){switch(this.type){case"File":return this[nS]();case"Directory":return this[nA]();case"SymbolicLink":return this[nR]();default:return this.end()}}[nj](e){return np(e,"Directory"===this.type,this.portable)}[nU](e){return nw(e,this.prefix)}[nB](){if(!this.stat)throw Error("cannot write header before stat");"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new rb({path:this[nU](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nU](this.linkpath):this.linkpath,mode:this[nj](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:"Unsupported"===this.type?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 rT({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[nU](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nU](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 e=this.header?.block;if(!e)throw Error("failed to encode header");super.write(e)}[nA](){if(!this.stat)throw Error("cannot create directory entry without stat");"/"!==this.path.slice(-1)&&(this.path+="/"),this.stat.size=0,this[nB](),this.end()}[nR](){tD.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[nL](t)})}[nL](e){this.linkpath=r$(e),this[nB](),this.end()}[nO](e){if(!this.stat)throw Error("cannot create link entry without stat");this.type="Link",this.linkpath=r$(td.default.relative(this.cwd,e)),this.stat.size=0,this[nB](),this.end()}[nS](){if(!this.stat)throw Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[nO](t);this.linkCache.set(e,this.absolute)}if(this[nB](),0===this.stat.size)return this.end();this[nk]()}[nk](){tD.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[nM](t)})}[nM](e){if(this.fd=e,this.#d)return this[n$]();if(!this.stat)throw Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[nx]()}[nx](){let{fd:e,buf:t,offset:i,length:r,pos:n}=this;if(void 0===e||void 0===t)throw Error("cannot read file without first opening");tD.default.read(e,t,i,r,n,(e,t)=>{if(e)return this[n$](()=>this.emit("error",e));this[nT](t)})}[n$](e=()=>{}){void 0!==this.fd&&tD.default.close(this.fd,e)}[nT](e){if(e<=0&&this.remain>0){let e=Object.assign(Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[n$](()=>this.emit("error",e))}if(e>this.remain){let e=Object.assign(Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[n$](()=>this.emit("error",e))}if(!this.buf)throw Error("should have created buffer prior to reading");if(e===this.remain)for(let t=e;t<this.length&&e<this.blockRemain;t++)this.buf[t+this.offset]=0,e++,this.remain++;let t=0===this.offset&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[nz]():this[nP](()=>this[nz]())}[nP](e){this.once("drain",e)}write(e,t,i){if("function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,"string"==typeof t?t:"utf8")),this.blockRemain<e.length){let e=Object.assign(Error("writing more data than expected"),{path:this.absolute});return this.emit("error",e)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,i)}[nz](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[n$](e=>e?this.emit("error",e):this.end());if(!this.buf)throw Error("buffer lost somehow in ONDRAIN");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[nx]()}}class nG extends nH{sync=!0;[nN](){this[nI](tD.default.lstatSync(this.absolute))}[nR](){this[nL](tD.default.readlinkSync(this.absolute))}[nk](){this[nM](tD.default.openSync(this.absolute,"r"))}[nx](){let e=!0;try{let{fd:t,buf:i,offset:r,length:n,pos:s}=this;if(void 0===t||void 0===i)throw Error("fd and buf must be set in READ method");let o=tD.default.readSync(t,i,r,n,s);this[nT](o),e=!1}finally{if(e)try{this[n$](()=>{})}catch(e){}}}[nP](e){e()}[n$](e=()=>{}){void 0!==this.fd&&tD.default.closeSync(this.fd),e()}}class nZ extends iy{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(e,t,i={}){return rP(this,e,t,i)}constructor(e,t={}){let i=i2(t);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:r}=e;if("Unsupported"===r)throw Error("writing entry that should be ignored");this.type=r,"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=r$(e.path),this.mode=void 0!==e.mode?this[nj](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=void 0!==e.linkpath?r$(e.linkpath):void 0,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[e,t]=nE(this.path);e&&"string"==typeof t&&(this.path=t,n=e)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new rb({path:this[nU](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nU](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}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new rT({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[nU](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nU](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 s=this.header?.block;if(!s)throw Error("failed to encode header");super.write(s),e.pipe(this)}[nU](e){return nw(e,this.prefix)}[nj](e){return np(e,"Directory"===this.type,this.portable)}write(e,t,i){"function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,"string"==typeof t?t:"utf8"));let r=e.length;if(r>this.blockRemain)throw Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e,i)}end(e,t,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),"function"==typeof e&&(i=e,t=void 0,e=void 0),"function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,t??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}}let nW=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported";class nV{tail;head;length=0;static create(e=[]){return new nV(e)}constructor(e=[]){for(let t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw Error("removing node which does not belong to this list");let t=e.next,i=e.prev;return t&&(t.prev=i),i&&(i.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let i=0,r=e.length;i<r;i++){var t;t=this,t.tail=new nY(e[i],t.tail,void 0,t),t.head||(t.head=t.tail),t.length++}return this.length}unshift(...e){for(var t,i=0,r=e.length;i<r;i++){t=this,t.head=new nY(e[i],void 0,t.head,t),t.tail||(t.tail=t.head),t.length++}return this.length}pop(){if(!this.tail)return;let e=this.tail.value,t=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,t.list=void 0,this.length--,e}shift(){if(!this.head)return;let e=this.head.value,t=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,t.list=void 0,this.length--,e}forEach(e,t){t=t||this;for(let i=this.head,r=0;i;r++)e.call(t,i.value,r,this),i=i.next}forEachReverse(e,t){t=t||this;for(let i=this.tail,r=this.length-1;i;r--)e.call(t,i.value,r,this),i=i.prev}get(e){let t=0,i=this.head;for(;i&&t<e;t++)i=i.next;if(t===e&&i)return i.value}getReverse(e){let t=0,i=this.tail;for(;i&&t<e;t++)i=i.prev;if(t===e&&i)return i.value}map(e,t){t=t||this;let i=new nV;for(let r=this.head;r;)i.push(e.call(t,r.value,this)),r=r.next;return i}mapReverse(e,t){t=t||this;var i=new nV;for(let r=this.tail;r;)i.push(e.call(t,r.value,this)),r=r.prev;return i}reduce(e,t){let i,r=this.head;if(arguments.length>1)i=t;else if(this.head)r=this.head.next,i=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var n=0;r;n++)i=e(i,r.value,n),r=r.next;return i}reduceReverse(e,t){let i,r=this.tail;if(arguments.length>1)i=t;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(let t=this.length-1;r;t--)i=e(i,r.value,t),r=r.prev;return i}toArray(){let e=Array(this.length);for(let t=0,i=this.head;i;t++)e[t]=i.value,i=i.next;return e}toArrayReverse(){let e=Array(this.length);for(let t=0,i=this.tail;i;t++)e[t]=i.value,i=i.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new nV;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.head,n=0;for(n=0;r&&n<e;n++)r=r.next;for(;r&&n<t;n++,r=r.next)i.push(r.value);return i}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new nV;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.length,n=this.tail;for(;n&&r>t;r--)n=n.prev;for(;n&&r>e;r--,n=n.prev)i.push(n.value);return i}splice(e,t=0,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let r=this.head;for(let t=0;r&&t<e;t++)r=r.next;let n=[];for(let e=0;r&&e<t;e++)n.push(r.value),r=this.removeNode(r);for(let e of(r?r!==this.tail&&(r=r.prev):r=this.tail,i))r=function(e,t,i){let r=t?t.next:e.head,n=new nY(i,t,r,e);return void 0===n.next&&(e.tail=n),void 0===n.prev&&(e.head=n),e.length++,n}(this,r,e);return n}reverse(){let e=this.head,t=this.tail;for(let t=e;t;t=t.prev){let e=t.prev;t.prev=t.next,t.next=e}return this.head=t,this.tail=e,this}}class nY{list;next;prev;value;constructor(e,t,i,r){this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}}class nX{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}}let nK=Buffer.alloc(1024),nq=Symbol("onStat"),nJ=Symbol("ended"),nQ=Symbol("queue"),n0=Symbol("current"),n1=Symbol("process"),n2=Symbol("processing"),n3=Symbol("processJob"),n8=Symbol("jobs"),n6=Symbol("jobDone"),n5=Symbol("addFSEntry"),n4=Symbol("addTarEntry"),n9=Symbol("stat"),n7=Symbol("readdir"),se=Symbol("onreaddir"),st=Symbol("pipe"),si=Symbol("entry"),sr=Symbol("entryOpt"),sn=Symbol("writeEntryClass"),ss=Symbol("write"),so=Symbol("ondrain");class su extends iy{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[sn];onWriteEntry;[nQ];[n8]=0;[n2]=!1;[nJ]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=r$(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[sn]=nH,"function"==typeof e.onwarn&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if(+!!e.gzip+ +!!e.brotli+ +!!e.zstd>1)throw TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&("object"!=typeof e.gzip&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new ro(e.gzip)),e.brotli&&("object"!=typeof e.brotli&&(e.brotli={}),this.zip=new rl(e.brotli)),e.zstd&&("object"!=typeof e.zstd&&(e.zstd={}),this.zip=new rd(e.zstd)),!this.zip)throw Error("impossible");let t=this.zip;t.on("data",e=>super.write(e)),t.on("end",()=>super.end()),t.on("drain",()=>this[so]()),this.on("resume",()=>t.resume())}else this.on("drain",this[so]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter="function"==typeof e.filter?e.filter:()=>!0,this[nQ]=new nV,this[n8]=0,this.jobs=Number(e.jobs)||4,this[n2]=!1,this[nJ]=!1}[ss](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,i){return"function"==typeof e&&(i=e,e=void 0),"function"==typeof t&&(i=t,t=void 0),e&&this.add(e),this[nJ]=!0,this[n1](),i&&i(),this}write(e){if(this[nJ])throw Error("write after end");return e instanceof rj?this[n4](e):this[n5](e),this.flowing}[n4](e){let t=r$(td.default.resolve(this.cwd,e.path));if(this.filter(e.path,e)){let i=new nX(e.path,t);i.entry=new nZ(e,this[sr](i)),i.entry.on("end",()=>this[n6](i)),this[n8]+=1,this[nQ].push(i)}else e.resume();this[n1]()}[n5](e){let t=r$(td.default.resolve(this.cwd,e));this[nQ].push(new nX(e,t)),this[n1]()}[n9](e){e.pending=!0,this[n8]+=1;let t=this.follow?"stat":"lstat";tD.default[t](e.absolute,(t,i)=>{e.pending=!1,this[n8]-=1,t?this.emit("error",t):this[nq](e,i)})}[nq](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[n1]()}[n7](e){e.pending=!0,this[n8]+=1,tD.default.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[n8]-=1,t)return this.emit("error",t);this[se](e,i)})}[se](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[n1]()}[n1](){if(!this[n2]){this[n2]=!0;for(let e=this[nQ].head;e&&this[n8]<this.jobs;e=e.next)if(this[n3](e.value),e.value.ignore){let t=e.next;this[nQ].removeNode(e),e.next=t}this[n2]=!1,this[nJ]&&!this[nQ].length&&0===this[n8]&&(this.zip?this.zip.end(nK):(super.write(nK),super.end()))}}get[n0](){return this[nQ]&&this[nQ].head&&this[nQ].head.value}[n6](e){this[nQ].shift(),this[n8]-=1,this[n1]()}[n3](e){if(!e.pending){if(e.entry){e!==this[n0]||e.piped||this[st](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[nq](e,t):this[n9](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[se](e,t):this[n7](e),!e.readdir)return}if(e.entry=this[si](e),!e.entry){e.ignore=!0;return}e!==this[n0]||e.piped||this[st](e)}}}[sr](e){return{onwarn:(e,t,i)=>this.warn(e,t,i),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[si](e){this[n8]+=1;try{return new this[sn](e.path,this[sr](e)).on("end",()=>this[n6](e)).on("error",e=>this.emit("error",e))}catch(e){this.emit("error",e)}}[so](){this[n0]&&this[n0].entry&&this[n0].entry.resume()}[st](e){e.piped=!0,e.readdir&&e.readdir.forEach(t=>{let i=e.path,r="./"===i?"":i.replace(/\/*$/,"/");this[n5](r+t)});let t=e.entry,i=this.zip;if(!t)throw Error("cannot pipe without source");i?t.on("data",e=>{i.write(e)||t.pause()}):t.on("data",e=>{super.write(e)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,i={}){rP(this,e,t,i)}}class sa extends su{sync=!0;constructor(e){super(e),this[sn]=nG}pause(){}resume(){}[n9](e){let t=this.follow?"statSync":"lstatSync";this[nq](e,tD.default[t](e.absolute))}[n7](e){this[se](e,tD.default.readdirSync(e.absolute))}[st](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(t=>{let i=e.path,r="./"===i?"":i.replace(/\/*$/,"/");this[n5](r+t)}),!t)throw Error("Cannot pipe without source");i?t.on("data",e=>{i.write(e)}):t.on("data",e=>{super[ss](e)})}}let sl=(e,t)=>{t.forEach(t=>{"@"===t.charAt(0)?nf({file:u.resolve(e.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:t=>e.add(t)}):e.add(t)}),e.end()},sh=async(e,t)=>{for(let i=0;i<t.length;i++){let r=String(t[i]);"@"===r.charAt(0)?await nf({file:u.resolve(String(e.cwd),r.slice(1)),noResume:!0,onReadEntry:t=>{e.add(t)}}):e.add(r)}e.end()};i3((e,t)=>{let i=new sa(e),r=new iQ(e.file,{mode:e.mode||438});i.pipe(r),sl(i,t)},(e,t)=>{let i=new su(e),r=new iJ(e.file,{mode:e.mode||438});i.pipe(r);let n=new Promise((e,t)=>{r.on("error",t),r.on("close",e),i.on("error",t)});return sh(i,t),n},(e,t)=>{let i=new sa(e);return sl(i,t),i},(e,t)=>{let i=new su(e);return sh(i,t),i},(e,t)=>{if(!t?.length)throw TypeError("no paths specified to add to archive")});let sc=process.env.__FAKE_PLATFORM__||process.platform,{O_CREAT:sd,O_TRUNC:sD,O_WRONLY:sf}=tD.default.constants,sp=Number(process.env.__FAKE_FS_O_FILENAME__)||tD.default.constants.UV_FS_O_FILEMAP||0,sm=sp|sD|sd|sf,sg="win32"===sc&&sp?e=>e<524288?sm:"w":()=>"w",sE=(t,i,r)=>{try{return e.lchownSync(t,i,r)}catch(e){if(e?.code!=="ENOENT")throw e}},sb=(t,i,r,n)=>{e.lchown(t,i,r,e=>{n(e&&e?.code!=="ENOENT"?e:null)})},sy=(e,t,i,r,n)=>{t.isDirectory()?sF(u.resolve(e,t.name),i,r,s=>{if(s)return n(s);sb(u.resolve(e,t.name),i,r,n)}):sb(u.resolve(e,t.name),i,r,n)},sF=(t,i,r,n)=>{e.readdir(t,{withFileTypes:!0},(e,s)=>{if(e){if("ENOENT"===e.code)return n();else if("ENOTDIR"!==e.code&&"ENOTSUP"!==e.code)return n(e)}if(e||!s.length)return sb(t,i,r,n);let o=s.length,u=null,a=e=>{if(!u){if(e)return n(u=e);if(0==--o)return sb(t,i,r,n)}};for(let e of s)sy(t,e,i,r,a)})},sC=(e,t,i,r)=>{t.isDirectory()&&sv(u.resolve(e,t.name),i,r),sE(u.resolve(e,t.name),i,r)},sv=(t,i,r)=>{let n;try{n=e.readdirSync(t,{withFileTypes:!0})}catch(e){if(e?.code==="ENOENT")return;if(e?.code==="ENOTDIR"||e?.code==="ENOTSUP")return sE(t,i,r);throw e}for(let e of n)sC(t,e,i,r);return sE(t,i,r)};class sw extends Error{path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}}class s_ extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}}let sS=(t,i,r,n,s,o,a)=>{if(!i.length)return a(null,o);let l=i.shift(),h=r$(u.resolve(t+"/"+l));e.mkdir(h,r,sA(h,i,r,n,s,o,a))},sA=(t,i,r,n,s,o,u)=>a=>{a?e.lstat(t,(l,h)=>{if(l)l.path=l.path&&r$(l.path),u(l);else if(h.isDirectory())sS(t,i,r,n,s,o,u);else if(n)e.unlink(t,a=>{if(a)return u(a);e.mkdir(t,r,sA(t,i,r,n,s,o,u))});else{if(h.isSymbolicLink())return u(new s_(t,t+"/"+i.join("/")));u(a)}}):(o=o||t,sS(t,i,r,n,s,o,u))},sR=Object.create(null),sO=new Set,sB="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform);class sx{#D=new Map;#f=new Map;#p=new Set;reserve(e,t){let i=new Set((e=sB?["win32 parallelization disabled"]:e.map(e=>nd(d((e=>{sO.has(e)?sO.delete(e):sR[e]=e.normalize("NFD"),sO.add(e);let t=sR[e],i=sO.size-1e4;if(i>1e3){for(let e of sO)if(sO.delete(e),delete sR[e],--i<=0)break}return t})(e))).toLowerCase())).map(e=>e.split("/").slice(0,-1).reduce((e,t)=>{let i=e[e.length-1];return void 0!==i&&(t=d(i,t)),e.push(t||"/"),e},[])).reduce((e,t)=>e.concat(t)));for(let r of(this.#f.set(t,{dirs:i,paths:e}),e)){let e=this.#D.get(r);e?e.push(t):this.#D.set(r,[t])}for(let e of i){let i=this.#D.get(e);if(i){let e=i[i.length-1];e instanceof Set?e.add(t):i.push(new Set([t]))}else this.#D.set(e,[new Set([t])])}return this.#m(t)}#g(e){let t=this.#f.get(e);if(!t)throw Error("function does not have any path reservations");return{paths:t.paths.map(e=>this.#D.get(e)),dirs:[...t.dirs].map(e=>this.#D.get(e))}}check(e){let{paths:t,dirs:i}=this.#g(e);return t.every(t=>t&&t[0]===e)&&i.every(t=>t&&t[0]instanceof Set&&t[0].has(e))}#m(e){return!this.#p.has(e)&&!!this.check(e)&&(this.#p.add(e),e(()=>this.#E(e)),!0)}#E(e){if(!this.#p.has(e))return!1;let t=this.#f.get(e);if(!t)throw Error("invalid reservation");let{paths:i,dirs:r}=t,n=new Set;for(let t of i){let i=this.#D.get(t);if(!i||i?.[0]!==e)continue;let r=i[1];if(!r){this.#D.delete(t);continue}if(i.shift(),"function"==typeof r)n.add(r);else for(let e of r)n.add(e)}for(let t of r){let i=this.#D.get(t),r=i?.[0];if(i&&r instanceof Set)if(1===r.size&&1===i.length){this.#D.delete(t);continue}else if(1===r.size){i.shift();let e=i[0];"function"==typeof e&&n.add(e)}else r.delete(e)}return this.#p.delete(e),n.forEach(e=>this.#m(e)),!0}}let sN=Symbol("onEntry"),sI=Symbol("checkFs"),sT=Symbol("checkFs2"),sL=Symbol("isReusable"),sk=Symbol("makeFs"),sM=Symbol("file"),s$=Symbol("directory"),sj=Symbol("link"),sP=Symbol("symlink"),sz=Symbol("hardlink"),sU=Symbol("unsupported"),sH=Symbol("checkPath"),sG=Symbol("mkdir"),sZ=Symbol("onError"),sW=Symbol("pending"),sV=Symbol("pend"),sY=Symbol("unpend"),sX=Symbol("ended"),sK=Symbol("maybeClose"),sq=Symbol("skip"),sJ=Symbol("doChown"),sQ=Symbol("uid"),s0=Symbol("gid"),s1=Symbol("checkedCwd"),s2="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform),s3=(e,t,i)=>void 0!==e&&e===e>>>0?e:void 0!==t&&t===t>>>0?t:i;class s8 extends nc{[sX]=!1;[s1]=!1;[sW]=0;reservations=new sx;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(e={}){if(e.ondone=()=>{this[sX]=!0,this[sK]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,"number"==typeof e.uid||"number"==typeof e.gid){if("number"!=typeof e.uid||"number"!=typeof e.gid)throw TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;void 0===e.preserveOwner&&"number"!=typeof e.uid?this.preserveOwner=!!(process.getuid&&0===process.getuid()):this.preserveOwner=!!e.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="number"==typeof e.maxDepth?e.maxDepth:1024,this.forceChown=!0===e.forceChown,this.win32=!!e.win32||s2,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=r$(u.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?"number"==typeof e.processUmask?e.processUmask:process.umask():0,this.umask="number"==typeof e.umask?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",e=>this[sN](e))}warn(e,t,i={}){return("TAR_BAD_ARCHIVE"===e||"TAR_ABORT"===e)&&(i.recoverable=!1),super.warn(e,t,i)}[sK](){this[sX]&&0===this[sW]&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[sH](e){let t=r$(e.path),i=t.split("/");if(this.strip){if(i.length<this.strip)return!1;if("Link"===e.type){let t=r$(String(e.linkpath)).split("/");if(!(t.length>=this.strip))return!1;e.linkpath=t.slice(this.strip).join("/")}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(i.includes("..")||s2&&/^[a-z]:\.\.$/i.test(i[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[r,n]=nE(t);r&&(e.path=String(n),this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:e,path:t}))}if(u.isAbsolute(e.path)?e.absolute=r$(u.resolve(e.path)):e.absolute=r$(u.resolve(this.cwd,e.path)),!this.preservePaths&&"string"==typeof e.absolute&&0!==e.absolute.indexOf(this.cwd+"/")&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:r$(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&"Directory"!==e.type&&"GNUDumpDir"!==e.type)return!1;if(this.win32){let{root:t}=u.win32.parse(String(e.absolute));e.absolute=t+nv(String(e.absolute).slice(t.length));let{root:i}=u.win32.parse(e.path);e.path=i+nv(e.path.slice(i.length))}return!0}[sN](e){if(!this[sH](e))return e.resume();switch(z.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=448|e.mode);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[sI](e);default:return this[sU](e)}}[sZ](e,t){"CwdError"===e.name?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[sY](),t.resume())}[sG](t,i,r){((t,i,r)=>{t=r$(t);let n=i.umask??18,s=448|i.mode,o=(s&n)!=0,a=i.uid,l=i.gid,h="number"==typeof a&&"number"==typeof l&&(a!==i.processUid||l!==i.processGid),c=i.preserve,d=i.unlink,D=r$(i.cwd),f=(i,n)=>{i?r(i):n&&h?sF(n,a,l,e=>f(e)):o?e.chmod(t,s,r):r()};if(t===D){var p;return p=t,e.stat(p,(e,t)=>{(e||!t.isDirectory())&&(e=new sw(p,e?.code||"ENOTDIR")),f(e)})}if(c)return R.mkdir(t,{mode:s,recursive:!0}).then(e=>f(null,e??void 0),f);let m=r$(u.relative(D,t)).split("/");sS(D,m,s,d,D,void 0,f)})(r$(t),{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:i},r)}[sJ](e){return this.forceChown||this.preserveOwner&&("number"==typeof e.uid&&e.uid!==this.processUid||"number"==typeof e.gid&&e.gid!==this.processGid)||"number"==typeof this.uid&&this.uid!==this.processUid||"number"==typeof this.gid&&this.gid!==this.processGid}[sQ](e){return s3(this.uid,e.uid,this.processUid)}[s0](e){return s3(this.gid,e.gid,this.processGid)}[sM](t,i){let r="number"==typeof t.mode?4095&t.mode:this.fmode,n=new iJ(String(t.absolute),{flags:sg(t.size),mode:r,autoClose:!1});n.on("error",r=>{n.fd&&e.close(n.fd,()=>{}),n.write=()=>!0,this[sZ](r,t),i()});let s=1,o=r=>{if(r){n.fd&&e.close(n.fd,()=>{}),this[sZ](r,t),i();return}0==--s&&void 0!==n.fd&&e.close(n.fd,e=>{e?this[sZ](e,t):this[sY](),i()})};n.on("finish",()=>{let i=String(t.absolute),r=n.fd;if("number"==typeof r&&t.mtime&&!this.noMtime){s++;let n=t.atime||new Date,u=t.mtime;e.futimes(r,n,u,t=>t?e.utimes(i,n,u,e=>o(e&&t)):o())}if("number"==typeof r&&this[sJ](t)){s++;let n=this[sQ](t),u=this[s0](t);"number"==typeof n&&"number"==typeof u&&e.fchown(r,n,u,t=>t?e.chown(i,n,u,e=>o(e&&t)):o())}o()});let u=this.transform&&this.transform(t)||t;u!==t&&(u.on("error",e=>{this[sZ](e,t),i()}),t.pipe(u)),u.pipe(n)}[s$](t,i){let r="number"==typeof t.mode?4095&t.mode:this.dmode;this[sG](String(t.absolute),r,r=>{if(r){this[sZ](r,t),i();return}let n=1,s=()=>{0==--n&&(i(),this[sY](),t.resume())};t.mtime&&!this.noMtime&&(n++,e.utimes(String(t.absolute),t.atime||new Date,t.mtime,s)),this[sJ](t)&&(n++,e.chown(String(t.absolute),Number(this[sQ](t)),Number(this[s0](t)),s)),s()})}[sU](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[sP](e,t){this[sj](e,String(e.linkpath),"symlink",t)}[sz](e,t){let i=r$(u.resolve(this.cwd,String(e.linkpath)));this[sj](e,i,"link",t)}[sV](){this[sW]++}[sY](){this[sW]--,this[sK]()}[sq](e){this[sY](),e.resume()}[sL](e,t){return"File"===e.type&&!this.unlink&&t.isFile()&&t.nlink<=1&&!s2}[sI](e){this[sV]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,t=>this[sT](e,t))}[sT](t,i){let r=e=>{i(e)},n=()=>{this[sG](this.cwd,this.dmode,e=>{if(e){this[sZ](e,t),r();return}this[s1]=!0,s()})},s=()=>{if(t.absolute!==this.cwd){let e=r$(u.dirname(String(t.absolute)));if(e!==this.cwd)return this[sG](e,this.dmode,e=>{if(e){this[sZ](e,t),r();return}o()})}o()},o=()=>{e.lstat(String(t.absolute),(i,n)=>{if(n&&(this.keep||this.newer&&n.mtime>(t.mtime??n.mtime))){this[sq](t),r();return}if(i||this[sL](t,n))return this[sk](null,t,r);if(n.isDirectory()){if("Directory"===t.type){let i=this.chmod&&t.mode&&(4095&n.mode)!==t.mode,s=e=>this[sk](e??null,t,r);return i?e.chmod(String(t.absolute),Number(t.mode),s):s()}if(t.absolute!==this.cwd)return e.rmdir(String(t.absolute),e=>this[sk](e??null,t,r))}if(t.absolute===this.cwd)return this[sk](null,t,r);((t,i)=>{if(!s2)return e.unlink(t,i);let r=t+".DELETE."+U(16).toString("hex");e.rename(t,r,t=>{if(t)return i(t);e.unlink(r,i)})})(String(t.absolute),e=>this[sk](e??null,t,r))})};this[s1]?s():n()}[sk](e,t,i){if(e){this[sZ](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[sM](t,i);case"Link":return this[sz](t,i);case"SymbolicLink":return this[sP](t,i);case"Directory":case"GNUDumpDir":return this[s$](t,i)}}[sj](t,i,r,n){e[r](i,String(t.absolute),e=>{e?this[sZ](e,t):(this[sY](),t.resume()),n()})}}let s6=e=>{try{return[null,e()]}catch(e){return[e,null]}};class s5 extends s8{sync=!0;[sk](e,t){return super[sk](e,t,()=>{})}[sI](t){if(!this[s1]){let e=this[sG](this.cwd,this.dmode);if(e)return this[sZ](e,t);this[s1]=!0}if(t.absolute!==this.cwd){let e=r$(u.dirname(String(t.absolute)));if(e!==this.cwd){let i=this[sG](e,this.dmode);if(i)return this[sZ](i,t)}}let[i,r]=s6(()=>e.lstatSync(String(t.absolute)));if(r&&(this.keep||this.newer&&r.mtime>(t.mtime??r.mtime)))return this[sq](t);if(i||this[sL](t,r))return this[sk](null,t);if(r.isDirectory()){if("Directory"===t.type){let[i]=this.chmod&&t.mode&&(4095&r.mode)!==t.mode?s6(()=>{e.chmodSync(String(t.absolute),Number(t.mode))}):[];return this[sk](i,t)}let[i]=s6(()=>e.rmdirSync(String(t.absolute)));this[sk](i,t)}let[n]=t.absolute===this.cwd?[]:s6(()=>(t=>{if(!s2)return e.unlinkSync(t);let i=t+".DELETE."+U(16).toString("hex");e.renameSync(t,i),e.unlinkSync(i)})(String(t.absolute)));this[sk](n,t)}[sM](t,i){let r,n="number"==typeof t.mode?4095&t.mode:this.fmode,s=n=>{let s;try{e.closeSync(r)}catch(e){s=e}(n||s)&&this[sZ](n||s,t),i()};try{r=e.openSync(String(t.absolute),sg(t.size),n)}catch(e){return s(e)}let o=this.transform&&this.transform(t)||t;o!==t&&(o.on("error",e=>this[sZ](e,t)),t.pipe(o)),o.on("data",t=>{try{e.writeSync(r,t,0,t.length)}catch(e){s(e)}}),o.on("end",()=>{let i=null;if(t.mtime&&!this.noMtime){let n=t.atime||new Date,s=t.mtime;try{e.futimesSync(r,n,s)}catch(r){try{e.utimesSync(String(t.absolute),n,s)}catch(e){i=r}}}if(this[sJ](t)){let n=this[sQ](t),s=this[s0](t);try{e.fchownSync(r,Number(n),Number(s))}catch(r){try{e.chownSync(String(t.absolute),Number(n),Number(s))}catch(e){i=i||r}}}s(i)})}[s$](t,i){let r="number"==typeof t.mode?4095&t.mode:this.dmode,n=this[sG](String(t.absolute),r);if(n){this[sZ](n,t),i();return}if(t.mtime&&!this.noMtime)try{e.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch(e){}if(this[sJ](t))try{e.chownSync(String(t.absolute),Number(this[sQ](t)),Number(this[s0](t)))}catch(e){}i(),t.resume()}[sG](t,i){try{return((t,i)=>{let r;t=r$(t);let n=i.umask??18,s=448|i.mode,o=(s&n)!=0,a=i.uid,l=i.gid,h="number"==typeof a&&"number"==typeof l&&(a!==i.processUid||l!==i.processGid),c=i.preserve,d=i.unlink,D=r$(i.cwd),f=i=>{i&&h&&sv(i,a,l),o&&e.chmodSync(t,s)};if(t===D){let t,i=!1;try{i=e.statSync(D).isDirectory()}catch(e){t=e?.code}finally{if(!i)throw new sw(D,t??"ENOTDIR")}return f()}if(c)return f(e.mkdirSync(t,{mode:s,recursive:!0})??void 0);let p=r$(u.relative(D,t)).split("/");for(let t=p.shift(),i=D;t&&(i+="/"+t);t=p.shift()){i=r$(u.resolve(i));try{e.mkdirSync(i,s),r=r||i}catch(n){let t=e.lstatSync(i);if(t.isDirectory())continue;if(d){e.unlinkSync(i),e.mkdirSync(i,s),r=r||i;continue}if(t.isSymbolicLink())return new s_(i,i+"/"+p.join("/"))}}return f(r)})(r$(t),{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:i})}catch(e){return e}}[sj](t,i,r,n){let s=`${r}Sync`;try{e[s](i,String(t.absolute)),n(),t.resume()}catch(e){return this[sZ](e,t)}}}let s4=i3(t=>{let i=new s5(t),r=t.file,n=e.statSync(r);new iq(r,{readSize:t.maxReadSize||0x1000000,size:n.size}).pipe(i)},(t,i)=>{let r=new s8(t),n=t.maxReadSize||0x1000000,s=t.file;return new Promise((t,i)=>{r.on("error",i),r.on("close",t),e.stat(s,(e,t)=>{if(e)i(e);else{let e=new iK(s,{readSize:n,size:t.size});e.on("error",i),e.pipe(r)}})})},e=>new s5(e),e=>new s8(e),(e,t)=>{t?.length&&nD(e,t)}),s9=(e,t)=>{t.forEach(t=>{"@"===t.charAt(0)?nf({file:u.resolve(e.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:t=>e.add(t)}):e.add(t)}),e.end()},s7=async(e,t)=>{for(let i=0;i<t.length;i++){let r=String(t[i]);"@"===r.charAt(0)?await nf({file:u.resolve(String(e.cwd),r.slice(1)),noResume:!0,onReadEntry:t=>e.add(t)}):e.add(r)}e.end()},oe=i3((t,i)=>{let r,n,s=new sa(t),o=!0;try{try{r=e.openSync(t.file,"r+")}catch(i){if(i?.code==="ENOENT")r=e.openSync(t.file,"w+");else throw i}let u=e.fstatSync(r),a=Buffer.alloc(512);e:for(n=0;n<u.size;n+=512){for(let t=0,i=0;t<512;t+=i){if(i=e.readSync(r,a,t,a.length-t,n+t),0===n&&31===a[0]&&139===a[1])throw Error("cannot append to compressed archives");if(!i)break e}let i=new rb(a);if(!i.cksumValid)break;let s=512*Math.ceil((i.size||0)/512);if(n+s+512>u.size)break;n+=s,t.mtimeCache&&i.mtime&&t.mtimeCache.set(String(i.path),i.mtime)}o=!1,((e,t,i,r,n)=>{let s=new iQ(e.file,{fd:r,start:i});t.pipe(s),s9(t,n)})(t,s,n,r,i)}finally{if(o)try{e.closeSync(r)}catch(e){}}},(t,i)=>{i=Array.from(i);let r=new su(t);return new Promise((n,s)=>{r.on("error",s);let o="r+",u=(a,l)=>a&&"ENOENT"===a.code&&"r+"===o?(o="w+",e.open(t.file,o,u)):a||!l?s(a):void e.fstat(l,(o,u)=>{if(o)return e.close(l,()=>s(o));((i,r,n)=>{let s=(t,r)=>{t?e.close(i,e=>n(t)):n(null,r)},o=0;if(0===r)return s(null,0);let u=0,a=Buffer.alloc(512),l=(n,h)=>{if(n||void 0===h)return s(n);if((u+=h)<512&&h)return e.read(i,a,u,a.length-u,o+u,l);if(0===o&&31===a[0]&&139===a[1])return s(Error("cannot append to compressed archives"));if(u<512)return s(null,o);let c=new rb(a);if(!c.cksumValid)return s(null,o);let d=512*Math.ceil((c.size??0)/512);if(o+d+512>r||(o+=d+512)>=r)return s(null,o);t.mtimeCache&&c.mtime&&t.mtimeCache.set(String(c.path),c.mtime),u=0,e.read(i,a,0,512,o,l)};e.read(i,a,0,512,o,l)})(l,u.size,(e,o)=>{if(e)return s(e);let u=new iJ(t.file,{fd:l,start:o});r.pipe(u),u.on("error",s),u.on("close",n),s7(r,i)})});e.open(t.file,o,u)})},()=>{throw TypeError("file is required")},()=>{throw TypeError("file is required")},(e,t)=>{if(!e.file)throw TypeError("file is required");if(e.gzip||e.brotli||e.zstd||e.file.endsWith(".br")||e.file.endsWith(".tbr"))throw TypeError("cannot append to compressed archives");if(!t?.length)throw TypeError("no paths specified to add/replace")});i3(oe.syncFile,oe.asyncFile,oe.syncNoFile,oe.asyncNoFile,(e,t=[])=>{oe.validate?.(e,t),ot(e)});let ot=e=>{let t=e.filter;e.mtimeCache||(e.mtimeCache=new Map),e.filter=t?(i,r)=>t(i,r)&&!((e.mtimeCache?.get(i)??r.mtime??0)>(r.mtime??0)):(t,i)=>!((e.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0))};async function oi(e,t){if(!await on())return void te.info("Git client not found, skipping git initialization");if(await os(e))return void te.debug("Git repo already initialized, skipping git initialization");let i=tl();i.start("Initializing git repo");let r=`Initial commit
62
+ `)})(e??"Operation cancelled by user."),process.exit(0)}Y("crypto");var td=Y("path"),tD=Y("fs");let tf=(e,t)=>e.at(-1)===t?e:tf([...e,t],u.resolve(t,"..")),tp=async(e,t,i)=>await tm(e,i)?[tC(e),t.map(e=>tF(e)),{...i,shell:!0}]:[e,t,i],tm=async(e,{shell:t,cwd:i,env:r=g.env})=>"win32"===g.platform&&!t&&!await tE(e,i,r),tE=async(e,t,{Path:i="",PATH:r=i})=>ty.some(t=>e.toLowerCase().endsWith(t))||(tg[`${e}\0${t}\0${r}`]??=await tb(e,t,r)),tg={},tb=async(e,t,i)=>{let r=i.split(u.delimiter).filter(Boolean).map(e=>e.replace(/^"(.*)"$/,"$1"));try{await Promise.all(ty.flatMap(i=>[t,...r].map(t=>`${u.resolve(t,e)}${i}`)).map(async e=>{try{await O(e)}catch{return}throw 0}))}catch{return!0}return!1},ty=[".exe",".com"],tF=e=>tC(tC(`"${e.replaceAll(/(\\*)"/g,'$1$1\\"').replace(/(\\*)$/,"$1$1")}"`)),tC=e=>e.replaceAll(/([()\][%!^"`<>&|;, *?])/g,"^$1"),tv=async(e,{input:t},i)=>{let r=await e;void 0!==t&&r.stdin.end(t);let n=T(r,"close");try{return await Promise.race([n,...r.stdio.filter(Boolean).map(e=>tw(e))]),t_(i,tO(r)),tB(i)}catch(e){throw await Promise.allSettled([n]),tS(e,r,i)}},tw=async e=>{for await(let[t]of I(e,"error"))if(!["ERR_STREAM_PREMATURE_CLOSE","EPIPE"].includes(t?.code))throw t},t_=({command:e},{exitCode:t,signalName:i})=>{if(void 0!==i)throw new tR(`Command was terminated with ${i}: ${e}`);if(void 0!==t)throw new tR(`Command failed with exit code ${t}: ${e}`)},tS=(e,t,i)=>Object.assign(tA(e,i),tO(t),tB(i)),tA=(e,{command:t})=>e instanceof tR?e:new tR(`Command failed: ${t}`,{cause:e});class tR extends Error{name="SubprocessError"}let tO=({exitCode:e,signalCode:t})=>({...e<1?{}:{exitCode:e},...null===t?{}:{signalName:t}}),tB=({state:{stdout:e,stderr:t,output:i},command:r,start:n})=>({stdout:tx(e),stderr:tx(t),output:tx(i),command:r,durationMs:Number(g.hrtime.bigint()-n)/1e6}),tx=e=>"\n"===e.at(-1)?e.slice(0,"\r"===e.at(-2)?-2:-1):e,tN=async(e,t,i,r)=>{try{[e,t]=["node","node.exe"].includes(e.toLowerCase())?[g.execPath,[...g.execArgv.filter(e=>!e.startsWith("--inspect")),...t]]:[e,t],[e,t,i]=await tp(e,t,i),[e,t,i]=tI(e,t,i);let n=x(e,t,i);return tT(n.stdout,r,"stdout"),tT(n.stderr,r,"stderr"),n.once("error",()=>{}),await T(n,"spawn"),n}catch(e){throw tS(e,{},r)}},tI=(e,t,i)=>i.shell&&t.length>0?[[e,...t].join(" "),[],i]:[e,t,i],tT=(e,{state:t},i)=>{e&&(e.setEncoding("utf8"),t.isIterating||(t.isIterating=!1,e.on("data",e=>{t[i]+=e,t.output+=e})))},tL=async e=>{let[[t,i]]=await Promise.all([Promise.allSettled(e),tk(e)]);if(i.reason)throw i.reason.pipedFrom=t.reason??t.value,i.reason;if(t.reason)throw t.reason;return{...i.value,pipedFrom:t.value}},tk=async e=>{try{let[{stdout:t},{stdin:i}]=await Promise.all(e.map(({nodeChildProcess:e})=>e));if(null===i)throw Error('The "stdin" option must be set on the first "spawn()" call in the pipeline.');if(null===t)throw Error('The "stdout" option must be set on the last "spawn()" call in the pipeline.');L(t,i).catch(()=>{})}catch(t){throw await Promise.allSettled(e.map(({nodeChildProcess:e})=>tM(e))),t}},tM=async e=>{let{stdin:t}=await e;t.end()},t$=async function*(e,{state:t},i){if(!1===t.isIterating)throw Error(`The subprocess must be iterated right away, for example:
63
+ for await (const line of spawn(...)) { ... }`);t.isIterating=!0;try{let{[i]:t}=await e.nodeChildProcess;if(!t)return;let r="";for await(let e of t.iterator({destroyOnReturn:!1})){let t=`${r}${e}`.split(/\r?\n/);r=t.pop(),yield*t}r&&(yield r)}finally{await e}},tj=async function*(...e){try{let t=[];for(;e.length>0;){t=e.map((e,i)=>t[i]??tP(e));let[{value:i,done:r},n]=await Promise.race(t.map((e,t)=>Promise.all([e,t]))),[s]=e.splice(n,1);t.splice(n,1),r||(e.push(s),yield i)}}finally{await Promise.all(e.map(e=>e.return()))}},tP=async e=>{try{return await e.next()}catch(t){await e.throw(t)}};function tz(e,t,i){let r=te.isVerbose()?"inherit":"pipe";te.debug(`Running: ${e}`,...t??[]);let n=function e(t,i,r,n){let s,[o=[],a={}]=Array.isArray(i)?[i,r]:[[],i],l=(s=[t,...o],{start:g.hrtime.bigint(),command:s.map(e=>{let t;return t=E(e),/[^\w./-]/.test(t)?`'${t.replaceAll("'","'\\''")}'`:t}).join(" "),state:{stdout:"",stderr:"",output:""}}),h=(({stdin:e,stdout:t,stderr:i,stdio:r=[e,t,i],env:n,preferLocal:s,cwd:o=".",...a})=>{let l=o instanceof URL?B(o):u.resolve(o),h=n?{...g.env,...n}:void 0,c=r[0]?.string;return{...a,input:c,stdio:void 0===c?r:["pipe",...r.slice(1)],env:s?(({Path:e="",PATH:t=e,...i},r)=>{let n=t.split(u.delimiter),s=tf([],u.resolve(r)).map(e=>u.join(e,"node_modules/.bin")).filter(e=>!n.includes(e));return{...i,PATH:[...s,t].filter(Boolean).join(u.delimiter)}})(h??g.env,l):h,cwd:l}})(a),c=tN(t,o,h,l),d=tv(c,h,l);Object.assign(d,{nodeChildProcess:c});let D=t$(d=n?tL([n,d]):d,l,"stdout"),f=t$(d,l,"stderr");return Object.assign(d,{nodeChildProcess:c,stdout:D,stderr:f,[Symbol.asyncIterator]:()=>tj(D,f),pipe:(t,i,r)=>e(t,i,r,d)})}(e,t,{stdin:r,stdout:r,stderr:"pipe",...i});return function(e){process.stdin.isTTY&&process.stdin.setRawMode(!1);let t=async()=>{try{(await e.nodeChildProcess).kill(),process.exit(1)}catch{}},i=()=>t(),r=()=>t();process.on("SIGINT",i),process.on("SIGTERM",r),e.nodeChildProcess.finally(()=>{process.off("SIGINT",i),process.off("SIGTERM",r)})}(n),n}function tU(e){return c(e)?e:d(process.cwd(),e)}Y("../../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/adm-zip.js");let tH="object"==typeof process&&process?process:{stdout:null,stderr:null},tG=e=>!!e&&"object"==typeof e&&(e instanceof iy||e instanceof S||tZ(e)||tW(e)),tZ=e=>!!e&&"object"==typeof e&&e instanceof N&&"function"==typeof e.pipe&&e.pipe!==S.Writable.prototype.pipe,tW=e=>!!e&&"object"==typeof e&&e instanceof N&&"function"==typeof e.write&&"function"==typeof e.end,tV=Symbol("EOF"),tY=Symbol("maybeEmitEnd"),tX=Symbol("emittedEnd"),tK=Symbol("emittingEnd"),tq=Symbol("emittedError"),tJ=Symbol("closed"),tQ=Symbol("read"),t0=Symbol("flush"),t1=Symbol("flushChunk"),t2=Symbol("encoding"),t3=Symbol("decoder"),t8=Symbol("flowing"),t6=Symbol("paused"),t5=Symbol("resume"),t4=Symbol("buffer"),t9=Symbol("pipes"),t7=Symbol("bufferLength"),ie=Symbol("bufferPush"),it=Symbol("bufferShift"),ii=Symbol("objectMode"),ir=Symbol("destroyed"),is=Symbol("error"),io=Symbol("emitData"),iu=Symbol("emitEnd"),ia=Symbol("emitEnd2"),il=Symbol("async"),ih=Symbol("abort"),ic=Symbol("aborted"),id=Symbol("signal"),iD=Symbol("dataListeners"),ip=Symbol("discarded"),im=e=>Promise.resolve().then(e),iE=e=>e();class ig{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[t5](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class ib extends ig{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=e=>t.emit("error",e),e.on("error",this.proxyErrors)}}class iy extends N{[t8]=!1;[t6]=!1;[t9]=[];[t4]=[];[ii];[t2];[il];[t3];[tV]=!1;[tX]=!1;[tK]=!1;[tJ]=!1;[tq]=null;[t7]=0;[ir]=!1;[id];[ic]=!1;[iD]=0;[ip]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&"string"==typeof t.encoding)throw TypeError("Encoding and objectMode may not be used together");if(t.objectMode)this[ii]=!0,this[t2]=null;else t.objectMode||!t.encoding||"buffer"===t.encoding?(this[ii]=!1,this[t2]=null):(this[t2]=t.encoding,this[ii]=!1);this[il]=!!t.async,this[t3]=this[t2]?new $(this[t2]):null,t&&!0===t.debugExposeBuffer&&Object.defineProperty(this,"buffer",{get:()=>this[t4]}),t&&!0===t.debugExposePipes&&Object.defineProperty(this,"pipes",{get:()=>this[t9]});let{signal:i}=t;i&&(this[id]=i,i.aborted?this[ih]():i.addEventListener("abort",()=>this[ih]()))}get bufferLength(){return this[t7]}get encoding(){return this[t2]}set encoding(e){throw Error("Encoding must be set at instantiation time")}setEncoding(e){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[ii]}set objectMode(e){throw Error("objectMode must be set at instantiation time")}get async(){return this[il]}set async(e){this[il]=this[il]||!!e}[ih](){this[ic]=!0,this.emit("abort",this[id]?.reason),this.destroy(this[id]?.reason)}get aborted(){return this[ic]}set aborted(e){}write(e,t,i){if(this[ic])return!1;if(this[tV])throw Error("write after end");if(this[ir])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;"function"==typeof t&&(i=t,t="utf8"),t||(t="utf8");let r=this[il]?im:iE;if(!this[ii]&&!Buffer.isBuffer(e)){let t;if(t=e,!Buffer.isBuffer(t)&&ArrayBuffer.isView(t))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else{let t;if((t=e)instanceof ArrayBuffer||t&&"object"==typeof t&&t.constructor&&"ArrayBuffer"===t.constructor.name&&t.byteLength>=0)e=Buffer.from(e);else if("string"!=typeof e)throw Error("Non-contiguous data written to non-objectMode stream")}}return this[ii]?(this[t8]&&0!==this[t7]&&this[t0](!0),this[t8]?this.emit("data",e):this[ie](e)):e.length&&("string"==typeof e&&(t!==this[t2]||this[t3]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[t2]&&(e=this[t3].write(e)),this[t8]&&0!==this[t7]&&this[t0](!0),this[t8]?this.emit("data",e):this[ie](e)),0!==this[t7]&&this.emit("readable"),i&&r(i),this[t8]}read(e){if(this[ir])return null;if(this[ip]=!1,0===this[t7]||0===e||e&&e>this[t7])return this[tY](),null;this[ii]&&(e=null),this[t4].length>1&&!this[ii]&&(this[t4]=[this[t2]?this[t4].join(""):Buffer.concat(this[t4],this[t7])]);let t=this[tQ](e||null,this[t4][0]);return this[tY](),t}[tQ](e,t){if(this[ii])this[it]();else{let i=t;e===i.length||null===e?this[it]():("string"==typeof i?(this[t4][0]=i.slice(e),t=i.slice(0,e)):(this[t4][0]=i.subarray(e),t=i.subarray(0,e)),this[t7]-=e)}return this.emit("data",t),this[t4].length||this[tV]||this.emit("drain"),t}end(e,t,i){return"function"==typeof e&&(i=e,e=void 0),"function"==typeof t&&(i=t,t="utf8"),void 0!==e&&this.write(e,t),i&&this.once("end",i),this[tV]=!0,this.writable=!1,(this[t8]||!this[t6])&&this[tY](),this}[t5](){this[ir]||(this[iD]||this[t9].length||(this[ip]=!0),this[t6]=!1,this[t8]=!0,this.emit("resume"),this[t4].length?this[t0]():this[tV]?this[tY]():this.emit("drain"))}resume(){return this[t5]()}pause(){this[t8]=!1,this[t6]=!0,this[ip]=!1}get destroyed(){return this[ir]}get flowing(){return this[t8]}get paused(){return this[t6]}[ie](e){this[ii]?this[t7]+=1:this[t7]+=e.length,this[t4].push(e)}[it](){return this[ii]?this[t7]-=1:this[t7]-=this[t4][0].length,this[t4].shift()}[t0](e=!1){do;while(this[t1](this[it]())&&this[t4].length);e||this[t4].length||this[tV]||this.emit("drain")}[t1](e){return this.emit("data",e),this[t8]}pipe(e,t){if(this[ir])return e;this[ip]=!1;let i=this[tX];return t=t||{},e===tH.stdout||e===tH.stderr?t.end=!1:t.end=!1!==t.end,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[t9].push(t.proxyErrors?new ib(this,e,t):new ig(this,e,t)),this[il]?im(()=>this[t5]()):this[t5]()),e}unpipe(e){let t=this[t9].find(t=>t.dest===e);t&&(1===this[t9].length?(this[t8]&&0===this[iD]&&(this[t8]=!1),this[t9]=[]):this[t9].splice(this[t9].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if("data"===e)this[ip]=!1,this[iD]++,this[t9].length||this[t8]||this[t5]();else if("readable"===e&&0!==this[t7])super.emit("readable");else("end"===e||"finish"===e||"prefinish"===e)&&this[tX]?(super.emit(e),this.removeAllListeners(e)):"error"===e&&this[tq]&&(this[il]?im(()=>t.call(this,this[tq])):t.call(this,this[tq]));return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return"data"===e&&(this[iD]=this.listeners("data").length,0!==this[iD]||this[ip]||this[t9].length||(this[t8]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return("data"===e||void 0===e)&&(this[iD]=0,this[ip]||this[t9].length||(this[t8]=!1)),t}get emittedEnd(){return this[tX]}[tY](){this[tK]||this[tX]||this[ir]||0!==this[t4].length||!this[tV]||(this[tK]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[tJ]&&this.emit("close"),this[tK]=!1)}emit(e,...t){let i=t[0];if("error"!==e&&"close"!==e&&e!==ir&&this[ir])return!1;if("data"===e)return(!!this[ii]||!!i)&&(this[il]?(im(()=>this[io](i)),!0):this[io](i));if("end"===e)return this[iu]();if("close"===e){if(this[tJ]=!0,!this[tX]&&!this[ir])return!1;let e=super.emit("close");return this.removeAllListeners("close"),e}if("error"===e){this[tq]=i,super.emit(is,i);let e=(!this[id]||!!this.listeners("error").length)&&super.emit("error",i);return this[tY](),e}else if("resume"===e){let e=super.emit("resume");return this[tY](),e}else if("finish"===e||"prefinish"===e){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[tY](),r}[io](e){for(let t of this[t9])!1===t.dest.write(e)&&this.pause();let t=!this[ip]&&super.emit("data",e);return this[tY](),t}[iu](){return!this[tX]&&(this[tX]=!0,this.readable=!1,this[il]?(im(()=>this[ia]()),!0):this[ia]())}[ia](){if(this[t3]){let e=this[t3].end();if(e){for(let t of this[t9])t.dest.write(e);this[ip]||super.emit("data",e)}}for(let e of this[t9])e.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ii]||(e.dataLength=0);let t=this.promise();return this.on("data",t=>{e.push(t),this[ii]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[ii])throw Error("cannot concat in objectMode");let e=await this.collect();return this[t2]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(ir,()=>t(Error("stream destroyed"))),this.on("error",e=>t(e)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ip]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{let i,r;if(e)return t();let n=this.read();if(null!==n)return Promise.resolve({done:!1,value:n});if(this[tV])return t();let s=e=>{this.off("data",o),this.off("end",u),this.off(ir,a),t(),r(e)},o=e=>{this.off("error",s),this.off("end",u),this.off(ir,a),this.pause(),i({value:e,done:!!this[tV]})},u=()=>{this.off("error",s),this.off("data",o),this.off(ir,a),t(),i({done:!0,value:void 0})},a=()=>s(Error("stream destroyed"));return new Promise((e,t)=>{r=t,i=e,this.once(ir,a),this.once("error",s),this.once("end",u),this.once("data",o)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ip]=!1;let e=!1,t=()=>(this.pause(),this.off(is,t),this.off(ir,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let i=this.read();return null===i?t():{done:!1,value:i}};return this.once("end",t),this.once(is,t),this.once(ir,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){return this[ir]||(this[ir]=!0,this[ip]=!0,this[t4].length=0,this[t7]=0,"function"!=typeof this.close||this[tJ]||this.close()),e?this.emit("error",e):this.emit(ir),this}static get isStream(){return tG}}let iF=tD.default.writev,iC=Symbol("_autoClose"),iv=Symbol("_close"),iw=Symbol("_ended"),i_=Symbol("_fd"),iS=Symbol("_finished"),iA=Symbol("_flags"),iR=Symbol("_flush"),iO=Symbol("_handleChunk"),iB=Symbol("_makeBuf"),ix=Symbol("_mode"),iN=Symbol("_needDrain"),iI=Symbol("_onerror"),iT=Symbol("_onopen"),iL=Symbol("_onread"),ik=Symbol("_onwrite"),iM=Symbol("_open"),i$=Symbol("_path"),ij=Symbol("_pos"),iP=Symbol("_queue"),iz=Symbol("_read"),iU=Symbol("_readSize"),iH=Symbol("_reading"),iG=Symbol("_remain"),iZ=Symbol("_size"),iW=Symbol("_write"),iV=Symbol("_writing"),iY=Symbol("_defaultFlag"),iX=Symbol("_errored");class iK extends iy{[iX]=!1;[i_];[i$];[iU];[iH]=!1;[iZ];[iG];[iC];constructor(e,t){if(super(t=t||{}),this.readable=!0,this.writable=!1,"string"!=typeof e)throw TypeError("path must be a string");this[iX]=!1,this[i_]="number"==typeof t.fd?t.fd:void 0,this[i$]=e,this[iU]=t.readSize||0x1000000,this[iH]=!1,this[iZ]="number"==typeof t.size?t.size:1/0,this[iG]=this[iZ],this[iC]="boolean"!=typeof t.autoClose||t.autoClose,"number"==typeof this[i_]?this[iz]():this[iM]()}get fd(){return this[i_]}get path(){return this[i$]}write(){throw TypeError("this is a readable stream")}end(){throw TypeError("this is a readable stream")}[iM](){tD.default.open(this[i$],"r",(e,t)=>this[iT](e,t))}[iT](e,t){e?this[iI](e):(this[i_]=t,this.emit("open",t),this[iz]())}[iB](){return Buffer.allocUnsafe(Math.min(this[iU],this[iG]))}[iz](){if(!this[iH]){this[iH]=!0;let e=this[iB]();if(0===e.length)return process.nextTick(()=>this[iL](null,0,e));tD.default.read(this[i_],e,0,e.length,null,(e,t,i)=>this[iL](e,t,i))}}[iL](e,t,i){this[iH]=!1,e?this[iI](e):this[iO](t,i)&&this[iz]()}[iv](){if(this[iC]&&"number"==typeof this[i_]){let e=this[i_];this[i_]=void 0,tD.default.close(e,e=>e?this.emit("error",e):this.emit("close"))}}[iI](e){this[iH]=!0,this[iv](),this.emit("error",e)}[iO](e,t){let i=!1;return this[iG]-=e,e>0&&(i=super.write(e<t.length?t.subarray(0,e):t)),(0===e||this[iG]<=0)&&(i=!1,this[iv](),super.end()),i}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return"number"==typeof this[i_]&&this[iz](),!1;case"error":if(this[iX])return!1;return this[iX]=!0,super.emit(e,...t);default:return super.emit(e,...t)}}}class iq extends iK{[iM](){let e=!0;try{this[iT](null,tD.default.openSync(this[i$],"r")),e=!1}finally{e&&this[iv]()}}[iz](){let e=!0;try{if(!this[iH]){for(this[iH]=!0;;){let e=this[iB](),t=0===e.length?0:tD.default.readSync(this[i_],e,0,e.length,null);if(!this[iO](t,e))break}this[iH]=!1}e=!1}finally{e&&this[iv]()}}[iv](){if(this[iC]&&"number"==typeof this[i_]){let e=this[i_];this[i_]=void 0,tD.default.closeSync(e),this.emit("close")}}}class iJ extends k{readable=!1;writable=!0;[iX]=!1;[iV]=!1;[iw]=!1;[iP]=[];[iN]=!1;[i$];[ix];[iC];[i_];[iY];[iA];[iS]=!1;[ij];constructor(e,t){super(t=t||{}),this[i$]=e,this[i_]="number"==typeof t.fd?t.fd:void 0,this[ix]=void 0===t.mode?438:t.mode,this[ij]="number"==typeof t.start?t.start:void 0,this[iC]="boolean"!=typeof t.autoClose||t.autoClose;let i=void 0!==this[ij]?"r+":"w";this[iY]=void 0===t.flags,this[iA]=void 0===t.flags?i:t.flags,void 0===this[i_]&&this[iM]()}emit(e,...t){if("error"===e){if(this[iX])return!1;this[iX]=!0}return super.emit(e,...t)}get fd(){return this[i_]}get path(){return this[i$]}[iI](e){this[iv](),this[iV]=!0,this.emit("error",e)}[iM](){tD.default.open(this[i$],this[iA],this[ix],(e,t)=>this[iT](e,t))}[iT](e,t){this[iY]&&"r+"===this[iA]&&e&&"ENOENT"===e.code?(this[iA]="w",this[iM]()):e?this[iI](e):(this[i_]=t,this.emit("open",t),this[iV]||this[iR]())}end(e,t){return e&&this.write(e,t),this[iw]=!0,this[iV]||this[iP].length||"number"!=typeof this[i_]||this[ik](null,0),this}write(e,t){return("string"==typeof e&&(e=Buffer.from(e,t)),this[iw])?(this.emit("error",Error("write() after end()")),!1):void 0===this[i_]||this[iV]||this[iP].length?(this[iP].push(e),this[iN]=!0,!1):(this[iV]=!0,this[iW](e),!0)}[iW](e){tD.default.write(this[i_],e,0,e.length,this[ij],(e,t)=>this[ik](e,t))}[ik](e,t){e?this[iI](e):(void 0!==this[ij]&&"number"==typeof t&&(this[ij]+=t),this[iP].length?this[iR]():(this[iV]=!1,this[iw]&&!this[iS]?(this[iS]=!0,this[iv](),this.emit("finish")):this[iN]&&(this[iN]=!1,this.emit("drain"))))}[iR](){if(0===this[iP].length)this[iw]&&this[ik](null,0);else if(1===this[iP].length)this[iW](this[iP].pop());else{let e=this[iP];this[iP]=[],iF(this[i_],e,this[ij],(e,t)=>this[ik](e,t))}}[iv](){if(this[iC]&&"number"==typeof this[i_]){let e=this[i_];this[i_]=void 0,tD.default.close(e,e=>e?this.emit("error",e):this.emit("close"))}}}class iQ extends iJ{[iM](){let e;if(this[iY]&&"r+"===this[iA])try{e=tD.default.openSync(this[i$],this[iA],this[ix])}catch(e){if(e?.code==="ENOENT")return this[iA]="w",this[iM]();throw e}else e=tD.default.openSync(this[i$],this[iA],this[ix]);this[iT](null,e)}[iv](){if(this[iC]&&"number"==typeof this[i_]){let e=this[i_];this[i_]=void 0,tD.default.closeSync(e),this.emit("close")}}[iW](e){let t=!0;try{this[ik](null,tD.default.writeSync(this[i_],e,0,e.length,this[ij])),t=!1}finally{if(t)try{this[iv]()}catch{}}}}let i0=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"]]),i1=e=>{let t=i0.get(e);return t||e},i2=(e={})=>{if(!e)return{};let t={};for(let[i,r]of Object.entries(e))t[i1(i)]=r;return void 0===t.chmod&&!1===t.noChmod&&(t.chmod=!0),delete t.noChmod,t},i3=(e,t,i,r,n)=>Object.assign((s=[],o,u)=>{Array.isArray(s)&&(o=s,s={}),"function"==typeof o&&(u=o,o=void 0),o=o?Array.from(o):[];let a=i2(s);if(n?.(a,o),!a.sync||!a.file){if(a.sync||!a.file){if(!a.sync||a.file){if(a.sync||a.file)throw Error("impossible options??");if("function"==typeof u)throw TypeError("callback only supported with file option");return r(a,o)}if("function"==typeof u)throw TypeError("callback not supported for sync tar functions");return i(a,o)}{let e=t(a,o),i=u||void 0;return i?e.then(()=>i(),i):e}}if("function"==typeof u)throw TypeError("callback not supported for sync tar functions");return e(a,o)},{syncFile:e,asyncFile:t,syncNoFile:i,asyncNoFile:r,validate:n});var i8=Y("zlib");let i6=i8.default.constants||{ZLIB_VERNUM:4736},i5=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},i6)),i4=P.concat,i9=Object.getOwnPropertyDescriptor(P,"concat"),i7=e=>e,re=i9?.writable===!0||i9?.set!==void 0?e=>{P.concat=e?i7:i4}:e=>{},rt=Symbol("_superWrite");class ri extends Error{code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}}let rr=Symbol("flushFlag");class rn extends iy{#e=!1;#t=!1;#i;#r;#n;#s;#o;get sawError(){return this.#e}get handle(){return this.#s}get flushFlag(){return this.#i}constructor(e,t){if(!e||"object"!=typeof e)throw TypeError("invalid options for ZlibBase constructor");if(super(e),this.#i=e.flush??0,this.#r=e.finishFlush??0,this.#n=e.fullFlushFlag??0,"function"!=typeof i8[t])throw TypeError("Compression method not supported: "+t);try{this.#s=new i8[t](e)}catch(e){throw new ri(e,this.constructor)}this.#o=e=>{this.#e||(this.#e=!0,this.close(),this.emit("error",e))},this.#s?.on("error",e=>this.#o(new ri(e))),this.once("end",()=>this.close)}close(){this.#s&&(this.#s.close(),this.#s=void 0,this.emit("close"))}reset(){if(!this.#e)return j(this.#s,"zlib binding closed"),this.#s.reset?.()}flush(e){this.ended||("number"!=typeof e&&(e=this.#n),this.write(Object.assign(P.alloc(0),{[rr]:e})))}end(e,t,i){return"function"==typeof e&&(i=e,t=void 0,e=void 0),"function"==typeof t&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(i)}get ended(){return this.#t}[rt](e){return super.write(e)}write(e,t,i){let r,n;if("function"==typeof t&&(i=t,t="utf8"),"string"==typeof e&&(e=P.from(e,t)),this.#e)return;j(this.#s,"zlib binding closed");let s=this.#s._handle,o=s.close;s.close=()=>{};let u=this.#s.close;this.#s.close=()=>{},re(!0);try{let t="number"==typeof e[rr]?e[rr]:this.#i;n=this.#s._processChunk(e,t),re(!1)}catch(e){re(!1),this.#o(new ri(e,this.write))}finally{this.#s&&(this.#s._handle=s,s.close=o,this.#s.close=u,this.#s.removeAllListeners("error"))}if(this.#s&&this.#s.on("error",e=>this.#o(new ri(e,this.write))),n)if(Array.isArray(n)&&n.length>0){let e=n[0];r=this[rt](P.from(e));for(let e=1;e<n.length;e++)r=this[rt](n[e])}else r=this[rt](P.from(n));return i&&i(),r}}class rs extends rn{#u;#a;constructor(e,t){(e=e||{}).flush=e.flush||i5.Z_NO_FLUSH,e.finishFlush=e.finishFlush||i5.Z_FINISH,e.fullFlushFlag=i5.Z_FULL_FLUSH,super(e,t),this.#u=e.level,this.#a=e.strategy}params(e,t){if(!this.sawError){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.#u!==e||this.#a!==t){this.flush(i5.Z_SYNC_FLUSH),j(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(e,t)=>{"function"==typeof e&&(t=e,e=this.flushFlag),this.flush(e),t?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#u=e,this.#a=t)}}}}class ro extends rs{#l;constructor(e){super(e,"Gzip"),this.#l=e&&!!e.portable}[rt](e){return this.#l&&(this.#l=!1,e[9]=255),super[rt](e)}}class ru extends rs{constructor(e){super(e,"Unzip")}}class ra extends rn{constructor(e,t){(e=e||{}).flush=e.flush||i5.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||i5.BROTLI_OPERATION_FINISH,e.fullFlushFlag=i5.BROTLI_OPERATION_FLUSH,super(e,t)}}class rl extends ra{constructor(e){super(e,"BrotliCompress")}}class rh extends ra{constructor(e){super(e,"BrotliDecompress")}}class rc extends rn{constructor(e,t){(e=e||{}).flush=e.flush||i5.ZSTD_e_continue,e.finishFlush=e.finishFlush||i5.ZSTD_e_end,e.fullFlushFlag=i5.ZSTD_e_flush,super(e,t)}}class rd extends rc{constructor(e){super(e,"ZstdCompress")}}class rD extends rc{constructor(e){super(e,"ZstdDecompress")}}let rf=e=>(255^e)&255,rp=e=>(255^e)+1&255,rm=e=>rE.has(e),rE=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"]]),rg=new Map(Array.from(rE).map(e=>[e[1],e[0]]));class rb{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#h="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,i,r){Buffer.isBuffer(e)?this.decode(e,t||0,i,r):e&&this.#c(e)}decode(e,t,i,r){if(t||(t=0),!e||!(e.length>=t+512))throw Error("need 512 bytes for header");this.path=rF(e,t,100),this.mode=rw(e,t+100,8),this.uid=rw(e,t+108,8),this.gid=rw(e,t+116,8),this.size=rw(e,t+124,12),this.mtime=rC(e,t+136,12),this.cksum=rw(e,t+148,12),r&&this.#c(r,!0),i&&this.#c(i);let n=rF(e,t+156,1);if(rm(n)&&(this.#h=n||"0"),"0"===this.#h&&"/"===this.path.slice(-1)&&(this.#h="5"),"5"===this.#h&&(this.size=0),this.linkpath=rF(e,t+157,100),"ustar\x0000"===e.subarray(t+257,t+265).toString())if(this.uname=rF(e,t+265,32),this.gname=rF(e,t+297,32),this.devmaj=rw(e,t+329,8)??0,this.devmin=rw(e,t+337,8)??0,0!==e[t+475]){let i=rF(e,t+345,155);this.path=i+"/"+this.path}else{let i=rF(e,t+345,130);i&&(this.path=i+"/"+this.path),this.atime=rC(e,t+476,12),this.ctime=rC(e,t+488,12)}let s=256;for(let i=t;i<t+148;i++)s+=e[i];for(let i=t+156;i<t+512;i++)s+=e[i];this.cksumValid=s===this.cksum,void 0===this.cksum&&256===s&&(this.nullBlock=!0)}#c(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([e,i])=>!(null==i||"path"===e&&t||"linkpath"===e&&t||"global"===e))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),"Unsupported"===this.#h&&(this.#h="0"),!(e.length>=t+512))throw Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,r=ry(this.path||"",i),n=r[0],s=r[1];this.needPax=!!r[2],this.needPax=rI(e,t,100,n)||this.needPax,this.needPax=rA(e,t+100,8,this.mode)||this.needPax,this.needPax=rA(e,t+108,8,this.uid)||this.needPax,this.needPax=rA(e,t+116,8,this.gid)||this.needPax,this.needPax=rA(e,t+124,12,this.size)||this.needPax,this.needPax=rx(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#h.charCodeAt(0),this.needPax=rI(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=rI(e,t+265,32,this.uname)||this.needPax,this.needPax=rI(e,t+297,32,this.gname)||this.needPax,this.needPax=rA(e,t+329,8,this.devmaj)||this.needPax,this.needPax=rA(e,t+337,8,this.devmin)||this.needPax,this.needPax=rI(e,t+345,i,s)||this.needPax,0!==e[t+475]?this.needPax=rI(e,t+345,155,s)||this.needPax:(this.needPax=rI(e,t+345,130,s)||this.needPax,this.needPax=rx(e,t+476,12,this.atime)||this.needPax,this.needPax=rx(e,t+488,12,this.ctime)||this.needPax);let o=256;for(let i=t;i<t+148;i++)o+=e[i];for(let i=t+156;i<t+512;i++)o+=e[i];return this.cksum=o,rA(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return"Unsupported"===this.#h?this.#h:rE.get(this.#h)}get typeKey(){return this.#h}set type(e){let t=String(rg.get(e));if(rm(t)||"Unsupported"===t)this.#h=t;else if(rm(e))this.#h=e;else throw TypeError("invalid entry type: "+e)}}let ry=(e,t)=>{let i,r=e,n="",s=D.parse(e).root||".";if(100>Buffer.byteLength(r))i=[r,n,!1];else{n=D.dirname(r),r=D.basename(r);do 100>=Buffer.byteLength(r)&&Buffer.byteLength(n)<=t?i=[r,n,!1]:Buffer.byteLength(r)>100&&Buffer.byteLength(n)<=t?i=[r.slice(0,99),n,!0]:(r=D.join(D.basename(n),r),n=D.dirname(n));while(n!==s&&void 0===i);i||(i=[e.slice(0,99),"",!0])}return i},rF=(e,t,i)=>e.subarray(t,t+i).toString("utf8").replace(/\0.*/,""),rC=(e,t,i)=>rv(rw(e,t,i)),rv=e=>void 0===e?void 0:new Date(1e3*e),rw=(e,t,i)=>128&Number(e[t])?(e=>{let t=e[0],i=128===t?(e=>{for(var t=e.length,i=0,r=t-1;r>-1;r--){var n=Number(e[r]);0!==n&&(i+=n*Math.pow(256,t-r-1))}return i})(e.subarray(1,e.length)):255===t?(e=>{for(var t=e.length,i=0,r=!1,n=t-1;n>-1;n--){var s,o=Number(e[n]);r?s=rf(o):0===o?s=o:(r=!0,s=rp(o)),0!==s&&(i-=s*Math.pow(256,t-n-1))}return i})(e):null;if(null===i)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i})(e.subarray(t,t+i)):r_(e,t,i),r_=(e,t,i)=>{let r;return isNaN(r=parseInt(e.subarray(t,t+i).toString("utf8").replace(/\0.*$/,"").trim(),8))?void 0:r},rS={12:0x1ffffffff,8:2097151},rA=(e,t,i,r)=>void 0!==r&&(r>rS[i]||r<0?(((e,t)=>{if(Number.isSafeInteger(e))e<0?((e,t)=>{t[0]=255;var i=!1;e*=-1;for(var r=t.length;r>1;r--){var n=255&e;e=Math.floor(e/256),i?t[r-1]=rf(n):0===n?t[r-1]=0:(i=!0,t[r-1]=rp(n))}})(e,t):((e,t)=>{t[0]=128;for(var i=t.length;i>1;i--)t[i-1]=255&e,e=Math.floor(e/256)})(e,t);else throw Error("cannot encode number outside of javascript safe integer range")})(r,e.subarray(t,t+i)),!0):(rR(e,t,i,r),!1)),rR=(e,t,i,r)=>e.write(rO(r,i),t,i,"ascii"),rO=(e,t)=>rB(Math.floor(e).toString(8),t),rB=(e,t)=>(e.length===t-1?e:Array(t-e.length-1).join("0")+e+" ")+"\0",rx=(e,t,i,r)=>void 0!==r&&rA(e,t,i,r.getTime()/1e3),rN=Array(156).join("\0"),rI=(e,t,i,r)=>void 0!==r&&(e.write(r+rN,t,i,"utf8"),r.length!==Buffer.byteLength(r)||r.length>i);class rT{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(""===e)return Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(i);for(let e=0;e<512;e++)r[e]=0;new rb({path:("PaxHeader/"+a(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,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(r),r.write(e,512,t,"utf8");for(let e=t+512;e<r.length;e++)r[e]=0;return r}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(void 0===this[e])return"";let t=this[e],i=" "+("dev"===e||"ino"===e||"nlink"===e?"SCHILY.":"")+e+"="+(t instanceof Date?t.getTime()/1e3:t)+"\n",r=Buffer.byteLength(i),n=Math.floor(Math.log(r)/Math.log(10))+1;return r+n>=Math.pow(10,n)&&(n+=1),n+r+i}static parse(e,t,i=!1){return new rT(rL(rk(e),t),i)}}let rL=(e,t)=>t?Object.assign({},t,e):e,rk=e=>e.replace(/\n$/,"").split("\n").reduce(rM,Object.create(null)),rM=(e,t)=>{let i=parseInt(t,10);if(i!==Buffer.byteLength(t)+1)return e;let r=(t=t.slice((i+" ").length)).split("="),n=r.shift();if(!n)return e;let s=n.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=r.join("=");return e[s]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(s)?new Date(1e3*Number(o)):/^[0-9]+$/.test(o)?+o:o,e},r$="win32"!==(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)?e=>e:e=>e&&e.replace(/\\/g,"/");class rj extends iy{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(e,t,i){switch(super({}),this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.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(!e.path)throw Error("no path provided for tar.ReadEntry");this.path=r$(e.path),this.mode=e.mode,this.mode&&(this.mode=4095&this.mode),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?r$(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#c(t),i&&this.#c(i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw Error("writing more to entry than is appropriate");let i=this.remain,r=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,r-t),!!this.ignore||(i>=t?super.write(e):super.write(e.subarray(0,i)))}#c(e,t=!1){e.path&&(e.path=r$(e.path)),e.linkpath&&(e.linkpath=r$(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([e,i])=>!(null==i||"path"===e&&t))))}}let rP=(e,t,i,r={})=>{e.file&&(r.file=e.file),e.cwd&&(r.cwd=e.cwd),r.code=i instanceof Error&&i.code||t,r.tarCode=t,e.strict||!1===r.recoverable?i instanceof Error?e.emit("error",Object.assign(i,r)):e.emit("error",Object.assign(Error(`${t}: ${i}`),r)):(i instanceof Error&&(r=Object.assign(i,r),i=i.message),e.emit("warn",t,i,r))},rz=Buffer.from([31,139]),rU=Buffer.from([40,181,47,253]),rH=Math.max(rz.length,rU.length),rG=Symbol("state"),rZ=Symbol("writeEntry"),rW=Symbol("readEntry"),rV=Symbol("nextEntry"),rY=Symbol("processEntry"),rX=Symbol("extendedHeader"),rK=Symbol("globalExtendedHeader"),rq=Symbol("meta"),rJ=Symbol("emitMeta"),rQ=Symbol("buffer"),r0=Symbol("queue"),r1=Symbol("ended"),r2=Symbol("emittedEnd"),r3=Symbol("emit"),r8=Symbol("unzip"),r6=Symbol("consumeChunk"),r5=Symbol("consumeChunkSub"),r4=Symbol("consumeBody"),r9=Symbol("consumeMeta"),r7=Symbol("consumeHeader"),ne=Symbol("consuming"),nt=Symbol("bufferConcat"),ni=Symbol("maybeEnd"),nr=Symbol("writing"),nn=Symbol("aborted"),ns=Symbol("onDone"),no=Symbol("sawValidEntry"),nu=Symbol("sawNullBlock"),na=Symbol("sawEOF"),nl=Symbol("closeStream"),nh=()=>!0;class nc extends M{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[r0]=[];[rQ];[rW];[rZ];[rG]="begin";[rq]="";[rX];[rK];[r1]=!1;[r8];[nn]=!1;[no];[nu]=!1;[na]=!1;[nr]=!1;[ne]=!1;[r2]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(ns,()=>{("begin"===this[rG]||!1===this[no])&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(ns,e.ondone):this.on(ns,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||1048576,this.filter="function"==typeof e.filter?e.filter:nh;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=e.gzip||e.zstd||void 0===e.brotli?!!t&&void 0:e.brotli;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=e.gzip||e.brotli||void 0===e.zstd?!!i||void 0:e.zstd,this.on("end",()=>this[nl]()),"function"==typeof e.onwarn&&this.on("warn",e.onwarn),"function"==typeof e.onReadEntry&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){rP(this,e,t,i)}[r7](e,t){let i;void 0===this[no]&&(this[no]=!1);try{i=new rb(e,t,this[rX],this[rK])}catch(e){return this.warn("TAR_ENTRY_INVALID",e)}if(i.nullBlock)this[nu]?(this[na]=!0,"begin"===this[rG]&&(this[rG]="header"),this[r3]("eof")):(this[nu]=!0,this[r3]("nullBlock"));else if(this[nu]=!1,i.cksumValid)if(i.path){let e=i.type;if(/^(Symbolic)?Link$/.test(e)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(/^(Symbolic)?Link$/.test(e)||/^(Global)?ExtendedHeader$/.test(e)||!i.linkpath){let e=this[rZ]=new rj(i,this[rX],this[rK]);if(!this[no])if(e.remain){let t=()=>{e.invalid||(this[no]=!0)};e.on("end",t)}else this[no]=!0;e.meta?e.size>this.maxMetaEntrySize?(e.ignore=!0,this[r3]("ignoredEntry",e),this[rG]="ignore",e.resume()):e.size>0&&(this[rq]="",e.on("data",e=>this[rq]+=e),this[rG]="meta"):(this[rX]=void 0,e.ignore=e.ignore||!this.filter(e.path,e),e.ignore?(this[r3]("ignoredEntry",e),this[rG]=e.remain?"ignore":"header",e.resume()):(e.remain?this[rG]="body":(this[rG]="header",e.end()),this[rW]?this[r0].push(e):(this[r0].push(e),this[rV]())))}else this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i})}else this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i})}[nl](){queueMicrotask(()=>this.emit("close"))}[rY](e){let t=!0;if(e)if(Array.isArray(e)){let[t,...i]=e;this.emit(t,...i)}else this[rW]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[rV]()),t=!1);else this[rW]=void 0,t=!1;return t}[rV](){do;while(this[rY](this[r0].shift()));if(!this[r0].length){let e=this[rW];!e||e.flowing||e.size===e.remain?this[nr]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[r4](e,t){let i=this[rZ];if(!i)throw Error("attempt to consume body without entry??");let r=i.blockRemain??0,n=r>=e.length&&0===t?e:e.subarray(t,t+r);return i.write(n),i.blockRemain||(this[rG]="header",this[rZ]=void 0,i.end()),n.length}[r9](e,t){let i=this[rZ],r=this[r4](e,t);return!this[rZ]&&i&&this[rJ](i),r}[r3](e,t,i){this[r0].length||this[rW]?this[r0].push([e,t,i]):this.emit(e,t,i)}[rJ](e){switch(this[r3]("meta",this[rq]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[rX]=rT.parse(this[rq],this[rX],!1);break;case"GlobalExtendedHeader":this[rK]=rT.parse(this[rq],this[rK],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let e=this[rX]??Object.create(null);this[rX]=e,e.path=this[rq].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let e=this[rX]||Object.create(null);this[rX]=e,e.linkpath=this[rq].replace(/\0.*/,"");break}default:throw Error("unknown meta: "+e.type)}}abort(e){this[nn]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,i){if("function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,"string"==typeof t?t:"utf8")),this[nn])return i?.(),!1;if((void 0===this[r8]||void 0===this.brotli&&!1===this[r8])&&e){if(this[rQ]&&(e=Buffer.concat([this[rQ],e]),this[rQ]=void 0),e.length<rH)return this[rQ]=e,i?.(),!0;for(let t=0;void 0===this[r8]&&t<rz.length;t++)e[t]!==rz[t]&&(this[r8]=!1);let t=!1;if(!1===this[r8]&&!1!==this.zstd){t=!0;for(let i=0;i<rU.length;i++)if(e[i]!==rU[i]){t=!1;break}}let r=void 0===this.brotli&&!t;if(!1===this[r8]&&r)if(e.length<512)if(!this[r1])return this[rQ]=e,i?.(),!0;else this.brotli=!0;else try{new rb(e.subarray(0,512)),this.brotli=!1}catch(e){this.brotli=!0}if(void 0===this[r8]||!1===this[r8]&&(this.brotli||t)){let r=this[r1];this[r1]=!1,this[r8]=void 0===this[r8]?new ru({}):t?new rD({}):new rh({}),this[r8].on("data",e=>this[r6](e)),this[r8].on("error",e=>this.abort(e)),this[r8].on("end",()=>{this[r1]=!0,this[r6]()}),this[nr]=!0;let n=!!this[r8][r?"end":"write"](e);return this[nr]=!1,i?.(),n}}this[nr]=!0,this[r8]?this[r8].write(e):this[r6](e),this[nr]=!1;let r=!this[r0].length&&(!this[rW]||this[rW].flowing);return r||this[r0].length||this[rW]?.once("drain",()=>this.emit("drain")),i?.(),r}[nt](e){e&&!this[nn]&&(this[rQ]=this[rQ]?Buffer.concat([this[rQ],e]):e)}[ni](){if(this[r1]&&!this[r2]&&!this[nn]&&!this[ne]){this[r2]=!0;let e=this[rZ];if(e&&e.blockRemain){let t=this[rQ]?this[rQ].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[rQ]&&e.write(this[rQ]),e.end()}this[r3](ns)}}[r6](e){if(this[ne]&&e)this[nt](e);else if(e||this[rQ]){if(e){if(this[ne]=!0,this[rQ]){this[nt](e);let t=this[rQ];this[rQ]=void 0,this[r5](t)}else this[r5](e);for(;this[rQ]&&this[rQ]?.length>=512&&!this[nn]&&!this[na];){let e=this[rQ];this[rQ]=void 0,this[r5](e)}this[ne]=!1}}else this[ni]();(!this[rQ]||this[r1])&&this[ni]()}[r5](e){let t=0,i=e.length;for(;t+512<=i&&!this[nn]&&!this[na];)switch(this[rG]){case"begin":case"header":this[r7](e,t),t+=512;break;case"ignore":case"body":t+=this[r4](e,t);break;case"meta":t+=this[r9](e,t);break;default:throw Error("invalid state: "+this[rG])}t<i&&(this[rQ]?this[rQ]=Buffer.concat([e.subarray(t),this[rQ]]):this[rQ]=e.subarray(t))}end(e,t,i){return"function"==typeof e&&(i=e,t=void 0,e=void 0),"function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,t)),i&&this.once("finish",i),this[nn]||(this[r8]?(e&&this[r8].write(e),this[r8].end()):(this[r1]=!0,(void 0===this.brotli||void 0===this.zstd)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[ni]())),this}}let nd=e=>{let t=e.length-1,i=-1;for(;t>-1&&"/"===e.charAt(t);)i=t,t--;return -1===i?e:e.slice(0,i)},nD=(e,t)=>{let i=new Map(t.map(e=>[nd(e),!0])),r=e.filter,n=(e,t="")=>{let r,s=t||(0,td.parse)(e).root||".";if(e===s)r=!1;else{let t=i.get(e);r=void 0!==t?t:n((0,td.dirname)(e),s)}return i.set(e,r),r};e.filter=r?(e,t)=>r(e,t)&&n(nd(e)):e=>n(nd(e))},nf=i3(t=>{let i,r=new nc(t),n=t.file;try{i=e.openSync(n,"r");let s=e.fstatSync(i),o=t.maxReadSize||0x1000000;if(s.size<o){let t=Buffer.allocUnsafe(s.size);e.readSync(i,t,0,s.size,0),r.end(t)}else{let t=0,n=Buffer.allocUnsafe(o);for(;t<s.size;){let s=e.readSync(i,n,0,o,t);t+=s,r.write(n.subarray(0,s))}r.end()}}finally{if("number"==typeof i)try{e.closeSync(i)}catch(e){}}},(t,i)=>{let r=new nc(t),n=t.maxReadSize||0x1000000,s=t.file;return new Promise((t,i)=>{r.on("error",i),r.on("end",t),e.stat(s,(e,t)=>{if(e)i(e);else{let e=new iK(s,{readSize:n,size:t.size});e.on("error",i),e.pipe(r)}})})},e=>new nc(e),e=>new nc(e),(e,t)=>{t?.length&&nD(e,t),e.noResume||(e=>{let t=e.onReadEntry;e.onReadEntry=t?e=>{t(e),e.resume()}:e=>e.resume()})(e)}),np=(e,t,i)=>(e&=4095,i&&(e=(384|e)&-19),t&&(256&e&&(e|=64),32&e&&(e|=8),4&e&&(e|=1)),e),{isAbsolute:nm,parse:nE}=p,ng=e=>{let t="",i=nE(e);for(;nm(e)||i.root;){let r="/"===e.charAt(0)&&"//?/"!==e.slice(0,4)?"/":i.root;e=e.slice(r.length),t+=r,i=nE(e)}return[t,e]},nb=["|","<",">","?",":"],ny=nb.map(e=>String.fromCharCode(61440+e.charCodeAt(0))),nF=new Map(nb.map((e,t)=>[e,ny[t]])),nC=new Map(ny.map((e,t)=>[e,nb[t]])),nv=e=>nb.reduce((e,t)=>e.split(t).join(nF.get(t)),e),nw=(e,t)=>t?(e=r$(e).replace(/^\.(\/|$)/,""),nd(t)+"/"+e):r$(e),n_=Symbol("process"),nS=Symbol("file"),nA=Symbol("directory"),nR=Symbol("symlink"),nO=Symbol("hardlink"),nB=Symbol("header"),nx=Symbol("read"),nN=Symbol("lstat"),nI=Symbol("onlstat"),nT=Symbol("onread"),nL=Symbol("onreadlink"),nk=Symbol("openfile"),nM=Symbol("onopenfile"),n$=Symbol("close"),nj=Symbol("mode"),nP=Symbol("awaitDrain"),nz=Symbol("ondrain"),nU=Symbol("prefix");class nH extends iy{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(e,t={}){let i=i2(t);super(),this.path=r$(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||0x1000000,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=r$(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?r$(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[e,t]=ng(this.path);e&&"string"==typeof t&&(this.path=t,r=e)}if(this.win32=!!i.win32||"win32"===process.platform,this.win32){let t;this.path=(t=this.path.replace(/\\/g,"/"),ny.reduce((e,t)=>e.split(t).join(nC.get(t)),t)),e=e.replace(/\\/g,"/")}this.absolute=r$(i.absolute||td.default.resolve(this.cwd,e)),""===this.path&&(this.path="./"),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path});let n=this.statCache.get(this.absolute);n?this[nI](n):this[nN]()}warn(e,t,i={}){return rP(this,e,t,i)}emit(e,...t){return"error"===e&&(this.#d=!0),super.emit(e,...t)}[nN](){tD.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[nI](t)})}[nI](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=nW(e),this.emit("stat",e),this[n_]()}[n_](){switch(this.type){case"File":return this[nS]();case"Directory":return this[nA]();case"SymbolicLink":return this[nR]();default:return this.end()}}[nj](e){return np(e,"Directory"===this.type,this.portable)}[nU](e){return nw(e,this.prefix)}[nB](){if(!this.stat)throw Error("cannot write header before stat");"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new rb({path:this[nU](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nU](this.linkpath):this.linkpath,mode:this[nj](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:"Unsupported"===this.type?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 rT({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[nU](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nU](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 e=this.header?.block;if(!e)throw Error("failed to encode header");super.write(e)}[nA](){if(!this.stat)throw Error("cannot create directory entry without stat");"/"!==this.path.slice(-1)&&(this.path+="/"),this.stat.size=0,this[nB](),this.end()}[nR](){tD.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[nL](t)})}[nL](e){this.linkpath=r$(e),this[nB](),this.end()}[nO](e){if(!this.stat)throw Error("cannot create link entry without stat");this.type="Link",this.linkpath=r$(td.default.relative(this.cwd,e)),this.stat.size=0,this[nB](),this.end()}[nS](){if(!this.stat)throw Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[nO](t);this.linkCache.set(e,this.absolute)}if(this[nB](),0===this.stat.size)return this.end();this[nk]()}[nk](){tD.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[nM](t)})}[nM](e){if(this.fd=e,this.#d)return this[n$]();if(!this.stat)throw Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[nx]()}[nx](){let{fd:e,buf:t,offset:i,length:r,pos:n}=this;if(void 0===e||void 0===t)throw Error("cannot read file without first opening");tD.default.read(e,t,i,r,n,(e,t)=>{if(e)return this[n$](()=>this.emit("error",e));this[nT](t)})}[n$](e=()=>{}){void 0!==this.fd&&tD.default.close(this.fd,e)}[nT](e){if(e<=0&&this.remain>0){let e=Object.assign(Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[n$](()=>this.emit("error",e))}if(e>this.remain){let e=Object.assign(Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[n$](()=>this.emit("error",e))}if(!this.buf)throw Error("should have created buffer prior to reading");if(e===this.remain)for(let t=e;t<this.length&&e<this.blockRemain;t++)this.buf[t+this.offset]=0,e++,this.remain++;let t=0===this.offset&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[nz]():this[nP](()=>this[nz]())}[nP](e){this.once("drain",e)}write(e,t,i){if("function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,"string"==typeof t?t:"utf8")),this.blockRemain<e.length){let e=Object.assign(Error("writing more data than expected"),{path:this.absolute});return this.emit("error",e)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,i)}[nz](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[n$](e=>e?this.emit("error",e):this.end());if(!this.buf)throw Error("buffer lost somehow in ONDRAIN");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[nx]()}}class nG extends nH{sync=!0;[nN](){this[nI](tD.default.lstatSync(this.absolute))}[nR](){this[nL](tD.default.readlinkSync(this.absolute))}[nk](){this[nM](tD.default.openSync(this.absolute,"r"))}[nx](){let e=!0;try{let{fd:t,buf:i,offset:r,length:n,pos:s}=this;if(void 0===t||void 0===i)throw Error("fd and buf must be set in READ method");let o=tD.default.readSync(t,i,r,n,s);this[nT](o),e=!1}finally{if(e)try{this[n$](()=>{})}catch(e){}}}[nP](e){e()}[n$](e=()=>{}){void 0!==this.fd&&tD.default.closeSync(this.fd),e()}}class nZ extends iy{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(e,t,i={}){return rP(this,e,t,i)}constructor(e,t={}){let i=i2(t);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:r}=e;if("Unsupported"===r)throw Error("writing entry that should be ignored");this.type=r,"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=r$(e.path),this.mode=void 0!==e.mode?this[nj](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=void 0!==e.linkpath?r$(e.linkpath):void 0,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[e,t]=ng(this.path);e&&"string"==typeof t&&(this.path=t,n=e)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new rb({path:this[nU](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nU](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}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new rT({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[nU](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nU](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 s=this.header?.block;if(!s)throw Error("failed to encode header");super.write(s),e.pipe(this)}[nU](e){return nw(e,this.prefix)}[nj](e){return np(e,"Directory"===this.type,this.portable)}write(e,t,i){"function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,"string"==typeof t?t:"utf8"));let r=e.length;if(r>this.blockRemain)throw Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e,i)}end(e,t,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),"function"==typeof e&&(i=e,t=void 0,e=void 0),"function"==typeof t&&(i=t,t=void 0),"string"==typeof e&&(e=Buffer.from(e,t??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}}let nW=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported";class nV{tail;head;length=0;static create(e=[]){return new nV(e)}constructor(e=[]){for(let t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw Error("removing node which does not belong to this list");let t=e.next,i=e.prev;return t&&(t.prev=i),i&&(i.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let i=0,r=e.length;i<r;i++){var t;t=this,t.tail=new nY(e[i],t.tail,void 0,t),t.head||(t.head=t.tail),t.length++}return this.length}unshift(...e){for(var t,i=0,r=e.length;i<r;i++){t=this,t.head=new nY(e[i],void 0,t.head,t),t.tail||(t.tail=t.head),t.length++}return this.length}pop(){if(!this.tail)return;let e=this.tail.value,t=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,t.list=void 0,this.length--,e}shift(){if(!this.head)return;let e=this.head.value,t=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,t.list=void 0,this.length--,e}forEach(e,t){t=t||this;for(let i=this.head,r=0;i;r++)e.call(t,i.value,r,this),i=i.next}forEachReverse(e,t){t=t||this;for(let i=this.tail,r=this.length-1;i;r--)e.call(t,i.value,r,this),i=i.prev}get(e){let t=0,i=this.head;for(;i&&t<e;t++)i=i.next;if(t===e&&i)return i.value}getReverse(e){let t=0,i=this.tail;for(;i&&t<e;t++)i=i.prev;if(t===e&&i)return i.value}map(e,t){t=t||this;let i=new nV;for(let r=this.head;r;)i.push(e.call(t,r.value,this)),r=r.next;return i}mapReverse(e,t){t=t||this;var i=new nV;for(let r=this.tail;r;)i.push(e.call(t,r.value,this)),r=r.prev;return i}reduce(e,t){let i,r=this.head;if(arguments.length>1)i=t;else if(this.head)r=this.head.next,i=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var n=0;r;n++)i=e(i,r.value,n),r=r.next;return i}reduceReverse(e,t){let i,r=this.tail;if(arguments.length>1)i=t;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(let t=this.length-1;r;t--)i=e(i,r.value,t),r=r.prev;return i}toArray(){let e=Array(this.length);for(let t=0,i=this.head;i;t++)e[t]=i.value,i=i.next;return e}toArrayReverse(){let e=Array(this.length);for(let t=0,i=this.tail;i;t++)e[t]=i.value,i=i.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new nV;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.head,n=0;for(n=0;r&&n<e;n++)r=r.next;for(;r&&n<t;n++,r=r.next)i.push(r.value);return i}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new nV;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.length,n=this.tail;for(;n&&r>t;r--)n=n.prev;for(;n&&r>e;r--,n=n.prev)i.push(n.value);return i}splice(e,t=0,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let r=this.head;for(let t=0;r&&t<e;t++)r=r.next;let n=[];for(let e=0;r&&e<t;e++)n.push(r.value),r=this.removeNode(r);for(let e of(r?r!==this.tail&&(r=r.prev):r=this.tail,i))r=function(e,t,i){let r=t?t.next:e.head,n=new nY(i,t,r,e);return void 0===n.next&&(e.tail=n),void 0===n.prev&&(e.head=n),e.length++,n}(this,r,e);return n}reverse(){let e=this.head,t=this.tail;for(let t=e;t;t=t.prev){let e=t.prev;t.prev=t.next,t.next=e}return this.head=t,this.tail=e,this}}class nY{list;next;prev;value;constructor(e,t,i,r){this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}}class nX{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}}let nK=Buffer.alloc(1024),nq=Symbol("onStat"),nJ=Symbol("ended"),nQ=Symbol("queue"),n0=Symbol("current"),n1=Symbol("process"),n2=Symbol("processing"),n3=Symbol("processJob"),n8=Symbol("jobs"),n6=Symbol("jobDone"),n5=Symbol("addFSEntry"),n4=Symbol("addTarEntry"),n9=Symbol("stat"),n7=Symbol("readdir"),se=Symbol("onreaddir"),st=Symbol("pipe"),si=Symbol("entry"),sr=Symbol("entryOpt"),sn=Symbol("writeEntryClass"),ss=Symbol("write"),so=Symbol("ondrain");class su extends iy{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[sn];onWriteEntry;[nQ];[n8]=0;[n2]=!1;[nJ]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=r$(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[sn]=nH,"function"==typeof e.onwarn&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if(+!!e.gzip+ +!!e.brotli+ +!!e.zstd>1)throw TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&("object"!=typeof e.gzip&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new ro(e.gzip)),e.brotli&&("object"!=typeof e.brotli&&(e.brotli={}),this.zip=new rl(e.brotli)),e.zstd&&("object"!=typeof e.zstd&&(e.zstd={}),this.zip=new rd(e.zstd)),!this.zip)throw Error("impossible");let t=this.zip;t.on("data",e=>super.write(e)),t.on("end",()=>super.end()),t.on("drain",()=>this[so]()),this.on("resume",()=>t.resume())}else this.on("drain",this[so]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter="function"==typeof e.filter?e.filter:()=>!0,this[nQ]=new nV,this[n8]=0,this.jobs=Number(e.jobs)||4,this[n2]=!1,this[nJ]=!1}[ss](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,i){return"function"==typeof e&&(i=e,e=void 0),"function"==typeof t&&(i=t,t=void 0),e&&this.add(e),this[nJ]=!0,this[n1](),i&&i(),this}write(e){if(this[nJ])throw Error("write after end");return e instanceof rj?this[n4](e):this[n5](e),this.flowing}[n4](e){let t=r$(td.default.resolve(this.cwd,e.path));if(this.filter(e.path,e)){let i=new nX(e.path,t);i.entry=new nZ(e,this[sr](i)),i.entry.on("end",()=>this[n6](i)),this[n8]+=1,this[nQ].push(i)}else e.resume();this[n1]()}[n5](e){let t=r$(td.default.resolve(this.cwd,e));this[nQ].push(new nX(e,t)),this[n1]()}[n9](e){e.pending=!0,this[n8]+=1;let t=this.follow?"stat":"lstat";tD.default[t](e.absolute,(t,i)=>{e.pending=!1,this[n8]-=1,t?this.emit("error",t):this[nq](e,i)})}[nq](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[n1]()}[n7](e){e.pending=!0,this[n8]+=1,tD.default.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[n8]-=1,t)return this.emit("error",t);this[se](e,i)})}[se](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[n1]()}[n1](){if(!this[n2]){this[n2]=!0;for(let e=this[nQ].head;e&&this[n8]<this.jobs;e=e.next)if(this[n3](e.value),e.value.ignore){let t=e.next;this[nQ].removeNode(e),e.next=t}this[n2]=!1,this[nJ]&&!this[nQ].length&&0===this[n8]&&(this.zip?this.zip.end(nK):(super.write(nK),super.end()))}}get[n0](){return this[nQ]&&this[nQ].head&&this[nQ].head.value}[n6](e){this[nQ].shift(),this[n8]-=1,this[n1]()}[n3](e){if(!e.pending){if(e.entry){e!==this[n0]||e.piped||this[st](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[nq](e,t):this[n9](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[se](e,t):this[n7](e),!e.readdir)return}if(e.entry=this[si](e),!e.entry){e.ignore=!0;return}e!==this[n0]||e.piped||this[st](e)}}}[sr](e){return{onwarn:(e,t,i)=>this.warn(e,t,i),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[si](e){this[n8]+=1;try{return new this[sn](e.path,this[sr](e)).on("end",()=>this[n6](e)).on("error",e=>this.emit("error",e))}catch(e){this.emit("error",e)}}[so](){this[n0]&&this[n0].entry&&this[n0].entry.resume()}[st](e){e.piped=!0,e.readdir&&e.readdir.forEach(t=>{let i=e.path,r="./"===i?"":i.replace(/\/*$/,"/");this[n5](r+t)});let t=e.entry,i=this.zip;if(!t)throw Error("cannot pipe without source");i?t.on("data",e=>{i.write(e)||t.pause()}):t.on("data",e=>{super.write(e)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,i={}){rP(this,e,t,i)}}class sa extends su{sync=!0;constructor(e){super(e),this[sn]=nG}pause(){}resume(){}[n9](e){let t=this.follow?"statSync":"lstatSync";this[nq](e,tD.default[t](e.absolute))}[n7](e){this[se](e,tD.default.readdirSync(e.absolute))}[st](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(t=>{let i=e.path,r="./"===i?"":i.replace(/\/*$/,"/");this[n5](r+t)}),!t)throw Error("Cannot pipe without source");i?t.on("data",e=>{i.write(e)}):t.on("data",e=>{super[ss](e)})}}let sl=(e,t)=>{t.forEach(t=>{"@"===t.charAt(0)?nf({file:u.resolve(e.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:t=>e.add(t)}):e.add(t)}),e.end()},sh=async(e,t)=>{for(let i=0;i<t.length;i++){let r=String(t[i]);"@"===r.charAt(0)?await nf({file:u.resolve(String(e.cwd),r.slice(1)),noResume:!0,onReadEntry:t=>{e.add(t)}}):e.add(r)}e.end()};i3((e,t)=>{let i=new sa(e),r=new iQ(e.file,{mode:e.mode||438});i.pipe(r),sl(i,t)},(e,t)=>{let i=new su(e),r=new iJ(e.file,{mode:e.mode||438});i.pipe(r);let n=new Promise((e,t)=>{r.on("error",t),r.on("close",e),i.on("error",t)});return sh(i,t),n},(e,t)=>{let i=new sa(e);return sl(i,t),i},(e,t)=>{let i=new su(e);return sh(i,t),i},(e,t)=>{if(!t?.length)throw TypeError("no paths specified to add to archive")});let sc=process.env.__FAKE_PLATFORM__||process.platform,{O_CREAT:sd,O_TRUNC:sD,O_WRONLY:sf}=tD.default.constants,sp=Number(process.env.__FAKE_FS_O_FILENAME__)||tD.default.constants.UV_FS_O_FILEMAP||0,sm=sp|sD|sd|sf,sE="win32"===sc&&sp?e=>e<524288?sm:"w":()=>"w",sg=(t,i,r)=>{try{return e.lchownSync(t,i,r)}catch(e){if(e?.code!=="ENOENT")throw e}},sb=(t,i,r,n)=>{e.lchown(t,i,r,e=>{n(e&&e?.code!=="ENOENT"?e:null)})},sy=(e,t,i,r,n)=>{t.isDirectory()?sF(u.resolve(e,t.name),i,r,s=>{if(s)return n(s);sb(u.resolve(e,t.name),i,r,n)}):sb(u.resolve(e,t.name),i,r,n)},sF=(t,i,r,n)=>{e.readdir(t,{withFileTypes:!0},(e,s)=>{if(e){if("ENOENT"===e.code)return n();else if("ENOTDIR"!==e.code&&"ENOTSUP"!==e.code)return n(e)}if(e||!s.length)return sb(t,i,r,n);let o=s.length,u=null,a=e=>{if(!u){if(e)return n(u=e);if(0==--o)return sb(t,i,r,n)}};for(let e of s)sy(t,e,i,r,a)})},sC=(e,t,i,r)=>{t.isDirectory()&&sv(u.resolve(e,t.name),i,r),sg(u.resolve(e,t.name),i,r)},sv=(t,i,r)=>{let n;try{n=e.readdirSync(t,{withFileTypes:!0})}catch(e){if(e?.code==="ENOENT")return;if(e?.code==="ENOTDIR"||e?.code==="ENOTSUP")return sg(t,i,r);throw e}for(let e of n)sC(t,e,i,r);return sg(t,i,r)};class sw extends Error{path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}}class s_ extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}}let sS=(t,i,r,n,s,o,a)=>{if(!i.length)return a(null,o);let l=i.shift(),h=r$(u.resolve(t+"/"+l));e.mkdir(h,r,sA(h,i,r,n,s,o,a))},sA=(t,i,r,n,s,o,u)=>a=>{a?e.lstat(t,(l,h)=>{if(l)l.path=l.path&&r$(l.path),u(l);else if(h.isDirectory())sS(t,i,r,n,s,o,u);else if(n)e.unlink(t,a=>{if(a)return u(a);e.mkdir(t,r,sA(t,i,r,n,s,o,u))});else{if(h.isSymbolicLink())return u(new s_(t,t+"/"+i.join("/")));u(a)}}):(o=o||t,sS(t,i,r,n,s,o,u))},sR=Object.create(null),sO=new Set,sB="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform);class sx{#D=new Map;#f=new Map;#p=new Set;reserve(e,t){let i=new Set((e=sB?["win32 parallelization disabled"]:e.map(e=>nd(d((e=>{sO.has(e)?sO.delete(e):sR[e]=e.normalize("NFD"),sO.add(e);let t=sR[e],i=sO.size-1e4;if(i>1e3){for(let e of sO)if(sO.delete(e),delete sR[e],--i<=0)break}return t})(e))).toLowerCase())).map(e=>e.split("/").slice(0,-1).reduce((e,t)=>{let i=e[e.length-1];return void 0!==i&&(t=d(i,t)),e.push(t||"/"),e},[])).reduce((e,t)=>e.concat(t)));for(let r of(this.#f.set(t,{dirs:i,paths:e}),e)){let e=this.#D.get(r);e?e.push(t):this.#D.set(r,[t])}for(let e of i){let i=this.#D.get(e);if(i){let e=i[i.length-1];e instanceof Set?e.add(t):i.push(new Set([t]))}else this.#D.set(e,[new Set([t])])}return this.#m(t)}#E(e){let t=this.#f.get(e);if(!t)throw Error("function does not have any path reservations");return{paths:t.paths.map(e=>this.#D.get(e)),dirs:[...t.dirs].map(e=>this.#D.get(e))}}check(e){let{paths:t,dirs:i}=this.#E(e);return t.every(t=>t&&t[0]===e)&&i.every(t=>t&&t[0]instanceof Set&&t[0].has(e))}#m(e){return!this.#p.has(e)&&!!this.check(e)&&(this.#p.add(e),e(()=>this.#g(e)),!0)}#g(e){if(!this.#p.has(e))return!1;let t=this.#f.get(e);if(!t)throw Error("invalid reservation");let{paths:i,dirs:r}=t,n=new Set;for(let t of i){let i=this.#D.get(t);if(!i||i?.[0]!==e)continue;let r=i[1];if(!r){this.#D.delete(t);continue}if(i.shift(),"function"==typeof r)n.add(r);else for(let e of r)n.add(e)}for(let t of r){let i=this.#D.get(t),r=i?.[0];if(i&&r instanceof Set)if(1===r.size&&1===i.length){this.#D.delete(t);continue}else if(1===r.size){i.shift();let e=i[0];"function"==typeof e&&n.add(e)}else r.delete(e)}return this.#p.delete(e),n.forEach(e=>this.#m(e)),!0}}let sN=Symbol("onEntry"),sI=Symbol("checkFs"),sT=Symbol("checkFs2"),sL=Symbol("isReusable"),sk=Symbol("makeFs"),sM=Symbol("file"),s$=Symbol("directory"),sj=Symbol("link"),sP=Symbol("symlink"),sz=Symbol("hardlink"),sU=Symbol("unsupported"),sH=Symbol("checkPath"),sG=Symbol("mkdir"),sZ=Symbol("onError"),sW=Symbol("pending"),sV=Symbol("pend"),sY=Symbol("unpend"),sX=Symbol("ended"),sK=Symbol("maybeClose"),sq=Symbol("skip"),sJ=Symbol("doChown"),sQ=Symbol("uid"),s0=Symbol("gid"),s1=Symbol("checkedCwd"),s2="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform),s3=(e,t,i)=>void 0!==e&&e===e>>>0?e:void 0!==t&&t===t>>>0?t:i;class s8 extends nc{[sX]=!1;[s1]=!1;[sW]=0;reservations=new sx;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(e={}){if(e.ondone=()=>{this[sX]=!0,this[sK]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,"number"==typeof e.uid||"number"==typeof e.gid){if("number"!=typeof e.uid||"number"!=typeof e.gid)throw TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;void 0===e.preserveOwner&&"number"!=typeof e.uid?this.preserveOwner=!!(process.getuid&&0===process.getuid()):this.preserveOwner=!!e.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="number"==typeof e.maxDepth?e.maxDepth:1024,this.forceChown=!0===e.forceChown,this.win32=!!e.win32||s2,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=r$(u.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?"number"==typeof e.processUmask?e.processUmask:process.umask():0,this.umask="number"==typeof e.umask?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",e=>this[sN](e))}warn(e,t,i={}){return("TAR_BAD_ARCHIVE"===e||"TAR_ABORT"===e)&&(i.recoverable=!1),super.warn(e,t,i)}[sK](){this[sX]&&0===this[sW]&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[sH](e){let t=r$(e.path),i=t.split("/");if(this.strip){if(i.length<this.strip)return!1;if("Link"===e.type){let t=r$(String(e.linkpath)).split("/");if(!(t.length>=this.strip))return!1;e.linkpath=t.slice(this.strip).join("/")}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(i.includes("..")||s2&&/^[a-z]:\.\.$/i.test(i[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[r,n]=ng(t);r&&(e.path=String(n),this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:e,path:t}))}if(u.isAbsolute(e.path)?e.absolute=r$(u.resolve(e.path)):e.absolute=r$(u.resolve(this.cwd,e.path)),!this.preservePaths&&"string"==typeof e.absolute&&0!==e.absolute.indexOf(this.cwd+"/")&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:r$(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&"Directory"!==e.type&&"GNUDumpDir"!==e.type)return!1;if(this.win32){let{root:t}=u.win32.parse(String(e.absolute));e.absolute=t+nv(String(e.absolute).slice(t.length));let{root:i}=u.win32.parse(e.path);e.path=i+nv(e.path.slice(i.length))}return!0}[sN](e){if(!this[sH](e))return e.resume();switch(z.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=448|e.mode);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[sI](e);default:return this[sU](e)}}[sZ](e,t){"CwdError"===e.name?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[sY](),t.resume())}[sG](t,i,r){((t,i,r)=>{t=r$(t);let n=i.umask??18,s=448|i.mode,o=(s&n)!=0,a=i.uid,l=i.gid,h="number"==typeof a&&"number"==typeof l&&(a!==i.processUid||l!==i.processGid),c=i.preserve,d=i.unlink,D=r$(i.cwd),f=(i,n)=>{i?r(i):n&&h?sF(n,a,l,e=>f(e)):o?e.chmod(t,s,r):r()};if(t===D){var p;return p=t,e.stat(p,(e,t)=>{(e||!t.isDirectory())&&(e=new sw(p,e?.code||"ENOTDIR")),f(e)})}if(c)return R.mkdir(t,{mode:s,recursive:!0}).then(e=>f(null,e??void 0),f);let m=r$(u.relative(D,t)).split("/");sS(D,m,s,d,D,void 0,f)})(r$(t),{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:i},r)}[sJ](e){return this.forceChown||this.preserveOwner&&("number"==typeof e.uid&&e.uid!==this.processUid||"number"==typeof e.gid&&e.gid!==this.processGid)||"number"==typeof this.uid&&this.uid!==this.processUid||"number"==typeof this.gid&&this.gid!==this.processGid}[sQ](e){return s3(this.uid,e.uid,this.processUid)}[s0](e){return s3(this.gid,e.gid,this.processGid)}[sM](t,i){let r="number"==typeof t.mode?4095&t.mode:this.fmode,n=new iJ(String(t.absolute),{flags:sE(t.size),mode:r,autoClose:!1});n.on("error",r=>{n.fd&&e.close(n.fd,()=>{}),n.write=()=>!0,this[sZ](r,t),i()});let s=1,o=r=>{if(r){n.fd&&e.close(n.fd,()=>{}),this[sZ](r,t),i();return}0==--s&&void 0!==n.fd&&e.close(n.fd,e=>{e?this[sZ](e,t):this[sY](),i()})};n.on("finish",()=>{let i=String(t.absolute),r=n.fd;if("number"==typeof r&&t.mtime&&!this.noMtime){s++;let n=t.atime||new Date,u=t.mtime;e.futimes(r,n,u,t=>t?e.utimes(i,n,u,e=>o(e&&t)):o())}if("number"==typeof r&&this[sJ](t)){s++;let n=this[sQ](t),u=this[s0](t);"number"==typeof n&&"number"==typeof u&&e.fchown(r,n,u,t=>t?e.chown(i,n,u,e=>o(e&&t)):o())}o()});let u=this.transform&&this.transform(t)||t;u!==t&&(u.on("error",e=>{this[sZ](e,t),i()}),t.pipe(u)),u.pipe(n)}[s$](t,i){let r="number"==typeof t.mode?4095&t.mode:this.dmode;this[sG](String(t.absolute),r,r=>{if(r){this[sZ](r,t),i();return}let n=1,s=()=>{0==--n&&(i(),this[sY](),t.resume())};t.mtime&&!this.noMtime&&(n++,e.utimes(String(t.absolute),t.atime||new Date,t.mtime,s)),this[sJ](t)&&(n++,e.chown(String(t.absolute),Number(this[sQ](t)),Number(this[s0](t)),s)),s()})}[sU](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[sP](e,t){this[sj](e,String(e.linkpath),"symlink",t)}[sz](e,t){let i=r$(u.resolve(this.cwd,String(e.linkpath)));this[sj](e,i,"link",t)}[sV](){this[sW]++}[sY](){this[sW]--,this[sK]()}[sq](e){this[sY](),e.resume()}[sL](e,t){return"File"===e.type&&!this.unlink&&t.isFile()&&t.nlink<=1&&!s2}[sI](e){this[sV]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,t=>this[sT](e,t))}[sT](t,i){let r=e=>{i(e)},n=()=>{this[sG](this.cwd,this.dmode,e=>{if(e){this[sZ](e,t),r();return}this[s1]=!0,s()})},s=()=>{if(t.absolute!==this.cwd){let e=r$(u.dirname(String(t.absolute)));if(e!==this.cwd)return this[sG](e,this.dmode,e=>{if(e){this[sZ](e,t),r();return}o()})}o()},o=()=>{e.lstat(String(t.absolute),(i,n)=>{if(n&&(this.keep||this.newer&&n.mtime>(t.mtime??n.mtime))){this[sq](t),r();return}if(i||this[sL](t,n))return this[sk](null,t,r);if(n.isDirectory()){if("Directory"===t.type){let i=this.chmod&&t.mode&&(4095&n.mode)!==t.mode,s=e=>this[sk](e??null,t,r);return i?e.chmod(String(t.absolute),Number(t.mode),s):s()}if(t.absolute!==this.cwd)return e.rmdir(String(t.absolute),e=>this[sk](e??null,t,r))}if(t.absolute===this.cwd)return this[sk](null,t,r);((t,i)=>{if(!s2)return e.unlink(t,i);let r=t+".DELETE."+U(16).toString("hex");e.rename(t,r,t=>{if(t)return i(t);e.unlink(r,i)})})(String(t.absolute),e=>this[sk](e??null,t,r))})};this[s1]?s():n()}[sk](e,t,i){if(e){this[sZ](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[sM](t,i);case"Link":return this[sz](t,i);case"SymbolicLink":return this[sP](t,i);case"Directory":case"GNUDumpDir":return this[s$](t,i)}}[sj](t,i,r,n){e[r](i,String(t.absolute),e=>{e?this[sZ](e,t):(this[sY](),t.resume()),n()})}}let s6=e=>{try{return[null,e()]}catch(e){return[e,null]}};class s5 extends s8{sync=!0;[sk](e,t){return super[sk](e,t,()=>{})}[sI](t){if(!this[s1]){let e=this[sG](this.cwd,this.dmode);if(e)return this[sZ](e,t);this[s1]=!0}if(t.absolute!==this.cwd){let e=r$(u.dirname(String(t.absolute)));if(e!==this.cwd){let i=this[sG](e,this.dmode);if(i)return this[sZ](i,t)}}let[i,r]=s6(()=>e.lstatSync(String(t.absolute)));if(r&&(this.keep||this.newer&&r.mtime>(t.mtime??r.mtime)))return this[sq](t);if(i||this[sL](t,r))return this[sk](null,t);if(r.isDirectory()){if("Directory"===t.type){let[i]=this.chmod&&t.mode&&(4095&r.mode)!==t.mode?s6(()=>{e.chmodSync(String(t.absolute),Number(t.mode))}):[];return this[sk](i,t)}let[i]=s6(()=>e.rmdirSync(String(t.absolute)));this[sk](i,t)}let[n]=t.absolute===this.cwd?[]:s6(()=>(t=>{if(!s2)return e.unlinkSync(t);let i=t+".DELETE."+U(16).toString("hex");e.renameSync(t,i),e.unlinkSync(i)})(String(t.absolute)));this[sk](n,t)}[sM](t,i){let r,n="number"==typeof t.mode?4095&t.mode:this.fmode,s=n=>{let s;try{e.closeSync(r)}catch(e){s=e}(n||s)&&this[sZ](n||s,t),i()};try{r=e.openSync(String(t.absolute),sE(t.size),n)}catch(e){return s(e)}let o=this.transform&&this.transform(t)||t;o!==t&&(o.on("error",e=>this[sZ](e,t)),t.pipe(o)),o.on("data",t=>{try{e.writeSync(r,t,0,t.length)}catch(e){s(e)}}),o.on("end",()=>{let i=null;if(t.mtime&&!this.noMtime){let n=t.atime||new Date,s=t.mtime;try{e.futimesSync(r,n,s)}catch(r){try{e.utimesSync(String(t.absolute),n,s)}catch(e){i=r}}}if(this[sJ](t)){let n=this[sQ](t),s=this[s0](t);try{e.fchownSync(r,Number(n),Number(s))}catch(r){try{e.chownSync(String(t.absolute),Number(n),Number(s))}catch(e){i=i||r}}}s(i)})}[s$](t,i){let r="number"==typeof t.mode?4095&t.mode:this.dmode,n=this[sG](String(t.absolute),r);if(n){this[sZ](n,t),i();return}if(t.mtime&&!this.noMtime)try{e.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch(e){}if(this[sJ](t))try{e.chownSync(String(t.absolute),Number(this[sQ](t)),Number(this[s0](t)))}catch(e){}i(),t.resume()}[sG](t,i){try{return((t,i)=>{let r;t=r$(t);let n=i.umask??18,s=448|i.mode,o=(s&n)!=0,a=i.uid,l=i.gid,h="number"==typeof a&&"number"==typeof l&&(a!==i.processUid||l!==i.processGid),c=i.preserve,d=i.unlink,D=r$(i.cwd),f=i=>{i&&h&&sv(i,a,l),o&&e.chmodSync(t,s)};if(t===D){let t,i=!1;try{i=e.statSync(D).isDirectory()}catch(e){t=e?.code}finally{if(!i)throw new sw(D,t??"ENOTDIR")}return f()}if(c)return f(e.mkdirSync(t,{mode:s,recursive:!0})??void 0);let p=r$(u.relative(D,t)).split("/");for(let t=p.shift(),i=D;t&&(i+="/"+t);t=p.shift()){i=r$(u.resolve(i));try{e.mkdirSync(i,s),r=r||i}catch(n){let t=e.lstatSync(i);if(t.isDirectory())continue;if(d){e.unlinkSync(i),e.mkdirSync(i,s),r=r||i;continue}if(t.isSymbolicLink())return new s_(i,i+"/"+p.join("/"))}}return f(r)})(r$(t),{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:i})}catch(e){return e}}[sj](t,i,r,n){let s=`${r}Sync`;try{e[s](i,String(t.absolute)),n(),t.resume()}catch(e){return this[sZ](e,t)}}}let s4=i3(t=>{let i=new s5(t),r=t.file,n=e.statSync(r);new iq(r,{readSize:t.maxReadSize||0x1000000,size:n.size}).pipe(i)},(t,i)=>{let r=new s8(t),n=t.maxReadSize||0x1000000,s=t.file;return new Promise((t,i)=>{r.on("error",i),r.on("close",t),e.stat(s,(e,t)=>{if(e)i(e);else{let e=new iK(s,{readSize:n,size:t.size});e.on("error",i),e.pipe(r)}})})},e=>new s5(e),e=>new s8(e),(e,t)=>{t?.length&&nD(e,t)}),s9=(e,t)=>{t.forEach(t=>{"@"===t.charAt(0)?nf({file:u.resolve(e.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:t=>e.add(t)}):e.add(t)}),e.end()},s7=async(e,t)=>{for(let i=0;i<t.length;i++){let r=String(t[i]);"@"===r.charAt(0)?await nf({file:u.resolve(String(e.cwd),r.slice(1)),noResume:!0,onReadEntry:t=>e.add(t)}):e.add(r)}e.end()},oe=i3((t,i)=>{let r,n,s=new sa(t),o=!0;try{try{r=e.openSync(t.file,"r+")}catch(i){if(i?.code==="ENOENT")r=e.openSync(t.file,"w+");else throw i}let u=e.fstatSync(r),a=Buffer.alloc(512);e:for(n=0;n<u.size;n+=512){for(let t=0,i=0;t<512;t+=i){if(i=e.readSync(r,a,t,a.length-t,n+t),0===n&&31===a[0]&&139===a[1])throw Error("cannot append to compressed archives");if(!i)break e}let i=new rb(a);if(!i.cksumValid)break;let s=512*Math.ceil((i.size||0)/512);if(n+s+512>u.size)break;n+=s,t.mtimeCache&&i.mtime&&t.mtimeCache.set(String(i.path),i.mtime)}o=!1,((e,t,i,r,n)=>{let s=new iQ(e.file,{fd:r,start:i});t.pipe(s),s9(t,n)})(t,s,n,r,i)}finally{if(o)try{e.closeSync(r)}catch(e){}}},(t,i)=>{i=Array.from(i);let r=new su(t);return new Promise((n,s)=>{r.on("error",s);let o="r+",u=(a,l)=>a&&"ENOENT"===a.code&&"r+"===o?(o="w+",e.open(t.file,o,u)):a||!l?s(a):void e.fstat(l,(o,u)=>{if(o)return e.close(l,()=>s(o));((i,r,n)=>{let s=(t,r)=>{t?e.close(i,e=>n(t)):n(null,r)},o=0;if(0===r)return s(null,0);let u=0,a=Buffer.alloc(512),l=(n,h)=>{if(n||void 0===h)return s(n);if((u+=h)<512&&h)return e.read(i,a,u,a.length-u,o+u,l);if(0===o&&31===a[0]&&139===a[1])return s(Error("cannot append to compressed archives"));if(u<512)return s(null,o);let c=new rb(a);if(!c.cksumValid)return s(null,o);let d=512*Math.ceil((c.size??0)/512);if(o+d+512>r||(o+=d+512)>=r)return s(null,o);t.mtimeCache&&c.mtime&&t.mtimeCache.set(String(c.path),c.mtime),u=0,e.read(i,a,0,512,o,l)};e.read(i,a,0,512,o,l)})(l,u.size,(e,o)=>{if(e)return s(e);let u=new iJ(t.file,{fd:l,start:o});r.pipe(u),u.on("error",s),u.on("close",n),s7(r,i)})});e.open(t.file,o,u)})},()=>{throw TypeError("file is required")},()=>{throw TypeError("file is required")},(e,t)=>{if(!e.file)throw TypeError("file is required");if(e.gzip||e.brotli||e.zstd||e.file.endsWith(".br")||e.file.endsWith(".tbr"))throw TypeError("cannot append to compressed archives");if(!t?.length)throw TypeError("no paths specified to add/replace")});i3(oe.syncFile,oe.asyncFile,oe.syncNoFile,oe.asyncNoFile,(e,t=[])=>{oe.validate?.(e,t),ot(e)});let ot=e=>{let t=e.filter;e.mtimeCache||(e.mtimeCache=new Map),e.filter=t?(i,r)=>t(i,r)&&!((e.mtimeCache?.get(i)??r.mtime??0)>(r.mtime??0)):(t,i)=>!((e.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0))};async function oi(e,t){if(!await on())return void te.info("Git client not found, skipping git initialization");if(await os(e))return void te.debug("Git repo already initialized, skipping git initialization");let i=tl();i.start("Initializing git repo");let r=`Initial commit
64
64
 
65
- Generated by rock${t?`@${t}`:""}.`;await or(e,r),i.stop("Git repo initialized.")}async function or(e,t){try{await tz("git",["init"],{cwd:e}),await tz("git",["branch","-M","main"],{cwd:e}),await tz("git",["add","."],{cwd:e}),await tz("git",["commit","-m",t],{cwd:e})}catch(e){te.warn("Failed to initialize git repository",e)}}async function on(){try{return await tz("git",["--version"],{stdio:"ignore"}),!0}catch{return!1}}async function os(e){try{return await tz("git",["rev-parse","--is-inside-work-tree"],{stdio:"ignore",cwd:e}),!0}catch{return!1}}let oo=[{type:"npm",name:"default",displayName:"default",packageName:"@rock-js/template-default",version:"latest",directory:"."}],ou=[{type:"npm",name:"brownfield-ios",displayName:"Brownfield iOS",packageName:"@rock-js/plugin-brownfield-ios",hint:"Setup packaging React Native app as a XCFramework",version:"latest",directory:"template",importName:"pluginBrownfieldIos"},{type:"npm",name:"brownfield-android",displayName:"Brownfield Android",packageName:"@rock-js/plugin-brownfield-android",hint:"Setup packaging React Native app as an AAR",version:"latest",directory:"template",importName:"pluginBrownfieldAndroid"}],oa=[{type:"npm",name:"metro",displayName:"Metro",packageName:"@rock-js/plugin-metro",version:"latest",directory:"template",importName:"pluginMetro"},{type:"npm",name:"repack",displayName:"Re.Pack",packageName:"@rock-js/plugin-repack",version:"latest",directory:"template",importName:"pluginRepack"}],ol=[{type:"npm",name:"ios",displayName:"iOS",packageName:"@rock-js/platform-ios",version:"latest",directory:"template",importName:"platformIOS"},{type:"npm",name:"android",displayName:"Android",packageName:"@rock-js/platform-android",version:"latest",directory:"template",importName:"platformAndroid"},{type:"npm",name:"harmony",displayName:"Harmony (experimental)",packageName:"@rock-js/platform-harmony",version:"latest",directory:"template",importName:"platformHarmony"}];function oh(e){return e.filter(e=>!Array.isArray(e)||!!e[1]).map(e=>Array.isArray(e)?e[0]:e).join("\n ")}function oc(e,t){let i=e.find(e=>e.name===t);if(i)return i;if(t.startsWith("./")||t.startsWith("../")||t.startsWith("/")||t.startsWith("file:///")){t.startsWith("file://")&&(t=t.slice(7));let e=a(t),i=h(e);return{type:"local",name:e.slice(0,e.length-i.length),displayName:e.slice(0,e.length-i.length),localPath:tU(t),directory:".",packageName:e.slice(0,e.length-i.length)}}return{type:"npm",name:od(t),displayName:od(t),packageName:od(t),directory:".",version:function(e){let t=e.split("@");return 3===t.length&&""===t[0]?t[2]:2===t.length&&""!==t[0]?t[1]:null}(t)??"latest"}}function od(e){let t=e.split("@");return 3===t.length&&""===t[0]?`@${t[1]}`:2===t.length&&""!==t[0]?t[0]:e}function oD(e,t,i){void 0!==i&&(e[t]=i)}function of(n,s,{skipFiles:a=[]}={}){for(let l of(e.mkdirSync(s,{recursive:!0}),e.readdirSync(n))){let h=u.resolve(n,l),c=e.statSync(h),d=u.resolve(s,l);if(c.isDirectory())of(h,d,{skipFiles:a});else if("package.json"===u.basename(h)){let e=JSON.parse(r(h,"utf-8"));i(d)||t(h,d);let n=JSON.parse(r(d,"utf-8"));n.scripts={...n.scripts,...e.scripts},n.dependencies={...n.dependencies,...e.dependencies},n.devDependencies={...n.devDependencies,...e.devDependencies},n.peerDependencies={...n.peerDependencies,...e.peerDependencies},o(d,JSON.stringify(n,null,2))}else(null==a?void 0:a.includes(u.basename(h)))||e.copyFileSync(h,d)}}function op(t){e.existsSync(t)&&e.rmSync(t,{recursive:!0})}function om(t,i,r){let n=u.join(u.dirname(t),u.basename(t).replaceAll(i,r));e.renameSync(t,n)}let og="HelloWorld";function oE(){return e.existsSync(u.join(process.cwd(),"pnpm-lock.yaml"))?"pnpm":e.existsSync(u.join(process.cwd(),"yarn.lock"))||e.existsSync(u.join(process.cwd(),".yarn"))?"yarn":e.existsSync(u.join(process.cwd(),"bun.lockb"))||e.existsSync(u.join(process.cwd(),"bun.lock"))?"bun":"npm"}async function ob(t){var i,r,n;let s=oE(),o=tl();o.start(`Adding ${J().bold("Rock")} dependencies with ${J().bold(s)}`),await oy(t,s,["rock","@rock-js/plugin-metro","@rock-js/platform-android","@rock-js/platform-ios"]),o.stop(`Added ${J().bold("Rock")} dependencies`),o.start(`Removing ${J().bold("React Native Community CLI")} packages`),await oF(t,s,["@react-native-community/cli","@react-native-community/cli-platform-android","@react-native-community/cli-platform-ios"]),o.stop(`Removed ${J().bold("React Native Community CLI")} packages`),o.start(`Adding ${J().bold(".gitignore")} entry for .rock/`),function(t,i){let r=u.join(t,".gitignore");e.existsSync(r)&&!e.readFileSync(r,"utf8").includes(i)&&e.appendFileSync(r,`
65
+ Generated by rock${t?`@${t}`:""}.`;await or(e,r),i.stop("Git repo initialized.")}async function or(e,t){try{await tz("git",["init"],{cwd:e}),await tz("git",["branch","-M","main"],{cwd:e}),await tz("git",["add","."],{cwd:e}),await tz("git",["commit","-m",t],{cwd:e})}catch(e){te.warn("Failed to initialize git repository",e)}}async function on(){try{return await tz("git",["--version"],{stdio:"ignore"}),!0}catch{return!1}}async function os(e){try{return await tz("git",["rev-parse","--is-inside-work-tree"],{stdio:"ignore",cwd:e}),!0}catch{return!1}}let oo=[{type:"npm",name:"default",displayName:"default",packageName:"@rock-js/template-default",version:"latest",directory:"."}],ou=[{type:"npm",name:"brownfield-ios",displayName:"Brownfield iOS",packageName:"@rock-js/plugin-brownfield-ios",hint:"Setup packaging React Native app as a XCFramework",version:"latest",directory:"template",importName:"pluginBrownfieldIos"},{type:"npm",name:"brownfield-android",displayName:"Brownfield Android",packageName:"@rock-js/plugin-brownfield-android",hint:"Setup packaging React Native app as an AAR",version:"latest",directory:"template",importName:"pluginBrownfieldAndroid"}],oa=[{type:"npm",name:"metro",displayName:"Metro",packageName:"@rock-js/plugin-metro",version:"latest",directory:"template",importName:"pluginMetro"},{type:"npm",name:"repack",displayName:"Re.Pack",packageName:"@rock-js/plugin-repack",version:"latest",directory:"template",importName:"pluginRepack"}],ol=[{type:"npm",name:"ios",displayName:"iOS",packageName:"@rock-js/platform-ios",version:"latest",directory:"template",importName:"platformIOS"},{type:"npm",name:"android",displayName:"Android",packageName:"@rock-js/platform-android",version:"latest",directory:"template",importName:"platformAndroid"},{type:"npm",name:"harmony",displayName:"Harmony (experimental)",packageName:"@rock-js/platform-harmony",version:"latest",directory:"template",importName:"platformHarmony"}];function oh(e){return e.filter(e=>!Array.isArray(e)||!!e[1]).map(e=>Array.isArray(e)?e[0]:e).join("\n ")}function oc(e,t){let i=e.find(e=>e.name===t);if(i)return i;if(t.startsWith("./")||t.startsWith("../")||t.startsWith("/")||t.startsWith("file:///")){t.startsWith("file://")&&(t=t.slice(7));let e=a(t),i=h(e);return{type:"local",name:e.slice(0,e.length-i.length),displayName:e.slice(0,e.length-i.length),localPath:tU(t),directory:".",packageName:e.slice(0,e.length-i.length)}}return{type:"npm",name:od(t),displayName:od(t),packageName:od(t),directory:".",version:function(e){let t=e.split("@");return 3===t.length&&""===t[0]?t[2]:2===t.length&&""!==t[0]?t[1]:null}(t)??"latest"}}function od(e){let t=e.split("@");return 3===t.length&&""===t[0]?`@${t[1]}`:2===t.length&&""!==t[0]?t[0]:e}function oD(e,t,i){void 0!==i&&(e[t]=i)}function of(n,s,{skipFiles:a=[]}={}){for(let l of(e.mkdirSync(s,{recursive:!0}),e.readdirSync(n))){let h=u.resolve(n,l),c=e.statSync(h),d=u.resolve(s,l);if(c.isDirectory())of(h,d,{skipFiles:a});else if("package.json"===u.basename(h)){let e=JSON.parse(r(h,"utf-8"));i(d)||t(h,d);let n=JSON.parse(r(d,"utf-8"));n.scripts={...n.scripts,...e.scripts},n.dependencies={...n.dependencies,...e.dependencies},n.devDependencies={...n.devDependencies,...e.devDependencies},n.peerDependencies={...n.peerDependencies,...e.peerDependencies},o(d,JSON.stringify(n,null,2))}else(null==a?void 0:a.includes(u.basename(h)))||e.copyFileSync(h,d)}}function op(t){e.existsSync(t)&&e.rmSync(t,{recursive:!0})}function om(t,i,r){let n=u.join(u.dirname(t),u.basename(t).replaceAll(i,r));e.renameSync(t,n)}let oE="HelloWorld";function og(){return e.existsSync(u.join(process.cwd(),"pnpm-lock.yaml"))?"pnpm":e.existsSync(u.join(process.cwd(),"yarn.lock"))||e.existsSync(u.join(process.cwd(),".yarn"))?"yarn":e.existsSync(u.join(process.cwd(),"bun.lockb"))||e.existsSync(u.join(process.cwd(),"bun.lock"))?"bun":"npm"}async function ob(t){var i,r,n;let s=og(),o=tl();o.start(`Adding ${J().bold("Rock")} dependencies with ${J().bold(s)}`),await oy(t,s,["rock","@rock-js/plugin-metro","@rock-js/platform-android","@rock-js/platform-ios"]),o.stop(`Added ${J().bold("Rock")} dependencies`),o.start(`Removing ${J().bold("React Native Community CLI")} packages`),await oF(t,s,["@react-native-community/cli","@react-native-community/cli-platform-android","@react-native-community/cli-platform-ios"]),o.stop(`Removed ${J().bold("React Native Community CLI")} packages`),o.start(`Adding ${J().bold(".gitignore")} entry for .rock/`),function(t,i){let r=u.join(t,".gitignore");e.existsSync(r)&&!e.readFileSync(r,"utf8").includes(i)&&e.appendFileSync(r,`
66
66
  # Rock
67
67
  ${i}
68
68
  `)}(t,".rock/"),o.stop(`Added ${J().bold(".gitignore")} entry for .rock/`),o.start(`Generating ${J().bold("rock.config.mjs")}`);let a=function(t){let i=u.join(t,"react-native.config.js");if(!e.existsSync(i))return{};try{var r,n;let e=H(import.meta.url)(i);return{ios:null==(r=e.project)?void 0:r.ios,android:null==(n=e.project)?void 0:n.android}}catch{return{}}}(t);(function(t,i){let r=u.join(t,"rock.config.mjs"),n=i.ios?`({
@@ -86,7 +86,7 @@ export default {
86
86
  `;e.writeFileSync(r,o)})(t,a),o.stop(`Generated ${J().bold("rock.config.mjs")}`);let l=(null==(i=a.ios)?void 0:i.sourceDir)??"ios",h=(null==(r=a.android)?void 0:r.sourceDir)??"android";o.start(`Updating ${J().bold(`${h}/app/build.gradle`)} and ${J().bold(`${h}/settings.gradle`)}`),function(t,i){let r=u.join(t,i,"app","build.gradle");if(!e.existsSync(r))return;let n='cliFile = file("../../node_modules/rock/dist/src/bin.js")',s=e.readFileSync(r,"utf8");if(s.includes(n))return te.debug(`${r} already contains "${n}"`);let o=s.replace(/(?:\/\/\s+)?cliFile\s*=\s*file\([^)]*\)/g,n);if(o===s)return te.warn(`Unable to update ${J().bold(r)}.
87
87
  Please update the "CLI file" build phase manually with:
88
88
  cliFile = file("../../node_modules/rock/dist/src/bin.js")
89
- `);e.writeFileSync(r,o)}(t,h),function(t,i){let r=u.join(t,i,"settings.gradle");if(!e.existsSync(r))return;let n=e.readFileSync(r,"utf8"),s=n.replace(/extensions\.configure\(com\.facebook\.react\.ReactSettingsExtension\)\{[^}]*autolinkLibrariesFromCommand\([^)]*\)[^}]*\}/gs,"extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand(['npx', 'rock', 'config', '-p', 'android']) }");s===n&&(s=n.replace(/autolinkLibrariesFromCommand\([^)]*\)/g,"autolinkLibrariesFromCommand(['npx', 'rock', 'config', '-p', 'android'])")),s!==n&&e.writeFileSync(r,s)}(t,h),o.stop(`Updated ${J().bold(`${h}/app/build.gradle`)} and ${J().bold(`${h}/settings.gradle`)}`),o.start(`Updating ${J().bold(`${l}/Podfile`)}`),function(t,i){let r=u.join(t,i,"Podfile");if(!e.existsSync(r))return;let n=e.readFileSync(r,"utf8"),s=n.replace(/(config\s*=\s*use_native_modules!)(\s*)/g,"$1(['npx', 'rock', 'config', '-p', 'ios'])$2");n.includes("(['npx', 'rock', 'config', '-p', 'ios'])")||s===n||e.writeFileSync(r,s)}(t,l),o.stop(`Updated ${J().bold(`${l}/Podfile`)}`),o.start(`Updating ${J().bold(`${l}/project.pbxproj`)}`),function(t,i){let r=e.readdirSync(u.join(t,i)).find(e=>e.endsWith(".xcodeproj")),n=r?u.join(t,i,r,"project.pbxproj"):void 0;if(!n)return te.debug(`No Xcode project found in ${i}`);let s=e.readFileSync(n,"utf8"),o=s.replace('shellScript = "set -e\\n\\nWITH_ENVIRONMENT=\\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\\"\\nREACT_NATIVE_XCODE=\\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\\"\\n\\n/bin/sh -c \\"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\\"\\n";','shellScript = "set -e\\nif [[ -f \\"$PODS_ROOT/../.xcode.env\\" ]]; then\\nsource \\"$PODS_ROOT/../.xcode.env\\"\\nfi\\nif [[ -f \\"$PODS_ROOT/../.xcode.env.local\\" ]]; then\\nsource \\"$PODS_ROOT/../.xcode.env.local\\"\\nfi\\nexport CONFIG_CMD=\\"dummy-workaround-value\\"\\nexport CLI_PATH=\\"$(\\"$NODE_BINARY\\" --print \\"require(\'path\').dirname(require.resolve(\'rock/package.json\')) + \'/dist/src/bin.js\'\\")\\"\\nWITH_ENVIRONMENT=\\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\\"\\n";');o!==s?e.writeFileSync(n,o):te.warn(`Unable to update ${J().bold(n)}.
89
+ `);e.writeFileSync(r,o)}(t,h),function(t,i){let r=u.join(t,i,"settings.gradle");if(!e.existsSync(r))return;let n=e.readFileSync(r,"utf8"),s=n.replace(/extensions\.configure\(com\.facebook\.react\.ReactSettingsExtension\)\{[^}]*autolinkLibrariesFromCommand\([^)]*\)[^}]*\}/gs,"extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand(['npx', 'rock', 'config', '-p', 'android']) }");s===n&&(s=n.replace(/autolinkLibrariesFromCommand\([^)]*\)/g,"autolinkLibrariesFromCommand(['npx', 'rock', 'config', '-p', 'android'])")),s!==n&&e.writeFileSync(r,s)}(t,h),o.stop(`Updated ${J().bold(`${h}/app/build.gradle`)} and ${J().bold(`${h}/settings.gradle`)}`),o.start(`Updating ${J().bold(`${l}/Podfile`)}`),function(t,i){let r=u.join(t,i,"Podfile");if(!e.existsSync(r))return;let n=e.readFileSync(r,"utf8"),s=n.replace(/(config\s*=\s*use_native_modules!)(\s*)/g,"$1(['npx', 'rock', 'config', '-p', 'ios'])$2");n.includes("(['npx', 'rock', 'config', '-p', 'ios'])")||s===n||e.writeFileSync(r,s)}(t,l),o.stop(`Updated ${J().bold(`${l}/Podfile`)}`),o.start(`Updating ${J().bold(`${l}/project.pbxproj`)}`),function(t,i){let r=e.readdirSync(u.join(t,i)).find(e=>e.endsWith(".xcodeproj")),n=r?u.join(t,i,r,"project.pbxproj"):void 0;if(!n)return te.debug(`No Xcode project found in ${i}`);let s=e.readFileSync(n,"utf8");for(let t of['shellScript = "set -e\\n\\nWITH_ENVIRONMENT=\\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\\"\\nREACT_NATIVE_XCODE=\\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\\"\\n\\n/bin/sh -c \\"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\\"\\n";','shellScript = "set -e\\n\\nWITH_ENVIRONMENT=\\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\\"\\nREACT_NATIVE_XCODE=\\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\\"\\n\\n/bin/sh -c \\"\\\\\\"$WITH_ENVIRONMENT\\\\\\" \\\\\\"$REACT_NATIVE_XCODE\\\\\\"\\"\\n";']){let i=s.replace(t,'shellScript = "set -e\\nif [[ -f \\"$PODS_ROOT/../.xcode.env\\" ]]; then\\nsource \\"$PODS_ROOT/../.xcode.env\\"\\nfi\\nif [[ -f \\"$PODS_ROOT/../.xcode.env.local\\" ]]; then\\nsource \\"$PODS_ROOT/../.xcode.env.local\\"\\nfi\\nexport CONFIG_CMD=\\"dummy-workaround-value\\"\\nexport CLI_PATH=\\"$(\\"$NODE_BINARY\\" --print \\"require(\'path\').dirname(require.resolve(\'rock/package.json\')) + \'/dist/src/bin.js\'\\")\\"\\nWITH_ENVIRONMENT=\\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\\"\\n";');if(i!==s)return void e.writeFileSync(n,i)}te.warn(`Unable to update ${J().bold(n)}.
90
90
  Please update the "Bundle React Native code and images" build phase manually with:
91
91
  set -e
92
92
  if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then
@@ -104,13 +104,13 @@ Please update the "Bundle React Native code and images" build phase manually wit
104
104
  - commands in CI workflows
105
105
  2. Run the dev server as you would normally do
106
106
  3. Run iOS and Android apps as you would normally do
107
- 4. Setup Remote Cache: ${(n="https://rockjs.dev/docs/configuration#remote-cache-configuration",q.cyan(q.underline(q.bold(n))))}`,"Next steps"),ti("Success \uD83C\uDF89.")}async function oy(e,t,i){let r={npm:["install","-D",...i],pnpm:["add","-D",...i],yarn:["add","-D",...i],bun:["add","-D",...i]}[t]??["install","-D",...i];await tz(t,r,{cwd:e})}async function oF(e,t,i){let r={npm:["remove",...i],pnpm:["remove",...i],yarn:["remove",...i],bun:["remove",...i]}[t]??["remove",...i];try{await tz(t,r,{cwd:e})}catch(e){te.debug(e.message,"Continuing with the rest of the steps\n")}}async function oC(t){let i=oE(),r=tl(),n={"@rnef/cli":"rock","@rnef/platform-android":"@rock-js/platform-android","@rnef/platform-ios":"@rock-js/platform-ios","@rnef/plugin-metro":"@rock-js/plugin-metro","@rnef/plugin-repack":"@rock-js/plugin-repack","@rnef/provider-github":"@rock-js/provider-github","@rnef/provider-s3":"@rock-js/provider-s3","@rnef/welcome-screen":"@rock-js/welcome-screen"},s=function(t){let i=u.join(t,"package.json"),r=JSON.parse(e.readFileSync(i,"utf8"));return[...Object.keys(r.dependencies).filter(e=>e.startsWith("@rnef/")),...Object.keys(r.devDependencies).filter(e=>e.startsWith("@rnef/"))]}(t);r.start(`Removing ${J().bold("RNEF")} packages`),await ow(t,i,s),r.stop(`Removed ${J().bold("RNEF")} packages`),r.start(`Adding ${J().bold("Rock")} packages with ${J().bold(i)}`),await ov(t,i,s.map(e=>n[e])),r.stop(`Added ${J().bold("Rock")} packages`),r.start(`Updating ${J().bold(".gitignore")}`),function(t){let i=u.join(t,".gitignore");if(e.existsSync(i)){let t=e.readFileSync(i,"utf8");t=t.replace(/\.rnef\//g,".rock/"),e.writeFileSync(i,t)}}(t),r.stop(`Updated ${J().bold(".gitignore")}`),r.start("Updating cache"),function(t){let i=u.join(t,".rnef"),r=u.join(t,".rock");e.existsSync(i)&&(e.existsSync(r)&&e.rmSync(r,{recursive:!0,force:!0}),e.renameSync(i,r))}(t),function(t){let i=u.join(t,".rock","cache","remote-build");e.existsSync(i)&&e.readdirSync(i).forEach(t=>{if(t.includes("rnef")){let r=t.replace(/rnef/g,"rock"),n=u.join(i,t),s=u.join(i,r);e.renameSync(n,s)}})}(t),r.stop("Updated cache"),r.start(`Renaming and updating ${J().bold("rnef.config.mjs")} to ${J().bold("rock.config.mjs")}`),function(t){let i=u.join(t,"rnef.config.mjs"),r=u.join(t,"rock.config.mjs");if(e.existsSync(i)){let t=e.readFileSync(i,"utf8");t=(t=t.replace(/@rnef\//g,"@rock-js/")).replace(/@rnef\/cli/g,"rock"),e.writeFileSync(r,t),e.unlinkSync(i)}}(t),r.stop(`Renamed and updated ${J().bold("rnef.config.mjs")} to ${J().bold("rock.config.mjs")}`),r.start(`Updating ${J().bold("android/app/build.gradle")}`),function(t){let i=u.join(t,"android","app","build.gradle");if(!e.existsSync(i))return;let r=e.readFileSync(i,"utf8");r=r.replace(/@rnef\/cli\/dist\/src\/bin\.js/g,"rock/dist/src/bin.js"),e.writeFileSync(i,r)}(t),r.stop(`Updated ${J().bold("android/app/build.gradle")}`),r.start(`Updating ${J().bold("ios/Podfile")}`),function(t){let i=u.join(t,"ios","Podfile");if(!e.existsSync(i))return;let r=e.readFileSync(i,"utf8");r=r.replace(/rnef/g,"rock"),e.writeFileSync(i,r)}(t),r.stop(`Updated ${J().bold("ios/Podfile")}`),r.start(`Updating ${J().bold("android/settings.gradle")}`),function(t){let i=u.join(t,"android","settings.gradle");if(!e.existsSync(i))return;let r=e.readFileSync(i,"utf8");r=r.replace(/rnef/g,"rock"),e.writeFileSync(i,r)}(t),r.stop(`Updated ${J().bold("android/settings.gradle")}`),r.start(`Updating ${J().bold("ios/project.pbxproj")}`),function(t){let i=u.join(t,"ios");if(!e.existsSync(i))return;let r=e.readdirSync(i).find(e=>e.endsWith(".xcodeproj"));if(!r)return;let n=u.join(i,r,"project.pbxproj");if(!e.existsSync(n))return;let s=e.readFileSync(n,"utf8");s=s.replace(/@rnef\/cli/g,"rock"),e.writeFileSync(n,s)}(t),r.stop(`Updated ${J().bold("ios/project.pbxproj")}`),r.start(`Updating ${J().bold("package.json")} scripts`),function(t){let i=u.join(t,"package.json");if(!e.existsSync(i))return;let r=e.readFileSync(i,"utf8");r=r.replace(/rnef/g,"rock"),e.writeFileSync(i,r)}(t),r.stop(`Updated ${J().bold("package.json")} scripts`),tr(`1. Run ${J().bold("git diff")} to see the changes. Adjust as necessary e.g.:
107
+ 4. Setup Remote Cache: ${(n="https://rockjs.dev/docs/configuration#remote-cache-configuration",q.cyan(q.underline(q.bold(n))))}`,"Next steps"),ti("Success \uD83C\uDF89.")}async function oy(e,t,i){let r={npm:["install","-D",...i],pnpm:["add","-D",...i],yarn:["add","-D",...i],bun:["add","-D",...i]}[t]??["install","-D",...i];await tz(t,r,{cwd:e})}async function oF(e,t,i){let r={npm:["remove",...i],pnpm:["remove",...i],yarn:["remove",...i],bun:["remove",...i]}[t]??["remove",...i];try{await tz(t,r,{cwd:e})}catch(e){te.debug(e.message,"Continuing with the rest of the steps\n")}}async function oC(t){let i=og(),r=tl(),n={"@rnef/cli":"rock","@rnef/platform-android":"@rock-js/platform-android","@rnef/platform-ios":"@rock-js/platform-ios","@rnef/plugin-metro":"@rock-js/plugin-metro","@rnef/plugin-repack":"@rock-js/plugin-repack","@rnef/provider-github":"@rock-js/provider-github","@rnef/provider-s3":"@rock-js/provider-s3","@rnef/welcome-screen":"@rock-js/welcome-screen"},s=function(t){let i=u.join(t,"package.json"),r=JSON.parse(e.readFileSync(i,"utf8"));return[...Object.keys(r.dependencies).filter(e=>e.startsWith("@rnef/")),...Object.keys(r.devDependencies).filter(e=>e.startsWith("@rnef/"))]}(t);r.start(`Removing ${J().bold("RNEF")} packages`),await ow(t,i,s),r.stop(`Removed ${J().bold("RNEF")} packages`),r.start(`Adding ${J().bold("Rock")} packages with ${J().bold(i)}`),await ov(t,i,s.map(e=>n[e])),r.stop(`Added ${J().bold("Rock")} packages`),r.start(`Updating ${J().bold(".gitignore")}`),function(t){let i=u.join(t,".gitignore");if(e.existsSync(i)){let t=e.readFileSync(i,"utf8");t=t.replace(/\.rnef\//g,".rock/"),e.writeFileSync(i,t)}}(t),r.stop(`Updated ${J().bold(".gitignore")}`),r.start("Updating cache"),function(t){let i=u.join(t,".rnef"),r=u.join(t,".rock");e.existsSync(i)&&(e.existsSync(r)&&e.rmSync(r,{recursive:!0,force:!0}),e.renameSync(i,r))}(t),function(t){let i=u.join(t,".rock","cache","remote-build");e.existsSync(i)&&e.readdirSync(i).forEach(t=>{if(t.includes("rnef")){let r=t.replace(/rnef/g,"rock"),n=u.join(i,t),s=u.join(i,r);e.renameSync(n,s)}})}(t),r.stop("Updated cache"),r.start(`Renaming and updating ${J().bold("rnef.config.mjs")} to ${J().bold("rock.config.mjs")}`),function(t){let i=u.join(t,"rnef.config.mjs"),r=u.join(t,"rock.config.mjs");if(e.existsSync(i)){let t=e.readFileSync(i,"utf8");t=(t=t.replace(/@rnef\//g,"@rock-js/")).replace(/@rnef\/cli/g,"rock"),e.writeFileSync(r,t),e.unlinkSync(i)}}(t),r.stop(`Renamed and updated ${J().bold("rnef.config.mjs")} to ${J().bold("rock.config.mjs")}`),r.start(`Updating ${J().bold("android/app/build.gradle")}`),function(t){let i=u.join(t,"android","app","build.gradle");if(!e.existsSync(i))return;let r=e.readFileSync(i,"utf8");r=r.replace(/@rnef\/cli\/dist\/src\/bin\.js/g,"rock/dist/src/bin.js"),e.writeFileSync(i,r)}(t),r.stop(`Updated ${J().bold("android/app/build.gradle")}`),r.start(`Updating ${J().bold("ios/Podfile")}`),function(t){let i=u.join(t,"ios","Podfile");if(!e.existsSync(i))return;let r=e.readFileSync(i,"utf8");r=r.replace(/rnef/g,"rock"),e.writeFileSync(i,r)}(t),r.stop(`Updated ${J().bold("ios/Podfile")}`),r.start(`Updating ${J().bold("android/settings.gradle")}`),function(t){let i=u.join(t,"android","settings.gradle");if(!e.existsSync(i))return;let r=e.readFileSync(i,"utf8");r=r.replace(/rnef/g,"rock"),e.writeFileSync(i,r)}(t),r.stop(`Updated ${J().bold("android/settings.gradle")}`),r.start(`Updating ${J().bold("ios/project.pbxproj")}`),function(t){let i=u.join(t,"ios");if(!e.existsSync(i))return;let r=e.readdirSync(i).find(e=>e.endsWith(".xcodeproj"));if(!r)return;let n=u.join(i,r,"project.pbxproj");if(!e.existsSync(n))return;let s=e.readFileSync(n,"utf8");s=s.replace(/@rnef\/cli/g,"rock"),e.writeFileSync(n,s)}(t),r.stop(`Updated ${J().bold("ios/project.pbxproj")}`),r.start(`Updating ${J().bold("package.json")} scripts`),function(t){let i=u.join(t,"package.json");if(!e.existsSync(i))return;let r=e.readFileSync(i,"utf8");r=r.replace(/rnef/g,"rock"),e.writeFileSync(i,r)}(t),r.stop(`Updated ${J().bold("package.json")} scripts`),tr(`1. Run ${J().bold("git diff")} to see the changes. Adjust as necessary e.g.:
108
108
  - paths in monorepo
109
109
  - commands in shell scripts
110
110
  - commands in CI workflows
111
111
  2. Run the dev server as you would normally do
112
112
  3. Run iOS and Android apps as you would normally do
113
- 4. Setup Remote Cache: ${J().bold("https://rockjs.dev/docs/configuration#remote-cache-configuration")}`,"Next steps"),ti("RNEF to Rock migration completed successfully \uD83C\uDF89.")}async function ov(e,t,i){let r={npm:["install","-D",...i],pnpm:["add","-D",...i],yarn:["add","-D",...i],bun:["add","-D",...i]}[t]??["install","-D",...i];await tz(t,r,{cwd:e})}async function ow(e,t,i){let r={npm:["remove",...i],pnpm:["remove",...i],yarn:["remove",...i],bun:["remove",...i]}[t]??["remove",...i];try{await tz(t,r,{cwd:e})}catch(e){te.debug(e.message,"Continuing with the rest of the steps\n")}}var o_=Y("../../node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js"),oS=Y.n(o_);function oA(e){if(void 0!=e)return Array.isArray(e)?e[e.length-1]:e}function oR(e){if(void 0!=e)return Array.isArray(e)?e:[e]}let oO=/^[A-Z][0-9A-Z_-]*$/i,oB=["react","react-native","abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while"];function ox(e){if(0===e.length)return"Project name cannot be empty.";if(!e.match(oO))return`Invalid project name: "${e}". Please use a valid identifier name (alphanumeric, hyphen, underscore).`;let t=e.toLowerCase();if(oB.includes(t))return`Invalid project name: "${e}". Can't use reserved name. Please use another name.`}let oN=(e=0)=>t=>`\u001B[${t+e}m`,oI=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,oT=(e=0)=>(t,i,r)=>`\u001B[${38+e};2;${t};${i};${r}m`,oL={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(oL.modifier),[...Object.keys(oL.color),...Object.keys(oL.bgColor)];let ok=function(){let e=new Map;for(let[t,i]of Object.entries(oL)){for(let[t,r]of Object.entries(i))oL[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},i[t]=oL[t],e.set(r[0],r[1]);Object.defineProperty(oL,t,{value:i,enumerable:!1})}return Object.defineProperty(oL,"codes",{value:e,enumerable:!1}),oL.color.close="\x1b[39m",oL.bgColor.close="\x1b[49m",oL.color.ansi=oN(),oL.color.ansi256=oI(),oL.color.ansi16m=oT(),oL.bgColor.ansi=oN(10),oL.bgColor.ansi256=oI(10),oL.bgColor.ansi16m=oT(10),Object.defineProperties(oL,{rgbToAnsi256:{value:(e,t,i)=>e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[i]=t;3===i.length&&(i=[...i].map(e=>e+e).join(""));let r=Number.parseInt(i,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>oL.rgbToAnsi256(...oL.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){let t,i,r;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)i=t=((e-232)*10+8)/255,r=t;else{let n=(e-=16)%36;t=Math.floor(e/36)/5,i=Math.floor(n/6)/5,r=n%6/5}let n=2*Math.max(t,i,r);if(0===n)return 30;let s=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(t));return 2===n&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,i)=>oL.ansi256ToAnsi(oL.rgbToAnsi256(e,t,i)),enumerable:!1},hexToAnsi:{value:e=>oL.ansi256ToAnsi(oL.hexToAnsi256(e)),enumerable:!1}}),oL}();function oM(e,t=globalThis.Deno?globalThis.Deno.args:E.argv){let i=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(i+e),n=t.indexOf("--");return -1!==r&&(-1===n||r<n)}let{env:o$}=E;function oj(e,t={}){var i;return 0!==(i=function(e,{streamIsTTY:t,sniffFlags:i=!0}={}){let r=function(){if("FORCE_COLOR"in o$)return"true"===o$.FORCE_COLOR?1:"false"===o$.FORCE_COLOR?0:0===o$.FORCE_COLOR.length?1:Math.min(Number.parseInt(o$.FORCE_COLOR,10),3)}();void 0!==r&&(X=r);let n=i?X:r;if(0===n)return 0;if(i){if(oM("color=16m")||oM("color=full")||oM("color=truecolor"))return 3;if(oM("color=256"))return 2}if("TF_BUILD"in o$&&"AGENT_NAME"in o$)return 1;if(e&&!t&&void 0===n)return 0;let s=n||0;if("dumb"===o$.TERM)return s;if("win32"===E.platform){let e=G.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in o$)return"GITHUB_ACTIONS"in o$||"GITEA_ACTIONS"in o$?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in o$)||"codeship"===o$.CI_NAME?1:s;if("TEAMCITY_VERSION"in o$)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o$.TEAMCITY_VERSION);if("truecolor"===o$.COLORTERM||"xterm-kitty"===o$.TERM)return 3;if("TERM_PROGRAM"in o$){let e=Number.parseInt((o$.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o$.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o$.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o$.TERM)||"COLORTERM"in o$?1:s}(e,{streamIsTTY:e&&e.isTTY,...t}))&&{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}oM("no-color")||oM("no-colors")||oM("color=false")||oM("color=never")?X=0:(oM("color")||oM("colors")||oM("color=true")||oM("color=always"))&&(X=1);let{stdout:oP,stderr:oz}={stdout:oj({isTTY:Z.isatty(1)}),stderr:oj({isTTY:Z.isatty(2)})},oU=Symbol("GENERATOR"),oH=Symbol("STYLER"),oG=Symbol("IS_EMPTY"),oZ=["ansi","ansi","ansi256","ansi16m"],oW=Object.create(null);function oV(e){let t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let i=oP?oP.level:0;e.level=void 0===t.level?i:t.level})(t,e),Object.setPrototypeOf(t,oV.prototype),t}for(let[e,t]of(Object.setPrototypeOf(oV.prototype,Function.prototype),Object.entries(ok)))oW[e]={get(){let i=oq(this,oK(t.open,t.close,this[oH]),this[oG]);return Object.defineProperty(this,e,{value:i}),i}};oW.visible={get(){let e=oq(this,this[oH],!0);return Object.defineProperty(this,"visible",{value:e}),e}};let oY=(e,t,i,...r)=>"rgb"===e?"ansi16m"===t?ok[i].ansi16m(...r):"ansi256"===t?ok[i].ansi256(ok.rgbToAnsi256(...r)):ok[i].ansi(ok.rgbToAnsi(...r)):"hex"===e?oY("rgb",t,i,...ok.hexToRgb(...r)):ok[i][e](...r);for(let e of["rgb","hex","ansi256"])oW[e]={get(){let{level:t}=this;return function(...i){return oq(this,oK(oY(e,oZ[t],"color",...i),ok.color.close,this[oH]),this[oG])}}},oW["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...i){return oq(this,oK(oY(e,oZ[t],"bgColor",...i),ok.bgColor.close,this[oH]),this[oG])}}};let oX=Object.defineProperties(()=>{},{...oW,level:{enumerable:!0,get(){return this[oU].level},set(e){this[oU].level=e}}}),oK=(e,t,i)=>{let r,n;return void 0===i?(r=e,n=t):(r=i.openAll+e,n=t+i.closeAll),{open:e,close:t,openAll:r,closeAll:n,parent:i}},oq=(e,t,i)=>{let r=(...e)=>oJ(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,oX),r[oU]=e,r[oH]=t,r[oG]=i,r},oJ=(e,t)=>{if(e.level<=0||!t)return e[oG]?"":t;let i=e[oH];if(void 0===i)return t;let{openAll:r,closeAll:n}=i;if(t.includes("\x1b"))for(;void 0!==i;)t=function(e,t,i){let r=e.indexOf(t);if(-1===r)return e;let n=t.length,s=0,o="";do o+=e.slice(s,r)+t+i,s=r+n,r=e.indexOf(t,s);while(-1!==r);return o+e.slice(s)}(t,i.close,i.open),i=i.parent;let s=t.indexOf("\n");return -1!==s&&(t=function(e,t,i,r){let n=0,s="";do{let o="\r"===e[r-1];s+=e.slice(n,o?r-1:r)+t+(o?"\r\n":"\n")+i,n=r+1,r=e.indexOf("\n",n)}while(-1!==r);return s+e.slice(n)}(t,n,r,s)),r+t+n};Object.defineProperties(oV.prototype,oW);let oQ=oV();oV({level:oz?oz.level:0});var o0=Y("../../node_modules/.pnpm/tinygradient@1.1.5/node_modules/tinygradient/index.js");let o1=(...e)=>{let t,i;if(0===e.length)throw Error("Missing gradient colors");if(Array.isArray(e[0]))t=o0(e[0]),i=o3(e[1]);else{if(1===e.length)throw Error(`Expected an array of colors, received ${JSON.stringify(e[0])}`);t=o0(...e)}let r=(e,r)=>(function(e,t,i){let r=o3(i),n=Math.max(e.replace(/\s/g,"").length,t.stops.length),s=o2(t,r,n),o="";for(let t of e)o+=t.match(/\s/g)?t:oQ.hex(s.shift()?.toHex()||"#000")(t);return o})(e?e.toString():"",t,r??i);return r.multiline=(e,r)=>(function(e,t,i){let r=o3(i),n=e.split("\n"),s=Math.max(...n.map(e=>e.length),t.stops.length),o=o2(t,r,s),u=[];for(let e of n){let t=o.slice(0),i="";for(let r of e)i+=oQ.hex(t.shift()?.toHex()||"#000")(r);u.push(i)}return u.join("\n")})(e?e.toString():"",t,r??i),r},o2=(e,t,i)=>t.interpolation?.toLowerCase()==="hsv"?e.hsv(i,t.hsvSpin?.toLowerCase()||!1):e.rgb(i);function o3(e){let t={interpolation:"rgb",hsvSpin:"short",...e};if(void 0!==e&&"object"!=typeof e)throw TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof e}\``);if("string"!=typeof t.interpolation)throw TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof t.interpolation}\``);if("hsv"===t.interpolation.toLowerCase()&&"string"!=typeof t.hsvSpin)throw TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof t.hsvSpin}\``);return t}function o8(e){let t=t=>o1(...e.colors)(t,e.options);return t.multiline=(t="")=>o1(...e.colors).multiline(t,e.options),t}let o6=o8({colors:["#feac5e","#c779d0","#4bc0c8"],options:{}}),o5=o8({colors:["#bdfff3","#4ac29a"],options:{}}),o4=o8({colors:["#77a1d3","#79cbca","#e684ae"],options:{}}),o9=o8({colors:["#473b7b","#3584a7","#30d2be"],options:{}}),o7=o8({colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}}),ue=o8({colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}}),ut=o8({colors:["#f43b47","#453a94"],options:{}}),ui=o8({colors:["#ff4e50","#f9d423"],options:{}}),ur=o8({colors:["#833ab4","#fd1d1d","#fcb045"],options:{}}),un=o8({colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}}),us=o8({colors:["#fdbb2d","#22c1c3"],options:{}}),uo=o8({colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}}),uu=o8({colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}});function ua(){try{let e=l(B(import.meta.url)),t=d(e,"../../package.json");return JSON.parse(r(t,"utf-8")).version}catch(e){return te.warn("Failed to get Rock version",e),null}}function ul(e){return tn({message:"What is your app named?",initialValue:e,validate:ox})}async function uh(e){if(0===e.length)throw new e9("No templates found");return ts({message:"Select a template:",options:e.map(e=>({value:e,label:e.displayName}))})}async function uc(t,i="latest",r){try{var n;let s=null==(n=(await ud(t,i)).dist)?void 0:n.tarball;if(!s)throw new e9("Tarball URL not found.");let o=await fetch(s);if(!o.ok)throw new e9(`Failed to fetch package ${t}: ${o.statusText}`);let a=u.join(r,`${t.replace("/","-")}.tgz`),l=await o.arrayBuffer();return e.writeFileSync(a,new Uint8Array(l)),a}catch(e){throw new e9(`Error downloading package ${t}`,{cause:e})}}async function ud(e,t){var i,r,n;let s=`${process.env.NPM_CONFIG_REGISTRY||"https://registry.npmjs.org"}/${e}`,o=await fetch(s);if(!o.ok)throw new e9(`Failed to fetch package metadata for ${e}: ${o.statusText}`);let u=await o.json(),a=null==(i=u["dist-tags"])?void 0:i[t],l=a?null==(r=u.versions)?void 0:r[a]:null==(n=u.versions)?void 0:n[t];if(!l)throw new e9(`Version ${t} not found for package ${e}`);return l}async function uD(t,i){let r=u.join(t,`.temp-${u.basename(i,u.extname(i))}-${Date.now()}`);return e.mkdirSync(r,{recursive:!0}),await s4({file:i,cwd:r,strip:1}),r}async function uf(){let t=function(e){let t=oS()(e,{alias:{h:"help",v:"version",p:"platform",t:"template",d:"dir"},boolean:["help","version","override","install"],string:["template","platform","dir","plugin","bundler"]});return{name:t._[0],template:oA(t.template),platforms:oR(t.platform),plugins:oR(t.plugin),bundler:t.bundler,help:t.help,version:t.version,dir:oA(t.dir),override:t.override,remoteCacheProvider:t["remote-cache-provider"],install:t.install}}(process.argv.slice(2)),l=ua();if(t.help)return void console.log(`
113
+ 4. Setup Remote Cache: ${J().bold("https://rockjs.dev/docs/configuration#remote-cache-configuration")}`,"Next steps"),ti("RNEF to Rock migration completed successfully \uD83C\uDF89.")}async function ov(e,t,i){let r={npm:["install","-D",...i],pnpm:["add","-D",...i],yarn:["add","-D",...i],bun:["add","-D",...i]}[t]??["install","-D",...i];await tz(t,r,{cwd:e})}async function ow(e,t,i){let r={npm:["remove",...i],pnpm:["remove",...i],yarn:["remove",...i],bun:["remove",...i]}[t]??["remove",...i];try{await tz(t,r,{cwd:e})}catch(e){te.debug(e.message,"Continuing with the rest of the steps\n")}}var o_=Y("../../node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js"),oS=Y.n(o_);function oA(e){if(void 0!=e)return Array.isArray(e)?e[e.length-1]:e}function oR(e){if(void 0!=e)return Array.isArray(e)?e:[e]}let oO=/^[A-Z][0-9A-Z_-]*$/i,oB=["react","react-native","abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while"];function ox(e){if(0===e.length)return"Project name cannot be empty.";if(!e.match(oO))return`Invalid project name: "${e}". Please use a valid identifier name (alphanumeric, hyphen, underscore).`;let t=e.toLowerCase();if(oB.includes(t))return`Invalid project name: "${e}". Can't use reserved name. Please use another name.`}let oN=(e=0)=>t=>`\u001B[${t+e}m`,oI=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,oT=(e=0)=>(t,i,r)=>`\u001B[${38+e};2;${t};${i};${r}m`,oL={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(oL.modifier),[...Object.keys(oL.color),...Object.keys(oL.bgColor)];let ok=function(){let e=new Map;for(let[t,i]of Object.entries(oL)){for(let[t,r]of Object.entries(i))oL[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},i[t]=oL[t],e.set(r[0],r[1]);Object.defineProperty(oL,t,{value:i,enumerable:!1})}return Object.defineProperty(oL,"codes",{value:e,enumerable:!1}),oL.color.close="\x1b[39m",oL.bgColor.close="\x1b[49m",oL.color.ansi=oN(),oL.color.ansi256=oI(),oL.color.ansi16m=oT(),oL.bgColor.ansi=oN(10),oL.bgColor.ansi256=oI(10),oL.bgColor.ansi16m=oT(10),Object.defineProperties(oL,{rgbToAnsi256:{value:(e,t,i)=>e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[i]=t;3===i.length&&(i=[...i].map(e=>e+e).join(""));let r=Number.parseInt(i,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>oL.rgbToAnsi256(...oL.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){let t,i,r;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)i=t=((e-232)*10+8)/255,r=t;else{let n=(e-=16)%36;t=Math.floor(e/36)/5,i=Math.floor(n/6)/5,r=n%6/5}let n=2*Math.max(t,i,r);if(0===n)return 30;let s=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(t));return 2===n&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,i)=>oL.ansi256ToAnsi(oL.rgbToAnsi256(e,t,i)),enumerable:!1},hexToAnsi:{value:e=>oL.ansi256ToAnsi(oL.hexToAnsi256(e)),enumerable:!1}}),oL}();function oM(e,t=globalThis.Deno?globalThis.Deno.args:g.argv){let i=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(i+e),n=t.indexOf("--");return -1!==r&&(-1===n||r<n)}let{env:o$}=g;function oj(e,t={}){var i;return 0!==(i=function(e,{streamIsTTY:t,sniffFlags:i=!0}={}){let r=function(){if("FORCE_COLOR"in o$)return"true"===o$.FORCE_COLOR?1:"false"===o$.FORCE_COLOR?0:0===o$.FORCE_COLOR.length?1:Math.min(Number.parseInt(o$.FORCE_COLOR,10),3)}();void 0!==r&&(X=r);let n=i?X:r;if(0===n)return 0;if(i){if(oM("color=16m")||oM("color=full")||oM("color=truecolor"))return 3;if(oM("color=256"))return 2}if("TF_BUILD"in o$&&"AGENT_NAME"in o$)return 1;if(e&&!t&&void 0===n)return 0;let s=n||0;if("dumb"===o$.TERM)return s;if("win32"===g.platform){let e=G.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in o$)return"GITHUB_ACTIONS"in o$||"GITEA_ACTIONS"in o$?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in o$)||"codeship"===o$.CI_NAME?1:s;if("TEAMCITY_VERSION"in o$)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o$.TEAMCITY_VERSION);if("truecolor"===o$.COLORTERM||"xterm-kitty"===o$.TERM)return 3;if("TERM_PROGRAM"in o$){let e=Number.parseInt((o$.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o$.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o$.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o$.TERM)||"COLORTERM"in o$?1:s}(e,{streamIsTTY:e&&e.isTTY,...t}))&&{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}oM("no-color")||oM("no-colors")||oM("color=false")||oM("color=never")?X=0:(oM("color")||oM("colors")||oM("color=true")||oM("color=always"))&&(X=1);let{stdout:oP,stderr:oz}={stdout:oj({isTTY:Z.isatty(1)}),stderr:oj({isTTY:Z.isatty(2)})},oU=Symbol("GENERATOR"),oH=Symbol("STYLER"),oG=Symbol("IS_EMPTY"),oZ=["ansi","ansi","ansi256","ansi16m"],oW=Object.create(null);function oV(e){let t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let i=oP?oP.level:0;e.level=void 0===t.level?i:t.level})(t,e),Object.setPrototypeOf(t,oV.prototype),t}for(let[e,t]of(Object.setPrototypeOf(oV.prototype,Function.prototype),Object.entries(ok)))oW[e]={get(){let i=oq(this,oK(t.open,t.close,this[oH]),this[oG]);return Object.defineProperty(this,e,{value:i}),i}};oW.visible={get(){let e=oq(this,this[oH],!0);return Object.defineProperty(this,"visible",{value:e}),e}};let oY=(e,t,i,...r)=>"rgb"===e?"ansi16m"===t?ok[i].ansi16m(...r):"ansi256"===t?ok[i].ansi256(ok.rgbToAnsi256(...r)):ok[i].ansi(ok.rgbToAnsi(...r)):"hex"===e?oY("rgb",t,i,...ok.hexToRgb(...r)):ok[i][e](...r);for(let e of["rgb","hex","ansi256"])oW[e]={get(){let{level:t}=this;return function(...i){return oq(this,oK(oY(e,oZ[t],"color",...i),ok.color.close,this[oH]),this[oG])}}},oW["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...i){return oq(this,oK(oY(e,oZ[t],"bgColor",...i),ok.bgColor.close,this[oH]),this[oG])}}};let oX=Object.defineProperties(()=>{},{...oW,level:{enumerable:!0,get(){return this[oU].level},set(e){this[oU].level=e}}}),oK=(e,t,i)=>{let r,n;return void 0===i?(r=e,n=t):(r=i.openAll+e,n=t+i.closeAll),{open:e,close:t,openAll:r,closeAll:n,parent:i}},oq=(e,t,i)=>{let r=(...e)=>oJ(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,oX),r[oU]=e,r[oH]=t,r[oG]=i,r},oJ=(e,t)=>{if(e.level<=0||!t)return e[oG]?"":t;let i=e[oH];if(void 0===i)return t;let{openAll:r,closeAll:n}=i;if(t.includes("\x1b"))for(;void 0!==i;)t=function(e,t,i){let r=e.indexOf(t);if(-1===r)return e;let n=t.length,s=0,o="";do o+=e.slice(s,r)+t+i,s=r+n,r=e.indexOf(t,s);while(-1!==r);return o+e.slice(s)}(t,i.close,i.open),i=i.parent;let s=t.indexOf("\n");return -1!==s&&(t=function(e,t,i,r){let n=0,s="";do{let o="\r"===e[r-1];s+=e.slice(n,o?r-1:r)+t+(o?"\r\n":"\n")+i,n=r+1,r=e.indexOf("\n",n)}while(-1!==r);return s+e.slice(n)}(t,n,r,s)),r+t+n};Object.defineProperties(oV.prototype,oW);let oQ=oV();oV({level:oz?oz.level:0});var o0=Y("../../node_modules/.pnpm/tinygradient@1.1.5/node_modules/tinygradient/index.js");let o1=(...e)=>{let t,i;if(0===e.length)throw Error("Missing gradient colors");if(Array.isArray(e[0]))t=o0(e[0]),i=o3(e[1]);else{if(1===e.length)throw Error(`Expected an array of colors, received ${JSON.stringify(e[0])}`);t=o0(...e)}let r=(e,r)=>(function(e,t,i){let r=o3(i),n=Math.max(e.replace(/\s/g,"").length,t.stops.length),s=o2(t,r,n),o="";for(let t of e)o+=t.match(/\s/g)?t:oQ.hex(s.shift()?.toHex()||"#000")(t);return o})(e?e.toString():"",t,r??i);return r.multiline=(e,r)=>(function(e,t,i){let r=o3(i),n=e.split("\n"),s=Math.max(...n.map(e=>e.length),t.stops.length),o=o2(t,r,s),u=[];for(let e of n){let t=o.slice(0),i="";for(let r of e)i+=oQ.hex(t.shift()?.toHex()||"#000")(r);u.push(i)}return u.join("\n")})(e?e.toString():"",t,r??i),r},o2=(e,t,i)=>t.interpolation?.toLowerCase()==="hsv"?e.hsv(i,t.hsvSpin?.toLowerCase()||!1):e.rgb(i);function o3(e){let t={interpolation:"rgb",hsvSpin:"short",...e};if(void 0!==e&&"object"!=typeof e)throw TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof e}\``);if("string"!=typeof t.interpolation)throw TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof t.interpolation}\``);if("hsv"===t.interpolation.toLowerCase()&&"string"!=typeof t.hsvSpin)throw TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof t.hsvSpin}\``);return t}function o8(e){let t=t=>o1(...e.colors)(t,e.options);return t.multiline=(t="")=>o1(...e.colors).multiline(t,e.options),t}let o6=o8({colors:["#feac5e","#c779d0","#4bc0c8"],options:{}}),o5=o8({colors:["#bdfff3","#4ac29a"],options:{}}),o4=o8({colors:["#77a1d3","#79cbca","#e684ae"],options:{}}),o9=o8({colors:["#473b7b","#3584a7","#30d2be"],options:{}}),o7=o8({colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}}),ue=o8({colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}}),ut=o8({colors:["#f43b47","#453a94"],options:{}}),ui=o8({colors:["#ff4e50","#f9d423"],options:{}}),ur=o8({colors:["#833ab4","#fd1d1d","#fcb045"],options:{}}),un=o8({colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}}),us=o8({colors:["#fdbb2d","#22c1c3"],options:{}}),uo=o8({colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}}),uu=o8({colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}});function ua(){try{let e=l(B(import.meta.url)),t=d(e,"../../package.json");return JSON.parse(r(t,"utf-8")).version}catch(e){return te.warn("Failed to get Rock version",e),null}}function ul(e){return tn({message:"What is your app named?",initialValue:e,validate:ox})}async function uh(e){if(0===e.length)throw new e9("No templates found");return ts({message:"Select a template:",options:e.map(e=>({value:e,label:e.displayName}))})}async function uc(t,i="latest",r){try{var n;let s=null==(n=(await ud(t,i)).dist)?void 0:n.tarball;if(!s)throw new e9("Tarball URL not found.");let o=await fetch(s);if(!o.ok)throw new e9(`Failed to fetch package ${t}: ${o.statusText}`);let a=u.join(r,`${t.replace("/","-")}.tgz`),l=await o.arrayBuffer();return e.writeFileSync(a,new Uint8Array(l)),a}catch(e){throw new e9(`Error downloading package ${t}`,{cause:e})}}async function ud(e,t){var i,r,n;let s=`${process.env.NPM_CONFIG_REGISTRY||"https://registry.npmjs.org"}/${e}`,o=await fetch(s);if(!o.ok)throw new e9(`Failed to fetch package metadata for ${e}: ${o.statusText}`);let u=await o.json(),a=null==(i=u["dist-tags"])?void 0:i[t],l=a?null==(r=u.versions)?void 0:r[a]:null==(n=u.versions)?void 0:n[t];if(!l)throw new e9(`Version ${t} not found for package ${e}`);return l}async function uD(t,i){let r=u.join(t,`.temp-${u.basename(i,u.extname(i))}-${Date.now()}`);return e.mkdirSync(r,{recursive:!0}),await s4({file:i,cwd:r,strip:1}),r}async function uf(){let t=function(e){let t=oS()(e,{alias:{h:"help",v:"version",p:"platform",t:"template",d:"dir"},boolean:["help","version","override","install"],string:["template","platform","dir","plugin","bundler"]});return{name:t._[0],template:oA(t.template),platforms:oR(t.platform),plugins:oR(t.plugin),bundler:t.bundler,help:t.help,version:t.version,dir:oA(t.dir),override:t.override,remoteCacheProvider:t["remote-cache-provider"],install:t.install}}(process.argv.slice(2)),l=ua();if(t.help)return void console.log(`
114
114
  Usage: create-rock [options]
115
115
 
116
116
  Options:
@@ -132,12 +132,12 @@ Please update the "Bundle React Native code and images" build phase manually wit
132
132
  Available platforms:
133
133
  ${ol.map(e=>e.name).join(", ")}
134
134
  `);if(t.version)return void console.log(`${ua()}`);console.log(""),((e="")=>{process.stdout.write(`${q.gray(eP)} ${e}
135
- `)})(`Welcome to ${J().bold(ue("Rock"))}!`);let h=tU(t.dir||process.cwd());if(function(t){var i,r;let n=u.join(t,"package.json");if(!e.existsSync(n))return!1;let s=JSON.parse(e.readFileSync(n,"utf8"));return(null==(i=s.dependencies)?void 0:i["@rnef/cli"])!==void 0||(null==(r=s.devDependencies)?void 0:r["@rnef/cli"])!==void 0}(h)){await up(h),await to({message:"Detected existing RNEF project. Would you like to migrate it to Rock?",confirmLabel:"Yes",cancelLabel:"No"})||tc(),await oC(h);return}if(function(t){var i,r;let n=u.join(t,"package.json");if(!e.existsSync(n))return!1;let s=JSON.parse(e.readFileSync(n,"utf8"));return(null==(i=s.dependencies)?void 0:i["react-native"])!==void 0||(null==(r=s.devDependencies)?void 0:r["react-native"])!==void 0}(h)){await up(h),await to({message:"Detected existing React Native project. Would you like to migrate it to Rock?",confirmLabel:"Yes",cancelLabel:"No"})||tc(),await ob(h);return}let c=(t.dir||t.name)??await ul();ox(c)&&(c=await ul(c));let{targetDir:D}=function(e){let t=e.trim().replace(/\/+$/g,"");return{packageName:t.startsWith("@")?t:u.basename(t),targetDir:t}}(c),p=tU(D);!t.override&&e.existsSync(p)&&!function(t){let i=e.readdirSync(t);return 0===i.length||1===i.length&&".git"===i[0]}(p)&&(await to({message:`"${p}" is not empty, please choose:`,confirmLabel:"Continue and override files",cancelLabel:"Cancel operation"})||tc()),op(p),e.mkdirSync(p,{recursive:!0});let m=t.template?oc(oo,t.template):await uh(oo),g=t.platforms?t.platforms.map(e=>oc(ol,e)):await function(e){if(0===e.length)throw new e9("No platforms found");let t=e.filter(e=>"android"===e.name||"ios"===e.name);return tu({message:`What platforms do you want to start with? ${J().dim("(Press <space> to select, <enter> to skip)")}:`,initialValues:t,options:e.map(e=>({value:e,label:e.displayName}))})}(ol),E=t.bundler?oc(oa,t.bundler):await function(e){if(0===e.length)throw new e9("No bundlers found");return ts({message:"Which bundler do you want to use?",initialValues:[e[0]],options:e.map(e=>({value:e,label:e.displayName}))})}(oa),b=t.plugins?t.plugins.map(e=>oc(ou,e)):await (0===ou.length||!e4()?Promise.resolve(null):tu({message:`Which plugins do you want to use? ${J().dim("(Press <space> to select, <enter> to skip)")}:`,options:ou.map(e=>({value:e,label:e.displayName,hint:e.hint})),required:!1})),y=void 0!==t.remoteCacheProvider||!1===t.remoteCacheProvider?null:await ts({message:"What do you want to use as cache for your remote builds?",initialValue:"github-actions",options:[{value:"github-actions",label:"GitHub Actions",hint:"The easiest way to start if you store your code on GitHub"},{value:"s3",label:"S3",hint:"Work with any S3-compatible storage, including AWS S3 and Cloudflare R2"},{value:null,label:"None",hint:"Local cache only which isn't shared across team members or CI/CD environments"}]}),F=y?await function(e){let t="Ensure the below environment variables are set";switch(e){case"github-actions":return tr(`GITHUB_TOKEN Your GitHub personal access token (PAT)
135
+ `)})(`Welcome to ${J().bold(ue("Rock"))}!`);let h=tU(t.dir||process.cwd());if(function(t){var i,r;let n=u.join(t,"package.json");if(!e.existsSync(n))return!1;let s=JSON.parse(e.readFileSync(n,"utf8"));return(null==(i=s.dependencies)?void 0:i["@rnef/cli"])!==void 0||(null==(r=s.devDependencies)?void 0:r["@rnef/cli"])!==void 0}(h)){await up(h),await to({message:"Detected existing RNEF project. Would you like to migrate it to Rock?",confirmLabel:"Yes",cancelLabel:"No"})||tc(),await oC(h);return}if(function(t){var i,r;let n=u.join(t,"package.json");if(!e.existsSync(n))return!1;let s=JSON.parse(e.readFileSync(n,"utf8"));return(null==(i=s.dependencies)?void 0:i["react-native"])!==void 0||(null==(r=s.devDependencies)?void 0:r["react-native"])!==void 0}(h)){await up(h),await to({message:"Detected existing React Native project. Would you like to migrate it to Rock?",confirmLabel:"Yes",cancelLabel:"No"})||tc(),await ob(h);return}let c=(t.dir||t.name)??await ul();ox(c)&&(c=await ul(c));let{targetDir:D}=function(e){let t=e.trim().replace(/\/+$/g,"");return{packageName:t.startsWith("@")?t:u.basename(t),targetDir:t}}(c),p=tU(D);!t.override&&e.existsSync(p)&&!function(t){let i=e.readdirSync(t);return 0===i.length||1===i.length&&".git"===i[0]}(p)&&(await to({message:`"${p}" is not empty, please choose:`,confirmLabel:"Continue and override files",cancelLabel:"Cancel operation"})||tc()),op(p),e.mkdirSync(p,{recursive:!0});let m=t.template?oc(oo,t.template):await uh(oo),E=t.platforms?t.platforms.map(e=>oc(ol,e)):await function(e){if(0===e.length)throw new e9("No platforms found");let t=e.filter(e=>"android"===e.name||"ios"===e.name);return tu({message:`What platforms do you want to start with? ${J().dim("(Press <space> to select, <enter> to skip)")}:`,initialValues:t,options:e.map(e=>({value:e,label:e.displayName}))})}(ol),g=t.bundler?oc(oa,t.bundler):await function(e){if(0===e.length)throw new e9("No bundlers found");return ts({message:"Which bundler do you want to use?",initialValues:[e[0]],options:e.map(e=>({value:e,label:e.displayName}))})}(oa),b=t.plugins?t.plugins.map(e=>oc(ou,e)):await (0===ou.length||!e4()?Promise.resolve(null):tu({message:`Which plugins do you want to use? ${J().dim("(Press <space> to select, <enter> to skip)")}:`,options:ou.map(e=>({value:e,label:e.displayName,hint:e.hint})),required:!1})),y=void 0!==t.remoteCacheProvider||!1===t.remoteCacheProvider?null:await ts({message:"What do you want to use as cache for your remote builds?",initialValue:"github-actions",options:[{value:"github-actions",label:"GitHub Actions",hint:"The easiest way to start if you store your code on GitHub"},{value:"s3",label:"S3",hint:"Work with any S3-compatible storage, including AWS S3 and Cloudflare R2"},{value:null,label:"None",hint:"Local cache only which isn't shared across team members or CI/CD environments"}]}),F=y?await function(e){let t="Ensure the below environment variables are set";switch(e){case"github-actions":return tr(`GITHUB_TOKEN Your GitHub personal access token (PAT)
136
136
 
137
137
  \u{1F4A1} Set this in your ${J().bold(".env")} file or pass it as an argument to ${J().bold("run:*")} commands.`,t),ta({owner:()=>tn({message:"GitHub repository owner"}),repository:()=>tn({message:"GitHub repository name"})});case"s3":return tr(`AWS_ACCESS_KEY_ID Your AWS access key ID
138
138
  AWS_SECRET_ACCESS_KEY Your AWS secret access key
139
139
 
140
- \u{1F4A1} Set these in your ${J().bold(".env")} file or pass them as arguments to ${J().bold("run:*")} commands.`,t),ta({bucket:()=>tn({message:"Pass your bucket name:",placeholder:"bucket-name",defaultValue:"bucket-name"}),region:()=>tn({message:"Pass your bucket region:",placeholder:"us-west-1",defaultValue:"us-west-1"}),endpoint:()=>tn({message:`If you're using self-hosted S3 or Cloudflare R2, pass your endpoint ${J().dim("(Press <enter> to skip)")}:`,placeholder:"https://<ACCOUNT_ID>.r2.cloudflarestorage.com",defaultValue:void 0})})}}(y):null,C=!!(t.install||e4())&&await to({message:"Do you want to install dependencies?",confirmLabel:"Yes",cancelLabel:"No"}),v=tl();for(let e of(v.start("Applying template, platforms and plugins"),await ug(p,m),g))await ug(p,e);let w=g.map(e=>e.name).includes("harmony")?["metro.config.js"]:void 0;for(let e of(await ug(p,E,w),b??[]))await ug(p,e);let _=d(p,"gitignore");i(_)&&n(_,d(p,".gitignore"));let S=d(p,"harmony","gitignore");i(S)&&n(S,d(p,"harmony",".gitignore"));var A,R=(A=c)?A.split("-").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""):"";if(R!==og)for(let t of(function t(i){if(!e.lstatSync(i).isDirectory())return[i];let r=e.readdirSync(i).flatMap(e=>t(u.join(i,e)));return[i,...r]})(p).reverse())s(t).isDirectory()||function(e,t){let i=r(e,"utf8"),n=i.replaceAll(og,t).replaceAll(og.toLowerCase(),t.toLowerCase());i!==n&&o(e,n,"utf8")}(t,R),a(t).includes(og)?om(t,og,R):a(t).includes(og.toLowerCase())&&om(t,og.toLowerCase(),R.toLowerCase());!function(e,t){let n=d(e,"package.json");if(!i(n))return;let s=JSON.parse(r(n,"utf-8"));s.name=t,s.version="1.0.0",s.private=!0,delete s.publishConfig,s.dependencies&&(s.dependencies=Object.fromEntries(Object.entries(s.dependencies).sort())),s.devDependencies&&(s.devDependencies=Object.fromEntries(Object.entries(s.devDependencies).sort())),s.peerDependencies&&(s.peerDependencies=Object.fromEntries(Object.entries(s.peerDependencies).sort())),o(n,JSON.stringify(function(e){let{name:t,version:i,private:r,scripts:n,dependencies:s,devDependencies:o,peerDependencies:u,...a}=e,l={};for(let e in oD(l,"name",t),oD(l,"version",i),oD(l,"private",r),oD(l,"scripts",n),oD(l,"dependencies",s),oD(l,"devDependencies",o),oD(l,"peerDependencies",u),a)l[e]=a[e];return l}(s),null,2))}(p,c),function(t,i,r,n,s){let o=u.join(t,"rock.config.mjs");e.writeFileSync(o,function(e,t,i,r){let n=e.filter(e=>e.importName),s=t?t.filter(e=>e.importName):null;return`${[...[...n,...s??[],i].map(e=>`import { ${e.importName} } from '${e.packageName}';`),(null==r?void 0:r.name)?function(e){switch(e){case"github-actions":return"import { providerGitHub } from '@rock-js/provider-github';";case"s3":return"import { providerS3 } from '@rock-js/provider-s3';"}}(r.name):""].filter(Boolean).join("\n")}
140
+ \u{1F4A1} Set these in your ${J().bold(".env")} file or pass them as arguments to ${J().bold("run:*")} commands.`,t),ta({bucket:()=>tn({message:"Pass your bucket name:",placeholder:"bucket-name",defaultValue:"bucket-name"}),region:()=>tn({message:"Pass your bucket region:",placeholder:"us-west-1",defaultValue:"us-west-1"}),endpoint:()=>tn({message:`If you're using self-hosted S3 or Cloudflare R2, pass your endpoint ${J().dim("(Press <enter> to skip)")}:`,placeholder:"https://<ACCOUNT_ID>.r2.cloudflarestorage.com",defaultValue:void 0})})}}(y):null,C=!!(t.install||e4())&&await to({message:"Do you want to install dependencies?",confirmLabel:"Yes",cancelLabel:"No"}),v=tl();for(let e of(v.start("Applying template, platforms and plugins"),await uE(p,m),E))await uE(p,e);let w=E.map(e=>e.name).includes("harmony")?["metro.config.js"]:void 0;for(let e of(await uE(p,g,w),b??[]))await uE(p,e);let _=d(p,"gitignore");i(_)&&n(_,d(p,".gitignore"));let S=d(p,"harmony","gitignore");i(S)&&n(S,d(p,"harmony",".gitignore"));var A,R=(A=c)?A.split("-").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""):"";if(R!==oE)for(let t of(function t(i){if(!e.lstatSync(i).isDirectory())return[i];let r=e.readdirSync(i).flatMap(e=>t(u.join(i,e)));return[i,...r]})(p).reverse())s(t).isDirectory()||function(e,t){let i=r(e,"utf8"),n=i.replaceAll(oE,t).replaceAll(oE.toLowerCase(),t.toLowerCase());i!==n&&o(e,n,"utf8")}(t,R),a(t).includes(oE)?om(t,oE,R):a(t).includes(oE.toLowerCase())&&om(t,oE.toLowerCase(),R.toLowerCase());!function(e,t){let n=d(e,"package.json");if(!i(n))return;let s=JSON.parse(r(n,"utf-8"));s.name=t,s.version="1.0.0",s.private=!0,delete s.publishConfig,s.dependencies&&(s.dependencies=Object.fromEntries(Object.entries(s.dependencies).sort())),s.devDependencies&&(s.devDependencies=Object.fromEntries(Object.entries(s.devDependencies).sort())),s.peerDependencies&&(s.peerDependencies=Object.fromEntries(Object.entries(s.peerDependencies).sort())),o(n,JSON.stringify(function(e){let{name:t,version:i,private:r,scripts:n,dependencies:s,devDependencies:o,peerDependencies:u,...a}=e,l={};for(let e in oD(l,"name",t),oD(l,"version",i),oD(l,"private",r),oD(l,"scripts",n),oD(l,"dependencies",s),oD(l,"devDependencies",o),oD(l,"peerDependencies",u),a)l[e]=a[e];return l}(s),null,2))}(p,c),function(t,i,r,n,s){let o=u.join(t,"rock.config.mjs");e.writeFileSync(o,function(e,t,i,r){let n=e.filter(e=>e.importName),s=t?t.filter(e=>e.importName):null;return`${[...[...n,...s??[],i].map(e=>`import { ${e.importName} } from '${e.packageName}';`),(null==r?void 0:r.name)?function(e){switch(e){case"github-actions":return"import { providerGitHub } from '@rock-js/provider-github';";case"s3":return"import { providerS3 } from '@rock-js/provider-s3';"}}(r.name):""].filter(Boolean).join("\n")}
141
141
 
142
142
  export default {
143
143
  ${[s&&s.length>0?`plugins: [
@@ -146,4 +146,4 @@ export default {
146
146
  ${n.map(e=>`${e.name}: ${e.importName}(),`).join("\n ")}
147
147
  },`,(null==r?void 0:r.name)?function(e,t){switch(e){case"github-actions":return oh(["remoteCacheProvider: providerGitHub({",` owner: '${t.owner}',`,` repository: '${t.repository}',`,"}),"]);case"s3":return oh(["remoteCacheProvider: providerS3({",` bucket: '${t.bucket}',`,` region: '${t.region}',`,[` endpoint: '${t.endpoint}',`,!!t.endpoint],"}),"])}}(r.name,r.args):""].filter(Boolean).join("\n ")}
148
148
  };
149
- `}(i,r,n,s))}(p,g,b,E,y&&F?{name:y,args:F}:null),v.stop("Applied template, platforms and plugins.");let O=function(){let e=function(e){if(!e)return;let t=e.split(" ")[0].split("/");return{name:t[0],version:t[1]}}(process.env.npm_config_user_agent);return e?e.name:oE()}();C&&await um(p,O),await oi(p,l);let B=f(process.cwd(),p);tr([`cd ${B}`,C?void 0:`${O} install`,`${O} run start starts dev server`,`${O} run ios builds and runs iOS app`,`${O} run android builds and runs Android app`].filter(Boolean).join("\n"),"Next steps"),ti("Success \uD83C\uDF89.")}async function up(e){if(await os(e)&&await on()){let{output:t}=await tz("git",["status","--porcelain"],{cwd:e});""!==t.trim()&&(await to({message:"Git has uncommitted changes. Would you like to continue with initializing Rock in existing project?",confirmLabel:"Yes",cancelLabel:"No"})||tc())}}async function um(e,t){let i=tl();i.start(`Installing dependencies with ${t}`),await tz(t,["install"],{cwd:e}),i.stop(`Installed dependencies with ${t}`)}async function ug(t,i,r){var n,s,o;let a=null;if("npm"===i.type?a=await uc(i.packageName,i.version,t):((null==(n=i.localPath)?void 0:n.endsWith(".tgz"))||(null==(s=i.localPath)?void 0:s.endsWith(".tar.gz"))||(null==(o=i.localPath)?void 0:o.endsWith(".tar")))&&(a=i.localPath),a){let n=await uD(t,a);i.packageName&&e.unlinkSync(a),of(u.join(n,i.directory??""),t,{skipFiles:r}),op(n);return}if("local"===i.type)return void of(u.join(i.localPath,i.directory??""),t,{skipFiles:r});throw new e9(`Invalid state: template not found: ${JSON.stringify(i,null,2)}`)}o1.atlas=o6,o1.cristal=o5,o1.teen=o4,o1.mind=o9,o1.morning=o7,o1.vice=ue,o1.passion=ut,o1.fruit=ui,o1.instagram=ur,o1.retro=un,o1.summer=us,o1.rainbow=uo,o1.pastel=uu},crypto:function(e){e.exports=W},fs:function(e){e.exports=V},path:function(e){e.exports=Y},zlib:function(e){e.exports=X},"../../node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/cjs/tinycolor.js":function(e){e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}var t,i,r,n=/^\s+/,s=/\s+$/;function o(t,i){if(i=i||{},(t=t||"")instanceof o)return t;if(!(this instanceof o))return new o(t,i);var r,u,a,l,h,c,d,D,f,p,m,g,E,b,y,F,C,w,A,O,x=(u={r:0,g:0,b:0},a=1,l=null,h=null,c=null,d=!1,D=!1,"string"==typeof(r=t)&&(r=function(e){e=e.replace(n,"").replace(s,"").toLowerCase();var t,i=!1;if(v[e])e=v[e],i=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=N.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=N.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=N.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=N.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=N.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=N.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=N.hex8.exec(e))?{r:R(t[1]),g:R(t[2]),b:R(t[3]),a:R(t[4])/255,format:i?"name":"hex8"}:(t=N.hex6.exec(e))?{r:R(t[1]),g:R(t[2]),b:R(t[3]),format:i?"name":"hex"}:(t=N.hex4.exec(e))?{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),a:R(t[4]+""+t[4])/255,format:i?"name":"hex8"}:!!(t=N.hex3.exec(e))&&{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),format:i?"name":"hex"}}(r)),"object"==e(r)&&(I(r.r)&&I(r.g)&&I(r.b)?(f=r.r,p=r.g,m=r.b,u={r:255*S(f,255),g:255*S(p,255),b:255*S(m,255)},d=!0,D="%"===String(r.r).substr(-1)?"prgb":"rgb"):I(r.h)&&I(r.s)&&I(r.v)?(l=B(r.s),h=B(r.v),g=r.h,E=l,b=h,g=6*S(g,360),E=S(E,100),b=S(b,100),y=Math.floor(g),F=g-y,C=b*(1-E),w=b*(1-F*E),A=b*(1-(1-F)*E),u={r:255*[b,w,C,C,A,b][O=y%6],g:255*[A,b,b,w,C,C][O],b:255*[C,C,A,b,b,w][O]},d=!0,D="hsv"):I(r.h)&&I(r.s)&&I(r.l)&&(l=B(r.s),c=B(r.l),u=function(e,t,i){var r,n,s;function o(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}if(e=S(e,360),t=S(t,100),i=S(i,100),0===t)r=n=s=i;else{var u=i<.5?i*(1+t):i+t-i*t,a=2*i-u;r=o(a,u,e+1/3),n=o(a,u,e),s=o(a,u,e-1/3)}return{r:255*r,g:255*n,b:255*s}}(r.h,l,c),d=!0,D="hsl"),r.hasOwnProperty("a")&&(a=r.a)),a=_(a),{ok:d,format:r.format||D,r:Math.min(255,Math.max(u.r,0)),g:Math.min(255,Math.max(u.g,0)),b:Math.min(255,Math.max(u.b,0)),a:a});this._originalInput=t,this._r=x.r,this._g=x.g,this._b=x.b,this._a=x.a,this._roundA=Math.round(100*this._a)/100,this._format=i.format||x.format,this._gradientType=i.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=x.ok}function u(e,t,i){e=S(e,255);var r,n,s=Math.max(e,t=S(t,255),i=S(i,255)),o=Math.min(e,t,i),u=(s+o)/2;if(s==o)r=n=0;else{var a=s-o;switch(n=u>.5?a/(2-s-o):a/(s+o),s){case e:r=(t-i)/a+6*(t<i);break;case t:r=(i-e)/a+2;break;case i:r=(e-t)/a+4}r/=6}return{h:r,s:n,l:u}}function a(e,t,i){e=S(e,255);var r,n=Math.max(e,t=S(t,255),i=S(i,255)),s=Math.min(e,t,i),o=n-s;if(n==s)r=0;else{switch(n){case e:r=(t-i)/o+6*(t<i);break;case t:r=(i-e)/o+2;break;case i:r=(e-t)/o+4}r/=6}return{h:r,s:0===n?0:o/n,v:n}}function l(e,t,i,r){var n=[O(Math.round(e).toString(16)),O(Math.round(t).toString(16)),O(Math.round(i).toString(16))];return r&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function h(e,t,i,r){return[O(x(r)),O(Math.round(e).toString(16)),O(Math.round(t).toString(16)),O(Math.round(i).toString(16))].join("")}function c(e,t){t=0===t?0:t||10;var i=o(e).toHsl();return i.s-=t/100,i.s=A(i.s),o(i)}function d(e,t){t=0===t?0:t||10;var i=o(e).toHsl();return i.s+=t/100,i.s=A(i.s),o(i)}function D(e){return o(e).desaturate(100)}function f(e,t){t=0===t?0:t||10;var i=o(e).toHsl();return i.l+=t/100,i.l=A(i.l),o(i)}function p(e,t){t=0===t?0:t||10;var i=o(e).toRgb();return i.r=Math.max(0,Math.min(255,i.r-Math.round(-(t/100*255)))),i.g=Math.max(0,Math.min(255,i.g-Math.round(-(t/100*255)))),i.b=Math.max(0,Math.min(255,i.b-Math.round(-(t/100*255)))),o(i)}function m(e,t){t=0===t?0:t||10;var i=o(e).toHsl();return i.l-=t/100,i.l=A(i.l),o(i)}function g(e,t){var i=o(e).toHsl(),r=(i.h+t)%360;return i.h=r<0?360+r:r,o(i)}function E(e){var t=o(e).toHsl();return t.h=(t.h+180)%360,o(t)}function b(e,t){if(isNaN(t)||t<=0)throw Error("Argument to polyad must be a positive number");for(var i=o(e).toHsl(),r=[o(e)],n=360/t,s=1;s<t;s++)r.push(o({h:(i.h+s*n)%360,s:i.s,l:i.l}));return r}function y(e){var t=o(e).toHsl(),i=t.h;return[o(e),o({h:(i+72)%360,s:t.s,l:t.l}),o({h:(i+216)%360,s:t.s,l:t.l})]}function F(e,t,i){t=t||6,i=i||30;var r=o(e).toHsl(),n=360/i,s=[o(e)];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,s.push(o(r));return s}function C(e,t){t=t||6;for(var i=o(e).toHsv(),r=i.h,n=i.s,s=i.v,u=[],a=1/t;t--;)u.push(o({h:r,s:n,v:s})),s=(s+a)%1;return u}o.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,i,r=this.toRgb();return e=r.r/255,t=r.g/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((i=r.b/255)<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},setAlpha:function(e){return this._a=_(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=a(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=a(this._r,this._g,this._b),t=Math.round(360*e.h),i=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+i+"%, "+r+"%)":"hsva("+t+", "+i+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=Math.round(360*e.h),i=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+i+"%, "+r+"%)":"hsla("+t+", "+i+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return l(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,i,r,n,s,o;return t=this._r,i=this._g,r=this._b,n=this._a,s=e,o=[O(Math.round(t).toString(16)),O(Math.round(i).toString(16)),O(Math.round(r).toString(16)),O(x(n))],s&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*S(this._r,255))+"%",g:Math.round(100*S(this._g,255))+"%",b:Math.round(100*S(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%)":"rgba("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(w[l(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+h(this._r,this._g,this._b,this._a),i=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var n=o(e);i="#"+h(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+i+")"},toString:function(e){var t=!!e;e=e||this._format;var i=!1,r=this._a<1&&this._a>=0;return!t&&r&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(i=this.toRgbString()),"prgb"===e&&(i=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(i=this.toHexString()),"hex3"===e&&(i=this.toHexString(!0)),"hex4"===e&&(i=this.toHex8String(!0)),"hex8"===e&&(i=this.toHex8String()),"name"===e&&(i=this.toName()),"hsl"===e&&(i=this.toHslString()),"hsv"===e&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return o(this.toString())},_applyModification:function(e,t){var i=e.apply(null,[this].concat([].slice.call(t)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(p,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(c,arguments)},saturate:function(){return this._applyModification(d,arguments)},greyscale:function(){return this._applyModification(D,arguments)},spin:function(){return this._applyModification(g,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(F,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(b,[3])},tetrad:function(){return this._applyCombination(b,[4])}},o.fromRatio=function(t,i){if("object"==e(t)){var r={};for(var n in t)t.hasOwnProperty(n)&&("a"===n?r[n]=t[n]:r[n]=B(t[n]));t=r}return o(t,i)},o.equals=function(e,t){return!!e&&!!t&&o(e).toRgbString()==o(t).toRgbString()},o.random=function(){return o.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},o.mix=function(e,t,i){i=0===i?0:i||50;var r=o(e).toRgb(),n=o(t).toRgb(),s=i/100;return o({r:(n.r-r.r)*s+r.r,g:(n.g-r.g)*s+r.g,b:(n.b-r.b)*s+r.b,a:(n.a-r.a)*s+r.a})},o.readability=function(e,t){var i=o(e),r=o(t);return(Math.max(i.getLuminance(),r.getLuminance())+.05)/(Math.min(i.getLuminance(),r.getLuminance())+.05)},o.isReadable=function(e,t,i){var r,n,s,u,a,l=o.readability(e,t);switch(a=!1,(n=((r=(r=i)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),s=(r.size||"small").toLowerCase(),"AA"!==n&&"AAA"!==n&&(n="AA"),"small"!==s&&"large"!==s&&(s="small"),u={level:n,size:s}).level+u.size){case"AAsmall":case"AAAlarge":a=l>=4.5;break;case"AAlarge":a=l>=3;break;case"AAAsmall":a=l>=7}return a},o.mostReadable=function(e,t,i){var r,n,s,u,a=null,l=0;n=(i=i||{}).includeFallbackColors,s=i.level,u=i.size;for(var h=0;h<t.length;h++)(r=o.readability(e,t[h]))>l&&(l=r,a=o(t[h]));return o.isReadable(e,a,{level:s,size:u})||!n?a:(i.includeFallbackColors=!1,o.mostReadable(e,["#fff","#000"],i))};var v=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},w=o.hexNames=function(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[e[i]]=i);return t}(v);function _(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function S(e,t){"string"==typeof(i=e)&&-1!=i.indexOf(".")&&1===parseFloat(i)&&(e="100%");var i,r,n="string"==typeof(r=e)&&-1!=r.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function A(e){return Math.min(1,Math.max(0,e))}function R(e){return parseInt(e,16)}function O(e){return 1==e.length?"0"+e:""+e}function B(e){return e<=1&&(e=100*e+"%"),e}function x(e){return Math.round(255*parseFloat(e)).toString(16)}var N=(i="[\\s|\\(]+("+(t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",{CSS_UNIT:new RegExp(t),rgb:RegExp("rgb"+i),rgba:RegExp("rgba"+r),hsl:RegExp("hsl"+i),hsla:RegExp("hsla"+r),hsv:RegExp("hsv"+i),hsva:RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function I(e){return!!N.CSS_UNIT.exec(e)}return o}()}},et={};function ei(e){var t=et[e];if(void 0!==t)return t.exports;var i=et[e]={exports:{}};return ee[e].call(i.exports,i,i.exports,ei),i.exports}K="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",q="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",J="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",Q=e=>{e&&e.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))},ei.a=(e,t,i)=>{i&&((r=[]).d=-1);var r,n,s,o,u=new Set,a=e.exports,l=new Promise((e,t)=>{o=t,s=e});l[q]=a,l[K]=e=>{r&&e(r),u.forEach(e),l.catch(function(){})},e.exports=l,t(e=>{n=e.map(e=>{if(null!==e&&"object"==typeof e){if(e[K])return e;if(e.then){var t=[];t.d=0,e.then(e=>{i[q]=e,Q(t)},e=>{i[J]=e,Q(t)});var i={};return i[K]=e=>e(t),i}}var r={};return r[K]=function(){},r[q]=e,r});var t,i=()=>n.map(e=>{if(e[J])throw e[J];return e[q]}),s=new Promise(e=>{(t=()=>e(i)).r=0;var s=e=>e!==r&&!u.has(e)&&(u.add(e),e&&!e.d&&(t.r++,e.push(t)));n.map(e=>e[K](s))});return t.r?s:i()},e=>(e?o(l[J]=e):s(a),Q(r))),r&&r.d<0&&(r.d=0)},ei.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return ei.d(t,{a:t}),t},ei.d=(e,t)=>{for(var i in t)ei.o(t,i)&&!ei.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},ei.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ei.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},ei("./src/bin.ts");
149
+ `}(i,r,n,s))}(p,E,b,g,y&&F?{name:y,args:F}:null),v.stop("Applied template, platforms and plugins.");let O=function(){let e=function(e){if(!e)return;let t=e.split(" ")[0].split("/");return{name:t[0],version:t[1]}}(process.env.npm_config_user_agent);return e?e.name:og()}();C&&await um(p,O),await oi(p,l);let B=f(process.cwd(),p);tr([`cd ${B}`,C?void 0:`${O} install`,`${O} run start starts dev server`,`${O} run ios builds and runs iOS app`,`${O} run android builds and runs Android app`].filter(Boolean).join("\n"),"Next steps"),ti("Success \uD83C\uDF89.")}async function up(e){if(await os(e)&&await on()){let{output:t}=await tz("git",["status","--porcelain"],{cwd:e});""!==t.trim()&&(await to({message:"Git has uncommitted changes. Would you like to continue with initializing Rock in existing project?",confirmLabel:"Yes",cancelLabel:"No"})||tc())}}async function um(e,t){let i=tl();i.start(`Installing dependencies with ${t}`),await tz(t,["install"],{cwd:e}),i.stop(`Installed dependencies with ${t}`)}async function uE(t,i,r){var n,s,o;let a=null;if("npm"===i.type?a=await uc(i.packageName,i.version,t):((null==(n=i.localPath)?void 0:n.endsWith(".tgz"))||(null==(s=i.localPath)?void 0:s.endsWith(".tar.gz"))||(null==(o=i.localPath)?void 0:o.endsWith(".tar")))&&(a=i.localPath),a){let n=await uD(t,a);i.packageName&&e.unlinkSync(a),of(u.join(n,i.directory??""),t,{skipFiles:r}),op(n);return}if("local"===i.type)return void of(u.join(i.localPath,i.directory??""),t,{skipFiles:r});throw new e9(`Invalid state: template not found: ${JSON.stringify(i,null,2)}`)}o1.atlas=o6,o1.cristal=o5,o1.teen=o4,o1.mind=o9,o1.morning=o7,o1.vice=ue,o1.passion=ut,o1.fruit=ui,o1.instagram=ur,o1.retro=un,o1.summer=us,o1.rainbow=uo,o1.pastel=uu},crypto:function(e){e.exports=W},fs:function(e){e.exports=V},path:function(e){e.exports=Y},zlib:function(e){e.exports=X},"../../node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/cjs/tinycolor.js":function(e){e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}var t,i,r,n=/^\s+/,s=/\s+$/;function o(t,i){if(i=i||{},(t=t||"")instanceof o)return t;if(!(this instanceof o))return new o(t,i);var r,u,a,l,h,c,d,D,f,p,m,E,g,b,y,F,C,w,A,O,x=(u={r:0,g:0,b:0},a=1,l=null,h=null,c=null,d=!1,D=!1,"string"==typeof(r=t)&&(r=function(e){e=e.replace(n,"").replace(s,"").toLowerCase();var t,i=!1;if(v[e])e=v[e],i=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=N.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=N.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=N.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=N.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=N.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=N.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=N.hex8.exec(e))?{r:R(t[1]),g:R(t[2]),b:R(t[3]),a:R(t[4])/255,format:i?"name":"hex8"}:(t=N.hex6.exec(e))?{r:R(t[1]),g:R(t[2]),b:R(t[3]),format:i?"name":"hex"}:(t=N.hex4.exec(e))?{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),a:R(t[4]+""+t[4])/255,format:i?"name":"hex8"}:!!(t=N.hex3.exec(e))&&{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),format:i?"name":"hex"}}(r)),"object"==e(r)&&(I(r.r)&&I(r.g)&&I(r.b)?(f=r.r,p=r.g,m=r.b,u={r:255*S(f,255),g:255*S(p,255),b:255*S(m,255)},d=!0,D="%"===String(r.r).substr(-1)?"prgb":"rgb"):I(r.h)&&I(r.s)&&I(r.v)?(l=B(r.s),h=B(r.v),E=r.h,g=l,b=h,E=6*S(E,360),g=S(g,100),b=S(b,100),y=Math.floor(E),F=E-y,C=b*(1-g),w=b*(1-F*g),A=b*(1-(1-F)*g),u={r:255*[b,w,C,C,A,b][O=y%6],g:255*[A,b,b,w,C,C][O],b:255*[C,C,A,b,b,w][O]},d=!0,D="hsv"):I(r.h)&&I(r.s)&&I(r.l)&&(l=B(r.s),c=B(r.l),u=function(e,t,i){var r,n,s;function o(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}if(e=S(e,360),t=S(t,100),i=S(i,100),0===t)r=n=s=i;else{var u=i<.5?i*(1+t):i+t-i*t,a=2*i-u;r=o(a,u,e+1/3),n=o(a,u,e),s=o(a,u,e-1/3)}return{r:255*r,g:255*n,b:255*s}}(r.h,l,c),d=!0,D="hsl"),r.hasOwnProperty("a")&&(a=r.a)),a=_(a),{ok:d,format:r.format||D,r:Math.min(255,Math.max(u.r,0)),g:Math.min(255,Math.max(u.g,0)),b:Math.min(255,Math.max(u.b,0)),a:a});this._originalInput=t,this._r=x.r,this._g=x.g,this._b=x.b,this._a=x.a,this._roundA=Math.round(100*this._a)/100,this._format=i.format||x.format,this._gradientType=i.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=x.ok}function u(e,t,i){e=S(e,255);var r,n,s=Math.max(e,t=S(t,255),i=S(i,255)),o=Math.min(e,t,i),u=(s+o)/2;if(s==o)r=n=0;else{var a=s-o;switch(n=u>.5?a/(2-s-o):a/(s+o),s){case e:r=(t-i)/a+6*(t<i);break;case t:r=(i-e)/a+2;break;case i:r=(e-t)/a+4}r/=6}return{h:r,s:n,l:u}}function a(e,t,i){e=S(e,255);var r,n=Math.max(e,t=S(t,255),i=S(i,255)),s=Math.min(e,t,i),o=n-s;if(n==s)r=0;else{switch(n){case e:r=(t-i)/o+6*(t<i);break;case t:r=(i-e)/o+2;break;case i:r=(e-t)/o+4}r/=6}return{h:r,s:0===n?0:o/n,v:n}}function l(e,t,i,r){var n=[O(Math.round(e).toString(16)),O(Math.round(t).toString(16)),O(Math.round(i).toString(16))];return r&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function h(e,t,i,r){return[O(x(r)),O(Math.round(e).toString(16)),O(Math.round(t).toString(16)),O(Math.round(i).toString(16))].join("")}function c(e,t){t=0===t?0:t||10;var i=o(e).toHsl();return i.s-=t/100,i.s=A(i.s),o(i)}function d(e,t){t=0===t?0:t||10;var i=o(e).toHsl();return i.s+=t/100,i.s=A(i.s),o(i)}function D(e){return o(e).desaturate(100)}function f(e,t){t=0===t?0:t||10;var i=o(e).toHsl();return i.l+=t/100,i.l=A(i.l),o(i)}function p(e,t){t=0===t?0:t||10;var i=o(e).toRgb();return i.r=Math.max(0,Math.min(255,i.r-Math.round(-(t/100*255)))),i.g=Math.max(0,Math.min(255,i.g-Math.round(-(t/100*255)))),i.b=Math.max(0,Math.min(255,i.b-Math.round(-(t/100*255)))),o(i)}function m(e,t){t=0===t?0:t||10;var i=o(e).toHsl();return i.l-=t/100,i.l=A(i.l),o(i)}function E(e,t){var i=o(e).toHsl(),r=(i.h+t)%360;return i.h=r<0?360+r:r,o(i)}function g(e){var t=o(e).toHsl();return t.h=(t.h+180)%360,o(t)}function b(e,t){if(isNaN(t)||t<=0)throw Error("Argument to polyad must be a positive number");for(var i=o(e).toHsl(),r=[o(e)],n=360/t,s=1;s<t;s++)r.push(o({h:(i.h+s*n)%360,s:i.s,l:i.l}));return r}function y(e){var t=o(e).toHsl(),i=t.h;return[o(e),o({h:(i+72)%360,s:t.s,l:t.l}),o({h:(i+216)%360,s:t.s,l:t.l})]}function F(e,t,i){t=t||6,i=i||30;var r=o(e).toHsl(),n=360/i,s=[o(e)];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,s.push(o(r));return s}function C(e,t){t=t||6;for(var i=o(e).toHsv(),r=i.h,n=i.s,s=i.v,u=[],a=1/t;t--;)u.push(o({h:r,s:n,v:s})),s=(s+a)%1;return u}o.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,i,r=this.toRgb();return e=r.r/255,t=r.g/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((i=r.b/255)<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},setAlpha:function(e){return this._a=_(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=a(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=a(this._r,this._g,this._b),t=Math.round(360*e.h),i=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+i+"%, "+r+"%)":"hsva("+t+", "+i+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=Math.round(360*e.h),i=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+i+"%, "+r+"%)":"hsla("+t+", "+i+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return l(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,i,r,n,s,o;return t=this._r,i=this._g,r=this._b,n=this._a,s=e,o=[O(Math.round(t).toString(16)),O(Math.round(i).toString(16)),O(Math.round(r).toString(16)),O(x(n))],s&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*S(this._r,255))+"%",g:Math.round(100*S(this._g,255))+"%",b:Math.round(100*S(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%)":"rgba("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(w[l(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+h(this._r,this._g,this._b,this._a),i=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var n=o(e);i="#"+h(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+i+")"},toString:function(e){var t=!!e;e=e||this._format;var i=!1,r=this._a<1&&this._a>=0;return!t&&r&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(i=this.toRgbString()),"prgb"===e&&(i=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(i=this.toHexString()),"hex3"===e&&(i=this.toHexString(!0)),"hex4"===e&&(i=this.toHex8String(!0)),"hex8"===e&&(i=this.toHex8String()),"name"===e&&(i=this.toName()),"hsl"===e&&(i=this.toHslString()),"hsv"===e&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return o(this.toString())},_applyModification:function(e,t){var i=e.apply(null,[this].concat([].slice.call(t)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(p,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(c,arguments)},saturate:function(){return this._applyModification(d,arguments)},greyscale:function(){return this._applyModification(D,arguments)},spin:function(){return this._applyModification(E,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(F,arguments)},complement:function(){return this._applyCombination(g,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(b,[3])},tetrad:function(){return this._applyCombination(b,[4])}},o.fromRatio=function(t,i){if("object"==e(t)){var r={};for(var n in t)t.hasOwnProperty(n)&&("a"===n?r[n]=t[n]:r[n]=B(t[n]));t=r}return o(t,i)},o.equals=function(e,t){return!!e&&!!t&&o(e).toRgbString()==o(t).toRgbString()},o.random=function(){return o.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},o.mix=function(e,t,i){i=0===i?0:i||50;var r=o(e).toRgb(),n=o(t).toRgb(),s=i/100;return o({r:(n.r-r.r)*s+r.r,g:(n.g-r.g)*s+r.g,b:(n.b-r.b)*s+r.b,a:(n.a-r.a)*s+r.a})},o.readability=function(e,t){var i=o(e),r=o(t);return(Math.max(i.getLuminance(),r.getLuminance())+.05)/(Math.min(i.getLuminance(),r.getLuminance())+.05)},o.isReadable=function(e,t,i){var r,n,s,u,a,l=o.readability(e,t);switch(a=!1,(n=((r=(r=i)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),s=(r.size||"small").toLowerCase(),"AA"!==n&&"AAA"!==n&&(n="AA"),"small"!==s&&"large"!==s&&(s="small"),u={level:n,size:s}).level+u.size){case"AAsmall":case"AAAlarge":a=l>=4.5;break;case"AAlarge":a=l>=3;break;case"AAAsmall":a=l>=7}return a},o.mostReadable=function(e,t,i){var r,n,s,u,a=null,l=0;n=(i=i||{}).includeFallbackColors,s=i.level,u=i.size;for(var h=0;h<t.length;h++)(r=o.readability(e,t[h]))>l&&(l=r,a=o(t[h]));return o.isReadable(e,a,{level:s,size:u})||!n?a:(i.includeFallbackColors=!1,o.mostReadable(e,["#fff","#000"],i))};var v=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},w=o.hexNames=function(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[e[i]]=i);return t}(v);function _(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function S(e,t){"string"==typeof(i=e)&&-1!=i.indexOf(".")&&1===parseFloat(i)&&(e="100%");var i,r,n="string"==typeof(r=e)&&-1!=r.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function A(e){return Math.min(1,Math.max(0,e))}function R(e){return parseInt(e,16)}function O(e){return 1==e.length?"0"+e:""+e}function B(e){return e<=1&&(e=100*e+"%"),e}function x(e){return Math.round(255*parseFloat(e)).toString(16)}var N=(i="[\\s|\\(]+("+(t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",{CSS_UNIT:new RegExp(t),rgb:RegExp("rgb"+i),rgba:RegExp("rgba"+r),hsl:RegExp("hsl"+i),hsla:RegExp("hsla"+r),hsv:RegExp("hsv"+i),hsva:RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function I(e){return!!N.CSS_UNIT.exec(e)}return o}()}},et={};function ei(e){var t=et[e];if(void 0!==t)return t.exports;var i=et[e]={exports:{}};return ee[e].call(i.exports,i,i.exports,ei),i.exports}K="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",q="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",J="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",Q=e=>{e&&e.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))},ei.a=(e,t,i)=>{i&&((r=[]).d=-1);var r,n,s,o,u=new Set,a=e.exports,l=new Promise((e,t)=>{o=t,s=e});l[q]=a,l[K]=e=>{r&&e(r),u.forEach(e),l.catch(function(){})},e.exports=l,t(e=>{n=e.map(e=>{if(null!==e&&"object"==typeof e){if(e[K])return e;if(e.then){var t=[];t.d=0,e.then(e=>{i[q]=e,Q(t)},e=>{i[J]=e,Q(t)});var i={};return i[K]=e=>e(t),i}}var r={};return r[K]=function(){},r[q]=e,r});var t,i=()=>n.map(e=>{if(e[J])throw e[J];return e[q]}),s=new Promise(e=>{(t=()=>e(i)).r=0;var s=e=>e!==r&&!u.has(e)&&(u.add(e),e&&!e.d&&(t.r++,e.push(t)));n.map(e=>e[K](s))});return t.r?s:i()},e=>(e?o(l[J]=e):s(a),Q(r))),r&&r.d<0&&(r.d=0)},ei.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return ei.d(t,{a:t}),t},ei.d=(e,t)=>{for(var i in t)ei.o(t,i)&&!ei.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},ei.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ei.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},ei("./src/bin.ts");