@versini/sassysaint 8.57.0 → 8.58.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.DzmH2Ft2.js → AboutChangelog.CB0dcRCM.js} +2 -2
- package/dist/chunks/{AboutEntry.DD3TTwq6.js → AboutEntry.DC6pIWQs.js} +7 -7
- package/dist/chunks/{App.D-eIGXB_.js → App.B8ehtPCy.js} +404 -401
- package/dist/chunks/{Chart.BYV6EqEz.js → Chart.D-VIQysU.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.Cos_gf6Y.js → ChatBubbleAssistant.CyJgR8J8.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.Bk0Fip7I.js → ChatBubbleUser.tWOit_f_.js} +3 -3
- package/dist/chunks/ChatHistoryTable.2v_Tv5Xj.js +317 -0
- package/dist/chunks/HistoryEntry.Dh5bLuYX.js +332 -0
- package/dist/chunks/{ProfileEntry.Mao95CEE.js → ProfileEntry.Dno0c0_1.js} +2 -2
- package/dist/chunks/{SettingsEntry.BCzuEKBT.js → SettingsEntry.IGOE-6JU.js} +3 -3
- package/dist/chunks/{Table.D8oP0Hfr.js → Table.CAzmyLPU.js} +2 -2
- package/dist/chunks/{UsageEntry.DsM00cbQ.js → UsageEntry.BStP6ETh.js} +3 -3
- package/dist/chunks/{UserMemoriesPanel.ByHUtoql.js → UserMemoriesPanel.w335l_3o.js} +3 -3
- package/dist/chunks/{index.Dhmu-uQg.js → index.Bm2rN-Q4.js} +1 -1
- package/dist/chunks/{index.CjLTtni3.js → index.BmuSGkDt.js} +1 -1
- package/dist/chunks/{index.C2glMPDi.js → index.Br-5S8Zv.js} +2 -2
- package/dist/chunks/{index.CQfod5uZ.js → index.CRS7yOjI.js} +1 -1
- package/dist/chunks/{index.M7cagQ1Z.js → index.CVdabB4A.js} +1 -1
- package/dist/chunks/{index.BAwdeYEk.js → index.CYzjDPpw.js} +3 -3
- package/dist/chunks/{index.C5_-KbC2.js → index.D3golFwx.js} +210 -194
- package/dist/chunks/{useMarkdown.B-G3RHi6.js → useMarkdown.B9WkUC07.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +2 -2
- package/package.json +5 -5
- package/dist/chunks/ChatHistoryTable.D26AKQqJ.js +0 -236
- package/dist/chunks/HistoryEntry.CrQhebc8.js +0 -291
@@ -1,13 +1,13 @@
|
|
1
1
|
import { jsx as l, jsxs as k, Fragment as Ae } from "react/jsx-runtime";
|
2
|
-
import { I as G, ACTION_SORT as Ka, ACTION_SEARCH as es, ACTION_RESET_PROMPT as ro, ACTION_TOGGLE_PROMPT as no, oe as ts, te as ge, DEFAULT_ICON_ACTION_SIZE as be, isTauri as Bt, n as Ie, isProbablyiPhone as ze, serverUrl as oo, useEntitlements as rs, L as Ir, j as Ye, C as en, LOCAL_STORAGE_PREFIX as Xe, LOCAL_STORAGE_PRIVATE_DISCLOSURE as ns, Re as jt, useUserPreferences as er, LOCAL_STORAGE_REASONING_DISCLOSURE as os, useChatsHistory as ao, mutateCall as as, SERVICE_TYPES as ss, TOAST_CHAT_SAVED as is, PROMPT_CLASSNAME as cs, PROMPT_EDITABLE_AREA_CLASSNAME as ls, i as us, ERROR_MESSAGE as ds, c as pt, CLIPBOARD_PROMPT as tn, INPUT_PLACEHOLDER_TEXT_MOBILE as rn, INPUT_PLACEHOLDER_TEXT_ENTER as nn, INPUT_PLACEHOLDER_TEXT_CMD_ENTER as on, isProbablyMobile as Er, Ae as ps, FOOTER_DISCLAIMERS as an, h as so, isProbablyiPad as ms, INPUT_BOTTOM_OFFSET_EXTRA as sn, INPUT_BOTTOM_OFFSET_IPHONE as hs, INPUT_BOTTOM_OFFSET_IPAD as fs, INPUT_BOTTOM_OFFSET as io, getLayoutPaddingClass as Tr, i$1 as gs, E as vs, y as ys, setNewProvider as _s, TOAST_PROVIDER_CHANGED as bs, LOG_OUT as cn, a as co, ne as ln, useServerCapabilities as ws, getMessageContaintWrapperClass as Is, UI_FOOTER_BUFFER as lo, UI_BUTTON_SCROLL_BUFFER as Es, Logo as Ts, UI_DEFAULT_MAIN_HEIGHT as un, isPWAMode as Ss, UI_DEFAULT_MAIN_HEIGHT_IPHONE as ks, APP_CLASSNAME as xs, de as dn, Oe as Cs, LOCAL_STORAGE_SORT as Ns, LOCAL_STORAGE_SEARCH as zs, LOCAL_STORAGE_SORT_TIMESTAMP as As, LOCAL_STORAGE_SORT_TOKEN_USAGE as Os, TOAST_CACHE_ENABLED as
|
2
|
+
import { I as G, ACTION_SORT as Ka, ACTION_SEARCH as es, ACTION_RESET_PROMPT as ro, ACTION_TOGGLE_PROMPT as no, oe as ts, te as ge, DEFAULT_ICON_ACTION_SIZE as be, isTauri as Bt, n as Ie, isProbablyiPhone as ze, serverUrl as oo, useEntitlements as rs, L as Ir, j as Ye, C as en, LOCAL_STORAGE_PREFIX as Xe, LOCAL_STORAGE_PRIVATE_DISCLOSURE as ns, Re as jt, useUserPreferences as er, LOCAL_STORAGE_REASONING_DISCLOSURE as os, useChatsHistory as ao, mutateCall as as, SERVICE_TYPES as ss, TOAST_CHAT_SAVED as is, PROMPT_CLASSNAME as cs, PROMPT_EDITABLE_AREA_CLASSNAME as ls, i as us, ERROR_MESSAGE as ds, c as pt, CLIPBOARD_PROMPT as tn, INPUT_PLACEHOLDER_TEXT_MOBILE as rn, INPUT_PLACEHOLDER_TEXT_ENTER as nn, INPUT_PLACEHOLDER_TEXT_CMD_ENTER as on, isProbablyMobile as Er, Ae as ps, FOOTER_DISCLAIMERS as an, h as so, isProbablyiPad as ms, INPUT_BOTTOM_OFFSET_EXTRA as sn, INPUT_BOTTOM_OFFSET_IPHONE as hs, INPUT_BOTTOM_OFFSET_IPAD as fs, INPUT_BOTTOM_OFFSET as io, getLayoutPaddingClass as Tr, i$1 as gs, E as vs, y as ys, setNewProvider as _s, TOAST_PROVIDER_CHANGED as bs, LOG_OUT as cn, a as co, ne as ln, useServerCapabilities as ws, getMessageContaintWrapperClass as Is, UI_FOOTER_BUFFER as lo, UI_BUTTON_SCROLL_BUFFER as Es, Logo as Ts, UI_DEFAULT_MAIN_HEIGHT as un, isPWAMode as Ss, UI_DEFAULT_MAIN_HEIGHT_IPHONE as ks, APP_CLASSNAME as xs, de as dn, Oe as Cs, LOCAL_STORAGE_SORT as Ns, LOCAL_STORAGE_SEARCH as zs, LOCAL_STORAGE_SORT_TIMESTAMP as As, LOCAL_STORAGE_SORT_TOKEN_USAGE as Os, TOAST_CACHE_ENABLED as Ms, TOAST_CACHE_DISABLED as $s } from "./index.D3golFwx.js";
|
3
3
|
import * as ae from "react";
|
4
|
-
import ot, { useRef as J, useEffect as
|
4
|
+
import ot, { useRef as J, useEffect as M, useState as P, useCallback as B, useSyncExternalStore as Pt, createContext as Ps, useContext as te, useId as uo, forwardRef as po, useMemo as tt, Suspense as Vt, lazy as Ee, useReducer as Tt, useLayoutEffect as Rs } from "react";
|
5
5
|
import O from "clsx";
|
6
6
|
import { computePosition as Zs, offset as mo, flip as ho, shift as fo, arrow as Ds, useMergeRefs as Pr, FloatingPortal as go, FloatingOverlay as Ls, FloatingFocusManager as vo, useFloating as yo, useClick as _o, useDismiss as bo, useRole as wo, useInteractions as Io, FloatingTree as Us, useFloatingTree as Eo, useFloatingNodeId as Bs, useListItem as To, autoUpdate as js, useListNavigation as Vs, useTypeahead as Fs, FloatingNode as Hs, FloatingList as Js } from "@floating-ui/react";
|
7
7
|
const pn = ["mousedown", "touchstart"];
|
8
8
|
function Gs(e, t, r) {
|
9
9
|
const n = J(null);
|
10
|
-
return
|
10
|
+
return M(() => {
|
11
11
|
const o = (a) => {
|
12
12
|
const i = a ? a.target : void 0;
|
13
13
|
if (Array.isArray(r)) {
|
@@ -40,7 +40,7 @@ function Ws(e) {
|
|
40
40
|
};
|
41
41
|
}
|
42
42
|
function qs(e, t) {
|
43
|
-
const { alt: r, ctrl: n, meta: o, mod: a, shift: i, key: s } = e, { altKey: u, ctrlKey: c, metaKey: p, shiftKey: d, key:
|
43
|
+
const { alt: r, ctrl: n, meta: o, mod: a, shift: i, key: s } = e, { altKey: u, ctrlKey: c, metaKey: p, shiftKey: d, key: g } = t;
|
44
44
|
if (r !== u)
|
45
45
|
return !1;
|
46
46
|
if (a) {
|
@@ -48,7 +48,7 @@ function qs(e, t) {
|
|
48
48
|
return !1;
|
49
49
|
} else if (n !== c || o !== p)
|
50
50
|
return !1;
|
51
|
-
return i !== d ? !1 : !!(s && (
|
51
|
+
return i !== d ? !1 : !!(s && (g.toLowerCase() === s.toLowerCase() || t.code.replace("Key", "").toLowerCase() === s.toLowerCase()));
|
52
52
|
}
|
53
53
|
function So(e) {
|
54
54
|
return (t) => qs(Ws(e), t);
|
@@ -65,7 +65,7 @@ function Xs(e, t, r = !1) {
|
|
65
65
|
return e.target instanceof HTMLElement ? (r || !e.target.isContentEditable) && !t.includes(e.target.tagName) : !0;
|
66
66
|
}
|
67
67
|
function Rr(e, t = ["INPUT", "TEXTAREA", "SELECT"], r = !1) {
|
68
|
-
|
68
|
+
M(() => {
|
69
69
|
const n = (o) => {
|
70
70
|
e.forEach(
|
71
71
|
([a, i, s = { preventDefault: !0 }]) => {
|
@@ -82,7 +82,7 @@ function Qs(e, t) {
|
|
82
82
|
}, [t]), s = B(() => {
|
83
83
|
n(!1), window.clearInterval(o.current || -1), o.current = -1;
|
84
84
|
}, []);
|
85
|
-
return
|
85
|
+
return M(() => (a.current = e, r && i(), s), [e, r, i, s]), { start: i, stop: s, active: r };
|
86
86
|
}
|
87
87
|
function Ks() {
|
88
88
|
const e = J(null), [t, r] = P(!1);
|
@@ -122,7 +122,7 @@ function Qe({
|
|
122
122
|
}, [t, n]), a = B(() => {
|
123
123
|
n(null);
|
124
124
|
}, [n]);
|
125
|
-
return
|
125
|
+
return M(() => {
|
126
126
|
try {
|
127
127
|
hn(e) === null && typeof t < "u" && mn(e, t);
|
128
128
|
} catch (i) {
|
@@ -131,7 +131,7 @@ function Qe({
|
|
131
131
|
}, [e, t]), [r ? JSON.parse(r) : null, n, o, a];
|
132
132
|
}
|
133
133
|
function fn(e, t) {
|
134
|
-
|
134
|
+
M(() => (window.addEventListener(e, t, {
|
135
135
|
passive: !0
|
136
136
|
}), () => window.removeEventListener(e, t)), [e, t]);
|
137
137
|
}
|
@@ -145,7 +145,7 @@ function ri() {
|
|
145
145
|
height: window.innerHeight || 0
|
146
146
|
});
|
147
147
|
}, []);
|
148
|
-
return fn("resize", r), fn("orientationchange", r),
|
148
|
+
return fn("resize", r), fn("orientationchange", r), M(r, []), e;
|
149
149
|
}
|
150
150
|
function ni() {
|
151
151
|
const [e, t] = P({
|
@@ -157,7 +157,7 @@ function ni() {
|
|
157
157
|
height: window?.visualViewport?.height || window.innerHeight || 0
|
158
158
|
});
|
159
159
|
}, []);
|
160
|
-
return
|
160
|
+
return M(() => (r(), window.visualViewport && (window.visualViewport.addEventListener("resize", r, {
|
161
161
|
passive: !0
|
162
162
|
}), window.visualViewport.addEventListener("orientationchange", r, {
|
163
163
|
passive: !0
|
@@ -783,23 +783,23 @@ var Oe = Ni;
|
|
783
783
|
function zo(e) {
|
784
784
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.message : JSON.stringify(e);
|
785
785
|
}
|
786
|
-
var Ao = "AI_InvalidArgumentError", Oo = `vercel.ai.error.${Ao}`, zi = Symbol.for(Oo),
|
786
|
+
var Ao = "AI_InvalidArgumentError", Oo = `vercel.ai.error.${Ao}`, zi = Symbol.for(Oo), Mo, Ai = class extends Oe {
|
787
787
|
constructor({
|
788
788
|
message: e,
|
789
789
|
cause: t,
|
790
790
|
argument: r
|
791
791
|
}) {
|
792
|
-
super({ name: Ao, message: e, cause: t }), this[
|
792
|
+
super({ name: Ao, message: e, cause: t }), this[Mo] = !0, this.argument = r;
|
793
793
|
}
|
794
794
|
static isInstance(e) {
|
795
795
|
return Oe.hasMarker(e, Oo);
|
796
796
|
}
|
797
797
|
};
|
798
|
-
|
799
|
-
var
|
798
|
+
Mo = zi;
|
799
|
+
var $o = "AI_JSONParseError", Po = `vercel.ai.error.${$o}`, Oi = Symbol.for(Po), Ro, gn = class extends Oe {
|
800
800
|
constructor({ text: e, cause: t }) {
|
801
801
|
super({
|
802
|
-
name:
|
802
|
+
name: $o,
|
803
803
|
message: `JSON parsing failed: Text: ${e}.
|
804
804
|
Error message: ${zo(t)}`,
|
805
805
|
cause: t
|
@@ -810,7 +810,7 @@ Error message: ${zo(t)}`,
|
|
810
810
|
}
|
811
811
|
};
|
812
812
|
Ro = Oi;
|
813
|
-
var Zo = "AI_TypeValidationError", Do = `vercel.ai.error.${Zo}`,
|
813
|
+
var Zo = "AI_TypeValidationError", Do = `vercel.ai.error.${Zo}`, Mi = Symbol.for(Do), Lo, $i = class Sr extends Oe {
|
814
814
|
constructor({ value: t, cause: r }) {
|
815
815
|
super({
|
816
816
|
name: Zo,
|
@@ -839,8 +839,8 @@ Error message: ${zo(r)}`,
|
|
839
839
|
return Sr.isInstance(r) && r.value === t ? r : new Sr({ value: t, cause: r });
|
840
840
|
}
|
841
841
|
};
|
842
|
-
Lo =
|
843
|
-
var Ft =
|
842
|
+
Lo = Mi;
|
843
|
+
var Ft = $i;
|
844
844
|
class vn extends Error {
|
845
845
|
constructor(t, r) {
|
846
846
|
super(t), this.name = "ParseError", this.type = r.type, this.field = r.field, this.value = r.value, this.line = r.line;
|
@@ -863,7 +863,7 @@ function Pi(e) {
|
|
863
863
|
}
|
864
864
|
function d(h) {
|
865
865
|
if (h === "") {
|
866
|
-
|
866
|
+
f();
|
867
867
|
return;
|
868
868
|
}
|
869
869
|
if (h.startsWith(":")) {
|
@@ -873,12 +873,12 @@ function Pi(e) {
|
|
873
873
|
const v = h.indexOf(":");
|
874
874
|
if (v !== -1) {
|
875
875
|
const I = h.slice(0, v), _ = h[v + 1] === " " ? 2 : 1, E = h.slice(v + _);
|
876
|
-
|
876
|
+
g(I, E, h);
|
877
877
|
return;
|
878
878
|
}
|
879
|
-
|
879
|
+
g(h, "", h);
|
880
880
|
}
|
881
|
-
function
|
881
|
+
function g(h, v, I) {
|
882
882
|
switch (h) {
|
883
883
|
case "event":
|
884
884
|
c = v;
|
@@ -909,7 +909,7 @@ function Pi(e) {
|
|
909
909
|
break;
|
910
910
|
}
|
911
911
|
}
|
912
|
-
function
|
912
|
+
function f() {
|
913
913
|
u.length > 0 && t({
|
914
914
|
id: s,
|
915
915
|
event: c || void 0,
|
@@ -997,7 +997,7 @@ class mt extends Error {
|
|
997
997
|
}
|
998
998
|
}
|
999
999
|
const Uo = {};
|
1000
|
-
function
|
1000
|
+
function Me(e) {
|
1001
1001
|
return Uo;
|
1002
1002
|
}
|
1003
1003
|
function Bo(e) {
|
@@ -1225,7 +1225,7 @@ function Le(e, t) {
|
|
1225
1225
|
function St(e) {
|
1226
1226
|
return typeof e == "string" ? e : e?.message;
|
1227
1227
|
}
|
1228
|
-
function
|
1228
|
+
function $e(e, t, r) {
|
1229
1229
|
const n = { ...e, path: e.path ?? [] };
|
1230
1230
|
if (!e.message) {
|
1231
1231
|
const o = St(e.inst?._zod.def?.error?.(e)) ?? St(t?.error?.(e)) ?? St(r.customError?.(e)) ?? St(r.localeError?.(e)) ?? "Invalid input";
|
@@ -1297,7 +1297,7 @@ const Qi = (e) => (t, r, n, o) => {
|
|
1297
1297
|
if (i instanceof Promise)
|
1298
1298
|
throw new mt();
|
1299
1299
|
if (i.issues.length) {
|
1300
|
-
const s = new (o?.Err ?? e)(i.issues.map((u) =>
|
1300
|
+
const s = new (o?.Err ?? e)(i.issues.map((u) => $e(u, a, Me())));
|
1301
1301
|
throw jo(s, o?.callee), s;
|
1302
1302
|
}
|
1303
1303
|
return i.value;
|
@@ -1305,7 +1305,7 @@ const Qi = (e) => (t, r, n, o) => {
|
|
1305
1305
|
const a = n ? Object.assign(n, { async: !0 }) : { async: !0 };
|
1306
1306
|
let i = t._zod.run({ value: r, issues: [] }, a);
|
1307
1307
|
if (i instanceof Promise && (i = await i), i.issues.length) {
|
1308
|
-
const s = new (o?.Err ?? e)(i.issues.map((u) =>
|
1308
|
+
const s = new (o?.Err ?? e)(i.issues.map((u) => $e(u, a, Me())));
|
1309
1309
|
throw jo(s, o?.callee), s;
|
1310
1310
|
}
|
1311
1311
|
return i.value;
|
@@ -1315,14 +1315,14 @@ const Qi = (e) => (t, r, n, o) => {
|
|
1315
1315
|
throw new mt();
|
1316
1316
|
return a.issues.length ? {
|
1317
1317
|
success: !1,
|
1318
|
-
error: new (e ?? Fo)(a.issues.map((i) =>
|
1318
|
+
error: new (e ?? Fo)(a.issues.map((i) => $e(i, o, Me())))
|
1319
1319
|
} : { success: !0, data: a.value };
|
1320
1320
|
}, ec = /* @__PURE__ */ Jo(Ho), Go = (e) => async (t, r, n) => {
|
1321
1321
|
const o = n ? Object.assign(n, { async: !0 }) : { async: !0 };
|
1322
1322
|
let a = t._zod.run({ value: r, issues: [] }, o);
|
1323
1323
|
return a instanceof Promise && (a = await a), a.issues.length ? {
|
1324
1324
|
success: !1,
|
1325
|
-
error: new e(a.issues.map((i) =>
|
1325
|
+
error: new e(a.issues.map((i) => $e(i, o, Me())))
|
1326
1326
|
} : { success: !0, data: a.value };
|
1327
1327
|
}, tc = /* @__PURE__ */ Go(Ho), rc = /^[cC][^\s-]{8,}$/, nc = /^[0-9a-z]+$/, oc = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, ac = /^[0-9a-vA-V]{20}$/, sc = /^[A-Za-z0-9]{27}$/, ic = /^[a-zA-Z0-9_-]{21}$/, cc = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, lc = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, yn = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, uc = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, dc = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
1328
1328
|
function pc() {
|
@@ -1481,7 +1481,7 @@ const Ec = (e) => {
|
|
1481
1481
|
continue: !t.abort
|
1482
1482
|
});
|
1483
1483
|
};
|
1484
|
-
}),
|
1484
|
+
}), Mc = /* @__PURE__ */ y("$ZodCheckMinLength", (e, t) => {
|
1485
1485
|
var r;
|
1486
1486
|
ue.init(e, t), (r = e._zod.def).when ?? (r.when = (n) => {
|
1487
1487
|
const o = n.value;
|
@@ -1504,7 +1504,7 @@ const Ec = (e) => {
|
|
1504
1504
|
continue: !t.abort
|
1505
1505
|
});
|
1506
1506
|
};
|
1507
|
-
}),
|
1507
|
+
}), $c = /* @__PURE__ */ y("$ZodCheckLengthEquals", (e, t) => {
|
1508
1508
|
var r;
|
1509
1509
|
ue.init(e, t), (r = e._zod.def).when ?? (r.when = (n) => {
|
1510
1510
|
const o = n.value;
|
@@ -1664,12 +1664,12 @@ const Vc = {
|
|
1664
1664
|
continue;
|
1665
1665
|
} else if (u)
|
1666
1666
|
continue;
|
1667
|
-
const d = a.issues.length,
|
1668
|
-
if (
|
1667
|
+
const d = a.issues.length, g = p._zod.check(a);
|
1668
|
+
if (g instanceof Promise && s?.async === !1)
|
1669
1669
|
throw new mt();
|
1670
|
-
if (c ||
|
1670
|
+
if (c || g instanceof Promise)
|
1671
1671
|
c = (c ?? Promise.resolve()).then(async () => {
|
1672
|
-
await
|
1672
|
+
await g, a.issues.length !== d && (u || (u = ut(a, d)));
|
1673
1673
|
});
|
1674
1674
|
else {
|
1675
1675
|
if (a.issues.length === d)
|
@@ -2000,47 +2000,47 @@ const wl = /* @__PURE__ */ y("$ZodObject", (e, t) => {
|
|
2000
2000
|
j.init(e, t);
|
2001
2001
|
const r = Zr(() => {
|
2002
2002
|
const d = Object.keys(t.shape);
|
2003
|
-
for (const
|
2004
|
-
if (!(t.shape[
|
2005
|
-
throw new Error(`Invalid element at key "${
|
2006
|
-
const
|
2003
|
+
for (const f of d)
|
2004
|
+
if (!(t.shape[f] instanceof j))
|
2005
|
+
throw new Error(`Invalid element at key "${f}": expected a Zod schema`);
|
2006
|
+
const g = ji(t.shape);
|
2007
2007
|
return {
|
2008
2008
|
shape: t.shape,
|
2009
2009
|
keys: d,
|
2010
2010
|
keySet: new Set(d),
|
2011
2011
|
numKeys: d.length,
|
2012
|
-
optionalKeys: new Set(
|
2012
|
+
optionalKeys: new Set(g)
|
2013
2013
|
};
|
2014
2014
|
});
|
2015
2015
|
Z(e._zod, "propValues", () => {
|
2016
|
-
const d = t.shape,
|
2017
|
-
for (const
|
2018
|
-
const m = d[
|
2016
|
+
const d = t.shape, g = {};
|
2017
|
+
for (const f in d) {
|
2018
|
+
const m = d[f]._zod;
|
2019
2019
|
if (m.values) {
|
2020
|
-
f
|
2020
|
+
g[f] ?? (g[f] = /* @__PURE__ */ new Set());
|
2021
2021
|
for (const h of m.values)
|
2022
|
-
f
|
2022
|
+
g[f].add(h);
|
2023
2023
|
}
|
2024
2024
|
}
|
2025
|
-
return
|
2025
|
+
return g;
|
2026
2026
|
});
|
2027
2027
|
const n = (d) => {
|
2028
|
-
const
|
2028
|
+
const g = new jc(["shape", "payload", "ctx"]), f = r.value, m = (_) => {
|
2029
2029
|
const E = at(_);
|
2030
2030
|
return `shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`;
|
2031
2031
|
};
|
2032
|
-
|
2032
|
+
g.write("const input = payload.value;");
|
2033
2033
|
const h = /* @__PURE__ */ Object.create(null);
|
2034
2034
|
let v = 0;
|
2035
|
-
for (const _ of
|
2035
|
+
for (const _ of f.keys)
|
2036
2036
|
h[_] = `key_${v++}`;
|
2037
|
-
|
2038
|
-
for (const _ of
|
2039
|
-
if (
|
2037
|
+
g.write("const newResult = {}");
|
2038
|
+
for (const _ of f.keys)
|
2039
|
+
if (f.optionalKeys.has(_)) {
|
2040
2040
|
const E = h[_];
|
2041
|
-
|
2041
|
+
g.write(`const ${E} = ${m(_)};`);
|
2042
2042
|
const b = at(_);
|
2043
|
-
|
2043
|
+
g.write(`
|
2044
2044
|
if (${E}.issues.length) {
|
2045
2045
|
if (input[${b}] === undefined) {
|
2046
2046
|
if (${b} in input) {
|
@@ -2062,57 +2062,57 @@ const wl = /* @__PURE__ */ y("$ZodObject", (e, t) => {
|
|
2062
2062
|
`);
|
2063
2063
|
} else {
|
2064
2064
|
const E = h[_];
|
2065
|
-
|
2065
|
+
g.write(`const ${E} = ${m(_)};`), g.write(`
|
2066
2066
|
if (${E}.issues.length) payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
2067
2067
|
...iss,
|
2068
2068
|
path: iss.path ? [${at(_)}, ...iss.path] : [${at(_)}]
|
2069
|
-
})));`),
|
2069
|
+
})));`), g.write(`newResult[${at(_)}] = ${E}.value`);
|
2070
2070
|
}
|
2071
|
-
|
2072
|
-
const I =
|
2071
|
+
g.write("payload.value = newResult;"), g.write("return payload;");
|
2072
|
+
const I = g.compile();
|
2073
2073
|
return (_, E) => I(d, _, E);
|
2074
2074
|
};
|
2075
2075
|
let o;
|
2076
2076
|
const a = Ht, i = !Uo.jitless, u = i && Ui.value, c = t.catchall;
|
2077
2077
|
let p;
|
2078
|
-
e._zod.parse = (d,
|
2078
|
+
e._zod.parse = (d, g) => {
|
2079
2079
|
p ?? (p = r.value);
|
2080
|
-
const
|
2081
|
-
if (!a(
|
2080
|
+
const f = d.value;
|
2081
|
+
if (!a(f))
|
2082
2082
|
return d.issues.push({
|
2083
2083
|
expected: "object",
|
2084
2084
|
code: "invalid_type",
|
2085
|
-
input:
|
2085
|
+
input: f,
|
2086
2086
|
inst: e
|
2087
2087
|
}), d;
|
2088
2088
|
const m = [];
|
2089
|
-
if (i && u &&
|
2090
|
-
o || (o = n(t.shape)), d = o(d,
|
2089
|
+
if (i && u && g?.async === !1 && g.jitless !== !0)
|
2090
|
+
o || (o = n(t.shape)), d = o(d, g);
|
2091
2091
|
else {
|
2092
2092
|
d.value = {};
|
2093
2093
|
const E = p.shape;
|
2094
2094
|
for (const b of p.keys) {
|
2095
|
-
const R = E[b], z = R._zod.run({ value:
|
2096
|
-
z instanceof Promise ? m.push(z.then((A) => x ? bn(A, d, b,
|
2095
|
+
const R = E[b], z = R._zod.run({ value: f[b], issues: [] }, g), x = R._zod.optin === "optional" && R._zod.optout === "optional";
|
2096
|
+
z instanceof Promise ? m.push(z.then((A) => x ? bn(A, d, b, f) : kt(A, d, b))) : x ? bn(z, d, b, f) : kt(z, d, b);
|
2097
2097
|
}
|
2098
2098
|
}
|
2099
2099
|
if (!c)
|
2100
2100
|
return m.length ? Promise.all(m).then(() => d) : d;
|
2101
2101
|
const h = [], v = p.keySet, I = c._zod, _ = I.def.type;
|
2102
|
-
for (const E of Object.keys(
|
2102
|
+
for (const E of Object.keys(f)) {
|
2103
2103
|
if (v.has(E))
|
2104
2104
|
continue;
|
2105
2105
|
if (_ === "never") {
|
2106
2106
|
h.push(E);
|
2107
2107
|
continue;
|
2108
2108
|
}
|
2109
|
-
const b = I.run({ value:
|
2109
|
+
const b = I.run({ value: f[E], issues: [] }, g);
|
2110
2110
|
b instanceof Promise ? m.push(b.then((R) => kt(R, d, E))) : kt(b, d, E);
|
2111
2111
|
}
|
2112
2112
|
return h.length && d.issues.push({
|
2113
2113
|
code: "unrecognized_keys",
|
2114
2114
|
keys: h,
|
2115
|
-
input:
|
2115
|
+
input: f,
|
2116
2116
|
inst: e
|
2117
2117
|
}), m.length ? Promise.all(m).then(() => d) : d;
|
2118
2118
|
};
|
@@ -2125,7 +2125,7 @@ function wn(e, t, r, n) {
|
|
2125
2125
|
code: "invalid_union",
|
2126
2126
|
input: t.value,
|
2127
2127
|
inst: r,
|
2128
|
-
errors: e.map((o) => o.issues.map((a) =>
|
2128
|
+
errors: e.map((o) => o.issues.map((a) => $e(a, n, Me())))
|
2129
2129
|
}), t;
|
2130
2130
|
}
|
2131
2131
|
const ra = /* @__PURE__ */ y("$ZodUnion", (e, t) => {
|
@@ -2296,7 +2296,7 @@ const Tl = /* @__PURE__ */ y("$ZodRecord", (e, t) => {
|
|
2296
2296
|
r.issues.push({
|
2297
2297
|
origin: "record",
|
2298
2298
|
code: "invalid_key",
|
2299
|
-
issues: s.issues.map((c) =>
|
2299
|
+
issues: s.issues.map((c) => $e(c, n, Me())),
|
2300
2300
|
input: i,
|
2301
2301
|
path: [i],
|
2302
2302
|
inst: e
|
@@ -2382,24 +2382,24 @@ function Tn(e, t) {
|
|
2382
2382
|
inst: t
|
2383
2383
|
}), e;
|
2384
2384
|
}
|
2385
|
-
const
|
2385
|
+
const Ml = /* @__PURE__ */ y("$ZodCatch", (e, t) => {
|
2386
2386
|
j.init(e, t), e._zod.optin = "optional", Z(e._zod, "optout", () => t.innerType._zod.optout), Z(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
|
2387
2387
|
const o = t.innerType._zod.run(r, n);
|
2388
2388
|
return o instanceof Promise ? o.then((a) => (r.value = a.value, a.issues.length && (r.value = t.catchValue({
|
2389
2389
|
...r,
|
2390
2390
|
error: {
|
2391
|
-
issues: a.issues.map((i) =>
|
2391
|
+
issues: a.issues.map((i) => $e(i, n, Me()))
|
2392
2392
|
},
|
2393
2393
|
input: r.value
|
2394
2394
|
}), r.issues = []), r)) : (r.value = o.value, o.issues.length && (r.value = t.catchValue({
|
2395
2395
|
...r,
|
2396
2396
|
error: {
|
2397
|
-
issues: o.issues.map((a) =>
|
2397
|
+
issues: o.issues.map((a) => $e(a, n, Me()))
|
2398
2398
|
},
|
2399
2399
|
input: r.value
|
2400
2400
|
}), r.issues = []), r);
|
2401
2401
|
};
|
2402
|
-
}),
|
2402
|
+
}), $l = /* @__PURE__ */ y("$ZodPipe", (e, t) => {
|
2403
2403
|
j.init(e, t), Z(e._zod, "values", () => t.in._zod.values), Z(e._zod, "optin", () => t.in._zod.optin), Z(e._zod, "optout", () => t.out._zod.optout), e._zod.parse = (r, n) => {
|
2404
2404
|
const o = t.in._zod.run(r, n);
|
2405
2405
|
return o instanceof Promise ? o.then((a) => Sn(a, t, n)) : Sn(o, t, n);
|
@@ -2807,14 +2807,14 @@ function aa(e, t) {
|
|
2807
2807
|
});
|
2808
2808
|
}
|
2809
2809
|
function Gt(e, t) {
|
2810
|
-
return new
|
2810
|
+
return new Mc({
|
2811
2811
|
check: "min_length",
|
2812
2812
|
...S(t),
|
2813
2813
|
minimum: e
|
2814
2814
|
});
|
2815
2815
|
}
|
2816
2816
|
function sa(e, t) {
|
2817
|
-
return new
|
2817
|
+
return new $c({
|
2818
2818
|
check: "length_equals",
|
2819
2819
|
...S(t),
|
2820
2820
|
length: e
|
@@ -2938,14 +2938,14 @@ class On {
|
|
2938
2938
|
...r,
|
2939
2939
|
schemaPath: [...r.schemaPath, t],
|
2940
2940
|
path: r.path
|
2941
|
-
},
|
2942
|
-
if (
|
2943
|
-
s.ref =
|
2941
|
+
}, g = t._zod.parent;
|
2942
|
+
if (g)
|
2943
|
+
s.ref = g, this.process(g, d), this.seen.get(g).isParent = !0;
|
2944
2944
|
else {
|
2945
|
-
const
|
2945
|
+
const f = s.schema;
|
2946
2946
|
switch (o.type) {
|
2947
2947
|
case "string": {
|
2948
|
-
const m =
|
2948
|
+
const m = f;
|
2949
2949
|
m.type = "string";
|
2950
2950
|
const { minimum: h, maximum: v, format: I, patterns: _, contentEncoding: E } = t._zod.bag;
|
2951
2951
|
if (typeof h == "number" && (m.minLength = h), typeof v == "number" && (m.maxLength = v), I && (m.format = a[I] ?? I, m.format === "" && delete m.format), E && (m.contentEncoding = E), _ && _.size > 0) {
|
@@ -2960,12 +2960,12 @@ class On {
|
|
2960
2960
|
break;
|
2961
2961
|
}
|
2962
2962
|
case "number": {
|
2963
|
-
const m =
|
2963
|
+
const m = f, { minimum: h, maximum: v, format: I, multipleOf: _, exclusiveMaximum: E, exclusiveMinimum: b } = t._zod.bag;
|
2964
2964
|
typeof I == "string" && I.includes("int") ? m.type = "integer" : m.type = "number", typeof b == "number" && (m.exclusiveMinimum = b), typeof h == "number" && (m.minimum = h, typeof b == "number" && (b >= h ? delete m.minimum : delete m.exclusiveMinimum)), typeof E == "number" && (m.exclusiveMaximum = E), typeof v == "number" && (m.maximum = v, typeof E == "number" && (E <= v ? delete m.maximum : delete m.exclusiveMaximum)), typeof _ == "number" && (m.multipleOf = _);
|
2965
2965
|
break;
|
2966
2966
|
}
|
2967
2967
|
case "boolean": {
|
2968
|
-
const m =
|
2968
|
+
const m = f;
|
2969
2969
|
m.type = "boolean";
|
2970
2970
|
break;
|
2971
2971
|
}
|
@@ -2980,7 +2980,7 @@ class On {
|
|
2980
2980
|
break;
|
2981
2981
|
}
|
2982
2982
|
case "null": {
|
2983
|
-
|
2983
|
+
f.type = "null";
|
2984
2984
|
break;
|
2985
2985
|
}
|
2986
2986
|
case "any":
|
@@ -2998,7 +2998,7 @@ class On {
|
|
2998
2998
|
break;
|
2999
2999
|
}
|
3000
3000
|
case "never": {
|
3001
|
-
|
3001
|
+
f.not = {};
|
3002
3002
|
break;
|
3003
3003
|
}
|
3004
3004
|
case "date": {
|
@@ -3007,12 +3007,12 @@ class On {
|
|
3007
3007
|
break;
|
3008
3008
|
}
|
3009
3009
|
case "array": {
|
3010
|
-
const m =
|
3010
|
+
const m = f, { minimum: h, maximum: v } = t._zod.bag;
|
3011
3011
|
typeof h == "number" && (m.minItems = h), typeof v == "number" && (m.maxItems = v), m.type = "array", m.items = this.process(o.element, { ...d, path: [...d.path, "items"] });
|
3012
3012
|
break;
|
3013
3013
|
}
|
3014
3014
|
case "object": {
|
3015
|
-
const m =
|
3015
|
+
const m = f;
|
3016
3016
|
m.type = "object", m.properties = {};
|
3017
3017
|
const h = o.shape;
|
3018
3018
|
for (const _ in h)
|
@@ -3031,7 +3031,7 @@ class On {
|
|
3031
3031
|
break;
|
3032
3032
|
}
|
3033
3033
|
case "union": {
|
3034
|
-
const m =
|
3034
|
+
const m = f;
|
3035
3035
|
m.anyOf = o.options.map((h, v) => this.process(h, {
|
3036
3036
|
...d,
|
3037
3037
|
path: [...d.path, "anyOf", v]
|
@@ -3039,7 +3039,7 @@ class On {
|
|
3039
3039
|
break;
|
3040
3040
|
}
|
3041
3041
|
case "intersection": {
|
3042
|
-
const m =
|
3042
|
+
const m = f, h = this.process(o.left, {
|
3043
3043
|
...d,
|
3044
3044
|
path: [...d.path, "allOf", 0]
|
3045
3045
|
}), v = this.process(o.right, {
|
@@ -3053,7 +3053,7 @@ class On {
|
|
3053
3053
|
break;
|
3054
3054
|
}
|
3055
3055
|
case "tuple": {
|
3056
|
-
const m =
|
3056
|
+
const m = f;
|
3057
3057
|
m.type = "array";
|
3058
3058
|
const h = o.items.map((_, E) => this.process(_, { ...d, path: [...d.path, "prefixItems", E] }));
|
3059
3059
|
if (this.target === "draft-2020-12" ? m.prefixItems = h : m.items = h, o.rest) {
|
@@ -3072,7 +3072,7 @@ class On {
|
|
3072
3072
|
break;
|
3073
3073
|
}
|
3074
3074
|
case "record": {
|
3075
|
-
const m =
|
3075
|
+
const m = f;
|
3076
3076
|
m.type = "object", m.propertyNames = this.process(o.keyType, { ...d, path: [...d.path, "propertyNames"] }), m.additionalProperties = this.process(o.valueType, {
|
3077
3077
|
...d,
|
3078
3078
|
path: [...d.path, "additionalProperties"]
|
@@ -3090,12 +3090,12 @@ class On {
|
|
3090
3090
|
break;
|
3091
3091
|
}
|
3092
3092
|
case "enum": {
|
3093
|
-
const m =
|
3093
|
+
const m = f, h = Bo(o.entries);
|
3094
3094
|
h.every((v) => typeof v == "number") && (m.type = "number"), h.every((v) => typeof v == "string") && (m.type = "string"), m.enum = h;
|
3095
3095
|
break;
|
3096
3096
|
}
|
3097
3097
|
case "literal": {
|
3098
|
-
const m =
|
3098
|
+
const m = f, h = [];
|
3099
3099
|
for (const v of o.values)
|
3100
3100
|
if (v === void 0) {
|
3101
3101
|
if (this.unrepresentable === "throw")
|
@@ -3114,7 +3114,7 @@ class On {
|
|
3114
3114
|
break;
|
3115
3115
|
}
|
3116
3116
|
case "file": {
|
3117
|
-
const m =
|
3117
|
+
const m = f, h = {
|
3118
3118
|
type: "string",
|
3119
3119
|
format: "binary",
|
3120
3120
|
contentEncoding: "binary"
|
@@ -3129,7 +3129,7 @@ class On {
|
|
3129
3129
|
}
|
3130
3130
|
case "nullable": {
|
3131
3131
|
const m = this.process(o.innerType, d);
|
3132
|
-
|
3132
|
+
f.anyOf = [m, { type: "null" }];
|
3133
3133
|
break;
|
3134
3134
|
}
|
3135
3135
|
case "nonoptional": {
|
@@ -3137,16 +3137,16 @@ class On {
|
|
3137
3137
|
break;
|
3138
3138
|
}
|
3139
3139
|
case "success": {
|
3140
|
-
const m =
|
3140
|
+
const m = f;
|
3141
3141
|
m.type = "boolean";
|
3142
3142
|
break;
|
3143
3143
|
}
|
3144
3144
|
case "default": {
|
3145
|
-
this.process(o.innerType, d), s.ref = o.innerType,
|
3145
|
+
this.process(o.innerType, d), s.ref = o.innerType, f.default = JSON.parse(JSON.stringify(o.defaultValue));
|
3146
3146
|
break;
|
3147
3147
|
}
|
3148
3148
|
case "prefault": {
|
3149
|
-
this.process(o.innerType, d), s.ref = o.innerType, this.io === "input" && (
|
3149
|
+
this.process(o.innerType, d), s.ref = o.innerType, this.io === "input" && (f._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
3150
3150
|
break;
|
3151
3151
|
}
|
3152
3152
|
case "catch": {
|
@@ -3157,7 +3157,7 @@ class On {
|
|
3157
3157
|
} catch {
|
3158
3158
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
3159
3159
|
}
|
3160
|
-
|
3160
|
+
f.default = m;
|
3161
3161
|
break;
|
3162
3162
|
}
|
3163
3163
|
case "nan": {
|
@@ -3166,7 +3166,7 @@ class On {
|
|
3166
3166
|
break;
|
3167
3167
|
}
|
3168
3168
|
case "template_literal": {
|
3169
|
-
const m =
|
3169
|
+
const m = f, h = t._zod.pattern;
|
3170
3170
|
if (!h)
|
3171
3171
|
throw new Error("Pattern not found in template literal");
|
3172
3172
|
m.type = "string", m.pattern = h.source;
|
@@ -3178,7 +3178,7 @@ class On {
|
|
3178
3178
|
break;
|
3179
3179
|
}
|
3180
3180
|
case "readonly": {
|
3181
|
-
this.process(o.innerType, d), s.ref = o.innerType,
|
3181
|
+
this.process(o.innerType, d), s.ref = o.innerType, f.readOnly = !0;
|
3182
3182
|
break;
|
3183
3183
|
}
|
3184
3184
|
// passthrough types
|
@@ -3227,17 +3227,17 @@ class On {
|
|
3227
3227
|
}
|
3228
3228
|
if (p[1] === o)
|
3229
3229
|
return { ref: "#" };
|
3230
|
-
const
|
3231
|
-
return { defId: m, ref:
|
3230
|
+
const f = `#/${d}/`, m = p[1].schema.id ?? `__schema${this.counter++}`;
|
3231
|
+
return { defId: m, ref: f + m };
|
3232
3232
|
}, i = (p) => {
|
3233
3233
|
if (p[1].schema.$ref)
|
3234
3234
|
return;
|
3235
|
-
const d = p[1], { ref:
|
3236
|
-
d.def = { ...d.schema },
|
3235
|
+
const d = p[1], { ref: g, defId: f } = a(p);
|
3236
|
+
d.def = { ...d.schema }, f && (d.defId = f);
|
3237
3237
|
const m = d.schema;
|
3238
3238
|
for (const h in m)
|
3239
3239
|
delete m[h];
|
3240
|
-
m.$ref =
|
3240
|
+
m.$ref = g;
|
3241
3241
|
};
|
3242
3242
|
if (n.cycles === "throw")
|
3243
3243
|
for (const p of this.seen.entries()) {
|
@@ -3254,8 +3254,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
3254
3254
|
continue;
|
3255
3255
|
}
|
3256
3256
|
if (n.external) {
|
3257
|
-
const
|
3258
|
-
if (t !== p[0] &&
|
3257
|
+
const f = n.external.registry.get(p[0])?.id;
|
3258
|
+
if (t !== p[0] && f) {
|
3259
3259
|
i(p);
|
3260
3260
|
continue;
|
3261
3261
|
}
|
@@ -3274,19 +3274,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
3274
3274
|
}
|
3275
3275
|
}
|
3276
3276
|
const s = (p, d) => {
|
3277
|
-
const
|
3278
|
-
if (
|
3277
|
+
const g = this.seen.get(p), f = g.def ?? g.schema, m = { ...f };
|
3278
|
+
if (g.ref === null)
|
3279
3279
|
return;
|
3280
|
-
const h =
|
3281
|
-
if (
|
3280
|
+
const h = g.ref;
|
3281
|
+
if (g.ref = null, h) {
|
3282
3282
|
s(h, d);
|
3283
3283
|
const v = this.seen.get(h).schema;
|
3284
|
-
v.$ref && d.target === "draft-7" ? (
|
3284
|
+
v.$ref && d.target === "draft-7" ? (f.allOf = f.allOf ?? [], f.allOf.push(v)) : (Object.assign(f, v), Object.assign(f, m));
|
3285
3285
|
}
|
3286
|
-
|
3286
|
+
g.isParent || this.override({
|
3287
3287
|
zodSchema: p,
|
3288
|
-
jsonSchema:
|
3289
|
-
path:
|
3288
|
+
jsonSchema: f,
|
3289
|
+
path: g.path ?? []
|
3290
3290
|
});
|
3291
3291
|
};
|
3292
3292
|
for (const p of [...this.seen.entries()].reverse())
|
@@ -3430,14 +3430,14 @@ function Au(e) {
|
|
3430
3430
|
const Ou = /* @__PURE__ */ y("ZodISODate", (e, t) => {
|
3431
3431
|
rl.init(e, t), Y.init(e, t);
|
3432
3432
|
});
|
3433
|
-
function
|
3433
|
+
function Mu(e) {
|
3434
3434
|
return iu(Ou, e);
|
3435
3435
|
}
|
3436
|
-
const
|
3436
|
+
const $u = /* @__PURE__ */ y("ZodISOTime", (e, t) => {
|
3437
3437
|
nl.init(e, t), Y.init(e, t);
|
3438
3438
|
});
|
3439
3439
|
function Pu(e) {
|
3440
|
-
return cu(
|
3440
|
+
return cu($u, e);
|
3441
3441
|
}
|
3442
3442
|
const Ru = /* @__PURE__ */ y("ZodISODuration", (e, t) => {
|
3443
3443
|
ol.init(e, t), Y.init(e, t);
|
@@ -3499,7 +3499,7 @@ const Du = (e, t) => {
|
|
3499
3499
|
const r = e._zod.bag;
|
3500
3500
|
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(gu(...n)), e.includes = (...n) => e.check(_u(...n)), e.startsWith = (...n) => e.check(bu(...n)), e.endsWith = (...n) => e.check(wu(...n)), e.min = (...n) => e.check(Gt(...n)), e.max = (...n) => e.check(aa(...n)), e.length = (...n) => e.check(sa(...n)), e.nonempty = (...n) => e.check(Gt(1, ...n)), e.lowercase = (n) => e.check(vu(n)), e.uppercase = (n) => e.check(yu(n)), e.trim = () => e.check(Eu()), e.normalize = (...n) => e.check(Iu(...n)), e.toLowerCase = () => e.check(Tu()), e.toUpperCase = () => e.check(Su());
|
3501
3501
|
}), ju = /* @__PURE__ */ y("ZodString", (e, t) => {
|
3502
|
-
Br.init(e, t), ca.init(e, t), e.email = (r) => e.check(Ul(Vu, r)), e.url = (r) => e.check(Hl(Fu, r)), e.jwt = (r) => e.check(au(od, r)), e.emoji = (r) => e.check(Jl(Hu, r)), e.guid = (r) => e.check(Cn(
|
3502
|
+
Br.init(e, t), ca.init(e, t), e.email = (r) => e.check(Ul(Vu, r)), e.url = (r) => e.check(Hl(Fu, r)), e.jwt = (r) => e.check(au(od, r)), e.emoji = (r) => e.check(Jl(Hu, r)), e.guid = (r) => e.check(Cn(Mn, r)), e.uuid = (r) => e.check(Bl(xt, r)), e.uuidv4 = (r) => e.check(jl(xt, r)), e.uuidv6 = (r) => e.check(Vl(xt, r)), e.uuidv7 = (r) => e.check(Fl(xt, r)), e.nanoid = (r) => e.check(Gl(Ju, r)), e.guid = (r) => e.check(Cn(Mn, r)), e.cuid = (r) => e.check(Wl(Gu, r)), e.cuid2 = (r) => e.check(ql(Wu, r)), e.ulid = (r) => e.check(Yl(qu, r)), e.base64 = (r) => e.check(oa(la, r)), e.base64url = (r) => e.check(nu(rd, r)), e.xid = (r) => e.check(Xl(Yu, r)), e.ksuid = (r) => e.check(Ql(Xu, r)), e.ipv4 = (r) => e.check(Kl(Qu, r)), e.ipv6 = (r) => e.check(eu(Ku, r)), e.cidrv4 = (r) => e.check(tu(ed, r)), e.cidrv6 = (r) => e.check(ru(td, r)), e.e164 = (r) => e.check(ou(nd, r)), e.datetime = (r) => e.check(Au(r)), e.date = (r) => e.check(Mu(r)), e.time = (r) => e.check(Pu(r)), e.duration = (r) => e.check(Zu(r));
|
3503
3503
|
});
|
3504
3504
|
function w(e) {
|
3505
3505
|
return Ll(ju, e);
|
@@ -3508,7 +3508,7 @@ const Y = /* @__PURE__ */ y("ZodStringFormat", (e, t) => {
|
|
3508
3508
|
W.init(e, t), ca.init(e, t);
|
3509
3509
|
}), Vu = /* @__PURE__ */ y("ZodEmail", (e, t) => {
|
3510
3510
|
Jc.init(e, t), Y.init(e, t);
|
3511
|
-
}),
|
3511
|
+
}), Mn = /* @__PURE__ */ y("ZodGUID", (e, t) => {
|
3512
3512
|
Fc.init(e, t), Y.init(e, t);
|
3513
3513
|
}), xt = /* @__PURE__ */ y("ZodUUID", (e, t) => {
|
3514
3514
|
Hc.init(e, t), Y.init(e, t);
|
@@ -3549,7 +3549,7 @@ const rd = /* @__PURE__ */ y("ZodBase64URL", (e, t) => {
|
|
3549
3549
|
}), od = /* @__PURE__ */ y("ZodJWT", (e, t) => {
|
3550
3550
|
hl.init(e, t), Y.init(e, t);
|
3551
3551
|
}), da = /* @__PURE__ */ y("ZodNumber", (e, t) => {
|
3552
|
-
ta.init(e, t), q.init(e, t), e.gt = (n, o) => e.check(zn(n, o)), e.gte = (n, o) => e.check(mr(n, o)), e.min = (n, o) => e.check(mr(n, o)), e.lt = (n, o) => e.check(Nn(n, o)), e.lte = (n, o) => e.check(pr(n, o)), e.max = (n, o) => e.check(pr(n, o)), e.int = (n) => e.check(
|
3552
|
+
ta.init(e, t), q.init(e, t), e.gt = (n, o) => e.check(zn(n, o)), e.gte = (n, o) => e.check(mr(n, o)), e.min = (n, o) => e.check(mr(n, o)), e.lt = (n, o) => e.check(Nn(n, o)), e.lte = (n, o) => e.check(pr(n, o)), e.max = (n, o) => e.check(pr(n, o)), e.int = (n) => e.check($n(n)), e.safe = (n) => e.check($n(n)), e.positive = (n) => e.check(zn(0, n)), e.nonnegative = (n) => e.check(mr(0, n)), e.negative = (n) => e.check(Nn(0, n)), e.nonpositive = (n) => e.check(pr(0, n)), e.multipleOf = (n, o) => e.check(An(n, o)), e.step = (n, o) => e.check(An(n, o)), e.finite = () => e;
|
3553
3553
|
const r = e._zod.bag;
|
3554
3554
|
e.minValue = Math.max(r.minimum ?? Number.NEGATIVE_INFINITY, r.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(r.maximum ?? Number.POSITIVE_INFINITY, r.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (r.format ?? "").includes("int") || Number.isSafeInteger(r.multipleOf ?? 0.5), e.isFinite = !0, e.format = r.format ?? null;
|
3555
3555
|
});
|
@@ -3559,7 +3559,7 @@ function ft(e) {
|
|
3559
3559
|
const ad = /* @__PURE__ */ y("ZodNumberFormat", (e, t) => {
|
3560
3560
|
fl.init(e, t), da.init(e, t);
|
3561
3561
|
});
|
3562
|
-
function
|
3562
|
+
function $n(e) {
|
3563
3563
|
return du(ad, e);
|
3564
3564
|
}
|
3565
3565
|
const sd = /* @__PURE__ */ y("ZodBoolean", (e, t) => {
|
@@ -3795,7 +3795,7 @@ function Sd(e, t) {
|
|
3795
3795
|
});
|
3796
3796
|
}
|
3797
3797
|
const kd = /* @__PURE__ */ y("ZodCatch", (e, t) => {
|
3798
|
-
|
3798
|
+
Ml.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
3799
3799
|
});
|
3800
3800
|
function xd(e, t) {
|
3801
3801
|
return new kd({
|
@@ -3805,7 +3805,7 @@ function xd(e, t) {
|
|
3805
3805
|
});
|
3806
3806
|
}
|
3807
3807
|
const Cd = /* @__PURE__ */ y("ZodPipe", (e, t) => {
|
3808
|
-
|
3808
|
+
$l.init(e, t), q.init(e, t), e.in = t.in, e.out = t.out;
|
3809
3809
|
});
|
3810
3810
|
function Rn(e, t) {
|
3811
3811
|
return new Cd({
|
@@ -3836,21 +3836,21 @@ function Od(e) {
|
|
3836
3836
|
const Vr = /* @__PURE__ */ y("ZodCustom", (e, t) => {
|
3837
3837
|
Zl.init(e, t), q.init(e, t);
|
3838
3838
|
});
|
3839
|
-
function
|
3839
|
+
function Md(e) {
|
3840
3840
|
const t = new ue({
|
3841
3841
|
check: "custom"
|
3842
3842
|
// ...util.normalizeParams(params),
|
3843
3843
|
});
|
3844
3844
|
return t._zod.check = e, t;
|
3845
3845
|
}
|
3846
|
-
function
|
3846
|
+
function $d(e, t) {
|
3847
3847
|
return xu(Vr, e ?? (() => !0), t);
|
3848
3848
|
}
|
3849
3849
|
function Pd(e, t = {}) {
|
3850
3850
|
return Cu(Vr, e, t);
|
3851
3851
|
}
|
3852
3852
|
function Rd(e) {
|
3853
|
-
const t =
|
3853
|
+
const t = Md((r) => (r.addIssue = (n) => {
|
3854
3854
|
if (typeof n == "string")
|
3855
3855
|
r.issues.push(ht(n, r.value, t._zod.def));
|
3856
3856
|
else {
|
@@ -4867,22 +4867,22 @@ var zp = (e, t) => {
|
|
4867
4867
|
])
|
4868
4868
|
)
|
4869
4869
|
};
|
4870
|
-
},
|
4870
|
+
}, Mp = (e, t) => {
|
4871
4871
|
var r;
|
4872
4872
|
const n = Op(t);
|
4873
4873
|
let o = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce(
|
4874
4874
|
(c, [p, d]) => {
|
4875
|
-
var
|
4875
|
+
var g;
|
4876
4876
|
return {
|
4877
4877
|
...c,
|
4878
|
-
[p]: (
|
4878
|
+
[p]: (g = L(
|
4879
4879
|
d._def,
|
4880
4880
|
{
|
4881
4881
|
...n,
|
4882
4882
|
currentPath: [...n.basePath, n.definitionPath, p]
|
4883
4883
|
},
|
4884
4884
|
!0
|
4885
|
-
)) != null ?
|
4885
|
+
)) != null ? g : pe()
|
4886
4886
|
};
|
4887
4887
|
},
|
4888
4888
|
{}
|
@@ -4911,12 +4911,12 @@ var zp = (e, t) => {
|
|
4911
4911
|
}
|
4912
4912
|
};
|
4913
4913
|
return u.$schema = "http://json-schema.org/draft-07/schema#", u;
|
4914
|
-
},
|
4914
|
+
}, $p = Mp;
|
4915
4915
|
function Pp(e, t) {
|
4916
4916
|
var r;
|
4917
4917
|
const n = (r = void 0) != null ? r : !1;
|
4918
4918
|
return Hr(
|
4919
|
-
|
4919
|
+
$p(e, {
|
4920
4920
|
$refStrategy: n ? "root" : "none"
|
4921
4921
|
}),
|
4922
4922
|
{
|
@@ -4992,7 +4992,7 @@ var Ia = ee([
|
|
4992
4992
|
w(),
|
4993
4993
|
Wt(Uint8Array),
|
4994
4994
|
Wt(ArrayBuffer),
|
4995
|
-
|
4995
|
+
$d(
|
4996
4996
|
// Buffer might not be available in some environments such as CloudFlare:
|
4997
4997
|
(e) => {
|
4998
4998
|
var t, r;
|
@@ -5009,34 +5009,34 @@ var Ia = ee([
|
|
5009
5009
|
xr(w(), gt),
|
5010
5010
|
Te(gt)
|
5011
5011
|
])
|
5012
|
-
),
|
5012
|
+
), $ = xr(
|
5013
5013
|
w(),
|
5014
5014
|
xr(w(), gt)
|
5015
5015
|
), Ea = C({
|
5016
5016
|
type: T("text"),
|
5017
5017
|
text: w(),
|
5018
|
-
providerOptions:
|
5018
|
+
providerOptions: $.optional()
|
5019
5019
|
}), Fp = C({
|
5020
5020
|
type: T("image"),
|
5021
5021
|
image: ee([Ia, Wt(URL)]),
|
5022
5022
|
mediaType: w().optional(),
|
5023
|
-
providerOptions:
|
5023
|
+
providerOptions: $.optional()
|
5024
5024
|
}), Ta = C({
|
5025
5025
|
type: T("file"),
|
5026
5026
|
data: ee([Ia, Wt(URL)]),
|
5027
5027
|
filename: w().optional(),
|
5028
5028
|
mediaType: w(),
|
5029
|
-
providerOptions:
|
5029
|
+
providerOptions: $.optional()
|
5030
5030
|
}), Hp = C({
|
5031
5031
|
type: T("reasoning"),
|
5032
5032
|
text: w(),
|
5033
|
-
providerOptions:
|
5033
|
+
providerOptions: $.optional()
|
5034
5034
|
}), Jp = C({
|
5035
5035
|
type: T("tool-call"),
|
5036
5036
|
toolCallId: w(),
|
5037
5037
|
toolName: w(),
|
5038
5038
|
input: H(),
|
5039
|
-
providerOptions:
|
5039
|
+
providerOptions: $.optional(),
|
5040
5040
|
providerExecuted: X().optional()
|
5041
5041
|
}), Gp = md("type", [
|
5042
5042
|
C({
|
@@ -5076,12 +5076,12 @@ var Ia = ee([
|
|
5076
5076
|
toolCallId: w(),
|
5077
5077
|
toolName: w(),
|
5078
5078
|
output: Gp,
|
5079
|
-
providerOptions:
|
5079
|
+
providerOptions: $.optional()
|
5080
5080
|
}), Wp = C(
|
5081
5081
|
{
|
5082
5082
|
role: T("system"),
|
5083
5083
|
content: w(),
|
5084
|
-
providerOptions:
|
5084
|
+
providerOptions: $.optional()
|
5085
5085
|
}
|
5086
5086
|
), qp = C({
|
5087
5087
|
role: T("user"),
|
@@ -5089,7 +5089,7 @@ var Ia = ee([
|
|
5089
5089
|
w(),
|
5090
5090
|
Te(ee([Ea, Fp, Ta]))
|
5091
5091
|
]),
|
5092
|
-
providerOptions:
|
5092
|
+
providerOptions: $.optional()
|
5093
5093
|
}), Yp = C({
|
5094
5094
|
role: T("assistant"),
|
5095
5095
|
content: ee([
|
@@ -5104,11 +5104,11 @@ var Ia = ee([
|
|
5104
5104
|
])
|
5105
5105
|
)
|
5106
5106
|
]),
|
5107
|
-
providerOptions:
|
5107
|
+
providerOptions: $.optional()
|
5108
5108
|
}), Xp = C({
|
5109
5109
|
role: T("tool"),
|
5110
5110
|
content: Te(Sa),
|
5111
|
-
providerOptions:
|
5111
|
+
providerOptions: $.optional()
|
5112
5112
|
});
|
5113
5113
|
ee([
|
5114
5114
|
Wp,
|
@@ -5124,18 +5124,18 @@ var Qp = ee([
|
|
5124
5124
|
V({
|
5125
5125
|
type: T("text-start"),
|
5126
5126
|
id: w(),
|
5127
|
-
providerMetadata:
|
5127
|
+
providerMetadata: $.optional()
|
5128
5128
|
}),
|
5129
5129
|
V({
|
5130
5130
|
type: T("text-delta"),
|
5131
5131
|
id: w(),
|
5132
5132
|
delta: w(),
|
5133
|
-
providerMetadata:
|
5133
|
+
providerMetadata: $.optional()
|
5134
5134
|
}),
|
5135
5135
|
V({
|
5136
5136
|
type: T("text-end"),
|
5137
5137
|
id: w(),
|
5138
|
-
providerMetadata:
|
5138
|
+
providerMetadata: $.optional()
|
5139
5139
|
}),
|
5140
5140
|
V({
|
5141
5141
|
type: T("error"),
|
@@ -5159,7 +5159,7 @@ var Qp = ee([
|
|
5159
5159
|
toolName: w(),
|
5160
5160
|
input: H(),
|
5161
5161
|
providerExecuted: X().optional(),
|
5162
|
-
providerMetadata:
|
5162
|
+
providerMetadata: $.optional(),
|
5163
5163
|
dynamic: X().optional()
|
5164
5164
|
}),
|
5165
5165
|
V({
|
@@ -5168,7 +5168,7 @@ var Qp = ee([
|
|
5168
5168
|
toolName: w(),
|
5169
5169
|
input: H(),
|
5170
5170
|
providerExecuted: X().optional(),
|
5171
|
-
providerMetadata:
|
5171
|
+
providerMetadata: $.optional(),
|
5172
5172
|
dynamic: X().optional(),
|
5173
5173
|
errorText: w()
|
5174
5174
|
}),
|
@@ -5190,23 +5190,23 @@ var Qp = ee([
|
|
5190
5190
|
V({
|
5191
5191
|
type: T("reasoning"),
|
5192
5192
|
text: w(),
|
5193
|
-
providerMetadata:
|
5193
|
+
providerMetadata: $.optional()
|
5194
5194
|
}),
|
5195
5195
|
V({
|
5196
5196
|
type: T("reasoning-start"),
|
5197
5197
|
id: w(),
|
5198
|
-
providerMetadata:
|
5198
|
+
providerMetadata: $.optional()
|
5199
5199
|
}),
|
5200
5200
|
V({
|
5201
5201
|
type: T("reasoning-delta"),
|
5202
5202
|
id: w(),
|
5203
5203
|
delta: w(),
|
5204
|
-
providerMetadata:
|
5204
|
+
providerMetadata: $.optional()
|
5205
5205
|
}),
|
5206
5206
|
V({
|
5207
5207
|
type: T("reasoning-end"),
|
5208
5208
|
id: w(),
|
5209
|
-
providerMetadata:
|
5209
|
+
providerMetadata: $.optional()
|
5210
5210
|
}),
|
5211
5211
|
V({
|
5212
5212
|
type: T("reasoning-part-finish")
|
@@ -5216,7 +5216,7 @@ var Qp = ee([
|
|
5216
5216
|
sourceId: w(),
|
5217
5217
|
url: w(),
|
5218
5218
|
title: w().optional(),
|
5219
|
-
providerMetadata:
|
5219
|
+
providerMetadata: $.optional()
|
5220
5220
|
}),
|
5221
5221
|
V({
|
5222
5222
|
type: T("source-document"),
|
@@ -5224,13 +5224,13 @@ var Qp = ee([
|
|
5224
5224
|
mediaType: w(),
|
5225
5225
|
title: w(),
|
5226
5226
|
filename: w().optional(),
|
5227
|
-
providerMetadata:
|
5227
|
+
providerMetadata: $.optional()
|
5228
5228
|
}),
|
5229
5229
|
V({
|
5230
5230
|
type: T("file"),
|
5231
5231
|
url: w(),
|
5232
5232
|
mediaType: w(),
|
5233
|
-
providerMetadata:
|
5233
|
+
providerMetadata: $.optional()
|
5234
5234
|
}),
|
5235
5235
|
V({
|
5236
5236
|
type: w().startsWith("data-"),
|
@@ -5580,7 +5580,7 @@ function nm({
|
|
5580
5580
|
new TransformStream({
|
5581
5581
|
async transform(s, u) {
|
5582
5582
|
await n(async ({ state: c, write: p }) => {
|
5583
|
-
var d,
|
5583
|
+
var d, g, f, m;
|
5584
5584
|
function h(b) {
|
5585
5585
|
const z = c.message.parts.filter(Rt).find(
|
5586
5586
|
(x) => x.toolCallId === b
|
@@ -5665,7 +5665,7 @@ function nm({
|
|
5665
5665
|
}
|
5666
5666
|
case "text-end": {
|
5667
5667
|
const b = c.activeTextParts[s.id];
|
5668
|
-
b.state = "done", b.providerMetadata = (
|
5668
|
+
b.state = "done", b.providerMetadata = (g = s.providerMetadata) != null ? g : b.providerMetadata, delete c.activeTextParts[s.id], p();
|
5669
5669
|
break;
|
5670
5670
|
}
|
5671
5671
|
case "reasoning-start": {
|
@@ -5680,7 +5680,7 @@ function nm({
|
|
5680
5680
|
}
|
5681
5681
|
case "reasoning-delta": {
|
5682
5682
|
const b = c.activeReasoningParts[s.id];
|
5683
|
-
b.text += s.delta, b.providerMetadata = (
|
5683
|
+
b.text += s.delta, b.providerMetadata = (f = s.providerMetadata) != null ? f : b.providerMetadata, p();
|
5684
5684
|
break;
|
5685
5685
|
}
|
5686
5686
|
case "reasoning-end": {
|
@@ -6172,7 +6172,7 @@ var Tm = class {
|
|
6172
6172
|
requestMetadata: t.metadata,
|
6173
6173
|
trigger: t.trigger,
|
6174
6174
|
messageId: t.messageId
|
6175
|
-
})), d = (n = p?.api) != null ? n : this.api,
|
6175
|
+
})), d = (n = p?.api) != null ? n : this.api, g = p?.headers !== void 0 ? p.headers : { ...u, ...t.headers }, f = p?.body !== void 0 ? p.body : {
|
6176
6176
|
...s,
|
6177
6177
|
...t.body,
|
6178
6178
|
id: t.chatId,
|
@@ -6183,9 +6183,9 @@ var Tm = class {
|
|
6183
6183
|
method: "POST",
|
6184
6184
|
headers: {
|
6185
6185
|
"Content-Type": "application/json",
|
6186
|
-
...
|
6186
|
+
...g
|
6187
6187
|
},
|
6188
|
-
body: JSON.stringify(
|
6188
|
+
body: JSON.stringify(f),
|
6189
6189
|
credentials: m,
|
6190
6190
|
signal: e
|
6191
6191
|
});
|
@@ -6206,10 +6206,10 @@ var Tm = class {
|
|
6206
6206
|
headers: { ...s, ...e.headers },
|
6207
6207
|
credentials: u,
|
6208
6208
|
requestMetadata: e.metadata
|
6209
|
-
})), p = (r = c?.api) != null ? r : `${this.api}/${e.chatId}/stream`, d = c?.headers !== void 0 ? c.headers : { ...s, ...e.headers },
|
6209
|
+
})), p = (r = c?.api) != null ? r : `${this.api}/${e.chatId}/stream`, d = c?.headers !== void 0 ? c.headers : { ...s, ...e.headers }, g = (n = c?.credentials) != null ? n : u, m = await ((o = this.fetch) != null ? o : globalThis.fetch)(p, {
|
6210
6210
|
method: "GET",
|
6211
6211
|
headers: d,
|
6212
|
-
credentials:
|
6212
|
+
credentials: g
|
6213
6213
|
});
|
6214
6214
|
if (m.status === 204)
|
6215
6215
|
return null;
|
@@ -6253,13 +6253,13 @@ var Tm = class {
|
|
6253
6253
|
onData: c,
|
6254
6254
|
sendAutomaticallyWhen: p
|
6255
6255
|
}) {
|
6256
|
-
this.activeResponse = void 0, this.jobExecutor = new am(), this.sendMessage = async (d,
|
6257
|
-
var
|
6256
|
+
this.activeResponse = void 0, this.jobExecutor = new am(), this.sendMessage = async (d, g) => {
|
6257
|
+
var f, m, h, v;
|
6258
6258
|
if (d == null) {
|
6259
6259
|
await this.makeRequest({
|
6260
6260
|
trigger: "submit-message",
|
6261
|
-
messageId: (
|
6262
|
-
...
|
6261
|
+
messageId: (f = this.lastMessage) == null ? void 0 : f.id,
|
6262
|
+
...g
|
6263
6263
|
});
|
6264
6264
|
return;
|
6265
6265
|
}
|
@@ -6295,23 +6295,23 @@ var Tm = class {
|
|
6295
6295
|
await this.makeRequest({
|
6296
6296
|
trigger: "submit-message",
|
6297
6297
|
messageId: d.messageId,
|
6298
|
-
...
|
6298
|
+
...g
|
6299
6299
|
});
|
6300
6300
|
}, this.regenerate = async ({
|
6301
6301
|
messageId: d,
|
6302
|
-
...
|
6302
|
+
...g
|
6303
6303
|
} = {}) => {
|
6304
|
-
const
|
6305
|
-
if (
|
6304
|
+
const f = d == null ? this.state.messages.length - 1 : this.state.messages.findIndex((m) => m.id === d);
|
6305
|
+
if (f === -1)
|
6306
6306
|
throw new Error(`message ${d} not found`);
|
6307
6307
|
this.state.messages = this.state.messages.slice(
|
6308
6308
|
0,
|
6309
6309
|
// if the message is a user message, we need to include it in the request:
|
6310
|
-
this.messages[
|
6310
|
+
this.messages[f].role === "assistant" ? f : f + 1
|
6311
6311
|
), await this.makeRequest({
|
6312
6312
|
trigger: "regenerate-message",
|
6313
6313
|
messageId: d,
|
6314
|
-
...
|
6314
|
+
...g
|
6315
6315
|
});
|
6316
6316
|
}, this.resumeStream = async (d = {}) => {
|
6317
6317
|
await this.makeRequest({ trigger: "resume-stream", ...d });
|
@@ -6319,21 +6319,21 @@ var Tm = class {
|
|
6319
6319
|
this.status === "error" && (this.state.error = void 0, this.setStatus({ status: "ready" }));
|
6320
6320
|
}, this.addToolResult = async ({
|
6321
6321
|
tool: d,
|
6322
|
-
toolCallId:
|
6323
|
-
output:
|
6322
|
+
toolCallId: g,
|
6323
|
+
output: f
|
6324
6324
|
}) => this.jobExecutor.run(async () => {
|
6325
6325
|
var m, h;
|
6326
6326
|
const v = this.state.messages, I = v[v.length - 1];
|
6327
6327
|
this.state.replaceMessage(v.length - 1, {
|
6328
6328
|
...I,
|
6329
6329
|
parts: I.parts.map(
|
6330
|
-
(_) => Bn(_) && _.toolCallId ===
|
6330
|
+
(_) => Bn(_) && _.toolCallId === g ? { ..._, state: "output-available", output: f } : _
|
6331
6331
|
)
|
6332
6332
|
}), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(
|
6333
|
-
(_) => Bn(_) && _.toolCallId ===
|
6333
|
+
(_) => Bn(_) && _.toolCallId === g ? {
|
6334
6334
|
..._,
|
6335
6335
|
state: "output-available",
|
6336
|
-
output:
|
6336
|
+
output: f,
|
6337
6337
|
errorText: void 0
|
6338
6338
|
} : _
|
6339
6339
|
)), this.status !== "streaming" && this.status !== "submitted" && ((m = this.sendAutomaticallyWhen) != null && m.call(this, { messages: this.state.messages })) && this.makeRequest({
|
@@ -6386,17 +6386,17 @@ var Tm = class {
|
|
6386
6386
|
const u = this.lastMessage;
|
6387
6387
|
let c = !1, p = !1, d = !1;
|
6388
6388
|
try {
|
6389
|
-
const
|
6389
|
+
const g = {
|
6390
6390
|
state: rm({
|
6391
6391
|
lastMessage: this.state.snapshot(u),
|
6392
6392
|
messageId: this.generateId()
|
6393
6393
|
}),
|
6394
6394
|
abortController: new AbortController()
|
6395
6395
|
};
|
6396
|
-
|
6396
|
+
g.abortController.signal.addEventListener("abort", () => {
|
6397
6397
|
c = !0;
|
6398
|
-
}), this.activeResponse =
|
6399
|
-
let
|
6398
|
+
}), this.activeResponse = g;
|
6399
|
+
let f;
|
6400
6400
|
if (e === "resume-stream") {
|
6401
6401
|
const h = await this.transport.reconnectToStream({
|
6402
6402
|
chatId: this.id,
|
@@ -6408,12 +6408,12 @@ var Tm = class {
|
|
6408
6408
|
this.setStatus({ status: "ready" });
|
6409
6409
|
return;
|
6410
6410
|
}
|
6411
|
-
|
6411
|
+
f = h;
|
6412
6412
|
} else
|
6413
|
-
|
6413
|
+
f = await this.transport.sendMessages({
|
6414
6414
|
chatId: this.id,
|
6415
6415
|
messages: this.state.messages,
|
6416
|
-
abortSignal:
|
6416
|
+
abortSignal: g.abortController.signal,
|
6417
6417
|
metadata: t,
|
6418
6418
|
headers: r,
|
6419
6419
|
body: n,
|
@@ -6424,20 +6424,20 @@ var Tm = class {
|
|
6424
6424
|
// serialize the job execution to avoid race conditions:
|
6425
6425
|
this.jobExecutor.run(
|
6426
6426
|
() => h({
|
6427
|
-
state:
|
6427
|
+
state: g.state,
|
6428
6428
|
write: () => {
|
6429
6429
|
var v;
|
6430
|
-
this.setStatus({ status: "streaming" }),
|
6430
|
+
this.setStatus({ status: "streaming" }), g.state.message.id === ((v = this.lastMessage) == null ? void 0 : v.id) ? this.state.replaceMessage(
|
6431
6431
|
this.state.messages.length - 1,
|
6432
|
-
|
6433
|
-
) : this.state.pushMessage(
|
6432
|
+
g.state.message
|
6433
|
+
) : this.state.pushMessage(g.state.message);
|
6434
6434
|
}
|
6435
6435
|
})
|
6436
6436
|
)
|
6437
6437
|
);
|
6438
6438
|
await om({
|
6439
6439
|
stream: nm({
|
6440
|
-
stream:
|
6440
|
+
stream: f,
|
6441
6441
|
onToolCall: this.onToolCall,
|
6442
6442
|
onData: this.onData,
|
6443
6443
|
messageMetadataSchema: this.messageMetadataSchema,
|
@@ -6451,10 +6451,10 @@ var Tm = class {
|
|
6451
6451
|
throw h;
|
6452
6452
|
}
|
6453
6453
|
}), this.setStatus({ status: "ready" });
|
6454
|
-
} catch (
|
6455
|
-
if (c ||
|
6454
|
+
} catch (g) {
|
6455
|
+
if (c || g.name === "AbortError")
|
6456
6456
|
return c = !0, this.setStatus({ status: "ready" }), null;
|
6457
|
-
d = !0,
|
6457
|
+
d = !0, g instanceof TypeError && (g.message.toLowerCase().includes("fetch") || g.message.toLowerCase().includes("network")) && (p = !0), this.onError && g instanceof Error && this.onError(g), this.setStatus({ status: "error", error: g });
|
6458
6458
|
} finally {
|
6459
6459
|
try {
|
6460
6460
|
(a = this.onFinish) == null || a.call(this, {
|
@@ -6464,8 +6464,8 @@ var Tm = class {
|
|
6464
6464
|
isDisconnect: p,
|
6465
6465
|
isError: d
|
6466
6466
|
});
|
6467
|
-
} catch (
|
6468
|
-
console.error(
|
6467
|
+
} catch (g) {
|
6468
|
+
console.error(g);
|
6469
6469
|
}
|
6470
6470
|
this.activeResponse = void 0;
|
6471
6471
|
}
|
@@ -6481,38 +6481,38 @@ var Tm = class {
|
|
6481
6481
|
type: T("text"),
|
6482
6482
|
text: w(),
|
6483
6483
|
state: nr(["streaming", "done"]).optional(),
|
6484
|
-
providerMetadata:
|
6484
|
+
providerMetadata: $.optional()
|
6485
6485
|
}), xm = C({
|
6486
6486
|
type: T("reasoning"),
|
6487
6487
|
text: w(),
|
6488
6488
|
state: nr(["streaming", "done"]).optional(),
|
6489
|
-
providerMetadata:
|
6489
|
+
providerMetadata: $.optional()
|
6490
6490
|
}), Cm = C({
|
6491
6491
|
type: T("source-url"),
|
6492
6492
|
sourceId: w(),
|
6493
6493
|
url: w(),
|
6494
6494
|
title: w().optional(),
|
6495
|
-
providerMetadata:
|
6495
|
+
providerMetadata: $.optional()
|
6496
6496
|
}), Nm = C({
|
6497
6497
|
type: T("source-document"),
|
6498
6498
|
sourceId: w(),
|
6499
6499
|
mediaType: w(),
|
6500
6500
|
title: w(),
|
6501
6501
|
filename: w().optional(),
|
6502
|
-
providerMetadata:
|
6502
|
+
providerMetadata: $.optional()
|
6503
6503
|
}), zm = C({
|
6504
6504
|
type: T("file"),
|
6505
6505
|
mediaType: w(),
|
6506
6506
|
filename: w().optional(),
|
6507
6507
|
url: w(),
|
6508
|
-
providerMetadata:
|
6508
|
+
providerMetadata: $.optional()
|
6509
6509
|
}), Am = C({
|
6510
6510
|
type: T("step-start")
|
6511
6511
|
}), Om = C({
|
6512
6512
|
type: w().startsWith("data-"),
|
6513
6513
|
id: w().optional(),
|
6514
6514
|
data: H()
|
6515
|
-
}),
|
6515
|
+
}), Mm = [
|
6516
6516
|
C({
|
6517
6517
|
type: T("dynamic-tool"),
|
6518
6518
|
toolName: w(),
|
@@ -6530,7 +6530,7 @@ var Tm = class {
|
|
6530
6530
|
input: H(),
|
6531
6531
|
output: le().optional(),
|
6532
6532
|
errorText: le().optional(),
|
6533
|
-
callProviderMetadata:
|
6533
|
+
callProviderMetadata: $.optional()
|
6534
6534
|
}),
|
6535
6535
|
C({
|
6536
6536
|
type: T("dynamic-tool"),
|
@@ -6540,7 +6540,7 @@ var Tm = class {
|
|
6540
6540
|
input: H(),
|
6541
6541
|
output: H(),
|
6542
6542
|
errorText: le().optional(),
|
6543
|
-
callProviderMetadata:
|
6543
|
+
callProviderMetadata: $.optional(),
|
6544
6544
|
preliminary: X().optional()
|
6545
6545
|
}),
|
6546
6546
|
C({
|
@@ -6551,9 +6551,9 @@ var Tm = class {
|
|
6551
6551
|
input: H(),
|
6552
6552
|
output: le().optional(),
|
6553
6553
|
errorText: w(),
|
6554
|
-
callProviderMetadata:
|
6554
|
+
callProviderMetadata: $.optional()
|
6555
6555
|
})
|
6556
|
-
],
|
6556
|
+
], $m = [
|
6557
6557
|
C({
|
6558
6558
|
type: w().startsWith("tool-"),
|
6559
6559
|
toolCallId: w(),
|
@@ -6569,7 +6569,7 @@ var Tm = class {
|
|
6569
6569
|
input: H(),
|
6570
6570
|
output: le().optional(),
|
6571
6571
|
errorText: le().optional(),
|
6572
|
-
callProviderMetadata:
|
6572
|
+
callProviderMetadata: $.optional()
|
6573
6573
|
}),
|
6574
6574
|
C({
|
6575
6575
|
type: w().startsWith("tool-"),
|
@@ -6578,7 +6578,7 @@ var Tm = class {
|
|
6578
6578
|
input: H(),
|
6579
6579
|
output: H(),
|
6580
6580
|
errorText: le().optional(),
|
6581
|
-
callProviderMetadata:
|
6581
|
+
callProviderMetadata: $.optional(),
|
6582
6582
|
preliminary: X().optional()
|
6583
6583
|
}),
|
6584
6584
|
C({
|
@@ -6588,7 +6588,7 @@ var Tm = class {
|
|
6588
6588
|
input: H(),
|
6589
6589
|
output: le().optional(),
|
6590
6590
|
errorText: w(),
|
6591
|
-
callProviderMetadata:
|
6591
|
+
callProviderMetadata: $.optional()
|
6592
6592
|
})
|
6593
6593
|
];
|
6594
6594
|
C({
|
@@ -6604,8 +6604,8 @@ C({
|
|
6604
6604
|
zm,
|
6605
6605
|
Am,
|
6606
6606
|
Om,
|
6607
|
-
|
6608
|
-
|
6607
|
+
...Mm,
|
6608
|
+
...$m
|
6609
6609
|
])
|
6610
6610
|
)
|
6611
6611
|
});
|
@@ -6641,7 +6641,7 @@ const Na = async () => (vr || (vr = import(
|
|
6641
6641
|
"./index.BwP0kG4H.js"
|
6642
6642
|
)), vr), za = async () => (yr || (yr = import(
|
6643
6643
|
/* webpackChunkName: "toast-utilities" */
|
6644
|
-
"./index.
|
6644
|
+
"./index.D3golFwx.js"
|
6645
6645
|
).then((e) => e.utilities)), yr), Lm = async () => {
|
6646
6646
|
try {
|
6647
6647
|
await Promise.all([Na(), za()]);
|
@@ -6679,9 +6679,9 @@ const Na = async () => (vr || (vr = import(
|
|
6679
6679
|
default:
|
6680
6680
|
return e;
|
6681
6681
|
}
|
6682
|
-
}, et = "CHAT_SET_STATUS",
|
6682
|
+
}, et = "CHAT_SET_STATUS", Ma = "CHAT_SET_USAGE", nt = "CHAT_SET_ATTACHMENTS", $a = "CHAT_SET_PROVIDER", je = "CHAT_RESET", Bm = (e, t) => {
|
6683
6683
|
switch (t.type) {
|
6684
|
-
case
|
6684
|
+
case Ma:
|
6685
6685
|
return {
|
6686
6686
|
...e,
|
6687
6687
|
tokenUsage: e.tokenUsage + t.payload.tokenUsage
|
@@ -6707,7 +6707,7 @@ const Na = async () => (vr || (vr = import(
|
|
6707
6707
|
lastStreamingTimestamp: n ? Date.now() : e.lastStreamingTimestamp
|
6708
6708
|
};
|
6709
6709
|
}
|
6710
|
-
case
|
6710
|
+
case $a:
|
6711
6711
|
return {
|
6712
6712
|
...e,
|
6713
6713
|
provider: t.payload.provider
|
@@ -6897,7 +6897,7 @@ function Ym({
|
|
6897
6897
|
},
|
6898
6898
|
[n]
|
6899
6899
|
);
|
6900
|
-
return
|
6900
|
+
return M(() => {
|
6901
6901
|
t && n.current.resumeStream();
|
6902
6902
|
}, [t, n]), {
|
6903
6903
|
id: n.current.id,
|
@@ -6924,9 +6924,9 @@ function Ve(e = {}) {
|
|
6924
6924
|
if (!t)
|
6925
6925
|
throw new Error("useAiChat must be used within a AiChatProvider");
|
6926
6926
|
const r = J(e);
|
6927
|
-
return
|
6927
|
+
return M(() => {
|
6928
6928
|
r.current = e;
|
6929
|
-
}, [e]),
|
6929
|
+
}, [e]), M(() => {
|
6930
6930
|
const { onFinish: n, onError: o, onData: a, onToolCall: i } = r.current;
|
6931
6931
|
return n && t.handlers.onFinish.add(n), o && t.handlers.onError.add(o), a && t.handlers.onData.add(a), i && t.handlers.onToolCall.add(i), () => {
|
6932
6932
|
n && t.handlers.onFinish.delete(n), o && t.handlers.onError.delete(o), a && t.handlers.onData.delete(a), i && t.handlers.onToolCall.delete(i);
|
@@ -6942,7 +6942,7 @@ function Xm({
|
|
6942
6942
|
value: t
|
6943
6943
|
}) {
|
6944
6944
|
const r = J(Jn()), [n, o] = P("");
|
6945
|
-
|
6945
|
+
M(() => {
|
6946
6946
|
r.current = Jn();
|
6947
6947
|
}, [t]);
|
6948
6948
|
const a = B((p) => {
|
@@ -6989,7 +6989,7 @@ const Gn = ({
|
|
6989
6989
|
...t
|
6990
6990
|
}) => {
|
6991
6991
|
const [r, n] = P(Ct);
|
6992
|
-
return
|
6992
|
+
return M(() => {
|
6993
6993
|
if (!Ct) {
|
6994
6994
|
const o = async () => {
|
6995
6995
|
try {
|
@@ -7096,7 +7096,7 @@ const Gn = ({
|
|
7096
7096
|
}) => {
|
7097
7097
|
const u = Gs(() => {
|
7098
7098
|
h.stop(), m(!1);
|
7099
|
-
}), c = J(null), p = J(null), [d,
|
7099
|
+
}), c = J(null), p = J(null), [d, g] = P(!1), [f, m] = P(!1), h = Qs(() => {
|
7100
7100
|
m(!1);
|
7101
7101
|
}, ih), v = ah({
|
7102
7102
|
mode: n,
|
@@ -7142,15 +7142,15 @@ const Gn = ({
|
|
7142
7142
|
});
|
7143
7143
|
}
|
7144
7144
|
}, [r, I, u]);
|
7145
|
-
|
7145
|
+
M(() => {
|
7146
7146
|
(async () => d && await _())();
|
7147
7147
|
}, [_, d]);
|
7148
7148
|
const E = () => {
|
7149
|
-
|
7149
|
+
g(!1), m(!0), h.start();
|
7150
7150
|
}, b = () => {
|
7151
|
-
|
7151
|
+
f || g(!0);
|
7152
7152
|
}, R = () => {
|
7153
|
-
|
7153
|
+
f || g(!1);
|
7154
7154
|
};
|
7155
7155
|
return /* @__PURE__ */ k(
|
7156
7156
|
"div",
|
@@ -7216,7 +7216,7 @@ const ch = ({
|
|
7216
7216
|
}
|
7217
7217
|
);
|
7218
7218
|
function Za(e, t) {
|
7219
|
-
|
7219
|
+
M(() => {
|
7220
7220
|
if (Bt() && typeof window < "u")
|
7221
7221
|
return window.__VERSINI_DIGGIDY_TAURI_EVENTS__ && (window.__VERSINI_DIGGIDY_TAURI_EVENTS__[e] = t), () => {
|
7222
7222
|
window.__VERSINI_DIGGIDY_TAURI_EVENTS__ && (window.__VERSINI_DIGGIDY_TAURI_EVENTS__[e] = null);
|
@@ -7231,7 +7231,7 @@ const lh = ({
|
|
7231
7231
|
dispatch: o,
|
7232
7232
|
setChatId: a,
|
7233
7233
|
setInitialMessages: i
|
7234
|
-
} = te(ve), { id: s, setInput: u, stop: c } = Ve(), p = J(null), d = J(!1),
|
7234
|
+
} = te(ve), { id: s, setInput: u, stop: c } = Ve(), p = J(null), d = J(!1), g = B(() => {
|
7235
7235
|
a(Pe()), i([]), u(""), o({
|
7236
7236
|
type: je,
|
7237
7237
|
payload: {
|
@@ -7245,18 +7245,18 @@ const lh = ({
|
|
7245
7245
|
}
|
7246
7246
|
});
|
7247
7247
|
}, [a, i, u, o]);
|
7248
|
-
Za("newChat",
|
7248
|
+
Za("newChat", g), Rr(
|
7249
7249
|
[
|
7250
7250
|
[
|
7251
7251
|
"mod+N",
|
7252
7252
|
() => {
|
7253
|
-
Bt() &&
|
7253
|
+
Bt() && g();
|
7254
7254
|
}
|
7255
7255
|
],
|
7256
7256
|
[
|
7257
7257
|
"mod+T",
|
7258
7258
|
() => {
|
7259
|
-
Bt() &&
|
7259
|
+
Bt() && g();
|
7260
7260
|
}
|
7261
7261
|
]
|
7262
7262
|
],
|
@@ -7267,7 +7267,7 @@ const lh = ({
|
|
7267
7267
|
*/
|
7268
7268
|
[]
|
7269
7269
|
);
|
7270
|
-
const
|
7270
|
+
const f = async (h) => {
|
7271
7271
|
h.preventDefault(), c(), o({
|
7272
7272
|
type: et,
|
7273
7273
|
payload: {
|
@@ -7290,9 +7290,9 @@ const lh = ({
|
|
7290
7290
|
console.error("Failed to send abort signal:", v);
|
7291
7291
|
}
|
7292
7292
|
}, m = (h) => {
|
7293
|
-
h.preventDefault(),
|
7293
|
+
h.preventDefault(), g();
|
7294
7294
|
};
|
7295
|
-
return
|
7295
|
+
return M(() => {
|
7296
7296
|
ze() || ((r === !0 || n === !0) && !d.current && p.current && (d.current = !0, p.current.focus()), r === !1 && d.current && (d.current = !1));
|
7297
7297
|
}, [r, n]), /* @__PURE__ */ l(
|
7298
7298
|
Se,
|
@@ -7310,7 +7310,7 @@ const lh = ({
|
|
7310
7310
|
focusMode: "light",
|
7311
7311
|
label: "New Chat",
|
7312
7312
|
ref: p,
|
7313
|
-
onClick: r || n ?
|
7313
|
+
onClick: r || n ? f : m,
|
7314
7314
|
children: r || n ? /* @__PURE__ */ l(ui, { size: be, monotone: !0 }) : /* @__PURE__ */ l(pi, { size: be })
|
7315
7315
|
}
|
7316
7316
|
)
|
@@ -7408,12 +7408,12 @@ function ph({
|
|
7408
7408
|
const [n, o] = ae.useState(e), [a, i] = ae.useState(), [s, u] = ae.useState(), c = t ?? n, p = r ?? o, d = yo({
|
7409
7409
|
open: c,
|
7410
7410
|
onOpenChange: p
|
7411
|
-
}),
|
7411
|
+
}), g = d.context, f = _o(g, {
|
7412
7412
|
enabled: t == null
|
7413
|
-
}), m = bo(
|
7413
|
+
}), m = bo(g, {
|
7414
7414
|
outsidePress: !1,
|
7415
7415
|
outsidePressEvent: "mousedown"
|
7416
|
-
}), h = wo(
|
7416
|
+
}), h = wo(g), v = Io([f, m, h]);
|
7417
7417
|
return ae.useMemo(
|
7418
7418
|
() => ({
|
7419
7419
|
open: c,
|
@@ -7524,7 +7524,7 @@ const De = "panel", At = "messagebox", yh = ({
|
|
7524
7524
|
animationType: c = _h,
|
7525
7525
|
maxWidth: p = "medium"
|
7526
7526
|
}) => {
|
7527
|
-
const d = J(""), [
|
7527
|
+
const d = J(""), [g, f] = P(
|
7528
7528
|
u ? c === Yn ? { opacity: 0 } : {
|
7529
7529
|
transform: "translateY(-100vh)"
|
7530
7530
|
} : {}
|
@@ -7535,17 +7535,17 @@ const De = "panel", At = "messagebox", yh = ({
|
|
7535
7535
|
animation: u,
|
7536
7536
|
maxWidth: p
|
7537
7537
|
});
|
7538
|
-
return
|
7538
|
+
return M(() => (e && (d.current = document.title, document.title = `${r} | ${d.current}`), () => {
|
7539
7539
|
e && (document.title = d.current);
|
7540
|
-
}), [r, e]),
|
7540
|
+
}), [r, e]), M(() => {
|
7541
7541
|
if (u && e) {
|
7542
|
-
|
7542
|
+
f(
|
7543
7543
|
u ? c === Yn ? { opacity: 0 } : {
|
7544
7544
|
transform: "translateY(-666vh)"
|
7545
7545
|
} : {}
|
7546
7546
|
);
|
7547
7547
|
const h = setTimeout(() => {
|
7548
|
-
|
7548
|
+
f(
|
7549
7549
|
u ? c === "fade" ? { opacity: 1 } : {
|
7550
7550
|
transform: "translateY(0)"
|
7551
7551
|
} : {}
|
@@ -7553,7 +7553,7 @@ const De = "panel", At = "messagebox", yh = ({
|
|
7553
7553
|
}, 100);
|
7554
7554
|
return () => clearTimeout(h);
|
7555
7555
|
}
|
7556
|
-
}, [e, u, c]), /* @__PURE__ */ l(Ae, { children: e && /* @__PURE__ */ l(mh, { open: e, onOpenChange: t, children: /* @__PURE__ */ k(hh, { className: m.main, style:
|
7556
|
+
}, [e, u, c]), /* @__PURE__ */ l(Ae, { children: e && /* @__PURE__ */ l(mh, { open: e, onOpenChange: t, children: /* @__PURE__ */ k(hh, { className: m.main, style: g, children: [
|
7557
7557
|
/* @__PURE__ */ k("div", { className: "flex flex-row-reverse items-center justify-between", children: [
|
7558
7558
|
/* @__PURE__ */ l(
|
7559
7559
|
vh,
|
@@ -7647,14 +7647,15 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
7647
7647
|
"border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium": e === "alt-system",
|
7648
7648
|
"border-border-medium bg-surface-medium dark:border-border-light dark:bg-surface-darker": e === "system"
|
7649
7649
|
}), xh = ({
|
7650
|
-
|
7651
|
-
|
7652
|
-
|
7653
|
-
|
7654
|
-
"text-copy-
|
7655
|
-
"text-copy-lighter
|
7656
|
-
"text-copy-
|
7657
|
-
|
7650
|
+
labelHidden: e,
|
7651
|
+
labelMode: t,
|
7652
|
+
mode: r
|
7653
|
+
}) => (t = t || r, e ? "sr-only" : O("ml-2 text-sm", {
|
7654
|
+
"text-copy-dark": t === "light",
|
7655
|
+
"text-copy-lighter": t === "dark",
|
7656
|
+
"text-copy-lighter dark:text-copy-dark": t === "alt-system",
|
7657
|
+
"text-copy-dark dark:text-copy-lighter": t === "system"
|
7658
|
+
})), Ch = ({ className: e }) => O(
|
7658
7659
|
wh,
|
7659
7660
|
"relative flex cursor-pointer items-center",
|
7660
7661
|
e
|
@@ -7664,7 +7665,8 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
7664
7665
|
labelHidden: r,
|
7665
7666
|
className: n,
|
7666
7667
|
noBorder: o,
|
7667
|
-
narrow: a
|
7668
|
+
narrow: a,
|
7669
|
+
labelMode: i
|
7668
7670
|
}) => ({
|
7669
7671
|
toggle: O(
|
7670
7672
|
Ih({ narrow: a }),
|
@@ -7673,7 +7675,7 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
7673
7675
|
Sh({ narrow: a }),
|
7674
7676
|
Th({ narrow: a })
|
7675
7677
|
),
|
7676
|
-
label: xh({
|
7678
|
+
label: xh({ labelHidden: r, labelMode: i, mode: e }),
|
7677
7679
|
input: "peer sr-only",
|
7678
7680
|
wrapper: Ch({ className: n })
|
7679
7681
|
}), zh = ({
|
@@ -7684,43 +7686,45 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
7684
7686
|
name: o,
|
7685
7687
|
mode: a = "system",
|
7686
7688
|
focusMode: i = "system",
|
7687
|
-
|
7688
|
-
|
7689
|
-
|
7689
|
+
labelMode: s,
|
7690
|
+
className: u,
|
7691
|
+
noBorder: c = !1,
|
7692
|
+
narrow: p = !1
|
7690
7693
|
}) => {
|
7691
|
-
const
|
7694
|
+
const d = Nh({
|
7692
7695
|
mode: a,
|
7693
7696
|
focusMode: i,
|
7694
7697
|
labelHidden: n,
|
7695
|
-
className:
|
7696
|
-
noBorder:
|
7697
|
-
narrow:
|
7698
|
-
|
7698
|
+
className: u,
|
7699
|
+
noBorder: c,
|
7700
|
+
narrow: p,
|
7701
|
+
labelMode: s
|
7702
|
+
}), g = (f) => {
|
7699
7703
|
t?.(f.target.checked);
|
7700
7704
|
};
|
7701
|
-
return /* @__PURE__ */ k("label", { className:
|
7705
|
+
return /* @__PURE__ */ k("label", { className: d.wrapper, children: [
|
7702
7706
|
/* @__PURE__ */ l(
|
7703
7707
|
"input",
|
7704
7708
|
{
|
7705
7709
|
name: o,
|
7706
7710
|
checked: e,
|
7707
7711
|
type: "checkbox",
|
7708
|
-
className:
|
7709
|
-
onChange:
|
7712
|
+
className: d.input,
|
7713
|
+
onChange: g
|
7710
7714
|
}
|
7711
7715
|
),
|
7712
|
-
/* @__PURE__ */ l("div", { className:
|
7713
|
-
/* @__PURE__ */ l("span", { className:
|
7716
|
+
/* @__PURE__ */ l("div", { className: d.toggle }),
|
7717
|
+
/* @__PURE__ */ l("span", { className: d.label, children: r })
|
7714
7718
|
] });
|
7715
7719
|
};
|
7716
7720
|
/*!
|
7717
|
-
@versini/ui-toggle v5.0
|
7721
|
+
@versini/ui-toggle v5.1.0
|
7718
7722
|
© 2025 gizmette.com
|
7719
7723
|
*/
|
7720
7724
|
try {
|
7721
7725
|
window.__VERSINI_UI_TOGGLE__ || (window.__VERSINI_UI_TOGGLE__ = {
|
7722
|
-
version: "5.0
|
7723
|
-
buildTime: "09/
|
7726
|
+
version: "5.1.0",
|
7727
|
+
buildTime: "10/09/2025 09:07 PM EDT",
|
7724
7728
|
homepage: "https://github.com/aversini/ui-components",
|
7725
7729
|
license: "MIT"
|
7726
7730
|
});
|
@@ -7770,7 +7774,7 @@ const Ue = ({
|
|
7770
7774
|
children: o.confirmAction
|
7771
7775
|
}
|
7772
7776
|
) })
|
7773
|
-
] }),
|
7777
|
+
] }), g = s ? /* @__PURE__ */ k(
|
7774
7778
|
Ir,
|
7775
7779
|
{
|
7776
7780
|
alignHorizontal: "space-between",
|
@@ -7787,8 +7791,8 @@ const Ue = ({
|
|
7787
7791
|
label: s,
|
7788
7792
|
name: u || s.toLowerCase().replace(/\s+/g, "-"),
|
7789
7793
|
checked: c,
|
7790
|
-
onChange: (
|
7791
|
-
p && p(
|
7794
|
+
onChange: (f) => {
|
7795
|
+
p && p(f);
|
7792
7796
|
}
|
7793
7797
|
}
|
7794
7798
|
) }),
|
@@ -7803,7 +7807,7 @@ const Ue = ({
|
|
7803
7807
|
open: e,
|
7804
7808
|
onOpenChange: t,
|
7805
7809
|
title: o.title,
|
7806
|
-
footer:
|
7810
|
+
footer: g,
|
7807
7811
|
children: n
|
7808
7812
|
}
|
7809
7813
|
);
|
@@ -7815,7 +7819,7 @@ const Ue = ({
|
|
7815
7819
|
dispatch: n,
|
7816
7820
|
setChatId: o,
|
7817
7821
|
setInitialMessages: a
|
7818
|
-
} = te(ve), [i, s] = P(!1), [u, c] = P(!1), [p, d] = P(!1), [
|
7822
|
+
} = te(ve), [i, s] = P(!1), [u, c] = P(!1), [p, d] = P(!1), [g, f] = Qe({
|
7819
7823
|
key: Xe + ns,
|
7820
7824
|
initialValue: ""
|
7821
7825
|
}), m = Kt(jt.TOOL.MEMORIES), h = (I) => {
|
@@ -7859,7 +7863,7 @@ const Ue = ({
|
|
7859
7863
|
showConfirmation: u,
|
7860
7864
|
setShowConfirmation: c,
|
7861
7865
|
action: () => {
|
7862
|
-
i &&
|
7866
|
+
i && f("true"), h();
|
7863
7867
|
},
|
7864
7868
|
customStrings: {
|
7865
7869
|
confirmAction: "Continue",
|
@@ -7894,7 +7898,7 @@ const Ue = ({
|
|
7894
7898
|
labelRight: t ? "private" : "",
|
7895
7899
|
variant: t ? "danger" : "secondary",
|
7896
7900
|
onClick: (I) => {
|
7897
|
-
I && I.preventDefault(),
|
7901
|
+
I && I.preventDefault(), g ? r > 0 ? d(!p) : h() : c(!u);
|
7898
7902
|
},
|
7899
7903
|
className: "text-sm",
|
7900
7904
|
disabled: t && r > 0,
|
@@ -7904,7 +7908,7 @@ const Ue = ({
|
|
7904
7908
|
}
|
7905
7909
|
)
|
7906
7910
|
] });
|
7907
|
-
},
|
7911
|
+
}, Mr = ae.createContext({
|
7908
7912
|
getItemProps: () => ({}),
|
7909
7913
|
activeIndex: null,
|
7910
7914
|
/* v8 ignore next 2 */
|
@@ -7935,7 +7939,7 @@ const Ue = ({
|
|
7935
7939
|
focusMode: i = "system",
|
7936
7940
|
...s
|
7937
7941
|
}, u) => {
|
7938
|
-
const [c, p] = P(!1), [d,
|
7942
|
+
const [c, p] = P(!1), [d, g] = P(!1), [f, m] = P(null), h = J([]), v = J([]), I = te(Mr), _ = Eo(), E = Bs(), b = To(), { floatingStyles: R, refs: z, context: x } = yo({
|
7939
7943
|
nodeId: E,
|
7940
7944
|
open: c,
|
7941
7945
|
onOpenChange: (ce) => {
|
@@ -7951,14 +7955,14 @@ const Ue = ({
|
|
7951
7955
|
ignoreMouse: !1
|
7952
7956
|
}), ie = wo(x, { role: "menu" }), ke = bo(x, { bubbles: !0 }), Fe = Vs(x, {
|
7953
7957
|
listRef: h,
|
7954
|
-
activeIndex:
|
7958
|
+
activeIndex: f,
|
7955
7959
|
nested: !1,
|
7956
7960
|
onNavigate: m,
|
7957
7961
|
loop: !0
|
7958
7962
|
}), U = Fs(x, {
|
7959
7963
|
listRef: v,
|
7960
7964
|
onMatch: c ? m : void 0,
|
7961
|
-
activeIndex:
|
7965
|
+
activeIndex: f
|
7962
7966
|
}), { getReferenceProps: He, getFloatingProps: de, getItemProps: xe } = Io([A, ie, ke, Fe, U]), Je = Xn(e) === "Button" || Xn(e) === "ButtonIcon", ir = Je ? {
|
7963
7967
|
noInternalClick: Je,
|
7964
7968
|
focusMode: i,
|
@@ -7978,7 +7982,7 @@ const Ue = ({
|
|
7978
7982
|
)
|
7979
7983
|
}
|
7980
7984
|
);
|
7981
|
-
return
|
7985
|
+
return M(() => {
|
7982
7986
|
if (!_)
|
7983
7987
|
return;
|
7984
7988
|
function ce() {
|
@@ -7987,18 +7991,18 @@ const Ue = ({
|
|
7987
7991
|
return _.events.on("click", ce), () => {
|
7988
7992
|
_.events.off("click", ce);
|
7989
7993
|
};
|
7990
|
-
}, [_, o]),
|
7994
|
+
}, [_, o]), M(() => {
|
7991
7995
|
c && _ && _.events.emit("menuopen", { nodeId: E });
|
7992
7996
|
}, [_, c, E]), /* @__PURE__ */ k(Hs, { id: E, children: [
|
7993
7997
|
It,
|
7994
7998
|
/* @__PURE__ */ l(
|
7995
|
-
|
7999
|
+
Mr.Provider,
|
7996
8000
|
{
|
7997
8001
|
value: {
|
7998
|
-
activeIndex:
|
8002
|
+
activeIndex: f,
|
7999
8003
|
setActiveIndex: m,
|
8000
8004
|
getItemProps: xe,
|
8001
|
-
setHasFocusInside:
|
8005
|
+
setHasFocusInside: g,
|
8002
8006
|
isOpen: c
|
8003
8007
|
},
|
8004
8008
|
children: /* @__PURE__ */ l(Js, { elementsRef: h, labelsRef: v, children: c && /* @__PURE__ */ l(go, { children: /* @__PURE__ */ l(
|
@@ -8070,7 +8074,7 @@ try {
|
|
8070
8074
|
});
|
8071
8075
|
} catch {
|
8072
8076
|
}
|
8073
|
-
const
|
8077
|
+
const Mh = ({
|
8074
8078
|
className: e,
|
8075
8079
|
viewBox: t,
|
8076
8080
|
title: r,
|
@@ -8122,7 +8126,7 @@ const _e = ae.forwardRef(
|
|
8122
8126
|
...s
|
8123
8127
|
}, u) => {
|
8124
8128
|
let c = "";
|
8125
|
-
const p = ae.useContext(
|
8129
|
+
const p = ae.useContext(Mr), d = To({ label: t ? null : e }), g = Eo(), f = Pr([d.ref, u]);
|
8126
8130
|
if (n && o)
|
8127
8131
|
return /* @__PURE__ */ l(
|
8128
8132
|
"div",
|
@@ -8130,7 +8134,7 @@ const _e = ae.forwardRef(
|
|
8130
8134
|
role: "menuitem",
|
8131
8135
|
...p.getItemProps({
|
8132
8136
|
onClick(h) {
|
8133
|
-
a || (s.onClick?.(h),
|
8137
|
+
a || (s.onClick?.(h), g?.events.emit("click"));
|
8134
8138
|
}
|
8135
8139
|
}),
|
8136
8140
|
children: o
|
@@ -8148,21 +8152,21 @@ const _e = ae.forwardRef(
|
|
8148
8152
|
"button",
|
8149
8153
|
{
|
8150
8154
|
...s,
|
8151
|
-
ref:
|
8155
|
+
ref: f,
|
8152
8156
|
role: "menuitem",
|
8153
8157
|
className: m,
|
8154
8158
|
tabIndex: 0,
|
8155
8159
|
disabled: t,
|
8156
8160
|
...p.getItemProps({
|
8157
8161
|
onClick(h) {
|
8158
|
-
a || (s.onClick?.(h),
|
8162
|
+
a || (s.onClick?.(h), g?.events.emit("click"));
|
8159
8163
|
},
|
8160
8164
|
onFocus(h) {
|
8161
8165
|
s.onFocus?.(h), p.setHasFocusInside(!0);
|
8162
8166
|
}
|
8163
8167
|
}),
|
8164
8168
|
children: [
|
8165
|
-
i && /* @__PURE__ */ l(
|
8169
|
+
i && /* @__PURE__ */ l(Mh, { className: "mr-2", size: "size-4" }),
|
8166
8170
|
r,
|
8167
8171
|
e && /* @__PURE__ */ l("span", { className: c, children: e })
|
8168
8172
|
]
|
@@ -8171,7 +8175,7 @@ const _e = ae.forwardRef(
|
|
8171
8175
|
}
|
8172
8176
|
);
|
8173
8177
|
_e.displayName = "MenuItem";
|
8174
|
-
const
|
8178
|
+
const $h = ({ className: e, ...t }) => {
|
8175
8179
|
const r = O(e, "my-1 border-t border-border-medium");
|
8176
8180
|
return /* @__PURE__ */ l("div", { className: r, ...t });
|
8177
8181
|
}, Ua = ({
|
@@ -8209,8 +8213,8 @@ const Ph = (e) => {
|
|
8209
8213
|
const { dispatch: r, setChatId: n, setInitialMessages: o } = te(ve), { dispatch: a } = te(qr), { getAccessToken: i, user: s } = Ie(), { data: u, isSuccess: c } = er({
|
8210
8214
|
user: s?.username,
|
8211
8215
|
getAccessToken: i
|
8212
|
-
}), p = (
|
8213
|
-
|
8216
|
+
}), p = (f, m, h) => {
|
8217
|
+
f.preventDefault(), n(Pe()), o([]), r({
|
8214
8218
|
type: je,
|
8215
8219
|
payload: {
|
8216
8220
|
privateChat: h
|
@@ -8221,7 +8225,7 @@ const Ph = (e) => {
|
|
8221
8225
|
prompt: m
|
8222
8226
|
}
|
8223
8227
|
});
|
8224
|
-
}, d = c && u && u.tags && Ph(u.tags),
|
8228
|
+
}, d = c && u && u.tags && Ph(u.tags), g = /* @__PURE__ */ k(
|
8225
8229
|
sr,
|
8226
8230
|
{
|
8227
8231
|
mode: "dark",
|
@@ -8239,9 +8243,9 @@ const Ph = (e) => {
|
|
8239
8243
|
defaultPlacement: t,
|
8240
8244
|
children: [
|
8241
8245
|
/* @__PURE__ */ l(Ua, { children: "Prompts" }),
|
8242
|
-
d && u.tags.map((
|
8246
|
+
d && u.tags.map((f) => {
|
8243
8247
|
let m = null;
|
8244
|
-
switch (
|
8248
|
+
switch (f.slot) {
|
8245
8249
|
case 0:
|
8246
8250
|
m = /* @__PURE__ */ l(_i, {});
|
8247
8251
|
break;
|
@@ -8255,14 +8259,14 @@ const Ph = (e) => {
|
|
8255
8259
|
m = null;
|
8256
8260
|
break;
|
8257
8261
|
}
|
8258
|
-
return
|
8262
|
+
return f.enabled && f.label && f.content && /* @__PURE__ */ l(
|
8259
8263
|
_e,
|
8260
8264
|
{
|
8261
|
-
label:
|
8265
|
+
label: f.label,
|
8262
8266
|
icon: m,
|
8263
|
-
onClick: (h) => p(h,
|
8267
|
+
onClick: (h) => p(h, f.content, f?.privateChat)
|
8264
8268
|
},
|
8265
|
-
`prompt-button-${
|
8269
|
+
`prompt-button-${f.slot}`
|
8266
8270
|
);
|
8267
8271
|
})
|
8268
8272
|
]
|
@@ -8274,9 +8278,9 @@ const Ph = (e) => {
|
|
8274
8278
|
label: "Prompts",
|
8275
8279
|
mode: "light",
|
8276
8280
|
className: e,
|
8277
|
-
trigger:
|
8281
|
+
trigger: g
|
8278
8282
|
}
|
8279
|
-
) : /* @__PURE__ */ l("div", { className: e, children:
|
8283
|
+
) : /* @__PURE__ */ l("div", { className: e, children: g });
|
8280
8284
|
}, Zh = ({
|
8281
8285
|
className: e
|
8282
8286
|
}) => {
|
@@ -8288,7 +8292,7 @@ const Ph = (e) => {
|
|
8288
8292
|
} = te(ve), [i, s] = P(!1), [u, c] = P(!1), [p, d] = Qe({
|
8289
8293
|
key: Xe + os,
|
8290
8294
|
initialValue: ""
|
8291
|
-
}), [
|
8295
|
+
}), [g, f] = P(!1), m = (v) => {
|
8292
8296
|
o(Pe()), a([]), n({
|
8293
8297
|
type: je,
|
8294
8298
|
payload: {
|
@@ -8321,12 +8325,12 @@ const Ph = (e) => {
|
|
8321
8325
|
{
|
8322
8326
|
toggleLabel: "Don't show this again",
|
8323
8327
|
toggleName: "reasoning-disclosure",
|
8324
|
-
toggleChecked:
|
8325
|
-
onToggleChange: (v) =>
|
8328
|
+
toggleChecked: g,
|
8329
|
+
onToggleChange: (v) => f(v),
|
8326
8330
|
showConfirmation: i,
|
8327
8331
|
setShowConfirmation: s,
|
8328
8332
|
action: () => {
|
8329
|
-
|
8333
|
+
g && d("true"), m();
|
8330
8334
|
},
|
8331
8335
|
customStrings: {
|
8332
8336
|
confirmAction: "Continue",
|
@@ -8380,7 +8384,7 @@ const Ph = (e) => {
|
|
8380
8384
|
sortDirection: c.sortDirection,
|
8381
8385
|
sortedCell: c.sortedCell,
|
8382
8386
|
getAccessToken: r
|
8383
|
-
}), [d,
|
8387
|
+
}), [d, g] = P(!1), [f, m] = P(!1), h = async () => {
|
8384
8388
|
try {
|
8385
8389
|
if (u && s && a) {
|
8386
8390
|
const I = s.filter((_) => _.parts && _.parts.length > 0 ? _.parts.some(
|
@@ -8414,15 +8418,15 @@ const Ph = (e) => {
|
|
8414
8418
|
} catch {
|
8415
8419
|
}
|
8416
8420
|
}, v = (I) => {
|
8417
|
-
I && I.preventDefault(), o > 0 ? m(!
|
8421
|
+
I && I.preventDefault(), o > 0 ? m(!f) : h();
|
8418
8422
|
};
|
8419
|
-
return
|
8420
|
-
i && s?.length > 0 ?
|
8423
|
+
return M(() => {
|
8424
|
+
i && s?.length > 0 ? g(!0) : g(!1);
|
8421
8425
|
}, [i, s]), /* @__PURE__ */ k(Ae, { children: [
|
8422
|
-
|
8426
|
+
f && /* @__PURE__ */ l(
|
8423
8427
|
Ue,
|
8424
8428
|
{
|
8425
|
-
showConfirmation:
|
8429
|
+
showConfirmation: f,
|
8426
8430
|
setShowConfirmation: m,
|
8427
8431
|
action: h,
|
8428
8432
|
customStrings: {
|
@@ -8500,7 +8504,7 @@ const Ph = (e) => {
|
|
8500
8504
|
], wr = [
|
8501
8505
|
...Uh,
|
8502
8506
|
...Bh
|
8503
|
-
],
|
8507
|
+
], $r = 400 * 1024, jh = "text/plain", Vh = () => O(
|
8504
8508
|
"relative rounded-md text-base h-auto min-w-28 overflow-hidden pt-2"
|
8505
8509
|
), Qn = () => O("bg-surface-darker"), Fh = () => O("text-copy-lighter caret-copy-light"), Hh = () => O(
|
8506
8510
|
"has-[.av-prompt-editable:focus]:outline",
|
@@ -8578,7 +8582,7 @@ const Ph = (e) => {
|
|
8578
8582
|
Ut(Ba(Array.from(e))),
|
8579
8583
|
" /",
|
8580
8584
|
" ",
|
8581
|
-
Ut(
|
8585
|
+
Ut($r)
|
8582
8586
|
] })
|
8583
8587
|
] }), ja = 24, Yh = 500, Va = 2, Xh = 5, Qh = ja * Va, Kn = Xh * ja, Kh = "ready", ef = "streaming", tf = "error", rf = "submitted", Ot = (e) => {
|
8584
8588
|
e.current && (e.current.style.height = `${Qh}px`);
|
@@ -8587,8 +8591,8 @@ const Ph = (e) => {
|
|
8587
8591
|
dispatch: p,
|
8588
8592
|
state: {
|
8589
8593
|
reasoning: d,
|
8590
|
-
streaming:
|
8591
|
-
aborted:
|
8594
|
+
streaming: g,
|
8595
|
+
aborted: f,
|
8592
8596
|
lastResetTimestamp: m,
|
8593
8597
|
attachments: h,
|
8594
8598
|
provider: v,
|
@@ -8611,7 +8615,7 @@ const Ph = (e) => {
|
|
8611
8615
|
R();
|
8612
8616
|
const ne = D.message?.metadata;
|
8613
8617
|
ne?.tokenUsage && p({
|
8614
|
-
type:
|
8618
|
+
type: Ma,
|
8615
8619
|
payload: {
|
8616
8620
|
tokenUsage: ne.tokenUsage
|
8617
8621
|
}
|
@@ -8670,7 +8674,7 @@ const Ph = (e) => {
|
|
8670
8674
|
streaming: !0
|
8671
8675
|
}
|
8672
8676
|
}), D === tf && setTimeout(() => {
|
8673
|
-
|
8677
|
+
f || (p({
|
8674
8678
|
type: et,
|
8675
8679
|
payload: {
|
8676
8680
|
loading: !1,
|
@@ -8686,11 +8690,11 @@ const Ph = (e) => {
|
|
8686
8690
|
]));
|
8687
8691
|
}, 1e3);
|
8688
8692
|
},
|
8689
|
-
[p, xe,
|
8693
|
+
[p, xe, f]
|
8690
8694
|
);
|
8691
|
-
|
8695
|
+
M(() => {
|
8692
8696
|
Je && Qr(Je);
|
8693
|
-
}, [Je, Qr]),
|
8697
|
+
}, [Je, Qr]), M(() => {
|
8694
8698
|
z?.sendOnEnter !== void 0 && c(z.sendOnEnter);
|
8695
8699
|
}, [z]);
|
8696
8700
|
const cr = B(() => {
|
@@ -8713,9 +8717,9 @@ const Ph = (e) => {
|
|
8713
8717
|
(ur) => ur.name === we.name && ur.size === we.size && ur.lastModified === we.lastModified
|
8714
8718
|
) || Ce.push(we) : Ze = !0;
|
8715
8719
|
}
|
8716
|
-
if (A.current && (A.current.value = ""), Ba(Ce) >
|
8720
|
+
if (A.current && (A.current.value = ""), Ba(Ce) > $r) {
|
8717
8721
|
x.current = `Total file size exceeds the limit of ${Ut(
|
8718
|
-
|
8722
|
+
$r
|
8719
8723
|
)}.`, s(!0);
|
8720
8724
|
return;
|
8721
8725
|
}
|
@@ -8782,7 +8786,7 @@ const Ph = (e) => {
|
|
8782
8786
|
U && U.current && !ze() && U.current.focus();
|
8783
8787
|
}
|
8784
8788
|
]
|
8785
|
-
]),
|
8789
|
+
]), M(() => {
|
8786
8790
|
if (_.prompt !== "") {
|
8787
8791
|
const D = _.prompt.endsWith(":") && !_.prompt.endsWith(": ") ? _.prompt + " " : _.prompt;
|
8788
8792
|
D.indexOf(tn) !== -1 ? navigator.clipboard.readText().then((ne) => {
|
@@ -8792,19 +8796,19 @@ const Ph = (e) => {
|
|
8792
8796
|
type: ro
|
8793
8797
|
});
|
8794
8798
|
}
|
8795
|
-
}, [_, E, Re]),
|
8799
|
+
}, [_, E, Re]), M(() => {
|
8796
8800
|
if (ie.current === !1) {
|
8797
8801
|
ie.current = !0, !ce && Ot(U);
|
8798
8802
|
return;
|
8799
8803
|
}
|
8800
8804
|
m > 0 && m !== ke.current ? (ke.current = m, setTimeout(() => {
|
8801
8805
|
U.current && (!ce && Ot(U), U.current.focus());
|
8802
|
-
}, Yh)) :
|
8803
|
-
}, [m,
|
8806
|
+
}, Yh)) : g === !1 && !ce && (Ot(U), !ze() && U.current && U.current.focus());
|
8807
|
+
}, [m, g, ce]), M(() => {
|
8804
8808
|
_.lastTriggeredTimestamp && setTimeout(() => {
|
8805
8809
|
cr();
|
8806
8810
|
}, 100);
|
8807
|
-
}, [_.lastTriggeredTimestamp, cr]),
|
8811
|
+
}, [_.lastTriggeredTimestamp, cr]), M(() => {
|
8808
8812
|
h === 0 && (A.current && (A.current.value = ""), a(null));
|
8809
8813
|
}, [h]), /* @__PURE__ */ k(Ae, { children: [
|
8810
8814
|
/* @__PURE__ */ l(
|
@@ -8874,7 +8878,7 @@ const Ph = (e) => {
|
|
8874
8878
|
] })
|
8875
8879
|
] }) })
|
8876
8880
|
] });
|
8877
|
-
},
|
8881
|
+
}, Mt = "--sassy-bottom", of = ({ isComponent: e }) => {
|
8878
8882
|
const {
|
8879
8883
|
state: { loading: t, streaming: r, restoring: n }
|
8880
8884
|
} = te(ve), {
|
@@ -8882,21 +8886,21 @@ const Ph = (e) => {
|
|
8882
8886
|
dispatch: i
|
8883
8887
|
} = te(Yr), [s] = P(
|
8884
8888
|
() => an[Math.floor(Math.random() * an.length)]
|
8885
|
-
), { messages: u } = Ve(), { height: c } = ri(), { height: p } = ni(), [d,
|
8886
|
-
const I =
|
8887
|
-
return h > 70 && h < 500 ?
|
8888
|
-
}, [h,
|
8889
|
-
return
|
8890
|
-
o !==
|
8889
|
+
), { messages: u } = Ve(), { height: c } = ri(), { height: p } = ni(), [d, g] = so(), f = tt(() => ze(), []), m = tt(() => ms(), []), h = c - p, v = tt(() => {
|
8890
|
+
const I = f ? hs : m ? fs : io;
|
8891
|
+
return h > 70 && h < 500 ? f ? sn / 2 : sn : I;
|
8892
|
+
}, [h, f, m]);
|
8893
|
+
return M(() => {
|
8894
|
+
o !== g.height && i({
|
8891
8895
|
type: Oa,
|
8892
8896
|
payload: {
|
8893
|
-
footerHeight:
|
8897
|
+
footerHeight: g.height
|
8894
8898
|
}
|
8895
8899
|
});
|
8896
|
-
}, [
|
8900
|
+
}, [g.height, o, i]), M(() => {
|
8897
8901
|
if (!d || !d.current)
|
8898
8902
|
return;
|
8899
|
-
const I = d?.current?.style.getPropertyValue(
|
8903
|
+
const I = d?.current?.style.getPropertyValue(Mt);
|
8900
8904
|
if (a === Qt && (t && !r || n) && I !== `${v}px` && (i({
|
8901
8905
|
type: Zt,
|
8902
8906
|
payload: {
|
@@ -8904,7 +8908,7 @@ const Ph = (e) => {
|
|
8904
8908
|
footerOffset: v
|
8905
8909
|
}
|
8906
8910
|
}), d.current.style.setProperty(
|
8907
|
-
|
8911
|
+
Mt,
|
8908
8912
|
`${v}px`
|
8909
8913
|
)), a === dt && I !== `${v}px` && (i({
|
8910
8914
|
type: Zt,
|
@@ -8913,10 +8917,10 @@ const Ph = (e) => {
|
|
8913
8917
|
footerOffset: v
|
8914
8918
|
}
|
8915
8919
|
}), d.current.style.setProperty(
|
8916
|
-
|
8920
|
+
Mt,
|
8917
8921
|
`${v}px`
|
8918
|
-
)), !t && !r && !n && u.length === 0 && c > 0 &&
|
8919
|
-
const _ = `${c -
|
8922
|
+
)), !t && !r && !n && u.length === 0 && c > 0 && g.height > 0) {
|
8923
|
+
const _ = `${c - g.height - (e ? 300 : 245)}`;
|
8920
8924
|
I !== `${_}px` && Number(_) > 0 && (i({
|
8921
8925
|
type: Zt,
|
8922
8926
|
payload: {
|
@@ -8924,7 +8928,7 @@ const Ph = (e) => {
|
|
8924
8928
|
footerOffset: Number(_)
|
8925
8929
|
}
|
8926
8930
|
}), d?.current?.style.setProperty(
|
8927
|
-
|
8931
|
+
Mt,
|
8928
8932
|
`${_}px`
|
8929
8933
|
));
|
8930
8934
|
}
|
@@ -8936,7 +8940,7 @@ const Ph = (e) => {
|
|
8936
8940
|
e,
|
8937
8941
|
u,
|
8938
8942
|
c,
|
8939
|
-
|
8943
|
+
g.height,
|
8940
8944
|
a,
|
8941
8945
|
v,
|
8942
8946
|
i
|
@@ -8955,7 +8959,7 @@ const Ph = (e) => {
|
|
8955
8959
|
] })
|
8956
8960
|
}
|
8957
8961
|
);
|
8958
|
-
},
|
8962
|
+
}, $t = [
|
8959
8963
|
{
|
8960
8964
|
id: gs,
|
8961
8965
|
label: "OpenAI",
|
@@ -8979,16 +8983,16 @@ const Ph = (e) => {
|
|
8979
8983
|
setInitialMessages: o
|
8980
8984
|
} = te(ve), { getAccessToken: a, user: i } = Ie(), { status: s } = Ve(), [u, c] = P(!1), p = B(() => {
|
8981
8985
|
u || (Lm(), c(!0));
|
8982
|
-
}, [u]), { isSuccess: d, refetch:
|
8986
|
+
}, [u]), { isSuccess: d, refetch: g, data: f } = er({
|
8983
8987
|
user: i?.username,
|
8984
8988
|
getAccessToken: a
|
8985
8989
|
}), m = async (_) => {
|
8986
8990
|
try {
|
8987
|
-
n(Pe()), o([]), _ !==
|
8991
|
+
n(Pe()), o([]), _ !== f?.provider && (await _s({
|
8988
8992
|
provider: _,
|
8989
8993
|
accessToken: await a(),
|
8990
8994
|
username: i?.username || ""
|
8991
|
-
}),
|
8995
|
+
}), g(), await Xt(`${bs} ${_}`, {
|
8992
8996
|
containerId: "toggle-provider"
|
8993
8997
|
})), t({
|
8994
8998
|
type: je,
|
@@ -8998,7 +9002,7 @@ const Ph = (e) => {
|
|
8998
9002
|
});
|
8999
9003
|
} catch {
|
9000
9004
|
}
|
9001
|
-
}, h =
|
9005
|
+
}, h = f && d, v = h && $t.find((_) => f.provider === _.id)?.icon || $t[0].icon, I = /* @__PURE__ */ k(
|
9002
9006
|
sr,
|
9003
9007
|
{
|
9004
9008
|
mode: "dark",
|
@@ -9024,10 +9028,10 @@ const Ph = (e) => {
|
|
9024
9028
|
defaultPlacement: "top-start",
|
9025
9029
|
children: [
|
9026
9030
|
/* @__PURE__ */ l(Ua, { children: "Providers" }),
|
9027
|
-
h &&
|
9031
|
+
h && $t.map((_) => /* @__PURE__ */ l(
|
9028
9032
|
_e,
|
9029
9033
|
{
|
9030
|
-
selected:
|
9034
|
+
selected: f.provider === _.id,
|
9031
9035
|
label: _.label,
|
9032
9036
|
icon: /* @__PURE__ */ l(_.icon, {}),
|
9033
9037
|
onClick: () => m(_.id)
|
@@ -9050,38 +9054,38 @@ const Ph = (e) => {
|
|
9050
9054
|
}, sf = Ee(
|
9051
9055
|
() => import(
|
9052
9056
|
/* webpackChunkName: "modal-chunk" */
|
9053
|
-
"./ProfileEntry.
|
9057
|
+
"./ProfileEntry.Dno0c0_1.js"
|
9054
9058
|
).then((e) => ({
|
9055
9059
|
default: e.Profile
|
9056
9060
|
}))
|
9057
9061
|
), cf = Ee(
|
9058
9062
|
() => import(
|
9059
9063
|
/* webpackChunkName: "modal-chunk" */
|
9060
|
-
"./SettingsEntry.
|
9064
|
+
"./SettingsEntry.IGOE-6JU.js"
|
9061
9065
|
).then((e) => ({
|
9062
9066
|
default: e.SettingsPanel
|
9063
9067
|
}))
|
9064
9068
|
), lf = Ee(
|
9065
9069
|
() => import(
|
9066
9070
|
/* webpackChunkName: "modal-chunk" */
|
9067
|
-
"./HistoryEntry.
|
9071
|
+
"./HistoryEntry.Dh5bLuYX.js"
|
9068
9072
|
).then((e) => ({
|
9069
9073
|
default: e.HistoryPanel
|
9070
9074
|
}))
|
9071
9075
|
), uf = Ee(
|
9072
9076
|
() => import(
|
9073
9077
|
/* webpackChunkName: "modal-chunk" */
|
9074
|
-
"./AboutEntry.
|
9078
|
+
"./AboutEntry.DC6pIWQs.js"
|
9075
9079
|
).then((e) => ({ default: e.About }))
|
9076
9080
|
), df = Ee(
|
9077
9081
|
() => import(
|
9078
9082
|
/* webpackChunkName: "modal-chunk" */
|
9079
|
-
"./UsageEntry.
|
9083
|
+
"./UsageEntry.BStP6ETh.js"
|
9080
9084
|
).then((e) => ({ default: e.Usage }))
|
9081
9085
|
), pf = Ee(
|
9082
9086
|
() => import(
|
9083
9087
|
/* webpackChunkName: "modal-chunk" */
|
9084
|
-
"./UserMemoriesPanel.
|
9088
|
+
"./UserMemoriesPanel.w335l_3o.js"
|
9085
9089
|
).then(
|
9086
9090
|
(e) => ({ default: e.default })
|
9087
9091
|
)
|
@@ -9122,34 +9126,34 @@ const Ph = (e) => {
|
|
9122
9126
|
i || Promise.all([
|
9123
9127
|
import(
|
9124
9128
|
/* webpackChunkName: "modal-chunk" */
|
9125
|
-
"./ProfileEntry.
|
9129
|
+
"./ProfileEntry.Dno0c0_1.js"
|
9126
9130
|
),
|
9127
9131
|
import(
|
9128
9132
|
/* webpackChunkName: "modal-chunk" */
|
9129
|
-
"./SettingsEntry.
|
9133
|
+
"./SettingsEntry.IGOE-6JU.js"
|
9130
9134
|
),
|
9131
9135
|
import(
|
9132
9136
|
/* webpackChunkName: "modal-chunk" */
|
9133
|
-
"./HistoryEntry.
|
9137
|
+
"./HistoryEntry.Dh5bLuYX.js"
|
9134
9138
|
),
|
9135
9139
|
import(
|
9136
9140
|
/* webpackChunkName: "modal-chunk" */
|
9137
|
-
"./AboutEntry.
|
9141
|
+
"./AboutEntry.DC6pIWQs.js"
|
9138
9142
|
),
|
9139
9143
|
import(
|
9140
9144
|
/* webpackChunkName: "modal-chunk" */
|
9141
|
-
"./UsageEntry.
|
9145
|
+
"./UsageEntry.BStP6ETh.js"
|
9142
9146
|
)
|
9143
9147
|
]).finally(() => s(!0));
|
9144
9148
|
}, [i]), p = B((m) => {
|
9145
9149
|
n(m);
|
9146
9150
|
}, []), d = B(() => {
|
9147
9151
|
n(null);
|
9148
|
-
}, []),
|
9152
|
+
}, []), g = B(() => {
|
9149
9153
|
p("settings");
|
9150
9154
|
}, [p]);
|
9151
|
-
Za("openSettings",
|
9152
|
-
const
|
9155
|
+
Za("openSettings", g);
|
9156
|
+
const f = () => {
|
9153
9157
|
a(!o);
|
9154
9158
|
};
|
9155
9159
|
return Rr(
|
@@ -9272,12 +9276,12 @@ const Ph = (e) => {
|
|
9272
9276
|
}
|
9273
9277
|
),
|
9274
9278
|
!e && /* @__PURE__ */ k(Ae, { children: [
|
9275
|
-
/* @__PURE__ */ l(
|
9279
|
+
/* @__PURE__ */ l($h, {}),
|
9276
9280
|
/* @__PURE__ */ l(
|
9277
9281
|
_e,
|
9278
9282
|
{
|
9279
9283
|
label: "Log out",
|
9280
|
-
onClick:
|
9284
|
+
onClick: f,
|
9281
9285
|
icon: /* @__PURE__ */ l("div", { className: "text-red-700", children: /* @__PURE__ */ l(si, { monotone: !0 }) })
|
9282
9286
|
}
|
9283
9287
|
)
|
@@ -9384,18 +9388,18 @@ try {
|
|
9384
9388
|
} catch {
|
9385
9389
|
}
|
9386
9390
|
const vf = Ee(
|
9387
|
-
() => import("./index.
|
9391
|
+
() => import("./index.CVdabB4A.js").then((e) => ({ default: e.Bubble }))
|
9388
9392
|
), Xr = (e) => /* @__PURE__ */ l(Vt, { fallback: /* @__PURE__ */ l("span", { className: "inline-block" }), children: /* @__PURE__ */ l(vf, { ...e }) });
|
9389
9393
|
Xr.displayName = "AsyncBubble";
|
9390
9394
|
const to = 1, yf = 150, _f = Ee(
|
9391
9395
|
() => import(
|
9392
9396
|
/* webpackChunkName: "LazyMessageAssistant" */
|
9393
|
-
"./ChatBubbleAssistant.
|
9397
|
+
"./ChatBubbleAssistant.CyJgR8J8.js"
|
9394
9398
|
)
|
9395
9399
|
), bf = Ee(
|
9396
9400
|
() => import(
|
9397
9401
|
/* webpackChunkName: "LazyMessageUser" */
|
9398
|
-
"./ChatBubbleUser.
|
9402
|
+
"./ChatBubbleUser.tWOit_f_.js"
|
9399
9403
|
)
|
9400
9404
|
), wf = ot.memo(
|
9401
9405
|
({
|
@@ -9409,15 +9413,15 @@ const to = 1, yf = 150, _f = Ee(
|
|
9409
9413
|
const [i, s] = P(!0), u = J(Date.now()), [c] = P(
|
9410
9414
|
() => o && (a === "streaming" || a === "submitted")
|
9411
9415
|
);
|
9412
|
-
return
|
9416
|
+
return M(() => {
|
9413
9417
|
if (o && i && t && t.trim().length >= to) {
|
9414
|
-
const d = Date.now() - u.current,
|
9415
|
-
if (
|
9416
|
-
const
|
9418
|
+
const d = Date.now() - u.current, g = yf - d;
|
9419
|
+
if (g > 0) {
|
9420
|
+
const f = setTimeout(
|
9417
9421
|
() => s(!1),
|
9418
|
-
|
9422
|
+
g
|
9419
9423
|
);
|
9420
|
-
return () => clearTimeout(
|
9424
|
+
return () => clearTimeout(f);
|
9421
9425
|
}
|
9422
9426
|
s(!1);
|
9423
9427
|
}
|
@@ -9485,7 +9489,7 @@ const Tf = () => {
|
|
9485
9489
|
state: { footerPosition: a, footerHeight: i, footerOffset: s }
|
9486
9490
|
} = te(Yr), {
|
9487
9491
|
state: { loading: u }
|
9488
|
-
} = te(ve), { messages: c } = Ve(), p = J(0), { data: d, isSuccess:
|
9492
|
+
} = te(ve), { messages: c } = Ve(), p = J(0), { data: d, isSuccess: g } = ws(), f = Is({
|
9489
9493
|
isAuthenticated: e,
|
9490
9494
|
extraClass: "rounded-b-md relative border-b-16 border-slate-900"
|
9491
9495
|
}), m = Er() ? "mt-4" : "", h = B(() => {
|
@@ -9494,17 +9498,17 @@ const Tf = () => {
|
|
9494
9498
|
block: "end"
|
9495
9499
|
});
|
9496
9500
|
}, []);
|
9497
|
-
return
|
9501
|
+
return M(() => {
|
9498
9502
|
u && h();
|
9499
|
-
}, [u, h]),
|
9503
|
+
}, [u, h]), M(() => {
|
9500
9504
|
p.current = a === dt ? i + s + lo + Es + 15 : 0;
|
9501
9505
|
}, [a, i, s]), /* @__PURE__ */ k(Ae, { children: [
|
9502
|
-
/* @__PURE__ */ k("div", { className:
|
9506
|
+
/* @__PURE__ */ k("div", { className: f, ref: n, children: [
|
9503
9507
|
/* @__PURE__ */ l(
|
9504
9508
|
Ts,
|
9505
9509
|
{
|
9506
9510
|
className: m,
|
9507
|
-
isCapabilitiesSuccess:
|
9511
|
+
isCapabilitiesSuccess: g,
|
9508
9512
|
capabilities: d
|
9509
9513
|
}
|
9510
9514
|
),
|
@@ -9534,10 +9538,10 @@ function Ha({
|
|
9534
9538
|
isComponent: e = !1,
|
9535
9539
|
headerHeight: t = 0
|
9536
9540
|
}) {
|
9537
|
-
const { user: r, getAccessToken: n } = Ie(), [o, a] = P(`${un}px`), [i, s] = so(), [u, c] = P(Pe()), [p, d] = P([]), [
|
9541
|
+
const { user: r, getAccessToken: n } = Ie(), [o, a] = P(`${un}px`), [i, s] = so(), [u, c] = P(Pe()), [p, d] = P([]), [g] = Qe({
|
9538
9542
|
key: Xe + zs,
|
9539
9543
|
initialValue: ""
|
9540
|
-
}), [
|
9544
|
+
}), [f] = Qe({
|
9541
9545
|
key: Xe + Ns,
|
9542
9546
|
initialValue: dn
|
9543
9547
|
}), [m] = Qe({
|
@@ -9554,10 +9558,10 @@ function Ha({
|
|
9554
9558
|
const de = ze(), xe = Ss();
|
9555
9559
|
return de && xe ? "mt-1" : "mt-5";
|
9556
9560
|
}, []), R = {
|
9557
|
-
searchString:
|
9558
|
-
sortedCell:
|
9561
|
+
searchString: g,
|
9562
|
+
sortedCell: f,
|
9559
9563
|
sortDirection: (() => {
|
9560
|
-
switch (
|
9564
|
+
switch (f) {
|
9561
9565
|
case Cs:
|
9562
9566
|
return h;
|
9563
9567
|
case dn:
|
@@ -9594,19 +9598,19 @@ function Ha({
|
|
9594
9598
|
username: r?.username
|
9595
9599
|
}
|
9596
9600
|
}), [r?.username]);
|
9597
|
-
return
|
9601
|
+
return M(() => {
|
9598
9602
|
document.getElementById("root")?.classList.replace("app-hidden", "fadeIn");
|
9599
|
-
}, []),
|
9603
|
+
}, []), M(() => {
|
9600
9604
|
U && U.provider && Fe({
|
9601
|
-
type:
|
9605
|
+
type: $a,
|
9602
9606
|
payload: {
|
9603
9607
|
provider: U.provider
|
9604
9608
|
}
|
9605
9609
|
});
|
9606
|
-
}, [U]),
|
9610
|
+
}, [U]), M(() => {
|
9607
9611
|
try {
|
9608
9612
|
const de = sessionStorage.getItem("sw-toggle-pending");
|
9609
|
-
de && (de === "enabled" ? Xt(
|
9613
|
+
de && (de === "enabled" ? Xt(Ms, { containerId: "toggle-save" }) : de === "disabled" && Xt($s, {
|
9610
9614
|
containerId: "toggle-save"
|
9611
9615
|
}), sessionStorage.removeItem("sw-toggle-pending"));
|
9612
9616
|
} catch {
|
@@ -9690,20 +9694,19 @@ function Ha({
|
|
9690
9694
|
);
|
9691
9695
|
}
|
9692
9696
|
Ha.displayName = "App";
|
9693
|
-
const
|
9697
|
+
const Mf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Ha }, Symbol.toStringTag, { value: "Module" }));
|
9694
9698
|
export {
|
9695
|
-
|
9699
|
+
Mf as App,
|
9696
9700
|
Xr as AsyncBubble,
|
9697
9701
|
gf as ButtonScroll,
|
9698
|
-
|
9702
|
+
$a as CHAT_SET_PROVIDER,
|
9699
9703
|
et as CHAT_SET_STATUS,
|
9700
9704
|
ve as ChatContext,
|
9701
9705
|
Ue as ConfirmationPanel,
|
9702
9706
|
Qe as E,
|
9703
9707
|
Wr as HistoryContext,
|
9704
|
-
zh as L,
|
9705
9708
|
Gn as LazyToastContainerWrapper,
|
9706
|
-
|
9709
|
+
zh as O,
|
9707
9710
|
rt as e,
|
9708
9711
|
Fm as getDefaultExportFromCjs,
|
9709
9712
|
Ks as p,
|