create-bubbles 0.0.21 → 0.0.23
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/LICENSE +21 -0
- package/dist/index.js +17 -0
- package/index.js +1 -1
- package/package.json +23 -16
- package/dist/index.mjs +0 -111
- package/template-react-rsbuild/.gitignore +0 -7
- package/template-react-rsbuild/.npmrc +0 -1
- package/template-vue-rolldown-oxlint/.gitignore +0 -24
- package/template-vue-rolldown-oxlint/.npmrc +0 -5
- package/template-vue-rsbuild/.gitignore +0 -10
- package/template-vue-rsbuild/.npmrc +0 -1
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/.env +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/.env.development +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/.env.production +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/.prettierignore +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/.prettierrc +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/.vscode/settings.json +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/README.md +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/biome.json +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/commitlint.config.js +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/index.html +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/lefthook.yml +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/package.json +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/public/.gitkeep +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/rsbuild.config.ts +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/App.tsx +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/assets/font/AlimamaShuHeiTi-Bold.ttf +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/assets/icon/logo.svg +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/components/Loading/PageLoading.tsx +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/env.d.ts +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/index.tsx +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/layout/default/index.tsx +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/pages/home/index.tsx +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/router/index.tsx +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/store/index.ts +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/store/modules/user.ts +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/styles/fonts.scss +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/styles/index.scss +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/styles/variables.scss +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/types/auto-import.d.ts +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/utils/env.ts +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/utils/request/axios.ts +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/src/utils/request/index.ts +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/tsconfig.json +0 -0
- /package/{template-react-rsbuild → template-react-rsbuild-biome}/uno.config.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/.env +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/.gitlab-ci.yml +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/.oxlintrc.json +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/.prettierrc +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/README.md +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/commitlint.config.js +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/components.d.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/index.html +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/lefthook.yml +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/package.json +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/postcss.config.js +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/public/vite.svg +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/App.vue +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/assets/icon/vue.svg +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/components/Icon/svg-icon.vue +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/layout/default/index.vue +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/main.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/router/guard/index.tsx +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/router/guard/permissionGuard.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/router/index.tsx +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/router/modules/index.tsx +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/store/index.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/styles/element-plus-variables.css +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/styles/font.scss +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/styles/index.scss +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/styles/variables.scss +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/types/auto-import.d.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/types/components.d.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/utils/env.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/views/home/index.vue +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/views/model/index.vue +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/vite-env.d.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/tsconfig.app.json +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/tsconfig.json +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/tsconfig.node.json +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/uno.config.ts +0 -0
- /package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/vite.config.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/.env +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/.env.development +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/.env.production +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/.prettierignore +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/.prettierrc +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/.vscode/settings.json +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/README.md +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/biome.json +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/index.html +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/lefthook.yml +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/package.json +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/public/.gitkeep +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/rsbuild.config.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/App.vue +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/index.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/router/guard/index.tsx +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/router/guard/permissionGuard.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/router/index.tsx +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/router/modules/index.tsx +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/store/index.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/store/modules/user.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/styles/index.css +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/types/auto-import.d.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/types/components.d.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/types/env.d.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/utils/request/axios.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/utils/request/index.ts +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/views/home/index.vue +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/tsconfig.json +0 -0
- /package/{template-vue-rsbuild → template-vue-rsbuild-biome}/uno.config.ts +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present, bubblesplant.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import e from"node:fs";import t from"node:path";import*as n from"@clack/prompts";import r from"gradient-string";import i from"mri";import a from"cross-spawn";import{fileURLToPath as o}from"node:url";const s={vue:r([`#42B883`,`#42B883`]),react:r([`#087EA4`,`#087EA4`]),others:r([`#8B5CF6`,`#A855F7`])},c=i(process.argv.slice(2),{alias:{h:`help`,t:`template`},boolean:[`help`,`overwrite`],string:[`template`]}),l=process.cwd(),u=`\
|
|
2
|
+
Usage: create-bubbles [OPTION]... [DIRECTORY]
|
|
3
|
+
|
|
4
|
+
Create a new Bubbles project in JavaScript or TypeScript.
|
|
5
|
+
With no arguments, start the CLI in interactive mode.
|
|
6
|
+
|
|
7
|
+
Options:
|
|
8
|
+
-t, --template NAME use a specific template
|
|
9
|
+
|
|
10
|
+
Available templates:
|
|
11
|
+
${s.vue(`vue-rsbuild-biome vue`)}
|
|
12
|
+
${s.vue(`vue-rolldown-oxc vue`)}
|
|
13
|
+
${s.react(`react-rsbuild-biome react`)}
|
|
14
|
+
${s.react(`react-rolldown-oxc react`)}`,d=e=>e.trim().replace(/\/+$/g,``),f=e=>{if(!e)return;let t=e.split(` `)[0].split(`/`);return{name:t[0],version:t[1]}},p=t=>{let n=e.readdirSync(t);return n.length===0||n.length===1&&n[0]===`.git`},m=async n=>{await Promise.all(e.readdirSync(n).filter(e=>e!==`.git`).map(r=>e.promises.rm(t.resolve(n,r),{recursive:!0,force:!0})))},h=e=>/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e),g=e=>e.trim().toLowerCase().replace(/\s+/g,`-`).replace(/^[._]/,``).replace(/[^a-z\d\-~]+g/,`-`),_=[{name:`vue`,display:`Vue`,color:s.vue,variants:[{name:`vue-rsbuild-biome`,display:`rsbuild + biome`,color:s.vue},{name:`vue-rolldown-oxc`,display:`rolldown + oxc`,color:s.vue}]},{name:`react`,display:`React`,color:s.react,variants:[{name:`react-rsbuild-biome`,display:`rsbuild-biome`,color:s.react}]},{name:`others`,display:`Others`,color:s.others,variants:[{name:`create-eletron-vite`,display:`Electron ↗`,color:s.others,customCommand:`pnpm create electron-vite@latest TARGET_DIR`}]}],v=_.map(e=>e.variants.map(e=>`${e.name}`)).reduce((e,t)=>e.concat(t),[]),y=(e,t)=>{console.log(`💦customCommand`,e,t);let n=t?t.name:`npm`,r=n===`yarn`&&t?.version.startsWith(`1.`);return e.replace(/^npm create (?:-- )?/,()=>n===`bun`?`bun x create-`:n===`pnpm`?`pnpm create `:e.startsWith(`npm create -- `)?`${n} create -- `:`${n} create `).replace(`@latest`,()=>r?``:`@latest`).replace(/^npm exec/,()=>n===`pnpm`?`pnpm dlx`:n===`yarn`&&!r?`yarn dlx`:n===`bun`?`bun x`:`npm exec`)},b={_gitignore:`.gitignore`},x=(n,r)=>{e.mkdirSync(r,{recursive:!0});for(let i of e.readdirSync(n)){let e=t.resolve(n,i),a=t.resolve(r,i);S(e,a)}},S=(t,n)=>{e.statSync(t).isDirectory()?x(t,n):e.copyFileSync(t,n)},C=(t,n)=>{let r=e.readFileSync(t,`utf-8`);e.writeFileSync(t,n(r),`utf-8`)},w=(e,n)=>{C(t.resolve(e,`package.json`),e=>e.replace(/"@vitejs\/plugin-react": ".+?"/,`"@vitejs/plugin-react-swc": "^4.0.1"`)),C(t.resolve(e,`vite.config.${n?`ts`:`js`}`),e=>e.replace(`@vitejs/plugin-react`,`@vitejs/plugin-react-swc`))};(async()=>{console.log(c);let i=c._[0]?d(c._[0]):void 0,x=c.template,C=c.overwrite,T=`bubbles-project`;if(c.help){console.log(u);return}let E=f(process.env.npm_config_user_agent),D=()=>n.cancel(`Operation cancelled`),O=i;if(!O){let e=await n.text({message:`Project name`,defaultValue:T,placeholder:T,validate:e=>e.length===0||d(e).length>0?void 0:`Invalid project name`});if(n.isCancel(e))return D();O=d(e)}if(e.existsSync(O)&&!p(O)){let e=C?`yes`:await n.select({message:O===`.`?`Current directory`:`Target directory "${O}" is not empty. Please choose how to proceed:`,options:[{label:`${s.vue(`Cancel operation`)}`,value:`no`},{label:`Remove existing files and continue`,value:`yes`},{label:`Ignore files and continue`,value:`ignore`}]});if(n.isCancel(e))return D();switch(e){case`yes`:m(O);break;case`no`:D();return}}let k=t.basename(t.resolve(O));if(!h(k)){let e=await n.text({message:`Package name is invalid. please input again:`,defaultValue:g(k),placeholder:g(k),validate(e){if(!h(e))return`Invalid package.json name`}});if(n.isCancel(e))return D();k=e}let A=x,j=!1;if(x&&!v.includes(x)&&(A=void 0,j=!0),!A){let e=await n.select({message:j?`"${x}" isn't a valia template. please choose from below:`:`Select a framework`,options:_.map(e=>{let t=e.color;return{label:t(e.display),value:e}})});if(n.isCancel(e))return D();console.log(`💦pkgInfo`,E);let t=await n.select({message:`Select a variant:`,options:e.variants.map(e=>{let t=e.color,n=e.customCommand?y(e.customCommand,E).replace(/ TARGET_DIR$/,``):void 0;return{label:t(e.display||e.name),value:e.name,hint:n}})});if(n.isCancel(t))return D();A=t}let M=t.join(l,O);e.mkdirSync(M,{recursive:!0});let N=!1;A.includes(`-swc`)&&(N=!0,A=A.replace(`-swc`,``));let P=E?E.name:`npm`,{customCommand:F}=_.flatMap(e=>e.variants).find(e=>e.name===A)??{};if(F){let[e,...t]=y(F,E).split(` `),n=t.map(e=>e.replace(`TARGET_DIR`,()=>O));console.log(`💦replacedArgs`,n);let{status:r}=a.sync(e,n,{stdio:`inherit`});process.exit(r??0)}n.log.step(`scaffolding project in ${M}...`);let I=t.resolve(o(import.meta.url),`../..`,`template-${A}`),L=(n,r)=>{let i=t.join(M,b[n]??n);r?e.writeFileSync(i,r):S(t.join(I,n),i)},R=e.readdirSync(I);for(let e of R)e!==`package.json`&&L(e);let z=JSON.parse(e.readFileSync(t.join(I,`package.json`),`utf-8`));z.name=k,L(`package.json`,`${JSON.stringify(z,null,2)}\n`),N&&w(M,A.endsWith(`-ts`));let B=``,V=t.relative(l,M);switch(console.log(`💦cwd`,l),console.log(`💦root`,M),console.log(`💦cdProjectName`,V),B+=`Done. Now run:
|
|
15
|
+
`,M!==l&&(B+=`\n cd ${V.includes(` `)?`"${V}"`:V} `),P){case`yarn`:B+=`
|
|
16
|
+
yarn`,B+=`
|
|
17
|
+
yarn dev`;break;default:B+=r([`pink`,`white`])(`\n ${P} install`),B+=r([`pink`,`white`])(`\n ${P} run dev`);break}n.outro(B)})().catch(e=>{console.error(`💦`,e)});export{};
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,41 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-bubbles",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "bubbles plant",
|
|
6
6
|
"bin": {
|
|
7
|
-
"create-
|
|
7
|
+
"create-bubbles": "index.js",
|
|
8
|
+
"cbp": "index.js"
|
|
8
9
|
},
|
|
9
10
|
"files": [
|
|
10
11
|
"index.js",
|
|
11
|
-
"template
|
|
12
|
+
"template-*",
|
|
12
13
|
"dist"
|
|
13
14
|
],
|
|
14
15
|
"engines": {
|
|
15
|
-
"node": "^
|
|
16
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
16
17
|
},
|
|
17
18
|
"repository": {
|
|
18
19
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/
|
|
20
|
-
"directory": "packages/create-
|
|
20
|
+
"url": "git+https://github.com/435012357/bubblesjs.git",
|
|
21
|
+
"directory": "packages/create-bubbles"
|
|
21
22
|
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/435012357/bubblesjs/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/435012357/bubblesjs/tree/master/packages/create-bubbles#readme",
|
|
27
|
+
"funding": "https://github.com/435012357/bubblesjs",
|
|
22
28
|
"devDependencies": {
|
|
23
|
-
"@types/
|
|
24
|
-
"
|
|
25
|
-
|
|
29
|
+
"@types/node": "^24.3.0",
|
|
30
|
+
"tsdown": "^0.14.1"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@clack/prompts": "^0.11.0",
|
|
26
34
|
"cross-spawn": "^7.0.6",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"unbuild": "^3.3.1"
|
|
35
|
+
"gradient-string": "^3.0.0",
|
|
36
|
+
"mri": "^1.2.0",
|
|
37
|
+
"picocolors": "^1.1.1"
|
|
31
38
|
},
|
|
32
39
|
"publishConfig": {
|
|
33
40
|
"access": "public",
|
|
34
41
|
"registry": "https://registry.npmjs.org/"
|
|
35
42
|
},
|
|
36
43
|
"scripts": {
|
|
37
|
-
"dev": "
|
|
38
|
-
"build": "
|
|
39
|
-
"typecheck": "tsc
|
|
44
|
+
"dev": "tsdown --watch",
|
|
45
|
+
"build": "tsdown",
|
|
46
|
+
"typecheck": "tsc"
|
|
40
47
|
}
|
|
41
48
|
}
|
package/dist/index.mjs
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import I from"node:fs";import j from"node:path";import{fileURLToPath as wi}from"node:url";import yi from"child_process";import X from"path";import Q from"fs";import Et from"readline";import _t from"events";var xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V={exports:{}},ee,Dt;function Si(){if(Dt)return ee;Dt=1,ee=t,t.sync=h;var e=Q;function n(a,s){var g=s.pathExt!==void 0?s.pathExt:process.env.PATHEXT;if(!g||(g=g.split(";"),g.indexOf("")!==-1))return!0;for(var r=0;r<g.length;r++){var o=g[r].toLowerCase();if(o&&a.substr(-o.length).toLowerCase()===o)return!0}return!1}function u(a,s,g){return!a.isSymbolicLink()&&!a.isFile()?!1:n(s,g)}function t(a,s,g){e.stat(a,function(r,o){g(r,r?!1:u(o,a,s))})}function h(a,s){return u(e.statSync(a),a,s)}return ee}var te,It;function $i(){if(It)return te;It=1,te=n,n.sync=u;var e=Q;function n(a,s,g){e.stat(a,function(r,o){g(r,r?!1:t(o,s))})}function u(a,s){return t(e.statSync(a),s)}function t(a,s){return a.isFile()&&h(a,s)}function h(a,s){var g=a.mode,r=a.uid,o=a.gid,i=s.uid!==void 0?s.uid:process.getuid&&process.getuid(),d=s.gid!==void 0?s.gid:process.getgid&&process.getgid(),f=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),b=f|l,v=g&c||g&l&&o===d||g&f&&r===i||g&b&&i===0;return v}return te}var re,At;function Mi(){if(At)return re;At=1;var e;process.platform==="win32"||xi.TESTING_WINDOWS?e=Si():e=$i(),re=n,n.sync=u;function n(t,h,a){if(typeof h=="function"&&(a=h,h={}),!a){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,g){n(t,h||{},function(r,o){r?g(r):s(o)})})}e(t,h||{},function(s,g){s&&(s.code==="EACCES"||h&&h.ignoreErrors)&&(s=null,g=!1),a(s,g)})}function u(t,h){try{return e.sync(t,h||{})}catch(a){if(h&&h.ignoreErrors||a.code==="EACCES")return!1;throw a}}return re}var ie,jt;function Oi(){if(jt)return ie;jt=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",n=X,u=e?";":":",t=Mi(),h=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),a=(r,o)=>{const i=o.colon||u,d=r.match(/\//)||e&&r.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(o.path||process.env.PATH||"").split(i)],f=e?o.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",l=e?f.split(i):[""];return e&&r.indexOf(".")!==-1&&l[0]!==""&&l.unshift(""),{pathEnv:d,pathExt:l,pathExtExe:f}},s=(r,o,i)=>{typeof o=="function"&&(i=o,o={}),o||(o={});const{pathEnv:d,pathExt:f,pathExtExe:l}=a(r,o),c=[],b=p=>new Promise((m,w)=>{if(p===d.length)return o.all&&c.length?m(c):w(h(r));const x=d[p],y=/^".*"$/.test(x)?x.slice(1,-1):x,S=n.join(y,r),$=!y&&/^\.[\\\/]/.test(r)?r.slice(0,2)+S:S;m(v($,p,0))}),v=(p,m,w)=>new Promise((x,y)=>{if(w===f.length)return x(b(m+1));const S=f[w];t(p+S,{pathExt:l},($,P)=>{if(!$&&P)if(o.all)c.push(p+S);else return x(p+S);return x(v(p,m,w+1))})});return i?b(0).then(p=>i(null,p),i):b(0)},g=(r,o)=>{o=o||{};const{pathEnv:i,pathExt:d,pathExtExe:f}=a(r,o),l=[];for(let c=0;c<i.length;c++){const b=i[c],v=/^".*"$/.test(b)?b.slice(1,-1):b,p=n.join(v,r),m=!v&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;for(let w=0;w<d.length;w++){const x=m+d[w];try{if(t.sync(x,{pathExt:f}))if(o.all)l.push(x);else return x}catch{}}}if(o.all&&l.length)return l;if(o.nothrow)return null;throw h(r)};return ie=s,s.sync=g,ie}var J={exports:{}},Ft;function Pi(){if(Ft)return J.exports;Ft=1;const e=(n={})=>{const u=n.env||process.env;return(n.platform||process.platform)!=="win32"?"PATH":Object.keys(u).reverse().find(h=>h.toUpperCase()==="PATH")||"Path"};return J.exports=e,J.exports.default=e,J.exports}var se,Nt;function Ti(){if(Nt)return se;Nt=1;const e=X,n=Oi(),u=Pi();function t(a,s){const g=a.options.env||process.env,r=process.cwd(),o=a.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(a.options.cwd)}catch{}let d;try{d=n.sync(a.command,{path:g[u({env:g})],pathExt:s?e.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return d&&(d=e.resolve(o?a.options.cwd:"",d)),d}function h(a){return t(a)||t(a,!0)}return se=h,se}var K={},Yt;function qi(){if(Yt)return K;Yt=1;const e=/([()\][%!^"`<>&|;, *?])/g;function n(t){return t=t.replace(e,"^$1"),t}function u(t,h){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(e,"^$1"),h&&(t=t.replace(e,"^$1")),t}return K.command=n,K.argument=u,K}var ne,Ht;function Ci(){return Ht||(Ht=1,ne=/^#!(.*)/),ne}var oe,kt;function Ri(){if(kt)return oe;kt=1;const e=Ci();return oe=(n="")=>{const u=n.match(e);if(!u)return null;const[t,h]=u[0].replace(/#! ?/,"").split(" "),a=t.split("/").pop();return a==="env"?h:h?`${a} ${h}`:a},oe}var he,Lt;function Ei(){if(Lt)return he;Lt=1;const e=Q,n=Ri();function u(t){const a=Buffer.alloc(150);let s;try{s=e.openSync(t,"r"),e.readSync(s,a,0,150,0),e.closeSync(s)}catch{}return n(a.toString())}return he=u,he}var le,Bt;function _i(){if(Bt)return le;Bt=1;const e=X,n=Ti(),u=qi(),t=Ei(),h=process.platform==="win32",a=/\.(?:com|exe)$/i,s=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function g(i){i.file=n(i);const d=i.file&&t(i.file);return d?(i.args.unshift(i.file),i.command=d,n(i)):i.file}function r(i){if(!h)return i;const d=g(i),f=!a.test(d);if(i.options.forceShell||f){const l=s.test(d);i.command=e.normalize(i.command),i.command=u.command(i.command),i.args=i.args.map(b=>u.argument(b,l));const c=[i.command].concat(i.args).join(" ");i.args=["/d","/s","/c",`"${c}"`],i.command=process.env.comspec||"cmd.exe",i.options.windowsVerbatimArguments=!0}return i}function o(i,d,f){d&&!Array.isArray(d)&&(f=d,d=null),d=d?d.slice(0):[],f=Object.assign({},f);const l={command:i,args:d,options:f,file:void 0,original:{command:i,args:d}};return f.shell?l:r(l)}return le=o,le}var ue,Vt;function Di(){if(Vt)return ue;Vt=1;const e=process.platform==="win32";function n(a,s){return Object.assign(new Error(`${s} ${a.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${s} ${a.command}`,path:a.command,spawnargs:a.args})}function u(a,s){if(!e)return;const g=a.emit;a.emit=function(r,o){if(r==="exit"){const i=t(o,s);if(i)return g.call(a,"error",i)}return g.apply(a,arguments)}}function t(a,s){return e&&a===1&&!s.file?n(s.original,"spawn"):null}function h(a,s){return e&&a===1&&!s.file?n(s.original,"spawnSync"):null}return ue={hookChildProcess:u,verifyENOENT:t,verifyENOENTSync:h,notFoundError:n},ue}var Ut;function Ii(){if(Ut)return V.exports;Ut=1;const e=yi,n=_i(),u=Di();function t(a,s,g){const r=n(a,s,g),o=e.spawn(r.command,r.args,r.options);return u.hookChildProcess(o,r),o}function h(a,s,g){const r=n(a,s,g),o=e.spawnSync(r.command,r.args,r.options);return o.error=o.error||u.verifyENOENTSync(o.status,r),o}return V.exports=t,V.exports.spawn=t,V.exports.sync=h,V.exports._parse=n,V.exports._enoent=u,V.exports}var Ai=Ii();const ji=z(Ai);var ae,Wt;function Fi(){if(Wt)return ae;Wt=1;function e(t,h){var a=t;h.slice(0,-1).forEach(function(g){a=a[g]||{}});var s=h[h.length-1];return s in a}function n(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function u(t,h){return h==="constructor"&&typeof t[h]=="function"||h==="__proto__"}return ae=function(t,h){h||(h={});var a={bools:{},strings:{},unknownFn:null};typeof h.unknown=="function"&&(a.unknownFn=h.unknown),typeof h.boolean=="boolean"&&h.boolean?a.allBools=!0:[].concat(h.boolean).filter(Boolean).forEach(function($){a.bools[$]=!0});var s={};function g($){return s[$].some(function(P){return a.bools[P]})}Object.keys(h.alias||{}).forEach(function($){s[$]=[].concat(h.alias[$]),s[$].forEach(function(P){s[P]=[$].concat(s[$].filter(function(O){return P!==O}))})}),[].concat(h.string).filter(Boolean).forEach(function($){a.strings[$]=!0,s[$]&&[].concat(s[$]).forEach(function(P){a.strings[P]=!0})});var r=h.default||{},o={_:[]};function i($,P){return a.allBools&&/^--[^=]+$/.test(P)||a.strings[$]||a.bools[$]||s[$]}function d($,P,O){for(var M=$,T=0;T<P.length-1;T++){var C=P[T];if(u(M,C))return;M[C]===void 0&&(M[C]={}),(M[C]===Object.prototype||M[C]===Number.prototype||M[C]===String.prototype)&&(M[C]={}),M[C]===Array.prototype&&(M[C]=[]),M=M[C]}var q=P[P.length-1];u(M,q)||((M===Object.prototype||M===Number.prototype||M===String.prototype)&&(M={}),M===Array.prototype&&(M=[]),M[q]===void 0||a.bools[q]||typeof M[q]=="boolean"?M[q]=O:Array.isArray(M[q])?M[q].push(O):M[q]=[M[q],O])}function f($,P,O){if(!(O&&a.unknownFn&&!i($,O)&&a.unknownFn(O)===!1)){var M=!a.strings[$]&&n(P)?Number(P):P;d(o,$.split("."),M),(s[$]||[]).forEach(function(T){d(o,T.split("."),M)})}}Object.keys(a.bools).forEach(function($){f($,r[$]===void 0?!1:r[$])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var c=0;c<t.length;c++){var b=t[c],v,p;if(/^--.+=/.test(b)){var m=b.match(/^--([^=]+)=([\s\S]*)$/);v=m[1];var w=m[2];a.bools[v]&&(w=w!=="false"),f(v,w,b)}else if(/^--no-.+/.test(b))v=b.match(/^--no-(.+)/)[1],f(v,!1,b);else if(/^--.+/.test(b))v=b.match(/^--(.+)/)[1],p=t[c+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!a.bools[v]&&!a.allBools&&(!s[v]||!g(v))?(f(v,p,b),c+=1):/^(true|false)$/.test(p)?(f(v,p==="true",b),c+=1):f(v,a.strings[v]?"":!0,b);else if(/^-[^-]+/.test(b)){for(var x=b.slice(1,-1).split(""),y=!1,S=0;S<x.length;S++){if(p=b.slice(S+2),p==="-"){f(x[S],p,b);continue}if(/[A-Za-z]/.test(x[S])&&p[0]==="="){f(x[S],p.slice(1),b),y=!0;break}if(/[A-Za-z]/.test(x[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){f(x[S],p,b),y=!0;break}if(x[S+1]&&x[S+1].match(/\W/)){f(x[S],b.slice(S+2),b),y=!0;break}else f(x[S],a.strings[x[S]]?"":!0,b)}v=b.slice(-1)[0],!y&&v!=="-"&&(t[c+1]&&!/^(-|--)[^-]/.test(t[c+1])&&!a.bools[v]&&(!s[v]||!g(v))?(f(v,t[c+1],b),c+=1):t[c+1]&&/^(true|false)$/.test(t[c+1])?(f(v,t[c+1]==="true",b),c+=1):f(v,a.strings[v]?"":!0,b))}else if((!a.unknownFn||a.unknownFn(b)!==!1)&&o._.push(a.strings._||!n(b)?b:Number(b)),h.stopEarly){o._.push.apply(o._,t.slice(c+1));break}}return Object.keys(r).forEach(function($){e(o,$.split("."))||(d(o,$.split("."),r[$]),(s[$]||[]).forEach(function(P){d(o,P.split("."),r[$])}))}),h["--"]?o["--"]=l.slice():l.forEach(function($){o._.push($)}),o},ae}var Ni=Fi();const Yi=z(Ni);var Z={exports:{}},Gt;function Hi(){if(Gt)return Z.exports;Gt=1;let e=process||{},n=e.argv||[],u=e.env||{},t=!(u.NO_COLOR||n.includes("--no-color"))&&(!!u.FORCE_COLOR||n.includes("--color")||e.platform==="win32"||(e.stdout||{}).isTTY&&u.TERM!=="dumb"||!!u.CI),h=(g,r,o=g)=>i=>{let d=""+i,f=d.indexOf(r,g.length);return~f?g+a(d,r,o,f)+r:g+d+r},a=(g,r,o,i)=>{let d="",f=0;do d+=g.substring(f,i)+o,f=i+r.length,i=g.indexOf(r,f);while(~i);return d+g.substring(f)},s=(g=t)=>{let r=g?h:()=>String;return{isColorSupported:g,reset:r("\x1B[0m","\x1B[0m"),bold:r("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:r("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:r("\x1B[3m","\x1B[23m"),underline:r("\x1B[4m","\x1B[24m"),inverse:r("\x1B[7m","\x1B[27m"),hidden:r("\x1B[8m","\x1B[28m"),strikethrough:r("\x1B[9m","\x1B[29m"),black:r("\x1B[30m","\x1B[39m"),red:r("\x1B[31m","\x1B[39m"),green:r("\x1B[32m","\x1B[39m"),yellow:r("\x1B[33m","\x1B[39m"),blue:r("\x1B[34m","\x1B[39m"),magenta:r("\x1B[35m","\x1B[39m"),cyan:r("\x1B[36m","\x1B[39m"),white:r("\x1B[37m","\x1B[39m"),gray:r("\x1B[90m","\x1B[39m"),bgBlack:r("\x1B[40m","\x1B[49m"),bgRed:r("\x1B[41m","\x1B[49m"),bgGreen:r("\x1B[42m","\x1B[49m"),bgYellow:r("\x1B[43m","\x1B[49m"),bgBlue:r("\x1B[44m","\x1B[49m"),bgMagenta:r("\x1B[45m","\x1B[49m"),bgCyan:r("\x1B[46m","\x1B[49m"),bgWhite:r("\x1B[47m","\x1B[49m"),blackBright:r("\x1B[90m","\x1B[39m"),redBright:r("\x1B[91m","\x1B[39m"),greenBright:r("\x1B[92m","\x1B[39m"),yellowBright:r("\x1B[93m","\x1B[39m"),blueBright:r("\x1B[94m","\x1B[39m"),magentaBright:r("\x1B[95m","\x1B[39m"),cyanBright:r("\x1B[96m","\x1B[39m"),whiteBright:r("\x1B[97m","\x1B[39m"),bgBlackBright:r("\x1B[100m","\x1B[49m"),bgRedBright:r("\x1B[101m","\x1B[49m"),bgGreenBright:r("\x1B[102m","\x1B[49m"),bgYellowBright:r("\x1B[103m","\x1B[49m"),bgBlueBright:r("\x1B[104m","\x1B[49m"),bgMagentaBright:r("\x1B[105m","\x1B[49m"),bgCyanBright:r("\x1B[106m","\x1B[49m"),bgWhiteBright:r("\x1B[107m","\x1B[49m")}};return Z.exports=s(),Z.exports.createColors=s,Z.exports}var ki=Hi();const Li=z(ki);var ce={},de,zt;function R(){if(zt)return de;zt=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:n,TERM:u}=process.env,t={enabled:!n&&u!=="dumb"&&e!=="0",reset:s(0,0),bold:s(1,22),dim:s(2,22),italic:s(3,23),underline:s(4,24),inverse:s(7,27),hidden:s(8,28),strikethrough:s(9,29),black:s(30,39),red:s(31,39),green:s(32,39),yellow:s(33,39),blue:s(34,39),magenta:s(35,39),cyan:s(36,39),white:s(37,39),gray:s(90,39),grey:s(90,39),bgBlack:s(40,49),bgRed:s(41,49),bgGreen:s(42,49),bgYellow:s(43,49),bgBlue:s(44,49),bgMagenta:s(45,49),bgCyan:s(46,49),bgWhite:s(47,49)};function h(g,r){let o=0,i,d="",f="";for(;o<g.length;o++)i=g[o],d+=i.open,f+=i.close,r.includes(i.close)&&(r=r.replace(i.rgx,i.close+i.open));return d+r+f}function a(g,r){let o={has:g,keys:r};return o.reset=t.reset.bind(o),o.bold=t.bold.bind(o),o.dim=t.dim.bind(o),o.italic=t.italic.bind(o),o.underline=t.underline.bind(o),o.inverse=t.inverse.bind(o),o.hidden=t.hidden.bind(o),o.strikethrough=t.strikethrough.bind(o),o.black=t.black.bind(o),o.red=t.red.bind(o),o.green=t.green.bind(o),o.yellow=t.yellow.bind(o),o.blue=t.blue.bind(o),o.magenta=t.magenta.bind(o),o.cyan=t.cyan.bind(o),o.white=t.white.bind(o),o.gray=t.gray.bind(o),o.grey=t.grey.bind(o),o.bgBlack=t.bgBlack.bind(o),o.bgRed=t.bgRed.bind(o),o.bgGreen=t.bgGreen.bind(o),o.bgYellow=t.bgYellow.bind(o),o.bgBlue=t.bgBlue.bind(o),o.bgMagenta=t.bgMagenta.bind(o),o.bgCyan=t.bgCyan.bind(o),o.bgWhite=t.bgWhite.bind(o),o}function s(g,r){let o={open:`\x1B[${g}m`,close:`\x1B[${r}m`,rgx:new RegExp(`\\x1b\\[${r}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(g)||(this.has.push(g),this.keys.push(o)),i===void 0?this:t.enabled?h(this.keys,i+""):i+""):i===void 0?a([g],[o]):t.enabled?h([o],i+""):i+""}}return de=t,de}var fe,Jt;function Bi(){return Jt||(Jt=1,fe=(e,n)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(n){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),fe}var pe,Kt;function me(){return Kt||(Kt=1,pe=e=>{const n=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),u=new RegExp(n,"g");return typeof e=="string"?e.replace(u,""):e}),pe}var ge,Zt;function E(){if(Zt)return ge;Zt=1;const e="\x1B",n=`${e}[`,u="\x07",t={to(s,g){return g?`${n}${g+1};${s+1}H`:`${n}${s+1}G`},move(s,g){let r="";return s<0?r+=`${n}${-s}D`:s>0&&(r+=`${n}${s}C`),g<0?r+=`${n}${-g}A`:g>0&&(r+=`${n}${g}B`),r},up:(s=1)=>`${n}${s}A`,down:(s=1)=>`${n}${s}B`,forward:(s=1)=>`${n}${s}C`,backward:(s=1)=>`${n}${s}D`,nextLine:(s=1)=>`${n}E`.repeat(s),prevLine:(s=1)=>`${n}F`.repeat(s),left:`${n}G`,hide:`${n}?25l`,show:`${n}?25h`,save:`${e}7`,restore:`${e}8`},h={up:(s=1)=>`${n}S`.repeat(s),down:(s=1)=>`${n}T`.repeat(s)},a={screen:`${n}2J`,up:(s=1)=>`${n}1J`.repeat(s),down:(s=1)=>`${n}J`.repeat(s),line:`${n}2K`,lineEnd:`${n}K`,lineStart:`${n}1K`,lines(s){let g="";for(let r=0;r<s;r++)g+=this.line+(r<s-1?t.up():"");return s&&(g+=t.left),g}};return ge={cursor:t,scroll:h,erase:a,beep:u},ge}var ve,Xt;function Vi(){if(Xt)return ve;Xt=1;function e(r,o){var i=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=n(r))||o){i&&(r=i);var d=0,f=function(){};return{s:f,n:function(){return d>=r.length?{done:!0}:{done:!1,value:r[d++]}},e:function(p){throw p},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l=!0,c=!1,b;return{s:function(){i=i.call(r)},n:function(){var p=i.next();return l=p.done,p},e:function(p){c=!0,b=p},f:function(){try{!l&&i.return!=null&&i.return()}finally{if(c)throw b}}}}function n(r,o){if(r){if(typeof r=="string")return u(r,o);var i=Object.prototype.toString.call(r).slice(8,-1);if(i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set")return Array.from(r);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return u(r,o)}}function u(r,o){(o==null||o>r.length)&&(o=r.length);for(var i=0,d=new Array(o);i<o;i++)d[i]=r[i];return d}const t=me(),h=E(),a=h.erase,s=h.cursor,g=r=>[...t(r)].length;return ve=function(r,o){if(!o)return a.line+s.to(0);let i=0;const d=r.split(/\r?\n/);var f=e(d),l;try{for(f.s();!(l=f.n()).done;){let c=l.value;i+=1+Math.floor(Math.max(g(c)-1,0)/o)}}catch(c){f.e(c)}finally{f.f()}return a.lines(i)},ve}var be,Qt;function er(){if(Qt)return be;Qt=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},n={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return be=process.platform==="win32"?n:e,be}var we,tr;function Ui(){if(tr)return we;tr=1;const e=R(),n=er(),u=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"\u{1F603}".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),t=r=>u[r]||u.default,h=Object.freeze({aborted:e.red(n.cross),done:e.green(n.tick),exited:e.yellow(n.cross),default:e.cyan("?")});return we={styles:u,render:t,symbols:h,symbol:(r,o,i)=>o?h.aborted:i?h.exited:r?h.done:h.default,delimiter:r=>e.gray(r?n.ellipsis:n.pointerSmall),item:(r,o)=>e.gray(r?o?n.pointerSmall:"+":n.line)},we}var ye,rr;function Wi(){if(rr)return ye;rr=1;const e=me();return ye=function(n,u){let t=String(e(n)||"").split(/\r?\n/);return u?t.map(h=>Math.ceil(h.length/u)).reduce((h,a)=>h+a):t.length},ye}var xe,ir;function Gi(){return ir||(ir=1,xe=(e,n={})=>{const u=Number.isSafeInteger(parseInt(n.margin))?new Array(parseInt(n.margin)).fill(" ").join(""):n.margin||"",t=n.width;return(e||"").split(/\r?\n/g).map(h=>h.split(/\s+/g).reduce((a,s)=>(s.length+u.length>=t||a[a.length-1].length+s.length+1<t?a[a.length-1]+=` ${s}`:a.push(`${u}${s}`),a),[u]).join(`
|
|
3
|
-
`)).join(`
|
|
4
|
-
`)}),xe}var Se,sr;function zi(){return sr||(sr=1,Se=(e,n,u)=>{u=u||n;let t=Math.min(n-u,e-Math.floor(u/2));t<0&&(t=0);let h=Math.min(t+u,n);return{startIndex:t,endIndex:h}}),Se}var $e,nr;function N(){return nr||(nr=1,$e={action:Bi(),clear:Vi(),style:Ui(),strip:me(),figures:er(),lines:Wi(),wrap:Gi(),entriesToDisplay:zi()}),$e}var Me,or;function L(){if(or)return Me;or=1;const e=Et,n=N(),u=n.action,t=_t,h=E(),a=h.beep,s=h.cursor,g=R();class r extends t{constructor(i={}){super(),this.firstRender=!0,this.in=i.stdin||process.stdin,this.out=i.stdout||process.stdout,this.onRender=(i.onRender||(()=>{})).bind(this);const d=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,d),this.in.isTTY&&this.in.setRawMode(!0);const f=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,l=(c,b)=>{let v=u(b,f);v===!1?this._&&this._(c,b):typeof this[v]=="function"?this[v](b):this.bell()};this.close=()=>{this.out.write(s.show),this.in.removeListener("keypress",l),this.in.isTTY&&this.in.setRawMode(!1),d.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",l)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(a)}render(){this.onRender(g),this.firstRender&&(this.firstRender=!1)}}return Me=r,Me}var Oe,hr;function Ji(){if(hr)return Oe;hr=1;function e(l,c,b,v,p,m,w){try{var x=l[m](w),y=x.value}catch(S){b(S);return}x.done?c(y):Promise.resolve(y).then(v,p)}function n(l){return function(){var c=this,b=arguments;return new Promise(function(v,p){var m=l.apply(c,b);function w(y){e(m,v,p,w,x,"next",y)}function x(y){e(m,v,p,w,x,"throw",y)}w(void 0)})}}const u=R(),t=L(),h=E(),a=h.erase,s=h.cursor,g=N(),r=g.style,o=g.clear,i=g.lines,d=g.figures;class f extends t{constructor(c={}){super(c),this.transform=r.render(c.style),this.scale=this.transform.scale,this.msg=c.message,this.initial=c.initial||"",this.validator=c.validate||(()=>!0),this.value="",this.errorMsg=c.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=o("",this.out.columns),this.render()}set value(c){!c&&this.initial?(this.placeholder=!0,this.rendered=u.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(c)),this._value=c,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
5
|
-
`),this.close()}validate(){var c=this;return n(function*(){let b=yield c.validator(c.value);typeof b=="string"&&(c.errorMsg=b,b=!1),c.error=!b})()}submit(){var c=this;return n(function*(){if(c.value=c.value||c.initial,c.cursorOffset=0,c.cursor=c.rendered.length,yield c.validate(),c.error){c.red=!0,c.fire(),c.render();return}c.done=!0,c.aborted=!1,c.fire(),c.render(),c.out.write(`
|
|
6
|
-
`),c.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(c){this.placeholder||(this.cursor=this.cursor+c,this.cursorOffset+=c)}_(c,b){let v=this.value.slice(0,this.cursor),p=this.value.slice(this.cursor);this.value=`${v}${c}${p}`,this.red=!1,this.cursor=this.placeholder?0:v.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let c=this.value.slice(0,this.cursor-1),b=this.value.slice(this.cursor);this.value=`${c}${b}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let c=this.value.slice(0,this.cursor),b=this.value.slice(this.cursor+1);this.value=`${c}${b}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(s.down(i(this.outputError,this.out.columns)-1)+o(this.outputError,this.out.columns)),this.out.write(o(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[r.symbol(this.done,this.aborted),u.bold(this.msg),r.delimiter(this.done),this.red?u.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
7
|
-
`).reduce((c,b,v)=>c+`
|
|
8
|
-
${v?" ":d.pointerSmall} ${u.red().italic(b)}`,"")),this.out.write(a.line+s.to(0)+this.outputText+s.save+this.outputError+s.restore+s.move(this.cursorOffset,0)))}}return Oe=f,Oe}var Pe,lr;function Ki(){if(lr)return Pe;lr=1;const e=R(),n=L(),u=N(),t=u.style,h=u.clear,a=u.figures,s=u.wrap,g=u.entriesToDisplay,r=E(),o=r.cursor;class i extends n{constructor(f={}){super(f),this.msg=f.message,this.hint=f.hint||"- Use arrow-keys. Return to submit.",this.warn=f.warn||"- This option is disabled",this.cursor=f.initial||0,this.choices=f.choices.map((l,c)=>(typeof l=="string"&&(l={title:l,value:c}),{title:l&&(l.title||l.value||l),value:l&&(l.value===void 0?c:l.value),description:l&&l.description,selected:l&&l.selected,disabled:l&&l.disabled})),this.optionsPerPage=f.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=h("",this.out.columns),this.render()}moveCursor(f){this.cursor=f,this.value=this.choices[f].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
9
|
-
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
10
|
-
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(f,l){if(f===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(o.hide):this.out.write(h(this.outputText,this.out.columns)),super.render();let f=g(this.cursor,this.choices.length,this.optionsPerPage),l=f.startIndex,c=f.endIndex;if(this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
11
|
-
`;for(let b=l;b<c;b++){let v,p,m="",w=this.choices[b];b===l&&l>0?p=a.arrowUp:b===c-1&&c<this.choices.length?p=a.arrowDown:p=" ",w.disabled?(v=this.cursor===b?e.gray().underline(w.title):e.strikethrough().gray(w.title),p=(this.cursor===b?e.bold().gray(a.pointer)+" ":" ")+p):(v=this.cursor===b?e.cyan().underline(w.title):w.title,p=(this.cursor===b?e.cyan(a.pointer)+" ":" ")+p,w.description&&this.cursor===b&&(m=` - ${w.description}`,(p.length+v.length+m.length>=this.out.columns||w.description.split(/\r?\n/).length>1)&&(m=`
|
|
12
|
-
`+s(w.description,{margin:3,width:this.out.columns})))),this.outputText+=`${p} ${v}${e.gray(m)}
|
|
13
|
-
`}}this.out.write(this.outputText)}}return Pe=i,Pe}var Te,ur;function Zi(){if(ur)return Te;ur=1;const e=R(),n=L(),u=N(),t=u.style,h=u.clear,a=E(),s=a.cursor,g=a.erase;class r extends n{constructor(i={}){super(i),this.msg=i.message,this.value=!!i.initial,this.active=i.active||"on",this.inactive=i.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
14
|
-
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
15
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(i,d){if(i===" ")this.value=!this.value;else if(i==="1")this.value=!0;else if(i==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(h(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(g.line+s.to(0)+this.outputText))}}return Te=r,Te}var qe,ar;function H(){if(ar)return qe;ar=1;class e{constructor({token:u,date:t,parts:h,locales:a}){this.token=u,this.date=t||new Date,this.parts=h||[this],this.locales=a||{}}up(){}down(){}next(){const u=this.parts.indexOf(this);return this.parts.find((t,h)=>h>u&&t instanceof e)}setTo(u){}prev(){let u=[].concat(this.parts).reverse();const t=u.indexOf(this);return u.find((h,a)=>a>t&&h instanceof e)}toString(){return String(this.date)}}return qe=e,qe}var Ce,cr;function Xi(){if(cr)return Ce;cr=1;const e=H();class n extends e{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}return Ce=n,Ce}var Re,dr;function Qi(){if(dr)return Re;dr=1;const e=H(),n=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class u extends e{constructor(h={}){super(h)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(h){this.date.setDate(parseInt(h.substr(-2)))}toString(){let h=this.date.getDate(),a=this.date.getDay();return this.token==="DD"?String(h).padStart(2,"0"):this.token==="Do"?h+n(h):this.token==="d"?a+1:this.token==="ddd"?this.locales.weekdaysShort[a]:this.token==="dddd"?this.locales.weekdays[a]:h}}return Re=u,Re}var Ee,fr;function es(){if(fr)return Ee;fr=1;const e=H();class n extends e{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}}return Ee=n,Ee}var _e,pr;function ts(){if(pr)return _e;pr=1;const e=H();class n extends e{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return _e=n,_e}var De,mr;function rs(){if(mr)return De;mr=1;const e=H();class n extends e{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}return De=n,De}var Ie,gr;function is(){if(gr)return Ie;gr=1;const e=H();class n extends e{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),h=this.token.length;return h===2?String(t+1).padStart(2,"0"):h===3?this.locales.monthsShort[t]:h===4?this.locales.months[t]:String(t+1)}}return Ie=n,Ie}var Ae,vr;function ss(){if(vr)return Ae;vr=1;const e=H();class n extends e{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}return Ae=n,Ae}var je,br;function ns(){if(br)return je;br=1;const e=H();class n extends e{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}return je=n,je}var Fe,wr;function os(){return wr||(wr=1,Fe={DatePart:H(),Meridiem:Xi(),Day:Qi(),Hours:es(),Milliseconds:ts(),Minutes:rs(),Month:is(),Seconds:ss(),Year:ns()}),Fe}var Ne,yr;function hs(){if(yr)return Ne;yr=1;function e(O,M,T,C,q,_,F){try{var A=O[_](F),D=A.value}catch(U){T(U);return}A.done?M(D):Promise.resolve(D).then(C,q)}function n(O){return function(){var M=this,T=arguments;return new Promise(function(C,q){var _=O.apply(M,T);function F(D){e(_,C,q,F,A,"next",D)}function A(D){e(_,C,q,F,A,"throw",D)}F(void 0)})}}const u=R(),t=L(),h=N(),a=h.style,s=h.clear,g=h.figures,r=E(),o=r.erase,i=r.cursor,d=os(),f=d.DatePart,l=d.Meridiem,c=d.Day,b=d.Hours,v=d.Milliseconds,p=d.Minutes,m=d.Month,w=d.Seconds,x=d.Year,y=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,S={1:({token:O})=>O.replace(/\\(.)/g,"$1"),2:O=>new c(O),3:O=>new m(O),4:O=>new x(O),5:O=>new l(O),6:O=>new b(O),7:O=>new p(O),8:O=>new w(O),9:O=>new v(O)},$={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class P extends t{constructor(M={}){super(M),this.msg=M.message,this.cursor=0,this.typed="",this.locales=Object.assign($,M.locales),this._date=M.initial||new Date,this.errorMsg=M.error||"Please Enter A Valid Value",this.validator=M.validate||(()=>!0),this.mask=M.mask||"YYYY-MM-DD HH:mm:ss",this.clear=s("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(M){M&&this._date.setTime(M.getTime())}set mask(M){let T;for(this.parts=[];T=y.exec(M);){let q=T.shift(),_=T.findIndex(F=>F!=null);this.parts.push(_ in S?S[_]({token:T[_]||q,date:this.date,parts:this.parts,locales:this.locales}):T[_]||q)}let C=this.parts.reduce((q,_)=>(typeof _=="string"&&typeof q[q.length-1]=="string"?q[q.length-1]+=_:q.push(_),q),[]);this.parts.splice(0),this.parts.push(...C),this.reset()}moveCursor(M){this.typed="",this.cursor=M,this.fire()}reset(){this.moveCursor(this.parts.findIndex(M=>M instanceof f)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
16
|
-
`),this.close()}validate(){var M=this;return n(function*(){let T=yield M.validator(M.value);typeof T=="string"&&(M.errorMsg=T,T=!1),M.error=!T})()}submit(){var M=this;return n(function*(){if(yield M.validate(),M.error){M.color="red",M.fire(),M.render();return}M.done=!0,M.aborted=!1,M.fire(),M.render(),M.out.write(`
|
|
17
|
-
`),M.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let M=this.parts[this.cursor].prev();if(M==null)return this.bell();this.moveCursor(this.parts.indexOf(M)),this.render()}right(){let M=this.parts[this.cursor].next();if(M==null)return this.bell();this.moveCursor(this.parts.indexOf(M)),this.render()}next(){let M=this.parts[this.cursor].next();this.moveCursor(M?this.parts.indexOf(M):this.parts.findIndex(T=>T instanceof f)),this.render()}_(M){/\d/.test(M)&&(this.typed+=M,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),u.bold(this.msg),a.delimiter(!1),this.parts.reduce((M,T,C)=>M.concat(C===this.cursor&&!this.done?u.cyan().underline(T.toString()):T),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
18
|
-
`).reduce((M,T,C)=>M+`
|
|
19
|
-
${C?" ":g.pointerSmall} ${u.red().italic(T)}`,"")),this.out.write(o.line+i.to(0)+this.outputText))}}return Ne=P,Ne}var Ye,xr;function ls(){if(xr)return Ye;xr=1;function e(v,p,m,w,x,y,S){try{var $=v[y](S),P=$.value}catch(O){m(O);return}$.done?p(P):Promise.resolve(P).then(w,x)}function n(v){return function(){var p=this,m=arguments;return new Promise(function(w,x){var y=v.apply(p,m);function S(P){e(y,w,x,S,$,"next",P)}function $(P){e(y,w,x,S,$,"throw",P)}S(void 0)})}}const u=R(),t=L(),h=E(),a=h.cursor,s=h.erase,g=N(),r=g.style,o=g.figures,i=g.clear,d=g.lines,f=/[0-9]/,l=v=>v!==void 0,c=(v,p)=>{let m=Math.pow(10,p);return Math.round(v*m)/m};class b extends t{constructor(p={}){super(p),this.transform=r.render(p.style),this.msg=p.message,this.initial=l(p.initial)?p.initial:"",this.float=!!p.float,this.round=p.round||2,this.inc=p.increment||1,this.min=l(p.min)?p.min:-1/0,this.max=l(p.max)?p.max:1/0,this.errorMsg=p.error||"Please Enter A Valid Value",this.validator=p.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(p){!p&&p!==0?(this.placeholder=!0,this.rendered=u.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${c(p,this.round)}`),this._value=c(p,this.round)),this.fire()}get value(){return this._value}parse(p){return this.float?parseFloat(p):parseInt(p)}valid(p){return p==="-"||p==="."&&this.float||f.test(p)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let p=this.value;this.value=p!==""?p:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
20
|
-
`),this.close()}validate(){var p=this;return n(function*(){let m=yield p.validator(p.value);typeof m=="string"&&(p.errorMsg=m,m=!1),p.error=!m})()}submit(){var p=this;return n(function*(){if(yield p.validate(),p.error){p.color="red",p.fire(),p.render();return}let m=p.value;p.value=m!==""?m:p.initial,p.done=!0,p.aborted=!1,p.error=!1,p.fire(),p.render(),p.out.write(`
|
|
21
|
-
`),p.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let p=this.value.toString();if(p.length===0)return this.bell();this.value=this.parse(p=p.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(p,m){if(!this.valid(p))return this.bell();const w=Date.now();if(w-this.lastHit>1e3&&(this.typed=""),this.typed+=p,this.lastHit=w,this.color="cyan",p===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(a.down(d(this.outputError,this.out.columns)-1)+i(this.outputError,this.out.columns)),this.out.write(i(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[r.symbol(this.done,this.aborted),u.bold(this.msg),r.delimiter(this.done),!this.done||!this.done&&!this.placeholder?u[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
22
|
-
`).reduce((p,m,w)=>p+`
|
|
23
|
-
${w?" ":o.pointerSmall} ${u.red().italic(m)}`,"")),this.out.write(s.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore))}}return Ye=b,Ye}var He,Sr;function $r(){if(Sr)return He;Sr=1;const e=R(),n=E(),u=n.cursor,t=L(),h=N(),a=h.clear,s=h.figures,g=h.style,r=h.wrap,o=h.entriesToDisplay;class i extends t{constructor(f={}){super(f),this.msg=f.message,this.cursor=f.cursor||0,this.scrollIndex=f.cursor||0,this.hint=f.hint||"",this.warn=f.warn||"- This option is disabled -",this.minSelected=f.min,this.showMinError=!1,this.maxChoices=f.max,this.instructions=f.instructions,this.optionsPerPage=f.optionsPerPage||10,this.value=f.choices.map((l,c)=>(typeof l=="string"&&(l={title:l,value:c}),{title:l&&(l.title||l.value||l),description:l&&l.description,value:l&&(l.value===void 0?c:l.value),selected:l&&l.selected,disabled:l&&l.disabled})),this.clear=a("",this.out.columns),f.overrideRender||this.render()}reset(){this.value.map(f=>!f.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(f=>f.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
24
|
-
`),this.close()}submit(){const f=this.value.filter(l=>l.selected);this.minSelected&&f.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
25
|
-
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(f=>f.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const f=this.value[this.cursor];if(f.selected)f.selected=!1,this.render();else{if(f.disabled||this.value.filter(l=>l.selected).length>=this.maxChoices)return this.bell();f.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const f=!this.value[this.cursor].selected;this.value.filter(l=>!l.disabled).forEach(l=>l.selected=f),this.render()}_(f,l){if(f===" ")this.handleSpaceToggle();else if(f==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
26
|
-
Instructions:
|
|
27
|
-
${s.arrowUp}/${s.arrowDown}: Highlight option
|
|
28
|
-
${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
|
|
29
|
-
`+(this.maxChoices===void 0?` a: Toggle all
|
|
30
|
-
`:"")+" enter/return: Complete answer":""}renderOption(f,l,c,b){const v=(l.selected?e.green(s.radioOn):s.radioOff)+" "+b+" ";let p,m;return l.disabled?p=f===c?e.gray().underline(l.title):e.strikethrough().gray(l.title):(p=f===c?e.cyan().underline(l.title):l.title,f===c&&l.description&&(m=` - ${l.description}`,(v.length+p.length+m.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(m=`
|
|
31
|
-
`+r(l.description,{margin:v.length,width:this.out.columns})))),v+p+e.gray(m||"")}paginateOptions(f){if(f.length===0)return e.red("No matches for this query.");let l=o(this.cursor,f.length,this.optionsPerPage),c=l.startIndex,b=l.endIndex,v,p=[];for(let m=c;m<b;m++)m===c&&c>0?v=s.arrowUp:m===b-1&&b<f.length?v=s.arrowDown:v=" ",p.push(this.renderOption(this.cursor,f[m],m,v));return`
|
|
32
|
-
`+p.join(`
|
|
33
|
-
`)}renderOptions(f){return this.done?"":this.paginateOptions(f)}renderDoneOrInstructions(){if(this.done)return this.value.filter(l=>l.selected).map(l=>l.title).join(", ");const f=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&f.push(e.yellow(this.warn)),f.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(u.hide),super.render();let f=[g.symbol(this.done,this.aborted),e.bold(this.msg),g.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(f+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),f+=this.renderOptions(this.value),this.out.write(this.clear+f),this.clear=a(f,this.out.columns)}}return He=i,He}var ke,Mr;function us(){if(Mr)return ke;Mr=1;function e(p,m,w,x,y,S,$){try{var P=p[S]($),O=P.value}catch(M){w(M);return}P.done?m(O):Promise.resolve(O).then(x,y)}function n(p){return function(){var m=this,w=arguments;return new Promise(function(x,y){var S=p.apply(m,w);function $(O){e(S,x,y,$,P,"next",O)}function P(O){e(S,x,y,$,P,"throw",O)}$(void 0)})}}const u=R(),t=L(),h=E(),a=h.erase,s=h.cursor,g=N(),r=g.style,o=g.clear,i=g.figures,d=g.wrap,f=g.entriesToDisplay,l=(p,m)=>p[m]&&(p[m].value||p[m].title||p[m]),c=(p,m)=>p[m]&&(p[m].title||p[m].value||p[m]),b=(p,m)=>{const w=p.findIndex(x=>x.value===m||x.title===m);return w>-1?w:void 0};class v extends t{constructor(m={}){super(m),this.msg=m.message,this.suggest=m.suggest,this.choices=m.choices,this.initial=typeof m.initial=="number"?m.initial:b(m.choices,m.initial),this.select=this.initial||m.cursor||0,this.i18n={noMatches:m.noMatches||"no matches found"},this.fallback=m.fallback||this.initial,this.clearFirst=m.clearFirst||!1,this.suggestions=[],this.input="",this.limit=m.limit||10,this.cursor=0,this.transform=r.render(m.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=o("",this.out.columns),this.complete(this.render),this.render()}set fallback(m){this._fb=Number.isSafeInteger(parseInt(m))?parseInt(m):m}get fallback(){let m;return typeof this._fb=="number"?m=this.choices[this._fb]:typeof this._fb=="string"&&(m={title:this._fb}),m||this._fb||{title:this.i18n.noMatches}}moveSelect(m){this.select=m,this.suggestions.length>0?this.value=l(this.suggestions,m):this.value=this.fallback.value,this.fire()}complete(m){var w=this;return n(function*(){const x=w.completing=w.suggest(w.input,w.choices),y=yield x;if(w.completing!==x)return;w.suggestions=y.map(($,P,O)=>({title:c(O,P),value:l(O,P),description:$.description})),w.completing=!1;const S=Math.max(y.length-1,0);w.moveSelect(Math.min(S,w.select)),m&&m()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
34
|
-
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
35
|
-
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
36
|
-
`),this.close()}_(m,w){let x=this.input.slice(0,this.cursor),y=this.input.slice(this.cursor);this.input=`${x}${m}${y}`,this.cursor=x.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let m=this.input.slice(0,this.cursor-1),w=this.input.slice(this.cursor);this.input=`${m}${w}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let m=this.input.slice(0,this.cursor),w=this.input.slice(this.cursor+1);this.input=`${m}${w}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(m,w,x,y){let S,$=x?i.arrowUp:y?i.arrowDown:" ",P=w?u.cyan().underline(m.title):m.title;return $=(w?u.cyan(i.pointer)+" ":" ")+$,m.description&&(S=` - ${m.description}`,($.length+P.length+S.length>=this.out.columns||m.description.split(/\r?\n/).length>1)&&(S=`
|
|
37
|
-
`+d(m.description,{margin:3,width:this.out.columns}))),$+" "+P+u.gray(S||"")}render(){if(this.closed)return;this.firstRender?this.out.write(s.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let m=f(this.select,this.choices.length,this.limit),w=m.startIndex,x=m.endIndex;if(this.outputText=[r.symbol(this.done,this.aborted,this.exited),u.bold(this.msg),r.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const y=this.suggestions.slice(w,x).map((S,$)=>this.renderOption(S,this.select===$+w,$===0&&w>0,$+w===x-1&&x<this.choices.length)).join(`
|
|
38
|
-
`);this.outputText+=`
|
|
39
|
-
`+(y||u.gray(this.fallback.title))}this.out.write(a.line+s.to(0)+this.outputText)}}return ke=v,ke}var Le,Or;function as(){if(Or)return Le;Or=1;const e=R(),n=E(),u=n.cursor,t=$r(),h=N(),a=h.clear,s=h.style,g=h.figures;class r extends t{constructor(i={}){i.overrideRender=!0,super(i),this.inputValue="",this.clear=a("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(i=>i.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const i=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(f=>this.inputValue?!!(typeof f.title=="string"&&f.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof f.value=="string"&&f.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const d=this.filteredOptions.findIndex(f=>f===i);this.cursor=d<0?0:d,this.render()}handleSpaceToggle(){const i=this.filteredOptions[this.cursor];if(i.selected)i.selected=!1,this.render();else{if(i.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();i.selected=!0,this.render()}}handleInputChange(i){this.inputValue=this.inputValue+i,this.updateFilteredOptions()}_(i,d){i===" "?this.handleSpaceToggle():this.handleInputChange(i)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
40
|
-
Instructions:
|
|
41
|
-
${g.arrowUp}/${g.arrowDown}: Highlight option
|
|
42
|
-
${g.arrowLeft}/${g.arrowRight}/[space]: Toggle selection
|
|
43
|
-
[a,b,c]/delete: Filter choices
|
|
44
|
-
enter/return: Complete answer
|
|
45
|
-
`:""}renderCurrentInput(){return`
|
|
46
|
-
Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
|
|
47
|
-
`}renderOption(i,d,f){let l;return d.disabled?l=i===f?e.gray().underline(d.title):e.strikethrough().gray(d.title):l=i===f?e.cyan().underline(d.title):d.title,(d.selected?e.green(g.radioOn):g.radioOff)+" "+l}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const i=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&i.push(e.yellow(this.warn)),i.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(u.hide),super.render();let i=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(i+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),i+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+i),this.clear=a(i,this.out.columns)}}return Le=r,Le}var Be,Pr;function cs(){if(Pr)return Be;Pr=1;const e=R(),n=L(),u=N(),t=u.style,h=u.clear,a=E(),s=a.erase,g=a.cursor;class r extends n{constructor(i={}){super(i),this.msg=i.message,this.value=i.initial,this.initialValue=!!i.initial,this.yesMsg=i.yes||"yes",this.yesOption=i.yesOption||"(Y/n)",this.noMsg=i.no||"no",this.noOption=i.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
48
|
-
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
49
|
-
`),this.close()}_(i,d){return i.toLowerCase()==="y"?(this.value=!0,this.submit()):i.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(g.hide):this.out.write(h(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(s.line+g.to(0)+this.outputText))}}return Be=r,Be}var Ve,Tr;function ds(){return Tr||(Tr=1,Ve={TextPrompt:Ji(),SelectPrompt:Ki(),TogglePrompt:Zi(),DatePrompt:hs(),NumberPrompt:ls(),MultiselectPrompt:$r(),AutocompletePrompt:us(),AutocompleteMultiselectPrompt:as(),ConfirmPrompt:cs()}),Ve}var qr;function fs(){return qr||(qr=1,function(e){const n=e,u=ds(),t=s=>s;function h(s,g,r={}){return new Promise((o,i)=>{const d=new u[s](g),f=r.onAbort||t,l=r.onSubmit||t,c=r.onExit||t;d.on("state",g.onState||t),d.on("submit",b=>o(l(b))),d.on("exit",b=>o(c(b))),d.on("abort",b=>i(f(b)))})}n.text=s=>h("TextPrompt",s),n.password=s=>(s.style="password",n.text(s)),n.invisible=s=>(s.style="invisible",n.text(s)),n.number=s=>h("NumberPrompt",s),n.date=s=>h("DatePrompt",s),n.confirm=s=>h("ConfirmPrompt",s),n.list=s=>{const g=s.separator||",";return h("TextPrompt",s,{onSubmit:r=>r.split(g).map(o=>o.trim())})},n.toggle=s=>h("TogglePrompt",s),n.select=s=>h("SelectPrompt",s),n.multiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(o=>o.selected).map(o=>o.value);return h("MultiselectPrompt",s,{onAbort:g,onSubmit:g})},n.autocompleteMultiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(o=>o.selected).map(o=>o.value);return h("AutocompleteMultiselectPrompt",s,{onAbort:g,onSubmit:g})};const a=(s,g)=>Promise.resolve(g.filter(r=>r.title.slice(0,s.length).toLowerCase()===s.toLowerCase()));n.autocomplete=s=>(s.suggest=s.suggest||a,s.choices=[].concat(s.choices||[]),h("AutocompletePrompt",s))}(ce)),ce}var Ue,Cr;function ps(){if(Cr)return Ue;Cr=1;function e(v,p){var m=Object.keys(v);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(v);p&&(w=w.filter(function(x){return Object.getOwnPropertyDescriptor(v,x).enumerable})),m.push.apply(m,w)}return m}function n(v){for(var p=1;p<arguments.length;p++){var m=arguments[p]!=null?arguments[p]:{};p%2?e(Object(m),!0).forEach(function(w){u(v,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(m)):e(Object(m)).forEach(function(w){Object.defineProperty(v,w,Object.getOwnPropertyDescriptor(m,w))})}return v}function u(v,p,m){return p in v?Object.defineProperty(v,p,{value:m,enumerable:!0,configurable:!0,writable:!0}):v[p]=m,v}function t(v,p){var m=typeof Symbol<"u"&&v[Symbol.iterator]||v["@@iterator"];if(!m){if(Array.isArray(v)||(m=h(v))||p){m&&(v=m);var w=0,x=function(){};return{s:x,n:function(){return w>=v.length?{done:!0}:{done:!1,value:v[w++]}},e:function(O){throw O},f:x}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
50
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var y=!0,S=!1,$;return{s:function(){m=m.call(v)},n:function(){var O=m.next();return y=O.done,O},e:function(O){S=!0,$=O},f:function(){try{!y&&m.return!=null&&m.return()}finally{if(S)throw $}}}}function h(v,p){if(v){if(typeof v=="string")return a(v,p);var m=Object.prototype.toString.call(v).slice(8,-1);if(m==="Object"&&v.constructor&&(m=v.constructor.name),m==="Map"||m==="Set")return Array.from(v);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return a(v,p)}}function a(v,p){(p==null||p>v.length)&&(p=v.length);for(var m=0,w=new Array(p);m<p;m++)w[m]=v[m];return w}function s(v,p,m,w,x,y,S){try{var $=v[y](S),P=$.value}catch(O){m(O);return}$.done?p(P):Promise.resolve(P).then(w,x)}function g(v){return function(){var p=this,m=arguments;return new Promise(function(w,x){var y=v.apply(p,m);function S(P){s(y,w,x,S,$,"next",P)}function $(P){s(y,w,x,S,$,"throw",P)}S(void 0)})}}const r=fs(),o=["suggest","format","onState","validate","onRender","type"],i=()=>{};function d(){return f.apply(this,arguments)}function f(){return f=g(function*(v=[],{onSubmit:p=i,onCancel:m=i}={}){const w={},x=d._override||{};v=[].concat(v);let y,S,$,P,O,M;const T=function(){var A=g(function*(D,U,Rt=!1){if(!(!Rt&&D.validate&&D.validate(U)!==!0))return D.format?yield D.format(U,w):U});return function(U,Rt){return A.apply(this,arguments)}}();var C=t(v),q;try{for(C.s();!(q=C.n()).done;){S=q.value;var _=S;if(P=_.name,O=_.type,typeof O=="function"&&(O=yield O(y,n({},w),S),S.type=O),!!O){for(let A in S){if(o.includes(A))continue;let D=S[A];S[A]=typeof D=="function"?yield D(y,n({},w),M):D}if(M=S,typeof S.message!="string")throw new Error("prompt message is required");var F=S;if(P=F.name,O=F.type,r[O]===void 0)throw new Error(`prompt type (${O}) is not defined`);if(x[S.name]!==void 0&&(y=yield T(S,x[S.name]),y!==void 0)){w[P]=y;continue}try{y=d._injected?l(d._injected,S.initial):yield r[O](S),w[P]=y=yield T(S,y,!0),$=yield p(S,y,w)}catch{$=!(yield m(S,w))}if($)return w}}}catch(A){C.e(A)}finally{C.f()}return w}),f.apply(this,arguments)}function l(v,p){const m=v.shift();if(m instanceof Error)throw m;return m===void 0?p:m}function c(v){d._injected=(d._injected||[]).concat(v)}function b(v){d._override=Object.assign({},v)}return Ue=Object.assign(d,{prompt:d,prompts:r,inject:c,override:b}),Ue}var We={},Ge,Rr;function ms(){return Rr||(Rr=1,Ge=(e,n)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(n){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),Ge}var ze,Er;function Je(){return Er||(Er=1,ze=e=>{const n=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),u=new RegExp(n,"g");return typeof e=="string"?e.replace(u,""):e}),ze}var Ke,_r;function gs(){if(_r)return Ke;_r=1;const e=Je(),{erase:n,cursor:u}=E(),t=h=>[...e(h)].length;return Ke=function(h,a){if(!a)return n.line+u.to(0);let s=0;const g=h.split(/\r?\n/);for(let r of g)s+=1+Math.floor(Math.max(t(r)-1,0)/a);return n.lines(s)},Ke}var Ze,Dr;function Ir(){if(Dr)return Ze;Dr=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},n={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return Ze=process.platform==="win32"?n:e,Ze}var Xe,Ar;function vs(){if(Ar)return Xe;Ar=1;const e=R(),n=Ir(),u=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"\u{1F603}".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),t=r=>u[r]||u.default,h=Object.freeze({aborted:e.red(n.cross),done:e.green(n.tick),exited:e.yellow(n.cross),default:e.cyan("?")});return Xe={styles:u,render:t,symbols:h,symbol:(r,o,i)=>o?h.aborted:i?h.exited:r?h.done:h.default,delimiter:r=>e.gray(r?n.ellipsis:n.pointerSmall),item:(r,o)=>e.gray(r?o?n.pointerSmall:"+":n.line)},Xe}var Qe,jr;function bs(){if(jr)return Qe;jr=1;const e=Je();return Qe=function(n,u){let t=String(e(n)||"").split(/\r?\n/);return u?t.map(h=>Math.ceil(h.length/u)).reduce((h,a)=>h+a):t.length},Qe}var et,Fr;function ws(){return Fr||(Fr=1,et=(e,n={})=>{const u=Number.isSafeInteger(parseInt(n.margin))?new Array(parseInt(n.margin)).fill(" ").join(""):n.margin||"",t=n.width;return(e||"").split(/\r?\n/g).map(h=>h.split(/\s+/g).reduce((a,s)=>(s.length+u.length>=t||a[a.length-1].length+s.length+1<t?a[a.length-1]+=` ${s}`:a.push(`${u}${s}`),a),[u]).join(`
|
|
51
|
-
`)).join(`
|
|
52
|
-
`)}),et}var tt,Nr;function ys(){return Nr||(Nr=1,tt=(e,n,u)=>{u=u||n;let t=Math.min(n-u,e-Math.floor(u/2));t<0&&(t=0);let h=Math.min(t+u,n);return{startIndex:t,endIndex:h}}),tt}var rt,Yr;function Y(){return Yr||(Yr=1,rt={action:ms(),clear:gs(),style:vs(),strip:Je(),figures:Ir(),lines:bs(),wrap:ws(),entriesToDisplay:ys()}),rt}var it,Hr;function B(){if(Hr)return it;Hr=1;const e=Et,{action:n}=Y(),u=_t,{beep:t,cursor:h}=E(),a=R();class s extends u{constructor(r={}){super(),this.firstRender=!0,this.in=r.stdin||process.stdin,this.out=r.stdout||process.stdout,this.onRender=(r.onRender||(()=>{})).bind(this);const o=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,o),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,d=(f,l)=>{let c=n(l,i);c===!1?this._&&this._(f,l):typeof this[c]=="function"?this[c](l):this.bell()};this.close=()=>{this.out.write(h.show),this.in.removeListener("keypress",d),this.in.isTTY&&this.in.setRawMode(!1),o.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",d)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(t)}render(){this.onRender(a),this.firstRender&&(this.firstRender=!1)}}return it=s,it}var st,kr;function xs(){if(kr)return st;kr=1;const e=R(),n=B(),{erase:u,cursor:t}=E(),{style:h,clear:a,lines:s,figures:g}=Y();class r extends n{constructor(i={}){super(i),this.transform=h.render(i.style),this.scale=this.transform.scale,this.msg=i.message,this.initial=i.initial||"",this.validator=i.validate||(()=>!0),this.value="",this.errorMsg=i.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=a("",this.out.columns),this.render()}set value(i){!i&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(i)),this._value=i,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
53
|
-
`),this.close()}async validate(){let i=await this.validator(this.value);typeof i=="string"&&(this.errorMsg=i,i=!1),this.error=!i}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
54
|
-
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(i){this.placeholder||(this.cursor=this.cursor+i,this.cursorOffset+=i)}_(i,d){let f=this.value.slice(0,this.cursor),l=this.value.slice(this.cursor);this.value=`${f}${i}${l}`,this.red=!1,this.cursor=this.placeholder?0:f.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let i=this.value.slice(0,this.cursor-1),d=this.value.slice(this.cursor);this.value=`${i}${d}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let i=this.value.slice(0,this.cursor),d=this.value.slice(this.cursor+1);this.value=`${i}${d}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(t.down(s(this.outputError,this.out.columns)-1)+a(this.outputError,this.out.columns)),this.out.write(a(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),e.bold(this.msg),h.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
55
|
-
`).reduce((i,d,f)=>i+`
|
|
56
|
-
${f?" ":g.pointerSmall} ${e.red().italic(d)}`,"")),this.out.write(u.line+t.to(0)+this.outputText+t.save+this.outputError+t.restore+t.move(this.cursorOffset,0)))}}return st=r,st}var nt,Lr;function Ss(){if(Lr)return nt;Lr=1;const e=R(),n=B(),{style:u,clear:t,figures:h,wrap:a,entriesToDisplay:s}=Y(),{cursor:g}=E();class r extends n{constructor(i={}){super(i),this.msg=i.message,this.hint=i.hint||"- Use arrow-keys. Return to submit.",this.warn=i.warn||"- This option is disabled",this.cursor=i.initial||0,this.choices=i.choices.map((d,f)=>(typeof d=="string"&&(d={title:d,value:f}),{title:d&&(d.title||d.value||d),value:d&&(d.value===void 0?f:d.value),description:d&&d.description,selected:d&&d.selected,disabled:d&&d.disabled})),this.optionsPerPage=i.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=t("",this.out.columns),this.render()}moveCursor(i){this.cursor=i,this.value=this.choices[i].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
57
|
-
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
58
|
-
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(i,d){if(i===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(g.hide):this.out.write(t(this.outputText,this.out.columns)),super.render();let{startIndex:i,endIndex:d}=s(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[u.symbol(this.done,this.aborted),e.bold(this.msg),u.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
59
|
-
`;for(let f=i;f<d;f++){let l,c,b="",v=this.choices[f];f===i&&i>0?c=h.arrowUp:f===d-1&&d<this.choices.length?c=h.arrowDown:c=" ",v.disabled?(l=this.cursor===f?e.gray().underline(v.title):e.strikethrough().gray(v.title),c=(this.cursor===f?e.bold().gray(h.pointer)+" ":" ")+c):(l=this.cursor===f?e.cyan().underline(v.title):v.title,c=(this.cursor===f?e.cyan(h.pointer)+" ":" ")+c,v.description&&this.cursor===f&&(b=` - ${v.description}`,(c.length+l.length+b.length>=this.out.columns||v.description.split(/\r?\n/).length>1)&&(b=`
|
|
60
|
-
`+a(v.description,{margin:3,width:this.out.columns})))),this.outputText+=`${c} ${l}${e.gray(b)}
|
|
61
|
-
`}}this.out.write(this.outputText)}}return nt=r,nt}var ot,Br;function $s(){if(Br)return ot;Br=1;const e=R(),n=B(),{style:u,clear:t}=Y(),{cursor:h,erase:a}=E();class s extends n{constructor(r={}){super(r),this.msg=r.message,this.value=!!r.initial,this.active=r.active||"on",this.inactive=r.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
62
|
-
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
63
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(r,o){if(r===" ")this.value=!this.value;else if(r==="1")this.value=!0;else if(r==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(h.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[u.symbol(this.done,this.aborted),e.bold(this.msg),u.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(a.line+h.to(0)+this.outputText))}}return ot=s,ot}var ht,Vr;function k(){if(Vr)return ht;Vr=1;class e{constructor({token:u,date:t,parts:h,locales:a}){this.token=u,this.date=t||new Date,this.parts=h||[this],this.locales=a||{}}up(){}down(){}next(){const u=this.parts.indexOf(this);return this.parts.find((t,h)=>h>u&&t instanceof e)}setTo(u){}prev(){let u=[].concat(this.parts).reverse();const t=u.indexOf(this);return u.find((h,a)=>a>t&&h instanceof e)}toString(){return String(this.date)}}return ht=e,ht}var lt,Ur;function Ms(){if(Ur)return lt;Ur=1;const e=k();class n extends e{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}return lt=n,lt}var ut,Wr;function Os(){if(Wr)return ut;Wr=1;const e=k(),n=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class u extends e{constructor(h={}){super(h)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(h){this.date.setDate(parseInt(h.substr(-2)))}toString(){let h=this.date.getDate(),a=this.date.getDay();return this.token==="DD"?String(h).padStart(2,"0"):this.token==="Do"?h+n(h):this.token==="d"?a+1:this.token==="ddd"?this.locales.weekdaysShort[a]:this.token==="dddd"?this.locales.weekdays[a]:h}}return ut=u,ut}var at,Gr;function Ps(){if(Gr)return at;Gr=1;const e=k();class n extends e{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}}return at=n,at}var ct,zr;function Ts(){if(zr)return ct;zr=1;const e=k();class n extends e{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return ct=n,ct}var dt,Jr;function qs(){if(Jr)return dt;Jr=1;const e=k();class n extends e{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}return dt=n,dt}var ft,Kr;function Cs(){if(Kr)return ft;Kr=1;const e=k();class n extends e{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),h=this.token.length;return h===2?String(t+1).padStart(2,"0"):h===3?this.locales.monthsShort[t]:h===4?this.locales.months[t]:String(t+1)}}return ft=n,ft}var pt,Zr;function Rs(){if(Zr)return pt;Zr=1;const e=k();class n extends e{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}return pt=n,pt}var mt,Xr;function Es(){if(Xr)return mt;Xr=1;const e=k();class n extends e{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}return mt=n,mt}var gt,Qr;function _s(){return Qr||(Qr=1,gt={DatePart:k(),Meridiem:Ms(),Day:Os(),Hours:Ps(),Milliseconds:Ts(),Minutes:qs(),Month:Cs(),Seconds:Rs(),Year:Es()}),gt}var vt,ei;function Ds(){if(ei)return vt;ei=1;const e=R(),n=B(),{style:u,clear:t,figures:h}=Y(),{erase:a,cursor:s}=E(),{DatePart:g,Meridiem:r,Day:o,Hours:i,Milliseconds:d,Minutes:f,Month:l,Seconds:c,Year:b}=_s(),v=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,p={1:({token:x})=>x.replace(/\\(.)/g,"$1"),2:x=>new o(x),3:x=>new l(x),4:x=>new b(x),5:x=>new r(x),6:x=>new i(x),7:x=>new f(x),8:x=>new c(x),9:x=>new d(x)},m={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class w extends n{constructor(y={}){super(y),this.msg=y.message,this.cursor=0,this.typed="",this.locales=Object.assign(m,y.locales),this._date=y.initial||new Date,this.errorMsg=y.error||"Please Enter A Valid Value",this.validator=y.validate||(()=>!0),this.mask=y.mask||"YYYY-MM-DD HH:mm:ss",this.clear=t("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(y){y&&this._date.setTime(y.getTime())}set mask(y){let S;for(this.parts=[];S=v.exec(y);){let P=S.shift(),O=S.findIndex(M=>M!=null);this.parts.push(O in p?p[O]({token:S[O]||P,date:this.date,parts:this.parts,locales:this.locales}):S[O]||P)}let $=this.parts.reduce((P,O)=>(typeof O=="string"&&typeof P[P.length-1]=="string"?P[P.length-1]+=O:P.push(O),P),[]);this.parts.splice(0),this.parts.push(...$),this.reset()}moveCursor(y){this.typed="",this.cursor=y,this.fire()}reset(){this.moveCursor(this.parts.findIndex(y=>y instanceof g)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
64
|
-
`),this.close()}async validate(){let y=await this.validator(this.value);typeof y=="string"&&(this.errorMsg=y,y=!1),this.error=!y}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
65
|
-
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let y=this.parts[this.cursor].prev();if(y==null)return this.bell();this.moveCursor(this.parts.indexOf(y)),this.render()}right(){let y=this.parts[this.cursor].next();if(y==null)return this.bell();this.moveCursor(this.parts.indexOf(y)),this.render()}next(){let y=this.parts[this.cursor].next();this.moveCursor(y?this.parts.indexOf(y):this.parts.findIndex(S=>S instanceof g)),this.render()}_(y){/\d/.test(y)&&(this.typed+=y,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[u.symbol(this.done,this.aborted),e.bold(this.msg),u.delimiter(!1),this.parts.reduce((y,S,$)=>y.concat($===this.cursor&&!this.done?e.cyan().underline(S.toString()):S),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
66
|
-
`).reduce((y,S,$)=>y+`
|
|
67
|
-
${$?" ":h.pointerSmall} ${e.red().italic(S)}`,"")),this.out.write(a.line+s.to(0)+this.outputText))}}return vt=w,vt}var bt,ti;function Is(){if(ti)return bt;ti=1;const e=R(),n=B(),{cursor:u,erase:t}=E(),{style:h,figures:a,clear:s,lines:g}=Y(),r=/[0-9]/,o=f=>f!==void 0,i=(f,l)=>{let c=Math.pow(10,l);return Math.round(f*c)/c};class d extends n{constructor(l={}){super(l),this.transform=h.render(l.style),this.msg=l.message,this.initial=o(l.initial)?l.initial:"",this.float=!!l.float,this.round=l.round||2,this.inc=l.increment||1,this.min=o(l.min)?l.min:-1/0,this.max=o(l.max)?l.max:1/0,this.errorMsg=l.error||"Please Enter A Valid Value",this.validator=l.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(l){!l&&l!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${i(l,this.round)}`),this._value=i(l,this.round)),this.fire()}get value(){return this._value}parse(l){return this.float?parseFloat(l):parseInt(l)}valid(l){return l==="-"||l==="."&&this.float||r.test(l)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let l=this.value;this.value=l!==""?l:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
68
|
-
`),this.close()}async validate(){let l=await this.validator(this.value);typeof l=="string"&&(this.errorMsg=l,l=!1),this.error=!l}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let l=this.value;this.value=l!==""?l:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
69
|
-
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let l=this.value.toString();if(l.length===0)return this.bell();this.value=this.parse(l=l.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(l,c){if(!this.valid(l))return this.bell();const b=Date.now();if(b-this.lastHit>1e3&&(this.typed=""),this.typed+=l,this.lastHit=b,this.color="cyan",l===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(u.down(g(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),e.bold(this.msg),h.delimiter(this.done),!this.done||!this.done&&!this.placeholder?e[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
70
|
-
`).reduce((l,c,b)=>l+`
|
|
71
|
-
${b?" ":a.pointerSmall} ${e.red().italic(c)}`,"")),this.out.write(t.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore))}}return bt=d,bt}var wt,ri;function ii(){if(ri)return wt;ri=1;const e=R(),{cursor:n}=E(),u=B(),{clear:t,figures:h,style:a,wrap:s,entriesToDisplay:g}=Y();class r extends u{constructor(i={}){super(i),this.msg=i.message,this.cursor=i.cursor||0,this.scrollIndex=i.cursor||0,this.hint=i.hint||"",this.warn=i.warn||"- This option is disabled -",this.minSelected=i.min,this.showMinError=!1,this.maxChoices=i.max,this.instructions=i.instructions,this.optionsPerPage=i.optionsPerPage||10,this.value=i.choices.map((d,f)=>(typeof d=="string"&&(d={title:d,value:f}),{title:d&&(d.title||d.value||d),description:d&&d.description,value:d&&(d.value===void 0?f:d.value),selected:d&&d.selected,disabled:d&&d.disabled})),this.clear=t("",this.out.columns),i.overrideRender||this.render()}reset(){this.value.map(i=>!i.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(i=>i.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
72
|
-
`),this.close()}submit(){const i=this.value.filter(d=>d.selected);this.minSelected&&i.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
73
|
-
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(i=>i.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const i=this.value[this.cursor];if(i.selected)i.selected=!1,this.render();else{if(i.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();i.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const i=!this.value[this.cursor].selected;this.value.filter(d=>!d.disabled).forEach(d=>d.selected=i),this.render()}_(i,d){if(i===" ")this.handleSpaceToggle();else if(i==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
74
|
-
Instructions:
|
|
75
|
-
${h.arrowUp}/${h.arrowDown}: Highlight option
|
|
76
|
-
${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection
|
|
77
|
-
`+(this.maxChoices===void 0?` a: Toggle all
|
|
78
|
-
`:"")+" enter/return: Complete answer":""}renderOption(i,d,f,l){const c=(d.selected?e.green(h.radioOn):h.radioOff)+" "+l+" ";let b,v;return d.disabled?b=i===f?e.gray().underline(d.title):e.strikethrough().gray(d.title):(b=i===f?e.cyan().underline(d.title):d.title,i===f&&d.description&&(v=` - ${d.description}`,(c.length+b.length+v.length>=this.out.columns||d.description.split(/\r?\n/).length>1)&&(v=`
|
|
79
|
-
`+s(d.description,{margin:c.length,width:this.out.columns})))),c+b+e.gray(v||"")}paginateOptions(i){if(i.length===0)return e.red("No matches for this query.");let{startIndex:d,endIndex:f}=g(this.cursor,i.length,this.optionsPerPage),l,c=[];for(let b=d;b<f;b++)b===d&&d>0?l=h.arrowUp:b===f-1&&f<i.length?l=h.arrowDown:l=" ",c.push(this.renderOption(this.cursor,i[b],b,l));return`
|
|
80
|
-
`+c.join(`
|
|
81
|
-
`)}renderOptions(i){return this.done?"":this.paginateOptions(i)}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const i=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&i.push(e.yellow(this.warn)),i.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let i=[a.symbol(this.done,this.aborted),e.bold(this.msg),a.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(i+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),i+=this.renderOptions(this.value),this.out.write(this.clear+i),this.clear=t(i,this.out.columns)}}return wt=r,wt}var yt,si;function As(){if(si)return yt;si=1;const e=R(),n=B(),{erase:u,cursor:t}=E(),{style:h,clear:a,figures:s,wrap:g,entriesToDisplay:r}=Y(),o=(l,c)=>l[c]&&(l[c].value||l[c].title||l[c]),i=(l,c)=>l[c]&&(l[c].title||l[c].value||l[c]),d=(l,c)=>{const b=l.findIndex(v=>v.value===c||v.title===c);return b>-1?b:void 0};class f extends n{constructor(c={}){super(c),this.msg=c.message,this.suggest=c.suggest,this.choices=c.choices,this.initial=typeof c.initial=="number"?c.initial:d(c.choices,c.initial),this.select=this.initial||c.cursor||0,this.i18n={noMatches:c.noMatches||"no matches found"},this.fallback=c.fallback||this.initial,this.clearFirst=c.clearFirst||!1,this.suggestions=[],this.input="",this.limit=c.limit||10,this.cursor=0,this.transform=h.render(c.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=a("",this.out.columns),this.complete(this.render),this.render()}set fallback(c){this._fb=Number.isSafeInteger(parseInt(c))?parseInt(c):c}get fallback(){let c;return typeof this._fb=="number"?c=this.choices[this._fb]:typeof this._fb=="string"&&(c={title:this._fb}),c||this._fb||{title:this.i18n.noMatches}}moveSelect(c){this.select=c,this.suggestions.length>0?this.value=o(this.suggestions,c):this.value=this.fallback.value,this.fire()}async complete(c){const b=this.completing=this.suggest(this.input,this.choices),v=await b;if(this.completing!==b)return;this.suggestions=v.map((m,w,x)=>({title:i(x,w),value:o(x,w),description:m.description})),this.completing=!1;const p=Math.max(v.length-1,0);this.moveSelect(Math.min(p,this.select)),c&&c()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
82
|
-
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
83
|
-
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
84
|
-
`),this.close()}_(c,b){let v=this.input.slice(0,this.cursor),p=this.input.slice(this.cursor);this.input=`${v}${c}${p}`,this.cursor=v.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let c=this.input.slice(0,this.cursor-1),b=this.input.slice(this.cursor);this.input=`${c}${b}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let c=this.input.slice(0,this.cursor),b=this.input.slice(this.cursor+1);this.input=`${c}${b}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(c,b,v,p){let m,w=v?s.arrowUp:p?s.arrowDown:" ",x=b?e.cyan().underline(c.title):c.title;return w=(b?e.cyan(s.pointer)+" ":" ")+w,c.description&&(m=` - ${c.description}`,(w.length+x.length+m.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(m=`
|
|
85
|
-
`+g(c.description,{margin:3,width:this.out.columns}))),w+" "+x+e.gray(m||"")}render(){if(this.closed)return;this.firstRender?this.out.write(t.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let{startIndex:c,endIndex:b}=r(this.select,this.choices.length,this.limit);if(this.outputText=[h.symbol(this.done,this.aborted,this.exited),e.bold(this.msg),h.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const v=this.suggestions.slice(c,b).map((p,m)=>this.renderOption(p,this.select===m+c,m===0&&c>0,m+c===b-1&&b<this.choices.length)).join(`
|
|
86
|
-
`);this.outputText+=`
|
|
87
|
-
`+(v||e.gray(this.fallback.title))}this.out.write(u.line+t.to(0)+this.outputText)}}return yt=f,yt}var xt,ni;function js(){if(ni)return xt;ni=1;const e=R(),{cursor:n}=E(),u=ii(),{clear:t,style:h,figures:a}=Y();class s extends u{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=t("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const o=this.filteredOptions.findIndex(i=>i===r);this.cursor=o<0?0:o,this.render()}handleSpaceToggle(){const r=this.filteredOptions[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(o=>o.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r,this.updateFilteredOptions()}_(r,o){r===" "?this.handleSpaceToggle():this.handleInputChange(r)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
88
|
-
Instructions:
|
|
89
|
-
${a.arrowUp}/${a.arrowDown}: Highlight option
|
|
90
|
-
${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection
|
|
91
|
-
[a,b,c]/delete: Filter choices
|
|
92
|
-
enter/return: Complete answer
|
|
93
|
-
`:""}renderCurrentInput(){return`
|
|
94
|
-
Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
|
|
95
|
-
`}renderOption(r,o,i){let d;return o.disabled?d=r===i?e.gray().underline(o.title):e.strikethrough().gray(o.title):d=r===i?e.cyan().underline(o.title):o.title,(o.selected?e.green(a.radioOn):a.radioOff)+" "+d}renderDoneOrInstructions(){if(this.done)return this.value.filter(o=>o.selected).map(o=>o.title).join(", ");const r=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(e.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let r=[h.symbol(this.done,this.aborted),e.bold(this.msg),h.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+r),this.clear=t(r,this.out.columns)}}return xt=s,xt}var St,oi;function Fs(){if(oi)return St;oi=1;const e=R(),n=B(),{style:u,clear:t}=Y(),{erase:h,cursor:a}=E();class s extends n{constructor(r={}){super(r),this.msg=r.message,this.value=r.initial,this.initialValue=!!r.initial,this.yesMsg=r.yes||"yes",this.yesOption=r.yesOption||"(Y/n)",this.noMsg=r.no||"no",this.noOption=r.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
96
|
-
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
97
|
-
`),this.close()}_(r,o){return r.toLowerCase()==="y"?(this.value=!0,this.submit()):r.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(a.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[u.symbol(this.done,this.aborted),e.bold(this.msg),u.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(h.line+a.to(0)+this.outputText))}}return St=s,St}var $t,hi;function Ns(){return hi||(hi=1,$t={TextPrompt:xs(),SelectPrompt:Ss(),TogglePrompt:$s(),DatePrompt:Ds(),NumberPrompt:Is(),MultiselectPrompt:ii(),AutocompletePrompt:As(),AutocompleteMultiselectPrompt:js(),ConfirmPrompt:Fs()}),$t}var li;function Ys(){return li||(li=1,function(e){const n=e,u=Ns(),t=s=>s;function h(s,g,r={}){return new Promise((o,i)=>{const d=new u[s](g),f=r.onAbort||t,l=r.onSubmit||t,c=r.onExit||t;d.on("state",g.onState||t),d.on("submit",b=>o(l(b))),d.on("exit",b=>o(c(b))),d.on("abort",b=>i(f(b)))})}n.text=s=>h("TextPrompt",s),n.password=s=>(s.style="password",n.text(s)),n.invisible=s=>(s.style="invisible",n.text(s)),n.number=s=>h("NumberPrompt",s),n.date=s=>h("DatePrompt",s),n.confirm=s=>h("ConfirmPrompt",s),n.list=s=>{const g=s.separator||",";return h("TextPrompt",s,{onSubmit:r=>r.split(g).map(o=>o.trim())})},n.toggle=s=>h("TogglePrompt",s),n.select=s=>h("SelectPrompt",s),n.multiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(o=>o.selected).map(o=>o.value);return h("MultiselectPrompt",s,{onAbort:g,onSubmit:g})},n.autocompleteMultiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(o=>o.selected).map(o=>o.value);return h("AutocompleteMultiselectPrompt",s,{onAbort:g,onSubmit:g})};const a=(s,g)=>Promise.resolve(g.filter(r=>r.title.slice(0,s.length).toLowerCase()===s.toLowerCase()));n.autocomplete=s=>(s.suggest=s.suggest||a,s.choices=[].concat(s.choices||[]),h("AutocompletePrompt",s))}(We)),We}var Mt,ui;function Hs(){if(ui)return Mt;ui=1;const e=Ys(),n=["suggest","format","onState","validate","onRender","type"],u=()=>{};async function t(g=[],{onSubmit:r=u,onCancel:o=u}={}){const i={},d=t._override||{};g=[].concat(g);let f,l,c,b,v,p;const m=async(w,x,y=!1)=>{if(!(!y&&w.validate&&w.validate(x)!==!0))return w.format?await w.format(x,i):x};for(l of g)if({name:b,type:v}=l,typeof v=="function"&&(v=await v(f,{...i},l),l.type=v),!!v){for(let w in l){if(n.includes(w))continue;let x=l[w];l[w]=typeof x=="function"?await x(f,{...i},p):x}if(p=l,typeof l.message!="string")throw new Error("prompt message is required");if({name:b,type:v}=l,e[v]===void 0)throw new Error(`prompt type (${v}) is not defined`);if(d[l.name]!==void 0&&(f=await m(l,d[l.name]),f!==void 0)){i[b]=f;continue}try{f=t._injected?h(t._injected,l.initial):await e[v](l),i[b]=f=await m(l,f,!0),c=await r(l,f,i)}catch{c=!await o(l,i)}if(c)return i}return i}function h(g,r){const o=g.shift();if(o instanceof Error)throw o;return o===void 0?r:o}function a(g){t._injected=(t._injected||[]).concat(g)}function s(g){t._override=Object.assign({},g)}return Mt=Object.assign(t,{prompt:t,prompts:e,inject:a,override:s}),Mt}var Ot,ai;function ks(){if(ai)return Ot;ai=1;function e(n){n=(Array.isArray(n)?n:n.split(".")).map(Number);let u=0,t=process.versions.node.split(".").map(Number);for(;u<n.length;u++){if(t[u]>n[u])return!1;if(n[u]>t[u])return!0}return!1}return Ot=e("8.6.0")?ps():Hs(),Ot}var Ls=ks();const ci=z(Ls),{blue:Pt,blueBright:un,cyan:Bs,green:di,greenBright:an,magenta:cn,red:fi,redBright:dn,reset:W,yellow:Vs}=Li,G=Yi(process.argv.slice(2),{default:{help:!1},alias:{h:"help",t:"template"},string:["_"]}),Tt=process.cwd(),Us=`Usage: create-vite [OPTION]... [DIRECTORY]
|
|
98
|
-
|
|
99
|
-
Create a new Vite project in JavaScript or TypeScript.
|
|
100
|
-
With no arguments, start the CLI in interactive mode.
|
|
101
|
-
|
|
102
|
-
Options:
|
|
103
|
-
-t, --template NAME use a specific template
|
|
104
|
-
|
|
105
|
-
Available templates:
|
|
106
|
-
${Vs("react-ts-biomejs-rsbuild react")}
|
|
107
|
-
${di("react-ts-biomejs-vite react")}`,qt=[{name:"react",display:"React",color:Bs,variants:[{name:"react-rsbuild",display:"react + ts + biomejs + rsbuild",color:Pt}]},{name:"vue",display:"Vue",color:di,variants:[{name:"vue-rsbuild",display:"vue + ts + biomejs + rsbuild",color:Pt},{name:"vue-rolldown-oxlint",display:"vue + ts + oxlint + vite-rolldown",color:Pt}]}],pi=qt.map(e=>e.variants.map(n=>n.name)).reduce((e,n)=>e.concat(n),[]),Ws={_gitignore:".gitignore"},Ct="template-project";async function Gs(){const e=mi(G._[0]),n=G.template||G.t;if(G.help){console.log(Us);return}let u=e||Ct;const t=()=>j.basename(j.resolve(u));let h;ci.override({overwrite:G.overwrite});try{h=await ci([{type:e?null:"text",name:"projectName",message:W("Project name:"),initial:Ct,onState:y=>{u=mi(y.value)||Ct}},{type:()=>!I.existsSync(u)||Ks(u)?null:"select",name:"overwrite",message:()=>`${u==="."?"Current directory":`Target directory "${u}"`} is not empty. Please choose how to proceed:`,initial:0,choices:[{title:"Cancel operation",value:"no"},{title:"Remove existing files and continue",value:"yes"},{title:"Ignore files and continue",value:"ignore"}]},{type:(y,{overwrite:S})=>{if(S==="no")throw new Error(`${fi("\u2716")} Operation cancelled`);return null},name:"overwriteChecker"},{type:()=>vi(t())?null:"text",name:"packageName",message:W("Package name:"),initial:()=>zs(t()),validate:y=>vi(y)||"Invalid package.json name"},{type:n&&pi.includes(n)?null:"select",name:"framework",message:typeof n=="string"&&!pi.includes(n)?W(`"${n}" isn't a valid template. Please choose from below: `):W("Select a framework:"),initial:0,choices:qt.map(y=>{const S=y.color;return{title:S(y.display||y.name),value:y}})},{type:y=>typeof y=="object"?"select":null,name:"variant",message:W("Select a variant:"),choices:y=>y.variants.map(S=>{const $=S.color;return{title:$(S.display||S.name),value:S.name}})}],{onCancel:()=>{throw new Error(`${fi("\u2716")} Operation cancelled`)}})}catch(y){console.log(y.message);return}console.log(h);const{framework:a,overwrite:s,packageName:g,variant:r}=h,o=j.join(Tt,u);s==="yes"?Zs(o):I.existsSync(o)||I.mkdirSync(o,{recursive:!0});let i=r||a?.name||n,d=!1;i.includes("-swc")&&(d=!0,i=i.replace("-swc",""));const f=Xs(process.env.npm_config_user_agent),l=f?f.name:"npm",c=l==="yarn"&&f?.version.startsWith("1."),{customCommand:b}=qt.flatMap(y=>y.variants).find(y=>y.name===i)??{};if(b){const y=b.replace(/^npm create /,()=>l==="bun"?"bun x create-":`${l} create `).replace("@latest",()=>c?"":"@latest").replace(/^npm exec/,()=>l==="pnpm"?"pnpm dlx":l==="yarn"&&!c?"yarn dlx":l==="bun"?"bun x":"npm exec"),[S,...$]=y.split(" "),P=$.map(M=>M.replace("TARGET_DIR",()=>u)),{status:O}=ji.sync(S,P,{stdio:"inherit"});process.exit(O??0)}console.log(`
|
|
108
|
-
Scaffolding project in ${o}...`);const v=j.resolve(wi(import.meta.url),"../..",`template-${i}`),p=(y,S)=>{const $=j.join(o,Ws[y]??y);S?I.writeFileSync($,S):gi(j.join(v,y),$)},m=I.readdirSync(v);for(const y of m.filter(S=>S!=="package.json"))p(y);const w=JSON.parse(I.readFileSync(j.join(v,"package.json"),"utf-8"));w.name=g||t(),p("package.json",`${JSON.stringify(w,null,2)}
|
|
109
|
-
`),d&&Qs(o,i.endsWith("-ts"));const x=j.relative(Tt,o);switch(console.log(`
|
|
110
|
-
Done. Now run:
|
|
111
|
-
`),o!==Tt&&console.log(` cd ${x.includes(" ")?`"${x}"`:x}`),l){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${l} install`),console.log(` ${l} run dev`);break}console.log()}function mi(e){return e?.trim().replace(/\/+$/g,"")}function gi(e,n){I.statSync(e).isDirectory()?Js(e,n):I.copyFileSync(e,n)}function vi(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function zs(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Js(e,n){I.mkdirSync(n,{recursive:!0});for(const u of I.readdirSync(e)){const t=j.resolve(e,u),h=j.resolve(n,u);gi(t,h)}}function Ks(e){const n=I.readdirSync(e);return n.length===0||n.length===1&&n[0]===".git"}function Zs(e){if(I.existsSync(e))for(const n of I.readdirSync(e))n!==".git"&&I.rmSync(j.resolve(e,n),{recursive:!0,force:!0})}function Xs(e){if(!e)return;const n=e.split(" ")[0].split("/");return{name:n[0],version:n[1]}}function Qs(e,n){bi(j.resolve(e,"package.json"),u=>u.replace(/"@vitejs\/plugin-react": ".+?"/,'"@vitejs/plugin-react-swc": "^3.5.0"')),bi(j.resolve(e,`vite.config.${n?"ts":"js"}`),u=>u.replace("@vitejs/plugin-react","@vitejs/plugin-react-swc"))}function bi(e,n){const u=I.readFileSync(e,"utf-8");I.writeFileSync(e,n(u),"utf-8")}Gs().catch(e=>{console.error(e)});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
registry=https://registry.npmmirror.com/
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
pnpm-debug.log*
|
|
8
|
-
lerna-debug.log*
|
|
9
|
-
|
|
10
|
-
node_modules
|
|
11
|
-
dist
|
|
12
|
-
dist-ssr
|
|
13
|
-
*.local
|
|
14
|
-
|
|
15
|
-
# Editor directories and files
|
|
16
|
-
.vscode/*
|
|
17
|
-
!.vscode/extensions.json
|
|
18
|
-
.idea
|
|
19
|
-
.DS_Store
|
|
20
|
-
*.suo
|
|
21
|
-
*.ntvs*
|
|
22
|
-
*.njsproj
|
|
23
|
-
*.sln
|
|
24
|
-
*.sw?
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
registry=https://registry.npmmirror.com/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{template-react-rsbuild → template-react-rsbuild-biome}/src/layout/default/index.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/components/Icon/svg-icon.vue
RENAMED
|
File without changes
|
/package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/layout/default/index.vue
RENAMED
|
File without changes
|
|
File without changes
|
/package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/router/guard/index.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/router/modules/index.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/styles/variables.scss
RENAMED
|
File without changes
|
/package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/types/auto-import.d.ts
RENAMED
|
File without changes
|
/package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/types/components.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/views/home/index.vue
RENAMED
|
File without changes
|
/package/{template-vue-rolldown-oxlint → template-vue-rolldown-oxc}/src/views/model/index.vue
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{template-vue-rsbuild → template-vue-rsbuild-biome}/src/router/guard/permissionGuard.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|