@versini/sassysaint 8.118.4 → 8.119.1

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 (87) hide show
  1. package/dist/chunks/{AboutChangelog.Dspi4cmi.js → AboutChangelog.DUUKJ4nJ.js} +2 -2
  2. package/dist/chunks/{AboutEntry.DxWZPlbg.js → AboutEntry.HowTPv8P.js} +7 -7
  3. package/dist/chunks/{App.yIuQGm0t.js → App.YH7VhNjK.js} +647 -646
  4. package/dist/chunks/{BubbleActions.BMYwxyEv.js → BubbleActions.CVas6oiy.js} +3 -3
  5. package/dist/chunks/ButtonIconDelete.DLIImGjj.js +538 -0
  6. package/dist/chunks/{Chart.C1IWoXDe.js → Chart.CgyzOc3_.js} +2 -2
  7. package/dist/chunks/{ChatBubbleAssistant.BKlO1McH.js → ChatBubbleAssistant.PmI4ABQt.js} +9 -6
  8. package/dist/chunks/{ChatBubbleUser.CSjDB1B9.js → ChatBubbleUser.YIoXqbVF.js} +4 -4
  9. package/dist/chunks/HistoryDataGrid.Dxc-zHra.js +487 -0
  10. package/dist/chunks/HistoryEntry.fta5Qy7u.js +305 -0
  11. package/dist/chunks/InlineFilter.BV1LITjW.js +123 -0
  12. package/dist/chunks/{LoginEntry.BEPZiizw.js → LoginEntry.s9rmuYKn.js} +4 -4
  13. package/dist/chunks/{LogoEntry.BZFz5IRw.js → LogoEntry.BAI8lPSQ.js} +175 -163
  14. package/dist/chunks/{MemoriesEntry.C40K6l5F.js → MemoriesEntry.z0U8T17Y.js} +234 -206
  15. package/dist/chunks/{ProfileEntry.C0WTyHem.js → ProfileEntry.CbUS7vRG.js} +4 -4
  16. package/dist/chunks/{SettingsEntry.B1WFVdjg.js → SettingsEntry.LEugTL8A.js} +5 -5
  17. package/dist/chunks/{UsageEntry.CPOickJC.js → UsageEntry.DMIbfTUl.js} +5 -5
  18. package/dist/chunks/{_baseUniq.YXUy3_Q9.js → _baseUniq.3SecgKQH.js} +1 -1
  19. package/dist/chunks/{arc.CgPKPJv0.js → arc.BDfa_lp3.js} +1 -1
  20. package/dist/chunks/{architecture-U656AL7Q.D2ZUn_s6.js → architecture-U656AL7Q.HFVQwsOS.js} +1 -1
  21. package/dist/chunks/{architectureDiagram-VXUJARFQ.DbVJLkeI.js → architectureDiagram-VXUJARFQ.BvrTiPQ0.js} +4 -4
  22. package/dist/chunks/{blockDiagram-VD42YOAC.DFlSEVyA.js → blockDiagram-VD42YOAC.DOklLUrl.js} +5 -5
  23. package/dist/chunks/{browser.DtDEL-3A.js → browser.DQk9GqZL.js} +1 -1
  24. package/dist/chunks/{c4Diagram-YG6GDRKO.CiBMNtX8.js → c4Diagram-YG6GDRKO.BFUTTk1Y.js} +2 -2
  25. package/dist/chunks/{channel.DS55bkfq.js → channel.BOFo9Gr-.js} +1 -1
  26. package/dist/chunks/{chunk-4BX2VUAB.t3AfQtrb.js → chunk-4BX2VUAB.CvDkLN8F.js} +1 -1
  27. package/dist/chunks/{chunk-55IACEB6.tlGBBIP8.js → chunk-55IACEB6.B2kRln8j.js} +1 -1
  28. package/dist/chunks/{chunk-B4BG7PRW.DB-Y3GhQ.js → chunk-B4BG7PRW.Corbwbnt.js} +4 -4
  29. package/dist/chunks/{chunk-DI55MBZ5.CkwKVFLI.js → chunk-DI55MBZ5.BT3HHSn0.js} +3 -3
  30. package/dist/chunks/{chunk-FMBD7UC4.CRLAfQmx.js → chunk-FMBD7UC4.5EY27HC-.js} +1 -1
  31. package/dist/chunks/{chunk-QN33PNHL.DF4bWkbp.js → chunk-QN33PNHL.BbRol0tK.js} +1 -1
  32. package/dist/chunks/{chunk-QZHKN3VN.BijmX3ar.js → chunk-QZHKN3VN.BDDo68fx.js} +1 -1
  33. package/dist/chunks/{chunk-TZMSLE5B.BIvqaR0r.js → chunk-TZMSLE5B.DUziio9C.js} +1 -1
  34. package/dist/chunks/{classDiagram-2ON5EDUG.SU5U-1P1.js → classDiagram-2ON5EDUG.CQzgRWsN.js} +2 -2
  35. package/dist/chunks/{classDiagram-v2-WZHVMYZB.SU5U-1P1.js → classDiagram-v2-WZHVMYZB.CQzgRWsN.js} +2 -2
  36. package/dist/chunks/{clone.8clUx6ET.js → clone.BbTV7Hf1.js} +1 -1
  37. package/dist/chunks/{cose-bilkent-S5V4N54A.DnWtIsYd.js → cose-bilkent-S5V4N54A.H-phdC7M.js} +2 -2
  38. package/dist/chunks/{dagre-6UL2VRFP.C8KeFvOQ.js → dagre-6UL2VRFP.x6Rep04B.js} +5 -5
  39. package/dist/chunks/{diagram-PSM6KHXK.DnzHPurw.js → diagram-PSM6KHXK.CSCzs70K.js} +4 -4
  40. package/dist/chunks/{diagram-QEK2KX5R.DCKZbQSh.js → diagram-QEK2KX5R.Dtem9HUK.js} +3 -3
  41. package/dist/chunks/{diagram-S2PKOQOG.lY2nb2ry.js → diagram-S2PKOQOG.zbHWbMaf.js} +3 -3
  42. package/dist/chunks/{erDiagram-Q2GNP2WA.BYtHx1uZ.js → erDiagram-Q2GNP2WA.BtpqAsGU.js} +4 -4
  43. package/dist/chunks/{flowDiagram-NV44I4VS.G-nRLM7M.js → flowDiagram-NV44I4VS.DWAr7BjD.js} +5 -5
  44. package/dist/chunks/{ganttDiagram-JELNMOA3.B7RwC1m-.js → ganttDiagram-JELNMOA3.CMrQ-dz3.js} +2 -2
  45. package/dist/chunks/{gitGraph-F6HP7TQM.Chwk8Igs.js → gitGraph-F6HP7TQM.BpVVMz0e.js} +1 -1
  46. package/dist/chunks/{gitGraphDiagram-NY62KEGX.BQpsCwST.js → gitGraphDiagram-NY62KEGX.Dnudwhw8.js} +4 -4
  47. package/dist/chunks/{graph.toxuN_lw.js → graph.Dchkn011.js} +2 -2
  48. package/dist/chunks/{index.KxPrp_tf.js → index.B-JCLT_X.js} +3 -3
  49. package/dist/chunks/{index.Bt339Jho.js → index.B8WGlS1_.js} +1 -1
  50. package/dist/chunks/{index.petd1VFV.js → index.C1iOYl0L.js} +1 -1
  51. package/dist/chunks/{index.BlDUpXR0.js → index.CFiwZc0d.js} +1 -1
  52. package/dist/chunks/{index.ChIqgESd.js → index.CJdOzh65.js} +1 -1
  53. package/dist/chunks/{index.mDr9FsVI.js → index.CKTPHcKB.js} +1 -1
  54. package/dist/chunks/{index.D_muERB9.js → index.CtIbZ6tf.js} +1 -1
  55. package/dist/chunks/{index.7D5oQmQR.js → index.CxH0cB2j.js} +3 -3
  56. package/dist/chunks/{index.hGvmkGha.js → index.jtqzynwK.js} +2 -2
  57. package/dist/chunks/{info-NVLQJR56.DqwhVDNM.js → info-NVLQJR56.D6y19kSs.js} +1 -1
  58. package/dist/chunks/{infoDiagram-WHAUD3N6.Bz9PwgrD.js → infoDiagram-WHAUD3N6.Df1Bl645.js} +2 -2
  59. package/dist/chunks/{journeyDiagram-XKPGCS4Q.b8ugCUee.js → journeyDiagram-XKPGCS4Q.Ci2alRy7.js} +4 -4
  60. package/dist/chunks/{kanban-definition-3W4ZIXB7.ruPmZWrk.js → kanban-definition-3W4ZIXB7.DfuyRvt8.js} +2 -2
  61. package/dist/chunks/{layout.Bw1IU1i2.js → layout.D90hHM4d.js} +4 -4
  62. package/dist/chunks/{mermaid-parser.core.BgEYW9Yt.js → mermaid-parser.core.DLE_P-x2.js} +10 -10
  63. package/dist/chunks/{min.C98rd9wr.js → min.B0AjWADq.js} +2 -2
  64. package/dist/chunks/{mindmap-definition-VGOIOE7T.VWXpOB6F.js → mindmap-definition-VGOIOE7T.Bu83LzTN.js} +257 -232
  65. package/dist/chunks/{packet-BFZMPI3H.BYL6GQTI.js → packet-BFZMPI3H.DxZoEqgw.js} +1 -1
  66. package/dist/chunks/{pie-7BOR55EZ.BbY5iD1e.js → pie-7BOR55EZ.DWdiSl6K.js} +1 -1
  67. package/dist/chunks/{pieDiagram-ADFJNKIX.CsOtW7r-.js → pieDiagram-ADFJNKIX.BDwKttQ7.js} +4 -4
  68. package/dist/chunks/{quadrantDiagram-AYHSOK5B.7UFNI_vX.js → quadrantDiagram-AYHSOK5B.CRt3S_H1.js} +1 -1
  69. package/dist/chunks/{radar-NHE76QYJ.DvagCir3.js → radar-NHE76QYJ.CoZXKuQy.js} +1 -1
  70. package/dist/chunks/{rehype-mermaid.hM-_EEUn.js → rehype-mermaid.Om4IoSir.js} +33 -33
  71. package/dist/chunks/{requirementDiagram-UZGBJVZJ.CBvrcwfU.js → requirementDiagram-UZGBJVZJ.DlBPAOx9.js} +3 -3
  72. package/dist/chunks/{sankeyDiagram-TZEHDZUN.DwPokg-1.js → sankeyDiagram-TZEHDZUN.BZytE4s9.js} +1 -1
  73. package/dist/chunks/{sequenceDiagram-WL72ISMW.DTlYi-bq.js → sequenceDiagram-WL72ISMW.Bbuw9Hz-.js} +3 -3
  74. package/dist/chunks/{stateDiagram-FKZM4ZOC.B3zjLqs6.js → stateDiagram-FKZM4ZOC.BsnKKwn5.js} +4 -4
  75. package/dist/chunks/{stateDiagram-v2-4FDKWEC3.M0ePKl-7.js → stateDiagram-v2-4FDKWEC3.BsNASJkO.js} +2 -2
  76. package/dist/chunks/{timeline-definition-IT6M3QCI.QqZxgHc2.js → timeline-definition-IT6M3QCI.R8tQley7.js} +2 -2
  77. package/dist/chunks/{treemap-KMMF4GRG.BmCv7l6d.js → treemap-KMMF4GRG.Cs8W98VP.js} +1 -1
  78. package/dist/chunks/{useMarkdown.ZHvHgCd8.js → useMarkdown.Bzgv93hs.js} +8 -8
  79. package/dist/chunks/{xychartDiagram-PRI3JC2R.CPjv7vTS.js → xychartDiagram-PRI3JC2R.SMqCrVMM.js} +1 -1
  80. package/dist/components/SassySaint/SassySaint.js +1 -1
  81. package/dist/index.js +3 -3
  82. package/dist/style.css +1 -1
  83. package/package.json +4 -4
  84. package/dist/chunks/ButtonIconDelete.BMqZFgu1.js +0 -326
  85. package/dist/chunks/ChatHistoryTable.B8dA3To0.js +0 -322
  86. package/dist/chunks/HistoryEntry.Bhv62llk.js +0 -333
  87. package/dist/chunks/useAnimatedHeight.3F4Xj7iE.js +0 -91
