@maizzle/framework 6.0.0-rc.1 → 6.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/bin/maizzle.mjs +1 -1
  2. package/dist/build.mjs +2 -1
  3. package/dist/build.mjs.map +1 -1
  4. package/dist/config/index.mjs +7 -0
  5. package/dist/config/index.mjs.map +1 -1
  6. package/dist/render/createRenderer.d.mts +2 -0
  7. package/dist/render/createRenderer.d.mts.map +1 -1
  8. package/dist/render/createRenderer.mjs +7 -2
  9. package/dist/render/createRenderer.mjs.map +1 -1
  10. package/dist/render/index.mjs +2 -1
  11. package/dist/render/index.mjs.map +1 -1
  12. package/dist/serve.mjs +2 -1
  13. package/dist/serve.mjs.map +1 -1
  14. package/dist/types/config.d.mts +3 -0
  15. package/dist/types/config.d.mts.map +1 -1
  16. package/node_modules/@clack/core/CHANGELOG.md +87 -4
  17. package/node_modules/@clack/core/README.md +1 -1
  18. package/node_modules/@clack/core/dist/index.d.mts +186 -48
  19. package/node_modules/@clack/core/dist/index.mjs +10 -14
  20. package/node_modules/@clack/core/dist/index.mjs.map +1 -1
  21. package/node_modules/@clack/core/package.json +7 -9
  22. package/node_modules/@clack/prompts/CHANGELOG.md +171 -7
  23. package/node_modules/@clack/prompts/README.md +66 -3
  24. package/node_modules/@clack/prompts/dist/index.d.mts +302 -76
  25. package/node_modules/@clack/prompts/dist/index.mjs +134 -84
  26. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
  27. package/node_modules/@clack/prompts/package.json +14 -10
  28. package/node_modules/citty/LICENSE +0 -15
  29. package/node_modules/citty/README.md +166 -69
  30. package/node_modules/citty/dist/index.d.mts +88 -56
  31. package/node_modules/citty/dist/index.mjs +399 -437
  32. package/node_modules/citty/package.json +28 -35
  33. package/node_modules/giget/README.md +59 -11
  34. package/node_modules/giget/dist/THIRD-PARTY-LICENSES.md +205 -0
  35. package/node_modules/giget/dist/_chunks/giget.mjs +508 -0
  36. package/node_modules/giget/dist/_chunks/libs/citty.mjs +269 -0
  37. package/node_modules/giget/dist/_chunks/libs/nypm.d.mts +1 -0
  38. package/node_modules/giget/dist/_chunks/libs/nypm.mjs +669 -0
  39. package/node_modules/giget/dist/_chunks/libs/tar.mjs +2931 -0
  40. package/node_modules/giget/dist/_chunks/rolldown-runtime.mjs +14 -0
  41. package/node_modules/giget/dist/cli.d.mts +1 -0
  42. package/node_modules/giget/dist/cli.mjs +89 -111
  43. package/node_modules/giget/dist/index.d.mts +46 -35
  44. package/node_modules/giget/dist/index.mjs +2 -22
  45. package/node_modules/giget/package.json +32 -45
  46. package/node_modules/maizzle/README.md +140 -0
  47. package/node_modules/maizzle/bin/maizzle.mjs +5 -0
  48. package/node_modules/maizzle/dist/commands/new.d.mts +7 -0
  49. package/node_modules/maizzle/dist/commands/new.mjs +278 -0
  50. package/node_modules/{@maizzle/cli → maizzle}/dist/index.d.mts +1 -1
  51. package/node_modules/maizzle/dist/index.mjs +44 -0
  52. package/node_modules/{commander → maizzle/node_modules/commander}/Readme.md +94 -67
  53. package/node_modules/{commander → maizzle/node_modules/commander}/lib/argument.js +5 -4
  54. package/node_modules/{commander → maizzle/node_modules/commander}/lib/command.js +154 -39
  55. package/node_modules/{commander → maizzle/node_modules/commander}/lib/help.js +77 -39
  56. package/node_modules/{commander → maizzle/node_modules/commander}/lib/option.js +16 -3
  57. package/node_modules/{commander → maizzle/node_modules/commander}/package-support.json +4 -1
  58. package/node_modules/{commander → maizzle/node_modules/commander}/package.json +8 -8
  59. package/node_modules/{commander → maizzle/node_modules/commander}/typings/index.d.ts +71 -3
  60. package/node_modules/{@maizzle/cli → maizzle}/package.json +13 -11
  61. package/node_modules/tinyexec/README.md +49 -3
  62. package/node_modules/tinyexec/dist/main.d.mts +25 -14
  63. package/node_modules/tinyexec/dist/main.mjs +148 -100
  64. package/node_modules/tinyexec/package.json +9 -8
  65. package/package.json +3 -3
  66. package/node_modules/@clack/core/dist/index.cjs +0 -15
  67. package/node_modules/@clack/core/dist/index.cjs.map +0 -1
  68. package/node_modules/@clack/core/dist/index.d.cts +0 -211
  69. package/node_modules/@clack/core/dist/index.d.ts +0 -211
  70. package/node_modules/@clack/prompts/dist/index.cjs +0 -87
  71. package/node_modules/@clack/prompts/dist/index.cjs.map +0 -1
  72. package/node_modules/@clack/prompts/dist/index.d.cts +0 -165
  73. package/node_modules/@clack/prompts/dist/index.d.ts +0 -165
  74. package/node_modules/@maizzle/cli/README.md +0 -58
  75. package/node_modules/@maizzle/cli/dist/index.mjs +0 -42
  76. package/node_modules/citty/dist/index.cjs +0 -475
  77. package/node_modules/citty/dist/index.d.cts +0 -80
  78. package/node_modules/citty/dist/index.d.ts +0 -80
  79. package/node_modules/consola/LICENSE +0 -47
  80. package/node_modules/consola/README.md +0 -352
  81. package/node_modules/consola/basic.d.ts +0 -1
  82. package/node_modules/consola/browser.d.ts +0 -1
  83. package/node_modules/consola/core.d.ts +0 -1
  84. package/node_modules/consola/dist/basic.cjs +0 -32
  85. package/node_modules/consola/dist/basic.d.cts +0 -23
  86. package/node_modules/consola/dist/basic.d.mts +0 -21
  87. package/node_modules/consola/dist/basic.d.ts +0 -23
  88. package/node_modules/consola/dist/basic.mjs +0 -24
  89. package/node_modules/consola/dist/browser.cjs +0 -84
  90. package/node_modules/consola/dist/browser.d.cts +0 -23
  91. package/node_modules/consola/dist/browser.d.mts +0 -21
  92. package/node_modules/consola/dist/browser.d.ts +0 -23
  93. package/node_modules/consola/dist/browser.mjs +0 -76
  94. package/node_modules/consola/dist/chunks/prompt.cjs +0 -288
  95. package/node_modules/consola/dist/chunks/prompt.mjs +0 -280
  96. package/node_modules/consola/dist/core.cjs +0 -517
  97. package/node_modules/consola/dist/core.d.cts +0 -459
  98. package/node_modules/consola/dist/core.d.mts +0 -459
  99. package/node_modules/consola/dist/core.d.ts +0 -459
  100. package/node_modules/consola/dist/core.mjs +0 -512
  101. package/node_modules/consola/dist/index.cjs +0 -663
  102. package/node_modules/consola/dist/index.d.cts +0 -24
  103. package/node_modules/consola/dist/index.d.mts +0 -22
  104. package/node_modules/consola/dist/index.d.ts +0 -24
  105. package/node_modules/consola/dist/index.mjs +0 -651
  106. package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +0 -75
  107. package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +0 -72
  108. package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +0 -288
  109. package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +0 -312
  110. package/node_modules/consola/dist/utils.cjs +0 -64
  111. package/node_modules/consola/dist/utils.d.cts +0 -286
  112. package/node_modules/consola/dist/utils.d.mts +0 -286
  113. package/node_modules/consola/dist/utils.d.ts +0 -286
  114. package/node_modules/consola/dist/utils.mjs +0 -54
  115. package/node_modules/consola/lib/index.cjs +0 -10
  116. package/node_modules/consola/package.json +0 -136
  117. package/node_modules/consola/utils.d.ts +0 -1
  118. package/node_modules/create-maizzle/README.md +0 -86
  119. package/node_modules/create-maizzle/bin/create-maizzle.mjs +0 -4
  120. package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +0 -340
  121. package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +0 -9
  122. package/node_modules/create-maizzle/node_modules/@clack/core/README.md +0 -22
  123. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +0 -349
  124. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +0 -11
  125. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +0 -1
  126. package/node_modules/create-maizzle/node_modules/@clack/core/package.json +0 -60
  127. package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +0 -576
  128. package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +0 -9
  129. package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +0 -270
  130. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +0 -391
  131. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +0 -137
  132. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
  133. package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +0 -65
  134. package/node_modules/create-maizzle/package.json +0 -47
  135. package/node_modules/create-maizzle/src/index.js +0 -242
  136. package/node_modules/defu/LICENSE +0 -21
  137. package/node_modules/defu/README.md +0 -171
  138. package/node_modules/defu/dist/defu.cjs +0 -77
  139. package/node_modules/defu/dist/defu.d.cts +0 -31
  140. package/node_modules/defu/dist/defu.d.mts +0 -29
  141. package/node_modules/defu/dist/defu.d.ts +0 -31
  142. package/node_modules/defu/dist/defu.mjs +0 -69
  143. package/node_modules/defu/lib/defu.cjs +0 -10
  144. package/node_modules/defu/lib/defu.d.cts +0 -12
  145. package/node_modules/defu/package.json +0 -48
  146. package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -468
  147. package/node_modules/node-fetch-native/LICENSE +0 -114
  148. package/node_modules/node-fetch-native/README.md +0 -225
  149. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -2
  150. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -2
  151. package/node_modules/node-fetch-native/dist/index.cjs +0 -1
  152. package/node_modules/node-fetch-native/dist/index.mjs +0 -1
  153. package/node_modules/node-fetch-native/dist/native.cjs +0 -1
  154. package/node_modules/node-fetch-native/dist/native.mjs +0 -1
  155. package/node_modules/node-fetch-native/dist/node.cjs +0 -19
  156. package/node_modules/node-fetch-native/dist/node.mjs +0 -19
  157. package/node_modules/node-fetch-native/dist/polyfill.cjs +0 -1
  158. package/node_modules/node-fetch-native/dist/polyfill.mjs +0 -1
  159. package/node_modules/node-fetch-native/dist/proxy-stub.cjs +0 -1
  160. package/node_modules/node-fetch-native/dist/proxy-stub.mjs +0 -1
  161. package/node_modules/node-fetch-native/dist/proxy.cjs +0 -58
  162. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -1
  163. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -1
  164. package/node_modules/node-fetch-native/index.d.ts +0 -1
  165. package/node_modules/node-fetch-native/lib/empty.cjs +0 -0
  166. package/node_modules/node-fetch-native/lib/empty.mjs +0 -0
  167. package/node_modules/node-fetch-native/lib/index.cjs +0 -11
  168. package/node_modules/node-fetch-native/lib/index.d.cts +0 -10
  169. package/node_modules/node-fetch-native/lib/index.d.mts +0 -10
  170. package/node_modules/node-fetch-native/lib/index.d.ts +0 -10
  171. package/node_modules/node-fetch-native/lib/native.cjs +0 -11
  172. package/node_modules/node-fetch-native/lib/polyfill.d.cts +0 -1
  173. package/node_modules/node-fetch-native/lib/polyfill.d.mts +0 -1
  174. package/node_modules/node-fetch-native/lib/polyfill.d.ts +0 -1
  175. package/node_modules/node-fetch-native/lib/proxy.d.ts +0 -32
  176. package/node_modules/node-fetch-native/node.d.ts +0 -1
  177. package/node_modules/node-fetch-native/package.json +0 -138
  178. package/node_modules/node-fetch-native/polyfill.d.ts +0 -1
  179. package/node_modules/node-fetch-native/proxy.d.ts +0 -1
  180. package/node_modules/nypm/node_modules/citty/LICENSE +0 -21
  181. package/node_modules/nypm/node_modules/citty/README.md +0 -231
  182. package/node_modules/nypm/node_modules/citty/dist/index.d.mts +0 -112
  183. package/node_modules/nypm/node_modules/citty/dist/index.mjs +0 -425
  184. package/node_modules/nypm/node_modules/citty/package.json +0 -42
  185. /package/node_modules/{nypm/node_modules/citty → citty}/dist/THIRD-PARTY-LICENSES.md +0 -0
  186. /package/node_modules/{nypm/node_modules/citty → citty}/dist/_chunks/libs/scule.mjs +0 -0
  187. /package/node_modules/{@maizzle/cli → maizzle}/LICENSE +0 -0
  188. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.d.mts +0 -0
  189. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.mjs +0 -0
  190. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.d.mts +0 -0
  191. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.mjs +0 -0
  192. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.d.mts +0 -0
  193. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.mjs +0 -0
  194. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.d.mts +0 -0
  195. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.mjs +0 -0
  196. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/component.vue +0 -0
  197. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/config.ts +0 -0
  198. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/layout.vue +0 -0
  199. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/template.vue +0 -0
  200. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.d.mts +0 -0
  201. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.mjs +0 -0
  202. /package/node_modules/{commander → maizzle/node_modules/commander}/LICENSE +0 -0
  203. /package/node_modules/{commander → maizzle/node_modules/commander}/esm.mjs +0 -0
  204. /package/node_modules/{commander → maizzle/node_modules/commander}/index.js +0 -0
  205. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/error.js +0 -0
  206. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/suggestSimilar.js +0 -0
  207. /package/node_modules/{commander → maizzle/node_modules/commander}/typings/esm.d.mts +0 -0
