@bunli/test 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -659,15 +659,36 @@ __export(exports_dist, {
659
659
  validateFields: () => validateFields,
660
660
  validate: () => validate,
661
661
  utils: () => utils,
662
+ text: () => text,
662
663
  spinner: () => createSpinner,
663
664
  select: () => select,
665
+ promptOrExit: () => promptOrExit,
664
666
  prompt: () => prompt2,
665
667
  password: () => password,
668
+ outro: () => outro,
669
+ note: () => note,
670
+ multiselect: () => multiselect,
671
+ log: () => log,
672
+ isCancel: () => isCancel,
673
+ intro: () => intro,
674
+ groupMultiselect: () => groupMultiselect,
675
+ group: () => group,
666
676
  getDotPath: () => getDotPath2,
667
677
  confirm: () => confirm,
668
678
  colors: () => colors,
669
- SchemaError: () => SchemaError2
679
+ clackPrompts: () => exports_dist2,
680
+ clack: () => clack,
681
+ assertNotCancelled: () => assertNotCancelled,
682
+ SchemaError: () => SchemaError2,
683
+ PromptCancelledError: () => PromptCancelledError,
684
+ CANCEL: () => CANCEL
670
685
  });
686
+ import { stripVTControlCharacters as S2 } from "util";
687
+ import { stdin as j, stdout as M } from "process";
688
+ import * as g from "readline";
689
+ import O from "readline";
690
+ import { Writable as X } from "stream";
691
+ import y2 from "process";
671
692
  function createColorFunction(code) {
672
693
  return (text) => {
673
694
  if (!process.stdout.isTTY || process.env.NO_COLOR) {
@@ -679,171 +700,411 @@ function createColorFunction(code) {
679
700
  function stripAnsi(text) {
680
701
  return text.replace(/\x1b\[[0-9;]*m/g, "");
681
702
  }
682
- async function readline(prompt) {
683
- process.stdout.write(prompt);
684
- for await (const line of console) {
685
- return line;
686
- }
687
- return "";
688
- }
689
- async function prompt(message, options = {}) {
690
- const defaultHint = options.default ? ` (${options.default})` : "";
691
- const promptText = `${message}${defaultHint} `;
692
- while (true) {
693
- const input = await readline(promptText);
694
- const value2 = input.trim() || options.default || "";
695
- if (options.schema) {
696
- const result = await options.schema["~standard"].validate(value2);
697
- if (result.issues) {
698
- console.error(colors.red("Invalid input:"));
699
- for (const issue2 of result.issues) {
700
- console.error(colors.dim(` \u2022 ${issue2.message}`));
703
+ function getDotPath2(issue2) {
704
+ if (issue2.path?.length) {
705
+ let dotPath = "";
706
+ for (const item of issue2.path) {
707
+ const key2 = typeof item === "object" ? item.key : item;
708
+ if (typeof key2 === "string" || typeof key2 === "number") {
709
+ if (dotPath) {
710
+ dotPath += `.${key2}`;
711
+ } else {
712
+ dotPath += key2;
701
713
  }
702
- console.error();
703
- continue;
704
- }
705
- return result.value;
706
- }
707
- if (options.validate) {
708
- const result = options.validate(value2);
709
- if (result === true) {
710
- return value2;
711
- } else if (typeof result === "string") {
712
- console.error(`\u2717 ${result}`);
713
- continue;
714
714
  } else {
715
- console.error("\u2717 Invalid input");
716
- continue;
715
+ return null;
717
716
  }
718
717
  }
719
- return value2;
718
+ return dotPath;
720
719
  }
720
+ return null;
721
721
  }
722
- async function confirm(message, options = {}) {
723
- const defaultHint = options.default === true ? "Y/n" : options.default === false ? "y/N" : "y/n";
724
- const promptText = `${message} (${defaultHint}) `;
725
- while (true) {
726
- const input = await readline(promptText);
727
- const value2 = input.trim().toLowerCase();
728
- if (!value2 && options.default !== undefined) {
729
- return options.default;
722
+ function DD({ onlyFirst: e = false } = {}) {
723
+ const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
724
+ return new RegExp(t, e ? undefined : "g");
725
+ }
726
+ function P(e) {
727
+ if (typeof e != "string")
728
+ throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
729
+ return e.replace(uD, "");
730
+ }
731
+ function L(e) {
732
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
733
+ }
734
+ function p(e, u = {}) {
735
+ if (typeof e != "string" || e.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, e = P(e), e.length === 0))
736
+ return 0;
737
+ e = e.replace(sD(), " ");
738
+ const t = u.ambiguousIsNarrow ? 1 : 2;
739
+ let F = 0;
740
+ for (const s of e) {
741
+ const i = s.codePointAt(0);
742
+ if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879)
743
+ continue;
744
+ switch (eD.eastAsianWidth(s)) {
745
+ case "F":
746
+ case "W":
747
+ F += 2;
748
+ break;
749
+ case "A":
750
+ F += t;
751
+ break;
752
+ default:
753
+ F += 1;
754
+ }
755
+ }
756
+ return F;
757
+ }
758
+ function CD() {
759
+ const e = new Map;
760
+ for (const [u, t] of Object.entries(C)) {
761
+ for (const [F, s] of Object.entries(t))
762
+ C[F] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, t[F] = C[F], e.set(s[0], s[1]);
763
+ Object.defineProperty(C, u, { value: t, enumerable: false });
764
+ }
765
+ return Object.defineProperty(C, "codes", { value: e, enumerable: false }), C.color.close = "\x1B[39m", C.bgColor.close = "\x1B[49m", C.color.ansi = N(), C.color.ansi256 = I(), C.color.ansi16m = R(), C.bgColor.ansi = N(w), C.bgColor.ansi256 = I(w), C.bgColor.ansi16m = R(w), Object.defineProperties(C, { rgbToAnsi256: { value: (u, t, F) => u === t && t === F ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
766
+ const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
767
+ if (!t)
768
+ return [0, 0, 0];
769
+ let [F] = t;
770
+ F.length === 3 && (F = [...F].map((i) => i + i).join(""));
771
+ const s = Number.parseInt(F, 16);
772
+ return [s >> 16 & 255, s >> 8 & 255, s & 255];
773
+ }, enumerable: false }, hexToAnsi256: { value: (u) => C.rgbToAnsi256(...C.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
774
+ if (u < 8)
775
+ return 30 + u;
776
+ if (u < 16)
777
+ return 90 + (u - 8);
778
+ let t, F, s;
779
+ if (u >= 232)
780
+ t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
781
+ else {
782
+ u -= 16;
783
+ const r = u % 36;
784
+ t = Math.floor(u / 36) / 5, F = Math.floor(r / 6) / 5, s = r % 6 / 5;
785
+ }
786
+ const i = Math.max(t, F, s) * 2;
787
+ if (i === 0)
788
+ return 30;
789
+ let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
790
+ return i === 2 && (D += 60), D;
791
+ }, enumerable: false }, rgbToAnsi: { value: (u, t, F) => C.ansi256ToAnsi(C.rgbToAnsi256(u, t, F)), enumerable: false }, hexToAnsi: { value: (u) => C.ansi256ToAnsi(C.hexToAnsi256(u)), enumerable: false } }), C;
792
+ }
793
+ function Y(e, u, t) {
794
+ return String(e).normalize().replace(/\r\n/g, `
795
+ `).split(`
796
+ `).map((F) => lD(F, u, t)).join(`
797
+ `);
798
+ }
799
+ function cD(e) {
800
+ for (const u in e) {
801
+ const t = u;
802
+ if (!Object.hasOwn(e, t))
803
+ continue;
804
+ const F = e[t];
805
+ switch (t) {
806
+ case "aliases": {
807
+ for (const s in F)
808
+ Object.hasOwn(F, s) && (B.aliases.has(s) || B.aliases.set(s, F[s]));
809
+ break;
810
+ }
730
811
  }
731
- if (value2 === "y" || value2 === "yes") {
812
+ }
813
+ }
814
+ function $(e, u) {
815
+ if (typeof e == "string")
816
+ return B.aliases.get(e) === u;
817
+ for (const t of e)
818
+ if (t !== undefined && $(t, u))
732
819
  return true;
820
+ return false;
821
+ }
822
+ function BD(e, u) {
823
+ if (e === u)
824
+ return;
825
+ const t = e.split(`
826
+ `), F = u.split(`
827
+ `), s = [];
828
+ for (let i = 0;i < Math.max(t.length, F.length); i++)
829
+ t[i] !== F[i] && s.push(i);
830
+ return s;
831
+ }
832
+ function pD(e) {
833
+ return e === S;
834
+ }
835
+ function m(e, u) {
836
+ const t = e;
837
+ t.isTTY && t.setRawMode(u);
838
+ }
839
+ function fD({ input: e = j, output: u = M, overwrite: t = true, hideCursor: F = true } = {}) {
840
+ const s = g.createInterface({ input: e, output: u, prompt: "", tabSize: 1 });
841
+ g.emitKeypressEvents(e, s), e.isTTY && e.setRawMode(true);
842
+ const i = (D, { name: r, sequence: n }) => {
843
+ const E = String(D);
844
+ if ($([E, r, n], "cancel")) {
845
+ F && u.write(import_sisteransi.cursor.show), process.exit(0);
846
+ return;
733
847
  }
734
- if (value2 === "n" || value2 === "no") {
735
- return false;
848
+ if (!t)
849
+ return;
850
+ const a = r === "return" ? 0 : -1, o = r === "return" ? -1 : 0;
851
+ g.moveCursor(u, a, o, () => {
852
+ g.clearLine(u, 1, () => {
853
+ e.once("keypress", i);
854
+ });
855
+ });
856
+ };
857
+ return F && u.write(import_sisteransi.cursor.hide), e.once("keypress", i), () => {
858
+ e.off("keypress", i), F && u.write(import_sisteransi.cursor.show), e.isTTY && !AD && e.setRawMode(false), s.terminal = false, s.close();
859
+ };
860
+ }
861
+
862
+ class x {
863
+ constructor(u, t = true) {
864
+ h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", new Map), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
865
+ const { input: F = j, output: s = M, render: i, signal: D, ...r } = u;
866
+ this.opts = r, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D, this.input = F, this.output = s;
867
+ }
868
+ unsubscribe() {
869
+ this._subscribers.clear();
870
+ }
871
+ setSubscriber(u, t) {
872
+ const F = this._subscribers.get(u) ?? [];
873
+ F.push(t), this._subscribers.set(u, F);
874
+ }
875
+ on(u, t) {
876
+ this.setSubscriber(u, { cb: t });
877
+ }
878
+ once(u, t) {
879
+ this.setSubscriber(u, { cb: t, once: true });
880
+ }
881
+ emit(u, ...t) {
882
+ const F = this._subscribers.get(u) ?? [], s = [];
883
+ for (const i of F)
884
+ i.cb(...t), i.once && s.push(() => F.splice(F.indexOf(i), 1));
885
+ for (const i of s)
886
+ i();
887
+ }
888
+ prompt() {
889
+ return new Promise((u, t) => {
890
+ if (this._abortSignal) {
891
+ if (this._abortSignal.aborted)
892
+ return this.state = "cancel", this.close(), u(S);
893
+ this._abortSignal.addEventListener("abort", () => {
894
+ this.state = "cancel", this.close();
895
+ }, { once: true });
896
+ }
897
+ const F = new X;
898
+ F._write = (s, i, D) => {
899
+ this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
900
+ }, this.input.pipe(F), this.rl = O.createInterface({ input: this.input, output: F, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), O.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== undefined && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
901
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(this.value);
902
+ }), this.once("cancel", () => {
903
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u(S);
904
+ });
905
+ });
906
+ }
907
+ onKeypress(u, t) {
908
+ if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === "\t" && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), t?.name === "return") {
909
+ if (!this.value && this.opts.placeholder && (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder)), this.opts.validate) {
910
+ const F = this.opts.validate(this.value);
911
+ F && (this.error = F instanceof Error ? F.message : F, this.state = "error", this.rl?.write(this.value));
912
+ }
913
+ this.state !== "error" && (this.state = "submit");
914
+ }
915
+ $([u, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
916
+ }
917
+ close() {
918
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
919
+ `), m(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
920
+ }
921
+ restoreCursor() {
922
+ const u = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
923
+ `).length - 1;
924
+ this.output.write(import_sisteransi.cursor.move(-999, u * -1));
925
+ }
926
+ render() {
927
+ const u = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
928
+ if (u !== this._prevFrame) {
929
+ if (this.state === "initial")
930
+ this.output.write(import_sisteransi.cursor.hide);
931
+ else {
932
+ const t = BD(this._prevFrame, u);
933
+ if (this.restoreCursor(), t && t?.length === 1) {
934
+ const F = t[0];
935
+ this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.lines(1));
936
+ const s = u.split(`
937
+ `);
938
+ this.output.write(s[F]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s.length - F - 1));
939
+ return;
940
+ }
941
+ if (t && t?.length > 1) {
942
+ const F = t[0];
943
+ this.output.write(import_sisteransi.cursor.move(0, F)), this.output.write(import_sisteransi.erase.down());
944
+ const s = u.split(`
945
+ `).slice(F);
946
+ this.output.write(s.join(`
947
+ `)), this._prevFrame = u;
948
+ return;
949
+ }
950
+ this.output.write(import_sisteransi.erase.down());
951
+ }
952
+ this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
736
953
  }
737
- console.error("\u2717 Please answer with y/yes or n/no");
738
954
  }
739
955
  }
740
- async function select(message, options) {
741
- const { options: choices, default: defaultValue } = options;
742
- let selectedIndex = defaultValue ? choices.findIndex((opt) => opt.value === defaultValue) : 0;
743
- if (selectedIndex === -1)
744
- selectedIndex = 0;
745
- console.log(message);
746
- process.stdout.write(CURSOR_HIDE);
747
- drawOptions(choices, selectedIndex);
748
- return new Promise((resolve) => {
749
- process.stdin.setRawMode(true);
750
- process.stdin.resume();
751
- const cleanup = () => {
752
- process.stdin.setRawMode(false);
753
- process.stdin.pause();
754
- process.stdout.write(CURSOR_SHOW);
755
- };
756
- process.stdin.on("data", (data) => {
757
- const key2 = data.toString();
758
- if (key2 === "\x1B[A") {
759
- selectedIndex = Math.max(0, selectedIndex - 1);
760
- drawOptions(choices, selectedIndex);
761
- } else if (key2 === "\x1B[B") {
762
- selectedIndex = Math.min(choices.length - 1, selectedIndex + 1);
763
- drawOptions(choices, selectedIndex);
764
- } else if (key2 === "\r" || key2 === `
765
- `) {
766
- cleanup();
767
- for (let i = 0;i < choices.length; i++) {
768
- process.stdout.write(`${CSI}1A${CLEAR_LINE}`);
769
- }
770
- const selected = choices[selectedIndex];
771
- if (selected) {
772
- console.log(`\u2713 ${selected.label}`);
773
- resolve(selected.value);
774
- }
775
- } else if (key2 === "\x03" || key2 === "\x1B") {
776
- cleanup();
777
- process.exit(0);
778
- }
956
+ function ce() {
957
+ return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
958
+ }
959
+ function isCancel(value2) {
960
+ return value2 === CANCEL || pD(value2);
961
+ }
962
+ function assertNotCancelled(value2, message) {
963
+ if (isCancel(value2))
964
+ throw new PromptCancelledError(message);
965
+ return value2;
966
+ }
967
+ function promptOrExit(value2, message) {
968
+ if (isCancel(value2)) {
969
+ xe(message ?? "Cancelled");
970
+ process.exit(0);
971
+ }
972
+ return value2;
973
+ }
974
+ function toClackOption(o2) {
975
+ if (o2.hint !== undefined && o2.disabled !== undefined) {
976
+ return { value: o2.value, label: o2.label, hint: o2.hint, disabled: o2.disabled };
977
+ }
978
+ if (o2.hint !== undefined) {
979
+ return { value: o2.value, label: o2.label, hint: o2.hint };
980
+ }
981
+ if (o2.disabled !== undefined) {
982
+ return { value: o2.value, label: o2.label, disabled: o2.disabled };
983
+ }
984
+ return { value: o2.value, label: o2.label };
985
+ }
986
+ function cancelAndThrow(message) {
987
+ clack.cancel(message ?? "Cancelled");
988
+ throw new PromptCancelledError(message ?? "Cancelled");
989
+ }
990
+ async function validateWithSchema(value2, options) {
991
+ const result = await options.schema["~standard"].validate(value2);
992
+ if (result.issues) {
993
+ throw new SchemaError2(result.issues);
994
+ }
995
+ return result.value;
996
+ }
997
+ function renderSchemaIssues(error48) {
998
+ if (!(error48 instanceof SchemaError2))
999
+ return;
1000
+ console.error(colors.red("Invalid input:"));
1001
+ for (const issue2 of error48.issues) {
1002
+ console.error(colors.dim(` \u2022 ${issue2.message}`));
1003
+ }
1004
+ console.error();
1005
+ }
1006
+ async function prompt(message, options = {}) {
1007
+ while (true) {
1008
+ const value2 = await clack.text({
1009
+ message,
1010
+ placeholder: options.placeholder,
1011
+ defaultValue: options.default,
1012
+ validate: options.validate ? (v2) => {
1013
+ const input2 = (v2 ?? "").trim();
1014
+ const res = options.validate?.(input2);
1015
+ if (res === true)
1016
+ return;
1017
+ if (typeof res === "string")
1018
+ return res;
1019
+ return "Invalid input";
1020
+ } : undefined
779
1021
  });
1022
+ if (clack.isCancel(value2))
1023
+ cancelAndThrow();
1024
+ const input = (value2 ?? "").trim();
1025
+ if (options.schema) {
1026
+ try {
1027
+ return await validateWithSchema(input, options);
1028
+ } catch (err) {
1029
+ renderSchemaIssues(err);
1030
+ continue;
1031
+ }
1032
+ }
1033
+ return input;
1034
+ }
1035
+ }
1036
+ async function confirm(message, options = {}) {
1037
+ const value2 = await clack.confirm({
1038
+ message,
1039
+ initialValue: options.default
780
1040
  });
1041
+ if (clack.isCancel(value2))
1042
+ cancelAndThrow();
1043
+ return value2;
781
1044
  }
782
- function drawOptions(options, selectedIndex) {
783
- for (let i = 0;i < options.length; i++) {
784
- process.stdout.write(`${CSI}1A`);
785
- }
786
- options.forEach((option2, index) => {
787
- process.stdout.write(CLEAR_LINE + CURSOR_START);
788
- const prefix = index === selectedIndex ? "\u276F " : " ";
789
- const hint = option2.hint ? ` (${option2.hint})` : "";
790
- console.log(`${prefix}${option2.label}${hint}`);
1045
+ async function select(message, options) {
1046
+ const mappedOptions = options.options.map((o2) => toClackOption({ value: o2.value, label: o2.label, hint: o2.hint, disabled: o2.disabled }));
1047
+ const value2 = await clack.select({
1048
+ message,
1049
+ options: mappedOptions,
1050
+ initialValue: options.default
791
1051
  });
1052
+ if (clack.isCancel(value2))
1053
+ cancelAndThrow();
1054
+ return value2;
1055
+ }
1056
+ async function multiselect(message, options) {
1057
+ const mappedOptions = options.options.map((o2) => toClackOption({ value: o2.value, label: o2.label, hint: o2.hint, disabled: o2.disabled }));
1058
+ while (true) {
1059
+ const value2 = await clack.multiselect({
1060
+ message,
1061
+ options: mappedOptions,
1062
+ initialValues: options.initialValues,
1063
+ required: (options.min ?? 0) > 0
1064
+ });
1065
+ if (clack.isCancel(value2))
1066
+ cancelAndThrow();
1067
+ const picked = value2 ?? [];
1068
+ const min = options.min ?? 0;
1069
+ const max = options.max;
1070
+ if (min > 0 && picked.length < min) {
1071
+ console.error(colors.red(`Please select at least ${min} option(s).`));
1072
+ continue;
1073
+ }
1074
+ if (typeof max === "number" && picked.length > max) {
1075
+ console.error(colors.red(`Please select at most ${max} option(s).`));
1076
+ continue;
1077
+ }
1078
+ return picked;
1079
+ }
792
1080
  }
793
1081
  async function password(message, options = {}) {
794
- process.stdout.write(message + " ");
795
- return new Promise((resolve) => {
796
- let input = "";
797
- process.stdin.setRawMode(true);
798
- process.stdin.resume();
799
- const cleanup = () => {
800
- process.stdin.setRawMode(false);
801
- process.stdin.pause();
802
- console.log();
803
- };
804
- process.stdin.on("data", async (data) => {
805
- const key2 = data.toString();
806
- if (key2 === "\r" || key2 === `
807
- `) {
808
- cleanup();
809
- if (options.schema) {
810
- const result = await options.schema["~standard"].validate(input);
811
- if (result.issues) {
812
- console.error(colors.red("Invalid input:"));
813
- for (const issue2 of result.issues) {
814
- console.error(colors.dim(` \u2022 ${issue2.message}`));
815
- }
816
- console.error();
817
- password(message, options).then(resolve);
818
- return;
819
- }
820
- resolve(result.value);
821
- } else if (options.validate) {
822
- const result = options.validate(input);
823
- if (result === true) {
824
- resolve(input);
825
- } else {
826
- const errorMsg = typeof result === "string" ? result : "Invalid input";
827
- console.error(`\u2717 ${errorMsg}`);
828
- password(message, options).then(resolve);
829
- }
830
- } else {
831
- resolve(input);
832
- }
833
- } else if (key2 === "\x03") {
834
- cleanup();
835
- process.exit(0);
836
- } else if (key2 === "\x7F" || key2 === "\b") {
837
- if (input.length > 0) {
838
- input = input.slice(0, -1);
839
- process.stdout.write("\b \b");
840
- }
841
- } else if (key2.length === 1 && key2 >= " ") {
842
- input += key2;
843
- process.stdout.write("*");
844
- }
1082
+ while (true) {
1083
+ const value2 = await clack.password({
1084
+ message,
1085
+ validate: options.validate ? (v2) => {
1086
+ const input2 = v2 ?? "";
1087
+ const res = options.validate?.(input2);
1088
+ if (res === true)
1089
+ return;
1090
+ if (typeof res === "string")
1091
+ return res;
1092
+ return "Invalid input";
1093
+ } : undefined
845
1094
  });
846
- });
1095
+ if (clack.isCancel(value2))
1096
+ cancelAndThrow();
1097
+ const input = value2 ?? "";
1098
+ if (options.schema) {
1099
+ try {
1100
+ return await validateWithSchema(input, options);
1101
+ } catch (err) {
1102
+ renderSchemaIssues(err);
1103
+ continue;
1104
+ }
1105
+ }
1106
+ return input;
1107
+ }
847
1108
  }
848
1109
  function createSpinner(options) {
849
1110
  const config2 = typeof options === "string" ? { text: options } : options || {};
@@ -851,16 +1112,16 @@ function createSpinner(options) {
851
1112
  let frameIndex = 0;
852
1113
  let intervalId = null;
853
1114
  let currentText = config2.text || "";
854
- const render = (symbol2, text) => {
855
- process.stdout.write(`${CLEAR_LINE2}${CURSOR_START2}${symbol2} ${text}`);
1115
+ const render = (symbol2, text2) => {
1116
+ process.stdout.write(`${CLEAR_LINE}${CURSOR_START}${symbol2} ${text2}`);
856
1117
  };
857
1118
  const spinner = {
858
- start(text) {
1119
+ start(text2) {
859
1120
  if (isSpinning)
860
1121
  return;
861
1122
  isSpinning = true;
862
- if (text !== undefined) {
863
- currentText = text;
1123
+ if (text2 !== undefined) {
1124
+ currentText = text2;
864
1125
  }
865
1126
  process.stdout.write("\x1B[?25l");
866
1127
  intervalId = setInterval(() => {
@@ -869,7 +1130,7 @@ function createSpinner(options) {
869
1130
  frameIndex = (frameIndex + 1) % SPINNER_FRAMES.length;
870
1131
  }, 80);
871
1132
  },
872
- stop(text) {
1133
+ stop(text2) {
873
1134
  if (!isSpinning)
874
1135
  return;
875
1136
  isSpinning = false;
@@ -877,30 +1138,30 @@ function createSpinner(options) {
877
1138
  clearInterval(intervalId);
878
1139
  intervalId = null;
879
1140
  }
880
- process.stdout.write(CLEAR_LINE2 + CURSOR_START2);
1141
+ process.stdout.write(CLEAR_LINE + CURSOR_START);
881
1142
  process.stdout.write("\x1B[?25h");
882
- if (text) {
883
- console.log(text);
1143
+ if (text2) {
1144
+ console.log(text2);
884
1145
  }
885
1146
  },
886
- succeed(text) {
1147
+ succeed(text2) {
887
1148
  this.stop();
888
- console.log(`\u2705 ${text || currentText}`);
1149
+ console.log(`\u2705 ${text2 || currentText}`);
889
1150
  },
890
- fail(text) {
1151
+ fail(text2) {
891
1152
  this.stop();
892
- console.log(`\u274C ${text || currentText}`);
1153
+ console.log(`\u274C ${text2 || currentText}`);
893
1154
  },
894
- warn(text) {
1155
+ warn(text2) {
895
1156
  this.stop();
896
- console.log(`\u26A0\uFE0F ${text || currentText}`);
1157
+ console.log(`\u26A0\uFE0F ${text2 || currentText}`);
897
1158
  },
898
- info(text) {
1159
+ info(text2) {
899
1160
  this.stop();
900
- console.log(`\u2139\uFE0F ${text || currentText}`);
1161
+ console.log(`\u2139\uFE0F ${text2 || currentText}`);
901
1162
  },
902
- update(text) {
903
- currentText = text;
1163
+ update(text2) {
1164
+ currentText = text2;
904
1165
  if (isSpinning) {
905
1166
  render(SPINNER_FRAMES[frameIndex], currentText);
906
1167
  }
@@ -913,25 +1174,6 @@ function createSpinner(options) {
913
1174
  });
914
1175
  return spinner;
915
1176
  }
916
- function getDotPath2(issue2) {
917
- if (issue2.path?.length) {
918
- let dotPath = "";
919
- for (const item of issue2.path) {
920
- const key2 = typeof item === "object" ? item.key : item;
921
- if (typeof key2 === "string" || typeof key2 === "number") {
922
- if (dotPath) {
923
- dotPath += `.${key2}`;
924
- } else {
925
- dotPath += key2;
926
- }
927
- } else {
928
- return null;
929
- }
930
- }
931
- return dotPath;
932
- }
933
- return null;
934
- }
935
1177
  async function validate(schema, value2) {
936
1178
  const result = await schema["~standard"].validate(value2);
937
1179
  if (result.issues) {
@@ -955,8 +1197,557 @@ async function validateFields(schemas3, values) {
955
1197
  }
956
1198
  return results;
957
1199
  }
958
- var colorCodes, colors, ESC = "\x1B", CSI, CLEAR_LINE, CURSOR_START, CURSOR_HIDE, CURSOR_SHOW, SPINNER_FRAMES, CLEAR_LINE2 = "\x1B[2K", CURSOR_START2 = "\x1B[G", SchemaError2, utils, prompt2;
1200
+ var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __toESM2 = (mod, isNodeMode, target) => {
1201
+ target = mod != null ? __create2(__getProtoOf2(mod)) : {};
1202
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target;
1203
+ for (let key2 of __getOwnPropNames2(mod))
1204
+ if (!__hasOwnProp2.call(to, key2))
1205
+ __defProp2(to, key2, {
1206
+ get: () => mod[key2],
1207
+ enumerable: true
1208
+ });
1209
+ return to;
1210
+ }, __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), __export2 = (target, all) => {
1211
+ for (var name2 in all)
1212
+ __defProp2(target, name2, {
1213
+ get: all[name2],
1214
+ enumerable: true,
1215
+ configurable: true,
1216
+ set: (newValue) => all[name2] = () => newValue
1217
+ });
1218
+ }, require_src2, require_picocolors, colorCodes, colors, SchemaError2, exports_dist2, import_sisteransi, import_picocolors, uD, W, tD, eD, FD = function() {
1219
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
1220
+ }, sD, w = 10, N = (e = 0) => (u) => `\x1B[${u + e}m`, I = (e = 0) => (u) => `\x1B[${38 + e};5;${u}m`, R = (e = 0) => (u, t, F) => `\x1B[${38 + e};2;${u};${t};${F}m`, C, iD, rD, ED, d, oD = 39, y = "\x07", V = "[", nD = "]", G = "m", _, z2 = (e) => `${d.values().next().value}${V}${e}${G}`, K = (e) => `${d.values().next().value}${_}${e}${y}`, aD = (e) => e.split(" ").map((u) => p(u)), k = (e, u, t) => {
1221
+ const F = [...u];
1222
+ let s = false, i = false, D = p(P(e[e.length - 1]));
1223
+ for (const [r, n] of F.entries()) {
1224
+ const E = p(n);
1225
+ if (D + E <= t ? e[e.length - 1] += n : (e.push(n), D = 0), d.has(n) && (s = true, i = F.slice(r + 1).join("").startsWith(_)), s) {
1226
+ i ? n === y && (s = false, i = false) : n === G && (s = false);
1227
+ continue;
1228
+ }
1229
+ D += E, D === t && r < F.length - 1 && (e.push(""), D = 0);
1230
+ }
1231
+ !D && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
1232
+ }, hD = (e) => {
1233
+ const u = e.split(" ");
1234
+ let t = u.length;
1235
+ for (;t > 0 && !(p(u[t - 1]) > 0); )
1236
+ t--;
1237
+ return t === u.length ? e : u.slice(0, t).join(" ") + u.slice(t).join("");
1238
+ }, lD = (e, u, t = {}) => {
1239
+ if (t.trim !== false && e.trim() === "")
1240
+ return "";
1241
+ let F = "", s, i;
1242
+ const D = aD(e);
1243
+ let r = [""];
1244
+ for (const [E, a] of e.split(" ").entries()) {
1245
+ t.trim !== false && (r[r.length - 1] = r[r.length - 1].trimStart());
1246
+ let o = p(r[r.length - 1]);
1247
+ if (E !== 0 && (o >= u && (t.wordWrap === false || t.trim === false) && (r.push(""), o = 0), (o > 0 || t.trim === false) && (r[r.length - 1] += " ", o++)), t.hard && D[E] > u) {
1248
+ const c = u - o, f = 1 + Math.floor((D[E] - c - 1) / u);
1249
+ Math.floor((D[E] - 1) / u) < f && r.push(""), k(r, a, u);
1250
+ continue;
1251
+ }
1252
+ if (o + D[E] > u && o > 0 && D[E] > 0) {
1253
+ if (t.wordWrap === false && o < u) {
1254
+ k(r, a, u);
1255
+ continue;
1256
+ }
1257
+ r.push("");
1258
+ }
1259
+ if (o + D[E] > u && t.wordWrap === false) {
1260
+ k(r, a, u);
1261
+ continue;
1262
+ }
1263
+ r[r.length - 1] += a;
1264
+ }
1265
+ t.trim !== false && (r = r.map((E) => hD(E)));
1266
+ const n = [...r.join(`
1267
+ `)];
1268
+ for (const [E, a] of n.entries()) {
1269
+ if (F += a, d.has(a)) {
1270
+ const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
1271
+ if (c.code !== undefined) {
1272
+ const f = Number.parseFloat(c.code);
1273
+ s = f === oD ? undefined : f;
1274
+ } else
1275
+ c.uri !== undefined && (i = c.uri.length === 0 ? undefined : c.uri);
1276
+ }
1277
+ const o = ED.codes.get(Number(s));
1278
+ n[E + 1] === `
1279
+ ` ? (i && (F += K("")), s && o && (F += z2(o))) : a === `
1280
+ ` && (s && o && (F += z2(s)), i && (F += K(i)));
1281
+ }
1282
+ return F;
1283
+ }, xD, B, AD, S, gD, vD = (e, u, t) => (u in e) ? gD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t), dD, mD, bD = (e, u, t) => (u in e) ? mD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, Z = (e, u, t) => (bD(e, typeof u != "symbol" ? u + "" : u, t), t), q = (e, u, t) => {
1284
+ if (!u.has(e))
1285
+ throw TypeError("Cannot " + t);
1286
+ }, T = (e, u, t) => (q(e, u, "read from private field"), t ? t.call(e) : u.get(e)), wD = (e, u, t) => {
1287
+ if (u.has(e))
1288
+ throw TypeError("Cannot add the same private member more than once");
1289
+ u instanceof WeakSet ? u.add(e) : u.set(e, t);
1290
+ }, yD = (e, u, t, F) => (q(e, u, "write to private field"), F ? F.call(e, t) : u.set(e, t), t), A, _D, kD, $D = (e, u, t) => (u in e) ? kD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t), SD, TD, jD = (e, u, t) => (u in e) ? TD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, U = (e, u, t) => (jD(e, typeof u != "symbol" ? u + "" : u, t), t), MD, OD, PD = (e, u, t) => (u in e) ? OD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, J = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t), LD, WD, ND = (e, u, t) => (u in e) ? WD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, Q = (e, u, t) => (ND(e, typeof u != "symbol" ? u + "" : u, t), t), ID, RD, import_picocolors2, import_sisteransi2, V2, u = (t, n) => V2 ? t : n, le, L2, W2, C2, ue, o, d2, k2, P2, A2, T2, F, $e, _2, me, de, pe, q2, D, U2, K2, b2 = (t) => {
1291
+ switch (t) {
1292
+ case "initial":
1293
+ case "active":
1294
+ return import_picocolors2.default.cyan(le);
1295
+ case "cancel":
1296
+ return import_picocolors2.default.red(L2);
1297
+ case "error":
1298
+ return import_picocolors2.default.yellow(W2);
1299
+ case "submit":
1300
+ return import_picocolors2.default.green(C2);
1301
+ }
1302
+ }, G2 = (t) => {
1303
+ 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));
1304
+ let l2 = 0;
1305
+ n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
1306
+ const $2 = a < r.length && l2 > 0, g2 = a < r.length && l2 + a < r.length;
1307
+ return r.slice(l2, l2 + a).map((p2, v2, f) => {
1308
+ const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
1309
+ return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
1310
+ });
1311
+ }, he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
1312
+ const n = `${import_picocolors2.default.gray(o)}
1313
+ ${b2(this.state)} ${t.message}
1314
+ `, r = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r;
1315
+ switch (this.state) {
1316
+ case "error":
1317
+ return `${n.trim()}
1318
+ ${import_picocolors2.default.yellow(o)} ${i}
1319
+ ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
1320
+ `;
1321
+ case "submit":
1322
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
1323
+ case "cancel":
1324
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
1325
+ ${import_picocolors2.default.gray(o)}` : ""}`;
1326
+ default:
1327
+ return `${n}${import_picocolors2.default.cyan(o)} ${i}
1328
+ ${import_picocolors2.default.cyan(d2)}
1329
+ `;
1330
+ }
1331
+ } }).prompt(), ge = (t) => new MD({ validate: t.validate, mask: t.mask ?? $e, render() {
1332
+ const n = `${import_picocolors2.default.gray(o)}
1333
+ ${b2(this.state)} ${t.message}
1334
+ `, r = this.valueWithCursor, i = this.masked;
1335
+ switch (this.state) {
1336
+ case "error":
1337
+ return `${n.trim()}
1338
+ ${import_picocolors2.default.yellow(o)} ${i}
1339
+ ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
1340
+ `;
1341
+ case "submit":
1342
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(i)}`;
1343
+ case "cancel":
1344
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i ?? ""))}${i ? `
1345
+ ${import_picocolors2.default.gray(o)}` : ""}`;
1346
+ default:
1347
+ return `${n}${import_picocolors2.default.cyan(o)} ${r}
1348
+ ${import_picocolors2.default.cyan(d2)}
1349
+ `;
1350
+ }
1351
+ } }).prompt(), ye = (t) => {
1352
+ const n = t.active ?? "Yes", r = t.inactive ?? "No";
1353
+ return new dD({ active: n, inactive: r, initialValue: t.initialValue ?? true, render() {
1354
+ const i = `${import_picocolors2.default.gray(o)}
1355
+ ${b2(this.state)} ${t.message}
1356
+ `, s = this.value ? n : r;
1357
+ switch (this.state) {
1358
+ case "submit":
1359
+ return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
1360
+ case "cancel":
1361
+ return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
1362
+ ${import_picocolors2.default.gray(o)}`;
1363
+ default:
1364
+ return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r)}` : `${import_picocolors2.default.green(k2)} ${r}`}
1365
+ ${import_picocolors2.default.cyan(d2)}
1366
+ `;
1367
+ }
1368
+ } }).prompt();
1369
+ }, ve = (t) => {
1370
+ const n = (r, i) => {
1371
+ const s = r.label ?? String(r.value);
1372
+ switch (i) {
1373
+ case "selected":
1374
+ return `${import_picocolors2.default.dim(s)}`;
1375
+ case "active":
1376
+ return `${import_picocolors2.default.green(k2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}`;
1377
+ case "cancelled":
1378
+ return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
1379
+ default:
1380
+ return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}`;
1381
+ }
1382
+ };
1383
+ return new LD({ options: t.options, initialValue: t.initialValue, render() {
1384
+ const r = `${import_picocolors2.default.gray(o)}
1385
+ ${b2(this.state)} ${t.message}
1386
+ `;
1387
+ switch (this.state) {
1388
+ case "submit":
1389
+ return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
1390
+ case "cancel":
1391
+ return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
1392
+ ${import_picocolors2.default.gray(o)}`;
1393
+ default:
1394
+ return `${r}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
1395
+ ${import_picocolors2.default.cyan(o)} `)}
1396
+ ${import_picocolors2.default.cyan(d2)}
1397
+ `;
1398
+ }
1399
+ } }).prompt();
1400
+ }, we = (t) => {
1401
+ const n = (r, i = "inactive") => {
1402
+ const s = r.label ?? String(r.value);
1403
+ return i === "selected" ? `${import_picocolors2.default.dim(s)}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : i === "active" ? `${import_picocolors2.default.bgCyan(import_picocolors2.default.gray(` ${r.value} `))} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : `${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(` ${r.value} `)))} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}`;
1404
+ };
1405
+ return new ID({ options: t.options, initialValue: t.initialValue, render() {
1406
+ const r = `${import_picocolors2.default.gray(o)}
1407
+ ${b2(this.state)} ${t.message}
1408
+ `;
1409
+ switch (this.state) {
1410
+ case "submit":
1411
+ return `${r}${import_picocolors2.default.gray(o)} ${n(this.options.find((i) => i.value === this.value) ?? t.options[0], "selected")}`;
1412
+ case "cancel":
1413
+ return `${r}${import_picocolors2.default.gray(o)} ${n(this.options[0], "cancelled")}
1414
+ ${import_picocolors2.default.gray(o)}`;
1415
+ default:
1416
+ return `${r}${import_picocolors2.default.cyan(o)} ${this.options.map((i, s) => n(i, s === this.cursor ? "active" : "inactive")).join(`
1417
+ ${import_picocolors2.default.cyan(o)} `)}
1418
+ ${import_picocolors2.default.cyan(d2)}
1419
+ `;
1420
+ }
1421
+ } }).prompt();
1422
+ }, fe = (t) => {
1423
+ const n = (r, i) => {
1424
+ const s = r.label ?? String(r.value);
1425
+ return i === "active" ? `${import_picocolors2.default.cyan(A2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors2.default.green(T2)} ${import_picocolors2.default.dim(s)} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : i === "active-selected" ? `${import_picocolors2.default.green(T2)} ${s} ${r.hint ? import_picocolors2.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.dim(F)} ${import_picocolors2.default.dim(s)}`;
1426
+ };
1427
+ return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r) {
1428
+ if (this.required && r.length === 0)
1429
+ return `Please select at least one option.
1430
+ ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
1431
+ }, render() {
1432
+ const r = `${import_picocolors2.default.gray(o)}
1433
+ ${b2(this.state)} ${t.message}
1434
+ `, i = (s, c) => {
1435
+ const a = this.value.includes(s.value);
1436
+ return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
1437
+ };
1438
+ switch (this.state) {
1439
+ case "submit":
1440
+ return `${r}${import_picocolors2.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
1441
+ case "cancel": {
1442
+ const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors2.default.dim(", "));
1443
+ return `${r}${import_picocolors2.default.gray(o)} ${s.trim() ? `${s}
1444
+ ${import_picocolors2.default.gray(o)}` : ""}`;
1445
+ }
1446
+ case "error": {
1447
+ const s = this.error.split(`
1448
+ `).map((c, a) => a === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(c)}` : ` ${c}`).join(`
1449
+ `);
1450
+ return `${r + import_picocolors2.default.yellow(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
1451
+ ${import_picocolors2.default.yellow(o)} `)}
1452
+ ${s}
1453
+ `;
1454
+ }
1455
+ default:
1456
+ return `${r}${import_picocolors2.default.cyan(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
1457
+ ${import_picocolors2.default.cyan(o)} `)}
1458
+ ${import_picocolors2.default.cyan(d2)}
1459
+ `;
1460
+ }
1461
+ } }).prompt();
1462
+ }, be = (t) => {
1463
+ const { selectableGroups: n = true } = t, r = (i, s, c = []) => {
1464
+ const a = i.label ?? String(i.value), l2 = typeof i.group == "string", $2 = l2 && (c[c.indexOf(i) + 1] ?? { group: true }), g2 = l2 && $2.group === true, p2 = l2 ? n ? `${g2 ? d2 : o} ` : " " : "";
1465
+ if (s === "active")
1466
+ return `${import_picocolors2.default.dim(p2)}${import_picocolors2.default.cyan(A2)} ${a} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}`;
1467
+ if (s === "group-active")
1468
+ return `${p2}${import_picocolors2.default.cyan(A2)} ${import_picocolors2.default.dim(a)}`;
1469
+ if (s === "group-active-selected")
1470
+ return `${p2}${import_picocolors2.default.green(T2)} ${import_picocolors2.default.dim(a)}`;
1471
+ if (s === "selected") {
1472
+ const f = l2 || n ? import_picocolors2.default.green(T2) : "";
1473
+ return `${import_picocolors2.default.dim(p2)}${f} ${import_picocolors2.default.dim(a)} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}`;
1474
+ }
1475
+ if (s === "cancelled")
1476
+ return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(a))}`;
1477
+ if (s === "active-selected")
1478
+ return `${import_picocolors2.default.dim(p2)}${import_picocolors2.default.green(T2)} ${a} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}`;
1479
+ if (s === "submitted")
1480
+ return `${import_picocolors2.default.dim(a)}`;
1481
+ const v2 = l2 || n ? import_picocolors2.default.dim(F) : "";
1482
+ return `${import_picocolors2.default.dim(p2)}${v2} ${import_picocolors2.default.dim(a)}`;
1483
+ };
1484
+ return new _D({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, selectableGroups: n, validate(i) {
1485
+ if (this.required && i.length === 0)
1486
+ return `Please select at least one option.
1487
+ ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
1488
+ }, render() {
1489
+ const i = `${import_picocolors2.default.gray(o)}
1490
+ ${b2(this.state)} ${t.message}
1491
+ `;
1492
+ switch (this.state) {
1493
+ case "submit":
1494
+ return `${i}${import_picocolors2.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => r(s, "submitted")).join(import_picocolors2.default.dim(", "))}`;
1495
+ case "cancel": {
1496
+ const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r(c, "cancelled")).join(import_picocolors2.default.dim(", "));
1497
+ return `${i}${import_picocolors2.default.gray(o)} ${s.trim() ? `${s}
1498
+ ${import_picocolors2.default.gray(o)}` : ""}`;
1499
+ }
1500
+ case "error": {
1501
+ const s = this.error.split(`
1502
+ `).map((c, a) => a === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(c)}` : ` ${c}`).join(`
1503
+ `);
1504
+ return `${i}${import_picocolors2.default.yellow(o)} ${this.options.map((c, a, l2) => {
1505
+ const $2 = this.value.includes(c.value) || c.group === true && this.isGroupSelected(`${c.value}`), g2 = a === this.cursor;
1506
+ return !g2 && typeof c.group == "string" && this.options[this.cursor].value === c.group ? r(c, $2 ? "group-active-selected" : "group-active", l2) : g2 && $2 ? r(c, "active-selected", l2) : $2 ? r(c, "selected", l2) : r(c, g2 ? "active" : "inactive", l2);
1507
+ }).join(`
1508
+ ${import_picocolors2.default.yellow(o)} `)}
1509
+ ${s}
1510
+ `;
1511
+ }
1512
+ default:
1513
+ return `${i}${import_picocolors2.default.cyan(o)} ${this.options.map((s, c, a) => {
1514
+ const l2 = this.value.includes(s.value) || s.group === true && this.isGroupSelected(`${s.value}`), $2 = c === this.cursor;
1515
+ return !$2 && typeof s.group == "string" && this.options[this.cursor].value === s.group ? r(s, l2 ? "group-active-selected" : "group-active", a) : $2 && l2 ? r(s, "active-selected", a) : l2 ? r(s, "selected", a) : r(s, $2 ? "active" : "inactive", a);
1516
+ }).join(`
1517
+ ${import_picocolors2.default.cyan(o)} `)}
1518
+ ${import_picocolors2.default.cyan(d2)}
1519
+ `;
1520
+ }
1521
+ } }).prompt();
1522
+ }, Me = (t = "", n = "") => {
1523
+ const r = `
1524
+ ${t}
1525
+ `.split(`
1526
+ `), i = S2(n).length, s = Math.max(r.reduce((a, l2) => {
1527
+ const $2 = S2(l2);
1528
+ return $2.length > a ? $2.length : a;
1529
+ }, 0), i) + 2, c = r.map((a) => `${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(a)}${" ".repeat(s - S2(a).length)}${import_picocolors2.default.gray(o)}`).join(`
1530
+ `);
1531
+ process.stdout.write(`${import_picocolors2.default.gray(o)}
1532
+ ${import_picocolors2.default.green(C2)} ${import_picocolors2.default.reset(n)} ${import_picocolors2.default.gray(_2.repeat(Math.max(s - i - 1, 1)) + me)}
1533
+ ${c}
1534
+ ${import_picocolors2.default.gray(de + _2.repeat(s + 2) + pe)}
1535
+ `);
1536
+ }, xe = (t = "") => {
1537
+ process.stdout.write(`${import_picocolors2.default.gray(d2)} ${import_picocolors2.default.red(t)}
1538
+
1539
+ `);
1540
+ }, Ie = (t = "") => {
1541
+ process.stdout.write(`${import_picocolors2.default.gray(ue)} ${t}
1542
+ `);
1543
+ }, Se = (t = "") => {
1544
+ process.stdout.write(`${import_picocolors2.default.gray(o)}
1545
+ ${import_picocolors2.default.gray(d2)} ${t}
1546
+
1547
+ `);
1548
+ }, M2, J2, x2, Y2 = ({ indicator: t = "dots" } = {}) => {
1549
+ const n = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], r = V2 ? 80 : 120, i = process.env.CI === "true";
1550
+ let s, c, a = false, l2 = "", $2, g2 = performance.now();
1551
+ const p2 = (m2) => {
1552
+ const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
1553
+ a && N2(h2, m2);
1554
+ }, v2 = () => p2(2), f = () => p2(1), j2 = () => {
1555
+ process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
1556
+ }, E = () => {
1557
+ process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
1558
+ }, B2 = () => {
1559
+ if ($2 === undefined)
1560
+ return;
1561
+ i && process.stdout.write(`
1562
+ `);
1563
+ const m2 = $2.split(`
1564
+ `);
1565
+ process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
1566
+ }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
1567
+ const h2 = (performance.now() - m2) / 1000, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
1568
+ return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
1569
+ }, H2 = (m2 = "") => {
1570
+ a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
1571
+ `);
1572
+ let h2 = 0, w2 = 0;
1573
+ j2(), c = setInterval(() => {
1574
+ if (i && l2 === $2)
1575
+ return;
1576
+ B2(), $2 = l2;
1577
+ const I2 = import_picocolors2.default.magenta(n[h2]);
1578
+ if (i)
1579
+ process.stdout.write(`${I2} ${l2}...`);
1580
+ else if (t === "timer")
1581
+ process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
1582
+ else {
1583
+ const z22 = ".".repeat(Math.floor(w2)).slice(0, 3);
1584
+ process.stdout.write(`${I2} ${l2}${z22}`);
1585
+ }
1586
+ h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
1587
+ }, r);
1588
+ }, N2 = (m2 = "", h2 = 0) => {
1589
+ a = false, clearInterval(c), B2();
1590
+ const w2 = h2 === 0 ? import_picocolors2.default.green(C2) : h2 === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
1591
+ l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
1592
+ `) : process.stdout.write(`${w2} ${l2}
1593
+ `), E(), s();
1594
+ };
1595
+ return { start: H2, stop: N2, message: (m2 = "") => {
1596
+ l2 = R2(m2 ?? l2);
1597
+ } };
1598
+ }, Ce = async (t, n) => {
1599
+ const r = {}, i = Object.keys(t);
1600
+ for (const s of i) {
1601
+ const c = t[s], a = await c({ results: r })?.catch((l2) => {
1602
+ throw l2;
1603
+ });
1604
+ if (typeof n?.onCancel == "function" && pD(a)) {
1605
+ r[s] = "canceled", n.onCancel({ results: r });
1606
+ continue;
1607
+ }
1608
+ r[s] = a;
1609
+ }
1610
+ return r;
1611
+ }, Te = async (t) => {
1612
+ for (const n of t) {
1613
+ if (n.enabled === false)
1614
+ continue;
1615
+ const r = Y2();
1616
+ r.start(n.title);
1617
+ const i = await n.task(r.message);
1618
+ r.stop(i || n.title);
1619
+ }
1620
+ }, CANCEL, PromptCancelledError, intro, outro, note, log, text, group, groupMultiselect, clack, SPINNER_FRAMES, CLEAR_LINE = "\x1B[2K", CURSOR_START = "\x1B[G", utils, prompt2;
959
1621
  var init_dist = __esm(() => {
1622
+ __create2 = Object.create;
1623
+ __getProtoOf2 = Object.getPrototypeOf;
1624
+ __defProp2 = Object.defineProperty;
1625
+ __getOwnPropNames2 = Object.getOwnPropertyNames;
1626
+ __hasOwnProp2 = Object.prototype.hasOwnProperty;
1627
+ require_src2 = __commonJS2((exports, module) => {
1628
+ var ESC = "\x1B";
1629
+ var CSI = `${ESC}[`;
1630
+ var beep = "\x07";
1631
+ var cursor = {
1632
+ to(x, y) {
1633
+ if (!y)
1634
+ return `${CSI}${x + 1}G`;
1635
+ return `${CSI}${y + 1};${x + 1}H`;
1636
+ },
1637
+ move(x, y) {
1638
+ let ret = "";
1639
+ if (x < 0)
1640
+ ret += `${CSI}${-x}D`;
1641
+ else if (x > 0)
1642
+ ret += `${CSI}${x}C`;
1643
+ if (y < 0)
1644
+ ret += `${CSI}${-y}A`;
1645
+ else if (y > 0)
1646
+ ret += `${CSI}${y}B`;
1647
+ return ret;
1648
+ },
1649
+ up: (count = 1) => `${CSI}${count}A`,
1650
+ down: (count = 1) => `${CSI}${count}B`,
1651
+ forward: (count = 1) => `${CSI}${count}C`,
1652
+ backward: (count = 1) => `${CSI}${count}D`,
1653
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
1654
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
1655
+ left: `${CSI}G`,
1656
+ hide: `${CSI}?25l`,
1657
+ show: `${CSI}?25h`,
1658
+ save: `${ESC}7`,
1659
+ restore: `${ESC}8`
1660
+ };
1661
+ var scroll = {
1662
+ up: (count = 1) => `${CSI}S`.repeat(count),
1663
+ down: (count = 1) => `${CSI}T`.repeat(count)
1664
+ };
1665
+ var erase = {
1666
+ screen: `${CSI}2J`,
1667
+ up: (count = 1) => `${CSI}1J`.repeat(count),
1668
+ down: (count = 1) => `${CSI}J`.repeat(count),
1669
+ line: `${CSI}2K`,
1670
+ lineEnd: `${CSI}K`,
1671
+ lineStart: `${CSI}1K`,
1672
+ lines(count) {
1673
+ let clear = "";
1674
+ for (let i = 0;i < count; i++)
1675
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
1676
+ if (count)
1677
+ clear += cursor.left;
1678
+ return clear;
1679
+ }
1680
+ };
1681
+ module.exports = { cursor, scroll, erase, beep };
1682
+ });
1683
+ require_picocolors = __commonJS2((exports, module) => {
1684
+ var p = process || {};
1685
+ var argv = p.argv || [];
1686
+ var env = p.env || {};
1687
+ var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
1688
+ var formatter = (open, close, replace = open) => (input) => {
1689
+ let string4 = "" + input, index = string4.indexOf(close, open.length);
1690
+ return ~index ? open + replaceClose(string4, close, replace, index) + close : open + string4 + close;
1691
+ };
1692
+ var replaceClose = (string4, close, replace, index) => {
1693
+ let result = "", cursor = 0;
1694
+ do {
1695
+ result += string4.substring(cursor, index) + replace;
1696
+ cursor = index + close.length;
1697
+ index = string4.indexOf(close, cursor);
1698
+ } while (~index);
1699
+ return result + string4.substring(cursor);
1700
+ };
1701
+ var createColors = (enabled = isColorSupported) => {
1702
+ let f = enabled ? formatter : () => String;
1703
+ return {
1704
+ isColorSupported: enabled,
1705
+ reset: f("\x1B[0m", "\x1B[0m"),
1706
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
1707
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
1708
+ italic: f("\x1B[3m", "\x1B[23m"),
1709
+ underline: f("\x1B[4m", "\x1B[24m"),
1710
+ inverse: f("\x1B[7m", "\x1B[27m"),
1711
+ hidden: f("\x1B[8m", "\x1B[28m"),
1712
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
1713
+ black: f("\x1B[30m", "\x1B[39m"),
1714
+ red: f("\x1B[31m", "\x1B[39m"),
1715
+ green: f("\x1B[32m", "\x1B[39m"),
1716
+ yellow: f("\x1B[33m", "\x1B[39m"),
1717
+ blue: f("\x1B[34m", "\x1B[39m"),
1718
+ magenta: f("\x1B[35m", "\x1B[39m"),
1719
+ cyan: f("\x1B[36m", "\x1B[39m"),
1720
+ white: f("\x1B[37m", "\x1B[39m"),
1721
+ gray: f("\x1B[90m", "\x1B[39m"),
1722
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
1723
+ bgRed: f("\x1B[41m", "\x1B[49m"),
1724
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
1725
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
1726
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
1727
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
1728
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
1729
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
1730
+ blackBright: f("\x1B[90m", "\x1B[39m"),
1731
+ redBright: f("\x1B[91m", "\x1B[39m"),
1732
+ greenBright: f("\x1B[92m", "\x1B[39m"),
1733
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
1734
+ blueBright: f("\x1B[94m", "\x1B[39m"),
1735
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
1736
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
1737
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
1738
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
1739
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
1740
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
1741
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
1742
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
1743
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
1744
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
1745
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
1746
+ };
1747
+ };
1748
+ module.exports = createColors();
1749
+ module.exports.createColors = createColors;
1750
+ });
960
1751
  colorCodes = {
961
1752
  black: 30,
962
1753
  red: 31,
@@ -1020,12 +1811,6 @@ var init_dist = __esm(() => {
1020
1811
  reset: createColorFunction(colorCodes.reset),
1021
1812
  strip: stripAnsi
1022
1813
  };
1023
- CSI = `${ESC}[`;
1024
- CLEAR_LINE = `${CSI}2K`;
1025
- CURSOR_START = `${CSI}G`;
1026
- CURSOR_HIDE = `${CSI}?25l`;
1027
- CURSOR_SHOW = `${CSI}?25h`;
1028
- SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
1029
1814
  SchemaError2 = class extends Error {
1030
1815
  issues;
1031
1816
  constructor(issues) {
@@ -1034,23 +1819,343 @@ var init_dist = __esm(() => {
1034
1819
  this.issues = issues;
1035
1820
  }
1036
1821
  };
1822
+ exports_dist2 = {};
1823
+ __export2(exports_dist2, {
1824
+ updateSettings: () => cD,
1825
+ text: () => he,
1826
+ tasks: () => Te,
1827
+ stream: () => x2,
1828
+ spinner: () => Y2,
1829
+ selectKey: () => we,
1830
+ select: () => ve,
1831
+ password: () => ge,
1832
+ outro: () => Se,
1833
+ note: () => Me,
1834
+ multiselect: () => fe,
1835
+ log: () => M2,
1836
+ isCancel: () => pD,
1837
+ intro: () => Ie,
1838
+ groupMultiselect: () => be,
1839
+ group: () => Ce,
1840
+ confirm: () => ye,
1841
+ cancel: () => xe
1842
+ });
1843
+ import_sisteransi = __toESM2(require_src2(), 1);
1844
+ import_picocolors = __toESM2(require_picocolors(), 1);
1845
+ uD = DD();
1846
+ W = { exports: {} };
1847
+ (function(e) {
1848
+ var u = {};
1849
+ e.exports = u, u.eastAsianWidth = function(F) {
1850
+ var s = F.charCodeAt(0), i = F.length == 2 ? F.charCodeAt(1) : 0, D = s;
1851
+ return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D = s << 10 | i, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
1852
+ }, u.characterLength = function(F) {
1853
+ var s = this.eastAsianWidth(F);
1854
+ return s == "F" || s == "W" || s == "A" ? 2 : 1;
1855
+ };
1856
+ function t(F) {
1857
+ return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1858
+ }
1859
+ u.length = function(F) {
1860
+ for (var s = t(F), i = 0, D = 0;D < s.length; D++)
1861
+ i = i + this.characterLength(s[D]);
1862
+ return i;
1863
+ }, u.slice = function(F, s, i) {
1864
+ textLen = u.length(F), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
1865
+ for (var D = "", r = 0, n = t(F), E = 0;E < n.length; E++) {
1866
+ var a = n[E], o = u.length(a);
1867
+ if (r >= s - (o == 2 ? 1 : 0))
1868
+ if (r + o <= i)
1869
+ D += a;
1870
+ else
1871
+ break;
1872
+ r += o;
1873
+ }
1874
+ return D;
1875
+ };
1876
+ })(W);
1877
+ tD = W.exports;
1878
+ eD = L(tD);
1879
+ sD = L(FD);
1880
+ C = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
1881
+ Object.keys(C.modifier);
1882
+ iD = Object.keys(C.color);
1883
+ rD = Object.keys(C.bgColor);
1884
+ [...iD, ...rD];
1885
+ ED = CD();
1886
+ d = new Set(["\x1B", "\x9B"]);
1887
+ _ = `${nD}8;;`;
1888
+ xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
1889
+ B = { actions: new Set(xD), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]) };
1890
+ AD = globalThis.process.platform.startsWith("win");
1891
+ S = Symbol("clack:cancel");
1892
+ gD = Object.defineProperty;
1893
+ dD = class dD extends x {
1894
+ get cursor() {
1895
+ return this.value ? 0 : 1;
1896
+ }
1897
+ get _value() {
1898
+ return this.cursor === 0;
1899
+ }
1900
+ constructor(u) {
1901
+ super(u, false), this.value = !!u.initialValue, this.on("value", () => {
1902
+ this.value = this._value;
1903
+ }), this.on("confirm", (t) => {
1904
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
1905
+ }), this.on("cursor", () => {
1906
+ this.value = !this.value;
1907
+ });
1908
+ }
1909
+ };
1910
+ mD = Object.defineProperty;
1911
+ _D = class extends x {
1912
+ constructor(u) {
1913
+ super(u, false), Z(this, "options"), Z(this, "cursor", 0), wD(this, A, undefined);
1914
+ const { options: t } = u;
1915
+ yD(this, A, u.selectableGroups !== false), this.options = Object.entries(t).flatMap(([F, s]) => [{ value: F, group: true, label: F }, ...s.map((i) => ({ ...i, group: F }))]), this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), T(this, A) ? 0 : 1), this.on("cursor", (F) => {
1916
+ switch (F) {
1917
+ case "left":
1918
+ case "up": {
1919
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1920
+ const s = this.options[this.cursor]?.group === true;
1921
+ !T(this, A) && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1922
+ break;
1923
+ }
1924
+ case "down":
1925
+ case "right": {
1926
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1927
+ const s = this.options[this.cursor]?.group === true;
1928
+ !T(this, A) && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1929
+ break;
1930
+ }
1931
+ case "space":
1932
+ this.toggleValue();
1933
+ break;
1934
+ }
1935
+ });
1936
+ }
1937
+ getGroupItems(u) {
1938
+ return this.options.filter((t) => t.group === u);
1939
+ }
1940
+ isGroupSelected(u) {
1941
+ return this.getGroupItems(u).every((t) => this.value.includes(t.value));
1942
+ }
1943
+ toggleValue() {
1944
+ const u = this.options[this.cursor];
1945
+ if (u.group === true) {
1946
+ const t = u.value, F = this.getGroupItems(t);
1947
+ this.isGroupSelected(t) ? this.value = this.value.filter((s) => F.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...F.map((s) => s.value)], this.value = Array.from(new Set(this.value));
1948
+ } else {
1949
+ const t = this.value.includes(u.value);
1950
+ this.value = t ? this.value.filter((F) => F !== u.value) : [...this.value, u.value];
1951
+ }
1952
+ }
1953
+ };
1954
+ A = new WeakMap;
1955
+ kD = Object.defineProperty;
1956
+ SD = class extends x {
1957
+ constructor(u) {
1958
+ super(u, false), H(this, "options"), H(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t }) => t === u.cursorAt), 0), this.on("key", (t) => {
1959
+ t === "a" && this.toggleAll();
1960
+ }), this.on("cursor", (t) => {
1961
+ switch (t) {
1962
+ case "left":
1963
+ case "up":
1964
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1965
+ break;
1966
+ case "down":
1967
+ case "right":
1968
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1969
+ break;
1970
+ case "space":
1971
+ this.toggleValue();
1972
+ break;
1973
+ }
1974
+ });
1975
+ }
1976
+ get _value() {
1977
+ return this.options[this.cursor].value;
1978
+ }
1979
+ toggleAll() {
1980
+ const u = this.value.length === this.options.length;
1981
+ this.value = u ? [] : this.options.map((t) => t.value);
1982
+ }
1983
+ toggleValue() {
1984
+ const u = this.value.includes(this._value);
1985
+ this.value = u ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
1986
+ }
1987
+ };
1988
+ TD = Object.defineProperty;
1989
+ MD = class MD extends x {
1990
+ constructor({ mask: u, ...t }) {
1991
+ super(t), U(this, "valueWithCursor", ""), U(this, "_mask", "\u2022"), this._mask = u ?? "\u2022", this.on("finalize", () => {
1992
+ this.valueWithCursor = this.masked;
1993
+ }), this.on("value", () => {
1994
+ if (this.cursor >= this.value.length)
1995
+ this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
1996
+ else {
1997
+ const F = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
1998
+ this.valueWithCursor = `${F}${import_picocolors.default.inverse(s[0])}${s.slice(1)}`;
1999
+ }
2000
+ });
2001
+ }
2002
+ get cursor() {
2003
+ return this._cursor;
2004
+ }
2005
+ get masked() {
2006
+ return this.value.replaceAll(/./g, this._mask);
2007
+ }
2008
+ };
2009
+ OD = Object.defineProperty;
2010
+ LD = class LD extends x {
2011
+ constructor(u) {
2012
+ super(u, false), J(this, "options"), J(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: t }) => t === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
2013
+ switch (t) {
2014
+ case "left":
2015
+ case "up":
2016
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
2017
+ break;
2018
+ case "down":
2019
+ case "right":
2020
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
2021
+ break;
2022
+ }
2023
+ this.changeValue();
2024
+ });
2025
+ }
2026
+ get _value() {
2027
+ return this.options[this.cursor];
2028
+ }
2029
+ changeValue() {
2030
+ this.value = this._value.value;
2031
+ }
2032
+ };
2033
+ WD = Object.defineProperty;
2034
+ ID = class ID extends x {
2035
+ constructor(u) {
2036
+ super(u, false), Q(this, "options"), Q(this, "cursor", 0), this.options = u.options;
2037
+ const t = this.options.map(({ value: [F] }) => F?.toLowerCase());
2038
+ this.cursor = Math.max(t.indexOf(u.initialValue), 0), this.on("key", (F) => {
2039
+ if (!t.includes(F))
2040
+ return;
2041
+ const s = this.options.find(({ value: [i] }) => i?.toLowerCase() === F);
2042
+ s && (this.value = s.value, this.state = "submit", this.emit("submit"));
2043
+ });
2044
+ }
2045
+ };
2046
+ RD = class RD extends x {
2047
+ get valueWithCursor() {
2048
+ if (this.state === "submit")
2049
+ return this.value;
2050
+ if (this.cursor >= this.value.length)
2051
+ return `${this.value}\u2588`;
2052
+ const u = this.value.slice(0, this.cursor), [t, ...F] = this.value.slice(this.cursor);
2053
+ return `${u}${import_picocolors.default.inverse(t)}${F.join("")}`;
2054
+ }
2055
+ get cursor() {
2056
+ return this._cursor;
2057
+ }
2058
+ constructor(u) {
2059
+ super(u), this.on("finalize", () => {
2060
+ this.value || (this.value = u.defaultValue);
2061
+ });
2062
+ }
2063
+ };
2064
+ import_picocolors2 = __toESM2(require_picocolors(), 1);
2065
+ import_sisteransi2 = __toESM2(require_src2(), 1);
2066
+ V2 = ce();
2067
+ le = u("\u25C6", "*");
2068
+ L2 = u("\u25A0", "x");
2069
+ W2 = u("\u25B2", "x");
2070
+ C2 = u("\u25C7", "o");
2071
+ ue = u("\u250C", "T");
2072
+ o = u("\u2502", "|");
2073
+ d2 = u("\u2514", "\u2014");
2074
+ k2 = u("\u25CF", ">");
2075
+ P2 = u("\u25CB", " ");
2076
+ A2 = u("\u25FB", "[\u2022]");
2077
+ T2 = u("\u25FC", "[+]");
2078
+ F = u("\u25FB", "[ ]");
2079
+ $e = u("\u25AA", "\u2022");
2080
+ _2 = u("\u2500", "-");
2081
+ me = u("\u256E", "+");
2082
+ de = u("\u251C", "+");
2083
+ pe = u("\u256F", "+");
2084
+ q2 = u("\u25CF", "\u2022");
2085
+ D = u("\u25C6", "*");
2086
+ U2 = u("\u25B2", "!");
2087
+ K2 = u("\u25A0", "x");
2088
+ M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
2089
+ const r = [`${import_picocolors2.default.gray(o)}`];
2090
+ if (t) {
2091
+ const [i, ...s] = t.split(`
2092
+ `);
2093
+ r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors2.default.gray(o)} ${c}`));
2094
+ }
2095
+ process.stdout.write(`${r.join(`
2096
+ `)}
2097
+ `);
2098
+ }, info: (t) => {
2099
+ M2.message(t, { symbol: import_picocolors2.default.blue(q2) });
2100
+ }, success: (t) => {
2101
+ M2.message(t, { symbol: import_picocolors2.default.green(D) });
2102
+ }, step: (t) => {
2103
+ M2.message(t, { symbol: import_picocolors2.default.green(C2) });
2104
+ }, warn: (t) => {
2105
+ M2.message(t, { symbol: import_picocolors2.default.yellow(U2) });
2106
+ }, warning: (t) => {
2107
+ M2.warn(t);
2108
+ }, error: (t) => {
2109
+ M2.message(t, { symbol: import_picocolors2.default.red(K2) });
2110
+ } };
2111
+ J2 = `${import_picocolors2.default.gray(o)} `;
2112
+ x2 = { message: async (t, { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
2113
+ process.stdout.write(`${import_picocolors2.default.gray(o)}
2114
+ ${n} `);
2115
+ let r = 3;
2116
+ for await (let i of t) {
2117
+ i = i.replace(/\n/g, `
2118
+ ${J2}`), i.includes(`
2119
+ `) && (r = 3 + S2(i.slice(i.lastIndexOf(`
2120
+ `))).length);
2121
+ const s = S2(i).length;
2122
+ r + s < process.stdout.columns ? (r += s, process.stdout.write(i)) : (process.stdout.write(`
2123
+ ${J2}${i.trimStart()}`), r = 3 + S2(i.trimStart()).length);
2124
+ }
2125
+ process.stdout.write(`
2126
+ `);
2127
+ }, info: (t) => x2.message(t, { symbol: import_picocolors2.default.blue(q2) }), success: (t) => x2.message(t, { symbol: import_picocolors2.default.green(D) }), step: (t) => x2.message(t, { symbol: import_picocolors2.default.green(C2) }), warn: (t) => x2.message(t, { symbol: import_picocolors2.default.yellow(U2) }), warning: (t) => x2.warn(t), error: (t) => x2.message(t, { symbol: import_picocolors2.default.red(K2) }) };
2128
+ CANCEL = Symbol.for("bunli:prompt_cancel");
2129
+ PromptCancelledError = class PromptCancelledError extends Error {
2130
+ constructor(message = "Cancelled") {
2131
+ super(message);
2132
+ this.name = "PromptCancelledError";
2133
+ }
2134
+ };
2135
+ intro = Ie;
2136
+ outro = Se;
2137
+ note = Me;
2138
+ log = M2;
2139
+ text = he;
2140
+ group = Ce;
2141
+ groupMultiselect = be;
2142
+ clack = {
2143
+ ...exports_dist2,
2144
+ CANCEL,
2145
+ isCancel,
2146
+ PromptCancelledError,
2147
+ assertNotCancelled,
2148
+ promptOrExit
2149
+ };
2150
+ SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
1037
2151
  utils = {
1038
2152
  prompt: Object.assign(prompt, {
1039
2153
  confirm,
1040
2154
  select,
2155
+ multiselect,
1041
2156
  password,
1042
2157
  text: (message, options) => prompt(message, options),
1043
- multiselect: async (message, options) => {
1044
- const { options: choices } = options;
1045
- const selected = [];
1046
- console.log(message);
1047
- for (const choice of choices) {
1048
- const ok = await confirm(`Select ${choice.label}?`, { default: false });
1049
- if (ok)
1050
- selected.push(choice.value);
1051
- }
1052
- return selected;
1053
- }
2158
+ clack
1054
2159
  }),
1055
2160
  spinner: createSpinner,
1056
2161
  colors
@@ -1058,19 +2163,10 @@ var init_dist = __esm(() => {
1058
2163
  prompt2 = Object.assign(prompt, {
1059
2164
  confirm,
1060
2165
  select,
2166
+ multiselect,
1061
2167
  password,
1062
2168
  text: (message, options) => prompt(message, options),
1063
- multiselect: async (message, options) => {
1064
- const { options: choices } = options;
1065
- const selected = [];
1066
- console.log(message);
1067
- for (const choice of choices) {
1068
- const ok = await confirm(`Select ${choice.label}?`, { default: false });
1069
- if (ok)
1070
- selected.push(choice.value);
1071
- }
1072
- return selected;
1073
- }
2169
+ clack
1074
2170
  });
1075
2171
  });
1076
2172
 
@@ -14658,7 +15754,11 @@ var bunliConfigSchema = exports_external.object({
14658
15754
  npm: exports_external.boolean().default(true),
14659
15755
  github: exports_external.boolean().default(false),
14660
15756
  tagFormat: exports_external.string().default("v{{version}}"),
14661
- conventionalCommits: exports_external.boolean().default(true)
15757
+ conventionalCommits: exports_external.boolean().default(true),
15758
+ binary: exports_external.object({
15759
+ packageNameFormat: exports_external.string().default("{{name}}-{{platform}}"),
15760
+ shimPath: exports_external.string().default("bin/run.mjs")
15761
+ }).optional()
14662
15762
  }).default({
14663
15763
  npm: true,
14664
15764
  github: false,
@@ -14668,7 +15768,14 @@ var bunliConfigSchema = exports_external.object({
14668
15768
  plugins: exports_external.array(exports_external.any()).default([]),
14669
15769
  help: exports_external.object({
14670
15770
  renderer: exports_external.any().optional()
14671
- }).optional()
15771
+ }).optional(),
15772
+ tui: exports_external.object({
15773
+ renderer: exports_external.object({
15774
+ bufferMode: exports_external.enum(["alternate", "standard"]).optional()
15775
+ }).catchall(exports_external.unknown()).default({})
15776
+ }).default({
15777
+ renderer: {}
15778
+ })
14672
15779
  });
14673
15780
  var bunliConfigStrictSchema = bunliConfigSchema.extend({
14674
15781
  name: exports_external.string().min(1, "Name is required"),
@@ -14837,7 +15944,7 @@ function extractSchemaType(schema) {
14837
15944
  function generateHint(schema, value2) {
14838
15945
  const type = extractSchemaType(schema);
14839
15946
  if (type === "boolean" && typeof value2 === "string") {
14840
- return "Use --flag or --no-flag for boolean options";
15947
+ return "Use --flag, --flag=true, or --flag=false for boolean options";
14841
15948
  }
14842
15949
  if (type === "number" && typeof value2 === "string") {
14843
15950
  return "Provide a numeric value";
@@ -14880,6 +15987,9 @@ var SchemaError = class extends Error {
14880
15987
  }
14881
15988
  };
14882
15989
 
15990
+ // ../core/src/cli.ts
15991
+ init_dist();
15992
+
14883
15993
  // ../core/src/plugin/manager.ts
14884
15994
  import { homedir } from "os";
14885
15995
  import { join as join2 } from "path";
@@ -15129,7 +16239,7 @@ class PluginManager {
15129
16239
  return this.plugins;
15130
16240
  }
15131
16241
  getPlugin(name2) {
15132
- return this.plugins.find((p) => p.name === name2);
16242
+ return this.plugins.find((p2) => p2.name === name2);
15133
16243
  }
15134
16244
  }
15135
16245
 
@@ -15292,6 +16402,14 @@ function createGeneratedHelpers(modules, metadata) {
15292
16402
 
15293
16403
  // ../core/src/cli.ts
15294
16404
  var logger3 = createLogger("core:cli");
16405
+ function resolveRendererOptions(configured, terminal) {
16406
+ const bufferModeDefault = terminal.isInteractive && !terminal.isCI ? "alternate" : "standard";
16407
+ const configuredBufferMode = configured?.bufferMode === "alternate" || configured?.bufferMode === "standard" ? configured.bufferMode : undefined;
16408
+ return {
16409
+ ...configured ?? {},
16410
+ bufferMode: configuredBufferMode ?? bufferModeDefault
16411
+ };
16412
+ }
15295
16413
  async function createCLI(configOverride) {
15296
16414
  let loadedConfigData = null;
15297
16415
  try {
@@ -15372,7 +16490,8 @@ async function createCLI(configOverride) {
15372
16490
  conventionalCommits: true
15373
16491
  },
15374
16492
  plugins: fullConfig.plugins || [],
15375
- help: fullConfig.help
16493
+ help: fullConfig.help,
16494
+ tui: fullConfig.tui
15376
16495
  };
15377
16496
  if (mergedConfig.plugins && mergedConfig.plugins.length > 0) {
15378
16497
  await pluginManager.runConfigResolved(resolvedConfig);
@@ -15403,9 +16522,9 @@ async function createCLI(configOverride) {
15403
16522
  }
15404
16523
  return { command: undefined, remainingArgs: args };
15405
16524
  }
15406
- function wrapText(text, width) {
16525
+ function wrapText(text2, width) {
15407
16526
  const safeWidth = Math.max(10, width);
15408
- const words = text.trim().split(/\s+/).filter(Boolean);
16527
+ const words = text2.trim().split(/\s+/).filter(Boolean);
15409
16528
  if (words.length === 0)
15410
16529
  return [""];
15411
16530
  const first = words[0];
@@ -15592,12 +16711,12 @@ Subcommands:`);
15592
16711
  registerCommand(cmd);
15593
16712
  }
15594
16713
  }
15595
- async function runCommandInternal(command, argv, providedFlags) {
16714
+ async function runCommandInternal(command, argv, providedFlags, invokedCommandName) {
15596
16715
  let context;
15597
16716
  try {
15598
16717
  const mergedOptions = { ...GLOBAL_FLAGS, ...command.options || {} };
15599
16718
  const parsed2 = providedFlags ? (() => {
15600
- return parseArgs([], mergedOptions, command.name).then((p) => (Object.assign(p.flags, providedFlags), p));
16719
+ return parseArgs([], mergedOptions, command.name).then((p2) => (Object.assign(p2.flags, providedFlags), p2));
15601
16720
  })() : parseArgs(argv, mergedOptions, command.name);
15602
16721
  const resultParsed = await parsed2;
15603
16722
  const { prompt: prompt3, spinner, colors: colors2 } = await Promise.resolve().then(() => (init_dist(), exports_dist));
@@ -15609,7 +16728,7 @@ Subcommands:`);
15609
16728
  const runtimeInfo = {
15610
16729
  startTime: Date.now(),
15611
16730
  args: providedFlags ? [] : argv,
15612
- command: command.name
16731
+ command: invokedCommandName ?? command.name
15613
16732
  };
15614
16733
  let render = false;
15615
16734
  if (command.render) {
@@ -15635,6 +16754,7 @@ Subcommands:`);
15635
16754
  colors: colors2,
15636
16755
  terminal: terminalInfo,
15637
16756
  runtime: runtimeInfo,
16757
+ rendererOptions: resolveRendererOptions(resolvedConfig.tui?.renderer ?? {}, terminalInfo),
15638
16758
  ...context ? { context } : {}
15639
16759
  });
15640
16760
  } else {
@@ -15658,6 +16778,12 @@ Subcommands:`);
15658
16778
  await pluginManager.runAfterCommand(context, { exitCode: 0 });
15659
16779
  }
15660
16780
  } catch (error48) {
16781
+ if (error48 instanceof PromptCancelledError) {
16782
+ if (mergedConfig.plugins && mergedConfig.plugins.length > 0 && context) {
16783
+ await pluginManager.runAfterCommand(context, { exitCode: 0 });
16784
+ }
16785
+ return;
16786
+ }
15661
16787
  if (mergedConfig.plugins && mergedConfig.plugins.length > 0 && context) {
15662
16788
  await pluginManager.runAfterCommand(context, { exitCode: 1 });
15663
16789
  }
@@ -15740,7 +16866,8 @@ Subcommands:`);
15740
16866
  }
15741
16867
  if (command.handler || command.render) {
15742
16868
  const allArgs = [...remainingArgs, ...passthroughArgs];
15743
- await runCommandInternal(command, allArgs);
16869
+ const invokedCommandName = commandArgs.slice(0, commandArgs.length - remainingArgs.length).join(" ");
16870
+ await runCommandInternal(command, allArgs, undefined, invokedCommandName || command.name);
15744
16871
  }
15745
16872
  },
15746
16873
  async execute(commandName, argsOrOptions, options) {
@@ -15774,23 +16901,33 @@ Subcommands:`);
15774
16901
  const runtimeInfo = {
15775
16902
  startTime: Date.now(),
15776
16903
  args: [],
15777
- command: command.name
16904
+ command: commandName.replace(/\//g, " ").trim() || command.name
15778
16905
  };
15779
16906
  const terminalInfo = getTerminalInfo();
15780
16907
  if (command.handler) {
15781
- await command.handler({
15782
- flags: parsed2.flags,
15783
- positional: [],
15784
- shell: Bun.$,
15785
- env: process.env,
15786
- cwd: process.cwd(),
15787
- prompt: prompt3,
15788
- spinner,
15789
- colors: colors2,
15790
- terminal: terminalInfo,
15791
- runtime: runtimeInfo,
15792
- ...context ? { context } : {}
15793
- });
16908
+ try {
16909
+ await command.handler({
16910
+ flags: parsed2.flags,
16911
+ positional: [],
16912
+ shell: Bun.$,
16913
+ env: process.env,
16914
+ cwd: process.cwd(),
16915
+ prompt: prompt3,
16916
+ spinner,
16917
+ colors: colors2,
16918
+ terminal: terminalInfo,
16919
+ runtime: runtimeInfo,
16920
+ ...context ? { context } : {}
16921
+ });
16922
+ } catch (error48) {
16923
+ if (error48 instanceof PromptCancelledError) {
16924
+ if (mergedConfig.plugins && mergedConfig.plugins.length > 0 && context) {
16925
+ await pluginManager.runAfterCommand(context, { exitCode: 0 });
16926
+ }
16927
+ return;
16928
+ }
16929
+ throw error48;
16930
+ }
15794
16931
  }
15795
16932
  if (mergedConfig.plugins && mergedConfig.plugins.length > 0 && context) {
15796
16933
  await pluginManager.runAfterCommand(context, { exitCode: 0 });
@@ -15801,7 +16938,7 @@ Subcommands:`);
15801
16938
  const foundCommand = command;
15802
16939
  const finalArgsToUse = [...remainingArgs, ...args];
15803
16940
  if (foundCommand.handler || foundCommand.render) {
15804
- await runCommandInternal(foundCommand, finalArgsToUse);
16941
+ await runCommandInternal(foundCommand, finalArgsToUse, undefined, commandName.replace(/\//g, " ").trim());
15805
16942
  }
15806
16943
  }
15807
16944
  };
@@ -15966,32 +17103,32 @@ async function testCommand(command, options = {}) {
15966
17103
  });
15967
17104
  }
15968
17105
  });
15969
- const mockSpinner = (text) => {
15970
- if (text)
15971
- stdout.push(`\u280B ${text}`);
17106
+ const mockSpinner = (text2) => {
17107
+ if (text2)
17108
+ stdout.push(`\u280B ${text2}`);
15972
17109
  return {
15973
- start: (text2) => {
15974
- if (text2)
15975
- stdout.push(`\u280B ${text2}`);
17110
+ start: (text3) => {
17111
+ if (text3)
17112
+ stdout.push(`\u280B ${text3}`);
15976
17113
  },
15977
- stop: (text2) => {
15978
- if (text2)
15979
- stdout.push(text2);
17114
+ stop: (text3) => {
17115
+ if (text3)
17116
+ stdout.push(text3);
15980
17117
  },
15981
- succeed: (text2) => {
15982
- stdout.push(`\u2705 ${text2 || "Done"}`);
17118
+ succeed: (text3) => {
17119
+ stdout.push(`\u2705 ${text3 || "Done"}`);
15983
17120
  },
15984
- fail: (text2) => {
15985
- stdout.push(`\u274C ${text2 || "Failed"}`);
17121
+ fail: (text3) => {
17122
+ stdout.push(`\u274C ${text3 || "Failed"}`);
15986
17123
  },
15987
- warn: (text2) => {
15988
- stdout.push(`\u26A0\uFE0F ${text2 || "Warning"}`);
17124
+ warn: (text3) => {
17125
+ stdout.push(`\u26A0\uFE0F ${text3 || "Warning"}`);
15989
17126
  },
15990
- info: (text2) => {
15991
- stdout.push(`\u2139\uFE0F ${text2 || "Info"}`);
17127
+ info: (text3) => {
17128
+ stdout.push(`\u2139\uFE0F ${text3 || "Info"}`);
15992
17129
  },
15993
- update: (text2) => {
15994
- stdout.push(`\u280B ${text2}`);
17130
+ update: (text3) => {
17131
+ stdout.push(`\u280B ${text3}`);
15995
17132
  }
15996
17133
  };
15997
17134
  };
@@ -16030,38 +17167,38 @@ async function testCommand(command, options = {}) {
16030
17167
  return promise2;
16031
17168
  };
16032
17169
  const mockColors = {
16033
- red: (text) => `[red]${text}[/red]`,
16034
- green: (text) => `[green]${text}[/green]`,
16035
- blue: (text) => `[blue]${text}[/blue]`,
16036
- yellow: (text) => `[yellow]${text}[/yellow]`,
16037
- cyan: (text) => `[cyan]${text}[/cyan]`,
16038
- magenta: (text) => `[magenta]${text}[/magenta]`,
16039
- gray: (text) => `[gray]${text}[/gray]`,
16040
- dim: (text) => `[dim]${text}[/dim]`,
16041
- bold: (text) => `[bold]${text}[/bold]`,
16042
- italic: (text) => `[italic]${text}[/italic]`,
16043
- underline: (text) => `[underline]${text}[/underline]`,
16044
- strikethrough: (text) => `[strikethrough]${text}[/strikethrough]`,
16045
- bgRed: (text) => `[bgRed]${text}[/bgRed]`,
16046
- bgGreen: (text) => `[bgGreen]${text}[/bgGreen]`,
16047
- bgBlue: (text) => `[bgBlue]${text}[/bgBlue]`,
16048
- bgYellow: (text) => `[bgYellow]${text}[/bgYellow]`,
16049
- bgCyan: (text) => `[bgCyan]${text}[/bgCyan]`,
16050
- bgMagenta: (text) => `[bgMagenta]${text}[/bgMagenta]`,
16051
- bgGray: (text) => `[bgGray]${text}[/bgGray]`,
16052
- black: (text) => `[black]${text}[/black]`,
16053
- white: (text) => `[white]${text}[/white]`,
16054
- bgBlack: (text) => `[bgBlack]${text}[/bgBlack]`,
16055
- bgWhite: (text) => `[bgWhite]${text}[/bgWhite]`,
16056
- brightRed: (text) => `[brightRed]${text}[/brightRed]`,
16057
- brightGreen: (text) => `[brightGreen]${text}[/brightGreen]`,
16058
- brightYellow: (text) => `[brightYellow]${text}[/brightYellow]`,
16059
- brightBlue: (text) => `[brightBlue]${text}[/brightBlue]`,
16060
- brightCyan: (text) => `[brightCyan]${text}[/brightCyan]`,
16061
- brightMagenta: (text) => `[brightMagenta]${text}[/brightMagenta]`,
16062
- brightWhite: (text) => `[brightWhite]${text}[/brightWhite]`,
16063
- reset: (text) => `[reset]${text}[/reset]`,
16064
- strip: (text) => text.replace(/\[[^\]]+\]/g, "")
17170
+ red: (text2) => `[red]${text2}[/red]`,
17171
+ green: (text2) => `[green]${text2}[/green]`,
17172
+ blue: (text2) => `[blue]${text2}[/blue]`,
17173
+ yellow: (text2) => `[yellow]${text2}[/yellow]`,
17174
+ cyan: (text2) => `[cyan]${text2}[/cyan]`,
17175
+ magenta: (text2) => `[magenta]${text2}[/magenta]`,
17176
+ gray: (text2) => `[gray]${text2}[/gray]`,
17177
+ dim: (text2) => `[dim]${text2}[/dim]`,
17178
+ bold: (text2) => `[bold]${text2}[/bold]`,
17179
+ italic: (text2) => `[italic]${text2}[/italic]`,
17180
+ underline: (text2) => `[underline]${text2}[/underline]`,
17181
+ strikethrough: (text2) => `[strikethrough]${text2}[/strikethrough]`,
17182
+ bgRed: (text2) => `[bgRed]${text2}[/bgRed]`,
17183
+ bgGreen: (text2) => `[bgGreen]${text2}[/bgGreen]`,
17184
+ bgBlue: (text2) => `[bgBlue]${text2}[/bgBlue]`,
17185
+ bgYellow: (text2) => `[bgYellow]${text2}[/bgYellow]`,
17186
+ bgCyan: (text2) => `[bgCyan]${text2}[/bgCyan]`,
17187
+ bgMagenta: (text2) => `[bgMagenta]${text2}[/bgMagenta]`,
17188
+ bgGray: (text2) => `[bgGray]${text2}[/bgGray]`,
17189
+ black: (text2) => `[black]${text2}[/black]`,
17190
+ white: (text2) => `[white]${text2}[/white]`,
17191
+ bgBlack: (text2) => `[bgBlack]${text2}[/bgBlack]`,
17192
+ bgWhite: (text2) => `[bgWhite]${text2}[/bgWhite]`,
17193
+ brightRed: (text2) => `[brightRed]${text2}[/brightRed]`,
17194
+ brightGreen: (text2) => `[brightGreen]${text2}[/brightGreen]`,
17195
+ brightYellow: (text2) => `[brightYellow]${text2}[/brightYellow]`,
17196
+ brightBlue: (text2) => `[brightBlue]${text2}[/brightBlue]`,
17197
+ brightCyan: (text2) => `[brightCyan]${text2}[/brightCyan]`,
17198
+ brightMagenta: (text2) => `[brightMagenta]${text2}[/brightMagenta]`,
17199
+ brightWhite: (text2) => `[brightWhite]${text2}[/brightWhite]`,
17200
+ reset: (text2) => `[reset]${text2}[/reset]`,
17201
+ strip: (text2) => text2.replace(/\[[^\]]+\]/g, "")
16065
17202
  };
16066
17203
  const originalLog = console.log;
16067
17204
  const originalError = console.error;
@@ -16191,15 +17328,15 @@ function createMatchers(result) {
16191
17328
  ` + `stdout: ${result.stdout}`);
16192
17329
  }
16193
17330
  },
16194
- toContainInStdout(text) {
16195
- if (!result.stdout.includes(text)) {
16196
- throw new Error(`Expected stdout to contain "${text}"
17331
+ toContainInStdout(text2) {
17332
+ if (!result.stdout.includes(text2)) {
17333
+ throw new Error(`Expected stdout to contain "${text2}"
16197
17334
  ` + `stdout: ${result.stdout}`);
16198
17335
  }
16199
17336
  },
16200
- toContainInStderr(text) {
16201
- if (!result.stderr.includes(text)) {
16202
- throw new Error(`Expected stderr to contain "${text}"
17337
+ toContainInStderr(text2) {
17338
+ if (!result.stderr.includes(text2)) {
17339
+ throw new Error(`Expected stderr to contain "${text2}"
16203
17340
  ` + `stderr: ${result.stderr}`);
16204
17341
  }
16205
17342
  },
@@ -16279,4 +17416,4 @@ export {
16279
17416
  createMatchers
16280
17417
  };
16281
17418
 
16282
- //# debugId=4B648A1569272EFB64756E2164756E21
17419
+ //# debugId=F69EF5EE8D7E2E8064756E2164756E21