@versini/sassysaint 8.99.3 → 8.100.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.C_qMLuiB.js → AboutChangelog.DA361mHf.js} +3 -3
- package/dist/chunks/AboutEntry.COmeuxq_.js +83 -0
- package/dist/chunks/{App.BUZaV6AF.js → App.BLNMkw5x.js} +331 -329
- package/dist/chunks/{Chart.DvSv2Eza.js → Chart.GBOvQ25I.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.DPvPqKP2.js → ChatBubbleAssistant.De5psmEG.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.BCEiPwpY.js → ChatBubbleUser.DF9Axp_4.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.BV0EO83B.js → ChatHistoryTable.rOFYnFKa.js} +3 -3
- package/dist/chunks/{HistoryEntry.DdsxhGAV.js → HistoryEntry.DnG7vXnm.js} +134 -133
- package/dist/chunks/{UserMemoriesPanel.B7Vh6shw.js → MemoriesEntry.rleSeGKZ.js} +212 -209
- package/dist/chunks/{ProfileEntry.C-3cFRJF.js → ProfileEntry.ZVmjBCNA.js} +76 -72
- package/dist/chunks/{SettingsEntry.AuH85ovZ.js → SettingsEntry.azCvMpSB.js} +116 -108
- package/dist/chunks/{UsageEntry.C5_CSslN.js → UsageEntry.CK1PBjs3.js} +77 -76
- package/dist/chunks/{index.DQOeZzJl.js → index.Bil3-QBE.js} +1 -1
- package/dist/chunks/{index.BtC6g5QI.js → index.Bz0fwQT2.js} +1 -1
- package/dist/chunks/{index.CHoYdZu2.js → index.CY7OKrvt.js} +3 -3
- package/dist/chunks/{index.3sEe64_a.js → index.CYzDnVAL.js} +1 -1
- package/dist/chunks/{index.BbB1hl1m.js → index.CgmhTYJp.js} +1 -1
- package/dist/chunks/{index.DRSAc_Rh.js → index.DfrHJ6QJ.js} +1 -1
- package/dist/chunks/{index.C8gT8NUq.js → index.DlepPi73.js} +2 -2
- package/dist/chunks/{index.IFwWrDqI.js → index.Dw8chhdS.js} +1 -1
- package/dist/chunks/{index.D3zzxjS0.js → index.iTnfwVri.js} +1 -1
- package/dist/chunks/{useMarkdown.CFmffPvi.js → useMarkdown.DhNvct2e.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/AboutEntry.CKKvxJXb.js +0 -79
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as I } from "react/jsx-runtime";
|
|
2
|
-
import { L as
|
|
3
|
-
import { Panel as
|
|
4
|
-
import { j as
|
|
5
|
-
import
|
|
6
|
-
import { useState as
|
|
7
|
-
import { TextArea as
|
|
2
|
+
import { L as M, j as f, Button as B, n as Te, useLocalStorage as ee, LOCAL_STORAGE_PREFIX as te, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as ke, e$1 as s, LOCAL_STORAGE_SORT_MEMORY_COLUMN as ve, useUserMemories as De, useExpiredMemories as be, useDeleteMemory as Ee, useDeleteAllActiveMemories as Me, useDeleteAllExpiredMemories as Re, useUpdateMemory as Ie, useRestoreMemory as Le, ButtonIcon as L, IconEdit as Oe, IconDelete as re, IconRestore as _e } from "./index.CgmhTYJp.js";
|
|
3
|
+
import { Panel as ae, Toggle as O, CancelButton as ce, ConfirmationPanel as ie, ResponsiveTooltip as _ } from "./App.BLNMkw5x.js";
|
|
4
|
+
import { j as ne, D as oe, F as v, L as a, Y as z, G as le, H as se } from "./index.Bil3-QBE.js";
|
|
5
|
+
import C from "clsx";
|
|
6
|
+
import { useState as N, useEffect as ze, useRef as q } from "react";
|
|
7
|
+
import { TextArea as Be } from "./index.DfrHJ6QJ.js";
|
|
8
8
|
const Pe = ({
|
|
9
|
-
open:
|
|
10
|
-
onOpenChange:
|
|
11
|
-
initialText:
|
|
9
|
+
open: w,
|
|
10
|
+
onOpenChange: D,
|
|
11
|
+
initialText: d,
|
|
12
12
|
metadata: n,
|
|
13
|
-
onSave:
|
|
14
|
-
isSaving:
|
|
13
|
+
onSave: A,
|
|
14
|
+
isSaving: b = !1
|
|
15
15
|
}) => {
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
16
|
+
const [l, E] = N(d), [y, h] = N("none");
|
|
17
|
+
ze(() => {
|
|
18
|
+
if (w) {
|
|
19
|
+
E(d);
|
|
20
20
|
const o = n?.expiration || "none";
|
|
21
|
-
|
|
21
|
+
h(o);
|
|
22
22
|
}
|
|
23
|
-
}, [
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
const o =
|
|
27
|
-
|
|
23
|
+
}, [w, d, n?.expiration]);
|
|
24
|
+
const P = () => {
|
|
25
|
+
if (l.trim().length >= 3) {
|
|
26
|
+
const o = y === "none" ? null : y;
|
|
27
|
+
A(l.trim(), o);
|
|
28
28
|
}
|
|
29
|
-
},
|
|
29
|
+
}, T = l.trim().length >= 3, p = l.trim() !== d.trim() || y !== (n?.expiration || "none");
|
|
30
30
|
return /* @__PURE__ */ e(
|
|
31
|
-
|
|
31
|
+
ae,
|
|
32
32
|
{
|
|
33
|
-
open:
|
|
34
|
-
onOpenChange:
|
|
33
|
+
open: w,
|
|
34
|
+
onOpenChange: D,
|
|
35
35
|
title: "Edit Memory",
|
|
36
36
|
animation: !0,
|
|
37
37
|
animationType: "fade",
|
|
38
|
-
footer: /* @__PURE__ */ r(
|
|
39
|
-
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
38
|
+
footer: /* @__PURE__ */ r(M, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
39
|
+
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(ce, { onOpenChange: D, label: "Cancel" }) }),
|
|
40
40
|
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
41
|
-
|
|
41
|
+
B,
|
|
42
42
|
{
|
|
43
43
|
mode: "dark",
|
|
44
44
|
focusMode: "light",
|
|
45
|
-
disabled:
|
|
46
|
-
onClick:
|
|
47
|
-
children:
|
|
45
|
+
disabled: b || !T || !p,
|
|
46
|
+
onClick: P,
|
|
47
|
+
children: b ? "Saving..." : "Save"
|
|
48
48
|
}
|
|
49
49
|
) })
|
|
50
50
|
] }),
|
|
51
51
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col pt-2 gap-4", children: [
|
|
52
52
|
/* @__PURE__ */ e(
|
|
53
|
-
|
|
53
|
+
Be,
|
|
54
54
|
{
|
|
55
55
|
mode: "dark",
|
|
56
56
|
focusMode: "light",
|
|
57
57
|
label: "Memory text",
|
|
58
58
|
name: "memoryText",
|
|
59
|
-
value:
|
|
60
|
-
onChange: (o) =>
|
|
59
|
+
value: l,
|
|
60
|
+
onChange: (o) => E(o.target.value),
|
|
61
61
|
autoFocus: !0,
|
|
62
|
-
helperText:
|
|
62
|
+
helperText: l.trim().length < 3 ? "Memory text must be at least 3 characters" : `${l.length} characters`
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
65
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-3 p-4 bg-slate-800/50 rounded-md border border-slate-700/50", children: [
|
|
@@ -75,9 +75,9 @@ const Pe = ({
|
|
|
75
75
|
narrow: !0,
|
|
76
76
|
label: "Never expire",
|
|
77
77
|
name: "expiration-none",
|
|
78
|
-
checked:
|
|
78
|
+
checked: y === "none",
|
|
79
79
|
onChange: (o) => {
|
|
80
|
-
o &&
|
|
80
|
+
o && h("none");
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
),
|
|
@@ -90,9 +90,9 @@ const Pe = ({
|
|
|
90
90
|
narrow: !0,
|
|
91
91
|
label: "Short (1 month)",
|
|
92
92
|
name: "expiration-short",
|
|
93
|
-
checked:
|
|
93
|
+
checked: y === "short",
|
|
94
94
|
onChange: (o) => {
|
|
95
|
-
o &&
|
|
95
|
+
o && h("short");
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
),
|
|
@@ -105,9 +105,9 @@ const Pe = ({
|
|
|
105
105
|
narrow: !0,
|
|
106
106
|
label: "Medium (6 months)",
|
|
107
107
|
name: "expiration-medium",
|
|
108
|
-
checked:
|
|
108
|
+
checked: y === "medium",
|
|
109
109
|
onChange: (o) => {
|
|
110
|
-
o &&
|
|
110
|
+
o && h("medium");
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
),
|
|
@@ -120,9 +120,9 @@ const Pe = ({
|
|
|
120
120
|
narrow: !0,
|
|
121
121
|
label: "Long (1 year)",
|
|
122
122
|
name: "expiration-long",
|
|
123
|
-
checked:
|
|
123
|
+
checked: y === "long",
|
|
124
124
|
onChange: (o) => {
|
|
125
|
-
o &&
|
|
125
|
+
o && h("long");
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
)
|
|
@@ -132,13 +132,13 @@ const Pe = ({
|
|
|
132
132
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-slate-300 m-0", children: "Memory Details" }),
|
|
133
133
|
n.categories && n.categories.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
134
134
|
/* @__PURE__ */ e("span", { className: "text-xs text-slate-400 uppercase", children: "Category" }),
|
|
135
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: n.categories.map((o,
|
|
135
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: n.categories.map((o, u) => /* @__PURE__ */ e(
|
|
136
136
|
"span",
|
|
137
137
|
{
|
|
138
138
|
className: "text-xs px-2 py-1 bg-slate-700/50 text-slate-200 rounded",
|
|
139
139
|
children: o
|
|
140
140
|
},
|
|
141
|
-
`${o}-${
|
|
141
|
+
`${o}-${u}`
|
|
142
142
|
)) })
|
|
143
143
|
] }),
|
|
144
144
|
/* @__PURE__ */ r("div", { className: "flex flex-col sm:flex-row gap-4", children: [
|
|
@@ -178,78 +178,74 @@ const Pe = ({
|
|
|
178
178
|
] })
|
|
179
179
|
}
|
|
180
180
|
);
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
})
|
|
186
|
-
|
|
187
|
-
key: Z + Te,
|
|
188
|
-
initialValue: l.DESC
|
|
189
|
-
}), [N, S] = W({
|
|
190
|
-
key: Z + ke,
|
|
181
|
+
}, Xe = ({ open: w, onOpenChange: D, user: d }) => {
|
|
182
|
+
const n = q(null), { getAccessToken: A } = Te(), [b] = N(void 0), [l, E] = N("active"), [y, h] = ee({
|
|
183
|
+
key: te + ke,
|
|
184
|
+
initialValue: s.DESC
|
|
185
|
+
}), [P, T] = ee({
|
|
186
|
+
key: te + ve,
|
|
191
187
|
initialValue: "createdAt"
|
|
192
|
-
}), [
|
|
193
|
-
|
|
194
|
-
), { data:
|
|
195
|
-
user:
|
|
196
|
-
query:
|
|
197
|
-
getAccessToken:
|
|
198
|
-
enabled:
|
|
188
|
+
}), [p, o] = N(y || s.DESC), [u, R] = N(
|
|
189
|
+
P || "createdAt"
|
|
190
|
+
), { data: k, isLoading: $, isError: H } = De({
|
|
191
|
+
user: d,
|
|
192
|
+
query: b,
|
|
193
|
+
getAccessToken: A,
|
|
194
|
+
enabled: w && l === "active"
|
|
199
195
|
}), {
|
|
200
196
|
data: g,
|
|
201
|
-
isLoading:
|
|
202
|
-
isError:
|
|
203
|
-
} =
|
|
204
|
-
user:
|
|
205
|
-
query:
|
|
206
|
-
getAccessToken:
|
|
207
|
-
enabled:
|
|
208
|
-
}),
|
|
209
|
-
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
},
|
|
197
|
+
isLoading: j,
|
|
198
|
+
isError: X
|
|
199
|
+
} = be({
|
|
200
|
+
user: d,
|
|
201
|
+
query: b,
|
|
202
|
+
getAccessToken: A,
|
|
203
|
+
enabled: w && l === "expired"
|
|
204
|
+
}), F = Ee({ getAccessToken: A }), V = Me({ getAccessToken: A }), Y = Re({ getAccessToken: A }), G = Ie({ getAccessToken: A }), J = Le({ getAccessToken: A }), [de, K] = N(!1), S = q(null), [me, Q] = N(!1), [xe, U] = N(!1), x = q(null), W = (t, i, c, m) => {
|
|
205
|
+
S.current = { id: t, text: i, description: c, createdAt: m }, K(!0);
|
|
206
|
+
}, he = () => {
|
|
207
|
+
S.current && F.mutate({ user: d, memoryId: S.current.id });
|
|
208
|
+
}, pe = (t, i, c, m, Ae, ye, Ce, Ne, we, Se) => {
|
|
213
209
|
x.current = {
|
|
214
210
|
id: t,
|
|
215
211
|
description: i,
|
|
216
|
-
categories:
|
|
217
|
-
quote:
|
|
218
|
-
canonicalText:
|
|
219
|
-
confidence:
|
|
220
|
-
status:
|
|
221
|
-
sourceType:
|
|
222
|
-
expiration:
|
|
223
|
-
expiresAt:
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
x.current &&
|
|
212
|
+
categories: c,
|
|
213
|
+
quote: m,
|
|
214
|
+
canonicalText: Ae,
|
|
215
|
+
confidence: ye,
|
|
216
|
+
status: Ce,
|
|
217
|
+
sourceType: Ne,
|
|
218
|
+
expiration: we,
|
|
219
|
+
expiresAt: Se
|
|
220
|
+
}, U(!0);
|
|
221
|
+
}, ue = (t, i) => {
|
|
222
|
+
x.current && d && G.mutate(
|
|
227
223
|
{
|
|
228
|
-
user:
|
|
224
|
+
user: d,
|
|
229
225
|
memoryId: x.current.id,
|
|
230
226
|
description: t,
|
|
231
227
|
expiration: i || void 0
|
|
232
228
|
},
|
|
233
229
|
{
|
|
234
230
|
onSuccess: () => {
|
|
235
|
-
|
|
231
|
+
U(!1);
|
|
236
232
|
}
|
|
237
233
|
}
|
|
238
234
|
);
|
|
239
|
-
}, ue = () => {
|
|
240
|
-
c && J(!0);
|
|
241
235
|
}, ge = () => {
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
|
|
236
|
+
d && Q(!0);
|
|
237
|
+
}, fe = () => {
|
|
238
|
+
d && (l === "active" ? V.mutate({ user: d }) : Y.mutate({ user: d }));
|
|
239
|
+
}, Z = (t) => {
|
|
240
|
+
const i = `${t.total} memor${t.total === 1 ? "y" : "ies"}`, c = t.totalTokenUsage ? ` (~${t.totalTokenUsage} tokens)` : "";
|
|
241
|
+
return i + c;
|
|
246
242
|
};
|
|
247
243
|
return /* @__PURE__ */ r(I, { children: [
|
|
248
244
|
/* @__PURE__ */ e(
|
|
249
245
|
Pe,
|
|
250
246
|
{
|
|
251
|
-
open:
|
|
252
|
-
onOpenChange:
|
|
247
|
+
open: xe,
|
|
248
|
+
onOpenChange: U,
|
|
253
249
|
initialText: x.current?.description || "",
|
|
254
250
|
metadata: x.current ? {
|
|
255
251
|
categories: x.current.categories,
|
|
@@ -261,16 +257,16 @@ const Pe = ({
|
|
|
261
257
|
expiration: x.current.expiration,
|
|
262
258
|
expiresAt: x.current.expiresAt
|
|
263
259
|
} : void 0,
|
|
264
|
-
onSave:
|
|
265
|
-
isSaving:
|
|
260
|
+
onSave: ue,
|
|
261
|
+
isSaving: G.isPending
|
|
266
262
|
}
|
|
267
263
|
),
|
|
268
264
|
/* @__PURE__ */ r(
|
|
269
|
-
|
|
265
|
+
ie,
|
|
270
266
|
{
|
|
271
|
-
showConfirmation:
|
|
272
|
-
setShowConfirmation:
|
|
273
|
-
action:
|
|
267
|
+
showConfirmation: de,
|
|
268
|
+
setShowConfirmation: K,
|
|
269
|
+
action: he,
|
|
274
270
|
customStrings: {
|
|
275
271
|
title: "Delete memory",
|
|
276
272
|
confirmAction: "Delete",
|
|
@@ -282,75 +278,83 @@ const Pe = ({
|
|
|
282
278
|
/* @__PURE__ */ r("li", { children: [
|
|
283
279
|
"Excerpt:",
|
|
284
280
|
" ",
|
|
285
|
-
(
|
|
281
|
+
(S.current?.description || S.current?.text || "").slice(0, 80)
|
|
286
282
|
] }),
|
|
287
283
|
/* @__PURE__ */ r("li", { children: [
|
|
288
284
|
"Created:",
|
|
289
285
|
" ",
|
|
290
|
-
|
|
286
|
+
S.current?.createdAt ? new Date(S.current.createdAt).toLocaleString() : "-"
|
|
291
287
|
] })
|
|
292
288
|
] })
|
|
293
289
|
]
|
|
294
290
|
}
|
|
295
291
|
),
|
|
296
292
|
/* @__PURE__ */ e(
|
|
297
|
-
|
|
293
|
+
ie,
|
|
298
294
|
{
|
|
299
|
-
showConfirmation:
|
|
300
|
-
setShowConfirmation:
|
|
301
|
-
action:
|
|
295
|
+
showConfirmation: me,
|
|
296
|
+
setShowConfirmation: Q,
|
|
297
|
+
action: fe,
|
|
302
298
|
customStrings: {
|
|
303
|
-
title:
|
|
299
|
+
title: l === "active" ? "Delete all active memories" : "Delete all expired memories",
|
|
304
300
|
confirmAction: "Delete all",
|
|
305
301
|
cancelAction: "Cancel"
|
|
306
302
|
},
|
|
307
|
-
children: /* @__PURE__ */ e("p", { className: "m-0", children:
|
|
303
|
+
children: /* @__PURE__ */ e("p", { className: "m-0", children: l === "active" ? "This will permanently delete all active memories for this user. This action cannot be undone." : "This will permanently delete all expired memories for this user. This action cannot be undone." })
|
|
308
304
|
}
|
|
309
305
|
),
|
|
310
306
|
/* @__PURE__ */ e(
|
|
311
|
-
|
|
307
|
+
ae,
|
|
312
308
|
{
|
|
313
|
-
open:
|
|
314
|
-
onOpenChange: (t) =>
|
|
309
|
+
open: w,
|
|
310
|
+
onOpenChange: (t) => D(t),
|
|
315
311
|
title: "User Memories",
|
|
316
312
|
animation: !0,
|
|
317
313
|
animationType: "fade",
|
|
318
314
|
blurEffect: "large",
|
|
319
|
-
|
|
320
|
-
|
|
315
|
+
initialFocus: n,
|
|
316
|
+
footer: /* @__PURE__ */ r(M, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
317
|
+
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
318
|
+
ce,
|
|
319
|
+
{
|
|
320
|
+
onOpenChange: D,
|
|
321
|
+
label: "Close",
|
|
322
|
+
ref: n
|
|
323
|
+
}
|
|
324
|
+
) }),
|
|
321
325
|
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
322
|
-
|
|
326
|
+
B,
|
|
323
327
|
{
|
|
324
328
|
mode: "dark",
|
|
325
329
|
focusMode: "light",
|
|
326
330
|
variant: "danger",
|
|
327
|
-
disabled: (
|
|
328
|
-
onClick:
|
|
331
|
+
disabled: (l === "active" ? V.isPending : Y.isPending) || (l === "active" ? (k?.total ?? 0) === 0 : (g?.total ?? 0) === 0),
|
|
332
|
+
onClick: ge,
|
|
329
333
|
children: "Delete All"
|
|
330
334
|
}
|
|
331
335
|
) })
|
|
332
336
|
] }),
|
|
333
337
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-4 @container/editmemoriespanel", children: [
|
|
334
|
-
/* @__PURE__ */ r(
|
|
338
|
+
/* @__PURE__ */ r(M, { columnGap: 2, alignHorizontal: "center", children: [
|
|
335
339
|
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
336
|
-
|
|
340
|
+
B,
|
|
337
341
|
{
|
|
338
342
|
focusMode: "light",
|
|
339
|
-
mode:
|
|
343
|
+
mode: l === "active" ? "light" : "dark",
|
|
340
344
|
size: "small",
|
|
341
345
|
noBorder: !0,
|
|
342
|
-
onClick: () =>
|
|
346
|
+
onClick: () => E("active"),
|
|
343
347
|
children: "Active Memories"
|
|
344
348
|
}
|
|
345
349
|
) }),
|
|
346
350
|
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
347
|
-
|
|
351
|
+
B,
|
|
348
352
|
{
|
|
349
353
|
focusMode: "light",
|
|
350
|
-
mode:
|
|
354
|
+
mode: l === "expired" ? "light" : "dark",
|
|
351
355
|
size: "small",
|
|
352
356
|
noBorder: !0,
|
|
353
|
-
onClick: () =>
|
|
357
|
+
onClick: () => E("expired"),
|
|
354
358
|
children: "Expired Memories"
|
|
355
359
|
}
|
|
356
360
|
) })
|
|
@@ -358,27 +362,27 @@ const Pe = ({
|
|
|
358
362
|
/* @__PURE__ */ e(
|
|
359
363
|
"div",
|
|
360
364
|
{
|
|
361
|
-
className:
|
|
365
|
+
className: C(
|
|
362
366
|
"flex flex-col sm:flex-row",
|
|
363
367
|
"max-h-[75vh]",
|
|
364
368
|
"sm:max-h-[75vh]",
|
|
365
369
|
"min-h-[70vh]"
|
|
366
370
|
),
|
|
367
|
-
children:
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
371
|
+
children: l === "active" ? /* @__PURE__ */ r(I, { children: [
|
|
372
|
+
$ && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
|
|
373
|
+
H && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load memories." }),
|
|
374
|
+
!$ && !H && (k && k.items.length > 0 ? /* @__PURE__ */ r(
|
|
375
|
+
ne,
|
|
372
376
|
{
|
|
373
377
|
stickyHeader: !0,
|
|
374
378
|
stickyFooter: !0,
|
|
375
379
|
compact: !0,
|
|
376
380
|
mode: "alt-system",
|
|
377
|
-
caption:
|
|
381
|
+
caption: Z(k),
|
|
378
382
|
children: [
|
|
379
|
-
/* @__PURE__ */ e(
|
|
380
|
-
/* @__PURE__ */ e(
|
|
381
|
-
/* @__PURE__ */ e(
|
|
383
|
+
/* @__PURE__ */ e(oe, { children: /* @__PURE__ */ r(v, { children: [
|
|
384
|
+
/* @__PURE__ */ e(a, { className: "sr-only", children: "Row" }),
|
|
385
|
+
/* @__PURE__ */ e(a, { children: "Memory" }),
|
|
382
386
|
/* @__PURE__ */ e(
|
|
383
387
|
z,
|
|
384
388
|
{
|
|
@@ -386,11 +390,11 @@ const Pe = ({
|
|
|
386
390
|
buttonClassName: "text-xs sm:text-sm",
|
|
387
391
|
cellId: "createdAt",
|
|
388
392
|
align: "left",
|
|
389
|
-
sortDirection:
|
|
390
|
-
sortedCell:
|
|
393
|
+
sortDirection: p,
|
|
394
|
+
sortedCell: u,
|
|
391
395
|
onClick: () => {
|
|
392
|
-
|
|
393
|
-
const i = t ===
|
|
396
|
+
R("createdAt"), T("createdAt"), o((t) => {
|
|
397
|
+
const i = t === s.ASC ? s.DESC : s.ASC;
|
|
394
398
|
return h(i), i;
|
|
395
399
|
});
|
|
396
400
|
},
|
|
@@ -404,35 +408,35 @@ const Pe = ({
|
|
|
404
408
|
buttonClassName: "text-xs sm:text-sm",
|
|
405
409
|
cellId: "expiresAt",
|
|
406
410
|
align: "left",
|
|
407
|
-
sortDirection:
|
|
408
|
-
sortedCell:
|
|
411
|
+
sortDirection: p,
|
|
412
|
+
sortedCell: u,
|
|
409
413
|
onClick: () => {
|
|
410
|
-
|
|
411
|
-
const i = t ===
|
|
414
|
+
R("expiresAt"), T("expiresAt"), o((t) => {
|
|
415
|
+
const i = t === s.ASC ? s.DESC : s.ASC;
|
|
412
416
|
return h(i), i;
|
|
413
417
|
});
|
|
414
418
|
},
|
|
415
419
|
children: "Expires"
|
|
416
420
|
}
|
|
417
421
|
),
|
|
418
|
-
/* @__PURE__ */ e(
|
|
422
|
+
/* @__PURE__ */ e(a, { align: "right", children: "Actions" })
|
|
419
423
|
] }) }),
|
|
420
|
-
/* @__PURE__ */ e(
|
|
421
|
-
if (
|
|
422
|
-
const
|
|
423
|
-
return
|
|
424
|
+
/* @__PURE__ */ e(le, { children: [...k.items].sort((t, i) => {
|
|
425
|
+
if (u === "createdAt") {
|
|
426
|
+
const c = t.createdAt ? new Date(t.createdAt).getTime() : 0, m = i.createdAt ? new Date(i.createdAt).getTime() : 0;
|
|
427
|
+
return p === s.ASC ? c - m : m - c;
|
|
424
428
|
}
|
|
425
|
-
if (
|
|
426
|
-
const
|
|
427
|
-
return
|
|
429
|
+
if (u === "expiresAt") {
|
|
430
|
+
const c = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, m = i.expiresAt ? new Date(i.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
|
|
431
|
+
return p === s.ASC ? c - m : m - c;
|
|
428
432
|
}
|
|
429
433
|
return 0;
|
|
430
|
-
}).map((t, i) => /* @__PURE__ */ r(
|
|
431
|
-
/* @__PURE__ */ e(
|
|
434
|
+
}).map((t, i) => /* @__PURE__ */ r(v, { children: [
|
|
435
|
+
/* @__PURE__ */ e(a, { className: C("dark:text-gray-400"), children: i + 1 }),
|
|
432
436
|
/* @__PURE__ */ e(
|
|
433
|
-
|
|
437
|
+
a,
|
|
434
438
|
{
|
|
435
|
-
className:
|
|
439
|
+
className: C(
|
|
436
440
|
"dark:text-white",
|
|
437
441
|
"max-w-25 sm:max-w-100",
|
|
438
442
|
"text-xs sm:text-sm"
|
|
@@ -444,11 +448,11 @@ const Pe = ({
|
|
|
444
448
|
}
|
|
445
449
|
),
|
|
446
450
|
/* @__PURE__ */ e(
|
|
447
|
-
|
|
451
|
+
a,
|
|
448
452
|
{
|
|
449
453
|
component: "th",
|
|
450
454
|
scope: "row",
|
|
451
|
-
className:
|
|
455
|
+
className: C(
|
|
452
456
|
"dark:text-gray-400",
|
|
453
457
|
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
454
458
|
),
|
|
@@ -456,9 +460,9 @@ const Pe = ({
|
|
|
456
460
|
}
|
|
457
461
|
),
|
|
458
462
|
/* @__PURE__ */ e(
|
|
459
|
-
|
|
463
|
+
a,
|
|
460
464
|
{
|
|
461
|
-
className:
|
|
465
|
+
className: C(
|
|
462
466
|
"dark:text-gray-400",
|
|
463
467
|
"sm:whitespace-nowrap text-xs sm:text-sm"
|
|
464
468
|
),
|
|
@@ -466,12 +470,12 @@ const Pe = ({
|
|
|
466
470
|
}
|
|
467
471
|
),
|
|
468
472
|
/* @__PURE__ */ e(
|
|
469
|
-
|
|
473
|
+
a,
|
|
470
474
|
{
|
|
471
475
|
className: "align-top border-l border-table-light dark:border-table-dark",
|
|
472
476
|
align: "right",
|
|
473
477
|
children: /* @__PURE__ */ r(
|
|
474
|
-
|
|
478
|
+
M,
|
|
475
479
|
{
|
|
476
480
|
columnGap: 2,
|
|
477
481
|
alignHorizontal: "flex-end",
|
|
@@ -489,8 +493,8 @@ const Pe = ({
|
|
|
489
493
|
noBorder: !0,
|
|
490
494
|
label: "Edit memory",
|
|
491
495
|
variant: "primary",
|
|
492
|
-
disabled:
|
|
493
|
-
onClick: () =>
|
|
496
|
+
disabled: G.isPending,
|
|
497
|
+
onClick: () => pe(
|
|
494
498
|
t.memoryId,
|
|
495
499
|
t.description || t.text,
|
|
496
500
|
t.categories,
|
|
@@ -502,7 +506,7 @@ const Pe = ({
|
|
|
502
506
|
t.expiration,
|
|
503
507
|
t.expiresAt
|
|
504
508
|
),
|
|
505
|
-
children: /* @__PURE__ */ e(
|
|
509
|
+
children: /* @__PURE__ */ e(Oe, { size: "size-3", monotone: !0 })
|
|
506
510
|
}
|
|
507
511
|
)
|
|
508
512
|
}
|
|
@@ -521,14 +525,14 @@ const Pe = ({
|
|
|
521
525
|
label: "Delete memory",
|
|
522
526
|
variant: "primary",
|
|
523
527
|
iconClassName: "text-red-700 dark:text-red-500",
|
|
524
|
-
disabled:
|
|
525
|
-
onClick: () =>
|
|
528
|
+
disabled: F.isPending,
|
|
529
|
+
onClick: () => W(
|
|
526
530
|
t.memoryId,
|
|
527
531
|
t.text,
|
|
528
532
|
t.description,
|
|
529
533
|
t.createdAt
|
|
530
534
|
),
|
|
531
|
-
children: /* @__PURE__ */ e(
|
|
535
|
+
children: /* @__PURE__ */ e(re, { size: "size-3", monotone: !0 })
|
|
532
536
|
}
|
|
533
537
|
)
|
|
534
538
|
}
|
|
@@ -539,17 +543,17 @@ const Pe = ({
|
|
|
539
543
|
}
|
|
540
544
|
)
|
|
541
545
|
] }, t.memoryId)) }),
|
|
542
|
-
/* @__PURE__ */ e(
|
|
546
|
+
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(a, { colSpan: 5, children: Z(k) }) }) })
|
|
543
547
|
]
|
|
544
548
|
}
|
|
545
549
|
) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
|
|
546
550
|
] }) : /* @__PURE__ */ r(I, { children: [
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
/* @__PURE__ */ e(
|
|
551
|
-
/* @__PURE__ */ e(
|
|
552
|
-
/* @__PURE__ */ e(
|
|
551
|
+
j && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading expired memories..." }),
|
|
552
|
+
X && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load expired memories." }),
|
|
553
|
+
!j && !X && (g && g.items.length > 0 ? /* @__PURE__ */ r(ne, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
|
|
554
|
+
/* @__PURE__ */ e(oe, { children: /* @__PURE__ */ r(v, { children: [
|
|
555
|
+
/* @__PURE__ */ e(a, { className: "sr-only", children: "Row" }),
|
|
556
|
+
/* @__PURE__ */ e(a, { children: "Memory" }),
|
|
553
557
|
/* @__PURE__ */ e(
|
|
554
558
|
z,
|
|
555
559
|
{
|
|
@@ -557,11 +561,11 @@ const Pe = ({
|
|
|
557
561
|
buttonClassName: "text-xs sm:text-sm",
|
|
558
562
|
cellId: "createdAt",
|
|
559
563
|
align: "left",
|
|
560
|
-
sortDirection:
|
|
561
|
-
sortedCell:
|
|
564
|
+
sortDirection: p,
|
|
565
|
+
sortedCell: u,
|
|
562
566
|
onClick: () => {
|
|
563
|
-
|
|
564
|
-
const i = t ===
|
|
567
|
+
R("createdAt"), T("createdAt"), o((t) => {
|
|
568
|
+
const i = t === s.ASC ? s.DESC : s.ASC;
|
|
565
569
|
return h(i), i;
|
|
566
570
|
});
|
|
567
571
|
},
|
|
@@ -575,35 +579,35 @@ const Pe = ({
|
|
|
575
579
|
buttonClassName: "text-xs sm:text-sm",
|
|
576
580
|
cellId: "expiresAt",
|
|
577
581
|
align: "left",
|
|
578
|
-
sortDirection:
|
|
579
|
-
sortedCell:
|
|
582
|
+
sortDirection: p,
|
|
583
|
+
sortedCell: u,
|
|
580
584
|
onClick: () => {
|
|
581
|
-
|
|
582
|
-
const i = t ===
|
|
585
|
+
R("expiresAt"), T("expiresAt"), o((t) => {
|
|
586
|
+
const i = t === s.ASC ? s.DESC : s.ASC;
|
|
583
587
|
return h(i), i;
|
|
584
588
|
});
|
|
585
589
|
},
|
|
586
590
|
children: "Expired"
|
|
587
591
|
}
|
|
588
592
|
),
|
|
589
|
-
/* @__PURE__ */ e(
|
|
593
|
+
/* @__PURE__ */ e(a, { align: "right", children: "Actions" })
|
|
590
594
|
] }) }),
|
|
591
|
-
/* @__PURE__ */ e(
|
|
592
|
-
if (
|
|
593
|
-
const
|
|
594
|
-
return
|
|
595
|
+
/* @__PURE__ */ e(le, { children: [...g.items].sort((t, i) => {
|
|
596
|
+
if (u === "createdAt") {
|
|
597
|
+
const c = t.createdAt ? new Date(t.createdAt).getTime() : 0, m = i.createdAt ? new Date(i.createdAt).getTime() : 0;
|
|
598
|
+
return p === s.ASC ? c - m : m - c;
|
|
595
599
|
}
|
|
596
|
-
if (
|
|
597
|
-
const
|
|
598
|
-
return
|
|
600
|
+
if (u === "expiresAt") {
|
|
601
|
+
const c = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, m = i.expiresAt ? new Date(i.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
|
|
602
|
+
return p === s.ASC ? c - m : m - c;
|
|
599
603
|
}
|
|
600
604
|
return 0;
|
|
601
|
-
}).map((t, i) => /* @__PURE__ */ r(
|
|
602
|
-
/* @__PURE__ */ e(
|
|
605
|
+
}).map((t, i) => /* @__PURE__ */ r(v, { children: [
|
|
606
|
+
/* @__PURE__ */ e(a, { className: C("dark:text-gray-400"), children: i + 1 }),
|
|
603
607
|
/* @__PURE__ */ e(
|
|
604
|
-
|
|
608
|
+
a,
|
|
605
609
|
{
|
|
606
|
-
className:
|
|
610
|
+
className: C(
|
|
607
611
|
"dark:text-white",
|
|
608
612
|
"max-w-25 sm:max-w-100",
|
|
609
613
|
"text-xs sm:text-sm"
|
|
@@ -615,11 +619,11 @@ const Pe = ({
|
|
|
615
619
|
}
|
|
616
620
|
),
|
|
617
621
|
/* @__PURE__ */ e(
|
|
618
|
-
|
|
622
|
+
a,
|
|
619
623
|
{
|
|
620
624
|
component: "th",
|
|
621
625
|
scope: "row",
|
|
622
|
-
className:
|
|
626
|
+
className: C(
|
|
623
627
|
"dark:text-gray-400",
|
|
624
628
|
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
625
629
|
),
|
|
@@ -627,9 +631,9 @@ const Pe = ({
|
|
|
627
631
|
}
|
|
628
632
|
),
|
|
629
633
|
/* @__PURE__ */ e(
|
|
630
|
-
|
|
634
|
+
a,
|
|
631
635
|
{
|
|
632
|
-
className:
|
|
636
|
+
className: C(
|
|
633
637
|
"dark:text-gray-400",
|
|
634
638
|
"sm:whitespace-nowrap text-xs sm:text-sm"
|
|
635
639
|
),
|
|
@@ -637,12 +641,12 @@ const Pe = ({
|
|
|
637
641
|
}
|
|
638
642
|
),
|
|
639
643
|
/* @__PURE__ */ e(
|
|
640
|
-
|
|
644
|
+
a,
|
|
641
645
|
{
|
|
642
646
|
className: "align-top border-l border-table-light dark:border-table-dark",
|
|
643
647
|
align: "right",
|
|
644
648
|
children: /* @__PURE__ */ r(
|
|
645
|
-
|
|
649
|
+
M,
|
|
646
650
|
{
|
|
647
651
|
columnGap: 2,
|
|
648
652
|
alignHorizontal: "flex-end",
|
|
@@ -660,14 +664,14 @@ const Pe = ({
|
|
|
660
664
|
noBorder: !0,
|
|
661
665
|
label: "Restore memory",
|
|
662
666
|
variant: "primary",
|
|
663
|
-
disabled:
|
|
667
|
+
disabled: J.isPending,
|
|
664
668
|
onClick: () => {
|
|
665
|
-
|
|
666
|
-
user:
|
|
669
|
+
d && J.mutate({
|
|
670
|
+
user: d,
|
|
667
671
|
memoryId: t.memoryId
|
|
668
672
|
});
|
|
669
673
|
},
|
|
670
|
-
children: /* @__PURE__ */ e(
|
|
674
|
+
children: /* @__PURE__ */ e(_e, { size: "size-3", monotone: !0 })
|
|
671
675
|
}
|
|
672
676
|
)
|
|
673
677
|
}
|
|
@@ -686,14 +690,14 @@ const Pe = ({
|
|
|
686
690
|
label: "Delete memory",
|
|
687
691
|
variant: "primary",
|
|
688
692
|
iconClassName: "text-red-700 dark:text-red-500",
|
|
689
|
-
disabled:
|
|
690
|
-
onClick: () =>
|
|
693
|
+
disabled: F.isPending,
|
|
694
|
+
onClick: () => W(
|
|
691
695
|
t.memoryId,
|
|
692
696
|
t.text,
|
|
693
697
|
t.description,
|
|
694
698
|
t.createdAt
|
|
695
699
|
),
|
|
696
|
-
children: /* @__PURE__ */ e(
|
|
700
|
+
children: /* @__PURE__ */ e(re, { size: "size-3", monotone: !0 })
|
|
697
701
|
}
|
|
698
702
|
)
|
|
699
703
|
}
|
|
@@ -704,7 +708,7 @@ const Pe = ({
|
|
|
704
708
|
}
|
|
705
709
|
)
|
|
706
710
|
] }, t.memoryId)) }),
|
|
707
|
-
/* @__PURE__ */ e(
|
|
711
|
+
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ r(a, { colSpan: 5, children: [
|
|
708
712
|
g.total,
|
|
709
713
|
" expired memor",
|
|
710
714
|
g.total === 1 ? "y" : "ies",
|
|
@@ -731,6 +735,5 @@ const Pe = ({
|
|
|
731
735
|
] });
|
|
732
736
|
};
|
|
733
737
|
export {
|
|
734
|
-
|
|
735
|
-
je as default
|
|
738
|
+
Xe as default
|
|
736
739
|
};
|