@versini/sassysaint 8.59.4 → 8.61.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.Ce5xKXvl.js → AboutChangelog.khIO6IQv.js} +2 -2
  2. package/dist/chunks/{AboutEntry.BIxJ0nBU.js → AboutEntry.C8vztscz.js} +7 -7
  3. package/dist/chunks/{App.C0TMLCXL.js → App.BrPp8T2f.js} +22 -22
  4. package/dist/chunks/{Chart.Dm1awtwo.js → Chart.-OJvZ1z-.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.Dq5_Eygw.js → ChatBubbleAssistant.R0psov42.js} +4 -4
  6. package/dist/chunks/{ChatBubbleUser.BklufN6-.js → ChatBubbleUser.Cyfsx64P.js} +3 -3
  7. package/dist/chunks/{ChatHistoryTable.BG-EQekK.js → ChatHistoryTable.CyvWYwYT.js} +9 -9
  8. package/dist/chunks/{HistoryEntry.DEz9BkNK.js → HistoryEntry.COlV18V9.js} +3 -3
  9. package/dist/chunks/{ProfileEntry.DlK0mggZ.js → ProfileEntry.Cz0cXlvu.js} +2 -2
  10. package/dist/chunks/SettingsEntry.DlOg852u.js +799 -0
  11. package/dist/chunks/{Table.DMMefioh.js → Table.lgFnJD0P.js} +2 -2
  12. package/dist/chunks/{UsageEntry.By1Tqk3d.js → UsageEntry.DqdOT7Fq.js} +3 -3
  13. package/dist/chunks/UserMemoriesPanel.oDlcY89z.js +208 -0
  14. package/dist/chunks/{index._DAcm-25.js → index.B-qS2v_F.js} +1 -1
  15. package/dist/chunks/{index.Cnzsl-SW.js → index.B73h5HsZ.js} +2 -2
  16. package/dist/chunks/{index._ok9-Gz7.js → index.BPgNgE6z.js} +3 -3
  17. package/dist/chunks/{index.DxCuShZW.js → index.D0NeHQ_Z.js} +610 -639
  18. package/dist/chunks/{index.BQNxqtEh.js → index.DPie0Opm.js} +1 -1
  19. package/dist/chunks/{index.CowNGsFh.js → index.KT85y0Xl.js} +1 -1
  20. package/dist/chunks/{index.B1gwgNLh.js → index.UrB_uFIS.js} +1 -1
  21. package/dist/chunks/{useMarkdown.BF3V5ODx.js → useMarkdown.DCsDrRoY.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.DqU_B5BR.js +0 -430
  27. package/dist/chunks/UserMemoriesPanel.BaEGaQVG.js +0 -692
@@ -1,430 +0,0 @@
1
- import { jsxs as s, Fragment as q, jsx as a } from "react/jsx-runtime";
2
- import { n as de, useUserPreferences as me, fe as he, getCacheInfo as ue, isServiceWorkerEnabled as pe, SETTINGS_TITLE as fe, S as m, CARDS as l, C as E, pe as ge, PROMPTS_DESCRIPTION as Se, L as Ne, j as J, getCurrentGeoLocation as Ee, mutateCall as K, handleServiceWorkerToggle as Te, SERVICE_TYPES as Q } from "./index.DxCuShZW.js";
3
- import { useCapability as Ce, oe as ke, O as i } from "./App.C0TMLCXL.js";
4
- import { Re as X, UserMemoriesPanel as be } from "./UserMemoriesPanel.BaEGaQVG.js";
5
- import { useState as r, useCallback as Ie, useEffect as Z } from "react";
6
- const Me = ({
7
- open: ee,
8
- onOpenChange: v
9
- }) => {
10
- const { getAccessToken: T, user: C } = de(), {
11
- data: t,
12
- isSuccess: ae,
13
- refetch: L
14
- } = me({
15
- user: C?.username,
16
- getAccessToken: T
17
- }), [x, f] = r({
18
- loadingLocation: !1
19
- }), [k, M] = r({
20
- prompts: []
21
- }), [P, D] = r(""), [_, g] = r(""), [O, B] = r(!1), [b, R] = r(!1), [S, A] = r(!1), [N, G] = r(!1), [h, U] = r(null), [W, z] = r(!1), [$, j] = r(!1), [te, H] = r(!1), Y = Ce(he.TOOL.MEMORIES), oe = (e) => {
22
- j(e);
23
- }, se = (e) => {
24
- B(e);
25
- }, re = (e) => {
26
- Y && R(e);
27
- }, ne = (e) => {
28
- G(e);
29
- }, ce = async (e) => {
30
- e.preventDefault();
31
- try {
32
- await K({
33
- accessToken: await T(),
34
- type: Q.SET_USER_PREFERENCES,
35
- params: {
36
- user: C?.username,
37
- instructions: P,
38
- location: _,
39
- provider: t?.provider,
40
- tags: k.prompts,
41
- sendOnEnter: O,
42
- useMemory: b,
43
- showDetails: $
44
- }
45
- }), N !== S && (await Te(N), A(N)), L(), f({
46
- loadingLocation: !1
47
- });
48
- } catch {
49
- }
50
- }, le = async () => {
51
- f({
52
- loadingLocation: !0
53
- }), g("...");
54
- try {
55
- const e = Date.now(), o = await Ee(), u = await K({
56
- accessToken: await T(),
57
- type: Q.GET_LOCATION,
58
- params: {
59
- latitude: o.latitude,
60
- longitude: o.longitude
61
- }
62
- }), d = Date.now() - e;
63
- if (d < 2e3 && await new Promise((n) => setTimeout(n, 2e3 - d)), u.status === 200) {
64
- const { city: n, state: c, country: p, displayName: w } = u.data, ie = n && c && p ? `${n}, ${c}, ${p}` : w;
65
- f({
66
- loadingLocation: !1
67
- }), g(ie);
68
- } else
69
- f({
70
- loadingLocation: !1
71
- });
72
- } catch {
73
- }
74
- }, F = () => {
75
- L(), v(!1);
76
- }, I = ({
77
- enabled: e = !1,
78
- privateChat: o = !1,
79
- clipboardAccess: u = !1,
80
- ...y
81
- }) => {
82
- M((d) => {
83
- const n = d.prompts, c = {
84
- ...y,
85
- enabled: e,
86
- privateChat: o,
87
- clipboardAccess: u
88
- };
89
- u ? c.content = c.content.replace(/{{clipboard}}/g, "") + " {{clipboard}}" : c.content = c.content.replace(/{{clipboard}}/g, "");
90
- const p = n.findIndex((w) => w.slot === y.slot);
91
- return p === -1 ? {
92
- ...d,
93
- prompts: [...n, { ...c }]
94
- } : (n[p] = c, {
95
- ...d,
96
- prompts: [...n]
97
- });
98
- });
99
- }, V = Ie(async () => {
100
- try {
101
- z(!0);
102
- const e = await ue();
103
- U(e);
104
- } catch {
105
- } finally {
106
- z(!1);
107
- }
108
- }, []);
109
- return Z(() => {
110
- if (!t)
111
- return;
112
- t.instructions && D(t.instructions), t.location && g(t.location), t.tags && M({ prompts: t.tags }), t.sendOnEnter !== void 0 && B(t.sendOnEnter), t.useMemory !== void 0 && R(t.useMemory), t.showDetails !== void 0 && j(t.showDetails);
113
- const e = pe();
114
- A(e), G(e);
115
- }, [t]), Z(() => {
116
- S ? V() : U(null);
117
- }, [S, V]), ae ? /* @__PURE__ */ s(q, { children: [
118
- /* @__PURE__ */ s(
119
- ke,
120
- {
121
- open: ee,
122
- onOpenChange: F,
123
- title: fe,
124
- animation: !0,
125
- animationType: "fade",
126
- footer: /* @__PURE__ */ s(
127
- Ne,
128
- {
129
- columnGap: 2,
130
- alignHorizontal: "flex-end",
131
- className: "pb-8 sm:pb-0",
132
- children: [
133
- /* @__PURE__ */ a(J, { children: /* @__PURE__ */ a(
134
- E,
135
- {
136
- mode: "dark",
137
- variant: "secondary",
138
- focusMode: "light",
139
- noBorder: !0,
140
- onClick: F,
141
- children: "Cancel"
142
- }
143
- ) }),
144
- /* @__PURE__ */ a(J, { children: /* @__PURE__ */ a(
145
- E,
146
- {
147
- mode: "dark",
148
- focusMode: "light",
149
- onClick: async (e) => {
150
- v(!1), await ce(e);
151
- },
152
- children: "Save"
153
- }
154
- ) })
155
- ]
156
- }
157
- ),
158
- children: [
159
- /* @__PURE__ */ s(
160
- m,
161
- {
162
- header: l.SETTINGS_DETAILS.TITLE,
163
- className: "prose-dark dark:prose-lighter",
164
- noBorder: !0,
165
- children: [
166
- /* @__PURE__ */ a("p", { className: "text-sm", children: l.SETTINGS_DETAILS.DETAILS }),
167
- /* @__PURE__ */ a(
168
- i,
169
- {
170
- noBorder: !0,
171
- narrow: !0,
172
- className: "mt-2",
173
- label: "Show Message Statistics",
174
- name: "show-message-statistics",
175
- onChange: oe,
176
- checked: $
177
- }
178
- ),
179
- /* @__PURE__ */ a("p", { className: "text-sm mt-5", children: l.SETTINGS_DETAILS.SEND_ON_ENTER }),
180
- /* @__PURE__ */ a(
181
- i,
182
- {
183
- noBorder: !0,
184
- narrow: !0,
185
- className: "mt-2",
186
- label: "Send Message on Enter",
187
- name: "send-message-on-enter",
188
- onChange: se,
189
- checked: O
190
- }
191
- ),
192
- Y && /* @__PURE__ */ s(q, { children: [
193
- /* @__PURE__ */ a("p", { className: "text-sm mt-5", children: l.SETTINGS_DETAILS.USE_MEMORY }),
194
- /* @__PURE__ */ a(
195
- i,
196
- {
197
- noBorder: !0,
198
- narrow: !0,
199
- className: "mt-2",
200
- label: "Use Memory",
201
- name: "use-memory",
202
- onChange: re,
203
- checked: b
204
- }
205
- ),
206
- b && /* @__PURE__ */ a(
207
- E,
208
- {
209
- variant: "secondary",
210
- noBorder: !0,
211
- size: "small",
212
- className: "mt-3",
213
- onClick: () => H(!0),
214
- children: "Manage Memories"
215
- }
216
- )
217
- ] })
218
- ]
219
- }
220
- ),
221
- /* @__PURE__ */ s(
222
- m,
223
- {
224
- header: "Custom Instructions",
225
- className: "prose-dark dark:prose-lighter mt-4",
226
- noBorder: !0,
227
- children: [
228
- /* @__PURE__ */ s("p", { className: "text-sm", children: [
229
- "What would you like ",
230
- /* @__PURE__ */ a("em", { children: ge }),
231
- " to know about you to provide better responses?"
232
- ] }),
233
- /* @__PURE__ */ a(
234
- X,
235
- {
236
- mode: "alt-system",
237
- autoCapitalize: "off",
238
- autoComplete: "off",
239
- autoCorrect: "off",
240
- name: "customInstructions",
241
- label: "Custom Instructions",
242
- value: P,
243
- onChange: (e) => {
244
- D(e.target.value);
245
- },
246
- helperText: "Press ENTER to add a new line."
247
- }
248
- )
249
- ]
250
- }
251
- ),
252
- /* @__PURE__ */ s(
253
- m,
254
- {
255
- header: "Location",
256
- className: "prose-dark dark:prose-lighter mt-4",
257
- noBorder: !0,
258
- children: [
259
- /* @__PURE__ */ a("p", { className: "text-sm", children: "You can share your location to receive customized responses based on your area." }),
260
- /* @__PURE__ */ a(
261
- X,
262
- {
263
- mode: "alt-system",
264
- name: "location",
265
- label: "Location",
266
- value: _,
267
- onChange: (e) => {
268
- g(e.target.value);
269
- },
270
- helperText: "Enter your location or press auto-detect."
271
- }
272
- ),
273
- /* @__PURE__ */ a(
274
- E,
275
- {
276
- className: "mt-2",
277
- size: "small",
278
- noBorder: !0,
279
- variant: "secondary",
280
- disabled: x.loadingLocation,
281
- onClick: le,
282
- children: x.loadingLocation ? "Detecting..." : "Auto-detect"
283
- }
284
- )
285
- ]
286
- }
287
- ),
288
- /* @__PURE__ */ s(
289
- m,
290
- {
291
- header: l.SETTINGS_PROMPTS.TITLE,
292
- className: "prose-dark dark:prose-lighter mt-4",
293
- noBorder: !0,
294
- children: [
295
- /* @__PURE__ */ a("p", { className: "text-sm", children: Se }),
296
- k.prompts && k.prompts.slice(0, 3).map((e) => /* @__PURE__ */ s(
297
- m,
298
- {
299
- mode: "dark",
300
- noBorder: !0,
301
- header: e.label.replace("...", ""),
302
- className: "prose-light mb-2",
303
- children: [
304
- /* @__PURE__ */ a("p", { className: "text-sm", children: e.description }),
305
- /* @__PURE__ */ a(
306
- i,
307
- {
308
- noBorder: !0,
309
- narrow: !0,
310
- mode: "dark",
311
- focusMode: "light",
312
- className: "mt-2",
313
- label: "Enabled",
314
- name: e.slot.toString(),
315
- onChange: (o) => {
316
- I({
317
- ...e,
318
- enabled: o
319
- });
320
- },
321
- checked: e.enabled
322
- }
323
- ),
324
- /* @__PURE__ */ a(
325
- i,
326
- {
327
- noBorder: !0,
328
- narrow: !0,
329
- mode: "dark",
330
- focusMode: "light",
331
- className: "mt-2",
332
- label: "Private Chat",
333
- name: `private-${e.slot.toString()}`,
334
- onChange: (o) => {
335
- I({
336
- ...e,
337
- privateChat: o
338
- });
339
- },
340
- checked: e.privateChat
341
- }
342
- ),
343
- /* @__PURE__ */ a(
344
- i,
345
- {
346
- noBorder: !0,
347
- narrow: !0,
348
- mode: "dark",
349
- focusMode: "light",
350
- className: "mt-2",
351
- label: "Use Clipboard",
352
- name: `clipboard-${e.slot.toString()}`,
353
- onChange: (o) => {
354
- I({
355
- ...e,
356
- clipboardAccess: o
357
- });
358
- },
359
- checked: e.clipboardAccess
360
- }
361
- )
362
- ]
363
- },
364
- `prompt-slot-${e.slot}`
365
- ))
366
- ]
367
- }
368
- ),
369
- /* @__PURE__ */ s(
370
- m,
371
- {
372
- header: l.SETTINGS_CACHING.TITLE,
373
- className: "prose-dark dark:prose-lighter mt-4 ",
374
- noBorder: !0,
375
- children: [
376
- /* @__PURE__ */ a("p", { className: "text-sm", children: l.SETTINGS_CACHING.DESCRIPTION }),
377
- /* @__PURE__ */ a(
378
- i,
379
- {
380
- noBorder: !0,
381
- narrow: !0,
382
- className: "mt-2",
383
- label: "Enable Assets Caching",
384
- name: "enable-service-worker",
385
- onChange: ne,
386
- checked: N
387
- }
388
- ),
389
- S && /* @__PURE__ */ s("div", { className: "mt-4 p-3 border border-dashed border-neutral-700 dark:border-neutral-400 rounded @container/optimizations", children: [
390
- /* @__PURE__ */ a("h3", { className: "m-0 mb-2 text-xs uppercase opacity-70", children: "Cache Info" }),
391
- h ? /* @__PURE__ */ s("div", { className: "text-xs space-y-2", children: [
392
- /* @__PURE__ */ s("p", { className: "m-0", children: [
393
- "Version: ",
394
- /* @__PURE__ */ a("strong", { children: h.version })
395
- ] }),
396
- /* @__PURE__ */ s("p", { className: "m-0", children: [
397
- "Total Items: ",
398
- /* @__PURE__ */ a("strong", { children: h.totalItems })
399
- ] }),
400
- h.caches.map((e) => /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("ul", { className: "not-prose font-mono mt-2 list-none w-[95cqw]", children: e.urls.map((o) => /* @__PURE__ */ a(
401
- "li",
402
- {
403
- className: "truncate text-xs text-copy-dark dark:text-copy-light overflow-hidden text-ellipsis",
404
- title: o,
405
- children: new URL(o).pathname
406
- },
407
- o
408
- )) }) }, e.name)),
409
- h.totalItems === 0 && !W && /* @__PURE__ */ a("p", { className: "italic m-0 opacity-70", children: "No cached assets yet." })
410
- ] }) : /* @__PURE__ */ a("p", { className: "text-xs opacity-70 m-0", children: W ? "Loading cache info..." : "No cache info available." })
411
- ] })
412
- ]
413
- }
414
- )
415
- ]
416
- }
417
- ),
418
- /* @__PURE__ */ a(
419
- be,
420
- {
421
- open: te,
422
- onOpenChange: H,
423
- user: C?.username
424
- }
425
- )
426
- ] }) : null;
427
- };
428
- export {
429
- Me as SettingsPanel
430
- };