@versini/sassysaint 8.26.3 → 8.27.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.7ueKzWyF.js → AboutChangelog.C1FUYrQH.js} +2 -2
- package/dist/chunks/{AboutEntry.DhljBqVO.js → AboutEntry.DYw63Smf.js} +5 -5
- package/dist/chunks/{App.9D7tAP-W.js → App.CLsRrqnB.js} +279 -272
- package/dist/chunks/{Chart.DA3KPOhe.js → Chart.C76TkuUt.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.DUDmGgnN.js → ChatBubbleAssistant.AQlDoZAW.js} +3 -3
- package/dist/chunks/{HistoryEntry.C92fhlNu.js → HistoryEntry.Cqle-uCR.js} +2 -2
- package/dist/chunks/{I3HPI4QX.DUpsHxtP.js → I3HPI4QX.B69lq-LG.js} +1 -1
- package/dist/chunks/{ProfileEntry.Bmyl_deB.js → ProfileEntry.Cb5Y7hl8.js} +2 -2
- package/dist/chunks/{SettingsEntry.CO4vgrKR.js → SettingsEntry.gGlNbDNL.js} +2 -2
- package/dist/chunks/{UsageEntry.BGyXJHmv.js → UsageEntry.Dgiz9VvB.js} +3 -3
- package/dist/chunks/{index.ClAz6-Y-.js → index.Bi1LXgwR.js} +3 -3
- package/dist/chunks/{index.DqNRauDV.js → index.CHVzaxdH.js} +1 -1
- package/dist/chunks/{index.CMwAtVjF.js → index.Clys7w0D.js} +1 -1
- package/dist/chunks/{index.CZXC4tuS.js → index.DdIh58Wu.js} +2 -2
- package/dist/chunks/{index.Dkj1FYyK.js → index.DeXqR0YT.js} +1 -1
- package/dist/chunks/{index.1NVu-BYL.js → index.DkMqkMUz.js} +275 -277
- package/dist/chunks/{useMarkdown.B-P_2-Ze.js → useMarkdown.GTRBn-s8.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +4 -3
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as i, jsxs as T, Fragment as ue } from "react/jsx-runtime";
|
2
|
-
import { Subscribable as lo, pendingThenable as ba, resolveEnabled as ke, shallowEqualObjects as wr, resolveStaleTime as gt, noop as Er, isServer as kr, isValidTimeout as va, focusManager as uo, fetchState as ho, replaceData as wa, notifyManager as kn, timeUntilStale as fo, shouldThrowError as mo, useQueryClient as po, I as re, ACTION_SORT as go, ACTION_SEARCH as yo, ACTION_RESET_PROMPT as _n, ACTION_TOGGLE_PROMPT as Sn, le as Ce, DEFAULT_ICON_ACTION_SIZE as Te, n as
|
2
|
+
import { Subscribable as lo, pendingThenable as ba, resolveEnabled as ke, shallowEqualObjects as wr, resolveStaleTime as gt, noop as Er, isServer as kr, isValidTimeout as va, focusManager as uo, fetchState as ho, replaceData as wa, notifyManager as kn, timeUntilStale as fo, shouldThrowError as mo, useQueryClient as po, I as re, ACTION_SORT as go, ACTION_SEARCH as yo, ACTION_RESET_PROMPT as _n, ACTION_TOGGLE_PROMPT as Sn, le as Ce, DEFAULT_ICON_ACTION_SIZE as Te, n as Ve, isElectron as Ea, isProbablyiPhone as Ae, L as Tn, j as yt, C as ka, LOCAL_STORAGE_PREFIX as Ft, LOCAL_STORAGE_PRIVATE_DISCLOSURE as bo, LOCAL_STORAGE_REASONING_DISCLOSURE as vo, TOAST_CHAT_SAVED as wo, TOAST_PROVIDER_CHANGED as Eo, PROMPT_CLASSNAME as ko, PROMPT_EDITABLE_AREA_CLASSNAME as _o, ERROR_MESSAGE as So, ROLE_INTERNAL as _r, CLIPBOARD_PROMPT as _a, isProbablyMobile as Ge, INPUT_PLACEHOLDER_TEXT_MOBILE as Sa, INPUT_PLACEHOLDER_TEXT_ENTER as Ta, INPUT_PLACEHOLDER_TEXT_CMD_ENTER as Ca, INPUT_BOTTOM_OFFSET_EXTRA as To, INPUT_BOTTOM_OFFSET as Cn, FOOTER_DISCLAIMER as Co, LOG_OUT as Ia, getMessageContaintWrapperClass as Io, UI_FOOTER_BUFFER as In, UI_BUTTON_SCROLL_BUFFER as xo, Logo as Ro, UI_DEFAULT_MAIN_HEIGHT as xa, APP_CLASSNAME as Ao, getMainPaddingClass as Ra, r as No, LOCAL_STORAGE_SORT as Oo, LOCAL_STORAGE_SEARCH as $o } from "./index.DkMqkMUz.js";
|
3
3
|
import * as Y from "react";
|
4
|
-
import Z, { useEffect as $, useRef as R, useState as F, useCallback as W, useSyncExternalStore as Po, useMemo as he, useId as Wr, useContext as X, useLayoutEffect as
|
4
|
+
import Z, { useEffect as $, useRef as R, useState as F, useCallback as W, useSyncExternalStore as Po, useMemo as he, useId as Wr, useContext as X, useLayoutEffect as Oe, createContext as xn, useDebugValue as Mo, forwardRef as Rn, Suspense as An, lazy as ot, useReducer as St } from "react";
|
5
5
|
import p from "clsx";
|
6
6
|
import { computePosition as Lo, offset as Nn, flip as On, shift as $n, arrow as Do, useMergeRefs as Kr, FloatingPortal as Pn, FloatingOverlay as Bo, FloatingFocusManager as Mn, useFloating as Ln, useClick as Dn, useDismiss as Bn, useRole as Hn, useInteractions as Un, FloatingTree as Ho, useFloatingTree as Vn, useFloatingNodeId as Uo, useListItem as zn, autoUpdate as Vo, useListNavigation as zo, useTypeahead as Fo, FloatingNode as jo, FloatingList as Wo } from "@floating-ui/react";
|
7
7
|
var Ko = class extends lo {
|
@@ -377,7 +377,7 @@ function oi(e, t, r) {
|
|
377
377
|
l.updateResult();
|
378
378
|
}), o.notifyOnChangeProps ? d : l.trackResult(d);
|
379
379
|
}
|
380
|
-
function
|
380
|
+
function it(e, t) {
|
381
381
|
return oi(e, Ko, t);
|
382
382
|
}
|
383
383
|
const ii = ({
|
@@ -1132,7 +1132,7 @@ function Fi() {
|
|
1132
1132
|
window.visualViewport && (window.visualViewport.removeEventListener("resize", r), window.visualViewport.removeEventListener("orientationchange", r));
|
1133
1133
|
}), [r]), e;
|
1134
1134
|
}
|
1135
|
-
const qt = "thead", Jr = "tfoot",
|
1135
|
+
const qt = "thead", Jr = "tfoot", tt = "tbody", ft = {
|
1136
1136
|
ASC: "asc",
|
1137
1137
|
DESC: "desc"
|
1138
1138
|
}, ji = ({
|
@@ -1212,13 +1212,13 @@ const qt = "thead", Jr = "tfoot", Ze = "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 === tt && 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 === tt && 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 === tt && 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 === tt && e === "alt-system"
|
1222
1222
|
},
|
1223
1223
|
t
|
1224
1224
|
), Ji = ({
|
@@ -1240,7 +1240,7 @@ const qt = "thead", Jr = "tfoot", Ze = "tbody", ft = {
|
|
1240
1240
|
"dark:text-copy-dark": a === "system",
|
1241
1241
|
"dark:text-copy-light": a === "alt-system",
|
1242
1242
|
"px-4 py-3": !r && (e === qt || e === Jr),
|
1243
|
-
"p-4": !r && e ===
|
1243
|
+
"p-4": !r && e === tt,
|
1244
1244
|
"px-2 py-1.5": r
|
1245
1245
|
},
|
1246
1246
|
t
|
@@ -1648,9 +1648,9 @@ const Tt = {
|
|
1648
1648
|
variant: w,
|
1649
1649
|
animated: S
|
1650
1650
|
}), _ = sc({ mode: r, raw: c, iconClassName: C }), k = oc({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, V] = er(), [A, z] = er(), [P, J] = er(), Q = R(0), L = R(null), M = R(null), q = dc([I, L]);
|
1651
|
-
return
|
1651
|
+
return Oe(() => {
|
1652
1652
|
P && P.current && S && (Q.current = J.width + hc[u] + (l ? 0 : fc), L.current && !L.current.style.width && (L.current.style.width = `${Tt[u]}px`));
|
1653
|
-
}, [J, P, u, l, S]),
|
1653
|
+
}, [J, P, u, l, S]), Oe(() => {
|
1654
1654
|
if (L && L.current && S) {
|
1655
1655
|
let B = Tt[u];
|
1656
1656
|
h && E && V.width > 0 ? B = V.width + Q.current : m && A && z.width > 0 && (B = z.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 > Tt[u] && (M.current = setTimeout(() => {
|
@@ -1906,7 +1906,7 @@ try {
|
|
1906
1906
|
});
|
1907
1907
|
} catch {
|
1908
1908
|
}
|
1909
|
-
const
|
1909
|
+
const ct = Z.createContext({
|
1910
1910
|
mode: "light",
|
1911
1911
|
cellWrapper: "thead",
|
1912
1912
|
stickyHeader: !1,
|
@@ -1933,7 +1933,7 @@ const it = Z.createContext({
|
|
1933
1933
|
stickyFooter: d
|
1934
1934
|
});
|
1935
1935
|
return /* @__PURE__ */ i(
|
1936
|
-
|
1936
|
+
ct.Provider,
|
1937
1937
|
{
|
1938
1938
|
value: { mode: t, stickyHeader: l, stickyFooter: d, compact: a },
|
1939
1939
|
children: /* @__PURE__ */ i(
|
@@ -1956,7 +1956,7 @@ const it = Z.createContext({
|
|
1956
1956
|
className: t,
|
1957
1957
|
...r
|
1958
1958
|
}) => {
|
1959
|
-
const a = X(
|
1959
|
+
const a = X(ct);
|
1960
1960
|
a.cellWrapper = qt;
|
1961
1961
|
const n = Wi({
|
1962
1962
|
className: t,
|
@@ -1969,7 +1969,7 @@ const it = Z.createContext({
|
|
1969
1969
|
className: t,
|
1970
1970
|
...r
|
1971
1971
|
}) => {
|
1972
|
-
const a = X(
|
1972
|
+
const a = X(ct);
|
1973
1973
|
a.cellWrapper = Jr;
|
1974
1974
|
const n = Ki({
|
1975
1975
|
className: t,
|
@@ -1978,14 +1978,14 @@ const it = Z.createContext({
|
|
1978
1978
|
});
|
1979
1979
|
return /* @__PURE__ */ i("tfoot", { className: n, ...r, children: e });
|
1980
1980
|
}, Wf = ({ children: e, ...t }) => {
|
1981
|
-
const r = X(
|
1982
|
-
return r.cellWrapper =
|
1981
|
+
const r = X(ct);
|
1982
|
+
return r.cellWrapper = tt, /* @__PURE__ */ i("tbody", { ...t, children: e });
|
1983
1983
|
}, Kf = ({
|
1984
1984
|
children: e,
|
1985
1985
|
className: t,
|
1986
1986
|
...r
|
1987
1987
|
}) => {
|
1988
|
-
const a = X(
|
1988
|
+
const a = X(ct), n = Gi({
|
1989
1989
|
mode: a.mode,
|
1990
1990
|
cellWrapper: a.cellWrapper,
|
1991
1991
|
className: t
|
@@ -1998,7 +1998,7 @@ const it = Z.createContext({
|
|
1998
1998
|
align: a,
|
1999
1999
|
...n
|
2000
2000
|
}) => {
|
2001
|
-
const s = X(
|
2001
|
+
const s = X(ct), o = t || (s.cellWrapper === qt ? "th" : "td"), { mainClasses: c, alignClasses: l } = Ji({
|
2002
2002
|
cellWrapper: s.cellWrapper,
|
2003
2003
|
className: r,
|
2004
2004
|
mode: s.mode,
|
@@ -2077,7 +2077,7 @@ function Ec() {
|
|
2077
2077
|
return tr(wc);
|
2078
2078
|
}
|
2079
2079
|
const kc = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ba = { randomUUID: kc };
|
2080
|
-
function
|
2080
|
+
function He(e, t, r) {
|
2081
2081
|
if (Ba.randomUUID && !e)
|
2082
2082
|
return Ba.randomUUID();
|
2083
2083
|
e = e || {};
|
@@ -2109,7 +2109,7 @@ const Ha = ({
|
|
2109
2109
|
};
|
2110
2110
|
}
|
2111
2111
|
}, []), r && rr ? /* @__PURE__ */ i(rr, { containerId: e, ...t }) : null;
|
2112
|
-
},
|
2112
|
+
}, Je = "FOOTER_BOTTOM", Wt = "FOOTER_TOP", mt = "APP_SET_FOOTER_POSITION", Qn = "APP_SET_FOOTER_HEIGHT", _c = (e, t) => {
|
2113
2113
|
switch (t.type) {
|
2114
2114
|
case mt:
|
2115
2115
|
return {
|
@@ -2125,19 +2125,19 @@ const Ha = ({
|
|
2125
2125
|
default:
|
2126
2126
|
return e;
|
2127
2127
|
}
|
2128
|
-
},
|
2128
|
+
}, rt = "CHAT_SET_STATUS", Xn = "CHAT_SET_USAGE", nt = "CHAT_SET_ATTACHMENTS", Zn = "CHAT_SET_PROVIDER", Ye = "CHAT_RESET", Sc = (e, t) => {
|
2129
2129
|
switch (t.type) {
|
2130
2130
|
case Xn:
|
2131
2131
|
return {
|
2132
2132
|
...e,
|
2133
2133
|
tokenUsage: e.tokenUsage + t.payload.tokenUsage
|
2134
2134
|
};
|
2135
|
-
case
|
2135
|
+
case nt:
|
2136
2136
|
return {
|
2137
2137
|
...e,
|
2138
2138
|
attachments: t.payload.attachments
|
2139
2139
|
};
|
2140
|
-
case
|
2140
|
+
case rt: {
|
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,7 +2158,7 @@ const Ha = ({
|
|
2158
2158
|
...e,
|
2159
2159
|
provider: t.payload.provider
|
2160
2160
|
};
|
2161
|
-
case
|
2161
|
+
case Ye: {
|
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,
|
@@ -2342,7 +2342,7 @@ const Ha = ({
|
|
2342
2342
|
tokenUsage
|
2343
2343
|
}
|
2344
2344
|
}`
|
2345
|
-
},
|
2345
|
+
}, ze = {
|
2346
2346
|
GET_LOCATION: {
|
2347
2347
|
schema: we.GET_LOCATION,
|
2348
2348
|
method: "location"
|
@@ -2443,7 +2443,7 @@ const Ha = ({
|
|
2443
2443
|
try {
|
2444
2444
|
await es({
|
2445
2445
|
accessToken: t,
|
2446
|
-
type:
|
2446
|
+
type: ze.SET_USER_PREFERENCES,
|
2447
2447
|
params: {
|
2448
2448
|
user: r,
|
2449
2449
|
provider: e
|
@@ -2451,23 +2451,23 @@ const Ha = ({
|
|
2451
2451
|
});
|
2452
2452
|
} catch {
|
2453
2453
|
}
|
2454
|
-
},
|
2454
|
+
}, lt = {
|
2455
2455
|
CHATS: "chats",
|
2456
2456
|
CHATS_STATS: "chatsStats",
|
2457
2457
|
CAPABILITIES: "capabilities",
|
2458
2458
|
CHANGELOGS: "changelogs",
|
2459
2459
|
PREFERENCES: "preferences",
|
2460
2460
|
USAGE: "usage"
|
2461
|
-
}, Jf = () =>
|
2462
|
-
queryKey: [
|
2463
|
-
queryFn: async () => await
|
2464
|
-
type:
|
2461
|
+
}, Jf = () => it({
|
2462
|
+
queryKey: [lt.CAPABILITIES],
|
2463
|
+
queryFn: async () => await dt({
|
2464
|
+
type: ze.GET_SERVER_CAPABILITIES,
|
2465
2465
|
noAuth: !0
|
2466
2466
|
})
|
2467
|
-
}), qf = () =>
|
2468
|
-
queryKey: [
|
2469
|
-
queryFn: async () => await
|
2470
|
-
type:
|
2467
|
+
}), qf = () => it({
|
2468
|
+
queryKey: [lt.CHANGELOGS],
|
2469
|
+
queryFn: async () => await dt({
|
2470
|
+
type: ze.GET_CHANGELOGS,
|
2471
2471
|
noAuth: !0,
|
2472
2472
|
params: {
|
2473
2473
|
client: !0
|
@@ -2476,25 +2476,25 @@ const Ha = ({
|
|
2476
2476
|
}), Yt = ({
|
2477
2477
|
user: e,
|
2478
2478
|
getAccessToken: t
|
2479
|
-
}) =>
|
2480
|
-
queryKey: [
|
2481
|
-
queryFn: async () => await
|
2479
|
+
}) => it({
|
2480
|
+
queryKey: [lt.PREFERENCES, e],
|
2481
|
+
queryFn: async () => await dt({
|
2482
2482
|
params: {
|
2483
2483
|
user: e
|
2484
2484
|
},
|
2485
|
-
type:
|
2485
|
+
type: ze.GET_USER_PREFERENCES,
|
2486
2486
|
getAccessToken: t
|
2487
2487
|
})
|
2488
2488
|
}), Yf = ({
|
2489
2489
|
user: e,
|
2490
2490
|
getAccessToken: t
|
2491
|
-
}) =>
|
2492
|
-
queryKey: [
|
2493
|
-
queryFn: async () => await
|
2491
|
+
}) => it({
|
2492
|
+
queryKey: [lt.CHATS_STATS, e],
|
2493
|
+
queryFn: async () => await dt({
|
2494
2494
|
params: {
|
2495
2495
|
user: e
|
2496
2496
|
},
|
2497
|
-
type:
|
2497
|
+
type: ze.GET_CHATS_STATS,
|
2498
2498
|
getAccessToken: t
|
2499
2499
|
})
|
2500
2500
|
}), ts = ({
|
@@ -2503,12 +2503,12 @@ const Ha = ({
|
|
2503
2503
|
sortDirection: r,
|
2504
2504
|
getAccessToken: a,
|
2505
2505
|
enabled: n = !0
|
2506
|
-
}) =>
|
2506
|
+
}) => it({
|
2507
2507
|
enabled: n,
|
2508
2508
|
staleTime: 60 * 1e3,
|
2509
2509
|
// 1 minute
|
2510
|
-
queryKey: [
|
2511
|
-
queryFn: async () => await
|
2510
|
+
queryKey: [lt.CHATS, e, t, r],
|
2511
|
+
queryFn: async () => await dt({
|
2512
2512
|
params: {
|
2513
2513
|
user: e,
|
2514
2514
|
searchString: t,
|
@@ -2516,7 +2516,7 @@ const Ha = ({
|
|
2516
2516
|
limit: 1,
|
2517
2517
|
truncateSize: 100
|
2518
2518
|
},
|
2519
|
-
type:
|
2519
|
+
type: ze.GET_CHATS,
|
2520
2520
|
getAccessToken: a
|
2521
2521
|
})
|
2522
2522
|
}), Qf = ({
|
@@ -2525,19 +2525,19 @@ const Ha = ({
|
|
2525
2525
|
year: r = (/* @__PURE__ */ new Date()).getFullYear().toString(),
|
2526
2526
|
getAccessToken: a,
|
2527
2527
|
enabled: n = !0
|
2528
|
-
}) =>
|
2528
|
+
}) => it({
|
2529
2529
|
enabled: n,
|
2530
|
-
queryKey: [
|
2531
|
-
queryFn: async () => await
|
2530
|
+
queryKey: [lt.USAGE, e, t, r],
|
2531
|
+
queryFn: async () => await dt({
|
2532
2532
|
params: {
|
2533
2533
|
user: e,
|
2534
2534
|
month: t,
|
2535
2535
|
year: r
|
2536
2536
|
},
|
2537
|
-
type:
|
2537
|
+
type: ze.GET_USAGE,
|
2538
2538
|
getAccessToken: a
|
2539
2539
|
})
|
2540
|
-
}),
|
2540
|
+
}), dt = async ({
|
2541
2541
|
params: e,
|
2542
2542
|
type: t,
|
2543
2543
|
noAuth: r,
|
@@ -2604,11 +2604,11 @@ var rs = "vercel.ai.error", xc = Symbol.for(rs), as, Rc = class ns extends Error
|
|
2604
2604
|
}
|
2605
2605
|
};
|
2606
2606
|
as = xc;
|
2607
|
-
var
|
2607
|
+
var st = Rc;
|
2608
2608
|
function ss(e) {
|
2609
2609
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.message : JSON.stringify(e);
|
2610
2610
|
}
|
2611
|
-
var os = "AI_InvalidArgumentError", is = `vercel.ai.error.${os}`, Ac = Symbol.for(is), cs, Nc = class extends
|
2611
|
+
var os = "AI_InvalidArgumentError", is = `vercel.ai.error.${os}`, Ac = Symbol.for(is), cs, Nc = class extends st {
|
2612
2612
|
constructor({
|
2613
2613
|
message: e,
|
2614
2614
|
cause: t,
|
@@ -2617,11 +2617,11 @@ var os = "AI_InvalidArgumentError", is = `vercel.ai.error.${os}`, Ac = Symbol.fo
|
|
2617
2617
|
super({ name: os, message: e, cause: t }), this[cs] = !0, this.argument = r;
|
2618
2618
|
}
|
2619
2619
|
static isInstance(e) {
|
2620
|
-
return
|
2620
|
+
return st.hasMarker(e, is);
|
2621
2621
|
}
|
2622
2622
|
};
|
2623
2623
|
cs = Ac;
|
2624
|
-
var ls = "AI_JSONParseError", ds = `vercel.ai.error.${ls}`, Oc = Symbol.for(ds), us, Ua = class extends
|
2624
|
+
var ls = "AI_JSONParseError", ds = `vercel.ai.error.${ls}`, Oc = Symbol.for(ds), us, Ua = class extends st {
|
2625
2625
|
constructor({ text: e, cause: t }) {
|
2626
2626
|
super({
|
2627
2627
|
name: ls,
|
@@ -2631,11 +2631,11 @@ Error message: ${ss(t)}`,
|
|
2631
2631
|
}), this[us] = !0, this.text = e;
|
2632
2632
|
}
|
2633
2633
|
static isInstance(e) {
|
2634
|
-
return
|
2634
|
+
return st.hasMarker(e, ds);
|
2635
2635
|
}
|
2636
2636
|
};
|
2637
2637
|
us = Oc;
|
2638
|
-
var hs = "AI_TypeValidationError", fs = `vercel.ai.error.${hs}`, $c = Symbol.for(fs), ms, Pc = class Cr extends
|
2638
|
+
var hs = "AI_TypeValidationError", fs = `vercel.ai.error.${hs}`, $c = Symbol.for(fs), ms, Pc = class Cr extends st {
|
2639
2639
|
constructor({ value: t, cause: r }) {
|
2640
2640
|
super({
|
2641
2641
|
name: hs,
|
@@ -2645,7 +2645,7 @@ Error message: ${ss(r)}`,
|
|
2645
2645
|
}), this[ms] = !0, this.value = t;
|
2646
2646
|
}
|
2647
2647
|
static isInstance(t) {
|
2648
|
-
return
|
2648
|
+
return st.hasMarker(t, fs);
|
2649
2649
|
}
|
2650
2650
|
/**
|
2651
2651
|
* Wraps an error into a TypeValidationError.
|
@@ -2675,9 +2675,9 @@ let Mc = (e, t = 21) => (r = t) => {
|
|
2675
2675
|
function ps(e) {
|
2676
2676
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
2677
2677
|
}
|
2678
|
-
var
|
2678
|
+
var Ke = { exports: {} }, za;
|
2679
2679
|
function Lc() {
|
2680
|
-
if (za) return
|
2680
|
+
if (za) return Ke.exports;
|
2681
2681
|
za = 1;
|
2682
2682
|
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
2683
|
function a(c, l, d) {
|
@@ -2746,7 +2746,7 @@ function Lc() {
|
|
2746
2746
|
Error.stackTraceLimit = d;
|
2747
2747
|
}
|
2748
2748
|
}
|
2749
|
-
return
|
2749
|
+
return Ke.exports = s, Ke.exports.default = s, Ke.exports.parse = s, Ke.exports.safeParse = o, Ke.exports.scan = n, Ke.exports;
|
2750
2750
|
}
|
2751
2751
|
var Dc = /* @__PURE__ */ Lc();
|
2752
2752
|
const Bc = /* @__PURE__ */ ps(Dc);
|
@@ -3972,15 +3972,15 @@ function Ar(e, t) {
|
|
3972
3972
|
}
|
3973
3973
|
return e !== e && t !== t;
|
3974
3974
|
}
|
3975
|
-
const
|
3975
|
+
const Ne = /* @__PURE__ */ new WeakMap(), Le = () => {
|
3976
3976
|
}, de = (
|
3977
3977
|
/*#__NOINLINE__*/
|
3978
|
-
|
3979
|
-
), Nr = Object, K = (e) => e === de, Se = (e) => typeof e == "function",
|
3978
|
+
Le()
|
3979
|
+
), Nr = Object, K = (e) => e === de, Se = (e) => typeof e == "function", Ue = (e, t) => ({
|
3980
3980
|
...e,
|
3981
3981
|
...t
|
3982
3982
|
}), Es = (e) => Se(e.then), or = {}, xt = {}, ea = "undefined", wt = typeof window != ea, Or = typeof document != ea, Il = wt && "Deno" in window, xl = () => wt && typeof window.requestAnimationFrame != ea, ks = (e, t) => {
|
3983
|
-
const r =
|
3983
|
+
const r = Ne.get(e);
|
3984
3984
|
return [
|
3985
3985
|
// Getter
|
3986
3986
|
() => !K(t) && e.get(t) || or,
|
@@ -3988,7 +3988,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
3988
3988
|
(a) => {
|
3989
3989
|
if (!K(t)) {
|
3990
3990
|
const n = e.get(t);
|
3991
|
-
t in xt || (xt[t] = n), r[5](t,
|
3991
|
+
t in xt || (xt[t] = n), r[5](t, Ue(n, a), n || or);
|
3992
3992
|
}
|
3993
3993
|
},
|
3994
3994
|
// Subscriber
|
@@ -4002,8 +4002,8 @@ const Rl = () => $r, [Pr, Mr] = wt && window.addEventListener ? [
|
|
4002
4002
|
window.addEventListener.bind(window),
|
4003
4003
|
window.removeEventListener.bind(window)
|
4004
4004
|
] : [
|
4005
|
-
|
4006
|
-
|
4005
|
+
Le,
|
4006
|
+
Le
|
4007
4007
|
], Al = () => {
|
4008
4008
|
const e = Or && document.visibilityState;
|
4009
4009
|
return K(e) || e !== "hidden";
|
@@ -4024,7 +4024,7 @@ const Rl = () => $r, [Pr, Mr] = wt && window.addEventListener ? [
|
|
4024
4024
|
}, Pl = {
|
4025
4025
|
initFocus: Nl,
|
4026
4026
|
initReconnect: Ol
|
4027
|
-
}, Ya = !Z.useId, bt = !wt || Il, Ml = (e) => xl() ? window.requestAnimationFrame(e) : setTimeout(e, 1), ir = bt ? $ :
|
4027
|
+
}, Ya = !Z.useId, bt = !wt || Il, Ml = (e) => xl() ? window.requestAnimationFrame(e) : setTimeout(e, 1), ir = bt ? $ : Oe, cr = typeof navigator < "u" && navigator.connection, Qa = !bt && cr && ([
|
4028
4028
|
"slow-2g",
|
4029
4029
|
"2g"
|
4030
4030
|
].includes(cr.effectiveType) || cr.saveData), Rt = /* @__PURE__ */ new WeakMap(), Ll = (e) => Nr.prototype.toString.call(e), lr = (e, t) => e === `[object ${t}]`;
|
@@ -4065,7 +4065,7 @@ const Lr = (e) => {
|
|
4065
4065
|
let Bl = 0;
|
4066
4066
|
const Dr = () => ++Bl;
|
4067
4067
|
async function _s(...e) {
|
4068
|
-
const [t, r, a, n] = e, s =
|
4068
|
+
const [t, r, a, n] = e, s = Ue({
|
4069
4069
|
populateCache: !0,
|
4070
4070
|
throwOnError: !0
|
4071
4071
|
}, typeof n == "boolean" ? {
|
@@ -4086,7 +4086,7 @@ async function _s(...e) {
|
|
4086
4086
|
async function u(h) {
|
4087
4087
|
const [m] = ta(h);
|
4088
4088
|
if (!m) return;
|
4089
|
-
const [g, y] = ks(t, m), [v, w, C, S] =
|
4089
|
+
const [g, y] = ks(t, m), [v, w, C, S] = Ne.get(t), O = () => {
|
4090
4090
|
const P = v[m];
|
4091
4091
|
return (Se(s.revalidate) ? s.revalidate(g().data, h) : s.revalidate !== !1) && (delete C[m], delete S[m], P && P[0]) ? P[0](ws).then(() => g().data) : g().data;
|
4092
4092
|
};
|
@@ -4147,9 +4147,9 @@ const Xa = (e, t) => {
|
|
4147
4147
|
for (const r in e)
|
4148
4148
|
e[r][0] && e[r][0](t);
|
4149
4149
|
}, Hl = (e, t) => {
|
4150
|
-
if (!
|
4151
|
-
const r =
|
4152
|
-
let s =
|
4150
|
+
if (!Ne.has(e)) {
|
4151
|
+
const r = Ue(Pl, t), a = /* @__PURE__ */ Object.create(null), n = _s.bind(de, e);
|
4152
|
+
let s = Le;
|
4153
4153
|
const o = /* @__PURE__ */ Object.create(null), c = (f, u) => {
|
4154
4154
|
const h = o[f] || [];
|
4155
4155
|
return o[f] = h, h.push(u), () => h.splice(h.indexOf(u), 1);
|
@@ -4160,7 +4160,7 @@ const Xa = (e, t) => {
|
|
4160
4160
|
for (const g of m)
|
4161
4161
|
g(u, h);
|
4162
4162
|
}, d = () => {
|
4163
|
-
if (!
|
4163
|
+
if (!Ne.has(e) && (Ne.set(e, [
|
4164
4164
|
a,
|
4165
4165
|
/* @__PURE__ */ Object.create(null),
|
4166
4166
|
/* @__PURE__ */ Object.create(null),
|
@@ -4171,7 +4171,7 @@ const Xa = (e, t) => {
|
|
4171
4171
|
]), !bt)) {
|
4172
4172
|
const f = r.initFocus(setTimeout.bind(de, Xa.bind(de, a, bs))), u = r.initReconnect(setTimeout.bind(de, Xa.bind(de, a, vs)));
|
4173
4173
|
s = () => {
|
4174
|
-
f && f(), u && u(),
|
4174
|
+
f && f(), u && u(), Ne.delete(e);
|
4175
4175
|
};
|
4176
4176
|
}
|
4177
4177
|
};
|
@@ -4184,19 +4184,19 @@ const Xa = (e, t) => {
|
|
4184
4184
|
}
|
4185
4185
|
return [
|
4186
4186
|
e,
|
4187
|
-
|
4187
|
+
Ne.get(e)[4]
|
4188
4188
|
];
|
4189
4189
|
}, Ul = (e, t, r, a, n) => {
|
4190
4190
|
const s = r.errorRetryCount, o = n.retryCount, c = ~~((Math.random() + 0.5) * (1 << (o < 8 ? o : 8))) * r.errorRetryInterval;
|
4191
4191
|
!K(s) && o > s || setTimeout(a, c, n);
|
4192
|
-
}, Vl = Ar, [Ss, zl] = Hl(/* @__PURE__ */ new Map()), Fl =
|
4192
|
+
}, Vl = Ar, [Ss, zl] = Hl(/* @__PURE__ */ new Map()), Fl = Ue(
|
4193
4193
|
{
|
4194
4194
|
// events
|
4195
|
-
onLoadingSlow:
|
4196
|
-
onSuccess:
|
4197
|
-
onError:
|
4195
|
+
onLoadingSlow: Le,
|
4196
|
+
onSuccess: Le,
|
4197
|
+
onError: Le,
|
4198
4198
|
onErrorRetry: Ul,
|
4199
|
-
onDiscarded:
|
4199
|
+
onDiscarded: Le,
|
4200
4200
|
// switches
|
4201
4201
|
revalidateOnFocus: !0,
|
4202
4202
|
revalidateOnReconnect: !0,
|
@@ -4217,10 +4217,10 @@ const Xa = (e, t) => {
|
|
4217
4217
|
// use web preset by default
|
4218
4218
|
$l
|
4219
4219
|
), jl = (e, t) => {
|
4220
|
-
const r =
|
4220
|
+
const r = Ue(e, t);
|
4221
4221
|
if (t) {
|
4222
4222
|
const { use: a, fallback: n } = e, { use: s, fallback: o } = t;
|
4223
|
-
a && s && (r.use = a.concat(s)), n && o && (r.fallback =
|
4223
|
+
a && s && (r.use = a.concat(s)), n && o && (r.fallback = Ue(n, o));
|
4224
4224
|
}
|
4225
4225
|
return r;
|
4226
4226
|
}, Wl = xn({}), Kl = "$inf$", Ts = wt && window.__SWR_DEVTOOLS_USE__, Gl = Ts ? window.__SWR_DEVTOOLS_USE__ : [], Jl = () => {
|
@@ -4233,8 +4233,8 @@ const Xa = (e, t) => {
|
|
4233
4233
|
e[0],
|
4234
4234
|
null,
|
4235
4235
|
(e[1] === null ? e[2] : e[1]) || {}
|
4236
|
-
], Yl = () =>
|
4237
|
-
const [o] = ta(t), [, , , c] =
|
4236
|
+
], Yl = () => Ue(Fl, X(Wl)), Ql = (e) => (t, r, a) => e(t, r && ((...s) => {
|
4237
|
+
const [o] = ta(t), [, , , c] = Ne.get(Ss);
|
4238
4238
|
if (o.startsWith(Kl))
|
4239
4239
|
return r(...s);
|
4240
4240
|
const l = c[o];
|
@@ -4276,11 +4276,11 @@ const dr = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4276
4276
|
}), ur = {
|
4277
4277
|
dedupe: !0
|
4278
4278
|
}, td = (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, g, y, v] =
|
4279
|
+
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, v] = Ne.get(a), [w, C] = ta(e), S = R(!1), O = R(!1), I = R(w), b = R(t), _ = R(r), k = () => _.current, x = () => k().isVisible() && k().isOnline(), [E, V, A, z] = ks(a, w), P = R({}).current, J = K(o) ? K(r.fallback) ? de : r.fallback[w] : o, Q = (D, N) => {
|
4280
4280
|
for (const j in P) {
|
4281
4281
|
const U = j;
|
4282
4282
|
if (U === "data") {
|
4283
|
-
if (!n(D[U], N[U]) && (!K(D[U]) || !n(
|
4283
|
+
if (!n(D[U], N[U]) && (!K(D[U]) || !n(Me, N[U])))
|
4284
4284
|
return !1;
|
4285
4285
|
} else if (N[U] !== D[U])
|
4286
4286
|
return !1;
|
@@ -4288,7 +4288,7 @@ const dr = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4288
4288
|
return !0;
|
4289
4289
|
}, L = he(() => {
|
4290
4290
|
const D = !w || !t ? !1 : K(c) ? k().isPaused() || s ? !1 : l !== !1 : c, N = (ee) => {
|
4291
|
-
const me =
|
4291
|
+
const me = Ue(ee);
|
4292
4292
|
return delete me._k, D ? {
|
4293
4293
|
isValidating: !0,
|
4294
4294
|
isLoading: !0,
|
@@ -4315,7 +4315,7 @@ const dr = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4315
4315
|
a,
|
4316
4316
|
w
|
4317
4317
|
]
|
4318
|
-
), L[0], L[1]), q = !S.current, B = m[w] && m[w].length > 0, ge = M.data, ve = K(ge) ? J && Es(J) ? dr(J) : J : ge,
|
4318
|
+
), L[0], L[1]), q = !S.current, B = m[w] && m[w].length > 0, ge = M.data, ve = K(ge) ? J && Es(J) ? dr(J) : J : ge, Pe = M.error, je = R(ve), Me = h ? K(ge) ? K(je.current) ? ve : je.current : ge : ve, We = B && !K(Pe) ? !1 : q && !K(c) ? c : k().isPaused() ? !1 : s ? K(ve) ? !1 : l : K(ve) || l, _e = !!(w && t && q && We), G = K(M.isValidating) ? _e : M.isValidating, se = K(M.isLoading) ? _e : M.isLoading, ie = W(
|
4319
4319
|
async (D) => {
|
4320
4320
|
const N = b.current;
|
4321
4321
|
if (!w || !N || O.current || k().isPaused())
|
@@ -4353,9 +4353,9 @@ const dr = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4353
4353
|
} catch (le) {
|
4354
4354
|
kt();
|
4355
4355
|
const pe = k(), { shouldRetryOnError: Ie } = pe;
|
4356
|
-
pe.isPaused() || (me.error = le, te && ee() && (pe.onError(le, w, pe), (Ie === !0 || Se(Ie) && Ie(le)) && (!k().revalidateOnFocus || !k().revalidateOnReconnect || x()) && pe.onErrorRetry(le, w, pe, (
|
4357
|
-
const
|
4358
|
-
|
4356
|
+
pe.isPaused() || (me.error = le, te && ee() && (pe.onError(le, w, pe), (Ie === !0 || Se(Ie) && Ie(le)) && (!k().revalidateOnFocus || !k().revalidateOnReconnect || x()) && pe.onErrorRetry(le, w, pe, (Xe) => {
|
4357
|
+
const Ze = m[w];
|
4358
|
+
Ze && Ze[0] && Ze[0](Ja, Xe);
|
4359
4359
|
}, {
|
4360
4360
|
retryCount: (fe.retryCount || 0) + 1,
|
4361
4361
|
dedupe: !0
|
@@ -4385,7 +4385,7 @@ const dr = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4385
4385
|
[]
|
4386
4386
|
);
|
4387
4387
|
if (ir(() => {
|
4388
|
-
b.current = t, _.current = r, K(ge) || (
|
4388
|
+
b.current = t, _.current = r, K(ge) || (je.current = ge);
|
4389
4389
|
}), ir(() => {
|
4390
4390
|
if (!w) return;
|
4391
4391
|
const D = ie.bind(de, ur);
|
@@ -4406,7 +4406,7 @@ const dr = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4406
4406
|
});
|
4407
4407
|
return O.current = !1, I.current = w, S.current = !0, V({
|
4408
4408
|
_k: C
|
4409
|
-
}),
|
4409
|
+
}), We && (y[w] || (K(ve) || bt ? D() : Ml(D))), () => {
|
4410
4410
|
O.current = !0, U();
|
4411
4411
|
};
|
4412
4412
|
}, [
|
@@ -4428,7 +4428,7 @@ const dr = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4428
4428
|
f,
|
4429
4429
|
u,
|
4430
4430
|
w
|
4431
|
-
]), Mo(
|
4431
|
+
]), Mo(Me), s && K(ve) && w) {
|
4432
4432
|
if (!Ya && bt)
|
4433
4433
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
4434
4434
|
b.current = t, _.current = r, O.current = !1;
|
@@ -4437,19 +4437,19 @@ const dr = Z.use || // This extra generic is to avoid TypeScript mixing up the g
|
|
4437
4437
|
const N = ye(D);
|
4438
4438
|
dr(N);
|
4439
4439
|
}
|
4440
|
-
if (K(
|
4440
|
+
if (K(Pe)) {
|
4441
4441
|
const N = ie(ur);
|
4442
|
-
K(
|
4442
|
+
K(Me) || (N.status = "fulfilled", N.value = !0), dr(N);
|
4443
4443
|
} else
|
4444
|
-
throw
|
4444
|
+
throw Pe;
|
4445
4445
|
}
|
4446
4446
|
return {
|
4447
4447
|
mutate: ye,
|
4448
4448
|
get data() {
|
4449
|
-
return P.data = !0,
|
4449
|
+
return P.data = !0, Me;
|
4450
4450
|
},
|
4451
4451
|
get error() {
|
4452
|
-
return P.error = !0,
|
4452
|
+
return P.error = !0, Pe;
|
4453
4453
|
},
|
4454
4454
|
get isValidating() {
|
4455
4455
|
return P.isValidating = !0, G;
|
@@ -4555,18 +4555,18 @@ function od({
|
|
4555
4555
|
({
|
4556
4556
|
role: pe,
|
4557
4557
|
content: Ie,
|
4558
|
-
experimental_attachments:
|
4559
|
-
data:
|
4558
|
+
experimental_attachments: Xe,
|
4559
|
+
data: Ze,
|
4560
4560
|
annotations: pa,
|
4561
4561
|
toolInvocations: ga,
|
4562
4562
|
parts: ya
|
4563
4563
|
}) => ({
|
4564
4564
|
role: pe,
|
4565
4565
|
content: Ie,
|
4566
|
-
...
|
4567
|
-
experimental_attachments:
|
4566
|
+
...Xe !== void 0 && {
|
4567
|
+
experimental_attachments: Xe
|
4568
4568
|
},
|
4569
|
-
...
|
4569
|
+
...Ze !== void 0 && { data: Ze },
|
4570
4570
|
...pa !== void 0 && { annotations: pa },
|
4571
4571
|
...ga !== void 0 && { toolInvocations: ga },
|
4572
4572
|
...ya !== void 0 && { parts: ya }
|
@@ -4597,10 +4597,10 @@ function od({
|
|
4597
4597
|
w || me(kt, !1);
|
4598
4598
|
},
|
4599
4599
|
onResponse: d,
|
4600
|
-
onUpdate({ message: pe, data: Ie, replaceLastMessage:
|
4600
|
+
onUpdate({ message: pe, data: Ie, replaceLastMessage: Xe }) {
|
4601
4601
|
J("streaming"), me(
|
4602
4602
|
[
|
4603
|
-
...
|
4603
|
+
...Xe ? U.slice(0, U.length - 1) : U,
|
4604
4604
|
pe
|
4605
4605
|
],
|
4606
4606
|
!1
|
@@ -4687,19 +4687,19 @@ function od({
|
|
4687
4687
|
});
|
4688
4688
|
},
|
4689
4689
|
[B]
|
4690
|
-
),
|
4690
|
+
), Pe = W(() => {
|
4691
4691
|
M.current && (M.current.abort(), M.current = null);
|
4692
|
-
}, []),
|
4692
|
+
}, []), je = W(async () => {
|
4693
4693
|
const H = E.current;
|
4694
4694
|
B({ messages: H }, "resume");
|
4695
|
-
}, [B]),
|
4695
|
+
}, [B]), Me = W(
|
4696
4696
|
(H) => {
|
4697
4697
|
typeof H == "function" && (H = H(E.current));
|
4698
4698
|
const D = ar(H);
|
4699
4699
|
x(D, !1), E.current = D;
|
4700
4700
|
},
|
4701
4701
|
[x]
|
4702
|
-
),
|
4702
|
+
), We = W(
|
4703
4703
|
(H) => {
|
4704
4704
|
typeof H == "function" && (H = H(z.current)), A(H, !1), z.current = H;
|
4705
4705
|
},
|
@@ -4756,14 +4756,14 @@ function od({
|
|
4756
4756
|
return {
|
4757
4757
|
messages: k ?? [],
|
4758
4758
|
id: O,
|
4759
|
-
setMessages:
|
4759
|
+
setMessages: Me,
|
4760
4760
|
data: V,
|
4761
|
-
setData:
|
4761
|
+
setData: We,
|
4762
4762
|
error: Q,
|
4763
4763
|
append: ge,
|
4764
4764
|
reload: ve,
|
4765
|
-
stop:
|
4766
|
-
experimental_resume:
|
4765
|
+
stop: Pe,
|
4766
|
+
experimental_resume: je,
|
4767
4767
|
input: _e,
|
4768
4768
|
setInput: G,
|
4769
4769
|
handleInputChange: ie,
|
@@ -4779,7 +4779,7 @@ const tn = () => ({
|
|
4779
4779
|
onResponse: /* @__PURE__ */ new Set(),
|
4780
4780
|
onToolCall: /* @__PURE__ */ new Set()
|
4781
4781
|
}), Cs = xn(null);
|
4782
|
-
function
|
4782
|
+
function Qe(e = {}) {
|
4783
4783
|
const t = X(Cs);
|
4784
4784
|
if (!t)
|
4785
4785
|
throw new Error("useAiChat must be used within a AiChatProvider");
|
@@ -4917,7 +4917,7 @@ try {
|
|
4917
4917
|
}
|
4918
4918
|
const Zf = {
|
4919
4919
|
PASSKEY: "passkey"
|
4920
|
-
},
|
4920
|
+
}, at = {
|
4921
4921
|
ALG: "RS256",
|
4922
4922
|
SCOPES_KEY: "scopes",
|
4923
4923
|
SCOPE_KEY: "scope",
|
@@ -4959,50 +4959,50 @@ function Ht(e) {
|
|
4959
4959
|
throw new TypeError("The input to be decoded is not correctly encoded.");
|
4960
4960
|
}
|
4961
4961
|
}
|
4962
|
-
class
|
4962
|
+
class Fe extends Error {
|
4963
4963
|
constructor(t, r) {
|
4964
4964
|
var a;
|
4965
4965
|
super(t, r), ae(this, "code", "ERR_JOSE_GENERIC"), this.name = this.constructor.name, (a = Error.captureStackTrace) == null || a.call(Error, this, this.constructor);
|
4966
4966
|
}
|
4967
4967
|
}
|
4968
|
-
ae(
|
4969
|
-
class Ee extends
|
4968
|
+
ae(Fe, "code", "ERR_JOSE_GENERIC");
|
4969
|
+
class Ee extends Fe {
|
4970
4970
|
constructor(t, r, a = "unspecified", n = "unspecified") {
|
4971
4971
|
super(t, { cause: { claim: a, reason: n, payload: r } }), ae(this, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED"), ae(this, "claim"), ae(this, "reason"), ae(this, "payload"), this.claim = a, this.reason = n, this.payload = r;
|
4972
4972
|
}
|
4973
4973
|
}
|
4974
4974
|
ae(Ee, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
|
4975
|
-
let Br = class extends
|
4975
|
+
let Br = class extends Fe {
|
4976
4976
|
constructor(t, r, a = "unspecified", n = "unspecified") {
|
4977
4977
|
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
4978
|
}
|
4979
4979
|
};
|
4980
4980
|
ae(Br, "code", "ERR_JWT_EXPIRED");
|
4981
|
-
let As = class extends
|
4981
|
+
let As = class extends Fe {
|
4982
4982
|
constructor() {
|
4983
4983
|
super(...arguments), ae(this, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
|
4984
4984
|
}
|
4985
4985
|
};
|
4986
4986
|
ae(As, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
|
4987
|
-
class
|
4987
|
+
class De extends Fe {
|
4988
4988
|
constructor() {
|
4989
4989
|
super(...arguments), ae(this, "code", "ERR_JOSE_NOT_SUPPORTED");
|
4990
4990
|
}
|
4991
4991
|
}
|
4992
|
-
ae(
|
4993
|
-
class oe extends
|
4992
|
+
ae(De, "code", "ERR_JOSE_NOT_SUPPORTED");
|
4993
|
+
class oe extends Fe {
|
4994
4994
|
constructor() {
|
4995
4995
|
super(...arguments), ae(this, "code", "ERR_JWS_INVALID");
|
4996
4996
|
}
|
4997
4997
|
}
|
4998
4998
|
ae(oe, "code", "ERR_JWS_INVALID");
|
4999
|
-
let oa = class extends
|
4999
|
+
let oa = class extends Fe {
|
5000
5000
|
constructor() {
|
5001
5001
|
super(...arguments), ae(this, "code", "ERR_JWT_INVALID");
|
5002
5002
|
}
|
5003
5003
|
};
|
5004
5004
|
ae(oa, "code", "ERR_JWT_INVALID");
|
5005
|
-
let Ns = class extends
|
5005
|
+
let Ns = class extends Fe {
|
5006
5006
|
constructor(t = "signature verification failed", r) {
|
5007
5007
|
super(t, r), ae(this, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
|
5008
5008
|
}
|
@@ -5204,7 +5204,7 @@ const Jt = (e) => {
|
|
5204
5204
|
s = { name: "Ed25519" }, o = ["verify"];
|
5205
5205
|
break;
|
5206
5206
|
default:
|
5207
|
-
throw new
|
5207
|
+
throw new De('Invalid or unsupported "alg" (Algorithm) value');
|
5208
5208
|
}
|
5209
5209
|
return crypto.subtle.importKey(t, c, s, !0, o);
|
5210
5210
|
}, Ld = (e, t, r) => Md(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
|
@@ -5233,7 +5233,7 @@ function Dd(e) {
|
|
5233
5233
|
}, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
|
5234
5234
|
break;
|
5235
5235
|
default:
|
5236
|
-
throw new
|
5236
|
+
throw new De('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
5237
5237
|
}
|
5238
5238
|
break;
|
5239
5239
|
}
|
@@ -5255,7 +5255,7 @@ function Dd(e) {
|
|
5255
5255
|
t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
|
5256
5256
|
break;
|
5257
5257
|
default:
|
5258
|
-
throw new
|
5258
|
+
throw new De('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
5259
5259
|
}
|
5260
5260
|
break;
|
5261
5261
|
}
|
@@ -5272,12 +5272,12 @@ function Dd(e) {
|
|
5272
5272
|
t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
|
5273
5273
|
break;
|
5274
5274
|
default:
|
5275
|
-
throw new
|
5275
|
+
throw new De('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
5276
5276
|
}
|
5277
5277
|
break;
|
5278
5278
|
}
|
5279
5279
|
default:
|
5280
|
-
throw new
|
5280
|
+
throw new De('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
5281
5281
|
}
|
5282
5282
|
return { algorithm: t, keyUsages: r };
|
5283
5283
|
}
|
@@ -5303,7 +5303,7 @@ const Ud = (e, t, r, a, n) => {
|
|
5303
5303
|
r !== void 0 ? s = new Map([...Object.entries(r), ...t.entries()]) : s = t;
|
5304
5304
|
for (const o of a.crit) {
|
5305
5305
|
if (!s.has(o))
|
5306
|
-
throw new
|
5306
|
+
throw new De(`Extension Header Parameter "${o}" is not recognized`);
|
5307
5307
|
if (n[o] === void 0)
|
5308
5308
|
throw new e(`Extension Header Parameter "${o}" is missing`);
|
5309
5309
|
if (s.get(o) && a[o] === void 0)
|
@@ -5328,18 +5328,18 @@ function Fd(e) {
|
|
5328
5328
|
function jd(e) {
|
5329
5329
|
return e.kty === "oct" && typeof e.k == "string";
|
5330
5330
|
}
|
5331
|
-
let
|
5331
|
+
let Be;
|
5332
5332
|
const rn = async (e, t, r, a = !1) => {
|
5333
|
-
|
5334
|
-
let n =
|
5333
|
+
Be || (Be = /* @__PURE__ */ new WeakMap());
|
5334
|
+
let n = Be.get(e);
|
5335
5335
|
if (n != null && n[r])
|
5336
5336
|
return n[r];
|
5337
5337
|
const s = await Bd({ ...t, alg: r });
|
5338
|
-
return a && Object.freeze(e), n ? n[r] = s :
|
5338
|
+
return a && Object.freeze(e), n ? n[r] = s : Be.set(e, { [r]: s }), s;
|
5339
5339
|
}, Wd = (e, t) => {
|
5340
5340
|
var r;
|
5341
|
-
|
5342
|
-
let a =
|
5341
|
+
Be || (Be = /* @__PURE__ */ new WeakMap());
|
5342
|
+
let a = Be.get(e);
|
5343
5343
|
if (a != null && a[t])
|
5344
5344
|
return a[t];
|
5345
5345
|
const n = e.type === "public", s = !!n;
|
@@ -5421,7 +5421,7 @@ const rn = async (e, t, r, a = !1) => {
|
|
5421
5421
|
}
|
5422
5422
|
if (!o)
|
5423
5423
|
throw new TypeError("given KeyObject instance cannot be used for this algorithm");
|
5424
|
-
return a ? a[t] = o :
|
5424
|
+
return a ? a[t] = o : Be.set(e, { [t]: o }), o;
|
5425
5425
|
}, Kd = async (e, t) => {
|
5426
5426
|
if (e instanceof Uint8Array || Ps(e))
|
5427
5427
|
return e;
|
@@ -5441,7 +5441,7 @@ const rn = async (e, t, r, a = !1) => {
|
|
5441
5441
|
if (ia(e))
|
5442
5442
|
return e.k ? Ht(e.k) : rn(e, e, t, !0);
|
5443
5443
|
throw new Error("unreachable");
|
5444
|
-
},
|
5444
|
+
}, et = (e) => e?.[Symbol.toStringTag], Hr = (e, t, r) => {
|
5445
5445
|
var a, n;
|
5446
5446
|
if (t.use !== void 0) {
|
5447
5447
|
let s;
|
@@ -5495,7 +5495,7 @@ const rn = async (e, t, r, a = !1) => {
|
|
5495
5495
|
if (!Ls(t))
|
5496
5496
|
throw new TypeError($s(e, t, "CryptoKey", "KeyObject", "JSON Web Key", "Uint8Array"));
|
5497
5497
|
if (t.type !== "secret")
|
5498
|
-
throw new TypeError(`${
|
5498
|
+
throw new TypeError(`${et(t)} instances for symmetric algorithms must be of type "secret"`);
|
5499
5499
|
}
|
5500
5500
|
}, Jd = (e, t, r) => {
|
5501
5501
|
if (ia(t))
|
@@ -5514,20 +5514,20 @@ const rn = async (e, t, r, a = !1) => {
|
|
5514
5514
|
if (!Ls(t))
|
5515
5515
|
throw new TypeError($s(e, t, "CryptoKey", "KeyObject", "JSON Web Key"));
|
5516
5516
|
if (t.type === "secret")
|
5517
|
-
throw new TypeError(`${
|
5517
|
+
throw new TypeError(`${et(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
5518
5518
|
if (t.type === "public")
|
5519
5519
|
switch (r) {
|
5520
5520
|
case "sign":
|
5521
|
-
throw new TypeError(`${
|
5521
|
+
throw new TypeError(`${et(t)} instances for asymmetric algorithm signing must be of type "private"`);
|
5522
5522
|
case "decrypt":
|
5523
|
-
throw new TypeError(`${
|
5523
|
+
throw new TypeError(`${et(t)} instances for asymmetric algorithm decryption must be of type "private"`);
|
5524
5524
|
}
|
5525
5525
|
if (t.type === "private")
|
5526
5526
|
switch (r) {
|
5527
5527
|
case "verify":
|
5528
|
-
throw new TypeError(`${
|
5528
|
+
throw new TypeError(`${et(t)} instances for asymmetric algorithm verifying must be of type "public"`);
|
5529
5529
|
case "encrypt":
|
5530
|
-
throw new TypeError(`${
|
5530
|
+
throw new TypeError(`${et(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
5531
5531
|
}
|
5532
5532
|
}, qd = (e, t, r) => {
|
5533
5533
|
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) ? Gd(e, t, r) : Jd(e, t, r);
|
@@ -5554,7 +5554,7 @@ const rn = async (e, t, r, a = !1) => {
|
|
5554
5554
|
case "EdDSA":
|
5555
5555
|
return { name: "Ed25519" };
|
5556
5556
|
default:
|
5557
|
-
throw new
|
5557
|
+
throw new De(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
5558
5558
|
}
|
5559
5559
|
}, Qd = async (e, t, r) => {
|
5560
5560
|
if (t instanceof Uint8Array) {
|
@@ -5760,9 +5760,9 @@ async function iu(e, t, r) {
|
|
5760
5760
|
}
|
5761
5761
|
const cu = async (e) => {
|
5762
5762
|
try {
|
5763
|
-
const t =
|
5763
|
+
const t = at.ALG, r = await Hd(Sd, t);
|
5764
5764
|
return await iu(e, r, {
|
5765
|
-
issuer:
|
5765
|
+
issuer: at.ISSUER
|
5766
5766
|
});
|
5767
5767
|
} catch {
|
5768
5768
|
return;
|
@@ -5776,10 +5776,10 @@ const Hs = async (e, t) => {
|
|
5776
5776
|
if (!r || !r.payload)
|
5777
5777
|
return !1;
|
5778
5778
|
let a = [];
|
5779
|
-
if (Array.isArray(r.payload[
|
5780
|
-
a = r.payload[
|
5781
|
-
else if (typeof r.payload[
|
5782
|
-
a = r.payload[
|
5779
|
+
if (Array.isArray(r.payload[at.SCOPES_KEY]))
|
5780
|
+
a = r.payload[at.SCOPES_KEY];
|
5781
|
+
else if (typeof r.payload[at.SCOPE_KEY] == "string")
|
5782
|
+
a = r.payload[at.SCOPE_KEY].split(" ").filter((n) => n.trim() !== "");
|
5783
5783
|
else
|
5784
5784
|
return !1;
|
5785
5785
|
return Array.isArray(t) ? t.every((n) => a.includes(n)) : Object.keys(t).some(
|
@@ -5850,7 +5850,7 @@ const Ot = (e, t = "px") => typeof e > "u" ? "" : `${Math.round(e)}${t}`, mu = (
|
|
5850
5850
|
return { tooltip: s, arrow: o, wrapper: n };
|
5851
5851
|
}, bu = ({ delay: e = 300 }) => ({
|
5852
5852
|
animation: `av-tooltip-fade-in ${e}ms ease-in-out`
|
5853
|
-
}), vu = 5e3,
|
5853
|
+
}), vu = 5e3, $e = ({
|
5854
5854
|
trigger: e,
|
5855
5855
|
label: t,
|
5856
5856
|
placement: r = "top",
|
@@ -5962,7 +5962,7 @@ const wu = ({
|
|
5962
5962
|
className: e,
|
5963
5963
|
onClick: t
|
5964
5964
|
}) => /* @__PURE__ */ i(
|
5965
|
-
|
5965
|
+
$e,
|
5966
5966
|
{
|
5967
5967
|
label: "Attach files",
|
5968
5968
|
mode: "light",
|
@@ -5983,20 +5983,20 @@ const wu = ({
|
|
5983
5983
|
), Eu = ({
|
5984
5984
|
className: e
|
5985
5985
|
}) => {
|
5986
|
-
const { getAccessToken: t } =
|
5986
|
+
const { getAccessToken: t } = Ve(), {
|
5987
5987
|
state: { streaming: r, loading: a },
|
5988
5988
|
dispatch: n,
|
5989
5989
|
setChatId: s,
|
5990
5990
|
setInitialMessages: o
|
5991
|
-
} = X(be), { id: c, setInput: l, stop: d } =
|
5992
|
-
s(
|
5993
|
-
type:
|
5991
|
+
} = X(be), { id: c, setInput: l, stop: d } = Qe(), f = R(null), u = R(!1), h = () => {
|
5992
|
+
s(He()), o([]), l(""), n({
|
5993
|
+
type: Ye,
|
5994
5994
|
payload: {
|
5995
5995
|
privateChat: !1,
|
5996
5996
|
reasoning: !1
|
5997
5997
|
}
|
5998
5998
|
}), n({
|
5999
|
-
type:
|
5999
|
+
type: nt,
|
6000
6000
|
payload: {
|
6001
6001
|
attachments: 0
|
6002
6002
|
}
|
@@ -6026,7 +6026,7 @@ const wu = ({
|
|
6026
6026
|
);
|
6027
6027
|
const m = async (y) => {
|
6028
6028
|
y.preventDefault(), d(), n({
|
6029
|
-
type:
|
6029
|
+
type: rt,
|
6030
6030
|
payload: {
|
6031
6031
|
aborted: !0,
|
6032
6032
|
streaming: !1,
|
@@ -6050,9 +6050,9 @@ const wu = ({
|
|
6050
6050
|
y.preventDefault(), h();
|
6051
6051
|
};
|
6052
6052
|
return $(() => {
|
6053
|
-
|
6053
|
+
Ae() || ((r === !0 || a === !0) && !u.current && f.current && (u.current = !0, f.current.focus()), r === !1 && u.current && (u.current = !1));
|
6054
6054
|
}, [r, a]), /* @__PURE__ */ i(
|
6055
|
-
|
6055
|
+
$e,
|
6056
6056
|
{
|
6057
6057
|
label: "New Chat",
|
6058
6058
|
mode: "light",
|
@@ -6473,9 +6473,9 @@ const $t = {
|
|
6473
6473
|
variant: w,
|
6474
6474
|
animated: S
|
6475
6475
|
}), _ = Nu({ mode: r, raw: c, iconClassName: C }), k = Ou({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, V] = mr(), [A, z] = mr(), [P, J] = mr(), Q = R(0), L = R(null), M = R(null), q = Lu([I, L]);
|
6476
|
-
return
|
6476
|
+
return Oe(() => {
|
6477
6477
|
P && P.current && S && (Q.current = J.width + Bu[u] + (l ? 0 : Hu), L.current && !L.current.style.width && (L.current.style.width = `${$t[u]}px`));
|
6478
|
-
}, [J, P, u, l, S]),
|
6478
|
+
}, [J, P, u, l, S]), Oe(() => {
|
6479
6479
|
if (L && L.current && S) {
|
6480
6480
|
let B = $t[u];
|
6481
6481
|
h && E && V.width > 0 ? B = V.width + Q.current : m && A && z.width > 0 && (B = z.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 > $t[u] && (M.current = setTimeout(() => {
|
@@ -6862,7 +6862,7 @@ try {
|
|
6862
6862
|
});
|
6863
6863
|
} catch {
|
6864
6864
|
}
|
6865
|
-
const
|
6865
|
+
const qe = ({
|
6866
6866
|
showConfirmation: e,
|
6867
6867
|
setShowConfirmation: t,
|
6868
6868
|
action: r,
|
@@ -6919,13 +6919,13 @@ const Ge = ({
|
|
6919
6919
|
key: Ft + bo,
|
6920
6920
|
initialValue: ""
|
6921
6921
|
}), h = (g) => {
|
6922
|
-
n(
|
6923
|
-
type:
|
6922
|
+
n(He()), s([]), a({
|
6923
|
+
type: Ye,
|
6924
6924
|
payload: {
|
6925
6925
|
privateChat: !t
|
6926
6926
|
}
|
6927
6927
|
}), g && a({
|
6928
|
-
type:
|
6928
|
+
type: nt,
|
6929
6929
|
payload: {
|
6930
6930
|
attachments: 0
|
6931
6931
|
}
|
@@ -6933,7 +6933,7 @@ const Ge = ({
|
|
6933
6933
|
};
|
6934
6934
|
return /* @__PURE__ */ T(ue, { children: [
|
6935
6935
|
l && /* @__PURE__ */ i(
|
6936
|
-
|
6936
|
+
qe,
|
6937
6937
|
{
|
6938
6938
|
showConfirmation: l,
|
6939
6939
|
setShowConfirmation: d,
|
@@ -6947,7 +6947,7 @@ const Ge = ({
|
|
6947
6947
|
}
|
6948
6948
|
),
|
6949
6949
|
o && /* @__PURE__ */ i(
|
6950
|
-
|
6950
|
+
qe,
|
6951
6951
|
{
|
6952
6952
|
showConfirmation: o,
|
6953
6953
|
setShowConfirmation: c,
|
@@ -6964,7 +6964,7 @@ const Ge = ({
|
|
6964
6964
|
}
|
6965
6965
|
),
|
6966
6966
|
/* @__PURE__ */ i(
|
6967
|
-
|
6967
|
+
$e,
|
6968
6968
|
{
|
6969
6969
|
label: "Private Chat",
|
6970
6970
|
mode: "light",
|
@@ -7295,12 +7295,12 @@ const rh = (e) => {
|
|
7295
7295
|
className: e,
|
7296
7296
|
defaultPlacement: t = "top-start"
|
7297
7297
|
}) => {
|
7298
|
-
const { dispatch: r, setChatId: a, setInitialMessages: n } = X(be), { dispatch: s } = X(na), { getAccessToken: o, user: c } =
|
7298
|
+
const { dispatch: r, setChatId: a, setInitialMessages: n } = X(be), { dispatch: s } = X(na), { getAccessToken: o, user: c } = Ve(), { data: l, isSuccess: d } = Yt({
|
7299
7299
|
user: c?.username,
|
7300
7300
|
getAccessToken: o
|
7301
7301
|
}), f = (m, g, y) => {
|
7302
|
-
m.preventDefault(), a(
|
7303
|
-
type:
|
7302
|
+
m.preventDefault(), a(He()), n([]), r({
|
7303
|
+
type: Ye,
|
7304
7304
|
payload: {
|
7305
7305
|
privateChat: y
|
7306
7306
|
}
|
@@ -7349,7 +7349,7 @@ const rh = (e) => {
|
|
7349
7349
|
}
|
7350
7350
|
);
|
7351
7351
|
return u ? /* @__PURE__ */ i(
|
7352
|
-
|
7352
|
+
$e,
|
7353
7353
|
{
|
7354
7354
|
label: "Prompts",
|
7355
7355
|
mode: "light",
|
@@ -7369,13 +7369,13 @@ const rh = (e) => {
|
|
7369
7369
|
key: Ft + vo,
|
7370
7370
|
initialValue: ""
|
7371
7371
|
}), h = (g) => {
|
7372
|
-
n(
|
7373
|
-
type:
|
7372
|
+
n(He()), s([]), a({
|
7373
|
+
type: Ye,
|
7374
7374
|
payload: {
|
7375
7375
|
reasoning: !t
|
7376
7376
|
}
|
7377
7377
|
}), g && a({
|
7378
|
-
type:
|
7378
|
+
type: nt,
|
7379
7379
|
payload: {
|
7380
7380
|
attachments: 0
|
7381
7381
|
}
|
@@ -7383,7 +7383,7 @@ const rh = (e) => {
|
|
7383
7383
|
};
|
7384
7384
|
return /* @__PURE__ */ T(ue, { children: [
|
7385
7385
|
l && /* @__PURE__ */ i(
|
7386
|
-
|
7386
|
+
qe,
|
7387
7387
|
{
|
7388
7388
|
showConfirmation: l,
|
7389
7389
|
setShowConfirmation: d,
|
@@ -7397,7 +7397,7 @@ const rh = (e) => {
|
|
7397
7397
|
}
|
7398
7398
|
),
|
7399
7399
|
o && /* @__PURE__ */ i(
|
7400
|
-
|
7400
|
+
qe,
|
7401
7401
|
{
|
7402
7402
|
showConfirmation: o,
|
7403
7403
|
setShowConfirmation: c,
|
@@ -7415,7 +7415,7 @@ const rh = (e) => {
|
|
7415
7415
|
}
|
7416
7416
|
),
|
7417
7417
|
/* @__PURE__ */ i(
|
7418
|
-
|
7418
|
+
$e,
|
7419
7419
|
{
|
7420
7420
|
label: "Reasoning Chat",
|
7421
7421
|
mode: "light",
|
@@ -7442,7 +7442,7 @@ const rh = (e) => {
|
|
7442
7442
|
] });
|
7443
7443
|
};
|
7444
7444
|
let pr = null, gr = null;
|
7445
|
-
const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = async () => (gr || (gr = import("./index.
|
7445
|
+
const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = async () => (gr || (gr = import("./index.DkMqkMUz.js").then((e) => e.utilities)), gr), nh = async () => {
|
7446
7446
|
try {
|
7447
7447
|
await Promise.all([Gs(), Js()]);
|
7448
7448
|
} catch {
|
@@ -7466,10 +7466,10 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7466
7466
|
}, Ys = (e, t) => qs(e, "success", t), nm = (e, t) => qs(e, "error", t), Qs = ({
|
7467
7467
|
className: e
|
7468
7468
|
}) => {
|
7469
|
-
const { user: t, getAccessToken: r } =
|
7469
|
+
const { user: t, getAccessToken: r } = Ve(), {
|
7470
7470
|
dispatch: a,
|
7471
7471
|
state: { tokenUsage: n, provider: s, privateChat: o }
|
7472
|
-
} = X(be), { messages: c, id: l } =
|
7472
|
+
} = X(be), { messages: c, id: l } = Qe(), { state: d } = X(aa), { refetch: f } = ts({
|
7473
7473
|
enabled: !1,
|
7474
7474
|
user: t?.username || "",
|
7475
7475
|
searchString: d.searchString,
|
@@ -7485,7 +7485,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7485
7485
|
}));
|
7486
7486
|
await es({
|
7487
7487
|
accessToken: await r(),
|
7488
|
-
type:
|
7488
|
+
type: ze.SAVE_CHAT,
|
7489
7489
|
params: {
|
7490
7490
|
userId: t?.username || "",
|
7491
7491
|
id: l,
|
@@ -7494,7 +7494,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7494
7494
|
tokenUsage: n
|
7495
7495
|
}
|
7496
7496
|
}), a({
|
7497
|
-
type:
|
7497
|
+
type: Ye,
|
7498
7498
|
payload: {
|
7499
7499
|
privateChat: !1
|
7500
7500
|
}
|
@@ -7511,7 +7511,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7511
7511
|
o && c?.length > 0 ? h(!0) : h(!1);
|
7512
7512
|
}, [o, c]), /* @__PURE__ */ T(ue, { children: [
|
7513
7513
|
m && /* @__PURE__ */ i(
|
7514
|
-
|
7514
|
+
qe,
|
7515
7515
|
{
|
7516
7516
|
showConfirmation: m,
|
7517
7517
|
setShowConfirmation: g,
|
@@ -7525,7 +7525,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7525
7525
|
}
|
7526
7526
|
),
|
7527
7527
|
u && /* @__PURE__ */ i(
|
7528
|
-
|
7528
|
+
$e,
|
7529
7529
|
{
|
7530
7530
|
label: "Save Private Chat",
|
7531
7531
|
mode: "light",
|
@@ -7597,7 +7597,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7597
7597
|
state: { loading: t, streaming: r }
|
7598
7598
|
} = X(be);
|
7599
7599
|
return /* @__PURE__ */ i(
|
7600
|
-
|
7600
|
+
$e,
|
7601
7601
|
{
|
7602
7602
|
label: "Send Message",
|
7603
7603
|
mode: "light",
|
@@ -7640,21 +7640,21 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7640
7640
|
state: { privateChat: r },
|
7641
7641
|
setChatId: a,
|
7642
7642
|
setInitialMessages: n
|
7643
|
-
} = X(be), { getAccessToken: s, user: o } =
|
7643
|
+
} = X(be), { getAccessToken: s, user: o } = Ve(), { status: c } = Qe(), [l, d] = F(!1), f = W(() => {
|
7644
7644
|
l || (nh(), d(!0));
|
7645
7645
|
}, [l]), { isSuccess: u, refetch: h, data: m } = Yt({
|
7646
7646
|
user: o?.username,
|
7647
7647
|
getAccessToken: s
|
7648
7648
|
}), g = async (C) => {
|
7649
7649
|
try {
|
7650
|
-
a(
|
7650
|
+
a(He()), n([]), C !== m?.provider && (await Ic({
|
7651
7651
|
provider: C,
|
7652
7652
|
accessToken: await s(),
|
7653
7653
|
username: o?.username || ""
|
7654
7654
|
}), h(), await Ys(`${Eo} ${C}`, {
|
7655
7655
|
containerId: "toggle-provider"
|
7656
7656
|
})), t({
|
7657
|
-
type:
|
7657
|
+
type: Ye,
|
7658
7658
|
payload: {
|
7659
7659
|
privateChat: r
|
7660
7660
|
}
|
@@ -7700,7 +7700,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7700
7700
|
}
|
7701
7701
|
);
|
7702
7702
|
return y ? /* @__PURE__ */ i(
|
7703
|
-
|
7703
|
+
$e,
|
7704
7704
|
{
|
7705
7705
|
label: "Toggle Providers",
|
7706
7706
|
mode: "light",
|
@@ -7809,7 +7809,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7809
7809
|
] }), Zs = 24, bh = 500, eo = 2, vh = 5, wh = Zs * eo, pn = vh * Zs, Eh = "ready", kh = "streaming", _h = "error", Sh = "submitted", Lt = (e) => {
|
7810
7810
|
e.current && (e.current.style.height = `${wh}px`);
|
7811
7811
|
}, Th = () => {
|
7812
|
-
const { user: e, getAccessToken: t } =
|
7812
|
+
const { user: e, getAccessToken: t } = Ve(), [r, a] = F(!1), [n, s] = F(null), [o, c] = F(!1), [l, d] = F(!1), {
|
7813
7813
|
dispatch: f,
|
7814
7814
|
state: { reasoning: u, streaming: h, aborted: m, lastResetTimestamp: g, attachments: y }
|
7815
7815
|
} = X(be), { state: v, dispatch: w } = X(na), { state: C } = X(aa), { refetch: S } = ts({
|
@@ -7831,7 +7831,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7831
7831
|
setMessages: L,
|
7832
7832
|
status: M,
|
7833
7833
|
id: q
|
7834
|
-
} =
|
7834
|
+
} = Qe({
|
7835
7835
|
onFinish: (G, { usage: se }) => {
|
7836
7836
|
S(), f({
|
7837
7837
|
type: Xn,
|
@@ -7843,26 +7843,26 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7843
7843
|
}), B = W(
|
7844
7844
|
async (G) => {
|
7845
7845
|
G === Eh && f({
|
7846
|
-
type:
|
7846
|
+
type: rt,
|
7847
7847
|
payload: {
|
7848
7848
|
loading: !1,
|
7849
7849
|
streaming: !1
|
7850
7850
|
}
|
7851
7851
|
}), G === Sh && f({
|
7852
|
-
type:
|
7852
|
+
type: rt,
|
7853
7853
|
payload: {
|
7854
7854
|
loading: !0,
|
7855
7855
|
streaming: !1
|
7856
7856
|
}
|
7857
7857
|
}), G === kh && f({
|
7858
|
-
type:
|
7858
|
+
type: rt,
|
7859
7859
|
payload: {
|
7860
7860
|
loading: !1,
|
7861
7861
|
streaming: !0
|
7862
7862
|
}
|
7863
7863
|
}), G === _h && setTimeout(() => {
|
7864
7864
|
m || (f({
|
7865
|
-
type:
|
7865
|
+
type: rt,
|
7866
7866
|
payload: {
|
7867
7867
|
loading: !1,
|
7868
7868
|
streaming: !1
|
@@ -7870,7 +7870,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7870
7870
|
}), L((se) => [
|
7871
7871
|
...se,
|
7872
7872
|
{
|
7873
|
-
id:
|
7873
|
+
id: He(),
|
7874
7874
|
role: _r,
|
7875
7875
|
content: So
|
7876
7876
|
}
|
@@ -7919,30 +7919,30 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7919
7919
|
if (ye.length > 0) {
|
7920
7920
|
const N = new DataTransfer();
|
7921
7921
|
ye.forEach((j) => N.items.add(j)), s(N.files), f({
|
7922
|
-
type:
|
7922
|
+
type: nt,
|
7923
7923
|
payload: {
|
7924
7924
|
attachments: N.files.length
|
7925
7925
|
}
|
7926
7926
|
});
|
7927
7927
|
}
|
7928
7928
|
}
|
7929
|
-
},
|
7929
|
+
}, Pe = () => {
|
7930
7930
|
b.current && b.current.click();
|
7931
|
-
},
|
7931
|
+
}, je = (G) => {
|
7932
7932
|
if (!n)
|
7933
7933
|
return;
|
7934
7934
|
const se = new DataTransfer();
|
7935
7935
|
Array.from(n).forEach((ie) => {
|
7936
7936
|
ie !== G && se.items.add(ie);
|
7937
7937
|
}), se.files.length === 0 ? s(null) : s(se.files), f({
|
7938
|
-
type:
|
7938
|
+
type: nt,
|
7939
7939
|
payload: {
|
7940
7940
|
attachments: se.files.length
|
7941
7941
|
}
|
7942
7942
|
}), b.current && (b.current.value = "");
|
7943
|
-
},
|
7943
|
+
}, Me = W(() => {
|
7944
7944
|
b.current && (b.current.value = ""), s(null);
|
7945
|
-
}, []),
|
7945
|
+
}, []), We = async (G) => {
|
7946
7946
|
G.preventDefault(), Lt(E);
|
7947
7947
|
const se = await t();
|
7948
7948
|
let ie;
|
@@ -7962,7 +7962,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7962
7962
|
reasoning: u
|
7963
7963
|
},
|
7964
7964
|
experimental_attachments: ie
|
7965
|
-
}),
|
7965
|
+
}), Me();
|
7966
7966
|
}, _e = (G) => {
|
7967
7967
|
ge(), J(G);
|
7968
7968
|
};
|
@@ -7970,7 +7970,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7970
7970
|
[
|
7971
7971
|
"mod+K",
|
7972
7972
|
() => {
|
7973
|
-
E && E.current && !
|
7973
|
+
E && E.current && !Ae() && E.current.focus();
|
7974
7974
|
}
|
7975
7975
|
]
|
7976
7976
|
]), $(() => {
|
@@ -7978,7 +7978,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7978
7978
|
const G = v.prompt.endsWith(":") && !v.prompt.endsWith(": ") ? v.prompt + " " : v.prompt;
|
7979
7979
|
G.indexOf(_a) !== -1 ? navigator.clipboard.readText().then((ie) => {
|
7980
7980
|
P(G.replace(_a, ie));
|
7981
|
-
}) : P(G), !
|
7981
|
+
}) : P(G), !Ae() && E.current && E.current.focus(), w({
|
7982
7982
|
type: _n
|
7983
7983
|
});
|
7984
7984
|
}
|
@@ -7989,14 +7989,14 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
7989
7989
|
}
|
7990
7990
|
g > 0 && g !== k.current ? (k.current = g, setTimeout(() => {
|
7991
7991
|
E.current && (!z && Lt(E), E.current.focus());
|
7992
|
-
}, bh)) : h === !1 && !z && (Lt(E), !
|
7992
|
+
}, bh)) : h === !1 && !z && (Lt(E), !Ae() && E.current && E.current.focus());
|
7993
7993
|
}, [g, h, z]), $(() => {
|
7994
7994
|
v.lastTriggeredTimestamp && setTimeout(() => {
|
7995
7995
|
ge();
|
7996
7996
|
}, 100);
|
7997
7997
|
}, [v.lastTriggeredTimestamp, ge]), $(() => {
|
7998
7998
|
(async () => {
|
7999
|
-
if (
|
7999
|
+
if (Ge())
|
8000
8000
|
return;
|
8001
8001
|
const G = await t(), se = await Hs(G, [Rs.REASONING]);
|
8002
8002
|
a(se);
|
@@ -8005,7 +8005,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8005
8005
|
y === 0 && (b.current && (b.current.value = ""), s(null));
|
8006
8006
|
}, [y]), /* @__PURE__ */ T(ue, { children: [
|
8007
8007
|
/* @__PURE__ */ i(
|
8008
|
-
|
8008
|
+
qe,
|
8009
8009
|
{
|
8010
8010
|
showConfirmation: o,
|
8011
8011
|
setShowConfirmation: c,
|
@@ -8020,8 +8020,8 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8020
8020
|
children: /* @__PURE__ */ i("p", { className: "m-0", children: I.current })
|
8021
8021
|
}
|
8022
8022
|
),
|
8023
|
-
/* @__PURE__ */ i("div", { className: A.wrapper, ref: x, children: /* @__PURE__ */ T("form", { onSubmit:
|
8024
|
-
/* @__PURE__ */ i("div", { id: V, className: "sr-only", children:
|
8023
|
+
/* @__PURE__ */ i("div", { className: A.wrapper, ref: x, children: /* @__PURE__ */ T("form", { onSubmit: We, children: [
|
8024
|
+
/* @__PURE__ */ i("div", { id: V, className: "sr-only", children: Ge() ? Sa : l ? Ta : Ca }),
|
8025
8025
|
/* @__PURE__ */ T("div", { className: "relative", children: [
|
8026
8026
|
/* @__PURE__ */ i(
|
8027
8027
|
"textarea",
|
@@ -8029,13 +8029,19 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8029
8029
|
required: !0,
|
8030
8030
|
rows: eo,
|
8031
8031
|
ref: E,
|
8032
|
-
placeholder:
|
8032
|
+
placeholder: Ge() ? Sa : l ? Ta : Ca,
|
8033
8033
|
translate: "no",
|
8034
8034
|
onChange: _e,
|
8035
8035
|
value: z,
|
8036
8036
|
onKeyDown: Pi([
|
8037
|
-
[l ? "enter" : "mod+Enter",
|
8037
|
+
[l ? "enter" : "mod+Enter", We]
|
8038
8038
|
]),
|
8039
|
+
onFocus: () => {
|
8040
|
+
Ae() && document.body.setAttribute("data-input-focused", "true");
|
8041
|
+
},
|
8042
|
+
onBlur: () => {
|
8043
|
+
Ae() && document.body.removeAttribute("data-input-focused");
|
8044
|
+
},
|
8039
8045
|
className: A.textArea,
|
8040
8046
|
"aria-labelledby": V
|
8041
8047
|
}
|
@@ -8053,7 +8059,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8053
8059
|
}
|
8054
8060
|
)
|
8055
8061
|
] }),
|
8056
|
-
/* @__PURE__ */ i(yh, { files: n, clearFile:
|
8062
|
+
/* @__PURE__ */ i(yh, { files: n, clearFile: je }),
|
8057
8063
|
/* @__PURE__ */ T("div", { className: "p-2 flex items-center", children: [
|
8058
8064
|
/* @__PURE__ */ i(oh, { className: "order-7 ml-auto" }),
|
8059
8065
|
/* @__PURE__ */ i(Eu, { className: "order-1 mr-4 sm:mr-2" }),
|
@@ -8062,10 +8068,10 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8062
8068
|
wu,
|
8063
8069
|
{
|
8064
8070
|
className: "order-3 mr-4 sm:mr-2",
|
8065
|
-
onClick:
|
8071
|
+
onClick: Pe
|
8066
8072
|
}
|
8067
8073
|
),
|
8068
|
-
!
|
8074
|
+
!Ge() && /* @__PURE__ */ T(ue, { children: [
|
8069
8075
|
r && /* @__PURE__ */ i(Ks, { className: "order-4 mr-4 sm:mr-2" }),
|
8070
8076
|
/* @__PURE__ */ i(Fs, { className: "order-5 mr-4 sm:mr-2" }),
|
8071
8077
|
/* @__PURE__ */ i(Qs, { className: "order-6" })
|
@@ -8079,7 +8085,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8079
8085
|
} = X(be), {
|
8080
8086
|
state: { footerHeight: n, footerPosition: s },
|
8081
8087
|
dispatch: o
|
8082
|
-
} = X(sa), { messages: c } =
|
8088
|
+
} = X(sa), { messages: c } = Qe(), { height: l } = zi(), { height: d } = Fi(), [f, u] = Kn(), h = he(() => Ae(), []), m = l - d, g = he(() => m > 0 && m < 100 ? To : Cn, [m]);
|
8083
8089
|
return $(() => {
|
8084
8090
|
n !== u.height && o({
|
8085
8091
|
type: Qn,
|
@@ -8095,7 +8101,7 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8095
8101
|
y !== `${g}px` && (o({
|
8096
8102
|
type: mt,
|
8097
8103
|
payload: {
|
8098
|
-
footerPosition:
|
8104
|
+
footerPosition: Je,
|
8099
8105
|
footerOffset: g
|
8100
8106
|
}
|
8101
8107
|
}), f.current.style.setProperty(
|
@@ -8107,16 +8113,16 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8107
8113
|
if (s === Wt && (t && !r || a) && y !== `${g}px` && (o({
|
8108
8114
|
type: mt,
|
8109
8115
|
payload: {
|
8110
|
-
footerPosition:
|
8116
|
+
footerPosition: Je,
|
8111
8117
|
footerOffset: g
|
8112
8118
|
}
|
8113
8119
|
}), f.current.style.setProperty(
|
8114
8120
|
ht,
|
8115
8121
|
`${g}px`
|
8116
|
-
)), s ===
|
8122
|
+
)), s === Je && y !== `${g}px` && (o({
|
8117
8123
|
type: mt,
|
8118
8124
|
payload: {
|
8119
|
-
footerPosition:
|
8125
|
+
footerPosition: Je,
|
8120
8126
|
footerOffset: g
|
8121
8127
|
}
|
8122
8128
|
}), f.current.style.setProperty(
|
@@ -8165,18 +8171,18 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8165
8171
|
]
|
8166
8172
|
}
|
8167
8173
|
);
|
8168
|
-
}, Ih =
|
8169
|
-
() => import("./ProfileEntry.
|
8170
|
-
), xh =
|
8171
|
-
() => import("./SettingsEntry.
|
8174
|
+
}, Ih = ot(
|
8175
|
+
() => import("./ProfileEntry.Cb5Y7hl8.js").then((e) => ({ default: e.Profile }))
|
8176
|
+
), xh = ot(
|
8177
|
+
() => import("./SettingsEntry.gGlNbDNL.js").then((e) => ({
|
8172
8178
|
default: e.SettingsPanel
|
8173
8179
|
}))
|
8174
|
-
), Rh =
|
8175
|
-
() => import("./HistoryEntry.
|
8176
|
-
), Ah =
|
8177
|
-
() => import("./AboutEntry.
|
8178
|
-
), Nh =
|
8179
|
-
() => import("./UsageEntry.
|
8180
|
+
), Rh = ot(
|
8181
|
+
() => import("./HistoryEntry.Cqle-uCR.js").then((e) => ({ default: e.HistoryPanel }))
|
8182
|
+
), Ah = ot(
|
8183
|
+
() => import("./AboutEntry.DYw63Smf.js").then((e) => ({ default: e.About }))
|
8184
|
+
), Nh = ot(
|
8185
|
+
() => import("./UsageEntry.Dgiz9VvB.js").then((e) => ({ default: e.Usage }))
|
8180
8186
|
), Oh = ({ type: e, open: t, onOpenChange: r }) => t ? /* @__PURE__ */ i(An, { fallback: /* @__PURE__ */ i("div", {}), children: (() => {
|
8181
8187
|
switch (e) {
|
8182
8188
|
case "profile":
|
@@ -8195,8 +8201,8 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8195
8201
|
})() }) : null, $h = ({
|
8196
8202
|
isComponent: e = !1
|
8197
8203
|
}) => {
|
8198
|
-
const { logout: t, getAccessToken: r } =
|
8199
|
-
d || (import("./ProfileEntry.
|
8204
|
+
const { logout: t, getAccessToken: r } = Ve(), [a, n] = F(null), [s, o] = F(!1), [c, l] = F(!1), [d, f] = F(!1), u = W(() => {
|
8205
|
+
d || (import("./ProfileEntry.Cb5Y7hl8.js"), import("./SettingsEntry.gGlNbDNL.js"), import("./HistoryEntry.Cqle-uCR.js"), import("./AboutEntry.DYw63Smf.js"), import("./UsageEntry.Dgiz9VvB.js"), f(!0));
|
8200
8206
|
}, [d]), h = (y) => {
|
8201
8207
|
n(y);
|
8202
8208
|
}, m = () => {
|
@@ -8206,14 +8212,14 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8206
8212
|
};
|
8207
8213
|
return $(() => {
|
8208
8214
|
(async () => {
|
8209
|
-
if (!
|
8215
|
+
if (!Ge())
|
8210
8216
|
return;
|
8211
8217
|
const y = await r(), v = await Hs(y, [Rs.REASONING]);
|
8212
8218
|
o(v);
|
8213
8219
|
})();
|
8214
8220
|
}, [r]), /* @__PURE__ */ T(ue, { children: [
|
8215
8221
|
/* @__PURE__ */ i(
|
8216
|
-
|
8222
|
+
qe,
|
8217
8223
|
{
|
8218
8224
|
showConfirmation: c,
|
8219
8225
|
setShowConfirmation: l,
|
@@ -8243,13 +8249,13 @@ const Gs = async () => (pr || (pr = import("./index.B8EJY2WR.js")), pr), Js = as
|
|
8243
8249
|
columnGap: 0,
|
8244
8250
|
children: [
|
8245
8251
|
/* @__PURE__ */ i(yt, { children: /* @__PURE__ */ i(ih, { className: " mr-4 sm:mr-2" }) }),
|
8246
|
-
/* @__PURE__ */ i(yt, { children:
|
8252
|
+
/* @__PURE__ */ i(yt, { children: Ge() && /* @__PURE__ */ T(ue, { children: [
|
8247
8253
|
s && /* @__PURE__ */ i(Ks, { className: "mr-4 sm:mr-2" }),
|
8248
8254
|
/* @__PURE__ */ i(Fs, { className: "mr-4 sm:mr-2" }),
|
8249
8255
|
/* @__PURE__ */ i(Qs, {})
|
8250
8256
|
] }) }),
|
8251
8257
|
/* @__PURE__ */ i(yt, { children: /* @__PURE__ */ i(
|
8252
|
-
|
8258
|
+
$e,
|
8253
8259
|
{
|
8254
8260
|
label: "Profile, Settings, etc.",
|
8255
8261
|
mode: "light",
|
@@ -8731,9 +8737,9 @@ const Dt = {
|
|
8731
8737
|
variant: w,
|
8732
8738
|
animated: S
|
8733
8739
|
}), _ = Fh({ mode: r, raw: c, iconClassName: C }), k = jh({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, V] = br(), [A, z] = br(), [P, J] = br(), Q = R(0), L = R(null), M = R(null), q = Jh([I, L]);
|
8734
|
-
return
|
8740
|
+
return Oe(() => {
|
8735
8741
|
P && P.current && S && (Q.current = J.width + Yh[u] + (l ? 0 : Qh), L.current && !L.current.style.width && (L.current.style.width = `${Dt[u]}px`));
|
8736
|
-
}, [J, P, u, l, S]),
|
8742
|
+
}, [J, P, u, l, S]), Oe(() => {
|
8737
8743
|
if (L && L.current && S) {
|
8738
8744
|
let B = Dt[u];
|
8739
8745
|
h && E && V.width > 0 ? B = V.width + Q.current : m && A && z.width > 0 && (B = z.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 > Dt[u] && (M.current = setTimeout(() => {
|
@@ -9585,9 +9591,9 @@ const Bt = {
|
|
9585
9591
|
variant: w,
|
9586
9592
|
animated: S
|
9587
9593
|
}), _ = vf({ mode: r, raw: c, iconClassName: C }), k = wf({ animated: S }), x = "flex items-center justify-center relative w-full h-full overflow-hidden", [E, V] = vr(), [A, z] = vr(), [P, J] = vr(), Q = R(0), L = R(null), M = R(null), q = _f([I, L]);
|
9588
|
-
return
|
9594
|
+
return Oe(() => {
|
9589
9595
|
P && P.current && S && (Q.current = J.width + Tf[u] + (l ? 0 : Cf), L.current && !L.current.style.width && (L.current.style.width = `${Bt[u]}px`));
|
9590
|
-
}, [J, P, u, l, S]),
|
9596
|
+
}, [J, P, u, l, S]), Oe(() => {
|
9591
9597
|
if (L && L.current && S) {
|
9592
9598
|
let B = Bt[u];
|
9593
9599
|
h && E && V.width > 0 ? B = V.width + Q.current : m && A && z.width > 0 && (B = z.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(() => {
|
@@ -9774,10 +9780,10 @@ const Of = ({ content: e }) => /* @__PURE__ */ i(
|
|
9774
9780
|
className: "mt-3",
|
9775
9781
|
children: /* @__PURE__ */ i(Nf, { mode: "light", focusMode: "light", children: e })
|
9776
9782
|
}
|
9777
|
-
), En = 2, $f =
|
9783
|
+
), En = 2, $f = ot(
|
9778
9784
|
() => import(
|
9779
9785
|
/* webpackChunkName: "LazyMessageAssistant" */
|
9780
|
-
"./ChatBubbleAssistant.
|
9786
|
+
"./ChatBubbleAssistant.AQlDoZAW.js"
|
9781
9787
|
)
|
9782
9788
|
), Pf = Z.memo(
|
9783
9789
|
({
|
@@ -9803,7 +9809,7 @@ const Of = ({ content: e }) => /* @__PURE__ */ i(
|
|
9803
9809
|
) }) : null;
|
9804
9810
|
}
|
9805
9811
|
), Mf = () => {
|
9806
|
-
const { messages: e } =
|
9812
|
+
const { messages: e } = Qe(), t = e ? e.map((r, a) => r.role === Gt ? a : -1).filter((r) => r !== -1).pop() : -1;
|
9807
9813
|
return e && e.length > 0 ? /* @__PURE__ */ i("div", { className: "space-y-6 mt-2 @container", children: e?.map((r, a) => {
|
9808
9814
|
let n;
|
9809
9815
|
const s = `${a}-${r.role}`, o = r.parts.map((d) => {
|
@@ -9830,26 +9836,27 @@ const Of = ({ content: e }) => /* @__PURE__ */ i(
|
|
9830
9836
|
);
|
9831
9837
|
}) }) : null;
|
9832
9838
|
}, Lf = () => {
|
9833
|
-
const { isAuthenticated: e } =
|
9839
|
+
const { isAuthenticated: e } = Ve(), { ref: t, inViewport: r } = Li(), a = R(null), n = R(null), {
|
9834
9840
|
state: { footerPosition: s, footerHeight: o, footerOffset: c }
|
9835
9841
|
} = X(sa), {
|
9836
9842
|
state: { loading: l }
|
9837
|
-
} = X(be), d = R(0),
|
9843
|
+
} = X(be), { messages: d } = Qe(), f = R(0), u = Io({
|
9838
9844
|
isAuthenticated: e,
|
9839
9845
|
extraClass: "rounded-b-md relative"
|
9840
|
-
}),
|
9846
|
+
}), m = (!d || d.length === 0) && // no current chat session OR no messages
|
9847
|
+
Ae() ? "iphone-logo-conditional" : Ge() ? "mt-4" : "", g = W(() => {
|
9841
9848
|
n.current && n.current.scrollIntoView({
|
9842
9849
|
behavior: "smooth",
|
9843
9850
|
block: "end"
|
9844
9851
|
});
|
9845
9852
|
}, []);
|
9846
9853
|
return $(() => {
|
9847
|
-
l &&
|
9848
|
-
}, [l,
|
9849
|
-
|
9854
|
+
l && g();
|
9855
|
+
}, [l, g]), $(() => {
|
9856
|
+
f.current = s === Je ? o + c + In + xo : 0;
|
9850
9857
|
}, [s, o, c]), /* @__PURE__ */ T(ue, { children: [
|
9851
|
-
/* @__PURE__ */ T("div", { className:
|
9852
|
-
/* @__PURE__ */ i(Ro, {}),
|
9858
|
+
/* @__PURE__ */ T("div", { className: u, ref: a, children: [
|
9859
|
+
/* @__PURE__ */ i(Ro, { className: m }),
|
9853
9860
|
/* @__PURE__ */ i(Mf, {}),
|
9854
9861
|
/* @__PURE__ */ i("div", { ref: t, className: "scroll-marker" }),
|
9855
9862
|
/* @__PURE__ */ i("div", { ref: n, className: "pt-20" })
|
@@ -9857,9 +9864,9 @@ const Of = ({ content: e }) => /* @__PURE__ */ i(
|
|
9857
9864
|
/* @__PURE__ */ i(
|
9858
9865
|
sh,
|
9859
9866
|
{
|
9860
|
-
show: !r && s ===
|
9861
|
-
bottom:
|
9862
|
-
onClick:
|
9867
|
+
show: !r && s === Je,
|
9868
|
+
bottom: f.current,
|
9869
|
+
onClick: g
|
9863
9870
|
}
|
9864
9871
|
)
|
9865
9872
|
] });
|
@@ -9868,16 +9875,16 @@ function co({
|
|
9868
9875
|
isComponent: e = !1,
|
9869
9876
|
headerHeight: t = 0
|
9870
9877
|
}) {
|
9871
|
-
const { user: r, getAccessToken: a } =
|
9878
|
+
const { user: r, getAccessToken: a } = Ve(), [n, s] = F(`${xa}px`), [o, c] = Kn(), [l, d] = F(He()), [f, u] = F([]), [h] = jt({
|
9872
9879
|
key: Ft + $o,
|
9873
9880
|
initialValue: ""
|
9874
9881
|
}), [m] = jt({
|
9875
9882
|
key: Ft + Oo,
|
9876
9883
|
initialValue: ft.ASC
|
9877
9884
|
}), g = he(() => {
|
9878
|
-
const k =
|
9885
|
+
const k = Ae();
|
9879
9886
|
return {
|
9880
|
-
footerPosition: k ?
|
9887
|
+
footerPosition: k ? Je : Wt,
|
9881
9888
|
footerHeight: 0,
|
9882
9889
|
footerOffset: k ? Cn : 0
|
9883
9890
|
};
|
@@ -9957,7 +9964,7 @@ function co({
|
|
9957
9964
|
username: r?.username
|
9958
9965
|
},
|
9959
9966
|
generateId() {
|
9960
|
-
return
|
9967
|
+
return He();
|
9961
9968
|
}
|
9962
9969
|
},
|
9963
9970
|
children: [
|
@@ -10011,9 +10018,9 @@ export {
|
|
10011
10018
|
sm as App,
|
10012
10019
|
sh as ButtonScroll,
|
10013
10020
|
Zn as CHAT_SET_PROVIDER,
|
10014
|
-
|
10021
|
+
rt as CHAT_SET_STATUS,
|
10015
10022
|
be as ChatContext,
|
10016
|
-
|
10023
|
+
qe as ConfirmationPanel,
|
10017
10024
|
jt as E,
|
10018
10025
|
jf as Fe,
|
10019
10026
|
Wf as Ge,
|
@@ -10025,11 +10032,11 @@ export {
|
|
10025
10032
|
no as Oe,
|
10026
10033
|
bc as Pe,
|
10027
10034
|
ft as R,
|
10028
|
-
|
10035
|
+
ze as SERVICE_TYPES,
|
10029
10036
|
Gf as Ye,
|
10030
10037
|
gi as a,
|
10031
10038
|
hi as a$1,
|
10032
|
-
|
10039
|
+
$e as at,
|
10033
10040
|
Li as b,
|
10034
10041
|
ps as getDefaultExportFromCjs,
|
10035
10042
|
Vi as i,
|
@@ -10045,7 +10052,7 @@ export {
|
|
10045
10052
|
Ic as setNewProvider,
|
10046
10053
|
nm as showErrorToast,
|
10047
10054
|
Ys as showSuccessToast,
|
10048
|
-
|
10055
|
+
Qe as useAiChat,
|
10049
10056
|
qf as useChangelogs,
|
10050
10057
|
ts as useChatsHistory,
|
10051
10058
|
Qf as useChatsUsage,
|