create-rock 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/bin.js +146 -9
- package/package.json +19 -12
- package/dist/e2e/e2e.test.d.ts +0 -1
- package/dist/e2e/e2e.test.js +0 -98
- package/dist/e2e/e2e.test.js.map +0 -1
- package/dist/src/bin.d.ts +0 -2
- package/dist/src/bin.js.map +0 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -2
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/bin.d.ts +0 -4
- package/dist/src/lib/bin.js +0 -210
- package/dist/src/lib/bin.js.map +0 -1
- package/dist/src/lib/steps/git-init.d.ts +0 -3
- package/dist/src/lib/steps/git-init.js +0 -51
- package/dist/src/lib/steps/git-init.js.map +0 -1
- package/dist/src/lib/templates.d.ts +0 -23
- package/dist/src/lib/templates.js +0 -122
- package/dist/src/lib/templates.js.map +0 -1
- package/dist/src/lib/utils/edit-template.d.ts +0 -10
- package/dist/src/lib/utils/edit-template.js +0 -48
- package/dist/src/lib/utils/edit-template.js.map +0 -1
- package/dist/src/lib/utils/fs.d.ts +0 -10
- package/dist/src/lib/utils/fs.js +0 -49
- package/dist/src/lib/utils/fs.js.map +0 -1
- package/dist/src/lib/utils/getPkgManager.d.ts +0 -2
- package/dist/src/lib/utils/getPkgManager.js +0 -25
- package/dist/src/lib/utils/getPkgManager.js.map +0 -1
- package/dist/src/lib/utils/initInExistingProject.d.ts +0 -1
- package/dist/src/lib/utils/initInExistingProject.js +0 -243
- package/dist/src/lib/utils/initInExistingProject.js.map +0 -1
- package/dist/src/lib/utils/migrateRnefProject.d.ts +0 -2
- package/dist/src/lib/utils/migrateRnefProject.js +0 -206
- package/dist/src/lib/utils/migrateRnefProject.js.map +0 -1
- package/dist/src/lib/utils/package-json.d.ts +0 -2
- package/dist/src/lib/utils/package-json.js +0 -65
- package/dist/src/lib/utils/package-json.js.map +0 -1
- package/dist/src/lib/utils/parse-cli-options.d.ts +0 -14
- package/dist/src/lib/utils/parse-cli-options.js +0 -35
- package/dist/src/lib/utils/parse-cli-options.js.map +0 -1
- package/dist/src/lib/utils/parsers.d.ts +0 -10
- package/dist/src/lib/utils/parsers.js +0 -22
- package/dist/src/lib/utils/parsers.js.map +0 -1
- package/dist/src/lib/utils/project-name.d.ts +0 -8
- package/dist/src/lib/utils/project-name.js +0 -88
- package/dist/src/lib/utils/project-name.js.map +0 -1
- package/dist/src/lib/utils/prompts.d.ts +0 -14
- package/dist/src/lib/utils/prompts.js +0 -141
- package/dist/src/lib/utils/prompts.js.map +0 -1
- package/dist/src/lib/utils/tarball.d.ts +0 -8
- package/dist/src/lib/utils/tarball.js +0 -47
- package/dist/src/lib/utils/tarball.js.map +0 -1
- package/dist/src/lib/utils/version.d.ts +0 -1
- package/dist/src/lib/utils/version.js +0 -18
- package/dist/src/lib/utils/version.js.map +0 -1
package/dist/src/bin.js
CHANGED
|
@@ -1,10 +1,147 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { run } from './lib/bin.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
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 y,stdout as b}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{stat as R}from"node:fs/promises";import"fs/promises";import{fileURLToPath as O}from"node:url";import{spawn as x}from"node:child_process";import{EventEmitter as B,on as I,once as N}from"node:events";import{pipeline as T}from"node:stream/promises";import L,{EventEmitter as k}from"events";import{StringDecoder as M}from"node:string_decoder";import $ from"assert";import{Buffer as j}from"buffer";import P from"node:assert";import{randomBytes as z}from"node:crypto";import{createRequire as U}from"node:module";import H from"node:os";import G from"node:tty";import*as Z from"crypto";import*as W from"fs";import*as V from"path";import*as Y from"zlib";var X,K,q,J,Q={"../../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 y=(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,y(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=y(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(y(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 y=o?e.header.fileAttr:void 0;return c.writeFileTo(E,g,s,y),!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 y(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 b=(u=r.toBuffer(val,f.encode))[u.length-1];l=47===b||92===b,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=y(e,s.EF_ZIP64_SUNCOMP),i.size===s.EF_ZIP64_OR_32&&(i.size=t)),e.length>=s.EF_ZIP64_RHO&&(r=y(e,s.EF_ZIP64_SCOMP),i.compressedSize===s.EF_ZIP64_OR_32&&(i.compressedSize=r)),e.length>=s.EF_ZIP64_DSN&&(n=y(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/ignore@7.0.5/node_modules/ignore/index.js":function(e){function t(e){return Array.isArray(e)?e:[e]}let i=void 0,r=/^\s+$/,n=/(?:[^\\]|^)\\$/,s=/^\\!/,o=/^\\#/,u=/\r?\n/g,a=/^\.{0,2}\/|^\.{1,2}$/,l=/\/$/,h="node-ignore";"undefined"!=typeof Symbol&&(h=Symbol.for("node-ignore"));let c=h,d=(e,t,i)=>(Object.defineProperty(e,t,{value:i}),i),D=/([0-z])-([0-z])/g,f=()=>!1,p=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,i)=>t+(0===i.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{let{length:i}=t;return t.slice(0,i-i%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,i)=>t+6<i.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,i)=>t+i.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,i,r,n)=>"\\"===t?`\\[${i}${(e=>{let{length:t}=e;return e.slice(0,t-t%2)})(r)}${n}`:"]"===n&&r.length%2==0?`[${i.replace(D,(e,t,i)=>t.charCodeAt(0)<=i.charCodeAt(0)?e:"")}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],m=/(^|\\\/)?\\\*$/,E="regex",g="checkRegex",y={[E](e,t){let i=t?`${t}[^/]+`:"[^/]*";return`${i}(?=$|\\/$)`},[g](e,t){let i=t?`${t}[^/]*`:"[^/]*";return`${i}(?=$|\\/$)`}};class b{constructor(e,t,i,r,n,s){this.pattern=e,this.mark=t,this.negative=n,d(this,"body",i),d(this,"ignoreCase",r),d(this,"regexPrefix",s)}get regex(){let e="_"+E;return this[e]?this[e]:this._make(E,e)}get checkRegex(){let e="_"+g;return this[e]?this[e]:this._make(g,e)}_make(e,t){let i=this.regexPrefix.replace(m,y[e]);return d(this,t,this.ignoreCase?RegExp(i,"i"):new RegExp(i))}}class F{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){let t;if(e&&e[c]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if("string"==typeof e&&(e={pattern:e}),(t=e.pattern)&&"string"==typeof t&&!r.test(t)&&!n.test(t)&&0!==t.indexOf("#")){let t=(({pattern:e,mark:t},i)=>{let r,n=!1,u=e;0===u.indexOf("!")&&(n=!0,u=u.substr(1));let a=(r=u=u.replace(s,"!").replace(o,"#"),p.reduce((e,[t,i])=>e.replace(t,i.bind(r)),r));return new b(e,t,u,i,n,a)})(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,t("string"==typeof e?e.split(u).filter(Boolean):e).forEach(this._add,this),this._added}test(e,t,r){let n,s=!1,o=!1;this._rules.forEach(u=>{let{negative:a}=u;(o!==a||s===o)&&(!a||s||o||t)&&u[r].test(e)&&(s=!a,o=a,n=a?i:u)});let u={ignored:s,unignored:o};return n&&(u.rule=n),u}}let C=(e,t)=>{throw new t(e)},v=(e,t,i)=>"string"!=typeof e?i(`path must be a string, but got \`${t}\``,TypeError):e?!v.isNotRelative(e)||i(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):i("path must not be empty",TypeError),w=e=>a.test(e);v.isNotRelative=w,v.convert=e=>e;class _{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:i=!1}={}){d(this,c,!0),this._rules=new F(t),this._strictPathCheck=!i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,i,r){let n=e&&v.convert(e);return v(n,e,this._strictPathCheck?C:f),this._t(n,t,i,r)}checkIgnore(e){if(!l.test(e))return this.test(e);let t=e.split("/").filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join("/")+"/",this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,g)}_t(e,t,i,r){if(e in t)return t[e];if(r||(r=e.split("/").filter(Boolean)),r.pop(),!r.length)return t[e]=this._rules.test(e,i,E);let n=this._t(r.join("/")+"/",t,i,r);return t[e]=n.ignored?n:this._rules.test(e,i,E)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return t(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}let S=e=>new _(e),A=()=>{v.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");let e=/^[a-z]:\//i;v.isNotRelative=t=>e.test(t)||w(t)};"undefined"!=typeof process&&"win32"===process.platform&&A(),e.exports=S,S.default=S,e.exports.isPathValid=e=>v(e&&v.convert(e),e,f),d(e.exports,Symbol.for("setupWindows"),A)},"../../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(""),y=!1,b=0;b<g.length;b++){if("-"===(f=p.slice(b+2))){h(g[b],f,p);continue}if(/[A-Za-z]/.test(g[b])&&"="===f[0]){h(g[b],f.slice(1),p),y=!0;break}if(/[A-Za-z]/.test(g[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(f)){h(g[b],f,p),y=!0;break}if(g[b+1]&&g[b+1].match(/\W/)){h(g[b],p.slice(b+2),p),y=!0;break}h(g[b],!n.strings[g[b]]||"",p)}D=p.slice(-1)[0],y||"-"===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(Z,W,V){let Y;V.d(W,{e:()=>u_});var X=V("../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"),K=V("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"),q=V.n(K);let J=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 Q(e){if("string"!=typeof e)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(J,"")}function ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var et={exports:{}},ei={};function er(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}et.exports=ei,ei.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"},ei.characterLength=function(e){var t=this.eastAsianWidth(e);return"F"==t||"W"==t||"A"==t?2:1},ei.length=function(e){for(var t=er(e),i=0,r=0;r<t.length;r++)i+=this.characterLength(t[r]);return i},ei.slice=function(e,t,i){textLen=ei.length(e),i=i||1,(t=t||0)<0&&(t=textLen+t),i<0&&(i=textLen+i);for(var r="",n=0,s=er(e),o=0;o<s.length;o++){var u=s[o],a=ei.length(u);if(n>=t-(2==a))if(n+a<=i)r+=u;else break;n+=a}return r};let en=ee(et.exports),es=ee(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 eo(e,t={}){if("string"!=typeof e||0===e.length||(t={ambiguousIsNarrow:!0,...t},0===(e=Q(e)).length))return 0;e=e.replace(es()," ");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(en.eastAsianWidth(t)){case"F":case"W":r+=2;break;case"A":r+=i;break;default:r+=1}}return r}let eu=(e=0)=>t=>`\x1b[${t+e}m`,ea=(e=0)=>t=>`\x1b[${38+e};5;${t}m`,el=(e=0)=>(t,i,r)=>`\x1b[${38+e};2;${t};${i};${r}m`,eh={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(eh.modifier),[...Object.keys(eh.color),...Object.keys(eh.bgColor)];let ec=function(){let e=new Map;for(let[t,i]of Object.entries(eh)){for(let[t,r]of Object.entries(i))eh[t]={open:`\x1b[${r[0]}m`,close:`\x1b[${r[1]}m`},i[t]=eh[t],e.set(r[0],r[1]);Object.defineProperty(eh,t,{value:i,enumerable:!1})}return Object.defineProperty(eh,"codes",{value:e,enumerable:!1}),eh.color.close="\x1b[39m",eh.bgColor.close="\x1b[49m",eh.color.ansi=eu(),eh.color.ansi256=ea(),eh.color.ansi16m=el(),eh.bgColor.ansi=eu(10),eh.bgColor.ansi256=ea(10),eh.bgColor.ansi16m=el(10),Object.defineProperties(eh,{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=>eh.rgbToAnsi256(...eh.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)=>eh.ansi256ToAnsi(eh.rgbToAnsi256(e,t,i)),enumerable:!1},hexToAnsi:{value:e=>eh.ansi256ToAnsi(eh.hexToAnsi256(e)),enumerable:!1}}),eh}(),ed=new Set(["\x1b","\x9b"]),eD="]8;;",ef=e=>`${ed.values().next().value}[${e}m`,ep=e=>`${ed.values().next().value}${eD}${e}\x07`,em=(e,t,i)=>{let r=[...t],n=!1,s=!1,o=eo(Q(e[e.length-1]));for(let[t,u]of r.entries()){let a=eo(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(eD)),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,`
|
|
3
|
+
`).split(`
|
|
4
|
+
`).map(e=>((e,t,i={})=>{if(!1!==i.trim&&""===e.trim())return"";let r="",n,s,o=e.split(" ").map(e=>eo(e)),u=[""];for(let[r,n]of e.split(" ").entries()){!1!==i.trim&&(u[u.length-1]=u[u.length-1].trimStart());let e=eo(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(""),em(u,n,t);continue}if(e+o[r]>t&&e>0&&o[r]>0){if(!1===i.wordWrap&&e<t){em(u,n,t);continue}u.push("")}if(e+o[r]>t&&!1===i.wordWrap){em(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&&!(eo(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
|
+
`)];for(let[e,t]of a.entries()){if(r+=t,ed.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${eD}(?<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=ec.codes.get(Number(n));a[e+1]===`
|
|
6
|
+
`?(s&&(r+=ep("")),n&&i&&(r+=ef(i))):t===`
|
|
7
|
+
`&&(n&&i&&(r+=ef(n)),s&&(r+=ep(s)))}return r})(e,t,i)).join(`
|
|
8
|
+
`)}let eg={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 eg.aliases.get(e)===t;for(let i of e)if(void 0!==i&&ey(i,t))return!0;return!1}let eb=globalThis.process.platform.startsWith("win"),eF=Symbol("clack:cancel");function eC(e,t){e.isTTY&&e.setRawMode(t)}var ev=Object.defineProperty,ew=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?ev(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,i};class e_{constructor(e,t=!0){ew(this,"input"),ew(this,"output"),ew(this,"_abortSignal"),ew(this,"rl"),ew(this,"opts"),ew(this,"_render"),ew(this,"_track",!1),ew(this,"_prevFrame",""),ew(this,"_subscribers",new Map),ew(this,"_cursor",0),ew(this,"state","initial"),ew(this,"error",""),ew(this,"value");let{input:i=y,output:r=b,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(eF);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),eC(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(X.cursor.show),this.output.off("resize",this.render),eC(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(X.cursor.show),this.output.off("resize",this.render),eC(this.input,!1),e(eF)})})}onKeypress(e,t){if("error"===this.state&&(this.state="active"),t?.name&&(!this._track&&eg.aliases.has(t.name)&&this.emit("cursor",eg.aliases.get(t.name)),eg.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
|
+
`),eC(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(X.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(X.cursor.hide);else{let t=function(e,t){if(e===t)return;let i=e.split(`
|
|
11
|
+
`),r=t.split(`
|
|
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(X.cursor.move(0,i)),this.output.write(X.erase.lines(1));let r=e.split(`
|
|
13
|
+
`);this.output.write(r[i]),this._prevFrame=e,this.output.write(X.cursor.move(0,r.length-i-1));return}if(t&&t?.length>1){let i=t[0];this.output.write(X.cursor.move(0,i)),this.output.write(X.erase.down());let r=e.split(`
|
|
14
|
+
`).slice(i);this.output.write(r.join(`
|
|
15
|
+
`)),this._prevFrame=e;return}this.output.write(X.erase.down())}this.output.write(e),"initial"===this.state&&(this.state="active"),this._prevFrame=e}}}new WeakMap;var eS=Object.defineProperty,eA=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?eS(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,i};let eR=class extends e_{constructor(e){super(e,!1),eA(this,"options"),eA(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 eO=Object.defineProperty,ex=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?eO(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,i};class eB extends e_{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 e_{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}${K.inverse(t)}${i.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}}let eN="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,eT=(e,t)=>eN?e:t,eL=eT("◆","*"),ek=eT("■","x"),eM=eT("▲","x"),e$=eT("◇","o"),ej=eT("┌","T"),eP=eT("│","|"),ez=eT("└","—"),eU=eT("●",">"),eH=eT("○"," "),eG=eT("◻","[•]"),eZ=eT("◼","[+]"),eW=eT("◻","[ ]"),eV=(eT("▪","•"),eT("─","-")),eY=eT("╮","+"),eX=eT("├","+"),eK=eT("╯","+"),eq=eT("●","•"),eJ=eT("◆","*"),eQ=eT("▲","!"),e0=eT("■","x"),e1=e=>{switch(e){case"initial":case"active":return K.cyan(eL);case"cancel":return K.red(ek);case"error":return K.yellow(eM);case"submit":return K.green(e$)}},e2=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?K.dim("..."):r(e,i+o===t)})},e3=e=>{let t=(e,t)=>{let i=e.label??String(e.value);switch(t){case"selected":return`${K.dim(i)}`;case"active":return`${K.green(eU)} ${i} ${e.hint?K.dim(`(${e.hint})`):""}`;case"cancelled":return`${K.strikethrough(K.dim(i))}`;default:return`${K.dim(eH)} ${K.dim(i)}`}};return new eB({options:e.options,initialValue:e.initialValue,render(){let i=`${K.gray(eP)}
|
|
16
|
+
${e1(this.state)} ${e.message}
|
|
17
|
+
`;switch(this.state){case"submit":return`${i}${K.gray(eP)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${i}${K.gray(eP)} ${t(this.options[this.cursor],"cancelled")}
|
|
18
|
+
${K.gray(eP)}`;default:return`${i}${K.cyan(eP)} ${e2({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,i)=>t(e,i?"active":"inactive")}).join(`
|
|
19
|
+
${K.cyan(eP)} `)}
|
|
20
|
+
${K.cyan(ez)}
|
|
21
|
+
`}}}).prompt()},e8={message:(e="",{symbol:t=K.gray(eP)}={})=>{let i=[`${K.gray(eP)}`];if(e){let[r,...n]=e.split(`
|
|
22
|
+
`);i.push(`${t} ${r}`,...n.map(e=>`${K.gray(eP)} ${e}`))}process.stdout.write(`${i.join(`
|
|
23
|
+
`)}
|
|
24
|
+
`)},info:e=>{e8.message(e,{symbol:K.blue(eq)})},success:e=>{e8.message(e,{symbol:K.green(eJ)})},step:e=>{e8.message(e,{symbol:K.green(e$)})},warn:e=>{e8.message(e,{symbol:K.yellow(eQ)})},warning:e=>{e8.warn(e)},error:e=>{e8.message(e,{symbol:K.red(e0)})}};function e6({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}K.gray(eP);let e5=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}()?"●":"•",e4=(...e)=>{let t=m.format(...e);e8.warn(tt(t,q().yellow))},e9=(...e)=>{0},e7=(...e)=>{let t=m.format(...e);e8.step(t)},te=()=>!e6();function tt(e,t){return e.split("\n").map(t).join("\n")}function ti(e){return((e="")=>{process.stdout.write(`${K.gray(eP)}
|
|
25
|
+
${K.gray(ez)} ${e}
|
|
26
|
+
|
|
27
|
+
`)})(e)}function tr(e,t){return((e="",t="")=>{let i=`
|
|
28
|
+
${e}
|
|
29
|
+
`.split(`
|
|
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=>`${K.gray(eP)} ${K.dim(e)}${" ".repeat(n-E(e).length)}${K.gray(eP)}`).join(`
|
|
31
|
+
`);process.stdout.write(`${K.gray(eP)}
|
|
32
|
+
${K.green(e$)} ${K.reset(t)} ${K.gray(eV.repeat(Math.max(n-r-1,1))+eY)}
|
|
33
|
+
${s}
|
|
34
|
+
${K.gray(eX+eV.repeat(n+2)+eK)}
|
|
35
|
+
`)})(e,t)}async function tn(e){let t=await new eI({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${K.gray(eP)}
|
|
36
|
+
${e1(this.state)} ${e.message}
|
|
37
|
+
`,i=e.placeholder?K.inverse(e.placeholder[0])+K.dim(e.placeholder.slice(1)):K.inverse(K.hidden("_")),r=this.value?this.valueWithCursor:i;switch(this.state){case"error":return`${t.trim()}
|
|
38
|
+
${K.yellow(eP)} ${r}
|
|
39
|
+
${K.yellow(ez)} ${K.yellow(this.error)}
|
|
40
|
+
`;case"submit":return`${t}${K.gray(eP)} ${K.dim(this.value||e.placeholder)}`;case"cancel":return`${t}${K.gray(eP)} ${K.strikethrough(K.dim(this.value??""))}${this.value?.trim()?`
|
|
41
|
+
${K.gray(eP)}`:""}`;default:return`${t}${K.cyan(eP)} ${r}
|
|
42
|
+
${K.cyan(ez)}
|
|
43
|
+
`}}}).prompt();return t===eF&&th(),t}async function ts(e){if(1===e.options.length)return e.options[0].value;let t=await e3(e);return t===eF&&th(),t}async function to(e){let t=await e3({message:e.message,options:[{value:!0,label:e.confirmLabel??"Confirm"},{value:!1,label:e.cancelLabel??"Cancel"}]});return t===eF&&th(),!0===t}async function tu(e){let t=await (e=>{let t=(e,t)=>{let i=e.label??String(e.value);return"active"===t?`${K.cyan(eG)} ${i} ${e.hint?K.dim(`(${e.hint})`):""}`:"selected"===t?`${K.green(eZ)} ${K.dim(i)} ${e.hint?K.dim(`(${e.hint})`):""}`:"cancelled"===t?`${K.strikethrough(K.dim(i))}`:"active-selected"===t?`${K.green(eZ)} ${i} ${e.hint?K.dim(`(${e.hint})`):""}`:"submitted"===t?`${K.dim(i)}`:`${K.dim(eW)} ${K.dim(i)}`};return new eR({options:e.options,initialValues:e.initialValues,required:e.required??!0,cursorAt:e.cursorAt,validate(e){if(this.required&&0===e.length)return`Please select at least one option.
|
|
44
|
+
${K.reset(K.dim(`Press ${K.gray(K.bgWhite(K.inverse(" space ")))} to select, ${K.gray(K.bgWhite(K.inverse(" enter ")))} to submit`))}`},render(){let i=`${K.gray(eP)}
|
|
45
|
+
${e1(this.state)} ${e.message}
|
|
46
|
+
`,r=(e,i)=>{let r=this.value.includes(e.value);return i&&r?t(e,"active-selected"):r?t(e,"selected"):t(e,i?"active":"inactive")};switch(this.state){case"submit":return`${i}${K.gray(eP)} ${this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,"submitted")).join(K.dim(", "))||K.dim("none")}`;case"cancel":{let e=this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,"cancelled")).join(K.dim(", "));return`${i}${K.gray(eP)} ${e.trim()?`${e}
|
|
47
|
+
${K.gray(eP)}`:""}`}case"error":{let t=this.error.split(`
|
|
48
|
+
`).map((e,t)=>0===t?`${K.yellow(ez)} ${K.yellow(e)}`:` ${e}`).join(`
|
|
49
|
+
`);return`${i+K.yellow(eP)} ${e2({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
|
|
50
|
+
${K.yellow(eP)} `)}
|
|
51
|
+
${t}
|
|
52
|
+
`}default:return`${i}${K.cyan(eP)} ${e2({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
|
|
53
|
+
${K.cyan(eP)} `)}
|
|
54
|
+
${K.cyan(ez)}
|
|
55
|
+
`}}}).prompt()})(e);return t===eF&&th(),t}function ta(e){if(null==e?void 0:e.silent)return{start:()=>{},stop:()=>{},message:()=>{}};if(te()||!e6())return{start:e=>e7(tl(e)),stop:(e,t=0)=>0===t?e7(e):((...e)=>{let t=m.format(...e);e8.error(tt(t,q().red))})(e),message:e=>e7(tl(e))};let t=(({indicator:e="dots"}={})=>{let t=eN?["◒","◐","◓","◑"]:["•","o","O","0"],i=eN?80:120,r="true"===process.env.CI,n,s,o=!1,u="",a,l=performance.now(),h=e=>{o&&m(e>1?"Something went wrong":"Canceled",e)},c=()=>h(2),d=()=>h(1),D=()=>{if(void 0===a)return;r&&process.stdout.write(`
|
|
56
|
+
`);let e=a.split(`
|
|
57
|
+
`);process.stdout.write(X.cursor.move(-999,e.length-1)),process.stdout.write(X.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?K.green(e$):1===i?K.red(ek):K.red(eM);u=f(t??u),"timer"===e?process.stdout.write(`${r} ${u} ${p(l)}
|
|
58
|
+
`):process.stdout.write(`${r} ${u}
|
|
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=y,output:t=b,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(X.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(X.cursor.hide),e.once("keypress",s),()=>{e.off("keypress",s),r&&t.write(X.cursor.show),e.isTTY&&!eb&&e.setRawMode(!1),n.terminal=!1,n.close()}}(),u=f(m),l=performance.now(),process.stdout.write(`${K.gray(eP)}
|
|
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=K.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 tl(e){if(void 0===e)return;let t=e.replace(/\.+$/,"");return`${t}...`}function th(e){((e="")=>{process.stdout.write(`${K.gray(ez)} ${K.red(e)}
|
|
61
|
+
|
|
62
|
+
`)})(e??"Operation cancelled by user."),process.exit(0)}class tc extends Error{constructor(e,{cause:t}={}){super(e,{cause:t}),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor)}}var td=V("fs"),tD=V("path");V("../../node_modules/.pnpm/ignore@7.0.5/node_modules/ignore/index.js"),V("crypto");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})=>tb.some(t=>e.toLowerCase().endsWith(t))||(tg[`${e}\0${t}\0${r}`]??=await ty(e,t,r)),tg={},ty=async(e,t,i)=>{let r=i.split(u.delimiter).filter(Boolean).map(e=>e.replace(/^"(.*)"$/,"$1"));try{await Promise.all(tb.flatMap(i=>[t,...r].map(t=>`${u.resolve(t,e)}${i}`)).map(async e=>{try{await R(e)}catch{return}throw 0}))}catch{return!0}return!1},tb=[".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=N(r,"close");try{return await Promise.race([n,...r.stdio.filter(Boolean).map(e=>tw(e))]),t_(i,tO(r)),tx(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),tx(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}}),tx=({state:{stdout:e,stderr:t,output:i},command:r,start:n})=>({stdout:tB(e),stderr:tB(t),output:tB(i),command:r,durationMs:Number(g.hrtime.bigint()-n)/1e6}),tB=e=>"\n"===e.at(-1)?e.slice(0,"\r"===e.at(-2)?-2:-1):e,tI=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]=tN(e,t,i);let n=x(e,t,i);return tT(n.stdout,r,"stdout"),tT(n.stderr,r,"stderr"),n.once("error",()=>{}),await N(n,"spawn"),n}catch(e){throw tS(e,{},r)}},tN=(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.');T(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()?"inherit":"pipe";e9(`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?O(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=tI(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)}V("../../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 ib||e instanceof S||tZ(e)||tW(e)),tZ=e=>!!e&&"object"==typeof e&&e instanceof B&&"function"==typeof e.pipe&&e.pipe!==S.Writable.prototype.pipe,tW=e=>!!e&&"object"==typeof e&&e instanceof B&&"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 iy 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 ib extends B{[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 M(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 iy(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"),ix=Symbol("_makeBuf"),iB=Symbol("_mode"),iI=Symbol("_needDrain"),iN=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 ib{[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[iN](e):(this[i_]=t,this.emit("open",t),this[iz]())}[ix](){return Buffer.allocUnsafe(Math.min(this[iU],this[iG]))}[iz](){if(!this[iH]){this[iH]=!0;let e=this[ix]();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[iN](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"))}}[iN](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[ix](),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 L{readable=!1;writable=!0;[iX]=!1;[iV]=!1;[iw]=!1;[iP]=[];[iI]=!1;[i$];[iB];[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[iB]=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$]}[iN](e){this[iv](),this[iV]=!0,this.emit("error",e)}[iM](){td.default.open(this[i$],this[iA],this[iB],(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[iN](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[iI]=!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[iN](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[iI]&&(this[iI]=!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[iB])}catch(e){if(e?.code==="ENOENT")return this[iA]="w",this[iM]();throw e}else e=td.default.openSync(this[i$],this[iA],this[iB]);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=V("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=j.concat,i9=Symbol("_superWrite");class i7 extends Error{code;errno;constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}let re=Symbol("flushFlag");class rt extends ib{#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");super(e),this.#i=e.flush??0,this.#r=e.finishFlush??0,this.#n=e.fullFlushFlag??0;try{this.#s=new i8.default[t](e)}catch(e){throw new i7(e)}this.#o=e=>{this.#e||(this.#e=!0,this.close(),this.emit("error",e))},this.#s?.on("error",e=>this.#o(new i7(e))),this.once("end",()=>this.close)}close(){this.#s&&(this.#s.close(),this.#s=void 0,this.emit("close"))}reset(){if(!this.#e)return $(this.#s,"zlib binding closed"),this.#s.reset?.()}flush(e){this.ended||("number"!=typeof e&&(e=this.#n),this.write(Object.assign(j.alloc(0),{[re]: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}[i9](e){return super.write(e)}write(e,t,i){let r,n;if("function"==typeof t&&(i=t,t="utf8"),"string"==typeof e&&(e=j.from(e,t)),this.#e)return;$(this.#s,"zlib binding closed");let s=this.#s._handle,o=s.close;s.close=()=>{};let u=this.#s.close;this.#s.close=()=>{},j.concat=e=>e;try{let t="number"==typeof e[re]?e[re]:this.#i;n=this.#s._processChunk(e,t),j.concat=i4}catch(e){j.concat=i4,this.#o(new i7(e))}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 i7(e))),n)if(Array.isArray(n)&&n.length>0){let e=n[0];r=this[i9](j.from(e));for(let e=1;e<n.length;e++)r=this[i9](n[e])}else r=this[i9](j.from(n));return i&&i(),r}}class ri extends rt{#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),$(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 rr extends ri{#l;constructor(e){super(e,"Gzip"),this.#l=e&&!!e.portable}[i9](e){return this.#l&&(this.#l=!1,e[9]=255),super[i9](e)}}class rn extends ri{constructor(e){super(e,"Unzip")}}class rs extends rt{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 ro extends rs{constructor(e){super(e,"BrotliCompress")}}class ru extends rs{constructor(e){super(e,"BrotliDecompress")}}class ra{tail;head;length=0;static create(e=[]){return new ra(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 rl(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 rl(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 ra;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 ra;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 ra;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 ra;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 rl(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 rl{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}}let rh=e=>(255^e)&255,rc=e=>(255^e)+1&255,rd=e=>rD.has(e),rD=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"]]),rf=new Map(Array.from(rD).map(e=>[e[1],e[0]]));class rp{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=rE(e,t,100),this.mode=rb(e,t+100,8),this.uid=rb(e,t+108,8),this.gid=rb(e,t+116,8),this.size=rb(e,t+124,12),this.mtime=rg(e,t+136,12),this.cksum=rb(e,t+148,12),r&&this.#c(r,!0),i&&this.#c(i);let n=rE(e,t+156,1);if(rd(n)&&(this.#h=n||"0"),"0"===this.#h&&"/"===this.path.slice(-1)&&(this.#h="5"),"5"===this.#h&&(this.size=0),this.linkpath=rE(e,t+157,100),"ustar\x0000"===e.subarray(t+257,t+265).toString())if(this.uname=rE(e,t+265,32),this.gname=rE(e,t+297,32),this.devmaj=rb(e,t+329,8)??0,this.devmin=rb(e,t+337,8)??0,0!==e[t+475]){let i=rE(e,t+345,155);this.path=i+"/"+this.path}else{let i=rE(e,t+345,130);i&&(this.path=i+"/"+this.path),this.atime=rg(e,t+476,12),this.ctime=rg(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=rm(this.path||"",i),n=r[0],s=r[1];this.needPax=!!r[2],this.needPax=rO(e,t,100,n)||this.needPax,this.needPax=rv(e,t+100,8,this.mode)||this.needPax,this.needPax=rv(e,t+108,8,this.uid)||this.needPax,this.needPax=rv(e,t+116,8,this.gid)||this.needPax,this.needPax=rv(e,t+124,12,this.size)||this.needPax,this.needPax=rA(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#h.charCodeAt(0),this.needPax=rO(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=rO(e,t+265,32,this.uname)||this.needPax,this.needPax=rO(e,t+297,32,this.gname)||this.needPax,this.needPax=rv(e,t+329,8,this.devmaj)||this.needPax,this.needPax=rv(e,t+337,8,this.devmin)||this.needPax,this.needPax=rO(e,t+345,i,s)||this.needPax,0!==e[t+475]?this.needPax=rO(e,t+345,155,s)||this.needPax:(this.needPax=rO(e,t+345,130,s)||this.needPax,this.needPax=rA(e,t+476,12,this.atime)||this.needPax,this.needPax=rA(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,rv(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return"Unsupported"===this.#h?this.#h:rD.get(this.#h)}get typeKey(){return this.#h}set type(e){let t=String(rf.get(e));if(rd(t)||"Unsupported"===t)this.#h=t;else if(rd(e))this.#h=e;else throw TypeError("invalid entry type: "+e)}}let rm=(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},rE=(e,t,i)=>e.subarray(t,t+i).toString("utf8").replace(/\0.*/,""),rg=(e,t,i)=>ry(rb(e,t,i)),ry=e=>void 0===e?void 0:new Date(1e3*e),rb=(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=rh(o):0===o?s=o:(r=!0,s=rc(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)):rF(e,t,i),rF=(e,t,i)=>{let r;return isNaN(r=parseInt(e.subarray(t,t+i).toString("utf8").replace(/\0.*$/,"").trim(),8))?void 0:r},rC={12:0x1ffffffff,8:2097151},rv=(e,t,i,r)=>void 0!==r&&(r>rC[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]=rh(n):0===n?t[r-1]=0:(i=!0,t[r-1]=rc(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):(rw(e,t,i,r),!1)),rw=(e,t,i,r)=>e.write(r_(r,i),t,i,"ascii"),r_=(e,t)=>rS(Math.floor(e).toString(8),t),rS=(e,t)=>(e.length===t-1?e:Array(t-e.length-1).join("0")+e+" ")+"\0",rA=(e,t,i,r)=>void 0!==r&&rv(e,t,i,r.getTime()/1e3),rR=Array(156).join("\0"),rO=(e,t,i,r)=>void 0!==r&&(e.write(r+rR,t,i,"utf8"),r.length!==Buffer.byteLength(r)||r.length>i);class rx{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 rp({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 rx(rB(rI(e),t),i)}}let rB=(e,t)=>t?Object.assign({},t,e):e,rI=e=>e.replace(/\n$/,"").split("\n").reduce(rN,Object.create(null)),rN=(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},rT="win32"!==(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)?e=>e:e=>e&&e.replace(/\\/g,"/");class rL extends ib{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=rT(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?rT(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=rT(e.path)),e.linkpath&&(e.linkpath=rT(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([e,i])=>!(null==i||"path"===e&&t))))}}let rk=(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))},rM=Buffer.from([31,139]),r$=Symbol("state"),rj=Symbol("writeEntry"),rP=Symbol("readEntry"),rz=Symbol("nextEntry"),rU=Symbol("processEntry"),rH=Symbol("extendedHeader"),rG=Symbol("globalExtendedHeader"),rZ=Symbol("meta"),rW=Symbol("emitMeta"),rV=Symbol("buffer"),rY=Symbol("queue"),rX=Symbol("ended"),rK=Symbol("emittedEnd"),rq=Symbol("emit"),rJ=Symbol("unzip"),rQ=Symbol("consumeChunk"),r0=Symbol("consumeChunkSub"),r1=Symbol("consumeBody"),r2=Symbol("consumeMeta"),r3=Symbol("consumeHeader"),r8=Symbol("consuming"),r6=Symbol("bufferConcat"),r5=Symbol("maybeEnd"),r4=Symbol("writing"),r9=Symbol("aborted"),r7=Symbol("onDone"),ne=Symbol("sawValidEntry"),nt=Symbol("sawNullBlock"),ni=Symbol("sawEOF"),nr=Symbol("closeStream"),nn=()=>!0;class ns extends k{file;strict;maxMetaEntrySize;filter;brotli;writable=!0;readable=!1;[rY]=new ra;[rV];[rP];[rj];[r$]="begin";[rZ]="";[rH];[rG];[rX]=!1;[rJ];[r9]=!1;[ne];[nt]=!1;[ni]=!1;[r4]=!1;[r8]=!1;[rK]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(r7,()=>{("begin"===this[r$]||!1===this[ne])&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(r7,e.ondone):this.on(r7,()=>{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:nn;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=e.gzip||void 0===e.brotli?!!t&&void 0:e.brotli,this.on("end",()=>this[nr]()),"function"==typeof e.onwarn&&this.on("warn",e.onwarn),"function"==typeof e.onReadEntry&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){rk(this,e,t,i)}[r3](e,t){let i;void 0===this[ne]&&(this[ne]=!1);try{i=new rp(e,t,this[rH],this[rG])}catch(e){return this.warn("TAR_ENTRY_INVALID",e)}if(i.nullBlock)this[nt]?(this[ni]=!0,"begin"===this[r$]&&(this[r$]="header"),this[rq]("eof")):(this[nt]=!0,this[rq]("nullBlock"));else if(this[nt]=!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[rj]=new rL(i,this[rH],this[rG]);if(!this[ne])if(e.remain){let t=()=>{e.invalid||(this[ne]=!0)};e.on("end",t)}else this[ne]=!0;e.meta?e.size>this.maxMetaEntrySize?(e.ignore=!0,this[rq]("ignoredEntry",e),this[r$]="ignore",e.resume()):e.size>0&&(this[rZ]="",e.on("data",e=>this[rZ]+=e),this[r$]="meta"):(this[rH]=void 0,e.ignore=e.ignore||!this.filter(e.path,e),e.ignore?(this[rq]("ignoredEntry",e),this[r$]=e.remain?"ignore":"header",e.resume()):(e.remain?this[r$]="body":(this[r$]="header",e.end()),this[rP]?this[rY].push(e):(this[rY].push(e),this[rz]())))}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})}[nr](){queueMicrotask(()=>this.emit("close"))}[rU](e){let t=!0;if(e)if(Array.isArray(e)){let[t,...i]=e;this.emit(t,...i)}else this[rP]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[rz]()),t=!1);else this[rP]=void 0,t=!1;return t}[rz](){do;while(this[rU](this[rY].shift()));if(!this[rY].length){let e=this[rP];!e||e.flowing||e.size===e.remain?this[r4]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[r1](e,t){let i=this[rj];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[r$]="header",this[rj]=void 0,i.end()),n.length}[r2](e,t){let i=this[rj],r=this[r1](e,t);return!this[rj]&&i&&this[rW](i),r}[rq](e,t,i){this[rY].length||this[rP]?this[rY].push([e,t,i]):this.emit(e,t,i)}[rW](e){switch(this[rq]("meta",this[rZ]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[rH]=rx.parse(this[rZ],this[rH],!1);break;case"GlobalExtendedHeader":this[rG]=rx.parse(this[rZ],this[rG],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let e=this[rH]??Object.create(null);this[rH]=e,e.path=this[rZ].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let e=this[rH]||Object.create(null);this[rH]=e,e.linkpath=this[rZ].replace(/\0.*/,"");break}default:throw Error("unknown meta: "+e.type)}}abort(e){this[r9]=!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[r9])return i?.(),!1;if((void 0===this[rJ]||void 0===this.brotli&&!1===this[rJ])&&e){if(this[rV]&&(e=Buffer.concat([this[rV],e]),this[rV]=void 0),e.length<rM.length)return this[rV]=e,i?.(),!0;for(let t=0;void 0===this[rJ]&&t<rM.length;t++)e[t]!==rM[t]&&(this[rJ]=!1);let t=void 0===this.brotli;if(!1===this[rJ]&&t)if(e.length<512)if(!this[rX])return this[rV]=e,i?.(),!0;else this.brotli=!0;else try{new rp(e.subarray(0,512)),this.brotli=!1}catch(e){this.brotli=!0}if(void 0===this[rJ]||!1===this[rJ]&&this.brotli){let t=this[rX];this[rX]=!1,this[rJ]=void 0===this[rJ]?new rn({}):new ru({}),this[rJ].on("data",e=>this[rQ](e)),this[rJ].on("error",e=>this.abort(e)),this[rJ].on("end",()=>{this[rX]=!0,this[rQ]()}),this[r4]=!0;let r=!!this[rJ][t?"end":"write"](e);return this[r4]=!1,i?.(),r}}this[r4]=!0,this[rJ]?this[rJ].write(e):this[rQ](e),this[r4]=!1;let r=!this[rY].length&&(!this[rP]||this[rP].flowing);return r||this[rY].length||this[rP]?.once("drain",()=>this.emit("drain")),i?.(),r}[r6](e){e&&!this[r9]&&(this[rV]=this[rV]?Buffer.concat([this[rV],e]):e)}[r5](){if(this[rX]&&!this[rK]&&!this[r9]&&!this[r8]){this[rK]=!0;let e=this[rj];if(e&&e.blockRemain){let t=this[rV]?this[rV].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[rV]&&e.write(this[rV]),e.end()}this[rq](r7)}}[rQ](e){if(this[r8]&&e)this[r6](e);else if(e||this[rV]){if(e){if(this[r8]=!0,this[rV]){this[r6](e);let t=this[rV];this[rV]=void 0,this[r0](t)}else this[r0](e);for(;this[rV]&&this[rV]?.length>=512&&!this[r9]&&!this[ni];){let e=this[rV];this[rV]=void 0,this[r0](e)}this[r8]=!1}}else this[r5]();(!this[rV]||this[rX])&&this[r5]()}[r0](e){let t=0,i=e.length;for(;t+512<=i&&!this[r9]&&!this[ni];)switch(this[r$]){case"begin":case"header":this[r3](e,t),t+=512;break;case"ignore":case"body":t+=this[r1](e,t);break;case"meta":t+=this[r2](e,t);break;default:throw Error("invalid state: "+this[r$])}t<i&&(this[rV]?this[rV]=Buffer.concat([e.subarray(t),this[rV]]):this[rV]=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[r9]||(this[rJ]?(e&&this[rJ].write(e),this[rJ].end()):(this[rX]=!0,void 0===this.brotli&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[r5]())),this}}let no=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)},nu=(e,t)=>{let i=new Map(t.map(e=>[no(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(no(e)):e=>n(no(e))},na=i3(t=>{let i,r=new ns(t),n=t.file;try{let s=e.statSync(n),o=t.maxReadSize||0x1000000;if(s.size<o)r.end(e.readFileSync(n));else{let t=0,u=Buffer.allocUnsafe(o);for(i=e.openSync(n,"r");t<s.size;){let n=e.readSync(i,u,0,o,t);t+=n,r.write(u.subarray(0,n))}r.end()}}finally{if("number"==typeof i)try{e.closeSync(i)}catch(e){}}},(t,i)=>{let r=new ns(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 ns(e),e=>new ns(e),(e,t)=>{t?.length&&nu(e,t),e.noResume||(e=>{let t=e.onReadEntry;e.onReadEntry=t?e=>{t(e),e.resume()}:e=>e.resume()})(e)}),nl=(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:nh,parse:nc}=p,nd=e=>{let t="",i=nc(e);for(;nh(e)||i.root;){let r="/"===e.charAt(0)&&"//?/"!==e.slice(0,4)?"/":i.root;e=e.slice(r.length),t+=r,i=nc(e)}return[t,e]},nD=["|","<",">","?",":"],nf=nD.map(e=>String.fromCharCode(61440+e.charCodeAt(0))),np=new Map(nD.map((e,t)=>[e,nf[t]])),nm=new Map(nf.map((e,t)=>[e,nD[t]])),nE=e=>nD.reduce((e,t)=>e.split(t).join(np.get(t)),e),ng=(e,t)=>t?(e=rT(e).replace(/^\.(\/|$)/,""),no(t)+"/"+e):rT(e),ny=Symbol("process"),nb=Symbol("file"),nF=Symbol("directory"),nC=Symbol("symlink"),nv=Symbol("hardlink"),nw=Symbol("header"),n_=Symbol("read"),nS=Symbol("lstat"),nA=Symbol("onlstat"),nR=Symbol("onread"),nO=Symbol("onreadlink"),nx=Symbol("openfile"),nB=Symbol("onopenfile"),nI=Symbol("close"),nN=Symbol("mode"),nT=Symbol("awaitDrain"),nL=Symbol("ondrain"),nk=Symbol("prefix");class nM extends ib{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=rT(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=rT(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?rT(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]=nd(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,"/"),nf.reduce((e,t)=>e.split(t).join(nm.get(t)),t)),e=e.replace(/\\/g,"/")}this.absolute=rT(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[nA](n):this[nS]()}warn(e,t,i={}){return rk(this,e,t,i)}emit(e,...t){return"error"===e&&(this.#d=!0),super.emit(e,...t)}[nS](){td.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[nA](t)})}[nA](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=nP(e),this.emit("stat",e),this[ny]()}[ny](){switch(this.type){case"File":return this[nb]();case"Directory":return this[nF]();case"SymbolicLink":return this[nC]();default:return this.end()}}[nN](e){return nl(e,"Directory"===this.type,this.portable)}[nk](e){return ng(e,this.prefix)}[nw](){if(!this.stat)throw Error("cannot write header before stat");"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new rp({path:this[nk](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nk](this.linkpath):this.linkpath,mode:this[nN](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 rx({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[nk](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nk](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)}[nF](){if(!this.stat)throw Error("cannot create directory entry without stat");"/"!==this.path.slice(-1)&&(this.path+="/"),this.stat.size=0,this[nw](),this.end()}[nC](){td.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[nO](t)})}[nO](e){this.linkpath=rT(e),this[nw](),this.end()}[nv](e){if(!this.stat)throw Error("cannot create link entry without stat");this.type="Link",this.linkpath=rT(tD.default.relative(this.cwd,e)),this.stat.size=0,this[nw](),this.end()}[nb](){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[nv](t);this.linkCache.set(e,this.absolute)}if(this[nw](),0===this.stat.size)return this.end();this[nx]()}[nx](){td.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[nB](t)})}[nB](e){if(this.fd=e,this.#d)return this[nI]();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[n_]()}[n_](){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[nI](()=>this.emit("error",e));this[nR](t)})}[nI](e=()=>{}){void 0!==this.fd&&td.default.close(this.fd,e)}[nR](e){if(e<=0&&this.remain>0){let e=Object.assign(Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[nI](()=>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[nI](()=>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[nL]():this[nT](()=>this[nL]())}[nT](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)}[nL](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[nI](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[n_]()}}class n$ extends nM{sync=!0;[nS](){this[nA](td.default.lstatSync(this.absolute))}[nC](){this[nO](td.default.readlinkSync(this.absolute))}[nx](){this[nB](td.default.openSync(this.absolute,"r"))}[n_](){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[nR](o),e=!1}finally{if(e)try{this[nI](()=>{})}catch(e){}}}[nT](e){e()}[nI](e=()=>{}){void 0!==this.fd&&td.default.closeSync(this.fd),e()}}class nj extends ib{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 rk(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=rT(e.path),this.mode=void 0!==e.mode?this[nN](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?rT(e.linkpath):void 0,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[e,t]=nd(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 rp({path:this[nk](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nk](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 rx({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[nk](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[nk](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)}[nk](e){return ng(e,this.prefix)}[nN](e){return nl(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 nP=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported";class nz{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}}let nU=Buffer.alloc(1024),nH=Symbol("onStat"),nG=Symbol("ended"),nZ=Symbol("queue"),nW=Symbol("current"),nV=Symbol("process"),nY=Symbol("processing"),nX=Symbol("processJob"),nK=Symbol("jobs"),nq=Symbol("jobDone"),nJ=Symbol("addFSEntry"),nQ=Symbol("addTarEntry"),n0=Symbol("stat"),n1=Symbol("readdir"),n2=Symbol("onreaddir"),n3=Symbol("pipe"),n8=Symbol("entry"),n6=Symbol("entryOpt"),n5=Symbol("writeEntryClass"),n4=Symbol("write"),n9=Symbol("ondrain");class n7 extends ib{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[n5];onWriteEntry;[nZ];[nK]=0;[nY]=!1;[nG]=!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=rT(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[n5]=nM,"function"==typeof e.onwarn&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli){if(e.gzip&&e.brotli)throw TypeError("gzip and brotli are mutually exclusive");if(e.gzip&&("object"!=typeof e.gzip&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new rr(e.gzip)),e.brotli&&("object"!=typeof e.brotli&&(e.brotli={}),this.zip=new ro(e.brotli)),!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[n9]()),this.on("resume",()=>t.resume())}else this.on("drain",this[n9]);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[nZ]=new ra,this[nK]=0,this.jobs=Number(e.jobs)||4,this[nY]=!1,this[nG]=!1}[n4](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[nG]=!0,this[nV](),i&&i(),this}write(e){if(this[nG])throw Error("write after end");return e instanceof rL?this[nQ](e):this[nJ](e),this.flowing}[nQ](e){let t=rT(tD.default.resolve(this.cwd,e.path));if(this.filter(e.path,e)){let i=new nz(e.path,t);i.entry=new nj(e,this[n6](i)),i.entry.on("end",()=>this[nq](i)),this[nK]+=1,this[nZ].push(i)}else e.resume();this[nV]()}[nJ](e){let t=rT(tD.default.resolve(this.cwd,e));this[nZ].push(new nz(e,t)),this[nV]()}[n0](e){e.pending=!0,this[nK]+=1;let t=this.follow?"stat":"lstat";td.default[t](e.absolute,(t,i)=>{e.pending=!1,this[nK]-=1,t?this.emit("error",t):this[nH](e,i)})}[nH](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[nV]()}[n1](e){e.pending=!0,this[nK]+=1,td.default.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[nK]-=1,t)return this.emit("error",t);this[n2](e,i)})}[n2](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[nV]()}[nV](){if(!this[nY]){this[nY]=!0;for(let e=this[nZ].head;e&&this[nK]<this.jobs;e=e.next)if(this[nX](e.value),e.value.ignore){let t=e.next;this[nZ].removeNode(e),e.next=t}this[nY]=!1,this[nG]&&!this[nZ].length&&0===this[nK]&&(this.zip?this.zip.end(nU):(super.write(nU),super.end()))}}get[nW](){return this[nZ]&&this[nZ].head&&this[nZ].head.value}[nq](e){this[nZ].shift(),this[nK]-=1,this[nV]()}[nX](e){if(!e.pending){if(e.entry){e!==this[nW]||e.piped||this[n3](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[nH](e,t):this[n0](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[n2](e,t):this[n1](e),!e.readdir)return}if(e.entry=this[n8](e),!e.entry){e.ignore=!0;return}e!==this[nW]||e.piped||this[n3](e)}}}[n6](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}}[n8](e){this[nK]+=1;try{return new this[n5](e.path,this[n6](e)).on("end",()=>this[nq](e)).on("error",e=>this.emit("error",e))}catch(e){this.emit("error",e)}}[n9](){this[nW]&&this[nW].entry&&this[nW].entry.resume()}[n3](e){e.piped=!0,e.readdir&&e.readdir.forEach(t=>{let i=e.path,r="./"===i?"":i.replace(/\/*$/,"/");this[nJ](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={}){rk(this,e,t,i)}}class se extends n7{sync=!0;constructor(e){super(e),this[n5]=n$}pause(){}resume(){}[n0](e){let t=this.follow?"statSync":"lstatSync";this[nH](e,td.default[t](e.absolute))}[n1](e){this[n2](e,td.default.readdirSync(e.absolute))}[n3](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(t=>{let i=e.path,r="./"===i?"":i.replace(/\/*$/,"/");this[nJ](r+t)}),!t)throw Error("Cannot pipe without source");i?t.on("data",e=>{i.write(e)}):t.on("data",e=>{super[n4](e)})}}let st=(e,t)=>{t.forEach(t=>{"@"===t.charAt(0)?na({file:u.resolve(e.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:t=>e.add(t)}):e.add(t)}),e.end()},si=async(e,t)=>{for(let i=0;i<t.length;i++){let r=String(t[i]);"@"===r.charAt(0)?await na({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 se(e),r=new iQ(e.file,{mode:e.mode||438});i.pipe(r),st(i,t)},(e,t)=>{let i=new n7(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 si(i,t),n},(e,t)=>{let i=new se(e);return st(i,t),i},(e,t)=>{let i=new n7(e);return si(i,t),i},(e,t)=>{if(!t?.length)throw TypeError("no paths specified to add to archive")});let sr=process.env.__FAKE_PLATFORM__||process.platform,{O_CREAT:sn,O_TRUNC:ss,O_WRONLY:so}=td.default.constants,su=Number(process.env.__FAKE_FS_O_FILENAME__)||td.default.constants.UV_FS_O_FILEMAP||0,sa=su|ss|sn|so,sl="win32"===sr&&su?e=>e<524288?sa:"w":()=>"w",sh=(t,i,r)=>{try{return e.lchownSync(t,i,r)}catch(e){if(e?.code!=="ENOENT")throw e}},sc=(t,i,r,n)=>{e.lchown(t,i,r,e=>{n(e&&e?.code!=="ENOENT"?e:null)})},sd=(e,t,i,r,n)=>{t.isDirectory()?sD(u.resolve(e,t.name),i,r,s=>{if(s)return n(s);sc(u.resolve(e,t.name),i,r,n)}):sc(u.resolve(e,t.name),i,r,n)},sD=(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 sc(t,i,r,n);let o=s.length,u=null,a=e=>{if(!u){if(e)return n(u=e);if(0==--o)return sc(t,i,r,n)}};for(let e of s)sd(t,e,i,r,a)})},sf=(e,t,i,r)=>{t.isDirectory()&&sp(u.resolve(e,t.name),i,r),sh(u.resolve(e,t.name),i,r)},sp=(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 sh(t,i,r);throw e}for(let e of n)sf(t,e,i,r);return sh(t,i,r)},sm=e=>{if(e)if("object"==typeof e)e={mode:511,...e};else if("number"==typeof e)e={mode:e};else if("string"==typeof e)e={mode:parseInt(e,8)};else throw TypeError("invalid options argument");else e={mode:511};let t=e,i=e.fs||{};return e.mkdir=e.mkdir||i.mkdir||td.mkdir,e.mkdirAsync=e.mkdirAsync?e.mkdirAsync:async(e,i)=>new Promise((r,n)=>t.mkdir(e,i,(e,t)=>e?n(e):r(t))),e.stat=e.stat||i.stat||td.stat,e.statAsync=e.statAsync?e.statAsync:async e=>new Promise((i,r)=>t.stat(e,(e,t)=>e?r(e):i(t))),e.statSync=e.statSync||i.statSync||td.statSync,e.mkdirSync=e.mkdirSync||i.mkdirSync||td.mkdirSync,t},sE=(e,t,i)=>{let r=(0,tD.dirname)(e),n={...sm(t),recursive:!1};if(r===e)try{return n.mkdirSync(e,n)}catch(e){if(e&&"EISDIR"!==e.code)throw e;return}try{return n.mkdirSync(e,n),i||e}catch(t){if(t&&"ENOENT"===t.code)return sE(e,n,sE(r,n,i));if(t&&"EEXIST"!==t.code&&t&&"EROFS"!==t.code)throw t;try{if(!n.statSync(e).isDirectory())throw t}catch(e){throw t}}},sg=Object.assign(async(e,t,i)=>{let r=sm(t);r.recursive=!1;let n=(0,tD.dirname)(e);return n===e?r.mkdirAsync(e,r).catch(e=>{if(e&&"EISDIR"!==e.code)throw e}):r.mkdirAsync(e,r).then(()=>i||e,async t=>{if(t&&"ENOENT"===t.code)return sg(n,r).then(t=>sg(e,r,t));if(t&&"EEXIST"!==t.code&&"EROFS"!==t.code)throw t;return r.statAsync(e).then(e=>{if(e.isDirectory())return i;throw t},()=>{throw t})})},{sync:sE}),sy=async(e,t,i)=>{if(i!==t)return e.statAsync(t).then(e=>e.isDirectory()?i:void 0,i=>i&&"ENOENT"===i.code?sy(e,(0,tD.dirname)(t),t):void 0)},sb=(e,t,i)=>{if(i!==t)try{return e.statSync(t).isDirectory()?i:void 0}catch(i){return i&&"ENOENT"===i.code?sb(e,(0,tD.dirname)(t),t):void 0}},sF=(e,t)=>{let i=sm(t);if(i.recursive=!0,(0,tD.dirname)(e)===e)return i.mkdirSync(e,i);let r=sb(i,e);try{return i.mkdirSync(e,i),r}catch(t){if(t&&"ENOENT"===t.code)return sE(e,i);throw t}},sC=Object.assign(async(e,t)=>{let i={...sm(t),recursive:!0};return(0,tD.dirname)(e)===e?await i.mkdirAsync(e,i):sy(i,e).then(t=>i.mkdirAsync(e,i).then(e=>t||e).catch(t=>{if(t&&"ENOENT"===t.code)return sg(e,i);throw t}))},{sync:sF}),sv=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,sw=e=>{if(/\0/.test(e))throw Object.assign(TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"});if(e=(0,tD.resolve)(e),"win32"===sv){let{root:t}=(0,tD.parse)(e);if(/[*|"<>?:]/.test(e.substring(t.length)))throw Object.assign(Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e},s_=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),sS=+s_[0]>10||10==+s_[0]&&+s_[1]>=12,sA=sS?e=>sm(e).mkdirSync===td.mkdirSync:()=>!1,sR=Object.assign(sS?e=>sm(e).mkdir===td.mkdir:()=>!1,{sync:sA}),sO=(e,t)=>{e=sw(e);let i=sm(t);return sA(i)?sF(e,i):sE(e,i)},sx=Object.assign(async(e,t)=>{e=sw(e);let i=sm(t);return sR(i)?sC(e,i):sg(e,i)},{mkdirpSync:sO,mkdirpNative:sC,mkdirpNativeSync:sF,mkdirpManual:sg,mkdirpManualSync:sE,sync:sO,native:sC,nativeSync:sF,manual:sg,manualSync:sE,useNative:sR,useNativeSync:sA});class sB 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 sI 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 sN=(e,t)=>e.get(rT(t)),sT=(e,t,i)=>e.set(rT(t),i),sL=(e,t,i,r,n,s,o,a)=>{if(!t.length)return a(null,o);let l=t.shift(),h=rT(u.resolve(e+"/"+l));if(sN(r,h))return sL(h,t,i,r,n,s,o,a);td.default.mkdir(h,i,sk(h,t,i,r,n,s,o,a))},sk=(e,t,i,r,n,s,o,u)=>a=>{a?td.default.lstat(e,(l,h)=>{if(l)l.path=l.path&&rT(l.path),u(l);else if(h.isDirectory())sL(e,t,i,r,n,s,o,u);else if(n)td.default.unlink(e,a=>{if(a)return u(a);td.default.mkdir(e,i,sk(e,t,i,r,n,s,o,u))});else{if(h.isSymbolicLink())return u(new sI(e,e+"/"+t.join("/")));u(a)}}):(o=o||e,sL(e,t,i,r,n,s,o,u))},sM=Object.create(null),{hasOwnProperty:s$}=Object.prototype,sj=e=>(s$.call(sM,e)||(sM[e]=e.normalize("NFD")),sM[e]),sP="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform);class sz{#D=new Map;#f=new Map;#p=new Set;reserve(e,t){let i=new Set((e=sP?["win32 parallelization disabled"]:e.map(e=>no(d(sj(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 sU=Symbol("onEntry"),sH=Symbol("checkFs"),sG=Symbol("checkFs2"),sZ=Symbol("pruneCache"),sW=Symbol("isReusable"),sV=Symbol("makeFs"),sY=Symbol("file"),sX=Symbol("directory"),sK=Symbol("link"),sq=Symbol("symlink"),sJ=Symbol("hardlink"),sQ=Symbol("unsupported"),s0=Symbol("checkPath"),s1=Symbol("mkdir"),s2=Symbol("onError"),s3=Symbol("pending"),s8=Symbol("pend"),s6=Symbol("unpend"),s5=Symbol("ended"),s4=Symbol("maybeClose"),s9=Symbol("skip"),s7=Symbol("doChown"),oe=Symbol("uid"),ot=Symbol("gid"),oi=Symbol("checkedCwd"),or="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform),on=(e,t,i)=>void 0!==e&&e===e>>>0?e:void 0!==t&&t===t>>>0?t:i,os=e=>no(rT(sj(e))).toLowerCase();class oo extends ns{[s5]=!1;[oi]=!1;[s3]=0;reservations=new sz;transform;writable=!0;readable=!1;dirCache;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[s5]=!0,this[s4]()},super(e),this.transform=e.transform,this.dirCache=e.dirCache||new Map,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||or,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=rT(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[sU](e))}warn(e,t,i={}){return("TAR_BAD_ARCHIVE"===e||"TAR_ABORT"===e)&&(i.recoverable=!1),super.warn(e,t,i)}[s4](){this[s5]&&0===this[s3]&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[s0](e){let t=rT(e.path),i=t.split("/");if(this.strip){if(i.length<this.strip)return!1;if("Link"===e.type){let t=rT(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("..")||or&&/^[a-z]:\.\.$/i.test(i[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[r,n]=nd(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=rT(u.resolve(e.path)):e.absolute=rT(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:rT(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+nE(String(e.absolute).slice(t.length));let{root:i}=u.win32.parse(e.path);e.path=i+nE(e.path.slice(i.length))}return!0}[sU](e){if(!this[s0](e))return e.resume();switch(P.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[sH](e);default:return this[sQ](e)}}[s2](e,t){"CwdError"===e.name?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[s6](),t.resume())}[s1](e,t,i){((e,t,i)=>{e=rT(e);let r=t.umask??18,n=448|t.mode,s=(n&r)!=0,o=t.uid,a=t.gid,l="number"==typeof o&&"number"==typeof a&&(o!==t.processUid||a!==t.processGid),h=t.preserve,c=t.unlink,d=t.cache,D=rT(t.cwd),f=(t,r)=>{t?i(t):(sT(d,e,!0),r&&l?sD(r,o,a,e=>f(e)):s?td.default.chmod(e,n,i):i())};if(d&&!0===sN(d,e))return f();if(e===D){var p;return p=e,td.default.stat(p,(e,t)=>{(e||!t.isDirectory())&&(e=new sB(p,e?.code||"ENOTDIR")),f(e)})}if(h)return sx(e,{mode:n}).then(e=>f(null,e??void 0),f);let m=rT(u.relative(D,e)).split("/");sL(D,m,n,d,c,D,void 0,f)})(rT(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t},i)}[s7](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}[oe](e){return on(this.uid,e.uid,this.processUid)}[ot](e){return on(this.gid,e.gid,this.processGid)}[sY](t,i){let r="number"==typeof t.mode?4095&t.mode:this.fmode,n=new iJ(String(t.absolute),{flags:sl(t.size),mode:r,autoClose:!1});n.on("error",r=>{n.fd&&e.close(n.fd,()=>{}),n.write=()=>!0,this[s2](r,t),i()});let s=1,o=r=>{if(r){n.fd&&e.close(n.fd,()=>{}),this[s2](r,t),i();return}0==--s&&void 0!==n.fd&&e.close(n.fd,e=>{e?this[s2](e,t):this[s6](),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[s7](t)){s++;let n=this[oe](t),u=this[ot](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[s2](e,t),i()}),t.pipe(u)),u.pipe(n)}[sX](t,i){let r="number"==typeof t.mode?4095&t.mode:this.dmode;this[s1](String(t.absolute),r,r=>{if(r){this[s2](r,t),i();return}let n=1,s=()=>{0==--n&&(i(),this[s6](),t.resume())};t.mtime&&!this.noMtime&&(n++,e.utimes(String(t.absolute),t.atime||new Date,t.mtime,s)),this[s7](t)&&(n++,e.chown(String(t.absolute),Number(this[oe](t)),Number(this[ot](t)),s)),s()})}[sQ](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[sq](e,t){this[sK](e,String(e.linkpath),"symlink",t)}[sJ](e,t){let i=rT(u.resolve(this.cwd,String(e.linkpath)));this[sK](e,i,"link",t)}[s8](){this[s3]++}[s6](){this[s3]--,this[s4]()}[s9](e){this[s6](),e.resume()}[sW](e,t){return"File"===e.type&&!this.unlink&&t.isFile()&&t.nlink<=1&&!or}[sH](e){this[s8]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,t=>this[sG](e,t))}[sZ](e){if("SymbolicLink"===e.type){var t=this.dirCache;for(let e of t.keys())t.delete(e)}else"Directory"!==e.type&&((e,t)=>{for(let i of(t=os(t),e.keys())){let r=os(i);(r===t||0===r.indexOf(t+"/"))&&e.delete(i)}})(this.dirCache,String(e.absolute))}[sG](t,i){this[sZ](t);let r=e=>{this[sZ](t),i(e)},n=()=>{this[s1](this.cwd,this.dmode,e=>{if(e){this[s2](e,t),r();return}this[oi]=!0,s()})},s=()=>{if(t.absolute!==this.cwd){let e=rT(u.dirname(String(t.absolute)));if(e!==this.cwd)return this[s1](e,this.dmode,e=>{if(e){this[s2](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[s9](t),r();return}if(i||this[sW](t,n))return this[sV](null,t,r);if(n.isDirectory()){if("Directory"===t.type){let i=this.chmod&&t.mode&&(4095&n.mode)!==t.mode,s=e=>this[sV](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[sV](e??null,t,r))}if(t.absolute===this.cwd)return this[sV](null,t,r);((t,i)=>{if(!or)return e.unlink(t,i);let r=t+".DELETE."+z(16).toString("hex");e.rename(t,r,t=>{if(t)return i(t);e.unlink(r,i)})})(String(t.absolute),e=>this[sV](e??null,t,r))})};this[oi]?s():n()}[sV](e,t,i){if(e){this[s2](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[sY](t,i);case"Link":return this[sJ](t,i);case"SymbolicLink":return this[sq](t,i);case"Directory":case"GNUDumpDir":return this[sX](t,i)}}[sK](t,i,r,n){e[r](i,String(t.absolute),e=>{e?this[s2](e,t):(this[s6](),t.resume()),n()})}}let ou=e=>{try{return[null,e()]}catch(e){return[e,null]}};class oa extends oo{sync=!0;[sV](e,t){return super[sV](e,t,()=>{})}[sH](t){if(this[sZ](t),!this[oi]){let e=this[s1](this.cwd,this.dmode);if(e)return this[s2](e,t);this[oi]=!0}if(t.absolute!==this.cwd){let e=rT(u.dirname(String(t.absolute)));if(e!==this.cwd){let i=this[s1](e,this.dmode);if(i)return this[s2](i,t)}}let[i,r]=ou(()=>e.lstatSync(String(t.absolute)));if(r&&(this.keep||this.newer&&r.mtime>(t.mtime??r.mtime)))return this[s9](t);if(i||this[sW](t,r))return this[sV](null,t);if(r.isDirectory()){if("Directory"===t.type){let[i]=this.chmod&&t.mode&&(4095&r.mode)!==t.mode?ou(()=>{e.chmodSync(String(t.absolute),Number(t.mode))}):[];return this[sV](i,t)}let[i]=ou(()=>e.rmdirSync(String(t.absolute)));this[sV](i,t)}let[n]=t.absolute===this.cwd?[]:ou(()=>(t=>{if(!or)return e.unlinkSync(t);let i=t+".DELETE."+z(16).toString("hex");e.renameSync(t,i),e.unlinkSync(i)})(String(t.absolute)));this[sV](n,t)}[sY](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[s2](n||s,t),i()};try{r=e.openSync(String(t.absolute),sl(t.size),n)}catch(e){return s(e)}let o=this.transform&&this.transform(t)||t;o!==t&&(o.on("error",e=>this[s2](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[s7](t)){let n=this[oe](t),s=this[ot](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)})}[sX](t,i){let r="number"==typeof t.mode?4095&t.mode:this.dmode,n=this[s1](String(t.absolute),r);if(n){this[s2](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[s7](t))try{e.chownSync(String(t.absolute),Number(this[oe](t)),Number(this[ot](t)))}catch(e){}i(),t.resume()}[s1](e,t){try{return((e,t)=>{let i;e=rT(e);let r=t.umask??18,n=448|t.mode,s=(n&r)!=0,o=t.uid,a=t.gid,l="number"==typeof o&&"number"==typeof a&&(o!==t.processUid||a!==t.processGid),h=t.preserve,c=t.unlink,d=t.cache,D=rT(t.cwd),f=t=>{sT(d,e,!0),t&&l&&sp(t,o,a),s&&td.default.chmodSync(e,n)};if(d&&!0===sN(d,e))return f();if(e===D){let e,t=!1;try{t=td.default.statSync(D).isDirectory()}catch(t){e=t?.code}finally{if(!t)throw new sB(D,e??"ENOTDIR")}return f()}if(h)return f(sO(e,n)??void 0);let p=rT(u.relative(D,e)).split("/");for(let e=p.shift(),t=D;e&&(t+="/"+e);e=p.shift())if(!sN(d,t=rT(u.resolve(t))))try{td.default.mkdirSync(t,n),i=i||t,sT(d,t,!0)}catch(r){let e=td.default.lstatSync(t);if(e.isDirectory()){sT(d,t,!0);continue}if(c){td.default.unlinkSync(t),td.default.mkdirSync(t,n),i=i||t,sT(d,t,!0);continue}if(e.isSymbolicLink())return new sI(t,t+"/"+p.join("/"))}return f(i)})(rT(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(e){return e}}[sK](t,i,r,n){let s=`${r}Sync`;try{e[s](i,String(t.absolute)),n(),t.resume()}catch(e){return this[s2](e,t)}}}let ol=i3(t=>{let i=new oa(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 oo(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 oa(e),e=>new oo(e),(e,t)=>{t?.length&&nu(e,t)}),oh=(e,t)=>{t.forEach(t=>{"@"===t.charAt(0)?na({file:u.resolve(e.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:t=>e.add(t)}):e.add(t)}),e.end()},oc=async(e,t)=>{for(let i=0;i<t.length;i++){let r=String(t[i]);"@"===r.charAt(0)?await na({file:u.resolve(String(e.cwd),r.slice(1)),noResume:!0,onReadEntry:t=>e.add(t)}):e.add(r)}e.end()},od=i3((t,i)=>{let r,n,s=new se(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 rp(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),oh(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 n7(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 rp(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),oc(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.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(od.syncFile,od.asyncFile,od.syncNoFile,od.asyncNoFile,(e,t=[])=>{od.validate?.(e,t),oD(e)});let oD=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 of(e,t){if(!await om())return void((...e)=>{let t=m.format(...e);e8.info(t)})("Git client not found, skipping git initialization");if(await oE(e))return void e9("Git repo already initialized, skipping git initialization");let i=ta();i.start("Initializing git repo");let r=`Initial commit
|
|
64
|
+
|
|
65
|
+
Generated by rock${t?`@${t}`:""}.`;await op(e,r),i.stop("Git repo initialized.")}async function op(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){e4("Failed to initialize git repository",e)}}async function om(){try{return await tz("git",["--version"],{stdio:"ignore"}),!0}catch{return!1}}async function oE(e){try{return await tz("git",["rev-parse","--is-inside-work-tree"],{stdio:"ignore",cwd:e}),!0}catch{return!1}}let og=[{type:"npm",name:"default",packageName:"@rock-js/template-default",version:"latest",directory:"."}],oy=[{type:"npm",name:"brownfield-ios",packageName:"@rock-js/plugin-brownfield-ios",version:"latest",directory:"template",importName:"pluginBrownfieldIos"},{type:"npm",name:"brownfield-android",packageName:"@rock-js/plugin-brownfield-android",version:"latest",directory:"template",importName:"pluginBrownfieldAndroid"}],ob=[{type:"npm",name:"metro",packageName:"@rock-js/plugin-metro",version:"latest",directory:"template",importName:"pluginMetro"},{type:"npm",name:"repack",packageName:"@rock-js/plugin-repack",version:"latest",directory:"template",importName:"pluginRepack"}],oF=[{type:"npm",name:"ios",packageName:"@rock-js/platform-ios",version:"latest",directory:"template",importName:"platformIOS"},{type:"npm",name:"android",packageName:"@rock-js/platform-android",version:"latest",directory:"template",importName:"platformAndroid"}];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),localPath:tU(t),directory:".",packageName:e.slice(0,e.length-i.length)}}return{type:"npm",name:ov(t),packageName:ov(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 ov(e){let t=e.split("@");return 3===t.length&&""===t[0]?`@${t[1]}`:2===t.length&&""!==t[0]?t[0]:e}function ow(e,t,i){void 0!==i&&(e[t]=i)}function o_(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())o_(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 e.copyFileSync(h,d)}}function oS(t){e.existsSync(t)&&e.rmSync(t,{recursive:!0})}function oA(t,i,r){let n=u.join(u.dirname(t),u.basename(t).replaceAll(i,r));e.renameSync(t,n)}let oR="HelloWorld";function oO(){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 ox(t){var i,r;let n=oO(),s=ta();s.start(`Adding ${q().bold("Rock")} dependencies with ${q().bold(n)}`),await oB(t,n,["rock","@rock-js/plugin-metro","@rock-js/platform-android","@rock-js/platform-ios"]),s.stop(`Added ${q().bold("Rock")} dependencies`),s.start(`Removing ${q().bold("React Native Community CLI")} packages`),await oI(t,n,["@react-native-community/cli","@react-native-community/cli-platform-android","@react-native-community/cli-platform-ios"]),s.stop(`Removed ${q().bold("React Native Community CLI")} packages`),s.start(`Adding ${q().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
|
+
# Rock
|
|
67
|
+
${i}
|
|
68
|
+
`)}(t,".rock/"),s.stop(`Added ${q().bold(".gitignore")} entry for .rock/`),s.start(`Generating ${q().bold("rock.config.mjs")}`);let o=function(t){let i=u.join(t,"react-native.config.js");if(!e.existsSync(i))return{};try{var r,n;let e=U(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?`({
|
|
69
|
+
${Object.entries(i.ios).map(([e,t])=>`${e}: '${t}'`).join(",\n ")},
|
|
70
|
+
})`:"()",s=i.android?`({
|
|
71
|
+
${Object.entries(i.android).map(([e,t])=>`${e}: '${t}'`).join(",\n ")},
|
|
72
|
+
})`:"()",o=`// @ts-check
|
|
73
|
+
import { platformIOS } from '@rock-js/platform-ios';
|
|
74
|
+
import { platformAndroid } from '@rock-js/platform-android';
|
|
75
|
+
import { pluginMetro } from '@rock-js/plugin-metro';
|
|
76
|
+
|
|
77
|
+
/** @type {import('rock').Config} */
|
|
78
|
+
export default {
|
|
79
|
+
bundler: pluginMetro(),
|
|
80
|
+
platforms: {
|
|
81
|
+
ios: platformIOS${n},
|
|
82
|
+
android: platformAndroid${s},
|
|
83
|
+
},
|
|
84
|
+
remoteCacheProvider: null,
|
|
85
|
+
};
|
|
86
|
+
`;e.writeFileSync(r,o)})(t,o),s.stop(`Generated ${q().bold("rock.config.mjs")}`);let a=(null==(i=o.ios)?void 0:i.sourceDir)??"ios",l=(null==(r=o.android)?void 0:r.sourceDir)??"android";s.start(`Updating ${q().bold(`${l}/app/build.gradle`)} and ${q().bold(`${l}/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 e9(`${r} already contains "${n}"`);let o=s.replace(/(?:\/\/\s+)?cliFile\s*=\s*file\([^)]*\)/g,n);if(o===s)return e4(`Unable to update ${q().bold(r)}.
|
|
87
|
+
Please update the "CLI file" build phase manually with:
|
|
88
|
+
cliFile = file("../../node_modules/rock/dist/src/bin.js")
|
|
89
|
+
`);e.writeFileSync(r,o)}(t,l),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,l),s.stop(`Updated ${q().bold(`${l}/app/build.gradle`)} and ${q().bold(`${l}/settings.gradle`)}`),s.start(`Updating ${q().bold(`${a}/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,a),s.stop(`Updated ${q().bold(`${a}/Podfile`)}`),s.start(`Updating ${q().bold(`${a}/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 e9(`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):e4(`Unable to update ${q().bold(n)}.
|
|
90
|
+
Please update the "Bundle React Native code and images" build phase manually with:
|
|
91
|
+
set -e
|
|
92
|
+
if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then
|
|
93
|
+
source "$PODS_ROOT/../.xcode.env"
|
|
94
|
+
fi
|
|
95
|
+
if [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then
|
|
96
|
+
source "$PODS_ROOT/../.xcode.env.local"
|
|
97
|
+
fi
|
|
98
|
+
export CONFIG_CMD="dummy-workaround-value"
|
|
99
|
+
export CLI_PATH="$("$NODE_BINARY" --print "require('path').dirname(require.resolve('rock/package.json')) + '/dist/src/bin.js'")"
|
|
100
|
+
WITH_ENVIRONMENT="$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
|
|
101
|
+
`)}(t,a),s.stop(`Updated ${q().bold(`${a}/project.pbxproj`)}`),s.start(`Updating ${q().bold("package.json")} scripts`),function(t){let i=u.join(t,"package.json");if(!e.existsSync(i))return;let r=e.readFileSync(i,"utf8").replaceAll("react-native start","rock start").replaceAll("react-native run-android","rock run:android").replaceAll("react-native build-android","rock build:android").replaceAll("react-native run-ios","rock run:ios").replaceAll("react-native build-ios","rock build:ios").replaceAll(/run:android(.*)--mode(.*)/g,"run:android$1--variant$2").replaceAll(/run:ios(.*)--mode(.*)/g,"run:ios$1--configuration$2").replaceAll(/build:android(.*)--mode(.*)/g,"build:android$1--variant$2").replaceAll(/build:ios(.*)--mode(.*)/g,"build:ios$1--configuration$2").replaceAll("--appIdSuffix","--app-id-suffix").replaceAll("--appId","--app-id").replaceAll("--buildFolder","--build-folder");e.writeFileSync(i,r)}(t),s.stop(`Updated ${q().bold("package.json")} scripts`),tr(`1. Run ${q().bold("git diff")} to see the changes. Adjust as necessary e.g.:
|
|
102
|
+
- paths in monorepo
|
|
103
|
+
- commands in shell scripts
|
|
104
|
+
- commands in CI workflows
|
|
105
|
+
2. Run the dev server as you would normally do
|
|
106
|
+
3. Run iOS and Android apps as you would normally do
|
|
107
|
+
4. Setup Remote Cache: ${K.cyan(K.underline(K.bold("https://rockjs.dev/docs/configuration#remote-cache-configuration")))}`,"Next steps"),ti("Success \uD83C\uDF89.")}async function oB(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 oI(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){e9(e.message,"Continuing with the rest of the steps\n")}}async function oN(t){let i=oO(),r=ta(),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 ${q().bold("RNEF")} packages`),await oL(t,i,s),r.stop(`Removed ${q().bold("RNEF")} packages`),r.start(`Adding ${q().bold("Rock")} packages with ${q().bold(i)}`),await oT(t,i,s.map(e=>n[e])),r.stop(`Added ${q().bold("Rock")} packages`),r.start(`Updating ${q().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 ${q().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 ${q().bold("rnef.config.mjs")} to ${q().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 ${q().bold("rnef.config.mjs")} to ${q().bold("rock.config.mjs")}`),r.start(`Updating ${q().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 ${q().bold("android/app/build.gradle")}`),r.start(`Updating ${q().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 ${q().bold("ios/Podfile")}`),r.start(`Updating ${q().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 ${q().bold("android/settings.gradle")}`),r.start(`Updating ${q().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 ${q().bold("ios/project.pbxproj")}`),r.start(`Updating ${q().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 ${q().bold("package.json")} scripts`),tr(`1. Run ${q().bold("git diff")} to see the changes. Adjust as necessary e.g.:
|
|
108
|
+
- paths in monorepo
|
|
109
|
+
- commands in shell scripts
|
|
110
|
+
- commands in CI workflows
|
|
111
|
+
2. Run the dev server as you would normally do
|
|
112
|
+
3. Run iOS and Android apps as you would normally do
|
|
113
|
+
4. Setup Remote Cache: ${q().bold("https://rockjs.dev/docs/configuration#remote-cache-configuration")}`,"Next steps"),ti("RNEF to Rock migration completed successfully \uD83C\uDF89.")}async function oT(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 oL(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){e9(e.message,"Continuing with the rest of the steps\n")}}var ok=V("../../node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js"),oM=V.n(ok);function o$(e){if(void 0!=e)return Array.isArray(e)?e[e.length-1]:e}function oj(e){if(void 0!=e)return Array.isArray(e)?e:[e]}let oP=/^[A-Z][0-9A-Z_-]*$/i,oz=["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 oU(e){if(0===e.length)return"Project name cannot be empty.";if(!e.match(oP))return`Invalid project name: "${e}". Please use a valid identifier name (alphanumeric, hyphen, underscore).`;let t=e.toLowerCase();if(oz.includes(t))return`Invalid project name: "${e}". Can't use reserved name. Please use another name.`}let oH=(e=0)=>t=>`\u001B[${t+e}m`,oG=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,oZ=(e=0)=>(t,i,r)=>`\u001B[${38+e};2;${t};${i};${r}m`,oW={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(oW.modifier),[...Object.keys(oW.color),...Object.keys(oW.bgColor)];let oV=function(){let e=new Map;for(let[t,i]of Object.entries(oW)){for(let[t,r]of Object.entries(i))oW[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},i[t]=oW[t],e.set(r[0],r[1]);Object.defineProperty(oW,t,{value:i,enumerable:!1})}return Object.defineProperty(oW,"codes",{value:e,enumerable:!1}),oW.color.close="\x1b[39m",oW.bgColor.close="\x1b[49m",oW.color.ansi=oH(),oW.color.ansi256=oG(),oW.color.ansi16m=oZ(),oW.bgColor.ansi=oH(10),oW.bgColor.ansi256=oG(10),oW.bgColor.ansi16m=oZ(10),Object.defineProperties(oW,{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=>oW.rgbToAnsi256(...oW.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)=>oW.ansi256ToAnsi(oW.rgbToAnsi256(e,t,i)),enumerable:!1},hexToAnsi:{value:e=>oW.ansi256ToAnsi(oW.hexToAnsi256(e)),enumerable:!1}}),oW}();function oY(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:oX}=g;function oK(e,t={}){var i;return 0!==(i=function(e,{streamIsTTY:t,sniffFlags:i=!0}={}){let r=function(){if("FORCE_COLOR"in oX)return"true"===oX.FORCE_COLOR?1:"false"===oX.FORCE_COLOR?0:0===oX.FORCE_COLOR.length?1:Math.min(Number.parseInt(oX.FORCE_COLOR,10),3)}();void 0!==r&&(Y=r);let n=i?Y:r;if(0===n)return 0;if(i){if(oY("color=16m")||oY("color=full")||oY("color=truecolor"))return 3;if(oY("color=256"))return 2}if("TF_BUILD"in oX&&"AGENT_NAME"in oX)return 1;if(e&&!t&&void 0===n)return 0;let s=n||0;if("dumb"===oX.TERM)return s;if("win32"===g.platform){let e=H.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in oX)return"GITHUB_ACTIONS"in oX||"GITEA_ACTIONS"in oX?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in oX)||"codeship"===oX.CI_NAME?1:s;if("TEAMCITY_VERSION"in oX)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(oX.TEAMCITY_VERSION);if("truecolor"===oX.COLORTERM||"xterm-kitty"===oX.TERM)return 3;if("TERM_PROGRAM"in oX){let e=Number.parseInt((oX.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(oX.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(oX.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(oX.TERM)||"COLORTERM"in oX?1:s}(e,{streamIsTTY:e&&e.isTTY,...t}))&&{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}oY("no-color")||oY("no-colors")||oY("color=false")||oY("color=never")?Y=0:(oY("color")||oY("colors")||oY("color=true")||oY("color=always"))&&(Y=1);let{stdout:oq,stderr:oJ}={stdout:oK({isTTY:G.isatty(1)}),stderr:oK({isTTY:G.isatty(2)})},oQ=Symbol("GENERATOR"),o0=Symbol("STYLER"),o1=Symbol("IS_EMPTY"),o2=["ansi","ansi","ansi256","ansi16m"],o3=Object.create(null);function o8(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=oq?oq.level:0;e.level=void 0===t.level?i:t.level})(t,e),Object.setPrototypeOf(t,o8.prototype),t}for(let[e,t]of(Object.setPrototypeOf(o8.prototype,Function.prototype),Object.entries(oV)))o3[e]={get(){let i=o9(this,o4(t.open,t.close,this[o0]),this[o1]);return Object.defineProperty(this,e,{value:i}),i}};o3.visible={get(){let e=o9(this,this[o0],!0);return Object.defineProperty(this,"visible",{value:e}),e}};let o6=(e,t,i,...r)=>"rgb"===e?"ansi16m"===t?oV[i].ansi16m(...r):"ansi256"===t?oV[i].ansi256(oV.rgbToAnsi256(...r)):oV[i].ansi(oV.rgbToAnsi(...r)):"hex"===e?o6("rgb",t,i,...oV.hexToRgb(...r)):oV[i][e](...r);for(let e of["rgb","hex","ansi256"])o3[e]={get(){let{level:t}=this;return function(...i){return o9(this,o4(o6(e,o2[t],"color",...i),oV.color.close,this[o0]),this[o1])}}},o3["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...i){return o9(this,o4(o6(e,o2[t],"bgColor",...i),oV.bgColor.close,this[o0]),this[o1])}}};let o5=Object.defineProperties(()=>{},{...o3,level:{enumerable:!0,get(){return this[oQ].level},set(e){this[oQ].level=e}}}),o4=(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}},o9=(e,t,i)=>{let r=(...e)=>o7(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,o5),r[oQ]=e,r[o0]=t,r[o1]=i,r},o7=(e,t)=>{if(e.level<=0||!t)return e[o1]?"":t;let i=e[o0];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(o8.prototype,o3);let ue=o8();o8({level:oJ?oJ.level:0});var ut=V("../../node_modules/.pnpm/tinygradient@1.1.5/node_modules/tinygradient/index.js");let ui=(...e)=>{let t,i;if(0===e.length)throw Error("Missing gradient colors");if(Array.isArray(e[0]))t=ut(e[0]),i=un(e[1]);else{if(1===e.length)throw Error(`Expected an array of colors, received ${JSON.stringify(e[0])}`);t=ut(...e)}let r=(e,r)=>(function(e,t,i){let r=un(i),n=Math.max(e.replace(/\s/g,"").length,t.stops.length),s=ur(t,r,n),o="";for(let t of e)o+=t.match(/\s/g)?t:ue.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=un(i),n=e.split("\n"),s=Math.max(...n.map(e=>e.length),t.stops.length),o=ur(t,r,s),u=[];for(let e of n){let t=o.slice(0),i="";for(let r of e)i+=ue.hex(t.shift()?.toHex()||"#000")(r);u.push(i)}return u.join("\n")})(e?e.toString():"",t,r??i),r},ur=(e,t,i)=>t.interpolation?.toLowerCase()==="hsv"?e.hsv(i,t.hsvSpin?.toLowerCase()||!1):e.rgb(i);function un(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 us(e){let t=t=>ui(...e.colors)(t,e.options);return t.multiline=(t="")=>ui(...e.colors).multiline(t,e.options),t}let uo=us({colors:["#feac5e","#c779d0","#4bc0c8"],options:{}}),uu=us({colors:["#bdfff3","#4ac29a"],options:{}}),ua=us({colors:["#77a1d3","#79cbca","#e684ae"],options:{}}),ul=us({colors:["#473b7b","#3584a7","#30d2be"],options:{}}),uh=us({colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}}),uc=us({colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}}),ud=us({colors:["#f43b47","#453a94"],options:{}}),uD=us({colors:["#ff4e50","#f9d423"],options:{}}),uf=us({colors:["#833ab4","#fd1d1d","#fcb045"],options:{}}),up=us({colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}}),um=us({colors:["#fdbb2d","#22c1c3"],options:{}}),uE=us({colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}}),ug=us({colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}});function uy(){try{let e=l(O(import.meta.url)),t=d(e,"../../../../package.json");return JSON.parse(r(t,"utf-8")).version}catch(e){return e4("Failed to get Rock version",e),null}}function ub(e){return tn({message:"What is your app named?",initialValue:e,validate:oU})}async function uF(e){if(0===e.length)throw new tc("No templates found");return ts({message:"Select a template:",options:e.map(e=>({value:e,label:e.name}))})}async function uC(t,i="latest",r){try{var n;let s=null==(n=(await uv(t,i)).dist)?void 0:n.tarball;if(!s)throw new tc("Tarball URL not found.");let o=await fetch(s);if(!o.ok)throw new tc(`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 tc(`Error downloading package ${t}`,{cause:e})}}async function uv(e,t){var i,r,n;let s=`https://registry.npmjs.org/${e}`,o=await fetch(s);if(!o.ok)throw new tc(`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 tc(`Version ${t} not found for package ${e}`);return l}async function uw(t,i){let r=u.join(t,`.temp-${u.basename(i,u.extname(i))}-${Date.now()}`);return e.mkdirSync(r,{recursive:!0}),await ol({file:i,cwd:r,strip:1}),r}async function u_(){let t=function(e){let t=oM()(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:o$(t.template),platforms:oj(t.platform),plugins:oj(t.plugin),bundler:t.bundler,help:t.help,version:t.version,dir:o$(t.dir),override:t.override,remoteCacheProvider:t["remote-cache-provider"],install:t.install}}(process.argv.slice(2)),l=uy();if(t.help)return void console.log(`
|
|
114
|
+
Usage: create-rock [options]
|
|
115
|
+
|
|
116
|
+
Options:
|
|
117
|
+
|
|
118
|
+
-h, --help Display help for command
|
|
119
|
+
-v, --version Output the version number
|
|
120
|
+
-d, --dir Create project in specified directory
|
|
121
|
+
-t, --template Specify template to use
|
|
122
|
+
-p, --platform Specify platform(s) to use
|
|
123
|
+
--plugin Specify plugin(s) to use
|
|
124
|
+
--bundler Specify bundler to use
|
|
125
|
+
--remote-cache-provider Specify remote cache provider
|
|
126
|
+
--override Override files in target directory
|
|
127
|
+
--install Install Node.js dependencies
|
|
128
|
+
|
|
129
|
+
Available templates:
|
|
130
|
+
${og.map(e=>e.name).join(", ")}
|
|
131
|
+
|
|
132
|
+
Available platforms:
|
|
133
|
+
${oF.map(e=>e.name).join(", ")}
|
|
134
|
+
`);if(t.version)return void console.log(`${uy()}`);console.log(""),((e="")=>{process.stdout.write(`${K.gray(ej)} ${e}
|
|
135
|
+
`)})(`Welcome to ${q().bold(uc("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 uS(h),await to({message:"Detected existing RNEF project. Would you like to migrate it to Rock?",confirmLabel:"Yes",cancelLabel:"No"})||th(),await oN(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 uS(h),await to({message:"Detected existing React Native project. Would you like to migrate it to Rock?",confirmLabel:"Yes",cancelLabel:"No"})||th(),await ox(h);return}let c=(t.dir||t.name)??await ub();oU(c)&&(c=await ub(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"})||th()),oS(p),e.mkdirSync(p,{recursive:!0});let m=t.template?oC(og,t.template):await uF(og),E=t.platforms?t.platforms.map(e=>oC(oF,e)):await function(e){if(0===e.length)throw new tc("No platforms found");return tu({message:"What platforms do you want to start with?",initialValues:e.filter(e=>"android"===e.name||"ios"===e.name),options:e.map(e=>({value:e,label:e.name}))})}(oF),g=t.bundler?oC(ob,t.bundler):await function(e){if(0===e.length)throw new tc("No bundlers found");return ts({message:"Which bundler do you want to use?",initialValues:[e[0]],options:e.map(e=>({value:e,label:e.name}))})}(ob),y=t.plugins?t.plugins.map(e=>oC(oy,e)):await (0===oy.length||!e6()?Promise.resolve(null):tu({message:"Select plugins:",options:oy.map(e=>({value:e,label:e.name})),required:!1})),b=void 0!==t.remoteCacheProvider||!1===t.remoteCacheProvider?null:await ts({message:"Which remote cache provider do you want to use?",initialValue:"github-actions",options:[{value:"github-actions",label:"GitHub Actions",hint:"Enable builds on your CI"},{value:null,label:"None",hint:"Local builds only"}]}),F=!!(t.install||e6())&&await to({message:"Do you want to install dependencies?",confirmLabel:"Yes",cancelLabel:"No"}),C=ta();for(let e of(C.start("Applying template, platforms and plugins"),await uR(p,m),E))await uR(p,e);for(let e of(await uR(p,g),y??[]))await uR(p,e);let v=d(p,"gitignore");i(v)&&n(v,d(p,".gitignore"));var w,_=(w=c)?w.split("-").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""):"";if(_!==oR)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(oR,t).replaceAll(oR.toLowerCase(),t.toLowerCase());i!==n&&o(e,n,"utf8")}(t,_),a(t).includes(oR)?oA(t,oR,_):a(t).includes(oR.toLowerCase())&&oA(t,oR.toLowerCase(),_.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 ow(l,"name",t),ow(l,"version",i),ow(l,"private",r),ow(l,"scripts",n),ow(l,"dependencies",s),ow(l,"devDependencies",o),ow(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}';`).join("\n")}
|
|
136
|
+
|
|
137
|
+
export default {${s&&s.length>0?`
|
|
138
|
+
plugins: [
|
|
139
|
+
${s.map(e=>`${e.importName}(),`).join("\n ")}
|
|
140
|
+
],`:""}
|
|
141
|
+
bundler: ${i.importName}(),
|
|
142
|
+
platforms: {
|
|
143
|
+
${n.map(e=>`${e.name}: ${e.importName}(),`).join("\n ")}
|
|
144
|
+
},
|
|
145
|
+
remoteCacheProvider: ${null===r?null:`'${r}'`},
|
|
146
|
+
};
|
|
147
|
+
`}(i,r,n,s))}(p,E,y,g,b),C.stop("Applied template, platforms and plugins.");let S=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:oO()}();F&&await uA(p,S),await of(p,l);let A=f(process.cwd(),p);tr([`cd ${A}`,F?void 0:`${S} install`,`${S} run start starts dev server`,`${S} run ios builds and runs iOS app`,`${S} run android builds and runs Android app`].filter(Boolean).join("\n"),"Next steps"),ti("Success \uD83C\uDF89.")}async function uS(e){if(await oE(e)&&await om()){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"})||th())}}async function uA(e,t){let i=ta();i.start(`Installing dependencies with ${t}`),await tz(t,["install"],{cwd:e}),i.stop(`Installed dependencies with ${t}`)}async function uR(t,i){var r,n,s;let o=null;if("npm"===i.type?o=await uC(i.packageName,i.version,t):((null==(r=i.localPath)?void 0:r.endsWith(".tgz"))||(null==(n=i.localPath)?void 0:n.endsWith(".tar.gz"))||(null==(s=i.localPath)?void 0:s.endsWith(".tar")))&&(o=i.localPath),o){let r=await uw(t,o);i.packageName&&e.unlinkSync(o),o_(u.join(r,i.directory??""),t),oS(r);return}if("local"===i.type)return void o_(u.join(i.localPath,i.directory??""),t);throw new tc(`Invalid state: template not found: ${JSON.stringify(i,null,2)}`)}ui.atlas=uo,ui.cristal=uu,ui.teen=ua,ui.mind=ul,ui.morning=uh,ui.vice=uc,ui.passion=ud,ui.fruit=uD,ui.instagram=uf,ui.retro=up,ui.summer=um,ui.rainbow=uE,ui.pastel=ug},crypto:function(e){e.exports=Z},fs:function(e){e.exports=W},path:function(e){e.exports=V},zlib:function(e){e.exports=Y},"../../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,y,b,F,C,w,A,O,B=(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=I.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=I.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=I.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=I.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=I.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=I.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=I.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=I.hex6.exec(e))?{r:R(t[1]),g:R(t[2]),b:R(t[3]),format:i?"name":"hex"}:(t=I.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=I.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)&&(N(r.r)&&N(r.g)&&N(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"):N(r.h)&&N(r.s)&&N(r.v)?(l=x(r.s),h=x(r.v),E=r.h,g=l,y=h,E=6*S(E,360),g=S(g,100),y=S(y,100),b=Math.floor(E),F=E-b,C=y*(1-g),w=y*(1-F*g),A=y*(1-(1-F)*g),u={r:255*[y,w,C,C,A,y][O=b%6],g:255*[A,y,y,w,C,C][O],b:255*[C,C,A,y,y,w][O]},d=!0,D="hsv"):N(r.h)&&N(r.s)&&N(r.l)&&(l=x(r.s),c=x(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=B.r,this._g=B.g,this._b=B.b,this._a=B.a,this._roundA=Math.round(100*this._a)/100,this._format=i.format||B.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=B.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(B(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 y(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 b(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(B(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(b,arguments)},triad:function(){return this._applyCombination(y,[3])},tetrad:function(){return this._applyCombination(y,[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]=x(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 x(e){return e<=1&&(e=100*e+"%"),e}function B(e){return Math.round(255*parseFloat(e)).toString(16)}var I=(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 N(e){return!!I.CSS_UNIT.exec(e)}return o}()}},ee={};function et(e){var t=ee[e];if(void 0!==t)return t.exports;var i=ee[e]={exports:{}};return Q[e].call(i.exports,i,i.exports,et),i.exports}X="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",K="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",q="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",J=e=>{e&&e.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))},et.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[K]=a,l[X]=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[X])return e;if(e.then){var t=[];t.d=0,e.then(e=>{i[K]=e,J(t)},e=>{i[q]=e,J(t)});var i={};return i[X]=e=>e(t),i}}var r={};return r[X]=function(){},r[K]=e,r});var t,i=()=>n.map(e=>{if(e[q])throw e[q];return e[K]}),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[X](s))});return t.r?s:i()},e=>(e?o(l[q]=e):s(a),J(r))),r&&r.d<0&&(r.d=0)},et.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return et.d(t,{a:t}),t},et.d=(e,t)=>{for(var i in t)et.o(t,i)&&!et.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},et.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),et.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},et("./src/bin.ts");
|