@@ -0,0 +1,487 @@
1
+ import { jsx as t, jsxs as h, Fragment as E } from "react/jsx-runtime";
2
+ import { DataGridContext as A, useColumnMeasurement as J, getBodyClass as K, DataGridHeader as Q, DataGridRow as q, DataGridCell as d, DataGridCellSort as B, ButtonIconDelete as ee, DataGrid as te } from "./ButtonIconDelete.DLIImGjj.js";
3
+ import { forwardRef as re, useContext as ne, useRef as D, useState as X, useCallback as P, useEffect as v, useImperativeHandle as se, useMemo as $ } from "react";
4
+ import { CellWrapper as F, IconCloseLight as oe, ButtonIcon as U, IconRestore as le, IconStarInCircle as ae, IconStarInCircleLight as ce, CARDS as ie } from "./LogoEntry.BAI8lPSQ.js";
5
+ import { pluralize as H, numberFormatter as me, ResponsiveTooltip as z, isProbablyMobile as ue } from "./App.YH7VhNjK.js";
6
+ import I from "clsx";
7
+ import { y as _, V, INFINITE_SCROLL_THRESHOLD as de, INFINITE_SCROLL_LIMIT as fe } from "./index.jtqzynwK.js";
8
+ const xe = 20, pe = 5, he = "20px", Y = "data-row-index";
9
+ function ge(e) {
10
+ let r = e.parentElement;
11
+ for (; r; ) {
12
+ const l = getComputedStyle(r).overflowY;
13
+ if (l === "auto" || l === "scroll")
14
+ return r;
15
+ r = r.parentElement;
16
+ }
17
+ return null;
18
+ }
19
+ function be({ data: e, children: r, batchSize: o = xe, threshold: l = pe, rootMargin: i = he, onVisibleCountChange: f, className: x }, g) {
20
+ const m = ne(A), b = D(null), y = D(null), u = D(null), s = e.length, N = Math.min(o + l, s), [a, T] = X(N), C = a < s, R = P((n) => {
21
+ const k = b.current;
22
+ if (!k)
23
+ return;
24
+ const c = k.querySelector(`[${Y}="${n}"]`);
25
+ if (c) {
26
+ const S = c.querySelector('[role="row"]');
27
+ S && S.scrollIntoView({
28
+ behavior: "smooth",
29
+ block: "center"
30
+ });
31
+ }
32
+ }, []);
33
+ v(() => {
34
+ if (u.current !== null) {
35
+ const n = u.current;
36
+ n < a && (requestAnimationFrame(() => {
37
+ R(n);
38
+ }), u.current = null);
39
+ }
40
+ }, [
41
+ a,
42
+ R
43
+ ]), se(g, () => ({
44
+ scrollToIndex: (n) => {
45
+ if (n < 0 || n >= s) {
46
+ console.warn(`scrollToIndex: index ${n} is out of bounds (0-${s - 1})`);
47
+ return;
48
+ }
49
+ if (n < a) {
50
+ R(n);
51
+ return;
52
+ }
53
+ const k = Math.min(n + l + 1, s);
54
+ u.current = n, T(k);
55
+ }
56
+ }), [
57
+ s,
58
+ a,
59
+ l,
60
+ R
61
+ ]), v(() => {
62
+ T(Math.min(o + l, s));
63
+ }, [
64
+ s,
65
+ o,
66
+ l
67
+ ]), v(() => {
68
+ f?.(a, s);
69
+ }, [
70
+ a,
71
+ s,
72
+ f
73
+ ]);
74
+ const p = P((n) => {
75
+ n[0]?.isIntersecting && T((c) => Math.min(c + o, s));
76
+ }, [
77
+ o,
78
+ s
79
+ ]), w = P((n) => {
80
+ if (y.current && (y.current.disconnect(), y.current = null), n && C) {
81
+ const k = ge(n);
82
+ y.current = new IntersectionObserver(p, {
83
+ root: k,
84
+ rootMargin: i
85
+ }), y.current.observe(n);
86
+ }
87
+ }, [
88
+ C,
89
+ p,
90
+ i
91
+ ]);
92
+ v(() => () => {
93
+ y.current?.disconnect();
94
+ }, []);
95
+ const M = $(() => C ? Math.max(0, a - l) : -1, [
96
+ C,
97
+ a,
98
+ l
99
+ ]), O = $(() => ({
100
+ ...m,
101
+ cellWrapper: F.BODY
102
+ }), [
103
+ m
104
+ ]), G = $(() => {
105
+ const n = [], k = Math.min(a, s) - 1;
106
+ for (let c = 0; c < a && c < s; c++) {
107
+ c === M && n.push(/* @__PURE__ */ t("div", {
108
+ ref: w,
109
+ "aria-hidden": "true",
110
+ style: {
111
+ height: "1px",
112
+ background: "transparent"
113
+ }
114
+ }, "__infinite-scroll-marker-inline__"));
115
+ const S = !C && c === k;
116
+ n.push(/* @__PURE__ */ t(A.Provider, {
117
+ value: {
118
+ ...O,
119
+ rowIndex: c,
120
+ isLastRow: S
121
+ },
122
+ children: /* @__PURE__ */ t("div", {
123
+ [Y]: c,
124
+ style: {
125
+ display: "contents"
126
+ },
127
+ children: r(e[c], c)
128
+ })
129
+ }, c));
130
+ }
131
+ return M === a && C && n.push(/* @__PURE__ */ t("div", {
132
+ ref: w,
133
+ "aria-hidden": "true",
134
+ style: {
135
+ height: "1px",
136
+ background: "transparent"
137
+ }
138
+ }, "__infinite-scroll-marker-end__")), n;
139
+ }, [
140
+ e,
141
+ a,
142
+ s,
143
+ M,
144
+ C,
145
+ r,
146
+ w,
147
+ O
148
+ ]);
149
+ J(b, G);
150
+ const Z = K(!!m.columns, x);
151
+ return /* @__PURE__ */ t(A.Provider, {
152
+ value: {
153
+ ...m,
154
+ cellWrapper: F.BODY
155
+ },
156
+ children: /* @__PURE__ */ t("div", {
157
+ ref: b,
158
+ role: "rowgroup",
159
+ className: Z,
160
+ children: G
161
+ })
162
+ });
163
+ }
164
+ const ye = /* @__PURE__ */ re(be), we = ({
165
+ sortDirection: e,
166
+ sortedCell: r,
167
+ onSortChange: o,
168
+ caption: l,
169
+ isSearchActive: i = !1,
170
+ showTokenUsage: f = !0
171
+ }) => {
172
+ const x = (g) => {
173
+ o(g);
174
+ };
175
+ return /* @__PURE__ */ t(Q, { caption: l, children: /* @__PURE__ */ h(q, { children: [
176
+ /* @__PURE__ */ t(d, { className: "invisible", children: "Row" }),
177
+ f ? /* @__PURE__ */ h(E, { children: [
178
+ /* @__PURE__ */ t(d, { className: "text-xs sm:text-sm", children: "Summary" }),
179
+ i ? /* @__PURE__ */ t(d, { className: "text-xs sm:text-sm", children: "Date" }) : /* @__PURE__ */ t(
180
+ B,
181
+ {
182
+ focusMode: "system",
183
+ buttonClassName: "text-xs sm:text-sm",
184
+ cellId: _,
185
+ align: "left",
186
+ sortDirection: r === _ ? e : !1,
187
+ sortedCell: r,
188
+ onSort: x,
189
+ children: "Date"
190
+ }
191
+ ),
192
+ i ? /* @__PURE__ */ t(d, { align: "right", className: "text-xs sm:text-sm", children: "Tokens" }) : /* @__PURE__ */ t(
193
+ B,
194
+ {
195
+ focusMode: "system",
196
+ buttonClassName: "text-xs sm:text-sm",
197
+ cellId: V,
198
+ align: "right",
199
+ sortDirection: r === V ? e : !1,
200
+ sortedCell: r,
201
+ onSort: x,
202
+ children: "Tokens"
203
+ }
204
+ )
205
+ ] }) : /* @__PURE__ */ h(E, { children: [
206
+ i ? /* @__PURE__ */ t(d, { className: "text-xs sm:text-sm", children: "Date" }) : /* @__PURE__ */ t(
207
+ B,
208
+ {
209
+ focusMode: "system",
210
+ buttonClassName: "text-xs sm:text-sm",
211
+ cellId: _,
212
+ align: "left",
213
+ sortDirection: r === _ ? e : !1,
214
+ sortedCell: r,
215
+ onSort: x,
216
+ children: "Date"
217
+ }
218
+ ),
219
+ /* @__PURE__ */ t(d, { className: "text-xs sm:text-sm", children: "Summary" })
220
+ ] }),
221
+ /* @__PURE__ */ t(d, { align: "right", className: "text-xs sm:text-sm", children: "Actions" })
222
+ ] }) });
223
+ };
224
+ const Ie = "av-pill", ke = ({ variant: e }) => I("rounded-xs border", {
225
+ "border-border-information": e === "information",
226
+ "border-border-warning": e === "warning",
227
+ "border-border-success": e === "success",
228
+ "border-border-error": e === "error"
229
+ }), W = ({ variant: e }) => I("not-prose", {
230
+ "text-copy-information": e === "information",
231
+ "text-copy-warning": e === "warning",
232
+ "text-copy-success": e === "success",
233
+ "text-copy-error": e === "error"
234
+ }), Ce = ({ variant: e }) => I({
235
+ "bg-surface-information": e === "information",
236
+ "bg-surface-warning": e === "warning",
237
+ "bg-surface-success": e === "success",
238
+ "bg-surface-error": e === "error"
239
+ }), Ne = (e) => {
240
+ const { className: r, variant: o } = e;
241
+ return {
242
+ main: I(Ie, "inline-flex items-center gap-1 px-2 py-0.5 text-xs", ke({
243
+ variant: o
244
+ }), W({
245
+ variant: o
246
+ }), Ce(e), r),
247
+ button: I("inline-flex items-center justify-center", "ml-1", "focus:outline", "focus:outline-1", "focus:outline-offset-1", "focus:outline-focus-dark", "hover:bg-surface-medium/50", "rounded-full", W({
248
+ variant: o
249
+ }))
250
+ };
251
+ }, j = ({ label: e, className: r, variant: o = "information", description: l, onClose: i }) => {
252
+ const [f, x] = X(!0), g = (b) => {
253
+ i && (i(b), b.defaultPrevented || x(!1));
254
+ };
255
+ if (!f)
256
+ return null;
257
+ const m = Ne({
258
+ className: r,
259
+ variant: o
260
+ });
261
+ return /* @__PURE__ */ h("div", {
262
+ role: "text",
263
+ className: m.main,
264
+ children: [
265
+ l && /* @__PURE__ */ t("span", {
266
+ className: "sr-only",
267
+ children: l
268
+ }),
269
+ /* @__PURE__ */ t("span", {
270
+ children: e
271
+ }),
272
+ i && /* @__PURE__ */ t("button", {
273
+ type: "button",
274
+ onClick: g,
275
+ className: m.button,
276
+ "aria-label": "Close",
277
+ children: /* @__PURE__ */ t(oe, {
278
+ size: "size-3"
279
+ })
280
+ })
281
+ ]
282
+ });
283
+ };
284
+ function ve(e, r, o) {
285
+ return o && r > e ? `Showing ${H(`${e} chat`, e)} out of ${r}` : H(`${e} chat`, e);
286
+ }
287
+ const L = {
288
+ rowNumber: "dark:text-copy-medium",
289
+ summary: "dark:text-white sm:max-w-full text-xs sm:text-sm",
290
+ timestamp: "dark:text-copy-medium sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
291
+ tokenUsage: "dark:text-copy-medium text-xs sm:text-sm"
292
+ };
293
+ function Te({
294
+ item: e,
295
+ index: r,
296
+ onClickRestore: o,
297
+ onClickDelete: l,
298
+ onClickFavorite: i,
299
+ showTokenUsage: f = !0,
300
+ isActive: x = !1
301
+ }) {
302
+ const g = e.timestamp.split(",")[0], m = e.similarityScore !== void 0 && e.similarityScore !== null ? Math.round(e.similarityScore * 100) : null, b = m !== null && m < 40 ? "warning" : "success", y = e.keywordMatch === !0, u = /* @__PURE__ */ t(
303
+ d,
304
+ {
305
+ className: I(L.summary),
306
+ style: { wordBreak: "break-word" },
307
+ children: /* @__PURE__ */ h("div", { className: "flex flex-col gap-1", children: [
308
+ /* @__PURE__ */ h("div", { className: "flex flex-wrap gap-1", children: [
309
+ m !== null && /* @__PURE__ */ t(
310
+ j,
311
+ {
312
+ variant: b,
313
+ label: `${m}% semantic`
314
+ }
315
+ ),
316
+ y && /* @__PURE__ */ t(j, { variant: "information", label: "keyword" })
317
+ ] }),
318
+ /* @__PURE__ */ t("span", { children: e.summary })
319
+ ] })
320
+ }
321
+ ), s = /* @__PURE__ */ t(d, { className: I(L.timestamp), children: g }), N = f ? /* @__PURE__ */ t(d, { align: "right", className: I(L.tokenUsage), children: e.tokenUsage ? me.format(e.tokenUsage) : "0" }) : null, a = /* @__PURE__ */ t(d, { align: "center", borderLeft: !0, children: /* @__PURE__ */ h("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
322
+ /* @__PURE__ */ t(
323
+ z,
324
+ {
325
+ label: "Restore chat",
326
+ placement: "top",
327
+ trigger: /* @__PURE__ */ t(
328
+ U,
329
+ {
330
+ noBorder: !0,
331
+ label: "Restore chat",
332
+ variant: "primary",
333
+ onClick: async () => {
334
+ await o(e);
335
+ },
336
+ children: /* @__PURE__ */ t(
337
+ le,
338
+ {
339
+ size: "size-3",
340
+ monotone: !0,
341
+ className: "text-copy-success dark:text-copy-success-light"
342
+ }
343
+ )
344
+ }
345
+ )
346
+ }
347
+ ),
348
+ /* @__PURE__ */ t(
349
+ z,
350
+ {
351
+ label: e.favoriteChat ? "Remove from favorites" : "Add to favorites",
352
+ placement: "top",
353
+ trigger: /* @__PURE__ */ t(
354
+ U,
355
+ {
356
+ noBorder: !0,
357
+ label: e.favoriteChat ? "Remove from favorites" : "Add to favorites",
358
+ variant: "primary",
359
+ onClick: async () => {
360
+ await i(e);
361
+ },
362
+ children: e.favoriteChat ? /* @__PURE__ */ t(ae, { size: "size-4", monotone: !0 }) : /* @__PURE__ */ t(ce, { size: "size-4", monotone: !0 })
363
+ }
364
+ )
365
+ }
366
+ ),
367
+ /* @__PURE__ */ t(
368
+ ee,
369
+ {
370
+ label: "Delete chat",
371
+ disabled: !1,
372
+ onClick: () => {
373
+ l(e);
374
+ }
375
+ }
376
+ )
377
+ ] }) });
378
+ return /* @__PURE__ */ h(q, { active: x, children: [
379
+ /* @__PURE__ */ t(d, { className: I(L.rowNumber), children: r + 1 }),
380
+ f ? /* @__PURE__ */ h(E, { children: [
381
+ u,
382
+ s,
383
+ N
384
+ ] }) : /* @__PURE__ */ h(E, { children: [
385
+ s,
386
+ u
387
+ ] }),
388
+ a
389
+ ] });
390
+ }
391
+ const Ae = ({
392
+ filteredHistory: e,
393
+ sortDirection: r,
394
+ sortedCell: o,
395
+ onSortChange: l,
396
+ onClickRestore: i,
397
+ onClickDelete: f,
398
+ onClickFavorite: x,
399
+ isLoading: g = !1,
400
+ totalHistoryCount: m,
401
+ isFiltered: b = !1,
402
+ isSearchActive: y = !1,
403
+ activeChatId: u
404
+ }) => {
405
+ const s = ue(), N = D(null), a = D(!1);
406
+ v(() => {
407
+ if (!u || a.current)
408
+ return;
409
+ const p = e.findIndex(
410
+ (w) => w.id === u
411
+ );
412
+ if (p !== -1) {
413
+ a.current = !0;
414
+ const w = setTimeout(() => {
415
+ N.current?.scrollToIndex(p);
416
+ }, 100);
417
+ return () => clearTimeout(w);
418
+ }
419
+ }, [u, e]), v(() => {
420
+ a.current = !1;
421
+ }, [u]);
422
+ const T = ve(
423
+ e.length,
424
+ m ?? e.length,
425
+ b
426
+ );
427
+ return /* @__PURE__ */ h(
428
+ te,
429
+ {
430
+ stickyHeader: !0,
431
+ stickyFooter: !0,
432
+ compact: !0,
433
+ mode: "alt-system",
434
+ blurEffect: "medium",
435
+ columns: s ? ["auto", "auto", "1fr", "0.4fr"] : [
436
+ "auto",
437
+ "minmax(10px, 1fr)",
438
+ "0.3fr",
439
+ "0.3fr",
440
+ "0.3fr"
441
+ ],
442
+ wrapperClassName: I(
443
+ "max-h-[clamp(12rem,calc(100dvh-24rem),60dvh)]",
444
+ "sm:max-h-[clamp(12rem,calc(100dvh-24rem),60dvh)]"
445
+ ),
446
+ loading: g && e.length > 0,
447
+ children: [
448
+ /* @__PURE__ */ t(
449
+ we,
450
+ {
451
+ sortDirection: r,
452
+ sortedCell: o,
453
+ onSortChange: l,
454
+ caption: T,
455
+ isSearchActive: y,
456
+ showTokenUsage: !s
457
+ }
458
+ ),
459
+ g && e.length === 0 ? /* @__PURE__ */ t("div", { className: "p-4 text-center", role: "status", "aria-live": "polite", children: "Loading..." }) : /* @__PURE__ */ t(
460
+ ye,
461
+ {
462
+ ref: N,
463
+ data: e.filter((p) => p?.summary),
464
+ batchSize: fe,
465
+ threshold: de,
466
+ children: (p, w) => /* @__PURE__ */ t(
467
+ Te,
468
+ {
469
+ item: p,
470
+ index: w,
471
+ onClickRestore: i,
472
+ onClickDelete: f,
473
+ onClickFavorite: x,
474
+ showTokenUsage: !s,
475
+ isActive: u === p.id
476
+ },
477
+ `${ie.HISTORY.TITLE}-${p.id}-${w}`
478
+ )
479
+ }
480
+ )
481
+ ]
482
+ }
483
+ );
484
+ };
485
+ export {
486
+ Ae as HistoryDataGrid
487
+ };