@epam/ai-dial-conversation-panel 1.1.0-dev.17 → 1.1.0-dev.173
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/components/ConversationGroupHeader/ConversationGroupHeader.d.ts +1 -4
- package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts.map +1 -1
- package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
- package/components/{ConversationGroup → ConversationRow}/ConversationRow.d.ts +6 -9
- package/components/ConversationRow/ConversationRow.d.ts.map +1 -0
- package/components/NewChatButton/NewChatButton.d.ts +4 -1
- package/components/NewChatButton/NewChatButton.d.ts.map +1 -1
- package/components/RowRenderer/RowRenderer.d.ts +1 -1
- package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +1 -2
- package/index.d.ts.map +1 -1
- package/index.js +462 -433
- package/models/panel-props.d.ts +42 -66
- package/models/panel-props.d.ts.map +1 -1
- package/models/virtual-row.d.ts +5 -6
- package/models/virtual-row.d.ts.map +1 -1
- package/package.json +5 -5
- package/types/conversation-classification.d.ts +1 -4
- package/types/conversation-classification.d.ts.map +1 -1
- package/utils/conversation-row.d.ts +1 -7
- package/utils/conversation-row.d.ts.map +1 -1
- package/utils/drag.d.ts +2 -14
- package/utils/drag.d.ts.map +1 -1
- package/components/ConversationGroup/ConversationGroup.d.ts +0 -31
- package/components/ConversationGroup/ConversationGroup.d.ts.map +0 -1
- package/components/ConversationGroup/ConversationRow.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { DeploymentIcon as e,
|
|
2
|
-
import { PanelEmpty as
|
|
3
|
-
import {
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { IconCaretDownFilled as
|
|
1
|
+
import { DeploymentIcon as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { PanelEmpty as r, PanelNoResults as i, SearchInput as a, SidebarOrientation as o, SidebarPanel as s } from "@epam/ai-dial-sidebar";
|
|
3
|
+
import { Button as c, DIAL_ICON_SIZE as l, DialEllipsisTooltip as u, DialTag as d, Dropdown as f, ElementSize as p, GhostIconButton as m, Highlight as h, Skeleton as g, SkeletonVariant as _, mergeClasses as v } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { createElement as y, memo as b, useCallback as x, useEffect as S, useId as C, useImperativeHandle as w, useLayoutEffect as T, useMemo as E, useRef as D, useState as O } from "react";
|
|
5
|
+
import { Fragment as ee, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
6
|
+
import { IconCaretDownFilled as j, IconCaretRightFilled as M, IconClock as N, IconDotsVertical as te, IconPlus as ne } from "@tabler/icons-react";
|
|
7
7
|
//#region ../../node_modules/react-window/dist/react-window.js
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var P = typeof window < "u" ? T : S;
|
|
9
|
+
function F(e) {
|
|
10
10
|
if (e !== void 0) switch (typeof e) {
|
|
11
11
|
case "number": return e;
|
|
12
12
|
case "string":
|
|
@@ -14,15 +14,15 @@ function L(e) {
|
|
|
14
14
|
break;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
let { styleHeight: s, styleWidth: c } =
|
|
19
|
-
styleHeight:
|
|
20
|
-
styleWidth:
|
|
21
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
17
|
+
function I({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
18
|
+
let { styleHeight: s, styleWidth: c } = E(() => ({
|
|
19
|
+
styleHeight: F(o?.height),
|
|
20
|
+
styleWidth: F(o?.width)
|
|
21
|
+
}), [o?.height, o?.width]), [l, u] = O({
|
|
22
22
|
height: t,
|
|
23
23
|
width: n
|
|
24
24
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
25
|
-
return
|
|
25
|
+
return P(() => {
|
|
26
26
|
if (i === null || d) return;
|
|
27
27
|
let t = new ResizeObserver((e) => {
|
|
28
28
|
for (let t of e) {
|
|
@@ -42,7 +42,7 @@ function R({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
42
42
|
i,
|
|
43
43
|
s,
|
|
44
44
|
c
|
|
45
|
-
]),
|
|
45
|
+
]), E(() => ({
|
|
46
46
|
height: s ?? l.height,
|
|
47
47
|
width: c ?? l.width
|
|
48
48
|
}), [
|
|
@@ -51,26 +51,26 @@ function R({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
51
51
|
c
|
|
52
52
|
]);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
let t =
|
|
54
|
+
function re(e) {
|
|
55
|
+
let t = D(() => {
|
|
56
56
|
throw Error("Cannot call during render.");
|
|
57
57
|
});
|
|
58
|
-
return
|
|
58
|
+
return P(() => {
|
|
59
59
|
t.current = e;
|
|
60
|
-
}, [e]),
|
|
60
|
+
}, [e]), x((e) => t.current?.(e), [t]);
|
|
61
61
|
}
|
|
62
|
-
var
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
62
|
+
var L = null;
|
|
63
|
+
function ie(e = !1) {
|
|
64
|
+
if (L === null || e) {
|
|
65
65
|
let e = document.createElement("div"), t = e.style;
|
|
66
66
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
67
67
|
let n = document.createElement("div"), r = n.style;
|
|
68
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
68
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? L = "positive-descending" : (e.scrollLeft = 1, L = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), L;
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return L;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
if (t === "horizontal" && n) switch (
|
|
72
|
+
function R({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
73
|
+
if (t === "horizontal" && n) switch (ie()) {
|
|
74
74
|
case "negative": return -r;
|
|
75
75
|
case "positive-descending":
|
|
76
76
|
if (e) {
|
|
@@ -81,26 +81,26 @@ function B({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
81
81
|
}
|
|
82
82
|
return r;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function z(e, t = "Assertion error") {
|
|
85
85
|
if (!e) throw console.error(t), Error(t);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function B(e, t) {
|
|
88
88
|
if (e === t) return !0;
|
|
89
|
-
if (!!e != !!t || (
|
|
89
|
+
if (!!e != !!t || (z(e !== void 0), z(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
90
90
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
91
91
|
return !0;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function ae({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
94
94
|
if (t === 0) return 0;
|
|
95
95
|
if (typeof n == "number") return t * n;
|
|
96
96
|
{
|
|
97
97
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
98
|
-
return
|
|
98
|
+
return z(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function V({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
102
102
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
103
|
-
let s =
|
|
103
|
+
let s = ae({
|
|
104
104
|
cachedBounds: t,
|
|
105
105
|
itemCount: r,
|
|
106
106
|
itemSize: i
|
|
@@ -112,7 +112,7 @@ function ne({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
112
112
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function H({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
116
116
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
117
117
|
for (; u < a;) {
|
|
118
118
|
let n = e.get(u);
|
|
@@ -131,11 +131,11 @@ function W({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
|
|
|
131
131
|
stopIndexOverscan: l
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function U({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
135
135
|
let r = /* @__PURE__ */ new Map();
|
|
136
136
|
return {
|
|
137
137
|
get(i) {
|
|
138
|
-
for (
|
|
138
|
+
for (z(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
139
139
|
let e = r.size, a;
|
|
140
140
|
switch (typeof n) {
|
|
141
141
|
case "function":
|
|
@@ -151,14 +151,14 @@ function G({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
151
151
|
});
|
|
152
152
|
else {
|
|
153
153
|
let t = r.get(e - 1);
|
|
154
|
-
|
|
154
|
+
z(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
155
155
|
scrollOffset: t.scrollOffset + t.size,
|
|
156
156
|
size: a
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
let a = r.get(i);
|
|
161
|
-
return
|
|
161
|
+
return z(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
162
162
|
},
|
|
163
163
|
set(e, t) {
|
|
164
164
|
r.set(e, t);
|
|
@@ -168,8 +168,8 @@ function G({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return
|
|
171
|
+
function W({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
172
|
+
return E(() => U({
|
|
173
173
|
itemCount: e,
|
|
174
174
|
itemProps: t,
|
|
175
175
|
itemSize: n
|
|
@@ -179,11 +179,11 @@ function K({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
179
179
|
n
|
|
180
180
|
]);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function G({ containerSize: e, itemSize: t }) {
|
|
183
183
|
let n;
|
|
184
184
|
switch (typeof t) {
|
|
185
185
|
case "string":
|
|
186
|
-
|
|
186
|
+
z(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), z(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
187
187
|
break;
|
|
188
188
|
default:
|
|
189
189
|
n = t;
|
|
@@ -191,21 +191,21 @@ function re({ containerSize: e, itemSize: t }) {
|
|
|
191
191
|
}
|
|
192
192
|
return n;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
let { height: u = n, width: d = n } =
|
|
194
|
+
function K({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
195
|
+
let { height: u = n, width: d = n } = I({
|
|
196
196
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
197
197
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
198
198
|
element: e,
|
|
199
199
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
200
200
|
style: t
|
|
201
|
-
}), f =
|
|
201
|
+
}), f = D({
|
|
202
202
|
height: 0,
|
|
203
203
|
width: 0
|
|
204
|
-
}), p = r === "vertical" ? u : d, m =
|
|
204
|
+
}), p = r === "vertical" ? u : d, m = G({
|
|
205
205
|
containerSize: p,
|
|
206
206
|
itemSize: s
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
T(() => {
|
|
209
209
|
if (typeof c == "function") {
|
|
210
210
|
let e = f.current;
|
|
211
211
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -218,22 +218,22 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
218
218
|
c,
|
|
219
219
|
d
|
|
220
220
|
]);
|
|
221
|
-
let h =
|
|
221
|
+
let h = W({
|
|
222
222
|
itemCount: a,
|
|
223
223
|
itemProps: o,
|
|
224
224
|
itemSize: m
|
|
225
|
-
}), g =
|
|
225
|
+
}), g = x((e) => h.get(e), [h]), [_, v] = O(() => H({
|
|
226
226
|
cachedBounds: h,
|
|
227
227
|
containerScrollOffset: 0,
|
|
228
228
|
containerSize: p,
|
|
229
229
|
itemCount: a,
|
|
230
230
|
overscanCount: l
|
|
231
|
-
})), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible:
|
|
231
|
+
})), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: S, stopIndexOverscan: C } = {
|
|
232
232
|
startIndexVisible: Math.min(a - 1, _.startIndexVisible),
|
|
233
233
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
234
234
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
235
235
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
236
|
-
}, w =
|
|
236
|
+
}, w = x(() => ae({
|
|
237
237
|
cachedBounds: h,
|
|
238
238
|
itemCount: a,
|
|
239
239
|
itemSize: m
|
|
@@ -241,9 +241,9 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
241
241
|
h,
|
|
242
242
|
a,
|
|
243
243
|
m
|
|
244
|
-
]),
|
|
244
|
+
]), E = x((t) => H({
|
|
245
245
|
cachedBounds: h,
|
|
246
|
-
containerScrollOffset:
|
|
246
|
+
containerScrollOffset: R({
|
|
247
247
|
containerElement: e,
|
|
248
248
|
direction: r,
|
|
249
249
|
isRtl: i,
|
|
@@ -261,19 +261,19 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
261
261
|
a,
|
|
262
262
|
l
|
|
263
263
|
]);
|
|
264
|
-
return
|
|
265
|
-
v(
|
|
264
|
+
return P(() => {
|
|
265
|
+
v(E((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
266
266
|
}, [
|
|
267
267
|
e,
|
|
268
268
|
r,
|
|
269
|
-
|
|
270
|
-
]),
|
|
269
|
+
E
|
|
270
|
+
]), P(() => {
|
|
271
271
|
if (!e) return;
|
|
272
272
|
let t = () => {
|
|
273
273
|
v((t) => {
|
|
274
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
274
|
+
let { scrollLeft: n, scrollTop: o } = e, s = H({
|
|
275
275
|
cachedBounds: h,
|
|
276
|
-
containerScrollOffset:
|
|
276
|
+
containerScrollOffset: R({
|
|
277
277
|
containerElement: e,
|
|
278
278
|
direction: r,
|
|
279
279
|
isRtl: i,
|
|
@@ -283,7 +283,7 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
283
283
|
itemCount: a,
|
|
284
284
|
overscanCount: l
|
|
285
285
|
});
|
|
286
|
-
return
|
|
286
|
+
return B(s, t) ? t : s;
|
|
287
287
|
});
|
|
288
288
|
};
|
|
289
289
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -299,8 +299,8 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
299
299
|
]), {
|
|
300
300
|
getCellBounds: g,
|
|
301
301
|
getEstimatedSize: w,
|
|
302
|
-
scrollToIndex:
|
|
303
|
-
let s =
|
|
302
|
+
scrollToIndex: re(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
303
|
+
let s = V({
|
|
304
304
|
align: t,
|
|
305
305
|
cachedBounds: h,
|
|
306
306
|
containerScrollOffset: n,
|
|
@@ -310,14 +310,14 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
310
310
|
itemSize: m
|
|
311
311
|
});
|
|
312
312
|
if (e) {
|
|
313
|
-
if (s =
|
|
313
|
+
if (s = R({
|
|
314
314
|
containerElement: e,
|
|
315
315
|
direction: r,
|
|
316
316
|
isRtl: i,
|
|
317
317
|
scrollOffset: s
|
|
318
318
|
}), typeof e.scrollTo != "function") {
|
|
319
|
-
let e =
|
|
320
|
-
|
|
319
|
+
let e = E(s);
|
|
320
|
+
B(_, e) || v(e);
|
|
321
321
|
}
|
|
322
322
|
return s;
|
|
323
323
|
}
|
|
@@ -325,38 +325,38 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
325
325
|
startIndexOverscan: b,
|
|
326
326
|
startIndexVisible: y,
|
|
327
327
|
stopIndexOverscan: C,
|
|
328
|
-
stopIndexVisible:
|
|
328
|
+
stopIndexVisible: S
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
331
|
+
function oe(e) {
|
|
332
|
+
return E(() => e, Object.values(e));
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function q(e, t) {
|
|
335
335
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
336
|
-
return
|
|
336
|
+
return B(n, a) && B(r, o) && B(i, s);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function J(e) {
|
|
339
339
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
340
340
|
}
|
|
341
|
-
var
|
|
342
|
-
function
|
|
343
|
-
let m =
|
|
341
|
+
var se = "data-react-window-index";
|
|
342
|
+
function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
|
|
343
|
+
let m = oe(u), h = E(() => b(s, q), [s]), [g, _] = O(null), v = J(l), { getCellBounds: x, getEstimatedSize: C, scrollToIndex: T, startIndexOverscan: D, startIndexVisible: ee, stopIndexOverscan: A, stopIndexVisible: j } = K({
|
|
344
344
|
containerElement: g,
|
|
345
345
|
containerStyle: f,
|
|
346
346
|
defaultContainerSize: n,
|
|
347
347
|
direction: "vertical",
|
|
348
348
|
itemCount: c,
|
|
349
349
|
itemProps: m,
|
|
350
|
-
itemSize:
|
|
350
|
+
itemSize: E(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
351
351
|
onResize: i,
|
|
352
352
|
overscanCount: o
|
|
353
353
|
});
|
|
354
|
-
|
|
354
|
+
w(r, () => ({
|
|
355
355
|
get element() {
|
|
356
356
|
return g;
|
|
357
357
|
},
|
|
358
358
|
scrollToRow({ align: e = "auto", behavior: t = "auto", index: n }) {
|
|
359
|
-
let r =
|
|
359
|
+
let r = T({
|
|
360
360
|
align: e,
|
|
361
361
|
containerScrollOffset: g?.scrollTop ?? 0,
|
|
362
362
|
index: n
|
|
@@ -366,40 +366,40 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
366
366
|
top: r
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
}), [g,
|
|
369
|
+
}), [g, T]), P(() => {
|
|
370
370
|
if (!g) return;
|
|
371
371
|
let e = Array.from(g.children).filter((e, t) => {
|
|
372
372
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
373
|
-
let n = `${
|
|
374
|
-
return e.setAttribute(
|
|
373
|
+
let n = `${D + t}`;
|
|
374
|
+
return e.setAttribute(se, n), !0;
|
|
375
375
|
});
|
|
376
376
|
if (v) return l.observeRowElements(e);
|
|
377
377
|
}, [
|
|
378
378
|
g,
|
|
379
379
|
v,
|
|
380
380
|
l,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
]),
|
|
384
|
-
|
|
385
|
-
startIndex:
|
|
386
|
-
stopIndex: M
|
|
387
|
-
}, {
|
|
388
|
-
startIndex: E,
|
|
381
|
+
D,
|
|
382
|
+
A
|
|
383
|
+
]), S(() => {
|
|
384
|
+
D >= 0 && A >= 0 && a && a({
|
|
385
|
+
startIndex: ee,
|
|
389
386
|
stopIndex: j
|
|
387
|
+
}, {
|
|
388
|
+
startIndex: D,
|
|
389
|
+
stopIndex: A
|
|
390
390
|
});
|
|
391
391
|
}, [
|
|
392
392
|
a,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
393
|
+
D,
|
|
394
|
+
ee,
|
|
395
|
+
A,
|
|
396
|
+
j
|
|
397
397
|
]);
|
|
398
|
-
let
|
|
398
|
+
let M = E(() => {
|
|
399
399
|
let e = [];
|
|
400
|
-
if (c > 0) for (let t =
|
|
401
|
-
let n =
|
|
402
|
-
e.push(/* @__PURE__ */
|
|
400
|
+
if (c > 0) for (let t = D; t <= A; t++) {
|
|
401
|
+
let n = x(t);
|
|
402
|
+
e.push(/* @__PURE__ */ y(h, {
|
|
403
403
|
...m,
|
|
404
404
|
ariaAttributes: {
|
|
405
405
|
"aria-posinset": t + 1,
|
|
@@ -420,21 +420,21 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
420
420
|
return e;
|
|
421
421
|
}, [
|
|
422
422
|
h,
|
|
423
|
-
|
|
423
|
+
x,
|
|
424
424
|
v,
|
|
425
425
|
c,
|
|
426
426
|
m,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
]),
|
|
427
|
+
D,
|
|
428
|
+
A
|
|
429
|
+
]), N = /* @__PURE__ */ k("div", {
|
|
430
430
|
"aria-hidden": !0,
|
|
431
431
|
style: {
|
|
432
|
-
height:
|
|
432
|
+
height: C(),
|
|
433
433
|
width: "100%",
|
|
434
434
|
zIndex: -1
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
|
-
return
|
|
437
|
+
return y(d, {
|
|
438
438
|
role: "list",
|
|
439
439
|
...p,
|
|
440
440
|
className: t,
|
|
@@ -446,514 +446,543 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
446
446
|
overflowY: "auto",
|
|
447
447
|
...f
|
|
448
448
|
}
|
|
449
|
-
},
|
|
449
|
+
}, M, e, N);
|
|
450
450
|
}
|
|
451
451
|
//#endregion
|
|
452
452
|
//#region src/types/virtual-row.ts
|
|
453
|
-
var
|
|
453
|
+
var Y = /* @__PURE__ */ function(e) {
|
|
454
454
|
return e.Header = "header", e.Item = "item", e;
|
|
455
|
-
}({}),
|
|
455
|
+
}({}), X = /* @__PURE__ */ function(e) {
|
|
456
456
|
return e.All = "all", e.Pinned = "pinned", e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
|
|
457
|
-
}({}),
|
|
457
|
+
}({}), le = (e) => `${60 + e * 23 % 35}%`, ue = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", de = (e, t) => t.rows[e].kind === Y.Item ? 36 : e === 0 ? 24 : 56, fe = (e) => {
|
|
458
458
|
switch (e) {
|
|
459
|
-
case
|
|
460
|
-
case
|
|
461
|
-
default: return
|
|
459
|
+
case X.Shared: return X.Shared;
|
|
460
|
+
case X.Organization: return X.Organization;
|
|
461
|
+
default: return X.MyChats;
|
|
462
462
|
}
|
|
463
|
-
},
|
|
463
|
+
}, pe = (e, t) => {
|
|
464
464
|
let n = null;
|
|
465
|
-
for (let r of e) if (r.kind ===
|
|
465
|
+
for (let r of e) if (r.kind === Y.Header) n = r.groupKey;
|
|
466
466
|
else if (r.item.id === t) return n;
|
|
467
467
|
return null;
|
|
468
|
-
},
|
|
468
|
+
}, me = (e, t, n) => {
|
|
469
469
|
let r = /* @__PURE__ */ new Set();
|
|
470
|
-
if (t != null && r.add(t), t ===
|
|
470
|
+
if (t != null && r.add(t), t === X.Pinned) {
|
|
471
471
|
let t = n.find((t) => t.id === e);
|
|
472
|
-
t && r.add(
|
|
473
|
-
} else r.add(
|
|
472
|
+
t && r.add(fe(t.source));
|
|
473
|
+
} else r.add(X.Pinned);
|
|
474
474
|
return r;
|
|
475
|
-
},
|
|
475
|
+
}, he = (e, t, n, r) => {
|
|
476
476
|
let i = e.currentTarget.getBoundingClientRect();
|
|
477
477
|
if (e.clientY >= i.top + i.height / 2) return t;
|
|
478
478
|
let a = null, o = !1;
|
|
479
|
-
for (let e of n) if (e.kind ===
|
|
479
|
+
for (let e of n) if (e.kind === Y.Header) o = e.groupKey === r;
|
|
480
480
|
else if (o) {
|
|
481
481
|
if (e.item.id === t) return a;
|
|
482
482
|
a = e.item.id;
|
|
483
483
|
}
|
|
484
484
|
return null;
|
|
485
|
-
},
|
|
486
|
-
tabContainer: "
|
|
487
|
-
tabActive: "
|
|
488
|
-
}, _e =
|
|
489
|
-
let { tabClassName:
|
|
490
|
-
return /* @__PURE__ */
|
|
485
|
+
}, ge = {
|
|
486
|
+
tabContainer: "_tabContainer_1917c_1",
|
|
487
|
+
tabActive: "_tabActive_1917c_19"
|
|
488
|
+
}, _e = b(({ tabs: e, activeTabId: r, onTabChange: i, styles: a }) => {
|
|
489
|
+
let { tabClassName: o = "dial-tiny-semi-text" } = a?.typography ?? {};
|
|
490
|
+
return /* @__PURE__ */ k("div", {
|
|
491
491
|
className: "flex flex-nowrap gap-1",
|
|
492
|
+
role: "tablist",
|
|
493
|
+
style: t({
|
|
494
|
+
"--pt-tab-text": a?.colors?.tabText,
|
|
495
|
+
"--pt-tab-text-hover": a?.colors?.tabTextHover,
|
|
496
|
+
"--pt-tab-active-text": a?.colors?.activeTabText
|
|
497
|
+
}),
|
|
492
498
|
children: e.map((e) => {
|
|
493
|
-
let
|
|
494
|
-
return /* @__PURE__ */
|
|
495
|
-
|
|
496
|
-
selected:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
499
|
+
let t = r === e.id;
|
|
500
|
+
return /* @__PURE__ */ k("div", {
|
|
501
|
+
role: "tab",
|
|
502
|
+
"aria-selected": t,
|
|
503
|
+
className: "contents",
|
|
504
|
+
children: /* @__PURE__ */ k(d, {
|
|
505
|
+
label: e.label,
|
|
506
|
+
selected: t,
|
|
507
|
+
onClick: () => i(e.id),
|
|
508
|
+
className: n("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", o, ge.tabContainer, t && ge.tabActive)
|
|
509
|
+
})
|
|
500
510
|
}, e.id);
|
|
501
511
|
})
|
|
502
512
|
});
|
|
503
513
|
}), ve = [
|
|
504
514
|
{
|
|
505
|
-
value:
|
|
515
|
+
value: X.All,
|
|
506
516
|
labelKey: "all"
|
|
507
517
|
},
|
|
508
518
|
{
|
|
509
|
-
value:
|
|
519
|
+
value: X.MyChats,
|
|
510
520
|
labelKey: "myChats"
|
|
511
521
|
},
|
|
512
522
|
{
|
|
513
|
-
value:
|
|
523
|
+
value: X.Shared,
|
|
514
524
|
labelKey: "shared"
|
|
515
525
|
},
|
|
516
526
|
{
|
|
517
|
-
value:
|
|
527
|
+
value: X.Organization,
|
|
518
528
|
labelKey: "organization"
|
|
519
529
|
}
|
|
520
|
-
], ye =
|
|
521
|
-
className: "
|
|
522
|
-
children: /* @__PURE__ */
|
|
530
|
+
], ye = b(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ k("div", {
|
|
531
|
+
className: "px-3 py-2",
|
|
532
|
+
children: /* @__PURE__ */ k(_e, {
|
|
523
533
|
tabs: ve.map(({ value: e, labelKey: n }) => ({
|
|
524
534
|
id: e,
|
|
525
535
|
label: t[n]
|
|
526
536
|
})),
|
|
527
537
|
activeTabId: e,
|
|
528
538
|
onTabChange: (e) => n(e),
|
|
529
|
-
styles: { typography: { tabClassName:
|
|
539
|
+
styles: { typography: { tabClassName: v(r, "flex-1") } }
|
|
530
540
|
})
|
|
531
|
-
})), be = { button: "
|
|
541
|
+
})), be = { button: "_button_8xsgo_1" }, xe = b(({ label: e, onClick: r, labelClassName: i = "dial-small-semi-text", colors: a }) => /* @__PURE__ */ k("div", {
|
|
532
542
|
className: "px-3 py-2",
|
|
533
|
-
|
|
534
|
-
|
|
543
|
+
style: t({
|
|
544
|
+
"--cp-new-chat-bg": a?.background,
|
|
545
|
+
"--cp-new-chat-text": a?.text,
|
|
546
|
+
"--cp-new-chat-focus-outline": a?.focusOutline
|
|
547
|
+
}),
|
|
548
|
+
children: /* @__PURE__ */ A("button", {
|
|
549
|
+
onClick: r,
|
|
535
550
|
type: "button",
|
|
536
|
-
className:
|
|
537
|
-
children: [/* @__PURE__ */
|
|
551
|
+
className: n("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1 shadow-sm hover:shadow-md active:shadow-xs", be.button),
|
|
552
|
+
children: [/* @__PURE__ */ k(ne, {
|
|
538
553
|
size: 18,
|
|
539
554
|
stroke: 2,
|
|
540
555
|
className: "shrink-0"
|
|
541
|
-
}), /* @__PURE__ */
|
|
542
|
-
className:
|
|
556
|
+
}), /* @__PURE__ */ k("span", {
|
|
557
|
+
className: i,
|
|
543
558
|
children: e
|
|
544
559
|
})]
|
|
545
560
|
})
|
|
546
|
-
})),
|
|
561
|
+
})), Z = {
|
|
547
562
|
skeletonColor: "var(--cp-skeleton-color, var(--bg-layer-4, #d1dbea))",
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
dropZoneActive: "
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}, Se = ({
|
|
557
|
-
let
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
563
|
+
item: "_item_1qyc3_1",
|
|
564
|
+
itemActive: "_itemActive_1qyc3_7",
|
|
565
|
+
groupHeader: "_groupHeader_1qyc3_12",
|
|
566
|
+
taskBadge: "_taskBadge_1qyc3_16",
|
|
567
|
+
dropZoneActive: "_dropZoneActive_1qyc3_22",
|
|
568
|
+
triggerActive: "_triggerActive_1qyc3_27",
|
|
569
|
+
triggerIcon: "_triggerIcon_1qyc3_30",
|
|
570
|
+
unreadDot: "_unreadDot_1qyc3_38"
|
|
571
|
+
}, Se = ({ label: e, isExpanded: t, onToggle: r, listId: i, className: a = "dial-tiny-lead-text", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: d }) => {
|
|
572
|
+
let f = o != null;
|
|
573
|
+
return /* @__PURE__ */ A("button", {
|
|
574
|
+
type: "button",
|
|
575
|
+
"aria-expanded": t,
|
|
576
|
+
"aria-controls": i,
|
|
577
|
+
onClick: r,
|
|
578
|
+
onDragOver: f ? (e) => {
|
|
579
|
+
f && (e.preventDefault(), c?.(o));
|
|
580
|
+
} : void 0,
|
|
581
|
+
onDragLeave: f ? (e) => {
|
|
582
|
+
f && (e.currentTarget.contains(e.relatedTarget) || l?.());
|
|
583
|
+
} : void 0,
|
|
584
|
+
onDrop: f ? (e) => {
|
|
585
|
+
f && (e.preventDefault(), d?.(o, o, null));
|
|
586
|
+
} : void 0,
|
|
587
|
+
className: n("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, Z.groupHeader, s && Z.dropZoneActive),
|
|
588
|
+
children: [t ? /* @__PURE__ */ k(j, {
|
|
589
|
+
stroke: .5,
|
|
590
|
+
size: 12,
|
|
591
|
+
className: "shrink-0",
|
|
592
|
+
"aria-hidden": !0
|
|
593
|
+
}) : /* @__PURE__ */ k(M, {
|
|
594
|
+
stroke: .5,
|
|
595
|
+
size: 12,
|
|
596
|
+
className: "shrink-0 rtl:scale-x-[-1]",
|
|
597
|
+
"aria-hidden": !0
|
|
598
|
+
}), /* @__PURE__ */ k(u, { text: e })]
|
|
599
|
+
});
|
|
600
|
+
}, Ce = ({ item: t, isActive: r, onSelectConversation: i, searchQuery: a = "", getActions: o, onActionMenuOpen: s, actionsLabel: u = "More actions", itemTitleClassName: d = "dial-small-text", itemIconBadgeClassName: v, taskBadgeClassName: y = "dial-caption-semi-text uppercase tracking-[0.6px]", unreadIndicatorLabel: b = "Unread", rowGroupKey: S, rows: C, draggingId: w, dragOverId: T, allowedDropGroups: E, onDragStart: j, onDragEnd: M, onDragOver: ne, onDragLeave: P, onDrop: F }) => {
|
|
601
|
+
let [I, re] = O(!1), L = D(null), ie = x((e) => {
|
|
602
|
+
re(e), e && L.current && s?.(t, L.current);
|
|
603
|
+
}, [t, s]), R = o?.(t) ?? [], z = R.length > 0, B = t.isIconLoading ? /* @__PURE__ */ k(g, {
|
|
604
|
+
variant: _.Circular,
|
|
605
|
+
width: l.LG,
|
|
606
|
+
height: l.LG,
|
|
607
|
+
color: Z.skeletonColor,
|
|
564
608
|
"aria-hidden": !0
|
|
565
|
-
}) : /* @__PURE__ */
|
|
566
|
-
src:
|
|
567
|
-
size:
|
|
568
|
-
initialsName:
|
|
569
|
-
labels: { tooltip:
|
|
570
|
-
styles: { badgeClassName:
|
|
571
|
-
}),
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
609
|
+
}) : /* @__PURE__ */ k(e, {
|
|
610
|
+
src: t.iconUrl,
|
|
611
|
+
size: l.LG,
|
|
612
|
+
initialsName: t.iconTooltip ?? "",
|
|
613
|
+
labels: { tooltip: t.iconTooltip },
|
|
614
|
+
styles: { badgeClassName: v }
|
|
615
|
+
}), ae = /* @__PURE__ */ A("span", {
|
|
616
|
+
className: "flex shrink-0 items-center",
|
|
617
|
+
children: [/* @__PURE__ */ k("span", {
|
|
618
|
+
className: "relative flex size-3 shrink-0 items-center justify-center",
|
|
619
|
+
children: t.isUnread && /* @__PURE__ */ A(ee, { children: [/* @__PURE__ */ k("span", {
|
|
620
|
+
className: n("size-[5.33px] rounded-full", Z.unreadDot),
|
|
621
|
+
"aria-hidden": !0
|
|
622
|
+
}), /* @__PURE__ */ k("span", {
|
|
623
|
+
className: "sr-only",
|
|
624
|
+
children: b
|
|
625
|
+
})] })
|
|
626
|
+
}), B]
|
|
627
|
+
}), V = ue(z, I), H = t.showTaskBadge ? /* @__PURE__ */ A("span", {
|
|
628
|
+
className: n("flex h-5 shrink-0 items-center justify-center gap-0.5 rounded-full border pe-2 ps-1", Z.taskBadge, y),
|
|
629
|
+
children: [/* @__PURE__ */ k(N, {
|
|
630
|
+
size: 12,
|
|
631
|
+
"aria-hidden": !0
|
|
632
|
+
}), t.taskBadgeLabel]
|
|
633
|
+
}) : void 0, U = S != null, W = x((e) => {
|
|
634
|
+
e.currentTarget.contains(e.relatedTarget) || P?.();
|
|
635
|
+
}, [P]), G = x((e) => {
|
|
636
|
+
if (!S || !C || !F) return;
|
|
575
637
|
e.preventDefault();
|
|
576
|
-
let
|
|
577
|
-
F(
|
|
638
|
+
let n = he(e, t.id, C, S);
|
|
639
|
+
F(t.id, S, n);
|
|
578
640
|
}, [
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
641
|
+
t.id,
|
|
642
|
+
C,
|
|
643
|
+
S,
|
|
582
644
|
F
|
|
583
|
-
]),
|
|
584
|
-
return /* @__PURE__ */
|
|
585
|
-
className:
|
|
586
|
-
draggable:
|
|
587
|
-
onDragStart:
|
|
588
|
-
onDragEnd:
|
|
589
|
-
onDragOver:
|
|
590
|
-
e.preventDefault(),
|
|
645
|
+
]), K = t.id === w, oe = t.id === T, q = S != null && (E?.has(S) ?? !1), J = w != null;
|
|
646
|
+
return /* @__PURE__ */ A("li", {
|
|
647
|
+
className: n("group/conversation relative", K && "cursor-grabbing opacity-50", oe && q && "rounded", oe && q && Z.dropZoneActive, J && !K && !q && "cursor-not-allowed"),
|
|
648
|
+
draggable: U || void 0,
|
|
649
|
+
onDragStart: U ? () => j?.(t.id) : void 0,
|
|
650
|
+
onDragEnd: U ? M : void 0,
|
|
651
|
+
onDragOver: U ? (e) => {
|
|
652
|
+
e.preventDefault(), ne?.(t.id);
|
|
591
653
|
} : void 0,
|
|
592
|
-
onDragLeave:
|
|
593
|
-
onDrop:
|
|
594
|
-
children: [/* @__PURE__ */
|
|
595
|
-
href:
|
|
654
|
+
onDragLeave: U ? W : void 0,
|
|
655
|
+
onDrop: U ? G : void 0,
|
|
656
|
+
children: [/* @__PURE__ */ k("a", {
|
|
657
|
+
href: t.href,
|
|
596
658
|
className: "contents",
|
|
597
659
|
onClick: (e) => {
|
|
598
|
-
|
|
660
|
+
t.href && (e.preventDefault(), i(t.id));
|
|
599
661
|
},
|
|
600
|
-
children: /* @__PURE__ */
|
|
601
|
-
iconBefore:
|
|
602
|
-
label: /* @__PURE__ */
|
|
603
|
-
text:
|
|
604
|
-
query:
|
|
605
|
-
className:
|
|
662
|
+
children: /* @__PURE__ */ k(c, {
|
|
663
|
+
iconBefore: ae,
|
|
664
|
+
label: /* @__PURE__ */ k(h, {
|
|
665
|
+
text: t.title,
|
|
666
|
+
query: a,
|
|
667
|
+
className: d,
|
|
606
668
|
maxLines: 1
|
|
607
669
|
}),
|
|
608
|
-
|
|
609
|
-
"
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
670
|
+
iconAfter: H,
|
|
671
|
+
textClassName: "min-w-0 flex-1",
|
|
672
|
+
"aria-current": r ? "page" : void 0,
|
|
673
|
+
onClick: t.href ? void 0 : () => i(t.id),
|
|
674
|
+
tabIndex: t.href ? -1 : void 0,
|
|
675
|
+
className: n("h-8 w-full justify-start gap-2 rounded-xl py-2 ps-0", V, Z.item, r && Z.itemActive, I && Z.itemActive)
|
|
613
676
|
})
|
|
614
|
-
}),
|
|
615
|
-
className:
|
|
616
|
-
children: /* @__PURE__ */
|
|
617
|
-
items:
|
|
618
|
-
onOpenChange:
|
|
677
|
+
}), z && /* @__PURE__ */ k("div", {
|
|
678
|
+
className: n("absolute inset-y-0 end-1 flex items-center", I ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
|
|
679
|
+
children: /* @__PURE__ */ k(f, {
|
|
680
|
+
items: R,
|
|
681
|
+
onOpenChange: ie,
|
|
619
682
|
matchReferenceWidth: !1,
|
|
620
|
-
listClassName: "w-[
|
|
621
|
-
children: /* @__PURE__ */
|
|
622
|
-
ref:
|
|
623
|
-
icon: /* @__PURE__ */
|
|
624
|
-
size:
|
|
625
|
-
className:
|
|
683
|
+
listClassName: "w-[200px]",
|
|
684
|
+
children: /* @__PURE__ */ k(m, {
|
|
685
|
+
ref: L,
|
|
686
|
+
icon: /* @__PURE__ */ k(te, {
|
|
687
|
+
size: l.SM,
|
|
688
|
+
className: Z.triggerIcon,
|
|
626
689
|
"aria-hidden": !0
|
|
627
690
|
}),
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
className: r("flex items-center justify-center rounded", X.trigger, I && X.triggerActive)
|
|
691
|
+
size: p.Small,
|
|
692
|
+
"aria-label": u,
|
|
693
|
+
className: n(I && Z.triggerActive)
|
|
632
694
|
})
|
|
633
695
|
})
|
|
634
696
|
})]
|
|
635
697
|
});
|
|
636
|
-
},
|
|
637
|
-
let
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
"
|
|
641
|
-
"aria-controls": i,
|
|
642
|
-
onClick: n,
|
|
643
|
-
onDragOver: d ? (e) => {
|
|
644
|
-
d && (e.preventDefault(), c?.(o));
|
|
645
|
-
} : void 0,
|
|
646
|
-
onDragLeave: d ? (e) => {
|
|
647
|
-
d && (e.currentTarget.contains(e.relatedTarget) || l?.());
|
|
648
|
-
} : void 0,
|
|
649
|
-
onDrop: d ? (e) => {
|
|
650
|
-
d && (e.preventDefault(), u?.(o, o, null));
|
|
651
|
-
} : void 0,
|
|
652
|
-
className: r("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, X.groupHeader, s && X.dropZoneActive),
|
|
653
|
-
children: [t ? /* @__PURE__ */ A(M, {
|
|
654
|
-
stroke: .5,
|
|
655
|
-
size: 12,
|
|
656
|
-
className: "shrink-0",
|
|
657
|
-
"aria-hidden": !0
|
|
658
|
-
}) : /* @__PURE__ */ A(N, {
|
|
659
|
-
stroke: .5,
|
|
660
|
-
size: 12,
|
|
661
|
-
className: "shrink-0 rtl:scale-x-[-1]",
|
|
662
|
-
"aria-hidden": !0
|
|
663
|
-
}), /* @__PURE__ */ A(p, { text: e })]
|
|
664
|
-
});
|
|
665
|
-
}, we = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, listId: a, activeConversationId: o, searchQuery: s, onSelectConversation: c, getActions: l, onActionMenuOpen: u, actionsLabel: d, styles: f, draggingId: p, dragOverId: m, allowedDropGroups: h, onDragStart: g, onDragEnd: _, onDragOver: v, onDragLeave: y, onDrop: b }) => {
|
|
666
|
-
let x = n[e];
|
|
667
|
-
if (x.kind === q.Header) {
|
|
668
|
-
let n = x.groupKey === J.Pinned;
|
|
669
|
-
return /* @__PURE__ */ A("div", {
|
|
698
|
+
}, we = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, listId: a, activeConversationId: o, searchQuery: s, onSelectConversation: c, getActions: l, onActionMenuOpen: u, actionsLabel: d, unreadIndicatorLabel: f, styles: p, draggingId: m, dragOverId: h, allowedDropGroups: g, onDragStart: _, onDragEnd: v, onDragOver: y, onDragLeave: b, onDrop: x }) => {
|
|
699
|
+
let S = n[e];
|
|
700
|
+
if (S.kind === Y.Header) {
|
|
701
|
+
let n = S.groupKey === X.Pinned;
|
|
702
|
+
return /* @__PURE__ */ k("div", {
|
|
670
703
|
role: "presentation",
|
|
671
704
|
style: t,
|
|
672
705
|
className: e === 0 ? "pt-0" : "pt-8",
|
|
673
|
-
children: /* @__PURE__ */
|
|
674
|
-
label:
|
|
675
|
-
isExpanded: r.has(
|
|
676
|
-
onToggle: () => i(
|
|
706
|
+
children: /* @__PURE__ */ k(Se, {
|
|
707
|
+
label: S.label,
|
|
708
|
+
isExpanded: r.has(S.groupKey),
|
|
709
|
+
onToggle: () => i(S.groupKey),
|
|
677
710
|
listId: a,
|
|
678
|
-
className:
|
|
679
|
-
dropZoneGroupKey: n ?
|
|
680
|
-
isDragOver: n &&
|
|
681
|
-
onDragOver: n ?
|
|
682
|
-
onDragLeave: n ?
|
|
683
|
-
onDrop: n ?
|
|
711
|
+
className: p?.groupHeaderClassName,
|
|
712
|
+
dropZoneGroupKey: n ? X.Pinned : void 0,
|
|
713
|
+
isDragOver: n && h === X.Pinned,
|
|
714
|
+
onDragOver: n ? y : void 0,
|
|
715
|
+
onDragLeave: n ? b : void 0,
|
|
716
|
+
onDrop: n ? x : void 0
|
|
684
717
|
})
|
|
685
718
|
});
|
|
686
719
|
}
|
|
687
|
-
return /* @__PURE__ */
|
|
720
|
+
return /* @__PURE__ */ k("div", {
|
|
688
721
|
role: "presentation",
|
|
689
722
|
style: t,
|
|
690
723
|
className: "pt-1",
|
|
691
|
-
children: /* @__PURE__ */
|
|
692
|
-
item:
|
|
693
|
-
isActive:
|
|
724
|
+
children: /* @__PURE__ */ k(Ce, {
|
|
725
|
+
item: S.item,
|
|
726
|
+
isActive: S.item.id === o,
|
|
694
727
|
searchQuery: s,
|
|
695
728
|
onSelectConversation: c,
|
|
696
729
|
getActions: l,
|
|
697
730
|
onActionMenuOpen: u,
|
|
698
731
|
actionsLabel: d,
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
732
|
+
unreadIndicatorLabel: f,
|
|
733
|
+
itemTitleClassName: p?.itemTitleClassName,
|
|
734
|
+
itemIconBadgeClassName: p?.itemIconBadgeClassName,
|
|
735
|
+
taskBadgeClassName: p?.taskBadgeClassName,
|
|
736
|
+
rowGroupKey: S.groupKey,
|
|
702
737
|
rows: n,
|
|
703
|
-
draggingId:
|
|
704
|
-
dragOverId:
|
|
705
|
-
allowedDropGroups:
|
|
706
|
-
onDragStart:
|
|
707
|
-
onDragEnd:
|
|
708
|
-
onDragOver:
|
|
709
|
-
onDragLeave:
|
|
710
|
-
onDrop:
|
|
738
|
+
draggingId: m,
|
|
739
|
+
dragOverId: h,
|
|
740
|
+
allowedDropGroups: g,
|
|
741
|
+
onDragStart: _,
|
|
742
|
+
onDragEnd: v,
|
|
743
|
+
onDragOver: y,
|
|
744
|
+
onDragLeave: b,
|
|
745
|
+
onDrop: x
|
|
711
746
|
})
|
|
712
747
|
});
|
|
713
|
-
}, Te = (e, t) => t ===
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
]),
|
|
719
|
-
let { colors:
|
|
720
|
-
|
|
721
|
-
T != null && (
|
|
748
|
+
}, Te = (e, t) => t === X.All ? !0 : e.source === t, Ee = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, De = new Set([
|
|
749
|
+
X.Pinned,
|
|
750
|
+
X.MyChats,
|
|
751
|
+
X.Shared,
|
|
752
|
+
X.Organization
|
|
753
|
+
]), Oe = b(({ conversations: e, isLoading: c, isOpen: l, onSelectConversation: u, activeConversationId: d, labels: f, onNewChat: p, styles: m, className: h, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: w, activeFilter: T, onActiveFilterChange: ee }) => {
|
|
754
|
+
let { colors: j, typography: M, newChatButton: N } = m ?? {}, { title: te, emptyLabel: ne, noResultsLabel: P, loadingLabel: F = "Loading conversations", newChatLabel: I, searchPlaceholder: re, searchClearLabel: L, filterLabels: ie, groupLabels: R, actionsLabel: z, unreadIndicatorLabel: B, closeAriaLabel: ae } = f, [V, H] = O(""), [U, W] = O(X.All);
|
|
755
|
+
S(() => {
|
|
756
|
+
T != null && W(T);
|
|
722
757
|
}, [T]);
|
|
723
|
-
let [
|
|
724
|
-
|
|
725
|
-
}, []),
|
|
726
|
-
|
|
758
|
+
let [G, K] = O(() => De), [oe, q] = O(5), J = C(), se = D(null), ue = D(null), [fe, he] = O(null), [ge, _e] = O(null), [ve, be] = O(null), Se = D(null), Ce = D(null), Oe = x(({ height: e }) => {
|
|
759
|
+
q(Math.ceil(e / 36 * 2));
|
|
760
|
+
}, []), ke = x((e) => {
|
|
761
|
+
K((t) => {
|
|
727
762
|
let n = new Set(t);
|
|
728
763
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
729
764
|
});
|
|
730
|
-
}, []),
|
|
731
|
-
|
|
732
|
-
}, []),
|
|
733
|
-
let r =
|
|
734
|
-
|
|
735
|
-
}, [e]),
|
|
736
|
-
|
|
737
|
-
}, [
|
|
738
|
-
|
|
739
|
-
}, []),
|
|
740
|
-
|
|
741
|
-
}, []),
|
|
742
|
-
let r =
|
|
743
|
-
|
|
765
|
+
}, []), Ae = x(() => {
|
|
766
|
+
Se.current = null, Ce.current = null, he(null), _e(null), be(null);
|
|
767
|
+
}, []), je = x((t, n) => {
|
|
768
|
+
let r = me(t, pe(n, t), e);
|
|
769
|
+
Se.current = t, Ce.current = r, he(t), be(r);
|
|
770
|
+
}, [e]), Me = x(() => {
|
|
771
|
+
Ae();
|
|
772
|
+
}, [Ae]), Ne = x((e) => {
|
|
773
|
+
_e(e);
|
|
774
|
+
}, []), Pe = x(() => {
|
|
775
|
+
_e(null);
|
|
776
|
+
}, []), Fe = x((e, t, n) => {
|
|
777
|
+
let r = Se.current, i = Ce.current;
|
|
778
|
+
Ae(), r != null && r !== e && i?.has(t) && w?.({
|
|
744
779
|
draggedId: r,
|
|
745
780
|
targetGroupKey: t,
|
|
746
781
|
afterId: n
|
|
747
782
|
});
|
|
748
|
-
}, [
|
|
749
|
-
"--cp-
|
|
750
|
-
"--
|
|
751
|
-
"--cp-
|
|
752
|
-
"--cp-
|
|
753
|
-
"--cp-
|
|
754
|
-
"--cp-text
|
|
755
|
-
"--cp-new-chat-
|
|
756
|
-
"--cp-
|
|
757
|
-
"--cp-
|
|
758
|
-
"--cp-
|
|
759
|
-
"--cp-
|
|
760
|
-
"--cp-
|
|
761
|
-
"--cp-
|
|
762
|
-
"--cp-
|
|
763
|
-
"--cp-
|
|
764
|
-
"--cp-
|
|
765
|
-
|
|
766
|
-
"--cp-trigger-bg": M?.triggerBackground,
|
|
767
|
-
"--cp-trigger-icon": M?.triggerIcon,
|
|
768
|
-
"--cp-trigger-icon-idle": M?.triggerIconIdle,
|
|
769
|
-
"--cp-skeleton-color": M?.skeletonColor
|
|
770
|
-
}), Q = D(() => e.filter((e) => Te(e, W) && Ee(e, U)), [
|
|
783
|
+
}, [Ae, w]), Ie = t({
|
|
784
|
+
"--cp-item-hover": j?.itemHover,
|
|
785
|
+
"--cp-item-active": j?.itemActive,
|
|
786
|
+
"--cp-text": j?.text,
|
|
787
|
+
"--cp-text-secondary": j?.textSecondary,
|
|
788
|
+
"--cp-new-chat-bg": N?.background,
|
|
789
|
+
"--cp-new-chat-text": N?.text,
|
|
790
|
+
"--cp-new-chat-focus-outline": N?.focusOutline,
|
|
791
|
+
"--cp-drop-zone-ring": j?.dropZoneRing,
|
|
792
|
+
"--cp-trigger-bg": j?.triggerBackground,
|
|
793
|
+
"--cp-trigger-icon": j?.triggerIcon,
|
|
794
|
+
"--cp-trigger-icon-idle": j?.triggerIconIdle,
|
|
795
|
+
"--cp-skeleton-color": j?.skeletonColor,
|
|
796
|
+
"--cp-task-badge-border": j?.taskBadgeBorder,
|
|
797
|
+
"--cp-task-badge-bg": j?.taskBadgeBackground,
|
|
798
|
+
"--cp-task-badge-text": j?.taskBadgeText,
|
|
799
|
+
"--cp-unread-dot": j?.unreadDot
|
|
800
|
+
}), Q = E(() => e.filter((e) => Te(e, U) && Ee(e, V)), [
|
|
771
801
|
e,
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
]),
|
|
802
|
+
U,
|
|
803
|
+
V
|
|
804
|
+
]), Le = E(() => Q.filter((e) => e.isPinned), [Q]), Re = E(() => Q.filter((e) => !e.isPinned && e.source !== X.Shared && e.source !== X.Organization), [Q]), ze = E(() => Q.filter((e) => !e.isPinned && e.source === X.Shared), [Q]), Be = E(() => Q.filter((e) => !e.isPinned && e.source === X.Organization), [Q]), Ve = E(() => [
|
|
775
805
|
{
|
|
776
|
-
key:
|
|
777
|
-
label:
|
|
778
|
-
items:
|
|
806
|
+
key: X.Pinned,
|
|
807
|
+
label: R?.pinned ?? "Pinned",
|
|
808
|
+
items: Le
|
|
779
809
|
},
|
|
780
810
|
{
|
|
781
|
-
key:
|
|
782
|
-
label:
|
|
783
|
-
items:
|
|
811
|
+
key: X.MyChats,
|
|
812
|
+
label: R?.myChats ?? "My chats",
|
|
813
|
+
items: Re
|
|
784
814
|
},
|
|
785
815
|
{
|
|
786
|
-
key:
|
|
787
|
-
label:
|
|
788
|
-
items:
|
|
816
|
+
key: X.Shared,
|
|
817
|
+
label: R?.shared ?? "Shared",
|
|
818
|
+
items: ze
|
|
789
819
|
},
|
|
790
820
|
{
|
|
791
|
-
key:
|
|
792
|
-
label:
|
|
793
|
-
items:
|
|
821
|
+
key: X.Organization,
|
|
822
|
+
label: R?.organization ?? "Organization",
|
|
823
|
+
items: Be
|
|
794
824
|
}
|
|
795
825
|
], [
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
]), $ =
|
|
826
|
+
R,
|
|
827
|
+
Le,
|
|
828
|
+
Re,
|
|
829
|
+
ze,
|
|
830
|
+
Be
|
|
831
|
+
]), $ = E(() => {
|
|
802
832
|
let e = [];
|
|
803
|
-
for (let t of
|
|
804
|
-
kind:
|
|
833
|
+
for (let t of Ve) if (t.items.length !== 0 && (e.push({
|
|
834
|
+
kind: Y.Header,
|
|
805
835
|
groupKey: t.key,
|
|
806
836
|
label: t.label
|
|
807
|
-
}),
|
|
808
|
-
kind:
|
|
837
|
+
}), G.has(t.key))) for (let n of t.items) e.push({
|
|
838
|
+
kind: Y.Item,
|
|
809
839
|
item: n,
|
|
810
840
|
groupKey: t.key
|
|
811
841
|
});
|
|
812
842
|
return e;
|
|
813
|
-
}, [
|
|
814
|
-
|
|
815
|
-
if (!d) return;
|
|
816
|
-
let e =
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
if (ce.current === d) return;
|
|
822
|
-
let t = $.findIndex((e) => e.kind === q.Item && e.item.id === d);
|
|
823
|
-
t >= 0 && (se.current?.scrollToRow({
|
|
824
|
-
index: t,
|
|
843
|
+
}, [Ve, G]);
|
|
844
|
+
S(() => {
|
|
845
|
+
if (!d || ue.current === d) return;
|
|
846
|
+
let e = $.findIndex((e) => e.kind === Y.Item && e.item.id === d);
|
|
847
|
+
e >= 0 && (se.current?.scrollToRow({
|
|
848
|
+
index: e,
|
|
825
849
|
align: "smart",
|
|
826
850
|
behavior: "smooth"
|
|
827
|
-
}),
|
|
851
|
+
}), ue.current = d);
|
|
828
852
|
}, [
|
|
829
853
|
d,
|
|
830
|
-
|
|
831
|
-
|
|
854
|
+
Ve,
|
|
855
|
+
G,
|
|
832
856
|
$
|
|
833
857
|
]);
|
|
834
|
-
let
|
|
858
|
+
let He = E(() => ({
|
|
835
859
|
rows: $,
|
|
836
|
-
expandedGroups:
|
|
837
|
-
onToggleGroup:
|
|
838
|
-
listId:
|
|
860
|
+
expandedGroups: G,
|
|
861
|
+
onToggleGroup: ke,
|
|
862
|
+
listId: J,
|
|
839
863
|
activeConversationId: d,
|
|
840
|
-
searchQuery:
|
|
864
|
+
searchQuery: V,
|
|
841
865
|
onSelectConversation: u,
|
|
842
866
|
getActions: _,
|
|
843
867
|
onActionMenuOpen: v,
|
|
844
|
-
actionsLabel:
|
|
868
|
+
actionsLabel: z,
|
|
869
|
+
unreadIndicatorLabel: B,
|
|
845
870
|
styles: {
|
|
846
|
-
groupHeaderClassName:
|
|
847
|
-
itemTitleClassName:
|
|
848
|
-
itemIconBadgeClassName: m?.itemIconBadgeClassName
|
|
871
|
+
groupHeaderClassName: M?.groupHeaderClassName,
|
|
872
|
+
itemTitleClassName: M?.itemTitleClassName,
|
|
873
|
+
itemIconBadgeClassName: m?.itemIconBadgeClassName,
|
|
874
|
+
taskBadgeClassName: m?.taskBadgeClassName
|
|
849
875
|
},
|
|
850
|
-
draggingId:
|
|
876
|
+
draggingId: fe,
|
|
851
877
|
dragOverId: ge,
|
|
852
|
-
allowedDropGroups:
|
|
853
|
-
onDragStart: (e) =>
|
|
854
|
-
onDragEnd:
|
|
855
|
-
onDragOver:
|
|
856
|
-
onDragLeave:
|
|
857
|
-
onDrop:
|
|
878
|
+
allowedDropGroups: ve,
|
|
879
|
+
onDragStart: (e) => je(e, $),
|
|
880
|
+
onDragEnd: Me,
|
|
881
|
+
onDragOver: Ne,
|
|
882
|
+
onDragLeave: Pe,
|
|
883
|
+
onDrop: Fe
|
|
858
884
|
}), [
|
|
859
885
|
$,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
886
|
+
G,
|
|
887
|
+
ke,
|
|
888
|
+
J,
|
|
863
889
|
d,
|
|
864
|
-
|
|
890
|
+
V,
|
|
865
891
|
u,
|
|
866
892
|
_,
|
|
867
893
|
v,
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
894
|
+
z,
|
|
895
|
+
B,
|
|
896
|
+
M?.groupHeaderClassName,
|
|
897
|
+
M?.itemTitleClassName,
|
|
871
898
|
m?.itemIconBadgeClassName,
|
|
872
|
-
|
|
899
|
+
m?.taskBadgeClassName,
|
|
900
|
+
fe,
|
|
873
901
|
ge,
|
|
874
|
-
|
|
875
|
-
Oe,
|
|
876
|
-
ke,
|
|
877
|
-
Ae,
|
|
902
|
+
ve,
|
|
878
903
|
je,
|
|
879
|
-
Me
|
|
880
|
-
|
|
881
|
-
|
|
904
|
+
Me,
|
|
905
|
+
Ne,
|
|
906
|
+
Pe,
|
|
907
|
+
Fe
|
|
908
|
+
]), Ue = e.length === 0, We = e.length > 0 && Q.length === 0;
|
|
909
|
+
return /* @__PURE__ */ A(s, {
|
|
882
910
|
isOpen: l,
|
|
883
|
-
orientation:
|
|
884
|
-
title:
|
|
911
|
+
orientation: o.Left,
|
|
912
|
+
title: te,
|
|
885
913
|
labels: {
|
|
886
|
-
ariaLabel:
|
|
887
|
-
closeLabel:
|
|
914
|
+
ariaLabel: te,
|
|
915
|
+
closeLabel: ae
|
|
888
916
|
},
|
|
889
917
|
onClose: y,
|
|
890
918
|
styles: {
|
|
891
919
|
colors: {
|
|
892
|
-
background:
|
|
893
|
-
border:
|
|
920
|
+
background: j?.background,
|
|
921
|
+
border: j?.border
|
|
894
922
|
},
|
|
895
|
-
typography: { fontClassName:
|
|
923
|
+
typography: { fontClassName: M?.fontClassName },
|
|
896
924
|
bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
|
|
897
|
-
cssVars:
|
|
898
|
-
titleClassName:
|
|
925
|
+
cssVars: Ie,
|
|
926
|
+
titleClassName: M?.fontClassName,
|
|
899
927
|
headerClassName: "h-[64px]",
|
|
900
|
-
className:
|
|
928
|
+
className: n(l ? "w-[324px] mobile:w-full" : "w-0", h)
|
|
901
929
|
},
|
|
902
930
|
rightActions: b,
|
|
903
931
|
children: [
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
label:
|
|
932
|
+
/* @__PURE__ */ k(xe, {
|
|
933
|
+
label: I,
|
|
906
934
|
onClick: p,
|
|
907
|
-
labelClassName:
|
|
935
|
+
labelClassName: M?.newChatLabelClassName,
|
|
936
|
+
colors: N
|
|
908
937
|
}),
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
value:
|
|
911
|
-
onChange:
|
|
938
|
+
/* @__PURE__ */ k(a, {
|
|
939
|
+
value: V,
|
|
940
|
+
onChange: H,
|
|
912
941
|
labels: {
|
|
913
|
-
placeholder:
|
|
914
|
-
clearLabel:
|
|
942
|
+
placeholder: re,
|
|
943
|
+
clearLabel: L
|
|
915
944
|
}
|
|
916
945
|
}),
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
activeTab:
|
|
919
|
-
labels:
|
|
946
|
+
/* @__PURE__ */ k(ye, {
|
|
947
|
+
activeTab: U,
|
|
948
|
+
labels: ie,
|
|
920
949
|
onChange: (e) => {
|
|
921
|
-
|
|
950
|
+
W(e), ee?.(e);
|
|
922
951
|
},
|
|
923
|
-
tabClassName:
|
|
952
|
+
tabClassName: M?.tabClassName
|
|
924
953
|
}),
|
|
925
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ k("span", {
|
|
926
955
|
role: "status",
|
|
927
956
|
"aria-live": "polite",
|
|
928
957
|
className: "sr-only",
|
|
929
|
-
children:
|
|
958
|
+
children: c ? F : Ue ? ne : We ? P : ""
|
|
930
959
|
}),
|
|
931
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ k("div", {
|
|
932
961
|
className: "flex-1 overflow-hidden px-2 py-1",
|
|
933
|
-
children:
|
|
962
|
+
children: c ? /* @__PURE__ */ k("div", {
|
|
934
963
|
className: "flex flex-col gap-3 px-2 py-3",
|
|
935
|
-
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */
|
|
964
|
+
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ k(g, {
|
|
936
965
|
avatar: { size: 24 },
|
|
937
|
-
showTitle: { width:
|
|
966
|
+
showTitle: { width: le(t) },
|
|
938
967
|
paragraph: !1,
|
|
939
968
|
active: !0,
|
|
940
|
-
color:
|
|
969
|
+
color: Z.skeletonColor
|
|
941
970
|
}, t))
|
|
942
|
-
}) :
|
|
971
|
+
}) : Ue ? /* @__PURE__ */ k(r, { label: ne }) : We ? /* @__PURE__ */ k(i, { label: P }) : /* @__PURE__ */ k(ce, {
|
|
943
972
|
listRef: se,
|
|
944
|
-
id:
|
|
973
|
+
id: J,
|
|
945
974
|
role: "list",
|
|
946
975
|
style: { height: "100%" },
|
|
947
976
|
rowComponent: we,
|
|
948
977
|
rowCount: $.length,
|
|
949
|
-
rowHeight:
|
|
950
|
-
overscanCount:
|
|
951
|
-
onResize:
|
|
952
|
-
rowProps:
|
|
978
|
+
rowHeight: de,
|
|
979
|
+
overscanCount: oe,
|
|
980
|
+
onResize: Oe,
|
|
981
|
+
rowProps: He
|
|
953
982
|
})
|
|
954
983
|
})
|
|
955
984
|
]
|
|
956
985
|
});
|
|
957
986
|
});
|
|
958
987
|
//#endregion
|
|
959
|
-
export {
|
|
988
|
+
export { Oe as ConversationPanel, X as FilterTab };
|