@versini/sassysaint 5.4.5 → 5.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{LazyApp.C-ghWo2j.js → LazyApp.4Z1jQACq.js} +3 -3
- package/dist/chunks/{LazyHeader.CHy11tdF.js → LazyHeader.UqpjTCxz.js} +1119 -1050
- package/dist/chunks/{LazyMarkdownWithExtra.CRBiqKQo.js → LazyMarkdownWithExtra.BFCvjsJU.js} +1 -1
- package/dist/chunks/{LazyMessageAssistant.ByDEgy53.js → LazyMessageAssistant.B3ooGdCs.js} +4 -4
- package/dist/chunks/{index.CTGK59bg.js → index.B5TWwDVi.js} +3 -3
- package/dist/chunks/{index.Cul7Y08v.js → index.VTwhsE7D.js} +3 -3
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
- package/dist/chunks/index.DaIz2ggm.CWKMlVvg.js +0 -99
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { g as
|
|
3
|
-
import { serviceCall as
|
|
4
|
-
import * as
|
|
5
|
-
import _, { useId as
|
|
1
|
+
import { jsx as r, jsxs as y, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { g as L, E as M, CARDS as T, renderDataAsList as re, pluralize as he, AppContext as se, ABOUT_TITLE as zt, DEFAULT_AI_ENGINE as te, numberFormatter as Ft, durationFormatter as Xe, NA as Gt, ROLE_ASSISTANT as Ht, extractAverage as Ut, GPT4_MAX_TOKENS as jt, un as W, STATS as Je, b as q, j as A, R as F, HistoryContext as et, LOCAL_STORAGE_PREFIX as ie, LOCAL_STORAGE_SORT as Kt, O as j, ACTION_RESET as tt, ACTION_RESTORE as Wt, truncate as Yt, ACTION_SORT as De, LOCAL_STORAGE_SEARCH as qt, fe as Te, ACTION_SEARCH as Zt, debounce as Qt, HISTORY_TITLE as Xt, LOCAL_STORAGE_ENGINE_TOGGLE as ot, ENGINE_OPENAI as we, ENGINE_ANTHROPIC as me, APP_NAME as Jt, ACTION_ENGINE as rt, getCurrentGeoLocation as eo, TagsContext as to, TAGS_DESCRIPTION as oo, ACTION_SET_TAGS as ro, LOCAL_STORAGE_CHAT_DETAILS as no, M as ao, v as ze, PROFILE_TITLE as so, LOG_OUT as Fe } from "./index.VTwhsE7D.js";
|
|
3
|
+
import { serviceCall as V, SERVICE_TYPES as D, E as ce, ge as io, he as co, ue as Ne, pe as lo, se as z, me as uo, be as mo, y as U, $e as Ge, m as He } from "./index.B5TWwDVi.js";
|
|
4
|
+
import * as f from "react";
|
|
5
|
+
import _, { useId as Ae, forwardRef as nt, useState as x, useRef as Z, useContext as P, useEffect as G } from "react";
|
|
6
6
|
import C from "clsx";
|
|
7
|
-
import { useFloatingTree as
|
|
8
|
-
const
|
|
7
|
+
import { useFloatingTree as at, useFloatingNodeId as ho, useListItem as st, useFloating as it, offset as po, flip as go, shift as fo, autoUpdate as bo, useClick as ct, useRole as lt, useDismiss as dt, useListNavigation as vo, useTypeahead as yo, useInteractions as ut, useMergeRefs as Me, FloatingNode as ko, FloatingList as Co, FloatingPortal as mt, FloatingFocusManager as ht, FloatingTree as wo, FloatingOverlay as No } from "@floating-ui/react";
|
|
8
|
+
const pt = ({
|
|
9
9
|
className: e,
|
|
10
10
|
viewBox: t,
|
|
11
11
|
spacing: o,
|
|
@@ -13,7 +13,7 @@ const st = ({
|
|
|
13
13
|
monotone: a,
|
|
14
14
|
...s
|
|
15
15
|
}) => /* @__PURE__ */ r(
|
|
16
|
-
|
|
16
|
+
L,
|
|
17
17
|
{
|
|
18
18
|
defaultViewBox: "0 0 256 176",
|
|
19
19
|
defaultClassName: "size-5",
|
|
@@ -31,8 +31,8 @@ const st = ({
|
|
|
31
31
|
title: n,
|
|
32
32
|
monotone: a,
|
|
33
33
|
...s
|
|
34
|
-
}) => /* @__PURE__ */
|
|
35
|
-
|
|
34
|
+
}) => /* @__PURE__ */ y(
|
|
35
|
+
L,
|
|
36
36
|
{
|
|
37
37
|
defaultViewBox: "0 0 512 512",
|
|
38
38
|
defaultClassName: "size-5",
|
|
@@ -52,15 +52,15 @@ const st = ({
|
|
|
52
52
|
/* @__PURE__ */ r("path", { d: "M32 0H192c17.7 0 32 14.3 32 32s-14.3 32-32 32H109.3L342.6 297.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 32s-32-14.3-32-32V32C0 14.3 14.3 0 32 0z" })
|
|
53
53
|
]
|
|
54
54
|
}
|
|
55
|
-
),
|
|
55
|
+
), To = ({
|
|
56
56
|
className: e,
|
|
57
57
|
viewBox: t,
|
|
58
58
|
spacing: o,
|
|
59
59
|
title: n,
|
|
60
60
|
monotone: a,
|
|
61
61
|
...s
|
|
62
|
-
}) => /* @__PURE__ */
|
|
63
|
-
|
|
62
|
+
}) => /* @__PURE__ */ y(
|
|
63
|
+
L,
|
|
64
64
|
{
|
|
65
65
|
defaultViewBox: "0 0 448 512",
|
|
66
66
|
defaultClassName: "size-5",
|
|
@@ -80,15 +80,15 @@ const st = ({
|
|
|
80
80
|
/* @__PURE__ */ r("path", { d: "M368 96c-26.5 0-48 21.5-48 48V432c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V144c0-26.5-21.5-48-48-48H368zM48 224c-26.5 0-48 21.5-48 48V432c0 26.5 21.5 48 48 48H80c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48H48z" })
|
|
81
81
|
]
|
|
82
82
|
}
|
|
83
|
-
),
|
|
83
|
+
), _o = ({
|
|
84
84
|
className: e,
|
|
85
85
|
viewBox: t,
|
|
86
86
|
spacing: o,
|
|
87
87
|
title: n,
|
|
88
88
|
monotone: a,
|
|
89
89
|
...s
|
|
90
|
-
}) => /* @__PURE__ */
|
|
91
|
-
|
|
90
|
+
}) => /* @__PURE__ */ y(
|
|
91
|
+
L,
|
|
92
92
|
{
|
|
93
93
|
defaultViewBox: "0 0 448 512",
|
|
94
94
|
defaultClassName: "size-5",
|
|
@@ -108,15 +108,15 @@ const st = ({
|
|
|
108
108
|
/* @__PURE__ */ r("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 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8z" })
|
|
109
109
|
]
|
|
110
110
|
}
|
|
111
|
-
),
|
|
111
|
+
), Eo = ({
|
|
112
112
|
className: e,
|
|
113
113
|
viewBox: t,
|
|
114
114
|
spacing: o,
|
|
115
115
|
title: n,
|
|
116
116
|
monotone: a,
|
|
117
117
|
...s
|
|
118
|
-
}) => /* @__PURE__ */
|
|
119
|
-
|
|
118
|
+
}) => /* @__PURE__ */ y(
|
|
119
|
+
L,
|
|
120
120
|
{
|
|
121
121
|
defaultViewBox: "0 0 512 512",
|
|
122
122
|
defaultClassName: "size-5",
|
|
@@ -136,15 +136,15 @@ const st = ({
|
|
|
136
136
|
/* @__PURE__ */ r("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" })
|
|
137
137
|
]
|
|
138
138
|
}
|
|
139
|
-
),
|
|
139
|
+
), xo = ({
|
|
140
140
|
className: e,
|
|
141
141
|
viewBox: t,
|
|
142
142
|
spacing: o,
|
|
143
143
|
title: n,
|
|
144
144
|
monotone: a,
|
|
145
145
|
...s
|
|
146
|
-
}) => /* @__PURE__ */
|
|
147
|
-
|
|
146
|
+
}) => /* @__PURE__ */ y(
|
|
147
|
+
L,
|
|
148
148
|
{
|
|
149
149
|
defaultViewBox: "0 0 512 512",
|
|
150
150
|
defaultClassName: "size-5",
|
|
@@ -164,7 +164,7 @@ const st = ({
|
|
|
164
164
|
/* @__PURE__ */ r("path", { d: "M256 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM192 248c0-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 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h24V272H216c-13.3 0-24-10.7-24-24z" })
|
|
165
165
|
]
|
|
166
166
|
}
|
|
167
|
-
),
|
|
167
|
+
), gt = ({
|
|
168
168
|
className: e,
|
|
169
169
|
viewBox: t,
|
|
170
170
|
spacing: o,
|
|
@@ -172,7 +172,7 @@ const st = ({
|
|
|
172
172
|
monotone: a,
|
|
173
173
|
...s
|
|
174
174
|
}) => /* @__PURE__ */ r(
|
|
175
|
-
|
|
175
|
+
L,
|
|
176
176
|
{
|
|
177
177
|
defaultViewBox: "0 0 24 24",
|
|
178
178
|
defaultClassName: "size-5",
|
|
@@ -189,15 +189,15 @@ const st = ({
|
|
|
189
189
|
}
|
|
190
190
|
)
|
|
191
191
|
}
|
|
192
|
-
),
|
|
192
|
+
), So = ({
|
|
193
193
|
className: e,
|
|
194
194
|
viewBox: t,
|
|
195
195
|
spacing: o,
|
|
196
196
|
title: n,
|
|
197
197
|
monotone: a,
|
|
198
198
|
...s
|
|
199
|
-
}) => /* @__PURE__ */
|
|
200
|
-
|
|
199
|
+
}) => /* @__PURE__ */ y(
|
|
200
|
+
L,
|
|
201
201
|
{
|
|
202
202
|
defaultViewBox: "0 0 576 512",
|
|
203
203
|
defaultClassName: "size-5",
|
|
@@ -217,15 +217,15 @@ const st = ({
|
|
|
217
217
|
/* @__PURE__ */ r("path", { d: "M176 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16H272c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80H144z" })
|
|
218
218
|
]
|
|
219
219
|
}
|
|
220
|
-
),
|
|
220
|
+
), Ro = ({
|
|
221
221
|
className: e,
|
|
222
222
|
viewBox: t,
|
|
223
223
|
spacing: o,
|
|
224
224
|
title: n,
|
|
225
225
|
monotone: a,
|
|
226
226
|
...s
|
|
227
|
-
}) => /* @__PURE__ */
|
|
228
|
-
|
|
227
|
+
}) => /* @__PURE__ */ y(
|
|
228
|
+
L,
|
|
229
229
|
{
|
|
230
230
|
defaultViewBox: "0 0 512 512",
|
|
231
231
|
defaultClassName: "size-5",
|
|
@@ -245,7 +245,7 @@ const st = ({
|
|
|
245
245
|
/* @__PURE__ */ r("path", { d: "M64 128c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64H64zm32 64H288c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32s14.3-32 32-32z" })
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
|
-
),
|
|
248
|
+
), Ao = ({
|
|
249
249
|
className: e,
|
|
250
250
|
viewBox: t,
|
|
251
251
|
spacing: o,
|
|
@@ -253,7 +253,7 @@ const st = ({
|
|
|
253
253
|
monotone: a,
|
|
254
254
|
...s
|
|
255
255
|
}) => /* @__PURE__ */ r(
|
|
256
|
-
|
|
256
|
+
L,
|
|
257
257
|
{
|
|
258
258
|
defaultViewBox: "0 0 448 512",
|
|
259
259
|
defaultClassName: "size-5",
|
|
@@ -265,10 +265,10 @@ const st = ({
|
|
|
265
265
|
children: /* @__PURE__ */ r("path", { d: "M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z" })
|
|
266
266
|
}
|
|
267
267
|
);
|
|
268
|
-
function
|
|
269
|
-
return
|
|
268
|
+
function ne(e) {
|
|
269
|
+
return Ae();
|
|
270
270
|
}
|
|
271
|
-
const
|
|
271
|
+
const _e = f.createContext({
|
|
272
272
|
getItemProps: () => ({}),
|
|
273
273
|
activeIndex: null,
|
|
274
274
|
/* v8 ignore next 2 */
|
|
@@ -277,7 +277,7 @@ const Ee = b.createContext({
|
|
|
277
277
|
setHasFocusInside: () => {
|
|
278
278
|
},
|
|
279
279
|
isOpen: !1
|
|
280
|
-
}),
|
|
280
|
+
}), Ue = (e) => {
|
|
281
281
|
if (typeof e == "string")
|
|
282
282
|
return e;
|
|
283
283
|
if (typeof e == "function")
|
|
@@ -288,7 +288,7 @@ const Ee = b.createContext({
|
|
|
288
288
|
return t.displayName || t.name || "Component";
|
|
289
289
|
}
|
|
290
290
|
return "Element";
|
|
291
|
-
},
|
|
291
|
+
}, ft = nt(
|
|
292
292
|
({
|
|
293
293
|
trigger: e,
|
|
294
294
|
children: t,
|
|
@@ -297,90 +297,90 @@ const Ee = b.createContext({
|
|
|
297
297
|
onOpenChange: a,
|
|
298
298
|
spacing: s,
|
|
299
299
|
mode: i = "system",
|
|
300
|
-
focusMode:
|
|
301
|
-
...
|
|
302
|
-
},
|
|
303
|
-
const [
|
|
300
|
+
focusMode: c = "system",
|
|
301
|
+
...p
|
|
302
|
+
}, m) => {
|
|
303
|
+
const [l, g] = x(!1), [v, h] = x(!1), [u, d] = x(null), b = Z([]), k = Z([]), w = P(_e), I = at(), E = ho(), R = st(), { floatingStyles: $, refs: O, context: N } = it({
|
|
304
304
|
nodeId: E,
|
|
305
|
-
open:
|
|
306
|
-
onOpenChange: (
|
|
307
|
-
g(
|
|
305
|
+
open: l,
|
|
306
|
+
onOpenChange: (J) => {
|
|
307
|
+
g(J), a == null || a(J);
|
|
308
308
|
},
|
|
309
309
|
placement: n,
|
|
310
310
|
strategy: "fixed",
|
|
311
|
-
middleware: [
|
|
312
|
-
whileElementsMounted:
|
|
313
|
-
}),
|
|
311
|
+
middleware: [po({ mainAxis: 10 }), go(), fo()],
|
|
312
|
+
whileElementsMounted: bo
|
|
313
|
+
}), le = ct(N, {
|
|
314
314
|
event: "mousedown",
|
|
315
315
|
toggle: !0,
|
|
316
316
|
ignoreMouse: !1
|
|
317
|
-
}),
|
|
318
|
-
listRef:
|
|
319
|
-
activeIndex:
|
|
317
|
+
}), de = lt(N, { role: "menu" }), X = dt(N, { bubbles: !0 }), ye = vo(N, {
|
|
318
|
+
listRef: b,
|
|
319
|
+
activeIndex: u,
|
|
320
320
|
nested: !1,
|
|
321
|
-
onNavigate:
|
|
321
|
+
onNavigate: d,
|
|
322
322
|
loop: !0
|
|
323
|
-
}),
|
|
323
|
+
}), ke = yo(N, {
|
|
324
324
|
listRef: k,
|
|
325
|
-
onMatch:
|
|
326
|
-
activeIndex:
|
|
327
|
-
}), { getReferenceProps:
|
|
325
|
+
onMatch: l ? d : void 0,
|
|
326
|
+
activeIndex: u
|
|
327
|
+
}), { getReferenceProps: Ce, getFloatingProps: B, getItemProps: Bt } = ut([le, de, X, ye, ke]), Ve = Ue(e) === "Button" || Ue(e) === "ButtonIcon", Vt = Ve ? {
|
|
328
328
|
noInternalClick: Ve,
|
|
329
|
-
focusMode:
|
|
329
|
+
focusMode: c,
|
|
330
330
|
mode: i,
|
|
331
331
|
spacing: s
|
|
332
|
-
} : {},
|
|
332
|
+
} : {}, Dt = _.cloneElement(
|
|
333
333
|
e,
|
|
334
334
|
{
|
|
335
|
-
...
|
|
335
|
+
...Vt,
|
|
336
336
|
"aria-label": o,
|
|
337
|
-
"data-open":
|
|
338
|
-
"data-focus-inside":
|
|
339
|
-
ref:
|
|
340
|
-
...
|
|
337
|
+
"data-open": l ? "" : void 0,
|
|
338
|
+
"data-focus-inside": v ? "" : void 0,
|
|
339
|
+
ref: Me([O.setReference, R.ref, m]),
|
|
340
|
+
...Ce(
|
|
341
341
|
w.getItemProps({
|
|
342
|
-
...
|
|
342
|
+
...p
|
|
343
343
|
})
|
|
344
344
|
)
|
|
345
345
|
}
|
|
346
346
|
);
|
|
347
|
-
return
|
|
348
|
-
if (!
|
|
347
|
+
return G(() => {
|
|
348
|
+
if (!I)
|
|
349
349
|
return;
|
|
350
|
-
function
|
|
350
|
+
function J() {
|
|
351
351
|
g(!1), a == null || a(!1);
|
|
352
352
|
}
|
|
353
|
-
return
|
|
354
|
-
|
|
353
|
+
return I.events.on("click", J), () => {
|
|
354
|
+
I.events.off("click", J);
|
|
355
355
|
};
|
|
356
|
-
}, [
|
|
357
|
-
|
|
358
|
-
}, [
|
|
359
|
-
|
|
356
|
+
}, [I, a]), G(() => {
|
|
357
|
+
l && I && I.events.emit("menuopen", { nodeId: E });
|
|
358
|
+
}, [I, l, E]), /* @__PURE__ */ y(ko, { id: E, children: [
|
|
359
|
+
Dt,
|
|
360
360
|
/* @__PURE__ */ r(
|
|
361
|
-
|
|
361
|
+
_e.Provider,
|
|
362
362
|
{
|
|
363
363
|
value: {
|
|
364
|
-
activeIndex:
|
|
365
|
-
setActiveIndex:
|
|
366
|
-
getItemProps:
|
|
367
|
-
setHasFocusInside:
|
|
368
|
-
isOpen:
|
|
364
|
+
activeIndex: u,
|
|
365
|
+
setActiveIndex: d,
|
|
366
|
+
getItemProps: Bt,
|
|
367
|
+
setHasFocusInside: h,
|
|
368
|
+
isOpen: l
|
|
369
369
|
},
|
|
370
|
-
children: /* @__PURE__ */ r(Co, { elementsRef:
|
|
371
|
-
|
|
370
|
+
children: /* @__PURE__ */ r(Co, { elementsRef: b, labelsRef: k, children: l && /* @__PURE__ */ r(mt, { children: /* @__PURE__ */ r(
|
|
371
|
+
ht,
|
|
372
372
|
{
|
|
373
|
-
context:
|
|
373
|
+
context: N,
|
|
374
374
|
modal: !1,
|
|
375
375
|
initialFocus: 0,
|
|
376
376
|
returnFocus: !0,
|
|
377
377
|
children: /* @__PURE__ */ r(
|
|
378
378
|
"div",
|
|
379
379
|
{
|
|
380
|
-
ref:
|
|
380
|
+
ref: O.setFloating,
|
|
381
381
|
className: "rounded-md bg-surface-light p-4 shadow-sm shadow-border-dark outline-none sm:p-2",
|
|
382
|
-
style:
|
|
383
|
-
...
|
|
382
|
+
style: $,
|
|
383
|
+
...B(),
|
|
384
384
|
children: t
|
|
385
385
|
}
|
|
386
386
|
)
|
|
@@ -390,10 +390,10 @@ const Ee = b.createContext({
|
|
|
390
390
|
)
|
|
391
391
|
] });
|
|
392
392
|
}
|
|
393
|
-
),
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
const
|
|
393
|
+
), Ee = nt((e, t) => /* @__PURE__ */ r(wo, { children: /* @__PURE__ */ r(ft, { ...e, ref: t }) }));
|
|
394
|
+
Ee.displayName = "Menu";
|
|
395
|
+
ft.displayName = "MenuComponent";
|
|
396
|
+
const H = f.forwardRef(
|
|
397
397
|
({
|
|
398
398
|
label: e,
|
|
399
399
|
disabled: t,
|
|
@@ -402,60 +402,61 @@ const K = b.forwardRef(
|
|
|
402
402
|
children: a,
|
|
403
403
|
ignoreClick: s = !1,
|
|
404
404
|
...i
|
|
405
|
-
},
|
|
406
|
-
|
|
405
|
+
}, c) => {
|
|
406
|
+
let p = "";
|
|
407
|
+
const m = f.useContext(_e), l = st({ label: t ? null : e }), g = at(), v = Me([l.ref, c]);
|
|
407
408
|
return n && a ? /* @__PURE__ */ r(
|
|
408
409
|
"div",
|
|
409
410
|
{
|
|
410
411
|
role: "menuitem",
|
|
411
|
-
...
|
|
412
|
-
onClick(
|
|
412
|
+
...m.getItemProps({
|
|
413
|
+
onClick(h) {
|
|
413
414
|
var u;
|
|
414
|
-
s || ((u = i.onClick) == null || u.call(i,
|
|
415
|
+
s || ((u = i.onClick) == null || u.call(i, h), g == null || g.events.emit("click"));
|
|
415
416
|
}
|
|
416
417
|
}),
|
|
417
418
|
children: a
|
|
418
419
|
}
|
|
419
|
-
) : /* @__PURE__ */
|
|
420
|
+
) : (o && (p = "pl-2"), /* @__PURE__ */ y(
|
|
420
421
|
"button",
|
|
421
422
|
{
|
|
422
423
|
...i,
|
|
423
|
-
ref:
|
|
424
|
+
ref: v,
|
|
424
425
|
role: "menuitem",
|
|
425
|
-
className: "m-0 flex w-full rounded-md border border-transparent bg-none px-
|
|
426
|
+
className: "m-0 flex w-full rounded-md border border-transparent bg-none px-2 py-2 text-left text-base outline-none focus:border focus:border-border-medium focus:bg-surface-lighter focus:underline disabled:cursor-not-allowed disabled:text-copy-medium sm:py-1",
|
|
426
427
|
tabIndex: 0,
|
|
427
428
|
disabled: t,
|
|
428
|
-
...
|
|
429
|
-
onClick(
|
|
429
|
+
...m.getItemProps({
|
|
430
|
+
onClick(h) {
|
|
430
431
|
var u;
|
|
431
|
-
s || ((u = i.onClick) == null || u.call(i,
|
|
432
|
+
s || ((u = i.onClick) == null || u.call(i, h), g == null || g.events.emit("click"));
|
|
432
433
|
},
|
|
433
|
-
onFocus(
|
|
434
|
+
onFocus(h) {
|
|
434
435
|
var u;
|
|
435
|
-
(u = i.onFocus) == null || u.call(i,
|
|
436
|
+
(u = i.onFocus) == null || u.call(i, h), m.setHasFocusInside(!0);
|
|
436
437
|
}
|
|
437
438
|
}),
|
|
438
439
|
children: [
|
|
439
440
|
o,
|
|
440
|
-
e && /* @__PURE__ */ r("span", { className:
|
|
441
|
+
e && /* @__PURE__ */ r("span", { className: p, children: e })
|
|
441
442
|
]
|
|
442
443
|
}
|
|
443
|
-
);
|
|
444
|
+
));
|
|
444
445
|
}
|
|
445
446
|
);
|
|
446
|
-
|
|
447
|
-
const
|
|
447
|
+
H.displayName = "MenuItem";
|
|
448
|
+
const Mo = ({ className: e, ...t }) => {
|
|
448
449
|
const o = C(e, "my-1 border-t border-border-medium");
|
|
449
450
|
return /* @__PURE__ */ r("div", { className: o, ...t });
|
|
450
451
|
};
|
|
451
452
|
/*!
|
|
452
|
-
@versini/ui-menu v1.4.
|
|
453
|
+
@versini/ui-menu v1.4.1
|
|
453
454
|
© 2024 gizmette.com
|
|
454
455
|
*/
|
|
455
456
|
try {
|
|
456
457
|
window.__VERSINI_UI_MENU__ || (window.__VERSINI_UI_MENU__ = {
|
|
457
|
-
version: "1.4.
|
|
458
|
-
buildTime: "12/
|
|
458
|
+
version: "1.4.1",
|
|
459
|
+
buildTime: "12/27/2024 07:18 PM EST",
|
|
459
460
|
homepage: "https://github.com/aversini/ui-components",
|
|
460
461
|
license: "MIT"
|
|
461
462
|
});
|
|
@@ -474,40 +475,40 @@ try {
|
|
|
474
475
|
});
|
|
475
476
|
} catch {
|
|
476
477
|
}
|
|
477
|
-
const
|
|
478
|
-
function
|
|
478
|
+
const Po = "av-togglegroup", Lo = "av-togglegroup-item-wrapper", $o = "av-togglegroup-item";
|
|
479
|
+
function Pe(e, t = []) {
|
|
479
480
|
let o = [];
|
|
480
481
|
function n(s, i) {
|
|
481
|
-
const
|
|
482
|
+
const c = f.createContext(i), p = o.length;
|
|
482
483
|
o = [...o, i];
|
|
483
|
-
const
|
|
484
|
-
var
|
|
485
|
-
const { scope:
|
|
486
|
-
return /* @__PURE__ */ r(
|
|
484
|
+
const m = (g) => {
|
|
485
|
+
var v;
|
|
486
|
+
const { scope: h, children: u, ...d } = g, b = ((v = h == null ? void 0 : h[e]) == null ? void 0 : v[p]) || c, k = f.useMemo(() => d, Object.values(d));
|
|
487
|
+
return /* @__PURE__ */ r(b.Provider, { value: k, children: u });
|
|
487
488
|
};
|
|
488
|
-
|
|
489
|
-
function
|
|
490
|
-
var
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
489
|
+
m.displayName = s + "Provider";
|
|
490
|
+
function l(g, v) {
|
|
491
|
+
var h;
|
|
492
|
+
const u = ((h = v == null ? void 0 : v[e]) == null ? void 0 : h[p]) || c, d = f.useContext(u);
|
|
493
|
+
if (d) return d;
|
|
493
494
|
if (i !== void 0) return i;
|
|
494
495
|
throw new Error(`\`${g}\` must be used within \`${s}\``);
|
|
495
496
|
}
|
|
496
|
-
return [
|
|
497
|
+
return [m, l];
|
|
497
498
|
}
|
|
498
499
|
const a = () => {
|
|
499
|
-
const s = o.map((i) =>
|
|
500
|
+
const s = o.map((i) => f.createContext(i));
|
|
500
501
|
return function(i) {
|
|
501
|
-
const
|
|
502
|
-
return
|
|
503
|
-
() => ({ [`__scope${e}`]: { ...i, [e]:
|
|
504
|
-
[i,
|
|
502
|
+
const c = (i == null ? void 0 : i[e]) || s;
|
|
503
|
+
return f.useMemo(
|
|
504
|
+
() => ({ [`__scope${e}`]: { ...i, [e]: c } }),
|
|
505
|
+
[i, c]
|
|
505
506
|
);
|
|
506
507
|
};
|
|
507
508
|
};
|
|
508
|
-
return a.scopeName = e, [n,
|
|
509
|
+
return a.scopeName = e, [n, Oo(a, ...t)];
|
|
509
510
|
}
|
|
510
|
-
function
|
|
511
|
+
function Oo(...e) {
|
|
511
512
|
const t = e[0];
|
|
512
513
|
if (e.length === 1) return t;
|
|
513
514
|
const o = () => {
|
|
@@ -516,64 +517,64 @@ function Vo(...e) {
|
|
|
516
517
|
scopeName: a.scopeName
|
|
517
518
|
}));
|
|
518
519
|
return function(a) {
|
|
519
|
-
const s = n.reduce((i, { useScope:
|
|
520
|
-
const
|
|
521
|
-
return { ...i, ...
|
|
520
|
+
const s = n.reduce((i, { useScope: c, scopeName: p }) => {
|
|
521
|
+
const m = c(a)[`__scope${p}`];
|
|
522
|
+
return { ...i, ...m };
|
|
522
523
|
}, {});
|
|
523
|
-
return
|
|
524
|
+
return f.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
|
|
524
525
|
};
|
|
525
526
|
};
|
|
526
527
|
return o.scopeName = t.scopeName, o;
|
|
527
528
|
}
|
|
528
|
-
function
|
|
529
|
+
function je(e, t) {
|
|
529
530
|
if (typeof e == "function")
|
|
530
531
|
return e(t);
|
|
531
532
|
e != null && (e.current = t);
|
|
532
533
|
}
|
|
533
|
-
function
|
|
534
|
+
function bt(...e) {
|
|
534
535
|
return (t) => {
|
|
535
536
|
let o = !1;
|
|
536
537
|
const n = e.map((a) => {
|
|
537
|
-
const s =
|
|
538
|
+
const s = je(a, t);
|
|
538
539
|
return !o && typeof s == "function" && (o = !0), s;
|
|
539
540
|
});
|
|
540
541
|
if (o)
|
|
541
542
|
return () => {
|
|
542
543
|
for (let a = 0; a < n.length; a++) {
|
|
543
544
|
const s = n[a];
|
|
544
|
-
typeof s == "function" ? s() :
|
|
545
|
+
typeof s == "function" ? s() : je(e[a], null);
|
|
545
546
|
}
|
|
546
547
|
};
|
|
547
548
|
};
|
|
548
549
|
}
|
|
549
|
-
function
|
|
550
|
-
return
|
|
550
|
+
function xe(...e) {
|
|
551
|
+
return f.useCallback(bt(...e), e);
|
|
551
552
|
}
|
|
552
|
-
var
|
|
553
|
-
const { children: o, ...n } = e, a =
|
|
553
|
+
var pe = f.forwardRef((e, t) => {
|
|
554
|
+
const { children: o, ...n } = e, a = f.Children.toArray(o), s = a.find(Vo);
|
|
554
555
|
if (s) {
|
|
555
|
-
const i = s.props.children,
|
|
556
|
-
return /* @__PURE__ */ r(
|
|
556
|
+
const i = s.props.children, c = a.map((p) => p === s ? f.Children.count(i) > 1 ? f.Children.only(null) : f.isValidElement(i) ? i.props.children : null : p);
|
|
557
|
+
return /* @__PURE__ */ r(Se, { ...n, ref: t, children: f.isValidElement(i) ? f.cloneElement(i, void 0, c) : null });
|
|
557
558
|
}
|
|
558
|
-
return /* @__PURE__ */ r(
|
|
559
|
+
return /* @__PURE__ */ r(Se, { ...n, ref: t, children: o });
|
|
559
560
|
});
|
|
560
|
-
|
|
561
|
-
var
|
|
561
|
+
pe.displayName = "Slot";
|
|
562
|
+
var Se = f.forwardRef((e, t) => {
|
|
562
563
|
const { children: o, ...n } = e;
|
|
563
|
-
if (
|
|
564
|
-
const a =
|
|
565
|
-
return
|
|
564
|
+
if (f.isValidElement(o)) {
|
|
565
|
+
const a = zo(o);
|
|
566
|
+
return f.cloneElement(o, {
|
|
566
567
|
...Do(n, o.props),
|
|
567
568
|
// @ts-ignore
|
|
568
|
-
ref: t ?
|
|
569
|
+
ref: t ? bt(t, a) : a
|
|
569
570
|
});
|
|
570
571
|
}
|
|
571
|
-
return
|
|
572
|
+
return f.Children.count(o) > 1 ? f.Children.only(null) : null;
|
|
572
573
|
});
|
|
573
|
-
|
|
574
|
-
var
|
|
575
|
-
function
|
|
576
|
-
return
|
|
574
|
+
Se.displayName = "SlotClone";
|
|
575
|
+
var Bo = ({ children: e }) => /* @__PURE__ */ r(S, { children: e });
|
|
576
|
+
function Vo(e) {
|
|
577
|
+
return f.isValidElement(e) && e.type === Bo;
|
|
577
578
|
}
|
|
578
579
|
function Do(e, t) {
|
|
579
580
|
const o = { ...t };
|
|
@@ -585,7 +586,7 @@ function Do(e, t) {
|
|
|
585
586
|
}
|
|
586
587
|
return { ...e, ...o };
|
|
587
588
|
}
|
|
588
|
-
function
|
|
589
|
+
function zo(e) {
|
|
589
590
|
var t, o;
|
|
590
591
|
let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, a = n && "isReactWarning" in n && n.isReactWarning;
|
|
591
592
|
return a ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, a = n && "isReactWarning" in n && n.isReactWarning, a ? e.props.ref : e.props.ref || e.ref);
|
|
@@ -607,188 +608,188 @@ var Fo = [
|
|
|
607
608
|
"span",
|
|
608
609
|
"svg",
|
|
609
610
|
"ul"
|
|
610
|
-
],
|
|
611
|
-
const o =
|
|
612
|
-
const { asChild: s, ...i } = n,
|
|
613
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ r(
|
|
611
|
+
], ae = Fo.reduce((e, t) => {
|
|
612
|
+
const o = f.forwardRef((n, a) => {
|
|
613
|
+
const { asChild: s, ...i } = n, c = s ? pe : t;
|
|
614
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ r(c, { ...i, ref: a });
|
|
614
615
|
});
|
|
615
616
|
return o.displayName = `Primitive.${t}`, { ...e, [t]: o };
|
|
616
617
|
}, {});
|
|
617
|
-
function
|
|
618
|
+
function K(e, t, { checkForDefaultPrevented: o = !0 } = {}) {
|
|
618
619
|
return function(n) {
|
|
619
620
|
if (e == null || e(n), o === !1 || !n.defaultPrevented)
|
|
620
621
|
return t == null ? void 0 : t(n);
|
|
621
622
|
};
|
|
622
623
|
}
|
|
623
624
|
function Go(e) {
|
|
624
|
-
const t = e + "CollectionProvider", [o, n] =
|
|
625
|
+
const t = e + "CollectionProvider", [o, n] = Pe(t), [a, s] = o(
|
|
625
626
|
t,
|
|
626
627
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
627
|
-
), i = (
|
|
628
|
-
const { scope:
|
|
629
|
-
return /* @__PURE__ */ r(a, { scope:
|
|
628
|
+
), i = (h) => {
|
|
629
|
+
const { scope: u, children: d } = h, b = _.useRef(null), k = _.useRef(/* @__PURE__ */ new Map()).current;
|
|
630
|
+
return /* @__PURE__ */ r(a, { scope: u, itemMap: k, collectionRef: b, children: d });
|
|
630
631
|
};
|
|
631
632
|
i.displayName = t;
|
|
632
|
-
const
|
|
633
|
-
(
|
|
634
|
-
const { scope:
|
|
635
|
-
return /* @__PURE__ */ r(
|
|
633
|
+
const c = e + "CollectionSlot", p = _.forwardRef(
|
|
634
|
+
(h, u) => {
|
|
635
|
+
const { scope: d, children: b } = h, k = s(c, d), w = xe(u, k.collectionRef);
|
|
636
|
+
return /* @__PURE__ */ r(pe, { ref: w, children: b });
|
|
636
637
|
}
|
|
637
638
|
);
|
|
638
|
-
|
|
639
|
-
const
|
|
640
|
-
(
|
|
641
|
-
const { scope:
|
|
642
|
-
return _.useEffect(() => (E.itemMap.set(w, { ref: w, ...k }), () => void E.itemMap.delete(w))), /* @__PURE__ */ r(
|
|
639
|
+
p.displayName = c;
|
|
640
|
+
const m = e + "CollectionItemSlot", l = "data-radix-collection-item", g = _.forwardRef(
|
|
641
|
+
(h, u) => {
|
|
642
|
+
const { scope: d, children: b, ...k } = h, w = _.useRef(null), I = xe(u, w), E = s(m, d);
|
|
643
|
+
return _.useEffect(() => (E.itemMap.set(w, { ref: w, ...k }), () => void E.itemMap.delete(w))), /* @__PURE__ */ r(pe, { [l]: "", ref: I, children: b });
|
|
643
644
|
}
|
|
644
645
|
);
|
|
645
|
-
g.displayName =
|
|
646
|
-
function
|
|
647
|
-
const
|
|
646
|
+
g.displayName = m;
|
|
647
|
+
function v(h) {
|
|
648
|
+
const u = s(e + "CollectionConsumer", h);
|
|
648
649
|
return _.useCallback(() => {
|
|
649
|
-
const
|
|
650
|
-
if (!
|
|
651
|
-
const
|
|
652
|
-
return Array.from(
|
|
653
|
-
(k, w) =>
|
|
650
|
+
const d = u.collectionRef.current;
|
|
651
|
+
if (!d) return [];
|
|
652
|
+
const b = Array.from(d.querySelectorAll(`[${l}]`));
|
|
653
|
+
return Array.from(u.itemMap.values()).sort(
|
|
654
|
+
(k, w) => b.indexOf(k.ref.current) - b.indexOf(w.ref.current)
|
|
654
655
|
);
|
|
655
|
-
}, [
|
|
656
|
+
}, [u.collectionRef, u.itemMap]);
|
|
656
657
|
}
|
|
657
658
|
return [
|
|
658
|
-
{ Provider: i, Slot:
|
|
659
|
-
|
|
659
|
+
{ Provider: i, Slot: p, ItemSlot: g },
|
|
660
|
+
v,
|
|
660
661
|
n
|
|
661
662
|
];
|
|
662
663
|
}
|
|
663
|
-
var
|
|
664
|
-
},
|
|
665
|
-
}),
|
|
666
|
-
function
|
|
667
|
-
const [t, o] =
|
|
668
|
-
return
|
|
669
|
-
o((n) => n ?? String(
|
|
664
|
+
var Ho = globalThis != null && globalThis.document ? f.useLayoutEffect : () => {
|
|
665
|
+
}, Uo = f.useId || (() => {
|
|
666
|
+
}), jo = 0;
|
|
667
|
+
function Ko(e) {
|
|
668
|
+
const [t, o] = f.useState(Uo());
|
|
669
|
+
return Ho(() => {
|
|
670
|
+
o((n) => n ?? String(jo++));
|
|
670
671
|
}, [e]), t ? `radix-${t}` : "";
|
|
671
672
|
}
|
|
672
|
-
function
|
|
673
|
-
const t =
|
|
674
|
-
return
|
|
673
|
+
function Le(e) {
|
|
674
|
+
const t = f.useRef(e);
|
|
675
|
+
return f.useEffect(() => {
|
|
675
676
|
t.current = e;
|
|
676
|
-
}),
|
|
677
|
+
}), f.useMemo(() => (...o) => {
|
|
677
678
|
var n;
|
|
678
679
|
return (n = t.current) == null ? void 0 : n.call(t, ...o);
|
|
679
680
|
}, []);
|
|
680
681
|
}
|
|
681
|
-
function
|
|
682
|
+
function fe({
|
|
682
683
|
prop: e,
|
|
683
684
|
defaultProp: t,
|
|
684
685
|
onChange: o = () => {
|
|
685
686
|
}
|
|
686
687
|
}) {
|
|
687
|
-
const [n, a] =
|
|
688
|
-
(
|
|
688
|
+
const [n, a] = Wo({ defaultProp: t, onChange: o }), s = e !== void 0, i = s ? e : n, c = Le(o), p = f.useCallback(
|
|
689
|
+
(m) => {
|
|
689
690
|
if (s) {
|
|
690
|
-
const
|
|
691
|
-
|
|
691
|
+
const l = typeof m == "function" ? m(e) : m;
|
|
692
|
+
l !== e && c(l);
|
|
692
693
|
} else
|
|
693
|
-
a(
|
|
694
|
+
a(m);
|
|
694
695
|
},
|
|
695
|
-
[s, e, a,
|
|
696
|
+
[s, e, a, c]
|
|
696
697
|
);
|
|
697
|
-
return [i,
|
|
698
|
+
return [i, p];
|
|
698
699
|
}
|
|
699
|
-
function
|
|
700
|
+
function Wo({
|
|
700
701
|
defaultProp: e,
|
|
701
702
|
onChange: t
|
|
702
703
|
}) {
|
|
703
|
-
const o =
|
|
704
|
-
return
|
|
704
|
+
const o = f.useState(e), [n] = o, a = f.useRef(n), s = Le(t);
|
|
705
|
+
return f.useEffect(() => {
|
|
705
706
|
a.current !== n && (s(n), a.current = n);
|
|
706
707
|
}, [n, a, s]), o;
|
|
707
708
|
}
|
|
708
|
-
var
|
|
709
|
-
function
|
|
710
|
-
const t =
|
|
709
|
+
var Yo = f.createContext(void 0);
|
|
710
|
+
function vt(e) {
|
|
711
|
+
const t = f.useContext(Yo);
|
|
711
712
|
return e || t || "ltr";
|
|
712
713
|
}
|
|
713
|
-
var Ie = "rovingFocusGroup.onEntryFocus",
|
|
714
|
-
|
|
714
|
+
var Ie = "rovingFocusGroup.onEntryFocus", qo = { bubbles: !1, cancelable: !0 }, be = "RovingFocusGroup", [Re, yt, Zo] = Go(be), [Qo, kt] = Pe(
|
|
715
|
+
be,
|
|
715
716
|
[Zo]
|
|
716
|
-
), [
|
|
717
|
-
(e, t) => /* @__PURE__ */ r(
|
|
717
|
+
), [Xo, Jo] = Qo(be), Ct = f.forwardRef(
|
|
718
|
+
(e, t) => /* @__PURE__ */ r(Re.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ r(Re.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ r(er, { ...e, ref: t }) }) })
|
|
718
719
|
);
|
|
719
|
-
|
|
720
|
-
var
|
|
720
|
+
Ct.displayName = be;
|
|
721
|
+
var er = f.forwardRef((e, t) => {
|
|
721
722
|
const {
|
|
722
723
|
__scopeRovingFocusGroup: o,
|
|
723
724
|
orientation: n,
|
|
724
725
|
loop: a = !1,
|
|
725
726
|
dir: s,
|
|
726
727
|
currentTabStopId: i,
|
|
727
|
-
defaultCurrentTabStopId:
|
|
728
|
-
onCurrentTabStopIdChange:
|
|
729
|
-
onEntryFocus:
|
|
730
|
-
preventScrollOnEntryFocus:
|
|
728
|
+
defaultCurrentTabStopId: c,
|
|
729
|
+
onCurrentTabStopIdChange: p,
|
|
730
|
+
onEntryFocus: m,
|
|
731
|
+
preventScrollOnEntryFocus: l = !1,
|
|
731
732
|
...g
|
|
732
|
-
} = e,
|
|
733
|
+
} = e, v = f.useRef(null), h = xe(t, v), u = vt(s), [d = null, b] = fe({
|
|
733
734
|
prop: i,
|
|
734
|
-
defaultProp:
|
|
735
|
-
onChange:
|
|
736
|
-
}), [k, w] =
|
|
737
|
-
return
|
|
738
|
-
const
|
|
739
|
-
if (
|
|
740
|
-
return
|
|
741
|
-
}, [
|
|
742
|
-
|
|
735
|
+
defaultProp: c,
|
|
736
|
+
onChange: p
|
|
737
|
+
}), [k, w] = f.useState(!1), I = Le(m), E = yt(o), R = f.useRef(!1), [$, O] = f.useState(0);
|
|
738
|
+
return f.useEffect(() => {
|
|
739
|
+
const N = v.current;
|
|
740
|
+
if (N)
|
|
741
|
+
return N.addEventListener(Ie, I), () => N.removeEventListener(Ie, I);
|
|
742
|
+
}, [I]), /* @__PURE__ */ r(
|
|
743
|
+
Xo,
|
|
743
744
|
{
|
|
744
745
|
scope: o,
|
|
745
746
|
orientation: n,
|
|
746
|
-
dir:
|
|
747
|
+
dir: u,
|
|
747
748
|
loop: a,
|
|
748
|
-
currentTabStopId:
|
|
749
|
-
onItemFocus:
|
|
750
|
-
(
|
|
751
|
-
[
|
|
749
|
+
currentTabStopId: d,
|
|
750
|
+
onItemFocus: f.useCallback(
|
|
751
|
+
(N) => b(N),
|
|
752
|
+
[b]
|
|
752
753
|
),
|
|
753
|
-
onItemShiftTab:
|
|
754
|
-
onFocusableItemAdd:
|
|
755
|
-
() =>
|
|
754
|
+
onItemShiftTab: f.useCallback(() => w(!0), []),
|
|
755
|
+
onFocusableItemAdd: f.useCallback(
|
|
756
|
+
() => O((N) => N + 1),
|
|
756
757
|
[]
|
|
757
758
|
),
|
|
758
|
-
onFocusableItemRemove:
|
|
759
|
-
() =>
|
|
759
|
+
onFocusableItemRemove: f.useCallback(
|
|
760
|
+
() => O((N) => N - 1),
|
|
760
761
|
[]
|
|
761
762
|
),
|
|
762
763
|
children: /* @__PURE__ */ r(
|
|
763
|
-
|
|
764
|
+
ae.div,
|
|
764
765
|
{
|
|
765
|
-
tabIndex: k ||
|
|
766
|
+
tabIndex: k || $ === 0 ? -1 : 0,
|
|
766
767
|
"data-orientation": n,
|
|
767
768
|
...g,
|
|
768
|
-
ref:
|
|
769
|
+
ref: h,
|
|
769
770
|
style: { outline: "none", ...e.style },
|
|
770
|
-
onMouseDown:
|
|
771
|
-
|
|
771
|
+
onMouseDown: K(e.onMouseDown, () => {
|
|
772
|
+
R.current = !0;
|
|
772
773
|
}),
|
|
773
|
-
onFocus:
|
|
774
|
-
const
|
|
775
|
-
if (
|
|
776
|
-
const
|
|
777
|
-
if (
|
|
778
|
-
const
|
|
774
|
+
onFocus: K(e.onFocus, (N) => {
|
|
775
|
+
const le = !R.current;
|
|
776
|
+
if (N.target === N.currentTarget && le && !k) {
|
|
777
|
+
const de = new CustomEvent(Ie, qo);
|
|
778
|
+
if (N.currentTarget.dispatchEvent(de), !de.defaultPrevented) {
|
|
779
|
+
const X = E().filter((B) => B.focusable), ye = X.find((B) => B.active), ke = X.find((B) => B.id === d), Ce = [ye, ke, ...X].filter(
|
|
779
780
|
Boolean
|
|
780
|
-
).map((
|
|
781
|
-
|
|
781
|
+
).map((B) => B.ref.current);
|
|
782
|
+
It(Ce, l);
|
|
782
783
|
}
|
|
783
784
|
}
|
|
784
|
-
|
|
785
|
+
R.current = !1;
|
|
785
786
|
}),
|
|
786
|
-
onBlur:
|
|
787
|
+
onBlur: K(e.onBlur, () => w(!1))
|
|
787
788
|
}
|
|
788
789
|
)
|
|
789
790
|
}
|
|
790
791
|
);
|
|
791
|
-
}),
|
|
792
|
+
}), wt = "RovingFocusGroupItem", Nt = f.forwardRef(
|
|
792
793
|
(e, t) => {
|
|
793
794
|
const {
|
|
794
795
|
__scopeRovingFocusGroup: o,
|
|
@@ -796,46 +797,46 @@ var tr = b.forwardRef((e, t) => {
|
|
|
796
797
|
active: a = !1,
|
|
797
798
|
tabStopId: s,
|
|
798
799
|
...i
|
|
799
|
-
} = e,
|
|
800
|
-
return
|
|
800
|
+
} = e, c = Ko(), p = s || c, m = Jo(wt, o), l = m.currentTabStopId === p, g = yt(o), { onFocusableItemAdd: v, onFocusableItemRemove: h } = m;
|
|
801
|
+
return f.useEffect(() => {
|
|
801
802
|
if (n)
|
|
802
|
-
return
|
|
803
|
-
}, [n,
|
|
804
|
-
|
|
803
|
+
return v(), () => h();
|
|
804
|
+
}, [n, v, h]), /* @__PURE__ */ r(
|
|
805
|
+
Re.ItemSlot,
|
|
805
806
|
{
|
|
806
807
|
scope: o,
|
|
807
|
-
id:
|
|
808
|
+
id: p,
|
|
808
809
|
focusable: n,
|
|
809
810
|
active: a,
|
|
810
811
|
children: /* @__PURE__ */ r(
|
|
811
|
-
|
|
812
|
+
ae.span,
|
|
812
813
|
{
|
|
813
|
-
tabIndex:
|
|
814
|
-
"data-orientation":
|
|
814
|
+
tabIndex: l ? 0 : -1,
|
|
815
|
+
"data-orientation": m.orientation,
|
|
815
816
|
...i,
|
|
816
817
|
ref: t,
|
|
817
|
-
onMouseDown:
|
|
818
|
-
n ?
|
|
818
|
+
onMouseDown: K(e.onMouseDown, (u) => {
|
|
819
|
+
n ? m.onItemFocus(p) : u.preventDefault();
|
|
819
820
|
}),
|
|
820
|
-
onFocus:
|
|
821
|
-
onKeyDown:
|
|
822
|
-
if (
|
|
823
|
-
|
|
821
|
+
onFocus: K(e.onFocus, () => m.onItemFocus(p)),
|
|
822
|
+
onKeyDown: K(e.onKeyDown, (u) => {
|
|
823
|
+
if (u.key === "Tab" && u.shiftKey) {
|
|
824
|
+
m.onItemShiftTab();
|
|
824
825
|
return;
|
|
825
826
|
}
|
|
826
|
-
if (
|
|
827
|
-
const
|
|
828
|
-
if (
|
|
829
|
-
if (
|
|
830
|
-
|
|
831
|
-
let
|
|
832
|
-
if (
|
|
833
|
-
else if (
|
|
834
|
-
|
|
835
|
-
const k =
|
|
836
|
-
|
|
827
|
+
if (u.target !== u.currentTarget) return;
|
|
828
|
+
const d = rr(u, m.orientation, m.dir);
|
|
829
|
+
if (d !== void 0) {
|
|
830
|
+
if (u.metaKey || u.ctrlKey || u.altKey || u.shiftKey) return;
|
|
831
|
+
u.preventDefault();
|
|
832
|
+
let b = g().filter((k) => k.focusable).map((k) => k.ref.current);
|
|
833
|
+
if (d === "last") b.reverse();
|
|
834
|
+
else if (d === "prev" || d === "next") {
|
|
835
|
+
d === "prev" && b.reverse();
|
|
836
|
+
const k = b.indexOf(u.currentTarget);
|
|
837
|
+
b = m.loop ? nr(b, k + 1) : b.slice(k + 1);
|
|
837
838
|
}
|
|
838
|
-
setTimeout(() =>
|
|
839
|
+
setTimeout(() => It(b));
|
|
839
840
|
}
|
|
840
841
|
})
|
|
841
842
|
}
|
|
@@ -844,8 +845,8 @@ var tr = b.forwardRef((e, t) => {
|
|
|
844
845
|
);
|
|
845
846
|
}
|
|
846
847
|
);
|
|
847
|
-
|
|
848
|
-
var
|
|
848
|
+
Nt.displayName = wt;
|
|
849
|
+
var tr = {
|
|
849
850
|
ArrowLeft: "prev",
|
|
850
851
|
ArrowUp: "prev",
|
|
851
852
|
ArrowRight: "next",
|
|
@@ -855,30 +856,30 @@ var or = {
|
|
|
855
856
|
PageDown: "last",
|
|
856
857
|
End: "last"
|
|
857
858
|
};
|
|
858
|
-
function
|
|
859
|
+
function or(e, t) {
|
|
859
860
|
return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
860
861
|
}
|
|
861
|
-
function
|
|
862
|
-
const n =
|
|
862
|
+
function rr(e, t, o) {
|
|
863
|
+
const n = or(e.key, o);
|
|
863
864
|
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(n)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(n)))
|
|
864
|
-
return
|
|
865
|
+
return tr[n];
|
|
865
866
|
}
|
|
866
|
-
function
|
|
867
|
+
function It(e, t = !1) {
|
|
867
868
|
const o = document.activeElement;
|
|
868
869
|
for (const n of e)
|
|
869
870
|
if (n === o || (n.focus({ preventScroll: t }), document.activeElement !== o)) return;
|
|
870
871
|
}
|
|
871
|
-
function
|
|
872
|
+
function nr(e, t) {
|
|
872
873
|
return e.map((o, n) => e[(t + n) % e.length]);
|
|
873
874
|
}
|
|
874
|
-
var
|
|
875
|
-
const { pressed: o, defaultPressed: n = !1, onPressedChange: a, ...s } = e, [i = !1,
|
|
875
|
+
var ar = Ct, sr = Nt, ir = "Toggle", Tt = f.forwardRef((e, t) => {
|
|
876
|
+
const { pressed: o, defaultPressed: n = !1, onPressedChange: a, ...s } = e, [i = !1, c] = fe({
|
|
876
877
|
prop: o,
|
|
877
878
|
onChange: a,
|
|
878
879
|
defaultProp: n
|
|
879
880
|
});
|
|
880
881
|
return /* @__PURE__ */ r(
|
|
881
|
-
|
|
882
|
+
ae.button,
|
|
882
883
|
{
|
|
883
884
|
type: "button",
|
|
884
885
|
"aria-pressed": i,
|
|
@@ -886,79 +887,79 @@ var sr = ht, ir = gt, lr = "Toggle", bt = b.forwardRef((e, t) => {
|
|
|
886
887
|
"data-disabled": e.disabled ? "" : void 0,
|
|
887
888
|
...s,
|
|
888
889
|
ref: t,
|
|
889
|
-
onClick:
|
|
890
|
-
e.disabled ||
|
|
890
|
+
onClick: K(e.onClick, () => {
|
|
891
|
+
e.disabled || c(!i);
|
|
891
892
|
})
|
|
892
893
|
}
|
|
893
894
|
);
|
|
894
895
|
});
|
|
895
|
-
|
|
896
|
-
var
|
|
897
|
-
|
|
898
|
-
]),
|
|
896
|
+
Tt.displayName = ir;
|
|
897
|
+
var Q = "ToggleGroup", [_t, Cn] = Pe(Q, [
|
|
898
|
+
kt
|
|
899
|
+
]), Et = kt(), $e = _.forwardRef((e, t) => {
|
|
899
900
|
const { type: o, ...n } = e;
|
|
900
901
|
if (o === "single")
|
|
901
902
|
return /* @__PURE__ */ r(cr, { ...n, ref: t });
|
|
902
903
|
if (o === "multiple")
|
|
903
|
-
return /* @__PURE__ */ r(
|
|
904
|
-
throw new Error(`Missing prop \`type\` expected on \`${
|
|
904
|
+
return /* @__PURE__ */ r(lr, { ...n, ref: t });
|
|
905
|
+
throw new Error(`Missing prop \`type\` expected on \`${Q}\``);
|
|
905
906
|
});
|
|
906
|
-
|
|
907
|
-
var [
|
|
907
|
+
$e.displayName = Q;
|
|
908
|
+
var [xt, St] = _t(Q), cr = _.forwardRef((e, t) => {
|
|
908
909
|
const {
|
|
909
910
|
value: o,
|
|
910
911
|
defaultValue: n,
|
|
911
912
|
onValueChange: a = () => {
|
|
912
913
|
},
|
|
913
914
|
...s
|
|
914
|
-
} = e, [i,
|
|
915
|
+
} = e, [i, c] = fe({
|
|
915
916
|
prop: o,
|
|
916
917
|
defaultProp: n,
|
|
917
918
|
onChange: a
|
|
918
919
|
});
|
|
919
920
|
return /* @__PURE__ */ r(
|
|
920
|
-
|
|
921
|
+
xt,
|
|
921
922
|
{
|
|
922
923
|
scope: e.__scopeToggleGroup,
|
|
923
924
|
type: "single",
|
|
924
925
|
value: i ? [i] : [],
|
|
925
|
-
onItemActivate:
|
|
926
|
-
onItemDeactivate: _.useCallback(() =>
|
|
927
|
-
children: /* @__PURE__ */ r(
|
|
926
|
+
onItemActivate: c,
|
|
927
|
+
onItemDeactivate: _.useCallback(() => c(""), [c]),
|
|
928
|
+
children: /* @__PURE__ */ r(Rt, { ...s, ref: t })
|
|
928
929
|
}
|
|
929
930
|
);
|
|
930
|
-
}),
|
|
931
|
+
}), lr = _.forwardRef((e, t) => {
|
|
931
932
|
const {
|
|
932
933
|
value: o,
|
|
933
934
|
defaultValue: n,
|
|
934
935
|
onValueChange: a = () => {
|
|
935
936
|
},
|
|
936
937
|
...s
|
|
937
|
-
} = e, [i = [],
|
|
938
|
+
} = e, [i = [], c] = fe({
|
|
938
939
|
prop: o,
|
|
939
940
|
defaultProp: n,
|
|
940
941
|
onChange: a
|
|
941
|
-
}),
|
|
942
|
-
(
|
|
943
|
-
[
|
|
944
|
-
),
|
|
945
|
-
(
|
|
946
|
-
[
|
|
942
|
+
}), p = _.useCallback(
|
|
943
|
+
(l) => c((g = []) => [...g, l]),
|
|
944
|
+
[c]
|
|
945
|
+
), m = _.useCallback(
|
|
946
|
+
(l) => c((g = []) => g.filter((v) => v !== l)),
|
|
947
|
+
[c]
|
|
947
948
|
);
|
|
948
949
|
return /* @__PURE__ */ r(
|
|
949
|
-
|
|
950
|
+
xt,
|
|
950
951
|
{
|
|
951
952
|
scope: e.__scopeToggleGroup,
|
|
952
953
|
type: "multiple",
|
|
953
954
|
value: i,
|
|
954
|
-
onItemActivate:
|
|
955
|
-
onItemDeactivate:
|
|
956
|
-
children: /* @__PURE__ */ r(
|
|
955
|
+
onItemActivate: p,
|
|
956
|
+
onItemDeactivate: m,
|
|
957
|
+
children: /* @__PURE__ */ r(Rt, { ...s, ref: t })
|
|
957
958
|
}
|
|
958
959
|
);
|
|
959
960
|
});
|
|
960
|
-
|
|
961
|
-
var [
|
|
961
|
+
$e.displayName = Q;
|
|
962
|
+
var [dr, ur] = _t(Q), Rt = _.forwardRef(
|
|
962
963
|
(e, t) => {
|
|
963
964
|
const {
|
|
964
965
|
__scopeToggleGroup: o,
|
|
@@ -966,55 +967,55 @@ var [ur, mr] = vt(ee), wt = _.forwardRef(
|
|
|
966
967
|
rovingFocus: a = !0,
|
|
967
968
|
orientation: s,
|
|
968
969
|
dir: i,
|
|
969
|
-
loop:
|
|
970
|
-
...
|
|
971
|
-
} = e,
|
|
972
|
-
return /* @__PURE__ */ r(
|
|
973
|
-
|
|
970
|
+
loop: c = !0,
|
|
971
|
+
...p
|
|
972
|
+
} = e, m = Et(o), l = vt(i), g = { role: "group", dir: l, ...p };
|
|
973
|
+
return /* @__PURE__ */ r(dr, { scope: o, rovingFocus: a, disabled: n, children: a ? /* @__PURE__ */ r(
|
|
974
|
+
ar,
|
|
974
975
|
{
|
|
975
976
|
asChild: !0,
|
|
976
|
-
...
|
|
977
|
+
...m,
|
|
977
978
|
orientation: s,
|
|
978
|
-
dir:
|
|
979
|
-
loop:
|
|
980
|
-
children: /* @__PURE__ */ r(
|
|
979
|
+
dir: l,
|
|
980
|
+
loop: c,
|
|
981
|
+
children: /* @__PURE__ */ r(ae.div, { ...g, ref: t })
|
|
981
982
|
}
|
|
982
|
-
) : /* @__PURE__ */ r(
|
|
983
|
+
) : /* @__PURE__ */ r(ae.div, { ...g, ref: t }) });
|
|
983
984
|
}
|
|
984
|
-
),
|
|
985
|
+
), ge = "ToggleGroupItem", At = _.forwardRef(
|
|
985
986
|
(e, t) => {
|
|
986
|
-
const o =
|
|
987
|
+
const o = St(ge, e.__scopeToggleGroup), n = ur(ge, e.__scopeToggleGroup), a = Et(e.__scopeToggleGroup), s = o.value.includes(e.value), i = n.disabled || e.disabled, c = { ...e, pressed: s, disabled: i }, p = _.useRef(null);
|
|
987
988
|
return n.rovingFocus ? /* @__PURE__ */ r(
|
|
988
|
-
|
|
989
|
+
sr,
|
|
989
990
|
{
|
|
990
991
|
asChild: !0,
|
|
991
992
|
...a,
|
|
992
993
|
focusable: !i,
|
|
993
994
|
active: s,
|
|
994
|
-
ref:
|
|
995
|
-
children: /* @__PURE__ */ r(
|
|
995
|
+
ref: p,
|
|
996
|
+
children: /* @__PURE__ */ r(Ke, { ...c, ref: t })
|
|
996
997
|
}
|
|
997
|
-
) : /* @__PURE__ */ r(
|
|
998
|
+
) : /* @__PURE__ */ r(Ke, { ...c, ref: t });
|
|
998
999
|
}
|
|
999
1000
|
);
|
|
1000
|
-
|
|
1001
|
-
var
|
|
1001
|
+
At.displayName = ge;
|
|
1002
|
+
var Ke = _.forwardRef(
|
|
1002
1003
|
(e, t) => {
|
|
1003
|
-
const { __scopeToggleGroup: o, value: n, ...a } = e, s =
|
|
1004
|
+
const { __scopeToggleGroup: o, value: n, ...a } = e, s = St(ge, o), i = { role: "radio", "aria-checked": e.pressed, "aria-pressed": void 0 }, c = s.type === "single" ? i : void 0;
|
|
1004
1005
|
return /* @__PURE__ */ r(
|
|
1005
|
-
|
|
1006
|
+
Tt,
|
|
1006
1007
|
{
|
|
1007
|
-
...
|
|
1008
|
+
...c,
|
|
1008
1009
|
...a,
|
|
1009
1010
|
ref: t,
|
|
1010
|
-
onPressedChange: (
|
|
1011
|
-
|
|
1011
|
+
onPressedChange: (p) => {
|
|
1012
|
+
p ? s.onItemActivate(n) : s.onItemDeactivate(n);
|
|
1012
1013
|
}
|
|
1013
1014
|
}
|
|
1014
1015
|
);
|
|
1015
1016
|
}
|
|
1016
|
-
),
|
|
1017
|
-
const
|
|
1017
|
+
), mr = $e, hr = At;
|
|
1018
|
+
const Mt = _.createContext({
|
|
1018
1019
|
size: "medium",
|
|
1019
1020
|
focusMode: "system",
|
|
1020
1021
|
mode: "system"
|
|
@@ -1032,7 +1033,7 @@ try {
|
|
|
1032
1033
|
});
|
|
1033
1034
|
} catch {
|
|
1034
1035
|
}
|
|
1035
|
-
const
|
|
1036
|
+
const pr = (e) => {
|
|
1036
1037
|
let t = "";
|
|
1037
1038
|
if (typeof e == "number" || typeof e == "string")
|
|
1038
1039
|
t = "m-" + e;
|
|
@@ -1041,22 +1042,22 @@ const gr = (e) => {
|
|
|
1041
1042
|
(e == null ? void 0 : e.t) !== void 0 && o.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && o.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && o.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && o.push(`ml-${e.l}`), t = o.join(" ");
|
|
1042
1043
|
}
|
|
1043
1044
|
return t;
|
|
1044
|
-
},
|
|
1045
|
+
}, gr = ({ focusMode: e }) => C("focus:outline", "focus:outline-2", "focus:outline-offset", {
|
|
1045
1046
|
"focus:outline-focus-light": e === "light",
|
|
1046
1047
|
"focus:outline-focus-dark": e === "dark",
|
|
1047
1048
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
1048
1049
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
1049
|
-
}),
|
|
1050
|
+
}), fr = ({ mode: e }) => C({
|
|
1050
1051
|
"data-[state=on]:bg-surface-medium": e === "dark",
|
|
1051
1052
|
"data-[state=on]:bg-surface-lightest": e === "light",
|
|
1052
1053
|
"data-[state=on]:bg-surface-lightest dark:data-[state=on]:bg-surface-medium": e === "system",
|
|
1053
1054
|
"data-[state=on]:bg-surface-medium dark:data-[state=on]:bg-surface-lightest": e === "alt-system"
|
|
1054
|
-
}),
|
|
1055
|
+
}), br = ({ size: e }) => C({
|
|
1055
1056
|
"h-5 px-2": e === "small",
|
|
1056
1057
|
"h-6 px-3": e === "medium",
|
|
1057
1058
|
"h-7 px-4": e === "large"
|
|
1058
|
-
}),
|
|
1059
|
-
|
|
1059
|
+
}), vr = ({ mode: e }) => C(
|
|
1060
|
+
Lo,
|
|
1060
1061
|
"px-1",
|
|
1061
1062
|
"relative",
|
|
1062
1063
|
"border-r",
|
|
@@ -1069,27 +1070,27 @@ const gr = (e) => {
|
|
|
1069
1070
|
"border-surface-light dark:border-surface-darker": e === "system",
|
|
1070
1071
|
"border-surface-darker dark:border-surface-light": e === "alt-system"
|
|
1071
1072
|
}
|
|
1072
|
-
),
|
|
1073
|
+
), yr = ({
|
|
1073
1074
|
focusMode: e,
|
|
1074
1075
|
mode: t,
|
|
1075
1076
|
size: o
|
|
1076
1077
|
}) => ({
|
|
1077
|
-
wrapperClass:
|
|
1078
|
+
wrapperClass: vr({ mode: t }),
|
|
1078
1079
|
itemClass: C(
|
|
1079
|
-
|
|
1080
|
+
$o,
|
|
1080
1081
|
"flex items-center justify-center bg-transparent",
|
|
1081
1082
|
"rounded-sm",
|
|
1082
1083
|
"transition duration-200 ease",
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1084
|
+
br({ size: o }),
|
|
1085
|
+
gr({ focusMode: e }),
|
|
1086
|
+
fr({ mode: t })
|
|
1086
1087
|
)
|
|
1087
|
-
}),
|
|
1088
|
+
}), kr = ({
|
|
1088
1089
|
mode: e,
|
|
1089
1090
|
spacing: t
|
|
1090
1091
|
}) => C(
|
|
1091
|
-
|
|
1092
|
-
|
|
1092
|
+
Po,
|
|
1093
|
+
pr(t),
|
|
1093
1094
|
"inline-flex p-1",
|
|
1094
1095
|
"rounded-sm",
|
|
1095
1096
|
{
|
|
@@ -1098,7 +1099,7 @@ const gr = (e) => {
|
|
|
1098
1099
|
"bg-surface-light text-copy-dark dark:bg-surface-darker dark:text-copy-lighter": e === "system",
|
|
1099
1100
|
"bg-surface-darker text-copy-lighter dark:bg-surface-light dark:text-copy-dark": e === "alt-system"
|
|
1100
1101
|
}
|
|
1101
|
-
),
|
|
1102
|
+
), Cr = ({
|
|
1102
1103
|
children: e,
|
|
1103
1104
|
value: t,
|
|
1104
1105
|
onValueChange: o,
|
|
@@ -1106,32 +1107,32 @@ const gr = (e) => {
|
|
|
1106
1107
|
mode: a = "system",
|
|
1107
1108
|
focusMode: s = "system",
|
|
1108
1109
|
size: i = "medium",
|
|
1109
|
-
defaultValue:
|
|
1110
|
-
spacing:
|
|
1111
|
-
...
|
|
1110
|
+
defaultValue: c,
|
|
1111
|
+
spacing: p,
|
|
1112
|
+
...m
|
|
1112
1113
|
}) => {
|
|
1113
|
-
const
|
|
1114
|
-
return /* @__PURE__ */ r(
|
|
1115
|
-
|
|
1114
|
+
const l = kr({ mode: a, spacing: p }), g = { size: i, focusMode: s, mode: a };
|
|
1115
|
+
return /* @__PURE__ */ r(Mt.Provider, { value: g, children: /* @__PURE__ */ r(
|
|
1116
|
+
mr,
|
|
1116
1117
|
{
|
|
1117
1118
|
disabled: n,
|
|
1118
|
-
className:
|
|
1119
|
+
className: l,
|
|
1119
1120
|
value: t,
|
|
1120
|
-
defaultValue:
|
|
1121
|
+
defaultValue: c,
|
|
1121
1122
|
onValueChange: o,
|
|
1122
|
-
...
|
|
1123
|
+
...m,
|
|
1123
1124
|
type: "single",
|
|
1124
1125
|
children: e
|
|
1125
1126
|
}
|
|
1126
1127
|
) });
|
|
1127
|
-
},
|
|
1128
|
-
const { size: o, focusMode: n, mode: a } =
|
|
1128
|
+
}, wr = ({ value: e, disabled: t }) => {
|
|
1129
|
+
const { size: o, focusMode: n, mode: a } = P(Mt), { itemClass: s, wrapperClass: i } = yr({
|
|
1129
1130
|
focusMode: n,
|
|
1130
1131
|
mode: a,
|
|
1131
1132
|
size: o
|
|
1132
1133
|
});
|
|
1133
1134
|
return /* @__PURE__ */ r("div", { className: i, children: /* @__PURE__ */ r(
|
|
1134
|
-
|
|
1135
|
+
hr,
|
|
1135
1136
|
{
|
|
1136
1137
|
disabled: t,
|
|
1137
1138
|
className: s,
|
|
@@ -1141,19 +1142,19 @@ const gr = (e) => {
|
|
|
1141
1142
|
) });
|
|
1142
1143
|
};
|
|
1143
1144
|
/*!
|
|
1144
|
-
@versini/ui-panel v1.2.
|
|
1145
|
+
@versini/ui-panel v1.2.3
|
|
1145
1146
|
© 2024 gizmette.com
|
|
1146
1147
|
*/
|
|
1147
1148
|
try {
|
|
1148
1149
|
window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
|
|
1149
|
-
version: "1.2.
|
|
1150
|
-
buildTime: "12/
|
|
1150
|
+
version: "1.2.3",
|
|
1151
|
+
buildTime: "12/27/2024 07:18 PM EST",
|
|
1151
1152
|
homepage: "https://github.com/aversini/ui-components",
|
|
1152
1153
|
license: "MIT"
|
|
1153
1154
|
});
|
|
1154
1155
|
} catch {
|
|
1155
1156
|
}
|
|
1156
|
-
const
|
|
1157
|
+
const We = "av-messagebox", Ye = "av-panel", qe = "av-button";
|
|
1157
1158
|
/*!
|
|
1158
1159
|
@versini/ui-spacing v1.1.0
|
|
1159
1160
|
© 2024 gizmette.com
|
|
@@ -1161,13 +1162,13 @@ const je = "av-messagebox", Ke = "av-panel", We = "av-button";
|
|
|
1161
1162
|
try {
|
|
1162
1163
|
window.__VERSINI_UI_SPACING__ || (window.__VERSINI_UI_SPACING__ = {
|
|
1163
1164
|
version: "1.1.0",
|
|
1164
|
-
buildTime: "12/
|
|
1165
|
+
buildTime: "12/27/2024 07:18 PM EST",
|
|
1165
1166
|
homepage: "https://github.com/aversini/ui-components",
|
|
1166
1167
|
license: "MIT"
|
|
1167
1168
|
});
|
|
1168
1169
|
} catch {
|
|
1169
1170
|
}
|
|
1170
|
-
const
|
|
1171
|
+
const Nr = (e) => {
|
|
1171
1172
|
let t = "";
|
|
1172
1173
|
if (typeof e == "number" || typeof e == "string")
|
|
1173
1174
|
t = "m-" + e;
|
|
@@ -1176,28 +1177,28 @@ const Tr = (e) => {
|
|
|
1176
1177
|
(e == null ? void 0 : e.t) !== void 0 && o.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && o.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && o.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && o.push(`ml-${e.l}`), t = o.join(" ");
|
|
1177
1178
|
}
|
|
1178
1179
|
return t;
|
|
1179
|
-
},
|
|
1180
|
+
}, Oe = "icon", Ir = "button", Tr = "link", _r = ({
|
|
1180
1181
|
type: e,
|
|
1181
1182
|
size: t,
|
|
1182
1183
|
labelRight: o,
|
|
1183
1184
|
labelLeft: n,
|
|
1184
1185
|
align: a
|
|
1185
1186
|
}) => {
|
|
1186
|
-
const s = "text-sm font-medium max-h-8 py-0", i = "text-base font-medium max-h-9 py-1",
|
|
1187
|
+
const s = "text-sm font-medium max-h-8 py-0", i = "text-base font-medium max-h-9 py-1", c = "text-lg font-medium max-h-12 py-2";
|
|
1187
1188
|
switch (e) {
|
|
1188
1189
|
case Ir:
|
|
1189
1190
|
return C("px-4", {
|
|
1190
1191
|
[s]: t === "small",
|
|
1191
1192
|
[i]: t === "medium",
|
|
1192
|
-
[
|
|
1193
|
+
[c]: t === "large"
|
|
1193
1194
|
});
|
|
1194
|
-
case
|
|
1195
|
+
case Tr:
|
|
1195
1196
|
return C("px-4 text-center", {
|
|
1196
1197
|
[s]: t === "small",
|
|
1197
1198
|
[i]: t === "medium",
|
|
1198
|
-
[
|
|
1199
|
+
[c]: t === "large"
|
|
1199
1200
|
});
|
|
1200
|
-
case
|
|
1201
|
+
case Oe:
|
|
1201
1202
|
return C("inline-flex items-center", {
|
|
1202
1203
|
"justify-center": a === "center",
|
|
1203
1204
|
"justify-start": a === "left",
|
|
@@ -1210,7 +1211,7 @@ const Tr = (e) => {
|
|
|
1210
1211
|
"h-12 px-4 text-lg font-medium": t === "large" && (o || n)
|
|
1211
1212
|
});
|
|
1212
1213
|
}
|
|
1213
|
-
},
|
|
1214
|
+
}, Er = ({
|
|
1214
1215
|
mode: e,
|
|
1215
1216
|
noBackground: t,
|
|
1216
1217
|
noTruncate: o,
|
|
@@ -1242,7 +1243,7 @@ const Tr = (e) => {
|
|
|
1242
1243
|
"bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
|
|
1243
1244
|
"bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
|
|
1244
1245
|
});
|
|
1245
|
-
},
|
|
1246
|
+
}, xr = ({
|
|
1246
1247
|
mode: e,
|
|
1247
1248
|
disabled: t,
|
|
1248
1249
|
variant: o
|
|
@@ -1270,7 +1271,7 @@ const Tr = (e) => {
|
|
|
1270
1271
|
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
|
|
1271
1272
|
"hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
|
|
1272
1273
|
});
|
|
1273
|
-
},
|
|
1274
|
+
}, Sr = ({
|
|
1274
1275
|
mode: e,
|
|
1275
1276
|
disabled: t,
|
|
1276
1277
|
variant: o
|
|
@@ -1298,7 +1299,7 @@ const Tr = (e) => {
|
|
|
1298
1299
|
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
|
|
1299
1300
|
"active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
|
|
1300
1301
|
});
|
|
1301
|
-
},
|
|
1302
|
+
}, Rr = ({
|
|
1302
1303
|
mode: e,
|
|
1303
1304
|
noBorder: t,
|
|
1304
1305
|
variant: o
|
|
@@ -1326,12 +1327,12 @@ const Tr = (e) => {
|
|
|
1326
1327
|
"border-border-danger-dark dark:border-border-danger-medium": e === "system",
|
|
1327
1328
|
"border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
|
|
1328
1329
|
});
|
|
1329
|
-
},
|
|
1330
|
+
}, Ar = ({ focusMode: e }) => C("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
1330
1331
|
"focus:outline-focus-dark": e === "dark",
|
|
1331
1332
|
"focus:outline-focus-light": e === "light",
|
|
1332
1333
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
1333
1334
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
1334
|
-
}),
|
|
1335
|
+
}), Pt = ({
|
|
1335
1336
|
type: e,
|
|
1336
1337
|
className: t,
|
|
1337
1338
|
raw: o,
|
|
@@ -1339,30 +1340,30 @@ const Tr = (e) => {
|
|
|
1339
1340
|
focusMode: a,
|
|
1340
1341
|
disabled: s,
|
|
1341
1342
|
fullWidth: i,
|
|
1342
|
-
size:
|
|
1343
|
-
noBorder:
|
|
1344
|
-
labelRight:
|
|
1345
|
-
labelLeft:
|
|
1343
|
+
size: c,
|
|
1344
|
+
noBorder: p,
|
|
1345
|
+
labelRight: m,
|
|
1346
|
+
labelLeft: l,
|
|
1346
1347
|
spacing: g,
|
|
1347
|
-
noBackground:
|
|
1348
|
-
variant:
|
|
1349
|
-
noTruncate:
|
|
1350
|
-
align:
|
|
1351
|
-
}) => (
|
|
1352
|
-
|
|
1348
|
+
noBackground: v,
|
|
1349
|
+
variant: h,
|
|
1350
|
+
noTruncate: u,
|
|
1351
|
+
align: d
|
|
1352
|
+
}) => (h || (h = "primary"), o ? C(qe, t) : C(
|
|
1353
|
+
qe,
|
|
1353
1354
|
t,
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1355
|
+
Nr(g),
|
|
1356
|
+
Er({ mode: n, variant: h, noBackground: v, noTruncate: u }),
|
|
1357
|
+
_r({ type: e, size: c, labelRight: m, labelLeft: l, align: d }),
|
|
1358
|
+
Rr({ mode: n, variant: h, noBorder: p }),
|
|
1359
|
+
Ar({ focusMode: a }),
|
|
1360
|
+
xr({ mode: n, variant: h, disabled: s }),
|
|
1361
|
+
Sr({ mode: n, variant: h, disabled: s }),
|
|
1361
1362
|
{
|
|
1362
1363
|
"w-full": i,
|
|
1363
1364
|
"disabled:cursor-not-allowed disabled:opacity-50": s
|
|
1364
1365
|
}
|
|
1365
|
-
)),
|
|
1366
|
+
)), Mr = (e, t, o) => {
|
|
1366
1367
|
var n;
|
|
1367
1368
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((n = e == null ? void 0 : e.currentTarget) == null ? void 0 : n.focus) == "function" && e.currentTarget.focus(), typeof o == "function" && o(e);
|
|
1368
1369
|
}, Be = _.forwardRef((e, t) => {
|
|
@@ -1372,14 +1373,14 @@ const Tr = (e) => {
|
|
|
1372
1373
|
{
|
|
1373
1374
|
ref: t,
|
|
1374
1375
|
onClick: (s) => {
|
|
1375
|
-
|
|
1376
|
+
Mr(s, n, o);
|
|
1376
1377
|
},
|
|
1377
1378
|
...a
|
|
1378
1379
|
}
|
|
1379
1380
|
);
|
|
1380
1381
|
});
|
|
1381
1382
|
Be.displayName = "BaseButton";
|
|
1382
|
-
const
|
|
1383
|
+
const Lt = _.forwardRef(
|
|
1383
1384
|
({
|
|
1384
1385
|
children: e,
|
|
1385
1386
|
disabled: t = !1,
|
|
@@ -1388,58 +1389,58 @@ const _t = _.forwardRef(
|
|
|
1388
1389
|
fullWidth: a = !1,
|
|
1389
1390
|
className: s,
|
|
1390
1391
|
type: i = "button",
|
|
1391
|
-
raw:
|
|
1392
|
-
noBorder:
|
|
1393
|
-
"aria-label":
|
|
1394
|
-
label:
|
|
1392
|
+
raw: c = !1,
|
|
1393
|
+
noBorder: p = !1,
|
|
1394
|
+
"aria-label": m,
|
|
1395
|
+
label: l,
|
|
1395
1396
|
size: g = "medium",
|
|
1396
|
-
labelRight:
|
|
1397
|
-
labelLeft:
|
|
1398
|
-
spacing:
|
|
1399
|
-
noBackground:
|
|
1400
|
-
align:
|
|
1397
|
+
labelRight: v,
|
|
1398
|
+
labelLeft: h,
|
|
1399
|
+
spacing: u,
|
|
1400
|
+
noBackground: d = !1,
|
|
1401
|
+
align: b = "center",
|
|
1401
1402
|
...k
|
|
1402
1403
|
}, w) => {
|
|
1403
|
-
const
|
|
1404
|
-
type:
|
|
1404
|
+
const I = Pt({
|
|
1405
|
+
type: Oe,
|
|
1405
1406
|
mode: o,
|
|
1406
1407
|
focusMode: n,
|
|
1407
1408
|
fullWidth: a,
|
|
1408
1409
|
disabled: t,
|
|
1409
|
-
raw:
|
|
1410
|
+
raw: c,
|
|
1410
1411
|
className: s,
|
|
1411
|
-
noBorder:
|
|
1412
|
+
noBorder: p,
|
|
1412
1413
|
size: g,
|
|
1413
|
-
labelRight:
|
|
1414
|
-
labelLeft:
|
|
1415
|
-
spacing:
|
|
1416
|
-
noBackground:
|
|
1417
|
-
align:
|
|
1414
|
+
labelRight: v,
|
|
1415
|
+
labelLeft: h,
|
|
1416
|
+
spacing: u,
|
|
1417
|
+
noBackground: d,
|
|
1418
|
+
align: b
|
|
1418
1419
|
}), E = C({
|
|
1419
|
-
"text-copy-accent-dark": o === "light" && !
|
|
1420
|
-
"text-copy-light": o === "dark" && !
|
|
1421
|
-
"text-copy-accent-dark dark:text-copy-light": o === "alt-system" && !
|
|
1422
|
-
"text-copy-light dark:text-copy-accent-dark": o === "system" && !
|
|
1420
|
+
"text-copy-accent-dark": o === "light" && !c,
|
|
1421
|
+
"text-copy-light": o === "dark" && !c,
|
|
1422
|
+
"text-copy-accent-dark dark:text-copy-light": o === "alt-system" && !c,
|
|
1423
|
+
"text-copy-light dark:text-copy-accent-dark": o === "system" && !c
|
|
1423
1424
|
});
|
|
1424
|
-
return /* @__PURE__ */
|
|
1425
|
+
return /* @__PURE__ */ y(
|
|
1425
1426
|
Be,
|
|
1426
1427
|
{
|
|
1427
1428
|
ref: w,
|
|
1428
|
-
className:
|
|
1429
|
+
className: I,
|
|
1429
1430
|
disabled: t,
|
|
1430
1431
|
type: i,
|
|
1431
|
-
"aria-label":
|
|
1432
|
+
"aria-label": m || l,
|
|
1432
1433
|
...k,
|
|
1433
1434
|
children: [
|
|
1434
|
-
|
|
1435
|
+
h && /* @__PURE__ */ r("span", { className: "pr-2", children: h }),
|
|
1435
1436
|
/* @__PURE__ */ r("div", { className: E, children: e }),
|
|
1436
|
-
|
|
1437
|
+
v && /* @__PURE__ */ r("span", { className: "pl-2", children: v })
|
|
1437
1438
|
]
|
|
1438
1439
|
}
|
|
1439
1440
|
);
|
|
1440
1441
|
}
|
|
1441
1442
|
);
|
|
1442
|
-
|
|
1443
|
+
Lt.displayName = "ButtonIcon";
|
|
1443
1444
|
/*!
|
|
1444
1445
|
@versini/ui-button v1.6.0
|
|
1445
1446
|
© 2024 gizmette.com
|
|
@@ -1447,13 +1448,13 @@ _t.displayName = "ButtonIcon";
|
|
|
1447
1448
|
try {
|
|
1448
1449
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
1449
1450
|
version: "1.6.0",
|
|
1450
|
-
buildTime: "12/
|
|
1451
|
+
buildTime: "12/27/2024 07:18 PM EST",
|
|
1451
1452
|
homepage: "https://github.com/aversini/ui-components",
|
|
1452
1453
|
license: "MIT"
|
|
1453
1454
|
});
|
|
1454
1455
|
} catch {
|
|
1455
1456
|
}
|
|
1456
|
-
const
|
|
1457
|
+
const Pr = _.forwardRef(
|
|
1457
1458
|
({
|
|
1458
1459
|
children: e,
|
|
1459
1460
|
disabled: t = !1,
|
|
@@ -1462,40 +1463,40 @@ const Lr = _.forwardRef(
|
|
|
1462
1463
|
fullWidth: a = !1,
|
|
1463
1464
|
className: s,
|
|
1464
1465
|
type: i = "button",
|
|
1465
|
-
raw:
|
|
1466
|
-
noBorder:
|
|
1467
|
-
"aria-label":
|
|
1468
|
-
label:
|
|
1466
|
+
raw: c = !1,
|
|
1467
|
+
noBorder: p = !1,
|
|
1468
|
+
"aria-label": m,
|
|
1469
|
+
label: l,
|
|
1469
1470
|
size: g = "medium",
|
|
1470
|
-
labelRight:
|
|
1471
|
-
labelLeft:
|
|
1472
|
-
spacing:
|
|
1473
|
-
noBackground:
|
|
1474
|
-
align:
|
|
1471
|
+
labelRight: v,
|
|
1472
|
+
labelLeft: h,
|
|
1473
|
+
spacing: u,
|
|
1474
|
+
noBackground: d = !1,
|
|
1475
|
+
align: b = "center",
|
|
1475
1476
|
active: k = !1,
|
|
1476
1477
|
...w
|
|
1477
|
-
},
|
|
1478
|
-
const E =
|
|
1479
|
-
type:
|
|
1478
|
+
}, I) => {
|
|
1479
|
+
const E = Pt({
|
|
1480
|
+
type: Oe,
|
|
1480
1481
|
mode: o,
|
|
1481
1482
|
focusMode: n,
|
|
1482
1483
|
fullWidth: a,
|
|
1483
1484
|
disabled: t,
|
|
1484
|
-
raw:
|
|
1485
|
+
raw: c,
|
|
1485
1486
|
className: s,
|
|
1486
|
-
noBorder:
|
|
1487
|
+
noBorder: p,
|
|
1487
1488
|
size: g,
|
|
1488
|
-
labelRight:
|
|
1489
|
-
labelLeft:
|
|
1490
|
-
spacing:
|
|
1491
|
-
noBackground:
|
|
1492
|
-
align:
|
|
1493
|
-
}),
|
|
1494
|
-
"text-copy-accent-dark": o === "light" && !
|
|
1495
|
-
"text-copy-light": o === "dark" && !
|
|
1496
|
-
"text-copy-accent-dark dark:text-copy-light": o === "alt-system" && !
|
|
1497
|
-
"text-copy-light dark:text-copy-accent-dark": o === "system" && !
|
|
1498
|
-
}),
|
|
1489
|
+
labelRight: v,
|
|
1490
|
+
labelLeft: h,
|
|
1491
|
+
spacing: u,
|
|
1492
|
+
noBackground: d,
|
|
1493
|
+
align: b
|
|
1494
|
+
}), R = C({
|
|
1495
|
+
"text-copy-accent-dark": o === "light" && !c,
|
|
1496
|
+
"text-copy-light": o === "dark" && !c,
|
|
1497
|
+
"text-copy-accent-dark dark:text-copy-light": o === "alt-system" && !c,
|
|
1498
|
+
"text-copy-light dark:text-copy-accent-dark": o === "system" && !c
|
|
1499
|
+
}), $ = k ? C(
|
|
1499
1500
|
"relative",
|
|
1500
1501
|
"focus-within:static",
|
|
1501
1502
|
"focus-within:after:border-transparent",
|
|
@@ -1512,25 +1513,25 @@ const Lr = _.forwardRef(
|
|
|
1512
1513
|
"after:border-table-light dark:after:border-table-dark": o === "alt-system"
|
|
1513
1514
|
}
|
|
1514
1515
|
) : "";
|
|
1515
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1516
|
+
return /* @__PURE__ */ r("div", { className: $, children: /* @__PURE__ */ y(
|
|
1516
1517
|
Be,
|
|
1517
1518
|
{
|
|
1518
|
-
ref:
|
|
1519
|
+
ref: I,
|
|
1519
1520
|
className: E,
|
|
1520
1521
|
disabled: t,
|
|
1521
1522
|
type: i,
|
|
1522
|
-
"aria-label":
|
|
1523
|
+
"aria-label": m || l,
|
|
1523
1524
|
...w,
|
|
1524
1525
|
children: [
|
|
1525
|
-
|
|
1526
|
-
/* @__PURE__ */ r("div", { className:
|
|
1527
|
-
|
|
1526
|
+
h && /* @__PURE__ */ r("span", { className: "pr-2", children: h }),
|
|
1527
|
+
/* @__PURE__ */ r("div", { className: R, children: e }),
|
|
1528
|
+
v && /* @__PURE__ */ r("span", { className: "pl-2", children: v })
|
|
1528
1529
|
]
|
|
1529
1530
|
}
|
|
1530
1531
|
) });
|
|
1531
1532
|
}
|
|
1532
1533
|
);
|
|
1533
|
-
|
|
1534
|
+
Pr.displayName = "ButtonSort";
|
|
1534
1535
|
/*!
|
|
1535
1536
|
@versini/ui-spacing v1.1.0
|
|
1536
1537
|
© 2024 gizmette.com
|
|
@@ -1538,13 +1539,13 @@ Lr.displayName = "ButtonSort";
|
|
|
1538
1539
|
try {
|
|
1539
1540
|
window.__VERSINI_UI_SPACING__ || (window.__VERSINI_UI_SPACING__ = {
|
|
1540
1541
|
version: "1.1.0",
|
|
1541
|
-
buildTime: "12/
|
|
1542
|
+
buildTime: "12/27/2024 07:18 PM EST",
|
|
1542
1543
|
homepage: "https://github.com/aversini/ui-components",
|
|
1543
1544
|
license: "MIT"
|
|
1544
1545
|
});
|
|
1545
1546
|
} catch {
|
|
1546
1547
|
}
|
|
1547
|
-
const
|
|
1548
|
+
const Lr = (e) => {
|
|
1548
1549
|
let t = "";
|
|
1549
1550
|
if (typeof e == "number" || typeof e == "string")
|
|
1550
1551
|
t = "m-" + e;
|
|
@@ -1553,7 +1554,7 @@ const $r = (e) => {
|
|
|
1553
1554
|
(e == null ? void 0 : e.t) !== void 0 && o.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && o.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && o.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && o.push(`ml-${e.l}`), t = o.join(" ");
|
|
1554
1555
|
}
|
|
1555
1556
|
return t;
|
|
1556
|
-
},
|
|
1557
|
+
}, $r = ({
|
|
1557
1558
|
children: e,
|
|
1558
1559
|
fill: t,
|
|
1559
1560
|
viewBox: o,
|
|
@@ -1561,15 +1562,15 @@ const $r = (e) => {
|
|
|
1561
1562
|
defaultViewBox: a,
|
|
1562
1563
|
defaultClassName: s,
|
|
1563
1564
|
spacing: i,
|
|
1564
|
-
title:
|
|
1565
|
-
semantic:
|
|
1566
|
-
...
|
|
1565
|
+
title: c,
|
|
1566
|
+
semantic: p = !1,
|
|
1567
|
+
...m
|
|
1567
1568
|
}) => {
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1569
|
+
const l = Lr(i), g = C(
|
|
1570
|
+
l,
|
|
1570
1571
|
n || s
|
|
1571
1572
|
);
|
|
1572
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ y(S, { children: [
|
|
1573
1574
|
/* @__PURE__ */ r(
|
|
1574
1575
|
"svg",
|
|
1575
1576
|
{
|
|
@@ -1578,13 +1579,13 @@ const $r = (e) => {
|
|
|
1578
1579
|
viewBox: o || a,
|
|
1579
1580
|
fill: t || "currentColor",
|
|
1580
1581
|
role: "img",
|
|
1581
|
-
"aria-hidden": !
|
|
1582
|
+
"aria-hidden": !p,
|
|
1582
1583
|
focusable: !1,
|
|
1583
|
-
...
|
|
1584
|
+
...m,
|
|
1584
1585
|
children: e
|
|
1585
1586
|
}
|
|
1586
1587
|
),
|
|
1587
|
-
|
|
1588
|
+
c && p && /* @__PURE__ */ r("span", { className: "sr-only", children: c })
|
|
1588
1589
|
] });
|
|
1589
1590
|
};
|
|
1590
1591
|
/*!
|
|
@@ -1594,13 +1595,13 @@ const $r = (e) => {
|
|
|
1594
1595
|
try {
|
|
1595
1596
|
window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
|
|
1596
1597
|
version: "1.1.0",
|
|
1597
|
-
buildTime: "12/
|
|
1598
|
+
buildTime: "12/27/2024 07:18 PM EST",
|
|
1598
1599
|
homepage: "https://github.com/aversini/ui-components",
|
|
1599
1600
|
license: "MIT"
|
|
1600
1601
|
});
|
|
1601
1602
|
} catch {
|
|
1602
1603
|
}
|
|
1603
|
-
const
|
|
1604
|
+
const Or = ({
|
|
1604
1605
|
className: e,
|
|
1605
1606
|
viewBox: t,
|
|
1606
1607
|
spacing: o,
|
|
@@ -1608,7 +1609,7 @@ const Vr = ({
|
|
|
1608
1609
|
monotone: a,
|
|
1609
1610
|
...s
|
|
1610
1611
|
}) => /* @__PURE__ */ r(
|
|
1611
|
-
|
|
1612
|
+
$r,
|
|
1612
1613
|
{
|
|
1613
1614
|
defaultViewBox: "0 0 384 512",
|
|
1614
1615
|
defaultClassName: "size-5",
|
|
@@ -1627,95 +1628,178 @@ const Vr = ({
|
|
|
1627
1628
|
try {
|
|
1628
1629
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
1629
1630
|
version: "1.19.0",
|
|
1630
|
-
buildTime: "12/
|
|
1631
|
+
buildTime: "12/27/2024 07:18 PM EST",
|
|
1631
1632
|
homepage: "https://github.com/aversini/ui-components",
|
|
1632
1633
|
license: "MIT"
|
|
1633
1634
|
});
|
|
1634
1635
|
} catch {
|
|
1635
1636
|
}
|
|
1636
|
-
const
|
|
1637
|
+
const $t = f.createContext(null);
|
|
1638
|
+
function Br({
|
|
1639
|
+
initialOpen: e = !1,
|
|
1640
|
+
open: t,
|
|
1641
|
+
onOpenChange: o
|
|
1642
|
+
} = {}) {
|
|
1643
|
+
const [n, a] = f.useState(e), [s, i] = f.useState(), [c, p] = f.useState(), m = t ?? n, l = o ?? a, g = it({
|
|
1644
|
+
open: m,
|
|
1645
|
+
onOpenChange: l
|
|
1646
|
+
}), v = g.context, h = ct(v, {
|
|
1647
|
+
enabled: t == null
|
|
1648
|
+
}), u = dt(v, {
|
|
1649
|
+
outsidePress: !1,
|
|
1650
|
+
outsidePressEvent: "mousedown"
|
|
1651
|
+
}), d = lt(v), b = ut([h, u, d]);
|
|
1652
|
+
return f.useMemo(
|
|
1653
|
+
() => ({
|
|
1654
|
+
open: m,
|
|
1655
|
+
setOpen: l,
|
|
1656
|
+
...b,
|
|
1657
|
+
...g,
|
|
1658
|
+
labelId: s,
|
|
1659
|
+
descriptionId: c,
|
|
1660
|
+
setLabelId: i,
|
|
1661
|
+
setDescriptionId: p
|
|
1662
|
+
}),
|
|
1663
|
+
[m, l, b, g, s, c]
|
|
1664
|
+
);
|
|
1665
|
+
}
|
|
1666
|
+
const ve = () => {
|
|
1667
|
+
const e = f.useContext($t);
|
|
1668
|
+
if (e == null)
|
|
1669
|
+
throw new Error("Modal components must be wrapped in <Modal />");
|
|
1670
|
+
return e;
|
|
1671
|
+
};
|
|
1672
|
+
function Vr({
|
|
1673
|
+
children: e,
|
|
1674
|
+
...t
|
|
1675
|
+
}) {
|
|
1676
|
+
const o = Br(t);
|
|
1677
|
+
return /* @__PURE__ */ r($t.Provider, { value: o, children: e });
|
|
1678
|
+
}
|
|
1679
|
+
const Dr = f.forwardRef(function(e, t) {
|
|
1680
|
+
const { context: o, ...n } = ve(), a = Me([n.refs.setFloating, t]);
|
|
1681
|
+
if (!o.open)
|
|
1682
|
+
return null;
|
|
1683
|
+
const { overlayBackground: s, ...i } = e, c = C("grid place-items-center", {
|
|
1684
|
+
[`${s}`]: s,
|
|
1685
|
+
"bg-black sm:bg-black/[.8]": !s
|
|
1686
|
+
});
|
|
1687
|
+
return /* @__PURE__ */ r(mt, { children: /* @__PURE__ */ r(No, { className: c, lockScroll: !0, children: /* @__PURE__ */ r(ht, { context: o, children: /* @__PURE__ */ r(
|
|
1688
|
+
"div",
|
|
1689
|
+
{
|
|
1690
|
+
ref: a,
|
|
1691
|
+
"aria-labelledby": n.labelId,
|
|
1692
|
+
"aria-describedby": n.descriptionId,
|
|
1693
|
+
...n.getFloatingProps(i),
|
|
1694
|
+
children: i.children
|
|
1695
|
+
}
|
|
1696
|
+
) }) }) });
|
|
1697
|
+
}), zr = f.forwardRef(function({ children: e, ...t }, o) {
|
|
1698
|
+
const { setLabelId: n } = ve(), a = Ae();
|
|
1699
|
+
return f.useLayoutEffect(() => (n(a), () => n(void 0)), [a, n]), /* @__PURE__ */ r("h1", { ...t, ref: o, id: a, children: e });
|
|
1700
|
+
}), Fr = f.forwardRef(function({ children: e, ...t }, o) {
|
|
1701
|
+
const { setDescriptionId: n } = ve(), a = Ae();
|
|
1702
|
+
return f.useLayoutEffect(() => (n(a), () => n(void 0)), [a, n]), /* @__PURE__ */ r("div", { ...t, ref: o, id: a, children: e });
|
|
1703
|
+
}), Gr = f.forwardRef(function(e, t) {
|
|
1704
|
+
const { setOpen: o } = ve(), { trigger: n, className: a, ...s } = e, i = f.useCallback(() => o(!1), [o]);
|
|
1705
|
+
return /* @__PURE__ */ r("div", { className: a, children: f.cloneElement(n, {
|
|
1706
|
+
ref: t,
|
|
1707
|
+
onClick: i,
|
|
1708
|
+
...s
|
|
1709
|
+
}) });
|
|
1710
|
+
});
|
|
1711
|
+
/*!
|
|
1712
|
+
@versini/ui-modal v1.1.0
|
|
1713
|
+
© 2024 gizmette.com
|
|
1714
|
+
*/
|
|
1715
|
+
try {
|
|
1716
|
+
window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
|
|
1717
|
+
version: "1.1.0",
|
|
1718
|
+
buildTime: "12/27/2024 07:18 PM EST",
|
|
1719
|
+
homepage: "https://github.com/aversini/ui-components",
|
|
1720
|
+
license: "MIT"
|
|
1721
|
+
});
|
|
1722
|
+
} catch {
|
|
1723
|
+
}
|
|
1724
|
+
const ee = "panel", ue = "messagebox", Hr = ({
|
|
1637
1725
|
className: e,
|
|
1638
1726
|
kind: t,
|
|
1639
1727
|
borderMode: o
|
|
1640
1728
|
}) => ({
|
|
1641
1729
|
main: C("prose prose-lighter flex flex-col bg-surface-medium", {
|
|
1642
|
-
[`${
|
|
1643
|
-
[`${
|
|
1644
|
-
[`${
|
|
1645
|
-
[`${
|
|
1730
|
+
[`${Ye} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === ee,
|
|
1731
|
+
[`${Ye} w-full sm:w-[95%] md:max-w-2xl`]: t === ee && !e,
|
|
1732
|
+
[`${We} rounded-lg border-2`]: t === ue,
|
|
1733
|
+
[`${We} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === ue && !e,
|
|
1646
1734
|
[`${e}`]: !!e,
|
|
1647
|
-
"sm:border-border-dark": o === "dark" && t ===
|
|
1648
|
-
"sm:border-border-accent": o === "light" && t ===
|
|
1649
|
-
"border-border-dark": o === "dark" && t ===
|
|
1650
|
-
"border-border-accent": o === "light" && t ===
|
|
1735
|
+
"sm:border-border-dark": o === "dark" && t === ee,
|
|
1736
|
+
"sm:border-border-accent": o === "light" && t === ee,
|
|
1737
|
+
"border-border-dark": o === "dark" && t === ue,
|
|
1738
|
+
"border-border-accent": o === "light" && t === ue
|
|
1651
1739
|
}),
|
|
1652
1740
|
content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
|
|
1653
1741
|
footer: "flex flex-grow flex-col sm:p-4 p-2",
|
|
1654
1742
|
header: "sm:p-4 mb-0 p-2",
|
|
1655
1743
|
close: "sm:p-4 p-2"
|
|
1656
|
-
}),
|
|
1657
|
-
() => import("./index.DaIz2ggm.CWKMlVvg.js").then((t) => ({
|
|
1658
|
-
default: t[e]
|
|
1659
|
-
}))
|
|
1660
|
-
), Or = pe("Modal"), Dr = pe("ModalClose"), Hr = pe("ModalContent"), Fr = pe("ModalDescription"), Gr = pe("ModalHeading"), Z = ({
|
|
1744
|
+
}), Y = ({
|
|
1661
1745
|
open: e,
|
|
1662
1746
|
onOpenChange: t,
|
|
1663
1747
|
title: o,
|
|
1664
1748
|
children: n,
|
|
1665
1749
|
footer: a,
|
|
1666
1750
|
borderMode: s = "light",
|
|
1667
|
-
kind: i =
|
|
1668
|
-
className:
|
|
1751
|
+
kind: i = ee,
|
|
1752
|
+
className: c
|
|
1669
1753
|
}) => {
|
|
1670
|
-
const
|
|
1671
|
-
return
|
|
1672
|
-
e && (document.title =
|
|
1673
|
-
}), [o, e]), /* @__PURE__ */ r(
|
|
1674
|
-
/* @__PURE__ */
|
|
1754
|
+
const p = Z(""), m = Hr({ className: c, kind: i, borderMode: s });
|
|
1755
|
+
return G(() => (e && (p.current = document.title, document.title = `${o} | ${p.current}`), () => {
|
|
1756
|
+
e && (document.title = p.current);
|
|
1757
|
+
}), [o, e]), /* @__PURE__ */ r(S, { children: e && /* @__PURE__ */ r(Vr, { open: e, onOpenChange: t, children: /* @__PURE__ */ y(Dr, { className: m.main, children: [
|
|
1758
|
+
/* @__PURE__ */ y("div", { className: "flex flex-row-reverse items-center justify-between", children: [
|
|
1675
1759
|
/* @__PURE__ */ r(
|
|
1676
|
-
|
|
1760
|
+
Gr,
|
|
1677
1761
|
{
|
|
1678
|
-
className:
|
|
1762
|
+
className: m.close,
|
|
1679
1763
|
trigger: /* @__PURE__ */ r(
|
|
1680
|
-
|
|
1764
|
+
Lt,
|
|
1681
1765
|
{
|
|
1682
1766
|
mode: "dark",
|
|
1683
1767
|
focusMode: "light",
|
|
1684
1768
|
noBorder: !0,
|
|
1685
1769
|
label: "Close",
|
|
1686
|
-
children: /* @__PURE__ */ r(
|
|
1770
|
+
children: /* @__PURE__ */ r(Or, {})
|
|
1687
1771
|
}
|
|
1688
1772
|
)
|
|
1689
1773
|
}
|
|
1690
1774
|
),
|
|
1691
|
-
/* @__PURE__ */ r(
|
|
1775
|
+
/* @__PURE__ */ r(zr, { className: m.header, children: o })
|
|
1692
1776
|
] }),
|
|
1693
|
-
/* @__PURE__ */ r(Fr, { className:
|
|
1694
|
-
a && /* @__PURE__ */ r("div", { className:
|
|
1777
|
+
/* @__PURE__ */ r(Fr, { className: m.content, children: n }),
|
|
1778
|
+
a && /* @__PURE__ */ r("div", { className: m.footer, children: a })
|
|
1695
1779
|
] }) }) });
|
|
1696
1780
|
}, Ur = ({ stats: e }) => {
|
|
1697
|
-
const t = (e == null ? void 0 : e.plugins) || [], o = (e == null ? void 0 : e.version) || "", n = (e == null ? void 0 : e.models) || [], a =
|
|
1698
|
-
return /* @__PURE__ */
|
|
1781
|
+
const t = (e == null ? void 0 : e.plugins) || [], o = (e == null ? void 0 : e.version) || "", n = (e == null ? void 0 : e.models) || [], a = ne(), s = ne();
|
|
1782
|
+
return /* @__PURE__ */ y(S, { children: [
|
|
1699
1783
|
/* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
|
|
1700
|
-
|
|
1784
|
+
M,
|
|
1701
1785
|
{
|
|
1702
|
-
header:
|
|
1786
|
+
header: T.ABOUT.TITLE_CLIENT,
|
|
1703
1787
|
className: "prose-dark dark:prose-lighter",
|
|
1704
|
-
children:
|
|
1705
|
-
[
|
|
1706
|
-
[
|
|
1788
|
+
children: re(a, {
|
|
1789
|
+
[T.ABOUT.VERSION]: "5.10.0",
|
|
1790
|
+
[T.ABOUT.BUILD_TIMESTAMP]: "12/28/2024 05:55 PM EST"
|
|
1707
1791
|
})
|
|
1708
1792
|
}
|
|
1709
1793
|
) }),
|
|
1710
1794
|
/* @__PURE__ */ r(
|
|
1711
|
-
|
|
1795
|
+
M,
|
|
1712
1796
|
{
|
|
1713
|
-
header:
|
|
1797
|
+
header: T.ABOUT.TITLE_SERVER,
|
|
1714
1798
|
className: "prose-dark dark:prose-lighter",
|
|
1715
|
-
children:
|
|
1716
|
-
[
|
|
1717
|
-
[
|
|
1718
|
-
[
|
|
1799
|
+
children: re(s, {
|
|
1800
|
+
[T.ABOUT.VERSION]: o,
|
|
1801
|
+
[he(T.ABOUT.ENGINE, n.length)]: /* @__PURE__ */ r(S, { children: n.map((i) => /* @__PURE__ */ r("div", { className: "text-right", children: i }, i)) }),
|
|
1802
|
+
[he(T.ABOUT.PLUGIN, t.length)]: /* @__PURE__ */ r(S, { children: t.map((i) => /* @__PURE__ */ r("div", { className: "text-right", children: i }, i)) })
|
|
1719
1803
|
})
|
|
1720
1804
|
}
|
|
1721
1805
|
)
|
|
@@ -1724,18 +1808,18 @@ const ne = "panel", ge = "messagebox", zr = ({
|
|
|
1724
1808
|
open: e,
|
|
1725
1809
|
onOpenChange: t
|
|
1726
1810
|
}) => {
|
|
1727
|
-
const { serverStats: o } =
|
|
1728
|
-
return /* @__PURE__ */ r(
|
|
1811
|
+
const { serverStats: o } = P(se);
|
|
1812
|
+
return /* @__PURE__ */ r(Y, { open: e, onOpenChange: t, title: zt, children: /* @__PURE__ */ r(Ur, { stats: o }) });
|
|
1729
1813
|
}, Kr = (e) => Xe(e), Wr = (e) => {
|
|
1730
1814
|
if (!e || e.length === 0)
|
|
1731
|
-
return
|
|
1815
|
+
return Gt;
|
|
1732
1816
|
const t = e.filter(
|
|
1733
1817
|
(o) => {
|
|
1734
1818
|
var n, a;
|
|
1735
|
-
return ((n = o == null ? void 0 : o.message) == null ? void 0 : n.role) ===
|
|
1819
|
+
return ((n = o == null ? void 0 : o.message) == null ? void 0 : n.role) === Ht && typeof ((a = o == null ? void 0 : o.message) == null ? void 0 : a.processingTime) == "number";
|
|
1736
1820
|
}
|
|
1737
1821
|
).map((o) => o.message.processingTime);
|
|
1738
|
-
return
|
|
1822
|
+
return Ut({
|
|
1739
1823
|
data: t,
|
|
1740
1824
|
formatter: Kr
|
|
1741
1825
|
});
|
|
@@ -1743,29 +1827,29 @@ const ne = "panel", ge = "messagebox", zr = ({
|
|
|
1743
1827
|
isAuthenticated: e,
|
|
1744
1828
|
stats: t
|
|
1745
1829
|
}) => {
|
|
1746
|
-
const { state: o } =
|
|
1747
|
-
return e ? /* @__PURE__ */
|
|
1830
|
+
const { state: o } = P(se), n = jt - Number(o == null ? void 0 : o.usage), a = ne(), s = ne();
|
|
1831
|
+
return e ? /* @__PURE__ */ y(S, { children: [
|
|
1748
1832
|
o && o.messages.length > 0 && /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
|
|
1749
|
-
|
|
1833
|
+
M,
|
|
1750
1834
|
{
|
|
1751
|
-
header:
|
|
1835
|
+
header: T.CURRENT_STATISTICS.TITLE,
|
|
1752
1836
|
className: "prose-dark dark:prose-lighter",
|
|
1753
|
-
children:
|
|
1754
|
-
[
|
|
1755
|
-
[
|
|
1756
|
-
[
|
|
1757
|
-
[
|
|
1837
|
+
children: re(a, {
|
|
1838
|
+
[T.CURRENT_STATISTICS.MODEL_NAME]: (o == null ? void 0 : o.model) || te,
|
|
1839
|
+
[T.CURRENT_STATISTICS.TOKENS_USED]: o == null ? void 0 : o.usage,
|
|
1840
|
+
[T.CURRENT_STATISTICS.REMAINING_TOKENS]: Ft.format(n),
|
|
1841
|
+
[T.CURRENT_STATISTICS.PROCESSING_TIME]: Wr(o == null ? void 0 : o.messages)
|
|
1758
1842
|
})
|
|
1759
1843
|
}
|
|
1760
1844
|
) }),
|
|
1761
1845
|
/* @__PURE__ */ r(
|
|
1762
|
-
|
|
1846
|
+
M,
|
|
1763
1847
|
{
|
|
1764
|
-
header:
|
|
1848
|
+
header: T.MAIN_STATISTICS.TITLE,
|
|
1765
1849
|
className: "prose-dark dark:prose-lighter",
|
|
1766
|
-
children:
|
|
1767
|
-
[
|
|
1768
|
-
[
|
|
1850
|
+
children: re(s, {
|
|
1851
|
+
[he(T.MAIN_STATISTICS.TOTAL, t.totalChats)]: t.totalChats,
|
|
1852
|
+
[T.MAIN_STATISTICS.PROCESSING_TIME]: Xe(
|
|
1769
1853
|
t.averageProcessingTimes
|
|
1770
1854
|
)
|
|
1771
1855
|
})
|
|
@@ -1779,38 +1863,38 @@ const ne = "panel", ge = "messagebox", zr = ({
|
|
|
1779
1863
|
const [o, n] = x({
|
|
1780
1864
|
averageProcessingTimes: 0,
|
|
1781
1865
|
totalChats: 0
|
|
1782
|
-
}), { isAuthenticated: a, getAccessToken: s, user: i } =
|
|
1783
|
-
return
|
|
1866
|
+
}), { isAuthenticated: a, getAccessToken: s, user: i } = W();
|
|
1867
|
+
return G(() => {
|
|
1784
1868
|
!e || !i || (async () => {
|
|
1785
1869
|
try {
|
|
1786
|
-
const
|
|
1870
|
+
const c = await V({
|
|
1787
1871
|
accessToken: await s(),
|
|
1788
|
-
type:
|
|
1872
|
+
type: D.GET_CHATS_STATS,
|
|
1789
1873
|
params: {
|
|
1790
1874
|
userId: i.username
|
|
1791
1875
|
}
|
|
1792
1876
|
});
|
|
1793
|
-
|
|
1877
|
+
c.status === 200 && n(c.data);
|
|
1794
1878
|
} catch {
|
|
1795
1879
|
}
|
|
1796
1880
|
})();
|
|
1797
|
-
}, [e, s, i]), /* @__PURE__ */ r(
|
|
1798
|
-
},
|
|
1881
|
+
}, [e, s, i]), /* @__PURE__ */ r(Y, { open: e, onOpenChange: t, title: Je, children: /* @__PURE__ */ r(Yr, { isAuthenticated: a, stats: o }) });
|
|
1882
|
+
}, Ot = ({
|
|
1799
1883
|
showConfirmation: e,
|
|
1800
1884
|
setShowConfirmation: t,
|
|
1801
1885
|
action: o,
|
|
1802
1886
|
children: n,
|
|
1803
1887
|
customStrings: a
|
|
1804
1888
|
}) => /* @__PURE__ */ r(
|
|
1805
|
-
|
|
1889
|
+
Y,
|
|
1806
1890
|
{
|
|
1807
1891
|
kind: "messagebox",
|
|
1808
1892
|
open: e,
|
|
1809
1893
|
onOpenChange: t,
|
|
1810
1894
|
title: a.title,
|
|
1811
|
-
footer: /* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */ r(
|
|
1813
|
-
|
|
1895
|
+
footer: /* @__PURE__ */ y(q, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
1896
|
+
/* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(
|
|
1897
|
+
F,
|
|
1814
1898
|
{
|
|
1815
1899
|
mode: "dark",
|
|
1816
1900
|
variant: "secondary",
|
|
@@ -1821,8 +1905,8 @@ const ne = "panel", ge = "messagebox", zr = ({
|
|
|
1821
1905
|
children: a.cancelAction
|
|
1822
1906
|
}
|
|
1823
1907
|
) }),
|
|
1824
|
-
/* @__PURE__ */ r(
|
|
1825
|
-
|
|
1908
|
+
/* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(
|
|
1909
|
+
F,
|
|
1826
1910
|
{
|
|
1827
1911
|
mode: "dark",
|
|
1828
1912
|
variant: "danger",
|
|
@@ -1836,19 +1920,19 @@ const ne = "panel", ge = "messagebox", zr = ({
|
|
|
1836
1920
|
] }),
|
|
1837
1921
|
children: n
|
|
1838
1922
|
}
|
|
1839
|
-
),
|
|
1923
|
+
), Zr = async (e, t, o, n) => {
|
|
1840
1924
|
try {
|
|
1841
|
-
const a = await
|
|
1925
|
+
const a = await V({
|
|
1842
1926
|
accessToken: n,
|
|
1843
|
-
type:
|
|
1927
|
+
type: D.GET_CHAT,
|
|
1844
1928
|
params: {
|
|
1845
1929
|
id: e.id
|
|
1846
1930
|
}
|
|
1847
1931
|
});
|
|
1848
1932
|
a.status === 200 && (t({
|
|
1849
|
-
type:
|
|
1933
|
+
type: tt
|
|
1850
1934
|
}), t({
|
|
1851
|
-
type:
|
|
1935
|
+
type: Wt,
|
|
1852
1936
|
payload: {
|
|
1853
1937
|
id: e.id,
|
|
1854
1938
|
model: a.data.model,
|
|
@@ -1858,86 +1942,63 @@ const ne = "panel", ge = "messagebox", zr = ({
|
|
|
1858
1942
|
}), o(!1));
|
|
1859
1943
|
} catch {
|
|
1860
1944
|
}
|
|
1861
|
-
},
|
|
1945
|
+
}, Ze = (e) => {
|
|
1862
1946
|
const t = e[0];
|
|
1863
|
-
return
|
|
1864
|
-
},
|
|
1947
|
+
return Yt(t == null ? void 0 : t.content, 100);
|
|
1948
|
+
}, Qr = ({
|
|
1865
1949
|
filteredHistory: e,
|
|
1866
1950
|
setFilteredHistory: t,
|
|
1867
1951
|
dispatch: o,
|
|
1868
1952
|
onOpenChange: n
|
|
1869
1953
|
}) => {
|
|
1870
|
-
var
|
|
1871
|
-
const { user: a, getAccessToken: s } =
|
|
1954
|
+
var u;
|
|
1955
|
+
const { user: a, getAccessToken: s } = W(), i = Z({
|
|
1872
1956
|
id: 0,
|
|
1873
1957
|
timestamp: "",
|
|
1874
1958
|
message: ""
|
|
1875
|
-
}), [
|
|
1876
|
-
key:
|
|
1877
|
-
initialValue:
|
|
1878
|
-
}),
|
|
1879
|
-
(
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
return new Date(p[d.sortedCell]).getTime() - new Date(k[d.sortedCell]).getTime();
|
|
1884
|
-
if (d.sortDirection === O.DESC)
|
|
1885
|
-
return new Date(k[d.sortedCell]).getTime() - new Date(p[d.sortedCell]).getTime();
|
|
1886
|
-
break;
|
|
1887
|
-
default:
|
|
1888
|
-
return 0;
|
|
1889
|
-
}
|
|
1890
|
-
return 0;
|
|
1891
|
-
}
|
|
1892
|
-
), u = (p) => {
|
|
1893
|
-
switch (d.sortDirection) {
|
|
1894
|
-
case !1:
|
|
1895
|
-
g(O.ASC), c({
|
|
1896
|
-
type: we,
|
|
1959
|
+
}), [c, p] = x(!1), { state: m, dispatch: l } = P(et), [, g] = ce({
|
|
1960
|
+
key: ie + Kt,
|
|
1961
|
+
initialValue: m.sortDirection
|
|
1962
|
+
}), v = (d) => {
|
|
1963
|
+
switch (m.sortDirection) {
|
|
1964
|
+
case U.ASC:
|
|
1965
|
+
g(U.DESC), l({
|
|
1966
|
+
type: De,
|
|
1897
1967
|
payload: {
|
|
1898
|
-
sortedCell:
|
|
1899
|
-
sortDirection:
|
|
1900
|
-
}
|
|
1901
|
-
});
|
|
1902
|
-
break;
|
|
1903
|
-
case O.ASC:
|
|
1904
|
-
g(O.DESC), c({
|
|
1905
|
-
type: we,
|
|
1906
|
-
payload: {
|
|
1907
|
-
sortedCell: p,
|
|
1908
|
-
sortDirection: O.DESC
|
|
1968
|
+
sortedCell: d,
|
|
1969
|
+
sortDirection: U.DESC
|
|
1909
1970
|
}
|
|
1910
1971
|
});
|
|
1911
1972
|
break;
|
|
1912
1973
|
default:
|
|
1913
|
-
g(
|
|
1914
|
-
type:
|
|
1974
|
+
g(U.ASC), l({
|
|
1975
|
+
type: De,
|
|
1915
1976
|
payload: {
|
|
1916
|
-
sortedCell:
|
|
1917
|
-
sortDirection:
|
|
1977
|
+
sortedCell: d,
|
|
1978
|
+
sortDirection: U.ASC
|
|
1918
1979
|
}
|
|
1919
1980
|
});
|
|
1920
1981
|
break;
|
|
1921
1982
|
}
|
|
1922
1983
|
};
|
|
1923
|
-
return /* @__PURE__ */
|
|
1924
|
-
/* @__PURE__ */
|
|
1925
|
-
|
|
1984
|
+
return /* @__PURE__ */ y(S, { children: [
|
|
1985
|
+
/* @__PURE__ */ y(
|
|
1986
|
+
Ot,
|
|
1926
1987
|
{
|
|
1927
|
-
showConfirmation:
|
|
1928
|
-
setShowConfirmation:
|
|
1988
|
+
showConfirmation: c,
|
|
1989
|
+
setShowConfirmation: p,
|
|
1929
1990
|
action: async () => {
|
|
1930
|
-
const
|
|
1991
|
+
const d = i.current;
|
|
1931
1992
|
try {
|
|
1932
|
-
const
|
|
1993
|
+
const b = await V({
|
|
1933
1994
|
accessToken: await s(),
|
|
1934
|
-
type:
|
|
1995
|
+
type: D.DELETE_CHAT,
|
|
1935
1996
|
params: {
|
|
1936
1997
|
userId: (a == null ? void 0 : a.username) || "",
|
|
1937
|
-
id:
|
|
1998
|
+
id: d.id
|
|
1938
1999
|
}
|
|
1939
2000
|
});
|
|
1940
|
-
|
|
2001
|
+
b.status === 200 && t({ data: b.data });
|
|
1941
2002
|
} catch {
|
|
1942
2003
|
}
|
|
1943
2004
|
},
|
|
@@ -1948,173 +2009,223 @@ const ne = "panel", ge = "messagebox", zr = ({
|
|
|
1948
2009
|
},
|
|
1949
2010
|
children: [
|
|
1950
2011
|
/* @__PURE__ */ r("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
|
|
1951
|
-
/* @__PURE__ */
|
|
1952
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ y("ul", { className: "m-0", children: [
|
|
2013
|
+
/* @__PURE__ */ y("li", { children: [
|
|
1953
2014
|
"Timestamp:",
|
|
1954
2015
|
" ",
|
|
1955
2016
|
/* @__PURE__ */ r("span", { className: "text-lg", children: i.current && i.current.timestamp })
|
|
1956
2017
|
] }),
|
|
1957
|
-
/* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ y("li", { children: [
|
|
1958
2019
|
"First message:",
|
|
1959
2020
|
" ",
|
|
1960
|
-
/* @__PURE__ */ r("span", { className: "text-lg", children: (
|
|
2021
|
+
/* @__PURE__ */ r("span", { className: "text-lg", children: (u = i.current) == null ? void 0 : u.message })
|
|
1961
2022
|
] })
|
|
1962
2023
|
] })
|
|
1963
2024
|
]
|
|
1964
2025
|
}
|
|
1965
2026
|
),
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
sortedCell: d.sortedCell,
|
|
1976
|
-
onClick: () => {
|
|
1977
|
-
u("timestamp");
|
|
1978
|
-
},
|
|
1979
|
-
children: "Date"
|
|
1980
|
-
}
|
|
1981
|
-
),
|
|
1982
|
-
/* @__PURE__ */ r(F, { className: "text-xs sm:text-sm", children: "First message" }),
|
|
1983
|
-
/* @__PURE__ */ r(F, { className: "text-xs sm:text-sm", children: "Model" }),
|
|
1984
|
-
/* @__PURE__ */ r(F, { className: "text-xs sm:text-sm text-right", children: "Actions" })
|
|
1985
|
-
] }) }),
|
|
1986
|
-
/* @__PURE__ */ r(to, { children: y.map((p, k) => {
|
|
1987
|
-
var w;
|
|
1988
|
-
return ((w = p == null ? void 0 : p.messages) == null ? void 0 : w.length) > 0 ? /* @__PURE__ */ v(Te, { children: [
|
|
1989
|
-
/* @__PURE__ */ r(
|
|
1990
|
-
F,
|
|
1991
|
-
{
|
|
1992
|
-
component: "th",
|
|
1993
|
-
scope: "row",
|
|
1994
|
-
className: "text-gray-400 sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
|
|
1995
|
-
children: p.timestamp
|
|
1996
|
-
}
|
|
1997
|
-
),
|
|
1998
|
-
/* @__PURE__ */ r(
|
|
1999
|
-
F,
|
|
2000
|
-
{
|
|
2001
|
-
className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
|
|
2002
|
-
style: {
|
|
2003
|
-
wordBreak: "break-word"
|
|
2004
|
-
},
|
|
2005
|
-
children: Ye(p.messages)
|
|
2006
|
-
}
|
|
2007
|
-
),
|
|
2008
|
-
/* @__PURE__ */ r(F, { component: "th", scope: "row", className: "text-gray-400", children: /* @__PURE__ */ v(Q, { alignHorizontal: "center", children: [
|
|
2009
|
-
p.model && p.model.startsWith("claude") && /* @__PURE__ */ r(st, { className: "size-4 sm:size-5" }),
|
|
2010
|
-
p.model && p.model.startsWith("gpt") && /* @__PURE__ */ r(it, { className: "size-4 sm:size-5" })
|
|
2011
|
-
] }) }),
|
|
2012
|
-
/* @__PURE__ */ r(F, { className: "px-2", children: /* @__PURE__ */ v("div", { className: "flex justify-end gap-2", children: [
|
|
2013
|
-
/* @__PURE__ */ r(
|
|
2014
|
-
W,
|
|
2015
|
-
{
|
|
2016
|
-
focusMode: "alt-system",
|
|
2017
|
-
noBorder: !0,
|
|
2018
|
-
label: "Restore chat",
|
|
2019
|
-
onClick: async () => {
|
|
2020
|
-
const T = await s();
|
|
2021
|
-
Xr(
|
|
2022
|
-
p,
|
|
2023
|
-
o,
|
|
2024
|
-
n,
|
|
2025
|
-
T
|
|
2026
|
-
);
|
|
2027
|
-
},
|
|
2028
|
-
children: /* @__PURE__ */ r(Ao, { className: "h-3 w-3", monotone: !0 })
|
|
2029
|
-
}
|
|
2030
|
-
),
|
|
2027
|
+
/* @__PURE__ */ y(
|
|
2028
|
+
io,
|
|
2029
|
+
{
|
|
2030
|
+
stickyHeader: !0,
|
|
2031
|
+
stickyFooter: !0,
|
|
2032
|
+
compact: !0,
|
|
2033
|
+
wrapperClassName: "max-h-[60vh] min-h-[60vh]",
|
|
2034
|
+
children: [
|
|
2035
|
+
/* @__PURE__ */ r(co, { children: /* @__PURE__ */ y(Ne, { children: [
|
|
2031
2036
|
/* @__PURE__ */ r(
|
|
2032
|
-
|
|
2037
|
+
lo,
|
|
2033
2038
|
{
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2039
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
2040
|
+
cellId: "timestamp",
|
|
2041
|
+
align: "left",
|
|
2042
|
+
sortDirection: m.sortDirection,
|
|
2043
|
+
sortedCell: m.sortedCell,
|
|
2037
2044
|
onClick: () => {
|
|
2038
|
-
|
|
2039
|
-
id: p.id,
|
|
2040
|
-
timestamp: p.timestamp,
|
|
2041
|
-
message: Ye(p.messages)
|
|
2042
|
-
}, h(!l);
|
|
2045
|
+
v("timestamp");
|
|
2043
2046
|
},
|
|
2044
|
-
children:
|
|
2047
|
+
children: "Date"
|
|
2045
2048
|
}
|
|
2046
|
-
)
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2049
|
+
),
|
|
2050
|
+
/* @__PURE__ */ r(z, { className: "text-xs sm:text-sm", children: "First message" }),
|
|
2051
|
+
/* @__PURE__ */ r(z, { className: "text-xs sm:text-sm", children: "Model" }),
|
|
2052
|
+
/* @__PURE__ */ r(z, { className: "text-xs sm:text-sm text-right", children: "Actions" })
|
|
2053
|
+
] }) }),
|
|
2054
|
+
/* @__PURE__ */ r(uo, { children: e.data.map((d, b) => {
|
|
2055
|
+
var k;
|
|
2056
|
+
return ((k = d == null ? void 0 : d.messages) == null ? void 0 : k.length) > 0 ? /* @__PURE__ */ y(Ne, { children: [
|
|
2057
|
+
/* @__PURE__ */ r(
|
|
2058
|
+
z,
|
|
2059
|
+
{
|
|
2060
|
+
component: "th",
|
|
2061
|
+
scope: "row",
|
|
2062
|
+
className: "text-gray-400 sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
|
|
2063
|
+
children: d.timestamp
|
|
2064
|
+
}
|
|
2065
|
+
),
|
|
2066
|
+
/* @__PURE__ */ r(
|
|
2067
|
+
z,
|
|
2068
|
+
{
|
|
2069
|
+
className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
|
|
2070
|
+
style: {
|
|
2071
|
+
wordBreak: "break-word"
|
|
2072
|
+
},
|
|
2073
|
+
children: Ze(d.messages)
|
|
2074
|
+
}
|
|
2075
|
+
),
|
|
2076
|
+
/* @__PURE__ */ r(z, { component: "th", scope: "row", className: "text-gray-400", children: /* @__PURE__ */ y(q, { alignHorizontal: "center", children: [
|
|
2077
|
+
d.model && d.model.startsWith("claude") && /* @__PURE__ */ r(pt, { className: "size-4 sm:size-5" }),
|
|
2078
|
+
d.model && d.model.startsWith("gpt") && /* @__PURE__ */ r(gt, { className: "size-4 sm:size-5" })
|
|
2079
|
+
] }) }),
|
|
2080
|
+
/* @__PURE__ */ r(z, { className: "px-2", children: /* @__PURE__ */ y("div", { className: "flex justify-end gap-2", children: [
|
|
2081
|
+
/* @__PURE__ */ r(
|
|
2082
|
+
j,
|
|
2083
|
+
{
|
|
2084
|
+
focusMode: "alt-system",
|
|
2085
|
+
noBorder: !0,
|
|
2086
|
+
label: "Restore chat",
|
|
2087
|
+
onClick: async () => {
|
|
2088
|
+
const w = await s();
|
|
2089
|
+
Zr(
|
|
2090
|
+
d,
|
|
2091
|
+
o,
|
|
2092
|
+
n,
|
|
2093
|
+
w
|
|
2094
|
+
);
|
|
2095
|
+
},
|
|
2096
|
+
children: /* @__PURE__ */ r(Ro, { className: "h-3 w-3", monotone: !0 })
|
|
2097
|
+
}
|
|
2098
|
+
),
|
|
2099
|
+
/* @__PURE__ */ r(
|
|
2100
|
+
j,
|
|
2101
|
+
{
|
|
2102
|
+
focusMode: "alt-system",
|
|
2103
|
+
noBorder: !0,
|
|
2104
|
+
label: "Delete chat",
|
|
2105
|
+
onClick: () => {
|
|
2106
|
+
i.current = {
|
|
2107
|
+
id: d.id,
|
|
2108
|
+
timestamp: d.timestamp,
|
|
2109
|
+
message: Ze(d.messages)
|
|
2110
|
+
}, p(!c);
|
|
2111
|
+
},
|
|
2112
|
+
children: /* @__PURE__ */ r("div", { className: "text-red-400", children: /* @__PURE__ */ r(_o, { className: "h-3 w-3", monotone: !0 }) })
|
|
2113
|
+
}
|
|
2114
|
+
)
|
|
2115
|
+
] }) })
|
|
2116
|
+
] }, `${T.HISTORY.TITLE}-${d.id}-${b}`) : null;
|
|
2117
|
+
}) }),
|
|
2118
|
+
/* @__PURE__ */ r(mo, { children: /* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r(z, { colSpan: 4, children: /* @__PURE__ */ r("div", { children: he(
|
|
2119
|
+
`${e.data.length} chat`,
|
|
2120
|
+
e.data.length
|
|
2121
|
+
) }) }) }) })
|
|
2122
|
+
]
|
|
2123
|
+
}
|
|
2124
|
+
)
|
|
2055
2125
|
] });
|
|
2056
|
-
}
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
) || o.timestamp && o.timestamp.toLowerCase().includes(t.toLowerCase())
|
|
2062
|
-
) : e;
|
|
2063
|
-
}
|
|
2064
|
-
const Jr = ({
|
|
2065
|
-
onOpenChange: e,
|
|
2066
|
-
historyData: t
|
|
2126
|
+
}, Qe = async ({
|
|
2127
|
+
searchString: e,
|
|
2128
|
+
username: t,
|
|
2129
|
+
accessToken: o,
|
|
2130
|
+
direction: n = U.ASC
|
|
2067
2131
|
}) => {
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2132
|
+
if (!t)
|
|
2133
|
+
return [];
|
|
2134
|
+
try {
|
|
2135
|
+
const a = await V({
|
|
2136
|
+
accessToken: o,
|
|
2137
|
+
type: D.GET_CHATS,
|
|
2138
|
+
params: {
|
|
2139
|
+
userId: t,
|
|
2140
|
+
searchString: e,
|
|
2141
|
+
limit: 1,
|
|
2142
|
+
direction: n
|
|
2143
|
+
}
|
|
2080
2144
|
});
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
}
|
|
2086
|
-
return
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2145
|
+
if (a.status === 200)
|
|
2146
|
+
return a.data;
|
|
2147
|
+
} catch {
|
|
2148
|
+
return [];
|
|
2149
|
+
}
|
|
2150
|
+
return [];
|
|
2151
|
+
}, Xr = ({ onOpenChange: e }) => {
|
|
2152
|
+
const { isAuthenticated: t, getAccessToken: o, user: n } = W(), a = Z(null), s = Z(!1), { dispatch: i } = P(se), { state: c, dispatch: p } = P(et), [, m] = ce({
|
|
2153
|
+
key: ie + qt,
|
|
2154
|
+
initialValue: c.searchString
|
|
2155
|
+
}), [l, g] = x({
|
|
2156
|
+
data: [],
|
|
2157
|
+
sortedDirection: c.sortDirection
|
|
2158
|
+
}), v = async (d) => {
|
|
2159
|
+
const b = await o(), k = await Qe({
|
|
2160
|
+
searchString: d,
|
|
2161
|
+
username: n == null ? void 0 : n.username,
|
|
2162
|
+
accessToken: b,
|
|
2163
|
+
direction: c.sortDirection
|
|
2093
2164
|
});
|
|
2094
|
-
|
|
2165
|
+
g({
|
|
2166
|
+
data: k,
|
|
2167
|
+
sortedDirection: c.sortDirection
|
|
2168
|
+
}), m(d), p({
|
|
2169
|
+
type: Zt,
|
|
2170
|
+
payload: { searchString: d }
|
|
2171
|
+
});
|
|
2172
|
+
}, h = Qt((d) => {
|
|
2173
|
+
v(d.target.value);
|
|
2174
|
+
}, 500), u = async (d) => {
|
|
2175
|
+
d.preventDefault();
|
|
2176
|
+
};
|
|
2177
|
+
return G(() => {
|
|
2178
|
+
s.current || (async () => {
|
|
2179
|
+
s.current = !0;
|
|
2180
|
+
const d = await o(), b = await Qe({
|
|
2181
|
+
searchString: c.searchString,
|
|
2182
|
+
username: n == null ? void 0 : n.username,
|
|
2183
|
+
accessToken: d,
|
|
2184
|
+
direction: c.sortDirection
|
|
2185
|
+
});
|
|
2186
|
+
g({
|
|
2187
|
+
data: b,
|
|
2188
|
+
sortedDirection: c.sortDirection
|
|
2189
|
+
});
|
|
2190
|
+
})();
|
|
2191
|
+
}), G(() => {
|
|
2192
|
+
if (c.sortDirection !== l.sortedDirection) {
|
|
2193
|
+
const d = [...l.data].sort((b, k) => {
|
|
2194
|
+
if (c.sortedCell === "timestamp") {
|
|
2195
|
+
const w = new Date(b[c.sortedCell]).getTime(), I = new Date(k[c.sortedCell]).getTime();
|
|
2196
|
+
return c.sortDirection === U.ASC ? w - I : I - w;
|
|
2197
|
+
}
|
|
2198
|
+
return 0;
|
|
2199
|
+
});
|
|
2200
|
+
g({
|
|
2201
|
+
data: d,
|
|
2202
|
+
sortedDirection: c.sortDirection
|
|
2203
|
+
});
|
|
2204
|
+
}
|
|
2205
|
+
}, [l, c]), t ? l && l.data && /* @__PURE__ */ y(S, { children: [
|
|
2095
2206
|
/* @__PURE__ */ r("form", { autoComplete: "off", onSubmit: u, children: /* @__PURE__ */ r(
|
|
2096
|
-
|
|
2207
|
+
Te,
|
|
2097
2208
|
{
|
|
2098
2209
|
autoComplete: "off",
|
|
2099
2210
|
autoCorrect: "off",
|
|
2100
|
-
ref:
|
|
2101
|
-
defaultValue:
|
|
2211
|
+
ref: a,
|
|
2212
|
+
defaultValue: c.searchString,
|
|
2102
2213
|
focusMode: "light",
|
|
2103
2214
|
name: "Search",
|
|
2104
2215
|
label: "Search",
|
|
2105
|
-
onChange:
|
|
2216
|
+
onChange: h,
|
|
2106
2217
|
spacing: { t: 2, b: 2 },
|
|
2107
|
-
...
|
|
2218
|
+
...c.searchString && {
|
|
2108
2219
|
rightElement: /* @__PURE__ */ r(
|
|
2109
|
-
|
|
2220
|
+
F,
|
|
2110
2221
|
{
|
|
2111
|
-
disabled: !
|
|
2222
|
+
disabled: !c.searchString,
|
|
2112
2223
|
mode: "dark",
|
|
2113
2224
|
noBorder: !0,
|
|
2114
2225
|
size: "small",
|
|
2115
2226
|
onClick: () => {
|
|
2116
|
-
var
|
|
2117
|
-
|
|
2227
|
+
var d;
|
|
2228
|
+
v(""), (d = a.current) != null && d.value && (a.current.value = "", a.current.focus());
|
|
2118
2229
|
},
|
|
2119
2230
|
children: "Reset"
|
|
2120
2231
|
}
|
|
@@ -2123,20 +2234,19 @@ const Jr = ({
|
|
|
2123
2234
|
}
|
|
2124
2235
|
) }),
|
|
2125
2236
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-2 sm:flex-row", children: /* @__PURE__ */ r(
|
|
2126
|
-
|
|
2237
|
+
Qr,
|
|
2127
2238
|
{
|
|
2128
|
-
filteredHistory:
|
|
2129
|
-
setFilteredHistory:
|
|
2130
|
-
dispatch:
|
|
2239
|
+
filteredHistory: l,
|
|
2240
|
+
setFilteredHistory: g,
|
|
2241
|
+
dispatch: i,
|
|
2131
2242
|
onOpenChange: e
|
|
2132
2243
|
}
|
|
2133
2244
|
) })
|
|
2134
2245
|
] }) : null;
|
|
2135
|
-
},
|
|
2246
|
+
}, Jr = ({
|
|
2136
2247
|
open: e,
|
|
2137
|
-
onOpenChange: t
|
|
2138
|
-
|
|
2139
|
-
}) => /* @__PURE__ */ r(Z, { open: e, onOpenChange: t, title: Gt, children: /* @__PURE__ */ r(Jr, { onOpenChange: t, historyData: o }) });
|
|
2248
|
+
onOpenChange: t
|
|
2249
|
+
}) => /* @__PURE__ */ r(Y, { open: e, onOpenChange: t, title: Xt, children: /* @__PURE__ */ r(Xr, { onOpenChange: t }) });
|
|
2140
2250
|
/*!
|
|
2141
2251
|
@versini/ui-toggle v1.4.0
|
|
2142
2252
|
© 2024 gizmette.com
|
|
@@ -2213,7 +2323,7 @@ const tn = (e) => {
|
|
|
2213
2323
|
"border-border-light bg-surface-darker": e === "dark",
|
|
2214
2324
|
"border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium": e === "alt-system",
|
|
2215
2325
|
"border-border-dark bg-surface-medium dark:border-border-light dark:bg-surface-darker": e === "system"
|
|
2216
|
-
}),
|
|
2326
|
+
}), cn = ({
|
|
2217
2327
|
mode: e,
|
|
2218
2328
|
labelHidden: t
|
|
2219
2329
|
}) => t ? "sr-only" : C("ml-2 text-sm", {
|
|
@@ -2221,7 +2331,7 @@ const tn = (e) => {
|
|
|
2221
2331
|
"text-copy-lighter": e === "dark",
|
|
2222
2332
|
"text-copy-lighter dark:text-copy-dark": e === "alt-system",
|
|
2223
2333
|
"text-copy-dark dark:text-copy-lighter": e === "system"
|
|
2224
|
-
}),
|
|
2334
|
+
}), ln = ({ spacing: e }) => C(
|
|
2225
2335
|
en,
|
|
2226
2336
|
"relative flex cursor-pointer items-center",
|
|
2227
2337
|
tn(e)
|
|
@@ -2239,10 +2349,10 @@ const tn = (e) => {
|
|
|
2239
2349
|
an(),
|
|
2240
2350
|
nn()
|
|
2241
2351
|
),
|
|
2242
|
-
label:
|
|
2352
|
+
label: cn({ mode: e, labelHidden: o }),
|
|
2243
2353
|
input: "peer sr-only",
|
|
2244
|
-
wrapper:
|
|
2245
|
-
}),
|
|
2354
|
+
wrapper: ln({ spacing: n })
|
|
2355
|
+
}), oe = ({
|
|
2246
2356
|
checked: e = !1,
|
|
2247
2357
|
onChange: t,
|
|
2248
2358
|
label: o,
|
|
@@ -2250,51 +2360,51 @@ const tn = (e) => {
|
|
|
2250
2360
|
name: a,
|
|
2251
2361
|
mode: s = "system",
|
|
2252
2362
|
focusMode: i = "system",
|
|
2253
|
-
spacing:
|
|
2254
|
-
noBorder:
|
|
2363
|
+
spacing: c,
|
|
2364
|
+
noBorder: p = !1
|
|
2255
2365
|
}) => {
|
|
2256
|
-
const
|
|
2366
|
+
const m = dn({
|
|
2257
2367
|
mode: s,
|
|
2258
2368
|
focusMode: i,
|
|
2259
2369
|
labelHidden: n,
|
|
2260
|
-
spacing:
|
|
2261
|
-
noBorder:
|
|
2262
|
-
}),
|
|
2370
|
+
spacing: c,
|
|
2371
|
+
noBorder: p
|
|
2372
|
+
}), l = (g) => {
|
|
2263
2373
|
t == null || t(g.target.checked);
|
|
2264
2374
|
};
|
|
2265
|
-
return /* @__PURE__ */
|
|
2375
|
+
return /* @__PURE__ */ y("label", { className: m.wrapper, children: [
|
|
2266
2376
|
/* @__PURE__ */ r(
|
|
2267
2377
|
"input",
|
|
2268
2378
|
{
|
|
2269
2379
|
name: a,
|
|
2270
2380
|
checked: e,
|
|
2271
2381
|
type: "checkbox",
|
|
2272
|
-
className:
|
|
2273
|
-
onChange:
|
|
2382
|
+
className: m.input,
|
|
2383
|
+
onChange: l
|
|
2274
2384
|
}
|
|
2275
2385
|
),
|
|
2276
|
-
/* @__PURE__ */ r("div", { className:
|
|
2277
|
-
/* @__PURE__ */ r("span", { className:
|
|
2386
|
+
/* @__PURE__ */ r("div", { className: m.toggle }),
|
|
2387
|
+
/* @__PURE__ */ r("span", { className: m.label, children: o })
|
|
2278
2388
|
] });
|
|
2279
2389
|
}, un = ({
|
|
2280
2390
|
open: e,
|
|
2281
2391
|
onOpenChange: t
|
|
2282
2392
|
}) => {
|
|
2283
|
-
const { dispatch: o } =
|
|
2393
|
+
const { dispatch: o } = P(se), { getAccessToken: n, user: a } = W(), [s, i] = x({
|
|
2284
2394
|
loaded: !1,
|
|
2285
2395
|
instructions: "",
|
|
2286
2396
|
loadingLocation: !1,
|
|
2287
2397
|
location: "",
|
|
2288
|
-
engine:
|
|
2289
|
-
}), [
|
|
2290
|
-
key:
|
|
2398
|
+
engine: te
|
|
2399
|
+
}), [c, p] = ce({
|
|
2400
|
+
key: ie + ot,
|
|
2291
2401
|
initialValue: !1
|
|
2292
|
-
}),
|
|
2293
|
-
|
|
2402
|
+
}), m = async (h) => {
|
|
2403
|
+
h.preventDefault();
|
|
2294
2404
|
try {
|
|
2295
|
-
await
|
|
2405
|
+
await V({
|
|
2296
2406
|
accessToken: await n(),
|
|
2297
|
-
type:
|
|
2407
|
+
type: D.SET_USER_PREFERENCES,
|
|
2298
2408
|
params: {
|
|
2299
2409
|
user: a == null ? void 0 : a.username,
|
|
2300
2410
|
instructions: s.instructions,
|
|
@@ -2302,34 +2412,34 @@ const tn = (e) => {
|
|
|
2302
2412
|
engine: s.engine
|
|
2303
2413
|
}
|
|
2304
2414
|
}), o({
|
|
2305
|
-
type:
|
|
2415
|
+
type: rt,
|
|
2306
2416
|
payload: {
|
|
2307
2417
|
engine: s.engine
|
|
2308
2418
|
}
|
|
2309
2419
|
});
|
|
2310
2420
|
} catch {
|
|
2311
2421
|
}
|
|
2312
|
-
},
|
|
2313
|
-
i((
|
|
2314
|
-
...
|
|
2422
|
+
}, l = async () => {
|
|
2423
|
+
i((h) => ({
|
|
2424
|
+
...h,
|
|
2315
2425
|
location: "...",
|
|
2316
2426
|
loadingLocation: !0
|
|
2317
2427
|
}));
|
|
2318
2428
|
try {
|
|
2319
|
-
const
|
|
2429
|
+
const h = Date.now(), u = await eo(), d = await V({
|
|
2320
2430
|
accessToken: await n(),
|
|
2321
|
-
type:
|
|
2431
|
+
type: D.GET_LOCATION,
|
|
2322
2432
|
params: {
|
|
2323
|
-
latitude:
|
|
2324
|
-
longitude:
|
|
2433
|
+
latitude: u.latitude,
|
|
2434
|
+
longitude: u.longitude
|
|
2325
2435
|
}
|
|
2326
|
-
}), k = Date.now() -
|
|
2327
|
-
if (k < 2e3 && await new Promise((w) => setTimeout(w, 2e3 - k)),
|
|
2328
|
-
const { city: w, state:
|
|
2329
|
-
i((
|
|
2330
|
-
...
|
|
2436
|
+
}), k = Date.now() - h;
|
|
2437
|
+
if (k < 2e3 && await new Promise((w) => setTimeout(w, 2e3 - k)), d.status === 200) {
|
|
2438
|
+
const { city: w, state: I, country: E, displayName: R } = d.data, $ = w && I && E ? `${w}, ${I}, ${E}` : R;
|
|
2439
|
+
i((O) => ({
|
|
2440
|
+
...O,
|
|
2331
2441
|
loaded: !0,
|
|
2332
|
-
location:
|
|
2442
|
+
location: $,
|
|
2333
2443
|
loadingLocation: !1
|
|
2334
2444
|
}));
|
|
2335
2445
|
} else
|
|
@@ -2341,62 +2451,62 @@ const tn = (e) => {
|
|
|
2341
2451
|
}));
|
|
2342
2452
|
} catch {
|
|
2343
2453
|
}
|
|
2344
|
-
}, g = (
|
|
2345
|
-
i((
|
|
2346
|
-
...
|
|
2347
|
-
engine:
|
|
2454
|
+
}, g = (h) => {
|
|
2455
|
+
i((u) => ({
|
|
2456
|
+
...u,
|
|
2457
|
+
engine: h ? we : me
|
|
2348
2458
|
}));
|
|
2349
|
-
},
|
|
2350
|
-
i((
|
|
2351
|
-
...
|
|
2352
|
-
engine:
|
|
2459
|
+
}, v = (h) => {
|
|
2460
|
+
i((u) => ({
|
|
2461
|
+
...u,
|
|
2462
|
+
engine: h ? me : we
|
|
2353
2463
|
}));
|
|
2354
2464
|
};
|
|
2355
|
-
return
|
|
2465
|
+
return G(() => {
|
|
2356
2466
|
if (!e || !a) {
|
|
2357
2467
|
i({
|
|
2358
2468
|
loaded: !1,
|
|
2359
2469
|
loadingLocation: !1,
|
|
2360
2470
|
instructions: "",
|
|
2361
2471
|
location: "",
|
|
2362
|
-
engine:
|
|
2472
|
+
engine: te
|
|
2363
2473
|
});
|
|
2364
2474
|
return;
|
|
2365
2475
|
}
|
|
2366
2476
|
(async () => {
|
|
2367
2477
|
try {
|
|
2368
|
-
const
|
|
2478
|
+
const h = await V({
|
|
2369
2479
|
accessToken: await n(),
|
|
2370
|
-
type:
|
|
2480
|
+
type: D.GET_USER_PREFERENCES,
|
|
2371
2481
|
params: {
|
|
2372
2482
|
user: a.username
|
|
2373
2483
|
}
|
|
2374
2484
|
});
|
|
2375
|
-
|
|
2376
|
-
...
|
|
2485
|
+
h.status === 200 && i((u) => ({
|
|
2486
|
+
...u,
|
|
2377
2487
|
loaded: !0,
|
|
2378
|
-
instructions:
|
|
2379
|
-
location:
|
|
2380
|
-
engine:
|
|
2488
|
+
instructions: h.data.instructions || "",
|
|
2489
|
+
location: h.data.location || "",
|
|
2490
|
+
engine: h.data.engine || te
|
|
2381
2491
|
}));
|
|
2382
2492
|
} catch {
|
|
2383
2493
|
}
|
|
2384
2494
|
})();
|
|
2385
|
-
}, [a, e]), /* @__PURE__ */ r(
|
|
2386
|
-
|
|
2495
|
+
}, [a, e]), /* @__PURE__ */ r(S, { children: s.loaded && /* @__PURE__ */ r(
|
|
2496
|
+
Y,
|
|
2387
2497
|
{
|
|
2388
2498
|
open: e,
|
|
2389
2499
|
onOpenChange: t,
|
|
2390
2500
|
title: "Engine Fine Tuning",
|
|
2391
|
-
footer: /* @__PURE__ */
|
|
2392
|
-
|
|
2501
|
+
footer: /* @__PURE__ */ y(
|
|
2502
|
+
q,
|
|
2393
2503
|
{
|
|
2394
2504
|
columnGap: 2,
|
|
2395
2505
|
alignHorizontal: "flex-end",
|
|
2396
2506
|
className: "pb-8 sm:pb-0",
|
|
2397
2507
|
children: [
|
|
2398
|
-
/* @__PURE__ */ r(
|
|
2399
|
-
|
|
2508
|
+
/* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(
|
|
2509
|
+
F,
|
|
2400
2510
|
{
|
|
2401
2511
|
mode: "dark",
|
|
2402
2512
|
variant: "secondary",
|
|
@@ -2407,14 +2517,14 @@ const tn = (e) => {
|
|
|
2407
2517
|
children: "Cancel"
|
|
2408
2518
|
}
|
|
2409
2519
|
) }),
|
|
2410
|
-
/* @__PURE__ */ r(
|
|
2411
|
-
|
|
2520
|
+
/* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(
|
|
2521
|
+
F,
|
|
2412
2522
|
{
|
|
2413
2523
|
mode: "dark",
|
|
2414
2524
|
variant: "danger",
|
|
2415
2525
|
focusMode: "light",
|
|
2416
|
-
onClick: async (
|
|
2417
|
-
t(!1), await
|
|
2526
|
+
onClick: async (h) => {
|
|
2527
|
+
t(!1), await m(h);
|
|
2418
2528
|
},
|
|
2419
2529
|
children: "Save"
|
|
2420
2530
|
}
|
|
@@ -2422,65 +2532,65 @@ const tn = (e) => {
|
|
|
2422
2532
|
]
|
|
2423
2533
|
}
|
|
2424
2534
|
),
|
|
2425
|
-
children: /* @__PURE__ */
|
|
2426
|
-
/* @__PURE__ */
|
|
2427
|
-
|
|
2535
|
+
children: /* @__PURE__ */ y(S, { children: [
|
|
2536
|
+
/* @__PURE__ */ y(
|
|
2537
|
+
M,
|
|
2428
2538
|
{
|
|
2429
2539
|
header: "AI Engine",
|
|
2430
2540
|
className: "prose-dark dark:prose-lighter",
|
|
2431
2541
|
children: [
|
|
2432
2542
|
/* @__PURE__ */ r("p", { children: "Select the AI engine that will be used to generate responses." }),
|
|
2433
2543
|
/* @__PURE__ */ r(
|
|
2434
|
-
|
|
2544
|
+
oe,
|
|
2435
2545
|
{
|
|
2436
2546
|
noBorder: !0,
|
|
2437
2547
|
label: "OpenAI",
|
|
2438
2548
|
name: "OpenAI",
|
|
2439
2549
|
onChange: g,
|
|
2440
|
-
checked: s.engine ===
|
|
2550
|
+
checked: s.engine === we
|
|
2441
2551
|
}
|
|
2442
2552
|
),
|
|
2443
2553
|
/* @__PURE__ */ r(
|
|
2444
|
-
|
|
2554
|
+
oe,
|
|
2445
2555
|
{
|
|
2446
2556
|
spacing: { t: 2 },
|
|
2447
2557
|
noBorder: !0,
|
|
2448
2558
|
label: "Anthropic",
|
|
2449
2559
|
name: "Anthropic",
|
|
2450
|
-
onChange:
|
|
2451
|
-
checked: s.engine ===
|
|
2560
|
+
onChange: v,
|
|
2561
|
+
checked: s.engine === me
|
|
2452
2562
|
}
|
|
2453
2563
|
),
|
|
2454
2564
|
/* @__PURE__ */ r("p", { className: "text-xs", children: "NOTE: Anthropic is currently in beta and may not be as accurate as OpenAI." }),
|
|
2455
2565
|
/* @__PURE__ */ r(
|
|
2456
|
-
|
|
2566
|
+
oe,
|
|
2457
2567
|
{
|
|
2458
2568
|
spacing: { t: 2 },
|
|
2459
2569
|
noBorder: !0,
|
|
2460
2570
|
label: "Show Quick Engine Toggle",
|
|
2461
2571
|
name: "show-toggle-engine-menu",
|
|
2462
|
-
onChange:
|
|
2463
|
-
checked:
|
|
2572
|
+
onChange: p,
|
|
2573
|
+
checked: c
|
|
2464
2574
|
}
|
|
2465
2575
|
),
|
|
2466
2576
|
/* @__PURE__ */ r("p", { className: "text-xs", children: "This option introduces a new menu on the left side of the screen, enabling you to quickly switch between engines." })
|
|
2467
2577
|
]
|
|
2468
2578
|
}
|
|
2469
2579
|
),
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
|
|
2580
|
+
/* @__PURE__ */ y(
|
|
2581
|
+
M,
|
|
2472
2582
|
{
|
|
2473
2583
|
spacing: { t: 4 },
|
|
2474
2584
|
header: "Custom Instructions",
|
|
2475
2585
|
className: "prose-dark dark:prose-lighter",
|
|
2476
2586
|
children: [
|
|
2477
|
-
/* @__PURE__ */
|
|
2587
|
+
/* @__PURE__ */ y("p", { children: [
|
|
2478
2588
|
"What would you like ",
|
|
2479
|
-
/* @__PURE__ */ r("em", { children:
|
|
2589
|
+
/* @__PURE__ */ r("em", { children: Jt }),
|
|
2480
2590
|
" to know about you to provide better responses?"
|
|
2481
2591
|
] }),
|
|
2482
2592
|
/* @__PURE__ */ r(
|
|
2483
|
-
|
|
2593
|
+
Ge,
|
|
2484
2594
|
{
|
|
2485
2595
|
mode: "alt-system",
|
|
2486
2596
|
autoCapitalize: "off",
|
|
@@ -2489,11 +2599,11 @@ const tn = (e) => {
|
|
|
2489
2599
|
name: "customInstructions",
|
|
2490
2600
|
label: "Custom Instructions",
|
|
2491
2601
|
value: s.instructions,
|
|
2492
|
-
onChange: (
|
|
2493
|
-
i((
|
|
2494
|
-
...
|
|
2602
|
+
onChange: (h) => {
|
|
2603
|
+
i((u) => ({
|
|
2604
|
+
...u,
|
|
2495
2605
|
loaded: !0,
|
|
2496
|
-
instructions:
|
|
2606
|
+
instructions: h.target.value
|
|
2497
2607
|
}));
|
|
2498
2608
|
},
|
|
2499
2609
|
helperText: "Press ENTER to add a new line."
|
|
@@ -2502,8 +2612,8 @@ const tn = (e) => {
|
|
|
2502
2612
|
]
|
|
2503
2613
|
}
|
|
2504
2614
|
),
|
|
2505
|
-
/* @__PURE__ */
|
|
2506
|
-
|
|
2615
|
+
/* @__PURE__ */ y(
|
|
2616
|
+
M,
|
|
2507
2617
|
{
|
|
2508
2618
|
header: "Location",
|
|
2509
2619
|
className: "prose-dark dark:prose-lighter",
|
|
@@ -2511,30 +2621,30 @@ const tn = (e) => {
|
|
|
2511
2621
|
children: [
|
|
2512
2622
|
/* @__PURE__ */ r("p", { children: "You can share your location to receive customized responses based on your area." }),
|
|
2513
2623
|
/* @__PURE__ */ r(
|
|
2514
|
-
|
|
2624
|
+
Ge,
|
|
2515
2625
|
{
|
|
2516
2626
|
mode: "alt-system",
|
|
2517
2627
|
name: "location",
|
|
2518
2628
|
label: "Location",
|
|
2519
2629
|
value: s.location,
|
|
2520
|
-
onChange: (
|
|
2521
|
-
i((
|
|
2522
|
-
...
|
|
2630
|
+
onChange: (h) => {
|
|
2631
|
+
i((u) => ({
|
|
2632
|
+
...u,
|
|
2523
2633
|
loaded: !0,
|
|
2524
|
-
location:
|
|
2634
|
+
location: h.target.value
|
|
2525
2635
|
}));
|
|
2526
2636
|
},
|
|
2527
2637
|
helperText: "Enter your location or press auto-detect."
|
|
2528
2638
|
}
|
|
2529
2639
|
),
|
|
2530
2640
|
/* @__PURE__ */ r(
|
|
2531
|
-
|
|
2641
|
+
F,
|
|
2532
2642
|
{
|
|
2533
2643
|
spacing: { t: 2 },
|
|
2534
2644
|
size: "small",
|
|
2535
2645
|
noBorder: !0,
|
|
2536
2646
|
disabled: s.loadingLocation,
|
|
2537
|
-
onClick:
|
|
2647
|
+
onClick: l,
|
|
2538
2648
|
children: s.loadingLocation ? "Detecting..." : "Auto-detect"
|
|
2539
2649
|
}
|
|
2540
2650
|
)
|
|
@@ -2548,41 +2658,41 @@ const tn = (e) => {
|
|
|
2548
2658
|
open: e,
|
|
2549
2659
|
onOpenChange: t
|
|
2550
2660
|
}) => {
|
|
2551
|
-
const { state: o, dispatch: n } =
|
|
2661
|
+
const { state: o, dispatch: n } = P(to), { getAccessToken: a, user: s } = W(), [i, c] = x({
|
|
2552
2662
|
tags: [...o.tags]
|
|
2553
|
-
}),
|
|
2554
|
-
slot:
|
|
2663
|
+
}), p = ({
|
|
2664
|
+
slot: l,
|
|
2555
2665
|
checked: g,
|
|
2556
|
-
label:
|
|
2557
|
-
content:
|
|
2666
|
+
label: v,
|
|
2667
|
+
content: h
|
|
2558
2668
|
}) => {
|
|
2559
|
-
|
|
2560
|
-
const
|
|
2561
|
-
slot:
|
|
2562
|
-
label:
|
|
2563
|
-
content:
|
|
2669
|
+
c((u) => {
|
|
2670
|
+
const d = u.tags, b = {
|
|
2671
|
+
slot: l,
|
|
2672
|
+
label: v,
|
|
2673
|
+
content: h,
|
|
2564
2674
|
enabled: g
|
|
2565
|
-
}, k =
|
|
2675
|
+
}, k = d.findIndex((w) => w.slot === l);
|
|
2566
2676
|
return k === -1 ? {
|
|
2567
|
-
...
|
|
2568
|
-
tags: [...
|
|
2569
|
-
} : (
|
|
2570
|
-
...
|
|
2571
|
-
tags: [...
|
|
2677
|
+
...u,
|
|
2678
|
+
tags: [...d, { ...b, slot: l }]
|
|
2679
|
+
} : (d[k] = b, {
|
|
2680
|
+
...u,
|
|
2681
|
+
tags: [...d]
|
|
2572
2682
|
});
|
|
2573
2683
|
});
|
|
2574
|
-
},
|
|
2575
|
-
|
|
2684
|
+
}, m = async (l) => {
|
|
2685
|
+
l.preventDefault();
|
|
2576
2686
|
try {
|
|
2577
|
-
await
|
|
2687
|
+
await V({
|
|
2578
2688
|
accessToken: await a(),
|
|
2579
|
-
type:
|
|
2689
|
+
type: D.SET_USER_PREFERENCES,
|
|
2580
2690
|
params: {
|
|
2581
2691
|
user: s == null ? void 0 : s.username,
|
|
2582
2692
|
tags: i.tags
|
|
2583
2693
|
}
|
|
2584
2694
|
}), n({
|
|
2585
|
-
type:
|
|
2695
|
+
type: ro,
|
|
2586
2696
|
payload: {
|
|
2587
2697
|
tags: i.tags
|
|
2588
2698
|
}
|
|
@@ -2590,21 +2700,21 @@ const tn = (e) => {
|
|
|
2590
2700
|
} catch {
|
|
2591
2701
|
}
|
|
2592
2702
|
};
|
|
2593
|
-
return /* @__PURE__ */
|
|
2594
|
-
|
|
2703
|
+
return /* @__PURE__ */ y(
|
|
2704
|
+
Y,
|
|
2595
2705
|
{
|
|
2596
2706
|
open: e,
|
|
2597
2707
|
onOpenChange: t,
|
|
2598
2708
|
title: "Tags",
|
|
2599
|
-
footer: /* @__PURE__ */
|
|
2600
|
-
|
|
2709
|
+
footer: /* @__PURE__ */ y(
|
|
2710
|
+
q,
|
|
2601
2711
|
{
|
|
2602
2712
|
columnGap: 2,
|
|
2603
2713
|
alignHorizontal: "flex-end",
|
|
2604
2714
|
className: "pb-8 sm:pb-0",
|
|
2605
2715
|
children: [
|
|
2606
|
-
/* @__PURE__ */ r(
|
|
2607
|
-
|
|
2716
|
+
/* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(
|
|
2717
|
+
F,
|
|
2608
2718
|
{
|
|
2609
2719
|
mode: "dark",
|
|
2610
2720
|
variant: "secondary",
|
|
@@ -2615,14 +2725,14 @@ const tn = (e) => {
|
|
|
2615
2725
|
children: "Cancel"
|
|
2616
2726
|
}
|
|
2617
2727
|
) }),
|
|
2618
|
-
/* @__PURE__ */ r(
|
|
2619
|
-
|
|
2728
|
+
/* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(
|
|
2729
|
+
F,
|
|
2620
2730
|
{
|
|
2621
2731
|
mode: "dark",
|
|
2622
2732
|
variant: "danger",
|
|
2623
2733
|
focusMode: "light",
|
|
2624
|
-
onClick: async (
|
|
2625
|
-
t(!1), await
|
|
2734
|
+
onClick: async (l) => {
|
|
2735
|
+
t(!1), await m(l);
|
|
2626
2736
|
},
|
|
2627
2737
|
children: "Save"
|
|
2628
2738
|
}
|
|
@@ -2631,42 +2741,42 @@ const tn = (e) => {
|
|
|
2631
2741
|
}
|
|
2632
2742
|
),
|
|
2633
2743
|
children: [
|
|
2634
|
-
/* @__PURE__ */ r("p", { children:
|
|
2635
|
-
i.tags && i.tags.map((
|
|
2636
|
-
|
|
2744
|
+
/* @__PURE__ */ r("p", { children: oo }),
|
|
2745
|
+
i.tags && i.tags.map((l) => /* @__PURE__ */ y(
|
|
2746
|
+
M,
|
|
2637
2747
|
{
|
|
2638
|
-
header: `Tag ${
|
|
2748
|
+
header: `Tag ${l.slot + 1}`,
|
|
2639
2749
|
className: "prose-dark dark:prose-lighter",
|
|
2640
2750
|
spacing: { b: 2 },
|
|
2641
2751
|
children: [
|
|
2642
|
-
/* @__PURE__ */
|
|
2643
|
-
/* @__PURE__ */ r(
|
|
2644
|
-
|
|
2752
|
+
/* @__PURE__ */ y(q, { spacing: { t: 8, b: 6 }, columnGap: 2, rowGap: 6, children: [
|
|
2753
|
+
/* @__PURE__ */ r(A, { span: { fallback: 12, sm: 6 }, children: /* @__PURE__ */ r(
|
|
2754
|
+
Te,
|
|
2645
2755
|
{
|
|
2646
2756
|
label: "Label",
|
|
2647
|
-
name: `tag${
|
|
2648
|
-
value:
|
|
2757
|
+
name: `tag${l.slot}-label`,
|
|
2758
|
+
value: l.label,
|
|
2649
2759
|
onChange: (g) => {
|
|
2650
|
-
|
|
2651
|
-
slot:
|
|
2652
|
-
checked:
|
|
2760
|
+
p({
|
|
2761
|
+
slot: l.slot,
|
|
2762
|
+
checked: l.enabled,
|
|
2653
2763
|
label: g.target.value,
|
|
2654
|
-
content:
|
|
2764
|
+
content: l.content
|
|
2655
2765
|
});
|
|
2656
2766
|
}
|
|
2657
2767
|
}
|
|
2658
2768
|
) }),
|
|
2659
|
-
/* @__PURE__ */ r(
|
|
2660
|
-
|
|
2769
|
+
/* @__PURE__ */ r(A, { span: { fallback: 12, sm: 6 }, children: /* @__PURE__ */ r(
|
|
2770
|
+
Te,
|
|
2661
2771
|
{
|
|
2662
2772
|
label: "Content",
|
|
2663
|
-
name: `tag${
|
|
2664
|
-
value:
|
|
2773
|
+
name: `tag${l.slot}-content`,
|
|
2774
|
+
value: l.content,
|
|
2665
2775
|
onChange: (g) => {
|
|
2666
|
-
|
|
2667
|
-
slot:
|
|
2668
|
-
checked:
|
|
2669
|
-
label:
|
|
2776
|
+
p({
|
|
2777
|
+
slot: l.slot,
|
|
2778
|
+
checked: l.enabled,
|
|
2779
|
+
label: l.label,
|
|
2670
2780
|
content: g.target.value
|
|
2671
2781
|
});
|
|
2672
2782
|
}
|
|
@@ -2674,87 +2784,87 @@ const tn = (e) => {
|
|
|
2674
2784
|
) })
|
|
2675
2785
|
] }),
|
|
2676
2786
|
/* @__PURE__ */ r(
|
|
2677
|
-
|
|
2787
|
+
oe,
|
|
2678
2788
|
{
|
|
2679
2789
|
spacing: { t: 2 },
|
|
2680
2790
|
noBorder: !0,
|
|
2681
2791
|
label: "Enabled",
|
|
2682
|
-
name:
|
|
2792
|
+
name: l.slot.toString(),
|
|
2683
2793
|
onChange: (g) => {
|
|
2684
|
-
|
|
2685
|
-
slot:
|
|
2794
|
+
p({
|
|
2795
|
+
slot: l.slot,
|
|
2686
2796
|
checked: g,
|
|
2687
|
-
label:
|
|
2688
|
-
content:
|
|
2797
|
+
label: l.label,
|
|
2798
|
+
content: l.content
|
|
2689
2799
|
});
|
|
2690
2800
|
},
|
|
2691
|
-
checked:
|
|
2801
|
+
checked: l.enabled
|
|
2692
2802
|
}
|
|
2693
2803
|
)
|
|
2694
2804
|
]
|
|
2695
2805
|
},
|
|
2696
|
-
`tag-slot-${
|
|
2806
|
+
`tag-slot-${l.slot}`
|
|
2697
2807
|
))
|
|
2698
2808
|
]
|
|
2699
2809
|
}
|
|
2700
2810
|
);
|
|
2701
2811
|
}, hn = () => {
|
|
2702
|
-
const { isAuthenticated: e, user: t, registeringForPasskey: o, authenticationType: n } =
|
|
2703
|
-
key:
|
|
2812
|
+
const { isAuthenticated: e, user: t, registeringForPasskey: o, authenticationType: n } = W(), [a, s] = ce({
|
|
2813
|
+
key: ie + no,
|
|
2704
2814
|
initialValue: !1
|
|
2705
|
-
}), [i,
|
|
2706
|
-
s(
|
|
2815
|
+
}), [i, c] = x(!1), [p, m] = x(!1), l = ne(), g = (t == null ? void 0 : t.username) || "", v = (d) => {
|
|
2816
|
+
s(d);
|
|
2817
|
+
}, h = () => {
|
|
2818
|
+
c(!i);
|
|
2707
2819
|
}, u = () => {
|
|
2708
|
-
|
|
2709
|
-
}, m = () => {
|
|
2710
|
-
d(!h);
|
|
2820
|
+
m(!p);
|
|
2711
2821
|
};
|
|
2712
|
-
return e && g ? /* @__PURE__ */
|
|
2822
|
+
return e && g ? /* @__PURE__ */ y(S, { children: [
|
|
2713
2823
|
i && /* @__PURE__ */ r(
|
|
2714
2824
|
un,
|
|
2715
2825
|
{
|
|
2716
2826
|
open: i,
|
|
2717
|
-
onOpenChange:
|
|
2827
|
+
onOpenChange: c
|
|
2718
2828
|
}
|
|
2719
2829
|
),
|
|
2720
|
-
|
|
2721
|
-
/* @__PURE__ */
|
|
2722
|
-
|
|
2830
|
+
p && /* @__PURE__ */ r(mn, { open: p, onOpenChange: m }),
|
|
2831
|
+
/* @__PURE__ */ y(
|
|
2832
|
+
M,
|
|
2723
2833
|
{
|
|
2724
|
-
header:
|
|
2834
|
+
header: T.PREFERENCES.TITLE,
|
|
2725
2835
|
className: "prose-dark dark:prose-lighter",
|
|
2726
2836
|
children: [
|
|
2727
|
-
|
|
2728
|
-
[
|
|
2729
|
-
[
|
|
2730
|
-
[
|
|
2731
|
-
|
|
2837
|
+
re(l, {
|
|
2838
|
+
[T.PREFERENCES.NAME]: g,
|
|
2839
|
+
[T.PREFERENCES.EMAIL]: (t == null ? void 0 : t.email) || "",
|
|
2840
|
+
[T.PREFERENCES.ENGINE_DETAILS]: /* @__PURE__ */ r(
|
|
2841
|
+
oe,
|
|
2732
2842
|
{
|
|
2733
2843
|
noBorder: !0,
|
|
2734
2844
|
labelHidden: !0,
|
|
2735
|
-
label:
|
|
2736
|
-
name:
|
|
2737
|
-
onChange:
|
|
2845
|
+
label: T.PREFERENCES.ENGINE_DETAILS,
|
|
2846
|
+
name: T.PREFERENCES.ENGINE_DETAILS,
|
|
2847
|
+
onChange: v,
|
|
2738
2848
|
checked: a
|
|
2739
2849
|
}
|
|
2740
2850
|
)
|
|
2741
2851
|
}),
|
|
2742
2852
|
/* @__PURE__ */ r(
|
|
2743
|
-
|
|
2853
|
+
j,
|
|
2744
2854
|
{
|
|
2745
2855
|
spacing: { t: 2 },
|
|
2746
2856
|
size: "small",
|
|
2747
|
-
onClick:
|
|
2857
|
+
onClick: h,
|
|
2748
2858
|
labelLeft: "Engine Fine Tuning",
|
|
2749
2859
|
children: /* @__PURE__ */ r(He, { className: "size-3", monotone: !0 })
|
|
2750
2860
|
}
|
|
2751
2861
|
),
|
|
2752
2862
|
/* @__PURE__ */ r(
|
|
2753
|
-
|
|
2863
|
+
j,
|
|
2754
2864
|
{
|
|
2755
2865
|
spacing: { t: 2, l: 2 },
|
|
2756
2866
|
size: "small",
|
|
2757
|
-
onClick:
|
|
2867
|
+
onClick: u,
|
|
2758
2868
|
labelLeft: "Tags",
|
|
2759
2869
|
children: /* @__PURE__ */ r(He, { className: "size-3", monotone: !0 })
|
|
2760
2870
|
}
|
|
@@ -2762,24 +2872,24 @@ const tn = (e) => {
|
|
|
2762
2872
|
]
|
|
2763
2873
|
}
|
|
2764
2874
|
),
|
|
2765
|
-
n !==
|
|
2766
|
-
|
|
2875
|
+
n !== ao.PASSKEY && /* @__PURE__ */ y(
|
|
2876
|
+
M,
|
|
2767
2877
|
{
|
|
2768
2878
|
spacing: { t: 4 },
|
|
2769
2879
|
className: "prose-dark dark:prose-lighter",
|
|
2770
|
-
header: /* @__PURE__ */ r("h2", { className: "m-0", children: /* @__PURE__ */
|
|
2771
|
-
/* @__PURE__ */ r(
|
|
2772
|
-
/* @__PURE__ */ r(
|
|
2880
|
+
header: /* @__PURE__ */ r("h2", { className: "m-0", children: /* @__PURE__ */ y(q, { columnGap: 3, alignVertical: "center", children: [
|
|
2881
|
+
/* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(ze, { className: "size-8" }) }),
|
|
2882
|
+
/* @__PURE__ */ r(A, { children: /* @__PURE__ */ r("div", { children: T.PREFERENCES.PASSKEY_TITLE }) })
|
|
2773
2883
|
] }) }),
|
|
2774
2884
|
children: [
|
|
2775
|
-
/* @__PURE__ */ r("p", { children:
|
|
2885
|
+
/* @__PURE__ */ r("p", { children: T.PREFERENCES.PASSKEY_INSTRUCTIONS }),
|
|
2776
2886
|
/* @__PURE__ */ r(
|
|
2777
|
-
|
|
2887
|
+
j,
|
|
2778
2888
|
{
|
|
2779
2889
|
size: "small",
|
|
2780
2890
|
spacing: { t: 2 },
|
|
2781
2891
|
onClick: o,
|
|
2782
|
-
labelLeft:
|
|
2892
|
+
labelLeft: T.PREFERENCES.PASSKEY_BUTTON,
|
|
2783
2893
|
children: /* @__PURE__ */ r(ze, { className: "size-5", monotone: !0 })
|
|
2784
2894
|
}
|
|
2785
2895
|
)
|
|
@@ -2790,171 +2900,130 @@ const tn = (e) => {
|
|
|
2790
2900
|
}, pn = ({
|
|
2791
2901
|
open: e,
|
|
2792
2902
|
onOpenChange: t
|
|
2793
|
-
}) => /* @__PURE__ */ r(
|
|
2794
|
-
const { state: e, dispatch: t, serverStats: o } =
|
|
2795
|
-
|
|
2796
|
-
progress: !1,
|
|
2797
|
-
timestamp: Date.now()
|
|
2798
|
-
}), [T] = he({
|
|
2799
|
-
key: me + et,
|
|
2903
|
+
}) => /* @__PURE__ */ r(Y, { open: e, onOpenChange: t, title: so, children: /* @__PURE__ */ r(hn, {}) }), wn = () => {
|
|
2904
|
+
const { state: e, dispatch: t, serverStats: o } = P(se), [n, a] = x((e == null ? void 0 : e.engine) || te), [s, i] = x(!1), [c, p] = x(!1), [m, l] = x(!1), [g, v] = x(!1), [h, u] = x(!1), [d] = ce({
|
|
2905
|
+
key: ie + ot,
|
|
2800
2906
|
initialValue: !1
|
|
2801
|
-
}), { logout:
|
|
2907
|
+
}), { logout: b, getAccessToken: k, user: w } = W(), I = () => {
|
|
2802
2908
|
i(!s);
|
|
2803
|
-
},
|
|
2804
|
-
|
|
2805
|
-
},
|
|
2806
|
-
|
|
2807
|
-
},
|
|
2808
|
-
|
|
2809
|
-
},
|
|
2810
|
-
|
|
2811
|
-
if (P && !(!S || !e || k.progress || k.done === !0 && j - k.timestamp < 5e3)) {
|
|
2812
|
-
w({
|
|
2813
|
-
done: !0,
|
|
2814
|
-
progress: !0,
|
|
2815
|
-
timestamp: j
|
|
2816
|
-
});
|
|
2817
|
-
try {
|
|
2818
|
-
const R = await D({
|
|
2819
|
-
accessToken: await M(),
|
|
2820
|
-
type: H.GET_CHATS,
|
|
2821
|
-
params: {
|
|
2822
|
-
userId: S.username
|
|
2823
|
-
}
|
|
2824
|
-
});
|
|
2825
|
-
R.status === 200 && (m(R.data), w({
|
|
2826
|
-
done: !0,
|
|
2827
|
-
progress: !1,
|
|
2828
|
-
timestamp: Date.now()
|
|
2829
|
-
}));
|
|
2830
|
-
} catch {
|
|
2831
|
-
w({
|
|
2832
|
-
done: !0,
|
|
2833
|
-
progress: !1,
|
|
2834
|
-
timestamp: Date.now()
|
|
2835
|
-
});
|
|
2836
|
-
}
|
|
2837
|
-
}
|
|
2838
|
-
}, oe = () => {
|
|
2839
|
-
p(!f);
|
|
2909
|
+
}, E = () => {
|
|
2910
|
+
p(!c);
|
|
2911
|
+
}, R = () => {
|
|
2912
|
+
l(!m);
|
|
2913
|
+
}, $ = () => {
|
|
2914
|
+
v(!g);
|
|
2915
|
+
}, O = () => {
|
|
2916
|
+
u(!h);
|
|
2840
2917
|
};
|
|
2841
|
-
return
|
|
2918
|
+
return G(() => {
|
|
2842
2919
|
e && e.engine && e.engine !== n && a(e.engine);
|
|
2843
|
-
}, [e, n]), /* @__PURE__ */
|
|
2920
|
+
}, [e, n]), /* @__PURE__ */ y(S, { children: [
|
|
2844
2921
|
/* @__PURE__ */ r(
|
|
2845
|
-
|
|
2922
|
+
Ot,
|
|
2846
2923
|
{
|
|
2847
|
-
showConfirmation:
|
|
2848
|
-
setShowConfirmation:
|
|
2849
|
-
action:
|
|
2924
|
+
showConfirmation: h,
|
|
2925
|
+
setShowConfirmation: u,
|
|
2926
|
+
action: b,
|
|
2850
2927
|
customStrings: {
|
|
2851
|
-
confirmAction:
|
|
2928
|
+
confirmAction: Fe,
|
|
2852
2929
|
cancelAction: "Cancel",
|
|
2853
|
-
title:
|
|
2930
|
+
title: Fe
|
|
2854
2931
|
},
|
|
2855
2932
|
children: /* @__PURE__ */ r("p", { children: "Are you sure you want to log out?" })
|
|
2856
2933
|
}
|
|
2857
2934
|
),
|
|
2858
2935
|
/* @__PURE__ */ r(pn, { open: s, onOpenChange: i }),
|
|
2859
|
-
/* @__PURE__ */ r(qr, { open:
|
|
2860
|
-
/* @__PURE__ */ r(
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
historyData: u
|
|
2866
|
-
}
|
|
2867
|
-
),
|
|
2868
|
-
/* @__PURE__ */ r(jr, { open: g, onOpenChange: y }),
|
|
2869
|
-
/* @__PURE__ */ v("div", { className: "relative", children: [
|
|
2870
|
-
T && o && /* @__PURE__ */ r("div", { className: "absolute bottom-[-28px] left-[-7px]", children: /* @__PURE__ */ r(
|
|
2871
|
-
xe,
|
|
2936
|
+
/* @__PURE__ */ r(qr, { open: c, onOpenChange: p }),
|
|
2937
|
+
/* @__PURE__ */ r(Jr, { open: m, onOpenChange: l }),
|
|
2938
|
+
/* @__PURE__ */ r(jr, { open: g, onOpenChange: v }),
|
|
2939
|
+
/* @__PURE__ */ y("div", { className: "relative", children: [
|
|
2940
|
+
d && o && /* @__PURE__ */ r("div", { className: "absolute bottom-[-28px] left-[-7px]", children: /* @__PURE__ */ r(
|
|
2941
|
+
Ee,
|
|
2872
2942
|
{
|
|
2873
2943
|
mode: "dark",
|
|
2874
2944
|
focusMode: "light",
|
|
2875
|
-
trigger: /* @__PURE__ */ r(
|
|
2945
|
+
trigger: /* @__PURE__ */ r(j, { children: e && e.engine === me ? /* @__PURE__ */ r(pt, {}) : /* @__PURE__ */ r(gt, {}) }),
|
|
2876
2946
|
defaultPlacement: "bottom-start",
|
|
2877
|
-
children: /* @__PURE__ */ r(
|
|
2878
|
-
|
|
2947
|
+
children: /* @__PURE__ */ r(H, { raw: !0, ignoreClick: !0, children: /* @__PURE__ */ r(
|
|
2948
|
+
Cr,
|
|
2879
2949
|
{
|
|
2880
2950
|
size: "small",
|
|
2881
2951
|
mode: "dark",
|
|
2882
2952
|
focusMode: "light",
|
|
2883
2953
|
value: n,
|
|
2884
|
-
onValueChange: async (
|
|
2885
|
-
if (
|
|
2954
|
+
onValueChange: async (N) => {
|
|
2955
|
+
if (N)
|
|
2886
2956
|
try {
|
|
2887
|
-
await
|
|
2888
|
-
accessToken: await
|
|
2889
|
-
type:
|
|
2957
|
+
await V({
|
|
2958
|
+
accessToken: await k(),
|
|
2959
|
+
type: D.SET_USER_PREFERENCES,
|
|
2890
2960
|
params: {
|
|
2891
|
-
user:
|
|
2892
|
-
engine:
|
|
2961
|
+
user: w == null ? void 0 : w.username,
|
|
2962
|
+
engine: N
|
|
2893
2963
|
}
|
|
2894
2964
|
}), t({
|
|
2895
|
-
type:
|
|
2965
|
+
type: rt,
|
|
2896
2966
|
payload: {
|
|
2897
|
-
engine:
|
|
2967
|
+
engine: N
|
|
2898
2968
|
}
|
|
2899
2969
|
}), t({
|
|
2900
|
-
type:
|
|
2970
|
+
type: tt
|
|
2901
2971
|
});
|
|
2902
2972
|
} catch {
|
|
2903
2973
|
}
|
|
2904
2974
|
},
|
|
2905
|
-
children: o && o.engines.map((
|
|
2975
|
+
children: o && o.engines.map((N) => /* @__PURE__ */ r(wr, { value: N }, N))
|
|
2906
2976
|
}
|
|
2907
2977
|
) })
|
|
2908
2978
|
}
|
|
2909
2979
|
) }),
|
|
2910
|
-
/* @__PURE__ */ r("div", { className: "absolute bottom-[-28px] right-[-7px]", children: /* @__PURE__ */
|
|
2911
|
-
|
|
2980
|
+
/* @__PURE__ */ r("div", { className: "absolute bottom-[-28px] right-[-7px]", children: /* @__PURE__ */ y(
|
|
2981
|
+
Ee,
|
|
2912
2982
|
{
|
|
2913
2983
|
mode: "dark",
|
|
2914
2984
|
focusMode: "light",
|
|
2915
|
-
trigger: /* @__PURE__ */ r(
|
|
2985
|
+
trigger: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(Ao, {}) }),
|
|
2916
2986
|
defaultPlacement: "bottom-end",
|
|
2917
|
-
onOpenChange: U,
|
|
2918
2987
|
children: [
|
|
2919
2988
|
/* @__PURE__ */ r(
|
|
2920
|
-
|
|
2989
|
+
H,
|
|
2921
2990
|
{
|
|
2922
2991
|
label: "Profile",
|
|
2923
|
-
onClick:
|
|
2924
|
-
icon: /* @__PURE__ */ r(
|
|
2992
|
+
onClick: I,
|
|
2993
|
+
icon: /* @__PURE__ */ r(So, {})
|
|
2925
2994
|
}
|
|
2926
2995
|
),
|
|
2927
2996
|
/* @__PURE__ */ r(
|
|
2928
|
-
|
|
2997
|
+
H,
|
|
2929
2998
|
{
|
|
2930
|
-
label:
|
|
2931
|
-
onClick:
|
|
2932
|
-
icon: /* @__PURE__ */ r(
|
|
2999
|
+
label: Je,
|
|
3000
|
+
onClick: E,
|
|
3001
|
+
icon: /* @__PURE__ */ r(To, {})
|
|
2933
3002
|
}
|
|
2934
3003
|
),
|
|
2935
3004
|
/* @__PURE__ */ r(
|
|
2936
|
-
|
|
3005
|
+
H,
|
|
2937
3006
|
{
|
|
2938
3007
|
label: "History",
|
|
2939
|
-
onClick:
|
|
2940
|
-
icon: /* @__PURE__ */ r(
|
|
3008
|
+
onClick: R,
|
|
3009
|
+
icon: /* @__PURE__ */ r(Eo, {})
|
|
2941
3010
|
}
|
|
2942
3011
|
),
|
|
2943
3012
|
/* @__PURE__ */ r(
|
|
2944
|
-
|
|
3013
|
+
H,
|
|
2945
3014
|
{
|
|
2946
3015
|
label: "About",
|
|
2947
|
-
onClick:
|
|
2948
|
-
icon: /* @__PURE__ */ r(
|
|
3016
|
+
onClick: $,
|
|
3017
|
+
icon: /* @__PURE__ */ r(xo, {})
|
|
2949
3018
|
}
|
|
2950
3019
|
),
|
|
2951
|
-
e && e.id && !e.isComponent && /* @__PURE__ */
|
|
2952
|
-
/* @__PURE__ */ r(
|
|
3020
|
+
e && e.id && !e.isComponent && /* @__PURE__ */ y(S, { children: [
|
|
3021
|
+
/* @__PURE__ */ r(Mo, {}),
|
|
2953
3022
|
/* @__PURE__ */ r(
|
|
2954
|
-
|
|
3023
|
+
H,
|
|
2955
3024
|
{
|
|
2956
3025
|
label: "Log out",
|
|
2957
|
-
onClick:
|
|
3026
|
+
onClick: O,
|
|
2958
3027
|
icon: /* @__PURE__ */ r("div", { className: "text-red-700", children: /* @__PURE__ */ r(Io, { monotone: !0 }) })
|
|
2959
3028
|
}
|
|
2960
3029
|
)
|