@versini/sassysaint 1.0.11 → 1.0.13
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/{App.CILpzJEh.js → App.WT_JMB-P.js} +212 -213
- package/dist/chunks/LazyHeader.CDeNMEns.js +1280 -0
- package/dist/chunks/{LazyMarkdownWithExtra.BPTMdcU8.js → LazyMarkdownWithExtra.JlXLVBc-.js} +1 -1
- package/dist/chunks/{LazyMessageAssistant.IDa3mLgE.js → LazyMessageAssistant.Ct8xA2HE.js} +4 -4
- package/dist/chunks/{index.eFSALEqy.js → index.CJJY2C9o.js} +1116 -1085
- package/dist/chunks/{index.BcV6McvW.U50izDOU.js → index.DbAx5fhD.DTsRcXtK.js} +14 -14
- package/dist/chunks/{useLocalStorage.CsBq2ZMB.js → useLocalStorage.CzVJ5Eng.js} +13 -14
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +6 -6
- package/dist/chunks/LazyHeader.YhIHsK0M.js +0 -1288
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { O as Be, s as Ve, S as De, f$1 as $e, M as ze, U as Ue, r as Fe, o as Pe, n as
|
|
3
|
-
import { g as
|
|
4
|
-
import pr, { useState as
|
|
1
|
+
import { jsxs as E, jsx as n, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { O as Be, s as Ve, S as De, f$1 as $e, M as ze, U as Ue, r as Fe, o as Pe, n as fe, l as Ge, a as q, isLastMessageFromRole as he, x as xe, CANCEL as je, CLEAR as We, ACTION_RESET as be, ROLE_ASSISTANT as M, ROLE_INTERNAL as Z, ROLE_USER as K, Wr as ee, ROLE_SYSTEM as Ye, ROLE_HIDDEN as qe, MODEL_GPT4 as ke, STATS_SEPARATOR as le, ACTION_MODEL as Ce, ACTION_MESSAGE as V, TYPE_QUESTION as Je, SEND as Qe, ACTION_STREAMING as Te, ERROR_MESSAGE as Xe, getMessageContaintWrapperClass as Ke, MessagesContainerHeader as Ze, ACTION_SEARCH as er, ACTION_SORT as rr, ACTION_RESTORE as tr, ACTION_LOCATION as B, getCurrentGeoLocation as or, c as sr, AppFooter as ar, LOCAL_STORAGE_PREFIX as J, LOCAL_STORAGE_SEARCH as nr, LOCAL_STORAGE_SORT as lr, LOCAL_STORAGE_LOCATION as cr } from "./index.CJJY2C9o.js";
|
|
3
|
+
import { g as ve, AppContext as P, restCall as ir, E as Q, serviceCall as ce, SERVICE_TYPES as ie, HistoryContext as dr, k as ur } from "./useLocalStorage.CzVJ5Eng.js";
|
|
4
|
+
import pr, { useState as I, useEffect as S, useRef as x, useLayoutEffect as z, useContext as re, lazy as mr, Suspense as de, useReducer as ue, useCallback as gr } from "react";
|
|
5
5
|
import g from "clsx";
|
|
6
6
|
const yr = ({
|
|
7
7
|
className: e,
|
|
@@ -10,8 +10,8 @@ const yr = ({
|
|
|
10
10
|
title: t,
|
|
11
11
|
monotone: s,
|
|
12
12
|
...a
|
|
13
|
-
}) => /* @__PURE__ */
|
|
14
|
-
|
|
13
|
+
}) => /* @__PURE__ */ E(
|
|
14
|
+
ve,
|
|
15
15
|
{
|
|
16
16
|
defaultViewBox: "0 0 448 512",
|
|
17
17
|
defaultClassName: "size-5",
|
|
@@ -39,7 +39,7 @@ const yr = ({
|
|
|
39
39
|
monotone: s,
|
|
40
40
|
...a
|
|
41
41
|
}) => /* @__PURE__ */ n(
|
|
42
|
-
|
|
42
|
+
ve,
|
|
43
43
|
{
|
|
44
44
|
defaultViewBox: "0 0 512 512",
|
|
45
45
|
defaultClassName: "size-5",
|
|
@@ -101,27 +101,27 @@ const yr = ({
|
|
|
101
101
|
copyToClipboardMode: h = "system",
|
|
102
102
|
spacing: c
|
|
103
103
|
}) => {
|
|
104
|
-
const [y, i] =
|
|
104
|
+
const [y, i] = I(!1), u = Cr({ kind: r, className: o, spacing: c }), b = !!a && (typeof a == "function" || typeof a == "string" || typeof e == "string"), v = () => {
|
|
105
105
|
i(!0), typeof a == "function" ? a(e) : typeof a == "string" ? navigator.clipboard.writeText(a) : typeof e == "string" && navigator.clipboard.writeText(e);
|
|
106
106
|
};
|
|
107
|
-
return
|
|
107
|
+
return S(() => {
|
|
108
108
|
let d;
|
|
109
109
|
return y && (d = window.setTimeout(() => {
|
|
110
110
|
i(!1);
|
|
111
111
|
}, 3e3)), () => {
|
|
112
112
|
clearTimeout(d);
|
|
113
113
|
};
|
|
114
|
-
}, [y]), /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */ n("div", { className:
|
|
117
|
-
t && Object.keys(t).map((d) => t[d] ? /* @__PURE__ */ n("div", { className: "prose-p:m-0", children: /* @__PURE__ */
|
|
114
|
+
}, [y]), /* @__PURE__ */ E("div", { className: u.wrapper, children: [
|
|
115
|
+
/* @__PURE__ */ E("div", { children: [
|
|
116
|
+
/* @__PURE__ */ n("div", { className: u.main, children: e }),
|
|
117
|
+
t && Object.keys(t).map((d) => t[d] ? /* @__PURE__ */ n("div", { className: "prose-p:m-0", children: /* @__PURE__ */ E("p", { className: u.footer, children: [
|
|
118
118
|
d,
|
|
119
119
|
": ",
|
|
120
120
|
t[d]
|
|
121
121
|
] }) }, `-${d}`) : null),
|
|
122
122
|
s && s
|
|
123
123
|
] }),
|
|
124
|
-
b && /* @__PURE__ */ n("div", { className:
|
|
124
|
+
b && /* @__PURE__ */ n("div", { className: u.copyButton, children: /* @__PURE__ */ n(
|
|
125
125
|
Be,
|
|
126
126
|
{
|
|
127
127
|
noBorder: !0,
|
|
@@ -130,7 +130,7 @@ const yr = ({
|
|
|
130
130
|
mode: h,
|
|
131
131
|
focusMode: l,
|
|
132
132
|
label: y ? "Copied to clipboard" : "Copy to clipboard",
|
|
133
|
-
onClick:
|
|
133
|
+
onClick: v,
|
|
134
134
|
disabled: y,
|
|
135
135
|
children: y ? /* @__PURE__ */ n(yr, { className: "size-3" }) : /* @__PURE__ */ n(fr, { className: "size-3" })
|
|
136
136
|
}
|
|
@@ -144,14 +144,14 @@ function vr({
|
|
|
144
144
|
onChange: t = () => {
|
|
145
145
|
}
|
|
146
146
|
}) {
|
|
147
|
-
const [s, a] =
|
|
147
|
+
const [s, a] = I(
|
|
148
148
|
r !== void 0 ? r : o
|
|
149
149
|
);
|
|
150
150
|
return e !== void 0 ? [e, t, !0] : [s, (l) => {
|
|
151
151
|
a(l), t == null || t(l);
|
|
152
152
|
}, !1];
|
|
153
153
|
}
|
|
154
|
-
const
|
|
154
|
+
const Nr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", Ar = ({
|
|
155
155
|
mode: e
|
|
156
156
|
}) => g({
|
|
157
157
|
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
|
@@ -165,7 +165,7 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
165
165
|
"focus:outline-focus-light": e === "light",
|
|
166
166
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
167
167
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
168
|
-
}),
|
|
168
|
+
}), Or = ({
|
|
169
169
|
noBorder: e,
|
|
170
170
|
error: r
|
|
171
171
|
}) => g("border-2", {
|
|
@@ -173,7 +173,7 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
173
173
|
"focus:border-border-dark": !e && r,
|
|
174
174
|
"border-border-error-dark": !e && r,
|
|
175
175
|
"border-transparent": e
|
|
176
|
-
}),
|
|
176
|
+
}), Sr = ({
|
|
177
177
|
disabled: e,
|
|
178
178
|
raw: r,
|
|
179
179
|
error: o,
|
|
@@ -207,18 +207,18 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
207
207
|
return "";
|
|
208
208
|
if (t)
|
|
209
209
|
return g(
|
|
210
|
-
|
|
210
|
+
q,
|
|
211
211
|
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
212
212
|
);
|
|
213
213
|
if (!e)
|
|
214
|
-
return g(
|
|
214
|
+
return g(q, "absolute px-2 font-medium", {
|
|
215
215
|
"text-copy-medium": o === "dark",
|
|
216
216
|
"text-copy-dark": o === "light",
|
|
217
217
|
"text-copy-dark dark:text-copy-medium": o === "system",
|
|
218
218
|
"text-copy-medium dark:text-copy-dark": o === "alt-system"
|
|
219
219
|
});
|
|
220
220
|
if (e)
|
|
221
|
-
return g(
|
|
221
|
+
return g(q, "absolute px-2 font-medium", {
|
|
222
222
|
"text-copy-error-light": o === "dark",
|
|
223
223
|
"text-copy-error-dark": o === "light",
|
|
224
224
|
"text-copy-error-dark dark:text-copy-error-light": o === "system",
|
|
@@ -241,24 +241,24 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
241
241
|
e,
|
|
242
242
|
Pe(h)
|
|
243
243
|
), i = o ? g(r) : g(
|
|
244
|
-
|
|
244
|
+
fe,
|
|
245
245
|
r,
|
|
246
|
-
|
|
246
|
+
Nr(),
|
|
247
247
|
Ar({ mode: c }),
|
|
248
248
|
Er({ focusMode: t }),
|
|
249
|
-
|
|
249
|
+
Or({
|
|
250
250
|
noBorder: a,
|
|
251
251
|
error: l
|
|
252
252
|
}),
|
|
253
253
|
{
|
|
254
254
|
"disabled:cursor-not-allowed disabled:opacity-50": s
|
|
255
255
|
}
|
|
256
|
-
),
|
|
256
|
+
), u = o ? void 0 : "sr-only", b = Sr({
|
|
257
257
|
disabled: s,
|
|
258
258
|
raw: o,
|
|
259
259
|
error: l,
|
|
260
260
|
mode: c
|
|
261
|
-
}),
|
|
261
|
+
}), v = wr({
|
|
262
262
|
error: l,
|
|
263
263
|
raw: o,
|
|
264
264
|
mode: c,
|
|
@@ -267,9 +267,9 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
267
267
|
return {
|
|
268
268
|
wrapper: y,
|
|
269
269
|
textArea: i,
|
|
270
|
-
accessibleLabel:
|
|
270
|
+
accessibleLabel: u,
|
|
271
271
|
visibleLabel: b,
|
|
272
|
-
helperText:
|
|
272
|
+
helperText: v,
|
|
273
273
|
rightElement: d
|
|
274
274
|
};
|
|
275
275
|
}, Rr = ({
|
|
@@ -288,7 +288,7 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
288
288
|
helperTextOffset: a,
|
|
289
289
|
scrollHeight: e
|
|
290
290
|
};
|
|
291
|
-
},
|
|
291
|
+
}, Ne = pr.forwardRef(
|
|
292
292
|
({
|
|
293
293
|
id: e,
|
|
294
294
|
name: r,
|
|
@@ -301,35 +301,35 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
301
301
|
focusMode: c = "system",
|
|
302
302
|
value: y,
|
|
303
303
|
defaultValue: i,
|
|
304
|
-
disabled:
|
|
304
|
+
disabled: u = !1,
|
|
305
305
|
noBorder: b = !1,
|
|
306
|
-
labelId:
|
|
306
|
+
labelId: v,
|
|
307
307
|
helperText: d = "",
|
|
308
|
-
helperTextOnFocus:
|
|
309
|
-
rightElement:
|
|
310
|
-
onChange:
|
|
311
|
-
onFocus:
|
|
312
|
-
onBlur:
|
|
313
|
-
spacing:
|
|
314
|
-
...
|
|
315
|
-
},
|
|
316
|
-
const
|
|
317
|
-
!!(!
|
|
318
|
-
), Le = `${r} error, ${d}`,
|
|
308
|
+
helperTextOnFocus: w = !1,
|
|
309
|
+
rightElement: T,
|
|
310
|
+
onChange: p,
|
|
311
|
+
onFocus: C,
|
|
312
|
+
onBlur: L,
|
|
313
|
+
spacing: N,
|
|
314
|
+
...D
|
|
315
|
+
}, m) => {
|
|
316
|
+
const A = x(null), Ee = $e([m, A]), $ = x(null), G = x(80), oe = x(-25), _ = x(null), se = x(30), j = x(null), H = ze({ id: e, prefix: `${fe}-` }), [Oe, Se] = I(0), [we, ae] = I(
|
|
317
|
+
!!(!w && d)
|
|
318
|
+
), Le = `${r} error, ${d}`, R = Lr({
|
|
319
319
|
className: a,
|
|
320
320
|
textAreaClassName: l,
|
|
321
321
|
error: t,
|
|
322
322
|
raw: s,
|
|
323
323
|
focusMode: c,
|
|
324
|
-
disabled:
|
|
324
|
+
disabled: u,
|
|
325
325
|
noBorder: b,
|
|
326
|
-
spacing:
|
|
326
|
+
spacing: N,
|
|
327
327
|
mode: h
|
|
328
|
-
}), [
|
|
328
|
+
}), [O, Re] = vr({
|
|
329
329
|
value: y,
|
|
330
330
|
defaultValue: i,
|
|
331
331
|
onChange: (k) => {
|
|
332
|
-
|
|
332
|
+
p && p({
|
|
333
333
|
target: {
|
|
334
334
|
value: k
|
|
335
335
|
}
|
|
@@ -338,46 +338,46 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
338
338
|
}), Me = (k) => {
|
|
339
339
|
Re(k.target.value);
|
|
340
340
|
}, Ie = (k) => {
|
|
341
|
-
|
|
341
|
+
w && d && ae(!0), C && C(k);
|
|
342
342
|
}, _e = (k) => {
|
|
343
|
-
|
|
343
|
+
w && d && !O && ae(!1), L && L(k);
|
|
344
344
|
};
|
|
345
|
-
return
|
|
346
|
-
!s &&
|
|
347
|
-
}, [
|
|
348
|
-
s ||
|
|
349
|
-
}, [
|
|
345
|
+
return z(() => {
|
|
346
|
+
!s && T && $.current && $.current.offsetWidth > 0 && Se($.current.offsetWidth + 18 + 10);
|
|
347
|
+
}, [T, s]), z(() => {
|
|
348
|
+
s || A && A.current && O !== void 0 && (A.current.style.height = "inherit", A.current.style.height = A.current.scrollHeight + "px");
|
|
349
|
+
}, [O, s]), z(() => {
|
|
350
350
|
s || setTimeout(() => {
|
|
351
351
|
var k;
|
|
352
|
-
(k =
|
|
352
|
+
(k = _ == null ? void 0 : _.current) == null || k.style.setProperty(
|
|
353
353
|
"--av-text-area-wrapper-transition",
|
|
354
|
-
|
|
354
|
+
O ? "none" : "all 0.2s ease-out"
|
|
355
355
|
);
|
|
356
356
|
}, 0);
|
|
357
|
-
}, [
|
|
358
|
-
var k,
|
|
359
|
-
if (!s &&
|
|
360
|
-
const { labelOffset:
|
|
361
|
-
scrollHeight:
|
|
362
|
-
currentHeight:
|
|
363
|
-
currentLabelOffset:
|
|
364
|
-
currentHelperTextOffset:
|
|
357
|
+
}, [O, s]), z(() => {
|
|
358
|
+
var k, ne;
|
|
359
|
+
if (!s && A && A.current && O !== void 0) {
|
|
360
|
+
const { labelOffset: W, helperTextOffset: Y, scrollHeight: He } = Rr({
|
|
361
|
+
scrollHeight: A.current.scrollHeight,
|
|
362
|
+
currentHeight: G.current,
|
|
363
|
+
currentLabelOffset: oe.current,
|
|
364
|
+
currentHelperTextOffset: se.current
|
|
365
365
|
});
|
|
366
|
-
|
|
366
|
+
W && (oe.current = W, (k = _ == null ? void 0 : _.current) == null || k.style.setProperty(
|
|
367
367
|
"--av-text-area-label",
|
|
368
|
-
`${
|
|
369
|
-
)),
|
|
368
|
+
`${W}px`
|
|
369
|
+
)), Y && (se.current = Y, (ne = j == null ? void 0 : j.current) == null || ne.style.setProperty(
|
|
370
370
|
"--av-text-area-helper-text",
|
|
371
|
-
`${
|
|
372
|
-
)),
|
|
371
|
+
`${Y}px`
|
|
372
|
+
)), G.current = He || G.current;
|
|
373
373
|
}
|
|
374
|
-
}, [
|
|
374
|
+
}, [O, s]), /* @__PURE__ */ E("div", { className: R.wrapper, children: [
|
|
375
375
|
/* @__PURE__ */ n(
|
|
376
376
|
"label",
|
|
377
377
|
{
|
|
378
|
-
htmlFor:
|
|
379
|
-
id:
|
|
380
|
-
className:
|
|
378
|
+
htmlFor: H,
|
|
379
|
+
id: v,
|
|
380
|
+
className: R.accessibleLabel,
|
|
381
381
|
children: o
|
|
382
382
|
}
|
|
383
383
|
),
|
|
@@ -385,87 +385,87 @@ const Sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
385
385
|
"textarea",
|
|
386
386
|
{
|
|
387
387
|
ref: Ee,
|
|
388
|
-
id:
|
|
388
|
+
id: H,
|
|
389
389
|
name: r,
|
|
390
|
-
disabled:
|
|
390
|
+
disabled: u,
|
|
391
391
|
placeholder: s ? void 0 : " ",
|
|
392
|
-
className:
|
|
392
|
+
className: R.textArea,
|
|
393
393
|
rows: 1,
|
|
394
|
-
...d && { "aria-describedby": `${
|
|
394
|
+
...d && { "aria-describedby": `${H}-helper` },
|
|
395
395
|
...t && { "aria-invalid": "true" },
|
|
396
|
-
...
|
|
397
|
-
value:
|
|
396
|
+
...T && !s && { style: { paddingRight: Oe } },
|
|
397
|
+
value: O,
|
|
398
398
|
onChange: Me,
|
|
399
399
|
onFocus: Ie,
|
|
400
400
|
onBlur: _e,
|
|
401
|
-
...
|
|
401
|
+
...D
|
|
402
402
|
}
|
|
403
403
|
),
|
|
404
404
|
!s && /* @__PURE__ */ n(
|
|
405
405
|
"label",
|
|
406
406
|
{
|
|
407
|
-
ref:
|
|
407
|
+
ref: _,
|
|
408
408
|
"aria-hidden": !0,
|
|
409
|
-
htmlFor:
|
|
410
|
-
className:
|
|
409
|
+
htmlFor: H,
|
|
410
|
+
className: R.visibleLabel,
|
|
411
411
|
children: o
|
|
412
412
|
}
|
|
413
413
|
),
|
|
414
414
|
we && /* @__PURE__ */ n(
|
|
415
415
|
"div",
|
|
416
416
|
{
|
|
417
|
-
ref:
|
|
418
|
-
id: `${
|
|
419
|
-
className:
|
|
417
|
+
ref: j,
|
|
418
|
+
id: `${H}-helper`,
|
|
419
|
+
className: R.helperText,
|
|
420
420
|
children: d
|
|
421
421
|
}
|
|
422
422
|
),
|
|
423
|
-
|
|
423
|
+
T && /* @__PURE__ */ n(
|
|
424
424
|
"div",
|
|
425
425
|
{
|
|
426
|
-
ref:
|
|
427
|
-
className:
|
|
428
|
-
children:
|
|
426
|
+
ref: $,
|
|
427
|
+
className: R.rightElement,
|
|
428
|
+
children: T
|
|
429
429
|
}
|
|
430
430
|
),
|
|
431
431
|
t && d && /* @__PURE__ */ n(Ue, { politeness: "polite", clearAnnouncementDelay: 500, children: Le })
|
|
432
432
|
] });
|
|
433
433
|
}
|
|
434
434
|
);
|
|
435
|
-
|
|
435
|
+
Ne.displayName = "TextArea";
|
|
436
436
|
var f = [];
|
|
437
|
-
for (var
|
|
438
|
-
f.push((
|
|
437
|
+
for (var X = 0; X < 256; ++X)
|
|
438
|
+
f.push((X + 256).toString(16).slice(1));
|
|
439
439
|
function Mr(e, r = 0) {
|
|
440
440
|
return (f[e[r + 0]] + f[e[r + 1]] + f[e[r + 2]] + f[e[r + 3]] + "-" + f[e[r + 4]] + f[e[r + 5]] + "-" + f[e[r + 6]] + f[e[r + 7]] + "-" + f[e[r + 8]] + f[e[r + 9]] + "-" + f[e[r + 10]] + f[e[r + 11]] + f[e[r + 12]] + f[e[r + 13]] + f[e[r + 14]] + f[e[r + 15]]).toLowerCase();
|
|
441
441
|
}
|
|
442
|
-
var
|
|
442
|
+
var U, Ir = new Uint8Array(16);
|
|
443
443
|
function _r() {
|
|
444
|
-
if (
|
|
444
|
+
if (!U && (U = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !U))
|
|
445
445
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
446
|
-
return
|
|
446
|
+
return U(Ir);
|
|
447
447
|
}
|
|
448
448
|
var Hr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
449
|
-
const
|
|
449
|
+
const pe = {
|
|
450
450
|
randomUUID: Hr
|
|
451
451
|
};
|
|
452
|
-
function
|
|
453
|
-
if (
|
|
454
|
-
return
|
|
452
|
+
function te(e, r, o) {
|
|
453
|
+
if (pe.randomUUID && !r && !e)
|
|
454
|
+
return pe.randomUUID();
|
|
455
455
|
e = e || {};
|
|
456
456
|
var t = e.random || (e.rng || _r)();
|
|
457
457
|
return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, Mr(t);
|
|
458
458
|
}
|
|
459
459
|
const Br = () => {
|
|
460
|
-
const { dispatch: e, state: r } =
|
|
460
|
+
const { dispatch: e, state: r } = re(P), o = "mt-2 flex justify-center rounded-md", t = x(null), s = x(!1), a = (l) => {
|
|
461
461
|
l.preventDefault(), e({
|
|
462
|
-
type:
|
|
462
|
+
type: be
|
|
463
463
|
});
|
|
464
464
|
};
|
|
465
|
-
return
|
|
465
|
+
return S(() => {
|
|
466
466
|
(r == null ? void 0 : r.streaming) === !0 && !s.current && t.current && (s.current = !0, t.current.focus()), (r == null ? void 0 : r.streaming) === !1 && (s.current = !1);
|
|
467
|
-
}, [r]),
|
|
468
|
-
|
|
467
|
+
}, [r]), he(M, r) ? /* @__PURE__ */ n("div", { className: o, children: /* @__PURE__ */ n(
|
|
468
|
+
xe,
|
|
469
469
|
{
|
|
470
470
|
ref: t,
|
|
471
471
|
noBorder: !0,
|
|
@@ -475,19 +475,19 @@ const Br = () => {
|
|
|
475
475
|
children: r != null && r.streaming ? je : We
|
|
476
476
|
}
|
|
477
477
|
) }) : null;
|
|
478
|
-
},
|
|
479
|
-
const { state: e } =
|
|
480
|
-
return /* @__PURE__ */
|
|
478
|
+
}, me = mr(() => import("./LazyMessageAssistant.Ct8xA2HE.js").then((e) => e.LazyMessageAssistant)), Vr = () => {
|
|
479
|
+
const { state: e } = re(P);
|
|
480
|
+
return /* @__PURE__ */ E(ye, { children: [
|
|
481
481
|
e && e.messages.length > 0 && e.messages.map((r, o) => {
|
|
482
482
|
const { role: t, content: s, name: a, processingTime: l } = r.message;
|
|
483
|
-
return (t ===
|
|
484
|
-
|
|
483
|
+
return (t === M || t === Z) && s ? /* @__PURE__ */ n(de, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(
|
|
484
|
+
me,
|
|
485
485
|
{
|
|
486
486
|
name: a,
|
|
487
487
|
processingTime: l,
|
|
488
488
|
children: s
|
|
489
489
|
}
|
|
490
|
-
) }, `${o}-${t}`) : t ===
|
|
490
|
+
) }, `${o}-${t}`) : t === K && s ? /* @__PURE__ */ n(
|
|
491
491
|
Tr,
|
|
492
492
|
{
|
|
493
493
|
kind: "right",
|
|
@@ -498,45 +498,45 @@ const Br = () => {
|
|
|
498
498
|
`${o}-${t}`
|
|
499
499
|
) : null;
|
|
500
500
|
}),
|
|
501
|
-
|
|
501
|
+
he(K, e) && /* @__PURE__ */ n(de, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(me, { loading: !0 }) })
|
|
502
502
|
] });
|
|
503
|
-
},
|
|
503
|
+
}, F = (e, r) => {
|
|
504
504
|
e({
|
|
505
|
-
type:
|
|
505
|
+
type: Te,
|
|
506
506
|
payload: {
|
|
507
507
|
streaming: r
|
|
508
508
|
}
|
|
509
509
|
});
|
|
510
|
-
},
|
|
511
|
-
|
|
512
|
-
type:
|
|
510
|
+
}, ge = (e) => {
|
|
511
|
+
F(e, !1), e({
|
|
512
|
+
type: V,
|
|
513
513
|
payload: {
|
|
514
514
|
message: {
|
|
515
|
-
role:
|
|
515
|
+
role: Z,
|
|
516
516
|
content: Xe
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
});
|
|
520
520
|
}, Dr = () => {
|
|
521
|
-
const { state: e, dispatch: r } =
|
|
521
|
+
const { state: e, dispatch: r } = re(P), [o, t] = I(""), { getAccessToken: s, user: a } = ee(), l = x(!1), h = x(null), c = x(
|
|
522
522
|
null
|
|
523
523
|
);
|
|
524
|
-
|
|
524
|
+
S(() => {
|
|
525
525
|
(async () => {
|
|
526
|
-
var
|
|
526
|
+
var u;
|
|
527
527
|
if (!e || e.messages.length === 0) {
|
|
528
|
-
(
|
|
528
|
+
(u = c == null ? void 0 : c.current) == null || u.cancel();
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
531
|
const i = e.messages[e.messages.length - 1];
|
|
532
|
-
if (!(e.messages.length === 0 || i.message.role ===
|
|
532
|
+
if (!(e.messages.length === 0 || i.message.role === M || i.message.role === Ye || i.message.role === Z || i.message.role === qe))
|
|
533
533
|
try {
|
|
534
534
|
const b = await ir({
|
|
535
535
|
accessToken: await s(),
|
|
536
536
|
name: "generate",
|
|
537
537
|
data: {
|
|
538
538
|
messages: e.messages,
|
|
539
|
-
model:
|
|
539
|
+
model: ke,
|
|
540
540
|
user: (a == null ? void 0 : a.username) || "",
|
|
541
541
|
id: e.id,
|
|
542
542
|
location: e.location,
|
|
@@ -544,74 +544,74 @@ const Br = () => {
|
|
|
544
544
|
}
|
|
545
545
|
});
|
|
546
546
|
if (b && b.ok) {
|
|
547
|
-
const
|
|
547
|
+
const v = te();
|
|
548
548
|
c.current = b.body.getReader();
|
|
549
549
|
const d = new TextDecoder();
|
|
550
550
|
for (; ; ) {
|
|
551
|
-
|
|
552
|
-
const { done:
|
|
553
|
-
if (
|
|
554
|
-
|
|
551
|
+
F(r, !0);
|
|
552
|
+
const { done: w, value: T } = await c.current.read();
|
|
553
|
+
if (w) {
|
|
554
|
+
F(r, !1);
|
|
555
555
|
break;
|
|
556
556
|
}
|
|
557
|
-
const
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
560
|
-
|
|
557
|
+
const p = d.decode(T, { stream: !0 }), C = p.indexOf(le);
|
|
558
|
+
if (C !== -1) {
|
|
559
|
+
const L = p.substring(0, C), N = JSON.parse(
|
|
560
|
+
p.substring(C + le.length)
|
|
561
561
|
);
|
|
562
562
|
r({
|
|
563
|
-
type:
|
|
563
|
+
type: Ce,
|
|
564
564
|
payload: {
|
|
565
|
-
model:
|
|
566
|
-
usage:
|
|
565
|
+
model: N.model,
|
|
566
|
+
usage: N.usage
|
|
567
567
|
}
|
|
568
568
|
}), r({
|
|
569
|
-
type:
|
|
569
|
+
type: V,
|
|
570
570
|
payload: {
|
|
571
571
|
message: {
|
|
572
|
-
content:
|
|
573
|
-
role:
|
|
574
|
-
messageId:
|
|
575
|
-
processingTime:
|
|
576
|
-
name:
|
|
572
|
+
content: L,
|
|
573
|
+
role: M,
|
|
574
|
+
messageId: v,
|
|
575
|
+
processingTime: N.processingTime,
|
|
576
|
+
name: N.name
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
}),
|
|
579
|
+
}), F(r, !1);
|
|
580
580
|
break;
|
|
581
581
|
} else
|
|
582
582
|
r({
|
|
583
|
-
type:
|
|
583
|
+
type: V,
|
|
584
584
|
payload: {
|
|
585
585
|
message: {
|
|
586
|
-
content:
|
|
587
|
-
role:
|
|
588
|
-
messageId:
|
|
586
|
+
content: p,
|
|
587
|
+
role: M,
|
|
588
|
+
messageId: v
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
});
|
|
592
592
|
}
|
|
593
593
|
} else
|
|
594
|
-
|
|
594
|
+
ge(r);
|
|
595
595
|
} catch (b) {
|
|
596
|
-
console.error(b),
|
|
596
|
+
console.error(b), ge(r);
|
|
597
597
|
}
|
|
598
598
|
})();
|
|
599
599
|
}, [e == null ? void 0 : e.messages]);
|
|
600
600
|
const y = async (i) => {
|
|
601
601
|
i.preventDefault(), r({
|
|
602
|
-
type:
|
|
602
|
+
type: V,
|
|
603
603
|
payload: {
|
|
604
604
|
message: {
|
|
605
|
-
role:
|
|
605
|
+
role: K,
|
|
606
606
|
content: o
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
609
|
}), t("");
|
|
610
610
|
};
|
|
611
|
-
return
|
|
611
|
+
return S(() => {
|
|
612
612
|
(e == null ? void 0 : e.streaming) === !1 && !l.current && h.current && (l.current = !0, h.current.focus()), (e == null ? void 0 : e.streaming) === !0 && l.current === !0 && (l.current = !1);
|
|
613
613
|
}, [e]), /* @__PURE__ */ n("form", { className: "mt-2", onSubmit: y, children: /* @__PURE__ */ n(
|
|
614
|
-
|
|
614
|
+
Ne,
|
|
615
615
|
{
|
|
616
616
|
mode: "dark",
|
|
617
617
|
focusMode: "light",
|
|
@@ -624,7 +624,7 @@ const Br = () => {
|
|
|
624
624
|
value: o,
|
|
625
625
|
onChange: (i) => t(i.target.value),
|
|
626
626
|
rightElement: /* @__PURE__ */ n(
|
|
627
|
-
|
|
627
|
+
xe,
|
|
628
628
|
{
|
|
629
629
|
disabled: e == null ? void 0 : e.streaming,
|
|
630
630
|
noBorder: !0,
|
|
@@ -637,9 +637,9 @@ const Br = () => {
|
|
|
637
637
|
}
|
|
638
638
|
) });
|
|
639
639
|
}, $r = () => {
|
|
640
|
-
const { isAuthenticated: e } =
|
|
641
|
-
return /* @__PURE__ */
|
|
642
|
-
/* @__PURE__ */
|
|
640
|
+
const { isAuthenticated: e } = ee(), r = Ke(e);
|
|
641
|
+
return /* @__PURE__ */ E(ye, { children: [
|
|
642
|
+
/* @__PURE__ */ E("div", { className: r, children: [
|
|
643
643
|
/* @__PURE__ */ n(Ze, {}),
|
|
644
644
|
/* @__PURE__ */ n(Vr, {})
|
|
645
645
|
] }),
|
|
@@ -673,7 +673,7 @@ const Br = () => {
|
|
|
673
673
|
messages: o
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
-
if ((r == null ? void 0 : r.type) ===
|
|
676
|
+
if ((r == null ? void 0 : r.type) === V) {
|
|
677
677
|
const o = r.payload.message.role, t = r.payload.message.content, s = r.payload.message.name, a = r.payload.message.processingTime, l = r.payload.message.messageId;
|
|
678
678
|
if (o !== "") {
|
|
679
679
|
const h = {
|
|
@@ -683,12 +683,12 @@ const Br = () => {
|
|
|
683
683
|
processingTime: a,
|
|
684
684
|
messageId: l
|
|
685
685
|
};
|
|
686
|
-
if (o ===
|
|
686
|
+
if (o === M) {
|
|
687
687
|
const c = e.messages.findIndex(
|
|
688
688
|
(y) => y.message.messageId === l
|
|
689
689
|
);
|
|
690
690
|
if (c !== -1) {
|
|
691
|
-
const y = e.messages.map((i,
|
|
691
|
+
const y = e.messages.map((i, u) => u === c ? {
|
|
692
692
|
message: {
|
|
693
693
|
...i.message,
|
|
694
694
|
content: `${i.message.content}${t}`,
|
|
@@ -721,59 +721,59 @@ const Br = () => {
|
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
return (r == null ? void 0 : r.type) ===
|
|
725
|
-
id:
|
|
724
|
+
return (r == null ? void 0 : r.type) === be ? {
|
|
725
|
+
id: te(),
|
|
726
726
|
model: e.model,
|
|
727
727
|
usage: 0,
|
|
728
728
|
messages: [],
|
|
729
729
|
location: e.location,
|
|
730
730
|
isComponent: e.isComponent
|
|
731
|
-
} : (r == null ? void 0 : r.type) ===
|
|
731
|
+
} : (r == null ? void 0 : r.type) === Ce ? {
|
|
732
732
|
id: e.id,
|
|
733
733
|
model: r.payload.model,
|
|
734
734
|
usage: r.payload.usage,
|
|
735
735
|
messages: e.messages,
|
|
736
736
|
location: e.location,
|
|
737
737
|
isComponent: e.isComponent
|
|
738
|
-
} : (r == null ? void 0 : r.type) ===
|
|
738
|
+
} : (r == null ? void 0 : r.type) === B ? {
|
|
739
739
|
id: e.id,
|
|
740
740
|
model: e.model,
|
|
741
741
|
usage: e.usage,
|
|
742
742
|
messages: e.messages,
|
|
743
743
|
location: r.payload.location,
|
|
744
744
|
isComponent: e.isComponent
|
|
745
|
-
} : (r == null ? void 0 : r.type) ===
|
|
745
|
+
} : (r == null ? void 0 : r.type) === Te ? {
|
|
746
746
|
...e,
|
|
747
747
|
streaming: r.payload.streaming
|
|
748
748
|
} : e;
|
|
749
749
|
};
|
|
750
|
-
function
|
|
751
|
-
const r = x(!1), o = x(!1), t = x(!1), { isAuthenticated: s, getAccessToken: a } =
|
|
752
|
-
key:
|
|
750
|
+
function Ae({ isComponent: e = !1 }) {
|
|
751
|
+
const r = x(!1), o = x(!1), t = x(!1), { isAuthenticated: s, getAccessToken: a } = ee(), [l] = Q({
|
|
752
|
+
key: J + nr,
|
|
753
753
|
initialValue: ""
|
|
754
|
-
}), [h] =
|
|
755
|
-
key:
|
|
754
|
+
}), [h] = Q({
|
|
755
|
+
key: J + lr,
|
|
756
756
|
initialValue: ur.ASC
|
|
757
|
-
}), [c, y] =
|
|
758
|
-
key:
|
|
757
|
+
}), [c, y] = Q({
|
|
758
|
+
key: J + cr,
|
|
759
759
|
initialValue: { latitude: 0, longitude: 0, accuracy: 0 }
|
|
760
|
-
}), [i,
|
|
761
|
-
id:
|
|
762
|
-
model:
|
|
760
|
+
}), [i, u] = ue(Ur, {
|
|
761
|
+
id: te(),
|
|
762
|
+
model: ke,
|
|
763
763
|
usage: 0,
|
|
764
764
|
messages: [],
|
|
765
765
|
isComponent: e
|
|
766
|
-
}), [b,
|
|
766
|
+
}), [b, v] = ue(zr, {
|
|
767
767
|
searchString: l,
|
|
768
768
|
sortedCell: "timestamp",
|
|
769
769
|
sortDirection: h
|
|
770
|
-
}), [d,
|
|
770
|
+
}), [d, w] = I({
|
|
771
771
|
version: "",
|
|
772
772
|
models: [],
|
|
773
773
|
plugins: []
|
|
774
|
-
}),
|
|
775
|
-
|
|
776
|
-
type:
|
|
774
|
+
}), T = gr(() => {
|
|
775
|
+
u({
|
|
776
|
+
type: B,
|
|
777
777
|
payload: {
|
|
778
778
|
location: {
|
|
779
779
|
...c,
|
|
@@ -782,75 +782,74 @@ function ve({ isComponent: e = !1 }) {
|
|
|
782
782
|
}
|
|
783
783
|
});
|
|
784
784
|
}, [c]);
|
|
785
|
-
return
|
|
785
|
+
return S(() => {
|
|
786
786
|
d.version !== "" || t.current || (async () => {
|
|
787
787
|
try {
|
|
788
788
|
t.current = !0;
|
|
789
|
-
const
|
|
789
|
+
const p = await ce({
|
|
790
790
|
accessToken: await a(),
|
|
791
|
-
type:
|
|
791
|
+
type: ie.ABOUT
|
|
792
792
|
});
|
|
793
|
-
t.current = !1,
|
|
793
|
+
t.current = !1, p.status === 200 && w(p.data);
|
|
794
794
|
} catch {
|
|
795
795
|
}
|
|
796
796
|
})();
|
|
797
|
-
}, [d, a]),
|
|
797
|
+
}, [d, a]), S(() => {
|
|
798
798
|
s && (r.current || ((!c || c.accuracy === 0) && (r.current = !0, (async () => {
|
|
799
|
-
const
|
|
800
|
-
y(
|
|
801
|
-
type:
|
|
799
|
+
const p = await or();
|
|
800
|
+
y(p), u({
|
|
801
|
+
type: B,
|
|
802
802
|
payload: {
|
|
803
|
-
location:
|
|
803
|
+
location: p
|
|
804
804
|
}
|
|
805
805
|
});
|
|
806
|
-
})()), c && c.accuracy !== 0 && !i.location &&
|
|
807
|
-
type:
|
|
806
|
+
})()), c && c.accuracy !== 0 && !i.location && u({
|
|
807
|
+
type: B,
|
|
808
808
|
payload: {
|
|
809
809
|
location: c
|
|
810
810
|
}
|
|
811
811
|
})));
|
|
812
|
-
}, [s, c, y, i.location]),
|
|
813
|
-
!i.location || i.location.accuracy === 0 || i.location.city || o.current || (async () => {
|
|
814
|
-
var
|
|
812
|
+
}, [s, c, y, i.location]), S(() => {
|
|
813
|
+
!i.location || i.location.accuracy === 0 || i.location.city || i.location.displayName || o.current || (async () => {
|
|
814
|
+
var p, C, L, N, D;
|
|
815
815
|
o.current = !0;
|
|
816
816
|
try {
|
|
817
|
-
const
|
|
817
|
+
const m = await ce({
|
|
818
818
|
accessToken: await a(),
|
|
819
|
-
type:
|
|
819
|
+
type: ie.GET_LOCATION,
|
|
820
820
|
params: {
|
|
821
821
|
latitude: c.latitude,
|
|
822
822
|
longitude: c.longitude
|
|
823
823
|
}
|
|
824
824
|
});
|
|
825
|
-
o.current = !1,
|
|
826
|
-
type:
|
|
825
|
+
o.current = !1, m.status !== 200 || ((p = m == null ? void 0 : m.errors) == null ? void 0 : p.length) > 0 ? T() : u({
|
|
826
|
+
type: B,
|
|
827
827
|
payload: {
|
|
828
828
|
location: {
|
|
829
829
|
...c,
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
countryShort: u.data.countryShort
|
|
830
|
+
country: (C = m == null ? void 0 : m.data) == null ? void 0 : C.country,
|
|
831
|
+
state: (L = m == null ? void 0 : m.data) == null ? void 0 : L.state,
|
|
832
|
+
city: ((N = m == null ? void 0 : m.data) == null ? void 0 : N.city) || "N/A",
|
|
833
|
+
displayName: (D = m == null ? void 0 : m.data) == null ? void 0 : D.displayName
|
|
835
834
|
}
|
|
836
835
|
}
|
|
837
836
|
});
|
|
838
837
|
} catch {
|
|
839
|
-
|
|
838
|
+
T();
|
|
840
839
|
}
|
|
841
840
|
})();
|
|
842
|
-
}, [i, c, a,
|
|
843
|
-
var
|
|
844
|
-
(
|
|
845
|
-
var
|
|
846
|
-
(
|
|
841
|
+
}, [i, c, a, T]), S(() => {
|
|
842
|
+
var p;
|
|
843
|
+
(p = document.getElementById("logo")) == null || p.classList.add("fadeOut"), setTimeout(() => {
|
|
844
|
+
var C;
|
|
845
|
+
(C = document.getElementById("root")) == null || C.classList.replace("app-hidden", "fadeIn");
|
|
847
846
|
}, 500);
|
|
848
|
-
}), /* @__PURE__ */ n(
|
|
847
|
+
}), /* @__PURE__ */ n(P.Provider, { value: { state: i, dispatch: u, serverStats: d }, children: /* @__PURE__ */ E(
|
|
849
848
|
dr.Provider,
|
|
850
849
|
{
|
|
851
850
|
value: {
|
|
852
851
|
state: b,
|
|
853
|
-
dispatch:
|
|
852
|
+
dispatch: v
|
|
854
853
|
},
|
|
855
854
|
children: [
|
|
856
855
|
/* @__PURE__ */ n(sr, { children: /* @__PURE__ */ n($r, {}) }),
|
|
@@ -859,8 +858,8 @@ function ve({ isComponent: e = !1 }) {
|
|
|
859
858
|
}
|
|
860
859
|
) });
|
|
861
860
|
}
|
|
862
|
-
|
|
863
|
-
const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default:
|
|
861
|
+
Ae.displayName = "App";
|
|
862
|
+
const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Ae }, Symbol.toStringTag, { value: "Module" }));
|
|
864
863
|
export {
|
|
865
864
|
Yr as App,
|
|
866
865
|
Tr as T
|