@versini/sassysaint 8.33.4 → 8.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AboutChangelog.ORkq454o.js → AboutChangelog.cIy_LdZE.js} +2 -2
- package/dist/chunks/{AboutEntry.BGlGd-JE.js → AboutEntry.CMvo-j5s.js} +8 -8
- package/dist/chunks/{App.B8I-Bynx.js → App.CxyIxMAe.js} +812 -795
- package/dist/chunks/{Chart.AapZuIW5.js → Chart.CYfLEQow.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.DF4lsIZY.js → ChatBubbleAssistant.Q0TKW7i_.js} +3 -3
- package/dist/chunks/HistoryEntry.C5m-7h3b.js +446 -0
- package/dist/chunks/{LNWAZHJI.C6kP9Qzn.js → LNWAZHJI.COg-zQKp.js} +1 -1
- package/dist/chunks/{ProfileEntry.CK-4l2mc.js → ProfileEntry.BtERQFK4.js} +2 -2
- package/dist/chunks/{SettingsEntry.CRrXxfN_.js → SettingsEntry.CHj1q4Pe.js} +2 -2
- package/dist/chunks/{UsageEntry.id6voo6W.js → UsageEntry.BglkGISL.js} +3 -3
- package/dist/chunks/{index.DLzHD9rm.js → index.ALcXlUu1.js} +1 -1
- package/dist/chunks/{index.DnwBNBLb.js → index.CeAv-M6m.js} +1 -1
- package/dist/chunks/{index.Czf9axok.js → index.DK5aa0OB.js} +2 -2
- package/dist/chunks/{index.Der377Cc.js → index.DNY9KnJU.js} +1 -1
- package/dist/chunks/{index.B9xSfw2G.js → index.DakkVauF.js} +3 -3
- package/dist/chunks/{index.DCBiERjz.js → index.Tr_z3XM6.js} +2 -2
- package/dist/chunks/{useMarkdown.C30sAbJt.js → useMarkdown.wo8gOuZw.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
- package/dist/chunks/HistoryEntry.I611L02L.js +0 -423
@@ -1,12 +1,12 @@
|
|
1
1
|
import { jsx as i, jsxs as T, Fragment as ue } from "react/jsx-runtime";
|
2
|
-
import { Subscribable as ho, pendingThenable as
|
2
|
+
import { Subscribable as ho, pendingThenable as Ea, resolveEnabled as ke, shallowEqualObjects as kr, resolveStaleTime as gt, noop as _r, isServer as Sr, isValidTimeout as ka, focusManager as fo, fetchState as mo, replaceData as _a, notifyManager as Sn, timeUntilStale as po, shouldThrowError as go, useQueryClient as yo, I as re, ACTION_SORT as bo, ACTION_SEARCH as vo, ACTION_RESET_PROMPT as Tn, ACTION_TOGGLE_PROMPT as Cn, le as Ce, DEFAULT_ICON_ACTION_SIZE as Te, isTauri as Wt, n as Ve, isProbablyiPhone as Ae, L as In, j as yt, C as Sa, LOCAL_STORAGE_PREFIX as jt, LOCAL_STORAGE_PRIVATE_DISCLOSURE as wo, LOCAL_STORAGE_REASONING_DISCLOSURE as Eo, TOAST_CHAT_SAVED as ko, TOAST_PROVIDER_CHANGED as _o, PROMPT_CLASSNAME as So, PROMPT_EDITABLE_AREA_CLASSNAME as To, ERROR_MESSAGE as Co, ROLE_INTERNAL as Tr, CLIPBOARD_PROMPT as Ta, isProbablyMobile as Je, INPUT_PLACEHOLDER_TEXT_MOBILE as Ca, INPUT_PLACEHOLDER_TEXT_ENTER as Ia, INPUT_PLACEHOLDER_TEXT_CMD_ENTER as xa, FOOTER_DISCLAIMERS as Ra, INPUT_BOTTOM_OFFSET_EXTRA as Io, INPUT_BOTTOM_OFFSET_IPHONE as xo, INPUT_BOTTOM_OFFSET as xn, LOG_OUT as Aa, getMessageContaintWrapperClass as Ro, UI_FOOTER_BUFFER as Rn, UI_BUTTON_SCROLL_BUFFER as Ao, Logo as No, UI_DEFAULT_MAIN_HEIGHT as Na, APP_CLASSNAME as Oo, getMainPaddingClass as Oa, r as $o, LOCAL_STORAGE_SORT as Po, LOCAL_STORAGE_SEARCH as Mo } from "./index.DK5aa0OB.js";
|
3
3
|
import * as Y from "react";
|
4
|
-
import Z, { useEffect as $, useRef as R, useState as z, useCallback as V, useSyncExternalStore as Lo, useMemo as he, useId as
|
4
|
+
import Z, { useEffect as $, useRef as R, useState as z, useCallback as V, useSyncExternalStore as Lo, useMemo as he, useId as Kr, useContext as X, useLayoutEffect as Oe, createContext as An, useDebugValue as Do, forwardRef as Nn, Suspense as On, lazy as it, useReducer as St } from "react";
|
5
5
|
import p from "clsx";
|
6
|
-
import { computePosition as Bo, offset as $n, flip as Pn, shift as Mn, arrow as Uo, useMergeRefs as
|
6
|
+
import { computePosition as Bo, offset as $n, flip as Pn, shift as Mn, arrow as Uo, useMergeRefs as Jr, FloatingPortal as Ln, FloatingOverlay as Ho, FloatingFocusManager as Dn, useFloating as Bn, useClick as Un, useDismiss as Hn, useRole as Vn, useInteractions as zn, FloatingTree as Vo, useFloatingTree as Fn, useFloatingNodeId as zo, useListItem as Wn, autoUpdate as Fo, useListNavigation as Wo, useTypeahead as jo, FloatingNode as Go, FloatingList as Ko } from "@floating-ui/react";
|
7
7
|
var Jo = class extends ho {
|
8
8
|
constructor(e, t) {
|
9
|
-
super(), this.options = t, this.#r = e, this.#n = null, this.#a =
|
9
|
+
super(), this.options = t, this.#r = e, this.#n = null, this.#a = Ea(), this.options.experimental_prefetchInRender || this.#a.reject(
|
10
10
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
11
11
|
), this.bindMethods(), this.setOptions(t);
|
12
12
|
}
|
@@ -31,20 +31,20 @@ var Jo = class extends ho {
|
|
31
31
|
this.refetch = this.refetch.bind(this);
|
32
32
|
}
|
33
33
|
onSubscribe() {
|
34
|
-
this.listeners.size === 1 && (this.#e.addObserver(this),
|
34
|
+
this.listeners.size === 1 && (this.#e.addObserver(this), $a(this.#e, this.options) ? this.#l() : this.updateResult(), this.#v());
|
35
35
|
}
|
36
36
|
onUnsubscribe() {
|
37
37
|
this.hasListeners() || this.destroy();
|
38
38
|
}
|
39
39
|
shouldFetchOnReconnect() {
|
40
|
-
return
|
40
|
+
return Cr(
|
41
41
|
this.#e,
|
42
42
|
this.options,
|
43
43
|
this.options.refetchOnReconnect
|
44
44
|
);
|
45
45
|
}
|
46
46
|
shouldFetchOnWindowFocus() {
|
47
|
-
return
|
47
|
+
return Cr(
|
48
48
|
this.#e,
|
49
49
|
this.options,
|
50
50
|
this.options.refetchOnWindowFocus
|
@@ -59,13 +59,13 @@ var Jo = class extends ho {
|
|
59
59
|
throw new Error(
|
60
60
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
61
61
|
);
|
62
|
-
this.#k(), this.#e.setOptions(this.options), t._defaulted && !
|
62
|
+
this.#k(), this.#e.setOptions(this.options), t._defaulted && !kr(this.options, t) && this.#r.getQueryCache().notify({
|
63
63
|
type: "observerOptionsUpdated",
|
64
64
|
query: this.#e,
|
65
65
|
observer: this
|
66
66
|
});
|
67
67
|
const a = this.hasListeners();
|
68
|
-
a &&
|
68
|
+
a && Pa(
|
69
69
|
this.#e,
|
70
70
|
r,
|
71
71
|
this.options,
|
@@ -113,7 +113,7 @@ var Jo = class extends ho {
|
|
113
113
|
this.options,
|
114
114
|
e
|
115
115
|
);
|
116
|
-
return e?.throwOnError || (t = t.catch(
|
116
|
+
return e?.throwOnError || (t = t.catch(_r)), t;
|
117
117
|
}
|
118
118
|
#g() {
|
119
119
|
this.#w();
|
@@ -121,7 +121,7 @@ var Jo = class extends ho {
|
|
121
121
|
this.options.staleTime,
|
122
122
|
this.#e
|
123
123
|
);
|
124
|
-
if (
|
124
|
+
if (Sr || this.#t.isStale || !ka(e))
|
125
125
|
return;
|
126
126
|
const r = po(this.#t.dataUpdatedAt, e) + 1;
|
127
127
|
this.#i = setTimeout(() => {
|
@@ -132,7 +132,7 @@ var Jo = class extends ho {
|
|
132
132
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#e) : this.options.refetchInterval) ?? !1;
|
133
133
|
}
|
134
134
|
#b(e) {
|
135
|
-
this.#E(), this.#s = e, !(
|
135
|
+
this.#E(), this.#s = e, !(Sr || ke(this.options.enabled, this.#e) === !1 || !ka(this.#s) || this.#s === 0) && (this.#c = setInterval(() => {
|
136
136
|
(this.options.refetchIntervalInBackground || fo.isFocused()) && this.#l();
|
137
137
|
}, this.#s));
|
138
138
|
}
|
@@ -149,21 +149,21 @@ var Jo = class extends ho {
|
|
149
149
|
const r = this.#e, a = this.options, n = this.#t, s = this.#o, o = this.#d, l = e !== r ? e.state : this.#m, { state: d } = e;
|
150
150
|
let f = { ...d }, u = !1, h;
|
151
151
|
if (t._optimisticResults) {
|
152
|
-
const k = this.hasListeners(), x = !k &&
|
152
|
+
const k = this.hasListeners(), x = !k && $a(e, t), E = k && Pa(e, r, t, a);
|
153
153
|
(x || E) && (f = {
|
154
154
|
...f,
|
155
155
|
...mo(d.data, e.options)
|
156
156
|
}), t._optimisticResults === "isRestoring" && (f.fetchStatus = "idle");
|
157
157
|
}
|
158
|
-
let { error: m, errorUpdatedAt:
|
158
|
+
let { error: m, errorUpdatedAt: g, status: y } = f;
|
159
159
|
h = f.data;
|
160
160
|
let w = !1;
|
161
|
-
if (t.placeholderData !== void 0 && h === void 0 &&
|
161
|
+
if (t.placeholderData !== void 0 && h === void 0 && y === "pending") {
|
162
162
|
let k;
|
163
163
|
n?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (k = n.data, w = !0) : k = typeof t.placeholderData == "function" ? t.placeholderData(
|
164
164
|
this.#h?.state.data,
|
165
165
|
this.#h
|
166
|
-
) : t.placeholderData, k !== void 0 && (
|
166
|
+
) : t.placeholderData, k !== void 0 && (y = "success", h = _a(
|
167
167
|
n?.data,
|
168
168
|
k,
|
169
169
|
t
|
@@ -174,23 +174,23 @@ var Jo = class extends ho {
|
|
174
174
|
h = this.#u;
|
175
175
|
else
|
176
176
|
try {
|
177
|
-
this.#p = t.select, h = t.select(h), h =
|
177
|
+
this.#p = t.select, h = t.select(h), h = _a(n?.data, h, t), this.#u = h, this.#n = null;
|
178
178
|
} catch (k) {
|
179
179
|
this.#n = k;
|
180
180
|
}
|
181
|
-
this.#n && (m = this.#n, h = this.#u,
|
182
|
-
const v = f.fetchStatus === "fetching", C =
|
183
|
-
status:
|
181
|
+
this.#n && (m = this.#n, h = this.#u, g = Date.now(), y = "error");
|
182
|
+
const v = f.fetchStatus === "fetching", C = y === "pending", S = y === "error", O = C && v, I = h !== void 0, _ = {
|
183
|
+
status: y,
|
184
184
|
fetchStatus: f.fetchStatus,
|
185
185
|
isPending: C,
|
186
|
-
isSuccess:
|
186
|
+
isSuccess: y === "success",
|
187
187
|
isError: S,
|
188
188
|
isInitialLoading: O,
|
189
189
|
isLoading: O,
|
190
190
|
data: h,
|
191
191
|
dataUpdatedAt: f.dataUpdatedAt,
|
192
192
|
error: m,
|
193
|
-
errorUpdatedAt:
|
193
|
+
errorUpdatedAt: g,
|
194
194
|
failureCount: f.fetchFailureCount,
|
195
195
|
failureReason: f.fetchFailureReason,
|
196
196
|
errorUpdateCount: f.errorUpdateCount,
|
@@ -202,7 +202,7 @@ var Jo = class extends ho {
|
|
202
202
|
isPaused: f.fetchStatus === "paused",
|
203
203
|
isPlaceholderData: u,
|
204
204
|
isRefetchError: S && I,
|
205
|
-
isStale:
|
205
|
+
isStale: qr(e, t),
|
206
206
|
refetch: this.refetch,
|
207
207
|
promise: this.#a,
|
208
208
|
isEnabled: ke(t.enabled, e) !== !1
|
@@ -211,7 +211,7 @@ var Jo = class extends ho {
|
|
211
211
|
const k = (F) => {
|
212
212
|
_.status === "error" ? F.reject(_.error) : _.data !== void 0 && F.resolve(_.data);
|
213
213
|
}, x = () => {
|
214
|
-
const F = this.#a = _.promise =
|
214
|
+
const F = this.#a = _.promise = Ea();
|
215
215
|
k(F);
|
216
216
|
}, E = this.#a;
|
217
217
|
switch (E.status) {
|
@@ -230,7 +230,7 @@ var Jo = class extends ho {
|
|
230
230
|
}
|
231
231
|
updateResult() {
|
232
232
|
const e = this.#t, t = this.createResult(this.#e, this.options);
|
233
|
-
if (this.#o = this.#e.state, this.#d = this.options, this.#o.data !== void 0 && (this.#h = this.#e),
|
233
|
+
if (this.#o = this.#e.state, this.#d = this.options, this.#o.data !== void 0 && (this.#h = this.#e), kr(t, e))
|
234
234
|
return;
|
235
235
|
this.#t = t;
|
236
236
|
const r = () => {
|
@@ -273,24 +273,24 @@ var Jo = class extends ho {
|
|
273
273
|
function qo(e, t) {
|
274
274
|
return ke(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
275
275
|
}
|
276
|
-
function
|
277
|
-
return qo(e, t) || e.state.data !== void 0 &&
|
276
|
+
function $a(e, t) {
|
277
|
+
return qo(e, t) || e.state.data !== void 0 && Cr(e, t, t.refetchOnMount);
|
278
278
|
}
|
279
|
-
function
|
279
|
+
function Cr(e, t, r) {
|
280
280
|
if (ke(t.enabled, e) !== !1 && gt(t.staleTime, e) !== "static") {
|
281
281
|
const a = typeof r == "function" ? r(e) : r;
|
282
|
-
return a === "always" || a !== !1 &&
|
282
|
+
return a === "always" || a !== !1 && qr(e, t);
|
283
283
|
}
|
284
284
|
return !1;
|
285
285
|
}
|
286
|
-
function
|
287
|
-
return (e !== t || ke(a.enabled, e) === !1) && (!r.suspense || e.state.status !== "error") &&
|
286
|
+
function Pa(e, t, r, a) {
|
287
|
+
return (e !== t || ke(a.enabled, e) === !1) && (!r.suspense || e.state.status !== "error") && qr(e, r);
|
288
288
|
}
|
289
|
-
function
|
289
|
+
function qr(e, t) {
|
290
290
|
return ke(t.enabled, e) !== !1 && e.isStaleByTime(gt(t.staleTime, e));
|
291
291
|
}
|
292
292
|
function Yo(e, t) {
|
293
|
-
return !
|
293
|
+
return !kr(e.getCurrentResult(), t);
|
294
294
|
}
|
295
295
|
var Qo = Y.createContext(!1), Xo = () => Y.useContext(Qo);
|
296
296
|
function Zo() {
|
@@ -322,7 +322,7 @@ var ei = Y.createContext(Zo()), ti = () => Y.useContext(ei), ri = (e, t) => {
|
|
322
322
|
const t = (a) => a === "static" ? a : Math.max(a ?? 1e3, 1e3), r = e.staleTime;
|
323
323
|
e.staleTime = typeof r == "function" ? (...a) => t(r(...a)) : t(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, 1e3));
|
324
324
|
}
|
325
|
-
}, oi = (e, t) => e.isLoading && e.isFetching && !t, ii = (e, t) => e?.suspense && t.isPending,
|
325
|
+
}, oi = (e, t) => e.isLoading && e.isFetching && !t, ii = (e, t) => e?.suspense && t.isPending, Ma = (e, t, r) => t.fetchOptimistic(e).catch(() => {
|
326
326
|
r.clearReset();
|
327
327
|
});
|
328
328
|
function ci(e, t, r) {
|
@@ -345,7 +345,7 @@ function ci(e, t, r) {
|
|
345
345
|
if (Y.useSyncExternalStore(
|
346
346
|
Y.useCallback(
|
347
347
|
(u) => {
|
348
|
-
const h = f ? l.subscribe(Sn.batchCalls(u)) :
|
348
|
+
const h = f ? l.subscribe(Sn.batchCalls(u)) : _r;
|
349
349
|
return l.updateResult(), h;
|
350
350
|
},
|
351
351
|
[l, f]
|
@@ -355,7 +355,7 @@ function ci(e, t, r) {
|
|
355
355
|
), Y.useEffect(() => {
|
356
356
|
l.setOptions(o);
|
357
357
|
}, [o, l]), ii(o, d))
|
358
|
-
throw
|
358
|
+
throw Ma(o, l, n);
|
359
359
|
if (ni({
|
360
360
|
result: d,
|
361
361
|
errorResetBoundary: n,
|
@@ -367,17 +367,17 @@ function ci(e, t, r) {
|
|
367
367
|
return s.getDefaultOptions().queries?._experimental_afterQuery?.(
|
368
368
|
o,
|
369
369
|
d
|
370
|
-
), o.experimental_prefetchInRender && !
|
370
|
+
), o.experimental_prefetchInRender && !Sr && oi(d, a) && (c ? (
|
371
371
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
372
|
-
|
372
|
+
Ma(o, l, n)
|
373
373
|
) : (
|
374
374
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
375
375
|
s.getQueryCache().get(o.queryHash)?.promise
|
376
|
-
))?.catch(
|
376
|
+
))?.catch(_r).finally(() => {
|
377
377
|
l.updateResult();
|
378
378
|
}), o.notifyOnChangeProps ? d : l.trackResult(d);
|
379
379
|
}
|
380
|
-
function
|
380
|
+
function ct(e, t) {
|
381
381
|
return ci(e, Jo, t);
|
382
382
|
}
|
383
383
|
const li = ({
|
@@ -1007,7 +1007,7 @@ function Li(e) {
|
|
1007
1007
|
function Di(e, t, r = !1) {
|
1008
1008
|
return e.target instanceof HTMLElement ? (r || !e.target.isContentEditable) && !t.includes(e.target.tagName) : !0;
|
1009
1009
|
}
|
1010
|
-
function
|
1010
|
+
function Yr(e, t = ["INPUT", "TEXTAREA", "SELECT"], r = !1) {
|
1011
1011
|
$(() => {
|
1012
1012
|
const a = (n) => {
|
1013
1013
|
e.forEach(
|
@@ -1037,23 +1037,23 @@ function Ui() {
|
|
1037
1037
|
function Gn(e, t) {
|
1038
1038
|
window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
|
1039
1039
|
}
|
1040
|
-
const
|
1040
|
+
const La = (e, t) => {
|
1041
1041
|
const r = JSON.stringify(
|
1042
1042
|
typeof t == "function" ? t() : t
|
1043
1043
|
);
|
1044
1044
|
window.localStorage.setItem(e, r), Gn(e, r);
|
1045
1045
|
}, Hi = (e) => {
|
1046
1046
|
window.localStorage.removeItem(e), Gn(e, null);
|
1047
|
-
},
|
1048
|
-
function
|
1047
|
+
}, Da = (e) => window.localStorage.getItem(e), Vi = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
1048
|
+
function Gt({
|
1049
1049
|
key: e,
|
1050
1050
|
initialValue: t
|
1051
1051
|
}) {
|
1052
|
-
const r = Lo(Vi, () =>
|
1052
|
+
const r = Lo(Vi, () => Da(e)), a = V(
|
1053
1053
|
(o) => {
|
1054
1054
|
try {
|
1055
1055
|
const c = typeof o == "function" ? o(JSON.parse(r)) : o;
|
1056
|
-
c == null ? Hi(e) :
|
1056
|
+
c == null ? Hi(e) : La(e, c);
|
1057
1057
|
} catch (c) {
|
1058
1058
|
console.warn(c);
|
1059
1059
|
}
|
@@ -1066,7 +1066,7 @@ function jt({
|
|
1066
1066
|
}, [a]);
|
1067
1067
|
return $(() => {
|
1068
1068
|
try {
|
1069
|
-
|
1069
|
+
Da(e) === null && typeof t < "u" && La(e, t);
|
1070
1070
|
} catch (o) {
|
1071
1071
|
console.warn(o);
|
1072
1072
|
}
|
@@ -1094,9 +1094,9 @@ function Kn(e) {
|
|
1094
1094
|
}), [o, e]), [a, n];
|
1095
1095
|
}
|
1096
1096
|
function Fi(e) {
|
1097
|
-
return
|
1097
|
+
return Kr();
|
1098
1098
|
}
|
1099
|
-
function
|
1099
|
+
function Ba(e, t) {
|
1100
1100
|
$(() => (window.addEventListener(e, t, {
|
1101
1101
|
passive: !0
|
1102
1102
|
}), () => window.removeEventListener(e, t)), [e, t]);
|
@@ -1111,7 +1111,7 @@ function Wi() {
|
|
1111
1111
|
height: window.innerHeight || 0
|
1112
1112
|
});
|
1113
1113
|
}, []);
|
1114
|
-
return
|
1114
|
+
return Ba("resize", r), Ba("orientationchange", r), $(r, []), e;
|
1115
1115
|
}
|
1116
1116
|
function ji() {
|
1117
1117
|
const [e, t] = z({
|
@@ -1132,7 +1132,7 @@ function ji() {
|
|
1132
1132
|
window.visualViewport && (window.visualViewport.removeEventListener("resize", r), window.visualViewport.removeEventListener("orientationchange", r));
|
1133
1133
|
}), [r]), e;
|
1134
1134
|
}
|
1135
|
-
const
|
1135
|
+
const Qt = "thead", Qr = "tfoot", rt = "tbody", mt = {
|
1136
1136
|
ASC: "asc",
|
1137
1137
|
DESC: "desc"
|
1138
1138
|
}, Gi = ({
|
@@ -1200,7 +1200,7 @@ const Yt = "thead", Yr = "tfoot", tt = "tbody", ft = {
|
|
1200
1200
|
mode: e,
|
1201
1201
|
className: t,
|
1202
1202
|
cellWrapper: r
|
1203
|
-
}) => r ===
|
1203
|
+
}) => r === Qt || r === Qr ? p(
|
1204
1204
|
{
|
1205
1205
|
"bg-table-head-dark": e === "dark" || e === "system",
|
1206
1206
|
"bg-table-head-light": e === "light" || e === "alt-system",
|
@@ -1212,13 +1212,13 @@ const Yt = "thead", Yr = "tfoot", tt = "tbody", ft = {
|
|
1212
1212
|
"border-b last:border-0",
|
1213
1213
|
{
|
1214
1214
|
"border-table-dark": e === "dark" || e === "system",
|
1215
|
-
"odd:bg-table-dark-odd even:bg-table-dark-even": r ===
|
1215
|
+
"odd:bg-table-dark-odd even:bg-table-dark-even": r === rt && e === "dark",
|
1216
1216
|
"border-table-light": e === "light" || e === "alt-system",
|
1217
|
-
"odd:bg-table-light-odd even:bg-table-light-even": r ===
|
1217
|
+
"odd:bg-table-light-odd even:bg-table-light-even": r === rt && e === "light",
|
1218
1218
|
"dark:border-table-light": e === "system",
|
1219
|
-
"odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": r ===
|
1219
|
+
"odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": r === rt && e === "system",
|
1220
1220
|
"dark:border-table-dark": e === "alt-system",
|
1221
|
-
"odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": r ===
|
1221
|
+
"odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": r === rt && e === "alt-system"
|
1222
1222
|
},
|
1223
1223
|
t
|
1224
1224
|
), Yi = ({
|
@@ -1239,15 +1239,15 @@ const Yt = "thead", Yr = "tfoot", tt = "tbody", ft = {
|
|
1239
1239
|
"text-copy-dark": a === "light" || a === "alt-system",
|
1240
1240
|
"dark:text-copy-dark": a === "system",
|
1241
1241
|
"dark:text-copy-light": a === "alt-system",
|
1242
|
-
"px-4 py-3": !r && (e ===
|
1243
|
-
"p-4": !r && e ===
|
1242
|
+
"px-4 py-3": !r && (e === Qt || e === Qr),
|
1243
|
+
"p-4": !r && e === rt,
|
1244
1244
|
"px-2 py-1.5": r
|
1245
1245
|
},
|
1246
1246
|
t
|
1247
1247
|
)
|
1248
1248
|
}), Qi = ({
|
1249
1249
|
buttonClassName: e
|
1250
|
-
}) => p("rounded-none text-sm", e),
|
1250
|
+
}) => p("rounded-none text-sm", e), Ua = "av-button", Xr = "icon", Jn = "button", Ir = "link", Xi = ({
|
1251
1251
|
type: e,
|
1252
1252
|
size: t,
|
1253
1253
|
labelRight: r,
|
@@ -1258,13 +1258,13 @@ const Yt = "thead", Yr = "tfoot", tt = "tbody", ft = {
|
|
1258
1258
|
const o = "max-h-8 py-0 px-2", c = "max-h-9 h-8 px-3", l = "max-h-12 py-2 px-4";
|
1259
1259
|
switch (e) {
|
1260
1260
|
case Jn:
|
1261
|
-
case
|
1261
|
+
case Ir:
|
1262
1262
|
return p({
|
1263
1263
|
[o]: t === "small",
|
1264
1264
|
[c]: t === "medium",
|
1265
1265
|
[l]: t === "large"
|
1266
1266
|
});
|
1267
|
-
case
|
1267
|
+
case Xr:
|
1268
1268
|
return p("flex items-center", {
|
1269
1269
|
"justify-center": n === "center",
|
1270
1270
|
"justify-start": n === "left",
|
@@ -1292,14 +1292,14 @@ const Yt = "thead", Yr = "tfoot", tt = "tbody", ft = {
|
|
1292
1292
|
const n = "text-sm font-medium", s = "text-base font-medium", o = "text-lg font-medium";
|
1293
1293
|
switch (e) {
|
1294
1294
|
case Jn:
|
1295
|
-
case
|
1295
|
+
case Ir:
|
1296
1296
|
return p({
|
1297
|
-
"text-center": e ===
|
1297
|
+
"text-center": e === Ir,
|
1298
1298
|
[n]: t === "small",
|
1299
1299
|
[s]: t === "medium",
|
1300
1300
|
[o]: t === "large"
|
1301
1301
|
});
|
1302
|
-
case
|
1302
|
+
case Xr:
|
1303
1303
|
return p({
|
1304
1304
|
[n]: t === "small" && (r || a),
|
1305
1305
|
[s]: t === "medium" && (r || a),
|
@@ -1506,11 +1506,11 @@ const Yt = "thead", Yr = "tfoot", tt = "tbody", ft = {
|
|
1506
1506
|
noBackground: u,
|
1507
1507
|
variant: h,
|
1508
1508
|
truncate: m,
|
1509
|
-
align:
|
1510
|
-
radius:
|
1509
|
+
align: g,
|
1510
|
+
radius: y,
|
1511
1511
|
animated: w
|
1512
|
-
}) => (h || (h = "primary"), r ? p(
|
1513
|
-
|
1512
|
+
}) => (h || (h = "primary"), r ? p(Ua, t) : p(
|
1513
|
+
Ua,
|
1514
1514
|
ec({
|
1515
1515
|
mode: a,
|
1516
1516
|
variant: h,
|
@@ -1518,13 +1518,13 @@ const Yt = "thead", Yr = "tfoot", tt = "tbody", ft = {
|
|
1518
1518
|
truncate: m
|
1519
1519
|
}),
|
1520
1520
|
tc({ mode: a, noBackground: u, variant: h }),
|
1521
|
-
rc({ radius:
|
1521
|
+
rc({ radius: y }),
|
1522
1522
|
Xi({
|
1523
1523
|
type: e,
|
1524
1524
|
size: c,
|
1525
1525
|
labelRight: d,
|
1526
1526
|
labelLeft: f,
|
1527
|
-
align:
|
1527
|
+
align: g,
|
1528
1528
|
animated: w
|
1529
1529
|
}),
|
1530
1530
|
Zi({ type: e, size: c, labelRight: d, labelLeft: f }),
|
@@ -1581,7 +1581,7 @@ const fc = {
|
|
1581
1581
|
bottom: 0,
|
1582
1582
|
right: 0
|
1583
1583
|
};
|
1584
|
-
function
|
1584
|
+
function rr(e) {
|
1585
1585
|
const t = uc(), r = R(0), a = R(null), [n, s] = z(fc), o = he(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
|
1586
1586
|
const l = c[0];
|
1587
1587
|
l && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
@@ -1622,8 +1622,8 @@ const Tt = {
|
|
1622
1622
|
size: u = "medium",
|
1623
1623
|
labelRight: h,
|
1624
1624
|
labelLeft: m,
|
1625
|
-
noBackground:
|
1626
|
-
align:
|
1625
|
+
noBackground: g = !1,
|
1626
|
+
align: y = "center",
|
1627
1627
|
radius: w = "large",
|
1628
1628
|
variant: v = "primary",
|
1629
1629
|
iconClassName: C,
|
@@ -1631,7 +1631,7 @@ const Tt = {
|
|
1631
1631
|
...O
|
1632
1632
|
}, I) => {
|
1633
1633
|
const b = lc({
|
1634
|
-
type:
|
1634
|
+
type: Xr,
|
1635
1635
|
mode: r,
|
1636
1636
|
focusMode: a,
|
1637
1637
|
fullWidth: n,
|
@@ -1642,12 +1642,12 @@ const Tt = {
|
|
1642
1642
|
size: u,
|
1643
1643
|
labelRight: h,
|
1644
1644
|
labelLeft: m,
|
1645
|
-
noBackground:
|
1646
|
-
align:
|
1645
|
+
noBackground: g,
|
1646
|
+
align: y,
|
1647
1647
|
radius: w,
|
1648
1648
|
variant: v,
|
1649
1649
|
animated: S
|
1650
|
-
}), _ = ic({ mode: r, raw: c, iconClassName: C }), k = cc({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, F] =
|
1650
|
+
}), _ = ic({ mode: r, raw: c, iconClassName: C }), k = cc({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, F] = rr(), [A, W] = rr(), [P, J] = rr(), Q = R(0), L = R(null), M = R(null), q = hc([I, L]);
|
1651
1651
|
return Oe(() => {
|
1652
1652
|
P && P.current && S && (Q.current = J.width + mc[u] + (l ? 0 : pc), L.current && !L.current.style.width && (L.current.style.width = `${Tt[u]}px`));
|
1653
1653
|
}, [J, P, u, l, S]), Oe(() => {
|
@@ -1679,7 +1679,7 @@ const Tt = {
|
|
1679
1679
|
...O,
|
1680
1680
|
children: /* @__PURE__ */ T("div", { className: x, children: [
|
1681
1681
|
/* @__PURE__ */ i(
|
1682
|
-
|
1682
|
+
Ha,
|
1683
1683
|
{
|
1684
1684
|
label: m,
|
1685
1685
|
labelRef: A,
|
@@ -1690,7 +1690,7 @@ const Tt = {
|
|
1690
1690
|
),
|
1691
1691
|
/* @__PURE__ */ i("span", { ref: P, className: _, children: e }),
|
1692
1692
|
/* @__PURE__ */ i(
|
1693
|
-
|
1693
|
+
Ha,
|
1694
1694
|
{
|
1695
1695
|
label: h,
|
1696
1696
|
labelRef: E,
|
@@ -1703,7 +1703,7 @@ const Tt = {
|
|
1703
1703
|
}
|
1704
1704
|
);
|
1705
1705
|
}
|
1706
|
-
),
|
1706
|
+
), Ha = ({
|
1707
1707
|
labelRef: e,
|
1708
1708
|
labelClass: t,
|
1709
1709
|
label: r,
|
@@ -1771,7 +1771,7 @@ const Qn = Z.forwardRef(
|
|
1771
1771
|
}
|
1772
1772
|
);
|
1773
1773
|
Qn.displayName = "ButtonSort";
|
1774
|
-
const
|
1774
|
+
const Zr = ({
|
1775
1775
|
children: e,
|
1776
1776
|
fill: t,
|
1777
1777
|
viewBox: r,
|
@@ -1821,7 +1821,7 @@ const yc = ({
|
|
1821
1821
|
monotone: a,
|
1822
1822
|
...n
|
1823
1823
|
}) => /* @__PURE__ */ T(
|
1824
|
-
|
1824
|
+
Zr,
|
1825
1825
|
{
|
1826
1826
|
defaultViewBox: "0 0 576 512",
|
1827
1827
|
size: "size-5",
|
@@ -1847,7 +1847,7 @@ const yc = ({
|
|
1847
1847
|
monotone: a,
|
1848
1848
|
...n
|
1849
1849
|
}) => /* @__PURE__ */ T(
|
1850
|
-
|
1850
|
+
Zr,
|
1851
1851
|
{
|
1852
1852
|
defaultViewBox: "0 0 576 512",
|
1853
1853
|
size: "size-5",
|
@@ -1873,7 +1873,7 @@ const yc = ({
|
|
1873
1873
|
monotone: a,
|
1874
1874
|
...n
|
1875
1875
|
}) => /* @__PURE__ */ T(
|
1876
|
-
|
1876
|
+
Zr,
|
1877
1877
|
{
|
1878
1878
|
defaultViewBox: "0 0 576 512",
|
1879
1879
|
size: "size-5",
|
@@ -1906,7 +1906,7 @@ try {
|
|
1906
1906
|
});
|
1907
1907
|
} catch {
|
1908
1908
|
}
|
1909
|
-
const
|
1909
|
+
const lt = Z.createContext({
|
1910
1910
|
mode: "light",
|
1911
1911
|
cellWrapper: "thead",
|
1912
1912
|
stickyHeader: !1,
|
@@ -1933,7 +1933,7 @@ const ct = Z.createContext({
|
|
1933
1933
|
stickyFooter: d
|
1934
1934
|
});
|
1935
1935
|
return /* @__PURE__ */ i(
|
1936
|
-
|
1936
|
+
lt.Provider,
|
1937
1937
|
{
|
1938
1938
|
value: { mode: t, stickyHeader: l, stickyFooter: d, compact: a },
|
1939
1939
|
children: /* @__PURE__ */ i(
|
@@ -1956,8 +1956,8 @@ const ct = Z.createContext({
|
|
1956
1956
|
className: t,
|
1957
1957
|
...r
|
1958
1958
|
}) => {
|
1959
|
-
const a = X(
|
1960
|
-
a.cellWrapper =
|
1959
|
+
const a = X(lt);
|
1960
|
+
a.cellWrapper = Qt;
|
1961
1961
|
const n = Ki({
|
1962
1962
|
className: t,
|
1963
1963
|
mode: a.mode,
|
@@ -1969,8 +1969,8 @@ const ct = Z.createContext({
|
|
1969
1969
|
className: t,
|
1970
1970
|
...r
|
1971
1971
|
}) => {
|
1972
|
-
const a = X(
|
1973
|
-
a.cellWrapper =
|
1972
|
+
const a = X(lt);
|
1973
|
+
a.cellWrapper = Qr;
|
1974
1974
|
const n = Ji({
|
1975
1975
|
className: t,
|
1976
1976
|
mode: a.mode,
|
@@ -1978,14 +1978,14 @@ const ct = Z.createContext({
|
|
1978
1978
|
});
|
1979
1979
|
return /* @__PURE__ */ i("tfoot", { className: n, ...r, children: e });
|
1980
1980
|
}, Kf = ({ children: e, ...t }) => {
|
1981
|
-
const r = X(
|
1982
|
-
return r.cellWrapper =
|
1981
|
+
const r = X(lt);
|
1982
|
+
return r.cellWrapper = rt, /* @__PURE__ */ i("tbody", { ...t, children: e });
|
1983
1983
|
}, Jf = ({
|
1984
1984
|
children: e,
|
1985
1985
|
className: t,
|
1986
1986
|
...r
|
1987
1987
|
}) => {
|
1988
|
-
const a = X(
|
1988
|
+
const a = X(lt), n = qi({
|
1989
1989
|
mode: a.mode,
|
1990
1990
|
cellWrapper: a.cellWrapper,
|
1991
1991
|
className: t
|
@@ -1998,7 +1998,7 @@ const ct = Z.createContext({
|
|
1998
1998
|
align: a,
|
1999
1999
|
...n
|
2000
2000
|
}) => {
|
2001
|
-
const s = X(
|
2001
|
+
const s = X(lt), o = t || (s.cellWrapper === Qt ? "th" : "td"), { mainClasses: c, alignClasses: l } = Yi({
|
2002
2002
|
cellWrapper: s.cellWrapper,
|
2003
2003
|
className: r,
|
2004
2004
|
mode: s.mode,
|
@@ -2027,7 +2027,7 @@ const ct = Z.createContext({
|
|
2027
2027
|
component: n,
|
2028
2028
|
className: a,
|
2029
2029
|
role: "columnheader",
|
2030
|
-
"aria-sort": l ===
|
2030
|
+
"aria-sort": l === mt.ASC && d === f ? "ascending" : l === mt.DESC && d === f ? "descending" : "other",
|
2031
2031
|
...u,
|
2032
2032
|
children: /* @__PURE__ */ i(
|
2033
2033
|
Qn,
|
@@ -2041,7 +2041,7 @@ const ct = Z.createContext({
|
|
2041
2041
|
mode: o,
|
2042
2042
|
fullWidth: !0,
|
2043
2043
|
labelRight: t,
|
2044
|
-
children: l ===
|
2044
|
+
children: l === mt.ASC && d === f ? /* @__PURE__ */ i(vc, { className: "size-4", monotone: !0 }) : l === mt.DESC && d === f ? /* @__PURE__ */ i(bc, { className: "size-4", monotone: !0 }) : /* @__PURE__ */ i(yc, { className: "size-4", monotone: !0 })
|
2045
2045
|
}
|
2046
2046
|
)
|
2047
2047
|
}
|
@@ -2066,28 +2066,28 @@ for (let e = 0; e < 256; ++e)
|
|
2066
2066
|
function Ec(e, t = 0) {
|
2067
2067
|
return (ce[e[t + 0]] + ce[e[t + 1]] + ce[e[t + 2]] + ce[e[t + 3]] + "-" + ce[e[t + 4]] + ce[e[t + 5]] + "-" + ce[e[t + 6]] + ce[e[t + 7]] + "-" + ce[e[t + 8]] + ce[e[t + 9]] + "-" + ce[e[t + 10]] + ce[e[t + 11]] + ce[e[t + 12]] + ce[e[t + 13]] + ce[e[t + 14]] + ce[e[t + 15]]).toLowerCase();
|
2068
2068
|
}
|
2069
|
-
let
|
2069
|
+
let ar;
|
2070
2070
|
const kc = new Uint8Array(16);
|
2071
2071
|
function _c() {
|
2072
|
-
if (!
|
2072
|
+
if (!ar) {
|
2073
2073
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
2074
2074
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
2075
|
-
|
2075
|
+
ar = crypto.getRandomValues.bind(crypto);
|
2076
2076
|
}
|
2077
|
-
return
|
2077
|
+
return ar(kc);
|
2078
2078
|
}
|
2079
|
-
const Sc = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
2079
|
+
const Sc = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Va = { randomUUID: Sc };
|
2080
2080
|
function Ue(e, t, r) {
|
2081
|
-
if (
|
2082
|
-
return
|
2081
|
+
if (Va.randomUUID && !e)
|
2082
|
+
return Va.randomUUID();
|
2083
2083
|
e = e || {};
|
2084
2084
|
const a = e.random ?? e.rng?.() ?? _c();
|
2085
2085
|
if (a.length < 16)
|
2086
2086
|
throw new Error("Random bytes length must be >= 16");
|
2087
2087
|
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Ec(a);
|
2088
2088
|
}
|
2089
|
-
let Ct = !1,
|
2090
|
-
const
|
2089
|
+
let Ct = !1, nr = null;
|
2090
|
+
const za = ({
|
2091
2091
|
containerId: e,
|
2092
2092
|
...t
|
2093
2093
|
}) => {
|
@@ -2097,7 +2097,7 @@ const Va = ({
|
|
2097
2097
|
const n = async () => {
|
2098
2098
|
try {
|
2099
2099
|
const { ToastContainer: o } = await import("./index.B8EJY2WR.js");
|
2100
|
-
|
2100
|
+
nr = o, Ct = !0, a(!0);
|
2101
2101
|
} catch (o) {
|
2102
2102
|
console.error("Failed to load ToastContainer:", o);
|
2103
2103
|
}
|
@@ -2108,10 +2108,10 @@ const Va = ({
|
|
2108
2108
|
window.removeEventListener("toast-request", s);
|
2109
2109
|
};
|
2110
2110
|
}
|
2111
|
-
}, []), r &&
|
2112
|
-
},
|
2111
|
+
}, []), r && nr ? /* @__PURE__ */ i(nr, { containerId: e, ...t }) : null;
|
2112
|
+
}, qe = "FOOTER_BOTTOM", Kt = "FOOTER_TOP", pt = "APP_SET_FOOTER_POSITION", Xn = "APP_SET_FOOTER_HEIGHT", Tc = (e, t) => {
|
2113
2113
|
switch (t.type) {
|
2114
|
-
case
|
2114
|
+
case pt:
|
2115
2115
|
return {
|
2116
2116
|
...e,
|
2117
2117
|
footerPosition: t.payload.footerPosition,
|
@@ -2125,19 +2125,19 @@ const Va = ({
|
|
2125
2125
|
default:
|
2126
2126
|
return e;
|
2127
2127
|
}
|
2128
|
-
},
|
2128
|
+
}, at = "CHAT_SET_STATUS", Zn = "CHAT_SET_USAGE", st = "CHAT_SET_ATTACHMENTS", es = "CHAT_SET_PROVIDER", Qe = "CHAT_RESET", Cc = (e, t) => {
|
2129
2129
|
switch (t.type) {
|
2130
2130
|
case Zn:
|
2131
2131
|
return {
|
2132
2132
|
...e,
|
2133
2133
|
tokenUsage: e.tokenUsage + t.payload.tokenUsage
|
2134
2134
|
};
|
2135
|
-
case
|
2135
|
+
case st:
|
2136
2136
|
return {
|
2137
2137
|
...e,
|
2138
2138
|
attachments: t.payload.attachments
|
2139
2139
|
};
|
2140
|
-
case
|
2140
|
+
case at: {
|
2141
2141
|
let r = !1, a = !1, n = !1, s = !1, o = "", c = 0, l = e.tokenUsage;
|
2142
2142
|
return typeof t?.payload?.loading == "boolean" ? n = t.payload.loading : typeof e.loading == "boolean" && (n = e.loading), typeof t?.payload?.streaming == "boolean" ? a = t.payload.streaming : typeof e.streaming == "boolean" && (a = e.streaming), typeof t?.payload?.restoring == "boolean" ? (r = t.payload.restoring, o = t.payload.restoredModel || "", c = t.payload.restoredUsage || 0, r && (l = c)) : typeof e.restoring == "boolean" && (r = e.restoring, o = e.restoredModel || "", c = e.restoredUsage || 0), typeof t?.payload?.aborted == "boolean" ? s = t.payload.aborted : typeof e.aborted == "boolean" && (s = e.aborted), (a || n) && (r = !1, o = "", c = 0, s = !1), {
|
2143
2143
|
...e,
|
@@ -2158,13 +2158,13 @@ const Va = ({
|
|
2158
2158
|
...e,
|
2159
2159
|
provider: t.payload.provider
|
2160
2160
|
};
|
2161
|
-
case
|
2161
|
+
case Qe: {
|
2162
2162
|
let r = !1, a = !1;
|
2163
2163
|
return typeof t?.payload?.privateChat == "boolean" ? r = t.payload.privateChat : typeof e.privateChat == "boolean" && (r = e.privateChat), typeof t?.payload?.reasoning == "boolean" ? a = t.payload.reasoning : typeof e.reasoning == "boolean" && (a = e.reasoning), {
|
2164
2164
|
privateChat: r,
|
2165
2165
|
reasoning: a,
|
2166
2166
|
provider: e.provider,
|
2167
|
-
tokenUsage: 0,
|
2167
|
+
tokenUsage: t.payload.preserveTokenUsage ? e.tokenUsage : 0,
|
2168
2168
|
attachments: e.attachments,
|
2169
2169
|
streaming: !1,
|
2170
2170
|
loading: !1,
|
@@ -2223,17 +2223,20 @@ const Va = ({
|
|
2223
2223
|
$searchString: String,
|
2224
2224
|
$limit: Float,
|
2225
2225
|
$direction: String,
|
2226
|
+
$sortBy: String,
|
2226
2227
|
$truncateSize: Float) {
|
2227
2228
|
chats(
|
2228
2229
|
user: $user,
|
2229
2230
|
searchString: $searchString,
|
2230
2231
|
limit: $limit,
|
2231
2232
|
direction: $direction,
|
2233
|
+
sortBy: $sortBy,
|
2232
2234
|
truncateSize: $truncateSize) {
|
2233
2235
|
timestamp
|
2234
2236
|
id
|
2235
2237
|
model
|
2236
2238
|
summary
|
2239
|
+
tokenUsage
|
2237
2240
|
messages {
|
2238
2241
|
content
|
2239
2242
|
}
|
@@ -2387,12 +2390,12 @@ const Va = ({
|
|
2387
2390
|
schema: we.GET_USAGE,
|
2388
2391
|
method: "usage"
|
2389
2392
|
}
|
2390
|
-
},
|
2393
|
+
}, ea = process.env.PUBLIC_SASSY_API_SERVER_URL, Jt = async ({
|
2391
2394
|
query: e,
|
2392
2395
|
data: t,
|
2393
2396
|
headers: r = {},
|
2394
2397
|
...a
|
2395
|
-
}) => await fetch(`${
|
2398
|
+
}) => await fetch(`${ea}/graphql`, {
|
2396
2399
|
method: "POST",
|
2397
2400
|
credentials: "include",
|
2398
2401
|
headers: {
|
@@ -2410,13 +2413,13 @@ const Va = ({
|
|
2410
2413
|
try {
|
2411
2414
|
let r;
|
2412
2415
|
if (e.noAuth === !0)
|
2413
|
-
r = await
|
2416
|
+
r = await Jt({
|
2414
2417
|
query: e.type.schema,
|
2415
2418
|
data: t
|
2416
2419
|
});
|
2417
2420
|
else {
|
2418
2421
|
const s = `Bearer ${e.accessToken}`;
|
2419
|
-
r = await
|
2422
|
+
r = await Jt({
|
2420
2423
|
headers: {
|
2421
2424
|
authorization: s
|
2422
2425
|
},
|
@@ -2451,34 +2454,34 @@ const Va = ({
|
|
2451
2454
|
});
|
2452
2455
|
} catch {
|
2453
2456
|
}
|
2454
|
-
},
|
2457
|
+
}, dt = {
|
2455
2458
|
CHATS: "chats",
|
2456
2459
|
CHATS_STATS: "chatsStats",
|
2457
2460
|
CAPABILITIES: "capabilities",
|
2458
2461
|
CHANGELOGS: "changelogs",
|
2459
2462
|
PREFERENCES: "preferences",
|
2460
2463
|
USAGE: "usage"
|
2461
|
-
}, Yf = () =>
|
2462
|
-
queryKey: [
|
2463
|
-
queryFn: async () => await
|
2464
|
+
}, Yf = () => ct({
|
2465
|
+
queryKey: [dt.CAPABILITIES],
|
2466
|
+
queryFn: async () => await ut({
|
2464
2467
|
type: ze.GET_SERVER_CAPABILITIES,
|
2465
2468
|
noAuth: !0
|
2466
2469
|
})
|
2467
|
-
}), Qf = () =>
|
2468
|
-
queryKey: [
|
2469
|
-
queryFn: async () => await
|
2470
|
+
}), Qf = () => ct({
|
2471
|
+
queryKey: [dt.CHANGELOGS],
|
2472
|
+
queryFn: async () => await ut({
|
2470
2473
|
type: ze.GET_CHANGELOGS,
|
2471
2474
|
noAuth: !0,
|
2472
2475
|
params: {
|
2473
2476
|
client: !0
|
2474
2477
|
}
|
2475
2478
|
})
|
2476
|
-
}),
|
2479
|
+
}), Xt = ({
|
2477
2480
|
user: e,
|
2478
2481
|
getAccessToken: t
|
2479
|
-
}) =>
|
2480
|
-
queryKey: [
|
2481
|
-
queryFn: async () => await
|
2482
|
+
}) => ct({
|
2483
|
+
queryKey: [dt.PREFERENCES, e],
|
2484
|
+
queryFn: async () => await ut({
|
2482
2485
|
params: {
|
2483
2486
|
user: e
|
2484
2487
|
},
|
@@ -2488,9 +2491,9 @@ const Va = ({
|
|
2488
2491
|
}), Xf = ({
|
2489
2492
|
user: e,
|
2490
2493
|
getAccessToken: t
|
2491
|
-
}) =>
|
2492
|
-
queryKey: [
|
2493
|
-
queryFn: async () => await
|
2494
|
+
}) => ct({
|
2495
|
+
queryKey: [dt.CHATS_STATS, e],
|
2496
|
+
queryFn: async () => await ut({
|
2494
2497
|
params: {
|
2495
2498
|
user: e
|
2496
2499
|
},
|
@@ -2501,23 +2504,25 @@ const Va = ({
|
|
2501
2504
|
user: e,
|
2502
2505
|
searchString: t,
|
2503
2506
|
sortDirection: r,
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
2507
|
-
|
2507
|
+
sortedCell: a,
|
2508
|
+
getAccessToken: n,
|
2509
|
+
enabled: s = !0
|
2510
|
+
}) => ct({
|
2511
|
+
enabled: s,
|
2508
2512
|
staleTime: 60 * 1e3,
|
2509
2513
|
// 1 minute
|
2510
|
-
queryKey: [
|
2511
|
-
queryFn: async () => await
|
2514
|
+
queryKey: [dt.CHATS, e, t, r, a],
|
2515
|
+
queryFn: async () => await ut({
|
2512
2516
|
params: {
|
2513
2517
|
user: e,
|
2514
2518
|
searchString: t,
|
2515
2519
|
direction: r,
|
2520
|
+
sortBy: a,
|
2516
2521
|
limit: 1,
|
2517
2522
|
truncateSize: 100
|
2518
2523
|
},
|
2519
2524
|
type: ze.GET_CHATS,
|
2520
|
-
getAccessToken:
|
2525
|
+
getAccessToken: n
|
2521
2526
|
})
|
2522
2527
|
}), Zf = ({
|
2523
2528
|
user: e,
|
@@ -2525,10 +2530,10 @@ const Va = ({
|
|
2525
2530
|
year: r = (/* @__PURE__ */ new Date()).getFullYear().toString(),
|
2526
2531
|
getAccessToken: a,
|
2527
2532
|
enabled: n = !0
|
2528
|
-
}) =>
|
2533
|
+
}) => ct({
|
2529
2534
|
enabled: n,
|
2530
|
-
queryKey: [
|
2531
|
-
queryFn: async () => await
|
2535
|
+
queryKey: [dt.USAGE, e, t, r],
|
2536
|
+
queryFn: async () => await ut({
|
2532
2537
|
params: {
|
2533
2538
|
user: e,
|
2534
2539
|
month: t,
|
@@ -2537,7 +2542,7 @@ const Va = ({
|
|
2537
2542
|
type: ze.GET_USAGE,
|
2538
2543
|
getAccessToken: a
|
2539
2544
|
})
|
2540
|
-
}),
|
2545
|
+
}), ut = async ({
|
2541
2546
|
params: e,
|
2542
2547
|
type: t,
|
2543
2548
|
noAuth: r,
|
@@ -2547,13 +2552,13 @@ const Va = ({
|
|
2547
2552
|
const n = t?.data ? t.data(e) : e;
|
2548
2553
|
let s;
|
2549
2554
|
if (r === !0)
|
2550
|
-
s = await
|
2555
|
+
s = await Jt({
|
2551
2556
|
query: t.schema,
|
2552
2557
|
data: n
|
2553
2558
|
});
|
2554
2559
|
else if (a) {
|
2555
2560
|
const d = await a();
|
2556
|
-
s = await
|
2561
|
+
s = await Jt({
|
2557
2562
|
headers: {
|
2558
2563
|
authorization: `Bearer ${d}`
|
2559
2564
|
},
|
@@ -2604,11 +2609,11 @@ var as = "vercel.ai.error", Ac = Symbol.for(as), ns, Nc = class ss extends Error
|
|
2604
2609
|
}
|
2605
2610
|
};
|
2606
2611
|
ns = Ac;
|
2607
|
-
var
|
2612
|
+
var ot = Nc;
|
2608
2613
|
function os(e) {
|
2609
2614
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.message : JSON.stringify(e);
|
2610
2615
|
}
|
2611
|
-
var is = "AI_InvalidArgumentError", cs = `vercel.ai.error.${is}`, Oc = Symbol.for(cs), ls, $c = class extends
|
2616
|
+
var is = "AI_InvalidArgumentError", cs = `vercel.ai.error.${is}`, Oc = Symbol.for(cs), ls, $c = class extends ot {
|
2612
2617
|
constructor({
|
2613
2618
|
message: e,
|
2614
2619
|
cause: t,
|
@@ -2617,11 +2622,11 @@ var is = "AI_InvalidArgumentError", cs = `vercel.ai.error.${is}`, Oc = Symbol.fo
|
|
2617
2622
|
super({ name: is, message: e, cause: t }), this[ls] = !0, this.argument = r;
|
2618
2623
|
}
|
2619
2624
|
static isInstance(e) {
|
2620
|
-
return
|
2625
|
+
return ot.hasMarker(e, cs);
|
2621
2626
|
}
|
2622
2627
|
};
|
2623
2628
|
ls = Oc;
|
2624
|
-
var ds = "AI_JSONParseError", us = `vercel.ai.error.${ds}`, Pc = Symbol.for(us), hs,
|
2629
|
+
var ds = "AI_JSONParseError", us = `vercel.ai.error.${ds}`, Pc = Symbol.for(us), hs, Fa = class extends ot {
|
2625
2630
|
constructor({ text: e, cause: t }) {
|
2626
2631
|
super({
|
2627
2632
|
name: ds,
|
@@ -2631,11 +2636,11 @@ Error message: ${os(t)}`,
|
|
2631
2636
|
}), this[hs] = !0, this.text = e;
|
2632
2637
|
}
|
2633
2638
|
static isInstance(e) {
|
2634
|
-
return
|
2639
|
+
return ot.hasMarker(e, us);
|
2635
2640
|
}
|
2636
2641
|
};
|
2637
2642
|
hs = Pc;
|
2638
|
-
var fs = "AI_TypeValidationError", ms = `vercel.ai.error.${fs}`, Mc = Symbol.for(ms), ps, Lc = class
|
2643
|
+
var fs = "AI_TypeValidationError", ms = `vercel.ai.error.${fs}`, Mc = Symbol.for(ms), ps, Lc = class xr extends ot {
|
2639
2644
|
constructor({ value: t, cause: r }) {
|
2640
2645
|
super({
|
2641
2646
|
name: fs,
|
@@ -2645,7 +2650,7 @@ Error message: ${os(r)}`,
|
|
2645
2650
|
}), this[ps] = !0, this.value = t;
|
2646
2651
|
}
|
2647
2652
|
static isInstance(t) {
|
2648
|
-
return
|
2653
|
+
return ot.hasMarker(t, ms);
|
2649
2654
|
}
|
2650
2655
|
/**
|
2651
2656
|
* Wraps an error into a TypeValidationError.
|
@@ -2661,11 +2666,11 @@ Error message: ${os(r)}`,
|
|
2661
2666
|
value: t,
|
2662
2667
|
cause: r
|
2663
2668
|
}) {
|
2664
|
-
return
|
2669
|
+
return xr.isInstance(r) && r.value === t ? r : new xr({ value: t, cause: r });
|
2665
2670
|
}
|
2666
2671
|
};
|
2667
2672
|
ps = Mc;
|
2668
|
-
var
|
2673
|
+
var Wa = Lc;
|
2669
2674
|
let Dc = (e, t = 21) => (r = t) => {
|
2670
2675
|
let a = "", n = r | 0;
|
2671
2676
|
for (; n--; )
|
@@ -2675,10 +2680,10 @@ let Dc = (e, t = 21) => (r = t) => {
|
|
2675
2680
|
function gs(e) {
|
2676
2681
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
2677
2682
|
}
|
2678
|
-
var Ge = { exports: {} },
|
2683
|
+
var Ge = { exports: {} }, ja;
|
2679
2684
|
function Bc() {
|
2680
|
-
if (
|
2681
|
-
|
2685
|
+
if (ja) return Ge.exports;
|
2686
|
+
ja = 1;
|
2682
2687
|
const e = typeof Buffer < "u", t = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, r = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
2683
2688
|
function a(c, l, d) {
|
2684
2689
|
d == null && l !== null && typeof l == "object" && (d = l, l = void 0), e && Buffer.isBuffer(c) && (c = c.toString()), c && c.charCodeAt(0) === 65279 && (c = c.slice(1));
|
@@ -2718,9 +2723,9 @@ function Bc() {
|
|
2718
2723
|
throw new SyntaxError("Object contains forbidden prototype property");
|
2719
2724
|
delete m.constructor;
|
2720
2725
|
}
|
2721
|
-
for (const
|
2722
|
-
const
|
2723
|
-
|
2726
|
+
for (const g in m) {
|
2727
|
+
const y = m[g];
|
2728
|
+
y && typeof y == "object" && u.push(y);
|
2724
2729
|
}
|
2725
2730
|
}
|
2726
2731
|
}
|
@@ -2765,12 +2770,12 @@ var Vc = ({
|
|
2765
2770
|
message: `The separator "${a}" must not be part of the alphabet "${r}".`
|
2766
2771
|
});
|
2767
2772
|
return (s) => `${e}${a}${n(s)}`;
|
2768
|
-
},
|
2773
|
+
}, ta = Vc(), Rr = Symbol.for("vercel.ai.validator");
|
2769
2774
|
function zc(e) {
|
2770
|
-
return { [
|
2775
|
+
return { [Rr]: !0, validate: e };
|
2771
2776
|
}
|
2772
2777
|
function Fc(e) {
|
2773
|
-
return typeof e == "object" && e !== null &&
|
2778
|
+
return typeof e == "object" && e !== null && Rr in e && e[Rr] === !0 && "validate" in e;
|
2774
2779
|
}
|
2775
2780
|
function Wc(e) {
|
2776
2781
|
return Fc(e) ? e : jc(e);
|
@@ -2792,16 +2797,16 @@ function Gc({
|
|
2792
2797
|
const a = r.validate(e);
|
2793
2798
|
return a.success ? a : {
|
2794
2799
|
success: !1,
|
2795
|
-
error:
|
2800
|
+
error: Wa.wrap({ value: e, cause: a.error })
|
2796
2801
|
};
|
2797
2802
|
} catch (a) {
|
2798
2803
|
return {
|
2799
2804
|
success: !1,
|
2800
|
-
error:
|
2805
|
+
error: Wa.wrap({ value: e, cause: a })
|
2801
2806
|
};
|
2802
2807
|
}
|
2803
2808
|
}
|
2804
|
-
function
|
2809
|
+
function Ga({
|
2805
2810
|
text: e,
|
2806
2811
|
schema: t
|
2807
2812
|
}) {
|
@@ -2814,7 +2819,7 @@ function ja({
|
|
2814
2819
|
} catch (r) {
|
2815
2820
|
return {
|
2816
2821
|
success: !1,
|
2817
|
-
error:
|
2822
|
+
error: Fa.isInstance(r) ? r : new Fa({ text: e, cause: r })
|
2818
2823
|
};
|
2819
2824
|
}
|
2820
2825
|
}
|
@@ -3079,8 +3084,8 @@ function Jc(e) {
|
|
3079
3084
|
function qc(e) {
|
3080
3085
|
if (e === void 0)
|
3081
3086
|
return { value: void 0, state: "undefined-input" };
|
3082
|
-
let t =
|
3083
|
-
return t.success ? { value: t.value, state: "successful-parse" } : (t =
|
3087
|
+
let t = Ga({ text: e });
|
3088
|
+
return t.success ? { value: t.value, state: "successful-parse" } : (t = Ga({ text: Jc(e) }), t.success ? { value: t.value, state: "repaired-parse" } : { value: void 0, state: "failed-parse" });
|
3084
3089
|
}
|
3085
3090
|
var Yc = {
|
3086
3091
|
code: "0",
|
@@ -3272,7 +3277,7 @@ var Yc = {
|
|
3272
3277
|
);
|
3273
3278
|
return { type: "file", value: e };
|
3274
3279
|
}
|
3275
|
-
},
|
3280
|
+
}, ra = [
|
3276
3281
|
Yc,
|
3277
3282
|
Qc,
|
3278
3283
|
Xc,
|
@@ -3290,12 +3295,12 @@ var Yc = {
|
|
3290
3295
|
dl,
|
3291
3296
|
ul
|
3292
3297
|
], hl = Object.fromEntries(
|
3293
|
-
|
3298
|
+
ra.map((e) => [e.code, e])
|
3294
3299
|
);
|
3295
3300
|
Object.fromEntries(
|
3296
|
-
|
3301
|
+
ra.map((e) => [e.name, e.code])
|
3297
3302
|
);
|
3298
|
-
var fl =
|
3303
|
+
var fl = ra.map((e) => e.code), ml = (e) => {
|
3299
3304
|
const t = e.indexOf(":");
|
3300
3305
|
if (t === -1)
|
3301
3306
|
throw new Error("Failed to parse stream string. No separator found.");
|
@@ -3327,8 +3332,8 @@ async function yl({
|
|
3327
3332
|
onToolCallPart: u,
|
3328
3333
|
onToolResultPart: h,
|
3329
3334
|
onMessageAnnotationsPart: m,
|
3330
|
-
onFinishMessagePart:
|
3331
|
-
onFinishStepPart:
|
3335
|
+
onFinishMessagePart: g,
|
3336
|
+
onFinishStepPart: y,
|
3332
3337
|
onStartStepPart: w
|
3333
3338
|
}) {
|
3334
3339
|
const v = e.getReader(), C = new TextDecoder(), S = [];
|
@@ -3385,10 +3390,10 @@ async function yl({
|
|
3385
3390
|
await h?.(x);
|
3386
3391
|
break;
|
3387
3392
|
case "finish_message":
|
3388
|
-
await
|
3393
|
+
await g?.(x);
|
3389
3394
|
break;
|
3390
3395
|
case "finish_step":
|
3391
|
-
await
|
3396
|
+
await y?.(x);
|
3392
3397
|
break;
|
3393
3398
|
case "start_step":
|
3394
3399
|
await w?.(x);
|
@@ -3405,7 +3410,7 @@ async function bl({
|
|
3405
3410
|
update: t,
|
3406
3411
|
onToolCall: r,
|
3407
3412
|
onFinish: a,
|
3408
|
-
generateId: n =
|
3413
|
+
generateId: n = ta,
|
3409
3414
|
getCurrentDate: s = () => /* @__PURE__ */ new Date(),
|
3410
3415
|
lastMessage: o
|
3411
3416
|
}) {
|
@@ -3423,8 +3428,8 @@ async function bl({
|
|
3423
3428
|
content: "",
|
3424
3429
|
parts: []
|
3425
3430
|
};
|
3426
|
-
let h, m,
|
3427
|
-
function
|
3431
|
+
let h, m, g;
|
3432
|
+
function y(b, _) {
|
3428
3433
|
const k = u.parts.find(
|
3429
3434
|
(x) => x.type === "tool-invocation" && x.toolInvocation.toolCallId === b
|
3430
3435
|
);
|
@@ -3471,14 +3476,14 @@ async function bl({
|
|
3471
3476
|
},
|
3472
3477
|
onReasoningPart(b) {
|
3473
3478
|
var _;
|
3474
|
-
|
3479
|
+
g == null ? (g = { type: "text", text: b }, m?.details.push(g)) : g.text += b, m == null ? (m = {
|
3475
3480
|
type: "reasoning",
|
3476
3481
|
reasoning: b,
|
3477
|
-
details: [
|
3482
|
+
details: [g]
|
3478
3483
|
}, u.parts.push(m)) : m.reasoning += b, u.reasoning = ((_ = u.reasoning) != null ? _ : "") + b, I();
|
3479
3484
|
},
|
3480
3485
|
onReasoningSignaturePart(b) {
|
3481
|
-
|
3486
|
+
g != null && (g.signature = b.signature);
|
3482
3487
|
},
|
3483
3488
|
onRedactedReasoningPart(b) {
|
3484
3489
|
m == null && (m = {
|
@@ -3488,7 +3493,7 @@ async function bl({
|
|
3488
3493
|
}, u.parts.push(m)), m.details.push({
|
3489
3494
|
type: "redacted",
|
3490
3495
|
data: b.data
|
3491
|
-
}),
|
3496
|
+
}), g = void 0, I();
|
3492
3497
|
},
|
3493
3498
|
onFilePart(b) {
|
3494
3499
|
u.parts.push({
|
@@ -3517,7 +3522,7 @@ async function bl({
|
|
3517
3522
|
toolName: b.toolName,
|
3518
3523
|
args: void 0
|
3519
3524
|
};
|
3520
|
-
u.toolInvocations.push(_),
|
3525
|
+
u.toolInvocations.push(_), y(b.toolCallId, _), I();
|
3521
3526
|
},
|
3522
3527
|
onToolCallDeltaPart(b) {
|
3523
3528
|
const _ = C[b.toolCallId];
|
@@ -3529,7 +3534,7 @@ async function bl({
|
|
3529
3534
|
toolName: _.toolName,
|
3530
3535
|
args: k
|
3531
3536
|
};
|
3532
|
-
u.toolInvocations[_.index] = x,
|
3537
|
+
u.toolInvocations[_.index] = x, y(b.toolCallId, x), I();
|
3533
3538
|
},
|
3534
3539
|
async onToolCallPart(b) {
|
3535
3540
|
const _ = {
|
@@ -3537,7 +3542,7 @@ async function bl({
|
|
3537
3542
|
step: f,
|
3538
3543
|
...b
|
3539
3544
|
};
|
3540
|
-
if (C[b.toolCallId] != null ? u.toolInvocations[C[b.toolCallId].index] = _ : (u.toolInvocations == null && (u.toolInvocations = []), u.toolInvocations.push(_)),
|
3545
|
+
if (C[b.toolCallId] != null ? u.toolInvocations[C[b.toolCallId].index] = _ : (u.toolInvocations == null && (u.toolInvocations = []), u.toolInvocations.push(_)), y(b.toolCallId, _), I(), r) {
|
3541
3546
|
const k = await r({ toolCall: b });
|
3542
3547
|
if (k != null) {
|
3543
3548
|
const x = {
|
@@ -3546,7 +3551,7 @@ async function bl({
|
|
3546
3551
|
...b,
|
3547
3552
|
result: k
|
3548
3553
|
};
|
3549
|
-
u.toolInvocations[u.toolInvocations.length - 1] = x,
|
3554
|
+
u.toolInvocations[u.toolInvocations.length - 1] = x, y(b.toolCallId, x), I();
|
3550
3555
|
}
|
3551
3556
|
}
|
3552
3557
|
},
|
@@ -3566,7 +3571,7 @@ async function bl({
|
|
3566
3571
|
state: "result",
|
3567
3572
|
...b
|
3568
3573
|
};
|
3569
|
-
_[k] = x,
|
3574
|
+
_[k] = x, y(b.toolCallId, x), I();
|
3570
3575
|
},
|
3571
3576
|
onDataPart(b) {
|
3572
3577
|
w.push(...b), I();
|
@@ -3575,7 +3580,7 @@ async function bl({
|
|
3575
3580
|
v == null ? v = [...b] : v.push(...b), I();
|
3576
3581
|
},
|
3577
3582
|
onFinishStepPart(b) {
|
3578
|
-
f += 1, h = b.isContinued ? h : void 0, m = void 0,
|
3583
|
+
f += 1, h = b.isContinued ? h : void 0, m = void 0, g = void 0;
|
3579
3584
|
},
|
3580
3585
|
onStartStepPart(b) {
|
3581
3586
|
d || (u.id = b.messageId), u.parts.push({ type: "step-start" }), I();
|
@@ -3605,7 +3610,7 @@ async function wl({
|
|
3605
3610
|
update: t,
|
3606
3611
|
onFinish: r,
|
3607
3612
|
getCurrentDate: a = () => /* @__PURE__ */ new Date(),
|
3608
|
-
generateId: n =
|
3613
|
+
generateId: n = ta
|
3609
3614
|
}) {
|
3610
3615
|
const s = { type: "text", text: "" }, o = {
|
3611
3616
|
id: n(),
|
@@ -3644,16 +3649,16 @@ async function kl({
|
|
3644
3649
|
generateId: u,
|
3645
3650
|
fetch: h = El(),
|
3646
3651
|
lastMessage: m,
|
3647
|
-
requestType:
|
3652
|
+
requestType: g = "generate"
|
3648
3653
|
}) {
|
3649
|
-
var
|
3650
|
-
const S = await (
|
3654
|
+
var y, w, v;
|
3655
|
+
const S = await (g === "resume" ? h(`${e}?chatId=${t.id}`, {
|
3651
3656
|
method: "GET",
|
3652
3657
|
headers: {
|
3653
3658
|
"Content-Type": "application/json",
|
3654
3659
|
...n
|
3655
3660
|
},
|
3656
|
-
signal: (
|
3661
|
+
signal: (y = s?.()) == null ? void 0 : y.signal,
|
3657
3662
|
credentials: a
|
3658
3663
|
}) : h(e, {
|
3659
3664
|
method: "POST",
|
@@ -3708,7 +3713,7 @@ async function kl({
|
|
3708
3713
|
}
|
3709
3714
|
}
|
3710
3715
|
}
|
3711
|
-
function
|
3716
|
+
function Ar(e) {
|
3712
3717
|
return e?.reduce((t, r) => {
|
3713
3718
|
var a;
|
3714
3719
|
return Math.max(t, (a = r.step) != null ? a : 0);
|
@@ -3731,13 +3736,13 @@ function ys(e) {
|
|
3731
3736
|
...e.content ? [{ type: "text", text: e.content }] : []
|
3732
3737
|
];
|
3733
3738
|
}
|
3734
|
-
function
|
3739
|
+
function sr(e) {
|
3735
3740
|
return e.map((t) => ({
|
3736
3741
|
...t,
|
3737
3742
|
parts: ys(t)
|
3738
3743
|
}));
|
3739
3744
|
}
|
3740
|
-
function
|
3745
|
+
function Nr(e, t) {
|
3741
3746
|
if (e === t)
|
3742
3747
|
return !0;
|
3743
3748
|
if (e == null || t == null)
|
@@ -3752,7 +3757,7 @@ function Ar(e, t) {
|
|
3752
3757
|
if (e.length !== t.length)
|
3753
3758
|
return !1;
|
3754
3759
|
for (let n = 0; n < e.length; n++)
|
3755
|
-
if (!
|
3760
|
+
if (!Nr(e[n], t[n]))
|
3756
3761
|
return !1;
|
3757
3762
|
return !0;
|
3758
3763
|
}
|
@@ -3760,11 +3765,11 @@ function Ar(e, t) {
|
|
3760
3765
|
if (r.length !== a.length)
|
3761
3766
|
return !1;
|
3762
3767
|
for (const n of r)
|
3763
|
-
if (!a.includes(n) || !
|
3768
|
+
if (!a.includes(n) || !Nr(e[n], t[n]))
|
3764
3769
|
return !1;
|
3765
3770
|
return !0;
|
3766
3771
|
}
|
3767
|
-
async function
|
3772
|
+
async function Ka(e) {
|
3768
3773
|
if (!e)
|
3769
3774
|
return [];
|
3770
3775
|
if (globalThis.FileList && e instanceof globalThis.FileList)
|
@@ -3800,9 +3805,9 @@ function _l({
|
|
3800
3805
|
// check if the feature is enabled:
|
3801
3806
|
r > 1 && // ensure there is a last message:
|
3802
3807
|
s != null && // ensure we actually have new steps (to prevent infinite loops in case of errors):
|
3803
|
-
(a.length > t ||
|
3808
|
+
(a.length > t || Ar(s.toolInvocations) !== e) && // check that next step is possible:
|
3804
3809
|
bs(s) && // limit the number of automatic steps:
|
3805
|
-
((n =
|
3810
|
+
((n = Ar(s.toolInvocations)) != null ? n : 0) < r
|
3806
3811
|
);
|
3807
3812
|
}
|
3808
3813
|
function bs(e) {
|
@@ -3831,7 +3836,7 @@ function Sl({
|
|
3831
3836
|
(c) => c.toolCallId === t ? o : c
|
3832
3837
|
);
|
3833
3838
|
}
|
3834
|
-
var It = { exports: {} },
|
3839
|
+
var It = { exports: {} }, or = {};
|
3835
3840
|
/**
|
3836
3841
|
* @license React
|
3837
3842
|
* use-sync-external-store-shim.production.js
|
@@ -3841,26 +3846,26 @@ var It = { exports: {} }, sr = {};
|
|
3841
3846
|
* This source code is licensed under the MIT license found in the
|
3842
3847
|
* LICENSE file in the root directory of this source tree.
|
3843
3848
|
*/
|
3844
|
-
var
|
3849
|
+
var Ja;
|
3845
3850
|
function Tl() {
|
3846
|
-
if (
|
3847
|
-
|
3851
|
+
if (Ja) return or;
|
3852
|
+
Ja = 1;
|
3848
3853
|
var e = Z;
|
3849
3854
|
function t(u, h) {
|
3850
3855
|
return u === h && (u !== 0 || 1 / u === 1 / h) || u !== u && h !== h;
|
3851
3856
|
}
|
3852
3857
|
var r = typeof Object.is == "function" ? Object.is : t, a = e.useState, n = e.useEffect, s = e.useLayoutEffect, o = e.useDebugValue;
|
3853
3858
|
function c(u, h) {
|
3854
|
-
var m = h(),
|
3859
|
+
var m = h(), g = a({ inst: { value: m, getSnapshot: h } }), y = g[0].inst, w = g[1];
|
3855
3860
|
return s(
|
3856
3861
|
function() {
|
3857
|
-
|
3862
|
+
y.value = m, y.getSnapshot = h, l(y) && w({ inst: y });
|
3858
3863
|
},
|
3859
3864
|
[u, m, h]
|
3860
3865
|
), n(
|
3861
3866
|
function() {
|
3862
|
-
return l(
|
3863
|
-
l(
|
3867
|
+
return l(y) && w({ inst: y }), u(function() {
|
3868
|
+
l(y) && w({ inst: y });
|
3864
3869
|
});
|
3865
3870
|
},
|
3866
3871
|
[u]
|
@@ -3880,9 +3885,9 @@ function Tl() {
|
|
3880
3885
|
return h();
|
3881
3886
|
}
|
3882
3887
|
var f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : c;
|
3883
|
-
return
|
3888
|
+
return or.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : f, or;
|
3884
3889
|
}
|
3885
|
-
var
|
3890
|
+
var ir = {};
|
3886
3891
|
/**
|
3887
3892
|
* @license React
|
3888
3893
|
* use-sync-external-store-shim.development.js
|
@@ -3892,32 +3897,32 @@ var or = {};
|
|
3892
3897
|
* This source code is licensed under the MIT license found in the
|
3893
3898
|
* LICENSE file in the root directory of this source tree.
|
3894
3899
|
*/
|
3895
|
-
var
|
3900
|
+
var qa;
|
3896
3901
|
function Cl() {
|
3897
|
-
return
|
3898
|
-
function e(m,
|
3899
|
-
return m ===
|
3902
|
+
return qa || (qa = 1, process.env.NODE_ENV !== "production" && function() {
|
3903
|
+
function e(m, g) {
|
3904
|
+
return m === g && (m !== 0 || 1 / m === 1 / g) || m !== m && g !== g;
|
3900
3905
|
}
|
3901
|
-
function t(m,
|
3906
|
+
function t(m, g) {
|
3902
3907
|
f || n.startTransition === void 0 || (f = !0, console.error(
|
3903
3908
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
3904
3909
|
));
|
3905
|
-
var
|
3910
|
+
var y = g();
|
3906
3911
|
if (!u) {
|
3907
|
-
var w =
|
3908
|
-
s(
|
3912
|
+
var w = g();
|
3913
|
+
s(y, w) || (console.error(
|
3909
3914
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
3910
3915
|
), u = !0);
|
3911
3916
|
}
|
3912
3917
|
w = o({
|
3913
|
-
inst: { value:
|
3918
|
+
inst: { value: y, getSnapshot: g }
|
3914
3919
|
});
|
3915
3920
|
var v = w[0].inst, C = w[1];
|
3916
3921
|
return l(
|
3917
3922
|
function() {
|
3918
|
-
v.value =
|
3923
|
+
v.value = y, v.getSnapshot = g, r(v) && C({ inst: v });
|
3919
3924
|
},
|
3920
|
-
[m,
|
3925
|
+
[m, y, g]
|
3921
3926
|
), c(
|
3922
3927
|
function() {
|
3923
3928
|
return r(v) && C({ inst: v }), m(function() {
|
@@ -3925,34 +3930,34 @@ function Cl() {
|
|
3925
3930
|
});
|
3926
3931
|
},
|
3927
3932
|
[m]
|
3928
|
-
), d(
|
3933
|
+
), d(y), y;
|
3929
3934
|
}
|
3930
3935
|
function r(m) {
|
3931
|
-
var
|
3936
|
+
var g = m.getSnapshot;
|
3932
3937
|
m = m.value;
|
3933
3938
|
try {
|
3934
|
-
var
|
3935
|
-
return !s(m,
|
3939
|
+
var y = g();
|
3940
|
+
return !s(m, y);
|
3936
3941
|
} catch {
|
3937
3942
|
return !0;
|
3938
3943
|
}
|
3939
3944
|
}
|
3940
|
-
function a(m,
|
3941
|
-
return
|
3945
|
+
function a(m, g) {
|
3946
|
+
return g();
|
3942
3947
|
}
|
3943
3948
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
3944
3949
|
var n = Z, s = typeof Object.is == "function" ? Object.is : e, o = n.useState, c = n.useEffect, l = n.useLayoutEffect, d = n.useDebugValue, f = !1, u = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? a : t;
|
3945
|
-
|
3946
|
-
}()),
|
3950
|
+
ir.useSyncExternalStore = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
3951
|
+
}()), ir;
|
3947
3952
|
}
|
3948
|
-
var
|
3953
|
+
var Ya;
|
3949
3954
|
function Il() {
|
3950
|
-
return
|
3955
|
+
return Ya || (Ya = 1, process.env.NODE_ENV === "production" ? It.exports = /* @__PURE__ */ Tl() : It.exports = /* @__PURE__ */ Cl()), It.exports;
|
3951
3956
|
}
|
3952
3957
|
var xl = /* @__PURE__ */ Il();
|
3953
|
-
const vs = 0, ws = 1, Es = 2,
|
3954
|
-
var
|
3955
|
-
function
|
3958
|
+
const vs = 0, ws = 1, Es = 2, Qa = 3;
|
3959
|
+
var Xa = Object.prototype.hasOwnProperty;
|
3960
|
+
function Or(e, t) {
|
3956
3961
|
var r, a;
|
3957
3962
|
if (e === t) return !0;
|
3958
3963
|
if (e && t && (r = e.constructor) === t.constructor) {
|
@@ -3960,13 +3965,13 @@ function Nr(e, t) {
|
|
3960
3965
|
if (r === RegExp) return e.toString() === t.toString();
|
3961
3966
|
if (r === Array) {
|
3962
3967
|
if ((a = e.length) === t.length)
|
3963
|
-
for (; a-- &&
|
3968
|
+
for (; a-- && Or(e[a], t[a]); ) ;
|
3964
3969
|
return a === -1;
|
3965
3970
|
}
|
3966
3971
|
if (!r || typeof e == "object") {
|
3967
3972
|
a = 0;
|
3968
3973
|
for (r in e)
|
3969
|
-
if (
|
3974
|
+
if (Xa.call(e, r) && ++a && !Xa.call(t, r) || !(r in t) || !Or(e[r], t[r])) return !1;
|
3970
3975
|
return Object.keys(t).length === a;
|
3971
3976
|
}
|
3972
3977
|
}
|
@@ -3976,47 +3981,47 @@ const Ne = /* @__PURE__ */ new WeakMap(), Le = () => {
|
|
3976
3981
|
}, de = (
|
3977
3982
|
/*#__NOINLINE__*/
|
3978
3983
|
Le()
|
3979
|
-
),
|
3984
|
+
), $r = Object, G = (e) => e === de, Se = (e) => typeof e == "function", He = (e, t) => ({
|
3980
3985
|
...e,
|
3981
3986
|
...t
|
3982
|
-
}), ks = (e) => Se(e.then),
|
3987
|
+
}), ks = (e) => Se(e.then), cr = {}, xt = {}, aa = "undefined", wt = typeof window != aa, Pr = typeof document != aa, Rl = wt && "Deno" in window, Al = () => wt && typeof window.requestAnimationFrame != aa, _s = (e, t) => {
|
3983
3988
|
const r = Ne.get(e);
|
3984
3989
|
return [
|
3985
3990
|
// Getter
|
3986
|
-
() => !G(t) && e.get(t) ||
|
3991
|
+
() => !G(t) && e.get(t) || cr,
|
3987
3992
|
// Setter
|
3988
3993
|
(a) => {
|
3989
3994
|
if (!G(t)) {
|
3990
3995
|
const n = e.get(t);
|
3991
|
-
t in xt || (xt[t] = n), r[5](t, He(n, a), n ||
|
3996
|
+
t in xt || (xt[t] = n), r[5](t, He(n, a), n || cr);
|
3992
3997
|
}
|
3993
3998
|
},
|
3994
3999
|
// Subscriber
|
3995
4000
|
r[6],
|
3996
4001
|
// Get server cache snapshot
|
3997
|
-
() => !G(t) && t in xt ? xt[t] : !G(t) && e.get(t) ||
|
4002
|
+
() => !G(t) && t in xt ? xt[t] : !G(t) && e.get(t) || cr
|
3998
4003
|
];
|
3999
4004
|
};
|
4000
|
-
let
|
4001
|
-
const Nl = () =>
|
4005
|
+
let Mr = !0;
|
4006
|
+
const Nl = () => Mr, [Lr, Dr] = wt && window.addEventListener ? [
|
4002
4007
|
window.addEventListener.bind(window),
|
4003
4008
|
window.removeEventListener.bind(window)
|
4004
4009
|
] : [
|
4005
4010
|
Le,
|
4006
4011
|
Le
|
4007
4012
|
], Ol = () => {
|
4008
|
-
const e =
|
4013
|
+
const e = Pr && document.visibilityState;
|
4009
4014
|
return G(e) || e !== "hidden";
|
4010
|
-
}, $l = (e) => (
|
4011
|
-
|
4015
|
+
}, $l = (e) => (Pr && document.addEventListener("visibilitychange", e), Lr("focus", e), () => {
|
4016
|
+
Pr && document.removeEventListener("visibilitychange", e), Dr("focus", e);
|
4012
4017
|
}), Pl = (e) => {
|
4013
4018
|
const t = () => {
|
4014
|
-
|
4019
|
+
Mr = !0, e();
|
4015
4020
|
}, r = () => {
|
4016
|
-
|
4021
|
+
Mr = !1;
|
4017
4022
|
};
|
4018
|
-
return
|
4019
|
-
|
4023
|
+
return Lr("online", t), Lr("offline", r), () => {
|
4024
|
+
Dr("online", t), Dr("offline", r);
|
4020
4025
|
};
|
4021
4026
|
}, Ml = {
|
4022
4027
|
isOnline: Nl,
|
@@ -4024,32 +4029,32 @@ const Nl = () => Pr, [Mr, Lr] = wt && window.addEventListener ? [
|
|
4024
4029
|
}, Ll = {
|
4025
4030
|
initFocus: $l,
|
4026
4031
|
initReconnect: Pl
|
4027
|
-
},
|
4032
|
+
}, Za = !Z.useId, bt = !wt || Rl, Dl = (e) => Al() ? window.requestAnimationFrame(e) : setTimeout(e, 1), lr = bt ? $ : Oe, dr = typeof navigator < "u" && navigator.connection, en = !bt && dr && ([
|
4028
4033
|
"slow-2g",
|
4029
4034
|
"2g"
|
4030
|
-
].includes(
|
4035
|
+
].includes(dr.effectiveType) || dr.saveData), Rt = /* @__PURE__ */ new WeakMap(), Bl = (e) => $r.prototype.toString.call(e), ur = (e, t) => e === `[object ${t}]`;
|
4031
4036
|
let Ul = 0;
|
4032
|
-
const
|
4033
|
-
const t = typeof e, r = Bl(e), a =
|
4037
|
+
const Br = (e) => {
|
4038
|
+
const t = typeof e, r = Bl(e), a = ur(r, "Date"), n = ur(r, "RegExp"), s = ur(r, "Object");
|
4034
4039
|
let o, c;
|
4035
|
-
if (
|
4040
|
+
if ($r(e) === e && !a && !n) {
|
4036
4041
|
if (o = Rt.get(e), o) return o;
|
4037
4042
|
if (o = ++Ul + "~", Rt.set(e, o), Array.isArray(e)) {
|
4038
4043
|
for (o = "@", c = 0; c < e.length; c++)
|
4039
|
-
o +=
|
4044
|
+
o += Br(e[c]) + ",";
|
4040
4045
|
Rt.set(e, o);
|
4041
4046
|
}
|
4042
4047
|
if (s) {
|
4043
4048
|
o = "#";
|
4044
|
-
const l =
|
4049
|
+
const l = $r.keys(e).sort();
|
4045
4050
|
for (; !G(c = l.pop()); )
|
4046
|
-
G(e[c]) || (o += c + ":" +
|
4051
|
+
G(e[c]) || (o += c + ":" + Br(e[c]) + ",");
|
4047
4052
|
Rt.set(e, o);
|
4048
4053
|
}
|
4049
4054
|
} else
|
4050
4055
|
o = a ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
|
4051
4056
|
return o;
|
4052
|
-
},
|
4057
|
+
}, na = (e) => {
|
4053
4058
|
if (Se(e))
|
4054
4059
|
try {
|
4055
4060
|
e = e();
|
@@ -4057,13 +4062,13 @@ const Dr = (e) => {
|
|
4057
4062
|
e = "";
|
4058
4063
|
}
|
4059
4064
|
const t = e;
|
4060
|
-
return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ?
|
4065
|
+
return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? Br(e) : "", [
|
4061
4066
|
e,
|
4062
4067
|
t
|
4063
4068
|
];
|
4064
4069
|
};
|
4065
4070
|
let Hl = 0;
|
4066
|
-
const
|
4071
|
+
const Ur = () => ++Hl;
|
4067
4072
|
async function Ss(...e) {
|
4068
4073
|
const [t, r, a, n] = e, s = He({
|
4069
4074
|
populateCache: !0,
|
@@ -4076,30 +4081,30 @@ async function Ss(...e) {
|
|
4076
4081
|
let l = s.optimisticData;
|
4077
4082
|
const d = (h) => typeof c == "function" ? c(h) : c !== !1, f = s.throwOnError;
|
4078
4083
|
if (Se(r)) {
|
4079
|
-
const h = r, m = [],
|
4080
|
-
for (const
|
4084
|
+
const h = r, m = [], g = t.keys();
|
4085
|
+
for (const y of g)
|
4081
4086
|
// Skip the special useSWRInfinite and useSWRSubscription keys.
|
4082
|
-
!/^\$(inf|sub)\$/.test(
|
4087
|
+
!/^\$(inf|sub)\$/.test(y) && h(t.get(y)._k) && m.push(y);
|
4083
4088
|
return Promise.all(m.map(u));
|
4084
4089
|
}
|
4085
4090
|
return u(r);
|
4086
4091
|
async function u(h) {
|
4087
|
-
const [m] =
|
4092
|
+
const [m] = na(h);
|
4088
4093
|
if (!m) return;
|
4089
|
-
const [
|
4094
|
+
const [g, y] = _s(t, m), [w, v, C, S] = Ne.get(t), O = () => {
|
4090
4095
|
const P = w[m];
|
4091
|
-
return (Se(s.revalidate) ? s.revalidate(
|
4096
|
+
return (Se(s.revalidate) ? s.revalidate(g().data, h) : s.revalidate !== !1) && (delete C[m], delete S[m], P && P[0]) ? P[0](Es).then(() => g().data) : g().data;
|
4092
4097
|
};
|
4093
4098
|
if (e.length < 3)
|
4094
4099
|
return O();
|
4095
4100
|
let I = a, b, _ = !1;
|
4096
|
-
const k =
|
4101
|
+
const k = Ur();
|
4097
4102
|
v[m] = [
|
4098
4103
|
k,
|
4099
4104
|
0
|
4100
4105
|
];
|
4101
|
-
const x = !G(l), E =
|
4102
|
-
if (x && (l = Se(l) ? l(W, F) : l,
|
4106
|
+
const x = !G(l), E = g(), F = E.data, A = E._c, W = G(A) ? F : A;
|
4107
|
+
if (x && (l = Se(l) ? l(W, F) : l, y({
|
4103
4108
|
data: l,
|
4104
4109
|
_c: W
|
4105
4110
|
})), Se(I))
|
@@ -4114,26 +4119,26 @@ async function Ss(...e) {
|
|
4114
4119
|
}), k !== v[m][0]) {
|
4115
4120
|
if (_) throw b;
|
4116
4121
|
return I;
|
4117
|
-
} else _ && x && d(b) && (o = !0,
|
4122
|
+
} else _ && x && d(b) && (o = !0, y({
|
4118
4123
|
data: W,
|
4119
4124
|
_c: de
|
4120
4125
|
}));
|
4121
4126
|
if (o && !_)
|
4122
4127
|
if (Se(o)) {
|
4123
4128
|
const P = o(I, W);
|
4124
|
-
|
4129
|
+
y({
|
4125
4130
|
data: P,
|
4126
4131
|
error: de,
|
4127
4132
|
_c: de
|
4128
4133
|
});
|
4129
4134
|
} else
|
4130
|
-
|
4135
|
+
y({
|
4131
4136
|
data: I,
|
4132
4137
|
error: de,
|
4133
4138
|
_c: de
|
4134
4139
|
});
|
4135
|
-
if (v[m][1] =
|
4136
|
-
|
4140
|
+
if (v[m][1] = Ur(), Promise.resolve(O()).then(() => {
|
4141
|
+
y({
|
4137
4142
|
_c: de
|
4138
4143
|
});
|
4139
4144
|
}), _) {
|
@@ -4143,7 +4148,7 @@ async function Ss(...e) {
|
|
4143
4148
|
return I;
|
4144
4149
|
}
|
4145
4150
|
}
|
4146
|
-
const
|
4151
|
+
const tn = (e, t) => {
|
4147
4152
|
for (const r in e)
|
4148
4153
|
e[r][0] && e[r][0](t);
|
4149
4154
|
}, Vl = (e, t) => {
|
@@ -4157,8 +4162,8 @@ const en = (e, t) => {
|
|
4157
4162
|
e.set(f, u);
|
4158
4163
|
const m = o[f];
|
4159
4164
|
if (m)
|
4160
|
-
for (const
|
4161
|
-
|
4165
|
+
for (const g of m)
|
4166
|
+
g(u, h);
|
4162
4167
|
}, d = () => {
|
4163
4168
|
if (!Ne.has(e) && (Ne.set(e, [
|
4164
4169
|
a,
|
@@ -4169,7 +4174,7 @@ const en = (e, t) => {
|
|
4169
4174
|
l,
|
4170
4175
|
c
|
4171
4176
|
]), !bt)) {
|
4172
|
-
const f = r.initFocus(setTimeout.bind(de,
|
4177
|
+
const f = r.initFocus(setTimeout.bind(de, tn.bind(de, a, vs))), u = r.initReconnect(setTimeout.bind(de, tn.bind(de, a, ws)));
|
4173
4178
|
s = () => {
|
4174
4179
|
f && f(), u && u(), Ne.delete(e);
|
4175
4180
|
};
|
@@ -4189,7 +4194,7 @@ const en = (e, t) => {
|
|
4189
4194
|
}, zl = (e, t, r, a, n) => {
|
4190
4195
|
const s = r.errorRetryCount, o = n.retryCount, c = ~~((Math.random() + 0.5) * (1 << (o < 8 ? o : 8))) * r.errorRetryInterval;
|
4191
4196
|
!G(s) && o > s || setTimeout(a, c, n);
|
4192
|
-
}, Fl =
|
4197
|
+
}, Fl = Or, [Ts, Wl] = Vl(/* @__PURE__ */ new Map()), jl = He(
|
4193
4198
|
{
|
4194
4199
|
// events
|
4195
4200
|
onLoadingSlow: Le,
|
@@ -4203,10 +4208,10 @@ const en = (e, t) => {
|
|
4203
4208
|
revalidateIfStale: !0,
|
4204
4209
|
shouldRetryOnError: !0,
|
4205
4210
|
// timeouts
|
4206
|
-
errorRetryInterval:
|
4211
|
+
errorRetryInterval: en ? 1e4 : 5e3,
|
4207
4212
|
focusThrottleInterval: 5 * 1e3,
|
4208
4213
|
dedupingInterval: 2 * 1e3,
|
4209
|
-
loadingTimeout:
|
4214
|
+
loadingTimeout: en ? 5e3 : 3e3,
|
4210
4215
|
// providers
|
4211
4216
|
compare: Fl,
|
4212
4217
|
isPaused: () => !1,
|
@@ -4234,7 +4239,7 @@ const en = (e, t) => {
|
|
4234
4239
|
null,
|
4235
4240
|
(e[1] === null ? e[2] : e[1]) || {}
|
4236
4241
|
], Xl = () => He(jl, X(Kl)), Zl = (e) => (t, r, a) => e(t, r && ((...s) => {
|
4237
|
-
const [o] =
|
4242
|
+
const [o] = na(t), [, , , c] = Ne.get(Ts);
|
4238
4243
|
if (o.startsWith(Jl))
|
4239
4244
|
return r(...s);
|
4240
4245
|
const l = c[o];
|
@@ -4254,7 +4259,7 @@ const en = (e, t) => {
|
|
4254
4259
|
};
|
4255
4260
|
};
|
4256
4261
|
Yl();
|
4257
|
-
const
|
4262
|
+
const hr = Z.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
|
4258
4263
|
// and emitting an error.
|
4259
4264
|
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
|
4260
4265
|
// https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
|
@@ -4273,10 +4278,10 @@ const ur = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4273
4278
|
e.status = "rejected", e.reason = t;
|
4274
4279
|
}), e;
|
4275
4280
|
}
|
4276
|
-
}),
|
4281
|
+
}), fr = {
|
4277
4282
|
dedupe: !0
|
4278
4283
|
}, ad = (e, t, r) => {
|
4279
|
-
const { cache: a, compare: n, suspense: s, fallbackData: o, revalidateOnMount: c, revalidateIfStale: l, refreshInterval: d, refreshWhenHidden: f, refreshWhenOffline: u, keepPreviousData: h } = r, [m,
|
4284
|
+
const { cache: a, compare: n, suspense: s, fallbackData: o, revalidateOnMount: c, revalidateIfStale: l, refreshInterval: d, refreshWhenHidden: f, refreshWhenOffline: u, keepPreviousData: h } = r, [m, g, y, w] = Ne.get(a), [v, C] = na(e), S = R(!1), O = R(!1), I = R(v), b = R(t), _ = R(r), k = () => _.current, x = () => k().isVisible() && k().isOnline(), [E, F, A, W] = _s(a, v), P = R({}).current, J = G(o) ? G(r.fallback) ? de : r.fallback[v] : o, Q = (D, N) => {
|
4280
4285
|
for (const j in P) {
|
4281
4286
|
const H = j;
|
4282
4287
|
if (H === "data") {
|
@@ -4315,20 +4320,20 @@ const ur = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4315
4320
|
a,
|
4316
4321
|
v
|
4317
4322
|
]
|
4318
|
-
), L[0], L[1]), q = !S.current, B = m[v] && m[v].length > 0, ge = M.data, ve = G(ge) ? J && ks(J) ?
|
4323
|
+
), L[0], L[1]), q = !S.current, B = m[v] && m[v].length > 0, ge = M.data, ve = G(ge) ? J && ks(J) ? hr(J) : J : ge, Pe = M.error, We = R(ve), Me = h ? G(ge) ? G(We.current) ? ve : We.current : ge : ve, je = B && !G(Pe) ? !1 : q && !G(c) ? c : k().isPaused() ? !1 : s ? G(ve) ? !1 : l : G(ve) || l, _e = !!(v && t && q && je), K = G(M.isValidating) ? _e : M.isValidating, se = G(M.isLoading) ? _e : M.isLoading, ie = V(
|
4319
4324
|
async (D) => {
|
4320
4325
|
const N = b.current;
|
4321
4326
|
if (!v || !N || O.current || k().isPaused())
|
4322
4327
|
return !1;
|
4323
4328
|
let j, H, ne = !0;
|
4324
|
-
const fe = D || {}, te = !
|
4329
|
+
const fe = D || {}, te = !y[v] || !fe.dedupe, ee = () => Za ? !O.current && v === I.current && S.current : v === I.current, me = {
|
4325
4330
|
isValidating: !1,
|
4326
4331
|
isLoading: !1
|
4327
4332
|
}, Et = () => {
|
4328
4333
|
F(me);
|
4329
4334
|
}, kt = () => {
|
4330
|
-
const le =
|
4331
|
-
le && le[1] === H && delete
|
4335
|
+
const le = y[v];
|
4336
|
+
le && le[1] === H && delete y[v];
|
4332
4337
|
}, _t = {
|
4333
4338
|
isValidating: !0
|
4334
4339
|
};
|
@@ -4336,13 +4341,13 @@ const ur = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4336
4341
|
try {
|
4337
4342
|
if (te && (F(_t), r.loadingTimeout && G(E().data) && setTimeout(() => {
|
4338
4343
|
ne && ee() && k().onLoadingSlow(v, r);
|
4339
|
-
}, r.loadingTimeout),
|
4344
|
+
}, r.loadingTimeout), y[v] = [
|
4340
4345
|
N(C),
|
4341
|
-
|
4342
|
-
]), [j, H] =
|
4346
|
+
Ur()
|
4347
|
+
]), [j, H] = y[v], j = await j, te && setTimeout(kt, r.dedupingInterval), !y[v] || y[v][1] !== H)
|
4343
4348
|
return te && ee() && k().onDiscarded(v), !1;
|
4344
4349
|
me.error = de;
|
4345
|
-
const le =
|
4350
|
+
const le = g[v];
|
4346
4351
|
if (!G(le) && // case 1
|
4347
4352
|
(H <= le[0] || // case 2
|
4348
4353
|
H <= le[1] || // case 3
|
@@ -4353,9 +4358,9 @@ const ur = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4353
4358
|
} catch (le) {
|
4354
4359
|
kt();
|
4355
4360
|
const pe = k(), { shouldRetryOnError: Ie } = pe;
|
4356
|
-
pe.isPaused() || (me.error = le, te && ee() && (pe.onError(le, v, pe), (Ie === !0 || Se(Ie) && Ie(le)) && (!k().revalidateOnFocus || !k().revalidateOnReconnect || x()) && pe.onErrorRetry(le, v, pe, (
|
4357
|
-
const
|
4358
|
-
|
4361
|
+
pe.isPaused() || (me.error = le, te && ee() && (pe.onError(le, v, pe), (Ie === !0 || Se(Ie) && Ie(le)) && (!k().revalidateOnFocus || !k().revalidateOnReconnect || x()) && pe.onErrorRetry(le, v, pe, (Ze) => {
|
4362
|
+
const et = m[v];
|
4363
|
+
et && et[0] && et[0](Qa, Ze);
|
4359
4364
|
}, {
|
4360
4365
|
retryCount: (fe.retryCount || 0) + 1,
|
4361
4366
|
dedupe: !0
|
@@ -4384,11 +4389,11 @@ const ur = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4384
4389
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
4385
4390
|
[]
|
4386
4391
|
);
|
4387
|
-
if (
|
4392
|
+
if (lr(() => {
|
4388
4393
|
b.current = t, _.current = r, G(ge) || (We.current = ge);
|
4389
|
-
}),
|
4394
|
+
}), lr(() => {
|
4390
4395
|
if (!v) return;
|
4391
|
-
const D = ie.bind(de,
|
4396
|
+
const D = ie.bind(de, fr);
|
4392
4397
|
let N = 0;
|
4393
4398
|
k().revalidateOnFocus && (N = Date.now() + k().focusThrottleInterval);
|
4394
4399
|
const H = rd(v, m, (ne, fe = {}) => {
|
@@ -4400,25 +4405,25 @@ const ur = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4400
4405
|
else {
|
4401
4406
|
if (ne == Es)
|
4402
4407
|
return ie();
|
4403
|
-
if (ne ==
|
4408
|
+
if (ne == Qa)
|
4404
4409
|
return ie(fe);
|
4405
4410
|
}
|
4406
4411
|
});
|
4407
4412
|
return O.current = !1, I.current = v, S.current = !0, F({
|
4408
4413
|
_k: C
|
4409
|
-
}), je && (
|
4414
|
+
}), je && (y[v] || (G(ve) || bt ? D() : Dl(D))), () => {
|
4410
4415
|
O.current = !0, H();
|
4411
4416
|
};
|
4412
4417
|
}, [
|
4413
4418
|
v
|
4414
|
-
]),
|
4419
|
+
]), lr(() => {
|
4415
4420
|
let D;
|
4416
4421
|
function N() {
|
4417
4422
|
const H = Se(d) ? d(E().data) : d;
|
4418
4423
|
H && D !== -1 && (D = setTimeout(j, H));
|
4419
4424
|
}
|
4420
4425
|
function j() {
|
4421
|
-
!E().error && (f || k().isVisible()) && (u || k().isOnline()) ? ie(
|
4426
|
+
!E().error && (f || k().isVisible()) && (u || k().isOnline()) ? ie(fr).then(N) : N();
|
4422
4427
|
}
|
4423
4428
|
return N(), () => {
|
4424
4429
|
D && (clearTimeout(D), D = -1);
|
@@ -4429,17 +4434,17 @@ const ur = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4429
4434
|
u,
|
4430
4435
|
v
|
4431
4436
|
]), Do(Me), s && G(ve) && v) {
|
4432
|
-
if (!
|
4437
|
+
if (!Za && bt)
|
4433
4438
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
4434
4439
|
b.current = t, _.current = r, O.current = !1;
|
4435
4440
|
const D = w[v];
|
4436
4441
|
if (!G(D)) {
|
4437
4442
|
const N = ye(D);
|
4438
|
-
|
4443
|
+
hr(N);
|
4439
4444
|
}
|
4440
4445
|
if (G(Pe)) {
|
4441
|
-
const N = ie(
|
4442
|
-
G(Me) || (N.status = "fulfilled", N.value = !0),
|
4446
|
+
const N = ie(fr);
|
4447
|
+
G(Me) || (N.status = "fulfilled", N.value = !0), hr(N);
|
4443
4448
|
} else
|
4444
4449
|
throw Pe;
|
4445
4450
|
}
|
@@ -4459,10 +4464,10 @@ const ur = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4459
4464
|
}
|
4460
4465
|
};
|
4461
4466
|
}, At = td(ad);
|
4462
|
-
var
|
4467
|
+
var mr, rn;
|
4463
4468
|
function nd() {
|
4464
|
-
if (
|
4465
|
-
|
4469
|
+
if (rn) return mr;
|
4470
|
+
rn = 1;
|
4466
4471
|
function e(t, r) {
|
4467
4472
|
if (typeof t != "function")
|
4468
4473
|
throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof t}\`.`);
|
@@ -4475,17 +4480,17 @@ function nd() {
|
|
4475
4480
|
}, d);
|
4476
4481
|
};
|
4477
4482
|
}
|
4478
|
-
return
|
4483
|
+
return mr = e, mr;
|
4479
4484
|
}
|
4480
4485
|
var sd = /* @__PURE__ */ nd();
|
4481
4486
|
const od = /* @__PURE__ */ gs(sd);
|
4482
|
-
function
|
4487
|
+
function an(e, t) {
|
4483
4488
|
return t != null ? od(e, t) : e;
|
4484
4489
|
}
|
4485
4490
|
function id(e) {
|
4486
4491
|
const [t, r] = z(e);
|
4487
4492
|
return $(() => {
|
4488
|
-
|
4493
|
+
Nr(e, t) || r(e);
|
4489
4494
|
}, [e, t]), t;
|
4490
4495
|
}
|
4491
4496
|
function cd({
|
@@ -4503,14 +4508,14 @@ function cd({
|
|
4503
4508
|
onError: u,
|
4504
4509
|
credentials: h,
|
4505
4510
|
headers: m,
|
4506
|
-
body:
|
4507
|
-
generateId:
|
4511
|
+
body: g,
|
4512
|
+
generateId: y = ta,
|
4508
4513
|
fetch: w,
|
4509
4514
|
keepLastMessageOnError: v = !0,
|
4510
4515
|
experimental_throttle: C
|
4511
4516
|
} = {}) {
|
4512
|
-
const [S] = z(
|
4513
|
-
() =>
|
4517
|
+
const [S] = z(y), O = t ?? S, I = typeof e == "string" ? [e, O] : O, b = id(r ?? []), _ = he(
|
4518
|
+
() => sr(b),
|
4514
4519
|
[b]
|
4515
4520
|
), { data: k, mutate: x } = At(
|
4516
4521
|
[I, "messages"],
|
@@ -4527,26 +4532,26 @@ function cd({
|
|
4527
4532
|
const { data: P = "ready", mutate: J } = At([I, "status"], null), { data: Q = void 0, mutate: L } = At([I, "error"], null), M = R(null), q = R({
|
4528
4533
|
credentials: h,
|
4529
4534
|
headers: m,
|
4530
|
-
body:
|
4535
|
+
body: g
|
4531
4536
|
});
|
4532
4537
|
$(() => {
|
4533
4538
|
q.current = {
|
4534
4539
|
credentials: h,
|
4535
4540
|
headers: m,
|
4536
|
-
body:
|
4541
|
+
body: g
|
4537
4542
|
};
|
4538
|
-
}, [h, m,
|
4543
|
+
}, [h, m, g]);
|
4539
4544
|
const B = V(
|
4540
4545
|
async (U, D = "generate") => {
|
4541
4546
|
var N, j;
|
4542
4547
|
J("submitted"), L(void 0);
|
4543
|
-
const H =
|
4548
|
+
const H = sr(U.messages), ne = H.length, fe = Ar(
|
4544
4549
|
(N = H[H.length - 1]) == null ? void 0 : N.toolInvocations
|
4545
4550
|
);
|
4546
4551
|
try {
|
4547
4552
|
const ee = new AbortController();
|
4548
4553
|
M.current = ee;
|
4549
|
-
const me =
|
4554
|
+
const me = an(x, C), Et = an(
|
4550
4555
|
A,
|
4551
4556
|
C
|
4552
4557
|
), kt = E.current;
|
@@ -4555,21 +4560,21 @@ function cd({
|
|
4555
4560
|
({
|
4556
4561
|
role: pe,
|
4557
4562
|
content: Ie,
|
4558
|
-
experimental_attachments:
|
4559
|
-
data:
|
4560
|
-
annotations:
|
4561
|
-
toolInvocations:
|
4562
|
-
parts:
|
4563
|
+
experimental_attachments: Ze,
|
4564
|
+
data: et,
|
4565
|
+
annotations: ba,
|
4566
|
+
toolInvocations: va,
|
4567
|
+
parts: wa
|
4563
4568
|
}) => ({
|
4564
4569
|
role: pe,
|
4565
4570
|
content: Ie,
|
4566
|
-
...
|
4567
|
-
experimental_attachments:
|
4571
|
+
...Ze !== void 0 && {
|
4572
|
+
experimental_attachments: Ze
|
4568
4573
|
},
|
4569
|
-
...
|
4570
|
-
...
|
4571
|
-
...
|
4572
|
-
...
|
4574
|
+
...et !== void 0 && { data: et },
|
4575
|
+
...ba !== void 0 && { annotations: ba },
|
4576
|
+
...va !== void 0 && { toolInvocations: va },
|
4577
|
+
...wa !== void 0 && { parts: wa }
|
4573
4578
|
})
|
4574
4579
|
), le = W.current;
|
4575
4580
|
await kl({
|
@@ -4597,10 +4602,10 @@ function cd({
|
|
4597
4602
|
v || me(kt, !1);
|
4598
4603
|
},
|
4599
4604
|
onResponse: d,
|
4600
|
-
onUpdate({ message: pe, data: Ie, replaceLastMessage:
|
4605
|
+
onUpdate({ message: pe, data: Ie, replaceLastMessage: Ze }) {
|
4601
4606
|
J("streaming"), me(
|
4602
4607
|
[
|
4603
|
-
...
|
4608
|
+
...Ze ? H.slice(0, H.length - 1) : H,
|
4604
4609
|
pe
|
4605
4610
|
],
|
4606
4611
|
!1
|
@@ -4611,7 +4616,7 @@ function cd({
|
|
4611
4616
|
},
|
4612
4617
|
onToolCall: s,
|
4613
4618
|
onFinish: f,
|
4614
|
-
generateId:
|
4619
|
+
generateId: y,
|
4615
4620
|
fetch: w,
|
4616
4621
|
lastMessage: H[H.length - 1],
|
4617
4622
|
requestType: D
|
@@ -4647,7 +4652,7 @@ function cd({
|
|
4647
4652
|
c,
|
4648
4653
|
E,
|
4649
4654
|
M,
|
4650
|
-
|
4655
|
+
y,
|
4651
4656
|
w,
|
4652
4657
|
v,
|
4653
4658
|
C,
|
@@ -4661,18 +4666,18 @@ function cd({
|
|
4661
4666
|
experimental_attachments: H = U.experimental_attachments
|
4662
4667
|
} = {}) => {
|
4663
4668
|
var ne, fe;
|
4664
|
-
const te = await
|
4669
|
+
const te = await Ka(
|
4665
4670
|
H
|
4666
4671
|
), ee = E.current.concat({
|
4667
4672
|
...U,
|
4668
|
-
id: (ne = U.id) != null ? ne :
|
4673
|
+
id: (ne = U.id) != null ? ne : y(),
|
4669
4674
|
createdAt: (fe = U.createdAt) != null ? fe : /* @__PURE__ */ new Date(),
|
4670
4675
|
experimental_attachments: te.length > 0 ? te : void 0,
|
4671
4676
|
parts: ys(U)
|
4672
4677
|
});
|
4673
4678
|
return B({ messages: ee, headers: N, body: j, data: D });
|
4674
4679
|
},
|
4675
|
-
[B,
|
4680
|
+
[B, y]
|
4676
4681
|
), ve = V(
|
4677
4682
|
async ({ data: U, headers: D, body: N } = {}) => {
|
4678
4683
|
const j = E.current;
|
@@ -4695,7 +4700,7 @@ function cd({
|
|
4695
4700
|
}, [B]), Me = V(
|
4696
4701
|
(U) => {
|
4697
4702
|
typeof U == "function" && (U = U(E.current));
|
4698
|
-
const D =
|
4703
|
+
const D = sr(U);
|
4699
4704
|
x(D, !1), E.current = D;
|
4700
4705
|
},
|
4701
4706
|
[x]
|
@@ -4713,11 +4718,11 @@ function cd({
|
|
4713
4718
|
...q.current,
|
4714
4719
|
...N
|
4715
4720
|
});
|
4716
|
-
const H = await
|
4721
|
+
const H = await Ka(
|
4717
4722
|
D.experimental_attachments
|
4718
4723
|
), fe = {
|
4719
4724
|
messages: E.current.concat({
|
4720
|
-
id:
|
4725
|
+
id: y(),
|
4721
4726
|
createdAt: /* @__PURE__ */ new Date(),
|
4722
4727
|
role: "user",
|
4723
4728
|
content: _e,
|
@@ -4730,7 +4735,7 @@ function cd({
|
|
4730
4735
|
};
|
4731
4736
|
B(fe), K("");
|
4732
4737
|
},
|
4733
|
-
[_e,
|
4738
|
+
[_e, y, B]
|
4734
4739
|
), ie = (U) => {
|
4735
4740
|
K(U.target.value);
|
4736
4741
|
}, ye = V(
|
@@ -4773,13 +4778,13 @@ function cd({
|
|
4773
4778
|
addToolResult: ye
|
4774
4779
|
};
|
4775
4780
|
}
|
4776
|
-
const
|
4781
|
+
const nn = () => ({
|
4777
4782
|
onFinish: /* @__PURE__ */ new Set(),
|
4778
4783
|
onError: /* @__PURE__ */ new Set(),
|
4779
4784
|
onResponse: /* @__PURE__ */ new Set(),
|
4780
4785
|
onToolCall: /* @__PURE__ */ new Set()
|
4781
4786
|
}), Is = An(null);
|
4782
|
-
function
|
4787
|
+
function Xe(e = {}) {
|
4783
4788
|
const t = X(Is);
|
4784
4789
|
if (!t)
|
4785
4790
|
throw new Error("useAiChat must be used within a AiChatProvider");
|
@@ -4797,9 +4802,9 @@ function ld({
|
|
4797
4802
|
children: e,
|
4798
4803
|
value: t
|
4799
4804
|
}) {
|
4800
|
-
const r = R(
|
4805
|
+
const r = R(nn());
|
4801
4806
|
$(() => {
|
4802
|
-
r.current =
|
4807
|
+
r.current = nn();
|
4803
4808
|
}, [t]);
|
4804
4809
|
const a = V(
|
4805
4810
|
(...l) => {
|
@@ -4843,12 +4848,12 @@ function ld({
|
|
4843
4848
|
}
|
4844
4849
|
);
|
4845
4850
|
}
|
4846
|
-
const dd = "z-20", ud = "z-10", hd = "user",
|
4851
|
+
const dd = "z-20", ud = "z-10", hd = "user", qt = "assistant", sa = "OpenAI", xs = "Anthropic", Rs = "Google", fd = "Perplexity", md = sa, pd = "claude-sonnet-4", gd = "claude-3", yd = "gpt-4", bd = "o3", vd = "o4", wd = "gemini", Ed = "sonar", kd = {
|
4847
4852
|
[xs]: [
|
4848
4853
|
pd,
|
4849
4854
|
gd
|
4850
4855
|
],
|
4851
|
-
[
|
4856
|
+
[sa]: [
|
4852
4857
|
yd,
|
4853
4858
|
bd,
|
4854
4859
|
vd
|
@@ -4864,11 +4869,11 @@ const dd = "z-20", ud = "z-10", hd = "user", Jt = "assistant", na = "OpenAI", xs
|
|
4864
4869
|
if (r.some((a) => e.startsWith(a)))
|
4865
4870
|
return t;
|
4866
4871
|
return null;
|
4867
|
-
},
|
4872
|
+
}, oa = Z.createContext({
|
4868
4873
|
state: { searchString: "", sortedCell: "", sortDirection: "" },
|
4869
4874
|
dispatch: () => {
|
4870
4875
|
}
|
4871
|
-
}),
|
4876
|
+
}), ia = Z.createContext({
|
4872
4877
|
state: { prompt: "", lastTriggeredTimestamp: 0 },
|
4873
4878
|
dispatch: () => {
|
4874
4879
|
}
|
@@ -4892,9 +4897,9 @@ const dd = "z-20", ud = "z-10", hd = "user", Jt = "assistant", na = "OpenAI", xs
|
|
4892
4897
|
},
|
4893
4898
|
setInitialMessages: () => {
|
4894
4899
|
}
|
4895
|
-
}),
|
4900
|
+
}), ca = Z.createContext({
|
4896
4901
|
state: {
|
4897
|
-
footerPosition:
|
4902
|
+
footerPosition: Kt,
|
4898
4903
|
footerHeight: 0,
|
4899
4904
|
footerOffset: 0
|
4900
4905
|
},
|
@@ -4917,7 +4922,7 @@ try {
|
|
4917
4922
|
}
|
4918
4923
|
const tm = {
|
4919
4924
|
PASSKEY: "passkey"
|
4920
|
-
},
|
4925
|
+
}, nt = {
|
4921
4926
|
ALG: "RS256",
|
4922
4927
|
SCOPES_KEY: "scopes",
|
4923
4928
|
SCOPE_KEY: "scope",
|
@@ -4946,7 +4951,7 @@ function xd(e) {
|
|
4946
4951
|
r[a] = t.charCodeAt(a);
|
4947
4952
|
return r;
|
4948
4953
|
}
|
4949
|
-
function
|
4954
|
+
function Ht(e) {
|
4950
4955
|
if (Uint8Array.fromBase64)
|
4951
4956
|
return Uint8Array.fromBase64(typeof e == "string" ? e : vt.decode(e), {
|
4952
4957
|
alphabet: "base64url"
|
@@ -4972,12 +4977,12 @@ class Ee extends Fe {
|
|
4972
4977
|
}
|
4973
4978
|
}
|
4974
4979
|
ae(Ee, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
|
4975
|
-
let
|
4980
|
+
let Hr = class extends Fe {
|
4976
4981
|
constructor(t, r, a = "unspecified", n = "unspecified") {
|
4977
4982
|
super(t, { cause: { claim: a, reason: n, payload: r } }), ae(this, "code", "ERR_JWT_EXPIRED"), ae(this, "claim"), ae(this, "reason"), ae(this, "payload"), this.claim = a, this.reason = n, this.payload = r;
|
4978
4983
|
}
|
4979
4984
|
};
|
4980
|
-
ae(
|
4985
|
+
ae(Hr, "code", "ERR_JWT_EXPIRED");
|
4981
4986
|
let Ns = class extends Fe {
|
4982
4987
|
constructor() {
|
4983
4988
|
super(...arguments), ae(this, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
|
@@ -4996,12 +5001,12 @@ class oe extends Fe {
|
|
4996
5001
|
}
|
4997
5002
|
}
|
4998
5003
|
ae(oe, "code", "ERR_JWS_INVALID");
|
4999
|
-
let
|
5004
|
+
let la = class extends Fe {
|
5000
5005
|
constructor() {
|
5001
5006
|
super(...arguments), ae(this, "code", "ERR_JWT_INVALID");
|
5002
5007
|
}
|
5003
5008
|
};
|
5004
|
-
ae(
|
5009
|
+
ae(la, "code", "ERR_JWT_INVALID");
|
5005
5010
|
let Os = class extends Fe {
|
5006
5011
|
constructor(t = "signature verification failed", r) {
|
5007
5012
|
super(t, r), ae(this, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
|
@@ -5011,10 +5016,10 @@ ae(Os, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
|
|
5011
5016
|
function xe(e, t = "algorithm.name") {
|
5012
5017
|
return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
|
5013
5018
|
}
|
5014
|
-
function
|
5019
|
+
function ht(e, t) {
|
5015
5020
|
return e.name === t;
|
5016
5021
|
}
|
5017
|
-
function
|
5022
|
+
function pr(e) {
|
5018
5023
|
return parseInt(e.name.slice(4), 10);
|
5019
5024
|
}
|
5020
5025
|
function Rd(e) {
|
@@ -5038,43 +5043,43 @@ function Nd(e, t, r) {
|
|
5038
5043
|
case "HS256":
|
5039
5044
|
case "HS384":
|
5040
5045
|
case "HS512": {
|
5041
|
-
if (!
|
5046
|
+
if (!ht(e.algorithm, "HMAC"))
|
5042
5047
|
throw xe("HMAC");
|
5043
5048
|
const a = parseInt(t.slice(2), 10);
|
5044
|
-
if (
|
5049
|
+
if (pr(e.algorithm.hash) !== a)
|
5045
5050
|
throw xe(`SHA-${a}`, "algorithm.hash");
|
5046
5051
|
break;
|
5047
5052
|
}
|
5048
5053
|
case "RS256":
|
5049
5054
|
case "RS384":
|
5050
5055
|
case "RS512": {
|
5051
|
-
if (!
|
5056
|
+
if (!ht(e.algorithm, "RSASSA-PKCS1-v1_5"))
|
5052
5057
|
throw xe("RSASSA-PKCS1-v1_5");
|
5053
5058
|
const a = parseInt(t.slice(2), 10);
|
5054
|
-
if (
|
5059
|
+
if (pr(e.algorithm.hash) !== a)
|
5055
5060
|
throw xe(`SHA-${a}`, "algorithm.hash");
|
5056
5061
|
break;
|
5057
5062
|
}
|
5058
5063
|
case "PS256":
|
5059
5064
|
case "PS384":
|
5060
5065
|
case "PS512": {
|
5061
|
-
if (!
|
5066
|
+
if (!ht(e.algorithm, "RSA-PSS"))
|
5062
5067
|
throw xe("RSA-PSS");
|
5063
5068
|
const a = parseInt(t.slice(2), 10);
|
5064
|
-
if (
|
5069
|
+
if (pr(e.algorithm.hash) !== a)
|
5065
5070
|
throw xe(`SHA-${a}`, "algorithm.hash");
|
5066
5071
|
break;
|
5067
5072
|
}
|
5068
5073
|
case "Ed25519":
|
5069
5074
|
case "EdDSA": {
|
5070
|
-
if (!
|
5075
|
+
if (!ht(e.algorithm, "Ed25519"))
|
5071
5076
|
throw xe("Ed25519");
|
5072
5077
|
break;
|
5073
5078
|
}
|
5074
5079
|
case "ES256":
|
5075
5080
|
case "ES384":
|
5076
5081
|
case "ES512": {
|
5077
|
-
if (!
|
5082
|
+
if (!ht(e.algorithm, "ECDSA"))
|
5078
5083
|
throw xe("ECDSA");
|
5079
5084
|
const a = Rd(t);
|
5080
5085
|
if (e.algorithm.namedCurve !== a)
|
@@ -5126,7 +5131,7 @@ const Ds = (e) => Ms(e) || Ls(e), $d = (...e) => {
|
|
5126
5131
|
function Pd(e) {
|
5127
5132
|
return typeof e == "object" && e !== null;
|
5128
5133
|
}
|
5129
|
-
const
|
5134
|
+
const Yt = (e) => {
|
5130
5135
|
if (!Pd(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
5131
5136
|
return !1;
|
5132
5137
|
if (Object.getPrototypeOf(e) === null)
|
@@ -5141,20 +5146,20 @@ const qt = (e) => {
|
|
5141
5146
|
if (typeof r != "number" || r < 2048)
|
5142
5147
|
throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
|
5143
5148
|
}
|
5144
|
-
},
|
5149
|
+
}, Vt = (e, t, r = 0) => {
|
5145
5150
|
r === 0 && (t.unshift(t.length), t.unshift(6));
|
5146
5151
|
const a = e.indexOf(t[0], r);
|
5147
5152
|
if (a === -1)
|
5148
5153
|
return !1;
|
5149
5154
|
const n = e.subarray(a, a + t.length);
|
5150
|
-
return n.length !== t.length ? !1 : n.every((s, o) => s === t[o]) ||
|
5155
|
+
return n.length !== t.length ? !1 : n.every((s, o) => s === t[o]) || Vt(e, t, a + 1);
|
5151
5156
|
}, Ld = (e) => {
|
5152
5157
|
switch (!0) {
|
5153
|
-
case
|
5158
|
+
case Vt(e, [42, 134, 72, 206, 61, 3, 1, 7]):
|
5154
5159
|
return "P-256";
|
5155
|
-
case
|
5160
|
+
case Vt(e, [43, 129, 4, 0, 34]):
|
5156
5161
|
return "P-384";
|
5157
|
-
case
|
5162
|
+
case Vt(e, [43, 129, 4, 0, 35]):
|
5158
5163
|
return "P-521";
|
5159
5164
|
default:
|
5160
5165
|
return;
|
@@ -5316,8 +5321,8 @@ const zd = (e, t, r, a, n) => {
|
|
5316
5321
|
if (t)
|
5317
5322
|
return new Set(t);
|
5318
5323
|
};
|
5319
|
-
function
|
5320
|
-
return
|
5324
|
+
function da(e) {
|
5325
|
+
return Yt(e) && typeof e.kty == "string";
|
5321
5326
|
}
|
5322
5327
|
function Wd(e) {
|
5323
5328
|
return e.kty !== "oct" && typeof e.d == "string";
|
@@ -5329,7 +5334,7 @@ function Gd(e) {
|
|
5329
5334
|
return e.kty === "oct" && typeof e.k == "string";
|
5330
5335
|
}
|
5331
5336
|
let Be;
|
5332
|
-
const
|
5337
|
+
const sn = async (e, t, r, a = !1) => {
|
5333
5338
|
Be || (Be = /* @__PURE__ */ new WeakMap());
|
5334
5339
|
let n = Be.get(e);
|
5335
5340
|
if (n != null && n[r])
|
@@ -5436,12 +5441,12 @@ const nn = async (e, t, r, a = !1) => {
|
|
5436
5441
|
throw a;
|
5437
5442
|
}
|
5438
5443
|
let r = e.export({ format: "jwk" });
|
5439
|
-
return
|
5444
|
+
return sn(e, r, t);
|
5440
5445
|
}
|
5441
|
-
if (
|
5442
|
-
return e.k ?
|
5446
|
+
if (da(e))
|
5447
|
+
return e.k ? Ht(e.k) : sn(e, e, t, !0);
|
5443
5448
|
throw new Error("unreachable");
|
5444
|
-
},
|
5449
|
+
}, tt = (e) => e?.[Symbol.toStringTag], Vr = (e, t, r) => {
|
5445
5450
|
var a, n;
|
5446
5451
|
if (t.use !== void 0) {
|
5447
5452
|
let s;
|
@@ -5487,47 +5492,47 @@ const nn = async (e, t, r, a = !1) => {
|
|
5487
5492
|
return !0;
|
5488
5493
|
}, qd = (e, t, r) => {
|
5489
5494
|
if (!(t instanceof Uint8Array)) {
|
5490
|
-
if (
|
5491
|
-
if (Gd(t) &&
|
5495
|
+
if (da(t)) {
|
5496
|
+
if (Gd(t) && Vr(e, t, r))
|
5492
5497
|
return;
|
5493
5498
|
throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present');
|
5494
5499
|
}
|
5495
5500
|
if (!Ds(t))
|
5496
5501
|
throw new TypeError(Ps(e, t, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array"));
|
5497
5502
|
if (t.type !== "secret")
|
5498
|
-
throw new TypeError(`${
|
5503
|
+
throw new TypeError(`${tt(t)} instances for symmetric algorithms must be of type "secret"`);
|
5499
5504
|
}
|
5500
5505
|
}, Yd = (e, t, r) => {
|
5501
|
-
if (
|
5506
|
+
if (da(t))
|
5502
5507
|
switch (r) {
|
5503
5508
|
case "decrypt":
|
5504
5509
|
case "sign":
|
5505
|
-
if (Wd(t) &&
|
5510
|
+
if (Wd(t) && Vr(e, t, r))
|
5506
5511
|
return;
|
5507
5512
|
throw new TypeError("JSON Web Key for this operation be a private JWK");
|
5508
5513
|
case "encrypt":
|
5509
5514
|
case "verify":
|
5510
|
-
if (jd(t) &&
|
5515
|
+
if (jd(t) && Vr(e, t, r))
|
5511
5516
|
return;
|
5512
5517
|
throw new TypeError("JSON Web Key for this operation be a public JWK");
|
5513
5518
|
}
|
5514
5519
|
if (!Ds(t))
|
5515
5520
|
throw new TypeError(Ps(e, t, "CryptoKey", "KeyObject", "JSON Web Key"));
|
5516
5521
|
if (t.type === "secret")
|
5517
|
-
throw new TypeError(`${
|
5522
|
+
throw new TypeError(`${tt(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
5518
5523
|
if (t.type === "public")
|
5519
5524
|
switch (r) {
|
5520
5525
|
case "sign":
|
5521
|
-
throw new TypeError(`${
|
5526
|
+
throw new TypeError(`${tt(t)} instances for asymmetric algorithm signing must be of type "private"`);
|
5522
5527
|
case "decrypt":
|
5523
|
-
throw new TypeError(`${
|
5528
|
+
throw new TypeError(`${tt(t)} instances for asymmetric algorithm decryption must be of type "private"`);
|
5524
5529
|
}
|
5525
5530
|
if (t.type === "private")
|
5526
5531
|
switch (r) {
|
5527
5532
|
case "verify":
|
5528
|
-
throw new TypeError(`${
|
5533
|
+
throw new TypeError(`${tt(t)} instances for asymmetric algorithm verifying must be of type "public"`);
|
5529
5534
|
case "encrypt":
|
5530
|
-
throw new TypeError(`${
|
5535
|
+
throw new TypeError(`${tt(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
5531
5536
|
}
|
5532
5537
|
}, Qd = (e, t, r) => {
|
5533
5538
|
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e) || /^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e) ? qd(e, t, r) : Yd(e, t, r);
|
@@ -5574,7 +5579,7 @@ const nn = async (e, t, r, a = !1) => {
|
|
5574
5579
|
}
|
5575
5580
|
};
|
5576
5581
|
async function tu(e, t, r) {
|
5577
|
-
if (!
|
5582
|
+
if (!Yt(e))
|
5578
5583
|
throw new oe("Flattened JWS must be an object");
|
5579
5584
|
if (e.protected === void 0 && e.header === void 0)
|
5580
5585
|
throw new oe('Flattened JWS must have either of the "protected" or "header" members');
|
@@ -5584,13 +5589,13 @@ async function tu(e, t, r) {
|
|
5584
5589
|
throw new oe("JWS Payload missing");
|
5585
5590
|
if (typeof e.signature != "string")
|
5586
5591
|
throw new oe("JWS Signature missing or incorrect type");
|
5587
|
-
if (e.header !== void 0 && !
|
5592
|
+
if (e.header !== void 0 && !Yt(e.header))
|
5588
5593
|
throw new oe("JWS Unprotected Header incorrect type");
|
5589
5594
|
let a = {};
|
5590
5595
|
if (e.protected)
|
5591
5596
|
try {
|
5592
|
-
const
|
5593
|
-
a = JSON.parse(vt.decode(
|
5597
|
+
const y = Ht(e.protected);
|
5598
|
+
a = JSON.parse(vt.decode(y));
|
5594
5599
|
} catch {
|
5595
5600
|
throw new oe("JWS Protected Header is invalid");
|
5596
5601
|
}
|
@@ -5619,7 +5624,7 @@ async function tu(e, t, r) {
|
|
5619
5624
|
const f = Id(Nt.encode(e.protected ?? ""), Nt.encode("."), typeof e.payload == "string" ? Nt.encode(e.payload) : e.payload);
|
5620
5625
|
let u;
|
5621
5626
|
try {
|
5622
|
-
u =
|
5627
|
+
u = Ht(e.signature);
|
5623
5628
|
} catch {
|
5624
5629
|
throw new oe("Failed to base64url decode the signature");
|
5625
5630
|
}
|
@@ -5629,13 +5634,13 @@ async function tu(e, t, r) {
|
|
5629
5634
|
let m;
|
5630
5635
|
if (o)
|
5631
5636
|
try {
|
5632
|
-
m =
|
5637
|
+
m = Ht(e.payload);
|
5633
5638
|
} catch {
|
5634
5639
|
throw new oe("Failed to base64url decode the payload");
|
5635
5640
|
}
|
5636
5641
|
else typeof e.payload == "string" ? m = Nt.encode(e.payload) : m = e.payload;
|
5637
|
-
const
|
5638
|
-
return e.protected !== void 0 && (
|
5642
|
+
const g = { payload: m };
|
5643
|
+
return e.protected !== void 0 && (g.protectedHeader = a), e.header !== void 0 && (g.unprotectedHeader = e.header), d ? { ...g, key: h } : g;
|
5639
5644
|
}
|
5640
5645
|
async function ru(e, t, r) {
|
5641
5646
|
if (e instanceof Uint8Array && (e = vt.decode(e)), typeof e != "string")
|
@@ -5646,7 +5651,7 @@ async function ru(e, t, r) {
|
|
5646
5651
|
const c = await tu({ payload: n, protected: a, signature: s }, t, r), l = { payload: c.payload, protectedHeader: c.protectedHeader };
|
5647
5652
|
return typeof t == "function" ? { ...l, key: c.key } : l;
|
5648
5653
|
}
|
5649
|
-
const au = (e) => Math.floor(e.getTime() / 1e3), Bs = 60, Us = Bs * 60,
|
5654
|
+
const au = (e) => Math.floor(e.getTime() / 1e3), Bs = 60, Us = Bs * 60, ua = Us * 24, nu = ua * 7, su = ua * 365.25, ou = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, on = (e) => {
|
5650
5655
|
const t = ou.exec(e);
|
5651
5656
|
if (!t || t[4] && t[1])
|
5652
5657
|
throw new TypeError("Invalid time period format");
|
@@ -5677,7 +5682,7 @@ const au = (e) => Math.floor(e.getTime() / 1e3), Bs = 60, Us = Bs * 60, da = Us
|
|
5677
5682
|
case "day":
|
5678
5683
|
case "days":
|
5679
5684
|
case "d":
|
5680
|
-
n = Math.round(r *
|
5685
|
+
n = Math.round(r * ua);
|
5681
5686
|
break;
|
5682
5687
|
case "week":
|
5683
5688
|
case "weeks":
|
@@ -5689,23 +5694,23 @@ const au = (e) => Math.floor(e.getTime() / 1e3), Bs = 60, Us = Bs * 60, da = Us
|
|
5689
5694
|
break;
|
5690
5695
|
}
|
5691
5696
|
return t[1] === "-" || t[4] === "ago" ? -n : n;
|
5692
|
-
},
|
5697
|
+
}, cn = (e) => e.toLowerCase().replace(/^application\//, ""), iu = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1;
|
5693
5698
|
function cu(e, t, r = {}) {
|
5694
5699
|
let a;
|
5695
5700
|
try {
|
5696
5701
|
a = JSON.parse(vt.decode(t));
|
5697
5702
|
} catch {
|
5698
5703
|
}
|
5699
|
-
if (!
|
5700
|
-
throw new
|
5704
|
+
if (!Yt(a))
|
5705
|
+
throw new la("JWT Claims Set must be a top-level JSON object");
|
5701
5706
|
const { typ: n } = r;
|
5702
|
-
if (n && (typeof e.typ != "string" ||
|
5707
|
+
if (n && (typeof e.typ != "string" || cn(e.typ) !== cn(n)))
|
5703
5708
|
throw new Ee('unexpected "typ" JWT header value', a, "typ", "check_failed");
|
5704
5709
|
const { requiredClaims: s = [], issuer: o, subject: c, audience: l, maxTokenAge: d } = r, f = [...s];
|
5705
5710
|
d !== void 0 && f.push("iat"), l !== void 0 && f.push("aud"), c !== void 0 && f.push("sub"), o !== void 0 && f.push("iss");
|
5706
|
-
for (const
|
5707
|
-
if (!(
|
5708
|
-
throw new Ee(`missing required "${
|
5711
|
+
for (const g of new Set(f.reverse()))
|
5712
|
+
if (!(g in a))
|
5713
|
+
throw new Ee(`missing required "${g}" claim`, a, g, "missing");
|
5709
5714
|
if (o && !(Array.isArray(o) ? o : [o]).includes(a.iss))
|
5710
5715
|
throw new Ee('unexpected "iss" claim value', a, "iss", "check_failed");
|
5711
5716
|
if (c && a.sub !== c)
|
@@ -5715,7 +5720,7 @@ function cu(e, t, r = {}) {
|
|
5715
5720
|
let u;
|
5716
5721
|
switch (typeof r.clockTolerance) {
|
5717
5722
|
case "string":
|
5718
|
-
u =
|
5723
|
+
u = on(r.clockTolerance);
|
5719
5724
|
break;
|
5720
5725
|
case "number":
|
5721
5726
|
u = r.clockTolerance;
|
@@ -5739,13 +5744,13 @@ function cu(e, t, r = {}) {
|
|
5739
5744
|
if (typeof a.exp != "number")
|
5740
5745
|
throw new Ee('"exp" claim must be a number', a, "exp", "invalid");
|
5741
5746
|
if (a.exp <= m - u)
|
5742
|
-
throw new
|
5747
|
+
throw new Hr('"exp" claim timestamp check failed', a, "exp", "check_failed");
|
5743
5748
|
}
|
5744
5749
|
if (d) {
|
5745
|
-
const
|
5746
|
-
if (
|
5747
|
-
throw new
|
5748
|
-
if (
|
5750
|
+
const g = m - a.iat, y = typeof d == "number" ? d : on(d);
|
5751
|
+
if (g - u > y)
|
5752
|
+
throw new Hr('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
|
5753
|
+
if (g < 0 - u)
|
5749
5754
|
throw new Ee('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
|
5750
5755
|
}
|
5751
5756
|
return a;
|
@@ -5754,15 +5759,15 @@ async function lu(e, t, r) {
|
|
5754
5759
|
var a;
|
5755
5760
|
const n = await ru(e, t, r);
|
5756
5761
|
if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
|
5757
|
-
throw new
|
5762
|
+
throw new la("JWTs MUST NOT use unencoded payload");
|
5758
5763
|
const s = { payload: cu(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
|
5759
5764
|
return typeof t == "function" ? { ...s, key: n.key } : s;
|
5760
5765
|
}
|
5761
5766
|
const du = async (e) => {
|
5762
5767
|
try {
|
5763
|
-
const t =
|
5768
|
+
const t = nt.ALG, r = await Vd(Cd, t);
|
5764
5769
|
return await lu(e, r, {
|
5765
|
-
issuer:
|
5770
|
+
issuer: nt.ISSUER
|
5766
5771
|
});
|
5767
5772
|
} catch {
|
5768
5773
|
return;
|
@@ -5776,16 +5781,16 @@ const Hs = async (e, t) => {
|
|
5776
5781
|
if (!r || !r.payload)
|
5777
5782
|
return !1;
|
5778
5783
|
let a = [];
|
5779
|
-
if (Array.isArray(r.payload[
|
5780
|
-
a = r.payload[
|
5781
|
-
else if (typeof r.payload[
|
5782
|
-
a = r.payload[
|
5784
|
+
if (Array.isArray(r.payload[nt.SCOPES_KEY]))
|
5785
|
+
a = r.payload[nt.SCOPES_KEY];
|
5786
|
+
else if (typeof r.payload[nt.SCOPE_KEY] == "string")
|
5787
|
+
a = r.payload[nt.SCOPE_KEY].split(" ").filter((n) => n.trim() !== "");
|
5783
5788
|
else
|
5784
5789
|
return !1;
|
5785
5790
|
return Array.isArray(t) ? t.every((n) => a.includes(n)) : Object.keys(t).some(
|
5786
5791
|
(n) => t[n].every((s) => a.includes(s))
|
5787
5792
|
);
|
5788
|
-
}, hu = "av-tooltip", fu = "av-tooltip-arrow",
|
5793
|
+
}, hu = "av-tooltip", fu = "av-tooltip-arrow", ln = ["mousedown", "touchstart"];
|
5789
5794
|
function mu(e, t, r) {
|
5790
5795
|
const a = R(null);
|
5791
5796
|
return $(() => {
|
@@ -5798,10 +5803,10 @@ function mu(e, t, r) {
|
|
5798
5803
|
) && !c && e();
|
5799
5804
|
} else a.current && !a.current.contains(o) && e();
|
5800
5805
|
};
|
5801
|
-
return
|
5806
|
+
return ln.forEach(
|
5802
5807
|
(s) => document.addEventListener(s, n)
|
5803
5808
|
), () => {
|
5804
|
-
|
5809
|
+
ln.forEach(
|
5805
5810
|
(s) => document.removeEventListener(s, n)
|
5806
5811
|
);
|
5807
5812
|
};
|
@@ -5815,7 +5820,7 @@ function pu(e, t) {
|
|
5815
5820
|
}, []);
|
5816
5821
|
return $(() => (s.current = e, r && o(), c), [e, r, o, c]), { start: o, stop: c, active: r };
|
5817
5822
|
}
|
5818
|
-
const Ot = (e, t = "px") => typeof e > "u" ? "" : `${Math.round(e)}${t}`, gu = () => p("absolute top-0 left-0 w-max py-1 px-2 rounded-sm text-sm z-50"),
|
5823
|
+
const Ot = (e, t = "px") => typeof e > "u" ? "" : `${Math.round(e)}${t}`, gu = () => p("absolute top-0 left-0 w-max py-1 px-2 rounded-sm text-sm z-50"), dn = ({
|
5819
5824
|
mode: e
|
5820
5825
|
}) => p({
|
5821
5826
|
"bg-surface-darker": e === "dark" || e === "system",
|
@@ -5838,13 +5843,13 @@ const Ot = (e, t = "px") => typeof e > "u" ? "" : `${Math.round(e)}${t}`, gu = (
|
|
5838
5843
|
const n = p("relative inline-block", t), s = p(
|
5839
5844
|
hu,
|
5840
5845
|
gu(),
|
5841
|
-
|
5846
|
+
dn({ mode: e }),
|
5842
5847
|
yu({ mode: e }),
|
5843
5848
|
r
|
5844
5849
|
), o = p(
|
5845
5850
|
fu,
|
5846
5851
|
bu(),
|
5847
|
-
|
5852
|
+
dn({ mode: e }),
|
5848
5853
|
a
|
5849
5854
|
);
|
5850
5855
|
return { tooltip: s, arrow: o, wrapper: n };
|
@@ -5861,9 +5866,9 @@ const Ot = (e, t = "px") => typeof e > "u" ? "" : `${Math.round(e)}${t}`, gu = (
|
|
5861
5866
|
arrowClassName: c
|
5862
5867
|
}) => {
|
5863
5868
|
const l = mu(() => {
|
5864
|
-
|
5865
|
-
}), d = R(null), f = R(null), [u, h] = z(!1), [m,
|
5866
|
-
|
5869
|
+
y.stop(), g(!1);
|
5870
|
+
}), d = R(null), f = R(null), [u, h] = z(!1), [m, g] = z(!1), y = pu(() => {
|
5871
|
+
g(!1);
|
5867
5872
|
}, Eu), w = vu({
|
5868
5873
|
mode: a,
|
5869
5874
|
className: s,
|
@@ -5913,7 +5918,7 @@ const Ot = (e, t = "px") => typeof e > "u" ? "" : `${Math.round(e)}${t}`, gu = (
|
|
5913
5918
|
(async () => u && await C())();
|
5914
5919
|
}, [C, u]);
|
5915
5920
|
const S = () => {
|
5916
|
-
h(!1),
|
5921
|
+
h(!1), g(!0), y.start();
|
5917
5922
|
}, O = () => {
|
5918
5923
|
m || h(!0);
|
5919
5924
|
}, I = () => {
|
@@ -5983,7 +5988,7 @@ const ku = ({
|
|
5983
5988
|
);
|
5984
5989
|
function Vs(e, t) {
|
5985
5990
|
$(() => {
|
5986
|
-
if (
|
5991
|
+
if (Wt() && typeof window < "u")
|
5987
5992
|
return window.__VERSINI_CALLISTO_TAURI_EVENTS__ && (window.__VERSINI_CALLISTO_TAURI_EVENTS__[e] = t), () => {
|
5988
5993
|
window.__VERSINI_CALLISTO_TAURI_EVENTS__ && (window.__VERSINI_CALLISTO_TAURI_EVENTS__[e] = null);
|
5989
5994
|
};
|
@@ -5997,32 +6002,32 @@ const _u = ({
|
|
5997
6002
|
dispatch: n,
|
5998
6003
|
setChatId: s,
|
5999
6004
|
setInitialMessages: o
|
6000
|
-
} = X(be), { id: c, setInput: l, stop: d } =
|
6005
|
+
} = X(be), { id: c, setInput: l, stop: d } = Xe(), f = R(null), u = R(!1), h = V(() => {
|
6001
6006
|
s(Ue()), o([]), l(""), n({
|
6002
|
-
type:
|
6007
|
+
type: Qe,
|
6003
6008
|
payload: {
|
6004
6009
|
privateChat: !1,
|
6005
6010
|
reasoning: !1
|
6006
6011
|
}
|
6007
6012
|
}), n({
|
6008
|
-
type:
|
6013
|
+
type: st,
|
6009
6014
|
payload: {
|
6010
6015
|
attachments: 0
|
6011
6016
|
}
|
6012
6017
|
});
|
6013
6018
|
}, [s, o, l, n]);
|
6014
|
-
Vs("newChat", h),
|
6019
|
+
Vs("newChat", h), Yr(
|
6015
6020
|
[
|
6016
6021
|
[
|
6017
6022
|
"mod+N",
|
6018
6023
|
() => {
|
6019
|
-
|
6024
|
+
Wt() && h();
|
6020
6025
|
}
|
6021
6026
|
],
|
6022
6027
|
[
|
6023
6028
|
"mod+T",
|
6024
6029
|
() => {
|
6025
|
-
|
6030
|
+
Wt() && h();
|
6026
6031
|
}
|
6027
6032
|
]
|
6028
6033
|
],
|
@@ -6033,9 +6038,9 @@ const _u = ({
|
|
6033
6038
|
*/
|
6034
6039
|
[]
|
6035
6040
|
);
|
6036
|
-
const m = async (
|
6037
|
-
|
6038
|
-
type:
|
6041
|
+
const m = async (y) => {
|
6042
|
+
y.preventDefault(), d(), n({
|
6043
|
+
type: at,
|
6039
6044
|
payload: {
|
6040
6045
|
aborted: !0,
|
6041
6046
|
streaming: !1,
|
@@ -6044,7 +6049,7 @@ const _u = ({
|
|
6044
6049
|
});
|
6045
6050
|
try {
|
6046
6051
|
const w = await t();
|
6047
|
-
await fetch(`${
|
6052
|
+
await fetch(`${ea}/api/abort`, {
|
6048
6053
|
method: "POST",
|
6049
6054
|
headers: {
|
6050
6055
|
"Content-Type": "application/json",
|
@@ -6055,8 +6060,8 @@ const _u = ({
|
|
6055
6060
|
} catch (w) {
|
6056
6061
|
console.error("Failed to send abort signal:", w);
|
6057
6062
|
}
|
6058
|
-
},
|
6059
|
-
|
6063
|
+
}, g = (y) => {
|
6064
|
+
y.preventDefault(), h();
|
6060
6065
|
};
|
6061
6066
|
return $(() => {
|
6062
6067
|
Ae() || ((r === !0 || a === !0) && !u.current && f.current && (u.current = !0, f.current.focus()), r === !1 && u.current && (u.current = !1));
|
@@ -6075,13 +6080,13 @@ const _u = ({
|
|
6075
6080
|
focusMode: "light",
|
6076
6081
|
label: "New Chat",
|
6077
6082
|
ref: f,
|
6078
|
-
onClick: r || a ? m :
|
6083
|
+
onClick: r || a ? m : g,
|
6079
6084
|
children: r || a ? /* @__PURE__ */ i(pi, { size: Te, monotone: !0 }) : /* @__PURE__ */ i(yi, { size: Te })
|
6080
6085
|
}
|
6081
6086
|
)
|
6082
6087
|
}
|
6083
6088
|
);
|
6084
|
-
},
|
6089
|
+
}, un = "av-messagebox", $t = "av-panel", hn = "av-button", ha = "icon", zs = "button", zr = "link", Su = ({
|
6085
6090
|
type: e,
|
6086
6091
|
size: t,
|
6087
6092
|
labelRight: r,
|
@@ -6092,13 +6097,13 @@ const _u = ({
|
|
6092
6097
|
const o = "max-h-8 py-0 px-2", c = "max-h-9 h-8 px-3", l = "max-h-12 py-2 px-4";
|
6093
6098
|
switch (e) {
|
6094
6099
|
case zs:
|
6095
|
-
case
|
6100
|
+
case zr:
|
6096
6101
|
return p({
|
6097
6102
|
[o]: t === "small",
|
6098
6103
|
[c]: t === "medium",
|
6099
6104
|
[l]: t === "large"
|
6100
6105
|
});
|
6101
|
-
case
|
6106
|
+
case ha:
|
6102
6107
|
return p("flex items-center", {
|
6103
6108
|
"justify-center": n === "center",
|
6104
6109
|
"justify-start": n === "left",
|
@@ -6126,14 +6131,14 @@ const _u = ({
|
|
6126
6131
|
const n = "text-sm font-medium", s = "text-base font-medium", o = "text-lg font-medium";
|
6127
6132
|
switch (e) {
|
6128
6133
|
case zs:
|
6129
|
-
case
|
6134
|
+
case zr:
|
6130
6135
|
return p({
|
6131
|
-
"text-center": e ===
|
6136
|
+
"text-center": e === zr,
|
6132
6137
|
[n]: t === "small",
|
6133
6138
|
[s]: t === "medium",
|
6134
6139
|
[o]: t === "large"
|
6135
6140
|
});
|
6136
|
-
case
|
6141
|
+
case ha:
|
6137
6142
|
return p({
|
6138
6143
|
[n]: t === "small" && (r || a),
|
6139
6144
|
[s]: t === "medium" && (r || a),
|
@@ -6340,8 +6345,8 @@ const _u = ({
|
|
6340
6345
|
noBackground: u,
|
6341
6346
|
variant: h,
|
6342
6347
|
truncate: m,
|
6343
|
-
align:
|
6344
|
-
radius:
|
6348
|
+
align: g,
|
6349
|
+
radius: y,
|
6345
6350
|
animated: w
|
6346
6351
|
}) => (h || (h = "primary"), r ? p(hn, t) : p(
|
6347
6352
|
hn,
|
@@ -6352,13 +6357,13 @@ const _u = ({
|
|
6352
6357
|
truncate: m
|
6353
6358
|
}),
|
6354
6359
|
Iu({ mode: a, noBackground: u, variant: h }),
|
6355
|
-
xu({ radius:
|
6360
|
+
xu({ radius: y }),
|
6356
6361
|
Su({
|
6357
6362
|
type: e,
|
6358
6363
|
size: c,
|
6359
6364
|
labelRight: d,
|
6360
6365
|
labelLeft: f,
|
6361
|
-
align:
|
6366
|
+
align: g,
|
6362
6367
|
animated: w
|
6363
6368
|
}),
|
6364
6369
|
Tu({ type: e, size: c, labelRight: d, labelLeft: f }),
|
@@ -6414,7 +6419,7 @@ const Uu = {
|
|
6414
6419
|
bottom: 0,
|
6415
6420
|
right: 0
|
6416
6421
|
};
|
6417
|
-
function
|
6422
|
+
function gr(e) {
|
6418
6423
|
const t = Du(), r = R(0), a = R(null), [n, s] = z(Uu), o = he(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
|
6419
6424
|
const l = c[0];
|
6420
6425
|
l && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
@@ -6425,7 +6430,7 @@ function pr(e) {
|
|
6425
6430
|
o?.disconnect(), r.current && cancelAnimationFrame(r.current);
|
6426
6431
|
}), [o, e]), [a, n];
|
6427
6432
|
}
|
6428
|
-
const
|
6433
|
+
const Pt = {
|
6429
6434
|
small: 24,
|
6430
6435
|
// w-6
|
6431
6436
|
medium: 32,
|
@@ -6439,7 +6444,7 @@ const $t = {
|
|
6439
6444
|
// px-3 x 2
|
6440
6445
|
large: 32
|
6441
6446
|
// px-4 x 2
|
6442
|
-
}, Vu = 2, zu = 300,
|
6447
|
+
}, Vu = 2, zu = 300, fa = Z.forwardRef(
|
6443
6448
|
({
|
6444
6449
|
children: e,
|
6445
6450
|
disabled: t = !1,
|
@@ -6455,8 +6460,8 @@ const $t = {
|
|
6455
6460
|
size: u = "medium",
|
6456
6461
|
labelRight: h,
|
6457
6462
|
labelLeft: m,
|
6458
|
-
noBackground:
|
6459
|
-
align:
|
6463
|
+
noBackground: g = !1,
|
6464
|
+
align: y = "center",
|
6460
6465
|
radius: w = "large",
|
6461
6466
|
variant: v = "primary",
|
6462
6467
|
iconClassName: C,
|
@@ -6464,7 +6469,7 @@ const $t = {
|
|
6464
6469
|
...O
|
6465
6470
|
}, I) => {
|
6466
6471
|
const b = Mu({
|
6467
|
-
type:
|
6472
|
+
type: ha,
|
6468
6473
|
mode: r,
|
6469
6474
|
focusMode: a,
|
6470
6475
|
fullWidth: n,
|
@@ -6475,20 +6480,20 @@ const $t = {
|
|
6475
6480
|
size: u,
|
6476
6481
|
labelRight: h,
|
6477
6482
|
labelLeft: m,
|
6478
|
-
noBackground:
|
6479
|
-
align:
|
6483
|
+
noBackground: g,
|
6484
|
+
align: y,
|
6480
6485
|
radius: w,
|
6481
6486
|
variant: v,
|
6482
6487
|
animated: S
|
6483
|
-
}), _ = $u({ mode: r, raw: c, iconClassName: C }), k = Pu({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, F] =
|
6488
|
+
}), _ = $u({ mode: r, raw: c, iconClassName: C }), k = Pu({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, F] = gr(), [A, W] = gr(), [P, J] = gr(), Q = R(0), L = R(null), M = R(null), q = Bu([I, L]);
|
6484
6489
|
return Oe(() => {
|
6485
|
-
P && P.current && S && (Q.current = J.width + Hu[u] + (l ? 0 : Vu), L.current && !L.current.style.width && (L.current.style.width = `${
|
6490
|
+
P && P.current && S && (Q.current = J.width + Hu[u] + (l ? 0 : Vu), L.current && !L.current.style.width && (L.current.style.width = `${Pt[u]}px`));
|
6486
6491
|
}, [J, P, u, l, S]), Oe(() => {
|
6487
6492
|
if (L && L.current && S) {
|
6488
|
-
let B =
|
6489
|
-
h && E && F.width > 0 ? B = F.width + Q.current : m && A && W.width > 0 && (B = W.width + Q.current), M.current && clearTimeout(M.current), B !== parseInt(L.current.style.width || "0", 10) && (E.current && (E.current.style.opacity = "0"), A.current && (A.current.style.opacity = "0"), L.current.style.width = `${B}px`, B >
|
6493
|
+
let B = Pt[u];
|
6494
|
+
h && E && F.width > 0 ? B = F.width + Q.current : m && A && W.width > 0 && (B = W.width + Q.current), M.current && clearTimeout(M.current), B !== parseInt(L.current.style.width || "0", 10) && (E.current && (E.current.style.opacity = "0"), A.current && (A.current.style.opacity = "0"), L.current.style.width = `${B}px`, B > Pt[u] && (M.current = setTimeout(() => {
|
6490
6495
|
E.current && h && (E.current.style.opacity = "1"), A.current && m && (A.current.style.opacity = "1"), M.current = null;
|
6491
|
-
}, zu * 0.8))), B ===
|
6496
|
+
}, zu * 0.8))), B === Pt[u] && (E.current && (E.current.style.opacity = "0"), A.current && (A.current.style.opacity = "0"));
|
6492
6497
|
}
|
6493
6498
|
}, [
|
6494
6499
|
F,
|
@@ -6551,7 +6556,7 @@ const $t = {
|
|
6551
6556
|
children: r && /* @__PURE__ */ i("span", { className: a, children: r })
|
6552
6557
|
}
|
6553
6558
|
);
|
6554
|
-
|
6559
|
+
fa.displayName = "ButtonIcon";
|
6555
6560
|
/*!
|
6556
6561
|
@versini/ui-button v6.0.9
|
6557
6562
|
© 2025 gizmette.com
|
@@ -6559,7 +6564,7 @@ ha.displayName = "ButtonIcon";
|
|
6559
6564
|
try {
|
6560
6565
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
6561
6566
|
version: "6.0.9",
|
6562
|
-
buildTime: "08/04/2025
|
6567
|
+
buildTime: "08/04/2025 01:24 PM EDT",
|
6563
6568
|
homepage: "https://github.com/aversini/ui-components",
|
6564
6569
|
license: "MIT"
|
6565
6570
|
});
|
@@ -6591,7 +6596,7 @@ const Fu = Z.forwardRef(
|
|
6591
6596
|
}
|
6592
6597
|
) : "";
|
6593
6598
|
return /* @__PURE__ */ i("div", { className: o, children: /* @__PURE__ */ i(
|
6594
|
-
|
6599
|
+
fa,
|
6595
6600
|
{
|
6596
6601
|
className: p("justify-center", r),
|
6597
6602
|
ref: s,
|
@@ -6695,10 +6700,10 @@ function Gu({
|
|
6695
6700
|
onOpenChange: f
|
6696
6701
|
}), h = u.context, m = Un(h, {
|
6697
6702
|
enabled: t == null
|
6698
|
-
}),
|
6703
|
+
}), g = Hn(h, {
|
6699
6704
|
outsidePress: !1,
|
6700
6705
|
outsidePressEvent: "mousedown"
|
6701
|
-
}),
|
6706
|
+
}), y = Vn(h), w = zn([m, g, y]);
|
6702
6707
|
return Y.useMemo(
|
6703
6708
|
() => ({
|
6704
6709
|
open: d,
|
@@ -6713,7 +6718,7 @@ function Gu({
|
|
6713
6718
|
[d, f, w, u, s, c]
|
6714
6719
|
);
|
6715
6720
|
}
|
6716
|
-
const
|
6721
|
+
const Zt = () => {
|
6717
6722
|
const e = Y.useContext(Ws);
|
6718
6723
|
if (e == null)
|
6719
6724
|
throw new Error("Modal components must be wrapped in <Modal />");
|
@@ -6727,7 +6732,7 @@ function Ku({
|
|
6727
6732
|
return /* @__PURE__ */ i(Ws.Provider, { value: r, children: e });
|
6728
6733
|
}
|
6729
6734
|
const Ju = Y.forwardRef(function(e, t) {
|
6730
|
-
const { context: r, ...a } =
|
6735
|
+
const { context: r, ...a } = Zt(), n = Jr([a.refs.setFloating, t]);
|
6731
6736
|
if (!r.open)
|
6732
6737
|
return null;
|
6733
6738
|
const { overlayBackground: s, ...o } = e, c = p("grid place-items-center", {
|
@@ -6745,13 +6750,13 @@ const Ju = Y.forwardRef(function(e, t) {
|
|
6745
6750
|
}
|
6746
6751
|
) }) }) });
|
6747
6752
|
}), qu = Y.forwardRef(function({ children: e, ...t }, r) {
|
6748
|
-
const { setLabelId: a } =
|
6753
|
+
const { setLabelId: a } = Zt(), n = Kr();
|
6749
6754
|
return Y.useLayoutEffect(() => (a(n), () => a(void 0)), [n, a]), /* @__PURE__ */ i("h1", { ...t, ref: r, id: n, children: e });
|
6750
6755
|
}), Yu = Y.forwardRef(function({ children: e, ...t }, r) {
|
6751
|
-
const { setDescriptionId: a } =
|
6756
|
+
const { setDescriptionId: a } = Zt(), n = Kr();
|
6752
6757
|
return Y.useLayoutEffect(() => (a(n), () => a(void 0)), [n, a]), /* @__PURE__ */ i("div", { ...t, ref: r, id: n, children: e });
|
6753
6758
|
}), Qu = Y.forwardRef(function(e, t) {
|
6754
|
-
const { setOpen: r } =
|
6759
|
+
const { setOpen: r } = Zt(), { trigger: a, className: n, ...s } = e, o = Y.useCallback(() => r(!1), [r]);
|
6755
6760
|
return /* @__PURE__ */ i("div", { className: n, children: Y.cloneElement(a, {
|
6756
6761
|
ref: t,
|
6757
6762
|
onClick: o,
|
@@ -6765,29 +6770,32 @@ const Ju = Y.forwardRef(function(e, t) {
|
|
6765
6770
|
try {
|
6766
6771
|
window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
|
6767
6772
|
version: "2.0.5",
|
6768
|
-
buildTime: "08/04/2025
|
6773
|
+
buildTime: "08/04/2025 01:24 PM EDT",
|
6769
6774
|
homepage: "https://github.com/aversini/ui-components",
|
6770
6775
|
license: "MIT"
|
6771
6776
|
});
|
6772
6777
|
} catch {
|
6773
6778
|
}
|
6774
|
-
const
|
6779
|
+
const Ke = "panel", Mt = "messagebox", Xu = ({
|
6775
6780
|
className: e,
|
6776
6781
|
kind: t,
|
6777
6782
|
borderMode: r,
|
6778
|
-
animation: a
|
6783
|
+
animation: a,
|
6784
|
+
maxWidth: n = "medium"
|
6779
6785
|
}) => ({
|
6780
6786
|
main: p("prose prose-lighter flex flex-col bg-surface-medium", {
|
6781
6787
|
"duration-200 ease-out": a,
|
6782
|
-
[`${
|
6783
|
-
[`${
|
6784
|
-
[`${
|
6785
|
-
[`${
|
6788
|
+
[`${$t} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === Ke,
|
6789
|
+
[`${$t} w-full sm:w-[95%] md:max-w-2xl`]: t === Ke && !e && n === "small",
|
6790
|
+
[`${$t} w-full sm:w-[95%] md:max-w-3xl`]: t === Ke && !e && n === "medium",
|
6791
|
+
[`${$t} w-full sm:w-[95%] md:max-w-4xl`]: t === Ke && !e && n === "large",
|
6792
|
+
[`${un} rounded-lg border-2`]: t === Mt,
|
6793
|
+
[`${un} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === Mt && !e,
|
6786
6794
|
[`${e}`]: !!e,
|
6787
|
-
"sm:border-border-dark": r === "dark" && t ===
|
6788
|
-
"sm:border-border-accent": r === "light" && t ===
|
6789
|
-
"border-border-dark": r === "dark" && t ===
|
6790
|
-
"border-border-accent": r === "light" && t ===
|
6795
|
+
"sm:border-border-dark": r === "dark" && t === Ke,
|
6796
|
+
"sm:border-border-accent": r === "light" && t === Ke,
|
6797
|
+
"border-border-dark": r === "dark" && t === Mt,
|
6798
|
+
"border-border-accent": r === "light" && t === Mt
|
6791
6799
|
}),
|
6792
6800
|
content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
|
6793
6801
|
footer: "flex grow flex-col sm:p-4 p-2",
|
@@ -6800,32 +6808,34 @@ const pt = "panel", Pt = "messagebox", Xu = ({
|
|
6800
6808
|
children: a,
|
6801
6809
|
footer: n,
|
6802
6810
|
borderMode: s = "light",
|
6803
|
-
kind: o =
|
6811
|
+
kind: o = Ke,
|
6804
6812
|
className: c,
|
6805
6813
|
animation: l = !1,
|
6806
|
-
animationType: d = Zu
|
6814
|
+
animationType: d = Zu,
|
6815
|
+
maxWidth: f = "medium"
|
6807
6816
|
}) => {
|
6808
|
-
const
|
6817
|
+
const u = R(""), [h, m] = z(
|
6809
6818
|
l ? d === mn ? { opacity: 0 } : {
|
6810
6819
|
transform: "translateY(-100vh)"
|
6811
6820
|
} : {}
|
6812
|
-
),
|
6821
|
+
), g = Xu({
|
6813
6822
|
className: c,
|
6814
6823
|
kind: o,
|
6815
6824
|
borderMode: s,
|
6816
|
-
animation: l
|
6825
|
+
animation: l,
|
6826
|
+
maxWidth: f
|
6817
6827
|
});
|
6818
|
-
return $(() => (e && (
|
6819
|
-
e && (document.title =
|
6828
|
+
return $(() => (e && (u.current = document.title, document.title = `${r} | ${u.current}`), () => {
|
6829
|
+
e && (document.title = u.current);
|
6820
6830
|
}), [r, e]), $(() => {
|
6821
6831
|
if (l && e) {
|
6822
|
-
|
6832
|
+
m(
|
6823
6833
|
l ? d === mn ? { opacity: 0 } : {
|
6824
6834
|
transform: "translateY(-666vh)"
|
6825
6835
|
} : {}
|
6826
6836
|
);
|
6827
6837
|
const y = setTimeout(() => {
|
6828
|
-
|
6838
|
+
m(
|
6829
6839
|
l ? d === "fade" ? { opacity: 1 } : {
|
6830
6840
|
transform: "translateY(0)"
|
6831
6841
|
} : {}
|
@@ -6833,14 +6843,14 @@ const pt = "panel", Pt = "messagebox", Xu = ({
|
|
6833
6843
|
}, 100);
|
6834
6844
|
return () => clearTimeout(y);
|
6835
6845
|
}
|
6836
|
-
}, [e, l, d]), /* @__PURE__ */ i(ue, { children: e && /* @__PURE__ */ i(Ku, { open: e, onOpenChange: t, children: /* @__PURE__ */ T(Ju, { className:
|
6846
|
+
}, [e, l, d]), /* @__PURE__ */ i(ue, { children: e && /* @__PURE__ */ i(Ku, { open: e, onOpenChange: t, children: /* @__PURE__ */ T(Ju, { className: g.main, style: h, children: [
|
6837
6847
|
/* @__PURE__ */ T("div", { className: "flex flex-row-reverse items-center justify-between", children: [
|
6838
6848
|
/* @__PURE__ */ i(
|
6839
6849
|
Qu,
|
6840
6850
|
{
|
6841
|
-
className:
|
6851
|
+
className: g.close,
|
6842
6852
|
trigger: /* @__PURE__ */ i(
|
6843
|
-
|
6853
|
+
fa,
|
6844
6854
|
{
|
6845
6855
|
mode: "dark",
|
6846
6856
|
focusMode: "light",
|
@@ -6851,26 +6861,26 @@ const pt = "panel", Pt = "messagebox", Xu = ({
|
|
6851
6861
|
)
|
6852
6862
|
}
|
6853
6863
|
),
|
6854
|
-
/* @__PURE__ */ i(qu, { className:
|
6864
|
+
/* @__PURE__ */ i(qu, { className: g.header, children: r })
|
6855
6865
|
] }),
|
6856
|
-
/* @__PURE__ */ i(Yu, { className:
|
6857
|
-
n && /* @__PURE__ */ i("div", { className:
|
6866
|
+
/* @__PURE__ */ i(Yu, { className: g.content, children: a }),
|
6867
|
+
n && /* @__PURE__ */ i("div", { className: g.footer, children: n })
|
6858
6868
|
] }) }) });
|
6859
6869
|
};
|
6860
6870
|
/*!
|
6861
|
-
@versini/ui-panel v2.1
|
6871
|
+
@versini/ui-panel v2.2.1
|
6862
6872
|
© 2025 gizmette.com
|
6863
6873
|
*/
|
6864
6874
|
try {
|
6865
6875
|
window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
|
6866
|
-
version: "2.1
|
6867
|
-
buildTime: "08/04/2025
|
6876
|
+
version: "2.2.1",
|
6877
|
+
buildTime: "08/04/2025 01:24 PM EDT",
|
6868
6878
|
homepage: "https://github.com/aversini/ui-components",
|
6869
6879
|
license: "MIT"
|
6870
6880
|
});
|
6871
6881
|
} catch {
|
6872
6882
|
}
|
6873
|
-
const
|
6883
|
+
const Ye = ({
|
6874
6884
|
showConfirmation: e,
|
6875
6885
|
setShowConfirmation: t,
|
6876
6886
|
action: r,
|
@@ -6887,7 +6897,7 @@ const qe = ({
|
|
6887
6897
|
title: n.title,
|
6888
6898
|
footer: /* @__PURE__ */ T(In, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
6889
6899
|
/* @__PURE__ */ i(yt, { children: !s && /* @__PURE__ */ i(
|
6890
|
-
|
6900
|
+
Sa,
|
6891
6901
|
{
|
6892
6902
|
noBorder: !0,
|
6893
6903
|
mode: "dark",
|
@@ -6900,7 +6910,7 @@ const qe = ({
|
|
6900
6910
|
}
|
6901
6911
|
) }),
|
6902
6912
|
/* @__PURE__ */ i(yt, { children: /* @__PURE__ */ i(
|
6903
|
-
|
6913
|
+
Sa,
|
6904
6914
|
{
|
6905
6915
|
noBorder: !0,
|
6906
6916
|
mode: "dark",
|
@@ -6923,25 +6933,25 @@ const qe = ({
|
|
6923
6933
|
dispatch: a,
|
6924
6934
|
setChatId: n,
|
6925
6935
|
setInitialMessages: s
|
6926
|
-
} = X(be), [o, c] = z(!1), [l, d] = z(!1), [f, u] =
|
6927
|
-
key:
|
6936
|
+
} = X(be), [o, c] = z(!1), [l, d] = z(!1), [f, u] = Gt({
|
6937
|
+
key: jt + wo,
|
6928
6938
|
initialValue: ""
|
6929
|
-
}), h = (
|
6939
|
+
}), h = (g) => {
|
6930
6940
|
n(Ue()), s([]), a({
|
6931
|
-
type:
|
6941
|
+
type: Qe,
|
6932
6942
|
payload: {
|
6933
6943
|
privateChat: !t
|
6934
6944
|
}
|
6935
|
-
}),
|
6936
|
-
type:
|
6945
|
+
}), g && a({
|
6946
|
+
type: st,
|
6937
6947
|
payload: {
|
6938
6948
|
attachments: 0
|
6939
6949
|
}
|
6940
6950
|
});
|
6941
6951
|
};
|
6942
6952
|
return /* @__PURE__ */ T(ue, { children: [
|
6943
|
-
l && /* @__PURE__ */
|
6944
|
-
|
6953
|
+
l && /* @__PURE__ */ T(
|
6954
|
+
Ye,
|
6945
6955
|
{
|
6946
6956
|
showConfirmation: l,
|
6947
6957
|
setShowConfirmation: d,
|
@@ -6951,11 +6961,14 @@ const qe = ({
|
|
6951
6961
|
cancelAction: "Cancel",
|
6952
6962
|
title: "Private Chat"
|
6953
6963
|
},
|
6954
|
-
children:
|
6964
|
+
children: [
|
6965
|
+
/* @__PURE__ */ i("p", { children: "Toggling private chat will start a new chat session." }),
|
6966
|
+
/* @__PURE__ */ i("p", { children: "Your current chat will be automatically saved to your chat history and can be restored or deleted from there if needed." })
|
6967
|
+
]
|
6955
6968
|
}
|
6956
6969
|
),
|
6957
6970
|
o && /* @__PURE__ */ i(
|
6958
|
-
|
6971
|
+
Ye,
|
6959
6972
|
{
|
6960
6973
|
showConfirmation: o,
|
6961
6974
|
setShowConfirmation: c,
|
@@ -6988,17 +7001,18 @@ const qe = ({
|
|
6988
7001
|
label: "Private Chat",
|
6989
7002
|
labelRight: t ? "private" : "",
|
6990
7003
|
variant: t ? "danger" : "primary",
|
6991
|
-
onClick: (
|
6992
|
-
|
7004
|
+
onClick: (g) => {
|
7005
|
+
g && g.preventDefault(), f ? r > 0 ? d(!l) : h() : (u("true"), c(!o));
|
6993
7006
|
},
|
6994
7007
|
className: "text-sm",
|
7008
|
+
disabled: t && r > 0,
|
6995
7009
|
children: t ? /* @__PURE__ */ i(ki, { size: Te }) : /* @__PURE__ */ i(Ni, { size: Te })
|
6996
7010
|
}
|
6997
7011
|
)
|
6998
7012
|
}
|
6999
7013
|
)
|
7000
7014
|
] });
|
7001
|
-
},
|
7015
|
+
}, Fr = Y.createContext({
|
7002
7016
|
getItemProps: () => ({}),
|
7003
7017
|
activeIndex: null,
|
7004
7018
|
/* v8 ignore next 2 */
|
@@ -7029,7 +7043,7 @@ const qe = ({
|
|
7029
7043
|
focusMode: o = "system",
|
7030
7044
|
...c
|
7031
7045
|
}, l) => {
|
7032
|
-
const [d, f] = z(!1), [u, h] = z(!1), [m,
|
7046
|
+
const [d, f] = z(!1), [u, h] = z(!1), [m, g] = z(null), y = R([]), w = R([]), v = X(Fr), C = Fn(), S = zo(), O = Wn(), { floatingStyles: I, refs: b, context: _ } = Bn({
|
7033
7047
|
nodeId: S,
|
7034
7048
|
open: d,
|
7035
7049
|
onOpenChange: (q) => {
|
@@ -7044,14 +7058,14 @@ const qe = ({
|
|
7044
7058
|
toggle: !0,
|
7045
7059
|
ignoreMouse: !1
|
7046
7060
|
}), x = Vn(_, { role: "menu" }), E = Hn(_, { bubbles: !0 }), F = Wo(_, {
|
7047
|
-
listRef:
|
7061
|
+
listRef: y,
|
7048
7062
|
activeIndex: m,
|
7049
7063
|
nested: !1,
|
7050
|
-
onNavigate:
|
7064
|
+
onNavigate: g,
|
7051
7065
|
loop: !0
|
7052
7066
|
}), A = jo(_, {
|
7053
7067
|
listRef: w,
|
7054
|
-
onMatch: d ?
|
7068
|
+
onMatch: d ? g : void 0,
|
7055
7069
|
activeIndex: m
|
7056
7070
|
}), { getReferenceProps: W, getFloatingProps: P, getItemProps: J } = zn([k, x, E, F, A]), Q = pn(e) === "Button" || pn(e) === "ButtonIcon", L = Q ? {
|
7057
7071
|
noInternalClick: Q,
|
@@ -7064,7 +7078,7 @@ const qe = ({
|
|
7064
7078
|
"aria-label": r,
|
7065
7079
|
"data-open": d ? "" : void 0,
|
7066
7080
|
"data-focus-inside": u ? "" : void 0,
|
7067
|
-
ref:
|
7081
|
+
ref: Jr([b.setReference, O.ref, l]),
|
7068
7082
|
...W(
|
7069
7083
|
v.getItemProps({
|
7070
7084
|
...c
|
@@ -7086,16 +7100,16 @@ const qe = ({
|
|
7086
7100
|
}, [C, d, S]), /* @__PURE__ */ T(Go, { id: S, children: [
|
7087
7101
|
M,
|
7088
7102
|
/* @__PURE__ */ i(
|
7089
|
-
|
7103
|
+
Fr.Provider,
|
7090
7104
|
{
|
7091
7105
|
value: {
|
7092
7106
|
activeIndex: m,
|
7093
|
-
setActiveIndex:
|
7107
|
+
setActiveIndex: g,
|
7094
7108
|
getItemProps: J,
|
7095
7109
|
setHasFocusInside: h,
|
7096
7110
|
isOpen: d
|
7097
7111
|
},
|
7098
|
-
children: /* @__PURE__ */ i(Ko, { elementsRef:
|
7112
|
+
children: /* @__PURE__ */ i(Ko, { elementsRef: y, labelsRef: w, children: d && /* @__PURE__ */ i(Ln, { children: /* @__PURE__ */ i(
|
7099
7113
|
Dn,
|
7100
7114
|
{
|
7101
7115
|
context: _,
|
@@ -7118,8 +7132,8 @@ const qe = ({
|
|
7118
7132
|
)
|
7119
7133
|
] });
|
7120
7134
|
}
|
7121
|
-
),
|
7122
|
-
|
7135
|
+
), er = Nn((e, t) => /* @__PURE__ */ i(Vo, { children: /* @__PURE__ */ i(Gs, { ...e, ref: t }) }));
|
7136
|
+
er.displayName = "Menu";
|
7123
7137
|
Gs.displayName = "MenuComponent";
|
7124
7138
|
const th = ({
|
7125
7139
|
children: e,
|
@@ -7216,23 +7230,23 @@ const Re = Y.forwardRef(
|
|
7216
7230
|
...c
|
7217
7231
|
}, l) => {
|
7218
7232
|
let d = "";
|
7219
|
-
const f = Y.useContext(
|
7233
|
+
const f = Y.useContext(Fr), u = Wn({ label: t ? null : e }), h = Fn(), m = Jr([u.ref, l]);
|
7220
7234
|
if (a && n)
|
7221
7235
|
return /* @__PURE__ */ i(
|
7222
7236
|
"div",
|
7223
7237
|
{
|
7224
7238
|
role: "menuitem",
|
7225
7239
|
...f.getItemProps({
|
7226
|
-
onClick(
|
7240
|
+
onClick(y) {
|
7227
7241
|
var w;
|
7228
|
-
s || ((w = c.onClick) == null || w.call(c,
|
7242
|
+
s || ((w = c.onClick) == null || w.call(c, y), h?.events.emit("click"));
|
7229
7243
|
}
|
7230
7244
|
}),
|
7231
7245
|
children: n
|
7232
7246
|
}
|
7233
7247
|
);
|
7234
7248
|
r && (d = "pl-2");
|
7235
|
-
const
|
7249
|
+
const g = p(
|
7236
7250
|
"items-center flex-row",
|
7237
7251
|
"m-0 first:mt-0 mt-2 sm:mt-1 px-2 py-1 flex w-full rounded-md border border-transparent text-left text-base outline-hidden focus:border focus:border-border-medium focus:bg-surface-lighter focus:underline disabled:cursor-not-allowed disabled:text-copy-medium",
|
7238
7252
|
{
|
@@ -7245,17 +7259,17 @@ const Re = Y.forwardRef(
|
|
7245
7259
|
...c,
|
7246
7260
|
ref: m,
|
7247
7261
|
role: "menuitem",
|
7248
|
-
className:
|
7262
|
+
className: g,
|
7249
7263
|
tabIndex: 0,
|
7250
7264
|
disabled: t,
|
7251
7265
|
...f.getItemProps({
|
7252
|
-
onClick(
|
7266
|
+
onClick(y) {
|
7253
7267
|
var w;
|
7254
|
-
s || ((w = c.onClick) == null || w.call(c,
|
7268
|
+
s || ((w = c.onClick) == null || w.call(c, y), h?.events.emit("click"));
|
7255
7269
|
},
|
7256
|
-
onFocus(
|
7270
|
+
onFocus(y) {
|
7257
7271
|
var w;
|
7258
|
-
(w = c.onFocus) == null || w.call(c,
|
7272
|
+
(w = c.onFocus) == null || w.call(c, y), f.setHasFocusInside(!0);
|
7259
7273
|
}
|
7260
7274
|
}),
|
7261
7275
|
children: [
|
@@ -7303,23 +7317,23 @@ const nh = (e) => {
|
|
7303
7317
|
className: e,
|
7304
7318
|
defaultPlacement: t = "top-start"
|
7305
7319
|
}) => {
|
7306
|
-
const { dispatch: r, setChatId: a, setInitialMessages: n } = X(be), { dispatch: s } = X(
|
7320
|
+
const { dispatch: r, setChatId: a, setInitialMessages: n } = X(be), { dispatch: s } = X(ia), { getAccessToken: o, user: c } = Ve(), { data: l, isSuccess: d } = Xt({
|
7307
7321
|
user: c?.username,
|
7308
7322
|
getAccessToken: o
|
7309
|
-
}), f = (m,
|
7323
|
+
}), f = (m, g, y) => {
|
7310
7324
|
m.preventDefault(), a(Ue()), n([]), r({
|
7311
|
-
type:
|
7325
|
+
type: Qe,
|
7312
7326
|
payload: {
|
7313
|
-
privateChat:
|
7327
|
+
privateChat: y
|
7314
7328
|
}
|
7315
7329
|
}), s({
|
7316
7330
|
type: Cn,
|
7317
7331
|
payload: {
|
7318
|
-
prompt:
|
7332
|
+
prompt: g
|
7319
7333
|
}
|
7320
7334
|
});
|
7321
7335
|
}, u = d && l && l.tags && nh(l.tags), h = /* @__PURE__ */ T(
|
7322
|
-
|
7336
|
+
er,
|
7323
7337
|
{
|
7324
7338
|
mode: "dark",
|
7325
7339
|
focusMode: "light",
|
@@ -7328,27 +7342,27 @@ const nh = (e) => {
|
|
7328
7342
|
children: [
|
7329
7343
|
/* @__PURE__ */ i(Ks, { children: "Prompts" }),
|
7330
7344
|
u && l.tags.map((m) => {
|
7331
|
-
let
|
7345
|
+
let g = null;
|
7332
7346
|
switch (m.slot) {
|
7333
7347
|
case 0:
|
7334
|
-
|
7348
|
+
g = /* @__PURE__ */ i(_i, {});
|
7335
7349
|
break;
|
7336
7350
|
case 1:
|
7337
|
-
|
7351
|
+
g = /* @__PURE__ */ i(Ci, {});
|
7338
7352
|
break;
|
7339
7353
|
case 2:
|
7340
|
-
|
7354
|
+
g = /* @__PURE__ */ i(Ii, {});
|
7341
7355
|
break;
|
7342
7356
|
default:
|
7343
|
-
|
7357
|
+
g = null;
|
7344
7358
|
break;
|
7345
7359
|
}
|
7346
7360
|
return m.enabled && m.label && m.content && /* @__PURE__ */ i(
|
7347
7361
|
Re,
|
7348
7362
|
{
|
7349
7363
|
label: m.label,
|
7350
|
-
icon:
|
7351
|
-
onClick: (
|
7364
|
+
icon: g,
|
7365
|
+
onClick: (y) => f(y, m.content, m?.privateChat)
|
7352
7366
|
},
|
7353
7367
|
`prompt-button-${m.slot}`
|
7354
7368
|
);
|
@@ -7373,17 +7387,17 @@ const nh = (e) => {
|
|
7373
7387
|
dispatch: a,
|
7374
7388
|
setChatId: n,
|
7375
7389
|
setInitialMessages: s
|
7376
|
-
} = X(be), [o, c] = z(!1), [l, d] = z(!1), [f, u] =
|
7377
|
-
key:
|
7390
|
+
} = X(be), [o, c] = z(!1), [l, d] = z(!1), [f, u] = Gt({
|
7391
|
+
key: jt + Eo,
|
7378
7392
|
initialValue: ""
|
7379
|
-
}), h = (
|
7393
|
+
}), h = (g) => {
|
7380
7394
|
n(Ue()), s([]), a({
|
7381
|
-
type:
|
7395
|
+
type: Qe,
|
7382
7396
|
payload: {
|
7383
7397
|
reasoning: !t
|
7384
7398
|
}
|
7385
|
-
}),
|
7386
|
-
type:
|
7399
|
+
}), g && a({
|
7400
|
+
type: st,
|
7387
7401
|
payload: {
|
7388
7402
|
attachments: 0
|
7389
7403
|
}
|
@@ -7391,7 +7405,7 @@ const nh = (e) => {
|
|
7391
7405
|
};
|
7392
7406
|
return /* @__PURE__ */ T(ue, { children: [
|
7393
7407
|
l && /* @__PURE__ */ i(
|
7394
|
-
|
7408
|
+
Ye,
|
7395
7409
|
{
|
7396
7410
|
showConfirmation: l,
|
7397
7411
|
setShowConfirmation: d,
|
@@ -7405,7 +7419,7 @@ const nh = (e) => {
|
|
7405
7419
|
}
|
7406
7420
|
),
|
7407
7421
|
o && /* @__PURE__ */ i(
|
7408
|
-
|
7422
|
+
Ye,
|
7409
7423
|
{
|
7410
7424
|
showConfirmation: o,
|
7411
7425
|
setShowConfirmation: c,
|
@@ -7438,8 +7452,8 @@ const nh = (e) => {
|
|
7438
7452
|
focusMode: "light",
|
7439
7453
|
label: "Reasoning Chat",
|
7440
7454
|
variant: t ? "selected" : "primary",
|
7441
|
-
onClick: (
|
7442
|
-
|
7455
|
+
onClick: (g) => {
|
7456
|
+
g && g.preventDefault(), f ? r > 0 ? d(!l) : h() : (u("true"), c(!o));
|
7443
7457
|
},
|
7444
7458
|
className: "text-sm",
|
7445
7459
|
children: /* @__PURE__ */ i(Ei, { size: Te })
|
@@ -7449,8 +7463,8 @@ const nh = (e) => {
|
|
7449
7463
|
)
|
7450
7464
|
] });
|
7451
7465
|
};
|
7452
|
-
let
|
7453
|
-
const qs = async () => (
|
7466
|
+
let yr = null, br = null;
|
7467
|
+
const qs = async () => (yr || (yr = import("./index.B8EJY2WR.js")), yr), Ys = async () => (br || (br = import("./index.DK5aa0OB.js").then((e) => e.utilities)), br), oh = async () => {
|
7454
7468
|
try {
|
7455
7469
|
await Promise.all([qs(), Ys()]);
|
7456
7470
|
} catch {
|
@@ -7477,13 +7491,14 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7477
7491
|
const { user: t, getAccessToken: r } = Ve(), {
|
7478
7492
|
dispatch: a,
|
7479
7493
|
state: { tokenUsage: n, provider: s, privateChat: o }
|
7480
|
-
} = X(be), { messages: c, id: l } =
|
7494
|
+
} = X(be), { messages: c, id: l } = Xe(), { state: d } = X(oa), { refetch: f } = rs({
|
7481
7495
|
enabled: !1,
|
7482
7496
|
user: t?.username || "",
|
7483
7497
|
searchString: d.searchString,
|
7484
7498
|
sortDirection: d.sortDirection,
|
7499
|
+
sortedCell: d.sortedCell,
|
7485
7500
|
getAccessToken: r
|
7486
|
-
}), [u, h] = z(!1), [m,
|
7501
|
+
}), [u, h] = z(!1), [m, g] = z(!1), y = async () => {
|
7487
7502
|
try {
|
7488
7503
|
if (l && c && s) {
|
7489
7504
|
const v = c.filter(({ content: C }) => C).map(({ role: C, content: S, id: O }) => ({
|
@@ -7502,9 +7517,10 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7502
7517
|
tokenUsage: n
|
7503
7518
|
}
|
7504
7519
|
}), a({
|
7505
|
-
type:
|
7520
|
+
type: Qe,
|
7506
7521
|
payload: {
|
7507
|
-
privateChat: !1
|
7522
|
+
privateChat: !1,
|
7523
|
+
preserveTokenUsage: !0
|
7508
7524
|
}
|
7509
7525
|
}), f(), await Xs(ko, {
|
7510
7526
|
containerId: "toggle-save"
|
@@ -7513,17 +7529,17 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7513
7529
|
} catch {
|
7514
7530
|
}
|
7515
7531
|
}, w = (v) => {
|
7516
|
-
v && v.preventDefault(), n > 0 ?
|
7532
|
+
v && v.preventDefault(), n > 0 ? g(!m) : y();
|
7517
7533
|
};
|
7518
7534
|
return $(() => {
|
7519
7535
|
o && c?.length > 0 ? h(!0) : h(!1);
|
7520
7536
|
}, [o, c]), /* @__PURE__ */ T(ue, { children: [
|
7521
7537
|
m && /* @__PURE__ */ i(
|
7522
|
-
|
7538
|
+
Ye,
|
7523
7539
|
{
|
7524
7540
|
showConfirmation: m,
|
7525
|
-
setShowConfirmation:
|
7526
|
-
action:
|
7541
|
+
setShowConfirmation: g,
|
7542
|
+
action: y,
|
7527
7543
|
customStrings: {
|
7528
7544
|
confirmAction: "Continue",
|
7529
7545
|
cancelAction: "Cancel",
|
@@ -7626,9 +7642,9 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7626
7642
|
)
|
7627
7643
|
}
|
7628
7644
|
);
|
7629
|
-
},
|
7645
|
+
}, Lt = [
|
7630
7646
|
{
|
7631
|
-
id:
|
7647
|
+
id: sa,
|
7632
7648
|
label: "OpenAI",
|
7633
7649
|
icon: Si
|
7634
7650
|
},
|
@@ -7648,12 +7664,12 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7648
7664
|
state: { privateChat: r },
|
7649
7665
|
setChatId: a,
|
7650
7666
|
setInitialMessages: n
|
7651
|
-
} = X(be), { getAccessToken: s, user: o } = Ve(), { status: c } =
|
7667
|
+
} = X(be), { getAccessToken: s, user: o } = Ve(), { status: c } = Xe(), [l, d] = z(!1), f = V(() => {
|
7652
7668
|
l || (oh(), d(!0));
|
7653
|
-
}, [l]), { isSuccess: u, refetch: h, data: m } =
|
7669
|
+
}, [l]), { isSuccess: u, refetch: h, data: m } = Xt({
|
7654
7670
|
user: o?.username,
|
7655
7671
|
getAccessToken: s
|
7656
|
-
}),
|
7672
|
+
}), g = async (C) => {
|
7657
7673
|
try {
|
7658
7674
|
a(Ue()), n([]), C !== m?.provider && (await Rc({
|
7659
7675
|
provider: C,
|
@@ -7662,15 +7678,15 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7662
7678
|
}), h(), await Xs(`${_o} ${C}`, {
|
7663
7679
|
containerId: "toggle-provider"
|
7664
7680
|
})), t({
|
7665
|
-
type:
|
7681
|
+
type: Qe,
|
7666
7682
|
payload: {
|
7667
7683
|
privateChat: r
|
7668
7684
|
}
|
7669
7685
|
});
|
7670
7686
|
} catch {
|
7671
7687
|
}
|
7672
|
-
},
|
7673
|
-
|
7688
|
+
}, y = m && u, w = y && Lt.find((C) => m.provider === C.id)?.icon || Lt[0].icon, v = /* @__PURE__ */ T(
|
7689
|
+
er,
|
7674
7690
|
{
|
7675
7691
|
mode: "dark",
|
7676
7692
|
focusMode: "light",
|
@@ -7679,13 +7695,13 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7679
7695
|
{
|
7680
7696
|
noBorder: !0,
|
7681
7697
|
label: "Providers",
|
7682
|
-
disabled: !
|
7698
|
+
disabled: !y,
|
7683
7699
|
onMouseEnter: f,
|
7684
7700
|
onFocus: f,
|
7685
7701
|
children: /* @__PURE__ */ i(
|
7686
7702
|
w,
|
7687
7703
|
{
|
7688
|
-
className:
|
7704
|
+
className: y && c === "streaming" ? "av-pulsate-icon" : "",
|
7689
7705
|
size: Te
|
7690
7706
|
}
|
7691
7707
|
)
|
@@ -7694,20 +7710,20 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7694
7710
|
defaultPlacement: "top-start",
|
7695
7711
|
children: [
|
7696
7712
|
/* @__PURE__ */ i(Ks, { children: "Providers" }),
|
7697
|
-
|
7713
|
+
y && Lt.map((C) => /* @__PURE__ */ i(
|
7698
7714
|
Re,
|
7699
7715
|
{
|
7700
7716
|
selected: m.provider === C.id,
|
7701
7717
|
label: C.label,
|
7702
7718
|
icon: /* @__PURE__ */ i(C.icon, {}),
|
7703
|
-
onClick: () =>
|
7719
|
+
onClick: () => g(C.id)
|
7704
7720
|
},
|
7705
7721
|
C.id
|
7706
7722
|
))
|
7707
7723
|
]
|
7708
7724
|
}
|
7709
7725
|
);
|
7710
|
-
return
|
7726
|
+
return y ? /* @__PURE__ */ i(
|
7711
7727
|
$e,
|
7712
7728
|
{
|
7713
7729
|
label: "Toggle Providers",
|
@@ -7731,10 +7747,10 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7731
7747
|
".html",
|
7732
7748
|
".json",
|
7733
7749
|
".md"
|
7734
|
-
],
|
7750
|
+
], vr = [
|
7735
7751
|
...dh,
|
7736
7752
|
...uh
|
7737
|
-
],
|
7753
|
+
], Wr = 400 * 1024, hh = "text/plain", fh = () => p(
|
7738
7754
|
"relative rounded-md text-base h-auto min-w-28 overflow-hidden pt-2"
|
7739
7755
|
), gn = () => p("bg-surface-darker"), mh = () => p("text-copy-lighter caret-copy-light"), ph = () => p(
|
7740
7756
|
"has-[.av-prompt-editable:focus]:outline",
|
@@ -7762,7 +7778,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7762
7778
|
wrapper: t,
|
7763
7779
|
textArea: r
|
7764
7780
|
};
|
7765
|
-
},
|
7781
|
+
}, zt = (e) => {
|
7766
7782
|
if (e === 0)
|
7767
7783
|
return "0 Bytes";
|
7768
7784
|
const t = 1024, r = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
@@ -7787,7 +7803,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7787
7803
|
/* @__PURE__ */ i("span", { className: "max-w-[150px] truncate", children: r.name }),
|
7788
7804
|
/* @__PURE__ */ T("span", { className: "mx-1 text-gray-400", children: [
|
7789
7805
|
"(",
|
7790
|
-
|
7806
|
+
zt(r.size),
|
7791
7807
|
")"
|
7792
7808
|
] }),
|
7793
7809
|
/* @__PURE__ */ i(
|
@@ -7809,24 +7825,25 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7809
7825
|
)) }),
|
7810
7826
|
/* @__PURE__ */ T("div", { className: "text-xs text-gray-400 mt-1 pl-1", children: [
|
7811
7827
|
"Total: ",
|
7812
|
-
|
7828
|
+
zt(eo(Array.from(e))),
|
7813
7829
|
" /",
|
7814
7830
|
" ",
|
7815
|
-
|
7831
|
+
zt(Wr)
|
7816
7832
|
] })
|
7817
|
-
] }), to = 24, wh = 500, ro = 2, Eh = 5, kh = to * ro, yn = Eh * to, _h = "ready", Sh = "streaming", Th = "error", Ch = "submitted",
|
7833
|
+
] }), to = 24, wh = 500, ro = 2, Eh = 5, kh = to * ro, yn = Eh * to, _h = "ready", Sh = "streaming", Th = "error", Ch = "submitted", Dt = (e) => {
|
7818
7834
|
e.current && (e.current.style.height = `${kh}px`);
|
7819
7835
|
}, Ih = () => {
|
7820
7836
|
const { user: e, getAccessToken: t } = Ve(), [r, a] = z(!1), [n, s] = z(null), [o, c] = z(!1), [l, d] = z(!1), {
|
7821
7837
|
dispatch: f,
|
7822
|
-
state: { reasoning: u, streaming: h, aborted: m, lastResetTimestamp:
|
7823
|
-
} = X(be), { state: w, dispatch: v } = X(
|
7838
|
+
state: { reasoning: u, streaming: h, aborted: m, lastResetTimestamp: g, attachments: y }
|
7839
|
+
} = X(be), { state: w, dispatch: v } = X(ia), { state: C } = X(oa), { refetch: S } = rs({
|
7824
7840
|
enabled: !1,
|
7825
7841
|
user: e?.username || "",
|
7826
7842
|
searchString: C.searchString,
|
7827
7843
|
sortDirection: C.sortDirection,
|
7844
|
+
sortedCell: C.sortedCell,
|
7828
7845
|
getAccessToken: t
|
7829
|
-
}), { data: O } =
|
7846
|
+
}), { data: O } = Xt({
|
7830
7847
|
user: e?.username,
|
7831
7848
|
getAccessToken: t
|
7832
7849
|
}), I = R(null), b = R(null), _ = R(!1), k = R(0), x = R(null), E = R(null), F = Fi(), A = yh({
|
@@ -7839,7 +7856,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7839
7856
|
setMessages: L,
|
7840
7857
|
status: M,
|
7841
7858
|
id: q
|
7842
|
-
} =
|
7859
|
+
} = Xe({
|
7843
7860
|
onFinish: (K, { usage: se }) => {
|
7844
7861
|
S(), f({
|
7845
7862
|
type: Zn,
|
@@ -7851,26 +7868,26 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7851
7868
|
}), B = V(
|
7852
7869
|
async (K) => {
|
7853
7870
|
K === _h && f({
|
7854
|
-
type:
|
7871
|
+
type: at,
|
7855
7872
|
payload: {
|
7856
7873
|
loading: !1,
|
7857
7874
|
streaming: !1
|
7858
7875
|
}
|
7859
7876
|
}), K === Ch && f({
|
7860
|
-
type:
|
7877
|
+
type: at,
|
7861
7878
|
payload: {
|
7862
7879
|
loading: !0,
|
7863
7880
|
streaming: !1
|
7864
7881
|
}
|
7865
7882
|
}), K === Sh && f({
|
7866
|
-
type:
|
7883
|
+
type: at,
|
7867
7884
|
payload: {
|
7868
7885
|
loading: !1,
|
7869
7886
|
streaming: !0
|
7870
7887
|
}
|
7871
7888
|
}), K === Th && setTimeout(() => {
|
7872
7889
|
m || (f({
|
7873
|
-
type:
|
7890
|
+
type: at,
|
7874
7891
|
payload: {
|
7875
7892
|
loading: !1,
|
7876
7893
|
streaming: !1
|
@@ -7879,7 +7896,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7879
7896
|
...se,
|
7880
7897
|
{
|
7881
7898
|
id: Ue(),
|
7882
|
-
role:
|
7899
|
+
role: Tr,
|
7883
7900
|
content: Co
|
7884
7901
|
}
|
7885
7902
|
]));
|
@@ -7908,18 +7925,18 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7908
7925
|
let U = !1;
|
7909
7926
|
for (const N of ie) {
|
7910
7927
|
const j = "." + N.name.split(".").pop()?.toLowerCase();
|
7911
|
-
|
7928
|
+
vr.includes(j) ? ye.some(
|
7912
7929
|
(ne) => ne.name === N.name && ne.size === N.size && ne.lastModified === N.lastModified
|
7913
7930
|
) || ye.push(N) : U = !0;
|
7914
7931
|
}
|
7915
|
-
if (b.current && (b.current.value = ""), eo(ye) >
|
7916
|
-
I.current = `Total file size exceeds the limit of ${
|
7917
|
-
|
7932
|
+
if (b.current && (b.current.value = ""), eo(ye) > Wr) {
|
7933
|
+
I.current = `Total file size exceeds the limit of ${zt(
|
7934
|
+
Wr
|
7918
7935
|
)}.`, c(!0);
|
7919
7936
|
return;
|
7920
7937
|
}
|
7921
7938
|
if (U) {
|
7922
|
-
I.current = `Only ${
|
7939
|
+
I.current = `Only ${vr.join(
|
7923
7940
|
", "
|
7924
7941
|
)} files are allowed.`, c(!0);
|
7925
7942
|
return;
|
@@ -7927,7 +7944,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7927
7944
|
if (ye.length > 0) {
|
7928
7945
|
const N = new DataTransfer();
|
7929
7946
|
ye.forEach((j) => N.items.add(j)), s(N.files), f({
|
7930
|
-
type:
|
7947
|
+
type: st,
|
7931
7948
|
payload: {
|
7932
7949
|
attachments: N.files.length
|
7933
7950
|
}
|
@@ -7943,7 +7960,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7943
7960
|
Array.from(n).forEach((ie) => {
|
7944
7961
|
ie !== K && se.items.add(ie);
|
7945
7962
|
}), se.files.length === 0 ? s(null) : s(se.files), f({
|
7946
|
-
type:
|
7963
|
+
type: st,
|
7947
7964
|
payload: {
|
7948
7965
|
attachments: se.files.length
|
7949
7966
|
}
|
@@ -7951,7 +7968,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7951
7968
|
}, Me = V(() => {
|
7952
7969
|
b.current && (b.current.value = ""), s(null);
|
7953
7970
|
}, []), je = async (K) => {
|
7954
|
-
K.preventDefault(),
|
7971
|
+
K.preventDefault(), Dt(E);
|
7955
7972
|
const se = await t();
|
7956
7973
|
let ie;
|
7957
7974
|
if (n && n.length > 0) {
|
@@ -7974,7 +7991,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7974
7991
|
}, _e = (K) => {
|
7975
7992
|
ge(), J(K);
|
7976
7993
|
};
|
7977
|
-
return
|
7994
|
+
return Yr([
|
7978
7995
|
[
|
7979
7996
|
"mod+K",
|
7980
7997
|
() => {
|
@@ -7984,36 +8001,36 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
7984
8001
|
]), $(() => {
|
7985
8002
|
if (w.prompt !== "") {
|
7986
8003
|
const K = w.prompt.endsWith(":") && !w.prompt.endsWith(": ") ? w.prompt + " " : w.prompt;
|
7987
|
-
K.indexOf(
|
7988
|
-
P(K.replace(
|
8004
|
+
K.indexOf(Ta) !== -1 ? navigator.clipboard.readText().then((ie) => {
|
8005
|
+
P(K.replace(Ta, ie));
|
7989
8006
|
}) : P(K), !Ae() && E.current && E.current.focus(), v({
|
7990
8007
|
type: Tn
|
7991
8008
|
});
|
7992
8009
|
}
|
7993
8010
|
}, [w, v, P]), $(() => {
|
7994
8011
|
if (_.current === !1) {
|
7995
|
-
_.current = !0, !W &&
|
8012
|
+
_.current = !0, !W && Dt(E);
|
7996
8013
|
return;
|
7997
8014
|
}
|
7998
|
-
|
7999
|
-
E.current && (!W &&
|
8000
|
-
}, wh)) : h === !1 && !W && (
|
8001
|
-
}, [
|
8015
|
+
g > 0 && g !== k.current ? (k.current = g, setTimeout(() => {
|
8016
|
+
E.current && (!W && Dt(E), E.current.focus());
|
8017
|
+
}, wh)) : h === !1 && !W && (Dt(E), !Ae() && E.current && E.current.focus());
|
8018
|
+
}, [g, h, W]), $(() => {
|
8002
8019
|
w.lastTriggeredTimestamp && setTimeout(() => {
|
8003
8020
|
ge();
|
8004
8021
|
}, 100);
|
8005
8022
|
}, [w.lastTriggeredTimestamp, ge]), $(() => {
|
8006
8023
|
(async () => {
|
8007
|
-
if (
|
8024
|
+
if (Je())
|
8008
8025
|
return;
|
8009
8026
|
const K = await t(), se = await Hs(K, [As.REASONING]);
|
8010
8027
|
a(se);
|
8011
8028
|
})();
|
8012
8029
|
}, [t]), $(() => {
|
8013
|
-
|
8014
|
-
}, [
|
8030
|
+
y === 0 && (b.current && (b.current.value = ""), s(null));
|
8031
|
+
}, [y]), /* @__PURE__ */ T(ue, { children: [
|
8015
8032
|
/* @__PURE__ */ i(
|
8016
|
-
|
8033
|
+
Ye,
|
8017
8034
|
{
|
8018
8035
|
showConfirmation: o,
|
8019
8036
|
setShowConfirmation: c,
|
@@ -8029,7 +8046,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8029
8046
|
}
|
8030
8047
|
),
|
8031
8048
|
/* @__PURE__ */ i("div", { className: A.wrapper, ref: x, children: /* @__PURE__ */ T("form", { onSubmit: je, children: [
|
8032
|
-
/* @__PURE__ */ i("div", { id: F, className: "sr-only", children:
|
8049
|
+
/* @__PURE__ */ i("div", { id: F, className: "sr-only", children: Je() ? Ca : l ? Ia : xa }),
|
8033
8050
|
/* @__PURE__ */ T("div", { className: "relative", children: [
|
8034
8051
|
/* @__PURE__ */ i(
|
8035
8052
|
"textarea",
|
@@ -8037,7 +8054,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8037
8054
|
required: !0,
|
8038
8055
|
rows: ro,
|
8039
8056
|
ref: E,
|
8040
|
-
placeholder:
|
8057
|
+
placeholder: Je() ? Ca : l ? Ia : xa,
|
8041
8058
|
translate: "no",
|
8042
8059
|
onChange: _e,
|
8043
8060
|
value: W,
|
@@ -8062,7 +8079,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8062
8079
|
onChange: ve,
|
8063
8080
|
className: "hidden",
|
8064
8081
|
multiple: !0,
|
8065
|
-
accept:
|
8082
|
+
accept: vr.join(","),
|
8066
8083
|
"aria-label": "Upload files"
|
8067
8084
|
}
|
8068
8085
|
)
|
@@ -8079,7 +8096,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8079
8096
|
onClick: Pe
|
8080
8097
|
}
|
8081
8098
|
),
|
8082
|
-
!
|
8099
|
+
!Je() && /* @__PURE__ */ T(ue, { children: [
|
8083
8100
|
r && /* @__PURE__ */ i(Js, { className: "order-4 mr-4 sm:mr-2" }),
|
8084
8101
|
/* @__PURE__ */ i(js, { className: "order-5 mr-4 sm:mr-2" }),
|
8085
8102
|
/* @__PURE__ */ i(Zs, { className: "order-6" })
|
@@ -8087,18 +8104,18 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8087
8104
|
] })
|
8088
8105
|
] }) })
|
8089
8106
|
] });
|
8090
|
-
},
|
8107
|
+
}, ft = "--sassy-bottom", xh = ({ isComponent: e }) => {
|
8091
8108
|
const {
|
8092
8109
|
state: { loading: t, streaming: r, restoring: a }
|
8093
8110
|
} = X(be), {
|
8094
8111
|
state: { footerHeight: n, footerPosition: s },
|
8095
8112
|
dispatch: o
|
8096
|
-
} = X(
|
8097
|
-
() =>
|
8098
|
-
), { messages: l } =
|
8113
|
+
} = X(ca), [c] = z(
|
8114
|
+
() => Ra[Math.floor(Math.random() * Ra.length)]
|
8115
|
+
), { messages: l } = Xe(), { height: d } = Wi(), { height: f } = ji(), [u, h] = Kn(), m = he(() => Ae(), []), g = d - f, y = he(() => {
|
8099
8116
|
const w = m ? xo : xn;
|
8100
|
-
return
|
8101
|
-
}, [
|
8117
|
+
return g > 0 && g < 100 ? Io : w;
|
8118
|
+
}, [g, m]);
|
8102
8119
|
return $(() => {
|
8103
8120
|
n !== h.height && o({
|
8104
8121
|
type: Xn,
|
@@ -8109,48 +8126,48 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8109
8126
|
}, [h.height, n, o]), $(() => {
|
8110
8127
|
if (!u || !u.current)
|
8111
8128
|
return;
|
8112
|
-
const w = u?.current?.style.getPropertyValue(
|
8129
|
+
const w = u?.current?.style.getPropertyValue(ft);
|
8113
8130
|
if (m) {
|
8114
|
-
w !== `${
|
8115
|
-
type:
|
8131
|
+
w !== `${y}px` && (o({
|
8132
|
+
type: pt,
|
8116
8133
|
payload: {
|
8117
|
-
footerPosition:
|
8118
|
-
footerOffset:
|
8134
|
+
footerPosition: qe,
|
8135
|
+
footerOffset: y
|
8119
8136
|
}
|
8120
8137
|
}), u.current.style.setProperty(
|
8121
|
-
|
8122
|
-
`${
|
8138
|
+
ft,
|
8139
|
+
`${y}px`
|
8123
8140
|
));
|
8124
8141
|
return;
|
8125
8142
|
}
|
8126
|
-
if (s ===
|
8127
|
-
type:
|
8143
|
+
if (s === Kt && (t && !r || a) && w !== `${y}px` && (o({
|
8144
|
+
type: pt,
|
8128
8145
|
payload: {
|
8129
|
-
footerPosition:
|
8130
|
-
footerOffset:
|
8146
|
+
footerPosition: qe,
|
8147
|
+
footerOffset: y
|
8131
8148
|
}
|
8132
8149
|
}), u.current.style.setProperty(
|
8133
|
-
|
8134
|
-
`${
|
8135
|
-
)), s ===
|
8136
|
-
type:
|
8150
|
+
ft,
|
8151
|
+
`${y}px`
|
8152
|
+
)), s === qe && w !== `${y}px` && (o({
|
8153
|
+
type: pt,
|
8137
8154
|
payload: {
|
8138
|
-
footerPosition:
|
8139
|
-
footerOffset:
|
8155
|
+
footerPosition: qe,
|
8156
|
+
footerOffset: y
|
8140
8157
|
}
|
8141
8158
|
}), u.current.style.setProperty(
|
8142
|
-
|
8143
|
-
`${
|
8159
|
+
ft,
|
8160
|
+
`${y}px`
|
8144
8161
|
)), !t && !r && !a && l.length === 0 && d > 0 && h.height > 0) {
|
8145
8162
|
const v = `${d - h.height - (e ? 300 : 245)}`;
|
8146
8163
|
w !== `${v}px` && Number(v) > 0 && (o({
|
8147
|
-
type:
|
8164
|
+
type: pt,
|
8148
8165
|
payload: {
|
8149
|
-
footerPosition:
|
8166
|
+
footerPosition: Kt,
|
8150
8167
|
footerOffset: Number(v)
|
8151
8168
|
}
|
8152
8169
|
}), u?.current?.style.setProperty(
|
8153
|
-
|
8170
|
+
ft,
|
8154
8171
|
`${v}px`
|
8155
8172
|
));
|
8156
8173
|
}
|
@@ -8165,7 +8182,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8165
8182
|
h.height,
|
8166
8183
|
s,
|
8167
8184
|
m,
|
8168
|
-
|
8185
|
+
y,
|
8169
8186
|
o
|
8170
8187
|
]), /* @__PURE__ */ T(
|
8171
8188
|
"footer",
|
@@ -8184,18 +8201,18 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8184
8201
|
]
|
8185
8202
|
}
|
8186
8203
|
);
|
8187
|
-
}, Rh =
|
8188
|
-
() => import("./ProfileEntry.
|
8189
|
-
), Ah =
|
8190
|
-
() => import("./SettingsEntry.
|
8204
|
+
}, Rh = it(
|
8205
|
+
() => import("./ProfileEntry.BtERQFK4.js").then((e) => ({ default: e.Profile }))
|
8206
|
+
), Ah = it(
|
8207
|
+
() => import("./SettingsEntry.CHj1q4Pe.js").then((e) => ({
|
8191
8208
|
default: e.SettingsPanel
|
8192
8209
|
}))
|
8193
|
-
), Nh =
|
8194
|
-
() => import("./HistoryEntry.
|
8195
|
-
), Oh =
|
8196
|
-
() => import("./AboutEntry.
|
8197
|
-
), $h =
|
8198
|
-
() => import("./UsageEntry.
|
8210
|
+
), Nh = it(
|
8211
|
+
() => import("./HistoryEntry.C5m-7h3b.js").then((e) => ({ default: e.HistoryPanel }))
|
8212
|
+
), Oh = it(
|
8213
|
+
() => import("./AboutEntry.CMvo-j5s.js").then((e) => ({ default: e.About }))
|
8214
|
+
), $h = it(
|
8215
|
+
() => import("./UsageEntry.BglkGISL.js").then((e) => ({ default: e.Usage }))
|
8199
8216
|
), Ph = ({ type: e, open: t, onOpenChange: r }) => t ? /* @__PURE__ */ i(On, { fallback: /* @__PURE__ */ i("div", {}), children: (() => {
|
8200
8217
|
switch (e) {
|
8201
8218
|
case "profile":
|
@@ -8215,31 +8232,31 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8215
8232
|
isComponent: e = !1
|
8216
8233
|
}) => {
|
8217
8234
|
const { logout: t, getAccessToken: r } = Ve(), [a, n] = z(null), [s, o] = z(!1), [c, l] = z(!1), [d, f] = z(!1), u = V(() => {
|
8218
|
-
d || (import("./ProfileEntry.
|
8235
|
+
d || (import("./ProfileEntry.BtERQFK4.js"), import("./SettingsEntry.CHj1q4Pe.js"), import("./HistoryEntry.C5m-7h3b.js"), import("./AboutEntry.CMvo-j5s.js"), import("./UsageEntry.BglkGISL.js"), f(!0));
|
8219
8236
|
}, [d]), h = V((w) => {
|
8220
8237
|
n(w);
|
8221
8238
|
}, []), m = V(() => {
|
8222
8239
|
n(null);
|
8223
|
-
}, []),
|
8240
|
+
}, []), g = V(() => {
|
8224
8241
|
h("settings");
|
8225
8242
|
}, [h]);
|
8226
|
-
Vs("openSettings",
|
8227
|
-
const
|
8243
|
+
Vs("openSettings", g);
|
8244
|
+
const y = () => {
|
8228
8245
|
l(!c);
|
8229
8246
|
};
|
8230
8247
|
return $(() => {
|
8231
8248
|
(async () => {
|
8232
|
-
if (!
|
8249
|
+
if (!Je())
|
8233
8250
|
return;
|
8234
8251
|
const w = await r(), v = await Hs(w, [As.REASONING]);
|
8235
8252
|
o(v);
|
8236
8253
|
})();
|
8237
|
-
}, [r]),
|
8254
|
+
}, [r]), Yr(
|
8238
8255
|
[
|
8239
8256
|
[
|
8240
8257
|
"mod+,",
|
8241
8258
|
() => {
|
8242
|
-
|
8259
|
+
Wt() && h("settings");
|
8243
8260
|
}
|
8244
8261
|
]
|
8245
8262
|
],
|
@@ -8251,15 +8268,15 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8251
8268
|
[]
|
8252
8269
|
), /* @__PURE__ */ T(ue, { children: [
|
8253
8270
|
/* @__PURE__ */ i(
|
8254
|
-
|
8271
|
+
Ye,
|
8255
8272
|
{
|
8256
8273
|
showConfirmation: c,
|
8257
8274
|
setShowConfirmation: l,
|
8258
8275
|
action: t,
|
8259
8276
|
customStrings: {
|
8260
|
-
confirmAction:
|
8277
|
+
confirmAction: Aa,
|
8261
8278
|
cancelAction: "Cancel",
|
8262
|
-
title:
|
8279
|
+
title: Aa
|
8263
8280
|
},
|
8264
8281
|
children: /* @__PURE__ */ i("p", { children: "Are you sure you want to log out?" })
|
8265
8282
|
}
|
@@ -8281,7 +8298,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8281
8298
|
columnGap: 0,
|
8282
8299
|
children: [
|
8283
8300
|
/* @__PURE__ */ i(yt, { children: /* @__PURE__ */ i(lh, { className: " mr-4 sm:mr-2" }) }),
|
8284
|
-
/* @__PURE__ */ i(yt, { children:
|
8301
|
+
/* @__PURE__ */ i(yt, { children: Je() && /* @__PURE__ */ T(ue, { children: [
|
8285
8302
|
s && /* @__PURE__ */ i(Js, { className: "mr-4 sm:mr-2" }),
|
8286
8303
|
/* @__PURE__ */ i(js, { className: "mr-4 sm:mr-2" }),
|
8287
8304
|
/* @__PURE__ */ i(Zs, {})
|
@@ -8293,7 +8310,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8293
8310
|
mode: "light",
|
8294
8311
|
placement: "left",
|
8295
8312
|
trigger: /* @__PURE__ */ T(
|
8296
|
-
|
8313
|
+
er,
|
8297
8314
|
{
|
8298
8315
|
mode: "dark",
|
8299
8316
|
focusMode: "light",
|
@@ -8354,7 +8371,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8354
8371
|
Re,
|
8355
8372
|
{
|
8356
8373
|
label: "Log out",
|
8357
|
-
onClick:
|
8374
|
+
onClick: y,
|
8358
8375
|
icon: /* @__PURE__ */ i("div", { className: "text-red-700", children: /* @__PURE__ */ i(ui, { monotone: !0 }) })
|
8359
8376
|
}
|
8360
8377
|
)
|
@@ -8368,7 +8385,7 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8368
8385
|
}
|
8369
8386
|
) })
|
8370
8387
|
] });
|
8371
|
-
},
|
8388
|
+
}, Ft = "av-bubble", bn = "av-button", ma = "icon", ao = "button", jr = "link", Lh = ({
|
8372
8389
|
type: e,
|
8373
8390
|
size: t,
|
8374
8391
|
labelRight: r,
|
@@ -8379,13 +8396,13 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8379
8396
|
const o = "max-h-8 py-0 px-2", c = "max-h-9 h-8 px-3", l = "max-h-12 py-2 px-4";
|
8380
8397
|
switch (e) {
|
8381
8398
|
case ao:
|
8382
|
-
case
|
8399
|
+
case jr:
|
8383
8400
|
return p({
|
8384
8401
|
[o]: t === "small",
|
8385
8402
|
[c]: t === "medium",
|
8386
8403
|
[l]: t === "large"
|
8387
8404
|
});
|
8388
|
-
case
|
8405
|
+
case ma:
|
8389
8406
|
return p("flex items-center", {
|
8390
8407
|
"justify-center": n === "center",
|
8391
8408
|
"justify-start": n === "left",
|
@@ -8413,14 +8430,14 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8413
8430
|
const n = "text-sm font-medium", s = "text-base font-medium", o = "text-lg font-medium";
|
8414
8431
|
switch (e) {
|
8415
8432
|
case ao:
|
8416
|
-
case
|
8433
|
+
case jr:
|
8417
8434
|
return p({
|
8418
|
-
"text-center": e ===
|
8435
|
+
"text-center": e === jr,
|
8419
8436
|
[n]: t === "small",
|
8420
8437
|
[s]: t === "medium",
|
8421
8438
|
[o]: t === "large"
|
8422
8439
|
});
|
8423
|
-
case
|
8440
|
+
case ma:
|
8424
8441
|
return p({
|
8425
8442
|
[n]: t === "small" && (r || a),
|
8426
8443
|
[s]: t === "medium" && (r || a),
|
@@ -8627,8 +8644,8 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8627
8644
|
noBackground: u,
|
8628
8645
|
variant: h,
|
8629
8646
|
truncate: m,
|
8630
|
-
align:
|
8631
|
-
radius:
|
8647
|
+
align: g,
|
8648
|
+
radius: y,
|
8632
8649
|
animated: w
|
8633
8650
|
}) => (h || (h = "primary"), r ? p(bn, t) : p(
|
8634
8651
|
bn,
|
@@ -8639,13 +8656,13 @@ const qs = async () => (gr || (gr = import("./index.B8EJY2WR.js")), gr), Ys = as
|
|
8639
8656
|
truncate: m
|
8640
8657
|
}),
|
8641
8658
|
Uh({ mode: a, noBackground: u, variant: h }),
|
8642
|
-
Hh({ radius:
|
8659
|
+
Hh({ radius: y }),
|
8643
8660
|
Lh({
|
8644
8661
|
type: e,
|
8645
8662
|
size: c,
|
8646
8663
|
labelRight: d,
|
8647
8664
|
labelLeft: f,
|
8648
|
-
align:
|
8665
|
+
align: g,
|
8649
8666
|
animated: w
|
8650
8667
|
}),
|
8651
8668
|
Dh({ type: e, size: c, labelRight: d, labelLeft: f }),
|
@@ -8702,7 +8719,7 @@ const Qh = {
|
|
8702
8719
|
bottom: 0,
|
8703
8720
|
right: 0
|
8704
8721
|
};
|
8705
|
-
function
|
8722
|
+
function wr(e) {
|
8706
8723
|
const t = qh(), r = R(0), a = R(null), [n, s] = z(Qh), o = he(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
|
8707
8724
|
const l = c[0];
|
8708
8725
|
l && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
@@ -8713,7 +8730,7 @@ function vr(e) {
|
|
8713
8730
|
o?.disconnect(), r.current && cancelAnimationFrame(r.current);
|
8714
8731
|
}), [o, e]), [a, n];
|
8715
8732
|
}
|
8716
|
-
const
|
8733
|
+
const Bt = {
|
8717
8734
|
small: 24,
|
8718
8735
|
// w-6
|
8719
8736
|
medium: 32,
|
@@ -8727,7 +8744,7 @@ const Dt = {
|
|
8727
8744
|
// px-3 x 2
|
8728
8745
|
large: 32
|
8729
8746
|
// px-4 x 2
|
8730
|
-
}, Zh = 2, ef = 300,
|
8747
|
+
}, Zh = 2, ef = 300, pa = Z.forwardRef(
|
8731
8748
|
({
|
8732
8749
|
children: e,
|
8733
8750
|
disabled: t = !1,
|
@@ -8743,8 +8760,8 @@ const Dt = {
|
|
8743
8760
|
size: u = "medium",
|
8744
8761
|
labelRight: h,
|
8745
8762
|
labelLeft: m,
|
8746
|
-
noBackground:
|
8747
|
-
align:
|
8763
|
+
noBackground: g = !1,
|
8764
|
+
align: y = "center",
|
8748
8765
|
radius: w = "large",
|
8749
8766
|
variant: v = "primary",
|
8750
8767
|
iconClassName: C,
|
@@ -8752,7 +8769,7 @@ const Dt = {
|
|
8752
8769
|
...O
|
8753
8770
|
}, I) => {
|
8754
8771
|
const b = Kh({
|
8755
|
-
type:
|
8772
|
+
type: ma,
|
8756
8773
|
mode: r,
|
8757
8774
|
focusMode: a,
|
8758
8775
|
fullWidth: n,
|
@@ -8763,20 +8780,20 @@ const Dt = {
|
|
8763
8780
|
size: u,
|
8764
8781
|
labelRight: h,
|
8765
8782
|
labelLeft: m,
|
8766
|
-
noBackground:
|
8767
|
-
align:
|
8783
|
+
noBackground: g,
|
8784
|
+
align: y,
|
8768
8785
|
radius: w,
|
8769
8786
|
variant: v,
|
8770
8787
|
animated: S
|
8771
|
-
}), _ = jh({ mode: r, raw: c, iconClassName: C }), k = Gh({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, F] =
|
8788
|
+
}), _ = jh({ mode: r, raw: c, iconClassName: C }), k = Gh({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, F] = wr(), [A, W] = wr(), [P, J] = wr(), Q = R(0), L = R(null), M = R(null), q = Yh([I, L]);
|
8772
8789
|
return Oe(() => {
|
8773
|
-
P && P.current && S && (Q.current = J.width + Xh[u] + (l ? 0 : Zh), L.current && !L.current.style.width && (L.current.style.width = `${
|
8790
|
+
P && P.current && S && (Q.current = J.width + Xh[u] + (l ? 0 : Zh), L.current && !L.current.style.width && (L.current.style.width = `${Bt[u]}px`));
|
8774
8791
|
}, [J, P, u, l, S]), Oe(() => {
|
8775
8792
|
if (L && L.current && S) {
|
8776
|
-
let B =
|
8777
|
-
h && E && F.width > 0 ? B = F.width + Q.current : m && A && W.width > 0 && (B = W.width + Q.current), M.current && clearTimeout(M.current), B !== parseInt(L.current.style.width || "0", 10) && (E.current && (E.current.style.opacity = "0"), A.current && (A.current.style.opacity = "0"), L.current.style.width = `${B}px`, B >
|
8793
|
+
let B = Bt[u];
|
8794
|
+
h && E && F.width > 0 ? B = F.width + Q.current : m && A && W.width > 0 && (B = W.width + Q.current), M.current && clearTimeout(M.current), B !== parseInt(L.current.style.width || "0", 10) && (E.current && (E.current.style.opacity = "0"), A.current && (A.current.style.opacity = "0"), L.current.style.width = `${B}px`, B > Bt[u] && (M.current = setTimeout(() => {
|
8778
8795
|
E.current && h && (E.current.style.opacity = "1"), A.current && m && (A.current.style.opacity = "1"), M.current = null;
|
8779
|
-
}, ef * 0.8))), B ===
|
8796
|
+
}, ef * 0.8))), B === Bt[u] && (E.current && (E.current.style.opacity = "0"), A.current && (A.current.style.opacity = "0"));
|
8780
8797
|
}
|
8781
8798
|
}, [
|
8782
8799
|
F,
|
@@ -8839,7 +8856,7 @@ const Dt = {
|
|
8839
8856
|
children: r && /* @__PURE__ */ i("span", { className: a, children: r })
|
8840
8857
|
}
|
8841
8858
|
);
|
8842
|
-
|
8859
|
+
pa.displayName = "ButtonIcon";
|
8843
8860
|
/*!
|
8844
8861
|
@versini/ui-button v6.0.9
|
8845
8862
|
© 2025 gizmette.com
|
@@ -8879,7 +8896,7 @@ const tf = Z.forwardRef(
|
|
8879
8896
|
}
|
8880
8897
|
) : "";
|
8881
8898
|
return /* @__PURE__ */ i("div", { className: o, children: /* @__PURE__ */ i(
|
8882
|
-
|
8899
|
+
pa,
|
8883
8900
|
{
|
8884
8901
|
className: p("justify-center", r),
|
8885
8902
|
ref: s,
|
@@ -9008,7 +9025,7 @@ const nf = ({ kind: e, noMaxWidth: t }) => p("px-4 py-2", {
|
|
9008
9025
|
), cf = ({ kind: e, tail: t }) => {
|
9009
9026
|
if (t)
|
9010
9027
|
return p(
|
9011
|
-
`${
|
9028
|
+
`${Ft}-${e}-tail`,
|
9012
9029
|
"rounded-3xl",
|
9013
9030
|
"relative",
|
9014
9031
|
"before:content-['']",
|
@@ -9034,15 +9051,15 @@ const nf = ({ kind: e, noMaxWidth: t }) => p("px-4 py-2", {
|
|
9034
9051
|
tail: n
|
9035
9052
|
}) => {
|
9036
9053
|
const s = p(
|
9037
|
-
|
9038
|
-
`${
|
9054
|
+
Ft,
|
9055
|
+
`${Ft}-${e}`,
|
9039
9056
|
"flex items-start",
|
9040
9057
|
{
|
9041
9058
|
"flex-row-reverse": e === "right"
|
9042
9059
|
},
|
9043
9060
|
t
|
9044
9061
|
), o = p(
|
9045
|
-
`${
|
9062
|
+
`${Ft}-content`,
|
9046
9063
|
"flex flex-col empty:hidden",
|
9047
9064
|
nf({ kind: e, noMaxWidth: a }),
|
9048
9065
|
of({ kind: e }),
|
@@ -9080,7 +9097,7 @@ const nf = ({ kind: e, noMaxWidth: t }) => p("px-4 py-2", {
|
|
9080
9097
|
contentClassName: a,
|
9081
9098
|
noMaxWidth: d,
|
9082
9099
|
tail: f
|
9083
|
-
}),
|
9100
|
+
}), g = !!o && (typeof o == "function" || typeof o == "string" || typeof e == "string"), y = () => {
|
9084
9101
|
h(!0), typeof o == "function" ? o(e) : typeof o == "string" ? navigator.clipboard.writeText(o) : typeof e == "string" && navigator.clipboard.writeText(e);
|
9085
9102
|
};
|
9086
9103
|
return $(() => {
|
@@ -9103,8 +9120,8 @@ const nf = ({ kind: e, noMaxWidth: t }) => p("px-4 py-2", {
|
|
9103
9120
|
}),
|
9104
9121
|
s && s
|
9105
9122
|
] }),
|
9106
|
-
|
9107
|
-
|
9123
|
+
g && /* @__PURE__ */ i("div", { className: m.copyButton, children: /* @__PURE__ */ i(
|
9124
|
+
pa,
|
9108
9125
|
{
|
9109
9126
|
noBorder: !0,
|
9110
9127
|
noBackground: !0,
|
@@ -9112,7 +9129,7 @@ const nf = ({ kind: e, noMaxWidth: t }) => p("px-4 py-2", {
|
|
9112
9129
|
mode: l,
|
9113
9130
|
focusMode: c,
|
9114
9131
|
label: u ? "Copied to clipboard" : "Copy to clipboard",
|
9115
|
-
onClick:
|
9132
|
+
onClick: y,
|
9116
9133
|
disabled: u,
|
9117
9134
|
children: u ? /* @__PURE__ */ i(rf, { size: "size-3" }) : /* @__PURE__ */ i(af, { size: "size-3" })
|
9118
9135
|
}
|
@@ -9179,7 +9196,7 @@ try {
|
|
9179
9196
|
});
|
9180
9197
|
} catch {
|
9181
9198
|
}
|
9182
|
-
const En = "av-button",
|
9199
|
+
const En = "av-button", tr = "icon", ga = "button", Gr = "link", hf = ({
|
9183
9200
|
type: e,
|
9184
9201
|
size: t,
|
9185
9202
|
labelRight: r,
|
@@ -9189,14 +9206,14 @@ const En = "av-button", er = "icon", pa = "button", jr = "link", hf = ({
|
|
9189
9206
|
}) => {
|
9190
9207
|
const o = "max-h-8 py-0 px-2", c = "max-h-9 h-8 px-3", l = "max-h-12 py-2 px-4";
|
9191
9208
|
switch (e) {
|
9192
|
-
case
|
9193
|
-
case
|
9209
|
+
case ga:
|
9210
|
+
case Gr:
|
9194
9211
|
return p({
|
9195
9212
|
[o]: t === "small",
|
9196
9213
|
[c]: t === "medium",
|
9197
9214
|
[l]: t === "large"
|
9198
9215
|
});
|
9199
|
-
case
|
9216
|
+
case tr:
|
9200
9217
|
return p("flex items-center", {
|
9201
9218
|
"justify-center": n === "center",
|
9202
9219
|
"justify-start": n === "left",
|
@@ -9223,15 +9240,15 @@ const En = "av-button", er = "icon", pa = "button", jr = "link", hf = ({
|
|
9223
9240
|
}) => {
|
9224
9241
|
const n = "text-sm font-medium", s = "text-base font-medium", o = "text-lg font-medium";
|
9225
9242
|
switch (e) {
|
9226
|
-
case
|
9227
|
-
case
|
9243
|
+
case ga:
|
9244
|
+
case Gr:
|
9228
9245
|
return p({
|
9229
|
-
"text-center": e ===
|
9246
|
+
"text-center": e === Gr,
|
9230
9247
|
[n]: t === "small",
|
9231
9248
|
[s]: t === "medium",
|
9232
9249
|
[o]: t === "large"
|
9233
9250
|
});
|
9234
|
-
case
|
9251
|
+
case tr:
|
9235
9252
|
return p({
|
9236
9253
|
[n]: t === "small" && (r || a),
|
9237
9254
|
[s]: t === "medium" && (r || a),
|
@@ -9438,8 +9455,8 @@ const En = "av-button", er = "icon", pa = "button", jr = "link", hf = ({
|
|
9438
9455
|
noBackground: u,
|
9439
9456
|
variant: h,
|
9440
9457
|
truncate: m,
|
9441
|
-
align:
|
9442
|
-
radius:
|
9458
|
+
align: g,
|
9459
|
+
radius: y,
|
9443
9460
|
animated: w
|
9444
9461
|
}) => (h || (h = "primary"), r ? p(En, t) : p(
|
9445
9462
|
En,
|
@@ -9450,13 +9467,13 @@ const En = "av-button", er = "icon", pa = "button", jr = "link", hf = ({
|
|
9450
9467
|
truncate: m
|
9451
9468
|
}),
|
9452
9469
|
pf({ mode: a, noBackground: u, variant: h }),
|
9453
|
-
gf({ radius:
|
9470
|
+
gf({ radius: y }),
|
9454
9471
|
hf({
|
9455
9472
|
type: e,
|
9456
9473
|
size: c,
|
9457
9474
|
labelRight: d,
|
9458
9475
|
labelLeft: f,
|
9459
|
-
align:
|
9476
|
+
align: g,
|
9460
9477
|
animated: w
|
9461
9478
|
}),
|
9462
9479
|
ff({ type: e, size: c, labelRight: d, labelLeft: f }),
|
@@ -9469,13 +9486,13 @@ const En = "av-button", er = "icon", pa = "button", jr = "link", hf = ({
|
|
9469
9486
|
"disabled:cursor-not-allowed disabled:opacity-50": s
|
9470
9487
|
},
|
9471
9488
|
p({
|
9472
|
-
"transition-[width] duration-300 ease-in": e ===
|
9489
|
+
"transition-[width] duration-300 ease-in": e === tr && w
|
9473
9490
|
}),
|
9474
9491
|
t
|
9475
9492
|
)), _f = (e, t, r) => {
|
9476
9493
|
var a;
|
9477
9494
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e?.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
9478
|
-
},
|
9495
|
+
}, ya = Z.forwardRef((e, t) => {
|
9479
9496
|
const { onClick: r, noInternalClick: a = !1, ...n } = e;
|
9480
9497
|
return /* @__PURE__ */ i(
|
9481
9498
|
"button",
|
@@ -9488,7 +9505,7 @@ const En = "av-button", er = "icon", pa = "button", jr = "link", hf = ({
|
|
9488
9505
|
}
|
9489
9506
|
);
|
9490
9507
|
});
|
9491
|
-
|
9508
|
+
ya.displayName = "BaseButton";
|
9492
9509
|
const co = Z.forwardRef(
|
9493
9510
|
({
|
9494
9511
|
children: e,
|
@@ -9505,8 +9522,8 @@ const co = Z.forwardRef(
|
|
9505
9522
|
radius: u = "large",
|
9506
9523
|
...h
|
9507
9524
|
}, m) => {
|
9508
|
-
const
|
9509
|
-
type:
|
9525
|
+
const g = io({
|
9526
|
+
type: ga,
|
9510
9527
|
mode: r,
|
9511
9528
|
focusMode: a,
|
9512
9529
|
fullWidth: n,
|
@@ -9520,10 +9537,10 @@ const co = Z.forwardRef(
|
|
9520
9537
|
radius: u
|
9521
9538
|
});
|
9522
9539
|
return /* @__PURE__ */ i(
|
9523
|
-
|
9540
|
+
ya,
|
9524
9541
|
{
|
9525
9542
|
ref: m,
|
9526
|
-
className:
|
9543
|
+
className: g,
|
9527
9544
|
disabled: t,
|
9528
9545
|
...h,
|
9529
9546
|
children: e
|
@@ -9556,7 +9573,7 @@ const Cf = {
|
|
9556
9573
|
bottom: 0,
|
9557
9574
|
right: 0
|
9558
9575
|
};
|
9559
|
-
function
|
9576
|
+
function Er(e) {
|
9560
9577
|
const t = Sf(), r = R(0), a = R(null), [n, s] = z(Cf), o = he(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((c) => {
|
9561
9578
|
const l = c[0];
|
9562
9579
|
l && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
@@ -9567,7 +9584,7 @@ function wr(e) {
|
|
9567
9584
|
o?.disconnect(), r.current && cancelAnimationFrame(r.current);
|
9568
9585
|
}), [o, e]), [a, n];
|
9569
9586
|
}
|
9570
|
-
const
|
9587
|
+
const Ut = {
|
9571
9588
|
small: 24,
|
9572
9589
|
// w-6
|
9573
9590
|
medium: 32,
|
@@ -9597,8 +9614,8 @@ const Bt = {
|
|
9597
9614
|
size: u = "medium",
|
9598
9615
|
labelRight: h,
|
9599
9616
|
labelLeft: m,
|
9600
|
-
noBackground:
|
9601
|
-
align:
|
9617
|
+
noBackground: g = !1,
|
9618
|
+
align: y = "center",
|
9602
9619
|
radius: w = "large",
|
9603
9620
|
variant: v = "primary",
|
9604
9621
|
iconClassName: C,
|
@@ -9606,7 +9623,7 @@ const Bt = {
|
|
9606
9623
|
...O
|
9607
9624
|
}, I) => {
|
9608
9625
|
const b = io({
|
9609
|
-
type:
|
9626
|
+
type: tr,
|
9610
9627
|
mode: r,
|
9611
9628
|
focusMode: a,
|
9612
9629
|
fullWidth: n,
|
@@ -9617,20 +9634,20 @@ const Bt = {
|
|
9617
9634
|
size: u,
|
9618
9635
|
labelRight: h,
|
9619
9636
|
labelLeft: m,
|
9620
|
-
noBackground:
|
9621
|
-
align:
|
9637
|
+
noBackground: g,
|
9638
|
+
align: y,
|
9622
9639
|
radius: w,
|
9623
9640
|
variant: v,
|
9624
9641
|
animated: S
|
9625
|
-
}), _ = Ef({ mode: r, raw: c, iconClassName: C }), k = kf({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, F] =
|
9642
|
+
}), _ = Ef({ mode: r, raw: c, iconClassName: C }), k = kf({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, F] = Er(), [A, W] = Er(), [P, J] = Er(), Q = R(0), L = R(null), M = R(null), q = Tf([I, L]);
|
9626
9643
|
return Oe(() => {
|
9627
|
-
P && P.current && S && (Q.current = J.width + If[u] + (l ? 0 : xf), L.current && !L.current.style.width && (L.current.style.width = `${
|
9644
|
+
P && P.current && S && (Q.current = J.width + If[u] + (l ? 0 : xf), L.current && !L.current.style.width && (L.current.style.width = `${Ut[u]}px`));
|
9628
9645
|
}, [J, P, u, l, S]), Oe(() => {
|
9629
9646
|
if (L && L.current && S) {
|
9630
|
-
let B =
|
9631
|
-
h && E && F.width > 0 ? B = F.width + Q.current : m && A && W.width > 0 && (B = W.width + Q.current), M.current && clearTimeout(M.current), B !== parseInt(L.current.style.width || "0", 10) && (E.current && (E.current.style.opacity = "0"), A.current && (A.current.style.opacity = "0"), L.current.style.width = `${B}px`, B >
|
9647
|
+
let B = Ut[u];
|
9648
|
+
h && E && F.width > 0 ? B = F.width + Q.current : m && A && W.width > 0 && (B = W.width + Q.current), M.current && clearTimeout(M.current), B !== parseInt(L.current.style.width || "0", 10) && (E.current && (E.current.style.opacity = "0"), A.current && (A.current.style.opacity = "0"), L.current.style.width = `${B}px`, B > Ut[u] && (M.current = setTimeout(() => {
|
9632
9649
|
E.current && h && (E.current.style.opacity = "1"), A.current && m && (A.current.style.opacity = "1"), M.current = null;
|
9633
|
-
}, Rf * 0.8))), B ===
|
9650
|
+
}, Rf * 0.8))), B === Ut[u] && (E.current && (E.current.style.opacity = "0"), A.current && (A.current.style.opacity = "0"));
|
9634
9651
|
}
|
9635
9652
|
}, [
|
9636
9653
|
F,
|
@@ -9644,7 +9661,7 @@ const Bt = {
|
|
9644
9661
|
]), $(() => () => {
|
9645
9662
|
M.current && clearTimeout(M.current);
|
9646
9663
|
}, []), /* @__PURE__ */ i(
|
9647
|
-
|
9664
|
+
ya,
|
9648
9665
|
{
|
9649
9666
|
ref: q,
|
9650
9667
|
className: b,
|
@@ -9812,10 +9829,10 @@ const Pf = ({ content: e }) => /* @__PURE__ */ i(
|
|
9812
9829
|
className: "mt-3",
|
9813
9830
|
children: /* @__PURE__ */ i($f, { mode: "light", focusMode: "light", children: e })
|
9814
9831
|
}
|
9815
|
-
), _n = 2, Mf =
|
9832
|
+
), _n = 2, Mf = it(
|
9816
9833
|
() => import(
|
9817
9834
|
/* webpackChunkName: "LazyMessageAssistant" */
|
9818
|
-
"./ChatBubbleAssistant.
|
9835
|
+
"./ChatBubbleAssistant.Q0TKW7i_.js"
|
9819
9836
|
)
|
9820
9837
|
), Lf = Z.memo(
|
9821
9838
|
({
|
@@ -9828,7 +9845,7 @@ const Pf = ({ content: e }) => /* @__PURE__ */ i(
|
|
9828
9845
|
const {
|
9829
9846
|
state: { restoring: s, streaming: o }
|
9830
9847
|
} = X(be);
|
9831
|
-
return e === hd && t ? /* @__PURE__ */ i(Pf, { content: t }) : o && (e ===
|
9848
|
+
return e === hd && t ? /* @__PURE__ */ i(Pf, { content: t }) : o && (e === qt || e === Tr) && (!t || t && t.length < _n) ? /* @__PURE__ */ i(oo, { tail: !0, children: /* @__PURE__ */ i(uf, { type: "dots" }) }) : (e === qt || e === Tr) && t && t.length >= _n ? /* @__PURE__ */ i(On, { fallback: /* @__PURE__ */ i("span", {}), children: /* @__PURE__ */ i(
|
9832
9849
|
Mf,
|
9833
9850
|
{
|
9834
9851
|
role: e,
|
@@ -9841,7 +9858,7 @@ const Pf = ({ content: e }) => /* @__PURE__ */ i(
|
|
9841
9858
|
) }) : null;
|
9842
9859
|
}
|
9843
9860
|
), Df = () => {
|
9844
|
-
const { messages: e } =
|
9861
|
+
const { messages: e } = Xe(), t = e ? e.map((r, a) => r.role === qt ? a : -1).filter((r) => r !== -1).pop() : -1;
|
9845
9862
|
return e && e.length > 0 ? /* @__PURE__ */ i("div", { className: "space-y-6 mt-2 @container", children: e?.map((r, a) => {
|
9846
9863
|
let n;
|
9847
9864
|
const s = `${a}-${r.role}`, o = r.parts.map((d) => {
|
@@ -9854,7 +9871,7 @@ const Pf = ({ content: e }) => /* @__PURE__ */ i(
|
|
9854
9871
|
`;
|
9855
9872
|
}
|
9856
9873
|
}), c = o && o.length > 0 ? o.filter(Boolean).join(`
|
9857
|
-
`) : void 0, l = r.role ===
|
9874
|
+
`) : void 0, l = r.role === qt && a === t;
|
9858
9875
|
return /* @__PURE__ */ i(
|
9859
9876
|
Lf,
|
9860
9877
|
{
|
@@ -9870,22 +9887,22 @@ const Pf = ({ content: e }) => /* @__PURE__ */ i(
|
|
9870
9887
|
}, Bf = () => {
|
9871
9888
|
const { isAuthenticated: e } = Ve(), { ref: t, inViewport: r } = Bi(), a = R(null), n = R(null), {
|
9872
9889
|
state: { footerPosition: s, footerHeight: o, footerOffset: c }
|
9873
|
-
} = X(
|
9890
|
+
} = X(ca), {
|
9874
9891
|
state: { loading: l }
|
9875
|
-
} = X(be), { messages: d } =
|
9892
|
+
} = X(be), { messages: d } = Xe(), f = R(0), u = Ro({
|
9876
9893
|
isAuthenticated: e,
|
9877
9894
|
extraClass: "rounded-b-md relative"
|
9878
9895
|
}), m = (!d || d.length === 0) && // no current chat session OR no messages
|
9879
|
-
Ae() ? "iphone-logo-conditional" :
|
9896
|
+
Ae() ? "iphone-logo-conditional" : Je() ? "mt-4" : "", g = V(() => {
|
9880
9897
|
n.current && n.current.scrollIntoView({
|
9881
9898
|
behavior: "smooth",
|
9882
9899
|
block: "end"
|
9883
9900
|
});
|
9884
9901
|
}, []);
|
9885
9902
|
return $(() => {
|
9886
|
-
l &&
|
9887
|
-
}, [l,
|
9888
|
-
f.current = s ===
|
9903
|
+
l && g();
|
9904
|
+
}, [l, g]), $(() => {
|
9905
|
+
f.current = s === qe ? o + c + Rn + Ao : 0;
|
9889
9906
|
}, [s, o, c]), /* @__PURE__ */ T(ue, { children: [
|
9890
9907
|
/* @__PURE__ */ T("div", { className: u, ref: a, children: [
|
9891
9908
|
/* @__PURE__ */ i(No, { className: m }),
|
@@ -9896,9 +9913,9 @@ const Pf = ({ content: e }) => /* @__PURE__ */ i(
|
|
9896
9913
|
/* @__PURE__ */ i(
|
9897
9914
|
ih,
|
9898
9915
|
{
|
9899
|
-
show: !r && s ===
|
9916
|
+
show: !r && s === qe,
|
9900
9917
|
bottom: f.current,
|
9901
|
-
onClick:
|
9918
|
+
onClick: g
|
9902
9919
|
}
|
9903
9920
|
)
|
9904
9921
|
] });
|
@@ -9907,20 +9924,20 @@ function uo({
|
|
9907
9924
|
isComponent: e = !1,
|
9908
9925
|
headerHeight: t = 0
|
9909
9926
|
}) {
|
9910
|
-
const { user: r, getAccessToken: a } = Ve(), [n, s] = z(`${
|
9911
|
-
key:
|
9927
|
+
const { user: r, getAccessToken: a } = Ve(), [n, s] = z(`${Na}px`), [o, c] = Kn(), [l, d] = z(Ue()), [f, u] = z([]), [h] = Gt({
|
9928
|
+
key: jt + Mo,
|
9912
9929
|
initialValue: ""
|
9913
|
-
}), [m] =
|
9914
|
-
key:
|
9915
|
-
initialValue:
|
9916
|
-
}),
|
9930
|
+
}), [m] = Gt({
|
9931
|
+
key: jt + Po,
|
9932
|
+
initialValue: mt.ASC
|
9933
|
+
}), g = he(() => {
|
9917
9934
|
const k = Ae();
|
9918
9935
|
return {
|
9919
|
-
footerPosition: k ?
|
9936
|
+
footerPosition: k ? qe : Kt,
|
9920
9937
|
footerHeight: 0,
|
9921
9938
|
footerOffset: k ? xn : 0
|
9922
9939
|
};
|
9923
|
-
}, []), [
|
9940
|
+
}, []), [y, w] = St(Tc, g), [v, C] = St(Ic, {
|
9924
9941
|
searchString: h,
|
9925
9942
|
sortedCell: "timestamp",
|
9926
9943
|
sortDirection: m
|
@@ -9940,7 +9957,7 @@ function uo({
|
|
9940
9957
|
attachments: 0,
|
9941
9958
|
lastStreamingTimestamp: 0,
|
9942
9959
|
lastResetTimestamp: 0
|
9943
|
-
}), { data: _ } =
|
9960
|
+
}), { data: _ } = Xt({
|
9944
9961
|
user: r?.username,
|
9945
9962
|
getAccessToken: a
|
9946
9963
|
});
|
@@ -9954,22 +9971,22 @@ function uo({
|
|
9954
9971
|
}
|
9955
9972
|
});
|
9956
9973
|
}, [_]), $(() => {
|
9957
|
-
if (
|
9974
|
+
if (y.footerPosition === "FOOTER_BOTTOM") {
|
9958
9975
|
const k = `calc(${c.height}px + 20px)`;
|
9959
9976
|
s(
|
9960
|
-
`calc(100svh - ${t}px - ${k} - ${
|
9977
|
+
`calc(100svh - ${t}px - ${k} - ${y.footerHeight}px - ${y.footerOffset}px - ${Rn}px)`
|
9961
9978
|
);
|
9962
9979
|
} else
|
9963
|
-
s(`${
|
9964
|
-
}, [
|
9965
|
-
|
9980
|
+
s(`${Na}px`);
|
9981
|
+
}, [y, c, t]), /* @__PURE__ */ i(
|
9982
|
+
oa.Provider,
|
9966
9983
|
{
|
9967
9984
|
value: {
|
9968
9985
|
state: v,
|
9969
9986
|
dispatch: C
|
9970
9987
|
},
|
9971
|
-
children: /* @__PURE__ */ i(
|
9972
|
-
|
9988
|
+
children: /* @__PURE__ */ i(ca.Provider, { value: { state: y, dispatch: w }, children: /* @__PURE__ */ i(
|
9989
|
+
ia.Provider,
|
9973
9990
|
{
|
9974
9991
|
value: { state: S, dispatch: O },
|
9975
9992
|
children: /* @__PURE__ */ i(
|
@@ -9986,7 +10003,7 @@ function uo({
|
|
9986
10003
|
{
|
9987
10004
|
value: {
|
9988
10005
|
id: l,
|
9989
|
-
api: `${
|
10006
|
+
api: `${ea}/api/generate`,
|
9990
10007
|
initialMessages: f,
|
9991
10008
|
experimental_throttle: 300,
|
9992
10009
|
sendExtraMessageFields: !1,
|
@@ -10001,8 +10018,8 @@ function uo({
|
|
10001
10018
|
},
|
10002
10019
|
children: [
|
10003
10020
|
/* @__PURE__ */ T("div", { className: Oo, children: [
|
10004
|
-
/* @__PURE__ */ i(
|
10005
|
-
/* @__PURE__ */ i(
|
10021
|
+
/* @__PURE__ */ i(za, { containerId: "toggle-save" }),
|
10022
|
+
/* @__PURE__ */ i(za, { containerId: "toggle-provider" })
|
10006
10023
|
] }),
|
10007
10024
|
/* @__PURE__ */ i(
|
10008
10025
|
$i,
|
@@ -10012,7 +10029,7 @@ function uo({
|
|
10012
10029
|
noMargin: !0,
|
10013
10030
|
noPadding: !0,
|
10014
10031
|
noBorder: !0,
|
10015
|
-
className:
|
10032
|
+
className: Oa({
|
10016
10033
|
extraClass: "mt-5"
|
10017
10034
|
}),
|
10018
10035
|
children: /* @__PURE__ */ i(Mh, { isComponent: e })
|
@@ -10021,7 +10038,7 @@ function uo({
|
|
10021
10038
|
/* @__PURE__ */ i(
|
10022
10039
|
$o,
|
10023
10040
|
{
|
10024
|
-
className:
|
10041
|
+
className: Oa({
|
10025
10042
|
extraClass: "transition-all ease-in-out duration-500"
|
10026
10043
|
}),
|
10027
10044
|
noMargin: !0,
|
@@ -10050,20 +10067,20 @@ export {
|
|
10050
10067
|
im as App,
|
10051
10068
|
ih as ButtonScroll,
|
10052
10069
|
es as CHAT_SET_PROVIDER,
|
10053
|
-
|
10070
|
+
at as CHAT_SET_STATUS,
|
10054
10071
|
be as ChatContext,
|
10055
|
-
|
10056
|
-
|
10072
|
+
Ye as ConfirmationPanel,
|
10073
|
+
Gt as E,
|
10057
10074
|
Gf as Fe,
|
10058
10075
|
Kf as Ge,
|
10059
10076
|
Wf as He,
|
10060
|
-
|
10061
|
-
|
10077
|
+
oa as HistoryContext,
|
10078
|
+
za as LazyToastContainerWrapper,
|
10062
10079
|
df as Me,
|
10063
10080
|
Rs as O,
|
10064
10081
|
oo as Oe,
|
10065
10082
|
wc as Pe,
|
10066
|
-
|
10083
|
+
mt as R,
|
10067
10084
|
ze as SERVICE_TYPES,
|
10068
10085
|
qf as Ye,
|
10069
10086
|
bi as a,
|
@@ -10074,7 +10091,7 @@ export {
|
|
10074
10091
|
Fi as i,
|
10075
10092
|
em as k,
|
10076
10093
|
ts as mutateCall,
|
10077
|
-
|
10094
|
+
sa as n,
|
10078
10095
|
tm as nt,
|
10079
10096
|
xs as o,
|
10080
10097
|
Si as p,
|
@@ -10084,11 +10101,11 @@ export {
|
|
10084
10101
|
Rc as setNewProvider,
|
10085
10102
|
om as showErrorToast,
|
10086
10103
|
Xs as showSuccessToast,
|
10087
|
-
|
10104
|
+
Xe as useAiChat,
|
10088
10105
|
Qf as useChangelogs,
|
10089
10106
|
rs as useChatsHistory,
|
10090
10107
|
Zf as useChatsUsage,
|
10091
10108
|
Yf as useServerCapabilities,
|
10092
10109
|
Xf as useUserChatStats,
|
10093
|
-
|
10110
|
+
Xt as useUserPreferences
|
10094
10111
|
};
|