@@ -1,87 +1,137 @@
1
- import{stripVTControlCharacters as S}from"node:util";import{TextPrompt as Q,PasswordPrompt as X,ConfirmPrompt as Z,SelectPrompt as ee,SelectKeyPrompt as te,MultiSelectPrompt as re,GroupMultiSelectPrompt as se,isCancel as ie,block as ne}from"@clack/core";export{isCancel,updateSettings}from"@clack/core";import y from"node:process";import e from"picocolors";import{cursor as oe,erase as ae}from"sisteransi";function ce(){return y.platform!=="win32"?y.env.TERM!=="linux":!!y.env.CI||!!y.env.WT_SESSION||!!y.env.TERMINUS_SUBLIME||y.env.ConEmuTask==="{cmd::Cmder}"||y.env.TERM_PROGRAM==="Terminus-Sublime"||y.env.TERM_PROGRAM==="vscode"||y.env.TERM==="xterm-256color"||y.env.TERM==="alacritty"||y.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const V=ce(),u=(t,n)=>V?t:n,le=u("\u25C6","*"),L=u("\u25A0","x"),W=u("\u25B2","x"),C=u("\u25C7","o"),ue=u("\u250C","T"),o=u("\u2502","|"),d=u("\u2514","\u2014"),k=u("\u25CF",">"),P=u("\u25CB"," "),A=u("\u25FB","[\u2022]"),T=u("\u25FC","[+]"),F=u("\u25FB","[ ]"),$e=u("\u25AA","\u2022"),_=u("\u2500","-"),me=u("\u256E","+"),de=u("\u251C","+"),pe=u("\u256F","+"),q=u("\u25CF","\u2022"),D=u("\u25C6","*"),U=u("\u25B2","!"),K=u("\u25A0","x"),b=t=>{switch(t){case"initial":case"active":return e.cyan(le);case"cancel":return e.red(L);case"error":return e.yellow(W);case"submit":return e.green(C)}},G=t=>{const{cursor:n,options:r,style:i}=t,s=t.maxItems??Number.POSITIVE_INFINITY,c=Math.max(process.stdout.rows-4,0),a=Math.min(c,Math.max(s,5));let l=0;n>=l+a-3?l=Math.max(Math.min(n-a+3,r.length-a),0):n<l+2&&(l=Math.max(n-2,0));const $=a<r.length&&l>0,g=a<r.length&&l+a<r.length;return r.slice(l,l+a).map((p,v,f)=>{const j=v===0&&$,E=v===f.length-1&&g;return j||E?e.dim("..."):i(p,v+l===n)})},he=t=>new Q({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const n=`${e.gray(o)}
2
- ${b(this.state)} ${t.message}
3
- `,r=t.placeholder?e.inverse(t.placeholder[0])+e.dim(t.placeholder.slice(1)):e.inverse(e.hidden("_")),i=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${n.trim()}
4
- ${e.yellow(o)} ${i}
5
- ${e.yellow(d)} ${e.yellow(this.error)}
6
- `;case"submit":return`${n}${e.gray(o)} ${e.dim(this.value||t.placeholder)}`;case"cancel":return`${n}${e.gray(o)} ${e.strikethrough(e.dim(this.value??""))}${this.value?.trim()?`
7
- ${e.gray(o)}`:""}`;default:return`${n}${e.cyan(o)} ${i}
8
- ${e.cyan(d)}
9
- `}}}).prompt(),ge=t=>new X({validate:t.validate,mask:t.mask??$e,render(){const n=`${e.gray(o)}
10
- ${b(this.state)} ${t.message}
11
- `,r=this.valueWithCursor,i=this.masked;switch(this.state){case"error":return`${n.trim()}
12
- ${e.yellow(o)} ${i}
13
- ${e.yellow(d)} ${e.yellow(this.error)}
14
- `;case"submit":return`${n}${e.gray(o)} ${e.dim(i)}`;case"cancel":return`${n}${e.gray(o)} ${e.strikethrough(e.dim(i??""))}${i?`
15
- ${e.gray(o)}`:""}`;default:return`${n}${e.cyan(o)} ${r}
16
- ${e.cyan(d)}
17
- `}}}).prompt(),ye=t=>{const n=t.active??"Yes",r=t.inactive??"No";return new Z({active:n,inactive:r,initialValue:t.initialValue??!0,render(){const i=`${e.gray(o)}
18
- ${b(this.state)} ${t.message}
19
- `,s=this.value?n:r;switch(this.state){case"submit":return`${i}${e.gray(o)} ${e.dim(s)}`;case"cancel":return`${i}${e.gray(o)} ${e.strikethrough(e.dim(s))}
20
- ${e.gray(o)}`;default:return`${i}${e.cyan(o)} ${this.value?`${e.green(k)} ${n}`:`${e.dim(P)} ${e.dim(n)}`} ${e.dim("/")} ${this.value?`${e.dim(P)} ${e.dim(r)}`:`${e.green(k)} ${r}`}
21
- ${e.cyan(d)}
22
- `}}}).prompt()},ve=t=>{const n=(r,i)=>{const s=r.label??String(r.value);switch(i){case"selected":return`${e.dim(s)}`;case"active":return`${e.green(k)} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`;case"cancelled":return`${e.strikethrough(e.dim(s))}`;default:return`${e.dim(P)} ${e.dim(s)}`}};return new ee({options:t.options,initialValue:t.initialValue,render(){const r=`${e.gray(o)}
23
- ${b(this.state)} ${t.message}
24
- `;switch(this.state){case"submit":return`${r}${e.gray(o)} ${n(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${e.gray(o)} ${n(this.options[this.cursor],"cancelled")}
25
- ${e.gray(o)}`;default:return`${r}${e.cyan(o)} ${G({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(i,s)=>n(i,s?"active":"inactive")}).join(`
26
- ${e.cyan(o)} `)}
27
- ${e.cyan(d)}
28
- `}}}).prompt()},we=t=>{const n=(r,i="inactive")=>{const s=r.label??String(r.value);return i==="selected"?`${e.dim(s)}`:i==="cancelled"?`${e.strikethrough(e.dim(s))}`:i==="active"?`${e.bgCyan(e.gray(` ${r.value} `))} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`:`${e.gray(e.bgWhite(e.inverse(` ${r.value} `)))} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`};return new te({options:t.options,initialValue:t.initialValue,render(){const r=`${e.gray(o)}
29
- ${b(this.state)} ${t.message}
30
- `;switch(this.state){case"submit":return`${r}${e.gray(o)} ${n(this.options.find(i=>i.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${r}${e.gray(o)} ${n(this.options[0],"cancelled")}
31
- ${e.gray(o)}`;default:return`${r}${e.cyan(o)} ${this.options.map((i,s)=>n(i,s===this.cursor?"active":"inactive")).join(`
32
- ${e.cyan(o)} `)}
33
- ${e.cyan(d)}
34
- `}}}).prompt()},fe=t=>{const n=(r,i)=>{const s=r.label??String(r.value);return i==="active"?`${e.cyan(A)} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`:i==="selected"?`${e.green(T)} ${e.dim(s)} ${r.hint?e.dim(`(${r.hint})`):""}`:i==="cancelled"?`${e.strikethrough(e.dim(s))}`:i==="active-selected"?`${e.green(T)} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`:i==="submitted"?`${e.dim(s)}`:`${e.dim(F)} ${e.dim(s)}`};return new re({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
35
- ${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const r=`${e.gray(o)}
36
- ${b(this.state)} ${t.message}
37
- `,i=(s,c)=>{const a=this.value.includes(s.value);return c&&a?n(s,"active-selected"):a?n(s,"selected"):n(s,c?"active":"inactive")};switch(this.state){case"submit":return`${r}${e.gray(o)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>n(s,"submitted")).join(e.dim(", "))||e.dim("none")}`;case"cancel":{const s=this.options.filter(({value:c})=>this.value.includes(c)).map(c=>n(c,"cancelled")).join(e.dim(", "));return`${r}${e.gray(o)} ${s.trim()?`${s}
38
- ${e.gray(o)}`:""}`}case"error":{const s=this.error.split(`
39
- `).map((c,a)=>a===0?`${e.yellow(d)} ${e.yellow(c)}`:` ${c}`).join(`
40
- `);return`${r+e.yellow(o)} ${G({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
41
- ${e.yellow(o)} `)}
42
- ${s}
43
- `}default:return`${r}${e.cyan(o)} ${G({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
44
- ${e.cyan(o)} `)}
45
- ${e.cyan(d)}
46
- `}}}).prompt()},be=t=>{const{selectableGroups:n=!0}=t,r=(i,s,c=[])=>{const a=i.label??String(i.value),l=typeof i.group=="string",$=l&&(c[c.indexOf(i)+1]??{group:!0}),g=l&&$.group===!0,p=l?n?`${g?d:o} `:" ":"";if(s==="active")return`${e.dim(p)}${e.cyan(A)} ${a} ${i.hint?e.dim(`(${i.hint})`):""}`;if(s==="group-active")return`${p}${e.cyan(A)} ${e.dim(a)}`;if(s==="group-active-selected")return`${p}${e.green(T)} ${e.dim(a)}`;if(s==="selected"){const f=l||n?e.green(T):"";return`${e.dim(p)}${f} ${e.dim(a)} ${i.hint?e.dim(`(${i.hint})`):""}`}if(s==="cancelled")return`${e.strikethrough(e.dim(a))}`;if(s==="active-selected")return`${e.dim(p)}${e.green(T)} ${a} ${i.hint?e.dim(`(${i.hint})`):""}`;if(s==="submitted")return`${e.dim(a)}`;const v=l||n?e.dim(F):"";return`${e.dim(p)}${v} ${e.dim(a)}`};return new se({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,selectableGroups:n,validate(i){if(this.required&&i.length===0)return`Please select at least one option.
47
- ${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const i=`${e.gray(o)}
48
- ${b(this.state)} ${t.message}
49
- `;switch(this.state){case"submit":return`${i}${e.gray(o)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>r(s,"submitted")).join(e.dim(", "))}`;case"cancel":{const s=this.options.filter(({value:c})=>this.value.includes(c)).map(c=>r(c,"cancelled")).join(e.dim(", "));return`${i}${e.gray(o)} ${s.trim()?`${s}
50
- ${e.gray(o)}`:""}`}case"error":{const s=this.error.split(`
51
- `).map((c,a)=>a===0?`${e.yellow(d)} ${e.yellow(c)}`:` ${c}`).join(`
52
- `);return`${i}${e.yellow(o)} ${this.options.map((c,a,l)=>{const $=this.value.includes(c.value)||c.group===!0&&this.isGroupSelected(`${c.value}`),g=a===this.cursor;return!g&&typeof c.group=="string"&&this.options[this.cursor].value===c.group?r(c,$?"group-active-selected":"group-active",l):g&&$?r(c,"active-selected",l):$?r(c,"selected",l):r(c,g?"active":"inactive",l)}).join(`
53
- ${e.yellow(o)} `)}
54
- ${s}
55
- `}default:return`${i}${e.cyan(o)} ${this.options.map((s,c,a)=>{const l=this.value.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),$=c===this.cursor;return!$&&typeof s.group=="string"&&this.options[this.cursor].value===s.group?r(s,l?"group-active-selected":"group-active",a):$&&l?r(s,"active-selected",a):l?r(s,"selected",a):r(s,$?"active":"inactive",a)}).join(`
56
- ${e.cyan(o)} `)}
57
- ${e.cyan(d)}
58
- `}}}).prompt()},Me=(t="",n="")=>{const r=`
59
- ${t}
60
- `.split(`
61
- `),i=S(n).length,s=Math.max(r.reduce((a,l)=>{const $=S(l);return $.length>a?$.length:a},0),i)+2,c=r.map(a=>`${e.gray(o)} ${e.dim(a)}${" ".repeat(s-S(a).length)}${e.gray(o)}`).join(`
62
- `);process.stdout.write(`${e.gray(o)}
63
- ${e.green(C)} ${e.reset(n)} ${e.gray(_.repeat(Math.max(s-i-1,1))+me)}
64
- ${c}
65
- ${e.gray(de+_.repeat(s+2)+pe)}
66
- `)},xe=(t="")=>{process.stdout.write(`${e.gray(d)} ${e.red(t)}
1
+ import{getColumns as X,getRows as ke,AutocompletePrompt as ve,settings as I,ConfirmPrompt as Le,wrapTextWithPrefix as N,DatePrompt as De,isCancel as We,GroupMultiSelectPrompt as Fe,MultiSelectPrompt as He,PasswordPrompt as Ue,block as Ke,SelectPrompt as qe,SelectKeyPrompt as Je,TextPrompt as Ye}from"@clack/core";export{isCancel,settings,updateSettings}from"@clack/core";import{styleText as t,stripVTControlCharacters as ne}from"node:util";import P from"node:process";import{wrapAnsi as q}from"fast-wrap-ansi";import B from"fast-string-width";import{existsSync as Xe,lstatSync as we,readdirSync as ze}from"node:fs";import{dirname as be,join as Qe}from"node:path";import{cursor as Se,erase as Ce}from"sisteransi";function Ze(){return P.platform!=="win32"?P.env.TERM!=="linux":!!P.env.CI||!!P.env.WT_SESSION||!!P.env.TERMINUS_SUBLIME||P.env.ConEmuTask==="{cmd::Cmder}"||P.env.TERM_PROGRAM==="Terminus-Sublime"||P.env.TERM_PROGRAM==="vscode"||P.env.TERM==="xterm-256color"||P.env.TERM==="alacritty"||P.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const ee=Ze(),ae=()=>process.env.CI==="true",Te=e=>e.isTTY===!0,w=(e,i)=>ee?e:i,_e=w("\u25C6","*"),oe=w("\u25A0","x"),ue=w("\u25B2","x"),F=w("\u25C7","o"),le=w("\u250C","T"),d=w("\u2502","|"),E=w("\u2514","\u2014"),Ie=w("\u2510","T"),Ee=w("\u2518","\u2014"),z=w("\u25CF",">"),H=w("\u25CB"," "),te=w("\u25FB","[\u2022]"),U=w("\u25FC","[+]"),J=w("\u25FB","[ ]"),xe=w("\u25AA","\u2022"),se=w("\u2500","-"),ce=w("\u256E","+"),Ge=w("\u251C","+"),$e=w("\u256F","+"),de=w("\u2570","+"),Oe=w("\u256D","+"),he=w("\u25CF","\u2022"),pe=w("\u25C6","*"),me=w("\u25B2","!"),ge=w("\u25A0","x"),V=e=>{switch(e){case"initial":case"active":return t("cyan",_e);case"cancel":return t("red",oe);case"error":return t("yellow",ue);case"submit":return t("green",F)}},ye=e=>{switch(e){case"initial":case"active":return t("cyan",d);case"cancel":return t("red",d);case"error":return t("yellow",d);case"submit":return t("green",d)}},et=(e,i,s,r,u)=>{let n=i,o=0;for(let c=s;c<r;c++){const a=e[c];if(n=n-a.length,o++,n<=u)break}return{lineCount:n,removals:o}},Y=({cursor:e,options:i,style:s,output:r=process.stdout,maxItems:u=Number.POSITIVE_INFINITY,columnPadding:n=0,rowPadding:o=4})=>{const c=X(r)-n,a=ke(r),l=t("dim","..."),$=Math.max(a-o,0),y=Math.max(Math.min(u,$),5);let p=0;e>=y-3&&(p=Math.max(Math.min(e-y+3,i.length-y),0));let m=y<i.length&&p>0,g=y<i.length&&p+y<i.length;const S=Math.min(p+y,i.length),h=[];let f=0;m&&f++,g&&f++;const v=p+(m?1:0),T=S-(g?1:0);for(let b=v;b<T;b++){const x=q(s(i[b],b===e),c,{hard:!0,trim:!1}).split(`
2
+ `);h.push(x),f+=x.length}if(f>$){let b=0,x=0,G=f;const M=e-v,R=(j,D)=>et(h,G,j,D,$);m?({lineCount:G,removals:b}=R(0,M),G>$&&({lineCount:G,removals:x}=R(M+1,h.length))):({lineCount:G,removals:x}=R(M+1,h.length),G>$&&({lineCount:G,removals:b}=R(0,M))),b>0&&(m=!0,h.splice(0,b)),x>0&&(g=!0,h.splice(h.length-x,x))}const C=[];m&&C.push(l);for(const b of h)for(const x of b)C.push(x);return g&&C.push(l),C};function Me(e){return e.label??String(e.value??"")}function Re(e,i){if(!e)return!0;const s=(i.label??String(i.value??"")).toLowerCase(),r=(i.hint??"").toLowerCase(),u=String(i.value).toLowerCase(),n=e.toLowerCase();return s.includes(n)||r.includes(n)||u.includes(n)}function tt(e,i){const s=[];for(const r of i)e.includes(r.value)&&s.push(r);return s}const Ae=e=>new ve({options:e.options,initialValue:e.initialValue?[e.initialValue]:void 0,initialUserInput:e.initialUserInput,placeholder:e.placeholder,filter:e.filter??((i,s)=>Re(i,s)),signal:e.signal,input:e.input,output:e.output,validate:e.validate,render(){const i=e.withGuide??I.withGuide,s=i?[`${t("gray",d)}`,`${V(this.state)} ${e.message}`]:[`${V(this.state)} ${e.message}`],r=this.userInput,u=this.options,n=e.placeholder,o=r===""&&n!==void 0,c=(a,l)=>{const $=Me(a),y=a.hint&&a.value===this.focusedValue?t("dim",` (${a.hint})`):"";switch(l){case"active":return`${t("green",z)} ${$}${y}`;case"inactive":return`${t("dim",H)} ${t("dim",$)}`;case"disabled":return`${t("gray",H)} ${t(["strikethrough","gray"],$)}`}};switch(this.state){case"submit":{const a=tt(this.selectedValues,u),l=a.length>0?` ${t("dim",a.map(Me).join(", "))}`:"",$=i?t("gray",d):"";return`${s.join(`
3
+ `)}
4
+ ${$}${l}`}case"cancel":{const a=r?` ${t(["strikethrough","dim"],r)}`:"",l=i?t("gray",d):"";return`${s.join(`
5
+ `)}
6
+ ${l}${a}`}default:{const a=this.state==="error"?"yellow":"cyan",l=i?`${t(a,d)} `:"",$=i?t(a,E):"";let y="";if(this.isNavigating||o){const v=o?n:r;y=v!==""?` ${t("dim",v)}`:""}else y=` ${this.userInputWithCursor}`;const p=this.filteredOptions.length!==u.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",m=this.filteredOptions.length===0&&r?[`${l}${t("yellow","No matches found")}`]:[],g=this.state==="error"?[`${l}${t("yellow",this.error)}`]:[];i&&s.push(`${l.trimEnd()}`),s.push(`${l}${t("dim","Search:")}${y}${p}`,...m,...g);const S=[`${t("dim","\u2191/\u2193")} to select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],h=[`${l}${S.join(" \u2022 ")}`,$],f=this.filteredOptions.length===0?[]:Y({cursor:this.cursor,options:this.filteredOptions,columnPadding:i?3:0,rowPadding:s.length+h.length,style:(v,T)=>c(v,v.disabled?"disabled":T?"active":"inactive"),maxItems:e.maxItems,output:e.output});return[...s,...f.map(v=>`${l}${v}`),...h].join(`
7
+ `)}}}}).prompt(),st=e=>{const i=(r,u,n,o)=>{const c=n.includes(r.value),a=r.label??String(r.value??""),l=r.hint&&o!==void 0&&r.value===o?t("dim",` (${r.hint})`):"",$=c?t("green",U):t("dim",J);return r.disabled?`${t("gray",J)} ${t(["strikethrough","gray"],a)}`:u?`${$} ${a}${l}`:`${$} ${t("dim",a)}`},s=new ve({options:e.options,multiple:!0,placeholder:e.placeholder,filter:e.filter??((r,u)=>Re(r,u)),validate:()=>{if(e.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:e.initialValues,signal:e.signal,input:e.input,output:e.output,render(){const r=e.withGuide??I.withGuide,u=`${r?`${t("gray",d)}
8
+ `:""}${V(this.state)} ${e.message}
9
+ `,n=this.userInput,o=e.placeholder,c=n===""&&o!==void 0,a=this.isNavigating||c?t("dim",c?o:n):this.userInputWithCursor,l=this.options,$=this.filteredOptions.length!==l.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${u}${r?`${t("gray",d)} `:""}${t("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${u}${r?`${t("gray",d)} `:""}${t(["strikethrough","dim"],n)}`;default:{const y=this.state==="error"?"yellow":"cyan",p=r?`${t(y,d)} `:"",m=r?t(y,E):"",g=[`${t("dim","\u2191/\u2193")} to navigate`,`${t("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],S=this.filteredOptions.length===0&&n?[`${p}${t("yellow","No matches found")}`]:[],h=this.state==="error"?[`${p}${t("yellow",this.error)}`]:[],f=[...`${u}${r?t(y,d):""}`.split(`
10
+ `),`${p}${t("dim","Search:")} ${a}${$}`,...S,...h],v=[`${p}${g.join(" \u2022 ")}`,m],T=Y({cursor:this.cursor,options:this.filteredOptions,style:(C,b)=>i(C,b,this.selectedValues,this.focusedValue),maxItems:e.maxItems,output:e.output,rowPadding:f.length+v.length});return[...f,...T.map(C=>`${p}${C}`),...v].join(`
11
+ `)}}}});return s.prompt()},rt=[Oe,ce,de,$e],it=[le,Ie,E,Ee];function Pe(e,i,s,r){let u=s,n=s;return r==="center"?u=Math.floor((i-e)/2):r==="right"&&(u=i-e-s),n=i-u-e,[u,n]}const nt=e=>e,at=(e="",i="",s)=>{const r=s?.output??process.stdout,u=X(r),n=2,o=s?.titlePadding??1,c=s?.contentPadding??2,a=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),l=s?.withGuide??I.withGuide?`${d} `:"",$=s?.formatBorder??nt,y=(s?.rounded?rt:it).map($),p=$(se),m=$(d),g=B(l),S=B(i),h=u-g;let f=Math.floor(u*a)-g;if(s?.width==="auto"){const R=e.split(`
12
+ `);let j=S+o*2;for(const ie of R){const W=B(ie)+c*2;W>j&&(j=W)}const D=j+n;D<f&&(f=D)}f%2!==0&&(f<h?f++:f--);const v=f-n,T=v-o*2,C=S>T?`${i.slice(0,T-3)}...`:i,[b,x]=Pe(B(C),v,o,s?.titleAlign),G=q(e,v-c*2,{hard:!0,trim:!1});r.write(`${l}${y[0]}${p.repeat(b)}${C}${p.repeat(x)}${y[1]}
13
+ `);const M=G.split(`
14
+ `);for(const R of M){const[j,D]=Pe(B(R),v,c,s?.contentAlign);r.write(`${l}${m}${" ".repeat(j)}${R}${" ".repeat(D)}${m}
15
+ `)}r.write(`${l}${y[2]}${p.repeat(v)}${y[3]}
16
+ `)},ot=e=>{const i=e.active??"Yes",s=e.inactive??"No";return new Le({active:i,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){const r=e.withGuide??I.withGuide,u=`${V(this.state)} `,n=r?`${t("gray",d)} `:"",o=N(e.output,e.message,n,u),c=`${r?`${t("gray",d)}
17
+ `:""}${o}
18
+ `,a=this.value?i:s;switch(this.state){case"submit":{const l=r?`${t("gray",d)} `:"";return`${c}${l}${t("dim",a)}`}case"cancel":{const l=r?`${t("gray",d)} `:"";return`${c}${l}${t(["strikethrough","dim"],a)}${r?`
19
+ ${t("gray",d)}`:""}`}default:{const l=r?`${t("cyan",d)} `:"",$=r?t("cyan",E):"";return`${c}${l}${this.value?`${t("green",z)} ${i}`:`${t("dim",H)} ${t("dim",i)}`}${e.vertical?r?`
20
+ ${t("cyan",d)} `:`
21
+ `:` ${t("dim","/")} `}${this.value?`${t("dim",H)} ${t("dim",s)}`:`${t("green",z)} ${s}`}
22
+ ${$}
23
+ `}}}}).prompt()},ut=e=>{const i=e.validate;return new De({...e,validate(s){if(s===void 0)return e.defaultValue!==void 0?void 0:i?i(s):I.date.messages.required;const r=u=>u.toISOString().slice(0,10);if(e.minDate&&r(s)<r(e.minDate))return I.date.messages.afterMin(e.minDate);if(e.maxDate&&r(s)>r(e.maxDate))return I.date.messages.beforeMax(e.maxDate);if(i)return i(s)},render(){const s=(e?.withGuide??I.withGuide)!==!1,r=`${`${s?`${t("gray",d)}
24
+ `:""}${V(this.state)} `}${e.message}
25
+ `,u=this.state!=="initial"?this.state:"active",n=lt(this,u),o=this.value instanceof Date?this.formattedValue:"";switch(this.state){case"error":{const c=this.error?` ${t("yellow",this.error)}`:"",a=s?`${t("yellow",d)} `:"",l=s?t("yellow",E):"";return`${r.trim()}
26
+ ${a}${n}
27
+ ${l}${c}
28
+ `}case"submit":{const c=o?` ${t("dim",o)}`:"",a=s?t("gray",d):"";return`${r}${a}${c}`}case"cancel":{const c=o?` ${t(["strikethrough","dim"],o)}`:"",a=s?t("gray",d):"";return`${r}${a}${c}${o.trim()?`
29
+ ${a}`:""}`}default:{const c=s?`${t("cyan",d)} `:"",a=s?t("cyan",E):"",l=s?`${t("cyan",d)} `:"",$=this.inlineError?`
30
+ ${l}${t("yellow",this.inlineError)}`:"";return`${r}${c}${n}${$}
31
+ ${a}
32
+ `}}}}).prompt()};function lt(e,i){const s=e.segmentValues,r=e.segmentCursor;if(i==="submit"||i==="cancel")return e.formattedValue;const u=t("gray",e.separator);return e.segments.map((n,o)=>{const c=o===r.segmentIndex&&!["submit","cancel"].includes(i),a=$t[n.type];return ct(s[n.type],{isActive:c,label:a})}).join(u)}function ct(e,i){const s=!e||e.replace(/_/g,"")==="";return i.isActive?t("inverse",s?i.label:e.replace(/_/g," ")):s?t("dim",i.label):e.replace(/_/g,t("dim"," "))}const $t={year:"yyyy",month:"mm",day:"dd"},dt=async(e,i)=>{const s={},r=Object.keys(e);for(const u of r){const n=e[u],o=await n({results:s})?.catch(c=>{throw c});if(typeof i?.onCancel=="function"&&We(o)){s[u]="canceled",i.onCancel({results:s});continue}s[u]=o}return s},ht=e=>{const{selectableGroups:i=!0,groupSpacing:s=0}=e,r=(n,o,c=[])=>{const a=n.label??String(n.value),l=typeof n.group=="string",$=l&&(c[c.indexOf(n)+1]??{group:!0}),y=l&&$&&$.group===!0,p=l?i?`${y?E:d} `:" ":"";let m="";if(s>0&&!l){const S=`
33
+ ${t("cyan",d)}`;m=`${S.repeat(s-1)}${S} `}if(o==="active")return`${m}${t("dim",p)}${t("cyan",te)} ${a}${n.hint?` ${t("dim",`(${n.hint})`)}`:""}`;if(o==="group-active")return`${m}${p}${t("cyan",te)} ${t("dim",a)}`;if(o==="group-active-selected")return`${m}${p}${t("green",U)} ${t("dim",a)}`;if(o==="selected"){const S=l||i?t("green",U):"";return`${m}${t("dim",p)}${S} ${t("dim",a)}${n.hint?` ${t("dim",`(${n.hint})`)}`:""}`}if(o==="cancelled")return`${t(["strikethrough","dim"],a)}`;if(o==="active-selected")return`${m}${t("dim",p)}${t("green",U)} ${a}${n.hint?` ${t("dim",`(${n.hint})`)}`:""}`;if(o==="submitted")return`${t("dim",a)}`;const g=l||i?t("dim",J):"";return`${m}${t("dim",p)}${g} ${t("dim",a)}`},u=e.required??!0;return new Fe({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:u,cursorAt:e.cursorAt,selectableGroups:i,validate(n){if(u&&(n===void 0||n.length===0))return`Please select at least one option.
34
+ ${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){const n=e.withGuide??I.withGuide,o=`${n?`${t("gray",d)}
35
+ `:""}${V(this.state)} ${e.message}
36
+ `,c=this.value??[];switch(this.state){case"submit":{const a=this.options.filter(({value:$})=>c.includes($)).map($=>r($,"submitted")),l=a.length===0?"":` ${a.join(t("dim",", "))}`;return`${o}${n?t("gray",d):""}${l}`}case"cancel":{const a=this.options.filter(({value:l})=>c.includes(l)).map(l=>r(l,"cancelled")).join(t("dim",", "));return`${o}${n?`${t("gray",d)} `:""}${a.trim()?`${a}${n?`
37
+ ${t("gray",d)}`:""}`:""}`}case"error":{const a=this.error.split(`
38
+ `).map((l,$)=>$===0?`${n?`${t("yellow",E)} `:""}${t("yellow",l)}`:` ${l}`).join(`
39
+ `);return`${o}${n?`${t("yellow",d)} `:""}${this.options.map((l,$,y)=>{const p=c.includes(l.value)||l.group===!0&&this.isGroupSelected(`${l.value}`),m=$===this.cursor;return!m&&typeof l.group=="string"&&this.options[this.cursor].value===l.group?r(l,p?"group-active-selected":"group-active",y):m&&p?r(l,"active-selected",y):p?r(l,"selected",y):r(l,m?"active":"inactive",y)}).join(`
40
+ ${n?`${t("yellow",d)} `:""}`)}
41
+ ${a}
42
+ `}default:{const a=this.options.map(($,y,p)=>{const m=c.includes($.value)||$.group===!0&&this.isGroupSelected(`${$.value}`),g=y===this.cursor,S=!g&&typeof $.group=="string"&&this.options[this.cursor].value===$.group;let h="";return S?h=r($,m?"group-active-selected":"group-active",p):g&&m?h=r($,"active-selected",p):m?h=r($,"selected",p):h=r($,g?"active":"inactive",p),`${y!==0&&!h.startsWith(`
43
+ `)?" ":""}${h}`}).join(`
44
+ ${n?t("cyan",d):""}`),l=a.startsWith(`
45
+ `)?"":" ";return`${o}${n?t("cyan",d):""}${l}${a}
46
+ ${n?t("cyan",E):""}
47
+ `}}}}).prompt()},O={message:(e=[],{symbol:i=t("gray",d),secondarySymbol:s=t("gray",d),output:r=process.stdout,spacing:u=1,withGuide:n}={})=>{const o=[],c=n??I.withGuide,a=c?s:"",l=c?`${i} `:"",$=c?`${s} `:"";for(let p=0;p<u;p++)o.push(a);const y=Array.isArray(e)?e:e.split(`
48
+ `);if(y.length>0){const[p,...m]=y;p.length>0?o.push(`${l}${p}`):o.push(c?i:"");for(const g of m)g.length>0?o.push(`${$}${g}`):o.push(c?s:"")}r.write(`${o.join(`
49
+ `)}
50
+ `)},info:(e,i)=>{O.message(e,{...i,symbol:t("blue",he)})},success:(e,i)=>{O.message(e,{...i,symbol:t("green",pe)})},step:(e,i)=>{O.message(e,{...i,symbol:t("green",F)})},warn:(e,i)=>{O.message(e,{...i,symbol:t("yellow",me)})},warning:(e,i)=>{O.warn(e,i)},error:(e,i)=>{O.message(e,{...i,symbol:t("red",ge)})}},pt=(e="",i)=>{const s=i?.output??process.stdout,r=i?.withGuide??I.withGuide?`${t("gray",E)} `:"";s.write(`${r}${t("red",e)}
67
51
 
68
- `)},Ie=(t="")=>{process.stdout.write(`${e.gray(ue)} ${t}
69
- `)},Se=(t="")=>{process.stdout.write(`${e.gray(o)}
70
- ${e.gray(d)} ${t}
52
+ `)},mt=(e="",i)=>{const s=i?.output??process.stdout,r=i?.withGuide??I.withGuide?`${t("gray",le)} `:"";s.write(`${r}${e}
53
+ `)},gt=(e="",i)=>{const s=i?.output??process.stdout,r=i?.withGuide??I.withGuide?`${t("gray",d)}
54
+ ${t("gray",E)} `:"";s.write(`${r}${e}
71
55
 
72
- `)},M={message:(t="",{symbol:n=e.gray(o)}={})=>{const r=[`${e.gray(o)}`];if(t){const[i,...s]=t.split(`
73
- `);r.push(`${n} ${i}`,...s.map(c=>`${e.gray(o)} ${c}`))}process.stdout.write(`${r.join(`
74
- `)}
75
- `)},info:t=>{M.message(t,{symbol:e.blue(q)})},success:t=>{M.message(t,{symbol:e.green(D)})},step:t=>{M.message(t,{symbol:e.green(C)})},warn:t=>{M.message(t,{symbol:e.yellow(U)})},warning:t=>{M.warn(t)},error:t=>{M.message(t,{symbol:e.red(K)})}},J=`${e.gray(o)} `,x={message:async(t,{symbol:n=e.gray(o)}={})=>{process.stdout.write(`${e.gray(o)}
76
- ${n} `);let r=3;for await(let i of t){i=i.replace(/\n/g,`
77
- ${J}`),i.includes(`
78
- `)&&(r=3+S(i.slice(i.lastIndexOf(`
79
- `))).length);const s=S(i).length;r+s<process.stdout.columns?(r+=s,process.stdout.write(i)):(process.stdout.write(`
80
- ${J}${i.trimStart()}`),r=3+S(i.trimStart()).length)}process.stdout.write(`
81
- `)},info:t=>x.message(t,{symbol:e.blue(q)}),success:t=>x.message(t,{symbol:e.green(D)}),step:t=>x.message(t,{symbol:e.green(C)}),warn:t=>x.message(t,{symbol:e.yellow(U)}),warning:t=>x.warn(t),error:t=>x.message(t,{symbol:e.red(K)})},Y=({indicator:t="dots"}={})=>{const n=V?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=V?80:120,i=process.env.CI==="true";let s,c,a=!1,l="",$,g=performance.now();const p=m=>{const h=m>1?"Something went wrong":"Canceled";a&&N(h,m)},v=()=>p(2),f=()=>p(1),j=()=>{process.on("uncaughtExceptionMonitor",v),process.on("unhandledRejection",v),process.on("SIGINT",f),process.on("SIGTERM",f),process.on("exit",p)},E=()=>{process.removeListener("uncaughtExceptionMonitor",v),process.removeListener("unhandledRejection",v),process.removeListener("SIGINT",f),process.removeListener("SIGTERM",f),process.removeListener("exit",p)},B=()=>{if($===void 0)return;i&&process.stdout.write(`
82
- `);const m=$.split(`
83
- `);process.stdout.write(oe.move(-999,m.length-1)),process.stdout.write(ae.down(m.length))},R=m=>m.replace(/\.+$/,""),O=m=>{const h=(performance.now()-m)/1e3,w=Math.floor(h/60),I=Math.floor(h%60);return w>0?`[${w}m ${I}s]`:`[${I}s]`},H=(m="")=>{a=!0,s=ne(),l=R(m),g=performance.now(),process.stdout.write(`${e.gray(o)}
84
- `);let h=0,w=0;j(),c=setInterval(()=>{if(i&&l===$)return;B(),$=l;const I=e.magenta(n[h]);if(i)process.stdout.write(`${I} ${l}...`);else if(t==="timer")process.stdout.write(`${I} ${l} ${O(g)}`);else{const z=".".repeat(Math.floor(w)).slice(0,3);process.stdout.write(`${I} ${l}${z}`)}h=h+1<n.length?h+1:0,w=w<n.length?w+.125:0},r)},N=(m="",h=0)=>{a=!1,clearInterval(c),B();const w=h===0?e.green(C):h===1?e.red(L):e.red(W);l=R(m??l),t==="timer"?process.stdout.write(`${w} ${l} ${O(g)}
85
- `):process.stdout.write(`${w} ${l}
86
- `),E(),s()};return{start:H,stop:N,message:(m="")=>{l=R(m??l)}}},Ce=async(t,n)=>{const r={},i=Object.keys(t);for(const s of i){const c=t[s],a=await c({results:r})?.catch(l=>{throw l});if(typeof n?.onCancel=="function"&&ie(a)){r[s]="canceled",n.onCancel({results:r});continue}r[s]=a}return r},Te=async t=>{for(const n of t){if(n.enabled===!1)continue;const r=Y();r.start(n.title);const i=await n.task(r.message);r.stop(i||n.title)}};export{xe as cancel,ye as confirm,Ce as group,be as groupMultiselect,Ie as intro,M as log,fe as multiselect,Me as note,Se as outro,ge as password,ve as select,we as selectKey,Y as spinner,x as stream,Te as tasks,he as text};
56
+ `)},Q=(e,i)=>e.split(`
57
+ `).map(s=>i(s)).join(`
58
+ `),yt=e=>{const i=(r,u)=>{const n=r.label??String(r.value);return u==="disabled"?`${t("gray",J)} ${Q(n,o=>t(["strikethrough","gray"],o))}${r.hint?` ${t("dim",`(${r.hint??"disabled"})`)}`:""}`:u==="active"?`${t("cyan",te)} ${n}${r.hint?` ${t("dim",`(${r.hint})`)}`:""}`:u==="selected"?`${t("green",U)} ${Q(n,o=>t("dim",o))}${r.hint?` ${t("dim",`(${r.hint})`)}`:""}`:u==="cancelled"?`${Q(n,o=>t(["strikethrough","dim"],o))}`:u==="active-selected"?`${t("green",U)} ${n}${r.hint?` ${t("dim",`(${r.hint})`)}`:""}`:u==="submitted"?`${Q(n,o=>t("dim",o))}`:`${t("dim",J)} ${Q(n,o=>t("dim",o))}`},s=e.required??!0;return new He({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:s,cursorAt:e.cursorAt,validate(r){if(s&&(r===void 0||r.length===0))return`Please select at least one option.
59
+ ${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t("bgWhite",t("inverse"," enter ")))} to submit`))}`},render(){const r=e.withGuide??I.withGuide,u=N(e.output,e.message,r?`${ye(this.state)} `:"",`${V(this.state)} `),n=`${r?`${t("gray",d)}
60
+ `:""}${u}
61
+ `,o=this.value??[],c=(a,l)=>{if(a.disabled)return i(a,"disabled");const $=o.includes(a.value);return l&&$?i(a,"active-selected"):$?i(a,"selected"):i(a,l?"active":"inactive")};switch(this.state){case"submit":{const a=this.options.filter(({value:$})=>o.includes($)).map($=>i($,"submitted")).join(t("dim",", "))||t("dim","none"),l=N(e.output,a,r?`${t("gray",d)} `:"");return`${n}${l}`}case"cancel":{const a=this.options.filter(({value:$})=>o.includes($)).map($=>i($,"cancelled")).join(t("dim",", "));if(a.trim()==="")return`${n}${t("gray",d)}`;const l=N(e.output,a,r?`${t("gray",d)} `:"");return`${n}${l}${r?`
62
+ ${t("gray",d)}`:""}`}case"error":{const a=r?`${t("yellow",d)} `:"",l=this.error.split(`
63
+ `).map((p,m)=>m===0?`${r?`${t("yellow",E)} `:""}${t("yellow",p)}`:` ${p}`).join(`
64
+ `),$=n.split(`
65
+ `).length,y=l.split(`
66
+ `).length+1;return`${n}${a}${Y({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:$+y,style:c}).join(`
67
+ ${a}`)}
68
+ ${l}
69
+ `}default:{const a=r?`${t("cyan",d)} `:"",l=n.split(`
70
+ `).length,$=r?2:1;return`${n}${a}${Y({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:l+$,style:c}).join(`
71
+ ${a}`)}
72
+ ${r?t("cyan",E):""}
73
+ `}}}}).prompt()},ft=e=>t("dim",e),vt=(e,i,s)=>{const r={hard:!0,trim:!1},u=q(e,i,r).split(`
74
+ `),n=u.reduce((a,l)=>Math.max(B(l),a),0),o=u.map(s).reduce((a,l)=>Math.max(B(l),a),0),c=i-(o-n);return q(e,c,r)},wt=(e="",i="",s)=>{const r=s?.output??P.stdout,u=s?.withGuide??I.withGuide,n=s?.format??ft,o=["",...vt(e,X(r)-6,n).split(`
75
+ `).map(n),""],c=B(i),a=Math.max(o.reduce((p,m)=>{const g=B(m);return g>p?g:p},0),c)+2,l=o.map(p=>`${t("gray",d)} ${p}${" ".repeat(a-B(p))}${t("gray",d)}`).join(`
76
+ `),$=u?`${t("gray",d)}
77
+ `:"",y=u?Ge:de;r.write(`${$}${t("green",F)} ${t("reset",i)} ${t("gray",se.repeat(Math.max(a-c-1,1))+ce)}
78
+ ${l}
79
+ ${t("gray",y+se.repeat(a+2)+$e)}
80
+ `)},bt=e=>new Ue({validate:e.validate,mask:e.mask??xe,signal:e.signal,input:e.input,output:e.output,render(){const i=e.withGuide??I.withGuide,s=`${i?`${t("gray",d)}
81
+ `:""}${V(this.state)} ${e.message}
82
+ `,r=this.userInputWithCursor,u=this.masked;switch(this.state){case"error":{const n=i?`${t("yellow",d)} `:"",o=i?`${t("yellow",E)} `:"",c=u??"";return e.clearOnError&&this.clear(),`${s.trim()}
83
+ ${n}${c}
84
+ ${o}${t("yellow",this.error)}
85
+ `}case"submit":{const n=i?`${t("gray",d)} `:"",o=u?t("dim",u):"";return`${s}${n}${o}`}case"cancel":{const n=i?`${t("gray",d)} `:"",o=u?t(["strikethrough","dim"],u):"";return`${s}${n}${o}${u&&i?`
86
+ ${t("gray",d)}`:""}`}default:{const n=i?`${t("cyan",d)} `:"",o=i?t("cyan",E):"";return`${s}${n}${r}
87
+ ${o}
88
+ `}}}}).prompt(),St=e=>{const i=e.validate;return Ae({...e,initialUserInput:e.initialValue??e.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(i)return i(s)}},options(){const s=this.userInput;if(s==="")return[];try{let r;Xe(s)?we(s).isDirectory()&&(!e.directory||s.endsWith("/"))?r=s:r=be(s):r=be(s);const u=s.length>1&&s.endsWith("/")?s.slice(0,-1):s;return ze(r).map(n=>{const o=Qe(r,n),c=we(o);return{name:n,path:o,isDirectory:c.isDirectory()}}).filter(({path:n,isDirectory:o})=>n.startsWith(u)&&(o||!e.directory)).map(n=>({value:n.path}))}catch{return[]}}})},Ct=e=>t("magenta",e),fe=({indicator:e="dots",onCancel:i,output:s=process.stdout,cancelMessage:r,errorMessage:u,frames:n=ee?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:o=ee?80:120,signal:c,...a}={})=>{const l=ae();let $,y,p=!1,m=!1,g="",S,h=performance.now();const f=X(s),v=a?.styleFrame??Ct,T=_=>{const A=_>1?u??I.messages.error:r??I.messages.cancel;m=_===1,p&&(W(A,_),m&&typeof i=="function"&&i())},C=()=>T(2),b=()=>T(1),x=()=>{process.on("uncaughtExceptionMonitor",C),process.on("unhandledRejection",C),process.on("SIGINT",b),process.on("SIGTERM",b),process.on("exit",T),c&&c.addEventListener("abort",b)},G=()=>{process.removeListener("uncaughtExceptionMonitor",C),process.removeListener("unhandledRejection",C),process.removeListener("SIGINT",b),process.removeListener("SIGTERM",b),process.removeListener("exit",T),c&&c.removeEventListener("abort",b)},M=()=>{if(S===void 0)return;l&&s.write(`
89
+ `);const _=q(S,f,{hard:!0,trim:!1}).split(`
90
+ `);_.length>1&&s.write(Se.up(_.length-1)),s.write(Se.to(0)),s.write(Ce.down())},R=_=>_.replace(/\.+$/,""),j=_=>{const A=(performance.now()-_)/1e3,k=Math.floor(A/60),L=Math.floor(A%60);return k>0?`[${k}m ${L}s]`:`[${L}s]`},D=a.withGuide??I.withGuide,ie=(_="")=>{p=!0,$=Ke({output:s}),g=R(_),h=performance.now(),D&&s.write(`${t("gray",d)}
91
+ `);let A=0,k=0;x(),y=setInterval(()=>{if(l&&g===S)return;M(),S=g;const L=v(n[A]);let Z;if(l)Z=`${L} ${g}...`;else if(e==="timer")Z=`${L} ${g} ${j(h)}`;else{const Be=".".repeat(Math.floor(k)).slice(0,3);Z=`${L} ${g}${Be}`}const Ne=q(Z,f,{hard:!0,trim:!1});s.write(Ne),A=A+1<n.length?A+1:0,k=k<4?k+.125:0},o)},W=(_="",A=0,k=!1)=>{if(!p)return;p=!1,clearInterval(y),M();const L=A===0?t("green",F):A===1?t("red",oe):t("red",ue);g=_??g,k||(e==="timer"?s.write(`${L} ${g} ${j(h)}
92
+ `):s.write(`${L} ${g}
93
+ `)),G(),$()};return{start:ie,stop:(_="")=>W(_,0),message:(_="")=>{g=R(_??g)},cancel:(_="")=>W(_,1),error:(_="")=>W(_,2),clear:()=>W("",0,!0),get isCancelled(){return m}}},Ve={light:w("\u2500","-"),heavy:w("\u2501","="),block:w("\u2588","#")};function Tt({style:e="heavy",max:i=100,size:s=40,...r}={}){const u=fe(r);let n=0,o="";const c=Math.max(1,i),a=Math.max(1,s),l=m=>{switch(m){case"initial":case"active":return g=>t("magenta",g);case"error":case"cancel":return g=>t("red",g);case"submit":return g=>t("green",g);default:return g=>t("magenta",g)}},$=(m,g)=>{const S=Math.floor(n/c*a);return`${l(m)(Ve[e].repeat(S))}${t("dim",Ve[e].repeat(a-S))} ${g}`},y=(m="")=>{o=m,u.start($("initial",m))},p=(m=1,g)=>{n=Math.min(c,m+n),u.message($("active",g??o)),o=g??o};return{start:y,stop:u.stop,cancel:u.cancel,error:u.error,clear:u.clear,advance:p,isCancelled:u.isCancelled,message:m=>p(0,m)}}const re=(e,i)=>e.includes(`
94
+ `)?e.split(`
95
+ `).map(s=>i(s)).join(`
96
+ `):i(e),_t=e=>{const i=(s,r)=>{const u=s.label??String(s.value);switch(r){case"disabled":return`${t("gray",H)} ${re(u,n=>t("gray",n))}${s.hint?` ${t("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${re(u,n=>t("dim",n))}`;case"active":return`${t("green",z)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${re(u,n=>t(["strikethrough","dim"],n))}`;default:return`${t("dim",H)} ${re(u,n=>t("dim",n))}`}};return new qe({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){const s=e.withGuide??I.withGuide,r=`${V(this.state)} `,u=`${ye(this.state)} `,n=N(e.output,e.message,u,r),o=`${s?`${t("gray",d)}
97
+ `:""}${n}
98
+ `;switch(this.state){case"submit":{const c=s?`${t("gray",d)} `:"",a=N(e.output,i(this.options[this.cursor],"selected"),c);return`${o}${a}`}case"cancel":{const c=s?`${t("gray",d)} `:"",a=N(e.output,i(this.options[this.cursor],"cancelled"),c);return`${o}${a}${s?`
99
+ ${t("gray",d)}`:""}`}default:{const c=s?`${t("cyan",d)} `:"",a=s?t("cyan",E):"",l=o.split(`
100
+ `).length,$=s?2:1;return`${o}${c}${Y({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:c.length,rowPadding:l+$,style:(y,p)=>i(y,y.disabled?"disabled":p?"active":"inactive")}).join(`
101
+ ${c}`)}
102
+ ${a}
103
+ `}}}}).prompt()},It=e=>{const i=(s,r="inactive")=>{const u=s.label??String(s.value);return r==="selected"?`${t("dim",u)}`:r==="cancelled"?`${t(["strikethrough","dim"],u)}`:r==="active"?`${t(["bgCyan","gray"],` ${s.value} `)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`:`${t(["gray","bgWhite","inverse"],` ${s.value} `)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`};return new Je({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,caseSensitive:e.caseSensitive,render(){const s=e.withGuide??I.withGuide,r=`${s?`${t("gray",d)}
104
+ `:""}${V(this.state)} ${e.message}
105
+ `;switch(this.state){case"submit":{const u=s?`${t("gray",d)} `:"",n=this.options.find(c=>c.value===this.value)??e.options[0],o=N(e.output,i(n,"selected"),u);return`${r}${o}`}case"cancel":{const u=s?`${t("gray",d)} `:"",n=N(e.output,i(this.options[0],"cancelled"),u);return`${r}${n}${s?`
106
+ ${t("gray",d)}`:""}`}default:{const u=s?`${t("cyan",d)} `:"",n=s?t("cyan",E):"",o=this.options.map((c,a)=>N(e.output,i(c,a===this.cursor?"active":"inactive"),u)).join(`
107
+ `);return`${r}${o}
108
+ ${n}
109
+ `}}}}).prompt()},je=`${t("gray",d)} `,K={message:async(e,{symbol:i=t("gray",d)}={})=>{process.stdout.write(`${t("gray",d)}
110
+ ${i} `);let s=3;for await(let r of e){r=r.replace(/\n/g,`
111
+ ${je}`),r.includes(`
112
+ `)&&(s=3+ne(r.slice(r.lastIndexOf(`
113
+ `))).length);const u=ne(r).length;s+u<process.stdout.columns?(s+=u,process.stdout.write(r)):(process.stdout.write(`
114
+ ${je}${r.trimStart()}`),s=3+ne(r.trimStart()).length)}process.stdout.write(`
115
+ `)},info:e=>K.message(e,{symbol:t("blue",he)}),success:e=>K.message(e,{symbol:t("green",pe)}),step:e=>K.message(e,{symbol:t("green",F)}),warn:e=>K.message(e,{symbol:t("yellow",me)}),warning:e=>K.warn(e),error:e=>K.message(e,{symbol:t("red",ge)})},Et=async(e,i)=>{for(const s of e){if(s.enabled===!1)continue;const r=fe(i);r.start(s.title);const u=await s.task(r.message);r.stop(u||s.title)}},xt=e=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),Gt=e=>{const i=e.output??process.stdout,s=X(i),r=t("gray",d),u=e.spacing??1,n=3,o=e.retainLog===!0,c=!ae()&&Te(i);i.write(`${r}
116
+ `),i.write(`${t("green",F)} ${e.title}
117
+ `);for(let h=0;h<u;h++)i.write(`${r}
118
+ `);const a=[{value:"",full:""}];let l=!1;const $=h=>{if(a.length===0)return;let f=0;h&&(f+=u+2);for(const v of a){const{value:T,result:C}=v;let b=C?.message??T;if(b.length===0)continue;C===void 0&&v.header!==void 0&&v.header!==""&&(b+=`
119
+ ${v.header}`);const x=b.split(`
120
+ `).reduce((G,M)=>M===""?G+1:G+Math.ceil((M.length+n)/s),0);f+=x}f>0&&(f+=1,i.write(Ce.lines(f)))},y=(h,f,v)=>{const T=v?`${h.full}
121
+ ${h.value}`:h.value;h.header!==void 0&&h.header!==""&&O.message(h.header.split(`
122
+ `).map(C=>t("bold",C)),{output:i,secondarySymbol:r,symbol:r,spacing:0}),O.message(T.split(`
123
+ `).map(C=>t("dim",C)),{output:i,secondarySymbol:r,symbol:r,spacing:f??u})},p=()=>{for(const h of a){const{header:f,value:v,full:T}=h;(f===void 0||f.length===0)&&v.length===0||y(h,void 0,o===!0&&T.length>0)}},m=(h,f,v)=>{if($(!1),(v?.raw!==!0||!l)&&h.value!==""&&(h.value+=`
124
+ `),h.value+=xt(f),l=v?.raw===!0,e.limit!==void 0){const T=h.value.split(`
125
+ `),C=T.length-e.limit;if(C>0){const b=T.splice(0,C);o&&(h.full+=(h.full===""?"":`
126
+ `)+b.join(`
127
+ `))}h.value=T.join(`
128
+ `)}c&&g()},g=()=>{for(const h of a)h.result?h.result.status==="error"?O.error(h.result.message,{output:i,secondarySymbol:r,spacing:0}):O.success(h.result.message,{output:i,secondarySymbol:r,spacing:0}):h.value!==""&&y(h,0)},S=(h,f)=>{$(!1),h.result=f,c&&g()};return{message(h,f){m(a[0],h,f)},group(h){const f={header:h,value:"",full:""};return a.push(f),{message(v,T){m(f,v,T)},error(v){S(f,{status:"error",message:v})},success(v){S(f,{status:"success",message:v})}}},error(h,f){$(!0),O.error(h,{output:i,secondarySymbol:r,spacing:1}),f?.showLog!==!1&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""},success(h,f){$(!0),O.success(h,{output:i,secondarySymbol:r,spacing:1}),f?.showLog===!0&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""}}},Ot=e=>new Ye({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){const i=e?.withGuide??I.withGuide,s=`${`${i?`${t("gray",d)}
129
+ `:""}${V(this.state)} `}${e.message}
130
+ `,r=e.placeholder?t("inverse",e.placeholder[0])+t("dim",e.placeholder.slice(1)):t(["inverse","hidden"],"_"),u=this.userInput?this.userInputWithCursor:r,n=this.value??"";switch(this.state){case"error":{const o=this.error?` ${t("yellow",this.error)}`:"",c=i?`${t("yellow",d)} `:"",a=i?t("yellow",E):"";return`${s.trim()}
131
+ ${c}${u}
132
+ ${a}${o}
133
+ `}case"submit":{const o=n?` ${t("dim",n)}`:"",c=i?t("gray",d):"";return`${s}${c}${o}`}case"cancel":{const o=n?` ${t(["strikethrough","dim"],n)}`:"",c=i?t("gray",d):"";return`${s}${c}${o}${n.trim()?`
134
+ ${c}`:""}`}default:{const o=i?`${t("cyan",d)} `:"",c=i?t("cyan",E):"";return`${s}${o}${u}
135
+ ${c}
136
+ `}}}}).prompt();export{d as S_BAR,E as S_BAR_END,Ee as S_BAR_END_RIGHT,se as S_BAR_H,le as S_BAR_START,Ie as S_BAR_START_RIGHT,te as S_CHECKBOX_ACTIVE,J as S_CHECKBOX_INACTIVE,U as S_CHECKBOX_SELECTED,Ge as S_CONNECT_LEFT,de as S_CORNER_BOTTOM_LEFT,$e as S_CORNER_BOTTOM_RIGHT,Oe as S_CORNER_TOP_LEFT,ce as S_CORNER_TOP_RIGHT,ge as S_ERROR,he as S_INFO,xe as S_PASSWORD_MASK,z as S_RADIO_ACTIVE,H as S_RADIO_INACTIVE,_e as S_STEP_ACTIVE,oe as S_STEP_CANCEL,ue as S_STEP_ERROR,F as S_STEP_SUBMIT,pe as S_SUCCESS,me as S_WARN,Ae as autocomplete,st as autocompleteMultiselect,at as box,pt as cancel,ot as confirm,ut as date,dt as group,ht as groupMultiselect,mt as intro,ae as isCI,Te as isTTY,Y as limitOptions,O as log,yt as multiselect,wt as note,gt as outro,bt as password,St as path,Tt as progress,_t as select,It as selectKey,fe as spinner,K as stream,V as symbol,ye as symbolBar,Gt as taskLog,Et as tasks,Ot as text,ee as unicode,w as unicodeOr};
87
137
  //# sourceMappingURL=index.mjs.map