@versini/sassysaint 8.117.1 → 8.118.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.C5D0TvzV.js → AboutChangelog.NMMfTbp4.js} +2 -2
- package/dist/chunks/{AboutEntry.BH9puKiR.js → AboutEntry.8kXGiBKr.js} +7 -7
- package/dist/chunks/{App.e-vnwYiT.js → App.MBikKP52.js} +16 -16
- package/dist/chunks/{BubbleActions.CZIq3NyO.js → BubbleActions.u9muFBXv.js} +3 -3
- package/dist/chunks/{ButtonIconDelete.CXKvnkV9.js → ButtonIconDelete.UIDZwKOu.js} +2 -2
- package/dist/chunks/{Chart.Crdej200.js → Chart.IEDLbK1M.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.BsPP4scU.js → ChatBubbleAssistant.Cn1keoow.js} +5 -5
- package/dist/chunks/{ChatBubbleUser.CXbMpU0u.js → ChatBubbleUser.DUizsIIv.js} +4 -4
- package/dist/chunks/{ChatHistoryTable.WYPAqhPD.js → ChatHistoryTable.DIT1MlOO.js} +4 -4
- package/dist/chunks/HistoryEntry.sZ_AMeUu.js +341 -0
- package/dist/chunks/InlineFilter.1dVMRTxM.js +58 -0
- package/dist/chunks/{LoginEntry.DsfSv0HE.js → LoginEntry.BnHprT7f.js} +4 -4
- package/dist/chunks/{LogoEntry.BaAKDAky.js → LogoEntry.uN5foS5i.js} +1 -1
- package/dist/chunks/MemoriesEntry.CpxdE30v.js +698 -0
- package/dist/chunks/{ProfileEntry.CbejkrAa.js → ProfileEntry.BMpJic5U.js} +4 -4
- package/dist/chunks/{SettingsEntry.BMdkik84.js → SettingsEntry.B8xGufV0.js} +5 -5
- package/dist/chunks/{UsageEntry.3T7jnx48.js → UsageEntry.B1zVYUBb.js} +5 -5
- package/dist/chunks/{_baseUniq.BfuOPl3s.js → _baseUniq.BeocMcb-.js} +1 -1
- package/dist/chunks/{arc.Yt3LnN9o.js → arc.C-CDR6Sz.js} +1 -1
- package/dist/chunks/{architecture-U656AL7Q.BXTYW3Rc.js → architecture-U656AL7Q.DQ7Jtm55.js} +1 -1
- package/dist/chunks/{architectureDiagram-VXUJARFQ.FCDARRR_.js → architectureDiagram-VXUJARFQ.Ceo3pgxm.js} +4 -4
- package/dist/chunks/{blockDiagram-VD42YOAC.C_rofYcs.js → blockDiagram-VD42YOAC.BvjaUl_a.js} +5 -5
- package/dist/chunks/{browser.D2KgtpfJ.js → browser.DvUqvHKQ.js} +1 -1
- package/dist/chunks/{c4Diagram-YG6GDRKO.HzZGAApo.js → c4Diagram-YG6GDRKO.D8dful9J.js} +2 -2
- package/dist/chunks/{channel.DG7G3U7-.js → channel.B6Qvl469.js} +1 -1
- package/dist/chunks/{chunk-4BX2VUAB.B4e3aO1D.js → chunk-4BX2VUAB.CtVNPH4N.js} +1 -1
- package/dist/chunks/{chunk-55IACEB6.CESo1NrJ.js → chunk-55IACEB6.C0X4Jue2.js} +1 -1
- package/dist/chunks/{chunk-B4BG7PRW.BBGa7Umf.js → chunk-B4BG7PRW.Conu6DQr.js} +4 -4
- package/dist/chunks/{chunk-DI55MBZ5.Z9MLFT29.js → chunk-DI55MBZ5.Dg38hF9_.js} +3 -3
- package/dist/chunks/{chunk-FMBD7UC4.D4_NSJjG.js → chunk-FMBD7UC4.BsUH0rhB.js} +1 -1
- package/dist/chunks/{chunk-QN33PNHL.CWfoXUts.js → chunk-QN33PNHL.0RjA_wXX.js} +1 -1
- package/dist/chunks/{chunk-QZHKN3VN.CGQnP_Cf.js → chunk-QZHKN3VN.Dz6HmVZY.js} +1 -1
- package/dist/chunks/{chunk-TZMSLE5B.BQIgZqgJ.js → chunk-TZMSLE5B.Dxuv9zIm.js} +1 -1
- package/dist/chunks/{classDiagram-2ON5EDUG.0mnXbc7I.js → classDiagram-2ON5EDUG.CRdX6xMs.js} +2 -2
- package/dist/chunks/{classDiagram-v2-WZHVMYZB.0mnXbc7I.js → classDiagram-v2-WZHVMYZB.CRdX6xMs.js} +2 -2
- package/dist/chunks/{clone.D47cjfdo.js → clone.ByaUA-r2.js} +1 -1
- package/dist/chunks/{cose-bilkent-S5V4N54A.mmkQB9Pa.js → cose-bilkent-S5V4N54A.B5YgIJoQ.js} +2 -2
- package/dist/chunks/{dagre-6UL2VRFP.qd2wkZfB.js → dagre-6UL2VRFP.uIiQ6FUj.js} +5 -5
- package/dist/chunks/{diagram-PSM6KHXK.ck1CH-jB.js → diagram-PSM6KHXK.Bv8fX1RC.js} +4 -4
- package/dist/chunks/{diagram-QEK2KX5R.CM3dUUt_.js → diagram-QEK2KX5R.CY_Rq5A7.js} +3 -3
- package/dist/chunks/{diagram-S2PKOQOG.Bjpg3WXB.js → diagram-S2PKOQOG.BfXCT4NH.js} +3 -3
- package/dist/chunks/{erDiagram-Q2GNP2WA.DQ7Zb7Yt.js → erDiagram-Q2GNP2WA.BQrPmQkr.js} +4 -4
- package/dist/chunks/{flowDiagram-NV44I4VS.Dd5E61BX.js → flowDiagram-NV44I4VS.DZwCRz8X.js} +5 -5
- package/dist/chunks/{ganttDiagram-JELNMOA3.D7NjdCpC.js → ganttDiagram-JELNMOA3.CpqB-Lco.js} +2 -2
- package/dist/chunks/{gitGraph-F6HP7TQM.IaH3QLVX.js → gitGraph-F6HP7TQM.HmdqWT9j.js} +1 -1
- package/dist/chunks/{gitGraphDiagram-NY62KEGX.u0rUsMj1.js → gitGraphDiagram-NY62KEGX.i87uZR96.js} +4 -4
- package/dist/chunks/{graph.wajwIKpE.js → graph.C_jA5HK0.js} +2 -2
- package/dist/chunks/{index.CDo0UzaU.js → index.BHwQBUwd.js} +1 -1
- package/dist/chunks/{index.D5kSEkHn.js → index.BaE2Lbfd.js} +1 -1
- package/dist/chunks/{index.DlOTeedC.js → index.BggKJCTP.js} +1 -1
- package/dist/chunks/{index.D4894ZsY.js → index.Bm1g0K7E.js} +3 -3
- package/dist/chunks/{index.BZr0bEQg.js → index.BrfxZy3k.js} +2 -2
- package/dist/chunks/{index.CLoMSp2_.js → index.C5piY5Ss.js} +1 -1
- package/dist/chunks/{index.DtA4hmwf.js → index.Y9mwgfBs.js} +1 -1
- package/dist/chunks/{index.BKWi9yvY.js → index.cXGGRddQ.js} +3 -3
- package/dist/chunks/{index.ilaSLj1g.js → index.g3S1xCER.js} +1 -1
- package/dist/chunks/{info-NVLQJR56.B6lxthJ9.js → info-NVLQJR56.ITJfPEdI.js} +1 -1
- package/dist/chunks/{infoDiagram-WHAUD3N6.BJncMSgg.js → infoDiagram-WHAUD3N6.fkRhLS2k.js} +2 -2
- package/dist/chunks/{journeyDiagram-XKPGCS4Q.Xc47puZv.js → journeyDiagram-XKPGCS4Q.BtGrOEeN.js} +4 -4
- package/dist/chunks/{kanban-definition-3W4ZIXB7.DdnGsCVe.js → kanban-definition-3W4ZIXB7.B5uNw32c.js} +2 -2
- package/dist/chunks/{layout.BT5I7f25.js → layout.CqkuHUdu.js} +4 -4
- package/dist/chunks/{mermaid-parser.core.Dy_1GmtD.js → mermaid-parser.core.Ci-ITaRl.js} +10 -10
- package/dist/chunks/{min.DvTOJyYm.js → min.ZkscJwva.js} +2 -2
- package/dist/chunks/{mindmap-definition-VGOIOE7T.Dd-3BZIu.js → mindmap-definition-VGOIOE7T.B6kzhC94.js} +4 -4
- package/dist/chunks/{packet-BFZMPI3H.Ch8ArXr6.js → packet-BFZMPI3H.BMbAoa6x.js} +1 -1
- package/dist/chunks/{pie-7BOR55EZ.EutZi19A.js → pie-7BOR55EZ.BMdBvM8R.js} +1 -1
- package/dist/chunks/{pieDiagram-ADFJNKIX.Bomp215d.js → pieDiagram-ADFJNKIX.-lbBXtjO.js} +4 -4
- package/dist/chunks/{quadrantDiagram-AYHSOK5B.DpUG7iX4.js → quadrantDiagram-AYHSOK5B.Davn6069.js} +1 -1
- package/dist/chunks/{radar-NHE76QYJ.WIkHtCoi.js → radar-NHE76QYJ.DYto8RZU.js} +1 -1
- package/dist/chunks/{rehype-mermaid.D2XFy4HS.js → rehype-mermaid.CSGNYSn9.js} +33 -33
- package/dist/chunks/{requirementDiagram-UZGBJVZJ.C65oMSNO.js → requirementDiagram-UZGBJVZJ.FMUxUq0R.js} +3 -3
- package/dist/chunks/{sankeyDiagram-TZEHDZUN.BPouA2z9.js → sankeyDiagram-TZEHDZUN.DTIl9DDr.js} +1 -1
- package/dist/chunks/{sequenceDiagram-WL72ISMW.DA-eSQtC.js → sequenceDiagram-WL72ISMW.Bc9ucdVx.js} +3 -3
- package/dist/chunks/{stateDiagram-FKZM4ZOC.GNpavprD.js → stateDiagram-FKZM4ZOC.DiBSTbjk.js} +4 -4
- package/dist/chunks/{stateDiagram-v2-4FDKWEC3.DdUIinRt.js → stateDiagram-v2-4FDKWEC3.C3xcoMwn.js} +2 -2
- package/dist/chunks/{timeline-definition-IT6M3QCI.DlJeBBE7.js → timeline-definition-IT6M3QCI.BC01Xx8r.js} +2 -2
- package/dist/chunks/{treemap-KMMF4GRG.BfQklqDu.js → treemap-KMMF4GRG.oysg6M_i.js} +1 -1
- package/dist/chunks/{useMarkdown.Sp_znZOD.js → useMarkdown.D8WEecQ3.js} +8 -8
- package/dist/chunks/{xychartDiagram-PRI3JC2R.e686B23N.js → xychartDiagram-PRI3JC2R.C3TO2yCs.js} +1 -1
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +3 -3
- package/package.json +3 -3
- package/dist/chunks/HistoryEntry.BhWdD0eP.js +0 -375
- package/dist/chunks/MemoriesEntry.B86jHTrW.js +0 -649
|
@@ -1,649 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n, Fragment as L } from "react/jsx-runtime";
|
|
2
|
-
import { n as pe, LOCAL_STORAGE_PREFIX as H, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as he, LOCAL_STORAGE_SORT_MEMORY_COLUMN as fe, useUserMemories as ge, useExpiredMemories as ye, useDeleteMemory as be, useDeleteAllActiveMemories as Ne, useDeleteAllExpiredMemories as ve, useUpdateMemory as Ce, useRestoreMemory as Ae } from "./index.BZr0bEQg.js";
|
|
3
|
-
import { Button as D, TableCellSortDirections as N, ButtonIcon as O, IconEdit as Te, IconRestore as Se, IconDelete as we } from "./LogoEntry.BaAKDAky.js";
|
|
4
|
-
import { Panel as K, Toggle as E, ButtonCancel as Q, ResponsiveTooltip as P, useLocalStorage as X, ConfirmationPanel as Y } from "./App.e-vnwYiT.js";
|
|
5
|
-
import S from "clsx";
|
|
6
|
-
import { useState as h, useEffect as Ee, useRef as B } from "react";
|
|
7
|
-
import { TextArea as De } from "./index.CLoMSp2_.js";
|
|
8
|
-
import { TableHead as ke, TableRow as _, TableCell as f, TableCellSort as J, ButtonIconDelete as Me, Table as Re, TableBody as Ie, TableFooter as Le } from "./ButtonIconDelete.CXKvnkV9.js";
|
|
9
|
-
const Oe = ({
|
|
10
|
-
open: r,
|
|
11
|
-
onOpenChange: s,
|
|
12
|
-
initialText: i,
|
|
13
|
-
metadata: t,
|
|
14
|
-
onSave: l,
|
|
15
|
-
isSaving: c = !1
|
|
16
|
-
}) => {
|
|
17
|
-
const [o, p] = h(i), [d, u] = h("none");
|
|
18
|
-
Ee(() => {
|
|
19
|
-
if (r) {
|
|
20
|
-
p(i);
|
|
21
|
-
const a = t?.expiration || "none";
|
|
22
|
-
u(a);
|
|
23
|
-
}
|
|
24
|
-
}, [r, i, t?.expiration]);
|
|
25
|
-
const g = () => {
|
|
26
|
-
if (o.trim().length >= 3) {
|
|
27
|
-
const a = d === "none" ? null : d;
|
|
28
|
-
l(o.trim(), a);
|
|
29
|
-
}
|
|
30
|
-
}, y = o.trim().length >= 3, v = o.trim() !== i.trim() || d !== (t?.expiration || "none");
|
|
31
|
-
return /* @__PURE__ */ e(
|
|
32
|
-
K,
|
|
33
|
-
{
|
|
34
|
-
open: r,
|
|
35
|
-
onOpenChange: s,
|
|
36
|
-
title: "Edit Memory",
|
|
37
|
-
animation: !0,
|
|
38
|
-
animationType: "fade",
|
|
39
|
-
footer: /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-x-2", children: [
|
|
40
|
-
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(Q, { onOpenChange: s, label: "Cancel" }) }),
|
|
41
|
-
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
42
|
-
D,
|
|
43
|
-
{
|
|
44
|
-
mode: "dark",
|
|
45
|
-
focusMode: "light",
|
|
46
|
-
disabled: c || !y || !v,
|
|
47
|
-
onClick: g,
|
|
48
|
-
children: c ? "Saving..." : "Save"
|
|
49
|
-
}
|
|
50
|
-
) })
|
|
51
|
-
] }),
|
|
52
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col pt-2 gap-4", children: [
|
|
53
|
-
/* @__PURE__ */ e(
|
|
54
|
-
De,
|
|
55
|
-
{
|
|
56
|
-
mode: "dark",
|
|
57
|
-
focusMode: "light",
|
|
58
|
-
label: "Memory text",
|
|
59
|
-
name: "memoryText",
|
|
60
|
-
value: o,
|
|
61
|
-
onChange: (a) => p(a.target.value),
|
|
62
|
-
autoFocus: !0,
|
|
63
|
-
helperText: o.trim().length < 3 ? "Memory text must be at least 3 characters" : `${o.length} characters`
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-3 p-4 bg-surface-darker rounded-md", children: [
|
|
67
|
-
/* @__PURE__ */ e("h3", { className: "text-sm m-0", children: "Memory Expiration" }),
|
|
68
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-copy-medium m-0", children: "Set when this memory should expire and be automatically removed." }),
|
|
69
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: [
|
|
70
|
-
/* @__PURE__ */ e(
|
|
71
|
-
E,
|
|
72
|
-
{
|
|
73
|
-
mode: "dark",
|
|
74
|
-
focusMode: "light",
|
|
75
|
-
noBorder: !0,
|
|
76
|
-
narrow: !0,
|
|
77
|
-
label: "Never expire",
|
|
78
|
-
name: "expiration-none",
|
|
79
|
-
checked: d === "none",
|
|
80
|
-
onChange: (a) => {
|
|
81
|
-
a && u("none");
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
/* @__PURE__ */ e(
|
|
86
|
-
E,
|
|
87
|
-
{
|
|
88
|
-
mode: "dark",
|
|
89
|
-
focusMode: "light",
|
|
90
|
-
noBorder: !0,
|
|
91
|
-
narrow: !0,
|
|
92
|
-
label: "Short (1 month)",
|
|
93
|
-
name: "expiration-short",
|
|
94
|
-
checked: d === "short",
|
|
95
|
-
onChange: (a) => {
|
|
96
|
-
a && u("short");
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
),
|
|
100
|
-
/* @__PURE__ */ e(
|
|
101
|
-
E,
|
|
102
|
-
{
|
|
103
|
-
mode: "dark",
|
|
104
|
-
focusMode: "light",
|
|
105
|
-
noBorder: !0,
|
|
106
|
-
narrow: !0,
|
|
107
|
-
label: "Medium (6 months)",
|
|
108
|
-
name: "expiration-medium",
|
|
109
|
-
checked: d === "medium",
|
|
110
|
-
onChange: (a) => {
|
|
111
|
-
a && u("medium");
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
/* @__PURE__ */ e(
|
|
116
|
-
E,
|
|
117
|
-
{
|
|
118
|
-
mode: "dark",
|
|
119
|
-
focusMode: "light",
|
|
120
|
-
noBorder: !0,
|
|
121
|
-
narrow: !0,
|
|
122
|
-
label: "Long (1 year)",
|
|
123
|
-
name: "expiration-long",
|
|
124
|
-
checked: d === "long",
|
|
125
|
-
onChange: (a) => {
|
|
126
|
-
a && u("long");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
] })
|
|
131
|
-
] }),
|
|
132
|
-
t && /* @__PURE__ */ n("div", { className: "flex flex-col gap-3 p-4 bg-surface-darker rounded-md", children: [
|
|
133
|
-
/* @__PURE__ */ e("h3", { className: "text-sm m-0", children: "Memory Details" }),
|
|
134
|
-
t.categories && t.categories.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
135
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Category" }),
|
|
136
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.categories.map((a, C) => /* @__PURE__ */ e(
|
|
137
|
-
"span",
|
|
138
|
-
{
|
|
139
|
-
className: "text-xs px-2 py-1 text-copy-light rounded",
|
|
140
|
-
children: a
|
|
141
|
-
},
|
|
142
|
-
`${a}-${C}`
|
|
143
|
-
)) })
|
|
144
|
-
] }),
|
|
145
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col sm:flex-row gap-4", children: [
|
|
146
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
|
|
147
|
-
t.confidence !== void 0 && t.confidence !== null && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
148
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Confidence" }),
|
|
149
|
-
/* @__PURE__ */ n("span", { className: "text-sm text-copy-light", children: [
|
|
150
|
-
(t.confidence * 100).toFixed(0),
|
|
151
|
-
"%"
|
|
152
|
-
] })
|
|
153
|
-
] }),
|
|
154
|
-
t.status && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
155
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Status" }),
|
|
156
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-copy-light capitalize", children: t.status })
|
|
157
|
-
] }),
|
|
158
|
-
t.sourceType && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
159
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Source Type" }),
|
|
160
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-copy-light capitalize", children: t.sourceType })
|
|
161
|
-
] })
|
|
162
|
-
] }),
|
|
163
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
|
|
164
|
-
t.quote && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
165
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Original Prompt" }),
|
|
166
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-copy-light m-0 italic", children: [
|
|
167
|
-
'"',
|
|
168
|
-
t.quote,
|
|
169
|
-
'"'
|
|
170
|
-
] })
|
|
171
|
-
] }),
|
|
172
|
-
t.canonicalText && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
173
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Canonical Text" }),
|
|
174
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-copy-light m-0 font-mono", children: t.canonicalText })
|
|
175
|
-
] })
|
|
176
|
-
] })
|
|
177
|
-
] })
|
|
178
|
-
] })
|
|
179
|
-
] })
|
|
180
|
-
}
|
|
181
|
-
);
|
|
182
|
-
};
|
|
183
|
-
function Pe({
|
|
184
|
-
isLoading: r,
|
|
185
|
-
isError: s,
|
|
186
|
-
viewMode: i
|
|
187
|
-
}) {
|
|
188
|
-
const t = i === "expired" ? "expired memories" : "memories";
|
|
189
|
-
return r ? /* @__PURE__ */ n("p", { className: "m-0", children: [
|
|
190
|
-
"Loading ",
|
|
191
|
-
t,
|
|
192
|
-
"..."
|
|
193
|
-
] }) : s ? /* @__PURE__ */ n("p", { className: "m-0 text-copy-error-light", children: [
|
|
194
|
-
"Failed to load ",
|
|
195
|
-
t,
|
|
196
|
-
"."
|
|
197
|
-
] }) : null;
|
|
198
|
-
}
|
|
199
|
-
function Be({ viewMode: r }) {
|
|
200
|
-
return /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: r === "expired" ? "No expired memories." : "No memories stored." });
|
|
201
|
-
}
|
|
202
|
-
function _e({
|
|
203
|
-
sortDirection: r,
|
|
204
|
-
sortedCell: s,
|
|
205
|
-
viewMode: i,
|
|
206
|
-
onSortChange: t
|
|
207
|
-
}) {
|
|
208
|
-
const l = (c) => {
|
|
209
|
-
t(c);
|
|
210
|
-
};
|
|
211
|
-
return /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ n(_, { children: [
|
|
212
|
-
/* @__PURE__ */ e(f, { className: "sr-only", children: "Row" }),
|
|
213
|
-
/* @__PURE__ */ e(f, { children: "Memory" }),
|
|
214
|
-
/* @__PURE__ */ e(
|
|
215
|
-
J,
|
|
216
|
-
{
|
|
217
|
-
focusMode: "system",
|
|
218
|
-
buttonClassName: "text-xs sm:text-sm",
|
|
219
|
-
cellId: "createdAt",
|
|
220
|
-
align: "left",
|
|
221
|
-
sortDirection: r,
|
|
222
|
-
sortedCell: s,
|
|
223
|
-
onClick: () => l("createdAt"),
|
|
224
|
-
children: "Date"
|
|
225
|
-
}
|
|
226
|
-
),
|
|
227
|
-
/* @__PURE__ */ e(
|
|
228
|
-
J,
|
|
229
|
-
{
|
|
230
|
-
focusMode: "system",
|
|
231
|
-
buttonClassName: "text-xs sm:text-sm",
|
|
232
|
-
cellId: "expiresAt",
|
|
233
|
-
align: "left",
|
|
234
|
-
sortDirection: r,
|
|
235
|
-
sortedCell: s,
|
|
236
|
-
onClick: () => l("expiresAt"),
|
|
237
|
-
children: i === "active" ? "Expires" : "Expired"
|
|
238
|
-
}
|
|
239
|
-
),
|
|
240
|
-
/* @__PURE__ */ e(f, { align: "right", children: "Actions" })
|
|
241
|
-
] }) });
|
|
242
|
-
}
|
|
243
|
-
function ze(r, s, i) {
|
|
244
|
-
return [...r].sort((t, l) => {
|
|
245
|
-
if (s === "createdAt") {
|
|
246
|
-
const c = t.createdAt ? new Date(t.createdAt).getTime() : 0, o = l.createdAt ? new Date(l.createdAt).getTime() : 0;
|
|
247
|
-
return i === N.ASC ? c - o : o - c;
|
|
248
|
-
}
|
|
249
|
-
if (s === "expiresAt") {
|
|
250
|
-
const c = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, o = l.expiresAt ? new Date(l.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
|
|
251
|
-
return i === N.ASC ? c - o : o - c;
|
|
252
|
-
}
|
|
253
|
-
return 0;
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
function Fe(r, s) {
|
|
257
|
-
const i = `${r} memor${r === 1 ? "y" : "ies"}`, t = s ? ` (~${s} tokens)` : "";
|
|
258
|
-
return i + t;
|
|
259
|
-
}
|
|
260
|
-
const T = {
|
|
261
|
-
rowNumber: "dark:text-copy-medium",
|
|
262
|
-
memoryText: "dark:text-copy-lighter max-w-25 sm:max-w-100 text-xs sm:text-sm",
|
|
263
|
-
date: "dark:text-copy-medium sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
|
|
264
|
-
dateCompact: "dark:text-copy-medium sm:whitespace-nowrap text-xs sm:text-sm",
|
|
265
|
-
actions: "align-top border-l border-table-light dark:border-table-dark"
|
|
266
|
-
};
|
|
267
|
-
function qe({
|
|
268
|
-
memory: r,
|
|
269
|
-
index: s,
|
|
270
|
-
viewMode: i,
|
|
271
|
-
isEditPending: t = !1,
|
|
272
|
-
isDeletePending: l = !1,
|
|
273
|
-
isRestorePending: c = !1,
|
|
274
|
-
onEdit: o,
|
|
275
|
-
onDelete: p,
|
|
276
|
-
onRestore: d
|
|
277
|
-
}) {
|
|
278
|
-
const u = r.description || r.text, g = r.createdAt ? new Date(r.createdAt).toLocaleDateString() : "-", y = r.expiresAt ? new Date(r.expiresAt).toLocaleDateString() : i === "active" ? "Never" : "-";
|
|
279
|
-
return /* @__PURE__ */ n(_, { children: [
|
|
280
|
-
/* @__PURE__ */ e(f, { className: S(T.rowNumber), children: s + 1 }),
|
|
281
|
-
/* @__PURE__ */ e(
|
|
282
|
-
f,
|
|
283
|
-
{
|
|
284
|
-
className: S(T.memoryText),
|
|
285
|
-
style: { wordBreak: "break-word" },
|
|
286
|
-
children: u
|
|
287
|
-
}
|
|
288
|
-
),
|
|
289
|
-
/* @__PURE__ */ e(f, { className: S(T.date), children: g }),
|
|
290
|
-
/* @__PURE__ */ e(f, { className: S(T.dateCompact), children: y }),
|
|
291
|
-
/* @__PURE__ */ e(f, { className: T.actions, align: "right", children: /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-x-2", children: [
|
|
292
|
-
i === "active" && o && /* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
293
|
-
P,
|
|
294
|
-
{
|
|
295
|
-
label: "Edit memory",
|
|
296
|
-
mode: "system",
|
|
297
|
-
placement: "top",
|
|
298
|
-
trigger: /* @__PURE__ */ e(
|
|
299
|
-
O,
|
|
300
|
-
{
|
|
301
|
-
focusMode: "system",
|
|
302
|
-
noBorder: !0,
|
|
303
|
-
label: "Edit memory",
|
|
304
|
-
variant: "primary",
|
|
305
|
-
disabled: t,
|
|
306
|
-
onClick: () => o(r),
|
|
307
|
-
children: /* @__PURE__ */ e(Te, { size: "size-3", monotone: !0 })
|
|
308
|
-
}
|
|
309
|
-
)
|
|
310
|
-
}
|
|
311
|
-
) }),
|
|
312
|
-
i === "expired" && d && /* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
313
|
-
P,
|
|
314
|
-
{
|
|
315
|
-
label: "Restore memory",
|
|
316
|
-
mode: "system",
|
|
317
|
-
placement: "top",
|
|
318
|
-
trigger: /* @__PURE__ */ e(
|
|
319
|
-
O,
|
|
320
|
-
{
|
|
321
|
-
focusMode: "system",
|
|
322
|
-
noBorder: !0,
|
|
323
|
-
label: "Restore memory",
|
|
324
|
-
variant: "primary",
|
|
325
|
-
disabled: c,
|
|
326
|
-
onClick: () => d(r.memoryId),
|
|
327
|
-
children: /* @__PURE__ */ e(Se, { size: "size-3", monotone: !0 })
|
|
328
|
-
}
|
|
329
|
-
)
|
|
330
|
-
}
|
|
331
|
-
) }),
|
|
332
|
-
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: i === "active" ? /* @__PURE__ */ e(
|
|
333
|
-
Me,
|
|
334
|
-
{
|
|
335
|
-
label: "Delete memory",
|
|
336
|
-
disabled: l,
|
|
337
|
-
onClick: () => p(r)
|
|
338
|
-
}
|
|
339
|
-
) : /* @__PURE__ */ e(
|
|
340
|
-
P,
|
|
341
|
-
{
|
|
342
|
-
label: "Delete memory",
|
|
343
|
-
mode: "system",
|
|
344
|
-
placement: "top",
|
|
345
|
-
trigger: /* @__PURE__ */ e(
|
|
346
|
-
O,
|
|
347
|
-
{
|
|
348
|
-
focusMode: "system",
|
|
349
|
-
noBorder: !0,
|
|
350
|
-
label: "Delete memory",
|
|
351
|
-
variant: "primary",
|
|
352
|
-
iconClassName: "text-copy-error-dark dark:text-copy-error-light",
|
|
353
|
-
disabled: l,
|
|
354
|
-
onClick: () => p(r),
|
|
355
|
-
children: /* @__PURE__ */ e(we, { size: "size-3", monotone: !0 })
|
|
356
|
-
}
|
|
357
|
-
)
|
|
358
|
-
}
|
|
359
|
-
) })
|
|
360
|
-
] }) })
|
|
361
|
-
] }, r.memoryId);
|
|
362
|
-
}
|
|
363
|
-
function je({
|
|
364
|
-
data: r,
|
|
365
|
-
isLoading: s,
|
|
366
|
-
isError: i,
|
|
367
|
-
viewMode: t,
|
|
368
|
-
sortDirection: l,
|
|
369
|
-
sortedCell: c,
|
|
370
|
-
isEditPending: o = !1,
|
|
371
|
-
isDeletePending: p = !1,
|
|
372
|
-
isRestorePending: d = !1,
|
|
373
|
-
onSortChange: u,
|
|
374
|
-
onEdit: g,
|
|
375
|
-
onDelete: y,
|
|
376
|
-
onRestore: v
|
|
377
|
-
}) {
|
|
378
|
-
const a = /* @__PURE__ */ e(
|
|
379
|
-
Pe,
|
|
380
|
-
{
|
|
381
|
-
isLoading: s,
|
|
382
|
-
isError: i,
|
|
383
|
-
viewMode: t
|
|
384
|
-
}
|
|
385
|
-
);
|
|
386
|
-
if (s || i)
|
|
387
|
-
return a;
|
|
388
|
-
if (!r || r.items.length === 0)
|
|
389
|
-
return /* @__PURE__ */ e(Be, { viewMode: t });
|
|
390
|
-
const C = ze(r.items, c, l), w = Fe(r.total, r.totalTokenUsage);
|
|
391
|
-
return /* @__PURE__ */ n(
|
|
392
|
-
Re,
|
|
393
|
-
{
|
|
394
|
-
stickyHeader: !0,
|
|
395
|
-
stickyFooter: !0,
|
|
396
|
-
compact: !0,
|
|
397
|
-
mode: "alt-system",
|
|
398
|
-
caption: t === "active" ? w : void 0,
|
|
399
|
-
children: [
|
|
400
|
-
/* @__PURE__ */ e(
|
|
401
|
-
_e,
|
|
402
|
-
{
|
|
403
|
-
sortDirection: l,
|
|
404
|
-
sortedCell: c,
|
|
405
|
-
viewMode: t,
|
|
406
|
-
onSortChange: u
|
|
407
|
-
}
|
|
408
|
-
),
|
|
409
|
-
/* @__PURE__ */ e(Ie, { children: C.map((A, k) => /* @__PURE__ */ e(
|
|
410
|
-
qe,
|
|
411
|
-
{
|
|
412
|
-
memory: A,
|
|
413
|
-
index: k,
|
|
414
|
-
viewMode: t,
|
|
415
|
-
isEditPending: o,
|
|
416
|
-
isDeletePending: p,
|
|
417
|
-
isRestorePending: d,
|
|
418
|
-
onEdit: g,
|
|
419
|
-
onDelete: y,
|
|
420
|
-
onRestore: v
|
|
421
|
-
},
|
|
422
|
-
A.memoryId
|
|
423
|
-
)) }),
|
|
424
|
-
/* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(f, { colSpan: 5, children: w }) }) })
|
|
425
|
-
]
|
|
426
|
-
}
|
|
427
|
-
);
|
|
428
|
-
}
|
|
429
|
-
const Qe = ({ open: r, onOpenChange: s, user: i }) => {
|
|
430
|
-
const t = B(null), { getAccessToken: l } = pe(), [c] = h(void 0), [o, p] = h("active"), [d, u] = X({
|
|
431
|
-
key: H + he,
|
|
432
|
-
initialValue: N.DESC
|
|
433
|
-
}), [g, y] = X({
|
|
434
|
-
key: H + fe,
|
|
435
|
-
initialValue: "createdAt"
|
|
436
|
-
}), [v, a] = h(
|
|
437
|
-
d || N.DESC
|
|
438
|
-
), [C, w] = h(
|
|
439
|
-
g || "createdAt"
|
|
440
|
-
), { data: A, isLoading: k, isError: W } = ge({
|
|
441
|
-
user: i,
|
|
442
|
-
query: c,
|
|
443
|
-
getAccessToken: l,
|
|
444
|
-
enabled: r && o === "active"
|
|
445
|
-
}), {
|
|
446
|
-
data: z,
|
|
447
|
-
isLoading: Z,
|
|
448
|
-
isError: ee
|
|
449
|
-
} = ye({
|
|
450
|
-
user: i,
|
|
451
|
-
query: c,
|
|
452
|
-
getAccessToken: l,
|
|
453
|
-
enabled: r && o === "expired"
|
|
454
|
-
}), F = be({ getAccessToken: l }), q = Ne({ getAccessToken: l }), j = ve({ getAccessToken: l }), M = Ce({ getAccessToken: l }), $ = Ae({ getAccessToken: l }), [te, G] = h(!1), b = B(null), [re, U] = h(!1), [ie, R] = h(!1), m = B(null), oe = (x) => {
|
|
455
|
-
w(x), y(x), a((I) => {
|
|
456
|
-
const V = I === N.ASC ? N.DESC : N.ASC;
|
|
457
|
-
return u(V), V;
|
|
458
|
-
});
|
|
459
|
-
}, ne = (x) => {
|
|
460
|
-
b.current = x, G(!0);
|
|
461
|
-
}, le = () => {
|
|
462
|
-
b.current && i && F.mutate({ user: i, memoryId: b.current.memoryId });
|
|
463
|
-
}, se = (x) => {
|
|
464
|
-
m.current = x, R(!0);
|
|
465
|
-
}, ae = (x, I) => {
|
|
466
|
-
m.current && i && M.mutate(
|
|
467
|
-
{
|
|
468
|
-
user: i,
|
|
469
|
-
memoryId: m.current.memoryId,
|
|
470
|
-
description: x,
|
|
471
|
-
expiration: I || void 0
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
onSuccess: () => {
|
|
475
|
-
R(!1);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
);
|
|
479
|
-
}, ce = (x) => {
|
|
480
|
-
i && $.mutate({ user: i, memoryId: x });
|
|
481
|
-
}, de = () => {
|
|
482
|
-
i && U(!0);
|
|
483
|
-
}, me = () => {
|
|
484
|
-
i && (o === "active" ? q.mutate({ user: i }) : j.mutate({ user: i }));
|
|
485
|
-
}, xe = o === "active" ? A : z, ue = (o === "active" ? q.isPending : j.isPending) || (xe?.total ?? 0) === 0;
|
|
486
|
-
return /* @__PURE__ */ n(L, { children: [
|
|
487
|
-
/* @__PURE__ */ e(
|
|
488
|
-
Oe,
|
|
489
|
-
{
|
|
490
|
-
open: ie,
|
|
491
|
-
onOpenChange: R,
|
|
492
|
-
initialText: m.current?.description || "",
|
|
493
|
-
metadata: m.current ? {
|
|
494
|
-
categories: m.current.categories,
|
|
495
|
-
quote: m.current.quote,
|
|
496
|
-
canonicalText: m.current.canonicalText,
|
|
497
|
-
confidence: m.current.confidence,
|
|
498
|
-
status: m.current.status,
|
|
499
|
-
sourceType: m.current.sourceType,
|
|
500
|
-
expiration: m.current.expiration,
|
|
501
|
-
expiresAt: m.current.expiresAt
|
|
502
|
-
} : void 0,
|
|
503
|
-
onSave: ae,
|
|
504
|
-
isSaving: M.isPending
|
|
505
|
-
}
|
|
506
|
-
),
|
|
507
|
-
/* @__PURE__ */ n(
|
|
508
|
-
Y,
|
|
509
|
-
{
|
|
510
|
-
showConfirmation: te,
|
|
511
|
-
setShowConfirmation: G,
|
|
512
|
-
action: le,
|
|
513
|
-
customStrings: {
|
|
514
|
-
title: "Delete memory",
|
|
515
|
-
confirmAction: "Delete",
|
|
516
|
-
cancelAction: "Cancel"
|
|
517
|
-
},
|
|
518
|
-
children: [
|
|
519
|
-
/* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
|
|
520
|
-
/* @__PURE__ */ n("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
|
|
521
|
-
/* @__PURE__ */ n("li", { children: [
|
|
522
|
-
"Excerpt:",
|
|
523
|
-
" ",
|
|
524
|
-
(b.current?.description || b.current?.text || "").slice(0, 80)
|
|
525
|
-
] }),
|
|
526
|
-
/* @__PURE__ */ n("li", { children: [
|
|
527
|
-
"Created:",
|
|
528
|
-
" ",
|
|
529
|
-
b.current?.createdAt ? new Date(b.current.createdAt).toLocaleString() : "-"
|
|
530
|
-
] })
|
|
531
|
-
] })
|
|
532
|
-
]
|
|
533
|
-
}
|
|
534
|
-
),
|
|
535
|
-
/* @__PURE__ */ e(
|
|
536
|
-
Y,
|
|
537
|
-
{
|
|
538
|
-
showConfirmation: re,
|
|
539
|
-
setShowConfirmation: U,
|
|
540
|
-
action: me,
|
|
541
|
-
customStrings: {
|
|
542
|
-
title: "Delete memories",
|
|
543
|
-
confirmAction: "Delete all",
|
|
544
|
-
cancelAction: "Cancel"
|
|
545
|
-
},
|
|
546
|
-
children: /* @__PURE__ */ e("p", { className: "m-0", children: o === "active" ? /* @__PURE__ */ n(L, { children: [
|
|
547
|
-
"This will permanently delete all ",
|
|
548
|
-
/* @__PURE__ */ e("em", { children: "active memories" }),
|
|
549
|
-
" for this user. This action cannot be undone."
|
|
550
|
-
] }) : /* @__PURE__ */ n(L, { children: [
|
|
551
|
-
"This will permanently delete all ",
|
|
552
|
-
/* @__PURE__ */ e("em", { children: "expired memories" }),
|
|
553
|
-
" for this user. This action cannot be undone."
|
|
554
|
-
] }) })
|
|
555
|
-
}
|
|
556
|
-
),
|
|
557
|
-
/* @__PURE__ */ e(
|
|
558
|
-
K,
|
|
559
|
-
{
|
|
560
|
-
open: r,
|
|
561
|
-
onOpenChange: (x) => s(x),
|
|
562
|
-
title: "User Memories",
|
|
563
|
-
animation: !0,
|
|
564
|
-
animationType: "fade",
|
|
565
|
-
blurEffect: "large",
|
|
566
|
-
initialFocus: t,
|
|
567
|
-
footer: /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-x-2", children: [
|
|
568
|
-
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
569
|
-
Q,
|
|
570
|
-
{
|
|
571
|
-
onOpenChange: s,
|
|
572
|
-
label: "Close",
|
|
573
|
-
ref: t
|
|
574
|
-
}
|
|
575
|
-
) }),
|
|
576
|
-
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
577
|
-
D,
|
|
578
|
-
{
|
|
579
|
-
mode: "dark",
|
|
580
|
-
focusMode: "light",
|
|
581
|
-
variant: "danger",
|
|
582
|
-
disabled: ue,
|
|
583
|
-
onClick: de,
|
|
584
|
-
children: "Delete All"
|
|
585
|
-
}
|
|
586
|
-
) })
|
|
587
|
-
] }),
|
|
588
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-4 @container/editmemoriespanel", children: [
|
|
589
|
-
/* @__PURE__ */ n("div", { className: "flex flex-wrap justify-center gap-x-2", children: [
|
|
590
|
-
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
591
|
-
D,
|
|
592
|
-
{
|
|
593
|
-
focusMode: "light",
|
|
594
|
-
mode: o === "active" ? "light" : "dark",
|
|
595
|
-
size: "small",
|
|
596
|
-
noBorder: !0,
|
|
597
|
-
onClick: () => p("active"),
|
|
598
|
-
children: "Active Memories"
|
|
599
|
-
}
|
|
600
|
-
) }),
|
|
601
|
-
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
602
|
-
D,
|
|
603
|
-
{
|
|
604
|
-
focusMode: "light",
|
|
605
|
-
mode: o === "expired" ? "light" : "dark",
|
|
606
|
-
size: "small",
|
|
607
|
-
noBorder: !0,
|
|
608
|
-
onClick: () => p("expired"),
|
|
609
|
-
children: "Expired Memories"
|
|
610
|
-
}
|
|
611
|
-
) })
|
|
612
|
-
] }),
|
|
613
|
-
/* @__PURE__ */ e(
|
|
614
|
-
"div",
|
|
615
|
-
{
|
|
616
|
-
className: S(
|
|
617
|
-
"flex flex-col sm:flex-row",
|
|
618
|
-
"max-h-[75vh]",
|
|
619
|
-
"sm:max-h-[75vh]",
|
|
620
|
-
"min-h-[70vh]"
|
|
621
|
-
),
|
|
622
|
-
children: /* @__PURE__ */ e(
|
|
623
|
-
je,
|
|
624
|
-
{
|
|
625
|
-
data: o === "active" ? A : z,
|
|
626
|
-
isLoading: o === "active" ? k : Z,
|
|
627
|
-
isError: o === "active" ? W : ee,
|
|
628
|
-
viewMode: o,
|
|
629
|
-
sortDirection: v,
|
|
630
|
-
sortedCell: C,
|
|
631
|
-
isEditPending: M.isPending,
|
|
632
|
-
isDeletePending: F.isPending,
|
|
633
|
-
isRestorePending: $.isPending,
|
|
634
|
-
onSortChange: oe,
|
|
635
|
-
onEdit: o === "active" ? se : void 0,
|
|
636
|
-
onDelete: ne,
|
|
637
|
-
onRestore: o === "expired" ? ce : void 0
|
|
638
|
-
}
|
|
639
|
-
)
|
|
640
|
-
}
|
|
641
|
-
)
|
|
642
|
-
] })
|
|
643
|
-
}
|
|
644
|
-
)
|
|
645
|
-
] });
|
|
646
|
-
};
|
|
647
|
-
export {
|
|
648
|
-
Qe as default
|
|
649
|
-
};
|