@versini/sassysaint 5.5.9 → 5.5.11

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,3438 @@
1
+ import { jsxs as k, jsx as l, Fragment as Y } from "react/jsx-runtime";
2
+ import { g as me, ACTION_RESTORE as At, ACTION_MESSAGE as q, ROLE_ASSISTANT as K, ACTION_RESET as qe, ACTION_MODEL as Ke, ACTION_ENGINE as Je, ACTION_STREAMING as Qe, ACTION_SORT as zt, ACTION_SEARCH as Mt, ACTION_SET_TAGS as Xe, ACTION_RESET_TAGS as Ye, ACTION_TOGGLE_TAG as Ze, DEFAULT_AI_ENGINE as V, P as et, un as Z, ROLE_SYSTEM as Lt, ROLE_INTERNAL as he, ROLE_HIDDEN as Ot, STATS_SEPARATOR as Be, CLIPBOARD_TAG as Ae, TYPE_QUESTION as Vt, C as tt, SEND as Ut, ERROR_MESSAGE as Ht, ROLE_USER as le, L as Pt, j as Dt, isLastMessageFromRole as Gt, getMessageContaintWrapperClass as Ft, Logo as Wt, getMainPaddingClass as ze, r as jt, LOCAL_STORAGE_PREFIX as Me, LOCAL_STORAGE_SEARCH as qt, LOCAL_STORAGE_SORT as Kt } from "./index.CTyCRIB4.js";
3
+ import i from "clsx";
4
+ import I, { useRef as v, useEffect as x, useCallback as U, useSyncExternalStore as Jt, useState as S, useMemo as pe, useContext as $, useLayoutEffect as P, useId as Qt, useReducer as Q, lazy as rt, Suspense as ce } from "react";
5
+ const Xt = ({
6
+ className: e,
7
+ viewBox: t,
8
+ title: r,
9
+ monotone: a,
10
+ ...o
11
+ }) => /* @__PURE__ */ k(
12
+ me,
13
+ {
14
+ defaultViewBox: "0 0 448 512",
15
+ size: "size-5",
16
+ viewBox: t,
17
+ className: e,
18
+ title: r || "Add",
19
+ ...o,
20
+ children: [
21
+ /* @__PURE__ */ l(
22
+ "path",
23
+ {
24
+ opacity: a ? "1" : "0.4",
25
+ d: "M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"
26
+ }
27
+ ),
28
+ /* @__PURE__ */ l("path", { d: "" })
29
+ ]
30
+ }
31
+ ), Yt = ({
32
+ className: e,
33
+ viewBox: t,
34
+ title: r,
35
+ monotone: a,
36
+ ...o
37
+ }) => /* @__PURE__ */ l(
38
+ me,
39
+ {
40
+ defaultViewBox: "0 0 384 512",
41
+ size: "size-5",
42
+ viewBox: t,
43
+ className: e,
44
+ title: r || "Close",
45
+ ...o,
46
+ children: /* @__PURE__ */ l("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4z" })
47
+ }
48
+ ), Zt = ({
49
+ className: e,
50
+ viewBox: t,
51
+ title: r,
52
+ monotone: a,
53
+ ...o
54
+ }) => /* @__PURE__ */ k(
55
+ me,
56
+ {
57
+ defaultViewBox: "0 0 384 512",
58
+ size: "size-5",
59
+ viewBox: t,
60
+ className: e,
61
+ title: r || "Down",
62
+ ...o,
63
+ children: [
64
+ /* @__PURE__ */ l(
65
+ "path",
66
+ {
67
+ opacity: a ? "1" : "0.4",
68
+ d: "M160 370.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V370.7l-32 32-32-32z"
69
+ }
70
+ ),
71
+ /* @__PURE__ */ l("path", { d: "M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7 54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z" })
72
+ ]
73
+ }
74
+ );
75
+ /*!
76
+ @versini/ui-header v2.1.1
77
+ © 2025 gizmette.com
78
+ */
79
+ try {
80
+ window.__VERSINI_UI_HEADER__ || (window.__VERSINI_UI_HEADER__ = {
81
+ version: "2.1.1",
82
+ buildTime: "01/02/2025 05:13 PM EST",
83
+ homepage: "https://github.com/aversini/ui-components",
84
+ license: "MIT"
85
+ });
86
+ } catch {
87
+ }
88
+ const er = "av-header", tr = ({
89
+ children: e,
90
+ className: t,
91
+ raw: r = !1,
92
+ mode: a = "system",
93
+ noColors: o = !1,
94
+ sticky: n = !1,
95
+ noBorder: s = !1,
96
+ noMargin: c = !1,
97
+ noPadding: d = !1
98
+ }) => {
99
+ const g = i(
100
+ er,
101
+ {
102
+ "border-border-accent": a === "dark" && !r && !o && !s,
103
+ "border-border-medium": a === "light" && !r && !o && !s,
104
+ "border-border-accent dark:border-border-medium": a === "alt-system" && !r && !o && !s,
105
+ "border-border-medium dark:border-border-accent": a === "system" && !r && !o && !s,
106
+ "border-b-4": !r && !s,
107
+ "border-transparent": !r && o,
108
+ "bg-surface-dark": a === "dark" && !r && !o,
109
+ "bg-surface-light": a === "light" && !r && !o,
110
+ "bg-surface-dark dark:bg-surface-light": a === "alt-system" && !r && !o,
111
+ "bg-surface-light dark:bg-surface-dark": a === "system" && !r && !o,
112
+ "sticky top-0 z-50": n
113
+ },
114
+ t
115
+ ), u = i({
116
+ "mt-0": !c,
117
+ "p-2": !d,
118
+ "flex flex-col w-full md:mx-auto md:max-w-4xl": !r
119
+ });
120
+ return /* @__PURE__ */ l("header", { className: g, children: /* @__PURE__ */ l("div", { className: u, children: e }) });
121
+ };
122
+ function rr(e) {
123
+ const t = e.toLowerCase().split("+").map((n) => n.trim()), r = {
124
+ alt: t.includes("alt"),
125
+ ctrl: t.includes("ctrl"),
126
+ meta: t.includes("meta"),
127
+ mod: t.includes("mod"),
128
+ shift: t.includes("shift")
129
+ }, a = ["alt", "ctrl", "meta", "shift", "mod"], o = t.find((n) => !a.includes(n));
130
+ return {
131
+ ...r,
132
+ key: o
133
+ };
134
+ }
135
+ function ar(e, t) {
136
+ const { alt: r, ctrl: a, meta: o, mod: n, shift: s, key: c } = e, { altKey: d, ctrlKey: g, metaKey: u, shiftKey: h, key: m } = t;
137
+ if (r !== d)
138
+ return !1;
139
+ if (n) {
140
+ if (!g && !u)
141
+ return !1;
142
+ } else if (a !== g || o !== u)
143
+ return !1;
144
+ return s !== h ? !1 : !!(c && (m.toLowerCase() === c.toLowerCase() || t.code.replace("Key", "").toLowerCase() === c.toLowerCase()));
145
+ }
146
+ function or(e) {
147
+ return (t) => ar(rr(e), t);
148
+ }
149
+ function nr(e) {
150
+ return (t) => {
151
+ const r = "nativeEvent" in t ? t.nativeEvent : t;
152
+ e.forEach(([a, o, n = { preventDefault: !0 }]) => {
153
+ or(a)(r) && (n.preventDefault && t.preventDefault(), o(r));
154
+ });
155
+ };
156
+ }
157
+ function ir() {
158
+ const e = v(!1);
159
+ return x(() => (e.current = !0, () => {
160
+ e.current = !1;
161
+ }), []), U(() => e.current, []);
162
+ }
163
+ function at(e, t) {
164
+ window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
165
+ }
166
+ const Le = (e, t) => {
167
+ const r = JSON.stringify(
168
+ typeof t == "function" ? t() : t
169
+ );
170
+ window.localStorage.setItem(e, r), at(e, r);
171
+ }, sr = (e) => {
172
+ window.localStorage.removeItem(e), at(e, null);
173
+ }, Oe = (e) => window.localStorage.getItem(e), lr = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
174
+ function Ve({
175
+ key: e,
176
+ initialValue: t
177
+ }) {
178
+ const r = Jt(lr, () => Oe(e)), a = U(
179
+ (s) => {
180
+ try {
181
+ const c = typeof s == "function" ? s(JSON.parse(r)) : s;
182
+ c == null ? sr(e) : Le(e, c);
183
+ } catch (c) {
184
+ console.warn(c);
185
+ }
186
+ },
187
+ [e, r]
188
+ ), o = U(() => {
189
+ a(t);
190
+ }, [t, a]), n = U(() => {
191
+ a(null);
192
+ }, [a]);
193
+ return x(() => {
194
+ try {
195
+ Oe(e) === null && typeof t < "u" && Le(e, t);
196
+ } catch (s) {
197
+ console.warn(s);
198
+ }
199
+ }, [e, t]), [r ? JSON.parse(r) : null, a, o, n];
200
+ }
201
+ const cr = {
202
+ x: 0,
203
+ y: 0,
204
+ width: 0,
205
+ height: 0,
206
+ top: 0,
207
+ left: 0,
208
+ bottom: 0,
209
+ right: 0
210
+ };
211
+ function dr(e) {
212
+ const t = ir(), r = v(0), a = v(null), [o, n] = S(cr), s = pe(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
213
+ const d = c[0];
214
+ d && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
215
+ a.current && t() && n(d.contentRect);
216
+ }));
217
+ }), [t]);
218
+ return x(() => (a.current && (s == null || s.observe(a.current, e)), () => {
219
+ s == null || s.disconnect(), r.current && cancelAnimationFrame(r.current);
220
+ }), [s, e]), [a, o];
221
+ }
222
+ /*!
223
+ @versini/ui-table v2.0.10
224
+ © 2025 gizmette.com
225
+ */
226
+ try {
227
+ window.__VERSINI_UI_TABLE__ || (window.__VERSINI_UI_TABLE__ = {
228
+ version: "2.0.10",
229
+ buildTime: "01/02/2025 05:13 PM EST",
230
+ homepage: "https://github.com/aversini/ui-components",
231
+ license: "MIT"
232
+ });
233
+ } catch {
234
+ }
235
+ const ee = "thead", be = "tfoot", D = "tbody", j = {
236
+ ASC: "asc",
237
+ DESC: "desc"
238
+ }, gr = ({
239
+ mode: e,
240
+ className: t,
241
+ wrapperClassName: r,
242
+ stickyHeader: a,
243
+ stickyFooter: o
244
+ }) => ({
245
+ wrapper: i(
246
+ "not-prose relative w-full rounded-lg shadow-md",
247
+ {
248
+ "overflow-x-auto": !a && !o,
249
+ "overflow-y-scroll": a || o,
250
+ "bg-surface-darker text-copy-light": e === "dark",
251
+ "bg-surface-light text-copy-dark": e === "light",
252
+ "bg-surface-darker text-copy-light dark:bg-surface-light dark:text-copy-dark": e === "system",
253
+ "bg-surface-light text-copy-dark dark:bg-surface-darker dark:text-copy-light": e === "alt-system"
254
+ },
255
+ r
256
+ ),
257
+ table: i("my-0 w-full text-left text-sm", t, {
258
+ "text-copy-light": e === "dark",
259
+ "text-copy-dark": e === "light",
260
+ "text-copy-light dark:text-copy-dark": e === "system",
261
+ "text-copy-dark dark:text-copy-light": e === "alt-system"
262
+ }),
263
+ caption: i("py-2 text-sm font-bold", {
264
+ "text-copy-light": e === "dark",
265
+ "text-copy-dark": e === "light",
266
+ "text-copy-light dark:text-copy-dark": e === "system",
267
+ "text-copy-dark dark:text-copy-light": e === "alt-system"
268
+ })
269
+ }), ur = ({
270
+ className: e,
271
+ stickyHeader: t,
272
+ mode: r
273
+ }) => i(
274
+ {
275
+ "sticky top-0 z-10": t,
276
+ "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": t && r === "dark",
277
+ "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": t && r === "system",
278
+ "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": t && r === "light",
279
+ "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": t && r === "alt-system"
280
+ },
281
+ e
282
+ ), mr = ({
283
+ className: e,
284
+ stickyFooter: t,
285
+ mode: r
286
+ }) => i(
287
+ {
288
+ "sticky bottom-0 z-10": t,
289
+ "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": t && r === "dark",
290
+ "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": t && r === "system",
291
+ "shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": t && r === "light",
292
+ "shadow-[rgb(65_65_65_/30%)_-0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": t && r === "alt-system"
293
+ },
294
+ e
295
+ ), hr = ({
296
+ mode: e,
297
+ className: t,
298
+ cellWrapper: r
299
+ }) => r === ee || r === be ? i(
300
+ {
301
+ "bg-table-head-dark": e === "dark",
302
+ "bg-table-head-light": e === "light",
303
+ "bg-table-head-dark dark:bg-table-head-light": e === "system",
304
+ "bg-table-head-light dark:bg-table-head-dark": e === "alt-system"
305
+ },
306
+ t
307
+ ) : i(
308
+ "border-b last:border-0",
309
+ {
310
+ "border-table-dark": e === "dark",
311
+ "odd:bg-table-dark-odd even:bg-table-dark-even": r === D && e === "dark",
312
+ "border-table-light": e === "light",
313
+ "odd:bg-table-light-odd even:bg-table-light-even": r === D && e === "light",
314
+ "border-table-dark dark:border-table-light": e === "system",
315
+ "odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": r === D && e === "system",
316
+ "border-table-light dark:border-table-dark": e === "alt-system",
317
+ "odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": r === D && e === "alt-system"
318
+ },
319
+ t
320
+ ), pr = ({
321
+ cellWrapper: e,
322
+ className: t,
323
+ compact: r,
324
+ mode: a
325
+ }) => i(
326
+ {
327
+ "text-copy-light": a === "dark",
328
+ "text-copy-dark": a === "light",
329
+ "text-copy-light dark:text-copy-dark": a === "system",
330
+ "text-copy-dark dark:text-copy-light": a === "alt-system",
331
+ "px-4 py-3": !r && (e === ee || e === be),
332
+ "p-4": !r && e === D,
333
+ "px-2 py-1.5": r
334
+ },
335
+ t
336
+ ), br = ({
337
+ buttonClassName: e
338
+ }) => i("rounded-none text-sm", e), Ue = "av-button", ye = "icon", ot = "button", de = "link", yr = ({
339
+ type: e,
340
+ size: t,
341
+ labelRight: r,
342
+ labelLeft: a,
343
+ align: o
344
+ }) => {
345
+ const n = "max-h-8 py-0 px-2", s = "max-h-9 py-1 px-3", c = "max-h-12 py-2 px-4";
346
+ switch (e) {
347
+ case ot:
348
+ case de:
349
+ return i({
350
+ [n]: t === "small",
351
+ [s]: t === "medium",
352
+ [c]: t === "large"
353
+ });
354
+ case ye:
355
+ return i("inline-flex items-center", {
356
+ "justify-center": o === "center",
357
+ "justify-start": o === "left",
358
+ "justify-end": o === "right",
359
+ "h-6 w-6 p-0": t === "small" && !(r || a),
360
+ "h-6 px-2": t === "small" && (r || a),
361
+ "h-8 w-8 p-1": t === "medium" && !(r || a),
362
+ "h-8 px-3": t === "medium" && (r || a),
363
+ "h-12 w-12 p-2": t === "large" && !(r || a),
364
+ "h-12 px-4": t === "large" && (r || a)
365
+ });
366
+ }
367
+ }, fr = ({
368
+ type: e,
369
+ size: t,
370
+ labelRight: r,
371
+ labelLeft: a
372
+ }) => {
373
+ const o = "text-sm font-medium", n = "text-base font-medium", s = "text-lg font-medium";
374
+ switch (e) {
375
+ case ot:
376
+ case de:
377
+ return i({
378
+ "text-center": e === de,
379
+ [o]: t === "small",
380
+ [n]: t === "medium",
381
+ [s]: t === "large"
382
+ });
383
+ case ye:
384
+ return i({
385
+ [o]: t === "small" && (r || a),
386
+ [n]: t === "medium" && (r || a),
387
+ [s]: t === "large" && (r || a)
388
+ });
389
+ }
390
+ }, kr = ({
391
+ mode: e,
392
+ noBackground: t,
393
+ noTruncate: r,
394
+ variant: a
395
+ }) => {
396
+ if (t)
397
+ return "not-prose";
398
+ if (a === "primary")
399
+ return i("not-prose", {
400
+ truncate: !r,
401
+ "text-copy-light": e === "dark",
402
+ "text-copy-lighter": e === "light",
403
+ "text-copy-light dark:text-copy-lighter": e === "system",
404
+ "text-copy-lighter dark:text-copy-light": e === "alt-system"
405
+ });
406
+ if (a === "secondary")
407
+ return i("not-prose", {
408
+ truncate: !r,
409
+ "text-copy-light": e === "light",
410
+ "text-copy-lighter": e === "dark",
411
+ "text-copy-light dark:text-copy-lighter": e === "alt-system",
412
+ "text-copy-lighter dark:text-copy-light": e === "system"
413
+ });
414
+ if (a === "danger")
415
+ return i("not-prose", {
416
+ truncate: !r,
417
+ "text-copy-light": e === "dark",
418
+ "text-copy-lighter": e === "light",
419
+ "text-copy-light dark:text-copy-lighter": e === "system",
420
+ "text-copy-lighter dark:text-copy-light": e === "alt-system"
421
+ });
422
+ if (a === "selected")
423
+ return i("not-prose", {
424
+ truncate: !r,
425
+ "text-copy-light": e === "dark",
426
+ "text-copy-lighter": e === "light",
427
+ "text-copy-light dark:text-copy-lighter": e === "system",
428
+ "text-copy-lighter dark:text-copy-light": e === "alt-system"
429
+ });
430
+ }, vr = ({
431
+ mode: e,
432
+ noBackground: t,
433
+ variant: r
434
+ }) => {
435
+ if (!t) {
436
+ if (r === "primary")
437
+ return i({
438
+ "bg-action-dark": e === "dark",
439
+ "bg-action-light": e === "light",
440
+ "bg-action-dark dark:bg-action-light": e === "system",
441
+ "bg-action-light dark:bg-action-dark": e === "alt-system"
442
+ });
443
+ if (r === "secondary")
444
+ return i({
445
+ "bg-action-dark": e === "light",
446
+ "bg-action-light": e === "dark",
447
+ "bg-action-dark dark:bg-action-light": e === "alt-system",
448
+ "bg-action-light dark:bg-action-dark": e === "system"
449
+ });
450
+ if (r === "danger")
451
+ return i({
452
+ "bg-action-danger-dark": e === "dark",
453
+ "bg-action-danger-light": e === "light",
454
+ "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
455
+ "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
456
+ });
457
+ if (r === "selected")
458
+ return "bg-action-selected-dark";
459
+ }
460
+ }, xr = ({
461
+ radius: e
462
+ }) => i({
463
+ "rounded-full": e === "large",
464
+ "rounded-md": e === "medium",
465
+ "rounded-sm": e === "small"
466
+ }), _r = ({
467
+ mode: e,
468
+ disabled: t,
469
+ variant: r
470
+ }) => {
471
+ if (t)
472
+ return "";
473
+ if (r === "primary")
474
+ return i("hover:text-copy-light-hover", {
475
+ "hover:bg-action-dark-hover": e === "dark",
476
+ "hover:bg-action-light-hover": e === "light",
477
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
478
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
479
+ });
480
+ if (r === "secondary")
481
+ return i("hover:text-copy-light-hover", {
482
+ "hover:bg-action-dark-hover": e === "light",
483
+ "hover:bg-action-light-hover": e === "dark",
484
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
485
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
486
+ });
487
+ if (r === "danger")
488
+ return i("hover:text-copy-light-hover", {
489
+ "hover:bg-action-danger-dark-hover": e === "dark",
490
+ "hover:bg-action-danger-light-hover": e === "light",
491
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
492
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
493
+ });
494
+ if (r === "selected")
495
+ return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
496
+ }, wr = ({
497
+ mode: e,
498
+ disabled: t,
499
+ variant: r
500
+ }) => {
501
+ if (t)
502
+ return "";
503
+ if (r === "primary")
504
+ return i("active:text-copy-light-active", {
505
+ "active:bg-action-dark-active": e === "dark",
506
+ "active:bg-action-light-active": e === "light",
507
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
508
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
509
+ });
510
+ if (r === "secondary")
511
+ return i("active:text-copy-light-active", {
512
+ "active:bg-action-dark-active": e === "light",
513
+ "active:bg-action-light-active": e === "dark",
514
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
515
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
516
+ });
517
+ if (r === "danger")
518
+ return i("active:text-copy-lighter-active", {
519
+ "active:bg-action-danger-dark-active": e === "dark",
520
+ "active:bg-action-danger-light-active": e === "light",
521
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
522
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
523
+ });
524
+ if (r === "selected")
525
+ return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
526
+ }, Tr = ({
527
+ mode: e,
528
+ noBorder: t,
529
+ variant: r
530
+ }) => {
531
+ if (t)
532
+ return "border border-transparent";
533
+ if (r === "primary")
534
+ return i("border", {
535
+ "border-border-dark": e === "dark",
536
+ "border-border-accent": e === "light",
537
+ "border-border-dark dark:border-border-accent": e === "system",
538
+ "border-border-accent dark:border-border-dark": e === "alt-system"
539
+ });
540
+ if (r === "secondary")
541
+ return i("border", {
542
+ "border-border-dark": e === "light",
543
+ "border-border-accent": e === "dark",
544
+ "border-border-dark dark:border-border-accent": e === "alt-system",
545
+ "border-border-accent dark:border-border-dark": e === "system"
546
+ });
547
+ if (r === "danger")
548
+ return i("border", {
549
+ "border-border-danger-dark": e === "dark",
550
+ "border-border-danger-medium": e === "light",
551
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
552
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
553
+ });
554
+ if (r === "selected")
555
+ return "border border-border-selected-dark";
556
+ }, Nr = ({
557
+ focusMode: e
558
+ }) => i("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
559
+ "focus:outline-focus-dark": e === "dark",
560
+ "focus:outline-focus-light": e === "light",
561
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
562
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
563
+ }), Er = ({
564
+ type: e,
565
+ className: t,
566
+ raw: r,
567
+ mode: a,
568
+ focusMode: o,
569
+ disabled: n,
570
+ fullWidth: s,
571
+ size: c,
572
+ noBorder: d,
573
+ labelRight: g,
574
+ labelLeft: u,
575
+ noBackground: h,
576
+ variant: m,
577
+ noTruncate: p,
578
+ align: b,
579
+ radius: f
580
+ }) => (m || (m = "primary"), r ? i(Ue, t) : i(
581
+ Ue,
582
+ kr({
583
+ mode: a,
584
+ variant: m,
585
+ noBackground: h,
586
+ noTruncate: p
587
+ }),
588
+ vr({ mode: a, noBackground: h, variant: m }),
589
+ xr({ radius: f }),
590
+ yr({
591
+ type: e,
592
+ size: c,
593
+ labelRight: g,
594
+ labelLeft: u,
595
+ align: b
596
+ }),
597
+ fr({ type: e, size: c, labelRight: g, labelLeft: u }),
598
+ Tr({ mode: a, variant: m, noBorder: d }),
599
+ Nr({ focusMode: o }),
600
+ _r({ mode: a, variant: m, disabled: n }),
601
+ wr({ mode: a, variant: m, disabled: n }),
602
+ {
603
+ "w-full": s,
604
+ "disabled:cursor-not-allowed disabled:opacity-50": n
605
+ },
606
+ t
607
+ )), Sr = (e, t, r) => {
608
+ var a;
609
+ !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
610
+ }, nt = I.forwardRef((e, t) => {
611
+ const { onClick: r, noInternalClick: a = !1, ...o } = e;
612
+ return /* @__PURE__ */ l(
613
+ "button",
614
+ {
615
+ ref: t,
616
+ onClick: (n) => {
617
+ Sr(n, a, r);
618
+ },
619
+ ...o
620
+ }
621
+ );
622
+ });
623
+ nt.displayName = "BaseButton";
624
+ /*!
625
+ @versini/ui-button v3.2.2
626
+ © 2025 gizmette.com
627
+ */
628
+ try {
629
+ window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
630
+ version: "3.2.2",
631
+ buildTime: "01/02/2025 05:13 PM EST",
632
+ homepage: "https://github.com/aversini/ui-components",
633
+ license: "MIT"
634
+ });
635
+ } catch {
636
+ }
637
+ const it = I.forwardRef(
638
+ ({
639
+ children: e,
640
+ disabled: t = !1,
641
+ mode: r = "system",
642
+ focusMode: a = "system",
643
+ fullWidth: o = !1,
644
+ className: n,
645
+ type: s = "button",
646
+ raw: c = !1,
647
+ noBorder: d = !1,
648
+ "aria-label": g,
649
+ label: u,
650
+ size: h = "medium",
651
+ labelRight: m,
652
+ labelLeft: p,
653
+ noBackground: b = !1,
654
+ align: f = "center",
655
+ active: y = !1,
656
+ radius: _ = "large",
657
+ ...T
658
+ }, N) => {
659
+ const R = Er({
660
+ type: ye,
661
+ mode: r,
662
+ focusMode: a,
663
+ fullWidth: o,
664
+ disabled: t,
665
+ raw: c,
666
+ className: n,
667
+ noBorder: d,
668
+ size: h,
669
+ labelRight: m,
670
+ labelLeft: p,
671
+ noBackground: b,
672
+ align: f,
673
+ radius: _
674
+ }), E = i({
675
+ "text-copy-accent-dark": r === "light" && !c,
676
+ "text-copy-light": r === "dark" && !c,
677
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
678
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !c
679
+ }), M = y ? i(
680
+ "relative",
681
+ "focus-within:static",
682
+ "focus-within:after:border-transparent",
683
+ "after:absolute",
684
+ "after:content-['']",
685
+ "after:border-b-2",
686
+ "after:bottom-[-4px]",
687
+ "after:left-0",
688
+ "after:right-0",
689
+ {
690
+ "after:border-table-dark": r === "dark",
691
+ "after:border-table-light": r === "light",
692
+ "after:border-table-dark dark:after:border-table-light": r === "system",
693
+ "after:border-table-light dark:after:border-table-dark": r === "alt-system"
694
+ }
695
+ ) : "";
696
+ return /* @__PURE__ */ l("div", { className: M, children: /* @__PURE__ */ k(
697
+ nt,
698
+ {
699
+ ref: N,
700
+ className: R,
701
+ disabled: t,
702
+ type: s,
703
+ "aria-label": g || u,
704
+ ...T,
705
+ children: [
706
+ p && /* @__PURE__ */ l("span", { className: "pr-2", children: p }),
707
+ /* @__PURE__ */ l("div", { className: E, children: e }),
708
+ m && /* @__PURE__ */ l("span", { className: "pl-2", children: m })
709
+ ]
710
+ }
711
+ ) });
712
+ }
713
+ );
714
+ it.displayName = "ButtonSort";
715
+ const fe = ({
716
+ children: e,
717
+ fill: t,
718
+ viewBox: r,
719
+ className: a,
720
+ defaultViewBox: o,
721
+ size: n,
722
+ title: s,
723
+ semantic: c = !1,
724
+ ...d
725
+ }) => {
726
+ const g = i(n, a);
727
+ return /* @__PURE__ */ k(Y, { children: [
728
+ /* @__PURE__ */ l(
729
+ "svg",
730
+ {
731
+ xmlns: "http://www.w3.org/2000/svg",
732
+ className: g,
733
+ viewBox: r || o,
734
+ fill: t || "currentColor",
735
+ role: "img",
736
+ "aria-hidden": !c,
737
+ focusable: !1,
738
+ ...d,
739
+ children: e
740
+ }
741
+ ),
742
+ s && c && /* @__PURE__ */ l("span", { className: "sr-only", children: s })
743
+ ] });
744
+ };
745
+ /*!
746
+ @versini/ui-svgicon v3.0.3
747
+ © 2025 gizmette.com
748
+ */
749
+ try {
750
+ window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
751
+ version: "3.0.3",
752
+ buildTime: "01/02/2025 05:13 PM EST",
753
+ homepage: "https://github.com/aversini/ui-components",
754
+ license: "MIT"
755
+ });
756
+ } catch {
757
+ }
758
+ const Cr = ({
759
+ className: e,
760
+ viewBox: t,
761
+ title: r,
762
+ monotone: a,
763
+ ...o
764
+ }) => /* @__PURE__ */ k(
765
+ fe,
766
+ {
767
+ defaultViewBox: "0 0 576 512",
768
+ size: "size-5",
769
+ viewBox: t,
770
+ className: e,
771
+ title: r || "Sort",
772
+ ...o,
773
+ children: [
774
+ /* @__PURE__ */ l(
775
+ "path",
776
+ {
777
+ opacity: a ? "1" : "0.4",
778
+ d: "M393.4 41.4c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L448 141.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V141.3l-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96z"
779
+ }
780
+ ),
781
+ /* @__PURE__ */ l("path", { d: "M137.4 470.6c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 370.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V370.7L86.6 329.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96z" })
782
+ ]
783
+ }
784
+ ), Ir = ({
785
+ className: e,
786
+ viewBox: t,
787
+ title: r,
788
+ monotone: a,
789
+ ...o
790
+ }) => /* @__PURE__ */ k(
791
+ fe,
792
+ {
793
+ defaultViewBox: "0 0 576 512",
794
+ size: "size-5",
795
+ viewBox: t,
796
+ className: e,
797
+ title: r || "Sort Down",
798
+ ...o,
799
+ children: [
800
+ /* @__PURE__ */ l(
801
+ "path",
802
+ {
803
+ opacity: a ? "1" : "0.4",
804
+ d: "M288 448c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32z"
805
+ }
806
+ ),
807
+ /* @__PURE__ */ l("path", { d: "M128 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L160 365.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V365.7L63.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C110.5 476.2 119 480 128 480z" })
808
+ ]
809
+ }
810
+ ), Rr = ({
811
+ className: e,
812
+ viewBox: t,
813
+ title: r,
814
+ monotone: a,
815
+ ...o
816
+ }) => /* @__PURE__ */ k(
817
+ fe,
818
+ {
819
+ defaultViewBox: "0 0 576 512",
820
+ size: "size-5",
821
+ viewBox: t,
822
+ className: e,
823
+ title: r || "Sort Up",
824
+ ...o,
825
+ children: [
826
+ /* @__PURE__ */ l(
827
+ "path",
828
+ {
829
+ opacity: a ? "1" : "0.4",
830
+ d: "M288 64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32z"
831
+ }
832
+ ),
833
+ /* @__PURE__ */ l("path", { d: "M128 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L160 146.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V146.3L63.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C110.5 35.8 119 32 128 32z" })
834
+ ]
835
+ }
836
+ );
837
+ /*!
838
+ @versini/ui-icons v3.1.1
839
+ © 2025 gizmette.com
840
+ */
841
+ try {
842
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
843
+ version: "3.1.1",
844
+ buildTime: "01/02/2025 05:13 PM EST",
845
+ homepage: "https://github.com/aversini/ui-components",
846
+ license: "MIT"
847
+ });
848
+ } catch {
849
+ }
850
+ const G = I.createContext({
851
+ mode: "light",
852
+ cellWrapper: "thead",
853
+ stickyHeader: !1,
854
+ stickyFooter: !1,
855
+ compact: !1
856
+ }), eo = ({
857
+ children: e,
858
+ mode: t = "system",
859
+ caption: r,
860
+ compact: a,
861
+ summary: o,
862
+ className: n,
863
+ wrapperClassName: s,
864
+ maxHeight: c,
865
+ stickyHeader: d,
866
+ stickyFooter: g,
867
+ ...u
868
+ }) => {
869
+ const h = gr({
870
+ mode: t,
871
+ className: n,
872
+ wrapperClassName: s,
873
+ stickyHeader: d,
874
+ stickyFooter: g
875
+ });
876
+ return /* @__PURE__ */ l(
877
+ G.Provider,
878
+ {
879
+ value: { mode: t, stickyHeader: d, stickyFooter: g, compact: a },
880
+ children: /* @__PURE__ */ l(
881
+ "div",
882
+ {
883
+ className: h.wrapper,
884
+ ...c && {
885
+ style: { maxHeight: c }
886
+ },
887
+ children: /* @__PURE__ */ k("table", { className: h.table, summary: o, ...u, children: [
888
+ r && /* @__PURE__ */ l("caption", { className: h.caption, children: r }),
889
+ e
890
+ ] })
891
+ }
892
+ )
893
+ }
894
+ );
895
+ }, to = ({
896
+ children: e,
897
+ className: t,
898
+ ...r
899
+ }) => {
900
+ const a = $(G);
901
+ a.cellWrapper = ee;
902
+ const o = ur({
903
+ className: t,
904
+ mode: a.mode,
905
+ stickyHeader: a.stickyHeader
906
+ });
907
+ return /* @__PURE__ */ l("thead", { className: o, ...r, children: e });
908
+ }, ro = ({
909
+ children: e,
910
+ className: t,
911
+ ...r
912
+ }) => {
913
+ const a = $(G);
914
+ a.cellWrapper = be;
915
+ const o = mr({
916
+ className: t,
917
+ mode: a.mode,
918
+ stickyFooter: a.stickyFooter
919
+ });
920
+ return /* @__PURE__ */ l("tfoot", { className: o, ...r, children: e });
921
+ }, ao = ({ children: e, ...t }) => {
922
+ const r = $(G);
923
+ return r.cellWrapper = D, /* @__PURE__ */ l("tbody", { ...t, children: e });
924
+ }, oo = ({
925
+ children: e,
926
+ className: t,
927
+ ...r
928
+ }) => {
929
+ const a = $(G), o = hr({
930
+ mode: a.mode,
931
+ cellWrapper: a.cellWrapper,
932
+ className: t
933
+ });
934
+ return /* @__PURE__ */ l("tr", { className: o, ...r, children: e });
935
+ }, $r = ({
936
+ children: e,
937
+ component: t,
938
+ className: r,
939
+ ...a
940
+ }) => {
941
+ const o = $(G), n = t || (o.cellWrapper === ee ? "th" : "td"), s = pr({
942
+ cellWrapper: o.cellWrapper,
943
+ className: r,
944
+ mode: o.mode,
945
+ compact: o.compact
946
+ });
947
+ return /* @__PURE__ */ l(n, { className: s, ...a, children: e });
948
+ }, no = ({
949
+ align: e,
950
+ children: t,
951
+ buttonClassName: r,
952
+ className: a,
953
+ component: o,
954
+ focusMode: n = "alt-system",
955
+ mode: s = "alt-system",
956
+ onClick: c,
957
+ sortDirection: d,
958
+ sortedCell: g,
959
+ cellId: u,
960
+ ...h
961
+ }) => {
962
+ const m = br({ buttonClassName: r });
963
+ return /* @__PURE__ */ l(
964
+ $r,
965
+ {
966
+ component: o,
967
+ className: a,
968
+ role: "columnheader",
969
+ "aria-sort": d === j.ASC && g === u ? "ascending" : d === j.DESC && g === u ? "descending" : "other",
970
+ ...h,
971
+ children: /* @__PURE__ */ l(
972
+ it,
973
+ {
974
+ active: g === u,
975
+ className: m,
976
+ onClick: c,
977
+ align: e,
978
+ noBorder: !0,
979
+ focusMode: n,
980
+ mode: s,
981
+ fullWidth: !0,
982
+ labelRight: t,
983
+ children: d === j.ASC && g === u ? /* @__PURE__ */ l(Rr, { className: "size-4", monotone: !0 }) : d === j.DESC && g === u ? /* @__PURE__ */ l(Ir, { className: "size-4", monotone: !0 }) : /* @__PURE__ */ l(Cr, { className: "size-4", monotone: !0 })
984
+ }
985
+ )
986
+ }
987
+ );
988
+ }, w = [];
989
+ for (let e = 0; e < 256; ++e)
990
+ w.push((e + 256).toString(16).slice(1));
991
+ function Br(e, t = 0) {
992
+ return (w[e[t + 0]] + w[e[t + 1]] + w[e[t + 2]] + w[e[t + 3]] + "-" + w[e[t + 4]] + w[e[t + 5]] + "-" + w[e[t + 6]] + w[e[t + 7]] + "-" + w[e[t + 8]] + w[e[t + 9]] + "-" + w[e[t + 10]] + w[e[t + 11]] + w[e[t + 12]] + w[e[t + 13]] + w[e[t + 14]] + w[e[t + 15]]).toLowerCase();
993
+ }
994
+ let ie;
995
+ const Ar = new Uint8Array(16);
996
+ function zr() {
997
+ if (!ie) {
998
+ if (typeof crypto > "u" || !crypto.getRandomValues)
999
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1000
+ ie = crypto.getRandomValues.bind(crypto);
1001
+ }
1002
+ return ie(Ar);
1003
+ }
1004
+ const Mr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), He = { randomUUID: Mr };
1005
+ function ke(e, t, r) {
1006
+ if (He.randomUUID && !t && !e)
1007
+ return He.randomUUID();
1008
+ e = e || {};
1009
+ const a = e.random || (e.rng || zr)();
1010
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Br(a);
1011
+ }
1012
+ const Lr = (e, t) => {
1013
+ if ((t == null ? void 0 : t.type) === At) {
1014
+ const r = t.payload.messages.map((a) => ({
1015
+ message: {
1016
+ role: a.role,
1017
+ content: a.content,
1018
+ name: a.name,
1019
+ processingTime: a.processingTime
1020
+ }
1021
+ }));
1022
+ return {
1023
+ id: t.payload.id,
1024
+ model: t.payload.model,
1025
+ usage: t.payload.usage,
1026
+ isComponent: e.isComponent,
1027
+ messages: r,
1028
+ engine: e.engine,
1029
+ tags: e.tags
1030
+ };
1031
+ }
1032
+ if ((t == null ? void 0 : t.type) === q) {
1033
+ const r = t.payload.message.role, a = t.payload.message.content, o = t.payload.message.name, n = t.payload.message.processingTime, s = t.payload.message.messageId;
1034
+ if (r !== "") {
1035
+ const c = {
1036
+ role: r,
1037
+ content: a,
1038
+ name: o,
1039
+ processingTime: n,
1040
+ messageId: s
1041
+ };
1042
+ if (r === K) {
1043
+ const d = e.messages.findIndex(
1044
+ (g) => g.message.messageId === s
1045
+ );
1046
+ if (d !== -1) {
1047
+ const g = e.messages.map((u, h) => h === d ? {
1048
+ message: {
1049
+ ...u.message,
1050
+ content: `${u.message.content}${a}`,
1051
+ processingTime: n,
1052
+ name: o
1053
+ }
1054
+ } : u);
1055
+ return {
1056
+ id: e.id,
1057
+ model: e.model,
1058
+ usage: e.usage,
1059
+ isComponent: e.isComponent,
1060
+ messages: g,
1061
+ engine: e.engine,
1062
+ tags: e.tags
1063
+ };
1064
+ }
1065
+ }
1066
+ return {
1067
+ id: e.id,
1068
+ model: e.model,
1069
+ engine: e.engine,
1070
+ tags: e.tags,
1071
+ usage: e.usage,
1072
+ isComponent: e.isComponent,
1073
+ messages: [
1074
+ ...e.messages,
1075
+ {
1076
+ message: c
1077
+ }
1078
+ ]
1079
+ };
1080
+ }
1081
+ }
1082
+ return (t == null ? void 0 : t.type) === qe ? {
1083
+ id: ke(),
1084
+ model: e.model,
1085
+ engine: e.engine,
1086
+ usage: 0,
1087
+ messages: [],
1088
+ isComponent: e.isComponent,
1089
+ tags: e.tags
1090
+ } : (t == null ? void 0 : t.type) === Ke ? {
1091
+ id: e.id,
1092
+ model: t.payload.model,
1093
+ engine: e.engine,
1094
+ tags: e.tags,
1095
+ usage: t.payload.usage,
1096
+ messages: e.messages,
1097
+ isComponent: e.isComponent
1098
+ } : (t == null ? void 0 : t.type) === Je ? {
1099
+ ...e,
1100
+ engine: t.payload.engine
1101
+ } : (t == null ? void 0 : t.type) === Qe ? {
1102
+ ...e,
1103
+ streaming: t.payload.streaming
1104
+ } : e;
1105
+ }, Or = (e, t) => {
1106
+ switch (t == null ? void 0 : t.type) {
1107
+ case Mt:
1108
+ return {
1109
+ searchString: t.payload.searchString,
1110
+ sortedCell: e.sortedCell,
1111
+ sortDirection: e.sortDirection
1112
+ };
1113
+ case zt:
1114
+ return {
1115
+ searchString: e.searchString,
1116
+ sortedCell: t.payload.sortedCell,
1117
+ sortDirection: t.payload.sortDirection
1118
+ };
1119
+ default:
1120
+ return e;
1121
+ }
1122
+ }, Vr = (e, t) => {
1123
+ switch (t == null ? void 0 : t.type) {
1124
+ case Ze:
1125
+ return {
1126
+ tags: e.tags,
1127
+ tag: t.payload.tag
1128
+ };
1129
+ case Ye:
1130
+ return {
1131
+ tags: e.tags,
1132
+ tag: ""
1133
+ };
1134
+ case Xe:
1135
+ return {
1136
+ tags: t.payload.tags,
1137
+ tag: ""
1138
+ };
1139
+ default:
1140
+ return e;
1141
+ }
1142
+ }, z = {
1143
+ GET_LOCATION: `query GetLocation($latitude: Float!, $longitude: Float!) {
1144
+ location(latitude: $latitude, longitude: $longitude) {
1145
+ country
1146
+ state
1147
+ city
1148
+ displayName
1149
+ }
1150
+ }`,
1151
+ GET_CHATS: `query GetChats(
1152
+ $userId: String!,
1153
+ $searchString: String,
1154
+ $limit: Float,
1155
+ $direction: String,
1156
+ $truncateSize: Float) {
1157
+ chats(
1158
+ user: $userId,
1159
+ searchString: $searchString,
1160
+ limit: $limit,
1161
+ direction: $direction,
1162
+ truncateSize: $truncateSize) {
1163
+ timestamp
1164
+ id
1165
+ model
1166
+ messages {
1167
+ content
1168
+ }
1169
+ }
1170
+ }`,
1171
+ GET_CHATS_STATS: `query GetChatsStats($userId: String!) {
1172
+ chatsStats(user: $userId) {
1173
+ totalChats
1174
+ averageProcessingTimes
1175
+ }
1176
+ }`,
1177
+ GET_CHAT: `query GetChatById($id: String!) {
1178
+ chatById(id: $id) {
1179
+ model
1180
+ usage
1181
+ messages {
1182
+ content
1183
+ role
1184
+ name
1185
+ processingTime
1186
+ }
1187
+ }
1188
+ }`,
1189
+ DELETE_CHAT: `mutation DeleteChat(
1190
+ $id: String!,
1191
+ $userId: String!,
1192
+ $searchString: String,
1193
+ $limit: Float,
1194
+ $direction: String,
1195
+ $truncateSize: Float) {
1196
+ deleteChat(
1197
+ id: $id,
1198
+ user: $userId,
1199
+ searchString: $searchString,
1200
+ limit: $limit,
1201
+ direction: $direction,
1202
+ truncateSize: $truncateSize) {
1203
+ timestamp
1204
+ id
1205
+ model
1206
+ messages {
1207
+ content
1208
+ }
1209
+ }
1210
+ }`,
1211
+ ABOUT: `query About($user: String!) {
1212
+ about(user: $user) {
1213
+ version
1214
+ models
1215
+ plugins
1216
+ engine
1217
+ engines
1218
+ }
1219
+ }`,
1220
+ GET_USER_PREFERENCES: `query GetUserPreferences($user: String!) {
1221
+ getUserPreferences(user: $user) {
1222
+ instructions
1223
+ location
1224
+ engine
1225
+ tags {
1226
+ enabled
1227
+ slot
1228
+ label
1229
+ content
1230
+ }
1231
+ }
1232
+ }`,
1233
+ SET_USER_PREFERENCES: `mutation SetUserPreferences(
1234
+ $user: String!,
1235
+ $instructions: String,
1236
+ $location: String,
1237
+ $engine: String,
1238
+ $tags: [TagIn]) {
1239
+ setUserPreferences(
1240
+ user: $user,
1241
+ instructions: $instructions,
1242
+ location: $location,
1243
+ engine: $engine,
1244
+ tags: $tags)
1245
+ }`
1246
+ }, st = {
1247
+ GET_LOCATION: {
1248
+ schema: z.GET_LOCATION,
1249
+ method: "location"
1250
+ },
1251
+ GET_CHATS: {
1252
+ schema: z.GET_CHATS,
1253
+ method: "chats"
1254
+ },
1255
+ GET_CHATS_STATS: {
1256
+ schema: z.GET_CHATS_STATS,
1257
+ method: "chatsStats"
1258
+ },
1259
+ GET_CHAT: {
1260
+ schema: z.GET_CHAT,
1261
+ method: "chatById"
1262
+ },
1263
+ DELETE_CHAT: {
1264
+ schema: z.DELETE_CHAT,
1265
+ method: "deleteChat"
1266
+ },
1267
+ ABOUT: {
1268
+ schema: z.ABOUT,
1269
+ method: "about"
1270
+ },
1271
+ GET_USER_PREFERENCES: {
1272
+ schema: z.GET_USER_PREFERENCES,
1273
+ method: "getUserPreferences"
1274
+ },
1275
+ SET_USER_PREFERENCES: {
1276
+ schema: z.SET_USER_PREFERENCES,
1277
+ method: "setUserPreferences"
1278
+ }
1279
+ }, lt = process.env.PUBLIC_SASSY_API_SERVER_URL, Ur = async ({
1280
+ query: e,
1281
+ data: t,
1282
+ headers: r = {}
1283
+ }) => await fetch(`${lt}/graphql`, {
1284
+ method: "POST",
1285
+ credentials: "include",
1286
+ headers: {
1287
+ ...r,
1288
+ "Content-Type": "application/json",
1289
+ Accept: "application/json"
1290
+ },
1291
+ body: JSON.stringify({
1292
+ query: e,
1293
+ variables: t
1294
+ })
1295
+ }), ct = async ({
1296
+ accessToken: e,
1297
+ type: t,
1298
+ params: r = {}
1299
+ }) => {
1300
+ const a = t != null && t.data ? t.data(r) : r;
1301
+ try {
1302
+ const o = `Bearer ${e}`, n = await Ur({
1303
+ headers: {
1304
+ authorization: o
1305
+ },
1306
+ query: t.schema,
1307
+ data: a
1308
+ });
1309
+ if (n.status !== 200)
1310
+ return { status: n.status, data: [] };
1311
+ const { data: s, errors: c } = await n.json();
1312
+ return {
1313
+ status: n.status,
1314
+ data: s[t.method],
1315
+ errors: c
1316
+ };
1317
+ } catch (o) {
1318
+ return console.error(o), { status: 500, data: [] };
1319
+ }
1320
+ }, Hr = async ({
1321
+ accessToken: e,
1322
+ name: t,
1323
+ data: r,
1324
+ method: a = "POST"
1325
+ }) => {
1326
+ const o = `Bearer ${e}`;
1327
+ return await fetch(`${lt}/api/${t}`, {
1328
+ method: a,
1329
+ credentials: "include",
1330
+ headers: {
1331
+ "Content-Type": "application/json",
1332
+ authorization: o
1333
+ },
1334
+ body: JSON.stringify(r)
1335
+ });
1336
+ }, F = I.createContext({
1337
+ state: {
1338
+ id: "",
1339
+ model: V,
1340
+ engine: V,
1341
+ usage: 0,
1342
+ messages: [],
1343
+ isComponent: !1,
1344
+ tags: []
1345
+ },
1346
+ dispatch: () => {
1347
+ },
1348
+ serverStats: {
1349
+ version: "",
1350
+ models: [],
1351
+ plugins: [],
1352
+ engine: V,
1353
+ engines: []
1354
+ }
1355
+ }), Pr = I.createContext({
1356
+ state: { searchString: "", sortedCell: "", sortDirection: "" },
1357
+ dispatch: () => {
1358
+ }
1359
+ }), ve = I.createContext({
1360
+ state: { tag: "" },
1361
+ dispatch: () => {
1362
+ }
1363
+ });
1364
+ /*!
1365
+ @versini/ui-textarea v2.1.2
1366
+ © 2025 gizmette.com
1367
+ */
1368
+ try {
1369
+ window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
1370
+ version: "2.1.2",
1371
+ buildTime: "01/02/2025 05:13 PM EST",
1372
+ homepage: "https://github.com/aversini/ui-components",
1373
+ license: "MIT"
1374
+ });
1375
+ } catch {
1376
+ }
1377
+ const dt = "av-text-area", Dr = "av-text-area-wrapper", se = "av-text-area-helper-text", Gr = "av-text-area__control--right", Fr = "av-text-area__control--left";
1378
+ function Wr() {
1379
+ const e = v(!1);
1380
+ return x(() => (e.current = !0, () => {
1381
+ e.current = !1;
1382
+ }), []), U(() => e.current, []);
1383
+ }
1384
+ function jr(e) {
1385
+ return pe(() => e.every((t) => t == null) ? () => {
1386
+ } : (t) => {
1387
+ e.forEach((r) => {
1388
+ typeof r == "function" ? r(t) : r != null && (r.current = t);
1389
+ });
1390
+ }, e);
1391
+ }
1392
+ const qr = {
1393
+ x: 0,
1394
+ y: 0,
1395
+ width: 0,
1396
+ height: 0,
1397
+ top: 0,
1398
+ left: 0,
1399
+ bottom: 0,
1400
+ right: 0
1401
+ };
1402
+ function Pe(e) {
1403
+ const t = Wr(), r = v(0), a = v(null), [o, n] = S(qr), s = pe(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
1404
+ const d = c[0];
1405
+ d && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
1406
+ a.current && t() && n(d.contentRect);
1407
+ }));
1408
+ }), [t]);
1409
+ return x(() => (a.current && (s == null || s.observe(a.current, e)), () => {
1410
+ s == null || s.disconnect(), r.current && cancelAnimationFrame(r.current);
1411
+ }), [s, e]), [a, o];
1412
+ }
1413
+ function Kr({
1414
+ value: e,
1415
+ defaultValue: t,
1416
+ finalValue: r,
1417
+ onChange: a = () => {
1418
+ },
1419
+ initialControlledDelay: o = 0
1420
+ }) {
1421
+ const [n, s] = S(!1), [c, d] = S(
1422
+ t !== void 0 ? t : r
1423
+ ), g = (u) => {
1424
+ d(u), a == null || a(u);
1425
+ };
1426
+ return x(() => {
1427
+ (async () => e !== void 0 && !n && o > 0 && (await new Promise(
1428
+ (u) => setTimeout(u, o)
1429
+ ), s(!0)))();
1430
+ }, [e, o, n]), e !== void 0 ? !n && o > 0 ? ["", a, !0] : [e, a, !0] : [c, g, !1];
1431
+ }
1432
+ function Jr(e) {
1433
+ const t = Qt();
1434
+ if (!e)
1435
+ return t;
1436
+ if (typeof e == "number" || typeof e == "string")
1437
+ return `${e}${t}`;
1438
+ if (typeof e == "object") {
1439
+ const { id: r, prefix: a = "" } = e;
1440
+ return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
1441
+ }
1442
+ }
1443
+ const gt = "SET_ANNOUNCEMENT", ut = "CLEAR_ANNOUNCEMENT", Qr = {
1444
+ alert: null,
1445
+ alertdialog: null,
1446
+ log: "polite",
1447
+ marquee: null,
1448
+ progressbar: null,
1449
+ status: "polite",
1450
+ timer: "assertive"
1451
+ }, Xr = (e, t) => {
1452
+ switch (t == null ? void 0 : t.type) {
1453
+ case gt:
1454
+ return {
1455
+ ...e,
1456
+ announcement: t.payload
1457
+ };
1458
+ case ut:
1459
+ return {
1460
+ ...e,
1461
+ announcement: null
1462
+ };
1463
+ default:
1464
+ return e;
1465
+ }
1466
+ }, Yr = ({
1467
+ onAnnouncementClear: e,
1468
+ dispatch: t
1469
+ }) => {
1470
+ t({
1471
+ type: ut
1472
+ }), typeof e == "function" && e();
1473
+ }, De = ({
1474
+ children: e,
1475
+ clearAnnouncementDelay: t,
1476
+ clearAnnouncementTimeoutRef: r,
1477
+ onAnnouncementClear: a,
1478
+ dispatch: o
1479
+ }) => {
1480
+ clearTimeout(r.current), e !== null && o({
1481
+ type: gt,
1482
+ payload: e
1483
+ }), t && (r.current = setTimeout(
1484
+ () => Yr({
1485
+ onAnnouncementClear: a,
1486
+ dispatch: o
1487
+ }),
1488
+ t
1489
+ ));
1490
+ }, Zr = ({
1491
+ children: e,
1492
+ announcementTimeoutRef: t,
1493
+ announcementDelay: r,
1494
+ clearAnnouncementDelay: a,
1495
+ clearAnnouncementTimeoutRef: o,
1496
+ onAnnouncementClear: n,
1497
+ dispatch: s
1498
+ }) => {
1499
+ clearTimeout(t.current), r ? t.current = setTimeout(De, r, {
1500
+ children: e,
1501
+ clearAnnouncementDelay: a,
1502
+ clearAnnouncementTimeoutRef: o,
1503
+ onAnnouncementClear: n,
1504
+ dispatch: s
1505
+ }) : De({
1506
+ children: e,
1507
+ clearAnnouncementDelay: a,
1508
+ clearAnnouncementTimeoutRef: o,
1509
+ onAnnouncementClear: n,
1510
+ dispatch: s
1511
+ });
1512
+ };
1513
+ function ea({
1514
+ children: e,
1515
+ className: t,
1516
+ politeness: r,
1517
+ role: a = null,
1518
+ announcementDelay: o,
1519
+ clearAnnouncementDelay: n,
1520
+ onAnnouncementClear: s,
1521
+ visible: c,
1522
+ ...d
1523
+ }) {
1524
+ const g = v(null), u = v(null), [h, m] = Q(Xr, {
1525
+ announcement: null
1526
+ });
1527
+ let p = r;
1528
+ typeof p > "u" && (p = a ? Qr[a] : "assertive"), x(() => {
1529
+ Zr({
1530
+ announcementTimeoutRef: g,
1531
+ announcementDelay: o,
1532
+ children: e,
1533
+ clearAnnouncementDelay: n,
1534
+ clearAnnouncementTimeoutRef: u,
1535
+ onAnnouncementClear: s,
1536
+ dispatch: m
1537
+ });
1538
+ }, [
1539
+ e,
1540
+ o,
1541
+ n,
1542
+ s
1543
+ ]);
1544
+ const b = i(t, {
1545
+ "sr-only": !c
1546
+ });
1547
+ return /* @__PURE__ */ l(
1548
+ "div",
1549
+ {
1550
+ "aria-live": p,
1551
+ ...a && { role: a },
1552
+ className: b,
1553
+ ...d,
1554
+ children: h.announcement
1555
+ }
1556
+ );
1557
+ }
1558
+ /*!
1559
+ @versini/ui-liveregion v1.2.8
1560
+ © 2025 gizmette.com
1561
+ */
1562
+ try {
1563
+ window.__VERSINI_UI_LIVEREGION__ || (window.__VERSINI_UI_LIVEREGION__ = {
1564
+ version: "1.2.8",
1565
+ buildTime: "01/02/2025 05:13 PM EST",
1566
+ homepage: "https://github.com/aversini/ui-components",
1567
+ license: "MIT"
1568
+ });
1569
+ } catch {
1570
+ }
1571
+ const ta = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", ra = ({ mode: e }) => i({
1572
+ "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
1573
+ "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
1574
+ "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
1575
+ "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
1576
+ }), aa = ({
1577
+ focusMode: e
1578
+ }) => i("focus:outline focus:outline-2 focus:outline-offset-2", {
1579
+ "focus:outline-focus-dark": e === "dark",
1580
+ "focus:outline-focus-light": e === "light",
1581
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1582
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1583
+ }), oa = ({
1584
+ noBorder: e,
1585
+ error: t
1586
+ }) => i("border-2", {
1587
+ "border-border-dark": !e && !t,
1588
+ "focus:border-border-dark": !e && t,
1589
+ "border-border-error-dark": !e && t,
1590
+ "border-transparent": e
1591
+ }), na = ({
1592
+ disabled: e,
1593
+ raw: t,
1594
+ error: r,
1595
+ mode: a,
1596
+ leftElement: o,
1597
+ rightElement: n
1598
+ }) => {
1599
+ if (t)
1600
+ return "";
1601
+ if (e)
1602
+ return i(
1603
+ "transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
1604
+ {
1605
+ "translate-x-[12px]": n === !0 && !o || !n && !o
1606
+ }
1607
+ );
1608
+ if (!r)
1609
+ return i(
1610
+ "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
1611
+ {
1612
+ "translate-x-[12px]": n === !0 && !o || !n && !o,
1613
+ "text-copy-medium": a === "dark",
1614
+ "text-copy-dark": a === "light",
1615
+ "text-copy-dark dark:text-copy-medium": a === "system",
1616
+ "text-copy-medium dark:text-copy-dark": a === "alt-system"
1617
+ }
1618
+ );
1619
+ if (r)
1620
+ return i(
1621
+ "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
1622
+ {
1623
+ "translate-x-[12px]": n === !0 && !o || !n && !o,
1624
+ "text-copy-medium": a === "dark",
1625
+ "text-copy-error-dark": a === "light",
1626
+ "text-copy-error-dark dark:text-copy-error-light": a === "system",
1627
+ "text-copy-medium dark:text-copy-error-dark": a === "alt-system"
1628
+ }
1629
+ );
1630
+ }, ia = ({
1631
+ error: e,
1632
+ raw: t,
1633
+ mode: r,
1634
+ disabled: a
1635
+ }) => {
1636
+ if (t)
1637
+ return "";
1638
+ if (a)
1639
+ return i(
1640
+ se,
1641
+ "absolute px-2 cursor-not-allowed opacity-50 font-medium"
1642
+ );
1643
+ if (!e)
1644
+ return i(se, "absolute px-2 font-medium", {
1645
+ "text-copy-medium": r === "dark",
1646
+ "text-copy-dark": r === "light",
1647
+ "text-copy-dark dark:text-copy-medium": r === "system",
1648
+ "text-copy-medium dark:text-copy-dark": r === "alt-system"
1649
+ });
1650
+ if (e)
1651
+ return i(se, "absolute px-2 font-medium", {
1652
+ "text-copy-error-light": r === "dark",
1653
+ "text-copy-error-dark": r === "light",
1654
+ "text-copy-error-dark dark:text-copy-error-light": r === "system",
1655
+ "dark:text-copy-error-dark text-copy-error-light": r === "alt-system"
1656
+ });
1657
+ }, sa = ({
1658
+ className: e,
1659
+ textAreaClassName: t,
1660
+ raw: r,
1661
+ focusMode: a,
1662
+ disabled: o,
1663
+ noBorder: n,
1664
+ error: s,
1665
+ mode: c,
1666
+ leftElement: d,
1667
+ rightElement: g
1668
+ }) => {
1669
+ const u = r ? e : i(
1670
+ "relative flex w-full flex-col justify-center",
1671
+ Dr,
1672
+ e
1673
+ ), h = r ? i(t) : i(
1674
+ dt,
1675
+ t,
1676
+ ta(),
1677
+ ra({ mode: c }),
1678
+ aa({ focusMode: a }),
1679
+ oa({
1680
+ noBorder: n,
1681
+ error: s
1682
+ }),
1683
+ {
1684
+ "disabled:cursor-not-allowed disabled:opacity-50": o
1685
+ }
1686
+ ), m = r ? void 0 : "sr-only", p = na({
1687
+ disabled: o,
1688
+ raw: r,
1689
+ error: s,
1690
+ mode: c,
1691
+ rightElement: g,
1692
+ leftElement: d
1693
+ }), b = ia({
1694
+ error: s,
1695
+ raw: r,
1696
+ mode: c,
1697
+ disabled: o
1698
+ }), f = r ? void 0 : i(Gr, "absolute"), y = r ? void 0 : i(Fr, "absolute");
1699
+ return {
1700
+ wrapper: u,
1701
+ textArea: h,
1702
+ accessibleLabel: m,
1703
+ visibleLabel: p,
1704
+ helperText: b,
1705
+ rightElement: f,
1706
+ leftElement: y
1707
+ };
1708
+ }, la = ({
1709
+ scrollHeight: e,
1710
+ currentHeight: t,
1711
+ currentLabelOffset: r = 0,
1712
+ currentHelperTextOffset: a = 0
1713
+ }) => {
1714
+ let o, n;
1715
+ if (e > 0 && e !== t) {
1716
+ const s = e - t, c = Math.abs(s / 24);
1717
+ o = r + -1 * Math.sign(s) * (12 * c), n = a + Math.sign(s) * (12 * c);
1718
+ }
1719
+ return {
1720
+ labelOffset: o,
1721
+ helperTextOffset: n,
1722
+ scrollHeight: e
1723
+ };
1724
+ }, mt = I.forwardRef(
1725
+ ({
1726
+ id: e,
1727
+ name: t,
1728
+ label: r,
1729
+ error: a = !1,
1730
+ raw: o = !1,
1731
+ className: n,
1732
+ textAreaClassName: s,
1733
+ mode: c = "system",
1734
+ focusMode: d = "system",
1735
+ value: g,
1736
+ defaultValue: u,
1737
+ disabled: h = !1,
1738
+ noBorder: m = !1,
1739
+ labelId: p,
1740
+ helperText: b = "",
1741
+ helperTextOnFocus: f = !1,
1742
+ rightElement: y,
1743
+ leftElement: _,
1744
+ onChange: T,
1745
+ onFocus: N,
1746
+ onBlur: R,
1747
+ ...E
1748
+ }, M) => {
1749
+ var Ne;
1750
+ const B = v(null), xt = jr([M, B]), [_t, J] = Pe(), [wt, H] = Pe(), re = v(80), Ee = v(-25), L = v(null), Se = v(30), ae = v(null), W = Jr({ id: e, prefix: `${dt}-` }), [Ce, Tt] = S(0), [Ie, Nt] = S(0), [Et, Re] = S(
1751
+ !!(!f && b)
1752
+ ), St = `${t} error, ${b}`, O = sa({
1753
+ className: n,
1754
+ textAreaClassName: s,
1755
+ error: a,
1756
+ raw: o,
1757
+ focusMode: d,
1758
+ disabled: h,
1759
+ noBorder: m,
1760
+ mode: c,
1761
+ rightElement: !!y,
1762
+ leftElement: !!_
1763
+ }), [A, Ct] = Kr({
1764
+ value: g,
1765
+ initialControlledDelay: 20,
1766
+ defaultValue: u,
1767
+ onChange: (C) => {
1768
+ T && T({
1769
+ target: {
1770
+ value: C
1771
+ }
1772
+ });
1773
+ }
1774
+ }), It = (C) => {
1775
+ Ct(C.target.value);
1776
+ }, Rt = (C) => {
1777
+ f && b && Re(!0), N && N(C);
1778
+ }, $t = (C) => {
1779
+ f && b && !A && Re(!1), R && R(C);
1780
+ };
1781
+ return P(() => {
1782
+ J && J.width && Tt(J.width + 18 + 10);
1783
+ }, [J]), P(() => {
1784
+ H && H.width && Nt(H.width + 18 + 10);
1785
+ }, [H]), P(() => {
1786
+ o || B && B.current && A !== void 0 && (B.current.style.height = "inherit", B.current.style.height = B.current.scrollHeight + "px");
1787
+ }, [A, o]), P(() => {
1788
+ o || setTimeout(() => {
1789
+ var C;
1790
+ (C = L == null ? void 0 : L.current) == null || C.style.setProperty(
1791
+ "--av-text-area-wrapper-transition",
1792
+ A ? "none" : "all 0.2s ease-out"
1793
+ );
1794
+ }, 0);
1795
+ }, [A, o]), P(() => {
1796
+ var C, $e;
1797
+ if (!o && B && B.current && A !== void 0) {
1798
+ const { labelOffset: oe, helperTextOffset: ne, scrollHeight: Bt } = la({
1799
+ scrollHeight: B.current.scrollHeight,
1800
+ currentHeight: re.current,
1801
+ currentLabelOffset: Ee.current,
1802
+ currentHelperTextOffset: Se.current
1803
+ });
1804
+ oe && (Ee.current = oe, (C = L == null ? void 0 : L.current) == null || C.style.setProperty(
1805
+ "--av-text-area-label",
1806
+ `${oe}px`
1807
+ )), ne && (Se.current = ne, ($e = ae == null ? void 0 : ae.current) == null || $e.style.setProperty(
1808
+ "--av-text-area-helper-text",
1809
+ `${ne}px`
1810
+ )), re.current = Bt || re.current;
1811
+ }
1812
+ }, [A, o]), H.width > 0 && ((Ne = L == null ? void 0 : L.current) == null || Ne.style.setProperty(
1813
+ "--tw-translate-x",
1814
+ `${12 + H.width + 5}px`
1815
+ )), /* @__PURE__ */ k("div", { className: O.wrapper, children: [
1816
+ /* @__PURE__ */ l(
1817
+ "label",
1818
+ {
1819
+ htmlFor: W,
1820
+ id: p,
1821
+ className: O.accessibleLabel,
1822
+ children: r
1823
+ }
1824
+ ),
1825
+ _ && /* @__PURE__ */ l(
1826
+ "div",
1827
+ {
1828
+ ref: wt,
1829
+ className: O.leftElement,
1830
+ children: _
1831
+ }
1832
+ ),
1833
+ /* @__PURE__ */ l(
1834
+ "textarea",
1835
+ {
1836
+ ref: xt,
1837
+ id: W,
1838
+ name: t,
1839
+ disabled: h,
1840
+ placeholder: o ? void 0 : " ",
1841
+ className: O.textArea,
1842
+ rows: 1,
1843
+ ...b && { "aria-describedby": `${W}-helper` },
1844
+ ...a && { "aria-invalid": "true" },
1845
+ ...y && !_ && !o && { style: { paddingRight: Ce } },
1846
+ ..._ && !y && !o && { style: { paddingLeft: Ie } },
1847
+ ...y && _ && !o && {
1848
+ style: {
1849
+ paddingRight: Ce,
1850
+ paddingLeft: Ie
1851
+ }
1852
+ },
1853
+ value: A,
1854
+ onChange: It,
1855
+ onFocus: Rt,
1856
+ onBlur: $t,
1857
+ ...E
1858
+ }
1859
+ ),
1860
+ !o && /* @__PURE__ */ l(
1861
+ "label",
1862
+ {
1863
+ ref: L,
1864
+ "aria-hidden": !0,
1865
+ htmlFor: W,
1866
+ className: `${O.visibleLabel}`,
1867
+ children: r
1868
+ }
1869
+ ),
1870
+ Et && /* @__PURE__ */ l(
1871
+ "div",
1872
+ {
1873
+ ref: ae,
1874
+ id: `${W}-helper`,
1875
+ className: O.helperText,
1876
+ children: b
1877
+ }
1878
+ ),
1879
+ y && /* @__PURE__ */ l(
1880
+ "div",
1881
+ {
1882
+ ref: _t,
1883
+ className: O.rightElement,
1884
+ children: y
1885
+ }
1886
+ ),
1887
+ a && b && /* @__PURE__ */ l(ea, { politeness: "polite", clearAnnouncementDelay: 500, children: St })
1888
+ ] });
1889
+ }
1890
+ );
1891
+ mt.displayName = "TextArea";
1892
+ const ca = ({
1893
+ mode: e = "light",
1894
+ focusMode: t = "light",
1895
+ radius: r = "small"
1896
+ }) => {
1897
+ const { state: a, dispatch: o } = $(F), n = v(null), s = v(!1), c = (d) => {
1898
+ d.preventDefault(), o({
1899
+ type: qe
1900
+ });
1901
+ };
1902
+ return x(() => {
1903
+ var d;
1904
+ (a == null ? void 0 : a.streaming) === !0 && !s.current && n.current && (s.current = !0, n.current.focus()), (a == null ? void 0 : a.streaming) === !1 && (s.current = !1, (d = n.current) == null || d.blur());
1905
+ }, [a]), /* @__PURE__ */ l(
1906
+ et,
1907
+ {
1908
+ noBorder: !0,
1909
+ radius: r,
1910
+ mode: e,
1911
+ focusMode: t,
1912
+ ref: n,
1913
+ onClick: c,
1914
+ children: a != null && a.streaming ? /* @__PURE__ */ l(Yt, { size: "size-4", monotone: !0 }) : /* @__PURE__ */ l(Xt, { size: "size-4", monotone: !0 })
1915
+ }
1916
+ );
1917
+ }, X = (e, t) => {
1918
+ e({
1919
+ type: Qe,
1920
+ payload: {
1921
+ streaming: t
1922
+ }
1923
+ });
1924
+ }, Ge = (e) => {
1925
+ X(e, !1), e({
1926
+ type: q,
1927
+ payload: {
1928
+ message: {
1929
+ role: he,
1930
+ content: Ht
1931
+ }
1932
+ }
1933
+ });
1934
+ }, da = () => {
1935
+ const { state: e, dispatch: t } = $(F), { state: r, dispatch: a } = $(ve), [o, n] = S(""), { getAccessToken: s, user: c } = Z(), d = v(null), g = v(
1936
+ null
1937
+ );
1938
+ x(() => {
1939
+ (async () => {
1940
+ var m;
1941
+ if (!e || e.messages.length === 0) {
1942
+ (m = g == null ? void 0 : g.current) == null || m.cancel();
1943
+ return;
1944
+ }
1945
+ const h = e.messages[e.messages.length - 1];
1946
+ if (!(e.messages.length === 0 || h.message.role === K || h.message.role === Lt || h.message.role === he || h.message.role === Ot))
1947
+ try {
1948
+ const p = await Hr({
1949
+ accessToken: await s(),
1950
+ name: "generate",
1951
+ data: {
1952
+ messages: e.messages,
1953
+ model: e.engine || V,
1954
+ user: (c == null ? void 0 : c.username) || "",
1955
+ id: e.id,
1956
+ usage: e.usage
1957
+ }
1958
+ });
1959
+ if (p && p.ok) {
1960
+ const b = ke();
1961
+ g.current = p.body.getReader();
1962
+ const f = new TextDecoder();
1963
+ for (; ; ) {
1964
+ X(t, !0);
1965
+ const { done: y, value: _ } = await g.current.read();
1966
+ if (y) {
1967
+ X(t, !1);
1968
+ break;
1969
+ }
1970
+ const T = f.decode(_, { stream: !0 }), N = T.indexOf(Be);
1971
+ if (N !== -1) {
1972
+ const R = T.substring(0, N), E = JSON.parse(
1973
+ T.substring(N + Be.length)
1974
+ );
1975
+ t({
1976
+ type: Ke,
1977
+ payload: {
1978
+ model: E.model,
1979
+ usage: E.usage
1980
+ }
1981
+ }), t({
1982
+ type: q,
1983
+ payload: {
1984
+ message: {
1985
+ content: R,
1986
+ role: K,
1987
+ messageId: b,
1988
+ processingTime: E.processingTime,
1989
+ name: E.name
1990
+ }
1991
+ }
1992
+ }), X(t, !1);
1993
+ break;
1994
+ } else
1995
+ t({
1996
+ type: q,
1997
+ payload: {
1998
+ message: {
1999
+ content: T,
2000
+ role: K,
2001
+ messageId: b
2002
+ }
2003
+ }
2004
+ });
2005
+ }
2006
+ } else
2007
+ Ge(t);
2008
+ } catch (p) {
2009
+ console.error(p), Ge(t);
2010
+ }
2011
+ })();
2012
+ }, [e == null ? void 0 : e.messages]);
2013
+ const u = async (h) => {
2014
+ h.preventDefault(), t({
2015
+ type: q,
2016
+ payload: {
2017
+ message: {
2018
+ role: le,
2019
+ content: o
2020
+ }
2021
+ }
2022
+ }), n("");
2023
+ };
2024
+ return x(() => {
2025
+ if (r.tag !== "") {
2026
+ const h = r.tag.endsWith(":") && !r.tag.endsWith(": ") ? r.tag + " " : r.tag;
2027
+ h.indexOf(Ae) !== -1 ? navigator.clipboard.readText().then((p) => {
2028
+ n(h.replace(Ae, p));
2029
+ }) : n(h), d.current && d.current.focus(), a({
2030
+ type: Ye
2031
+ });
2032
+ }
2033
+ }, [r, a]), x(() => {
2034
+ e && e.usage === 0 && e.messages.length === 0 && d.current && d.current.focus();
2035
+ }, [e]), /* @__PURE__ */ l(Y, { children: /* @__PURE__ */ l("form", { className: "mt-2", onSubmit: u, children: /* @__PURE__ */ l(
2036
+ mt,
2037
+ {
2038
+ mode: "dark",
2039
+ focusMode: "light",
2040
+ ref: d,
2041
+ name: "chat-input",
2042
+ label: Vt,
2043
+ helperText: "Press ENTER to add a new line",
2044
+ helperTextOnFocus: !0,
2045
+ required: !0,
2046
+ value: o,
2047
+ onChange: (h) => n(h.target.value),
2048
+ onKeyDown: nr([["mod+Enter", u]]),
2049
+ leftElement: /* @__PURE__ */ l(ca, {}),
2050
+ rightElement: /* @__PURE__ */ l(
2051
+ tt,
2052
+ {
2053
+ disabled: e == null ? void 0 : e.streaming,
2054
+ noBorder: !0,
2055
+ type: "submit",
2056
+ mode: "light",
2057
+ focusMode: "light",
2058
+ children: Ut
2059
+ }
2060
+ )
2061
+ }
2062
+ ) }) });
2063
+ }, ga = () => {
2064
+ const { dispatch: e, state: t } = $(ve), { getAccessToken: r, user: a } = Z(), [o, n] = S({
2065
+ loaded: !1
2066
+ }), s = "mt-2 flex justify-center rounded-md", c = (d, g) => {
2067
+ d.preventDefault(), e({
2068
+ type: Ze,
2069
+ payload: {
2070
+ tag: g
2071
+ }
2072
+ });
2073
+ };
2074
+ return x(() => {
2075
+ if (!a) {
2076
+ n({
2077
+ loaded: !1
2078
+ });
2079
+ return;
2080
+ }
2081
+ o.loaded || (async () => {
2082
+ try {
2083
+ const d = await ct({
2084
+ accessToken: await r(),
2085
+ type: st.GET_USER_PREFERENCES,
2086
+ params: {
2087
+ user: a.username
2088
+ }
2089
+ });
2090
+ d.status === 200 && (e({
2091
+ type: Xe,
2092
+ payload: {
2093
+ tags: d.data.tags || []
2094
+ }
2095
+ }), n({
2096
+ loaded: !0
2097
+ }));
2098
+ } catch {
2099
+ }
2100
+ })();
2101
+ }, [a]), /* @__PURE__ */ l(Y, { children: /* @__PURE__ */ l(Pt, { alignHorizontal: "center", columnGap: 2, children: o && o.loaded && t.tags && t.tags.map((d) => d.enabled && d.label && d.content && /* @__PURE__ */ l(Dt, { children: /* @__PURE__ */ l("div", { className: s, children: /* @__PURE__ */ l(
2102
+ tt,
2103
+ {
2104
+ noBorder: !0,
2105
+ mode: "dark",
2106
+ focusMode: "light",
2107
+ size: "small",
2108
+ onClick: (g) => c(g, d.content),
2109
+ children: d.label
2110
+ }
2111
+ ) }) }, `tag-button-${d.slot}`)) }) });
2112
+ }, ua = () => {
2113
+ const { state: e } = $(F), t = v(!1), r = window.innerWidth < 403, [a, o] = S(
2114
+ r ? "bottom-10" : "top-[245px]"
2115
+ );
2116
+ return x(() => {
2117
+ r || e && (!t.current && e.streaming && o("bottom-10"), t.current = !!e.streaming);
2118
+ }, [e, r]), x(() => {
2119
+ r || (e && e.messages.length === 0 && o("top-[245px]"), e && !e.streaming && e.messages.length > 0 && o("bottom-10"));
2120
+ }, [e, r]), /* @__PURE__ */ k(
2121
+ "footer",
2122
+ {
2123
+ className: i(
2124
+ "md:mx-auto md:max-w-4xl w-11/12 fixed left-1/2 transform -translate-x-1/2 z-1000",
2125
+ a
2126
+ ),
2127
+ children: [
2128
+ /* @__PURE__ */ l(ga, {}),
2129
+ /* @__PURE__ */ l(da, {})
2130
+ ]
2131
+ }
2132
+ );
2133
+ };
2134
+ /*!
2135
+ @versini/ui-bubble v2.0.13
2136
+ © 2025 gizmette.com
2137
+ */
2138
+ try {
2139
+ window.__VERSINI_UI_BUBBLE__ || (window.__VERSINI_UI_BUBBLE__ = {
2140
+ version: "2.0.13",
2141
+ buildTime: "01/02/2025 05:13 PM EST",
2142
+ homepage: "https://github.com/aversini/ui-components",
2143
+ license: "MIT"
2144
+ });
2145
+ } catch {
2146
+ }
2147
+ const ma = "av-bubble", Fe = "av-button", te = "icon", ht = "button", ge = "link", ha = ({
2148
+ type: e,
2149
+ size: t,
2150
+ labelRight: r,
2151
+ labelLeft: a,
2152
+ align: o
2153
+ }) => {
2154
+ const n = "max-h-8 py-0 px-2", s = "max-h-9 py-1 px-3", c = "max-h-12 py-2 px-4";
2155
+ switch (e) {
2156
+ case ht:
2157
+ case ge:
2158
+ return i({
2159
+ [n]: t === "small",
2160
+ [s]: t === "medium",
2161
+ [c]: t === "large"
2162
+ });
2163
+ case te:
2164
+ return i("inline-flex items-center", {
2165
+ "justify-center": o === "center",
2166
+ "justify-start": o === "left",
2167
+ "justify-end": o === "right",
2168
+ "h-6 w-6 p-0": t === "small" && !(r || a),
2169
+ "h-6 px-2": t === "small" && (r || a),
2170
+ "h-8 w-8 p-1": t === "medium" && !(r || a),
2171
+ "h-8 px-3": t === "medium" && (r || a),
2172
+ "h-12 w-12 p-2": t === "large" && !(r || a),
2173
+ "h-12 px-4": t === "large" && (r || a)
2174
+ });
2175
+ }
2176
+ }, pa = ({
2177
+ type: e,
2178
+ size: t,
2179
+ labelRight: r,
2180
+ labelLeft: a
2181
+ }) => {
2182
+ const o = "text-sm font-medium", n = "text-base font-medium", s = "text-lg font-medium";
2183
+ switch (e) {
2184
+ case ht:
2185
+ case ge:
2186
+ return i({
2187
+ "text-center": e === ge,
2188
+ [o]: t === "small",
2189
+ [n]: t === "medium",
2190
+ [s]: t === "large"
2191
+ });
2192
+ case te:
2193
+ return i({
2194
+ [o]: t === "small" && (r || a),
2195
+ [n]: t === "medium" && (r || a),
2196
+ [s]: t === "large" && (r || a)
2197
+ });
2198
+ }
2199
+ }, ba = ({
2200
+ mode: e,
2201
+ noBackground: t,
2202
+ noTruncate: r,
2203
+ variant: a
2204
+ }) => {
2205
+ if (t)
2206
+ return "not-prose";
2207
+ if (a === "primary")
2208
+ return i("not-prose", {
2209
+ truncate: !r,
2210
+ "text-copy-light": e === "dark",
2211
+ "text-copy-lighter": e === "light",
2212
+ "text-copy-light dark:text-copy-lighter": e === "system",
2213
+ "text-copy-lighter dark:text-copy-light": e === "alt-system"
2214
+ });
2215
+ if (a === "secondary")
2216
+ return i("not-prose", {
2217
+ truncate: !r,
2218
+ "text-copy-light": e === "light",
2219
+ "text-copy-lighter": e === "dark",
2220
+ "text-copy-light dark:text-copy-lighter": e === "alt-system",
2221
+ "text-copy-lighter dark:text-copy-light": e === "system"
2222
+ });
2223
+ if (a === "danger")
2224
+ return i("not-prose", {
2225
+ truncate: !r,
2226
+ "text-copy-light": e === "dark",
2227
+ "text-copy-lighter": e === "light",
2228
+ "text-copy-light dark:text-copy-lighter": e === "system",
2229
+ "text-copy-lighter dark:text-copy-light": e === "alt-system"
2230
+ });
2231
+ if (a === "selected")
2232
+ return i("not-prose", {
2233
+ truncate: !r,
2234
+ "text-copy-light": e === "dark",
2235
+ "text-copy-lighter": e === "light",
2236
+ "text-copy-light dark:text-copy-lighter": e === "system",
2237
+ "text-copy-lighter dark:text-copy-light": e === "alt-system"
2238
+ });
2239
+ }, ya = ({
2240
+ mode: e,
2241
+ noBackground: t,
2242
+ variant: r
2243
+ }) => {
2244
+ if (!t) {
2245
+ if (r === "primary")
2246
+ return i({
2247
+ "bg-action-dark": e === "dark",
2248
+ "bg-action-light": e === "light",
2249
+ "bg-action-dark dark:bg-action-light": e === "system",
2250
+ "bg-action-light dark:bg-action-dark": e === "alt-system"
2251
+ });
2252
+ if (r === "secondary")
2253
+ return i({
2254
+ "bg-action-dark": e === "light",
2255
+ "bg-action-light": e === "dark",
2256
+ "bg-action-dark dark:bg-action-light": e === "alt-system",
2257
+ "bg-action-light dark:bg-action-dark": e === "system"
2258
+ });
2259
+ if (r === "danger")
2260
+ return i({
2261
+ "bg-action-danger-dark": e === "dark",
2262
+ "bg-action-danger-light": e === "light",
2263
+ "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
2264
+ "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
2265
+ });
2266
+ if (r === "selected")
2267
+ return "bg-action-selected-dark";
2268
+ }
2269
+ }, fa = ({
2270
+ radius: e
2271
+ }) => i({
2272
+ "rounded-full": e === "large",
2273
+ "rounded-md": e === "medium",
2274
+ "rounded-sm": e === "small"
2275
+ }), ka = ({
2276
+ mode: e,
2277
+ disabled: t,
2278
+ variant: r
2279
+ }) => {
2280
+ if (t)
2281
+ return "";
2282
+ if (r === "primary")
2283
+ return i("hover:text-copy-light-hover", {
2284
+ "hover:bg-action-dark-hover": e === "dark",
2285
+ "hover:bg-action-light-hover": e === "light",
2286
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
2287
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
2288
+ });
2289
+ if (r === "secondary")
2290
+ return i("hover:text-copy-light-hover", {
2291
+ "hover:bg-action-dark-hover": e === "light",
2292
+ "hover:bg-action-light-hover": e === "dark",
2293
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
2294
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
2295
+ });
2296
+ if (r === "danger")
2297
+ return i("hover:text-copy-light-hover", {
2298
+ "hover:bg-action-danger-dark-hover": e === "dark",
2299
+ "hover:bg-action-danger-light-hover": e === "light",
2300
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
2301
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
2302
+ });
2303
+ if (r === "selected")
2304
+ return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
2305
+ }, va = ({
2306
+ mode: e,
2307
+ disabled: t,
2308
+ variant: r
2309
+ }) => {
2310
+ if (t)
2311
+ return "";
2312
+ if (r === "primary")
2313
+ return i("active:text-copy-light-active", {
2314
+ "active:bg-action-dark-active": e === "dark",
2315
+ "active:bg-action-light-active": e === "light",
2316
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
2317
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
2318
+ });
2319
+ if (r === "secondary")
2320
+ return i("active:text-copy-light-active", {
2321
+ "active:bg-action-dark-active": e === "light",
2322
+ "active:bg-action-light-active": e === "dark",
2323
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
2324
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
2325
+ });
2326
+ if (r === "danger")
2327
+ return i("active:text-copy-lighter-active", {
2328
+ "active:bg-action-danger-dark-active": e === "dark",
2329
+ "active:bg-action-danger-light-active": e === "light",
2330
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
2331
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
2332
+ });
2333
+ if (r === "selected")
2334
+ return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
2335
+ }, xa = ({
2336
+ mode: e,
2337
+ noBorder: t,
2338
+ variant: r
2339
+ }) => {
2340
+ if (t)
2341
+ return "border border-transparent";
2342
+ if (r === "primary")
2343
+ return i("border", {
2344
+ "border-border-dark": e === "dark",
2345
+ "border-border-accent": e === "light",
2346
+ "border-border-dark dark:border-border-accent": e === "system",
2347
+ "border-border-accent dark:border-border-dark": e === "alt-system"
2348
+ });
2349
+ if (r === "secondary")
2350
+ return i("border", {
2351
+ "border-border-dark": e === "light",
2352
+ "border-border-accent": e === "dark",
2353
+ "border-border-dark dark:border-border-accent": e === "alt-system",
2354
+ "border-border-accent dark:border-border-dark": e === "system"
2355
+ });
2356
+ if (r === "danger")
2357
+ return i("border", {
2358
+ "border-border-danger-dark": e === "dark",
2359
+ "border-border-danger-medium": e === "light",
2360
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
2361
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
2362
+ });
2363
+ if (r === "selected")
2364
+ return "border border-border-selected-dark";
2365
+ }, _a = ({
2366
+ focusMode: e
2367
+ }) => i("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
2368
+ "focus:outline-focus-dark": e === "dark",
2369
+ "focus:outline-focus-light": e === "light",
2370
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
2371
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
2372
+ }), pt = ({
2373
+ type: e,
2374
+ className: t,
2375
+ raw: r,
2376
+ mode: a,
2377
+ focusMode: o,
2378
+ disabled: n,
2379
+ fullWidth: s,
2380
+ size: c,
2381
+ noBorder: d,
2382
+ labelRight: g,
2383
+ labelLeft: u,
2384
+ noBackground: h,
2385
+ variant: m,
2386
+ noTruncate: p,
2387
+ align: b,
2388
+ radius: f
2389
+ }) => (m || (m = "primary"), r ? i(Fe, t) : i(
2390
+ Fe,
2391
+ ba({
2392
+ mode: a,
2393
+ variant: m,
2394
+ noBackground: h,
2395
+ noTruncate: p
2396
+ }),
2397
+ ya({ mode: a, noBackground: h, variant: m }),
2398
+ fa({ radius: f }),
2399
+ ha({
2400
+ type: e,
2401
+ size: c,
2402
+ labelRight: g,
2403
+ labelLeft: u,
2404
+ align: b
2405
+ }),
2406
+ pa({ type: e, size: c, labelRight: g, labelLeft: u }),
2407
+ xa({ mode: a, variant: m, noBorder: d }),
2408
+ _a({ focusMode: o }),
2409
+ ka({ mode: a, variant: m, disabled: n }),
2410
+ va({ mode: a, variant: m, disabled: n }),
2411
+ {
2412
+ "w-full": s,
2413
+ "disabled:cursor-not-allowed disabled:opacity-50": n
2414
+ },
2415
+ t
2416
+ )), wa = (e, t, r) => {
2417
+ var a;
2418
+ !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
2419
+ }, xe = I.forwardRef((e, t) => {
2420
+ const { onClick: r, noInternalClick: a = !1, ...o } = e;
2421
+ return /* @__PURE__ */ l(
2422
+ "button",
2423
+ {
2424
+ ref: t,
2425
+ onClick: (n) => {
2426
+ wa(n, a, r);
2427
+ },
2428
+ ...o
2429
+ }
2430
+ );
2431
+ });
2432
+ xe.displayName = "BaseButton";
2433
+ const bt = I.forwardRef(
2434
+ ({
2435
+ children: e,
2436
+ disabled: t = !1,
2437
+ mode: r = "system",
2438
+ focusMode: a = "system",
2439
+ fullWidth: o = !1,
2440
+ className: n,
2441
+ type: s = "button",
2442
+ raw: c = !1,
2443
+ noBorder: d = !1,
2444
+ "aria-label": g,
2445
+ label: u,
2446
+ size: h = "medium",
2447
+ labelRight: m,
2448
+ labelLeft: p,
2449
+ noBackground: b = !1,
2450
+ align: f = "center",
2451
+ radius: y = "large",
2452
+ variant: _ = "primary",
2453
+ ...T
2454
+ }, N) => {
2455
+ const R = pt({
2456
+ type: te,
2457
+ mode: r,
2458
+ focusMode: a,
2459
+ fullWidth: o,
2460
+ disabled: t,
2461
+ raw: c,
2462
+ className: n,
2463
+ noBorder: d,
2464
+ size: h,
2465
+ labelRight: m,
2466
+ labelLeft: p,
2467
+ noBackground: b,
2468
+ align: f,
2469
+ radius: y,
2470
+ variant: _
2471
+ }), E = i({
2472
+ "text-copy-accent-dark": r === "light" && !c,
2473
+ "text-copy-light": r === "dark" && !c,
2474
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
2475
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !c
2476
+ });
2477
+ return /* @__PURE__ */ k(
2478
+ xe,
2479
+ {
2480
+ ref: N,
2481
+ className: R,
2482
+ disabled: t,
2483
+ type: s,
2484
+ "aria-label": g || u,
2485
+ ...T,
2486
+ children: [
2487
+ p && /* @__PURE__ */ l("span", { className: "pr-2", children: p }),
2488
+ /* @__PURE__ */ l("div", { className: E, children: e }),
2489
+ m && /* @__PURE__ */ l("span", { className: "pl-2", children: m })
2490
+ ]
2491
+ }
2492
+ );
2493
+ }
2494
+ );
2495
+ bt.displayName = "ButtonIcon";
2496
+ /*!
2497
+ @versini/ui-button v3.2.2
2498
+ © 2025 gizmette.com
2499
+ */
2500
+ try {
2501
+ window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
2502
+ version: "3.2.2",
2503
+ buildTime: "01/02/2025 05:13 PM EST",
2504
+ homepage: "https://github.com/aversini/ui-components",
2505
+ license: "MIT"
2506
+ });
2507
+ } catch {
2508
+ }
2509
+ const Ta = I.forwardRef(
2510
+ ({
2511
+ children: e,
2512
+ disabled: t = !1,
2513
+ mode: r = "system",
2514
+ focusMode: a = "system",
2515
+ fullWidth: o = !1,
2516
+ className: n,
2517
+ type: s = "button",
2518
+ raw: c = !1,
2519
+ noBorder: d = !1,
2520
+ "aria-label": g,
2521
+ label: u,
2522
+ size: h = "medium",
2523
+ labelRight: m,
2524
+ labelLeft: p,
2525
+ noBackground: b = !1,
2526
+ align: f = "center",
2527
+ active: y = !1,
2528
+ radius: _ = "large",
2529
+ ...T
2530
+ }, N) => {
2531
+ const R = pt({
2532
+ type: te,
2533
+ mode: r,
2534
+ focusMode: a,
2535
+ fullWidth: o,
2536
+ disabled: t,
2537
+ raw: c,
2538
+ className: n,
2539
+ noBorder: d,
2540
+ size: h,
2541
+ labelRight: m,
2542
+ labelLeft: p,
2543
+ noBackground: b,
2544
+ align: f,
2545
+ radius: _
2546
+ }), E = i({
2547
+ "text-copy-accent-dark": r === "light" && !c,
2548
+ "text-copy-light": r === "dark" && !c,
2549
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
2550
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !c
2551
+ }), M = y ? i(
2552
+ "relative",
2553
+ "focus-within:static",
2554
+ "focus-within:after:border-transparent",
2555
+ "after:absolute",
2556
+ "after:content-['']",
2557
+ "after:border-b-2",
2558
+ "after:bottom-[-4px]",
2559
+ "after:left-0",
2560
+ "after:right-0",
2561
+ {
2562
+ "after:border-table-dark": r === "dark",
2563
+ "after:border-table-light": r === "light",
2564
+ "after:border-table-dark dark:after:border-table-light": r === "system",
2565
+ "after:border-table-light dark:after:border-table-dark": r === "alt-system"
2566
+ }
2567
+ ) : "";
2568
+ return /* @__PURE__ */ l("div", { className: M, children: /* @__PURE__ */ k(
2569
+ xe,
2570
+ {
2571
+ ref: N,
2572
+ className: R,
2573
+ disabled: t,
2574
+ type: s,
2575
+ "aria-label": g || u,
2576
+ ...T,
2577
+ children: [
2578
+ p && /* @__PURE__ */ l("span", { className: "pr-2", children: p }),
2579
+ /* @__PURE__ */ l("div", { className: E, children: e }),
2580
+ m && /* @__PURE__ */ l("span", { className: "pl-2", children: m })
2581
+ ]
2582
+ }
2583
+ ) });
2584
+ }
2585
+ );
2586
+ Ta.displayName = "ButtonSort";
2587
+ const yt = ({
2588
+ children: e,
2589
+ fill: t,
2590
+ viewBox: r,
2591
+ className: a,
2592
+ defaultViewBox: o,
2593
+ size: n,
2594
+ title: s,
2595
+ semantic: c = !1,
2596
+ ...d
2597
+ }) => {
2598
+ const g = i(n, a);
2599
+ return /* @__PURE__ */ k(Y, { children: [
2600
+ /* @__PURE__ */ l(
2601
+ "svg",
2602
+ {
2603
+ xmlns: "http://www.w3.org/2000/svg",
2604
+ className: g,
2605
+ viewBox: r || o,
2606
+ fill: t || "currentColor",
2607
+ role: "img",
2608
+ "aria-hidden": !c,
2609
+ focusable: !1,
2610
+ ...d,
2611
+ children: e
2612
+ }
2613
+ ),
2614
+ s && c && /* @__PURE__ */ l("span", { className: "sr-only", children: s })
2615
+ ] });
2616
+ };
2617
+ /*!
2618
+ @versini/ui-svgicon v3.0.3
2619
+ © 2025 gizmette.com
2620
+ */
2621
+ try {
2622
+ window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
2623
+ version: "3.0.3",
2624
+ buildTime: "01/02/2025 05:13 PM EST",
2625
+ homepage: "https://github.com/aversini/ui-components",
2626
+ license: "MIT"
2627
+ });
2628
+ } catch {
2629
+ }
2630
+ const Na = ({
2631
+ className: e,
2632
+ viewBox: t,
2633
+ title: r,
2634
+ monotone: a,
2635
+ ...o
2636
+ }) => /* @__PURE__ */ k(
2637
+ yt,
2638
+ {
2639
+ defaultViewBox: "0 0 448 512",
2640
+ size: "size-5",
2641
+ viewBox: t,
2642
+ className: e,
2643
+ title: r || "Copied",
2644
+ ...o,
2645
+ children: [
2646
+ /* @__PURE__ */ l(
2647
+ "path",
2648
+ {
2649
+ opacity: "0.4",
2650
+ d: "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"
2651
+ }
2652
+ ),
2653
+ /* @__PURE__ */ l("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
2654
+ ]
2655
+ }
2656
+ ), Ea = ({
2657
+ className: e,
2658
+ viewBox: t,
2659
+ title: r,
2660
+ monotone: a,
2661
+ ...o
2662
+ }) => /* @__PURE__ */ l(
2663
+ yt,
2664
+ {
2665
+ defaultViewBox: "0 0 512 512",
2666
+ size: "size-5",
2667
+ viewBox: t,
2668
+ className: e,
2669
+ title: r || "Copy",
2670
+ ...o,
2671
+ children: /* @__PURE__ */ l("path", { d: "M64 464H288c8.8 0 16-7.2 16-16V384h48v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h64v48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16zM224 304H448c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16V288c0 8.8 7.2 16 16 16zm-64-16V64c0-35.3 28.7-64 64-64H448c35.3 0 64 28.7 64 64V288c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64z" })
2672
+ }
2673
+ );
2674
+ /*!
2675
+ @versini/ui-icons v3.1.1
2676
+ © 2025 gizmette.com
2677
+ */
2678
+ try {
2679
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
2680
+ version: "3.1.1",
2681
+ buildTime: "01/02/2025 05:13 PM EST",
2682
+ homepage: "https://github.com/aversini/ui-components",
2683
+ license: "MIT"
2684
+ });
2685
+ } catch {
2686
+ }
2687
+ const Sa = () => "p-4 max-w-xs sm:max-w-md md:max-w-2xl", Ca = ({ kind: e }) => i({
2688
+ "bg-surface-lighter dark:bg-surface-dark": e === "left",
2689
+ "bg-surface-accent": e === "right"
2690
+ }), Ia = ({ kind: e }) => i(
2691
+ "prose prose-dark dark:prose-lighter prose-p:my-3 prose-blockquote:my-3 prose-ol:my-3 prose-ul:my-3 prose-ul:prose-li:marker:text-black",
2692
+ {
2693
+ "text-copy-lighter": e === "right"
2694
+ }
2695
+ ), Ra = ({ kind: e }) => i("rounded-b-xl", {
2696
+ "rounded-tr-xl": e === "left",
2697
+ "rounded-tl-xl": e === "right"
2698
+ }), $a = ({
2699
+ kind: e,
2700
+ className: t
2701
+ }) => {
2702
+ const r = i(
2703
+ ma,
2704
+ "flex items-start",
2705
+ {
2706
+ "flex-row-reverse": e === "right"
2707
+ },
2708
+ t
2709
+ ), a = i(
2710
+ "flex flex-col empty:hidden",
2711
+ Sa(),
2712
+ Ia({ kind: e }),
2713
+ Ca({ kind: e }),
2714
+ Ra({ kind: e })
2715
+ ), o = "pr-2 pt-1 text-end text-xs text-copy-light", n = i("flex flex-col-reverse gap-2 sm:flex-row", {
2716
+ "ml-2": e === "left",
2717
+ "mr-2": e === "right"
2718
+ });
2719
+ return {
2720
+ wrapper: r,
2721
+ main: a,
2722
+ footer: o,
2723
+ copyButton: n
2724
+ };
2725
+ }, Ba = ({
2726
+ children: e,
2727
+ kind: t = "left",
2728
+ className: r,
2729
+ footer: a,
2730
+ rawFooter: o,
2731
+ copyToClipboard: n,
2732
+ copyToClipboardFocusMode: s = "system",
2733
+ copyToClipboardMode: c = "system"
2734
+ }) => {
2735
+ const [d, g] = S(!1), u = $a({ kind: t, className: r }), h = !!n && (typeof n == "function" || typeof n == "string" || typeof e == "string"), m = () => {
2736
+ g(!0), typeof n == "function" ? n(e) : typeof n == "string" ? navigator.clipboard.writeText(n) : typeof e == "string" && navigator.clipboard.writeText(e);
2737
+ };
2738
+ return x(() => {
2739
+ let p;
2740
+ return d && (p = window.setTimeout(() => {
2741
+ g(!1);
2742
+ }, 3e3)), () => {
2743
+ clearTimeout(p);
2744
+ };
2745
+ }, [d]), /* @__PURE__ */ k("div", { className: u.wrapper, children: [
2746
+ /* @__PURE__ */ k("div", { children: [
2747
+ /* @__PURE__ */ l("div", { className: u.main, children: e }),
2748
+ a && Object.keys(a).map((p) => a[p] ? /* @__PURE__ */ l("div", { className: "prose-p:m-0", children: /* @__PURE__ */ k("p", { className: u.footer, children: [
2749
+ p,
2750
+ ": ",
2751
+ a[p]
2752
+ ] }) }, `-${p}`) : null),
2753
+ o && o
2754
+ ] }),
2755
+ h && /* @__PURE__ */ l("div", { className: u.copyButton, children: /* @__PURE__ */ l(
2756
+ bt,
2757
+ {
2758
+ noBorder: !0,
2759
+ noBackground: !0,
2760
+ size: "small",
2761
+ mode: c,
2762
+ focusMode: s,
2763
+ label: d ? "Copied to clipboard" : "Copy to clipboard",
2764
+ onClick: m,
2765
+ disabled: d,
2766
+ children: d ? /* @__PURE__ */ l(Na, { size: "size-3" }) : /* @__PURE__ */ l(Ea, { size: "size-3" })
2767
+ }
2768
+ ) })
2769
+ ] });
2770
+ }, We = "av-button", _e = "icon", we = "button", ue = "link", Aa = ({
2771
+ type: e,
2772
+ size: t,
2773
+ labelRight: r,
2774
+ labelLeft: a,
2775
+ align: o
2776
+ }) => {
2777
+ const n = "max-h-8 py-0 px-2", s = "max-h-9 py-1 px-3", c = "max-h-12 py-2 px-4";
2778
+ switch (e) {
2779
+ case we:
2780
+ case ue:
2781
+ return i({
2782
+ [n]: t === "small",
2783
+ [s]: t === "medium",
2784
+ [c]: t === "large"
2785
+ });
2786
+ case _e:
2787
+ return i("inline-flex items-center", {
2788
+ "justify-center": o === "center",
2789
+ "justify-start": o === "left",
2790
+ "justify-end": o === "right",
2791
+ "h-6 w-6 p-0": t === "small" && !(r || a),
2792
+ "h-6 px-2": t === "small" && (r || a),
2793
+ "h-8 w-8 p-1": t === "medium" && !(r || a),
2794
+ "h-8 px-3": t === "medium" && (r || a),
2795
+ "h-12 w-12 p-2": t === "large" && !(r || a),
2796
+ "h-12 px-4": t === "large" && (r || a)
2797
+ });
2798
+ }
2799
+ }, za = ({
2800
+ type: e,
2801
+ size: t,
2802
+ labelRight: r,
2803
+ labelLeft: a
2804
+ }) => {
2805
+ const o = "text-sm font-medium", n = "text-base font-medium", s = "text-lg font-medium";
2806
+ switch (e) {
2807
+ case we:
2808
+ case ue:
2809
+ return i({
2810
+ "text-center": e === ue,
2811
+ [o]: t === "small",
2812
+ [n]: t === "medium",
2813
+ [s]: t === "large"
2814
+ });
2815
+ case _e:
2816
+ return i({
2817
+ [o]: t === "small" && (r || a),
2818
+ [n]: t === "medium" && (r || a),
2819
+ [s]: t === "large" && (r || a)
2820
+ });
2821
+ }
2822
+ }, Ma = ({
2823
+ mode: e,
2824
+ noBackground: t,
2825
+ noTruncate: r,
2826
+ variant: a
2827
+ }) => {
2828
+ if (t)
2829
+ return "not-prose";
2830
+ if (a === "primary")
2831
+ return i("not-prose", {
2832
+ truncate: !r,
2833
+ "text-copy-light": e === "dark",
2834
+ "text-copy-lighter": e === "light",
2835
+ "text-copy-light dark:text-copy-lighter": e === "system",
2836
+ "text-copy-lighter dark:text-copy-light": e === "alt-system"
2837
+ });
2838
+ if (a === "secondary")
2839
+ return i("not-prose", {
2840
+ truncate: !r,
2841
+ "text-copy-light": e === "light",
2842
+ "text-copy-lighter": e === "dark",
2843
+ "text-copy-light dark:text-copy-lighter": e === "alt-system",
2844
+ "text-copy-lighter dark:text-copy-light": e === "system"
2845
+ });
2846
+ if (a === "danger")
2847
+ return i("not-prose", {
2848
+ truncate: !r,
2849
+ "text-copy-light": e === "dark",
2850
+ "text-copy-lighter": e === "light",
2851
+ "text-copy-light dark:text-copy-lighter": e === "system",
2852
+ "text-copy-lighter dark:text-copy-light": e === "alt-system"
2853
+ });
2854
+ if (a === "selected")
2855
+ return i("not-prose", {
2856
+ truncate: !r,
2857
+ "text-copy-light": e === "dark",
2858
+ "text-copy-lighter": e === "light",
2859
+ "text-copy-light dark:text-copy-lighter": e === "system",
2860
+ "text-copy-lighter dark:text-copy-light": e === "alt-system"
2861
+ });
2862
+ }, La = ({
2863
+ mode: e,
2864
+ noBackground: t,
2865
+ variant: r
2866
+ }) => {
2867
+ if (!t) {
2868
+ if (r === "primary")
2869
+ return i({
2870
+ "bg-action-dark": e === "dark",
2871
+ "bg-action-light": e === "light",
2872
+ "bg-action-dark dark:bg-action-light": e === "system",
2873
+ "bg-action-light dark:bg-action-dark": e === "alt-system"
2874
+ });
2875
+ if (r === "secondary")
2876
+ return i({
2877
+ "bg-action-dark": e === "light",
2878
+ "bg-action-light": e === "dark",
2879
+ "bg-action-dark dark:bg-action-light": e === "alt-system",
2880
+ "bg-action-light dark:bg-action-dark": e === "system"
2881
+ });
2882
+ if (r === "danger")
2883
+ return i({
2884
+ "bg-action-danger-dark": e === "dark",
2885
+ "bg-action-danger-light": e === "light",
2886
+ "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
2887
+ "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
2888
+ });
2889
+ if (r === "selected")
2890
+ return "bg-action-selected-dark";
2891
+ }
2892
+ }, Oa = ({
2893
+ radius: e
2894
+ }) => i({
2895
+ "rounded-full": e === "large",
2896
+ "rounded-md": e === "medium",
2897
+ "rounded-sm": e === "small"
2898
+ }), Va = ({
2899
+ mode: e,
2900
+ disabled: t,
2901
+ variant: r
2902
+ }) => {
2903
+ if (t)
2904
+ return "";
2905
+ if (r === "primary")
2906
+ return i("hover:text-copy-light-hover", {
2907
+ "hover:bg-action-dark-hover": e === "dark",
2908
+ "hover:bg-action-light-hover": e === "light",
2909
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
2910
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
2911
+ });
2912
+ if (r === "secondary")
2913
+ return i("hover:text-copy-light-hover", {
2914
+ "hover:bg-action-dark-hover": e === "light",
2915
+ "hover:bg-action-light-hover": e === "dark",
2916
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
2917
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
2918
+ });
2919
+ if (r === "danger")
2920
+ return i("hover:text-copy-light-hover", {
2921
+ "hover:bg-action-danger-dark-hover": e === "dark",
2922
+ "hover:bg-action-danger-light-hover": e === "light",
2923
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
2924
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
2925
+ });
2926
+ if (r === "selected")
2927
+ return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
2928
+ }, Ua = ({
2929
+ mode: e,
2930
+ disabled: t,
2931
+ variant: r
2932
+ }) => {
2933
+ if (t)
2934
+ return "";
2935
+ if (r === "primary")
2936
+ return i("active:text-copy-light-active", {
2937
+ "active:bg-action-dark-active": e === "dark",
2938
+ "active:bg-action-light-active": e === "light",
2939
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
2940
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
2941
+ });
2942
+ if (r === "secondary")
2943
+ return i("active:text-copy-light-active", {
2944
+ "active:bg-action-dark-active": e === "light",
2945
+ "active:bg-action-light-active": e === "dark",
2946
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
2947
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
2948
+ });
2949
+ if (r === "danger")
2950
+ return i("active:text-copy-lighter-active", {
2951
+ "active:bg-action-danger-dark-active": e === "dark",
2952
+ "active:bg-action-danger-light-active": e === "light",
2953
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
2954
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
2955
+ });
2956
+ if (r === "selected")
2957
+ return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
2958
+ }, Ha = ({
2959
+ mode: e,
2960
+ noBorder: t,
2961
+ variant: r
2962
+ }) => {
2963
+ if (t)
2964
+ return "border border-transparent";
2965
+ if (r === "primary")
2966
+ return i("border", {
2967
+ "border-border-dark": e === "dark",
2968
+ "border-border-accent": e === "light",
2969
+ "border-border-dark dark:border-border-accent": e === "system",
2970
+ "border-border-accent dark:border-border-dark": e === "alt-system"
2971
+ });
2972
+ if (r === "secondary")
2973
+ return i("border", {
2974
+ "border-border-dark": e === "light",
2975
+ "border-border-accent": e === "dark",
2976
+ "border-border-dark dark:border-border-accent": e === "alt-system",
2977
+ "border-border-accent dark:border-border-dark": e === "system"
2978
+ });
2979
+ if (r === "danger")
2980
+ return i("border", {
2981
+ "border-border-danger-dark": e === "dark",
2982
+ "border-border-danger-medium": e === "light",
2983
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
2984
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
2985
+ });
2986
+ if (r === "selected")
2987
+ return "border border-border-selected-dark";
2988
+ }, Pa = ({
2989
+ focusMode: e
2990
+ }) => i("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
2991
+ "focus:outline-focus-dark": e === "dark",
2992
+ "focus:outline-focus-light": e === "light",
2993
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
2994
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
2995
+ }), ft = ({
2996
+ type: e,
2997
+ className: t,
2998
+ raw: r,
2999
+ mode: a,
3000
+ focusMode: o,
3001
+ disabled: n,
3002
+ fullWidth: s,
3003
+ size: c,
3004
+ noBorder: d,
3005
+ labelRight: g,
3006
+ labelLeft: u,
3007
+ noBackground: h,
3008
+ variant: m,
3009
+ noTruncate: p,
3010
+ align: b,
3011
+ radius: f
3012
+ }) => (m || (m = "primary"), r ? i(We, t) : i(
3013
+ We,
3014
+ Ma({
3015
+ mode: a,
3016
+ variant: m,
3017
+ noBackground: h,
3018
+ noTruncate: p
3019
+ }),
3020
+ La({ mode: a, noBackground: h, variant: m }),
3021
+ Oa({ radius: f }),
3022
+ Aa({
3023
+ type: e,
3024
+ size: c,
3025
+ labelRight: g,
3026
+ labelLeft: u,
3027
+ align: b
3028
+ }),
3029
+ za({ type: e, size: c, labelRight: g, labelLeft: u }),
3030
+ Ha({ mode: a, variant: m, noBorder: d }),
3031
+ Pa({ focusMode: o }),
3032
+ Va({ mode: a, variant: m, disabled: n }),
3033
+ Ua({ mode: a, variant: m, disabled: n }),
3034
+ {
3035
+ "w-full": s,
3036
+ "disabled:cursor-not-allowed disabled:opacity-50": n
3037
+ },
3038
+ t
3039
+ )), Da = (e, t, r) => {
3040
+ var a;
3041
+ !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
3042
+ }, Te = I.forwardRef((e, t) => {
3043
+ const { onClick: r, noInternalClick: a = !1, ...o } = e;
3044
+ return /* @__PURE__ */ l(
3045
+ "button",
3046
+ {
3047
+ ref: t,
3048
+ onClick: (n) => {
3049
+ Da(n, a, r);
3050
+ },
3051
+ ...o
3052
+ }
3053
+ );
3054
+ });
3055
+ Te.displayName = "BaseButton";
3056
+ const kt = I.forwardRef(
3057
+ ({
3058
+ children: e,
3059
+ disabled: t = !1,
3060
+ mode: r = "system",
3061
+ focusMode: a = "system",
3062
+ fullWidth: o = !1,
3063
+ className: n,
3064
+ size: s = "medium",
3065
+ raw: c = !1,
3066
+ noBorder: d = !1,
3067
+ variant: g = "primary",
3068
+ noTruncate: u = !1,
3069
+ radius: h = "large",
3070
+ ...m
3071
+ }, p) => {
3072
+ const b = ft({
3073
+ type: we,
3074
+ mode: r,
3075
+ focusMode: a,
3076
+ fullWidth: o,
3077
+ disabled: t,
3078
+ raw: c,
3079
+ className: n,
3080
+ size: s,
3081
+ noBorder: d,
3082
+ variant: g,
3083
+ noTruncate: u,
3084
+ radius: h
3085
+ });
3086
+ return /* @__PURE__ */ l(
3087
+ Te,
3088
+ {
3089
+ ref: p,
3090
+ className: b,
3091
+ disabled: t,
3092
+ ...m,
3093
+ children: e
3094
+ }
3095
+ );
3096
+ }
3097
+ );
3098
+ kt.displayName = "Button";
3099
+ /*!
3100
+ @versini/ui-button v3.2.2
3101
+ © 2025 gizmette.com
3102
+ */
3103
+ try {
3104
+ window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
3105
+ version: "3.2.2",
3106
+ buildTime: "01/02/2025 05:13 PM EST",
3107
+ homepage: "https://github.com/aversini/ui-components",
3108
+ license: "MIT"
3109
+ });
3110
+ } catch {
3111
+ }
3112
+ const Ga = I.forwardRef(
3113
+ ({
3114
+ children: e,
3115
+ disabled: t = !1,
3116
+ mode: r = "system",
3117
+ focusMode: a = "system",
3118
+ fullWidth: o = !1,
3119
+ className: n,
3120
+ type: s = "button",
3121
+ raw: c = !1,
3122
+ noBorder: d = !1,
3123
+ "aria-label": g,
3124
+ label: u,
3125
+ size: h = "medium",
3126
+ labelRight: m,
3127
+ labelLeft: p,
3128
+ noBackground: b = !1,
3129
+ align: f = "center",
3130
+ active: y = !1,
3131
+ radius: _ = "large",
3132
+ ...T
3133
+ }, N) => {
3134
+ const R = ft({
3135
+ type: _e,
3136
+ mode: r,
3137
+ focusMode: a,
3138
+ fullWidth: o,
3139
+ disabled: t,
3140
+ raw: c,
3141
+ className: n,
3142
+ noBorder: d,
3143
+ size: h,
3144
+ labelRight: m,
3145
+ labelLeft: p,
3146
+ noBackground: b,
3147
+ align: f,
3148
+ radius: _
3149
+ }), E = i({
3150
+ "text-copy-accent-dark": r === "light" && !c,
3151
+ "text-copy-light": r === "dark" && !c,
3152
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
3153
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !c
3154
+ }), M = y ? i(
3155
+ "relative",
3156
+ "focus-within:static",
3157
+ "focus-within:after:border-transparent",
3158
+ "after:absolute",
3159
+ "after:content-['']",
3160
+ "after:border-b-2",
3161
+ "after:bottom-[-4px]",
3162
+ "after:left-0",
3163
+ "after:right-0",
3164
+ {
3165
+ "after:border-table-dark": r === "dark",
3166
+ "after:border-table-light": r === "light",
3167
+ "after:border-table-dark dark:after:border-table-light": r === "system",
3168
+ "after:border-table-light dark:after:border-table-dark": r === "alt-system"
3169
+ }
3170
+ ) : "";
3171
+ return /* @__PURE__ */ l("div", { className: M, children: /* @__PURE__ */ k(
3172
+ Te,
3173
+ {
3174
+ ref: N,
3175
+ className: R,
3176
+ disabled: t,
3177
+ type: s,
3178
+ "aria-label": g || u,
3179
+ ...T,
3180
+ children: [
3181
+ p && /* @__PURE__ */ l("span", { className: "pr-2", children: p }),
3182
+ /* @__PURE__ */ l("div", { className: E, children: e }),
3183
+ m && /* @__PURE__ */ l("span", { className: "pl-2", children: m })
3184
+ ]
3185
+ }
3186
+ ) });
3187
+ }
3188
+ );
3189
+ Ga.displayName = "ButtonSort";
3190
+ const Fa = 200, Wa = ({
3191
+ string: e,
3192
+ idealLength: t = Fa
3193
+ }) => {
3194
+ if (e.length <= t)
3195
+ return { string: e, isTruncated: !1 };
3196
+ if (e.charAt(t) === " ")
3197
+ return { string: e.slice(0, t), isTruncated: !0 };
3198
+ const r = e.slice(t).search(" ");
3199
+ return {
3200
+ string: e.slice(0, t + r),
3201
+ isTruncated: !0
3202
+ };
3203
+ }, ja = ({
3204
+ children: e,
3205
+ length: t = 200,
3206
+ mode: r = "system",
3207
+ focusMode: a = "system"
3208
+ }) => {
3209
+ const [o, n] = S(!1);
3210
+ if (typeof e != "string")
3211
+ return e;
3212
+ const { string: s, isTruncated: c } = Wa({
3213
+ string: e,
3214
+ idealLength: t
3215
+ });
3216
+ return /* @__PURE__ */ k("span", { style: { wordBreak: "break-word" }, children: [
3217
+ o ? e : s,
3218
+ c && /* @__PURE__ */ l(
3219
+ kt,
3220
+ {
3221
+ mode: r,
3222
+ focusMode: a,
3223
+ className: "ml-2",
3224
+ size: "small",
3225
+ onClick: (d) => {
3226
+ d.preventDefault(), n(!o);
3227
+ },
3228
+ children: o ? "less..." : "more..."
3229
+ }
3230
+ )
3231
+ ] });
3232
+ };
3233
+ /*!
3234
+ @versini/ui-truncate v2.0.10
3235
+ © 2025 gizmette.com
3236
+ */
3237
+ try {
3238
+ window.__VERSINI_UI_TRUNCATE__ || (window.__VERSINI_UI_TRUNCATE__ = {
3239
+ version: "2.0.10",
3240
+ buildTime: "01/02/2025 05:13 PM EST",
3241
+ homepage: "https://github.com/aversini/ui-components",
3242
+ license: "MIT"
3243
+ });
3244
+ } catch {
3245
+ }
3246
+ const je = rt(
3247
+ () => import(
3248
+ /* webpackChunkName: "LazyMessageAssistant" */
3249
+ "./MessageAssistant.C_sIDCZ4.js"
3250
+ ).then((e) => e.MessageAssistant)
3251
+ ), qa = () => {
3252
+ const { state: e } = $(F);
3253
+ return /* @__PURE__ */ k("div", { className: "space-y-6 mt-2", children: [
3254
+ e && e.messages.length > 0 && e.messages.map((t, r) => {
3255
+ const { role: a, content: o, name: n, processingTime: s } = t.message;
3256
+ return (a === K || a === he) && o ? /* @__PURE__ */ l(ce, { fallback: /* @__PURE__ */ l("span", {}), children: /* @__PURE__ */ l(je, { name: n, processingTime: s, children: o }) }, `${r}-${a}`) : a === le && o ? /* @__PURE__ */ l(
3257
+ Ba,
3258
+ {
3259
+ kind: "right",
3260
+ copyToClipboard: o,
3261
+ copyToClipboardFocusMode: "light",
3262
+ children: /* @__PURE__ */ l(ja, { mode: "light", focusMode: "light", children: o })
3263
+ },
3264
+ `${r}-${a}`
3265
+ ) : null;
3266
+ }),
3267
+ Gt(le, e) && /* @__PURE__ */ l(ce, { fallback: /* @__PURE__ */ l("span", {}), children: /* @__PURE__ */ l(je, { loading: !0 }) })
3268
+ ] });
3269
+ }, Ka = () => {
3270
+ const { isAuthenticated: e } = Z(), { state: t } = $(F), [r, a] = S(!1), [o, n] = dr(), s = Ft({
3271
+ isAuthenticated: e,
3272
+ extraClass: "rounded-b-md"
3273
+ }), c = v(!1), d = U(() => {
3274
+ const u = o.current;
3275
+ if (u) {
3276
+ const { scrollHeight: h, clientHeight: m, scrollTop: p } = u, b = h - m - p;
3277
+ u.scrollBy({
3278
+ top: b,
3279
+ behavior: "smooth"
3280
+ });
3281
+ }
3282
+ }, [o]), g = U(() => {
3283
+ const u = o.current;
3284
+ if (u) {
3285
+ const { scrollTop: h, scrollHeight: m, clientHeight: p } = u, b = m > p, f = h + p >= m - 1;
3286
+ a(b && !f);
3287
+ }
3288
+ }, [o]);
3289
+ return P(() => {
3290
+ n && n.width && t && !t.streaming && g();
3291
+ }, [n, t, g]), x(() => {
3292
+ const u = o.current;
3293
+ if (u)
3294
+ return u.addEventListener("scroll", g), () => u.removeEventListener("scroll", g);
3295
+ }, [g, o]), x(() => {
3296
+ t && t.streaming && g();
3297
+ }, [t, g]), x(() => {
3298
+ t && (!c.current && t.streaming && d(), c.current = !!t.streaming);
3299
+ }, [t, d]), /* @__PURE__ */ k("div", { className: s, ref: o, children: [
3300
+ r && /* @__PURE__ */ l("div", { className: "bottom-44 z-40 fixed left-1/2 transform -translate-x-1/2", children: /* @__PURE__ */ l(
3301
+ et,
3302
+ {
3303
+ className: "bg-white hover:bg-white active:bg-slate-400",
3304
+ size: "medium",
3305
+ mode: "dark",
3306
+ onClick: d,
3307
+ children: /* @__PURE__ */ l(Zt, { monotone: !0, size: "size-3", className: "text-copy-dark" })
3308
+ }
3309
+ ) }),
3310
+ /* @__PURE__ */ l(Wt, {}),
3311
+ e && /* @__PURE__ */ l(qa, {})
3312
+ ] });
3313
+ }, Ja = rt(
3314
+ () => import(
3315
+ /* webpackChunkName: "LazyHeader" */
3316
+ "./HeaderToolbar.CmGmS7yq.js"
3317
+ )
3318
+ );
3319
+ function vt({ isComponent: e = !1 }) {
3320
+ const t = v(!1), { getAccessToken: r, user: a, isAuthenticated: o } = Z(), [n] = Ve({
3321
+ key: Me + qt,
3322
+ initialValue: ""
3323
+ }), [s] = Ve({
3324
+ key: Me + Kt,
3325
+ initialValue: j.ASC
3326
+ }), [c, d] = Q(Lr, {
3327
+ id: ke(),
3328
+ model: V,
3329
+ engine: V,
3330
+ usage: 0,
3331
+ messages: [],
3332
+ tags: [],
3333
+ isComponent: e
3334
+ }), [g, u] = Q(Or, {
3335
+ searchString: n,
3336
+ sortedCell: "timestamp",
3337
+ sortDirection: s
3338
+ }), [h, m] = Q(Vr, {
3339
+ tag: "",
3340
+ tags: []
3341
+ }), [p, b] = S({
3342
+ version: "",
3343
+ models: [],
3344
+ plugins: [],
3345
+ engine: V,
3346
+ engines: []
3347
+ });
3348
+ return x(() => {
3349
+ p.version !== "" || t.current || (async () => {
3350
+ try {
3351
+ t.current = !0;
3352
+ const y = await ct({
3353
+ accessToken: await r(),
3354
+ type: st.ABOUT,
3355
+ params: {
3356
+ user: a == null ? void 0 : a.username
3357
+ }
3358
+ });
3359
+ t.current = !1, y.status === 200 && (b(y.data), d({
3360
+ type: Je,
3361
+ payload: {
3362
+ engine: y.data.engine
3363
+ }
3364
+ }));
3365
+ } catch {
3366
+ }
3367
+ })();
3368
+ }, [p, r, a]), x(() => {
3369
+ var y;
3370
+ (y = document.getElementById("logo")) == null || y.classList.add("fadeOut"), setTimeout(() => {
3371
+ var _;
3372
+ (_ = document.getElementById("root")) == null || _.classList.replace("app-hidden", "fadeIn");
3373
+ }, 500);
3374
+ }), /* @__PURE__ */ l(F.Provider, { value: { state: c, dispatch: d, serverStats: p }, children: /* @__PURE__ */ l(
3375
+ Pr.Provider,
3376
+ {
3377
+ value: {
3378
+ state: g,
3379
+ dispatch: u
3380
+ },
3381
+ children: /* @__PURE__ */ k(
3382
+ ve.Provider,
3383
+ {
3384
+ value: { state: h, dispatch: m },
3385
+ children: [
3386
+ /* @__PURE__ */ l(
3387
+ tr,
3388
+ {
3389
+ noColors: !0,
3390
+ noMargin: !0,
3391
+ noPadding: !0,
3392
+ noBorder: !0,
3393
+ className: ze({
3394
+ extraClass: "mt-5"
3395
+ }),
3396
+ children: o && /* @__PURE__ */ l(ce, { fallback: /* @__PURE__ */ l("div", {}), children: /* @__PURE__ */ l(Ja, {}) })
3397
+ }
3398
+ ),
3399
+ /* @__PURE__ */ l(
3400
+ jt,
3401
+ {
3402
+ className: ze({
3403
+ extraClass: "max-h-[calc(100svh_-_250px)]"
3404
+ }),
3405
+ noMargin: !0,
3406
+ noPadding: !0,
3407
+ children: /* @__PURE__ */ l(Ka, {})
3408
+ }
3409
+ ),
3410
+ /* @__PURE__ */ l(ua, {})
3411
+ ]
3412
+ }
3413
+ )
3414
+ }
3415
+ ) });
3416
+ }
3417
+ vt.displayName = "App";
3418
+ const io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: vt }, Symbol.toStringTag, { value: "Module" }));
3419
+ export {
3420
+ io as App,
3421
+ F as AppContext,
3422
+ Ve as E,
3423
+ mt as Fe,
3424
+ Pr as HistoryContext,
3425
+ ca as NewChatButton,
3426
+ st as SERVICE_TYPES,
3427
+ ve as TagsContext,
3428
+ j as _,
3429
+ ro as be,
3430
+ $r as de,
3431
+ eo as ge,
3432
+ to as he,
3433
+ no as ke,
3434
+ Ba as le,
3435
+ ao as me,
3436
+ ct as serviceCall,
3437
+ oo as ue
3438
+ };