@versini/sassysaint 8.52.0 → 8.54.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.
Files changed (25) hide show
  1. package/dist/chunks/{AboutChangelog.BXP_S_6h.js → AboutChangelog.B9nDZe3K.js} +2 -2
  2. package/dist/chunks/{AboutEntry.xxSM1oC2.js → AboutEntry.BeGJGDPe.js} +5 -5
  3. package/dist/chunks/{App.vcT52Cxv.js → App.BmUEowbc.js} +1460 -1404
  4. package/dist/chunks/{Chart.BL7C958a.js → Chart.CzdIORdS.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.BvSTXfZu.js → ChatBubbleAssistant.OB8R738h.js} +4 -4
  6. package/dist/chunks/{ChatBubbleUser.DAG3DtIn.js → ChatBubbleUser.D8HJY2x_.js} +3 -3
  7. package/dist/chunks/{ChatHistoryTable.OynguQ8f.js → ChatHistoryTable.r5JcCYqk.js} +3 -3
  8. package/dist/chunks/{HistoryEntry.c-t2Qly1.js → HistoryEntry.BuY2Bv0R.js} +3 -3
  9. package/dist/chunks/{ProfileEntry.Cp6GKTXd.js → ProfileEntry.DloW2WvY.js} +2 -2
  10. package/dist/chunks/SettingsEntry.eJrAIi7y.js +777 -0
  11. package/dist/chunks/{Table.BHKK2hx0.js → Table.BnhJmkZC.js} +2 -2
  12. package/dist/chunks/{UsageEntry.DQ8C9RD2.js → UsageEntry.CCXNc5Y_.js} +3 -3
  13. package/dist/chunks/UserMemoriesPanel.B38gBvdE.js +197 -0
  14. package/dist/chunks/{index.DOGFTmsP.js → index.B6rRPzOs.js} +1 -1
  15. package/dist/chunks/{index.MR8A9dOE.js → index.C_x8MF7I.js} +2 -2
  16. package/dist/chunks/{index.4-oS1zsv.js → index.CegCInPa.js} +1 -1
  17. package/dist/chunks/{index.CTR90Zgl.js → index.D_k-KOpB.js} +1 -1
  18. package/dist/chunks/{index.eMvwIUBJ.js → index.Dj1SDcB6.js} +1 -1
  19. package/dist/chunks/{index.CQ6wFEdL.js → index.ngl9rapw.js} +3 -3
  20. package/dist/chunks/{index.Cs-kxUcH.js → index.oOqpVbjJ.js} +5 -5
  21. package/dist/chunks/{useMarkdown.DboPchKq.js → useMarkdown.Cj71fxpP.js} +6 -6
  22. package/dist/components/SassySaint/SassySaint.js +1 -1
  23. package/dist/index.js +4 -4
  24. package/package.json +3 -3
  25. package/dist/chunks/SettingsEntry.CBvovzte.js +0 -964
