@versini/sassysaint 8.58.2 → 8.59.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 (27) hide show
  1. package/dist/chunks/{AboutChangelog.BJb6evn9.js → AboutChangelog.VIMWfrJ2.js} +2 -2
  2. package/dist/chunks/{AboutEntry.CKS9KQYk.js → AboutEntry.HhBVaghX.js} +9 -9
  3. package/dist/chunks/{App.Bw24TFS-.js → App.DFkumxrG.js} +1798 -1780
  4. package/dist/chunks/{Chart.Cddg0IXQ.js → Chart.DyiU5Qev.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.6-hK6qAF.js → ChatBubbleAssistant.a1OalMkY.js} +4 -4
  6. package/dist/chunks/{ChatBubbleUser.DpUR_1HU.js → ChatBubbleUser.DP50erQL.js} +3 -3
  7. package/dist/chunks/{ChatHistoryTable.BB5ESpr2.js → ChatHistoryTable.9NfCFVTm.js} +3 -3
  8. package/dist/chunks/{HistoryEntry.BQlLgB9G.js → HistoryEntry.Dz-6Alzn.js} +14 -14
  9. package/dist/chunks/{ProfileEntry.CuUO01aL.js → ProfileEntry.DJ4q6KoG.js} +2 -2
  10. package/dist/chunks/SettingsEntry.Cc0vofff.js +430 -0
  11. package/dist/chunks/{Table.BLNonpLk.js → Table.CGJz3l0P.js} +2 -2
  12. package/dist/chunks/{UsageEntry.CuWrk617.js → UsageEntry.B6zt1DS_.js} +3 -3
  13. package/dist/chunks/UserMemoriesPanel.C2262GRv.js +693 -0
  14. package/dist/chunks/{index.BjpuOtB7.js → index.6QVNoWZY.js} +616 -584
  15. package/dist/chunks/{index.Dgyiis4p.js → index.BlzmTlvN.js} +2 -2
  16. package/dist/chunks/{index.YTqgXQdg.js → index.CGcokH1z.js} +3 -3
  17. package/dist/chunks/{index.Ds-UToar.js → index.CV96FPnP.js} +1 -1
  18. package/dist/chunks/{index.CQgBz9Dt.js → index.D69nnw0C.js} +1 -1
  19. package/dist/chunks/{index.Cs8bFhFv.js → index.DXesyWpt.js} +1 -1
  20. package/dist/chunks/{index.CcOFJwqN.js → index.en8Vui5r.js} +1 -1
  21. package/dist/chunks/{useMarkdown.CskeXXFn.js → useMarkdown.DRQL-Q_k.js} +6 -6
  22. package/dist/components/SassySaint/SassySaint.js +1 -1
  23. package/dist/index.js +4 -4
  24. package/dist/style.css +1 -1
  25. package/package.json +3 -3
  26. package/dist/chunks/SettingsEntry.6T_vvycf.js +0 -781
  27. package/dist/chunks/UserMemoriesPanel.3ikfhdxH.js +0 -205
@@ -1,781 +0,0 @@
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, Re as Ee, getCacheInfo as Te, isServiceWorkerEnabled as Ne, SETTINGS_TITLE as we, S as U, CARDS as A, C as oe, le 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.BjpuOtB7.js";
3
- import { useCapability as _e, se as Me, O as B } from "./App.Bw24TFS-.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.3ikfhdxH.js";
6
- import g from "clsx";
7
- function Be({
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", De = "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", D = 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(De, "absolute"), b = o ? void 0 : g(Ge, "absolute");
154
- return {
155
- wrapper: x,
156
- textArea: I,
157
- accessibleLabel: R,
158
- visibleLabel: D,
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: D,
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] = Be({
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: D,
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(""), [D, 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: D,
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
- B,
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
- B,
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__ */ m(de, { children: [
544
- /* @__PURE__ */ r("p", { className: "text-sm mt-5", children: A.SETTINGS_DETAILS.USE_MEMORY }),
545
- /* @__PURE__ */ r(
546
- B,
547
- {
548
- noBorder: !0,
549
- narrow: !0,
550
- className: "mt-2",
551
- label: "Use Memory",
552
- name: "use-memory",
553
- onChange: P,
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__ */ m(
573
- U,
574
- {
575
- header: "Custom Instructions",
576
- className: "prose-dark dark:prose-lighter mt-4",
577
- noBorder: !0,
578
- children: [
579
- /* @__PURE__ */ m("p", { className: "text-sm", children: [
580
- "What would you like ",
581
- /* @__PURE__ */ r("em", { children: ve }),
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
- R(t.target.value);
596
- },
597
- helperText: "Press ENTER to add a new line."
598
- }
599
- )
600
- ]
601
- }
602
- ),
603
- /* @__PURE__ */ m(
604
- U,
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: D,
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__ */ m(
640
- U,
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
- w.prompts && w.prompts.slice(0, 3).map((t) => /* @__PURE__ */ m(
648
- U,
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
- B,
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
- B,
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
- B,
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__ */ m(
721
- U,
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
- B,
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: G
738
- }
739
- ),
740
- L && /* @__PURE__ */ m("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
- u ? /* @__PURE__ */ m("div", { className: "text-xs space-y-2", children: [
743
- /* @__PURE__ */ m("p", { className: "m-0", children: [
744
- "Version: ",
745
- /* @__PURE__ */ r("strong", { children: u.version })
746
- ] }),
747
- /* @__PURE__ */ m("p", { className: "m-0", children: [
748
- "Total Items: ",
749
- /* @__PURE__ */ r("strong", { children: u.totalItems })
750
- ] }),
751
- 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(
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
- u.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
- };