poof 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,6 +52,7 @@ $ poof --verbose ./large-directory
52
52
  | ------------- | ----- | ---------------------------------------------- |
53
53
  | `--dry` | `-d` | Preview files without deleting |
54
54
  | `--verbose` | `-v` | Log each file as it's deleted |
55
+ | `--ignore` | `-i` | Glob pattern to exclude from deletion |
55
56
  | `--dangerous` | | Allow deleting paths outside current directory |
56
57
  | `--version` | | Show version |
57
58
  | `--help` | | Show help |
@@ -105,6 +106,18 @@ $ poof "**/*.log"
105
106
  $ poof "**/dist" "**/coverage" "**/*.tmp"
106
107
  ```
107
108
 
109
+ ### Excluding paths
110
+
111
+ Use `--ignore` to exclude paths from deletion:
112
+
113
+ ```sh
114
+ # Delete all dist folders except those in node_modules
115
+ $ poof "**/dist" --ignore "**/node_modules/**"
116
+
117
+ # Multiple ignore patterns
118
+ $ poof "**/*.log" -i "**/important/**" -i "**/backup/**"
119
+ ```
120
+
108
121
  ### Dotfiles (hidden files)
109
122
 
110
123
  By default, glob wildcards (`*`, `**`) don't match dotfiles (files starting with `.`). This helps avoid accidentally deleting `.git`, `.env`, or other hidden files.
@@ -215,6 +228,7 @@ type Options = {
215
228
  cwd?: string
216
229
  dry?: boolean
217
230
  dangerous?: boolean
231
+ ignore?: string[]
218
232
  }
219
233
 
220
234
  type Failure = {
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import path from 'node:path';
3
- import S$1 from 'tty';
3
+ import M$1 from 'tty';
4
4
  import poof from './index.mjs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:os';
@@ -10,16 +10,16 @@ import 'node:timers/promises';
10
10
 
11
11
  var O$2 = Object.defineProperty;
12
12
  var a = (t, e) => O$2(t, "name", { value: e, configurable: true });
13
- const P$1 = "known-flag", _$2 = "unknown-flag", D$1 = "argument", B$1 = /\B([A-Z])/g, G$2 = a((t) => t.replaceAll(B$1, "-$1").toLowerCase(), "camelToKebab"), { hasOwnProperty: K$2 } = Object.prototype, h$1 = a((t, e) => K$2.call(t, e), "hasOwn"), F$1 = a((t) => typeof t == "function" ? [t, false] : Array.isArray(t) ? [t[0], true] : F$1(t.type), "parseFlagType"), $$2 = a((t, e) => t === Boolean ? e !== "false" : e, "normalizeBoolean"), m$1 = a((t, e) => typeof e == "boolean" ? e : t === Number && e === "" ? Number.NaN : t(e), "applyParser"), R$2 = /[\s.:=]/, T$2 = a((t) => {
13
+ const P$2 = "known-flag", _$2 = "unknown-flag", D = "argument", B$1 = /\B([A-Z])/g, G$2 = a((t) => t.replaceAll(B$1, "-$1").toLowerCase(), "camelToKebab"), { hasOwnProperty: K$2 } = Object.prototype, h$1 = a((t, e) => K$2.call(t, e), "hasOwn"), F$1 = a((t) => typeof t == "function" ? [t, false] : Array.isArray(t) ? [t[0], true] : F$1(t.type), "parseFlagType"), $$1 = a((t, e) => t === Boolean ? e !== "false" : e, "normalizeBoolean"), m$1 = a((t, e) => typeof e == "boolean" ? e : t === Number && e === "" ? Number.NaN : t(e), "applyParser"), R$1 = /[\s.:=]/, T$2 = a((t) => {
14
14
  const e = `Flag name "${t}"`;
15
15
  if (t.length === 0) throw new Error(`${e} cannot be empty`);
16
16
  if (t.length === 1) throw new Error(`${e} must be longer than a character`);
17
- const n = t.match(R$2);
17
+ const n = t.match(R$1);
18
18
  if (n) throw new Error(`${e} cannot contain "${n?.[0]}"`);
19
19
  }, "validateFlagName"), d$1 = a((t, e, n) => {
20
20
  if (h$1(t, e)) throw new Error(`Duplicate flags named "${e}"`);
21
21
  t[e] = n;
22
- }, "setFlag"), U$2 = a((t) => {
22
+ }, "setFlag"), U$1 = a((t) => {
23
23
  const e = {};
24
24
  for (const n in t) {
25
25
  if (!h$1(t, n)) continue;
@@ -46,9 +46,9 @@ const P$1 = "known-flag", _$2 = "unknown-flag", D$1 = "argument", B$1 = /\B([A-Z
46
46
  } else n[s] = l ? r : r.pop();
47
47
  }
48
48
  return n;
49
- }, "finalizeFlags"), A = "--", j$2 = 3, v$1 = /^-{1,2}\w/, V$2 = a((t) => {
49
+ }, "finalizeFlags"), A$1 = "--", j$1 = 3, v$1 = /^-{1,2}\w/, V$2 = a((t) => {
50
50
  if (!v$1.test(t)) return;
51
- const e = !t.startsWith(A);
51
+ const e = !t.startsWith(A$1);
52
52
  let n = t.slice(e ? 1 : 2), s, r = -1;
53
53
  for (const l of ["=", ":", "."]) {
54
54
  const o = n.indexOf(l);
@@ -63,7 +63,7 @@ const P$1 = "known-flag", _$2 = "unknown-flag", D$1 = "argument", B$1 = /\B([A-Z
63
63
  }, "triggerValueCallback");
64
64
  for (let l = 0; l < t.length; l += 1) {
65
65
  const o = t[l];
66
- if (o === A) {
66
+ if (o === A$1) {
67
67
  r();
68
68
  const c = t.slice(l + 1);
69
69
  n?.(c, [l], true);
@@ -96,12 +96,12 @@ const P$1 = "known-flag", _$2 = "unknown-flag", D$1 = "argument", B$1 = /\B([A-Z
96
96
  t.splice(s, 1);
97
97
  }
98
98
  }, "spliceFromArgv"), z$2 = a((t, e = process.argv.slice(2), { ignore: n } = {}) => {
99
- const s = [], r = U$2(t), l = {}, o = [];
100
- return o[A] = [], L$2(e, { onFlag(i, c, f) {
101
- const g = (f.length === j$2 || i.length > 1) && h$1(r, i);
102
- if (!n?.(g ? P$1 : _$2, i, c)) {
99
+ const s = [], r = U$1(t), l = {}, o = [];
100
+ return o[A$1] = [], L$2(e, { onFlag(i, c, f) {
101
+ const g = (f.length === j$1 || i.length > 1) && h$1(r, i);
102
+ if (!n?.(g ? P$2 : _$2, i, c)) {
103
103
  if (g) {
104
- const [y, p] = r[i], b = $$2(p, c), N = a((C, E) => {
104
+ const [y, p] = r[i], b = $$1(p, c), N = a((C, E) => {
105
105
  s.push(f), E && s.push(E), y.push(m$1(p, C || ""));
106
106
  }, "getFollowingValue");
107
107
  return b === void 0 ? N : N(b);
@@ -109,13 +109,13 @@ const P$1 = "known-flag", _$2 = "unknown-flag", D$1 = "argument", B$1 = /\B([A-Z
109
109
  h$1(l, i) || (l[i] = []), l[i].push(c === void 0 ? true : c), s.push(f);
110
110
  }
111
111
  }, onArgument: a((i, c, f) => {
112
- n?.(D$1, e[c[0]]) || (o.push(...i), f ? (o[A] = i, e.splice(c[0])) : s.push(c));
112
+ n?.(D, e[c[0]]) || (o.push(...i), f ? (o[A$1] = i, e.splice(c[0])) : s.push(c));
113
113
  }, "onArgument") }), k$2(e, s), { flags: W$2(t, r), unknownFlags: l, _: o };
114
114
  }, "typeFlag"); a((t, e, n = process.argv.slice(2)) => {
115
115
  const s = new Set(t.split(",").map((c) => V$2(c)?.[0])), [r, l] = F$1(e), o = [], i = [];
116
116
  return L$2(n, { onFlag: a((c, f, w) => {
117
117
  if (!s.has(c) || !l && o.length > 0) return;
118
- const u = $$2(r, f), g = a((y, p) => {
118
+ const u = $$1(r, f), g = a((y, p) => {
119
119
  i.push(w), p && i.push(p), o.push(m$1(r, y || ""));
120
120
  }, "getFollowingValue");
121
121
  return u === void 0 ? g : g(u);
@@ -124,25 +124,25 @@ const P$1 = "known-flag", _$2 = "unknown-flag", D$1 = "argument", B$1 = /\B([A-Z
124
124
 
125
125
  var O$1 = Object.defineProperty;
126
126
  var n = (D, F) => O$1(D, "name", { value: F, configurable: true });
127
- const M$1 = n((D) => {
127
+ const M = n((D) => {
128
128
  const F = process.stdout.columns ?? Number.POSITIVE_INFINITY;
129
129
  return typeof D == "function" && (D = D(F)), D || (D = {}), Array.isArray(D) ? { columns: D, stdoutColumns: F } : { columns: D.columns ?? [], stdoutColumns: D.stdoutColumns ?? F };
130
130
  }, "getOptions");
131
- function j$1({ onlyFirst: D = false } = {}) {
131
+ function j({ onlyFirst: D = false } = {}) {
132
132
  const u = ["[\\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("|");
133
133
  return new RegExp(u, D ? void 0 : "g");
134
134
  }
135
- n(j$1, "ansiRegex");
136
- const k$1 = j$1();
135
+ n(j, "ansiRegex");
136
+ const k$1 = j();
137
137
  function w(D) {
138
138
  if (typeof D != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);
139
139
  return D.replace(k$1, "");
140
140
  }
141
141
  n(w, "stripAnsi");
142
- function P(D) {
142
+ function P$1(D) {
143
143
  return D === 161 || D === 164 || D === 167 || D === 168 || D === 170 || D === 173 || D === 174 || D >= 176 && D <= 180 || D >= 182 && D <= 186 || D >= 188 && D <= 191 || D === 198 || D === 208 || D === 215 || D === 216 || D >= 222 && D <= 225 || D === 230 || D >= 232 && D <= 234 || D === 236 || D === 237 || D === 240 || D === 242 || D === 243 || D >= 247 && D <= 250 || D === 252 || D === 254 || D === 257 || D === 273 || D === 275 || D === 283 || D === 294 || D === 295 || D === 299 || D >= 305 && D <= 307 || D === 312 || D >= 319 && D <= 322 || D === 324 || D >= 328 && D <= 331 || D === 333 || D === 338 || D === 339 || D === 358 || 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 || D >= 713 && D <= 715 || D === 717 || D === 720 || D >= 728 && D <= 731 || D === 733 || D === 735 || D >= 768 && D <= 879 || D >= 913 && D <= 929 || D >= 931 && D <= 937 || D >= 945 && D <= 961 || D >= 963 && D <= 969 || D === 1025 || D >= 1040 && D <= 1103 || D === 1105 || D === 8208 || D >= 8211 && D <= 8214 || D === 8216 || D === 8217 || D === 8220 || D === 8221 || D >= 8224 && D <= 8226 || D >= 8228 && D <= 8231 || D === 8240 || D === 8242 || D === 8243 || D === 8245 || D === 8251 || D === 8254 || D === 8308 || D === 8319 || D >= 8321 && D <= 8324 || D === 8364 || D === 8451 || D === 8453 || D === 8457 || D === 8467 || D === 8470 || D === 8481 || D === 8482 || D === 8486 || D === 8491 || D === 8531 || D === 8532 || D >= 8539 && D <= 8542 || D >= 8544 && D <= 8555 || D >= 8560 && D <= 8569 || D === 8585 || D >= 8592 && D <= 8601 || D === 8632 || D === 8633 || D === 8658 || D === 8660 || D === 8679 || D === 8704 || D === 8706 || D === 8707 || D === 8711 || D === 8712 || D === 8715 || D === 8719 || D === 8721 || D === 8725 || D === 8730 || D >= 8733 && D <= 8736 || D === 8739 || D === 8741 || D >= 8743 && D <= 8748 || D === 8750 || D >= 8756 && D <= 8759 || D === 8764 || D === 8765 || D === 8776 || D === 8780 || D === 8786 || D === 8800 || D === 8801 || D >= 8804 && D <= 8807 || D === 8810 || D === 8811 || D === 8814 || D === 8815 || D === 8834 || D === 8835 || D === 8838 || D === 8839 || D === 8853 || D === 8857 || D === 8869 || D === 8895 || D === 8978 || D >= 9312 && D <= 9449 || D >= 9451 && D <= 9547 || D >= 9552 && D <= 9587 || D >= 9600 && D <= 9615 || D >= 9618 && D <= 9621 || D === 9632 || D === 9633 || D >= 9635 && D <= 9641 || D === 9650 || D === 9651 || D === 9654 || D === 9655 || D === 9660 || D === 9661 || D === 9664 || D === 9665 || D >= 9670 && D <= 9672 || D === 9675 || D >= 9678 && D <= 9681 || D >= 9698 && D <= 9701 || D === 9711 || D === 9733 || D === 9734 || D === 9737 || D === 9742 || D === 9743 || D === 9756 || D === 9758 || D === 9792 || D === 9794 || D === 9824 || D === 9825 || D >= 9827 && D <= 9829 || D >= 9831 && D <= 9834 || D === 9836 || D === 9837 || D === 9839 || D === 9886 || D === 9887 || D === 9919 || D >= 9926 && D <= 9933 || D >= 9935 && D <= 9939 || D >= 9941 && D <= 9953 || D === 9955 || D === 9960 || D === 9961 || D >= 9963 && D <= 9969 || D === 9972 || D >= 9974 && D <= 9977 || D === 9979 || D === 9980 || D === 9982 || D === 9983 || D === 10045 || D >= 10102 && D <= 10111 || D >= 11094 && D <= 11097 || D >= 12872 && D <= 12879 || D >= 57344 && D <= 63743 || D >= 65024 && D <= 65039 || D === 65533 || D >= 127232 && D <= 127242 || D >= 127248 && D <= 127277 || D >= 127280 && D <= 127337 || D >= 127344 && D <= 127373 || D === 127375 || D === 127376 || D >= 127387 && D <= 127404 || D >= 917760 && D <= 917999 || D >= 983040 && D <= 1048573 || D >= 1048576 && D <= 1114109;
144
144
  }
145
- n(P, "isAmbiguous");
145
+ n(P$1, "isAmbiguous");
146
146
  function z$1(D) {
147
147
  return D === 12288 || D >= 65281 && D <= 65376 || D >= 65504 && D <= 65510;
148
148
  }
@@ -156,11 +156,11 @@ function Z$1(D) {
156
156
  }
157
157
  n(Z$1, "validate");
158
158
  function V$1(D, { ambiguousAsWide: F = false } = {}) {
159
- return Z$1(D), z$1(D) || G$1(D) || F && P(D) ? 2 : 1;
159
+ return Z$1(D), z$1(D) || G$1(D) || F && P$1(D) ? 2 : 1;
160
160
  }
161
161
  n(V$1, "eastAsianWidth");
162
- var Y = n(() => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g, "emojiRegex");
163
- const K$1 = new Intl.Segmenter(), U$1 = new RegExp("^\\p{Default_Ignorable_Code_Point}$", "u");
162
+ var Y$1 = n(() => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g, "emojiRegex");
163
+ const K$1 = new Intl.Segmenter(), U = new RegExp("^\\p{Default_Ignorable_Code_Point}$", "u");
164
164
  function d(D, F = {}) {
165
165
  if (typeof D != "string" || D.length === 0) return 0;
166
166
  const { ambiguousIsNarrow: u = true, countAnsiEscapeCodes: C = false } = F;
@@ -169,8 +169,8 @@ function d(D, F = {}) {
169
169
  const t = { ambiguousAsWide: !u };
170
170
  for (const { segment: i } of K$1.segment(D)) {
171
171
  const e = i.codePointAt(0);
172
- if (!(e <= 31 || e >= 127 && e <= 159) && !(e >= 8203 && e <= 8207 || e === 65279) && !(e >= 768 && e <= 879 || e >= 6832 && e <= 6911 || e >= 7616 && e <= 7679 || e >= 8400 && e <= 8447 || e >= 65056 && e <= 65071) && !(e >= 55296 && e <= 57343) && !(e >= 65024 && e <= 65039) && !U$1.test(i)) {
173
- if (Y().test(i)) {
172
+ if (!(e <= 31 || e >= 127 && e <= 159) && !(e >= 8203 && e <= 8207 || e === 65279) && !(e >= 768 && e <= 879 || e >= 6832 && e <= 6911 || e >= 7616 && e <= 7679 || e >= 8400 && e <= 8447 || e >= 65056 && e <= 65071) && !(e >= 55296 && e <= 57343) && !(e >= 65024 && e <= 65039) && !U.test(i)) {
173
+ if (Y$1().test(i)) {
174
174
  E += 2;
175
175
  continue;
176
176
  }
@@ -180,28 +180,28 @@ function d(D, F = {}) {
180
180
  return E;
181
181
  }
182
182
  n(d, "stringWidth");
183
- const x$1 = n((D) => Math.max(...D.split(`
183
+ const x = n((D) => Math.max(...D.split(`
184
184
  `).map((F) => d(F))), "getLongestLineWidth"), q = n((D) => {
185
185
  const F = [];
186
186
  for (const u of D) {
187
187
  const { length: C } = u, E = C - F.length;
188
188
  for (let t = 0; t < E; t += 1) F.push(0);
189
189
  for (let t = 0; t < C; t += 1) {
190
- const i = x$1(u[t]);
190
+ const i = x(u[t]);
191
191
  i > F[t] && (F[t] = i);
192
192
  }
193
193
  }
194
194
  return F;
195
- }, "getColumnContentWidths"), y = /^\d+%$/, S = { width: "auto", align: "left", contentWidth: 0, paddingLeft: 0, paddingRight: 0, paddingTop: 0, paddingBottom: 0, horizontalPadding: 0, paddingLeftString: "", paddingRightString: "" }, H$1 = n((D, F) => {
195
+ }, "getColumnContentWidths"), y = /^\d+%$/, S$1 = { width: "auto", align: "left", contentWidth: 0, paddingLeft: 0, paddingRight: 0, paddingTop: 0, paddingBottom: 0, horizontalPadding: 0, paddingLeftString: "", paddingRightString: "" }, H$1 = n((D, F) => {
196
196
  const u = [];
197
197
  for (let C = 0; C < D.length; C += 1) {
198
198
  const E = F[C] ?? "auto";
199
199
  if (typeof E == "number" || E === "auto" || E === "content-width" || typeof E == "string" && y.test(E)) {
200
- u.push({ ...S, width: E, contentWidth: D[C] });
200
+ u.push({ ...S$1, width: E, contentWidth: D[C] });
201
201
  continue;
202
202
  }
203
203
  if (E && typeof E == "object") {
204
- const t = { ...S, ...E, contentWidth: D[C] };
204
+ const t = { ...S$1, ...E, contentWidth: D[C] };
205
205
  t.horizontalPadding = t.paddingLeft + t.paddingRight, u.push(t);
206
206
  continue;
207
207
  }
@@ -228,12 +228,12 @@ const x$1 = n((D) => Math.max(...D.split(`
228
228
  const e = F - u.horizontalPadding;
229
229
  u.width = Math.max(Math.min(u.width, e), t);
230
230
  }
231
- }, "resolveColumnWidths"), R$1 = n(() => Object.assign([], { columns: 0 }), "makeRow"), Q$1 = n((D, F) => {
232
- const u = [R$1()];
231
+ }, "resolveColumnWidths"), R = n(() => Object.assign([], { columns: 0 }), "makeRow"), Q$1 = n((D, F) => {
232
+ const u = [R()];
233
233
  let [C] = u;
234
234
  for (const E of D) {
235
235
  const t = E.width + E.horizontalPadding;
236
- C.columns + t > F && (C = R$1(), u.push(C)), C.push(E), C.columns += t;
236
+ C.columns + t > F && (C = R(), u.push(C)), C.push(E), C.columns += t;
237
237
  }
238
238
  for (const E of u) {
239
239
  const t = E.reduce((r, o) => r + o.width + o.horizontalPadding, 0);
@@ -254,24 +254,24 @@ const x$1 = n((D) => Math.max(...D.split(`
254
254
  }, "balanceAuto"), X$1 = n((D, F, u) => {
255
255
  const C = H$1(u, F);
256
256
  return J$1(C, D), Q$1(C, D);
257
- }, "computeColumnWidths"), p = 10, v = n((D = 0) => (F) => `\x1B[${F + D}m`, "wrapAnsi16"), _$1 = n((D = 0) => (F) => `\x1B[${38 + D};5;${F}m`, "wrapAnsi256"), L$1 = n((D = 0) => (F, u, C) => `\x1B[${38 + D};2;${F};${u};${C}m`, "wrapAnsi16m"), s$1 = { 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] } };
258
- Object.keys(s$1.modifier);
259
- const DD = Object.keys(s$1.color), uD = Object.keys(s$1.bgColor);
257
+ }, "computeColumnWidths"), p = 10, v = n((D = 0) => (F) => `\x1B[${F + D}m`, "wrapAnsi16"), _$1 = n((D = 0) => (F) => `\x1B[${38 + D};5;${F}m`, "wrapAnsi256"), L$1 = n((D = 0) => (F, u, C) => `\x1B[${38 + D};2;${F};${u};${C}m`, "wrapAnsi16m"), s = { 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] } };
258
+ Object.keys(s.modifier);
259
+ const DD = Object.keys(s.color), uD = Object.keys(s.bgColor);
260
260
  [...DD, ...uD];
