@versini/sassysaint 8.59.3 → 8.60.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.Dox-NMAe.js → AboutChangelog.D7rARJQu.js} +2 -2
- package/dist/chunks/{AboutEntry.CVFfQ1yk.js → AboutEntry.2nf0TV4n.js} +5 -5
- package/dist/chunks/{App.BI1AgnoF.js → App.Ch8FU2zW.js} +17 -17
- package/dist/chunks/{Chart.DHXouvK2.js → Chart.Iz1BoL-_.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.DDzr5AUP.js → ChatBubbleAssistant.M4WRDuaw.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.Dg11mYO3.js → ChatBubbleUser.CJHFRmMF.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.82jyjrx0.js → ChatHistoryTable.B2mRc_wV.js} +9 -9
- package/dist/chunks/{HistoryEntry.muPSI9qn.js → HistoryEntry.71E6Pz_O.js} +3 -3
- package/dist/chunks/{ProfileEntry.Bov4_Y_K.js → ProfileEntry.BWsYCeof.js} +2 -2
- package/dist/chunks/SettingsEntry.Qi5gQD0-.js +781 -0
- package/dist/chunks/{Table.BkWkQP0Y.js → Table.SHD8KKEE.js} +2 -2
- package/dist/chunks/{UsageEntry.CRs1WXat.js → UsageEntry.DPhNHm9B.js} +3 -3
- package/dist/chunks/UserMemoriesPanel.CT_7TJ_Z.js +208 -0
- package/dist/chunks/{index.BGpoRXQk.js → index.BBAApLM_.js} +1 -1
- package/dist/chunks/{index.CZQODsrP.js → index.BJqzFaBo.js} +2 -2
- package/dist/chunks/{index.eMp9_gI5.js → index.CEgF3L_6.js} +3 -3
- package/dist/chunks/{index.DCZKUmgB.js → index.CqKtw4TJ.js} +1 -1
- package/dist/chunks/{index.DDJOJ-SM.js → index.DG2NgWZ6.js} +1 -1
- package/dist/chunks/{index.D97kQsNo.js → index.DnHjiSVh.js} +604 -637
- package/dist/chunks/{index.dN-7mPvm.js → index.HkxzuofI.js} +1 -1
- package/dist/chunks/{useMarkdown.wJ9LWx_X.js → useMarkdown.BBFa2GkT.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
- package/dist/chunks/SettingsEntry.BnCkBWa0.js +0 -430
- package/dist/chunks/UserMemoriesPanel.CoNs_q02.js +0 -693
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+
import { jsxs as u, jsx as r, Fragment as de } from "react/jsx-runtime";
|
|
2
|
+
import { o as ge, h as ue, i as ye, x as xe, n as be, useUserPreferences as ke, Pe as Ee, getCacheInfo as Te, isServiceWorkerEnabled as Ne, SETTINGS_TITLE as ve, S as G, CARDS as A, C as oe, _e as we, PROMPTS_DESCRIPTION as Se, L as Ce, j as me, getCurrentGeoLocation as Ie, mutateCall as he, handleServiceWorkerToggle as Le, SERVICE_TYPES as pe } from "./index.DnHjiSVh.js";
|
|
3
|
+
import { useCapability as _e, oe as Me, O as R } from "./App.Ch8FU2zW.js";
|
|
4
|
+
import Oe, { useState as d, useEffect as ce, useRef as H, useLayoutEffect as Y, useCallback as Pe } from "react";
|
|
5
|
+
import { UserMemoriesPanel as Ae } from "./UserMemoriesPanel.CT_7TJ_Z.js";
|
|
6
|
+
import g from "clsx";
|
|
7
|
+
function Re({
|
|
8
|
+
value: a,
|
|
9
|
+
defaultValue: n,
|
|
10
|
+
finalValue: o,
|
|
11
|
+
onChange: s = () => {
|
|
12
|
+
},
|
|
13
|
+
initialControlledDelay: e = 0
|
|
14
|
+
}) {
|
|
15
|
+
const [c, h] = d(!1), [y, T] = d(
|
|
16
|
+
n !== void 0 ? n : o
|
|
17
|
+
), v = (x) => {
|
|
18
|
+
T(x), s?.(x);
|
|
19
|
+
};
|
|
20
|
+
return ce(() => {
|
|
21
|
+
(async () => a !== void 0 && !c && e > 0 && (await new Promise(
|
|
22
|
+
(x) => setTimeout(x, e)
|
|
23
|
+
), h(!0)))();
|
|
24
|
+
}, [a, e, c]), a !== void 0 ? !c && e > 0 ? ["", s, !0] : [a, s, !0] : [y, v, !1];
|
|
25
|
+
}
|
|
26
|
+
const fe = "av-text-area", De = "av-text-area-wrapper", ne = "av-text-area-helper-text", Be = "av-text-area__control--right", Ue = "av-text-area__control--left", Ge = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", He = ({ mode: a }) => g({
|
|
27
|
+
"bg-surface-darker text-copy-lighter caret-copy-light": a === "dark",
|
|
28
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark": a === "light",
|
|
29
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": a === "system",
|
|
30
|
+
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": a === "alt-system"
|
|
31
|
+
}), $e = ({
|
|
32
|
+
focusMode: a
|
|
33
|
+
}) => g("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
34
|
+
"focus:outline-focus-dark": a === "dark",
|
|
35
|
+
"focus:outline-focus-light": a === "light",
|
|
36
|
+
"focus:outline-focus-light dark:focus:outline-focus-dark": a === "alt-system",
|
|
37
|
+
"focus:outline-focus-dark dark:focus:outline-focus-light": a === "system"
|
|
38
|
+
}), Ve = ({
|
|
39
|
+
noBorder: a,
|
|
40
|
+
error: n
|
|
41
|
+
}) => g("border-2", {
|
|
42
|
+
"border-border-dark": !a && !n,
|
|
43
|
+
"focus:border-border-dark": !a && n,
|
|
44
|
+
"border-border-error-dark": !a && n,
|
|
45
|
+
"border-transparent": a
|
|
46
|
+
}), We = ({
|
|
47
|
+
disabled: a,
|
|
48
|
+
raw: n,
|
|
49
|
+
error: o,
|
|
50
|
+
mode: s,
|
|
51
|
+
leftElement: e,
|
|
52
|
+
rightElement: c
|
|
53
|
+
}) => {
|
|
54
|
+
if (n)
|
|
55
|
+
return "";
|
|
56
|
+
if (a)
|
|
57
|
+
return g(
|
|
58
|
+
"transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
|
|
59
|
+
{
|
|
60
|
+
"translate-x-[10px]": c === !0 && !e || !c && !e
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
if (!o)
|
|
64
|
+
return g(
|
|
65
|
+
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
|
66
|
+
{
|
|
67
|
+
"translate-x-[10px]": c === !0 && !e || !c && !e,
|
|
68
|
+
"text-copy-medium": s === "dark",
|
|
69
|
+
"text-copy-dark": s === "light",
|
|
70
|
+
"text-copy-dark dark:text-copy-medium": s === "system",
|
|
71
|
+
"text-copy-medium dark:text-copy-dark": s === "alt-system"
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
if (o)
|
|
75
|
+
return g(
|
|
76
|
+
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
|
77
|
+
{
|
|
78
|
+
"translate-x-[10px]": c === !0 && !e || !c && !e,
|
|
79
|
+
"text-copy-medium": s === "dark",
|
|
80
|
+
"text-copy-error-dark": s === "light",
|
|
81
|
+
"text-copy-error-dark dark:text-copy-error-light": s === "system",
|
|
82
|
+
"text-copy-medium dark:text-copy-error-dark": s === "alt-system"
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}, ze = ({
|
|
86
|
+
error: a,
|
|
87
|
+
raw: n,
|
|
88
|
+
mode: o,
|
|
89
|
+
disabled: s
|
|
90
|
+
}) => {
|
|
91
|
+
if (n)
|
|
92
|
+
return "";
|
|
93
|
+
if (s)
|
|
94
|
+
return g(
|
|
95
|
+
ne,
|
|
96
|
+
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
97
|
+
);
|
|
98
|
+
if (!a)
|
|
99
|
+
return g(ne, "absolute px-2 font-medium", {
|
|
100
|
+
"text-copy-medium": o === "dark",
|
|
101
|
+
"text-copy-dark": o === "light",
|
|
102
|
+
"text-copy-dark dark:text-copy-medium": o === "system",
|
|
103
|
+
"text-copy-medium dark:text-copy-dark": o === "alt-system"
|
|
104
|
+
});
|
|
105
|
+
if (a)
|
|
106
|
+
return g(ne, "absolute px-2 font-medium", {
|
|
107
|
+
"text-copy-error-light": o === "dark",
|
|
108
|
+
"text-copy-error-dark": o === "light",
|
|
109
|
+
"text-copy-error-dark dark:text-copy-error-light": o === "system",
|
|
110
|
+
"dark:text-copy-error-dark text-copy-error-light": o === "alt-system"
|
|
111
|
+
});
|
|
112
|
+
}, Fe = ({
|
|
113
|
+
className: a,
|
|
114
|
+
textAreaClassName: n,
|
|
115
|
+
raw: o,
|
|
116
|
+
focusMode: s,
|
|
117
|
+
disabled: e,
|
|
118
|
+
noBorder: c,
|
|
119
|
+
error: h,
|
|
120
|
+
mode: y,
|
|
121
|
+
leftElement: T,
|
|
122
|
+
rightElement: v
|
|
123
|
+
}) => {
|
|
124
|
+
const x = o ? a : g(
|
|
125
|
+
"relative flex w-full flex-col justify-center",
|
|
126
|
+
De,
|
|
127
|
+
a
|
|
128
|
+
), I = o ? g(n) : g(
|
|
129
|
+
fe,
|
|
130
|
+
n,
|
|
131
|
+
Ge(),
|
|
132
|
+
He({ mode: y }),
|
|
133
|
+
$e({ focusMode: s }),
|
|
134
|
+
Ve({
|
|
135
|
+
noBorder: c,
|
|
136
|
+
error: h
|
|
137
|
+
}),
|
|
138
|
+
{
|
|
139
|
+
"disabled:cursor-not-allowed disabled:opacity-50": e
|
|
140
|
+
}
|
|
141
|
+
), D = o ? void 0 : "sr-only", B = We({
|
|
142
|
+
disabled: e,
|
|
143
|
+
raw: o,
|
|
144
|
+
error: h,
|
|
145
|
+
mode: y,
|
|
146
|
+
rightElement: v,
|
|
147
|
+
leftElement: T
|
|
148
|
+
}), p = ze({
|
|
149
|
+
error: h,
|
|
150
|
+
raw: o,
|
|
151
|
+
mode: y,
|
|
152
|
+
disabled: e
|
|
153
|
+
}), S = o ? void 0 : g(Be, "absolute"), b = o ? void 0 : g(Ue, "absolute");
|
|
154
|
+
return {
|
|
155
|
+
wrapper: x,
|
|
156
|
+
textArea: I,
|
|
157
|
+
accessibleLabel: D,
|
|
158
|
+
visibleLabel: B,
|
|
159
|
+
helperText: p,
|
|
160
|
+
rightElement: S,
|
|
161
|
+
leftElement: b
|
|
162
|
+
};
|
|
163
|
+
}, je = ({
|
|
164
|
+
scrollHeight: a,
|
|
165
|
+
currentHeight: n,
|
|
166
|
+
currentLabelOffset: o = 0,
|
|
167
|
+
currentHelperTextOffset: s = 0
|
|
168
|
+
}) => {
|
|
169
|
+
let e, c;
|
|
170
|
+
if (a > 0 && a !== n) {
|
|
171
|
+
const h = a - n, y = Math.abs(h / 24);
|
|
172
|
+
e = o + -1 * Math.sign(h) * (12 * y), c = s + Math.sign(h) * (12 * y);
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
labelOffset: e,
|
|
176
|
+
helperTextOffset: c,
|
|
177
|
+
scrollHeight: a
|
|
178
|
+
};
|
|
179
|
+
}, ie = Oe.forwardRef(
|
|
180
|
+
({
|
|
181
|
+
id: a,
|
|
182
|
+
name: n,
|
|
183
|
+
label: o,
|
|
184
|
+
error: s = !1,
|
|
185
|
+
raw: e = !1,
|
|
186
|
+
className: c,
|
|
187
|
+
textAreaClassName: h,
|
|
188
|
+
mode: y = "system",
|
|
189
|
+
focusMode: T = "system",
|
|
190
|
+
value: v,
|
|
191
|
+
defaultValue: x,
|
|
192
|
+
disabled: I = !1,
|
|
193
|
+
noBorder: D = !1,
|
|
194
|
+
labelId: B,
|
|
195
|
+
helperText: p = "",
|
|
196
|
+
helperTextOnFocus: S = !1,
|
|
197
|
+
rightElement: b,
|
|
198
|
+
leftElement: N,
|
|
199
|
+
onChange: $,
|
|
200
|
+
onFocus: L,
|
|
201
|
+
onBlur: V,
|
|
202
|
+
...U
|
|
203
|
+
}, q) => {
|
|
204
|
+
const m = H(null), J = ge([q, m]), [K, _] = ue(), [Q, w] = ue(), W = H(80), z = H(-25), M = H(null), Z = H(30), ee = H(null), O = ye({ id: a, prefix: `${fe}-` }), [te, se] = d(0), [re, ae] = d(0), [F, j] = d(
|
|
205
|
+
!!(!S && p)
|
|
206
|
+
), t = `${n} error, ${p}`, l = Fe({
|
|
207
|
+
className: c,
|
|
208
|
+
textAreaClassName: h,
|
|
209
|
+
error: s,
|
|
210
|
+
raw: e,
|
|
211
|
+
focusMode: T,
|
|
212
|
+
disabled: I,
|
|
213
|
+
noBorder: D,
|
|
214
|
+
mode: y,
|
|
215
|
+
rightElement: !!b,
|
|
216
|
+
leftElement: !!N
|
|
217
|
+
}), [f, X] = Re({
|
|
218
|
+
value: v,
|
|
219
|
+
initialControlledDelay: 20,
|
|
220
|
+
defaultValue: x,
|
|
221
|
+
onChange: (i) => {
|
|
222
|
+
$ && $({
|
|
223
|
+
target: {
|
|
224
|
+
value: i
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}), C = (i) => {
|
|
229
|
+
X(i.target.value);
|
|
230
|
+
}, k = (i) => {
|
|
231
|
+
S && p && j(!0), L && L(i);
|
|
232
|
+
}, E = (i) => {
|
|
233
|
+
S && p && !f && j(!1), V && V(i);
|
|
234
|
+
};
|
|
235
|
+
return Y(() => {
|
|
236
|
+
_ && _.width && se(_.width + 18 + 10);
|
|
237
|
+
}, [_]), Y(() => {
|
|
238
|
+
w && w.width && ae(w.width + 18 + 10);
|
|
239
|
+
}, [w]), Y(() => {
|
|
240
|
+
e || m && m.current && f !== void 0 && (m.current.style.height = "inherit", m.current.style.height = m.current.scrollHeight + "px");
|
|
241
|
+
}, [f, e]), Y(() => {
|
|
242
|
+
e || setTimeout(() => {
|
|
243
|
+
M?.current?.style.setProperty(
|
|
244
|
+
"--av-text-area-wrapper-transition",
|
|
245
|
+
f ? "none" : "all 0.2s ease-out"
|
|
246
|
+
);
|
|
247
|
+
}, 0);
|
|
248
|
+
}, [f, e]), Y(() => {
|
|
249
|
+
if (!e && m && m.current && f !== void 0) {
|
|
250
|
+
const { labelOffset: i, helperTextOffset: P, scrollHeight: le } = je({
|
|
251
|
+
scrollHeight: m.current.scrollHeight,
|
|
252
|
+
currentHeight: W.current,
|
|
253
|
+
currentLabelOffset: z.current,
|
|
254
|
+
currentHelperTextOffset: Z.current
|
|
255
|
+
});
|
|
256
|
+
i && (z.current = i, M?.current?.style.setProperty(
|
|
257
|
+
"--av-text-area-label",
|
|
258
|
+
`${i}px`
|
|
259
|
+
)), P && (Z.current = P, ee?.current?.style.setProperty(
|
|
260
|
+
"--av-text-area-helper-text",
|
|
261
|
+
`${P}px`
|
|
262
|
+
)), W.current = le || W.current;
|
|
263
|
+
}
|
|
264
|
+
}, [f, e]), w.width > 0 && M?.current?.style.setProperty(
|
|
265
|
+
"--tw-translate-x",
|
|
266
|
+
`${12 + w.width + 5}px`
|
|
267
|
+
), /* @__PURE__ */ u("div", { className: l.wrapper, children: [
|
|
268
|
+
/* @__PURE__ */ r(
|
|
269
|
+
"label",
|
|
270
|
+
{
|
|
271
|
+
htmlFor: O,
|
|
272
|
+
id: B,
|
|
273
|
+
className: l.accessibleLabel,
|
|
274
|
+
children: o
|
|
275
|
+
}
|
|
276
|
+
),
|
|
277
|
+
N && /* @__PURE__ */ r(
|
|
278
|
+
"div",
|
|
279
|
+
{
|
|
280
|
+
ref: Q,
|
|
281
|
+
className: l.leftElement,
|
|
282
|
+
children: N
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
/* @__PURE__ */ r(
|
|
286
|
+
"textarea",
|
|
287
|
+
{
|
|
288
|
+
ref: J,
|
|
289
|
+
id: O,
|
|
290
|
+
name: n,
|
|
291
|
+
disabled: I,
|
|
292
|
+
placeholder: e ? void 0 : " ",
|
|
293
|
+
className: l.textArea,
|
|
294
|
+
rows: 1,
|
|
295
|
+
...p && { "aria-describedby": `${O}-helper` },
|
|
296
|
+
...s && { "aria-invalid": "true" },
|
|
297
|
+
...b && !N && !e && { style: { paddingRight: te } },
|
|
298
|
+
...N && !b && !e && { style: { paddingLeft: re } },
|
|
299
|
+
...b && N && !e && {
|
|
300
|
+
style: {
|
|
301
|
+
paddingRight: te,
|
|
302
|
+
paddingLeft: re
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
value: f,
|
|
306
|
+
onChange: C,
|
|
307
|
+
onFocus: k,
|
|
308
|
+
onBlur: E,
|
|
309
|
+
...U
|
|
310
|
+
}
|
|
311
|
+
),
|
|
312
|
+
!e && /* @__PURE__ */ r(
|
|
313
|
+
"label",
|
|
314
|
+
{
|
|
315
|
+
ref: M,
|
|
316
|
+
"aria-hidden": !0,
|
|
317
|
+
htmlFor: O,
|
|
318
|
+
className: `${l.visibleLabel}`,
|
|
319
|
+
children: o
|
|
320
|
+
}
|
|
321
|
+
),
|
|
322
|
+
F && /* @__PURE__ */ r(
|
|
323
|
+
"div",
|
|
324
|
+
{
|
|
325
|
+
ref: ee,
|
|
326
|
+
id: `${O}-helper`,
|
|
327
|
+
className: l.helperText,
|
|
328
|
+
children: p
|
|
329
|
+
}
|
|
330
|
+
),
|
|
331
|
+
b && /* @__PURE__ */ r(
|
|
332
|
+
"div",
|
|
333
|
+
{
|
|
334
|
+
ref: K,
|
|
335
|
+
className: l.rightElement,
|
|
336
|
+
children: b
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
s && p && /* @__PURE__ */ r(xe, { politeness: "polite", clearAnnouncementDelay: 500, children: t })
|
|
340
|
+
] });
|
|
341
|
+
}
|
|
342
|
+
);
|
|
343
|
+
ie.displayName = "TextArea";
|
|
344
|
+
/*!
|
|
345
|
+
@versini/ui-textarea v5.0.2
|
|
346
|
+
© 2025 gizmette.com
|
|
347
|
+
*/
|
|
348
|
+
try {
|
|
349
|
+
window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
|
|
350
|
+
version: "5.0.2",
|
|
351
|
+
buildTime: "10/11/2025 07:15 PM EDT",
|
|
352
|
+
homepage: "https://github.com/aversini/ui-components",
|
|
353
|
+
license: "MIT"
|
|
354
|
+
});
|
|
355
|
+
} catch {
|
|
356
|
+
}
|
|
357
|
+
const Ze = ({
|
|
358
|
+
open: a,
|
|
359
|
+
onOpenChange: n
|
|
360
|
+
}) => {
|
|
361
|
+
const { getAccessToken: o, user: s } = be(), {
|
|
362
|
+
data: e,
|
|
363
|
+
isSuccess: c,
|
|
364
|
+
refetch: h
|
|
365
|
+
} = ke({
|
|
366
|
+
user: s?.username,
|
|
367
|
+
getAccessToken: o
|
|
368
|
+
}), [y, T] = d({
|
|
369
|
+
loadingLocation: !1
|
|
370
|
+
}), [v, x] = d({
|
|
371
|
+
prompts: []
|
|
372
|
+
}), [I, D] = d(""), [B, p] = d(""), [S, b] = d(!1), [N, $] = d(!1), [L, V] = d(!1), [U, q] = d(!1), [m, J] = d(null), [K, _] = d(!1), [Q, w] = d(!1), [W, z] = d(!1), M = _e(Ee.TOOL.MEMORIES), Z = (t) => {
|
|
373
|
+
w(t);
|
|
374
|
+
}, ee = (t) => {
|
|
375
|
+
b(t);
|
|
376
|
+
}, O = (t) => {
|
|
377
|
+
M && $(t);
|
|
378
|
+
}, te = (t) => {
|
|
379
|
+
q(t);
|
|
380
|
+
}, se = async (t) => {
|
|
381
|
+
t.preventDefault();
|
|
382
|
+
try {
|
|
383
|
+
await he({
|
|
384
|
+
accessToken: await o(),
|
|
385
|
+
type: pe.SET_USER_PREFERENCES,
|
|
386
|
+
params: {
|
|
387
|
+
user: s?.username,
|
|
388
|
+
instructions: I,
|
|
389
|
+
location: B,
|
|
390
|
+
provider: e?.provider,
|
|
391
|
+
tags: v.prompts,
|
|
392
|
+
sendOnEnter: S,
|
|
393
|
+
useMemory: N,
|
|
394
|
+
showDetails: Q
|
|
395
|
+
}
|
|
396
|
+
}), U !== L && (await Le(U), V(U)), h(), T({
|
|
397
|
+
loadingLocation: !1
|
|
398
|
+
});
|
|
399
|
+
} catch {
|
|
400
|
+
}
|
|
401
|
+
}, re = async () => {
|
|
402
|
+
T({
|
|
403
|
+
loadingLocation: !0
|
|
404
|
+
}), p("...");
|
|
405
|
+
try {
|
|
406
|
+
const t = Date.now(), l = await Ie(), f = await he({
|
|
407
|
+
accessToken: await o(),
|
|
408
|
+
type: pe.GET_LOCATION,
|
|
409
|
+
params: {
|
|
410
|
+
latitude: l.latitude,
|
|
411
|
+
longitude: l.longitude
|
|
412
|
+
}
|
|
413
|
+
}), C = Date.now() - t;
|
|
414
|
+
if (C < 2e3 && await new Promise((k) => setTimeout(k, 2e3 - C)), f.status === 200) {
|
|
415
|
+
const { city: k, state: E, country: i, displayName: P } = f.data, le = k && E && i ? `${k}, ${E}, ${i}` : P;
|
|
416
|
+
T({
|
|
417
|
+
loadingLocation: !1
|
|
418
|
+
}), p(le);
|
|
419
|
+
} else
|
|
420
|
+
T({
|
|
421
|
+
loadingLocation: !1
|
|
422
|
+
});
|
|
423
|
+
} catch {
|
|
424
|
+
}
|
|
425
|
+
}, ae = () => {
|
|
426
|
+
h(), n(!1);
|
|
427
|
+
}, F = ({
|
|
428
|
+
enabled: t = !1,
|
|
429
|
+
privateChat: l = !1,
|
|
430
|
+
clipboardAccess: f = !1,
|
|
431
|
+
...X
|
|
432
|
+
}) => {
|
|
433
|
+
x((C) => {
|
|
434
|
+
const k = C.prompts, E = {
|
|
435
|
+
...X,
|
|
436
|
+
enabled: t,
|
|
437
|
+
privateChat: l,
|
|
438
|
+
clipboardAccess: f
|
|
439
|
+
};
|
|
440
|
+
f ? E.content = E.content.replace(/{{clipboard}}/g, "") + " {{clipboard}}" : E.content = E.content.replace(/{{clipboard}}/g, "");
|
|
441
|
+
const i = k.findIndex((P) => P.slot === X.slot);
|
|
442
|
+
return i === -1 ? {
|
|
443
|
+
...C,
|
|
444
|
+
prompts: [...k, { ...E }]
|
|
445
|
+
} : (k[i] = E, {
|
|
446
|
+
...C,
|
|
447
|
+
prompts: [...k]
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
}, j = Pe(async () => {
|
|
451
|
+
try {
|
|
452
|
+
_(!0);
|
|
453
|
+
const t = await Te();
|
|
454
|
+
J(t);
|
|
455
|
+
} catch {
|
|
456
|
+
} finally {
|
|
457
|
+
_(!1);
|
|
458
|
+
}
|
|
459
|
+
}, []);
|
|
460
|
+
return ce(() => {
|
|
461
|
+
if (!e)
|
|
462
|
+
return;
|
|
463
|
+
e.instructions && D(e.instructions), e.location && p(e.location), e.tags && x({ prompts: e.tags }), e.sendOnEnter !== void 0 && b(e.sendOnEnter), e.useMemory !== void 0 && $(e.useMemory), e.showDetails !== void 0 && w(e.showDetails);
|
|
464
|
+
const t = Ne();
|
|
465
|
+
V(t), q(t);
|
|
466
|
+
}, [e]), ce(() => {
|
|
467
|
+
L ? j() : J(null);
|
|
468
|
+
}, [L, j]), c ? /* @__PURE__ */ u(de, { children: [
|
|
469
|
+
/* @__PURE__ */ u(
|
|
470
|
+
Me,
|
|
471
|
+
{
|
|
472
|
+
open: a,
|
|
473
|
+
onOpenChange: ae,
|
|
474
|
+
title: ve,
|
|
475
|
+
animation: !0,
|
|
476
|
+
animationType: "fade",
|
|
477
|
+
footer: /* @__PURE__ */ u(
|
|
478
|
+
Ce,
|
|
479
|
+
{
|
|
480
|
+
columnGap: 2,
|
|
481
|
+
alignHorizontal: "flex-end",
|
|
482
|
+
className: "pb-8 sm:pb-0",
|
|
483
|
+
children: [
|
|
484
|
+
/* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(
|
|
485
|
+
oe,
|
|
486
|
+
{
|
|
487
|
+
mode: "dark",
|
|
488
|
+
variant: "secondary",
|
|
489
|
+
focusMode: "light",
|
|
490
|
+
noBorder: !0,
|
|
491
|
+
onClick: ae,
|
|
492
|
+
children: "Cancel"
|
|
493
|
+
}
|
|
494
|
+
) }),
|
|
495
|
+
/* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(
|
|
496
|
+
oe,
|
|
497
|
+
{
|
|
498
|
+
mode: "dark",
|
|
499
|
+
focusMode: "light",
|
|
500
|
+
onClick: async (t) => {
|
|
501
|
+
n(!1), await se(t);
|
|
502
|
+
},
|
|
503
|
+
children: "Save"
|
|
504
|
+
}
|
|
505
|
+
) })
|
|
506
|
+
]
|
|
507
|
+
}
|
|
508
|
+
),
|
|
509
|
+
children: [
|
|
510
|
+
/* @__PURE__ */ u(
|
|
511
|
+
G,
|
|
512
|
+
{
|
|
513
|
+
header: A.SETTINGS_DETAILS.TITLE,
|
|
514
|
+
className: "prose-dark dark:prose-lighter",
|
|
515
|
+
noBorder: !0,
|
|
516
|
+
children: [
|
|
517
|
+
/* @__PURE__ */ r("p", { className: "text-sm", children: A.SETTINGS_DETAILS.DETAILS }),
|
|
518
|
+
/* @__PURE__ */ r(
|
|
519
|
+
R,
|
|
520
|
+
{
|
|
521
|
+
noBorder: !0,
|
|
522
|
+
narrow: !0,
|
|
523
|
+
className: "mt-2",
|
|
524
|
+
label: "Show Message Statistics",
|
|
525
|
+
name: "show-message-statistics",
|
|
526
|
+
onChange: Z,
|
|
527
|
+
checked: Q
|
|
528
|
+
}
|
|
529
|
+
),
|
|
530
|
+
/* @__PURE__ */ r("p", { className: "text-sm mt-5", children: A.SETTINGS_DETAILS.SEND_ON_ENTER }),
|
|
531
|
+
/* @__PURE__ */ r(
|
|
532
|
+
R,
|
|
533
|
+
{
|
|
534
|
+
noBorder: !0,
|
|
535
|
+
narrow: !0,
|
|
536
|
+
className: "mt-2",
|
|
537
|
+
label: "Send Message on Enter",
|
|
538
|
+
name: "send-message-on-enter",
|
|
539
|
+
onChange: ee,
|
|
540
|
+
checked: S
|
|
541
|
+
}
|
|
542
|
+
),
|
|
543
|
+
M && /* @__PURE__ */ u(de, { children: [
|
|
544
|
+
/* @__PURE__ */ r("p", { className: "text-sm mt-5", children: A.SETTINGS_DETAILS.USE_MEMORY }),
|
|
545
|
+
/* @__PURE__ */ r(
|
|
546
|
+
R,
|
|
547
|
+
{
|
|
548
|
+
noBorder: !0,
|
|
549
|
+
narrow: !0,
|
|
550
|
+
className: "mt-2",
|
|
551
|
+
label: "Use Memory",
|
|
552
|
+
name: "use-memory",
|
|
553
|
+
onChange: O,
|
|
554
|
+
checked: N
|
|
555
|
+
}
|
|
556
|
+
),
|
|
557
|
+
N && /* @__PURE__ */ r(
|
|
558
|
+
oe,
|
|
559
|
+
{
|
|
560
|
+
variant: "secondary",
|
|
561
|
+
noBorder: !0,
|
|
562
|
+
size: "small",
|
|
563
|
+
className: "mt-3",
|
|
564
|
+
onClick: () => z(!0),
|
|
565
|
+
children: "Manage Memories"
|
|
566
|
+
}
|
|
567
|
+
)
|
|
568
|
+
] })
|
|
569
|
+
]
|
|
570
|
+
}
|
|
571
|
+
),
|
|
572
|
+
/* @__PURE__ */ u(
|
|
573
|
+
G,
|
|
574
|
+
{
|
|
575
|
+
header: "Custom Instructions",
|
|
576
|
+
className: "prose-dark dark:prose-lighter mt-4",
|
|
577
|
+
noBorder: !0,
|
|
578
|
+
children: [
|
|
579
|
+
/* @__PURE__ */ u("p", { className: "text-sm", children: [
|
|
580
|
+
"What would you like ",
|
|
581
|
+
/* @__PURE__ */ r("em", { children: we }),
|
|
582
|
+
" to know about you to provide better responses?"
|
|
583
|
+
] }),
|
|
584
|
+
/* @__PURE__ */ r(
|
|
585
|
+
ie,
|
|
586
|
+
{
|
|
587
|
+
mode: "alt-system",
|
|
588
|
+
autoCapitalize: "off",
|
|
589
|
+
autoComplete: "off",
|
|
590
|
+
autoCorrect: "off",
|
|
591
|
+
name: "customInstructions",
|
|
592
|
+
label: "Custom Instructions",
|
|
593
|
+
value: I,
|
|
594
|
+
onChange: (t) => {
|
|
595
|
+
D(t.target.value);
|
|
596
|
+
},
|
|
597
|
+
helperText: "Press ENTER to add a new line."
|
|
598
|
+
}
|
|
599
|
+
)
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
),
|
|
603
|
+
/* @__PURE__ */ u(
|
|
604
|
+
G,
|
|
605
|
+
{
|
|
606
|
+
header: "Location",
|
|
607
|
+
className: "prose-dark dark:prose-lighter mt-4",
|
|
608
|
+
noBorder: !0,
|
|
609
|
+
children: [
|
|
610
|
+
/* @__PURE__ */ r("p", { className: "text-sm", children: "You can share your location to receive customized responses based on your area." }),
|
|
611
|
+
/* @__PURE__ */ r(
|
|
612
|
+
ie,
|
|
613
|
+
{
|
|
614
|
+
mode: "alt-system",
|
|
615
|
+
name: "location",
|
|
616
|
+
label: "Location",
|
|
617
|
+
value: B,
|
|
618
|
+
onChange: (t) => {
|
|
619
|
+
p(t.target.value);
|
|
620
|
+
},
|
|
621
|
+
helperText: "Enter your location or press auto-detect."
|
|
622
|
+
}
|
|
623
|
+
),
|
|
624
|
+
/* @__PURE__ */ r(
|
|
625
|
+
oe,
|
|
626
|
+
{
|
|
627
|
+
className: "mt-2",
|
|
628
|
+
size: "small",
|
|
629
|
+
noBorder: !0,
|
|
630
|
+
variant: "secondary",
|
|
631
|
+
disabled: y.loadingLocation,
|
|
632
|
+
onClick: re,
|
|
633
|
+
children: y.loadingLocation ? "Detecting..." : "Auto-detect"
|
|
634
|
+
}
|
|
635
|
+
)
|
|
636
|
+
]
|
|
637
|
+
}
|
|
638
|
+
),
|
|
639
|
+
/* @__PURE__ */ u(
|
|
640
|
+
G,
|
|
641
|
+
{
|
|
642
|
+
header: A.SETTINGS_PROMPTS.TITLE,
|
|
643
|
+
className: "prose-dark dark:prose-lighter mt-4",
|
|
644
|
+
noBorder: !0,
|
|
645
|
+
children: [
|
|
646
|
+
/* @__PURE__ */ r("p", { className: "text-sm", children: Se }),
|
|
647
|
+
v.prompts && v.prompts.slice(0, 3).map((t) => /* @__PURE__ */ u(
|
|
648
|
+
G,
|
|
649
|
+
{
|
|
650
|
+
mode: "dark",
|
|
651
|
+
noBorder: !0,
|
|
652
|
+
header: t.label.replace("...", ""),
|
|
653
|
+
className: "prose-light mb-2",
|
|
654
|
+
children: [
|
|
655
|
+
/* @__PURE__ */ r("p", { className: "text-sm", children: t.description }),
|
|
656
|
+
/* @__PURE__ */ r(
|
|
657
|
+
R,
|
|
658
|
+
{
|
|
659
|
+
noBorder: !0,
|
|
660
|
+
narrow: !0,
|
|
661
|
+
mode: "dark",
|
|
662
|
+
focusMode: "light",
|
|
663
|
+
className: "mt-2",
|
|
664
|
+
label: "Enabled",
|
|
665
|
+
name: t.slot.toString(),
|
|
666
|
+
onChange: (l) => {
|
|
667
|
+
F({
|
|
668
|
+
...t,
|
|
669
|
+
enabled: l
|
|
670
|
+
});
|
|
671
|
+
},
|
|
672
|
+
checked: t.enabled
|
|
673
|
+
}
|
|
674
|
+
),
|
|
675
|
+
/* @__PURE__ */ r(
|
|
676
|
+
R,
|
|
677
|
+
{
|
|
678
|
+
noBorder: !0,
|
|
679
|
+
narrow: !0,
|
|
680
|
+
mode: "dark",
|
|
681
|
+
focusMode: "light",
|
|
682
|
+
className: "mt-2",
|
|
683
|
+
label: "Private Chat",
|
|
684
|
+
name: `private-${t.slot.toString()}`,
|
|
685
|
+
onChange: (l) => {
|
|
686
|
+
F({
|
|
687
|
+
...t,
|
|
688
|
+
privateChat: l
|
|
689
|
+
});
|
|
690
|
+
},
|
|
691
|
+
checked: t.privateChat
|
|
692
|
+
}
|
|
693
|
+
),
|
|
694
|
+
/* @__PURE__ */ r(
|
|
695
|
+
R,
|
|
696
|
+
{
|
|
697
|
+
noBorder: !0,
|
|
698
|
+
narrow: !0,
|
|
699
|
+
mode: "dark",
|
|
700
|
+
focusMode: "light",
|
|
701
|
+
className: "mt-2",
|
|
702
|
+
label: "Use Clipboard",
|
|
703
|
+
name: `clipboard-${t.slot.toString()}`,
|
|
704
|
+
onChange: (l) => {
|
|
705
|
+
F({
|
|
706
|
+
...t,
|
|
707
|
+
clipboardAccess: l
|
|
708
|
+
});
|
|
709
|
+
},
|
|
710
|
+
checked: t.clipboardAccess
|
|
711
|
+
}
|
|
712
|
+
)
|
|
713
|
+
]
|
|
714
|
+
},
|
|
715
|
+
`prompt-slot-${t.slot}`
|
|
716
|
+
))
|
|
717
|
+
]
|
|
718
|
+
}
|
|
719
|
+
),
|
|
720
|
+
/* @__PURE__ */ u(
|
|
721
|
+
G,
|
|
722
|
+
{
|
|
723
|
+
header: A.SETTINGS_CACHING.TITLE,
|
|
724
|
+
className: "prose-dark dark:prose-lighter mt-4 ",
|
|
725
|
+
noBorder: !0,
|
|
726
|
+
children: [
|
|
727
|
+
/* @__PURE__ */ r("p", { className: "text-sm", children: A.SETTINGS_CACHING.DESCRIPTION }),
|
|
728
|
+
/* @__PURE__ */ r(
|
|
729
|
+
R,
|
|
730
|
+
{
|
|
731
|
+
noBorder: !0,
|
|
732
|
+
narrow: !0,
|
|
733
|
+
className: "mt-2",
|
|
734
|
+
label: "Enable Assets Caching",
|
|
735
|
+
name: "enable-service-worker",
|
|
736
|
+
onChange: te,
|
|
737
|
+
checked: U
|
|
738
|
+
}
|
|
739
|
+
),
|
|
740
|
+
L && /* @__PURE__ */ u("div", { className: "mt-4 p-3 border border-dashed border-neutral-700 dark:border-neutral-400 rounded @container/optimizations", children: [
|
|
741
|
+
/* @__PURE__ */ r("h3", { className: "m-0 mb-2 text-xs uppercase opacity-70", children: "Cache Info" }),
|
|
742
|
+
m ? /* @__PURE__ */ u("div", { className: "text-xs space-y-2", children: [
|
|
743
|
+
/* @__PURE__ */ u("p", { className: "m-0", children: [
|
|
744
|
+
"Version: ",
|
|
745
|
+
/* @__PURE__ */ r("strong", { children: m.version })
|
|
746
|
+
] }),
|
|
747
|
+
/* @__PURE__ */ u("p", { className: "m-0", children: [
|
|
748
|
+
"Total Items: ",
|
|
749
|
+
/* @__PURE__ */ r("strong", { children: m.totalItems })
|
|
750
|
+
] }),
|
|
751
|
+
m.caches.map((t) => /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("ul", { className: "not-prose font-mono mt-2 list-none w-[95cqw]", children: t.urls.map((l) => /* @__PURE__ */ r(
|
|
752
|
+
"li",
|
|
753
|
+
{
|
|
754
|
+
className: "truncate text-xs text-copy-dark dark:text-copy-light overflow-hidden text-ellipsis",
|
|
755
|
+
title: l,
|
|
756
|
+
children: new URL(l).pathname
|
|
757
|
+
},
|
|
758
|
+
l
|
|
759
|
+
)) }) }, t.name)),
|
|
760
|
+
m.totalItems === 0 && !K && /* @__PURE__ */ r("p", { className: "italic m-0 opacity-70", children: "No cached assets yet." })
|
|
761
|
+
] }) : /* @__PURE__ */ r("p", { className: "text-xs opacity-70 m-0", children: K ? "Loading cache info..." : "No cache info available." })
|
|
762
|
+
] })
|
|
763
|
+
]
|
|
764
|
+
}
|
|
765
|
+
)
|
|
766
|
+
]
|
|
767
|
+
}
|
|
768
|
+
),
|
|
769
|
+
/* @__PURE__ */ r(
|
|
770
|
+
Ae,
|
|
771
|
+
{
|
|
772
|
+
open: W,
|
|
773
|
+
onOpenChange: z,
|
|
774
|
+
user: s?.username
|
|
775
|
+
}
|
|
776
|
+
)
|
|
777
|
+
] }) : null;
|
|
778
|
+
};
|
|
779
|
+
export {
|
|
780
|
+
Ze as SettingsPanel
|
|
781
|
+
};
|