@mahameru/cli 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +440 -629
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* ┌────────────────────────────────────────────┐
|
|
4
4
|
* │ │
|
|
5
5
|
* │ ▲ MahameruJS - CLI UTILITY │
|
|
6
|
-
* │ Version: 0.0.
|
|
6
|
+
* │ Version: 0.0.15 │
|
|
7
7
|
* │ Built: 2026 │
|
|
8
8
|
* │ │
|
|
9
9
|
* │ Copyright (c) Bintan <hello@bintvn.co> │
|
|
@@ -11,20 +11,14 @@
|
|
|
11
11
|
* │ │
|
|
12
12
|
* └────────────────────────────────────────────┘
|
|
13
13
|
*/
|
|
14
|
-
import{default as t,spawn as e}from"node:child_process"
|
|
15
|
-
;import{default as
|
|
16
|
-
;import{default as
|
|
17
|
-
;import{
|
|
18
|
-
;import{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
;import{type as H}from"os";import{default as W}from"node:process";import{stripVTControlCharacters as M}from"node:util"
|
|
23
|
-
;import{default as F}from"node:os";import{default as N}from"node:tty";import{pathToFileURL as j}from"node:url"
|
|
24
|
-
;import{EventEmitter as G}from"node:events";var V={991(t){
|
|
25
|
-
let e=process||{},i=e.argv||[],s=e.env||{},r=!(s.NO_COLOR||i.includes("--no-color"))&&(!!s.FORCE_COLOR||i.includes("--color")||"win32"===e.platform||(e.stdout||{}).isTTY&&"dumb"!==s.TERM||!!s.CI),n=(t,e,i=t)=>s=>{
|
|
26
|
-
let r=""+s,n=r.indexOf(e,t.length);return~n?t+o(r,e,i,n)+e:t+r+e},o=(t,e,i,s)=>{let r="",n=0;do{r+=t.substring(n,s)+i,
|
|
27
|
-
n=s+e.length,s=t.indexOf(e,n)}while(~s);return r+t.substring(n)},a=(t=r)=>{let e=t?n:()=>String;return{
|
|
14
|
+
import{default as t,spawn as e}from"node:child_process";import{default as i,join as r,relative as s}from"node:path"
|
|
15
|
+
;import{default as n,existsSync as o,readFileSync as a,readdirSync as l,statSync as h}from"node:fs"
|
|
16
|
+
;import{default as c}from"node:process";import{stripVTControlCharacters as u}from"node:util"
|
|
17
|
+
;import{default as m}from"node:os";import{default as p}from"node:tty";import{pathToFileURL as d}from"node:url"
|
|
18
|
+
;import{EventEmitter as f}from"node:events";import{rename as g,rm as _}from"node:fs/promises";var v={991(t){
|
|
19
|
+
let e=process||{},i=e.argv||[],r=e.env||{},s=!(r.NO_COLOR||i.includes("--no-color"))&&(!!r.FORCE_COLOR||i.includes("--color")||"win32"===e.platform||(e.stdout||{}).isTTY&&"dumb"!==r.TERM||!!r.CI),n=(t,e,i=t)=>r=>{
|
|
20
|
+
let s=""+r,n=s.indexOf(e,t.length);return~n?t+o(s,e,i,n)+e:t+s+e},o=(t,e,i,r)=>{let s="",n=0;do{s+=t.substring(n,r)+i,
|
|
21
|
+
n=r+e.length,r=t.indexOf(e,n)}while(~r);return s+t.substring(n)},a=(t=s)=>{let e=t?n:()=>String;return{
|
|
28
22
|
isColorSupported:t,reset:e("[0m","[0m"),bold:e("[1m","[22m","[22m[1m"),dim:e("[2m","[22m","[22m[2m"),
|
|
29
23
|
italic:e("[3m","[23m"),underline:e("[4m","[24m"),inverse:e("[7m","[27m"),hidden:e("[8m","[28m"),
|
|
30
24
|
strikethrough:e("[9m","[29m"),black:e("[30m","[39m"),red:e("[31m","[39m"),green:e("[32m","[39m"),
|
|
@@ -36,448 +30,257 @@ greenBright:e("[92m","[39m"),yellowBright:e("[93m","[39m"),blueBright:e("[9
|
|
|
36
30
|
magentaBright:e("[95m","[39m"),cyanBright:e("[96m","[39m"),whiteBright:e("[97m","[39m"),
|
|
37
31
|
bgBlackBright:e("[100m","[49m"),bgRedBright:e("[101m","[49m"),bgGreenBright:e("[102m","[49m"),
|
|
38
32
|
bgYellowBright:e("[103m","[49m"),bgBlueBright:e("[104m","[49m"),bgMagentaBright:e("[105m","[49m"),
|
|
39
|
-
bgCyanBright:e("[106m","[49m"),bgWhiteBright:e("[107m","[49m")}};t.exports=a(),t.exports.createColors=a}},
|
|
40
|
-
;function
|
|
41
|
-
|
|
42
|
-
for(var i in e)
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
;"directory"===i&&this._directoryFilter(e)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(e.fullPath,r+1)),
|
|
59
|
-
this._wantsDir&&(this.push(e),
|
|
60
|
-
t--)):("file"===i||this._includeAsFile(e))&&this._fileFilter(e)&&this._wantsFile&&(this.push(e),t--)}}else{
|
|
61
|
-
const t=this.parents.pop();if(!t){this.push(null);break}if(this.parent=await t,this.destroyed)return}}}catch(t){
|
|
62
|
-
this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(t,e){let i;try{i=await R(t,this._rdOptions)}catch(t){
|
|
63
|
-
this._onError(t)}return{files:i,depth:e,path:t}}async _formatEntry(t,e){let i;const o=this._isDirent?t.name:t;try{
|
|
64
|
-
const a=n(s(e,o));i={path:r(this._root,a),fullPath:a,basename:o},i[this._statsProp]=this._isDirent?t:await this._stat(a)
|
|
65
|
-
}catch(t){return void this._onError(t)}return i}_onError(t){
|
|
66
|
-
(t=>X.has(t.code))(t)&&!this.destroyed?this.emit("warn",t):this.destroy(t)}async _getEntryType(t){
|
|
67
|
-
if(!t&&this._statsProp in t)return"";const e=t[this._statsProp];if(e.isFile())return"file"
|
|
68
|
-
;if(e.isDirectory())return"directory";if(e&&e.isSymbolicLink()){const e=t.fullPath;try{const t=await I(e),i=await k(t)
|
|
69
|
-
;if(i.isFile())return"file";if(i.isDirectory()){const i=t.length;if(e.startsWith(t)&&e.substr(i,1)===o){
|
|
70
|
-
const i=new Error(`Circular symlink detected: "${e}" points to "${t}"`);return i.code=Q,this._onError(i)}
|
|
71
|
-
return"directory"}}catch(t){return this._onError(t),""}}}_includeAsFile(t){const e=t&&t[this._statsProp]
|
|
72
|
-
;return e&&this._wantsEverything&&!e.isDirectory()}}function ot(t,e={}){let i=e.entryType||e.type;if("both"===i&&(i=q),
|
|
73
|
-
i&&(e.type=i),!t)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)")
|
|
74
|
-
;if("string"!=typeof t)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)")
|
|
75
|
-
;if(i&&!Z.includes(i))throw new Error(`readdirp: Invalid type passed. Use one of ${Z.join(", ")}`);return e.root=t,
|
|
76
|
-
new nt(e)}
|
|
77
|
-
const at=()=>{},lt=process.platform,ht="win32"===lt,ct="darwin"===lt,ut="linux"===lt,dt="freebsd"===lt,pt="OS400"===H(),mt={
|
|
78
|
-
ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",
|
|
79
|
-
ERROR:"error"},ft=mt,gt={lstat:g,stat:b
|
|
80
|
-
},_t="listeners",vt="errHandlers",wt="rawEmitters",bt=[_t,vt,wt],yt=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),xt=(t,e)=>{
|
|
81
|
-
t instanceof Set?t.forEach(e):e(t)},Ot=(t,e,i)=>{let s=t[e];s instanceof Set||(t[e]=s=new Set([s])),s.add(i)
|
|
82
|
-
},Ct=(t,e,i)=>{const s=t[e];s instanceof Set?s.delete(i):s===i&&delete t[e]
|
|
83
|
-
},Et=t=>t instanceof Set?0===t.size:!t,Tt=new Map;function At(t,e,i,s,r){const n=(e,s)=>{i(t),r(e,s,{watchedPath:t}),
|
|
84
|
-
s&&t!==s&&St(P(t,s),_t,T(t,s))};try{return m(t,{persistent:e.persistent},n)}catch(t){return void s(t)}}
|
|
85
|
-
const St=(t,e,i,s,r)=>{const n=Tt.get(t);n&&xt(n[e],t=>{t(i,s,r)})},Pt=(t,e,i,s)=>{
|
|
86
|
-
const{listener:r,errHandler:n,rawEmitter:o}=s;let a,l=Tt.get(e);if(!i.persistent){if(a=At(t,i,r,n,o),!a)return
|
|
87
|
-
;return a.close.bind(a)}if(l)Ot(l,_t,r),Ot(l,vt,n),Ot(l,wt,o);else{if(a=At(t,i,St.bind(null,e,_t),n,St.bind(null,e,wt)),
|
|
88
|
-
!a)return;a.on(ft.ERROR,async i=>{const s=St.bind(null,e,vt);if(l&&(l.watcherUnusable=!0),ht&&"EPERM"===i.code)try{
|
|
89
|
-
const e=await _(t,"r");await e.close(),s(i)}catch(t){}else s(i)}),l={listeners:r,errHandlers:n,rawEmitters:o,watcher:a},
|
|
90
|
-
Tt.set(e,l)}return()=>{Ct(l,_t,r),Ct(l,vt,n),Ct(l,wt,o),Et(l.listeners)&&(l.watcher.close(),Tt.delete(e),
|
|
91
|
-
bt.forEach((t=>e=>{const i=t[e];i instanceof Set?i.clear():delete t[e]})(l)),l.watcher=void 0,Object.freeze(l))}
|
|
92
|
-
},kt=new Map;class Rt{constructor(t){this.fsw=t,this._boundHandleError=e=>t._handleError(e)}_watchWithNodeFs(t,e){
|
|
93
|
-
const i=this.fsw.options,s=O(t),r=x(t);this.fsw._getWatchedDir(s).add(r);const n=P(t),o={persistent:i.persistent};let a
|
|
94
|
-
;if(e||(e=at),i.usePolling){const s=i.interval!==i.binaryInterval;o.interval=s&&(l=r,
|
|
95
|
-
yt.has(C(l).slice(1).toLowerCase()))?i.binaryInterval:i.interval,a=((t,e,i,s)=>{const{listener:r,rawEmitter:n}=s
|
|
96
|
-
;let o=kt.get(e);const a=o&&o.options;return a&&(a.persistent<i.persistent||a.interval>i.interval)&&(p(e),o=void 0),
|
|
97
|
-
o?(Ot(o,_t,r),Ot(o,wt,n)):(o={listeners:r,rawEmitters:n,options:i,watcher:f(e,i,(i,s)=>{xt(o.rawEmitters,t=>{
|
|
98
|
-
t(ft.CHANGE,e,{curr:i,prev:s})});const r=i.mtimeMs;(i.size!==s.size||r>s.mtimeMs||0===r)&&xt(o.listeners,e=>e(t,i))})},
|
|
99
|
-
kt.set(e,o)),()=>{Ct(o,_t,r),Ct(o,wt,n),Et(o.listeners)&&(kt.delete(e),p(e),o.options=o.watcher=void 0,Object.freeze(o))
|
|
100
|
-
}})(t,n,o,{listener:e,rawEmitter:this.fsw._emitRaw})}else a=Pt(t,n,o,{listener:e,errHandler:this._boundHandleError,
|
|
101
|
-
rawEmitter:this.fsw._emitRaw});var l;return a}_handleFile(t,e,i){if(this.fsw.closed)return
|
|
102
|
-
;const s=O(t),r=x(t),n=this.fsw._getWatchedDir(s);let o=e;if(n.has(r))return;const a=async(e,i)=>{
|
|
103
|
-
if(this.fsw._throttle("watch",t,5))if(i&&0!==i.mtimeMs){if(n.has(r)){const e=i.atimeMs,s=i.mtimeMs
|
|
104
|
-
;(!e||e<=s||s!==o.mtimeMs)&&this.fsw._emit(ft.CHANGE,t,i),o=i}}else try{const i=await b(t);if(this.fsw.closed)return
|
|
105
|
-
;const s=i.atimeMs,r=i.mtimeMs;if((!s||s<=r||r!==o.mtimeMs)&&this.fsw._emit(ft.CHANGE,t,i),(ct||ut||dt)&&o.ino!==i.ino){
|
|
106
|
-
this.fsw._closeFile(e),o=i;const s=this._watchWithNodeFs(t,a);s&&this.fsw._addPathCloser(e,s)}else o=i}catch(t){
|
|
107
|
-
this.fsw._remove(s,r)}},l=this._watchWithNodeFs(t,a)
|
|
108
|
-
;if((!i||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(ft.ADD,t,0))return
|
|
109
|
-
;this.fsw._emit(ft.ADD,t,e)}return l}async _handleSymlink(t,e,i,s){if(this.fsw.closed)return
|
|
110
|
-
;const r=t.fullPath,n=this.fsw._getWatchedDir(e);if(!this.fsw.options.followSymlinks){let e;this.fsw._incrReadyCount()
|
|
111
|
-
;try{e=await w(i)}catch(t){return this.fsw._emitReady(),!0}if(this.fsw.closed)return
|
|
112
|
-
;return n.has(s)?this.fsw._symlinkPaths.get(r)!==e&&(this.fsw._symlinkPaths.set(r,e),
|
|
113
|
-
this.fsw._emit(ft.CHANGE,i,t.stats)):(n.add(s),this.fsw._symlinkPaths.set(r,e),this.fsw._emit(ft.ADD,i,t.stats)),
|
|
114
|
-
this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(r))return!0;this.fsw._symlinkPaths.set(r,!0)}
|
|
115
|
-
_handleRead(t,e,i,s,r,n,o){if(t=T(t,""),!(o=this.fsw._throttle("readdir",t,1e3)))return
|
|
116
|
-
;const a=this.fsw._getWatchedDir(i.path),l=new Set;let h=this.fsw._readdirp(t,{fileFilter:t=>i.filterPath(t),
|
|
117
|
-
directoryFilter:t=>i.filterDir(t)});return h?(h.on("data",async o=>{if(this.fsw.closed)return void(h=void 0)
|
|
118
|
-
;const c=o.path;let u=T(t,c)
|
|
119
|
-
;l.add(c),o.stats.isSymbolicLink()&&await this._handleSymlink(o,t,u,c)||(this.fsw.closed?h=void 0:c!==s&&(s||a.has(c))||(this.fsw._incrReadyCount(),
|
|
120
|
-
u=T(r,S(r,u)),this._addToNodeFs(u,e,i,n+1)))}).on(ft.ERROR,this._boundHandleError),new Promise((e,c)=>{if(!h)return c()
|
|
121
|
-
;h.once("end",()=>{if(this.fsw.closed)return void(h=void 0);const c=!!o&&o.clear();e(void 0),
|
|
122
|
-
a.getChildren().filter(e=>e!==t&&!l.has(e)).forEach(e=>{this.fsw._remove(t,e)}),h=void 0,
|
|
123
|
-
c&&this._handleRead(t,!1,i,s,r,n,o)})})):void 0}async _handleDir(t,e,i,s,r,n,o){
|
|
124
|
-
const a=this.fsw._getWatchedDir(O(t)),l=a.has(x(t));let h,c
|
|
125
|
-
;i&&this.fsw.options.ignoreInitial||r||l||this.fsw._emit(ft.ADD_DIR,t,e),a.add(x(t)),this.fsw._getWatchedDir(t)
|
|
126
|
-
;const u=this.fsw.options.depth;if((null==u||s<=u)&&!this.fsw._symlinkPaths.has(o)){
|
|
127
|
-
if(!r&&(await this._handleRead(t,i,n,r,t,s,h),this.fsw.closed))return;c=this._watchWithNodeFs(t,(e,i)=>{
|
|
128
|
-
i&&0===i.mtimeMs||this._handleRead(e,!1,n,r,t,s,h)})}return c}async _addToNodeFs(t,e,i,s,r){const n=this.fsw._emitReady
|
|
129
|
-
;if(this.fsw._isIgnored(t)||this.fsw.closed)return n(),!1;const o=this.fsw._getWatchHelpers(t)
|
|
130
|
-
;i&&(o.filterPath=t=>i.filterPath(t),o.filterDir=t=>i.filterDir(t));try{const i=await gt[o.statMethod](o.watchPath)
|
|
131
|
-
;if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,i))return n(),!1;const a=this.fsw.options.followSymlinks
|
|
132
|
-
;let l;if(i.isDirectory()){const n=P(t),h=a?await w(t):t;if(this.fsw.closed)return
|
|
133
|
-
;if(l=await this._handleDir(o.watchPath,i,e,s,r,o,h),this.fsw.closed)return
|
|
134
|
-
;n!==h&&void 0!==h&&this.fsw._symlinkPaths.set(n,h)}else if(i.isSymbolicLink()){const r=a?await w(t):t
|
|
135
|
-
;if(this.fsw.closed)return;const n=O(o.watchPath);if(this.fsw._getWatchedDir(n).add(o.watchPath),
|
|
136
|
-
this.fsw._emit(ft.ADD,o.watchPath,i),l=await this._handleDir(n,i,e,s,t,o,r),this.fsw.closed)return
|
|
137
|
-
;void 0!==r&&this.fsw._symlinkPaths.set(P(t),r)}else l=this._handleFile(o.watchPath,i,e);return n(),
|
|
138
|
-
l&&this.fsw._addPathCloser(t,l),!1}catch(e){if(this.fsw._handleError(e))return n(),t}}}
|
|
139
|
-
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
|
140
|
-
const It=/\\/g,$t=/\/\//,Dt=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Ht=/^\.[/\\]/;function Wt(t){
|
|
141
|
-
return Array.isArray(t)?t:[t]}const Mt=t=>"object"==typeof t&&null!==t&&!(t instanceof RegExp);function Ft(t,e,i){
|
|
142
|
-
const s=function(t){if("string"!=typeof t)throw new Error("string expected");let e=!1
|
|
143
|
-
;(t=(t=A(t)).replace(/\\/g,"/")).startsWith("//")&&(e=!0);const i=/\/\//;for(;t.match(i);)t=t.replace(i,"/")
|
|
144
|
-
;return e&&(t="/"+t),t}(e);for(let e=0;e<t.length;e++){if((0,t[e])(s,i))return!0}return!1}function Nt(t,e){
|
|
145
|
-
if(null==t)throw new TypeError("anymatch: specify first argument");const i=Wt(t).map(t=>function(t){
|
|
146
|
-
return"function"==typeof t?t:"string"==typeof t?e=>t===e:t instanceof RegExp?e=>t.test(e):"object"==typeof t&&null!==t?e=>{
|
|
147
|
-
if(t.path===e)return!0;if(t.recursive){const i=S(t.path,e);return!!i&&!i.startsWith("..")&&!E(i)}return!1}:()=>!1}(t))
|
|
148
|
-
;return null==e?(t,e)=>Ft(i,t,e):Ft(i,e)}const jt=t=>{const e=Wt(t).flat()
|
|
149
|
-
;if(!e.every(t=>"string"==typeof t))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Vt)
|
|
150
|
-
},Gt=t=>{let e=t.replace(It,"/"),i=!1;for(e.startsWith("//")&&(i=!0);e.match($t);)e=e.replace($t,"/")
|
|
151
|
-
;return i&&(e="/"+e),e
|
|
152
|
-
},Vt=t=>Gt(A(Gt(t))),Lt=(t="")=>e=>"string"==typeof e?Vt(E(e)?e:T(t,e)):e,Bt=Object.freeze(new Set);class Ut{
|
|
153
|
-
constructor(t,e){this.path=t,this._removeWatcher=e,this.items=new Set}add(t){const{items:e}=this
|
|
154
|
-
;e&&"."!==t&&".."!==t&&e.add(t)}async remove(t){const{items:e}=this;if(!e)return;if(e.delete(t),e.size>0)return
|
|
155
|
-
;const i=this.path;try{await v(i)}catch(t){this._removeWatcher&&this._removeWatcher(O(i),x(i))}}has(t){
|
|
156
|
-
const{items:e}=this;if(e)return e.has(t)}getChildren(){const{items:t}=this;return t?[...t.values()]:[]}dispose(){
|
|
157
|
-
this.items.clear(),this.path="",this._removeWatcher=at,this.items=Bt,Object.freeze(this)}}class zt{constructor(t,e,i){
|
|
158
|
-
this.fsw=i;const s=t;this.path=t=t.replace(Ht,""),this.watchPath=s,this.fullWatchPath=P(s),this.dirParts=[],
|
|
159
|
-
this.dirParts.forEach(t=>{t.length>1&&t.pop()}),this.followSymlinks=e,this.statMethod=e?"stat":"lstat"}entryPath(t){
|
|
160
|
-
return T(this.watchPath,S(this.watchPath,t.fullPath))}filterPath(t){const{stats:e}=t
|
|
161
|
-
;if(e&&e.isSymbolicLink())return this.filterDir(t);const i=this.entryPath(t)
|
|
162
|
-
;return this.fsw._isntIgnored(i,e)&&this.fsw._hasReadPermissions(e)}filterDir(t){
|
|
163
|
-
return this.fsw._isntIgnored(this.entryPath(t),t.stats)}}class Yt extends y{constructor(t={}){super(),this.closed=!1,
|
|
164
|
-
this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,
|
|
165
|
-
this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,
|
|
166
|
-
this._readyCount=0,this._readyEmitted=!1;const e=t.awaitWriteFinish,i={stabilityThreshold:2e3,pollInterval:100},s={
|
|
167
|
-
persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,
|
|
168
|
-
usePolling:!1,atomic:!0,...t,ignored:t.ignored?Wt(t.ignored):Wt([]),awaitWriteFinish:!0===e?i:"object"==typeof e&&{...i,
|
|
169
|
-
...e}};pt&&(s.usePolling=!0),void 0===s.atomic&&(s.atomic=!s.usePolling);const r=process.env.CHOKIDAR_USEPOLLING
|
|
170
|
-
;if(void 0!==r){const t=r.toLowerCase();s.usePolling="false"!==t&&"0"!==t&&("true"===t||"1"===t||!!t)}
|
|
171
|
-
const n=process.env.CHOKIDAR_INTERVAL;n&&(s.interval=Number.parseInt(n,10));let o=0;this._emitReady=()=>{o++,
|
|
172
|
-
o>=this._readyCount&&(this._emitReady=at,this._readyEmitted=!0,process.nextTick(()=>this.emit(mt.READY)))},
|
|
173
|
-
this._emitRaw=(...t)=>this.emit(mt.RAW,...t),this._boundRemove=this._remove.bind(this),this.options=s,
|
|
174
|
-
this._nodeFsHandler=new Rt(this),Object.freeze(s)}_addIgnoredPath(t){
|
|
175
|
-
if(Mt(t))for(const e of this._ignoredPaths)if(Mt(e)&&e.path===t.path&&e.recursive===t.recursive)return
|
|
176
|
-
;this._ignoredPaths.add(t)}_removeIgnoredPath(t){if(this._ignoredPaths.delete(t),
|
|
177
|
-
"string"==typeof t)for(const e of this._ignoredPaths)Mt(e)&&e.path===t&&this._ignoredPaths.delete(e)}add(t,e,i){
|
|
178
|
-
const{cwd:s}=this.options;this.closed=!1,this._closePromise=void 0;let r=jt(t);return s&&(r=r.map(t=>{
|
|
179
|
-
const e=((t,e)=>E(t)?t:T(e,t))(t,s);return e})),r.forEach(t=>{this._removeIgnoredPath(t)}),this._userIgnored=void 0,
|
|
180
|
-
this._readyCount||(this._readyCount=0),this._readyCount+=r.length,Promise.all(r.map(async t=>{
|
|
181
|
-
const s=await this._nodeFsHandler._addToNodeFs(t,!i,void 0,0,e);return s&&this._emitReady(),s})).then(t=>{
|
|
182
|
-
this.closed||t.forEach(t=>{t&&this.add(O(t),x(e||t))})}),this}unwatch(t){if(this.closed)return this
|
|
183
|
-
;const e=jt(t),{cwd:i}=this.options;return e.forEach(t=>{E(t)||this._closers.has(t)||(i&&(t=T(i,t)),t=P(t)),
|
|
184
|
-
this._closePath(t),this._addIgnoredPath(t),this._watched.has(t)&&this._addIgnoredPath({path:t,recursive:!0}),
|
|
185
|
-
this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,
|
|
186
|
-
this.removeAllListeners();const t=[];return this._closers.forEach(e=>e.forEach(e=>{const i=e()
|
|
187
|
-
;i instanceof Promise&&t.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,
|
|
188
|
-
this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),this._closers.clear(),this._watched.clear(),
|
|
189
|
-
this._streams.clear(),
|
|
190
|
-
this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=t.length?Promise.all(t).then(()=>{}):Promise.resolve(),
|
|
191
|
-
this._closePromise}getWatched(){const t={};return this._watched.forEach((e,i)=>{
|
|
192
|
-
const s=this.options.cwd?S(this.options.cwd,i):i;t[s||"."]=e.getChildren().sort()}),t}emitWithAll(t,e){
|
|
193
|
-
this.emit(t,...e),t!==mt.ERROR&&this.emit(mt.ALL,t,...e)}async _emit(t,e,i){if(this.closed)return;const s=this.options
|
|
194
|
-
;ht&&(e=A(e)),s.cwd&&(e=S(s.cwd,e));const r=[e];null!=i&&r.push(i);const n=s.awaitWriteFinish;let o
|
|
195
|
-
;if(n&&(o=this._pendingWrites.get(e)))return o.lastChange=new Date,this;if(s.atomic){
|
|
196
|
-
if(t===mt.UNLINK)return this._pendingUnlinks.set(e,[t,...r]),setTimeout(()=>{this._pendingUnlinks.forEach((t,e)=>{
|
|
197
|
-
this.emit(...t),this.emit(mt.ALL,...t),this._pendingUnlinks.delete(e)})},"number"==typeof s.atomic?s.atomic:100),this
|
|
198
|
-
;t===mt.ADD&&this._pendingUnlinks.has(e)&&(t=mt.CHANGE,this._pendingUnlinks.delete(e))}
|
|
199
|
-
if(n&&(t===mt.ADD||t===mt.CHANGE)&&this._readyEmitted){const i=(e,i)=>{e?(t=mt.ERROR,r[0]=e,
|
|
200
|
-
this.emitWithAll(t,r)):i&&(r.length>1?r[1]=i:r.push(i),this.emitWithAll(t,r))}
|
|
201
|
-
;return this._awaitWriteFinish(e,n.stabilityThreshold,t,i),this}if(t===mt.CHANGE){
|
|
202
|
-
if(!this._throttle(mt.CHANGE,e,50))return this}
|
|
203
|
-
if(s.alwaysStat&&void 0===i&&(t===mt.ADD||t===mt.ADD_DIR||t===mt.CHANGE)){const t=s.cwd?T(s.cwd,e):e;let i;try{
|
|
204
|
-
i=await b(t)}catch(t){}if(!i||this.closed)return;r.push(i)}return this.emitWithAll(t,r),this}_handleError(t){
|
|
205
|
-
const e=t&&t.code
|
|
206
|
-
;return t&&"ENOENT"!==e&&"ENOTDIR"!==e&&(!this.options.ignorePermissionErrors||"EPERM"!==e&&"EACCES"!==e)&&this.emit(mt.ERROR,t),
|
|
207
|
-
t||this.closed}_throttle(t,e,i){this._throttled.has(t)||this._throttled.set(t,new Map);const s=this._throttled.get(t)
|
|
208
|
-
;if(!s)throw new Error("invalid throttle");const r=s.get(e);if(r)return r.count++,!1;let n;const o=()=>{
|
|
209
|
-
const t=s.get(e),i=t?t.count:0;return s.delete(e),clearTimeout(n),t&&clearTimeout(t.timeoutObject),i};n=setTimeout(o,i)
|
|
210
|
-
;const a={timeoutObject:n,clear:o,count:0};return s.set(e,a),a}_incrReadyCount(){return this._readyCount++}
|
|
211
|
-
_awaitWriteFinish(t,e,i,s){const r=this.options.awaitWriteFinish;if("object"!=typeof r)return;const n=r.pollInterval
|
|
212
|
-
;let o,a=t;this.options.cwd&&!E(t)&&(a=T(this.options.cwd,t));const l=new Date,h=this._pendingWrites
|
|
213
|
-
;h.has(t)||(h.set(t,{lastChange:l,cancelWait:()=>(h.delete(t),clearTimeout(o),i)}),o=setTimeout(function i(r){
|
|
214
|
-
d(a,(a,l)=>{if(a||!h.has(t))return void(a&&"ENOENT"!==a.code&&s(a));const c=Number(new Date)
|
|
215
|
-
;r&&l.size!==r.size&&(h.get(t).lastChange=c),c-h.get(t).lastChange>=e?(h.delete(t),s(void 0,l)):o=setTimeout(i,n,l)})
|
|
216
|
-
},n))}_isIgnored(t,e){if(this.options.atomic&&Dt.test(t))return!0;if(!this._userIgnored){
|
|
217
|
-
const{cwd:t}=this.options,e=(this.options.ignored||[]).map(Lt(t)),i=[...[...this._ignoredPaths].map(Lt(t)),...e]
|
|
218
|
-
;this._userIgnored=Nt(i,void 0)}return this._userIgnored(t,e)}_isntIgnored(t,e){return!this._isIgnored(t,e)}
|
|
219
|
-
_getWatchHelpers(t){return new zt(t,this.options.followSymlinks,this)}_getWatchedDir(t){const e=P(t)
|
|
220
|
-
;return this._watched.has(e)||this._watched.set(e,new Ut(e,this._boundRemove)),this._watched.get(e)}
|
|
221
|
-
_hasReadPermissions(t){return!!this.options.ignorePermissionErrors||Boolean(256&Number(t.mode))}_remove(t,e,i){
|
|
222
|
-
const s=T(t,e),r=P(s);if(i=null!=i?i:this._watched.has(s)||this._watched.has(r),!this._throttle("remove",s,100))return
|
|
223
|
-
;i||1!==this._watched.size||this.add(t,e,!0);this._getWatchedDir(s).getChildren().forEach(t=>this._remove(s,t))
|
|
224
|
-
;const n=this._getWatchedDir(t),o=n.has(e);n.remove(e),this._symlinkPaths.has(r)&&this._symlinkPaths.delete(r);let a=s
|
|
225
|
-
;if(this.options.cwd&&(a=S(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(a)){
|
|
226
|
-
if(this._pendingWrites.get(a).cancelWait()===mt.ADD)return}this._watched.delete(s),this._watched.delete(r)
|
|
227
|
-
;const l=i?mt.UNLINK_DIR:mt.UNLINK;o&&!this._isIgnored(s)&&this._emit(l,s),this._closePath(s)}_closePath(t){
|
|
228
|
-
this._closeFile(t);const e=O(t);this._getWatchedDir(e).remove(x(t))}_closeFile(t){const e=this._closers.get(t)
|
|
229
|
-
;e&&(e.forEach(t=>t()),this._closers.delete(t))}_addPathCloser(t,e){if(!e)return;let i=this._closers.get(t);i||(i=[],
|
|
230
|
-
this._closers.set(t,i)),i.push(e)}_readdirp(t,e){if(this.closed)return;let i=ot(t,{type:mt.ALL,alwaysStat:!0,lstat:!0,
|
|
231
|
-
...e,depth:0});return this._streams.add(i),i.once("close",()=>{i=void 0}),i.once("end",()=>{i&&(this._streams.delete(i),
|
|
232
|
-
i=void 0)}),i}}const qt={watch:function(t,e={}){const i=new Yt(e);return i.add(t),i},FSWatcher:Yt
|
|
233
|
-
},Jt=(t=0)=>e=>`[${e+t}m`,Kt=(t=0)=>e=>`[${38+t};5;${e}m`,Qt=(t=0)=>(e,i,s)=>`[${38+t};2;${e};${i};${s}m`,Xt={
|
|
234
|
-
modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],
|
|
235
|
-
hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],
|
|
236
|
-
magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],
|
|
237
|
-
greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]
|
|
238
|
-
},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],
|
|
239
|
-
bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],
|
|
240
|
-
bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],
|
|
241
|
-
bgWhiteBright:[107,49]}};Object.keys(Xt.modifier),Object.keys(Xt.color),Object.keys(Xt.bgColor);const Zt=function(){
|
|
242
|
-
const t=new Map;for(const[e,i]of Object.entries(Xt)){for(const[e,s]of Object.entries(i))Xt[e]={open:`[${s[0]}m`,
|
|
243
|
-
close:`[${s[1]}m`},i[e]=Xt[e],t.set(s[0],s[1]);Object.defineProperty(Xt,e,{value:i,enumerable:!1})}
|
|
244
|
-
return Object.defineProperty(Xt,"codes",{value:t,enumerable:!1}),Xt.color.close="[39m",Xt.bgColor.close="[49m",
|
|
245
|
-
Xt.color.ansi=Jt(),Xt.color.ansi256=Kt(),Xt.color.ansi16m=Qt(),Xt.bgColor.ansi=Jt(10),Xt.bgColor.ansi256=Kt(10),
|
|
246
|
-
Xt.bgColor.ansi16m=Qt(10),Object.defineProperties(Xt,{rgbToAnsi256:{
|
|
33
|
+
bgCyanBright:e("[106m","[49m"),bgWhiteBright:e("[107m","[49m")}};t.exports=a(),t.exports.createColors=a}},b={}
|
|
34
|
+
;function O(t){var e=b[t];if(void 0!==e)return e.exports;var i=b[t]={exports:{}};return v[t](i,i.exports,O),i.exports}
|
|
35
|
+
O.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return O.d(e,{a:e}),e},O.d=(t,e)=>{
|
|
36
|
+
for(var i in e)O.o(e,i)&&!O.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},
|
|
37
|
+
O.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const x={rE:"0.0.15"
|
|
38
|
+
},y=(t=0)=>e=>`[${e+t}m`,w=(t=0)=>e=>`[${38+t};5;${e}m`,C=(t=0)=>(e,i,r)=>`[${38+t};2;${e};${i};${r}m`,T={modifier:{
|
|
39
|
+
reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],
|
|
40
|
+
strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],
|
|
41
|
+
cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],
|
|
42
|
+
yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{
|
|
43
|
+
bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],
|
|
44
|
+
bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],
|
|
45
|
+
bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}}
|
|
46
|
+
;Object.keys(T.modifier),Object.keys(T.color),Object.keys(T.bgColor);const E=function(){const t=new Map
|
|
47
|
+
;for(const[e,i]of Object.entries(T)){for(const[e,r]of Object.entries(i))T[e]={open:`[${r[0]}m`,close:`[${r[1]}m`},
|
|
48
|
+
i[e]=T[e],t.set(r[0],r[1]);Object.defineProperty(T,e,{value:i,enumerable:!1})}return Object.defineProperty(T,"codes",{
|
|
49
|
+
value:t,enumerable:!1}),T.color.close="[39m",T.bgColor.close="[49m",T.color.ansi=y(),T.color.ansi256=w(),
|
|
50
|
+
T.color.ansi16m=C(),T.bgColor.ansi=y(10),T.bgColor.ansi256=w(10),T.bgColor.ansi16m=C(10),Object.defineProperties(T,{
|
|
51
|
+
rgbToAnsi256:{
|
|
247
52
|
value:(t,e,i)=>t===e&&e===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5),
|
|
248
53
|
enumerable:!1},hexToRgb:{value(t){const e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e)return[0,0,0];let[i]=e
|
|
249
|
-
;3===i.length&&(i=[...i].map(t=>t+t).join(""));const
|
|
250
|
-
enumerable:!1},hexToAnsi256:{value:t=>
|
|
251
|
-
if(t<8)return 30+t;if(t<16)return t-8+90;let e,i,
|
|
252
|
-
;e=Math.floor(t/36)/5,i=Math.floor(
|
|
253
|
-
;let n=30+(Math.round(
|
|
254
|
-
value:(t,e,i)=>
|
|
255
|
-
value:t=>
|
|
256
|
-
;function
|
|
257
|
-
const i=t.startsWith("-")?"":1===t.length?"-":"--",
|
|
258
|
-
const{env
|
|
259
|
-
if("FORCE_COLOR"in
|
|
260
|
-
}();void 0!==
|
|
261
|
-
if(
|
|
262
|
-
if("TF_BUILD"in
|
|
263
|
-
;if("win32"===
|
|
54
|
+
;3===i.length&&(i=[...i].map(t=>t+t).join(""));const r=Number.parseInt(i,16);return[r>>16&255,r>>8&255,255&r]},
|
|
55
|
+
enumerable:!1},hexToAnsi256:{value:t=>T.rgbToAnsi256(...T.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){
|
|
56
|
+
if(t<8)return 30+t;if(t<16)return t-8+90;let e,i,r;if(t>=232)e=(10*(t-232)+8)/255,i=e,r=e;else{const s=(t-=16)%36
|
|
57
|
+
;e=Math.floor(t/36)/5,i=Math.floor(s/6)/5,r=s%6/5}const s=2*Math.max(e,i,r);if(0===s)return 30
|
|
58
|
+
;let n=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(e));return 2===s&&(n+=60),n},enumerable:!1},rgbToAnsi:{
|
|
59
|
+
value:(t,e,i)=>T.ansi256ToAnsi(T.rgbToAnsi256(t,e,i)),enumerable:!1},hexToAnsi:{
|
|
60
|
+
value:t=>T.ansi256ToAnsi(T.hexToAnsi256(t)),enumerable:!1}}),T}(),A=E
|
|
61
|
+
;function S(t,e=(globalThis.Deno?globalThis.Deno.args:c.argv)){
|
|
62
|
+
const i=t.startsWith("-")?"":1===t.length?"-":"--",r=e.indexOf(i+t),s=e.indexOf("--");return-1!==r&&(-1===s||r<s)}
|
|
63
|
+
const{env:$}=c;let P;function k(t,{streamIsTTY:e,sniffFlags:i=!0}={}){const r=function(){
|
|
64
|
+
if("FORCE_COLOR"in $)return"true"===$.FORCE_COLOR?1:"false"===$.FORCE_COLOR?0:0===$.FORCE_COLOR.length?1:Math.min(Number.parseInt($.FORCE_COLOR,10),3)
|
|
65
|
+
}();void 0!==r&&(P=r);const s=i?P:r;if(0===s)return 0;if(i){
|
|
66
|
+
if(S("color=16m")||S("color=full")||S("color=truecolor"))return 3;if(S("color=256"))return 2}
|
|
67
|
+
if("TF_BUILD"in $&&"AGENT_NAME"in $)return 1;if(t&&!e&&void 0===s)return 0;const n=s||0;if("dumb"===$.TERM)return n
|
|
68
|
+
;if("win32"===c.platform){const t=m.release().split(".")
|
|
264
69
|
;return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}
|
|
265
|
-
if("CI"in
|
|
266
|
-
;if("TEAMCITY_VERSION"in
|
|
267
|
-
;if("truecolor"
|
|
268
|
-
;if("wezterm"
|
|
269
|
-
const t=Number.parseInt((
|
|
70
|
+
if("CI"in $)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(t=>t in $)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(t=>t in $)||"codeship"===$.CI_NAME?1:n
|
|
71
|
+
;if("TEAMCITY_VERSION"in $)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($.TEAMCITY_VERSION)?1:0
|
|
72
|
+
;if("truecolor"===$.COLORTERM)return 3;if("xterm-kitty"===$.TERM)return 3;if("xterm-ghostty"===$.TERM)return 3
|
|
73
|
+
;if("wezterm"===$.TERM)return 3;if("TERM_PROGRAM"in $){
|
|
74
|
+
const t=Number.parseInt(($.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($.TERM_PROGRAM){case"iTerm.app":
|
|
270
75
|
return t>=3?3:2;case"Apple_Terminal":return 2}}
|
|
271
|
-
return/-256(color)?$/i.test(
|
|
272
|
-
}function
|
|
76
|
+
return/-256(color)?$/i.test($.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($.TERM)||"COLORTERM"in $?1:n
|
|
77
|
+
}function I(t,e={}){return function(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(k(t,{
|
|
273
78
|
streamIsTTY:t&&t.isTTY,...e}))}
|
|
274
|
-
|
|
275
|
-
;const
|
|
276
|
-
;if(-1===
|
|
79
|
+
S("no-color")||S("no-colors")||S("color=false")||S("color=never")?P=0:(S("color")||S("colors")||S("color=true")||S("color=always"))&&(P=1)
|
|
80
|
+
;const R={stdout:I({isTTY:p.isatty(1)}),stderr:I({isTTY:p.isatty(2)})};function H(t,e,i){let r=t.indexOf(e)
|
|
81
|
+
;if(-1===r)return t;const s=e.length;let n=0,o="";do{o+=t.slice(n,r)+e+i,n=r+s,r=t.indexOf(e,n)}while(-1!==r)
|
|
277
82
|
;return o+=t.slice(n),o}
|
|
278
|
-
const{stdout:
|
|
279
|
-
;const
|
|
83
|
+
const{stdout:M,stderr:V}=R,j=Symbol("GENERATOR"),G=Symbol("STYLER"),W=Symbol("IS_EMPTY"),B=["ansi","ansi","ansi256","ansi16m"],F=Object.create(null)
|
|
84
|
+
;const N=t=>{const e=(...t)=>t.join(" ");return((t,e={})=>{
|
|
280
85
|
if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3")
|
|
281
|
-
;const i=
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
;return Object.defineProperty(this,
|
|
285
|
-
;
|
|
286
|
-
;const
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
}}
|
|
293
|
-
|
|
294
|
-
;
|
|
295
|
-
;
|
|
296
|
-
;
|
|
297
|
-
;
|
|
298
|
-
r=s+1,s=t.indexOf("\n",r)}while(-1!==s);return n+=t.slice(r),n}(e,r,s,n)),s+e+r}
|
|
299
|
-
;Object.defineProperties(ge.prototype,me);const Oe=ge(),Ce=(ge({level:he?he.level:0}),Oe),Ee=(t,e,i,s)=>{
|
|
86
|
+
;const i=M?M.level:0;t.level=void 0===e.level?i:e.level})(e,t),Object.setPrototypeOf(e,D.prototype),e};function D(t){
|
|
87
|
+
return N(t)}Object.setPrototypeOf(D.prototype,Function.prototype);for(const[t,e]of Object.entries(A))F[t]={get(){
|
|
88
|
+
const i=J(this,q(e.open,e.close,this[G]),this[W]);return Object.defineProperty(this,t,{value:i}),i}};F.visible={get(){
|
|
89
|
+
const t=J(this,this[G],!0);return Object.defineProperty(this,"visible",{value:t}),t}}
|
|
90
|
+
;const L=(t,e,i,...r)=>"rgb"===t?"ansi16m"===e?A[i].ansi16m(...r):"ansi256"===e?A[i].ansi256(A.rgbToAnsi256(...r)):A[i].ansi(A.rgbToAnsi(...r)):"hex"===t?L("rgb",e,i,...A.hexToRgb(...r)):A[i][t](...r),U=["rgb","hex","ansi256"]
|
|
91
|
+
;for(const t of U){F[t]={get(){const{level:e}=this;return function(...i){
|
|
92
|
+
const r=q(L(t,B[e],"color",...i),A.color.close,this[G]);return J(this,r,this[W])}}}
|
|
93
|
+
;F["bg"+t[0].toUpperCase()+t.slice(1)]={get(){const{level:e}=this;return function(...i){
|
|
94
|
+
const r=q(L(t,B[e],"bgColor",...i),A.bgColor.close,this[G]);return J(this,r,this[W])}}}}
|
|
95
|
+
const Y=Object.defineProperties(()=>{},{...F,level:{enumerable:!0,get(){return this[j].level},set(t){this[j].level=t}}
|
|
96
|
+
}),q=(t,e,i)=>{let r,s;return void 0===i?(r=t,s=e):(r=i.openAll+t,s=e+i.closeAll),{open:t,close:e,openAll:r,closeAll:s,
|
|
97
|
+
parent:i}},J=(t,e,i)=>{const r=(...t)=>z(r,1===t.length?""+t[0]:t.join(" "));return Object.setPrototypeOf(r,Y),r[j]=t,
|
|
98
|
+
r[G]=e,r[W]=i,r},z=(t,e)=>{if(t.level<=0||!e)return t[W]?"":e;let i=t[G];if(void 0===i)return e
|
|
99
|
+
;const{openAll:r,closeAll:s}=i;if(e.includes(""))for(;void 0!==i;)e=H(e,i.close,i.open),i=i.parent
|
|
100
|
+
;const n=e.indexOf("\n");return-1!==n&&(e=function(t,e,i,r){let s=0,n="";do{const o="\r"===t[r-1]
|
|
101
|
+
;n+=t.slice(s,o?r-1:r)+e+(o?"\r\n":"\n")+i,s=r+1,r=t.indexOf("\n",s)}while(-1!==r);return n+=t.slice(s),n}(e,s,r,n)),
|
|
102
|
+
r+e+s};Object.defineProperties(D.prototype,F);const K=D(),Q=(D({level:V?V.level:0}),K),X=(t,e,i,r)=>{
|
|
300
103
|
if("length"===i||"prototype"===i)return;if("arguments"===i||"caller"===i)return
|
|
301
|
-
;const
|
|
302
|
-
;!
|
|
104
|
+
;const s=Object.getOwnPropertyDescriptor(t,i),n=Object.getOwnPropertyDescriptor(e,i)
|
|
105
|
+
;!Z(s,n)&&r||Object.defineProperty(t,i,n)},Z=function(t,e){
|
|
303
106
|
return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)
|
|
304
|
-
},
|
|
305
|
-
;function
|
|
107
|
+
},tt=(t,e)=>`/* Wrapped ${t}*/\n${e}`,et=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),it=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")
|
|
108
|
+
;function rt(t,e,{ignoreNonConfigurable:i=!1}={}){const{name:r}=t;for(const r of Reflect.ownKeys(e))X(t,e,r,i)
|
|
306
109
|
;return((t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)})(t,e),
|
|
307
|
-
((t,e,i)=>{const
|
|
308
|
-
;const{writable:n,enumerable:o,configurable:a}=
|
|
309
|
-
configurable:a})})(t,e,
|
|
310
|
-
if("function"!=typeof t)throw new TypeError("Expected a function");let i,
|
|
311
|
-
;const
|
|
312
|
-
t=void 0;else if(!0===e.throw)throw new Error(`Function \`${
|
|
313
|
-
|
|
314
|
-
if(!
|
|
315
|
-
;return
|
|
316
|
-
;
|
|
317
|
-
"linux"===process.platform&&
|
|
318
|
-
;const
|
|
319
|
-
;class
|
|
320
|
-
if(
|
|
321
|
-
this.listeners[t].push(e)}removeListener(t,e){const i=this.listeners[t],
|
|
322
|
-
;-1!==
|
|
323
|
-
;let
|
|
324
|
-
class
|
|
325
|
-
#t="win32"===
|
|
326
|
-
;for(const e of
|
|
327
|
-
;if("object"==typeof
|
|
328
|
-
i.length===
|
|
329
|
-
;this.#
|
|
110
|
+
((t,e,i)=>{const r=""===i?"":`with ${i.trim()}() `,s=tt.bind(null,r,e.toString());Object.defineProperty(s,"name",it)
|
|
111
|
+
;const{writable:n,enumerable:o,configurable:a}=et;Object.defineProperty(t,"toString",{value:s,writable:n,enumerable:o,
|
|
112
|
+
configurable:a})})(t,e,r),t}const st=new WeakMap,nt=(t,e={})=>{
|
|
113
|
+
if("function"!=typeof t)throw new TypeError("Expected a function");let i,r=0
|
|
114
|
+
;const s=t.displayName||t.name||"<anonymous>",n=function(...o){if(st.set(n,++r),1===r)i=t.apply(this,o),
|
|
115
|
+
t=void 0;else if(!0===e.throw)throw new Error(`Function \`${s}\` can only be called once`);return i};return rt(n,t),
|
|
116
|
+
st.set(n,r),n};nt.callCount=t=>{
|
|
117
|
+
if(!st.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`)
|
|
118
|
+
;return st.get(t)};const ot=nt,at=[]
|
|
119
|
+
;at.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&at.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),
|
|
120
|
+
"linux"===process.platform&&at.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")
|
|
121
|
+
;const lt=t=>!!t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on,ht=Symbol.for("signal-exit emitter"),ct=globalThis,ut=Object.defineProperty.bind(Object)
|
|
122
|
+
;class mt{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){
|
|
123
|
+
if(ct[ht])return ct[ht];ut(ct,ht,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,e){
|
|
124
|
+
this.listeners[t].push(e)}removeListener(t,e){const i=this.listeners[t],r=i.indexOf(e)
|
|
125
|
+
;-1!==r&&(0===r&&1===i.length?i.length=0:i.splice(r,1))}emit(t,e,i){if(this.emitted[t])return!1;this.emitted[t]=!0
|
|
126
|
+
;let r=!1;for(const s of this.listeners[t])r=!0===s(e,i)||r;return"exit"===t&&(r=this.emit("afterExit",e,i)||r),r}}
|
|
127
|
+
class pt{}const dt=globalThis.process,{onExit:ft,load:gt,unload:_t}=(vt=lt(dt)?new class extends pt{
|
|
128
|
+
#t="win32"===dt.platform?"SIGINT":"SIGHUP";#e=new mt;#i;#r;#s;#n={};#o=!1;constructor(t){super(),this.#i=t,this.#n={}
|
|
129
|
+
;for(const e of at)this.#n[e]=()=>{const i=this.#i.listeners(e);let{count:r}=this.#e;const s=t
|
|
130
|
+
;if("object"==typeof s.__signal_exit_emitter__&&"number"==typeof s.__signal_exit_emitter__.count&&(r+=s.__signal_exit_emitter__.count),
|
|
131
|
+
i.length===r){this.unload();const i=this.#e.emit("exit",null,e),r="SIGHUP"===e?this.#t:e;i||t.kill(t.pid,r)}}
|
|
132
|
+
;this.#s=t.reallyExit,this.#r=t.emit}onExit(t,e){if(!lt(this.#i))return()=>{};!1===this.#o&&this.load()
|
|
330
133
|
;const i=e?.alwaysLast?"afterExit":"exit";return this.#e.on(i,t),()=>{this.#e.removeListener(i,t),
|
|
331
134
|
0===this.#e.listeners.exit.length&&0===this.#e.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){
|
|
332
|
-
this.#o=!0,this.#e.count+=1;for(const t of
|
|
333
|
-
this.#i.emit=(t,...e)=>this.#a(t,...e),this.#i.reallyExit=t=>this.#l(t)}}unload(){this.#o&&(this.#o=!1,
|
|
135
|
+
this.#o=!0,this.#e.count+=1;for(const t of at)try{const e=this.#n[t];e&&this.#i.on(t,e)}catch(t){}
|
|
136
|
+
this.#i.emit=(t,...e)=>this.#a(t,...e),this.#i.reallyExit=t=>this.#l(t)}}unload(){this.#o&&(this.#o=!1,at.forEach(t=>{
|
|
334
137
|
const e=this.#n[t];if(!e)throw new Error("Listener not defined for signal: "+t);try{this.#i.removeListener(t,e)
|
|
335
|
-
}catch(t){}}),this.#i.emit=this.#
|
|
336
|
-
return
|
|
337
|
-
this.#
|
|
338
|
-
"number"==typeof e[0]&&(this.#i.exitCode=e[0]);const
|
|
339
|
-
;return this.#e.emit("exit",this.#i.exitCode,null),
|
|
340
|
-
return()=>{}}load(){}unload(){}},{onExit:(t,e)=>
|
|
341
|
-
;const
|
|
342
|
-
alwaysLast:!0})}):()=>{};let
|
|
343
|
-
hide:(t=
|
|
344
|
-
},Ke=Je,Qe=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots14":{"interval":80,"frames":["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"dotsCircle":{"interval":80,"frames":["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"rollingLine":{"interval":80,"frames":["/ "," - "," \\\\ "," |"," |"," \\\\ "," - ","/ "]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","💗 "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},"fish":{"interval":80,"frames":["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}}')
|
|
345
|
-
;const
|
|
346
|
-
;const i=`[${t}m`,
|
|
347
|
-
;const l=(22===e?
|
|
348
|
-
},
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
const{env:t}=
|
|
353
|
-
;return"win32"!==
|
|
354
|
-
}const
|
|
355
|
-
;const
|
|
138
|
+
}catch(t){}}),this.#i.emit=this.#r,this.#i.reallyExit=this.#s,this.#e.count-=1)}#l(t){
|
|
139
|
+
return lt(this.#i)?(this.#i.exitCode=t||0,this.#e.emit("exit",this.#i.exitCode,null),
|
|
140
|
+
this.#s.call(this.#i,this.#i.exitCode)):0}#a(t,...e){const i=this.#r;if("exit"===t&<(this.#i)){
|
|
141
|
+
"number"==typeof e[0]&&(this.#i.exitCode=e[0]);const r=i.call(this.#i,t,...e)
|
|
142
|
+
;return this.#e.emit("exit",this.#i.exitCode,null),r}return i.call(this.#i,t,...e)}}(dt):new class extends pt{onExit(){
|
|
143
|
+
return()=>{}}load(){}unload(){}},{onExit:(t,e)=>vt.onExit(t,e),load:()=>vt.load(),unload:()=>vt.unload()});var vt
|
|
144
|
+
;const bt=c.stderr.isTTY?c.stderr:c.stdout.isTTY?c.stdout:void 0,Ot=bt?ot(()=>{ft(()=>{bt.write("[?25h")},{
|
|
145
|
+
alwaysLast:!0})}):()=>{};let xt=!1;const yt={show:(t=c.stderr)=>{t.isTTY&&(xt=!1,t.write("[?25h"))},
|
|
146
|
+
hide:(t=c.stderr)=>{t.isTTY&&(Ot(),xt=!0,t.write("[?25l"))},toggle:(t,e)=>{void 0!==t&&(xt=t),xt?yt.show(e):yt.hide(e)}
|
|
147
|
+
},wt=yt,Ct=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots14":{"interval":80,"frames":["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"dotsCircle":{"interval":80,"frames":["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"rollingLine":{"interval":80,"frames":["/ "," - "," \\\\ "," |"," |"," \\\\ "," - ","/ "]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","💗 "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},"fish":{"interval":80,"frames":["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}}')
|
|
148
|
+
;const Tt=Ct;Object.keys(Ct);const Et=p?.WriteStream?.prototype?.hasColors?.()??!1,At=(t,e)=>{if(!Et)return t=>t
|
|
149
|
+
;const i=`[${t}m`,r=`[${e}m`;return t=>{const s=t+"";let n=s.indexOf(r);if(-1===n)return i+s+r;let o=i,a=0
|
|
150
|
+
;const l=(22===e?r:"")+i;for(;-1!==n;)o+=s.slice(a,n)+l,a=n+r.length,n=s.indexOf(r,a);return o+=s.slice(a)+r,o}
|
|
151
|
+
},St=(At(0,0),At(1,22),At(2,22),At(3,23),At(4,24),At(53,55),At(7,27),At(8,28),At(9,29),At(30,39),
|
|
152
|
+
At(31,39)),$t=At(32,39),Pt=At(33,39),kt=At(34,39);At(35,39),At(36,39),At(37,39),At(90,39),At(40,49),At(41,49),At(42,49),
|
|
153
|
+
At(43,49),At(44,49),At(45,49),At(46,49),At(47,49),At(100,49),At(91,39),At(92,39),At(93,39),At(94,39),At(95,39),
|
|
154
|
+
At(96,39),At(97,39),At(101,49),At(102,49),At(103,49),At(104,49),At(105,49),At(106,49),At(107,49);function It(){
|
|
155
|
+
const{env:t}=c,{TERM:e,TERM_PROGRAM:i}=t
|
|
156
|
+
;return"win32"!==c.platform?"linux"!==e:Boolean(t.WT_SESSION)||Boolean(t.TERMINUS_SUBLIME)||"{cmd::Cmder}"===t.ConEmuTask||"Terminus-Sublime"===i||"vscode"===i||"xterm-256color"===e||"alacritty"===e||"rxvt-unicode"===e||"rxvt-unicode-256color"===e||"JetBrains-JediTerm"===t.TERMINAL_EMULATOR
|
|
157
|
+
}const Rt=It(),Ht=kt(Rt?"ℹ":"i"),Mt=$t(Rt?"✔":"√"),Vt=Pt(Rt?"⚠":"‼"),jt=St(Rt?"✖":"×")
|
|
158
|
+
;const Gt=function({onlyFirst:t=!1}={}){
|
|
356
159
|
return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",t?void 0:"g")
|
|
357
160
|
}()
|
|
358
|
-
;const
|
|
359
|
-
let i=0,
|
|
360
|
-
if(!(e>t[n+1]))return!0;i=
|
|
361
|
-
;for(let
|
|
362
|
-
const
|
|
363
|
-
;function
|
|
364
|
-
function
|
|
365
|
-
const
|
|
366
|
-
;function
|
|
367
|
-
;return null!==e&&e.length>=2}return!1}function
|
|
368
|
-
function
|
|
369
|
-
function
|
|
370
|
-
const i=[];for(const e of t)
|
|
371
|
-
;for(let t=0;t<i.length;t++){const
|
|
372
|
-
|
|
373
|
-
;for(const
|
|
374
|
-
if("string"!=typeof t||0===t.length)return 0;const{ambiguousIsNarrow:i=!0,countAnsiEscapeCodes:
|
|
375
|
-
;if(s
|
|
161
|
+
;const Wt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Bt=[12288,12288,65281,65376,65504,65510],Ft=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Nt=(t,e)=>{
|
|
162
|
+
let i=0,r=Math.floor(t.length/2)-1;for(;i<=r;){const s=Math.floor((i+r)/2),n=2*s;if(e<t[n])r=s-1;else{
|
|
163
|
+
if(!(e>t[n+1]))return!0;i=s+1}}return!1};const[Dt,Lt]=Ut(Ft);function Ut(t){let e=t[0],i=t[1]
|
|
164
|
+
;for(let r=0;r<t.length;r+=2){const s=t[r],n=t[r+1];if(19968>=s&&19968<=n)return[s,n];n-s>i-e&&(e=s,i=n)}return[e,i]}
|
|
165
|
+
const Yt=t=>!(t<161||t>1114109)&&Nt(Wt,t),qt=t=>!(t<12288||t>65510)&&Nt(Bt,t),Jt=t=>t>=Dt&&t<=Lt||!(t<4352||t>262141)&&Nt(Ft,t)
|
|
166
|
+
;function zt(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}
|
|
167
|
+
function Kt(t,{ambiguousAsWide:e=!1}={}){return zt(t),qt(t)||Jt(t)||e&&Yt(t)?2:1}
|
|
168
|
+
const Qt=new Intl.Segmenter,Xt=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,Zt=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,te=/^\p{RGI_Emoji}$/v,ee=/^[\d#*]\u20E3$/,ie=/\p{Extended_Pictographic}/gu
|
|
169
|
+
;function re(t){if(t.length>50)return!1;if(ee.test(t))return!0;if(t.includes("")){const e=t.match(ie)
|
|
170
|
+
;return null!==e&&e.length>=2}return!1}function se(t){return t.replace(Zt,"")}function ne(t){return Xt.test(t)}
|
|
171
|
+
function oe(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function ae(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}
|
|
172
|
+
function le(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function he(t){return oe(t)||ae(t)||le(t)}function ce(t,e){
|
|
173
|
+
const i=[];for(const e of t)Xt.test(e)||i.push(e.codePointAt(0));if(0===i.length)return;let r=0
|
|
174
|
+
;for(let t=0;t<i.length;t++){const s=i[t];if(!he(s)){if(0===r)return;for(let s=t;s<i.length;s++)r+=Kt(i[s],e);return r}
|
|
175
|
+
oe(s)&&ae(i[t+1])?(r+=2,t+=le(i[t+2])?2:1):r+=Kt(s,e)}return r}function ue(t,e){let i=0,r=!0
|
|
176
|
+
;for(const s of t)r?r=!1:s>=""&&s<=""&&(i+=Kt(s.codePointAt(0),e));return i}function me(t,e={}){
|
|
177
|
+
if("string"!=typeof t||0===t.length)return 0;const{ambiguousIsNarrow:i=!0,countAnsiEscapeCodes:r=!1}=e;let s=t
|
|
178
|
+
;if(r||!s.includes("")&&!s.includes("")||(s=function(t){
|
|
376
179
|
if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``)
|
|
377
|
-
;return t.includes("")||t.includes("")?t.replace(
|
|
378
|
-
;if(/^[\u0020-\u007E]*$/.test(
|
|
379
|
-
;for(const{segment:t}of
|
|
380
|
-
;if(void 0!==i){n+=i;continue}n+=
|
|
381
|
-
;#p=t=>{if(!t?.length)return;3===("string"==typeof t?t.codePointAt(0):t[0])&&
|
|
382
|
-
1===this.#h&&this.#
|
|
383
|
-
;"win32"!==
|
|
384
|
-
this.#
|
|
385
|
-
if(!this.#c)return;const t=this.#c;t.off("data",this.#p),t.isTTY&&t.setRawMode?.(this.#
|
|
386
|
-
this.#c=void 0,this.#u=!1,this.#
|
|
387
|
-
},
|
|
388
|
-
;class
|
|
389
|
-
}}#
|
|
180
|
+
;return t.includes("")||t.includes("")?t.replace(Gt,""):t}(s)),0===s.length)return 0
|
|
181
|
+
;if(/^[\u0020-\u007E]*$/.test(s))return s.length;let n=0;const o={ambiguousAsWide:!i}
|
|
182
|
+
;for(const{segment:t}of Qt.segment(s)){if(ne(t))continue;if(te.test(t)||re(t)){n+=2;continue}const e=se(t),i=ce(e,o)
|
|
183
|
+
;if(void 0!==i){n+=i;continue}n+=Kt(e.codePointAt(0),o),n+=ue(e,o)}return n}const pe=new class{#h=0;#c;#u=!1;#m=!1
|
|
184
|
+
;#p=t=>{if(!t?.length)return;3===("string"==typeof t?t.codePointAt(0):t[0])&&c.kill(c.pid,"SIGINT")};start(){this.#h++,
|
|
185
|
+
1===this.#h&&this.#d()}stop(){0!==this.#h&&0===--this.#h&&this.#f()}#d(){const{stdin:t}=c
|
|
186
|
+
;"win32"!==c.platform&&t?.isTTY&&"function"==typeof t.setRawMode?(this.#c=t,this.#u=t.isPaused(),
|
|
187
|
+
this.#m=Boolean(t.isRaw),t.setRawMode(!0),t.prependListener("data",this.#p),this.#u&&t.resume()):this.#c=void 0}#f(){
|
|
188
|
+
if(!this.#c)return;const t=this.#c;t.off("data",this.#p),t.isTTY&&t.setRawMode?.(this.#m),this.#u&&t.pause(),
|
|
189
|
+
this.#c=void 0,this.#u=!1,this.#m=!1}
|
|
190
|
+
},de=Object.freeze(pe),fe=new Map,ge=new Set(["black","red","green","yellow","blue","magenta","cyan","white","gray"])
|
|
191
|
+
;class _e{#g=0;#_=-1;#v=0;#b;#O;#x;#y;#w=new Map;#C=!1;#T;#E;#A=!1;#S;#$(t){this.#C=!0;try{return t()}finally{this.#C=!1
|
|
192
|
+
}}#P(){this.isSpinning&&this.render()}#k(t,e){if(null==t)return"";if("string"==typeof t)return t
|
|
390
193
|
;if(Buffer.isBuffer(t)||ArrayBuffer.isView(t)){const i="string"==typeof e&&e&&"buffer"!==e?e:"utf8"
|
|
391
|
-
;return Buffer.from(t).toString(i)}return String(t)}#I(t){if(!t)return!1;const e=t.at(-1);return"\n"===e||"\r"===e}
|
|
392
|
-
this.#
|
|
393
|
-
"function"==typeof this.#
|
|
394
|
-
return this.#
|
|
395
|
-
text:t}),this.#
|
|
396
|
-
this.#
|
|
397
|
-
return Boolean(t&&t.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#
|
|
398
|
-
"boolean"!=typeof this.#
|
|
399
|
-
void 0!==this.#
|
|
400
|
-
;const e=this.#
|
|
401
|
-
this.prefixText=this.#
|
|
402
|
-
return this.#
|
|
403
|
-
if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#
|
|
404
|
-
}get interval(){return this.#
|
|
405
|
-
if(this.#_=-1,this.#
|
|
194
|
+
;return Buffer.from(t).toString(i)}return String(t)}#I(t){if(!t)return!1;const e=t.at(-1);return"\n"===e||"\r"===e}#R(){
|
|
195
|
+
this.#E||(this.#E=setTimeout(()=>{this.#E=void 0,this.isSpinning&&this.#P()},200),
|
|
196
|
+
"function"==typeof this.#E?.unref&&this.#E.unref())}#H(){this.#E&&(clearTimeout(this.#E),this.#E=void 0)}#M(t,e,i,r){
|
|
197
|
+
return this.#V(i," ")+t+("string"==typeof e?(t?" ":"")+e:"")+this.#j(r," ")}constructor(t){if("string"==typeof t&&(t={
|
|
198
|
+
text:t}),this.#b={color:"cyan",stream:c.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#b.color,
|
|
199
|
+
this.#x=this.#b.stream,"boolean"!=typeof this.#b.isEnabled&&(this.#b.isEnabled=function({stream:t=process.stdout}={}){
|
|
200
|
+
return Boolean(t&&t.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#x})),
|
|
201
|
+
"boolean"!=typeof this.#b.isSilent&&(this.#b.isSilent=!1),
|
|
202
|
+
void 0!==this.#b.interval&&!(Number.isInteger(this.#b.interval)&&this.#b.interval>0))throw new Error("The `interval` option must be a positive integer")
|
|
203
|
+
;const e=this.#b.interval;this.spinner=this.#b.spinner,this.#b.interval=e,this.text=this.#b.text,
|
|
204
|
+
this.prefixText=this.#b.prefixText,this.suffixText=this.#b.suffixText,this.indent=this.#b.indent}get indent(){
|
|
205
|
+
return this.#b.indent}set indent(t=0){
|
|
206
|
+
if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#b.indent=t
|
|
207
|
+
}get interval(){return this.#b.interval??this.#O.interval??100}get spinner(){return this.#O}set spinner(t){
|
|
208
|
+
if(this.#_=-1,this.#b.interval=void 0,"object"==typeof t){
|
|
406
209
|
if(!Array.isArray(t.frames)||0===t.frames.length||t.frames.some(t=>"string"!=typeof t))throw new Error("The given spinner must have a non-empty `frames` array of strings")
|
|
407
210
|
;if(void 0!==t.interval&&!(Number.isInteger(t.interval)&&t.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided")
|
|
408
|
-
;this.#
|
|
409
|
-
if("default"===t||!
|
|
410
|
-
;this.#
|
|
411
|
-
return this.#
|
|
412
|
-
set suffixText(t=""){this.#
|
|
413
|
-
const
|
|
414
|
-
return this.#
|
|
415
|
-
;for(const
|
|
416
|
-
if(void 0!==t&&!1!==t&&!
|
|
417
|
-
;this.#S=t}get isEnabled(){return this.#
|
|
418
|
-
if("boolean"!=typeof t)throw new TypeError("The `isEnabled` option must be a boolean");this.#
|
|
419
|
-
get isSilent(){return this.#
|
|
420
|
-
if("boolean"!=typeof t)throw new TypeError("The `isSilent` option must be a boolean");this.#
|
|
421
|
-
const t=Date.now();(-1===this.#_||t-this.#v>=this.interval)&&(this.#_=(this.#_+1)%this.#
|
|
422
|
-
;const{frames:e}=this.#
|
|
423
|
-
;return this.#
|
|
424
|
-
clear(){return this.isEnabled&&this.#
|
|
425
|
-
;for(let t=0;t<this.#g;t++)t>0&&this.#
|
|
426
|
-
;this.#
|
|
427
|
-
if(!t||this.#
|
|
428
|
-
;
|
|
429
|
-
;const e=t.write;this.#
|
|
430
|
-
if(!this.isEnabled||this.#
|
|
431
|
-
for(const[t,e]of this.#
|
|
432
|
-
if("function"==typeof
|
|
433
|
-
;const n=this.#
|
|
434
|
-
this.isSpinning&&!this.#
|
|
435
|
-
;const t=this.#
|
|
436
|
-
;const
|
|
211
|
+
;this.#O=t}else if(It())if(void 0===t)this.#O=Tt.dots;else{
|
|
212
|
+
if("default"===t||!Tt[t])throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)
|
|
213
|
+
;this.#O=Tt[t]}else this.#O=Tt.line}get text(){return this.#b.text}set text(t=""){this.#b.text=t}get prefixText(){
|
|
214
|
+
return this.#b.prefixText}set prefixText(t=""){this.#b.prefixText=t}get suffixText(){return this.#b.suffixText}
|
|
215
|
+
set suffixText(t=""){this.#b.suffixText=t}get isSpinning(){return void 0!==this.#y}#G(t,e,i=!1){
|
|
216
|
+
const r="function"==typeof t?t():t;return"string"==typeof r&&""!==r?i?e+r:r+e:""}#V(t=this.#b.prefixText,e=" "){
|
|
217
|
+
return this.#G(t,e,!1)}#j(t=this.#b.suffixText,e=" "){return this.#G(t,e,!0)}#W(t,e){let i=0
|
|
218
|
+
;for(const r of u(t).split("\n"))i+=Math.max(1,Math.ceil(me(r)/e));return i}get color(){return this.#S}set color(t){
|
|
219
|
+
if(void 0!==t&&!1!==t&&!ge.has(t))throw new Error("The `color` option must be a valid color or `false` to disable")
|
|
220
|
+
;this.#S=t}get isEnabled(){return this.#b.isEnabled&&!this.#b.isSilent}set isEnabled(t){
|
|
221
|
+
if("boolean"!=typeof t)throw new TypeError("The `isEnabled` option must be a boolean");this.#b.isEnabled=t}
|
|
222
|
+
get isSilent(){return this.#b.isSilent}set isSilent(t){
|
|
223
|
+
if("boolean"!=typeof t)throw new TypeError("The `isSilent` option must be a boolean");this.#b.isSilent=t}frame(){
|
|
224
|
+
const t=Date.now();(-1===this.#_||t-this.#v>=this.interval)&&(this.#_=(this.#_+1)%this.#O.frames.length,this.#v=t)
|
|
225
|
+
;const{frames:e}=this.#O;let i=e[this.#_];this.#S&&(i=Q[this.#S](i))
|
|
226
|
+
;return this.#V(this.#b.prefixText," ")+i+("string"==typeof this.text?" "+this.text:"")+this.#j(this.#b.suffixText," ")}
|
|
227
|
+
clear(){return this.isEnabled&&this.#x.isTTY?(this.#$(()=>{this.#x.cursorTo(0)
|
|
228
|
+
;for(let t=0;t<this.#g;t++)t>0&&this.#x.moveCursor(0,-1),this.#x.clearLine(1)
|
|
229
|
+
;this.#b.indent&&this.#x.cursorTo(this.#b.indent)}),this.#g=0,this):this}#B(t){
|
|
230
|
+
if(!t||this.#w.has(t)||!t.isTTY||"function"!=typeof t.write)return
|
|
231
|
+
;fe.has(t)&&console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.")
|
|
232
|
+
;const e=t.write;this.#w.set(t,e),fe.set(t,this),t.write=(i,r,s)=>this.#F(t,e,i,r,s)}#N(){
|
|
233
|
+
if(!this.isEnabled||this.#w.size>0)return;const t=new Set([this.#x,c.stdout,c.stderr]);for(const e of t)this.#B(e)}#D(){
|
|
234
|
+
for(const[t,e]of this.#w)t.write=e,fe.get(t)===this&&fe.delete(t);this.#w.clear()}#F(t,e,i,r,s){
|
|
235
|
+
if("function"==typeof r&&(s=r,r=void 0),this.#C)return e.call(t,i,r,s);this.clear()
|
|
236
|
+
;const n=this.#k(i,r),o=this.#I(n),a=e.call(t,i,r,s);return o?this.#H():n.length>0&&this.#R(),
|
|
237
|
+
this.isSpinning&&!this.#E&&this.render(),a}render(){if(!this.isEnabled||this.#T||this.#E)return this
|
|
238
|
+
;const t=this.#x.isTTY;let e=!1;try{t&&(this.#$(()=>this.#x.write("[?2026h")),e=!0),this.clear();let i=this.frame()
|
|
239
|
+
;const r=this.#x.columns??80,s=this.#W(i,r),n=this.#x.rows;if(n&&n>1&&s>n){const t=i.split("\n"),e=n-1
|
|
437
240
|
;i=[...t.slice(0,e),"... (content truncated to fit terminal)"].join("\n")}
|
|
438
|
-
!1===this
|
|
439
|
-
this.#
|
|
241
|
+
!1===this.#$(()=>this.#x.write(i))&&this.#x.isTTY&&(this.#T=()=>{this.#T=void 0,this.#P()},
|
|
242
|
+
this.#x.once("drain",this.#T)),this.#g=this.#W(i,r)}finally{e&&this.#$(()=>this.#x.write("[?2026l"))}return this}
|
|
440
243
|
start(t){if(void 0!==t&&(this.text=t),this.isSilent)return this;if(!this.isEnabled){
|
|
441
|
-
const t=this.text?"-":"",e=" ".repeat(this.#
|
|
442
|
-
;return""!==e.trim()&&this
|
|
443
|
-
return this.isSpinning||(this.#
|
|
444
|
-
this.#A=!0),this.#
|
|
445
|
-
return clearInterval(this.#
|
|
446
|
-
this.#
|
|
447
|
-
this.#
|
|
448
|
-
symbol:
|
|
449
|
-
text:t})}info(t){return this.stopAndPersist({symbol:
|
|
450
|
-
;const e=t.symbol??" ",i=t.text??this.text,
|
|
451
|
-
;return this.stop(),this
|
|
452
|
-
;class
|
|
453
|
-
this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}}class
|
|
244
|
+
const t=this.text?"-":"",e=" ".repeat(this.#b.indent)+this.#M(t,this.text,this.#b.prefixText,this.#b.suffixText)
|
|
245
|
+
;return""!==e.trim()&&this.#$(()=>this.#x.write(e+"\n")),this}
|
|
246
|
+
return this.isSpinning||(this.#b.hideCursor&&wt.hide(this.#x),this.#b.discardStdin&&c.stdin.isTTY&&(de.start(),
|
|
247
|
+
this.#A=!0),this.#N(),this.render(),this.#y=setInterval(this.render.bind(this),this.interval)),this}stop(){
|
|
248
|
+
return clearInterval(this.#y),this.#y=void 0,this.#_=-1,this.#v=0,this.#H(),this.#D(),
|
|
249
|
+
this.#T&&(this.#x.removeListener("drain",this.#T),this.#T=void 0),this.isEnabled&&(this.clear(),
|
|
250
|
+
this.#b.hideCursor&&wt.show(this.#x)),this.#A&&(this.#A=!1,de.stop()),this}succeed(t){return this.stopAndPersist({
|
|
251
|
+
symbol:Mt,text:t})}fail(t){return this.stopAndPersist({symbol:jt,text:t})}warn(t){return this.stopAndPersist({symbol:Vt,
|
|
252
|
+
text:t})}info(t){return this.stopAndPersist({symbol:Ht,text:t})}stopAndPersist(t={}){if(this.isSilent)return this
|
|
253
|
+
;const e=t.symbol??" ",i=t.text??this.text,r=t.prefixText??this.#b.prefixText,s=t.suffixText??this.#b.suffixText,n=this.#M(e,i,r,s)+"\n"
|
|
254
|
+
;return this.stop(),this.#$(()=>this.#x.write(n)),this}}function ve(t){return new _e(t)}var be=O(991),Oe=O.n(be)
|
|
255
|
+
;class xe extends Error{constructor(t,e,i){super(i),Error.captureStackTrace(this,this.constructor),
|
|
256
|
+
this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}}class ye extends xe{constructor(t){
|
|
454
257
|
super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}
|
|
455
|
-
class
|
|
258
|
+
class we{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,
|
|
456
259
|
this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break
|
|
457
260
|
;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t}
|
|
458
261
|
this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}
|
|
459
262
|
_collectValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?(e.push(t),e):[t]}default(t,e){
|
|
460
263
|
return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){
|
|
461
264
|
return this.argChoices=t.slice(),this.parseArg=(t,e)=>{
|
|
462
|
-
if(!this.argChoices.includes(t))throw new
|
|
265
|
+
if(!this.argChoices.includes(t))throw new ye(`Allowed choices are ${this.argChoices.join(", ")}.`)
|
|
463
266
|
;return this.variadic?this._collectValue(t,e):t},this}argRequired(){return this.required=!0,this}argOptional(){
|
|
464
|
-
return this.required=!1,this}}function
|
|
465
|
-
;return t.required?"<"+e+">":"["+e+"]"}class
|
|
267
|
+
return this.required=!1,this}}function Ce(t){const e=t.name()+(!0===t.variadic?"...":"")
|
|
268
|
+
;return t.required?"<"+e+">":"["+e+"]"}class Te{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,
|
|
466
269
|
this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){
|
|
467
270
|
this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){
|
|
468
271
|
const e=t.commands.filter(t=>!t._hidden),i=t._getHelpCommand();return i&&!i._hidden&&e.push(i),
|
|
469
272
|
this.sortSubcommands&&e.sort((t,e)=>t.name().localeCompare(e.name())),e}compareOptions(t,e){
|
|
470
273
|
const i=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return i(t).localeCompare(i(e))}visibleOptions(t){
|
|
471
274
|
const e=t.options.filter(t=>!t.hidden),i=t._getHelpOption();if(i&&!i.hidden){
|
|
472
|
-
const
|
|
473
|
-
;s
|
|
275
|
+
const r=i.short&&t._findOption(i.short),s=i.long&&t._findOption(i.long)
|
|
276
|
+
;r||s?i.long&&!s?e.push(t.createOption(i.long,i.description)):i.short&&!r&&e.push(t.createOption(i.short,i.description)):e.push(i)
|
|
474
277
|
}return this.sortOptions&&e.sort(this.compareOptions),e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[]
|
|
475
278
|
;const e=[];for(let i=t.parent;i;i=i.parent){const t=i.options.filter(t=>!t.hidden);e.push(...t)}
|
|
476
279
|
return this.sortOptions&&e.sort(this.compareOptions),e}visibleArguments(t){
|
|
477
280
|
return t._argsDescription&&t.registeredArguments.forEach(e=>{
|
|
478
281
|
e.description=e.description||t._argsDescription[e.name()]||""
|
|
479
282
|
}),t.registeredArguments.find(t=>t.description)?t.registeredArguments:[]}subcommandTerm(t){
|
|
480
|
-
const e=t.registeredArguments.map(t=>
|
|
283
|
+
const e=t.registeredArguments.map(t=>Ce(t)).join(" ")
|
|
481
284
|
;return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){
|
|
482
285
|
return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){
|
|
483
286
|
return e.visibleCommands(t).reduce((t,i)=>Math.max(t,this.displayWidth(e.styleSubcommandTerm(e.subcommandTerm(i)))),0)}
|
|
@@ -498,21 +301,21 @@ void 0!==t.envVar&&e.push(`env: ${t.envVar}`),e.length>0){const i=`(${e.join(",
|
|
|
498
301
|
;if(t.argChoices&&e.push(`choices: ${t.argChoices.map(t=>JSON.stringify(t)).join(", ")}`),
|
|
499
302
|
void 0!==t.defaultValue&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){
|
|
500
303
|
const i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,e,i){
|
|
501
|
-
return 0===e.length?[]:[i.styleTitle(t),...e,""]}groupItems(t,e,i){const
|
|
502
|
-
;
|
|
503
|
-
const i=e.padWidth(t,e),
|
|
304
|
+
return 0===e.length?[]:[i.styleTitle(t),...e,""]}groupItems(t,e,i){const r=new Map;return t.forEach(t=>{const e=i(t)
|
|
305
|
+
;r.has(e)||r.set(e,[])}),e.forEach(t=>{const e=i(t);r.has(e)||r.set(e,[]),r.get(e).push(t)}),r}formatHelp(t,e){
|
|
306
|
+
const i=e.padWidth(t,e),r=e.helpWidth??80;function s(t,r){return e.formatItem(t,i,r,e)}
|
|
504
307
|
let n=[`${e.styleTitle("Usage:")} ${e.styleUsage(e.commandUsage(t))}`,""];const o=e.commandDescription(t)
|
|
505
|
-
;o.length>0&&(n=n.concat([e.boxWrap(e.styleCommandDescription(o),
|
|
506
|
-
;const a=e.visibleArguments(t).map(t=>
|
|
308
|
+
;o.length>0&&(n=n.concat([e.boxWrap(e.styleCommandDescription(o),r),""]))
|
|
309
|
+
;const a=e.visibleArguments(t).map(t=>s(e.styleArgumentTerm(e.argumentTerm(t)),e.styleArgumentDescription(e.argumentDescription(t))))
|
|
507
310
|
;n=n.concat(this.formatItemList("Arguments:",a,e))
|
|
508
311
|
;if(this.groupItems(t.options,e.visibleOptions(t),t=>t.helpGroupHeading??"Options:").forEach((t,i)=>{
|
|
509
|
-
const
|
|
510
|
-
;n=n.concat(this.formatItemList(i,
|
|
511
|
-
const i=e.visibleGlobalOptions(t).map(t=>
|
|
312
|
+
const r=t.map(t=>s(e.styleOptionTerm(e.optionTerm(t)),e.styleOptionDescription(e.optionDescription(t))))
|
|
313
|
+
;n=n.concat(this.formatItemList(i,r,e))}),e.showGlobalOptions){
|
|
314
|
+
const i=e.visibleGlobalOptions(t).map(t=>s(e.styleOptionTerm(e.optionTerm(t)),e.styleOptionDescription(e.optionDescription(t))))
|
|
512
315
|
;n=n.concat(this.formatItemList("Global Options:",i,e))}
|
|
513
316
|
return this.groupItems(t.commands,e.visibleCommands(t),t=>t.helpGroup()||"Commands:").forEach((t,i)=>{
|
|
514
|
-
const
|
|
515
|
-
;n=n.concat(this.formatItemList(i,
|
|
317
|
+
const r=t.map(t=>s(e.styleSubcommandTerm(e.subcommandTerm(t)),e.styleSubcommandDescription(e.subcommandDescription(t))))
|
|
318
|
+
;n=n.concat(this.formatItemList(i,r,e))}),n.join("\n")}displayWidth(t){return u(t).length}styleTitle(t){return t}
|
|
516
319
|
styleUsage(t){
|
|
517
320
|
return t.split(" ").map(t=>"[options]"===t?this.styleOptionText(t):"[command]"===t?this.styleSubcommandText(t):"["===t[0]||"<"===t[0]?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")
|
|
518
321
|
}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){
|
|
@@ -523,22 +326,22 @@ return t.split(" ").map(t=>"[options]"===t?this.styleOptionText(t):"["===t[0]||"
|
|
|
523
326
|
}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}
|
|
524
327
|
styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,e){
|
|
525
328
|
return Math.max(e.longestOptionTermLength(t,e),e.longestGlobalOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))
|
|
526
|
-
}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,e,i,
|
|
527
|
-
;const n=t.padEnd(e+t.length-
|
|
528
|
-
;if(o<this.minWidthToWrap||
|
|
529
|
-
return
|
|
530
|
-
;const i=t.split(/\r\n|\n/),
|
|
531
|
-
;if(null===i)return void
|
|
532
|
-
const i=this.displayWidth(t);if(o+i<=e)return n.push(t),void(o+=i);
|
|
533
|
-
o=this.displayWidth(
|
|
329
|
+
}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,e,i,r){const s=" ".repeat(2);if(!i)return s+t
|
|
330
|
+
;const n=t.padEnd(e+t.length-r.displayWidth(t)),o=(this.helpWidth??80)-e-2-2;let a
|
|
331
|
+
;if(o<this.minWidthToWrap||r.preformatted(i))a=i;else{a=r.boxWrap(i,o).replace(/\n/g,"\n"+" ".repeat(e+2))}
|
|
332
|
+
return s+n+" ".repeat(2)+a.replace(/\n/g,`\n${s}`)}boxWrap(t,e){if(e<this.minWidthToWrap)return t
|
|
333
|
+
;const i=t.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,s=[];return i.forEach(t=>{const i=t.match(r)
|
|
334
|
+
;if(null===i)return void s.push("");let n=[i.shift()],o=this.displayWidth(n[0]);i.forEach(t=>{
|
|
335
|
+
const i=this.displayWidth(t);if(o+i<=e)return n.push(t),void(o+=i);s.push(n.join(""));const r=t.trimStart();n=[r],
|
|
336
|
+
o=this.displayWidth(r)}),s.push(n.join(""))}),s.join("\n")}}class Ee{constructor(t,e){this.flags=t,
|
|
534
337
|
this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),
|
|
535
338
|
this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;const i=function(t){let e,i
|
|
536
|
-
;const
|
|
537
|
-
;
|
|
339
|
+
;const r=/^-[^-]$/,s=/^--[^-]/,n=t.split(/[ |,]+/).concat("guard");r.test(n[0])&&(e=n.shift())
|
|
340
|
+
;s.test(n[0])&&(i=n.shift());!e&&r.test(n[0])&&(e=n.shift());!e&&s.test(n[0])&&(e=i,i=n.shift())
|
|
538
341
|
;if(n[0].startsWith("-")){const e=n[0],i=`option creation failed due to '${e}' in option flags '${t}'`
|
|
539
342
|
;if(/^-[^-][^-]/.test(e))throw new Error(`${i}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`)
|
|
540
|
-
;if(
|
|
541
|
-
;if(
|
|
343
|
+
;if(r.test(e))throw new Error(`${i}\n- too many short flags`)
|
|
344
|
+
;if(s.test(e))throw new Error(`${i}\n- too many long flags`);throw new Error(`${i}\n- unrecognised flag format`)}
|
|
542
345
|
if(void 0===e&&void 0===i)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,
|
|
543
346
|
longFlag:i}}(t)
|
|
544
347
|
;this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),
|
|
@@ -550,27 +353,27 @@ return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflic
|
|
|
550
353
|
this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){
|
|
551
354
|
return this.hidden=!!t,this}_collectValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?(e.push(t),e):[t]}
|
|
552
355
|
choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{
|
|
553
|
-
if(!this.argChoices.includes(t))throw new
|
|
356
|
+
if(!this.argChoices.includes(t))throw new ye(`Allowed choices are ${this.argChoices.join(", ")}.`)
|
|
554
357
|
;return this.variadic?this._collectValue(t,e):t},this}name(){
|
|
555
358
|
return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){
|
|
556
|
-
return this.negate?
|
|
557
|
-
is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class
|
|
359
|
+
return this.negate?Se(this.name().replace(/^no-/,"")):Se(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}
|
|
360
|
+
is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class Ae{
|
|
558
361
|
constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(t=>{
|
|
559
362
|
t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),
|
|
560
363
|
this.negativeOptions.forEach((t,e)=>{this.positiveOptions.has(e)&&this.dualOptions.add(e)})}valueFromOption(t,e){
|
|
561
364
|
const i=e.attributeName();if(!this.dualOptions.has(i))return!0
|
|
562
|
-
;const
|
|
563
|
-
return t.split("-").reduce((t,e)=>t+e[0].toUpperCase()+e.slice(1))}function
|
|
564
|
-
;e=Array.from(new Set(e));const i=t.startsWith("--");i&&(t=t.slice(2),e=e.map(t=>t.slice(2)));let
|
|
365
|
+
;const r=this.negativeOptions.get(i).presetArg,s=void 0!==r&&r;return e.negate===(s===t)}}function Se(t){
|
|
366
|
+
return t.split("-").reduce((t,e)=>t+e[0].toUpperCase()+e.slice(1))}function $e(t,e){if(!e||0===e.length)return""
|
|
367
|
+
;e=Array.from(new Set(e));const i=t.startsWith("--");i&&(t=t.slice(2),e=e.map(t=>t.slice(2)));let r=[],s=3
|
|
565
368
|
;return e.forEach(e=>{if(e.length<=1)return;const i=function(t,e){
|
|
566
369
|
if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);const i=[];for(let e=0;e<=t.length;e++)i[e]=[e]
|
|
567
|
-
;for(let t=0;t<=e.length;t++)i[0][t]=t;for(let
|
|
568
|
-
;n=t[
|
|
569
|
-
i[
|
|
570
|
-
}return i[t.length][e.length]}(t,e),n=Math.max(t.length,e.length);(n-i)/n>.4&&(i<
|
|
571
|
-
|
|
572
|
-
i&&(
|
|
573
|
-
}class
|
|
370
|
+
;for(let t=0;t<=e.length;t++)i[0][t]=t;for(let r=1;r<=e.length;r++)for(let s=1;s<=t.length;s++){let n
|
|
371
|
+
;n=t[s-1]===e[r-1]?0:1,
|
|
372
|
+
i[s][r]=Math.min(i[s-1][r]+1,i[s][r-1]+1,i[s-1][r-1]+n),s>1&&r>1&&t[s-1]===e[r-2]&&t[s-2]===e[r-1]&&(i[s][r]=Math.min(i[s][r],i[s-2][r-2]+1))
|
|
373
|
+
}return i[t.length][e.length]}(t,e),n=Math.max(t.length,e.length);(n-i)/n>.4&&(i<s?(s=i,r=[e]):i===s&&r.push(e))}),
|
|
374
|
+
r.sort((t,e)=>t.localeCompare(e)),
|
|
375
|
+
i&&(r=r.map(t=>`--${t}`)),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""
|
|
376
|
+
}class Pe extends f{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,
|
|
574
377
|
this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],
|
|
575
378
|
this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,
|
|
576
379
|
this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,
|
|
@@ -578,11 +381,11 @@ this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,th
|
|
|
578
381
|
this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,
|
|
579
382
|
this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,
|
|
580
383
|
this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,
|
|
581
|
-
this._savedState=null,this._outputConfiguration={writeOut:t=>
|
|
582
|
-
outputError:(t,e)=>e(t),getOutHelpWidth:()=>
|
|
583
|
-
getErrHelpWidth:()=>
|
|
584
|
-
getOutHasColors:()=>
|
|
585
|
-
getErrHasColors:()=>
|
|
384
|
+
this._savedState=null,this._outputConfiguration={writeOut:t=>c.stdout.write(t),writeErr:t=>c.stderr.write(t),
|
|
385
|
+
outputError:(t,e)=>e(t),getOutHelpWidth:()=>c.stdout.isTTY?c.stdout.columns:void 0,
|
|
386
|
+
getErrHelpWidth:()=>c.stderr.isTTY?c.stderr.columns:void 0,
|
|
387
|
+
getOutHasColors:()=>Ie()??(c.stdout.isTTY&&c.stdout.hasColors?.()),
|
|
388
|
+
getErrHasColors:()=>Ie()??(c.stderr.isTTY&&c.stderr.hasColors?.()),stripColor:t=>u(t)},this._hidden=!1,
|
|
586
389
|
this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},
|
|
587
390
|
this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){
|
|
588
391
|
return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,
|
|
@@ -591,29 +394,29 @@ this._storeOptionsAsProperties=t._storeOptionsAsProperties,
|
|
|
591
394
|
this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,
|
|
592
395
|
this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,
|
|
593
396
|
this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){const t=[]
|
|
594
|
-
;for(let e=this;e;e=e.parent)t.push(e);return t}command(t,e,i){let
|
|
595
|
-
|
|
596
|
-
a._executableHandler=!0),
|
|
597
|
-
a._executableFile=
|
|
598
|
-
a.copyInheritedSettings(this),
|
|
599
|
-
return Object.assign(new
|
|
397
|
+
;for(let e=this;e;e=e.parent)t.push(e);return t}command(t,e,i){let r=e,s=i;"object"==typeof r&&null!==r&&(s=r,r=null),
|
|
398
|
+
s=s||{};const[,n,o]=t.match(/([^ ]+) *(.*)/),a=this.createCommand(n);return r&&(a.description(r),
|
|
399
|
+
a._executableHandler=!0),s.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!s.noHelp&&!s.hidden),
|
|
400
|
+
a._executableFile=s.executableFile||null,o&&a.arguments(o),this._registerCommand(a),a.parent=this,
|
|
401
|
+
a.copyInheritedSettings(this),r?this:a}createCommand(t){return new Pe(t)}createHelp(){
|
|
402
|
+
return Object.assign(new Te,this.configureHelp())}configureHelp(t){
|
|
600
403
|
return void 0===t?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){
|
|
601
404
|
return void 0===t?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}
|
|
602
405
|
showHelpAfterError(t=!0){return"string"!=typeof t&&(t=!!t),this._showHelpAfterError=t,this}
|
|
603
406
|
showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){
|
|
604
407
|
if(!t._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()")
|
|
605
408
|
;return(e=e||{}).isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),
|
|
606
|
-
this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,e){return new
|
|
607
|
-
argument(t,e,i,
|
|
608
|
-
this.addArgument(
|
|
409
|
+
this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,e){return new we(t,e)}
|
|
410
|
+
argument(t,e,i,r){const s=this.createArgument(t,e);return"function"==typeof i?s.default(r).argParser(i):s.default(i),
|
|
411
|
+
this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(t){
|
|
609
412
|
const e=this.registeredArguments.slice(-1)[0]
|
|
610
413
|
;if(e?.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`)
|
|
611
414
|
;if(t.required&&void 0!==t.defaultValue&&void 0===t.parseArg)throw new Error(`a default value for a required argument is never used: '${t.name()}'`)
|
|
612
415
|
;return this.registeredArguments.push(t),this}helpCommand(t,e){
|
|
613
416
|
if("boolean"==typeof t)return this._addImplicitHelpCommand=t,
|
|
614
417
|
t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this
|
|
615
|
-
;const i=t??"help [command]",[,s
|
|
616
|
-
;return o.helpOption(!1),
|
|
418
|
+
;const i=t??"help [command]",[,r,s]=i.match(/([^ ]+) *(.*)/),n=e??"display help for command",o=this.createCommand(r)
|
|
419
|
+
;return o.helpOption(!1),s&&o.arguments(s),n&&o.description(n),this._addImplicitHelpCommand=!0,this._helpCommand=o,
|
|
617
420
|
(t||e)&&this._initCommandGroup(o),this}addHelpCommand(t,e){return"object"!=typeof t?(this.helpCommand(t,e),
|
|
618
421
|
this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){
|
|
619
422
|
return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),
|
|
@@ -621,33 +424,33 @@ this._helpCommand):null}hook(t,e){const i=["preSubcommand","preAction","postActi
|
|
|
621
424
|
;if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)
|
|
622
425
|
;return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){
|
|
623
426
|
return this._exitCallback=t||(t=>{if("commander.executeSubCommandAsync"!==t.code)throw t}),this}_exit(t,e,i){
|
|
624
|
-
this._exitCallback&&this._exitCallback(new
|
|
625
|
-
const i=this.registeredArguments.length,
|
|
626
|
-
|
|
627
|
-
return t.parseArg(e,i)}catch(t){if("commander.invalidArgument"===t.code){const e=`${
|
|
427
|
+
this._exitCallback&&this._exitCallback(new xe(t,e,i)),c.exit(t)}action(t){return this._actionHandler=e=>{
|
|
428
|
+
const i=this.registeredArguments.length,r=e.slice(0,i);return this._storeOptionsAsProperties?r[i]=this:r[i]=this.opts(),
|
|
429
|
+
r.push(this),t.apply(this,r)},this}createOption(t,e){return new Ee(t,e)}_callParseArg(t,e,i,r){try{
|
|
430
|
+
return t.parseArg(e,i)}catch(t){if("commander.invalidArgument"===t.code){const e=`${r} ${t.message}`;this.error(e,{
|
|
628
431
|
exitCode:t.exitCode,code:t.code})}throw t}}_registerOption(t){
|
|
629
432
|
const e=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(e){
|
|
630
433
|
const i=t.long&&this._findOption(t.long)?t.long:t.short
|
|
631
434
|
;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'\n- already used by option '${e.flags}'`)
|
|
632
435
|
}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){
|
|
633
436
|
const e=t=>[t.name()].concat(t.aliases()),i=e(t).find(t=>this._findCommand(t));if(i){
|
|
634
|
-
const
|
|
635
|
-
;throw new Error(`cannot add command '${
|
|
437
|
+
const r=e(this._findCommand(i)).join("|"),s=e(t).join("|")
|
|
438
|
+
;throw new Error(`cannot add command '${s}' as already have command '${r}'`)}this._initCommandGroup(t),
|
|
636
439
|
this.commands.push(t)}addOption(t){this._registerOption(t);const e=t.name(),i=t.attributeName()
|
|
637
|
-
;void 0!==t.defaultValue&&this.setOptionValueWithSource(i,t.defaultValue,"default");const
|
|
440
|
+
;void 0!==t.defaultValue&&this.setOptionValueWithSource(i,t.defaultValue,"default");const r=(e,r,s)=>{
|
|
638
441
|
null==e&&void 0!==t.presetArg&&(e=t.presetArg);const n=this.getOptionValue(i)
|
|
639
|
-
;null!==e&&t.parseArg?e=this._callParseArg(t,e,n,
|
|
640
|
-
null==e&&(e=!t.negate&&(!(!t.isBoolean()&&!t.optional)||"")),this.setOptionValueWithSource(i,e,
|
|
641
|
-
;return this.on("option:"+e,e=>{const i=`error: option '${t.flags}' argument '${e}' is invalid.`;
|
|
442
|
+
;null!==e&&t.parseArg?e=this._callParseArg(t,e,n,r):null!==e&&t.variadic&&(e=t._collectValue(e,n)),
|
|
443
|
+
null==e&&(e=!t.negate&&(!(!t.isBoolean()&&!t.optional)||"")),this.setOptionValueWithSource(i,e,s)}
|
|
444
|
+
;return this.on("option:"+e,e=>{const i=`error: option '${t.flags}' argument '${e}' is invalid.`;r(e,i,"cli")}),
|
|
642
445
|
t.envVar&&this.on("optionEnv:"+e,e=>{
|
|
643
|
-
const i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;
|
|
644
|
-
_optionEx(t,e,i,s
|
|
645
|
-
if("object"==typeof e&&e instanceof
|
|
446
|
+
const i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;r(e,i,"env")}),this}
|
|
447
|
+
_optionEx(t,e,i,r,s){
|
|
448
|
+
if("object"==typeof e&&e instanceof Ee)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")
|
|
646
449
|
;const n=this.createOption(e,i)
|
|
647
|
-
;if(n.makeOptionMandatory(!!t.mandatory),"function"==typeof
|
|
648
|
-
const t=
|
|
649
|
-
;return this.addOption(n)}option(t,e,i,
|
|
650
|
-
return this._optionEx({mandatory:!0},t,e,i,
|
|
450
|
+
;if(n.makeOptionMandatory(!!t.mandatory),"function"==typeof r)n.default(s).argParser(r);else if(r instanceof RegExp){
|
|
451
|
+
const t=r;r=(e,i)=>{const r=t.exec(e);return r?r[0]:i},n.default(s).argParser(r)}else n.default(r)
|
|
452
|
+
;return this.addOption(n)}option(t,e,i,r){return this._optionEx({},t,e,i,r)}requiredOption(t,e,i,r){
|
|
453
|
+
return this._optionEx({mandatory:!0},t,e,i,r)}combineFlagAndOptionalValue(t=!0){
|
|
651
454
|
return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}
|
|
652
455
|
allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){
|
|
653
456
|
return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,
|
|
@@ -664,10 +467,10 @@ getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceW
|
|
|
664
467
|
;return this._getCommandAndAncestors().forEach(i=>{void 0!==i.getOptionValueSource(t)&&(e=i.getOptionValueSource(t))}),e
|
|
665
468
|
}_prepareUserArgs(t,e){
|
|
666
469
|
if(void 0!==t&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(e=e||{},
|
|
667
|
-
void 0===t&&void 0===e.from){
|
|
470
|
+
void 0===t&&void 0===e.from){c.versions?.electron&&(e.from="electron");const t=c.execArgv??[]
|
|
668
471
|
;(t.includes("-e")||t.includes("--eval")||t.includes("-p")||t.includes("--print"))&&(e.from="eval")}let i
|
|
669
|
-
;switch(void 0===t&&(t=
|
|
670
|
-
;break;case"electron":
|
|
472
|
+
;switch(void 0===t&&(t=c.argv),this.rawArgs=t.slice(),e.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2)
|
|
473
|
+
;break;case"electron":c.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break
|
|
671
474
|
;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}
|
|
672
475
|
return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}
|
|
673
476
|
parse(t,e){this._prepareForParse();const i=this._prepareUserArgs(t,e);return this._parseCommand([],i),this}
|
|
@@ -681,42 +484,42 @@ restoreStateBeforeParse(){
|
|
|
681
484
|
if(this._storeOptionsAsProperties)throw new Error("Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties")
|
|
682
485
|
;this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={
|
|
683
486
|
...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],
|
|
684
|
-
this.processedArgs=[]}_checkForMissingExecutable(t,e,i){if(
|
|
487
|
+
this.processedArgs=[]}_checkForMissingExecutable(t,e,i){if(n.existsSync(t))return
|
|
685
488
|
;throw new Error(`'${t}' does not exist\n - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${e?`searched for local subcommand relative to directory '${e}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory"}`)
|
|
686
|
-
}_executeSubCommand(e,
|
|
687
|
-
;if(
|
|
688
|
-
;return
|
|
689
|
-
;let
|
|
690
|
-
t=
|
|
691
|
-
;if(!t&&!e._executableFile&&this._scriptPath){const
|
|
692
|
-
;
|
|
693
|
-
;if("win32"!==
|
|
694
|
-
})):
|
|
695
|
-
|
|
696
|
-
["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(t=>{
|
|
697
|
-
})}const
|
|
698
|
-
t=t??1,
|
|
699
|
-
if("ENOENT"===t.code)this._checkForMissingExecutable(
|
|
700
|
-
;if(
|
|
701
|
-
this.runningCommand=
|
|
702
|
-
|
|
703
|
-
if(!
|
|
489
|
+
}_executeSubCommand(e,r){r=r.slice();const s=[".js",".ts",".tsx",".mjs",".cjs"];function o(t,e){const r=i.resolve(t,e)
|
|
490
|
+
;if(n.existsSync(r))return r;if(s.includes(i.extname(e)))return;const o=s.find(t=>n.existsSync(`${r}${t}`))
|
|
491
|
+
;return o?`${r}${o}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions()
|
|
492
|
+
;let a=e._executableFile||`${this._name}-${e._name}`,l=this._executableDir||"";if(this._scriptPath){let t;try{
|
|
493
|
+
t=n.realpathSync(this._scriptPath)}catch{t=this._scriptPath}l=i.resolve(i.dirname(t),l)}if(l){let t=o(l,a)
|
|
494
|
+
;if(!t&&!e._executableFile&&this._scriptPath){const r=i.basename(this._scriptPath,i.extname(this._scriptPath))
|
|
495
|
+
;r!==this._name&&(t=o(l,`${r}-${e._name}`))}a=t||a}const h=s.includes(i.extname(a));let u
|
|
496
|
+
;if("win32"!==c.platform?h?(r.unshift(a),r=ke(c.execArgv).concat(r),u=t.spawn(c.argv[0],r,{stdio:"inherit"
|
|
497
|
+
})):u=t.spawn(a,r,{stdio:"inherit"}):(this._checkForMissingExecutable(a,l,e._name),r.unshift(a),
|
|
498
|
+
r=ke(c.execArgv).concat(r),u=t.spawn(c.execPath,r,{stdio:"inherit"})),!u.killed){
|
|
499
|
+
["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(t=>{c.on(t,()=>{!1===u.killed&&null===u.exitCode&&u.kill(t)})
|
|
500
|
+
})}const m=this._exitCallback;u.on("close",t=>{
|
|
501
|
+
t=t??1,m?m(new xe(t,"commander.executeSubCommandAsync","(close)")):c.exit(t)}),u.on("error",t=>{
|
|
502
|
+
if("ENOENT"===t.code)this._checkForMissingExecutable(a,l,e._name);else if("EACCES"===t.code)throw new Error(`'${a}' not executable`)
|
|
503
|
+
;if(m){const e=new xe(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,m(e)}else c.exit(1)}),
|
|
504
|
+
this.runningCommand=u}_dispatchSubcommand(t,e,i){const r=this._findCommand(t);let s;return r||this.help({error:!0}),
|
|
505
|
+
r._prepareForParse(),s=this._chainOrCallSubCommandHook(s,r,"preSubcommand"),s=this._chainOrCall(s,()=>{
|
|
506
|
+
if(!r._executableHandler)return r._parseCommand(e,i);this._executeSubCommand(r,e.concat(i))}),s}_dispatchHelpCommand(t){
|
|
704
507
|
t||this.help();const e=this._findCommand(t);return e&&!e._executableHandler&&e.help(),
|
|
705
508
|
this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}
|
|
706
509
|
_checkNumberOfArguments(){this.registeredArguments.forEach((t,e)=>{
|
|
707
510
|
t.required&&null==this.args[e]&&this.missingArgument(t.name())
|
|
708
511
|
}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)
|
|
709
|
-
}_processArguments(){const t=(t,e,i)=>{let
|
|
710
|
-
const
|
|
711
|
-
return
|
|
712
|
-
;i.variadic?
|
|
713
|
-
i.parseArg&&(
|
|
714
|
-
i.parseArg&&(
|
|
715
|
-
return t?.then&&"function"==typeof t.then?t.then(()=>e()):e()}_chainOrCallHooks(t,e){let i=t;const
|
|
512
|
+
}_processArguments(){const t=(t,e,i)=>{let r=e;if(null!==e&&t.parseArg){
|
|
513
|
+
const s=`error: command-argument value '${e}' is invalid for argument '${t.name()}'.`;r=this._callParseArg(t,e,i,s)}
|
|
514
|
+
return r};this._checkNumberOfArguments();const e=[];this.registeredArguments.forEach((i,r)=>{let s=i.defaultValue
|
|
515
|
+
;i.variadic?r<this.args.length?(s=this.args.slice(r),
|
|
516
|
+
i.parseArg&&(s=s.reduce((e,r)=>t(i,r,e),i.defaultValue))):void 0===s&&(s=[]):r<this.args.length&&(s=this.args[r],
|
|
517
|
+
i.parseArg&&(s=t(i,s,i.defaultValue))),e[r]=s}),this.processedArgs=e}_chainOrCall(t,e){
|
|
518
|
+
return t?.then&&"function"==typeof t.then?t.then(()=>e()):e()}_chainOrCallHooks(t,e){let i=t;const r=[]
|
|
716
519
|
;return this._getCommandAndAncestors().reverse().filter(t=>void 0!==t._lifeCycleHooks[e]).forEach(t=>{
|
|
717
|
-
t._lifeCycleHooks[e].forEach(e=>{
|
|
718
|
-
i=this._chainOrCall(i,()=>t.callback(t.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,e,i){let
|
|
719
|
-
;return void 0!==this._lifeCycleHooks[i]&&this._lifeCycleHooks[i].forEach(t=>{
|
|
520
|
+
t._lifeCycleHooks[e].forEach(e=>{r.push({hookedCommand:t,callback:e})})}),"postAction"===e&&r.reverse(),r.forEach(t=>{
|
|
521
|
+
i=this._chainOrCall(i,()=>t.callback(t.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,e,i){let r=t
|
|
522
|
+
;return void 0!==this._lifeCycleHooks[i]&&this._lifeCycleHooks[i].forEach(t=>{r=this._chainOrCall(r,()=>t(this,e))}),r}
|
|
720
523
|
_parseCommand(t,e){const i=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),
|
|
721
524
|
t=t.concat(i.operands),
|
|
722
525
|
e=i.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e)
|
|
@@ -725,14 +528,14 @@ e=i.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispat
|
|
|
725
528
|
this._dispatchSubcommand(this._defaultCommandName,t,e)
|
|
726
529
|
;!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),
|
|
727
530
|
this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions()
|
|
728
|
-
;const
|
|
729
|
-
let i;return
|
|
531
|
+
;const r=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){
|
|
532
|
+
let i;return r(),this._processArguments(),i=this._chainOrCallHooks(i,"preAction"),
|
|
730
533
|
i=this._chainOrCall(i,()=>this._actionHandler(this.processedArgs)),this.parent&&(i=this._chainOrCall(i,()=>{
|
|
731
|
-
this.parent.emit(
|
|
732
|
-
this._processArguments(),this.parent.emit(
|
|
534
|
+
this.parent.emit(s,t,e)})),i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent?.listenerCount(s))r(),
|
|
535
|
+
this._processArguments(),this.parent.emit(s,t,e);else if(t.length){
|
|
733
536
|
if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e)
|
|
734
|
-
;this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(
|
|
735
|
-
this._processArguments())}else this.commands.length?(
|
|
537
|
+
;this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(r(),
|
|
538
|
+
this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}
|
|
736
539
|
_findCommand(t){if(t)return this.commands.find(e=>e._name===t||e._aliases.includes(t))}_findOption(t){
|
|
737
540
|
return this.options.find(e=>e.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{
|
|
738
541
|
t.options.forEach(e=>{e.mandatory&&void 0===t.getOptionValue(e.attributeName())&&t.missingMandatoryOptionValue(e)})})}
|
|
@@ -740,33 +543,33 @@ _checkForConflictingLocalOptions(){const t=this.options.filter(t=>{const e=t.att
|
|
|
740
543
|
;return void 0!==this.getOptionValue(e)&&"default"!==this.getOptionValueSource(e)})
|
|
741
544
|
;t.filter(t=>t.conflictsWith.length>0).forEach(e=>{const i=t.find(t=>e.conflictsWith.includes(t.attributeName()))
|
|
742
545
|
;i&&this._conflictingOption(e,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{
|
|
743
|
-
t._checkForConflictingLocalOptions()})}parseOptions(t){const e=[],i=[];let
|
|
546
|
+
t._checkForConflictingLocalOptions()})}parseOptions(t){const e=[],i=[];let r=e;function s(t){
|
|
744
547
|
return t.length>1&&"-"===t[0]}
|
|
745
548
|
const n=t=>!!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(t)&&!this._getCommandAndAncestors().some(t=>t.options.map(t=>t.short).some(t=>/^-\d$/.test(t)))
|
|
746
|
-
;let o=null,a=null,l=0;for(;l<t.length||a;){const h=a??t[l++];if(a=null,"--"===h){
|
|
747
|
-
;break}if(!o||
|
|
549
|
+
;let o=null,a=null,l=0;for(;l<t.length||a;){const h=a??t[l++];if(a=null,"--"===h){r===i&&r.push(h),r.push(...t.slice(l))
|
|
550
|
+
;break}if(!o||s(h)&&!n(h)){if(o=null,s(h)){const e=this._findOption(h);if(e){if(e.required){const i=t[l++]
|
|
748
551
|
;void 0===i&&this.optionMissingArgument(e),this.emit(`option:${e.name()}`,i)}else if(e.optional){let i=null
|
|
749
|
-
;l<t.length&&(!
|
|
552
|
+
;l<t.length&&(!s(t[l])||n(t[l]))&&(i=t[l++]),this.emit(`option:${e.name()}`,i)}else this.emit(`option:${e.name()}`)
|
|
750
553
|
;o=e.variadic?e:null;continue}}if(h.length>2&&"-"===h[0]&&"-"!==h[1]){const t=this._findOption(`-${h[1]}`);if(t){
|
|
751
554
|
t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,h.slice(2)):(this.emit(`option:${t.name()}`),
|
|
752
555
|
a=`-${h.slice(2)}`);continue}}if(/^--[^=]+=/.test(h)){const t=h.indexOf("="),e=this._findOption(h.slice(0,t))
|
|
753
556
|
;if(e&&(e.required||e.optional)){this.emit(`option:${e.name()}`,h.slice(t+1));continue}}
|
|
754
|
-
if(
|
|
557
|
+
if(r!==e||!s(h)||0===this.commands.length&&n(h)||(r=i),
|
|
755
558
|
(this._enablePositionalOptions||this._passThroughOptions)&&0===e.length&&0===i.length){if(this._findCommand(h)){
|
|
756
559
|
e.push(h),i.push(...t.slice(l));break}if(this._getHelpCommand()&&h===this._getHelpCommand().name()){
|
|
757
560
|
e.push(h,...t.slice(l));break}if(this._defaultCommandName){i.push(h,...t.slice(l));break}}if(this._passThroughOptions){
|
|
758
|
-
|
|
561
|
+
r.push(h,...t.slice(l));break}r.push(h)}else this.emit(`option:${o.name()}`,h)}return{operands:e,unknown:i}}opts(){
|
|
759
562
|
if(this._storeOptionsAsProperties){const t={},e=this.options.length;for(let i=0;i<e;i++){
|
|
760
563
|
const e=this.options[i].attributeName();t[e]=e===this._versionOptionName?this._version:this[e]}return t}
|
|
761
564
|
return this._optionValues}optsWithGlobals(){
|
|
762
565
|
return this._getCommandAndAncestors().reduce((t,e)=>Object.assign(t,e.opts()),{})}error(t,e){
|
|
763
566
|
this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr),
|
|
764
567
|
"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),
|
|
765
|
-
this.outputHelp({error:!0}));const i=e||{},
|
|
766
|
-
_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in
|
|
767
|
-
;(void 0===this.getOptionValue(e)||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,
|
|
568
|
+
this.outputHelp({error:!0}));const i=e||{},r=i.exitCode||1,s=i.code||"commander.error";this._exit(r,s,t)}
|
|
569
|
+
_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in c.env){const e=t.attributeName()
|
|
570
|
+
;(void 0===this.getOptionValue(e)||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,c.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))
|
|
768
571
|
}})}_parseOptionsImplied(){
|
|
769
|
-
const t=new
|
|
572
|
+
const t=new Ae(this.options),e=t=>void 0!==this.getOptionValue(t)&&!["default","implied"].includes(this.getOptionValueSource(t))
|
|
770
573
|
;this.options.filter(i=>void 0!==i.implied&&e(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(t=>{
|
|
771
574
|
Object.keys(t.implied).filter(t=>!e(t)).forEach(e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")})})}
|
|
772
575
|
missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}
|
|
@@ -774,22 +577,22 @@ optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;t
|
|
|
774
577
|
code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){
|
|
775
578
|
const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})
|
|
776
579
|
}_conflictingOption(t,e){const i=t=>{
|
|
777
|
-
const e=t.attributeName(),i=this.getOptionValue(e),
|
|
778
|
-
;return
|
|
779
|
-
const e=i(t),
|
|
780
|
-
;return"env"===this.getOptionValueSource(
|
|
781
|
-
},
|
|
782
|
-
if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],
|
|
783
|
-
const t=
|
|
784
|
-
}while(
|
|
580
|
+
const e=t.attributeName(),i=this.getOptionValue(e),r=this.options.find(t=>t.negate&&e===t.attributeName()),s=this.options.find(t=>!t.negate&&e===t.attributeName())
|
|
581
|
+
;return r&&(void 0===r.presetArg&&!1===i||void 0!==r.presetArg&&i===r.presetArg)?r:s||t},r=t=>{
|
|
582
|
+
const e=i(t),r=e.attributeName()
|
|
583
|
+
;return"env"===this.getOptionValueSource(r)?`environment variable '${e.envVar}'`:`option '${e.flags}'`
|
|
584
|
+
},s=`error: ${r(t)} cannot be used with ${r(e)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){
|
|
585
|
+
if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],r=this;do{
|
|
586
|
+
const t=r.createHelp().visibleOptions(r).filter(t=>t.long).map(t=>t.long);i=i.concat(t),r=r.parent
|
|
587
|
+
}while(r&&!r._enablePositionalOptions);e=$e(t,i)}const i=`error: unknown option '${t}'${e}`;this.error(i,{
|
|
785
588
|
code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return
|
|
786
|
-
;const e=this.registeredArguments.length,i=1===e?"":"s",
|
|
787
|
-
;this.error(
|
|
589
|
+
;const e=this.registeredArguments.length,i=1===e?"":"s",r=t.length,s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${i} but got ${r}: ${t.join(", ")}.`
|
|
590
|
+
;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e=""
|
|
788
591
|
;if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach(t=>{i.push(t.name()),
|
|
789
|
-
t.alias()&&i.push(t.alias())}),e
|
|
592
|
+
t.alias()&&i.push(t.alias())}),e=$e(t,i)}const i=`error: unknown command '${t}'${e}`;this.error(i,{
|
|
790
593
|
code:"commander.unknownCommand"})}version(t,e,i){if(void 0===t)return this._version;this._version=t,
|
|
791
|
-
e=e||"-V, --version",i=i||"output the version number";const
|
|
792
|
-
;return this._versionOptionName=
|
|
594
|
+
e=e||"-V, --version",i=i||"output the version number";const r=this.createOption(e,i)
|
|
595
|
+
;return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{
|
|
793
596
|
this._outputConfiguration.writeOut(`${t}\n`),this._exit(0,"commander.version",t)}),this}description(t,e){
|
|
794
597
|
return void 0===t&&void 0===e?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){
|
|
795
598
|
return void 0===t?this._summary:(this._summary=t,this)}alias(t){if(void 0===t)return this._aliases[0];let e=this
|
|
@@ -798,7 +601,7 @@ t===e._name)throw new Error("Command alias can't be the same as its name");const
|
|
|
798
601
|
const e=[i.name()].concat(i.aliases()).join("|")
|
|
799
602
|
;throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${e}'`)}
|
|
800
603
|
return e._aliases.push(t),this}aliases(t){return void 0===t?this._aliases:(t.forEach(t=>this.alias(t)),this)}usage(t){
|
|
801
|
-
if(void 0===t){if(this._usage)return this._usage;const t=this.registeredArguments.map(t=>
|
|
604
|
+
if(void 0===t){if(this._usage)return this._usage;const t=this.registeredArguments.map(t=>Ce(t))
|
|
802
605
|
;return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")
|
|
803
606
|
}return this._usage=t,this}name(t){return void 0===t?this._name:(this._name=t,this)}helpGroup(t){
|
|
804
607
|
return void 0===t?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){
|
|
@@ -809,98 +612,106 @@ this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup
|
|
|
809
612
|
return this._name=i.basename(t,i.extname(t)),this}executableDir(t){
|
|
810
613
|
return void 0===t?this._executableDir:(this._executableDir=t,this)}helpInformation(t){
|
|
811
614
|
const e=this.createHelp(),i=this._getOutputContext(t);e.prepareContext({error:i.error,helpWidth:i.helpWidth,
|
|
812
|
-
outputHasColors:i.hasColors});const
|
|
813
|
-
_getOutputContext(t){const e=!!(t=t||{}).error;let i,s
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
write:t=>(
|
|
818
|
-
;"function"==typeof t&&(e=t,t=void 0);const i=this._getOutputContext(t),
|
|
819
|
-
;this._getCommandAndAncestors().reverse().forEach(t=>t.emit("beforeAllHelp",
|
|
820
|
-
;let
|
|
821
|
-
;if(e&&(
|
|
822
|
-
;i.write(
|
|
823
|
-
this._getCommandAndAncestors().forEach(t=>t.emit("afterAllHelp",
|
|
615
|
+
outputHasColors:i.hasColors});const r=e.formatHelp(this,e);return i.hasColors?r:this._outputConfiguration.stripColor(r)}
|
|
616
|
+
_getOutputContext(t){const e=!!(t=t||{}).error;let i,r,s;e?(i=t=>this._outputConfiguration.writeErr(t),
|
|
617
|
+
r=this._outputConfiguration.getErrHasColors(),
|
|
618
|
+
s=this._outputConfiguration.getErrHelpWidth()):(i=t=>this._outputConfiguration.writeOut(t),
|
|
619
|
+
r=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth());return{error:e,
|
|
620
|
+
write:t=>(r||(t=this._outputConfiguration.stripColor(t)),i(t)),hasColors:r,helpWidth:s}}outputHelp(t){let e
|
|
621
|
+
;"function"==typeof t&&(e=t,t=void 0);const i=this._getOutputContext(t),r={error:i.error,write:i.write,command:this}
|
|
622
|
+
;this._getCommandAndAncestors().reverse().forEach(t=>t.emit("beforeAllHelp",r)),this.emit("beforeHelp",r)
|
|
623
|
+
;let s=this.helpInformation({error:i.error})
|
|
624
|
+
;if(e&&(s=e(s),"string"!=typeof s&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer")
|
|
625
|
+
;i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),
|
|
626
|
+
this._getCommandAndAncestors().forEach(t=>t.emit("afterAllHelp",r))}helpOption(t,e){
|
|
824
627
|
return"boolean"==typeof t?(t?(null===this._helpOption&&(this._helpOption=void 0),
|
|
825
628
|
this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,
|
|
826
629
|
this):(this._helpOption=this.createOption(t??"-h, --help",e??"display help for command"),
|
|
827
630
|
(t||e)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){
|
|
828
631
|
return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){
|
|
829
|
-
return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let e=Number(
|
|
632
|
+
return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let e=Number(c.exitCode??0)
|
|
830
633
|
;0===e&&t&&"function"!=typeof t&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){
|
|
831
634
|
const i=["beforeAll","before","after","afterAll"]
|
|
832
635
|
;if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)
|
|
833
|
-
;const
|
|
636
|
+
;const r=`${t}Help`;return this.on(r,t=>{let i;i="function"==typeof e?e({error:t.error,command:t.command}):e,
|
|
834
637
|
i&&t.write(`${i}\n`)}),this}_outputHelpIfRequested(t){const e=this._getHelpOption()
|
|
835
|
-
;e&&t.find(t=>e.is(t))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function
|
|
836
|
-
return t.map(t=>{if(!t.startsWith("--inspect"))return t;let e,i,
|
|
638
|
+
;e&&t.find(t=>e.is(t))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function ke(t){
|
|
639
|
+
return t.map(t=>{if(!t.startsWith("--inspect"))return t;let e,i,r="127.0.0.1",s="9229"
|
|
837
640
|
;return null!==(i=t.match(/^(--inspect(-brk)?)$/))?e=i[1]:null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(e=i[1],
|
|
838
|
-
/^\d+$/.test(i[3])?
|
|
839
|
-
|
|
840
|
-
return!
|
|
841
|
-
}new
|
|
842
|
-
function
|
|
641
|
+
/^\d+$/.test(i[3])?s=i[3]:r=i[3]):null!==(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(e=i[1],r=i[3],
|
|
642
|
+
s=i[4]),e&&"0"!==s?`${e}=${r}:${parseInt(s)+1}`:t})}function Ie(){
|
|
643
|
+
return!c.env.NO_COLOR&&"0"!==c.env.FORCE_COLOR&&"false"!==c.env.FORCE_COLOR&&(!(!c.env.FORCE_COLOR&&void 0===c.env.CLICOLOR_FORCE)||void 0)
|
|
644
|
+
}new Pe;const Re=process.cwd();async function He(t){return await _(t,{recursive:!0,force:!0})}function Me(){
|
|
645
|
+
return o(r(Re,"package.json"))&&o(r(Re,"node_modules"))}function Ve(t){
|
|
843
646
|
return`\n import mahameru from "mahameru";\n\n mahameru(${JSON.stringify(t)}).then(app =>\n app.initialize().then(() => {\n console.log("\\x1b[32m Mahameru Server Ready! 🚀\\x1b[0m");\n console.log(" \\x1b[1mMode:\\x1b[22m \\x1b[36m${t.dev?"Development":"Production"}\\x1b[0m");\n console.log(" \\x1b[1mLocal:\\x1b[22m \\x1b[36mhttp://${t.host}:${t.port}\\x1b[0m");\n console.log(" \\x1b[1mHost:\\x1b[22m ${t.host}");\n console.log(" \\x1b[1mPort:\\x1b[22m ${t.port}\\n");\n console.log("\\x1b[90mPress Ctrl+C to stop server\\x1b[0m\\n");\n }).catch(error => {\n console.error(error);\n process.exitCode = 1;\n })\n ).catch(error => {\n console.error(error);\n process.exitCode = 1;\n });\n `
|
|
844
|
-
}function
|
|
845
|
-
const e=parseInt(t,10);if(!isNaN(e))return e}function
|
|
846
|
-
const o=e(process.execPath,[t,...i],{stdio:"inherit",cwd:
|
|
847
|
-
return new Promise(e=>{t&&null===t.exitCode&&!t.killed?(t.once("close",()=>e()),t.kill("SIGTERM")):e()})}(
|
|
848
|
-
const t=new
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
const t=
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
console.error(
|
|
857
|
-
|
|
858
|
-
;
|
|
859
|
-
console.error(
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
console.
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
;
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
}(t.
|
|
647
|
+
}function je(t){console.log(`${Oe().bold(Oe().cyan("▲ Mahameru"))} ${Oe().dim(`CLI v${t}`)}\n`)}function Ge(t){
|
|
648
|
+
const e=parseInt(t,10);if(!isNaN(e))return e}function We(t,i,r){return new Promise((s,n)=>{
|
|
649
|
+
const o=e(process.execPath,[t,...i],{stdio:"inherit",cwd:r});o.on("close",t=>s(t??1)),o.on("error",n)})}function Be(t){
|
|
650
|
+
return new Promise(e=>{t&&null===t.exitCode&&!t.killed?(t.once("close",()=>e()),t.kill("SIGTERM")):e()})}function Fe(){
|
|
651
|
+
const t=new Map,e=r(Re,"mahameru.config.ts"),i=r(Re,"global.d.ts");o(e)&&t.set(e,Ne(e)),o(i)&&t.set(i,Ne(i))
|
|
652
|
+
;const s=r(Re,"src");if(!o(s))return t;const n=[s];for(;n.length>0;){const e=n.pop();for(const i of l(e)){
|
|
653
|
+
if(i.startsWith("."))continue;const s=r(e,i),o=h(s);o.isDirectory()?n.push(s):t.set(s,`${o.mtimeMs}:${o.size}`)}}
|
|
654
|
+
return t}function Ne(t){const e=h(t);return`${e.mtimeMs}:${e.size}`}function De(t){return s(Re,t)||t}(async()=>{
|
|
655
|
+
const t=new Pe,{rE:i}=x;try{
|
|
656
|
+
t.name("mahameru").description(`${Oe().bold(Oe().cyan("▲ Mahameru"))} ${Oe().dim(`CLI v${i}`)}`).version(i,"-v, --version","Display help for command"),
|
|
657
|
+
t.command("dev").option("-p, --port <number>","Port to run the server on",Ge).option("-h, --host <string>","Host to run the server on").action(async({host:t,port:s})=>{
|
|
658
|
+
Me()||(console.error(Oe().red(" Current directory is not a Node.js project.")),process.exit(1));const n=function(){
|
|
659
|
+
const t="mahameru.config.ts",e=r(Re,t);o(e)||(console.error(Oe().red(`❌ Error: Config file '${t}' is not found.`)),
|
|
660
|
+
console.error(Oe().yellow("Please create project by running: npm create mahameru")),process.exit(1))
|
|
661
|
+
;const i=r(Re,"node_modules","tsx","dist","cli.mjs")
|
|
662
|
+
;o(i)||(console.error(Oe().red("❌ Error: Runner 'tsx' is not installed.")),
|
|
663
|
+
console.error(Oe().yellow("Please install it by running: npm install -D tsx")),process.exit(1))
|
|
664
|
+
;const s=r(Re,"node_modules","tsx","dist","esm","api")
|
|
665
|
+
;o(s)||(console.error(Oe().red("❌ Error: Runner 'tsx' API is not installed.")),
|
|
666
|
+
console.error(Oe().yellow("Please install it by running: npm install -D tsx")),process.exit(1));return{configFileName:t,
|
|
667
|
+
configFilePath:e,tsxJsPath:i}}();console.clear(),je(i),await async function({environment:t,host:i,port:s}){
|
|
668
|
+
let n=null,o=null,a=null,l=!1,h=!1,c=!1,u=0,m=Fe();const p=async o=>{if(!h){l=!0,o&&(console.clear(),
|
|
669
|
+
console.log(Oe().yellow(`\nFile changed (${o.replaceAll("\\","/")}), restarting dev server...\n`))),await Be(n),n=null
|
|
670
|
+
;try{n=await async function({environment:t,host:i,port:s}){const n=await async function(t,{host:e,port:i}){
|
|
671
|
+
const s=await import("tsx/esm/api").catch(()=>{console.error(Oe().red("❌ Error: Runner 'tsx' api is not installed.")),
|
|
672
|
+
console.error(Oe().yellow("Please install it by running: npm install -D tsx")),process.exit(1)
|
|
673
|
+
}),n=d(t.configFilePath).href;let o=(await s.tsImport(n,"file:///F:/Projects/@mahameru/cli/src/index.ts")).default
|
|
674
|
+
;return o={...o,dev:!0,appPath:r(Re,"src"),port:void 0!==i?i:void 0!==o.port?o.port:3e3,
|
|
675
|
+
host:void 0!==e?e:void 0!==o.host?o.host:"localhost",modulesPath:r(Re,"src","modules"),routesPath:r(Re,"src","routes")},
|
|
676
|
+
o}(t,{host:i,port:s}),o=Ve(n);return function(t,i,r,s){return e(process.execPath,[t,...i],{stdio:"inherit",cwd:r,env:s})
|
|
677
|
+
}(t.tsxJsPath,["-e",o],Re,{...process.env,NODE_ENV:"development"})}({environment:t,host:i,port:s}),u+=1,
|
|
871
678
|
n.once("exit",(t,e)=>{
|
|
872
|
-
h||l||(e?console.error(
|
|
873
|
-
})}catch(t){console.error(
|
|
874
|
-
0===
|
|
875
|
-
h||(
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
console.log(
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
;
|
|
885
|
-
;
|
|
886
|
-
;
|
|
887
|
-
;
|
|
888
|
-
|
|
889
|
-
;
|
|
890
|
-
;
|
|
891
|
-
|
|
892
|
-
;
|
|
893
|
-
|
|
894
|
-
;(
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
;
|
|
898
|
-
t.fail(
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
679
|
+
h||l||(e?console.error(Oe().red(`Mahameru dev server stopped by signal ${e}.`)):"number"==typeof t&&0!==t&&console.error(Oe().red(`Mahameru dev server exited with code ${t}. Watching for changes...`)))
|
|
680
|
+
})}catch(t){console.error(Oe().red("Failed to start dev server. Watching for changes...")),console.error(t),
|
|
681
|
+
0===u&&console.log(Oe().dim("Fix the error above and save a file to try again.\n"))}finally{l=!1}}},f=t=>{
|
|
682
|
+
h||(o&&clearTimeout(o),o=setTimeout(()=>{p(t)},200))},g=()=>{if(!h&&!c){c=!0;try{const t=Fe(),e=function(t,e){
|
|
683
|
+
for(const[i,r]of e){if(!t.has(i))return De(i);if(t.get(i)!==r)return De(i)}
|
|
684
|
+
for(const i of t.keys())if(!e.has(i))return De(i);return null}(m,t);m=t,e&&f(e)}finally{c=!1}}},_=async(t=0)=>{h||(h=!0,
|
|
685
|
+
o&&clearTimeout(o),a&&clearInterval(a),await Be(n),process.exit(t))};process.once("SIGINT",()=>{_(0)}),
|
|
686
|
+
process.once("SIGTERM",()=>{_(0)
|
|
687
|
+
}),a=setInterval(g,300),console.log(Oe().dim("Watching src/** and mahameru.config.ts for changes...\n")),await p(),
|
|
688
|
+
await new Promise(()=>{})}({environment:n,host:t,port:s})
|
|
689
|
+
}),t.command("build").description("Build Mahameru production application.").action(async()=>{
|
|
690
|
+
console.log(`${Oe().bold(Oe().cyan("▲ Mahameru"))} ${Oe().dim(`CLI v${i}`)}\n`)
|
|
691
|
+
;const t=ve(Oe().cyan(" Checking environment...")).start()
|
|
692
|
+
;Me()||(t.fail(Oe().red(" Current directory is not a Node.js project.")),process.exit(1))
|
|
693
|
+
;const e=r(Re,"node_modules","typescript","bin","tsc")
|
|
694
|
+
;o(e)||(t.fail(Oe().red(" TypeScript compiler (tsc) is not installed in this project.")),process.exit(1))
|
|
695
|
+
;const s=r(Re,"node_modules","tsc-alias","dist","bin","index.js");o(s)||(t.fail(Oe().red(" tsc-alias not installed.")),
|
|
696
|
+
process.exit(1));try{t.text=Oe().cyan(" Starting build...");const i=r(Re,".mahameru"),n=r(Re,"dist");o(n)&&await He(n),
|
|
697
|
+
o(i)&&await He(i);const c=await We(e,["--project","tsconfig.json"],Re);0!==c&&(t.fail(Oe().red(" Build failed!")),
|
|
698
|
+
await He(r(Re,".mahameru")),process.exit(c))
|
|
699
|
+
;0!==await We(e,["--project","config.tsconfig.json"],Re)&&(t.fail(Oe().red(" Build failed!")),
|
|
700
|
+
await He(r(Re,".mahameru")),process.exit(c));const u=await We(s,["-p","tsconfig.json"],Re)
|
|
701
|
+
;0!==u&&(t.fail(Oe().red(" tsc-alias failed.")),await He(r(Re,".mahameru")),process.exit(u));const m=function(t){
|
|
702
|
+
if(!o(t))return[];const e=[t],i=new Set;for(;e.length>0;){const t=e.pop();for(const s of l(t)){const n=r(t,s)
|
|
703
|
+
;if(h(n).isDirectory()){e.push(n);continue}if(!n.endsWith(".js"))continue;const o=a(n,"utf8")
|
|
704
|
+
;(o.includes("'@/")||o.includes('"@/')||o.includes("'#/")||o.includes('"#/'))&&i.add(n)}}return[...i]
|
|
705
|
+
}(r(Re,".mahameru"));if(m.length>0){t.fail(Oe().red(" Build produced unresolved path aliases.")),
|
|
706
|
+
console.error(Oe().yellow("Please use tsconfig path aliases such as @/* and avoid package.json imports for app source files."))
|
|
707
|
+
;for(const t of m)console.error(Oe().red(` - ${t}`));process.exit(1)}await g(r(Re,"dist"),r(Re,".mahameru")),
|
|
708
|
+
t.succeed(Oe().green(" Build success."))}catch(e){t.fail(Oe().red(" Terjadi kesalahan internal.")),console.error(e),
|
|
709
|
+
process.exit(1)}
|
|
710
|
+
}),t.command("start").description("Start Mahameru production server.").option("-p, --port <number>","Port to run the server on",Ge).option("-h, --host <string>","Host to run the server on").action(async({host:t,port:s})=>{
|
|
711
|
+
const n=r(Re,".mahameru","mahameru.config.js"),o=d(n).href;let a=(await import(o).catch(()=>{
|
|
712
|
+
console.error(Oe().red("❌ Error: mahameru.config.js is not found.")),process.exit(1)})).default;a={...a,
|
|
713
|
+
appPath:r(Re,".mahameru"),port:void 0!==s?s:void 0!==a.port?a.port:3e3,
|
|
714
|
+
host:void 0!==t?t:void 0!==a.host?a.host:"localhost",modulesPath:r(Re,".mahameru","modules"),
|
|
715
|
+
routesPath:r(Re,".mahameru","routes")};const l=Ve(a);je(i),e(process.execPath,["-e",l],{stdio:"inherit",cwd:Re,env:{
|
|
716
|
+
...process.env,NODE_ENV:"production"}}).on("exit",t=>{0!==t&&process.exit(t)}).on("error",t=>{console.error(t)
|
|
717
|
+
}).on("message",t=>{console.log(t)})}),await t.parseAsync(process.argv)}catch(t){console.error(t),process.exit(1)}})();
|