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