zen-code 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,774 @@
1
+ import { b as X, a as o, p as cn, n as un, c as an, F as mn, j as w, T as D, u as _n, B, R as fn } from "./use-input-1eSjZocJ.mjs";
2
+ import P from "chalk";
3
+ import { g as dn } from "./_commonjsHelpers-ByX85dGu.mjs";
4
+ import Cn from "openai";
5
+ import Ln from "@anthropic-ai/sdk";
6
+ const hn = (s, t = {}) => {
7
+ const { stdin: c, setRawMode: i, internal_exitOnCtrlC: r, internal_eventEmitter: m } = X();
8
+ o.useEffect(() => {
9
+ if (t.isActive !== !1)
10
+ return i(!0), () => {
11
+ i(!1);
12
+ };
13
+ }, [t.isActive, i]), o.useEffect(() => {
14
+ if (t.isActive === !1)
15
+ return;
16
+ const C = (x) => {
17
+ const a = cn(x), L = {
18
+ upArrow: a.name === "up",
19
+ downArrow: a.name === "down",
20
+ leftArrow: a.name === "left",
21
+ rightArrow: a.name === "right",
22
+ pageDown: a.name === "pagedown",
23
+ pageUp: a.name === "pageup",
24
+ home: a.name === "home",
25
+ end: a.name === "end",
26
+ return: a.name === "return",
27
+ escape: a.name === "escape",
28
+ ctrl: a.ctrl,
29
+ shift: a.shift,
30
+ tab: a.name === "tab",
31
+ backspace: a.name === "backspace",
32
+ delete: a.name === "delete",
33
+ // `parseKeypress` parses \u001B\u001B[A (meta + up arrow) as meta = false
34
+ // but with option = true, so we need to take this into account here
35
+ // to avoid breaking changes in Ink.
36
+ // TODO(vadimdemedes): consider removing this in the next major version.
37
+ meta: a.meta || a.name === "escape" || a.option
38
+ };
39
+ let f = a.ctrl ? a.name : a.sequence;
40
+ un.includes(a.name) && (f = ""), f.startsWith("\x1B") && (f = f.slice(1)), f.length === 1 && typeof f[0] == "string" && /[A-Z]/.test(f[0]) && (L.shift = !0), (!(f === "c" && L.ctrl) || !r) && an.batchedUpdates(() => {
41
+ s(f, L);
42
+ });
43
+ };
44
+ return m?.on("input", C), () => {
45
+ m?.removeListener("input", C);
46
+ };
47
+ }, [t.isActive, c, r, s]);
48
+ }, y = ({ isActive: s = !0, autoFocus: t = !1, id: c } = {}) => {
49
+ const { isRawModeSupported: i, setRawMode: r } = X(), { activeId: m, add: C, remove: x, activate: a, deactivate: L, focus: f } = o.useContext(mn), h = o.useMemo(() => c ?? Math.random().toString().slice(2, 7), [c]);
50
+ return o.useEffect(() => (C(h, { autoFocus: t }), () => {
51
+ x(h);
52
+ }), [h, t]), o.useEffect(() => {
53
+ s ? a(h) : L(h);
54
+ }, [s, h]), o.useEffect(() => {
55
+ if (!(!i || !s))
56
+ return r(!0), () => {
57
+ r(!1);
58
+ };
59
+ }, [s]), {
60
+ isFocused: !!h && m === h,
61
+ focus: f
62
+ };
63
+ };
64
+ function v(s) {
65
+ if (s.length === 0)
66
+ return [""];
67
+ const t = s.replace(/\r\n/g, `
68
+ `).replace(/\r/g, `
69
+ `), c = t.split(`
70
+ `);
71
+ return t.endsWith(`
72
+ `) && c[c.length - 1] !== "" && c.push(""), c;
73
+ }
74
+ function G(s) {
75
+ return s.join(`
76
+ `);
77
+ }
78
+ function N(s, t, c) {
79
+ const i = s.length;
80
+ if (c === -1) {
81
+ if (t === 0) return 0;
82
+ let r = t - 1;
83
+ for (; r >= 0 && /\s/.test(s[r]); )
84
+ r--;
85
+ for (; r >= 0 && !/\s/.test(s[r]); )
86
+ r--;
87
+ const m = r + 1;
88
+ return Math.max(0, m);
89
+ } else {
90
+ if (t >= i) return i;
91
+ let r = t;
92
+ for (; r < i && /\s/.test(s[r]); )
93
+ r++;
94
+ for (; r < i && !/\s/.test(s[r]); )
95
+ r++;
96
+ return r;
97
+ }
98
+ }
99
+ function J(s) {
100
+ const t = v(s);
101
+ return {
102
+ lines: t,
103
+ cursorLine: t.length - 1,
104
+ cursorColumn: t[t.length - 1].length,
105
+ desiredColumn: null
106
+ };
107
+ }
108
+ function gn(s = "") {
109
+ const [t, c] = o.useState(() => J(s)), i = o.useRef(s);
110
+ o.useEffect(() => {
111
+ s !== i.current && (c((n) => {
112
+ const e = G(n.lines);
113
+ return s !== e ? J(s) : n;
114
+ }), i.current = s);
115
+ }, [s]), o.useCallback((n, e) => {
116
+ const u = Math.max(0, Math.min(n, t.lines.length - 1)), l = Math.max(0, Math.min(e, t.lines[u]?.length || 0));
117
+ return { line: u, column: l };
118
+ }, [t.lines]);
119
+ const r = o.useCallback(() => {
120
+ c((n) => {
121
+ if (n.cursorColumn > 0)
122
+ return { ...n, cursorColumn: n.cursorColumn - 1, desiredColumn: null };
123
+ if (n.cursorLine > 0) {
124
+ const e = n.lines[n.cursorLine - 1].length;
125
+ return {
126
+ ...n,
127
+ cursorLine: n.cursorLine - 1,
128
+ cursorColumn: e,
129
+ desiredColumn: null
130
+ };
131
+ }
132
+ return { ...n, desiredColumn: null };
133
+ });
134
+ }, []), m = o.useCallback(() => {
135
+ c((n) => n.cursorColumn < n.lines[n.cursorLine].length ? { ...n, cursorColumn: n.cursorColumn + 1, desiredColumn: null } : n.cursorLine < n.lines.length - 1 ? {
136
+ ...n,
137
+ cursorLine: n.cursorLine + 1,
138
+ cursorColumn: 0,
139
+ desiredColumn: null
140
+ } : { ...n, desiredColumn: null });
141
+ }, []), C = o.useCallback(() => {
142
+ c((n) => {
143
+ const e = n.cursorLine - 1, u = n.desiredColumn ?? n.cursorColumn;
144
+ if (e < 0)
145
+ return n.desiredColumn !== null ? { ...n, desiredColumn: u } : { ...n, desiredColumn: n.cursorColumn };
146
+ const l = Math.max(0, Math.min(e, n.lines.length - 1)), d = n.lines[l]?.length || 0, I = Math.min(u, d);
147
+ return {
148
+ ...n,
149
+ cursorLine: l,
150
+ cursorColumn: I,
151
+ desiredColumn: n.desiredColumn !== null ? n.desiredColumn : u
152
+ };
153
+ });
154
+ }, []), x = o.useCallback(() => {
155
+ c((n) => {
156
+ const e = n.cursorLine + 1, u = n.desiredColumn ?? n.cursorColumn;
157
+ if (e >= n.lines.length)
158
+ return n.desiredColumn !== null ? { ...n, desiredColumn: u } : { ...n, desiredColumn: n.cursorColumn };
159
+ const l = Math.max(0, Math.min(e, n.lines.length - 1)), d = n.lines[l]?.length || 0, I = Math.min(u, d);
160
+ return {
161
+ ...n,
162
+ cursorLine: l,
163
+ cursorColumn: I,
164
+ desiredColumn: n.desiredColumn !== null ? n.desiredColumn : u
165
+ };
166
+ });
167
+ }, []), a = o.useCallback(() => {
168
+ c((n) => {
169
+ if (n.cursorColumn > 0) {
170
+ const e = n.lines[n.cursorLine];
171
+ if (n.cursorColumn > 0 && !/\s/.test(e[n.cursorColumn]) && (n.cursorColumn === 0 || /\s/.test(e[n.cursorColumn - 1]))) {
172
+ const d = N(e, n.cursorColumn, -1);
173
+ return { ...n, cursorColumn: d, desiredColumn: null };
174
+ }
175
+ const l = N(e, n.cursorColumn, -1);
176
+ return { ...n, cursorColumn: l, desiredColumn: null };
177
+ } else if (n.cursorLine > 0) {
178
+ const e = n.lines[n.cursorLine - 1].length;
179
+ return {
180
+ ...n,
181
+ cursorLine: n.cursorLine - 1,
182
+ cursorColumn: e,
183
+ desiredColumn: null
184
+ };
185
+ }
186
+ return { ...n, desiredColumn: null };
187
+ });
188
+ }, []), L = o.useCallback(() => {
189
+ c((n) => {
190
+ if (n.cursorColumn < n.lines[n.cursorLine].length) {
191
+ const e = N(n.lines[n.cursorLine], n.cursorColumn, 1);
192
+ return { ...n, cursorColumn: e, desiredColumn: null };
193
+ } else if (n.cursorLine < n.lines.length - 1)
194
+ return {
195
+ ...n,
196
+ cursorLine: n.cursorLine + 1,
197
+ cursorColumn: 0,
198
+ desiredColumn: null
199
+ };
200
+ return { ...n, desiredColumn: null };
201
+ });
202
+ }, []), f = o.useCallback(() => {
203
+ c((n) => ({ ...n, cursorColumn: 0, desiredColumn: null }));
204
+ }, []), h = o.useCallback(() => {
205
+ c((n) => ({
206
+ ...n,
207
+ cursorColumn: n.lines[n.cursorLine].length,
208
+ desiredColumn: null
209
+ }));
210
+ }, []), j = o.useCallback((n) => {
211
+ c((e) => {
212
+ if (n === `
213
+ `) {
214
+ const I = e.lines[e.cursorLine], S = I.slice(0, e.cursorColumn), W = I.slice(e.cursorColumn), R = [...e.lines];
215
+ return R[e.cursorLine] = S, R.splice(e.cursorLine + 1, 0, W), {
216
+ ...e,
217
+ lines: R,
218
+ cursorLine: e.cursorLine + 1,
219
+ cursorColumn: 0,
220
+ desiredColumn: null
221
+ };
222
+ }
223
+ const u = e.lines[e.cursorLine], l = u.slice(0, e.cursorColumn) + n + u.slice(e.cursorColumn), d = [...e.lines];
224
+ return d[e.cursorLine] = l, {
225
+ ...e,
226
+ lines: d,
227
+ cursorColumn: e.cursorColumn + 1,
228
+ // Move after inserted char
229
+ desiredColumn: null
230
+ };
231
+ });
232
+ }, []), b = o.useCallback((n) => {
233
+ c((e) => {
234
+ if (n.includes(`
235
+ `) || n.includes("\r")) {
236
+ const l = v(n), d = e.lines[e.cursorLine], I = d.slice(0, e.cursorColumn), S = d.slice(e.cursorColumn), W = [
237
+ ...e.lines.slice(0, e.cursorLine),
238
+ I + l[0],
239
+ ...l.slice(1, -1),
240
+ l[l.length - 1] + S,
241
+ ...e.lines.slice(e.cursorLine + 1)
242
+ ], R = e.cursorLine + l.length - 1, q = l[l.length - 1].length;
243
+ return {
244
+ ...e,
245
+ lines: W,
246
+ cursorLine: R,
247
+ cursorColumn: q,
248
+ desiredColumn: null
249
+ };
250
+ } else {
251
+ const l = e.lines[e.cursorLine], d = l.slice(0, e.cursorColumn) + n + l.slice(e.cursorColumn), I = [...e.lines];
252
+ return I[e.cursorLine] = d, {
253
+ ...e,
254
+ lines: I,
255
+ cursorColumn: e.cursorColumn + n.length,
256
+ desiredColumn: null
257
+ };
258
+ }
259
+ });
260
+ }, []), E = o.useCallback(() => {
261
+ c((n) => {
262
+ const e = n.lines[n.cursorLine], u = e.slice(0, n.cursorColumn), l = e.slice(n.cursorColumn), d = [...n.lines];
263
+ return d[n.cursorLine] = u, d.splice(n.cursorLine + 1, 0, l), {
264
+ ...n,
265
+ lines: d,
266
+ cursorLine: n.cursorLine + 1,
267
+ cursorColumn: 0,
268
+ desiredColumn: null
269
+ };
270
+ });
271
+ }, []), g = o.useCallback(() => {
272
+ c((n) => {
273
+ if (n.cursorColumn > 0) {
274
+ const e = n.lines[n.cursorLine], u = e.slice(0, n.cursorColumn - 1) + e.slice(n.cursorColumn), l = [...n.lines];
275
+ return l[n.cursorLine] = u, {
276
+ ...n,
277
+ lines: l,
278
+ cursorColumn: n.cursorColumn - 1,
279
+ desiredColumn: null
280
+ };
281
+ } else if (n.cursorLine > 0) {
282
+ const e = n.lines[n.cursorLine - 1], u = n.lines[n.cursorLine], l = [...n.lines];
283
+ return l[n.cursorLine - 1] = e + u, l.splice(n.cursorLine, 1), {
284
+ ...n,
285
+ lines: l,
286
+ cursorLine: n.cursorLine - 1,
287
+ cursorColumn: e.length,
288
+ desiredColumn: null
289
+ };
290
+ }
291
+ return { ...n, desiredColumn: null };
292
+ });
293
+ }, []), A = o.useCallback(() => {
294
+ c((n) => {
295
+ const e = n.lines[n.cursorLine];
296
+ if (n.cursorColumn < e.length) {
297
+ const u = e.slice(0, n.cursorColumn) + e.slice(n.cursorColumn + 1), l = [...n.lines];
298
+ return l[n.cursorLine] = u, { ...n, lines: l, desiredColumn: null };
299
+ } else if (n.cursorLine < n.lines.length - 1) {
300
+ const u = n.lines[n.cursorLine + 1], l = [...n.lines];
301
+ return l[n.cursorLine] = e + u, l.splice(n.cursorLine + 1, 1), { ...n, lines: l, desiredColumn: null };
302
+ }
303
+ return { ...n, desiredColumn: null };
304
+ });
305
+ }, []), O = o.useCallback(() => {
306
+ c((n) => {
307
+ const e = n.lines[n.cursorLine];
308
+ if (n.cursorColumn > 0) {
309
+ const u = N(e, n.cursorColumn, -1);
310
+ if (u < n.cursorColumn) {
311
+ const l = e.slice(0, u) + e.slice(n.cursorColumn), d = [...n.lines];
312
+ return d[n.cursorLine] = l, {
313
+ ...n,
314
+ lines: d,
315
+ cursorColumn: u,
316
+ desiredColumn: null
317
+ };
318
+ }
319
+ return { ...n, desiredColumn: null };
320
+ } else if (n.cursorLine > 0) {
321
+ const u = n.lines[n.cursorLine - 1], l = [...n.lines];
322
+ return l[n.cursorLine - 1] = u + e, l.splice(n.cursorLine, 1), {
323
+ ...n,
324
+ lines: l,
325
+ cursorLine: n.cursorLine - 1,
326
+ cursorColumn: u.length,
327
+ desiredColumn: null
328
+ };
329
+ }
330
+ return { ...n, desiredColumn: null };
331
+ });
332
+ }, []), F = o.useCallback(() => {
333
+ c((n) => {
334
+ const e = n.lines[n.cursorLine];
335
+ if (n.cursorColumn < e.length) {
336
+ const u = N(e, n.cursorColumn, 1);
337
+ if (u > n.cursorColumn) {
338
+ const l = e.slice(0, n.cursorColumn) + e.slice(u), d = [...n.lines];
339
+ return d[n.cursorLine] = l, { ...n, lines: d, desiredColumn: null };
340
+ }
341
+ return { ...n, desiredColumn: null };
342
+ } else if (n.cursorLine < n.lines.length - 1) {
343
+ const u = n.lines[n.cursorLine + 1], l = [...n.lines];
344
+ return l[n.cursorLine] = e + u, l.splice(n.cursorLine + 1, 1), { ...n, lines: l, desiredColumn: null };
345
+ }
346
+ return { ...n, desiredColumn: null };
347
+ });
348
+ }, []);
349
+ return {
350
+ text: o.useMemo(() => G(t.lines), [t.lines]),
351
+ lines: t.lines,
352
+ cursorLine: t.cursorLine,
353
+ cursorColumn: t.cursorColumn,
354
+ moveLeft: r,
355
+ moveRight: m,
356
+ moveUp: C,
357
+ moveDown: x,
358
+ moveWordLeft: a,
359
+ moveWordRight: L,
360
+ moveToLineStart: f,
361
+ moveToLineEnd: h,
362
+ input: j,
363
+ insertText: b,
364
+ insertNewline: E,
365
+ backspace: g,
366
+ deleteChar: A,
367
+ backspaceWord: O,
368
+ deleteWord: F
369
+ };
370
+ }
371
+ function bn(s, t, c) {
372
+ const i = Math.max(0, t), r = Math.min(s, i + c);
373
+ return { start: i, end: r };
374
+ }
375
+ function wn(s, t, c, i) {
376
+ if (s < t)
377
+ return s;
378
+ const r = t + c - 1;
379
+ return s > r ? Math.max(0, s - c + 1) : t;
380
+ }
381
+ const xn = o.memo(function({
382
+ content: t,
383
+ lineNumber: c,
384
+ showCursor: i,
385
+ cursorColumn: r,
386
+ isFocused: m
387
+ }) {
388
+ const C = o.useMemo(() => {
389
+ if (!i || !m)
390
+ return t;
391
+ const x = Array.from(t);
392
+ let a = "", L = 0;
393
+ for (const f of x)
394
+ L === r ? a += P.inverse(f || " ") : a += f, L++;
395
+ return r >= x.length && (a += P.inverse(" ")), a;
396
+ }, [t, i, r, m]);
397
+ return /* @__PURE__ */ w.jsx(D, { children: C });
398
+ });
399
+ function Ls({
400
+ id: s,
401
+ placeholder: t = "",
402
+ autoFocus: c = !0,
403
+ showCursor: i = !0,
404
+ value: r,
405
+ onChange: m,
406
+ onSubmit: C,
407
+ onHotKey: x,
408
+ disabled: a = !1,
409
+ maxVisibleLines: L,
410
+ enableVirtualScroll: f = !0
411
+ }) {
412
+ const { isFocused: h } = y({ autoFocus: c, id: s }), j = o.useRef(!1), b = o.useRef(r), {
413
+ text: E,
414
+ lines: g,
415
+ cursorLine: A,
416
+ cursorColumn: O,
417
+ moveLeft: F,
418
+ moveRight: k,
419
+ moveUp: n,
420
+ moveDown: e,
421
+ moveWordLeft: u,
422
+ moveWordRight: l,
423
+ moveToLineStart: d,
424
+ moveToLineEnd: I,
425
+ input: S,
426
+ insertText: W,
427
+ insertNewline: R,
428
+ backspace: q,
429
+ deleteChar: Y,
430
+ backspaceWord: Q,
431
+ deleteWord: T
432
+ } = gn(r), U = o.useRef(0);
433
+ o.useEffect(() => {
434
+ r !== b.current && r !== E && (j.current = !0), b.current = r;
435
+ }, [r, E]), o.useEffect(() => {
436
+ if (j.current) {
437
+ j.current = !1;
438
+ return;
439
+ }
440
+ E !== r && m?.(E);
441
+ }, [E, m, r]);
442
+ const H = o.useMemo(() => L || Math.min(10, g.length), [L, g.length]);
443
+ o.useEffect(() => {
444
+ U.current = wn(
445
+ A,
446
+ U.current,
447
+ H,
448
+ g.length
449
+ );
450
+ }, [A, H, g.length]);
451
+ const { start: z, end: Z } = o.useMemo(
452
+ () => bn(g.length, U.current, H),
453
+ [g.length, U.current, H]
454
+ ), p = o.useCallback((M) => {
455
+ S(M);
456
+ }, [S]), nn = o.useCallback(() => {
457
+ R();
458
+ }, [R]), en = o.useCallback(() => {
459
+ q();
460
+ }, [q]), sn = o.useCallback(() => {
461
+ Y();
462
+ }, [Y]), tn = o.useCallback(() => {
463
+ Q();
464
+ }, [Q]), rn = o.useCallback(() => {
465
+ T();
466
+ }, [T]), ln = o.useCallback((M) => {
467
+ W(M);
468
+ }, [W]);
469
+ _n((M, _) => {
470
+ if (!(a || !h) && !(x && !x(M, _)) && !(_.ctrl && M === "c" || _.tab || _.shift && _.tab)) {
471
+ if (_.return) {
472
+ if (!_.ctrl && !_.alt) {
473
+ C?.(E);
474
+ return;
475
+ }
476
+ nn();
477
+ return;
478
+ }
479
+ if (_.leftArrow) {
480
+ if (!i) return;
481
+ _.ctrl || _.alt ? u() : F();
482
+ return;
483
+ }
484
+ if (_.rightArrow) {
485
+ if (!i) return;
486
+ _.ctrl || _.alt ? l() : k();
487
+ return;
488
+ }
489
+ if (_.upArrow) {
490
+ if (!i) return;
491
+ _.alt || _.ctrl ? d() : n();
492
+ return;
493
+ }
494
+ if (_.downArrow) {
495
+ if (!i) return;
496
+ _.alt || _.ctrl ? I() : e();
497
+ return;
498
+ }
499
+ if (_.ctrl && M === "a" || _.alt && _.leftArrow) {
500
+ if (!i) return;
501
+ d();
502
+ return;
503
+ }
504
+ if (_.ctrl && M === "e" || _.alt && _.rightArrow) {
505
+ if (!i) return;
506
+ I();
507
+ return;
508
+ }
509
+ if (_.backspace) {
510
+ _.ctrl || _.alt ? tn() : en();
511
+ return;
512
+ }
513
+ if (_.delete) {
514
+ _.ctrl || _.alt ? rn() : sn();
515
+ return;
516
+ }
517
+ M && (M.length > 1 || M.includes(`
518
+ `) ? ln(M) : p(M));
519
+ }
520
+ });
521
+ const on = o.useMemo(() => g.slice(z, Z), [g, z, Z]);
522
+ return g.length === 0 || g.every((M) => M.length === 0) ? !h || !i ? /* @__PURE__ */ w.jsx(D, { children: P.grey(t) }) : /* @__PURE__ */ w.jsx(D, { children: P.inverse(t[0] || " ") + P.grey(t.slice(1)) }) : /* @__PURE__ */ w.jsx(B, { flexDirection: "column", children: on.map((M, _) => {
523
+ const $ = z + _;
524
+ return /* @__PURE__ */ w.jsx(
525
+ xn,
526
+ {
527
+ content: M,
528
+ lineNumber: $,
529
+ showCursor: i && $ === A,
530
+ cursorColumn: O,
531
+ isFocused: h
532
+ },
533
+ $
534
+ );
535
+ }) });
536
+ }
537
+ const Mn = (s, t, c) => {
538
+ const i = parseInt(s.slice(1, 3), 16), r = parseInt(s.slice(3, 5), 16), m = parseInt(s.slice(5, 7), 16), C = parseInt(t.slice(1, 3), 16), x = parseInt(t.slice(3, 5), 16), a = parseInt(t.slice(5, 7), 16), L = Math.round(i + c * (C - i)), f = Math.round(r + c * (x - r)), h = Math.round(m + c * (a - m));
539
+ return `#${((1 << 24) + (L << 16) + (f << 8) + h).toString(16).slice(1).toUpperCase()}`;
540
+ }, hs = ({
541
+ text: s,
542
+ highlightColor: t = "#00FFFF",
543
+ // Cyan
544
+ baseColor: c = "#003333",
545
+ // Dark Cyan
546
+ interval: i = 20,
547
+ spread: r = 32,
548
+ globalIndex: m
549
+ }) => {
550
+ const [C, x] = o.useState(0), a = m !== void 0 ? m : C;
551
+ return o.useEffect(() => {
552
+ if (m !== void 0) return;
553
+ const L = setInterval(() => {
554
+ x((f) => (f + 1) % (s.length + r * 2));
555
+ }, i);
556
+ return () => clearInterval(L);
557
+ }, [s.length, r, i, m]), /* @__PURE__ */ w.jsx(D, { children: s.split("").map((L, f) => {
558
+ const h = a - r, j = Math.abs(f - h);
559
+ let b = c, E = !1;
560
+ if (j < r) {
561
+ const g = Math.cos(j / r * (Math.PI / 2)), A = Math.pow(g, 2);
562
+ b = Mn(c, t, A), E = j < 1;
563
+ }
564
+ return /* @__PURE__ */ w.jsx(D, { color: b, bold: E, children: L }, f);
565
+ }) });
566
+ }, En = ({ option: s, isSelected: t, isHighlighted: c, isFocused: i, isComponentDisabled: r }) => {
567
+ const m = !i || r;
568
+ let C = "white";
569
+ return s.disabled ? C = "gray" : t ? C = i ? "green" : "gray" : c && i ? C = "cyan" : m && (C = "gray"), /* @__PURE__ */ w.jsx(B, { children: /* @__PURE__ */ w.jsxs(D, { color: C, children: [
570
+ t ? "◉ " : "○ ",
571
+ s.label
572
+ ] }) });
573
+ }, In = ({ isSelected: s }) => /* @__PURE__ */ w.jsx(D, { color: s ? "green" : "gray", children: s ? "◉" : "○" }), jn = ({ values: s }) => /* @__PURE__ */ w.jsx(w.Fragment, {}), gs = ({
574
+ options: s,
575
+ values: t,
576
+ defaultValues: c = [],
577
+ onChange: i,
578
+ onSubmit: r,
579
+ disabled: m = !1,
580
+ highlightText: C,
581
+ itemComponent: x = En,
582
+ indicatorComponent: a = In,
583
+ statusComponent: L = jn,
584
+ autoFocus: f = !0,
585
+ singleSelect: h = !1
586
+ }) => {
587
+ const { isFocused: j } = y({ autoFocus: f }), [b, E] = o.useState(t || c), [g, A] = o.useState(0);
588
+ o.useEffect(() => {
589
+ t !== void 0 && E(t);
590
+ }, [t]);
591
+ const O = o.useCallback(
592
+ (n) => {
593
+ if (m || s[n].disabled) return;
594
+ const e = s[n];
595
+ let u;
596
+ h ? u = b.includes(e.value) ? [] : [e.value] : u = b.includes(e.value) ? b.filter((l) => l !== e.value) : [...b, e.value], E(u), i?.(u);
597
+ },
598
+ [b, s, m, i, h]
599
+ ), F = o.useCallback(() => {
600
+ if (!m) {
601
+ if (b.length === 0 && s.length > 0) {
602
+ const n = s[g];
603
+ if (n && !n.disabled) {
604
+ i?.([n.value]), r?.([n.value]);
605
+ return;
606
+ }
607
+ }
608
+ r?.(b);
609
+ }
610
+ }, [b, m, r, s, g]);
611
+ hn((n, e) => {
612
+ !j || m || (e.upArrow ? A((u) => Math.max(0, u - 1)) : e.downArrow ? A((u) => Math.min(s.length - 1, u + 1)) : e.return ? F() : n === " " && O(g));
613
+ });
614
+ const k = C ? s.filter(
615
+ (n) => n.label.toLowerCase().includes(C.toLowerCase()) || n.value.toLowerCase().includes(C.toLowerCase())
616
+ ) : s;
617
+ return /* @__PURE__ */ w.jsxs(B, { flexDirection: "column", children: [
618
+ /* @__PURE__ */ w.jsx(B, { marginBottom: 1, children: /* @__PURE__ */ w.jsx(L, { values: b }) }),
619
+ /* @__PURE__ */ w.jsx(B, { flexDirection: "column", children: k.map((n, e) => {
620
+ const u = b.includes(n.value), l = e === g;
621
+ return /* @__PURE__ */ w.jsx(B, { children: /* @__PURE__ */ w.jsx(
622
+ x,
623
+ {
624
+ option: n,
625
+ isSelected: u,
626
+ isHighlighted: l,
627
+ isFocused: j,
628
+ isComponentDisabled: m
629
+ }
630
+ ) }, n.value);
631
+ }) })
632
+ ] });
633
+ }, An = { interval: 80, frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"] }, Rn = { interval: 80, frames: ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"] }, Dn = { interval: 80, frames: ["⠋", "⠙", "⠚", "⠞", "⠖", "⠦", "⠴", "⠲", "⠳", "⠓"] }, Sn = { interval: 80, frames: ["⠄", "⠆", "⠇", "⠋", "⠙", "⠸", "⠰", "⠠", "⠰", "⠸", "⠙", "⠋", "⠇", "⠆"] }, Wn = { interval: 80, frames: ["⠋", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋"] }, Bn = { interval: 80, frames: ["⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠴", "⠲", "⠒", "⠂", "⠂", "⠒", "⠚", "⠙", "⠉", "⠁"] }, On = { interval: 80, frames: ["⠈", "⠉", "⠋", "⠓", "⠒", "⠐", "⠐", "⠒", "⠖", "⠦", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈"] }, Fn = { interval: 80, frames: ["⠁", "⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈", "⠈"] }, Nn = { interval: 80, frames: ["⢹", "⢺", "⢼", "⣸", "⣇", "⡧", "⡗", "⡏"] }, Pn = { interval: 80, frames: ["⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"] }, kn = { interval: 100, frames: ["⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"] }, qn = { interval: 80, frames: ["⢀⠀", "⡀⠀", "⠄⠀", "⢂⠀", "⡂⠀", "⠅⠀", "⢃⠀", "⡃⠀", "⠍⠀", "⢋⠀", "⡋⠀", "⠍⠁", "⢋⠁", "⡋⠁", "⠍⠉", "⠋⠉", "⠋⠉", "⠉⠙", "⠉⠙", "⠉⠩", "⠈⢙", "⠈⡙", "⢈⠩", "⡀⢙", "⠄⡙", "⢂⠩", "⡂⢘", "⠅⡘", "⢃⠨", "⡃⢐", "⠍⡐", "⢋⠠", "⡋⢀", "⠍⡁", "⢋⠁", "⡋⠁", "⠍⠉", "⠋⠉", "⠋⠉", "⠉⠙", "⠉⠙", "⠉⠩", "⠈⢙", "⠈⡙", "⠈⠩", "⠀⢙", "⠀⡙", "⠀⠩", "⠀⢘", "⠀⡘", "⠀⠨", "⠀⢐", "⠀⡐", "⠀⠠", "⠀⢀", "⠀⡀"] }, Un = { interval: 80, frames: ["⣼", "⣹", "⢻", "⠿", "⡟", "⣏", "⣧", "⣶"] }, Hn = { interval: 80, frames: ["⠀", "⠁", "⠂", "⠃", "⠄", "⠅", "⠆", "⠇", "⡀", "⡁", "⡂", "⡃", "⡄", "⡅", "⡆", "⡇", "⠈", "⠉", "⠊", "⠋", "⠌", "⠍", "⠎", "⠏", "⡈", "⡉", "⡊", "⡋", "⡌", "⡍", "⡎", "⡏", "⠐", "⠑", "⠒", "⠓", "⠔", "⠕", "⠖", "⠗", "⡐", "⡑", "⡒", "⡓", "⡔", "⡕", "⡖", "⡗", "⠘", "⠙", "⠚", "⠛", "⠜", "⠝", "⠞", "⠟", "⡘", "⡙", "⡚", "⡛", "⡜", "⡝", "⡞", "⡟", "⠠", "⠡", "⠢", "⠣", "⠤", "⠥", "⠦", "⠧", "⡠", "⡡", "⡢", "⡣", "⡤", "⡥", "⡦", "⡧", "⠨", "⠩", "⠪", "⠫", "⠬", "⠭", "⠮", "⠯", "⡨", "⡩", "⡪", "⡫", "⡬", "⡭", "⡮", "⡯", "⠰", "⠱", "⠲", "⠳", "⠴", "⠵", "⠶", "⠷", "⡰", "⡱", "⡲", "⡳", "⡴", "⡵", "⡶", "⡷", "⠸", "⠹", "⠺", "⠻", "⠼", "⠽", "⠾", "⠿", "⡸", "⡹", "⡺", "⡻", "⡼", "⡽", "⡾", "⡿", "⢀", "⢁", "⢂", "⢃", "⢄", "⢅", "⢆", "⢇", "⣀", "⣁", "⣂", "⣃", "⣄", "⣅", "⣆", "⣇", "⢈", "⢉", "⢊", "⢋", "⢌", "⢍", "⢎", "⢏", "⣈", "⣉", "⣊", "⣋", "⣌", "⣍", "⣎", "⣏", "⢐", "⢑", "⢒", "⢓", "⢔", "⢕", "⢖", "⢗", "⣐", "⣑", "⣒", "⣓", "⣔", "⣕", "⣖", "⣗", "⢘", "⢙", "⢚", "⢛", "⢜", "⢝", "⢞", "⢟", "⣘", "⣙", "⣚", "⣛", "⣜", "⣝", "⣞", "⣟", "⢠", "⢡", "⢢", "⢣", "⢤", "⢥", "⢦", "⢧", "⣠", "⣡", "⣢", "⣣", "⣤", "⣥", "⣦", "⣧", "⢨", "⢩", "⢪", "⢫", "⢬", "⢭", "⢮", "⢯", "⣨", "⣩", "⣪", "⣫", "⣬", "⣭", "⣮", "⣯", "⢰", "⢱", "⢲", "⢳", "⢴", "⢵", "⢶", "⢷", "⣰", "⣱", "⣲", "⣳", "⣴", "⣵", "⣶", "⣷", "⢸", "⢹", "⢺", "⢻", "⢼", "⢽", "⢾", "⢿", "⣸", "⣹", "⣺", "⣻", "⣼", "⣽", "⣾", "⣿"] }, $n = { interval: 80, frames: ["⠁", "⠂", "⠄", "⡀", "⡈", "⡐", "⡠", "⣀", "⣁", "⣂", "⣄", "⣌", "⣔", "⣤", "⣥", "⣦", "⣮", "⣶", "⣷", "⣿", "⡿", "⠿", "⢟", "⠟", "⡛", "⠛", "⠫", "⢋", "⠋", "⠍", "⡉", "⠉", "⠑", "⠡", "⢁"] }, zn = { interval: 130, frames: ["-", "\\", "|", "/"] }, Kn = { interval: 100, frames: ["⠂", "-", "–", "—", "–", "-"] }, Yn = { interval: 100, frames: ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"] }, Qn = { interval: 400, frames: [". ", ".. ", "...", " "] }, Tn = { interval: 200, frames: [". ", ".. ", "...", " ..", " .", " "] }, Zn = { interval: 70, frames: ["✶", "✸", "✹", "✺", "✹", "✷"] }, Gn = { interval: 80, frames: ["+", "x", "*"] }, Jn = { interval: 70, frames: ["_", "_", "_", "-", "`", "`", "'", "´", "-", "_", "_", "_"] }, Vn = { interval: 100, frames: ["☱", "☲", "☴"] }, Xn = { interval: 120, frames: ["▁", "▃", "▄", "▅", "▆", "▇", "▆", "▅", "▄", "▃"] }, yn = { interval: 120, frames: ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "▊", "▋", "▌", "▍", "▎"] }, vn = { interval: 140, frames: [" ", ".", "o", "O", "@", "*", " "] }, pn = { interval: 120, frames: [".", "o", "O", "°", "O", "o", "."] }, ne = { interval: 100, frames: ["▓", "▒", "░"] }, ee = { interval: 120, frames: ["⠁", "⠂", "⠄", "⠂"] }, se = { interval: 120, frames: ["▖", "▘", "▝", "▗"] }, te = { interval: 100, frames: ["▌", "▀", "▐", "▄"] }, re = { interval: 50, frames: ["◢", "◣", "◤", "◥"] }, le = { interval: 80, frames: ["010010", "001100", "100101", "111010", "111101", "010111", "101011", "111000", "110011", "110101"] }, oe = { interval: 100, frames: ["◜", "◠", "◝", "◞", "◡", "◟"] }, ce = { interval: 120, frames: ["◡", "⊙", "◠"] }, ie = { interval: 180, frames: ["◰", "◳", "◲", "◱"] }, ue = { interval: 120, frames: ["◴", "◷", "◶", "◵"] }, ae = { interval: 50, frames: ["◐", "◓", "◑", "◒"] }, me = { interval: 100, frames: ["╫", "╪"] }, _e = { interval: 250, frames: ["⊶", "⊷"] }, fe = { interval: 80, frames: ["▫", "▪"] }, de = { interval: 120, frames: ["□", "■"] }, Ce = { interval: 100, frames: ["■", "□", "▪", "▫"] }, Le = { interval: 100, frames: ["▮", "▯"] }, he = { interval: 300, frames: ["ဝ", "၀"] }, ge = { interval: 80, frames: ["⦾", "⦿"] }, be = { interval: 100, frames: ["◍", "◌"] }, we = { interval: 100, frames: ["◉", "◎"] }, xe = { interval: 100, frames: ["㊂", "㊀", "㊁"] }, Me = { interval: 50, frames: ["⧇", "⧆"] }, Ee = { interval: 120, frames: ["☗", "☖"] }, Ie = { interval: 80, frames: ["=", "*", "-"] }, je = { interval: 100, frames: ["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"] }, Ae = { interval: 80, frames: ["⬆️ ", "↗️ ", "➡️ ", "↘️ ", "⬇️ ", "↙️ ", "⬅️ ", "↖️ "] }, Re = { interval: 120, frames: ["▹▹▹▹▹", "▸▹▹▹▹", "▹▸▹▹▹", "▹▹▸▹▹", "▹▹▹▸▹", "▹▹▹▹▸"] }, De = { interval: 80, frames: ["[ ]", "[= ]", "[== ]", "[=== ]", "[====]", "[ ===]", "[ ==]", "[ =]", "[ ]", "[ =]", "[ ==]", "[ ===]", "[====]", "[=== ]", "[== ]", "[= ]"] }, Se = { interval: 80, frames: ["( ● )", "( ● )", "( ● )", "( ● )", "( ●)", "( ● )", "( ● )", "( ● )", "( ● )", "(● )"] }, We = { interval: 200, frames: ["😄 ", "😝 "] }, Be = { interval: 300, frames: ["🙈 ", "🙈 ", "🙉 ", "🙊 "] }, Oe = { interval: 100, frames: ["💛 ", "💙 ", "💜 ", "💚 ", "❤️ "] }, Fe = { interval: 100, frames: ["🕛 ", "🕐 ", "🕑 ", "🕒 ", "🕓 ", "🕔 ", "🕕 ", "🕖 ", "🕗 ", "🕘 ", "🕙 ", "🕚 "] }, Ne = { interval: 180, frames: ["🌍 ", "🌎 ", "🌏 "] }, Pe = { interval: 17, frames: ["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "███████▁▁▁▁▁▁▁▁▁▁▁▁▁", "████████▁▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "██████████▁▁▁▁▁▁▁▁▁▁", "███████████▁▁▁▁▁▁▁▁▁", "█████████████▁▁▁▁▁▁▁", "██████████████▁▁▁▁▁▁", "██████████████▁▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁▁██████████████▁▁▁▁", "▁▁▁██████████████▁▁▁", "▁▁▁▁█████████████▁▁▁", "▁▁▁▁██████████████▁▁", "▁▁▁▁██████████████▁▁", "▁▁▁▁▁██████████████▁", "▁▁▁▁▁██████████████▁", "▁▁▁▁▁██████████████▁", "▁▁▁▁▁▁██████████████", "▁▁▁▁▁▁██████████████", "▁▁▁▁▁▁▁█████████████", "▁▁▁▁▁▁▁█████████████", "▁▁▁▁▁▁▁▁████████████", "▁▁▁▁▁▁▁▁████████████", "▁▁▁▁▁▁▁▁▁███████████", "▁▁▁▁▁▁▁▁▁███████████", "▁▁▁▁▁▁▁▁▁▁██████████", "▁▁▁▁▁▁▁▁▁▁██████████", "▁▁▁▁▁▁▁▁▁▁▁▁████████", "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", "█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", "█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "██████▁▁▁▁▁▁▁▁▁▁▁▁▁█", "████████▁▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "█████████▁▁▁▁▁▁▁▁▁▁▁", "███████████▁▁▁▁▁▁▁▁▁", "████████████▁▁▁▁▁▁▁▁", "████████████▁▁▁▁▁▁▁▁", "██████████████▁▁▁▁▁▁", "██████████████▁▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁██████████████▁▁▁▁▁", "▁▁▁█████████████▁▁▁▁", "▁▁▁▁▁████████████▁▁▁", "▁▁▁▁▁████████████▁▁▁", "▁▁▁▁▁▁███████████▁▁▁", "▁▁▁▁▁▁▁▁█████████▁▁▁", "▁▁▁▁▁▁▁▁█████████▁▁▁", "▁▁▁▁▁▁▁▁▁█████████▁▁", "▁▁▁▁▁▁▁▁▁█████████▁▁", "▁▁▁▁▁▁▁▁▁▁█████████▁", "▁▁▁▁▁▁▁▁▁▁▁████████▁", "▁▁▁▁▁▁▁▁▁▁▁████████▁", "▁▁▁▁▁▁▁▁▁▁▁▁███████▁", "▁▁▁▁▁▁▁▁▁▁▁▁███████▁", "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"] }, ke = { interval: 80, frames: ["🌑 ", "🌒 ", "🌓 ", "🌔 ", "🌕 ", "🌖 ", "🌗 ", "🌘 "] }, qe = { interval: 140, frames: ["🚶 ", "🏃 "] }, Ue = { interval: 80, frames: ["▐⠂ ▌", "▐⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂▌", "▐ ⠠▌", "▐ ⡀▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐⠠ ▌"] }, He = { interval: 120, frames: ["▐|\\____________▌", "▐_|\\___________▌", "▐__|\\__________▌", "▐___|\\_________▌", "▐____|\\________▌", "▐_____|\\_______▌", "▐______|\\______▌", "▐_______|\\_____▌", "▐________|\\____▌", "▐_________|\\___▌", "▐__________|\\__▌", "▐___________|\\_▌", "▐____________|\\▌", "▐____________/|▌", "▐___________/|_▌", "▐__________/|__▌", "▐_________/|___▌", "▐________/|____▌", "▐_______/|_____▌", "▐______/|______▌", "▐_____/|_______▌", "▐____/|________▌", "▐___/|_________▌", "▐__/|__________▌", "▐_/|___________▌", "▐/|____________▌"] }, $e = { interval: 100, frames: ["d", "q", "p", "b"] }, ze = { interval: 100, frames: ["☀️ ", "☀️ ", "☀️ ", "🌤 ", "⛅️ ", "🌥 ", "☁️ ", "🌧 ", "🌨 ", "🌧 ", "🌨 ", "🌧 ", "🌨 ", "⛈ ", "🌨 ", "🌧 ", "🌨 ", "☁️ ", "🌥 ", "⛅️ ", "🌤 ", "☀️ ", "☀️ "] }, Ke = { interval: 400, frames: ["🌲", "🎄"] }, Ye = { interval: 80, frames: ["، ", "′ ", " ´ ", " ‾ ", " ⸌", " ⸊", " |", " ⁎", " ⁕", " ෴ ", " ⁓", " ", " ", " "] }, Qe = { interval: 125, frames: ["∙∙∙", "●∙∙", "∙●∙", "∙∙●", "∙∙∙"] }, Te = { interval: 150, frames: ["-", "=", "≡"] }, Ze = { interval: 80, frames: ["ρββββββ", "βρβββββ", "ββρββββ", "βββρβββ", "ββββρββ", "βββββρβ", "ββββββρ"] }, Ge = { interval: 160, frames: ["🤘 ", "🤟 ", "🖖 ", "✋ ", "🤚 ", "👆 "] }, Je = { interval: 80, frames: ["🤜    🤛 ", "🤜    🤛 ", "🤜    🤛 ", " 🤜  🤛  ", "  🤜🤛   ", " 🤜✨🤛   ", "🤜 ✨ 🤛  "] }, Ve = { interval: 80, frames: [" 🧑⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 ", "🧑 ⚽️ 🧑 "] }, Xe = { interval: 160, frames: ["😐 ", "😐 ", "😮 ", "😮 ", "😦 ", "😦 ", "😧 ", "😧 ", "🤯 ", "💥 ", "✨ ", "  ", "  ", "  "] }, ye = { interval: 160, frames: ["🔈 ", "🔉 ", "🔊 ", "🔉 "] }, ve = { interval: 100, frames: ["🔸 ", "🔶 ", "🟠 ", "🟠 ", "🔶 "] }, pe = { interval: 100, frames: ["🔹 ", "🔷 ", "🔵 ", "🔵 ", "🔷 "] }, ns = { interval: 100, frames: ["🔸 ", "🔶 ", "🟠 ", "🟠 ", "🔶 ", "🔹 ", "🔷 ", "🔵 ", "🔵 ", "🔷 "] }, es = { interval: 100, frames: ["🕛 ", "🕚 ", "🕙 ", "🕘 ", "🕗 ", "🕖 ", "🕕 ", "🕔 ", "🕓 ", "🕒 ", "🕑 ", "🕐 "] }, ss = { interval: 80, frames: ["▰▱▱▱▱▱▱", "▰▰▱▱▱▱▱", "▰▰▰▱▱▱▱", "▰▰▰▰▱▱▱", "▰▰▰▰▰▱▱", "▰▰▰▰▰▰▱", "▰▰▰▰▰▰▰", "▰▱▱▱▱▱▱"] }, ts = { interval: 80, frames: [" ██████£££ ", "☺██████£££ ", "☺██████£££ ", "☺▓█████£££ ", "☺▓█████£££ ", "☺▒█████£££ ", "☺▒█████£££ ", "☺░█████£££ ", "☺░█████£££ ", "☺ █████£££ ", " ☺█████£££ ", " ☺█████£££ ", " ☺▓████£££ ", " ☺▓████£££ ", " ☺▒████£££ ", " ☺▒████£££ ", " ☺░████£££ ", " ☺░████£££ ", " ☺ ████£££ ", " ☺████£££ ", " ☺████£££ ", " ☺▓███£££ ", " ☺▓███£££ ", " ☺▒███£££ ", " ☺▒███£££ ", " ☺░███£££ ", " ☺░███£££ ", " ☺ ███£££ ", " ☺███£££ ", " ☺███£££ ", " ☺▓██£££ ", " ☺▓██£££ ", " ☺▒██£££ ", " ☺▒██£££ ", " ☺░██£££ ", " ☺░██£££ ", " ☺ ██£££ ", " ☺██£££ ", " ☺██£££ ", " ☺▓█£££ ", " ☺▓█£££ ", " ☺▒█£££ ", " ☺▒█£££ ", " ☺░█£££ ", " ☺░█£££ ", " ☺ █£££ ", " ☺█£££ ", " ☺█£££ ", " ☺▓£££ ", " ☺▓£££ ", " ☺▒£££ ", " ☺▒£££ ", " ☺░£££ ", " ☺░£££ ", " ☺ £££ ", " ☺£££ ", " ☺£££ ", " ☺▓££ ", " ☺▓££ ", " ☺▒££ ", " ☺▒££ ", " ☺░££ ", " ☺░££ ", " ☺ ££ ", " ☺££ ", " ☺££ ", " ☺▓£ ", " ☺▓£ ", " ☺▒£ ", " ☺▒£ ", " ☺░£ ", " ☺░£ ", " ☺ £ ", " ☺£ ", " ☺£ ", " ☺▓ ", " ☺▓ ", " ☺▒ ", " ☺▒ ", " ☺░ ", " ☺░ ", " ☺ ", " ☺ &", " ☺ ☼&", " ☺ ☼ &", " ☺☼ &", " ☺☼ & ", " ‼ & ", " ☺ & ", " ‼ & ", " ☺ & ", " ‼ & ", " ☺ & ", "‼ & ", " & ", " & ", " & ░ ", " & ▒ ", " & ▓ ", " & £ ", " & ░£ ", " & ▒£ ", " & ▓£ ", " & ££ ", " & ░££ ", " & ▒££ ", "& ▓££ ", "& £££ ", " ░£££ ", " ▒£££ ", " ▓£££ ", " █£££ ", " ░█£££ ", " ▒█£££ ", " ▓█£££ ", " ██£££ ", " ░██£££ ", " ▒██£££ ", " ▓██£££ ", " ███£££ ", " ░███£££ ", " ▒███£££ ", " ▓███£££ ", " ████£££ ", " ░████£££ ", " ▒████£££ ", " ▓████£££ ", " █████£££ ", " ░█████£££ ", " ▒█████£££ ", " ▓█████£££ ", " ██████£££ ", " ██████£££ "] }, rs = {
634
+ dots: An,
635
+ dots2: Rn,
636
+ dots3: Dn,
637
+ dots4: Sn,
638
+ dots5: Wn,
639
+ dots6: Bn,
640
+ dots7: On,
641
+ dots8: Fn,
642
+ dots9: Nn,
643
+ dots10: Pn,
644
+ dots11: kn,
645
+ dots12: qn,
646
+ dots13: Un,
647
+ dots8Bit: Hn,
648
+ sand: $n,
649
+ line: zn,
650
+ line2: Kn,
651
+ pipe: Yn,
652
+ simpleDots: Qn,
653
+ simpleDotsScrolling: Tn,
654
+ star: Zn,
655
+ star2: Gn,
656
+ flip: Jn,
657
+ hamburger: Vn,
658
+ growVertical: Xn,
659
+ growHorizontal: yn,
660
+ balloon: vn,
661
+ balloon2: pn,
662
+ noise: ne,
663
+ bounce: ee,
664
+ boxBounce: se,
665
+ boxBounce2: te,
666
+ triangle: re,
667
+ binary: le,
668
+ arc: oe,
669
+ circle: ce,
670
+ squareCorners: ie,
671
+ circleQuarters: ue,
672
+ circleHalves: ae,
673
+ squish: me,
674
+ toggle: _e,
675
+ toggle2: fe,
676
+ toggle3: de,
677
+ toggle4: Ce,
678
+ toggle5: Le,
679
+ toggle6: he,
680
+ toggle7: ge,
681
+ toggle8: be,
682
+ toggle9: we,
683
+ toggle10: xe,
684
+ toggle11: Me,
685
+ toggle12: Ee,
686
+ toggle13: Ie,
687
+ arrow: je,
688
+ arrow2: Ae,
689
+ arrow3: Re,
690
+ bouncingBar: De,
691
+ bouncingBall: Se,
692
+ smiley: We,
693
+ monkey: Be,
694
+ hearts: Oe,
695
+ clock: Fe,
696
+ earth: Ne,
697
+ material: Pe,
698
+ moon: ke,
699
+ runner: qe,
700
+ pong: Ue,
701
+ shark: He,
702
+ dqpb: $e,
703
+ weather: ze,
704
+ christmas: Ke,
705
+ grenade: Ye,
706
+ point: Qe,
707
+ layer: Te,
708
+ betaWave: Ze,
709
+ fingerDance: Ge,
710
+ fistBump: Je,
711
+ soccerHeader: Ve,
712
+ mindblown: Xe,
713
+ speaker: ye,
714
+ orangePulse: ve,
715
+ bluePulse: pe,
716
+ orangeBluePulse: ns,
717
+ timeTravel: es,
718
+ aesthetic: ss,
719
+ dwarfFortress: ts
720
+ };
721
+ var K, V;
722
+ function ls() {
723
+ if (V) return K;
724
+ V = 1;
725
+ const s = Object.assign({}, rs), t = Object.keys(s);
726
+ return Object.defineProperty(s, "random", {
727
+ get() {
728
+ const c = Math.floor(Math.random() * t.length), i = t[c];
729
+ return s[i];
730
+ }
731
+ }), K = s, K;
732
+ }
733
+ var os = ls();
734
+ const cs = /* @__PURE__ */ dn(os);
735
+ function bs({ type: s = "dots" }) {
736
+ const [t, c] = o.useState(0), i = cs[s];
737
+ return o.useEffect(() => {
738
+ const r = setInterval(() => {
739
+ c((m) => m === i.frames.length - 1 ? 0 : m + 1);
740
+ }, i.interval);
741
+ return () => {
742
+ clearInterval(r);
743
+ };
744
+ }, [i]), fn.createElement(D, null, i.frames[t]);
745
+ }
746
+ const is = async () => {
747
+ if (!process.env.ANTHROPIC_API_KEY) return [];
748
+ let s = [];
749
+ for await (const t of new Ln().beta.models.list())
750
+ s.push({
751
+ id: t.id,
752
+ name: t.display_name,
753
+ provider: "anthropic"
754
+ });
755
+ return s;
756
+ }, us = async () => process.env.OPENAI_API_KEY ? new Cn().models.list().then(
757
+ (s) => s.data.map((t) => ({
758
+ id: t.id,
759
+ name: t.id,
760
+ provider: "openai"
761
+ })).sort((t, c) => t.id.localeCompare(c.id))
762
+ ) : [], ws = async () => Promise.all([
763
+ is().catch((s) => (console.log(s), [])),
764
+ us().catch((s) => (console.log(s), []))
765
+ ]).then((s) => s.flat());
766
+ export {
767
+ gs as M,
768
+ hs as S,
769
+ Ls as a,
770
+ bs as b,
771
+ y as c,
772
+ ws as g,
773
+ hn as u
774
+ };