@@ -0,0 +1,777 @@
1
+ import { jsxs as m, jsx as r, Fragment as de } from "react/jsx-runtime";
2
+ import { o as ge, h as me, i as ye, x as xe, n as be, useUserPreferences as ke, le as Ee, getCacheInfo as Te, isServiceWorkerEnabled as Ne, SETTINGS_TITLE as we, S as U, CARDS as A, C as oe, de as ve, PROMPTS_DESCRIPTION as Se, L as Ce, j as ue, getCurrentGeoLocation as Ie, mutateCall as he, handleServiceWorkerToggle as Le, SERVICE_TYPES as pe } from "./index.oOqpVbjJ.js";
3
+ import { useCapability as _e, se as Me, L as D } from "./App.BmUEowbc.js";
4
+ import Pe, { useState as d, useEffect as ce, useRef as H, useLayoutEffect as X, useCallback as Oe } from "react";
5
+ import { UserMemoriesPanel as Ae } from "./UserMemoriesPanel.B38gBvdE.js";
6
+ import g from "clsx";
7
+ function De({
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
+ ), w = (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, w, !1];
25
+ }
26
+ const fe = "av-text-area", Re = "av-text-area-wrapper", ne = "av-text-area-helper-text", Be = "av-text-area__control--right", Ge = "av-text-area__control--left", Ue = () => "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-[12px]": 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-[12px]": 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-[12px]": 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: w
123
+ }) => {
124
+ const x = o ? a : g(
125
+ "relative flex w-full flex-col justify-center",
126
+ Re,
127
+ a
128
+ ), I = o ? g(n) : g(
129
+ fe,
130
+ n,
131
+ Ue(),
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
+ ), R = o ? void 0 : "sr-only", B = We({
142
+ disabled: e,
143
+ raw: o,
144
+ error: h,
145
+ mode: y,
146
+ rightElement: w,
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(Ge, "absolute");
154
+ return {
155
+ wrapper: x,
156
+ textArea: I,
157
+ accessibleLabel: R,
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 = Pe.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: w,
191
+ defaultValue: x,
192
+ disabled: I = !1,
193
+ noBorder: R = !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
+ ...G
203
+ }, q) => {
204
+ const u = H(null), J = ge([q, u]), [K, _] = me(), [Q, v] = me(), W = H(80), z = H(-25), M = H(null), Z = H(30), ee = H(null), P = 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: R,
214
+ mode: y,
215
+ rightElement: !!b,
216
+ leftElement: !!N
217
+ }), [f, Y] = De({
218
+ value: w,
219
+ initialControlledDelay: 20,
220
+ defaultValue: x,
221
+ onChange: (i) => {
222
+ $ && $({
223
+ target: {
224
+ value: i
225
+ }
226
+ });
227
+ }
228
+ }), C = (i) => {
229
+ Y(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 X(() => {
236
+ _ && _.width && se(_.width + 18 + 10);
237
+ }, [_]), X(() => {
238
+ v && v.width && ae(v.width + 18 + 10);
239
+ }, [v]), X(() => {
240
+ e || u && u.current && f !== void 0 && (u.current.style.height = "inherit", u.current.style.height = u.current.scrollHeight + "px");
241
+ }, [f, e]), X(() => {
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]), X(() => {
249
+ if (!e && u && u.current && f !== void 0) {
250
+ const { labelOffset: i, helperTextOffset: O, scrollHeight: le } = je({
251
+ scrollHeight: u.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
+ )), O && (Z.current = O, ee?.current?.style.setProperty(
260
+ "--av-text-area-helper-text",
261
+ `${O}px`
262
+ )), W.current = le || W.current;
263
+ }
264
+ }, [f, e]), v.width > 0 && M?.current?.style.setProperty(
265
+ "--tw-translate-x",
266
+ `${12 + v.width + 5}px`
267
+ ), /* @__PURE__ */ m("div", { className: l.wrapper, children: [
268
+ /* @__PURE__ */ r(
269
+ "label",
270
+ {
271
+ htmlFor: P,
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: P,
290
+ name: n,
291
+ disabled: I,
292
+ placeholder: e ? void 0 : " ",
293
+ className: l.textArea,
294
+ rows: 1,
295
+ ...p && { "aria-describedby": `${P}-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
+ ...G
310
+ }
311
+ ),
312
+ !e && /* @__PURE__ */ r(
313
+ "label",
314
+ {
315
+ ref: M,
316
+ "aria-hidden": !0,
317
+ htmlFor: P,
318
+ className: `${l.visibleLabel}`,
319
+ children: o
320
+ }
321
+ ),
322
+ F && /* @__PURE__ */ r(
323
+ "div",
324
+ {
325
+ ref: ee,
326
+ id: `${P}-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.1
346
+ © 2025 gizmette.com
347
+ */
348
+ try {
349
+ window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
350
+ version: "5.0.1",
351
+ buildTime: "09/01/2025 04:01 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
+ }), [w, x] = d({
371
+ prompts: []
372
+ }), [I, R] = d(""), [B, p] = d(""), [S, b] = d(!1), [N, $] = d(!1), [L, V] = d(!1), [G, q] = d(!1), [u, J] = d(null), [K, _] = d(!1), [Q, v] = d(!1), [W, z] = d(!1), M = _e(Ee.TOOL.MEMORIES), Z = (t) => {
373
+ v(t);
374
+ }, ee = (t) => {
375
+ b(t);
376
+ }, P = (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: w.prompts,
392
+ sendOnEnter: S,
393
+ useMemory: N,
394
+ showDetails: Q
395
+ }
396
+ }), G !== L && (await Le(G), V(G)), 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: O } = f.data, le = k && E && i ? `${k}, ${E}, ${i}` : O;
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
+ ...Y
432
+ }) => {
433
+ x((C) => {
434
+ const k = C.prompts, E = {
435
+ ...Y,
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((O) => O.slot === Y.slot);
442
+ return i === -1 ? {
443
+ ...C,
444
+ prompts: [...k, { ...E }]
445
+ } : (k[i] = E, {
446
+ ...C,
447
+ prompts: [...k]
448
+ });
449
+ });
450
+ }, j = Oe(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 && R(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 && v(e.showDetails);
464
+ const t = Ne();
465
+ V(t), q(t);
466
+ }, [e]), ce(() => {
467
+ L ? j() : J(null);
468
+ }, [L, j]), c ? /* @__PURE__ */ m(de, { children: [
469
+ /* @__PURE__ */ m(
470
+ Me,
471
+ {
472
+ open: a,
473
+ onOpenChange: ae,
474
+ title: we,
475
+ animation: !0,
476
+ animationType: "fade",
477
+ footer: /* @__PURE__ */ m(
478
+ Ce,
479
+ {
480
+ columnGap: 2,
481
+ alignHorizontal: "flex-end",
482
+ className: "pb-8 sm:pb-0",
483
+ children: [
484
+ /* @__PURE__ */ r(ue, { 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(ue, { 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__ */ m(
511
+ U,
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
+ D,
520
+ {
521
+ narrow: !0,
522
+ className: "mt-2",
523
+ label: "Show Message Statistics",
524
+ name: "show-message-statistics",
525
+ onChange: Z,
526
+ checked: Q
527
+ }
528
+ ),
529
+ /* @__PURE__ */ r("p", { className: "text-sm mt-5", children: A.SETTINGS_DETAILS.SEND_ON_ENTER }),
530
+ /* @__PURE__ */ r(
531
+ D,
532
+ {
533
+ narrow: !0,
534
+ className: "mt-2",
535
+ label: "Send Message on Enter",
536
+ name: "send-message-on-enter",
537
+ onChange: ee,
538
+ checked: S
539
+ }
540
+ ),
541
+ M && /* @__PURE__ */ m(de, { children: [
542
+ /* @__PURE__ */ r("p", { className: "text-sm mt-5", children: A.SETTINGS_DETAILS.USE_MEMORY }),
543
+ /* @__PURE__ */ r(
544
+ D,
545
+ {
546
+ narrow: !0,
547
+ className: "mt-2",
548
+ label: "Use Memory",
549
+ name: "use-memory",
550
+ onChange: P,
551
+ checked: N
552
+ }
553
+ ),
554
+ N && /* @__PURE__ */ r(
555
+ oe,
556
+ {
557
+ variant: "secondary",
558
+ noBorder: !0,
559
+ size: "small",
560
+ className: "mt-3",
561
+ onClick: () => z(!0),
562
+ children: "Manage Memories"
563
+ }
564
+ )
565
+ ] })
566
+ ]
567
+ }
568
+ ),
569
+ /* @__PURE__ */ m(
570
+ U,
571
+ {
572
+ header: "Custom Instructions",
573
+ className: "prose-dark dark:prose-lighter mt-4",
574
+ noBorder: !0,
575
+ children: [
576
+ /* @__PURE__ */ m("p", { className: "text-sm", children: [
577
+ "What would you like ",
578
+ /* @__PURE__ */ r("em", { children: ve }),
579
+ " to know about you to provide better responses?"
580
+ ] }),
581
+ /* @__PURE__ */ r(
582
+ ie,
583
+ {
584
+ mode: "alt-system",
585
+ autoCapitalize: "off",
586
+ autoComplete: "off",
587
+ autoCorrect: "off",
588
+ name: "customInstructions",
589
+ label: "Custom Instructions",
590
+ value: I,
591
+ onChange: (t) => {
592
+ R(t.target.value);
593
+ },
594
+ helperText: "Press ENTER to add a new line."
595
+ }
596
+ )
597
+ ]
598
+ }
599
+ ),
600
+ /* @__PURE__ */ m(
601
+ U,
602
+ {
603
+ header: "Location",
604
+ className: "prose-dark dark:prose-lighter mt-4",
605
+ noBorder: !0,
606
+ children: [
607
+ /* @__PURE__ */ r("p", { className: "text-sm", children: "You can share your location to receive customized responses based on your area." }),
608
+ /* @__PURE__ */ r(
609
+ ie,
610
+ {
611
+ mode: "alt-system",
612
+ name: "location",
613
+ label: "Location",
614
+ value: B,
615
+ onChange: (t) => {
616
+ p(t.target.value);
617
+ },
618
+ helperText: "Enter your location or press auto-detect."
619
+ }
620
+ ),
621
+ /* @__PURE__ */ r(
622
+ oe,
623
+ {
624
+ className: "mt-2",
625
+ size: "small",
626
+ noBorder: !0,
627
+ variant: "secondary",
628
+ disabled: y.loadingLocation,
629
+ onClick: re,
630
+ children: y.loadingLocation ? "Detecting..." : "Auto-detect"
631
+ }
632
+ )
633
+ ]
634
+ }
635
+ ),
636
+ /* @__PURE__ */ m(
637
+ U,
638
+ {
639
+ header: A.SETTINGS_PROMPTS.TITLE,
640
+ className: "prose-dark dark:prose-lighter mt-4",
641
+ noBorder: !0,
642
+ children: [
643
+ /* @__PURE__ */ r("p", { className: "text-sm", children: Se }),
644
+ w.prompts && w.prompts.slice(0, 3).map((t) => /* @__PURE__ */ m(
645
+ U,
646
+ {
647
+ mode: "dark",
648
+ noBorder: !0,
649
+ header: t.label.replace("...", ""),
650
+ className: "prose-light mb-2",
651
+ children: [
652
+ /* @__PURE__ */ r("p", { className: "text-sm", children: t.description }),
653
+ /* @__PURE__ */ r(
654
+ D,
655
+ {
656
+ narrow: !0,
657
+ mode: "dark",
658
+ focusMode: "light",
659
+ className: "mt-2",
660
+ noBorder: !0,
661
+ label: "Enabled",
662
+ name: t.slot.toString(),
663
+ onChange: (l) => {
664
+ F({
665
+ ...t,
666
+ enabled: l
667
+ });
668
+ },
669
+ checked: t.enabled
670
+ }
671
+ ),
672
+ /* @__PURE__ */ r(
673
+ D,
674
+ {
675
+ narrow: !0,
676
+ mode: "dark",
677
+ focusMode: "light",
678
+ className: "mt-2",
679
+ noBorder: !0,
680
+ label: "Private Chat",
681
+ name: `private-${t.slot.toString()}`,
682
+ onChange: (l) => {
683
+ F({
684
+ ...t,
685
+ privateChat: l
686
+ });
687
+ },
688
+ checked: t.privateChat
689
+ }
690
+ ),
691
+ /* @__PURE__ */ r(
692
+ D,
693
+ {
694
+ narrow: !0,
695
+ mode: "dark",
696
+ focusMode: "light",
697
+ className: "mt-2",
698
+ noBorder: !0,
699
+ label: "Use Clipboard",
700
+ name: `clipboard-${t.slot.toString()}`,
701
+ onChange: (l) => {
702
+ F({
703
+ ...t,
704
+ clipboardAccess: l
705
+ });
706
+ },
707
+ checked: t.clipboardAccess
708
+ }
709
+ )
710
+ ]
711
+ },
712
+ `prompt-slot-${t.slot}`
713
+ ))
714
+ ]
715
+ }
716
+ ),
717
+ /* @__PURE__ */ m(
718
+ U,
719
+ {
720
+ header: A.SETTINGS_CACHING.TITLE,
721
+ className: "prose-dark dark:prose-lighter mt-4 ",
722
+ noBorder: !0,
723
+ children: [
724
+ /* @__PURE__ */ r("p", { className: "text-sm", children: A.SETTINGS_CACHING.DESCRIPTION }),
725
+ /* @__PURE__ */ r(
726
+ D,
727
+ {
728
+ narrow: !0,
729
+ className: "mt-2",
730
+ label: "Enable Assets Caching",
731
+ name: "enable-service-worker",
732
+ onChange: te,
733
+ checked: G
734
+ }
735
+ ),
736
+ L && /* @__PURE__ */ m("div", { className: "mt-4 p-3 border border-dashed border-neutral-700 dark:border-neutral-400 rounded @container/optimizations", children: [
737
+ /* @__PURE__ */ r("h3", { className: "m-0 mb-2 text-xs uppercase opacity-70", children: "Cache Info" }),
738
+ u ? /* @__PURE__ */ m("div", { className: "text-xs space-y-2", children: [
739
+ /* @__PURE__ */ m("p", { className: "m-0", children: [
740
+ "Version: ",
741
+ /* @__PURE__ */ r("strong", { children: u.version })
742
+ ] }),
743
+ /* @__PURE__ */ m("p", { className: "m-0", children: [
744
+ "Total Items: ",
745
+ /* @__PURE__ */ r("strong", { children: u.totalItems })
746
+ ] }),
747
+ u.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(
748
+ "li",
749
+ {
750
+ className: "truncate text-xs text-copy-dark dark:text-copy-light overflow-hidden text-ellipsis",
751
+ title: l,
752
+ children: new URL(l).pathname
753
+ },
754
+ l
755
+ )) }) }, t.name)),
756
+ u.totalItems === 0 && !K && /* @__PURE__ */ r("p", { className: "italic m-0 opacity-70", children: "No cached assets yet." })
757
+ ] }) : /* @__PURE__ */ r("p", { className: "text-xs opacity-70 m-0", children: K ? "Loading cache info..." : "No cache info available." })
758
+ ] })
759
+ ]
760
+ }
761
+ )
762
+ ]
763
+ }
764
+ ),
765
+ /* @__PURE__ */ r(
766
+ Ae,
767
+ {
768
+ open: W,
769
+ onOpenChange: z,
770
+ user: s?.username
771
+ }
772
+ )
773
+ ] }) : null;
774
+ };
775
+ export {
776
+ Ze as SettingsPanel
777
+ };