@versini/sassysaint 6.0.3 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2449 +0,0 @@
1
- import { jsxs as h, jsx as a, Fragment as B } from "react/jsx-runtime";
2
- import { g as F, un as G, R as H, CARDS as T, renderDataAsList as he, pluralize as ge, ABOUT_TITLE as ht, L as X, j as R, C as U, INFINITE_SCROLL_LIMIT as Oe, INFINITE_SCROLL_THRESHOLD as Pe, LOCAL_STORAGE_PREFIX as _e, LOCAL_STORAGE_SORT as gt, Y as le, ACTION_RESET as ft, ACTION_RESTORE as pt, ACTION_SORT as ze, LOCAL_STORAGE_SEARCH as bt, HISTORY_TITLE as yt, ye as Ee, ACTION_SEARCH as kt, debounce as vt, M as xt, l as $e, durationFormatter as Nt, PROFILE_TITLE as wt, PROMPTS_DESCRIPTION as Et, DEFAULT_AI_ENGINE as Tt, LOCAL_STORAGE_CHAT_DETAILS as Ct, SETTINGS_TITLE as _t, ENGINE_OPENAI as Q, ENGINE_ANTHROPIC as re, APP_NAME as It, getCurrentGeoLocation as St, LOG_OUT as He } from "./index.lSfnE_4F.js";
3
- import { i as fe, useServerCapabilities as At, HistoryContext as je, E as Ie, ge as Rt, he as Lt, ue as Ne, le as $, ye as Mt, me as Bt, p as Ot, z as Pt, be as zt, serviceCall as ie, SERVICE_TYPES as ce, f as ae, AppContext as Ye, useChatsHistory as $t, useUserChatStats as Ht, useUserPreferences as We, m as Dt, _e as Vt, me$1 as Ut, R as oe, P as Ft } from "./App.BLBn8tAW.js";
4
- import * as S from "react";
5
- import be, { useId as Se, useRef as _, useEffect as D, useState as w, useContext as pe, useCallback as Ke, Fragment as Gt, useLayoutEffect as ne, useMemo as Xe, useReducer as jt } from "react";
6
- import d from "clsx";
7
- import { useMergeRefs as Yt, FloatingPortal as Wt, FloatingOverlay as Kt, FloatingFocusManager as Xt, useFloating as qt, useClick as Qt, useDismiss as Jt, useRole as Zt, useInteractions as er } from "@floating-ui/react";
8
- const tr = ({
9
- className: e,
10
- viewBox: r,
11
- title: t,
12
- monotone: o,
13
- ...n
14
- }) => /* @__PURE__ */ h(
15
- F,
16
- {
17
- defaultViewBox: "0 0 512 512",
18
- size: "size-5",
19
- viewBox: r,
20
- className: e,
21
- title: t || "Back",
22
- ...n,
23
- children: [
24
- /* @__PURE__ */ a(
25
- "path",
26
- {
27
- d: "M66.6 320c0 1.8.1 3.5.4 5.3C84.9 431.3 177 512 288 512c123.7 0 224-100.3 224-224 0-111-80.7-203.1-186.7-220.9-1.8-.3-3.6-.4-5.3-.4-15.3 0-28.9 11.1-31.5 26.7-2.9 17.4 8.8 33.9 26.3 36.9C390.4 142.9 448 208.8 448 288c0 88.4-71.6 160-160 160-79.2 0-145.1-57.6-157.8-133.3-2.9-17.4-19.4-29.2-36.9-26.3-15.6 2.6-26.7 16.2-26.7 31.5z",
28
- opacity: o ? "1" : "0.4"
29
- }
30
- ),
31
- /* @__PURE__ */ a("path", { d: "M32 0h160c17.7 0 32 14.3 32 32s-14.3 32-32 32h-82.7l233.3 233.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L64 109.3V192c0 17.7-14.3 32-32 32S0 209.7 0 192V32C0 14.3 14.3 0 32 0" })
32
- ]
33
- }
34
- ), rr = ({
35
- className: e,
36
- viewBox: r,
37
- title: t,
38
- monotone: o,
39
- ...n
40
- }) => /* @__PURE__ */ h(
41
- F,
42
- {
43
- defaultViewBox: "0 0 448 512",
44
- size: "size-5",
45
- viewBox: r,
46
- className: e,
47
- title: t || "Delete",
48
- ...n,
49
- children: [
50
- /* @__PURE__ */ a(
51
- "path",
52
- {
53
- d: "M32 96v352c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V96zm80 80c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16z",
54
- opacity: o ? "1" : "0.4"
55
- }
56
- ),
57
- /* @__PURE__ */ a("path", { d: "M163.8 0c-12.1 0-23.2 6.8-28.6 17.7L128 32H32C14.3 32 0 46.3 0 64s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96l-7.2-14.3C307.4 6.8 296.3 0 284.2 0z" })
58
- ]
59
- }
60
- ), ar = ({
61
- className: e,
62
- viewBox: r,
63
- title: t,
64
- monotone: o,
65
- ...n
66
- }) => /* @__PURE__ */ h(
67
- F,
68
- {
69
- defaultViewBox: "0 0 512 512",
70
- size: "size-5",
71
- viewBox: r,
72
- className: e,
73
- title: t || "History",
74
- ...n,
75
- children: [
76
- /* @__PURE__ */ a(
77
- "path",
78
- {
79
- d: "M0 57.9V168c0 13.3 10.7 24 24 24h110.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75L41 41C25.9 25.9 0 36.6 0 57.9",
80
- opacity: o ? "1" : "0.4"
81
- }
82
- ),
83
- /* @__PURE__ */ a("path", { d: "M256 128c13.3 0 24 10.7 24 24v94.1l65 65c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-72-72c-4.5-4.5-7-10.6-7-17V152c0-13.3 10.7-24 24-24z" })
84
- ]
85
- }
86
- ), or = ({
87
- className: e,
88
- viewBox: r,
89
- title: t,
90
- monotone: o,
91
- ...n
92
- }) => /* @__PURE__ */ h(
93
- F,
94
- {
95
- defaultViewBox: "0 0 512 512",
96
- size: "size-5",
97
- viewBox: r,
98
- className: e,
99
- title: t || "Info",
100
- ...n,
101
- children: [
102
- /* @__PURE__ */ a(
103
- "path",
104
- {
105
- d: "M0 256a256 256 0 1 0 512 0 256 256 0 1 0-512 0m192-8c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24h-80c-13.3 0-24-10.7-24-24s10.7-24 24-24h24v-64h-24c-13.3 0-24-10.7-24-24m96-88a32 32 0 1 1-64 0 32 32 0 1 1 64 0",
106
- opacity: ".4"
107
- }
108
- ),
109
- /* @__PURE__ */ a("path", { d: "M256 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64m-64 120c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24h-80c-13.3 0-24-10.7-24-24s10.7-24 24-24h24v-64h-24c-13.3 0-24-10.7-24-24" })
110
- ]
111
- }
112
- ), nr = ({
113
- className: e,
114
- viewBox: r,
115
- title: t,
116
- monotone: o,
117
- ...n
118
- }) => /* @__PURE__ */ h(
119
- F,
120
- {
121
- defaultViewBox: "0 0 576 512",
122
- size: "size-5",
123
- viewBox: r,
124
- className: e,
125
- title: t || "Profile",
126
- ...n,
127
- children: [
128
- /* @__PURE__ */ a(
129
- "path",
130
- {
131
- d: "M0 96v320c0 35.3 28.7 64 64 64h448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96m64 272c0-44.2 35.8-80 80-80h64c44.2 0 80 35.8 80 80 0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16m176-176a64 64 0 1 1-128 0 64 64 0 1 1 128 0m112-16c0-8.8 7.2-16 16-16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16m0 64c0-8.8 7.2-16 16-16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16m0 64c0-8.8 7.2-16 16-16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16",
132
- opacity: ".4"
133
- }
134
- ),
135
- /* @__PURE__ */ a("path", { d: "M176 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128m-32 32c-44.2 0-80 35.8-80 80 0 8.8 7.2 16 16 16h192c8.8 0 16-7.2 16-16 0-44.2-35.8-80-80-80z" })
136
- ]
137
- }
138
- ), sr = ({
139
- className: e,
140
- viewBox: r,
141
- title: t,
142
- monotone: o,
143
- ...n
144
- }) => /* @__PURE__ */ h(
145
- F,
146
- {
147
- defaultViewBox: "0 0 512 512",
148
- size: "size-5",
149
- viewBox: r,
150
- className: e,
151
- title: t || "Restore",
152
- ...n,
153
- children: [
154
- /* @__PURE__ */ a(
155
- "path",
156
- {
157
- d: "M128 80v16h64V80c0-8.8 7.2-16 16-16h224c8.8 0 16 7.2 16 16v224c0 8.8-7.2 16-16 16h-16v64h16c44.2 0 80-35.8 80-80V80c0-44.2-35.8-80-80-80H208c-44.2 0-80 35.8-80 80",
158
- opacity: o ? "1" : "0.4"
159
- }
160
- ),
161
- /* @__PURE__ */ a("path", { d: "M64 128c-35.3 0-64 28.7-64 64v256c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64zm32 64h192c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32s14.3-32 32-32" })
162
- ]
163
- }
164
- ), lr = ({
165
- className: e,
166
- viewBox: r,
167
- title: t,
168
- monotone: o,
169
- ...n
170
- }) => /* @__PURE__ */ a(
171
- F,
172
- {
173
- defaultViewBox: "0 0 448 512",
174
- size: "size-5",
175
- viewBox: r,
176
- className: e,
177
- title: t || "Settings",
178
- ...n,
179
- children: /* @__PURE__ */ a("path", { d: "M432 256a48 48 0 1 1-96 0 48 48 0 1 1 96 0m-160 0a48 48 0 1 1-96 0 48 48 0 1 1 96 0M64 304a48 48 0 1 1 0-96 48 48 0 1 1 0 96" })
180
- }
181
- ), ir = ({
182
- className: e,
183
- viewBox: r,
184
- title: t,
185
- monotone: o,
186
- ...n
187
- }) => /* @__PURE__ */ h(
188
- F,
189
- {
190
- defaultViewBox: "0 0 512 512",
191
- size: "size-5",
192
- viewBox: r,
193
- className: e,
194
- title: t || "Sliders",
195
- ...n,
196
- children: [
197
- /* @__PURE__ */ a(
198
- "path",
199
- {
200
- d: "M0 96c0-17.7 14.3-32 32-32h86.7c-2.1 4.9-3.8 10.1-4.9 15.4-.6 2.7-1 5.4-1.3 8.2-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32H32c-17.7 0-32-14.3-32-32m0 160c0-17.7 14.3-32 32-32h246.7c-2.1 4.9-3.8 10.1-4.9 15.4-.6 2.7-1 5.4-1.3 8.2-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32H32c-17.7 0-32-14.3-32-32m0 160c0-17.7 14.3-32 32-32h54.7c-2.1 4.9-3.8 10.1-4.9 15.4-.6 2.7-1 5.4-1.3 8.2-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32H32c-17.7 0-32-14.3-32-32m233.3-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H233.3c2.1-4.9 3.8-10.1 4.9-15.4.6-2.7 1-5.4 1.3-8.2.1-1.4.3-2.8.3-4.2s.1-2.8.1-4.2c0-11.4-2.4-22.2-6.7-32zm32-320H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H265.3c2.1-4.9 3.8-10.1 4.9-15.4.6-2.7 1-5.4 1.3-8.2.1-1.4.3-2.8.3-4.2s.1-2.8.1-4.2c0-11.4-2.4-22.2-6.7-32zm160 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32h-54.7c2.1-4.9 3.8-10.1 4.9-15.4.6-2.7 1-5.4 1.3-8.2.1-1.4.3-2.8.3-4.2s.1-2.8.1-4.2c0-11.4-2.4-22.2-6.7-32z",
201
- opacity: o ? "1" : "0.4"
202
- }
203
- ),
204
- /* @__PURE__ */ a("path", { d: "M128 416a32 32 0 1 1 64 0 32 32 0 1 1-64 0m112 0a80 80 0 1 0-160 0 80 80 0 1 0 160 0m80-160a32 32 0 1 1 64 0 32 32 0 1 1-64 0m112 0a80 80 0 1 0-160 0 80 80 0 1 0 160 0M192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64m0-112a80 80 0 1 0 0 160 80 80 0 1 0 0-160" })
205
- ]
206
- }
207
- );
208
- /*!
209
- @versini/ui-panel v1.3.15
210
- © 2025 gizmette.com
211
- */
212
- try {
213
- window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
214
- version: "1.3.15",
215
- buildTime: "01/20/2025 03:51 PM EST",
216
- homepage: "https://github.com/aversini/ui-components",
217
- license: "MIT"
218
- });
219
- } catch {
220
- }
221
- const De = "av-messagebox", Ve = "av-panel", Ue = "av-button", ye = "icon", qe = "button", Te = "link", cr = ({
222
- type: e,
223
- size: r,
224
- labelRight: t,
225
- labelLeft: o,
226
- align: n
227
- }) => {
228
- const l = "max-h-8 py-0 px-2", s = "max-h-9 h-8 px-3", i = "max-h-12 py-2 px-4";
229
- switch (e) {
230
- case qe:
231
- case Te:
232
- return d({
233
- [l]: r === "small",
234
- [s]: r === "medium",
235
- [i]: r === "large"
236
- });
237
- case ye:
238
- return d("inline-flex items-center", {
239
- "justify-center": n === "center",
240
- "justify-start": n === "left",
241
- "justify-end": n === "right",
242
- "h-6 w-6 p-0": r === "small" && !(t || o),
243
- "h-6 px-2": r === "small" && (t || o),
244
- "h-8 w-8 p-1": r === "medium" && !(t || o),
245
- "h-8 px-3": r === "medium" && (t || o),
246
- "h-12 w-12 p-2": r === "large" && !(t || o),
247
- "h-12 px-4": r === "large" && (t || o)
248
- });
249
- }
250
- }, dr = ({
251
- type: e,
252
- size: r,
253
- labelRight: t,
254
- labelLeft: o
255
- }) => {
256
- const n = "text-sm font-medium", l = "text-base font-medium", s = "text-lg font-medium";
257
- switch (e) {
258
- case qe:
259
- case Te:
260
- return d({
261
- "text-center": e === Te,
262
- [n]: r === "small",
263
- [l]: r === "medium",
264
- [s]: r === "large"
265
- });
266
- case ye:
267
- return d({
268
- [n]: r === "small" && (t || o),
269
- [l]: r === "medium" && (t || o),
270
- [s]: r === "large" && (t || o)
271
- });
272
- }
273
- }, ur = ({
274
- mode: e,
275
- noBackground: r,
276
- noTruncate: t,
277
- variant: o
278
- }) => {
279
- if (r)
280
- return "not-prose";
281
- if (o === "primary")
282
- return d("not-prose", {
283
- truncate: !t,
284
- "text-copy-light": e === "dark" || e === "system",
285
- "text-copy-lighter": e === "light" || e === "alt-system",
286
- "dark:text-copy-lighter": e === "system",
287
- "dark:text-copy-light": e === "alt-system"
288
- });
289
- if (o === "secondary")
290
- return d("not-prose", {
291
- truncate: !t,
292
- "text-copy-light": e === "light" || e === "system",
293
- "text-copy-lighter": e === "dark" || e === "alt-system",
294
- "dark:text-copy-lighter": e === "alt-system",
295
- "dark:text-copy-light": e === "system"
296
- });
297
- if (o === "danger")
298
- return d("not-prose", {
299
- truncate: !t,
300
- "text-copy-light": e === "dark" || e === "system",
301
- "text-copy-lighter": e === "light" || e === "alt-system",
302
- "dark:text-copy-lighter": e === "system",
303
- "dark:text-copy-light": e === "alt-system"
304
- });
305
- if (o === "selected")
306
- return d("not-prose text-copy-lighter", {
307
- truncate: !t
308
- });
309
- }, mr = ({
310
- mode: e,
311
- noBackground: r,
312
- variant: t
313
- }) => {
314
- if (!r) {
315
- if (t === "primary")
316
- return d({
317
- "bg-action-dark": e === "dark",
318
- "bg-action-light": e === "light",
319
- "bg-action-dark dark:bg-action-light": e === "system",
320
- "bg-action-light dark:bg-action-dark": e === "alt-system"
321
- });
322
- if (t === "secondary")
323
- return d({
324
- "bg-action-dark": e === "light",
325
- "bg-action-light": e === "dark",
326
- "bg-action-dark dark:bg-action-light": e === "alt-system",
327
- "bg-action-light dark:bg-action-dark": e === "system"
328
- });
329
- if (t === "danger")
330
- return d({
331
- "bg-action-danger-dark": e === "dark",
332
- "bg-action-danger-light": e === "light",
333
- "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
334
- "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
335
- });
336
- if (t === "selected")
337
- return "bg-action-selected-dark";
338
- }
339
- }, hr = ({
340
- radius: e
341
- }) => d({
342
- "rounded-full": e === "large",
343
- "rounded-md": e === "medium",
344
- "rounded-sm": e === "small"
345
- }), gr = ({
346
- mode: e,
347
- disabled: r,
348
- variant: t
349
- }) => {
350
- if (r)
351
- return "";
352
- if (t === "primary")
353
- return d("hover:text-copy-light-hover", {
354
- "hover:bg-action-dark-hover": e === "dark",
355
- "hover:bg-action-light-hover": e === "light",
356
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
357
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
358
- });
359
- if (t === "secondary")
360
- return d("hover:text-copy-light-hover", {
361
- "hover:bg-action-dark-hover": e === "light",
362
- "hover:bg-action-light-hover": e === "dark",
363
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
364
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
365
- });
366
- if (t === "danger")
367
- return d("hover:text-copy-light-hover", {
368
- "hover:bg-action-danger-dark-hover": e === "dark",
369
- "hover:bg-action-danger-light-hover": e === "light",
370
- "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
371
- "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
372
- });
373
- if (t === "selected")
374
- return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
375
- }, fr = ({
376
- mode: e,
377
- disabled: r,
378
- variant: t
379
- }) => {
380
- if (r)
381
- return "";
382
- if (t === "primary")
383
- return d("active:text-copy-light-active", {
384
- "active:bg-action-dark-active": e === "dark",
385
- "active:bg-action-light-active": e === "light",
386
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
387
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
388
- });
389
- if (t === "secondary")
390
- return d("active:text-copy-light-active", {
391
- "active:bg-action-dark-active": e === "light",
392
- "active:bg-action-light-active": e === "dark",
393
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
394
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
395
- });
396
- if (t === "danger")
397
- return d("active:text-copy-lighter-active", {
398
- "active:bg-action-danger-dark-active": e === "dark",
399
- "active:bg-action-danger-light-active": e === "light",
400
- "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
401
- "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
402
- });
403
- if (t === "selected")
404
- return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
405
- }, pr = ({
406
- mode: e,
407
- noBorder: r,
408
- variant: t
409
- }) => {
410
- if (r)
411
- return "border border-transparent";
412
- if (t === "primary")
413
- return d("border", {
414
- "border-border-dark": e === "dark",
415
- "border-border-accent": e === "light",
416
- "border-border-dark dark:border-border-accent": e === "system",
417
- "border-border-accent dark:border-border-dark": e === "alt-system"
418
- });
419
- if (t === "secondary")
420
- return d("border", {
421
- "border-border-dark": e === "light",
422
- "border-border-accent": e === "dark",
423
- "border-border-dark dark:border-border-accent": e === "alt-system",
424
- "border-border-accent dark:border-border-dark": e === "system"
425
- });
426
- if (t === "danger")
427
- return d("border", {
428
- "border-border-danger-dark": e === "dark",
429
- "border-border-danger-medium": e === "light",
430
- "border-border-danger-dark dark:border-border-danger-medium": e === "system",
431
- "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
432
- });
433
- if (t === "selected")
434
- return "border border-border-selected-dark";
435
- }, br = ({
436
- focusMode: e
437
- }) => d("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
438
- "focus:outline-focus-dark": e === "dark",
439
- "focus:outline-focus-light": e === "light",
440
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
441
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
442
- }), yr = ({
443
- mode: e,
444
- raw: r,
445
- iconClassName: t
446
- }) => r ? "" : d(
447
- {
448
- "text-copy-accent-dark": e === "light" || e === "alt-system",
449
- "text-copy-light": e === "dark" || e === "system",
450
- "dark:text-copy-light": e === "alt-system",
451
- "dark:text-copy-accent-dark": e === "system"
452
- },
453
- t
454
- ), Qe = ({
455
- type: e,
456
- className: r,
457
- raw: t,
458
- mode: o,
459
- focusMode: n,
460
- disabled: l,
461
- fullWidth: s,
462
- size: i,
463
- noBorder: m,
464
- labelRight: u,
465
- labelLeft: g,
466
- noBackground: y,
467
- variant: f,
468
- noTruncate: c,
469
- align: p,
470
- radius: v
471
- }) => (f || (f = "primary"), t ? d(Ue, r) : d(
472
- Ue,
473
- ur({
474
- mode: o,
475
- variant: f,
476
- noBackground: y,
477
- noTruncate: c
478
- }),
479
- mr({ mode: o, noBackground: y, variant: f }),
480
- hr({ radius: v }),
481
- cr({
482
- type: e,
483
- size: i,
484
- labelRight: u,
485
- labelLeft: g,
486
- align: p
487
- }),
488
- dr({ type: e, size: i, labelRight: u, labelLeft: g }),
489
- pr({ mode: o, variant: f, noBorder: m }),
490
- br({ focusMode: n }),
491
- gr({ mode: o, variant: f, disabled: l }),
492
- fr({ mode: o, variant: f, disabled: l }),
493
- {
494
- "w-full": s,
495
- "disabled:cursor-not-allowed disabled:opacity-50": l
496
- },
497
- r
498
- )), kr = (e, r, t) => {
499
- var o;
500
- !r && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((o = e == null ? void 0 : e.currentTarget) == null ? void 0 : o.focus) == "function" && e.currentTarget.focus(), typeof t == "function" && t(e);
501
- }, Ae = be.forwardRef((e, r) => {
502
- const { onClick: t, noInternalClick: o = !1, ...n } = e;
503
- return /* @__PURE__ */ a(
504
- "button",
505
- {
506
- ref: r,
507
- onClick: (l) => {
508
- kr(l, o, t);
509
- },
510
- ...n
511
- }
512
- );
513
- });
514
- Ae.displayName = "BaseButton";
515
- const Je = be.forwardRef(
516
- ({
517
- children: e,
518
- disabled: r = !1,
519
- mode: t = "system",
520
- focusMode: o = "system",
521
- fullWidth: n = !1,
522
- className: l,
523
- type: s = "button",
524
- raw: i = !1,
525
- noBorder: m = !1,
526
- "aria-label": u,
527
- label: g,
528
- size: y = "medium",
529
- labelRight: f,
530
- labelLeft: c,
531
- noBackground: p = !1,
532
- align: v = "center",
533
- radius: x = "large",
534
- variant: k = "primary",
535
- iconClassName: C,
536
- ...b
537
- }, E) => {
538
- const I = Qe({
539
- type: ye,
540
- mode: t,
541
- focusMode: o,
542
- fullWidth: n,
543
- disabled: r,
544
- raw: i,
545
- className: l,
546
- noBorder: m,
547
- size: y,
548
- labelRight: f,
549
- labelLeft: c,
550
- noBackground: p,
551
- align: v,
552
- radius: x,
553
- variant: k
554
- }), O = yr({ mode: t, raw: i, iconClassName: C });
555
- return /* @__PURE__ */ h(
556
- Ae,
557
- {
558
- ref: E,
559
- className: I,
560
- disabled: r,
561
- type: s,
562
- "aria-label": u || g,
563
- ...b,
564
- children: [
565
- c && /* @__PURE__ */ a("span", { className: "pr-2", children: c }),
566
- /* @__PURE__ */ a("div", { className: O, children: e }),
567
- f && /* @__PURE__ */ a("span", { className: "pl-2", children: f })
568
- ]
569
- }
570
- );
571
- }
572
- );
573
- Je.displayName = "ButtonIcon";
574
- /*!
575
- @versini/ui-button v4.1.4
576
- © 2025 gizmette.com
577
- */
578
- try {
579
- window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
580
- version: "4.1.4",
581
- buildTime: "01/20/2025 03:51 PM EST",
582
- homepage: "https://github.com/aversini/ui-components",
583
- license: "MIT"
584
- });
585
- } catch {
586
- }
587
- const vr = be.forwardRef(
588
- ({
589
- children: e,
590
- disabled: r = !1,
591
- mode: t = "system",
592
- focusMode: o = "system",
593
- fullWidth: n = !1,
594
- className: l,
595
- type: s = "button",
596
- raw: i = !1,
597
- noBorder: m = !1,
598
- "aria-label": u,
599
- label: g,
600
- size: y = "medium",
601
- labelRight: f,
602
- labelLeft: c,
603
- noBackground: p = !1,
604
- align: v = "center",
605
- active: x = !1,
606
- radius: k = "large",
607
- ...C
608
- }, b) => {
609
- const E = Qe({
610
- type: ye,
611
- mode: t,
612
- focusMode: o,
613
- fullWidth: n,
614
- disabled: r,
615
- raw: i,
616
- className: l,
617
- noBorder: m,
618
- size: y,
619
- labelRight: f,
620
- labelLeft: c,
621
- noBackground: p,
622
- align: v,
623
- radius: k
624
- }), I = d({
625
- "text-copy-accent-dark": t === "light" && !i,
626
- "text-copy-light": t === "dark" && !i,
627
- "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !i,
628
- "text-copy-light dark:text-copy-accent-dark": t === "system" && !i
629
- }), O = x ? d(
630
- "relative",
631
- "focus-within:static",
632
- "focus-within:after:border-transparent",
633
- "after:absolute",
634
- "after:content-['']",
635
- "after:border-b-2",
636
- "after:bottom-[-4px]",
637
- "after:left-0",
638
- "after:right-0",
639
- {
640
- "after:border-table-dark": t === "dark",
641
- "after:border-table-light": t === "light",
642
- "after:border-table-dark dark:after:border-table-light": t === "system",
643
- "after:border-table-light dark:after:border-table-dark": t === "alt-system"
644
- }
645
- ) : "";
646
- return /* @__PURE__ */ a("div", { className: O, children: /* @__PURE__ */ h(
647
- Ae,
648
- {
649
- ref: b,
650
- className: E,
651
- disabled: r,
652
- type: s,
653
- "aria-label": u || g,
654
- ...C,
655
- children: [
656
- c && /* @__PURE__ */ a("span", { className: "pr-2", children: c }),
657
- /* @__PURE__ */ a("div", { className: I, children: e }),
658
- f && /* @__PURE__ */ a("span", { className: "pl-2", children: f })
659
- ]
660
- }
661
- ) });
662
- }
663
- );
664
- vr.displayName = "ButtonSort";
665
- const xr = ({
666
- children: e,
667
- fill: r,
668
- viewBox: t,
669
- className: o,
670
- defaultViewBox: n,
671
- size: l,
672
- title: s,
673
- semantic: i = !1,
674
- ...m
675
- }) => {
676
- const u = d(l, o);
677
- return /* @__PURE__ */ h(B, { children: [
678
- /* @__PURE__ */ a(
679
- "svg",
680
- {
681
- xmlns: "http://www.w3.org/2000/svg",
682
- className: u,
683
- viewBox: t || n,
684
- fill: r || "currentColor",
685
- role: "img",
686
- "aria-hidden": !i,
687
- focusable: !1,
688
- ...m,
689
- children: e
690
- }
691
- ),
692
- s && i && /* @__PURE__ */ a("span", { className: "sr-only", children: s })
693
- ] });
694
- };
695
- /*!
696
- @versini/ui-svgicon v4.0.7
697
- © 2025 gizmette.com
698
- */
699
- try {
700
- window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
701
- version: "4.0.7",
702
- buildTime: "01/20/2025 01:49 PM EST",
703
- homepage: "https://github.com/aversini/ui-components",
704
- license: "MIT"
705
- });
706
- } catch {
707
- }
708
- const Nr = ({
709
- className: e,
710
- viewBox: r,
711
- title: t,
712
- monotone: o,
713
- ...n
714
- }) => /* @__PURE__ */ a(
715
- xr,
716
- {
717
- defaultViewBox: "0 0 384 512",
718
- size: "size-5",
719
- viewBox: r,
720
- className: e,
721
- title: t || "Close",
722
- ...n,
723
- children: /* @__PURE__ */ a(
724
- "path",
725
- {
726
- d: "M297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4c12.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.3z",
727
- opacity: o ? "1" : "0.4"
728
- }
729
- )
730
- }
731
- );
732
- /*!
733
- @versini/ui-icons v4.5.2
734
- © 2025 gizmette.com
735
- */
736
- try {
737
- window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
738
- version: "4.5.2",
739
- buildTime: "01/20/2025 01:49 PM EST",
740
- homepage: "https://github.com/aversini/ui-components",
741
- license: "MIT"
742
- });
743
- } catch {
744
- }
745
- const Ze = S.createContext(null);
746
- function wr({
747
- initialOpen: e = !1,
748
- open: r,
749
- onOpenChange: t
750
- } = {}) {
751
- const [o, n] = S.useState(e), [l, s] = S.useState(), [i, m] = S.useState(), u = r ?? o, g = t ?? n, y = qt({
752
- open: u,
753
- onOpenChange: g
754
- }), f = y.context, c = Qt(f, {
755
- enabled: r == null
756
- }), p = Jt(f, {
757
- outsidePress: !1,
758
- outsidePressEvent: "mousedown"
759
- }), v = Zt(f), x = er([c, p, v]);
760
- return S.useMemo(
761
- () => ({
762
- open: u,
763
- setOpen: g,
764
- ...x,
765
- ...y,
766
- labelId: l,
767
- descriptionId: i,
768
- setLabelId: s,
769
- setDescriptionId: m
770
- }),
771
- [u, g, x, y, l, i]
772
- );
773
- }
774
- const ke = () => {
775
- const e = S.useContext(Ze);
776
- if (e == null)
777
- throw new Error("Modal components must be wrapped in <Modal />");
778
- return e;
779
- };
780
- function Er({
781
- children: e,
782
- ...r
783
- }) {
784
- const t = wr(r);
785
- return /* @__PURE__ */ a(Ze.Provider, { value: t, children: e });
786
- }
787
- const Tr = S.forwardRef(function(e, r) {
788
- const { context: t, ...o } = ke(), n = Yt([o.refs.setFloating, r]);
789
- if (!t.open)
790
- return null;
791
- const { overlayBackground: l, ...s } = e, i = d("grid place-items-center", {
792
- [`${l}`]: l,
793
- "bg-black sm:bg-black/[.8]": !l
794
- });
795
- return /* @__PURE__ */ a(Wt, { children: /* @__PURE__ */ a(Kt, { className: i, lockScroll: !0, children: /* @__PURE__ */ a(Xt, { context: t, children: /* @__PURE__ */ a(
796
- "div",
797
- {
798
- ref: n,
799
- "aria-labelledby": o.labelId,
800
- "aria-describedby": o.descriptionId,
801
- ...o.getFloatingProps(s),
802
- children: s.children
803
- }
804
- ) }) }) });
805
- }), Cr = S.forwardRef(function({ children: e, ...r }, t) {
806
- const { setLabelId: o } = ke(), n = Se();
807
- return S.useLayoutEffect(() => (o(n), () => o(void 0)), [n, o]), /* @__PURE__ */ a("h1", { ...r, ref: t, id: n, children: e });
808
- }), _r = S.forwardRef(function({ children: e, ...r }, t) {
809
- const { setDescriptionId: o } = ke(), n = Se();
810
- return S.useLayoutEffect(() => (o(n), () => o(void 0)), [n, o]), /* @__PURE__ */ a("div", { ...r, ref: t, id: n, children: e });
811
- }), Ir = S.forwardRef(function(e, r) {
812
- const { setOpen: t } = ke(), { trigger: o, className: n, ...l } = e, s = S.useCallback(() => t(!1), [t]);
813
- return /* @__PURE__ */ a("div", { className: n, children: S.cloneElement(o, {
814
- ref: r,
815
- onClick: s,
816
- ...l
817
- }) });
818
- });
819
- /*!
820
- @versini/ui-modal v1.2.8
821
- © 2025 gizmette.com
822
- */
823
- try {
824
- window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
825
- version: "1.2.8",
826
- buildTime: "01/20/2025 03:51 PM EST",
827
- homepage: "https://github.com/aversini/ui-components",
828
- license: "MIT"
829
- });
830
- } catch {
831
- }
832
- const se = "panel", ue = "messagebox", Sr = ({
833
- className: e,
834
- kind: r,
835
- borderMode: t
836
- }) => ({
837
- main: d("prose prose-lighter flex flex-col bg-surface-medium", {
838
- [`${Ve} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: r === se,
839
- [`${Ve} w-full sm:w-[95%] md:max-w-2xl`]: r === se && !e,
840
- [`${De} rounded-lg border-2`]: r === ue,
841
- [`${De} w-[95%] sm:w-[50%] md:max-w-2xl`]: r === ue && !e,
842
- [`${e}`]: !!e,
843
- "sm:border-border-dark": t === "dark" && r === se,
844
- "sm:border-border-accent": t === "light" && r === se,
845
- "border-border-dark": t === "dark" && r === ue,
846
- "border-border-accent": t === "light" && r === ue
847
- }),
848
- content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
849
- footer: "flex flex-grow flex-col sm:p-4 p-2",
850
- header: "sm:p-4 mb-0 p-2",
851
- close: "sm:p-4 p-2"
852
- }), J = ({
853
- open: e,
854
- onOpenChange: r,
855
- title: t,
856
- children: o,
857
- footer: n,
858
- borderMode: l = "light",
859
- kind: s = se,
860
- className: i
861
- }) => {
862
- const m = _(""), u = Sr({ className: i, kind: s, borderMode: l });
863
- return D(() => (e && (m.current = document.title, document.title = `${t} | ${m.current}`), () => {
864
- e && (document.title = m.current);
865
- }), [t, e]), /* @__PURE__ */ a(B, { children: e && /* @__PURE__ */ a(Er, { open: e, onOpenChange: r, children: /* @__PURE__ */ h(Tr, { className: u.main, children: [
866
- /* @__PURE__ */ h("div", { className: "flex flex-row-reverse items-center justify-between", children: [
867
- /* @__PURE__ */ a(
868
- Ir,
869
- {
870
- className: u.close,
871
- trigger: /* @__PURE__ */ a(
872
- Je,
873
- {
874
- mode: "dark",
875
- focusMode: "light",
876
- noBorder: !0,
877
- label: "Close",
878
- children: /* @__PURE__ */ a(Nr, {})
879
- }
880
- )
881
- }
882
- ),
883
- /* @__PURE__ */ a(Cr, { className: u.header, children: t })
884
- ] }),
885
- /* @__PURE__ */ a(_r, { className: u.content, children: o }),
886
- n && /* @__PURE__ */ a("div", { className: u.footer, children: n })
887
- ] }) }) });
888
- }, Ar = () => {
889
- const { getAccessToken: e } = G(), r = fe(), t = fe(), {
890
- data: o,
891
- error: n,
892
- isLoading: l
893
- } = At({
894
- getAccessToken: e
895
- }), s = (o == null ? void 0 : o.plugins) || [], i = (o == null ? void 0 : o.version) || "", m = (o == null ? void 0 : o.models) || [];
896
- return /* @__PURE__ */ h(B, { children: [
897
- /* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(
898
- H,
899
- {
900
- header: T.ABOUT.TITLE_CLIENT,
901
- className: "prose-dark dark:prose-lighter",
902
- children: he(r, {
903
- [T.ABOUT.VERSION]: "6.0.3",
904
- [T.ABOUT.BUILD_TIMESTAMP]: "01/23/2025 08:42 AM EST"
905
- })
906
- }
907
- ) }),
908
- n || l ? null : /* @__PURE__ */ a(
909
- H,
910
- {
911
- header: T.ABOUT.TITLE_SERVER,
912
- className: "prose-dark dark:prose-lighter",
913
- children: he(t, {
914
- [T.ABOUT.VERSION]: i,
915
- [ge(T.ABOUT.ENGINE, m.length)]: /* @__PURE__ */ a(B, { children: m.map((u) => /* @__PURE__ */ a("div", { className: "text-right", children: u }, u)) }),
916
- [ge(T.ABOUT.PLUGIN, s.length)]: /* @__PURE__ */ a(B, { children: s.map((u) => /* @__PURE__ */ a("div", { className: "text-right", children: u }, u)) })
917
- })
918
- }
919
- )
920
- ] });
921
- }, Rr = ({
922
- open: e,
923
- onOpenChange: r
924
- }) => /* @__PURE__ */ a(J, { open: e, onOpenChange: r, title: ht, children: /* @__PURE__ */ a(Ar, {}) }), et = ({
925
- showConfirmation: e,
926
- setShowConfirmation: r,
927
- action: t,
928
- children: o,
929
- customStrings: n
930
- }) => /* @__PURE__ */ a(
931
- J,
932
- {
933
- kind: "messagebox",
934
- open: e,
935
- onOpenChange: r,
936
- title: n.title,
937
- footer: /* @__PURE__ */ h(X, { columnGap: 2, alignHorizontal: "flex-end", children: [
938
- /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
939
- U,
940
- {
941
- mode: "dark",
942
- variant: "secondary",
943
- focusMode: "light",
944
- onClick: () => {
945
- r(!1);
946
- },
947
- children: n.cancelAction
948
- }
949
- ) }),
950
- /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
951
- U,
952
- {
953
- mode: "dark",
954
- variant: "danger",
955
- focusMode: "light",
956
- onClick: () => {
957
- r(!1), t();
958
- },
959
- children: n.confirmAction
960
- }
961
- ) })
962
- ] }),
963
- children: o
964
- }
965
- ), Lr = async (e, r, t, o) => {
966
- try {
967
- const n = await ie({
968
- accessToken: o,
969
- type: ce.GET_CHAT,
970
- params: {
971
- id: e.id
972
- }
973
- });
974
- n.status === 200 && (r({
975
- type: ft
976
- }), r({
977
- type: pt,
978
- payload: {
979
- id: e.id,
980
- model: n.data.model,
981
- usage: n.data.usage,
982
- messages: n.data.messages
983
- }
984
- }), t(!1));
985
- } catch {
986
- }
987
- }, Mr = ({
988
- filteredHistory: e,
989
- dispatch: r,
990
- onOpenChange: t,
991
- mutate: o
992
- }) => {
993
- var C;
994
- const { user: n, getAccessToken: l } = G(), s = _(null), i = _({
995
- id: 0,
996
- timestamp: "",
997
- message: ""
998
- }), [m, u] = w(!1), [g, y] = w(
999
- Oe + Pe
1000
- ), { state: f, dispatch: c } = pe(je), [, p] = Ie({
1001
- key: _e + gt,
1002
- initialValue: f.sortDirection
1003
- }), v = (b) => {
1004
- switch (f.sortDirection) {
1005
- case ae.ASC:
1006
- p(ae.DESC), c({
1007
- type: ze,
1008
- payload: {
1009
- sortedCell: b,
1010
- sortDirection: ae.DESC
1011
- }
1012
- });
1013
- break;
1014
- default:
1015
- p(ae.ASC), c({
1016
- type: ze,
1017
- payload: {
1018
- sortedCell: b,
1019
- sortDirection: ae.ASC
1020
- }
1021
- });
1022
- break;
1023
- }
1024
- }, x = async () => {
1025
- const b = i.current;
1026
- try {
1027
- await ie({
1028
- accessToken: await l(),
1029
- type: ce.DELETE_CHAT,
1030
- params: {
1031
- userId: (n == null ? void 0 : n.username) || "",
1032
- id: b.id
1033
- }
1034
- }), o();
1035
- } catch {
1036
- }
1037
- }, k = Ke((b) => {
1038
- b[0].isIntersecting && y((I) => I + Oe);
1039
- }, []);
1040
- return D(() => {
1041
- const b = {
1042
- // root: null,
1043
- rootMargin: "20px"
1044
- }, E = new IntersectionObserver(k, b);
1045
- s.current && E.observe(s.current);
1046
- }), /* @__PURE__ */ h(B, { children: [
1047
- /* @__PURE__ */ h(
1048
- et,
1049
- {
1050
- showConfirmation: m,
1051
- setShowConfirmation: u,
1052
- action: x,
1053
- customStrings: {
1054
- confirmAction: "Delete",
1055
- cancelAction: "Cancel",
1056
- title: "Delete chat"
1057
- },
1058
- children: [
1059
- /* @__PURE__ */ a("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
1060
- /* @__PURE__ */ h("ul", { className: "m-0", children: [
1061
- /* @__PURE__ */ h("li", { children: [
1062
- "Timestamp:",
1063
- " ",
1064
- /* @__PURE__ */ a("span", { className: "text-lg", children: i.current && i.current.timestamp })
1065
- ] }),
1066
- /* @__PURE__ */ h("li", { children: [
1067
- "First message:",
1068
- " ",
1069
- /* @__PURE__ */ a("span", { className: "text-lg", children: (C = i.current) == null ? void 0 : C.message })
1070
- ] })
1071
- ] })
1072
- ]
1073
- }
1074
- ),
1075
- /* @__PURE__ */ h(Rt, { stickyHeader: !0, stickyFooter: !0, compact: !0, children: [
1076
- /* @__PURE__ */ a(Lt, { children: /* @__PURE__ */ h(Ne, { children: [
1077
- /* @__PURE__ */ a($, { className: "sr-only", children: "Row" }),
1078
- /* @__PURE__ */ a(
1079
- Mt,
1080
- {
1081
- buttonClassName: "text-xs sm:text-sm",
1082
- cellId: "timestamp",
1083
- align: "left",
1084
- sortDirection: f.sortDirection,
1085
- sortedCell: f.sortedCell,
1086
- onClick: () => {
1087
- v("timestamp");
1088
- },
1089
- children: "Date"
1090
- }
1091
- ),
1092
- /* @__PURE__ */ a($, { className: "text-xs sm:text-sm", children: "First message" }),
1093
- /* @__PURE__ */ a($, { className: "text-xs sm:text-sm", children: "Model" }),
1094
- /* @__PURE__ */ a($, { className: "text-xs sm:text-sm text-right", children: "Actions" })
1095
- ] }) }),
1096
- /* @__PURE__ */ a(Bt, { children: e.slice(0, g).map((b, E) => {
1097
- var I, O;
1098
- return ((I = b == null ? void 0 : b.messages) == null ? void 0 : I.length) > 0 ? /* @__PURE__ */ h(Gt, { children: [
1099
- E === g - Pe && /* @__PURE__ */ a("tr", { ref: s }),
1100
- /* @__PURE__ */ h(Ne, { children: [
1101
- /* @__PURE__ */ a($, { children: E + 1 }),
1102
- /* @__PURE__ */ a(
1103
- $,
1104
- {
1105
- component: "th",
1106
- scope: "row",
1107
- className: "text-gray-400 sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
1108
- children: b.timestamp.split(",")[0]
1109
- }
1110
- ),
1111
- /* @__PURE__ */ a(
1112
- $,
1113
- {
1114
- className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
1115
- style: {
1116
- wordBreak: "break-word"
1117
- },
1118
- children: b.messages.length > 0 ? (O = b.messages[0]) == null ? void 0 : O.content : ""
1119
- }
1120
- ),
1121
- /* @__PURE__ */ h(
1122
- $,
1123
- {
1124
- component: "th",
1125
- scope: "row",
1126
- className: "text-gray-400",
1127
- align: "center",
1128
- children: [
1129
- b.model && b.model.startsWith("claude") && /* @__PURE__ */ a(Ot, { size: "size-4 sm:size-5" }),
1130
- b.model && b.model.startsWith("gpt") && /* @__PURE__ */ a(Pt, { size: "size-4 sm:size-5" })
1131
- ]
1132
- }
1133
- ),
1134
- /* @__PURE__ */ h($, { align: "right", children: [
1135
- /* @__PURE__ */ a(
1136
- le,
1137
- {
1138
- className: "mr-2",
1139
- focusMode: "alt-system",
1140
- noBorder: !0,
1141
- label: "Restore chat",
1142
- onClick: async () => {
1143
- const P = await l();
1144
- Lr(
1145
- b,
1146
- r,
1147
- t,
1148
- P
1149
- );
1150
- },
1151
- children: /* @__PURE__ */ a(sr, { size: "size-3", monotone: !0 })
1152
- }
1153
- ),
1154
- /* @__PURE__ */ a(
1155
- le,
1156
- {
1157
- focusMode: "alt-system",
1158
- noBorder: !0,
1159
- label: "Delete chat",
1160
- onClick: () => {
1161
- var P;
1162
- i.current = {
1163
- id: b.id,
1164
- timestamp: b.timestamp,
1165
- message: b.messages.length > 0 ? (P = b.messages[0]) == null ? void 0 : P.content : ""
1166
- }, u(!m);
1167
- },
1168
- children: /* @__PURE__ */ a("div", { className: "text-red-400", children: /* @__PURE__ */ a(rr, { size: "size-3", monotone: !0 }) })
1169
- }
1170
- )
1171
- ] })
1172
- ] })
1173
- ] }, `${T.HISTORY.TITLE}-${b.id}-${E}`) : null;
1174
- }) }),
1175
- /* @__PURE__ */ a(zt, { children: /* @__PURE__ */ a(Ne, { children: /* @__PURE__ */ a($, { colSpan: 1e3, children: /* @__PURE__ */ a("div", { children: ge(
1176
- `${e.length} chat`,
1177
- e.length
1178
- ) }) }) }) })
1179
- ] })
1180
- ] });
1181
- }, Br = ({
1182
- open: e,
1183
- onOpenChange: r
1184
- }) => {
1185
- const { getAccessToken: t, user: o } = G(), { state: n, dispatch: l } = pe(Ye), { state: s, dispatch: i } = pe(je), { data: m, mutate: u } = $t({
1186
- keys: [
1187
- o == null ? void 0 : o.username,
1188
- s.searchString,
1189
- s.sortDirection,
1190
- (n == null ? void 0 : n.lastTriggeredTimestamp) || 0
1191
- ],
1192
- getAccessToken: t
1193
- }), g = _(null), [, y] = Ie({
1194
- key: _e + bt,
1195
- initialValue: s.searchString
1196
- }), [f, c] = w([]);
1197
- D(() => {
1198
- m && c(m);
1199
- }, [m]);
1200
- const p = async (k) => {
1201
- y(k), i({
1202
- type: kt,
1203
- payload: { searchString: k }
1204
- });
1205
- }, v = vt((k) => {
1206
- p(k.target.value.trim());
1207
- }, 500);
1208
- return /* @__PURE__ */ a(J, { open: e, onOpenChange: r, title: yt, children: /* @__PURE__ */ h(B, { children: [
1209
- /* @__PURE__ */ a("form", { autoComplete: "off", onSubmit: async (k) => {
1210
- k.preventDefault();
1211
- }, children: /* @__PURE__ */ a(
1212
- Ee,
1213
- {
1214
- autoCapitalize: "off",
1215
- autoComplete: "off",
1216
- autoCorrect: "off",
1217
- ref: g,
1218
- defaultValue: s.searchString,
1219
- focusMode: "light",
1220
- mode: "dark",
1221
- name: "Search",
1222
- label: "Search",
1223
- onChange: v,
1224
- className: "mt-2 mb-2",
1225
- ...s.searchString && {
1226
- rightElement: /* @__PURE__ */ a(
1227
- U,
1228
- {
1229
- type: "button",
1230
- disabled: !s.searchString,
1231
- mode: "light",
1232
- focusMode: "light",
1233
- noBorder: !0,
1234
- size: "small",
1235
- onClick: () => {
1236
- var k;
1237
- p(""), (k = g.current) != null && k.value && (g.current.value = "", g.current.focus());
1238
- },
1239
- children: "Reset"
1240
- }
1241
- )
1242
- }
1243
- }
1244
- ) }),
1245
- /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 sm:flex-row max-h-[60vh] min-h-[60vh]", children: /* @__PURE__ */ a(
1246
- Mr,
1247
- {
1248
- mutate: u,
1249
- filteredHistory: f,
1250
- dispatch: l,
1251
- onOpenChange: r
1252
- }
1253
- ) })
1254
- ] }) });
1255
- }, Or = ({ stats: e }) => {
1256
- const { isAuthenticated: r, user: t, registeringForPasskey: o, authenticationType: n } = G(), l = fe(), s = fe(), i = (t == null ? void 0 : t.username) || "";
1257
- return r && i ? /* @__PURE__ */ h(B, { children: [
1258
- /* @__PURE__ */ a(
1259
- H,
1260
- {
1261
- header: T.PREFERENCES.TITLE,
1262
- className: "prose-dark dark:prose-lighter",
1263
- children: he(l, {
1264
- [T.PREFERENCES.NAME]: i,
1265
- [T.PREFERENCES.EMAIL]: (t == null ? void 0 : t.email) || ""
1266
- })
1267
- }
1268
- ),
1269
- n !== xt.PASSKEY && /* @__PURE__ */ h(
1270
- H,
1271
- {
1272
- className: "prose-dark dark:prose-lighter mt-4",
1273
- header: /* @__PURE__ */ a("h2", { className: "m-0", children: /* @__PURE__ */ h(X, { columnGap: 3, alignVertical: "center", children: [
1274
- /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a($e, { size: "size-8" }) }),
1275
- /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a("div", { children: T.PREFERENCES.PASSKEY_TITLE }) })
1276
- ] }) }),
1277
- children: [
1278
- /* @__PURE__ */ a("p", { children: T.PREFERENCES.PASSKEY_INSTRUCTIONS }),
1279
- /* @__PURE__ */ a(
1280
- le,
1281
- {
1282
- size: "small",
1283
- className: "mt-2",
1284
- onClick: o,
1285
- labelLeft: T.PREFERENCES.PASSKEY_BUTTON,
1286
- children: /* @__PURE__ */ a($e, { size: "size-5", monotone: !0 })
1287
- }
1288
- )
1289
- ]
1290
- }
1291
- ),
1292
- /* @__PURE__ */ a(
1293
- H,
1294
- {
1295
- header: T.MAIN_STATISTICS.TITLE,
1296
- className: "prose-dark dark:prose-lighter mt-4",
1297
- children: he(s, {
1298
- [ge(T.MAIN_STATISTICS.TOTAL, e.totalChats)]: e.totalChats,
1299
- [T.MAIN_STATISTICS.PROCESSING_TIME]: Nt(
1300
- e.averageProcessingTimes
1301
- )
1302
- })
1303
- }
1304
- )
1305
- ] }) : null;
1306
- }, Pr = ({
1307
- open: e,
1308
- onOpenChange: r
1309
- }) => {
1310
- const { getAccessToken: t, user: o } = G(), {
1311
- data: n,
1312
- error: l,
1313
- isLoading: s
1314
- } = Ht({
1315
- keys: [o == null ? void 0 : o.username],
1316
- getAccessToken: t
1317
- });
1318
- return l || s ? null : /* @__PURE__ */ a(J, { open: e, onOpenChange: r, title: wt, children: /* @__PURE__ */ a(Or, { stats: n }) });
1319
- };
1320
- /*!
1321
- @versini/ui-textarea v3.0.10
1322
- © 2025 gizmette.com
1323
- */
1324
- try {
1325
- window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
1326
- version: "3.0.10",
1327
- buildTime: "01/20/2025 10:07 PM EST",
1328
- homepage: "https://github.com/aversini/ui-components",
1329
- license: "MIT"
1330
- });
1331
- } catch {
1332
- }
1333
- const tt = "av-text-area", zr = "av-text-area-wrapper", we = "av-text-area-helper-text", $r = "av-text-area__control--right", Hr = "av-text-area__control--left";
1334
- function Dr() {
1335
- const e = _(!1);
1336
- return D(() => (e.current = !0, () => {
1337
- e.current = !1;
1338
- }), []), Ke(() => e.current, []);
1339
- }
1340
- function Vr(e) {
1341
- return Xe(() => e.every((r) => r == null) ? () => {
1342
- } : (r) => {
1343
- e.forEach((t) => {
1344
- typeof t == "function" ? t(r) : t != null && (t.current = r);
1345
- });
1346
- }, e);
1347
- }
1348
- const Ur = {
1349
- x: 0,
1350
- y: 0,
1351
- width: 0,
1352
- height: 0,
1353
- top: 0,
1354
- left: 0,
1355
- bottom: 0,
1356
- right: 0
1357
- };
1358
- function Fe(e) {
1359
- const r = Dr(), t = _(0), o = _(null), [n, l] = w(Ur), s = Xe(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((i) => {
1360
- const m = i[0];
1361
- m && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
1362
- o.current && r() && l(m.contentRect);
1363
- }));
1364
- }), [r]);
1365
- return D(() => (o.current && (s == null || s.observe(o.current, e)), () => {
1366
- s == null || s.disconnect(), t.current && cancelAnimationFrame(t.current);
1367
- }), [s, e]), [o, n];
1368
- }
1369
- function Fr({
1370
- value: e,
1371
- defaultValue: r,
1372
- finalValue: t,
1373
- onChange: o = () => {
1374
- },
1375
- initialControlledDelay: n = 0
1376
- }) {
1377
- const [l, s] = w(!1), [i, m] = w(
1378
- r !== void 0 ? r : t
1379
- ), u = (g) => {
1380
- m(g), o == null || o(g);
1381
- };
1382
- return D(() => {
1383
- (async () => e !== void 0 && !l && n > 0 && (await new Promise(
1384
- (g) => setTimeout(g, n)
1385
- ), s(!0)))();
1386
- }, [e, n, l]), e !== void 0 ? !l && n > 0 ? ["", o, !0] : [e, o, !0] : [i, u, !1];
1387
- }
1388
- function Gr(e) {
1389
- const r = Se();
1390
- if (!e)
1391
- return r;
1392
- if (typeof e == "number" || typeof e == "string")
1393
- return `${e}${r}`;
1394
- if (typeof e == "object") {
1395
- const { id: t, prefix: o = "" } = e;
1396
- return typeof t == "number" || typeof t == "string" ? `${o}${t}` : `${o}${r}`;
1397
- }
1398
- }
1399
- const rt = "SET_ANNOUNCEMENT", at = "CLEAR_ANNOUNCEMENT", jr = {
1400
- alert: null,
1401
- alertdialog: null,
1402
- log: "polite",
1403
- marquee: null,
1404
- progressbar: null,
1405
- status: "polite",
1406
- timer: "assertive"
1407
- }, Yr = (e, r) => {
1408
- switch (r == null ? void 0 : r.type) {
1409
- case rt:
1410
- return {
1411
- ...e,
1412
- announcement: r.payload
1413
- };
1414
- case at:
1415
- return {
1416
- ...e,
1417
- announcement: null
1418
- };
1419
- default:
1420
- return e;
1421
- }
1422
- }, Wr = ({
1423
- onAnnouncementClear: e,
1424
- dispatch: r
1425
- }) => {
1426
- r({
1427
- type: at
1428
- }), typeof e == "function" && e();
1429
- }, Ge = ({
1430
- children: e,
1431
- clearAnnouncementDelay: r,
1432
- clearAnnouncementTimeoutRef: t,
1433
- onAnnouncementClear: o,
1434
- dispatch: n
1435
- }) => {
1436
- clearTimeout(t.current), e !== null && n({
1437
- type: rt,
1438
- payload: e
1439
- }), r && (t.current = setTimeout(
1440
- () => Wr({
1441
- onAnnouncementClear: o,
1442
- dispatch: n
1443
- }),
1444
- r
1445
- ));
1446
- }, Kr = ({
1447
- children: e,
1448
- announcementTimeoutRef: r,
1449
- announcementDelay: t,
1450
- clearAnnouncementDelay: o,
1451
- clearAnnouncementTimeoutRef: n,
1452
- onAnnouncementClear: l,
1453
- dispatch: s
1454
- }) => {
1455
- clearTimeout(r.current), t ? r.current = setTimeout(Ge, t, {
1456
- children: e,
1457
- clearAnnouncementDelay: o,
1458
- clearAnnouncementTimeoutRef: n,
1459
- onAnnouncementClear: l,
1460
- dispatch: s
1461
- }) : Ge({
1462
- children: e,
1463
- clearAnnouncementDelay: o,
1464
- clearAnnouncementTimeoutRef: n,
1465
- onAnnouncementClear: l,
1466
- dispatch: s
1467
- });
1468
- };
1469
- function Xr({
1470
- children: e,
1471
- className: r,
1472
- politeness: t,
1473
- role: o = null,
1474
- announcementDelay: n,
1475
- clearAnnouncementDelay: l,
1476
- onAnnouncementClear: s,
1477
- visible: i,
1478
- ...m
1479
- }) {
1480
- const u = _(null), g = _(null), [y, f] = jt(Yr, {
1481
- announcement: null
1482
- });
1483
- let c = t;
1484
- typeof c > "u" && (c = o ? jr[o] : "assertive"), D(() => {
1485
- Kr({
1486
- announcementTimeoutRef: u,
1487
- announcementDelay: n,
1488
- children: e,
1489
- clearAnnouncementDelay: l,
1490
- clearAnnouncementTimeoutRef: g,
1491
- onAnnouncementClear: s,
1492
- dispatch: f
1493
- });
1494
- }, [
1495
- e,
1496
- n,
1497
- l,
1498
- s
1499
- ]);
1500
- const p = d(r, {
1501
- "sr-only": !i
1502
- });
1503
- return /* @__PURE__ */ a(
1504
- "div",
1505
- {
1506
- "aria-live": c,
1507
- ...o && { role: o },
1508
- className: p,
1509
- ...m,
1510
- children: y.announcement
1511
- }
1512
- );
1513
- }
1514
- /*!
1515
- @versini/ui-liveregion v1.3.7
1516
- © 2025 gizmette.com
1517
- */
1518
- try {
1519
- window.__VERSINI_UI_LIVEREGION__ || (window.__VERSINI_UI_LIVEREGION__ = {
1520
- version: "1.3.7",
1521
- buildTime: "01/20/2025 10:07 PM EST",
1522
- homepage: "https://github.com/aversini/ui-components",
1523
- license: "MIT"
1524
- });
1525
- } catch {
1526
- }
1527
- const qr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", Qr = ({ mode: e }) => d({
1528
- "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
1529
- "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
1530
- "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
1531
- "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
1532
- }), Jr = ({
1533
- focusMode: e
1534
- }) => d("focus:outline focus:outline-2 focus:outline-offset-2", {
1535
- "focus:outline-focus-dark": e === "dark",
1536
- "focus:outline-focus-light": e === "light",
1537
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1538
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1539
- }), Zr = ({
1540
- noBorder: e,
1541
- error: r
1542
- }) => d("border-2", {
1543
- "border-border-dark": !e && !r,
1544
- "focus:border-border-dark": !e && r,
1545
- "border-border-error-dark": !e && r,
1546
- "border-transparent": e
1547
- }), ea = ({
1548
- disabled: e,
1549
- raw: r,
1550
- error: t,
1551
- mode: o,
1552
- leftElement: n,
1553
- rightElement: l
1554
- }) => {
1555
- if (r)
1556
- return "";
1557
- if (e)
1558
- return d(
1559
- "transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
1560
- {
1561
- "translate-x-[12px]": l === !0 && !n || !l && !n
1562
- }
1563
- );
1564
- if (!t)
1565
- return d(
1566
- "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
1567
- {
1568
- "translate-x-[12px]": l === !0 && !n || !l && !n,
1569
- "text-copy-medium": o === "dark",
1570
- "text-copy-dark": o === "light",
1571
- "text-copy-dark dark:text-copy-medium": o === "system",
1572
- "text-copy-medium dark:text-copy-dark": o === "alt-system"
1573
- }
1574
- );
1575
- if (t)
1576
- return d(
1577
- "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
1578
- {
1579
- "translate-x-[12px]": l === !0 && !n || !l && !n,
1580
- "text-copy-medium": o === "dark",
1581
- "text-copy-error-dark": o === "light",
1582
- "text-copy-error-dark dark:text-copy-error-light": o === "system",
1583
- "text-copy-medium dark:text-copy-error-dark": o === "alt-system"
1584
- }
1585
- );
1586
- }, ta = ({
1587
- error: e,
1588
- raw: r,
1589
- mode: t,
1590
- disabled: o
1591
- }) => {
1592
- if (r)
1593
- return "";
1594
- if (o)
1595
- return d(
1596
- we,
1597
- "absolute px-2 cursor-not-allowed opacity-50 font-medium"
1598
- );
1599
- if (!e)
1600
- return d(we, "absolute px-2 font-medium", {
1601
- "text-copy-medium": t === "dark",
1602
- "text-copy-dark": t === "light",
1603
- "text-copy-dark dark:text-copy-medium": t === "system",
1604
- "text-copy-medium dark:text-copy-dark": t === "alt-system"
1605
- });
1606
- if (e)
1607
- return d(we, "absolute px-2 font-medium", {
1608
- "text-copy-error-light": t === "dark",
1609
- "text-copy-error-dark": t === "light",
1610
- "text-copy-error-dark dark:text-copy-error-light": t === "system",
1611
- "dark:text-copy-error-dark text-copy-error-light": t === "alt-system"
1612
- });
1613
- }, ra = ({
1614
- className: e,
1615
- textAreaClassName: r,
1616
- raw: t,
1617
- focusMode: o,
1618
- disabled: n,
1619
- noBorder: l,
1620
- error: s,
1621
- mode: i,
1622
- leftElement: m,
1623
- rightElement: u
1624
- }) => {
1625
- const g = t ? e : d(
1626
- "relative flex w-full flex-col justify-center",
1627
- zr,
1628
- e
1629
- ), y = t ? d(r) : d(
1630
- tt,
1631
- r,
1632
- qr(),
1633
- Qr({ mode: i }),
1634
- Jr({ focusMode: o }),
1635
- Zr({
1636
- noBorder: l,
1637
- error: s
1638
- }),
1639
- {
1640
- "disabled:cursor-not-allowed disabled:opacity-50": n
1641
- }
1642
- ), f = t ? void 0 : "sr-only", c = ea({
1643
- disabled: n,
1644
- raw: t,
1645
- error: s,
1646
- mode: i,
1647
- rightElement: u,
1648
- leftElement: m
1649
- }), p = ta({
1650
- error: s,
1651
- raw: t,
1652
- mode: i,
1653
- disabled: n
1654
- }), v = t ? void 0 : d($r, "absolute"), x = t ? void 0 : d(Hr, "absolute");
1655
- return {
1656
- wrapper: g,
1657
- textArea: y,
1658
- accessibleLabel: f,
1659
- visibleLabel: c,
1660
- helperText: p,
1661
- rightElement: v,
1662
- leftElement: x
1663
- };
1664
- }, aa = ({
1665
- scrollHeight: e,
1666
- currentHeight: r,
1667
- currentLabelOffset: t = 0,
1668
- currentHelperTextOffset: o = 0
1669
- }) => {
1670
- let n, l;
1671
- if (e > 0 && e !== r) {
1672
- const s = e - r, i = Math.abs(s / 24);
1673
- n = t + -1 * Math.sign(s) * (12 * i), l = o + Math.sign(s) * (12 * i);
1674
- }
1675
- return {
1676
- labelOffset: n,
1677
- helperTextOffset: l,
1678
- scrollHeight: e
1679
- };
1680
- }, Ce = be.forwardRef(
1681
- ({
1682
- id: e,
1683
- name: r,
1684
- label: t,
1685
- error: o = !1,
1686
- raw: n = !1,
1687
- className: l,
1688
- textAreaClassName: s,
1689
- mode: i = "system",
1690
- focusMode: m = "system",
1691
- value: u,
1692
- defaultValue: g,
1693
- disabled: y = !1,
1694
- noBorder: f = !1,
1695
- labelId: c,
1696
- helperText: p = "",
1697
- helperTextOnFocus: v = !1,
1698
- rightElement: x,
1699
- leftElement: k,
1700
- onChange: C,
1701
- onFocus: b,
1702
- onBlur: E,
1703
- ...I
1704
- }, O) => {
1705
- var P;
1706
- const L = _(null), de = Vr([O, L]), [N, M] = Fe(), [Z, j] = Fe(), q = _(80), Y = _(-25), z = _(null), ee = _(30), te = _(null), W = Gr({ id: e, prefix: `${tt}-` }), [Re, ot] = w(0), [Le, nt] = w(0), [st, Me] = w(
1707
- !!(!v && p)
1708
- ), lt = `${r} error, ${p}`, K = ra({
1709
- className: l,
1710
- textAreaClassName: s,
1711
- error: o,
1712
- raw: n,
1713
- focusMode: m,
1714
- disabled: y,
1715
- noBorder: f,
1716
- mode: i,
1717
- rightElement: !!x,
1718
- leftElement: !!k
1719
- }), [V, it] = Fr({
1720
- value: u,
1721
- initialControlledDelay: 20,
1722
- defaultValue: g,
1723
- onChange: (A) => {
1724
- C && C({
1725
- target: {
1726
- value: A
1727
- }
1728
- });
1729
- }
1730
- }), ct = (A) => {
1731
- it(A.target.value);
1732
- }, dt = (A) => {
1733
- v && p && Me(!0), b && b(A);
1734
- }, ut = (A) => {
1735
- v && p && !V && Me(!1), E && E(A);
1736
- };
1737
- return ne(() => {
1738
- M && M.width && ot(M.width + 18 + 10);
1739
- }, [M]), ne(() => {
1740
- j && j.width && nt(j.width + 18 + 10);
1741
- }, [j]), ne(() => {
1742
- n || L && L.current && V !== void 0 && (L.current.style.height = "inherit", L.current.style.height = L.current.scrollHeight + "px");
1743
- }, [V, n]), ne(() => {
1744
- n || setTimeout(() => {
1745
- var A;
1746
- (A = z == null ? void 0 : z.current) == null || A.style.setProperty(
1747
- "--av-text-area-wrapper-transition",
1748
- V ? "none" : "all 0.2s ease-out"
1749
- );
1750
- }, 0);
1751
- }, [V, n]), ne(() => {
1752
- var A, Be;
1753
- if (!n && L && L.current && V !== void 0) {
1754
- const { labelOffset: ve, helperTextOffset: xe, scrollHeight: mt } = aa({
1755
- scrollHeight: L.current.scrollHeight,
1756
- currentHeight: q.current,
1757
- currentLabelOffset: Y.current,
1758
- currentHelperTextOffset: ee.current
1759
- });
1760
- ve && (Y.current = ve, (A = z == null ? void 0 : z.current) == null || A.style.setProperty(
1761
- "--av-text-area-label",
1762
- `${ve}px`
1763
- )), xe && (ee.current = xe, (Be = te == null ? void 0 : te.current) == null || Be.style.setProperty(
1764
- "--av-text-area-helper-text",
1765
- `${xe}px`
1766
- )), q.current = mt || q.current;
1767
- }
1768
- }, [V, n]), j.width > 0 && ((P = z == null ? void 0 : z.current) == null || P.style.setProperty(
1769
- "--tw-translate-x",
1770
- `${12 + j.width + 5}px`
1771
- )), /* @__PURE__ */ h("div", { className: K.wrapper, children: [
1772
- /* @__PURE__ */ a(
1773
- "label",
1774
- {
1775
- htmlFor: W,
1776
- id: c,
1777
- className: K.accessibleLabel,
1778
- children: t
1779
- }
1780
- ),
1781
- k && /* @__PURE__ */ a(
1782
- "div",
1783
- {
1784
- ref: Z,
1785
- className: K.leftElement,
1786
- children: k
1787
- }
1788
- ),
1789
- /* @__PURE__ */ a(
1790
- "textarea",
1791
- {
1792
- ref: de,
1793
- id: W,
1794
- name: r,
1795
- disabled: y,
1796
- placeholder: n ? void 0 : " ",
1797
- className: K.textArea,
1798
- rows: 1,
1799
- ...p && { "aria-describedby": `${W}-helper` },
1800
- ...o && { "aria-invalid": "true" },
1801
- ...x && !k && !n && { style: { paddingRight: Re } },
1802
- ...k && !x && !n && { style: { paddingLeft: Le } },
1803
- ...x && k && !n && {
1804
- style: {
1805
- paddingRight: Re,
1806
- paddingLeft: Le
1807
- }
1808
- },
1809
- value: V,
1810
- onChange: ct,
1811
- onFocus: dt,
1812
- onBlur: ut,
1813
- ...I
1814
- }
1815
- ),
1816
- !n && /* @__PURE__ */ a(
1817
- "label",
1818
- {
1819
- ref: z,
1820
- "aria-hidden": !0,
1821
- htmlFor: W,
1822
- className: `${K.visibleLabel}`,
1823
- children: t
1824
- }
1825
- ),
1826
- st && /* @__PURE__ */ a(
1827
- "div",
1828
- {
1829
- ref: te,
1830
- id: `${W}-helper`,
1831
- className: K.helperText,
1832
- children: p
1833
- }
1834
- ),
1835
- x && /* @__PURE__ */ a(
1836
- "div",
1837
- {
1838
- ref: N,
1839
- className: K.rightElement,
1840
- children: x
1841
- }
1842
- ),
1843
- o && p && /* @__PURE__ */ a(Xr, { politeness: "polite", clearAnnouncementDelay: 500, children: lt })
1844
- ] });
1845
- }
1846
- );
1847
- Ce.displayName = "TextArea";
1848
- /*!
1849
- @versini/ui-toggle v3.0.8
1850
- © 2025 gizmette.com
1851
- */
1852
- try {
1853
- window.__VERSINI_UI_TOGGLE__ || (window.__VERSINI_UI_TOGGLE__ = {
1854
- version: "3.0.8",
1855
- buildTime: "01/20/2025 01:49 PM EST",
1856
- homepage: "https://github.com/aversini/ui-components",
1857
- license: "MIT"
1858
- });
1859
- } catch {
1860
- }
1861
- const oa = "av-toggle", na = () => d("peer", "h-6", "w-11", "rounded-full"), sa = ({
1862
- focusMode: e
1863
- }) => d(
1864
- "peer-focus:outline",
1865
- "peer-focus:outline-2",
1866
- "peer-focus:outline-offset-2",
1867
- {
1868
- "peer-focus:outline-focus-dark": e === "dark",
1869
- "peer-focus:outline-focus-light": e === "light",
1870
- "peer-focus:outline-focus-light dark:peer-focus:outline-focus-dark": e === "alt-system",
1871
- "peer-focus:outline-focus-dark dark:peer-focus:outline-focus-light": e === "system"
1872
- }
1873
- ), la = () => d(
1874
- "peer-checked:after:translate-x-full",
1875
- // background color when checked
1876
- "peer-checked:bg-violet-500",
1877
- // knob circle and border color when checked
1878
- "peer-checked:after:bg-white",
1879
- "peer-checked:after:border-white"
1880
- ), ia = () => d(
1881
- "after:left-[2px]",
1882
- "after:top-[2px]",
1883
- "after:border",
1884
- "after:border-surface-light dark:after:border-surface-medium",
1885
- "after:bg-surface-light dark:after:bg-surface-medium",
1886
- "after:absolute",
1887
- "after:h-5",
1888
- "after:w-5",
1889
- "after:rounded-full",
1890
- "after:transition-all",
1891
- "after:content-['']"
1892
- ), ca = ({
1893
- mode: e,
1894
- noBorder: r
1895
- }) => d({
1896
- border: !r,
1897
- "border-border-dark bg-surface-medium": e === "light",
1898
- "border-border-light bg-surface-darker": e === "dark",
1899
- "border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium": e === "alt-system",
1900
- "border-border-dark bg-surface-medium dark:border-border-light dark:bg-surface-darker": e === "system"
1901
- }), da = ({
1902
- mode: e,
1903
- labelHidden: r
1904
- }) => r ? "sr-only" : d("ml-2 text-sm", {
1905
- "text-copy-dark": e === "light",
1906
- "text-copy-lighter": e === "dark",
1907
- "text-copy-lighter dark:text-copy-dark": e === "alt-system",
1908
- "text-copy-dark dark:text-copy-lighter": e === "system"
1909
- }), ua = ({ className: e }) => d(
1910
- oa,
1911
- "relative flex cursor-pointer items-center",
1912
- e
1913
- ), ma = ({
1914
- mode: e,
1915
- focusMode: r,
1916
- labelHidden: t,
1917
- className: o,
1918
- noBorder: n
1919
- }) => ({
1920
- toggle: d(
1921
- na(),
1922
- ca({ mode: e, noBorder: n }),
1923
- sa({ focusMode: r }),
1924
- ia(),
1925
- la()
1926
- ),
1927
- label: da({ mode: e, labelHidden: t }),
1928
- input: "peer sr-only",
1929
- wrapper: ua({ className: o })
1930
- }), me = ({
1931
- checked: e = !1,
1932
- onChange: r,
1933
- label: t,
1934
- labelHidden: o = !1,
1935
- name: n,
1936
- mode: l = "system",
1937
- focusMode: s = "system",
1938
- className: i,
1939
- noBorder: m = !1
1940
- }) => {
1941
- const u = ma({
1942
- mode: l,
1943
- focusMode: s,
1944
- labelHidden: o,
1945
- className: i,
1946
- noBorder: m
1947
- }), g = (y) => {
1948
- r == null || r(y.target.checked);
1949
- };
1950
- return /* @__PURE__ */ h("label", { className: u.wrapper, children: [
1951
- /* @__PURE__ */ a(
1952
- "input",
1953
- {
1954
- name: n,
1955
- checked: e,
1956
- type: "checkbox",
1957
- className: u.input,
1958
- onChange: g
1959
- }
1960
- ),
1961
- /* @__PURE__ */ a("div", { className: u.toggle }),
1962
- /* @__PURE__ */ a("span", { className: u.label, children: t })
1963
- ] });
1964
- }, ha = ({
1965
- open: e,
1966
- onOpenChange: r
1967
- }) => {
1968
- const { getAccessToken: t, user: o } = G(), {
1969
- data: n,
1970
- error: l,
1971
- isLoading: s,
1972
- mutate: i
1973
- } = We({
1974
- keys: [o == null ? void 0 : o.username],
1975
- getAccessToken: t
1976
- }), [m, u] = w({
1977
- prompts: []
1978
- }), g = ({
1979
- slot: c,
1980
- checked: p,
1981
- label: v,
1982
- content: x
1983
- }) => {
1984
- u((k) => {
1985
- const C = k.prompts, b = {
1986
- slot: c,
1987
- label: v,
1988
- content: x,
1989
- enabled: p
1990
- }, E = C.findIndex((I) => I.slot === c);
1991
- return E === -1 ? {
1992
- ...k,
1993
- prompts: [...C, { ...b, slot: c }]
1994
- } : (C[E] = b, {
1995
- ...k,
1996
- prompts: [...C]
1997
- });
1998
- });
1999
- }, y = async (c) => {
2000
- c.preventDefault();
2001
- try {
2002
- await ie({
2003
- accessToken: await t(),
2004
- type: ce.SET_USER_PREFERENCES,
2005
- params: {
2006
- user: o == null ? void 0 : o.username,
2007
- tags: m.prompts
2008
- }
2009
- });
2010
- } catch {
2011
- }
2012
- }, f = () => {
2013
- i({ ...n }), r(!1);
2014
- };
2015
- return D(() => {
2016
- n != null && n.tags && u({ prompts: n.tags });
2017
- }, [n]), l || s ? null : /* @__PURE__ */ h(
2018
- J,
2019
- {
2020
- open: e,
2021
- onOpenChange: f,
2022
- title: "Prompts",
2023
- footer: /* @__PURE__ */ h(
2024
- X,
2025
- {
2026
- columnGap: 2,
2027
- alignHorizontal: "flex-end",
2028
- className: "pb-8 sm:pb-0",
2029
- children: [
2030
- /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
2031
- U,
2032
- {
2033
- mode: "dark",
2034
- variant: "secondary",
2035
- focusMode: "light",
2036
- onClick: f,
2037
- children: "Cancel"
2038
- }
2039
- ) }),
2040
- /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
2041
- U,
2042
- {
2043
- mode: "dark",
2044
- variant: "danger",
2045
- focusMode: "light",
2046
- onClick: async (c) => {
2047
- r(!1), await y(c);
2048
- },
2049
- children: "Save"
2050
- }
2051
- ) })
2052
- ]
2053
- }
2054
- ),
2055
- children: [
2056
- /* @__PURE__ */ a("p", { children: Et }),
2057
- m.prompts && m.prompts.map((c) => /* @__PURE__ */ h(
2058
- H,
2059
- {
2060
- header: `Prompt ${c.slot + 1}`,
2061
- className: "prose-dark dark:prose-lighter mb-2",
2062
- children: [
2063
- /* @__PURE__ */ h(X, { className: "mt-8 mb-6", columnGap: 2, rowGap: 6, children: [
2064
- /* @__PURE__ */ a(R, { span: 12, children: /* @__PURE__ */ a(
2065
- Ee,
2066
- {
2067
- label: "Label",
2068
- name: `prompt${c.slot}-label`,
2069
- value: c.label,
2070
- onChange: (p) => {
2071
- g({
2072
- slot: c.slot,
2073
- checked: c.enabled,
2074
- label: p.target.value,
2075
- content: c.content
2076
- });
2077
- }
2078
- }
2079
- ) }),
2080
- /* @__PURE__ */ a(R, { span: 12, children: /* @__PURE__ */ a(
2081
- Ee,
2082
- {
2083
- label: "Content",
2084
- name: `prompt${c.slot}-content`,
2085
- value: c.content,
2086
- onChange: (p) => {
2087
- g({
2088
- slot: c.slot,
2089
- checked: c.enabled,
2090
- label: c.label,
2091
- content: p.target.value
2092
- });
2093
- }
2094
- }
2095
- ) })
2096
- ] }),
2097
- /* @__PURE__ */ a(
2098
- me,
2099
- {
2100
- className: "mt-2",
2101
- noBorder: !0,
2102
- label: "Enabled",
2103
- name: c.slot.toString(),
2104
- onChange: (p) => {
2105
- g({
2106
- slot: c.slot,
2107
- checked: p,
2108
- label: c.label,
2109
- content: c.content
2110
- });
2111
- },
2112
- checked: c.enabled
2113
- }
2114
- )
2115
- ]
2116
- },
2117
- `prompt-slot-${c.slot}`
2118
- ))
2119
- ]
2120
- }
2121
- );
2122
- }, ga = ({
2123
- open: e,
2124
- onOpenChange: r
2125
- }) => {
2126
- const { getAccessToken: t, user: o } = G(), {
2127
- data: n,
2128
- error: l,
2129
- isLoading: s,
2130
- mutate: i
2131
- } = We({
2132
- keys: [o == null ? void 0 : o.username],
2133
- getAccessToken: t
2134
- }), [m, u] = w(!1), [g, y] = w({
2135
- loadingLocation: !1
2136
- }), [f, c] = w(""), [p, v] = w(""), [x, k] = w(Tt), [C, b] = Ie({
2137
- key: _e + Ct,
2138
- initialValue: !1
2139
- }), E = (N) => {
2140
- b(N);
2141
- }, I = async (N) => {
2142
- N.preventDefault();
2143
- try {
2144
- await ie({
2145
- accessToken: await t(),
2146
- type: ce.SET_USER_PREFERENCES,
2147
- params: {
2148
- user: o == null ? void 0 : o.username,
2149
- instructions: f,
2150
- location: p,
2151
- engine: x
2152
- }
2153
- }), i(), y({
2154
- loadingLocation: !1
2155
- });
2156
- } catch {
2157
- }
2158
- }, O = async () => {
2159
- y({
2160
- loadingLocation: !0
2161
- }), v("...");
2162
- try {
2163
- const N = Date.now(), M = await St(), Z = await ie({
2164
- accessToken: await t(),
2165
- type: ce.GET_LOCATION,
2166
- params: {
2167
- latitude: M.latitude,
2168
- longitude: M.longitude
2169
- }
2170
- }), q = Date.now() - N;
2171
- if (q < 2e3 && await new Promise((Y) => setTimeout(Y, 2e3 - q)), Z.status === 200) {
2172
- const { city: Y, state: z, country: ee, displayName: te } = Z.data, W = Y && z && ee ? `${Y}, ${z}, ${ee}` : te;
2173
- y({
2174
- loadingLocation: !1
2175
- }), v(W);
2176
- } else
2177
- y({
2178
- loadingLocation: !1
2179
- });
2180
- } catch {
2181
- }
2182
- }, P = (N, M) => {
2183
- k(N ? M : M === Q ? re : Q);
2184
- }, L = () => {
2185
- u(!m);
2186
- }, de = () => {
2187
- i({ ...n }), r(!1);
2188
- };
2189
- return D(() => {
2190
- n != null && n.instructions && c(n.instructions), n != null && n.location && v(n.location), n != null && n.engine && k(n.engine);
2191
- }, [n]), l || s ? null : /* @__PURE__ */ a(
2192
- J,
2193
- {
2194
- open: e,
2195
- onOpenChange: de,
2196
- title: _t,
2197
- footer: /* @__PURE__ */ h(
2198
- X,
2199
- {
2200
- columnGap: 2,
2201
- alignHorizontal: "flex-end",
2202
- className: "pb-8 sm:pb-0",
2203
- children: [
2204
- /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
2205
- U,
2206
- {
2207
- mode: "dark",
2208
- variant: "secondary",
2209
- focusMode: "light",
2210
- onClick: de,
2211
- children: "Cancel"
2212
- }
2213
- ) }),
2214
- /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
2215
- U,
2216
- {
2217
- mode: "dark",
2218
- variant: "danger",
2219
- focusMode: "light",
2220
- onClick: async (N) => {
2221
- r(!1), await I(N);
2222
- },
2223
- children: "Save"
2224
- }
2225
- ) })
2226
- ]
2227
- }
2228
- ),
2229
- children: /* @__PURE__ */ h(B, { children: [
2230
- m && /* @__PURE__ */ a(ha, { open: m, onOpenChange: u }),
2231
- /* @__PURE__ */ h(
2232
- H,
2233
- {
2234
- header: T.SETTINGS_ENGINE.TITLE,
2235
- className: "prose-dark dark:prose-lighter",
2236
- children: [
2237
- /* @__PURE__ */ a("p", { className: "text-sm", children: "Select the AI engine that will be used to generate responses." }),
2238
- /* @__PURE__ */ a(
2239
- me,
2240
- {
2241
- noBorder: !0,
2242
- label: Q,
2243
- name: Q,
2244
- onChange: (N) => P(N, Q),
2245
- checked: x === Q
2246
- }
2247
- ),
2248
- /* @__PURE__ */ a(
2249
- me,
2250
- {
2251
- className: "mt-2",
2252
- noBorder: !0,
2253
- label: re,
2254
- name: re,
2255
- onChange: (N) => P(N, re),
2256
- checked: x === re
2257
- }
2258
- ),
2259
- /* @__PURE__ */ a("p", { className: "text-sm", children: 'This "Show Message Statistics" option adds individual statistics for each messages under their respective bubbles, such as processing time, model name, and more.' }),
2260
- /* @__PURE__ */ a(
2261
- me,
2262
- {
2263
- className: "mt-2",
2264
- noBorder: !0,
2265
- label: "Show Message Statistics",
2266
- name: "show-message-statistics",
2267
- onChange: E,
2268
- checked: C
2269
- }
2270
- ),
2271
- /* @__PURE__ */ a("h3", { className: "border-b-2 border-slate-400", children: "Prompts" }),
2272
- /* @__PURE__ */ a(
2273
- le,
2274
- {
2275
- className: "mt-2",
2276
- size: "small",
2277
- onClick: L,
2278
- labelLeft: "Edit Custom Prompts",
2279
- children: /* @__PURE__ */ a(Dt, { size: "size-3", monotone: !0 })
2280
- }
2281
- )
2282
- ]
2283
- }
2284
- ),
2285
- /* @__PURE__ */ h(
2286
- H,
2287
- {
2288
- header: "Custom Instructions",
2289
- className: "prose-dark dark:prose-lighter mt-4",
2290
- children: [
2291
- /* @__PURE__ */ h("p", { className: "text-sm", children: [
2292
- "What would you like ",
2293
- /* @__PURE__ */ a("em", { children: It }),
2294
- " to know about you to provide better responses?"
2295
- ] }),
2296
- /* @__PURE__ */ a(
2297
- Ce,
2298
- {
2299
- mode: "alt-system",
2300
- autoCapitalize: "off",
2301
- autoComplete: "off",
2302
- autoCorrect: "off",
2303
- name: "customInstructions",
2304
- label: "Custom Instructions",
2305
- value: f,
2306
- onChange: (N) => {
2307
- c(N.target.value);
2308
- },
2309
- helperText: "Press ENTER to add a new line."
2310
- }
2311
- )
2312
- ]
2313
- }
2314
- ),
2315
- /* @__PURE__ */ h(
2316
- H,
2317
- {
2318
- header: "Location",
2319
- className: "prose-dark dark:prose-lighter mt-4",
2320
- children: [
2321
- /* @__PURE__ */ a("p", { className: "text-sm", children: "You can share your location to receive customized responses based on your area." }),
2322
- /* @__PURE__ */ a(
2323
- Ce,
2324
- {
2325
- mode: "alt-system",
2326
- name: "location",
2327
- label: "Location",
2328
- value: p,
2329
- onChange: (N) => {
2330
- v(N.target.value);
2331
- },
2332
- helperText: "Enter your location or press auto-detect."
2333
- }
2334
- ),
2335
- /* @__PURE__ */ a(
2336
- U,
2337
- {
2338
- className: "mt-2",
2339
- size: "small",
2340
- noBorder: !0,
2341
- disabled: g.loadingLocation,
2342
- onClick: O,
2343
- children: g.loadingLocation ? "Detecting..." : "Auto-detect"
2344
- }
2345
- )
2346
- ]
2347
- }
2348
- )
2349
- ] })
2350
- }
2351
- );
2352
- }, xa = () => {
2353
- const { logout: e } = G(), { state: r } = pe(Ye), [t, o] = w(!1), [n, l] = w(!1), [s, i] = w(!1), [m, u] = w(!1), [g, y] = w(!1), f = () => {
2354
- o(!t);
2355
- }, c = () => {
2356
- l(!n);
2357
- }, p = () => {
2358
- i(!s);
2359
- }, v = () => {
2360
- u(!m);
2361
- }, x = () => {
2362
- y(!g);
2363
- };
2364
- return /* @__PURE__ */ h(B, { children: [
2365
- /* @__PURE__ */ a(
2366
- et,
2367
- {
2368
- showConfirmation: g,
2369
- setShowConfirmation: y,
2370
- action: e,
2371
- customStrings: {
2372
- confirmAction: He,
2373
- cancelAction: "Cancel",
2374
- title: He
2375
- },
2376
- children: /* @__PURE__ */ a("p", { children: "Are you sure you want to log out?" })
2377
- }
2378
- ),
2379
- /* @__PURE__ */ a(Pr, { open: t, onOpenChange: o }),
2380
- /* @__PURE__ */ a(ga, { open: n, onOpenChange: l }),
2381
- s && /* @__PURE__ */ a(Br, { open: s, onOpenChange: i }),
2382
- /* @__PURE__ */ a(Rr, { open: m, onOpenChange: u }),
2383
- /* @__PURE__ */ a("div", { className: "bg-slate-900 py-4 px-4 rounded-t-md", children: /* @__PURE__ */ a(X, { alignHorizontal: "flex-end", alignVertical: "center", children: /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
2384
- Vt,
2385
- {
2386
- label: "Profile, Settings, etc.",
2387
- mode: "light",
2388
- placement: "left",
2389
- trigger: /* @__PURE__ */ h(
2390
- Ut,
2391
- {
2392
- mode: "dark",
2393
- focusMode: "light",
2394
- trigger: /* @__PURE__ */ a(le, { label: "Settings", children: /* @__PURE__ */ a(lr, {}) }),
2395
- defaultPlacement: "bottom-end",
2396
- children: [
2397
- /* @__PURE__ */ a(
2398
- oe,
2399
- {
2400
- label: "Profile",
2401
- onClick: f,
2402
- icon: /* @__PURE__ */ a(nr, {})
2403
- }
2404
- ),
2405
- /* @__PURE__ */ a(
2406
- oe,
2407
- {
2408
- label: "Settings",
2409
- onClick: c,
2410
- icon: /* @__PURE__ */ a(ir, {})
2411
- }
2412
- ),
2413
- /* @__PURE__ */ a(
2414
- oe,
2415
- {
2416
- label: "History",
2417
- onClick: p,
2418
- icon: /* @__PURE__ */ a(ar, {})
2419
- }
2420
- ),
2421
- /* @__PURE__ */ a(
2422
- oe,
2423
- {
2424
- label: "About",
2425
- onClick: v,
2426
- icon: /* @__PURE__ */ a(or, {})
2427
- }
2428
- ),
2429
- r && r.id && !r.isComponent && /* @__PURE__ */ h(B, { children: [
2430
- /* @__PURE__ */ a(Ft, {}),
2431
- /* @__PURE__ */ a(
2432
- oe,
2433
- {
2434
- label: "Log out",
2435
- onClick: x,
2436
- icon: /* @__PURE__ */ a("div", { className: "text-red-700", children: /* @__PURE__ */ a(tr, { monotone: !0 }) })
2437
- }
2438
- )
2439
- ] })
2440
- ]
2441
- }
2442
- )
2443
- }
2444
- ) }) }) }) }) })
2445
- ] });
2446
- };
2447
- export {
2448
- xa as default
2449
- };