261
261
  function FD() {
262
262
  const D = /* @__PURE__ */ new Map();
263
- for (const [F, u] of Object.entries(s$1)) {
264
- for (const [C, E] of Object.entries(u)) s$1[C] = { open: `\x1B[${E[0]}m`, close: `\x1B[${E[1]}m` }, u[C] = s$1[C], D.set(E[0], E[1]);
265
- Object.defineProperty(s$1, F, { value: u, enumerable: false });
263
+ for (const [F, u] of Object.entries(s)) {
264
+ for (const [C, E] of Object.entries(u)) s[C] = { open: `\x1B[${E[0]}m`, close: `\x1B[${E[1]}m` }, u[C] = s[C], D.set(E[0], E[1]);
265
+ Object.defineProperty(s, F, { value: u, enumerable: false });
266
266
  }
267
- return Object.defineProperty(s$1, "codes", { value: D, enumerable: false }), s$1.color.close = "\x1B[39m", s$1.bgColor.close = "\x1B[49m", s$1.color.ansi = v(), s$1.color.ansi256 = _$1(), s$1.color.ansi16m = L$1(), s$1.bgColor.ansi = v(p), s$1.bgColor.ansi256 = _$1(p), s$1.bgColor.ansi16m = L$1(p), Object.defineProperties(s$1, { rgbToAnsi256: { value: n((F, u, C) => F === u && u === C ? F < 8 ? 16 : F > 248 ? 231 : Math.round((F - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(F / 255 * 5) + 6 * Math.round(u / 255 * 5) + Math.round(C / 255 * 5), "value"), enumerable: false }, hexToRgb: { value: n((F) => {
267
+ return Object.defineProperty(s, "codes", { value: D, enumerable: false }), s.color.close = "\x1B[39m", s.bgColor.close = "\x1B[49m", s.color.ansi = v(), s.color.ansi256 = _$1(), s.color.ansi16m = L$1(), s.bgColor.ansi = v(p), s.bgColor.ansi256 = _$1(p), s.bgColor.ansi16m = L$1(p), Object.defineProperties(s, { rgbToAnsi256: { value: n((F, u, C) => F === u && u === C ? F < 8 ? 16 : F > 248 ? 231 : Math.round((F - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(F / 255 * 5) + 6 * Math.round(u / 255 * 5) + Math.round(C / 255 * 5), "value"), enumerable: false }, hexToRgb: { value: n((F) => {
268
268
  const u = /[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));
269
269
  if (!u) return [0, 0, 0];
270
270
  let [C] = u;
271
271
  C.length === 3 && (C = [...C].map((t) => t + t).join(""));
272
272
  const E = Number.parseInt(C, 16);
273
273
  return [E >> 16 & 255, E >> 8 & 255, E & 255];
274
- }, "value"), enumerable: false }, hexToAnsi256: { value: n((F) => s$1.rgbToAnsi256(...s$1.hexToRgb(F)), "value"), enumerable: false }, ansi256ToAnsi: { value: n((F) => {
274
+ }, "value"), enumerable: false }, hexToAnsi256: { value: n((F) => s.rgbToAnsi256(...s.hexToRgb(F)), "value"), enumerable: false }, ansi256ToAnsi: { value: n((F) => {
275
275
  if (F < 8) return 30 + F;
276
276
  if (F < 16) return 90 + (F - 8);
277
277
  let u, C, E;
@@ -285,10 +285,10 @@ function FD() {
285
285
  if (t === 0) return 30;
286
286
  let i = 30 + (Math.round(E) << 2 | Math.round(C) << 1 | Math.round(u));
287
287
  return t === 2 && (i += 60), i;
288
- }, "value"), enumerable: false }, rgbToAnsi: { value: n((F, u, C) => s$1.ansi256ToAnsi(s$1.rgbToAnsi256(F, u, C)), "value"), enumerable: false }, hexToAnsi: { value: n((F) => s$1.ansi256ToAnsi(s$1.hexToAnsi256(F)), "value"), enumerable: false } }), s$1;
288
+ }, "value"), enumerable: false }, rgbToAnsi: { value: n((F, u, C) => s.ansi256ToAnsi(s.rgbToAnsi256(F, u, C)), "value"), enumerable: false }, hexToAnsi: { value: n((F) => s.ansi256ToAnsi(s.hexToAnsi256(F)), "value"), enumerable: false } }), s;
289
289
  }
290
290
  n(FD, "assembleStyles");
291
- const CD = FD(), g = /* @__PURE__ */ new Set(["\x1B", "\x9B"]), ED = 39, m = "\x07", N = "[", eD = "]", T$1 = "m", h = `${eD}8;;`, $$1 = n((D) => `${g.values().next().value}${N}${D}${T$1}`, "wrapAnsiCode"), W$1 = n((D) => `${g.values().next().value}${h}${D}${m}`, "wrapAnsiHyperlink"), tD = n((D) => D.split(" ").map((F) => d(F)), "wordLengths"), b = n((D, F, u) => {
291
+ const CD = FD(), g = /* @__PURE__ */ new Set(["\x1B", "\x9B"]), ED = 39, m = "\x07", N = "[", eD = "]", T$1 = "m", h = `${eD}8;;`, $ = n((D) => `${g.values().next().value}${N}${D}${T$1}`, "wrapAnsiCode"), W$1 = n((D) => `${g.values().next().value}${h}${D}${m}`, "wrapAnsiHyperlink"), tD = n((D) => D.split(" ").map((F) => d(F)), "wordLengths"), b$1 = n((D, F, u) => {
292
292
  const C = [...F];
293
293
  let E = false, t = false, i = d(w(D.at(-1)));
294
294
  for (const [e, B] of C.entries()) {
@@ -315,18 +315,18 @@ const CD = FD(), g = /* @__PURE__ */ new Set(["\x1B", "\x9B"]), ED = 39, m = "\x
315
315
  let o = d(e.at(-1));
316
316
  if (l !== 0 && (o >= F && (u.wordWrap === false || u.trim === false) && (e.push(""), o = 0), (o > 0 || u.trim === false) && (e[e.length - 1] += " ", o++)), u.hard && i[l] > F) {
317
317
  const c = F - o, f = 1 + Math.floor((i[l] - c - 1) / F);
318
- Math.floor((i[l] - 1) / F) < f && e.push(""), b(e, r, F);
318
+ Math.floor((i[l] - 1) / F) < f && e.push(""), b$1(e, r, F);
319
319
  continue;
320
320
  }
321
321
  if (o + i[l] > F && o > 0 && i[l] > 0) {
322
322
  if (u.wordWrap === false && o < F) {
323
- b(e, r, F);
323
+ b$1(e, r, F);
324
324
  continue;
325
325
  }
326
326
  e.push("");
327
327
  }
328
328
  if (o + i[l] > F && u.wordWrap === false) {
329
- b(e, r, F);
329
+ b$1(e, r, F);
330
330
  continue;
331
331
  }
332
332
  e[e.length - 1] += r;
@@ -345,8 +345,8 @@ const CD = FD(), g = /* @__PURE__ */ new Set(["\x1B", "\x9B"]), ED = 39, m = "\x
345
345
  }
346
346
  const o = CD.codes.get(Number(E));
347
347
  A[l + 1] === `
348
- ` ? (t && (C += W$1("")), E && o && (C += $$1(o))) : r === `
349
- ` && (E && o && (C += $$1(E)), t && (C += W$1(t))), a += r.length;
348
+ ` ? (t && (C += W$1("")), E && o && (C += $(o))) : r === `
349
+ ` && (E && o && (C += $(E)), t && (C += W$1(t))), a += r.length;
350
350
  }
351
351
  return C;
352
352
  }, "exec");
@@ -358,21 +358,21 @@ function BD(D, F, u) {
358
358
  `);
359
359
  }
360
360
  n(BD, "wrapAnsi");
361
- const I = n((D) => Array.from({ length: D }).fill(""), "emptyLines"), oD = n((D, F) => {
361
+ const I$1 = n((D) => Array.from({ length: D }).fill(""), "emptyLines"), oD = n((D, F) => {
362
362
  const u = [];
363
363
  let C = 0;
364
364
  for (const E of D) {
365
365
  let t = 0;
366
366
  const i = E.map((B) => {
367
367
  let A = F[C] ?? "";
368
- C += 1, B.preprocess && (A = B.preprocess(A)), x$1(A) > B.width && (A = BD(A, B.width, { hard: true }));
368
+ C += 1, B.preprocess && (A = B.preprocess(A)), x(A) > B.width && (A = BD(A, B.width, { hard: true }));
369
369
  let a = A.split(`
370
370
  `);
371
371
  if (B.postprocess) {
372
372
  const { postprocess: l } = B;
373
373
  a = a.map((r, o) => l.call(B, r, o));
374
374
  }
375
- return B.paddingTop && a.unshift(...I(B.paddingTop)), B.paddingBottom && a.push(...I(B.paddingBottom)), a.length > t && (t = a.length), { ...B, lines: a };
375
+ return B.paddingTop && a.unshift(...I$1(B.paddingTop)), B.paddingBottom && a.push(...I$1(B.paddingBottom)), a.length > t && (t = a.length), { ...B, lines: a };
376
376
  }), e = [];
377
377
  for (let B = 0; B < t; B += 1) {
378
378
  const A = i.map((a) => {
@@ -391,7 +391,7 @@ const I = n((D) => Array.from({ length: D }).fill(""), "emptyLines"), oD = n((D,
391
391
  if (!D || D.length === 0) return "";
392
392
  const u = q(D), C = u.length;
393
393
  if (C === 0) return "";
394
- const { stdoutColumns: E, columns: t } = M$1(F);
394
+ const { stdoutColumns: E, columns: t } = M(F);
395
395
  if (t.length > C) throw new Error(`${t.length} columns defined, but only ${C} columns found`);
396
396
  const i = X$1(E, t, u);
397
397
  return D.map((e) => oD(i, e)).join(`
@@ -410,85 +410,135 @@ const I = n((D) => Array.from({ length: D }).fill(""), "emptyLines"), oD = n((D,
410
410
  return (u) => F.find(({ operator: C, breakpoint: E }) => C === "=" && u === E || C === ">" && u > E || C === "<" && u < E || C === ">=" && u >= E || C === "<=" && u <= E)?.value;
411
411
  }, "breakpoints");
412
412
 
413
- var B = Object.defineProperty;
414
- var s = (t, e) => B(t, "name", { value: e, configurable: true });
415
- const R = s((t) => t.replaceAll(/[\W_]([a-z\d])?/gi, (e, r) => r ? r.toUpperCase() : ""), "camelCase"), D = s((t) => t.replaceAll(/\B([A-Z])/g, "-$1").toLowerCase(), "kebabCase"), L = { "> 80": [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "auto" }], "> 40": [{ width: "auto", paddingLeft: 2, paddingRight: 8, preprocess: s((t) => t.trim(), "preprocess") }, { width: "100%", paddingLeft: 2, paddingBottom: 1 }], "> 0": { stdoutColumns: 1e3, columns: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "content-width" }] } };
416
- function T(t) {
413
+ var _ = Object.defineProperty;
414
+ var o = (t, e) => _(t, "name", { value: e, configurable: true });
415
+ const b = new Uint32Array(65536), L = o((t, e) => {
416
+ const r = t.length, a = e.length, n = 1 << r - 1;
417
+ let s = -1, i = 0, d = r, l = r;
418
+ for (; l--; ) b[t.charCodeAt(l)] |= 1 << l;
419
+ for (l = 0; l < a; l++) {
420
+ let h = b[e.charCodeAt(l)];
421
+ const u = h | i;
422
+ h |= (h & s) + s ^ s, i |= ~(h | s), s &= h, i & n && d++, s & n && d--, i = i << 1 | 1, s = s << 1 | ~(u | i), i &= u;
423
+ }
424
+ for (l = r; l--; ) b[t.charCodeAt(l)] = 0;
425
+ return d;
426
+ }, "myers_32"), T = o((t, e) => {
427
+ const r = e.length, a = t.length, n = [], s = [], i = Math.ceil(r / 32), d = Math.ceil(a / 32);
428
+ for (let c = 0; c < i; c++) s[c] = -1, n[c] = 0;
429
+ let l = 0;
430
+ for (; l < d - 1; l++) {
431
+ let c = 0, g = -1;
432
+ const m = l * 32, y = Math.min(32, a) + m;
433
+ for (let f = m; f < y; f++) b[t.charCodeAt(f)] |= 1 << f;
434
+ for (let f = 0; f < r; f++) {
435
+ const v = b[e.charCodeAt(f)], w = s[f / 32 | 0] >>> f & 1, p = n[f / 32 | 0] >>> f & 1, N = v | c, q = ((v | p) & g) + g ^ g | v | p;
436
+ let x = c | ~(q | g), j = g & q;
437
+ x >>> 31 ^ w && (s[f / 32 | 0] ^= 1 << f), j >>> 31 ^ p && (n[f / 32 | 0] ^= 1 << f), x = x << 1 | w, j = j << 1 | p, g = j | ~(N | x), c = x & N;
438
+ }
439
+ for (let f = m; f < y; f++) b[t.charCodeAt(f)] = 0;
440
+ }
441
+ let h = 0, u = -1;
442
+ const C = l * 32, $ = Math.min(32, a - C) + C;
443
+ for (let c = C; c < $; c++) b[t.charCodeAt(c)] |= 1 << c;
444
+ let E = a;
445
+ for (let c = 0; c < r; c++) {
446
+ const g = b[e.charCodeAt(c)], m = s[c / 32 | 0] >>> c & 1, y = n[c / 32 | 0] >>> c & 1, f = g | h, v = ((g | y) & u) + u ^ u | g | y;
447
+ let w = h | ~(v | u), p = u & v;
448
+ E += w >>> a - 1 & 1, E -= p >>> a - 1 & 1, w >>> 31 ^ m && (s[c / 32 | 0] ^= 1 << c), p >>> 31 ^ y && (n[c / 32 | 0] ^= 1 << c), w = w << 1 | m, p = p << 1 | y, u = p | ~(f | w), h = w & f;
449
+ }
450
+ for (let c = C; c < $; c++) b[t.charCodeAt(c)] = 0;
451
+ return E;
452
+ }, "myers_x"), F = o((t, e) => {
453
+ if (t.length < e.length) {
454
+ const r = e;
455
+ e = t, t = r;
456
+ }
457
+ return e.length === 0 ? t.length : t.length <= 32 ? L(t, e) : T(t, e);
458
+ }, "distance"), H = o((t, e) => {
459
+ let r = 1 / 0, a = 0;
460
+ for (let n = 0; n < e.length; n++) {
461
+ const s = F(t, e[n]);
462
+ s < r && (r = s, a = n);
463
+ }
464
+ return e[a];
465
+ }, "closest"), V = o((t) => t.replaceAll(/[\W_]([a-z\d])?/gi, (e, r) => r ? r.toUpperCase() : ""), "camelCase"), J = o((t) => t.replaceAll(/\B([A-Z])/g, "-$1").toLowerCase(), "kebabCase"), W = { "> 80": [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "auto" }], "> 40": [{ width: "auto", paddingLeft: 2, paddingRight: 8, preprocess: o((t) => t.trim(), "preprocess") }, { width: "100%", paddingLeft: 2, paddingBottom: 1 }], "> 0": { stdoutColumns: 1e3, columns: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "content-width" }] } };
466
+ function z(t) {
417
467
  let e = false;
418
- return { type: "table", data: { tableData: Object.keys(t).sort((a, i) => a.localeCompare(i)).map((a) => {
419
- const i = t[a], o = "alias" in i;
420
- return o && (e = true), { name: a, flag: i, flagFormatted: `--${D(a)}`, aliasesEnabled: e, aliasFormatted: o ? `-${i.alias}` : void 0 };
421
- }).map((a) => (a.aliasesEnabled = e, [{ type: "flagName", data: a }, { type: "flagDescription", data: a }])), tableBreakpoints: L } };
468
+ return { type: "table", data: { tableData: Object.keys(t).sort((n, s) => n.localeCompare(s)).map((n) => {
469
+ const s = t[n], i = "alias" in s;
470
+ return i && (e = true), { name: n, flag: s, flagFormatted: `--${J(n)}`, aliasesEnabled: e, aliasFormatted: i ? `-${s.alias}` : void 0 };
471
+ }).map((n) => (n.aliasesEnabled = e, [{ type: "flagName", data: n }, { type: "flagDescription", data: n }])), tableBreakpoints: W } };
422
472
  }
423
- s(T, "renderFlags");
424
- const E = s((t) => !t || (t.version ?? (t.help ? t.help.version : void 0)), "getVersion"), C = s((t) => {
473
+ o(z, "renderFlags");
474
+ const k = o((t) => !t || (t.version ?? (t.help ? t.help.version : void 0)), "getVersion"), B = o((t) => {
425
475
  const e = "parent" in t && t.parent?.name;
426
476
  return (e ? `${e} ` : "") + t.name;
427
477
  }, "getName");
428
- function k(t) {
478
+ function K(t) {
429
479
  const e = [];
430
- t.name && e.push(C(t));
431
- const r = E(t) ?? ("parent" in t && E(t.parent));
480
+ t.name && e.push(B(t));
481
+ const r = k(t) ?? ("parent" in t && k(t.parent));
432
482
  if (r && e.push(`v${r}`), e.length !== 0) return { id: "name", type: "text", data: `${e.join(" ")}
433
483
  ` };
434
484
  }
435
- s(k, "getNameAndVersion");
436
- function _(t) {
485
+ o(K, "getNameAndVersion");
486
+ function Z(t) {
437
487
  const { help: e } = t;
438
488
  if (!(!e || !e.description)) return { id: "description", type: "text", data: `${e.description}
439
489
  ` };
440
490
  }
441
- s(_, "getDescription");
442
- function F(t) {
491
+ o(Z, "getDescription");
492
+ function G(t) {
443
493
  const e = t.help || {};
444
494
  if ("usage" in e) return e.usage ? { id: "usage", type: "section", data: { title: "Usage:", body: Array.isArray(e.usage) ? e.usage.join(`
445
495
  `) : e.usage } } : void 0;
446
496
  if (t.name) {
447
- const r = [], n = [C(t)];
448
- if (t.flags && Object.keys(t.flags).length > 0 && n.push("[flags...]"), t.parameters && t.parameters.length > 0) {
449
- const { parameters: a } = t, i = a.indexOf("--"), o = i !== -1 && a.slice(i + 1).some((l) => l.startsWith("<"));
450
- n.push(a.map((l) => l !== "--" ? l : o ? "--" : "[--]").join(" "));
497
+ const r = [], a = [B(t)];
498
+ if (t.flags && Object.keys(t.flags).length > 0 && a.push("[flags...]"), t.parameters && t.parameters.length > 0) {
499
+ const { parameters: n } = t, s = n.indexOf("--"), i = s !== -1 && n.slice(s + 1).some((d) => d.startsWith("<"));
500
+ a.push(n.map((d) => d !== "--" ? d : i ? "--" : "[--]").join(" "));
451
501
  }
452
- if (n.length > 1 && r.push(n.join(" ")), "commands" in t && t.commands?.length && r.push(`${t.name} <command>`), r.length > 0) return { id: "usage", type: "section", data: { title: "Usage:", body: r.join(`
502
+ if (a.length > 1 && r.push(a.join(" ")), "commands" in t && t.commands?.length && r.push(`${t.name} <command>`), r.length > 0) return { id: "usage", type: "section", data: { title: "Usage:", body: r.join(`
453
503
  `) } };
454
504
  }
455
505
  }
456
- s(F, "getUsage");
457
- function H(t) {
458
- return !("commands" in t) || !t.commands?.length ? void 0 : { id: "commands", type: "section", data: { title: "Commands:", body: { type: "table", data: { tableData: t.commands.map((n) => {
459
- const { help: a } = n.options;
460
- return [n.options.name, typeof a == "object" && a.description || ""];
506
+ o(G, "getUsage");
507
+ function Q(t) {
508
+ return !("commands" in t) || !t.commands?.length ? void 0 : { id: "commands", type: "section", data: { title: "Commands:", body: { type: "table", data: { tableData: t.commands.map((a) => {
509
+ const { help: n } = a.options;
510
+ return [a.options.name, typeof n == "object" && n.description || ""];
461
511
  }), tableOptions: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }] } }, indentBody: 0 } };
462
512
  }
463
- s(H, "getCommands");
464
- function U(t) {
465
- if (!(!t.flags || Object.keys(t.flags).length === 0)) return { id: "flags", type: "section", data: { title: "Flags:", body: T(t.flags), indentBody: 0 } };
513
+ o(Q, "getCommands");
514
+ function X(t) {
515
+ if (!(!t.flags || Object.keys(t.flags).length === 0)) return { id: "flags", type: "section", data: { title: "Flags:", body: z(t.flags), indentBody: 0 } };
466
516
  }
467
- s(U, "getFlags");
468
- function V(t) {
517
+ o(X, "getFlags");
518
+ function Y(t) {
469
519
  const { help: e } = t;
470
520
  if (!e || !e.examples || e.examples.length === 0) return;
471
521
  let { examples: r } = e;
472
522
  if (Array.isArray(r) && (r = r.join(`
473
523
  `)), r) return { id: "examples", type: "section", data: { title: "Examples:", body: r } };
474
524
  }
475
- s(V, "getExamples");
476
- function J(t) {
525
+ o(Y, "getExamples");
526
+ function ee(t) {
477
527
  if (!("alias" in t) || !t.alias) return;
478
528
  const { alias: e } = t;
479
529
  return { id: "aliases", type: "section", data: { title: "Aliases:", body: Array.isArray(e) ? e.join(", ") : e } };
480
530
  }
481
- s(J, "getAliases");
482
- const M = s((t) => [k, _, F, H, U, V, J].map((e) => e(t)).filter(Boolean), "generateHelp"), W = S$1.WriteStream.prototype.hasColors();
483
- class z {
531
+ o(ee, "getAliases");
532
+ const te = o((t) => [K, Z, G, Q, X, Y, ee].map((e) => e(t)).filter(Boolean), "generateHelp"), re = M$1.WriteStream.prototype.hasColors();
533
+ class ne {
484
534
  static {
485
- s(this, "Renderers");
535
+ o(this, "Renderers");
486
536
  }
487
537
  text(e) {
488
538
  return e;
489
539
  }
490
540
  bold(e) {
491
- return W ? `\x1B[1m${e}\x1B[22m` : e.toLocaleUpperCase();
541
+ return re ? `\x1B[1m${e}\x1B[22m` : e.toLocaleUpperCase();
492
542
  }
493
543
  indentText({ text: e, spaces: r }) {
494
544
  return e.replaceAll(/^/gm, " ".repeat(r));
@@ -496,13 +546,13 @@ class z {
496
546
  heading(e) {
497
547
  return this.bold(e);
498
548
  }
499
- section({ title: e, body: r, indentBody: n = 2 }) {
549
+ section({ title: e, body: r, indentBody: a = 2 }) {
500
550
  return `${(e ? `${this.heading(e)}
501
- ` : "") + (r ? this.indentText({ text: this.render(r), spaces: n }) : "")}
551
+ ` : "") + (r ? this.indentText({ text: this.render(r), spaces: a }) : "")}
502
552
  `;
503
553
  }
504
- table({ tableData: e, tableOptions: r, tableBreakpoints: n }) {
505
- return rD(e.map((a) => a.map((i) => this.render(i))), n ? AD(n) : r);
554
+ table({ tableData: e, tableOptions: r, tableBreakpoints: a }) {
555
+ return rD(e.map((n) => n.map((s) => this.render(s))), a ? AD(a) : r);
506
556
  }
507
557
  flagParameter(e) {
508
558
  return e === Boolean ? "" : e === String ? "<string>" : e === Number ? "<number>" : Array.isArray(e) ? this.flagParameter(e[0]) : "<value>";
@@ -511,14 +561,14 @@ class z {
511
561
  return " ";
512
562
  }
513
563
  flagName(e) {
514
- const { flag: r, flagFormatted: n, aliasesEnabled: a, aliasFormatted: i } = e;
515
- let o = "";
516
- if (i ? o += `${i}, ` : a && (o += " "), o += n, "placeholder" in r && typeof r.placeholder == "string") o += `${this.flagOperator(e)}${r.placeholder}`;
564
+ const { flag: r, flagFormatted: a, aliasesEnabled: n, aliasFormatted: s } = e;
565
+ let i = "";
566
+ if (s ? i += `${s}, ` : n && (i += " "), i += a, "placeholder" in r && typeof r.placeholder == "string") i += `${this.flagOperator(e)}${r.placeholder}`;
517
567
  else {
518
- const l = this.flagParameter("type" in r ? r.type : r);
519
- l && (o += `${this.flagOperator(e)}${l}`);
568
+ const d = this.flagParameter("type" in r ? r.type : r);
569
+ d && (i += `${this.flagOperator(e)}${d}`);
520
570
  }
521
- return o;
571
+ return i;
522
572
  }
523
573
  flagDefault(e) {
524
574
  return JSON.stringify(e);
@@ -526,8 +576,8 @@ class z {
526
576
  flagDescription({ flag: e }) {
527
577
  let r = "description" in e ? e.description ?? "" : "";
528
578
  if ("default" in e) {
529
- let { default: n } = e;
530
- typeof n == "function" && (n = n()), n && (r += ` (default: ${this.flagDefault(n)})`);
579
+ let { default: a } = e;
580
+ typeof a == "function" && (a = a()), a && (r += ` (default: ${this.flagDefault(a)})`);
531
581
  }
532
582
  return r;
533
583
  }
@@ -542,253 +592,131 @@ class z {
542
592
  throw new Error(`Invalid node type: ${JSON.stringify(e)}`);
543
593
  }
544
594
  }
545
- const $ = s((t) => t.length > 0 && !t.includes(" "), "isValidScriptName"), { stringify: f } = JSON, Z = /[|\\{}()[\]^$+*?.]/;
546
- function x(t) {
595
+ const O = o((t) => t.length > 0 && !t.includes(" "), "isValidScriptName"), { stringify: A } = JSON, ae = /[|\\{}()[\]^$+*?.]/;
596
+ function P(t) {
547
597
  const e = [];
548
- let r, n;
549
- for (const a of t) {
550
- if (n) throw new Error(`Invalid parameter: Spread parameter ${f(n)} must be last`);
551
- const i = a[0], o = a.at(-1);
552
- let l;
553
- if (i === "<" && o === ">" && (l = true, r)) throw new Error(`Invalid parameter: Required parameter ${f(a)} cannot come after optional parameter ${f(r)}`);
554
- if (i === "[" && o === "]" && (l = false, r = a), l === void 0) throw new Error(`Invalid parameter: ${f(a)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);
555
- let c = a.slice(1, -1);
556
- const m = c.slice(-3) === "...";
557
- m && (n = a, c = c.slice(0, -3));
558
- const u = c.match(Z);
559
- if (u) throw new Error(`Invalid parameter: ${f(a)}. Invalid character found ${f(u[0])}`);
560
- e.push({ name: c, required: l, spread: m });
598
+ let r, a;
599
+ for (const n of t) {
600
+ if (a) throw new Error(`Invalid parameter: Spread parameter ${A(a)} must be last`);
601
+ const s = n[0], i = n.at(-1);
602
+ let d;
603
+ if (s === "<" && i === ">" && (d = true, r)) throw new Error(`Invalid parameter: Required parameter ${A(n)} cannot come after optional parameter ${A(r)}`);
604
+ if (s === "[" && i === "]" && (d = false, r = n), d === void 0) throw new Error(`Invalid parameter: ${A(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);
605
+ let l = n.slice(1, -1);
606
+ const h = l.slice(-3) === "...";
607
+ h && (a = n, l = l.slice(0, -3));
608
+ const u = l.match(ae);
609
+ if (u) throw new Error(`Invalid parameter: ${A(n)}. Invalid character found ${A(u[0])}`);
610
+ e.push({ name: l, required: d, spread: h });
561
611
  }
562
612
  return e;
563
613
  }
564
- s(x, "parseParameters");
565
- function O(t, e, r, n) {
566
- for (let a = 0; a < e.length; a += 1) {
567
- const { name: i, required: o, spread: l } = e[a], c = R(i);
568
- if (c in t) throw new Error(`Invalid parameter: ${f(i)} is used more than once.`);
569
- const m = l ? r.slice(a) : r[a];
570
- if (l && (a = e.length), o && (!m || l && m.length === 0)) return console.error(`Error: Missing required parameter ${f(i)}
571
- `), n(), process.exit(1);
572
- t[c] = m;
614
+ o(P, "parseParameters");
615
+ function S(t, e, r, a) {
616
+ for (let n = 0; n < e.length; n += 1) {
617
+ const { name: s, required: i, spread: d } = e[n], l = V(s);
618
+ if (l in t) throw new Error(`Invalid parameter: ${A(s)} is used more than once.`);
619
+ const h = d ? r.slice(n) : r[n];
620
+ if (d && (n = e.length), i && (!h || d && h.length === 0)) return console.error(`Error: Missing required parameter ${A(s)}
621
+ `), a(), process.exit(1);
622
+ t[l] = h;
573
623
  }
574
624
  }
575
- s(O, "mapParametersToArguments");
576
- function G(t) {
625
+ o(S, "mapParametersToArguments");
626
+ function se(t) {
577
627
  return t !== false;
578
628
  }
579
- s(G, "helpEnabled");
580
- function j(t, e, r, n) {
581
- const a = { ...e.flags }, i = e.version && !("version" in a);
582
- i && (a.version = { type: Boolean, description: "Show version" });
583
- const { help: o } = e, l = G(o);
584
- l && !("help" in a) && (a.help = { type: Boolean, alias: "h", description: "Show help" });
585
- const c = z$2(a, n, { ignore: e.ignoreArgv }), m = s(() => {
629
+ o(se, "helpEnabled");
630
+ const ie = o((t) => {
631
+ const e = [];
632
+ for (const [r, a] of Object.entries(t)) if (e.push(r), a && typeof a == "object" && "alias" in a) {
633
+ const { alias: n } = a;
634
+ typeof n == "string" && n ? e.push(n) : Array.isArray(n) && e.push(...n.filter(Boolean));
635
+ }
636
+ return e;
637
+ }, "getKnownFlagNames"), oe = o((t, e) => {
638
+ if (t.length < 3 || e.length === 0) return;
639
+ const r = H(t, e);
640
+ return F(t, r) <= 2 ? r : void 0;
641
+ }, "findClosestFlag"), le = o((t, e) => {
642
+ const r = Object.keys(t);
643
+ if (r.length !== 0) {
644
+ for (const a of r) {
645
+ const n = oe(a, e), s = n ? ` (Did you mean --${n}?)` : "";
646
+ console.error(`Error: Unknown flag: --${a}.${s}`);
647
+ }
648
+ process.exit(1);
649
+ }
650
+ }, "handleUnknownFlags");
651
+ function I(t, e, r, a) {
652
+ const n = { ...e.flags }, s = e.version && !("version" in n);
653
+ s && (n.version = { type: Boolean, description: "Show version" });
654
+ const { help: i } = e, d = se(i);
655
+ d && !("help" in n) && (n.help = { type: Boolean, alias: "h", description: "Show help" });
656
+ const l = z$2(n, a, { ignore: e.ignoreArgv }), h = o(() => {
586
657
  console.log(e.version);
587
658
  }, "showVersion");
588
- if (i && c.flags.version === true) return m(), process.exit(0);
589
- const u = new z(), N = l && o?.render ? o.render : (d) => u.render(d), h = s((d) => {
590
- const p = M({ ...e, ...d ? { help: d } : {}, flags: a });
591
- console.log(N(p, u));
659
+ if (s && l.flags.version === true) return h(), process.exit(0);
660
+ const u = new ne(), C = d && i?.render ? i.render : (m) => u.render(m), $ = o((m) => {
661
+ const y = te({ ...e, ...m ? { help: m } : {}, flags: n });
662
+ console.log(C(y, u));
592
663
  }, "showHelp");
593
- if (l && c.flags.help === true) return h(), process.exit(0);
594
- if (e.parameters) {
595
- let { parameters: d } = e, p = c._;
596
- const g = d.indexOf("--"), y = d.slice(g + 1), w = /* @__PURE__ */ Object.create(null);
597
- let b = [];
598
- g > -1 && y.length > 0 && (d = d.slice(0, g), b = c._["--"], p = p.slice(0, -b.length || void 0)), O(w, x(d), p, h), g > -1 && y.length > 0 && O(w, x(y), b, h), Object.assign(c._, w);
599
- }
600
- const v = { ...c, showVersion: m, showHelp: h }, A = { command: t, ...v };
664
+ if (d && l.flags.help === true) return $(), process.exit(0);
665
+ if ((e.strictFlags ?? e.parent?.strictFlags) && le(l.unknownFlags, ie(n)), e.parameters) {
666
+ let { parameters: m } = e, y = l._;
667
+ const f = m.indexOf("--"), v = m.slice(f + 1), w = /* @__PURE__ */ Object.create(null);
668
+ let p = [];
669
+ f > -1 && v.length > 0 && (m = m.slice(0, f), p = l._["--"], y = y.slice(0, -p.length || void 0)), S(w, P(m), y, $), f > -1 && v.length > 0 && S(w, P(v), p, $), Object.assign(l._, w);
670
+ }
671
+ const c = { ...l, showVersion: h, showHelp: $ }, g = { command: t, ...c };
601
672
  if (typeof r == "function") {
602
- const d = r(v);
603
- if (d && "then" in d) return Object.assign(Promise.resolve(d), A);
673
+ const m = r(c);
674
+ if (m && "then" in m) return Object.assign(Promise.resolve(m), g);
604
675
  }
605
- return A;
676
+ return g;
606
677
  }
607
- s(j, "cliBase");
608
- function K(t, e) {
678
+ o(I, "cliBase");
679
+ function ce(t, e) {
609
680
  const r = /* @__PURE__ */ new Map();
610
- for (const n of e) {
611
- const a = [n.options.name], { alias: i } = n.options;
612
- i && (Array.isArray(i) ? a.push(...i) : a.push(i));
613
- for (const o of a) {
614
- if (r.has(o)) throw new Error(`Duplicate command name found: ${f(o)}`);
615
- r.set(o, n);
681
+ for (const a of e) {
682
+ const n = [a.options.name], { alias: s } = a.options;
683
+ s && (Array.isArray(s) ? n.push(...s) : n.push(s));
684
+ for (const i of n) {
685
+ if (r.has(i)) throw new Error(`Duplicate command name found: ${A(i)}`);
686
+ r.set(i, a);
616
687
  }
617
688
  }
618
689
  return r.get(t);
619
690
  }
620
- s(K, "getCommand");
621
- function Q(t, e, r = process.argv.slice(2)) {
691
+ o(ce, "getCommand");
692
+ function fe(t, e, r = process.argv.slice(2)) {
622
693
  if (!t) throw new Error("Options is required");
623
- if ("name" in t && (!t.name || !$(t.name))) throw new Error(`Invalid script name: ${f(t.name)}`);
624
- const n = r[0];
625
- if (t.commands && n && $(n)) {
626
- const a = K(n, t.commands);
627
- if (a) return j(a.options.name, { ...a.options, parent: t }, a.callback, r.slice(1));
694
+ if ("name" in t && (!t.name || !O(t.name))) throw new Error(`Invalid script name: ${A(t.name)}`);
695
+ const a = r[0];
696
+ if (t.commands && a && O(a)) {
697
+ const n = ce(a, t.commands);
698
+ if (n) return I(n.options.name, { ...n.options, parent: t }, n.callback, r.slice(1));
628
699
  }
629
- return j(void 0, t, e, r);
700
+ return I(void 0, t, e, r);
630
701
  }
631
- s(Q, "cli");
632
- function X(t, e) {
702
+ o(fe, "cli");
703
+ function de(t, e) {
633
704
  if (!t) throw new Error("Command options are required");
634
705
  const { name: r } = t;
635
706
  if (r === void 0) throw new Error("Command name is required");
636
- if (!$(r)) throw new Error(`Invalid command name ${JSON.stringify(r)}. Command names must be one word.`);
707
+ if (!O(r)) throw new Error(`Invalid command name ${JSON.stringify(r)}. Command names must be one word.`);
637
708
  return { options: t, callback: e };
638
709
  }
639
- s(X, "command");
640
-
641
- const peq = new Uint32Array(65536);
642
- const myers_32 = (a, b) => {
643
- const n = a.length;
644
- const m = b.length;
645
- const lst = 1 << n - 1;
646
- let pv = -1;
647
- let mv = 0;
648
- let sc = n;
649
- let i = n;
650
- while (i--) {
651
- peq[a.charCodeAt(i)] |= 1 << i;
652
- }
653
- for (i = 0; i < m; i++) {
654
- let eq = peq[b.charCodeAt(i)];
655
- const xv = eq | mv;
656
- eq |= (eq & pv) + pv ^ pv;
657
- mv |= ~(eq | pv);
658
- pv &= eq;
659
- if (mv & lst) {
660
- sc++;
661
- }
662
- if (pv & lst) {
663
- sc--;
664
- }
665
- mv = mv << 1 | 1;
666
- pv = pv << 1 | ~(xv | mv);
667
- mv &= xv;
668
- }
669
- i = n;
670
- while (i--) {
671
- peq[a.charCodeAt(i)] = 0;
672
- }
673
- return sc;
674
- };
675
- const myers_x = (b, a) => {
676
- const n = a.length;
677
- const m = b.length;
678
- const mhc = [];
679
- const phc = [];
680
- const hsize = Math.ceil(n / 32);
681
- const vsize = Math.ceil(m / 32);
682
- for (let i = 0; i < hsize; i++) {
683
- phc[i] = -1;
684
- mhc[i] = 0;
685
- }
686
- let j = 0;
687
- for (; j < vsize - 1; j++) {
688
- let mv2 = 0;
689
- let pv2 = -1;
690
- const start2 = j * 32;
691
- const vlen2 = Math.min(32, m) + start2;
692
- for (let k = start2; k < vlen2; k++) {
693
- peq[b.charCodeAt(k)] |= 1 << k;
694
- }
695
- for (let i = 0; i < n; i++) {
696
- const eq = peq[a.charCodeAt(i)];
697
- const pb = phc[i / 32 | 0] >>> i & 1;
698
- const mb = mhc[i / 32 | 0] >>> i & 1;
699
- const xv = eq | mv2;
700
- const xh = ((eq | mb) & pv2) + pv2 ^ pv2 | eq | mb;
701
- let ph = mv2 | ~(xh | pv2);
702
- let mh = pv2 & xh;
703
- if (ph >>> 31 ^ pb) {
704
- phc[i / 32 | 0] ^= 1 << i;
705
- }
706
- if (mh >>> 31 ^ mb) {
707
- mhc[i / 32 | 0] ^= 1 << i;
708
- }
709
- ph = ph << 1 | pb;
710
- mh = mh << 1 | mb;
711
- pv2 = mh | ~(xv | ph);
712
- mv2 = ph & xv;
713
- }
714
- for (let k = start2; k < vlen2; k++) {
715
- peq[b.charCodeAt(k)] = 0;
716
- }
717
- }
718
- let mv = 0;
719
- let pv = -1;
720
- const start = j * 32;
721
- const vlen = Math.min(32, m - start) + start;
722
- for (let k = start; k < vlen; k++) {
723
- peq[b.charCodeAt(k)] |= 1 << k;
724
- }
725
- let score = m;
726
- for (let i = 0; i < n; i++) {
727
- const eq = peq[a.charCodeAt(i)];
728
- const pb = phc[i / 32 | 0] >>> i & 1;
729
- const mb = mhc[i / 32 | 0] >>> i & 1;
730
- const xv = eq | mv;
731
- const xh = ((eq | mb) & pv) + pv ^ pv | eq | mb;
732
- let ph = mv | ~(xh | pv);
733
- let mh = pv & xh;
734
- score += ph >>> m - 1 & 1;
735
- score -= mh >>> m - 1 & 1;
736
- if (ph >>> 31 ^ pb) {
737
- phc[i / 32 | 0] ^= 1 << i;
738
- }
739
- if (mh >>> 31 ^ mb) {
740
- mhc[i / 32 | 0] ^= 1 << i;
741
- }
742
- ph = ph << 1 | pb;
743
- mh = mh << 1 | mb;
744
- pv = mh | ~(xv | ph);
745
- mv = ph & xv;
746
- }
747
- for (let k = start; k < vlen; k++) {
748
- peq[b.charCodeAt(k)] = 0;
749
- }
750
- return score;
751
- };
752
- const distance = (a, b) => {
753
- if (a.length < b.length) {
754
- const tmp = b;
755
- b = a;
756
- a = tmp;
757
- }
758
- if (b.length === 0) {
759
- return a.length;
760
- }
761
- if (a.length <= 32) {
762
- return myers_32(a, b);
763
- }
764
- return myers_x(a, b);
765
- };
766
- const closest = (str, arr) => {
767
- let min_distance = Infinity;
768
- let min_index = 0;
769
- for (let i = 0; i < arr.length; i++) {
770
- const dist = distance(str, arr[i]);
771
- if (dist < min_distance) {
772
- min_distance = dist;
773
- min_index = i;
774
- }
775
- }
776
- return arr[min_index];
777
- };
710
+ o(de, "command");
778
711
 
779
712
  var name = "poof";
780
- var version = "3.0.1";
713
+ var version = "3.1.0";
781
714
  var description = "Fast, non-blocking rm -rf alternative. Deletes files instantly while cleanup runs in the background.";
782
715
  var packageJson = {
783
716
  name: name,
784
717
  version: version,
785
718
  description: description};
786
719
 
787
- const knownFlags = ["dry", "verbose", "dangerous", "version", "help"];
788
- const findClosestFlag = (unknown) => {
789
- const match = closest(unknown, knownFlags);
790
- return distance(unknown, match) <= 2 ? match : void 0;
791
- };
792
720
  const friendlyMessages = {
793
721
  EBUSY: "Resource busy or locked",
794
722
  EPERM: "Operation not permitted",
@@ -801,7 +729,7 @@ const formatError = ({ error }) => {
801
729
  }
802
730
  return message;
803
731
  };
804
- const argv = Q({
732
+ const argv = fe({
805
733
  name: packageJson.name,
806
734
  version: packageJson.version,
807
735
  parameters: ["[globs...]"],
@@ -822,18 +750,15 @@ const argv = Q({
822
750
  dangerous: {
823
751
  type: Boolean,
824
752
  description: "Allow deleting paths outside current directory"
753
+ },
754
+ ignore: {
755
+ type: [String],
756
+ alias: "i",
757
+ description: "Glob pattern to exclude from deletion"
825
758
  }
826
- }
759
+ },
760
+ strictFlags: true
827
761
  });
828
- const unknownFlags = Object.keys(argv.unknownFlags);
829
- if (unknownFlags.length > 0) {
830
- for (const flag of unknownFlags) {
831
- const closestMatch = findClosestFlag(flag);
832
- const suggestion = closestMatch ? ` (Did you mean --${closestMatch}?)` : "";
833
- console.error(`Unknown flag: --${flag}.${suggestion}`);
834
- }
835
- process.exit(1);
836
- }
837
762
  (async () => {
838
763
  const { globs } = argv._;
839
764
  if (globs.length === 0) {
@@ -843,7 +768,8 @@ if (unknownFlags.length > 0) {
843
768
  const cwd = process.cwd();
844
769
  const { deleted, errors } = await poof(globs, {
845
770
  dry: argv.flags.dry,
846
- dangerous: argv.flags.dangerous
771
+ dangerous: argv.flags.dangerous,
772
+ ignore: argv.flags.ignore
847
773
  });
848
774
  if (deleted.length === 0 && errors.length === 0) {
849
775
  console.warn("No matches found");
package/dist/index.mjs CHANGED
@@ -1583,10 +1583,13 @@ const concurrentMap = async (items, concurrency, callback) => {
1583
1583
  await Promise.all(pending);
1584
1584
  };
1585
1585
 
1586
- const glob = async (root, globPattern, options) => {
1586
+ const glob = async (root, globPatterns, options) => {
1587
1587
  const includeDot = options?.dot ?? false;
1588
- const isMatch = picomatch(globPattern, { dot: includeDot });
1589
- const isRecursive = globPattern.includes("**");
1588
+ const ignorePatterns = options?.ignore;
1589
+ const isMatch = picomatch(globPatterns, { dot: includeDot });
1590
+ const shouldPrune = ignorePatterns?.length ? picomatch(ignorePatterns, { dot: true }) : void 0;
1591
+ const patterns = Array.isArray(globPatterns) ? globPatterns : [globPatterns];
1592
+ const isRecursive = patterns.some((p) => p.includes("**"));
1590
1593
  const results = [];
1591
1594
  const rootPrefix = root.length + 1;
1592
1595
  const crawl = async (directory) => {
@@ -1595,6 +1598,9 @@ const glob = async (root, globPattern, options) => {
1595
1598
  for (const entry of entries) {
1596
1599
  const fullPath = `${directory}/${entry.name}`;
1597
1600
  const relativePath = fullPath.slice(rootPrefix);
1601
+ if (shouldPrune?.(relativePath)) {
1602
+ continue;
1603
+ }
1598
1604
  if (isMatch(relativePath)) {
1599
1605
  results.push(fullPath);
1600
1606
  continue;
@@ -1632,10 +1638,14 @@ const validatePath = (target, cwd, dangerous) => {
1632
1638
  }
1633
1639
  }
1634
1640
  };
1635
- const resolvePatterns = async (patterns, cwd, dangerous = false) => {
1641
+ const needsDotMode = (globPattern) => /^\.[^\\/.]|[{,]\.[^\\/.]/.test(globPattern);
1642
+ const resolvePatterns = async (patterns, options) => {
1643
+ const { cwd, dangerous = false, ignore } = options;
1636
1644
  const files = [];
1637
1645
  const notFound = [];
1638
- await concurrentMap(patterns, GLOB_CONCURRENCY, async (pattern) => {
1646
+ const groups = /* @__PURE__ */ new Map();
1647
+ const explicitPaths = [];
1648
+ for (const pattern of patterns) {
1639
1649
  const posixPattern = toPosix(pattern);
1640
1650
  const fullPattern = path.isAbsolute(pattern) ? posixPattern : path.posix.join(toPosix(cwd), posixPattern);
1641
1651
  const scanned = picomatch.scan(fullPattern);
@@ -1643,30 +1653,57 @@ const resolvePatterns = async (patterns, cwd, dangerous = false) => {
1643
1653
  const pathToValidate = scanned.isGlob ? scanned.base || cwd : fullPattern;
1644
1654
  validatePath(pathToValidate, cwd, dangerous);
1645
1655
  if (!scanned.isGlob) {
1646
- await fs.access(fullPattern).then(
1647
- () => {
1648
- debug$2(`explicit path exists: ${fullPattern}`);
1649
- files.push(fullPattern);
1650
- },
1651
- () => {
1652
- debug$2(`explicit path not found: ${pattern}`);
1653
- notFound.push(pattern);
1654
- }
1655
- );
1656
- return;
1656
+ explicitPaths.push({
1657
+ fullPath: fullPattern,
1658
+ originalPattern: pattern
1659
+ });
1660
+ continue;
1657
1661
  }
1658
1662
  let root = scanned.base || toPosix(cwd);
1659
1663
  if (root.endsWith("/")) {
1660
1664
  root = root.slice(0, -1);
1661
1665
  }
1662
- const descendIntoDotDirectories = /^\.[^\\/.]|[{,]\.[^\\/.]/.test(scanned.glob);
1663
- const globStart = performance.now();
1664
- const matches = await glob(root, scanned.glob, { dot: descendIntoDotDirectories });
1665
- debug$2(`glob pattern=${pattern} files=${matches.length} time=${(performance.now() - globStart).toFixed(2)}ms`);
1666
- for (const match of matches) {
1667
- files.push(match);
1666
+ const group = groups.get(root);
1667
+ if (group) {
1668
+ group.globs.push(scanned.glob);
1669
+ group.needsDot = group.needsDot || needsDotMode(scanned.glob);
1670
+ } else {
1671
+ groups.set(root, {
1672
+ globs: [scanned.glob],
1673
+ needsDot: needsDotMode(scanned.glob)
1674
+ });
1668
1675
  }
1669
- });
1676
+ }
1677
+ await Promise.all([
1678
+ // Check explicit paths concurrently
1679
+ concurrentMap(explicitPaths, GLOB_CONCURRENCY, async ({ fullPath, originalPattern }) => {
1680
+ await fs.access(fullPath).then(
1681
+ () => {
1682
+ debug$2(`explicit path exists: ${fullPath}`);
1683
+ files.push(fullPath);
1684
+ },
1685
+ () => {
1686
+ debug$2(`explicit path not found: ${originalPattern}`);
1687
+ notFound.push(originalPattern);
1688
+ }
1689
+ );
1690
+ }),
1691
+ // Walk globs concurrently (one walk per unique root)
1692
+ concurrentMap([...groups.keys()], GLOB_CONCURRENCY, async (root) => {
1693
+ const group = groups.get(root);
1694
+ const globStart = performance.now();
1695
+ const matches = await glob(root, group.globs, {
1696
+ dot: group.needsDot,
1697
+ ignore
1698
+ });
1699
+ debug$2(
1700
+ `glob root=${root} patterns=${group.globs.length} matches=${matches.length} time=${(performance.now() - globStart).toFixed(2)}ms`
1701
+ );
1702
+ for (const match of matches) {
1703
+ files.push(match);
1704
+ }
1705
+ })
1706
+ ]);
1670
1707
  return {
1671
1708
  files,
1672
1709
  notFound
@@ -1747,14 +1784,35 @@ const withRetry = async (operation, shouldRetry) => {
1747
1784
 
1748
1785
  const debug = createDebug("poof:rename");
1749
1786
  const RENAME_CONCURRENCY = 100;
1787
+ const filterNestedPaths = (paths) => {
1788
+ if (paths.length === 0) {
1789
+ return [];
1790
+ }
1791
+ const sorted = paths.slice().sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
1792
+ const roots = [];
1793
+ let lastAccepted;
1794
+ for (const filePath of sorted) {
1795
+ if (lastAccepted && filePath.startsWith(`${lastAccepted}/`)) {
1796
+ continue;
1797
+ }
1798
+ roots.push(filePath);
1799
+ lastAccepted = filePath;
1800
+ }
1801
+ return roots;
1802
+ };
1750
1803
  const poof = async (patterns, options) => {
1751
1804
  const patternArray = Array.isArray(patterns) ? patterns : [patterns];
1752
1805
  const cwd = options?.cwd ?? process.cwd();
1753
1806
  debug(`patterns: ${JSON.stringify(patternArray)}, cwd: ${cwd}`);
1754
1807
  const resolveStart = performance.now();
1755
- const { files, notFound } = await resolvePatterns(patternArray, cwd, options?.dangerous ?? false);
1808
+ const { files, notFound } = await resolvePatterns(patternArray, {
1809
+ cwd,
1810
+ dangerous: options?.dangerous,
1811
+ ignore: options?.ignore
1812
+ });
1756
1813
  debug(`resolve files=${files.length} time=${(performance.now() - resolveStart).toFixed(2)}ms`);
1757
- const filesToDelete = files;
1814
+ const filesToDelete = filterNestedPaths(files);
1815
+ debug(`filtered ${files.length} -> ${filesToDelete.length} (removed ${files.length - filesToDelete.length} nested)`);
1758
1816
  const errors = notFound.map((pattern) => {
1759
1817
  const error = new Error(`Path not found: ${pattern}`);
1760
1818
  error.code = "ENOENT";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poof",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Fast, non-blocking rm -rf alternative. Deletes files instantly while cleanup runs in the background.",
5
5
  "keywords": [
6
6
  "rm",