@epam/ai-dial-conversation-panel 1.1.0-dev.99 → 1.2.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts +2 -2
- package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts.map +1 -1
- package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
- package/components/ConversationPanel/utils.d.ts +1 -1
- package/components/ConversationPanel/utils.d.ts.map +1 -1
- package/components/ConversationRow/ConversationRow.d.ts +4 -2
- package/components/ConversationRow/ConversationRow.d.ts.map +1 -1
- package/components/FilterTabs/FilterTabs.d.ts +6 -2
- package/components/FilterTabs/FilterTabs.d.ts.map +1 -1
- package/components/ImportExportQueue/ImportExportQueue.d.ts +6 -0
- package/components/ImportExportQueue/ImportExportQueue.d.ts.map +1 -0
- package/components/ImportExportQueueHeader/ImportExportQueueHeader.d.ts +24 -0
- package/components/ImportExportQueueHeader/ImportExportQueueHeader.d.ts.map +1 -0
- package/components/ImportExportQueueRow/ImportExportQueueRow.d.ts +17 -0
- package/components/ImportExportQueueRow/ImportExportQueueRow.d.ts.map +1 -0
- package/components/NewChatButton/NewChatButton.d.ts.map +1 -1
- package/components/RenameConversationPopup/RenameConversationPopup.d.ts +5 -0
- package/components/RenameConversationPopup/RenameConversationPopup.d.ts.map +1 -0
- package/components/RowRenderer/RowRenderer.d.ts +1 -1
- package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
- package/constants/import-export-queue.d.ts +4 -0
- package/constants/import-export-queue.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +5 -1
- package/index.d.ts.map +1 -1
- package/index.js +774 -464
- package/models/import-export-queue.d.ts +113 -0
- package/models/import-export-queue.d.ts.map +1 -0
- package/models/panel-props.d.ts +48 -3
- package/models/panel-props.d.ts.map +1 -1
- package/models/rename-conversation-popup.d.ts +47 -0
- package/models/rename-conversation-popup.d.ts.map +1 -0
- package/models/virtual-row.d.ts +7 -5
- package/models/virtual-row.d.ts.map +1 -1
- package/package.json +7 -8
- package/utils/conversation-row.d.ts +8 -1
- package/utils/conversation-row.d.ts.map +1 -1
- package/utils/drag.d.ts +1 -1
- package/utils/drag.d.ts.map +1 -1
- package/utils/transfer-file.d.ts +10 -0
- package/utils/transfer-file.d.ts.map +1 -0
- package/types/conversation-classification.d.ts +0 -9
- package/types/conversation-classification.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PanelEmpty as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { IconCaretDownFilled as
|
|
1
|
+
import { ConversationTransferJobStatus as e, DeploymentIcon as t, FilterTab as n, buildCssVars as r, getUtf8ByteLength as i, mergeClasses as a, sanitizeConversationName as o, stripTrailingDots as s } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { PanelEmpty as c, PanelNoResults as l, SidebarOrientation as u, SidebarPanel as d } from "@epam/ai-dial-sidebar";
|
|
3
|
+
import { Button as f, ButtonVariant as p, ConfirmationPopup as m, ConfirmationPopupVariant as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, Dropdown as v, ElementSize as y, EllipsisTooltip as b, GhostIconButton as x, Highlight as S, Input as C, Popup as w, PopupSize as T, ProgressBar as E, Search as D, Skeleton as O, SkeletonVariant as k, Spinner as A, Tag as j, TagAppearance as M, Tooltip as ee, mergeClasses as N } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { createElement as te, memo as P, useCallback as F, useEffect as I, useId as ne, useImperativeHandle as re, useLayoutEffect as ie, useMemo as L, useRef as R, useState as z } from "react";
|
|
5
|
+
import { Fragment as ae, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
6
|
+
import { IconAlertCircleFilled as H, IconAlertTriangleFilled as oe, IconCaretDownFilled as se, IconCaretRightFilled as ce, IconCheck as U, IconChevronDown as le, IconChevronUp as ue, IconClock as de, IconDotsVertical as W, IconFile as fe, IconFileZip as pe, IconJson as me, IconPlus as he, IconSparkles as ge, IconX as _e } from "@tabler/icons-react";
|
|
7
7
|
//#region ../../node_modules/react-window/dist/react-window.js
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var G = typeof window < "u" ? ie : I;
|
|
9
|
+
function ve(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 ye({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
18
|
+
let { styleHeight: s, styleWidth: c } = L(() => ({
|
|
19
|
+
styleHeight: ve(o?.height),
|
|
20
|
+
styleWidth: ve(o?.width)
|
|
21
|
+
}), [o?.height, o?.width]), [l, u] = z({
|
|
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 G(() => {
|
|
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 ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
42
42
|
i,
|
|
43
43
|
s,
|
|
44
44
|
c
|
|
45
|
-
]),
|
|
45
|
+
]), L(() => ({
|
|
46
46
|
height: s ?? l.height,
|
|
47
47
|
width: c ?? l.width
|
|
48
48
|
}), [
|
|
@@ -51,26 +51,26 @@ function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
51
51
|
c
|
|
52
52
|
]);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
let t =
|
|
54
|
+
function be(e) {
|
|
55
|
+
let t = R(() => {
|
|
56
56
|
throw Error("Cannot call during render.");
|
|
57
57
|
});
|
|
58
|
-
return
|
|
58
|
+
return G(() => {
|
|
59
59
|
t.current = e;
|
|
60
|
-
}, [e]),
|
|
60
|
+
}, [e]), F((e) => t.current?.(e), [t]);
|
|
61
61
|
}
|
|
62
|
-
var
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
62
|
+
var K = null;
|
|
63
|
+
function xe(e = !1) {
|
|
64
|
+
if (K === 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 ? K = "positive-descending" : (e.scrollLeft = 1, K = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), K;
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return K;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
if (t === "horizontal" && n) switch (
|
|
72
|
+
function Se({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
73
|
+
if (t === "horizontal" && n) switch (xe()) {
|
|
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 q(e, t = "Assertion error") {
|
|
85
85
|
if (!e) throw console.error(t), Error(t);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function J(e, t) {
|
|
88
88
|
if (e === t) return !0;
|
|
89
|
-
if (!!e != !!t || (
|
|
89
|
+
if (!!e != !!t || (q(e !== void 0), q(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 Ce({ 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 q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function we({ 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 = Ce({
|
|
104
104
|
cachedBounds: t,
|
|
105
105
|
itemCount: r,
|
|
106
106
|
itemSize: i
|
|
@@ -112,7 +112,7 @@ function U({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, con
|
|
|
112
112
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Te({ 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 Ee({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
135
135
|
let r = /* @__PURE__ */ new Map();
|
|
136
136
|
return {
|
|
137
137
|
get(i) {
|
|
138
|
-
for (
|
|
138
|
+
for (q(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
|
+
q(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 q(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 De({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
172
|
+
return L(() => Ee({
|
|
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 Oe({ containerSize: e, itemSize: t }) {
|
|
183
183
|
let n;
|
|
184
184
|
switch (typeof t) {
|
|
185
185
|
case "string":
|
|
186
|
-
|
|
186
|
+
q(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), q(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 q({ containerSize: e, itemSize: t }) {
|
|
|
191
191
|
}
|
|
192
192
|
return n;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
let { height: u = n, width: d = n } =
|
|
194
|
+
function ke({ 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 } = ye({
|
|
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 = R({
|
|
202
202
|
height: 0,
|
|
203
203
|
width: 0
|
|
204
|
-
}), p = r === "vertical" ? u : d, m =
|
|
204
|
+
}), p = r === "vertical" ? u : d, m = Oe({
|
|
205
205
|
containerSize: p,
|
|
206
206
|
itemSize: s
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
ie(() => {
|
|
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 J({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
218
218
|
c,
|
|
219
219
|
d
|
|
220
220
|
]);
|
|
221
|
-
let h =
|
|
221
|
+
let h = De({
|
|
222
222
|
itemCount: a,
|
|
223
223
|
itemProps: o,
|
|
224
224
|
itemSize: m
|
|
225
|
-
}), g =
|
|
225
|
+
}), g = F((e) => h.get(e), [h]), [_, v] = z(() => Te({
|
|
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: S } = {
|
|
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
|
-
},
|
|
236
|
+
}, C = F(() => Ce({
|
|
237
237
|
cachedBounds: h,
|
|
238
238
|
itemCount: a,
|
|
239
239
|
itemSize: m
|
|
@@ -241,9 +241,9 @@ function J({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
241
241
|
h,
|
|
242
242
|
a,
|
|
243
243
|
m
|
|
244
|
-
]),
|
|
244
|
+
]), w = F((t) => Te({
|
|
245
245
|
cachedBounds: h,
|
|
246
|
-
containerScrollOffset:
|
|
246
|
+
containerScrollOffset: Se({
|
|
247
247
|
containerElement: e,
|
|
248
248
|
direction: r,
|
|
249
249
|
isRtl: i,
|
|
@@ -261,19 +261,19 @@ function J({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
261
261
|
a,
|
|
262
262
|
l
|
|
263
263
|
]);
|
|
264
|
-
return
|
|
265
|
-
v(
|
|
264
|
+
return G(() => {
|
|
265
|
+
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
266
266
|
}, [
|
|
267
267
|
e,
|
|
268
268
|
r,
|
|
269
|
-
|
|
270
|
-
]),
|
|
269
|
+
w
|
|
270
|
+
]), G(() => {
|
|
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 = Te({
|
|
275
275
|
cachedBounds: h,
|
|
276
|
-
containerScrollOffset:
|
|
276
|
+
containerScrollOffset: Se({
|
|
277
277
|
containerElement: e,
|
|
278
278
|
direction: r,
|
|
279
279
|
isRtl: i,
|
|
@@ -283,7 +283,7 @@ function J({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
283
283
|
itemCount: a,
|
|
284
284
|
overscanCount: l
|
|
285
285
|
});
|
|
286
|
-
return
|
|
286
|
+
return J(s, t) ? t : s;
|
|
287
287
|
});
|
|
288
288
|
};
|
|
289
289
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -298,9 +298,9 @@ function J({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
298
298
|
l
|
|
299
299
|
]), {
|
|
300
300
|
getCellBounds: g,
|
|
301
|
-
getEstimatedSize:
|
|
302
|
-
scrollToIndex:
|
|
303
|
-
let s =
|
|
301
|
+
getEstimatedSize: C,
|
|
302
|
+
scrollToIndex: be(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
303
|
+
let s = we({
|
|
304
304
|
align: t,
|
|
305
305
|
cachedBounds: h,
|
|
306
306
|
containerScrollOffset: n,
|
|
@@ -310,53 +310,53 @@ function J({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
310
310
|
itemSize: m
|
|
311
311
|
});
|
|
312
312
|
if (e) {
|
|
313
|
-
if (s =
|
|
313
|
+
if (s = Se({
|
|
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 = w(s);
|
|
320
|
+
J(_, e) || v(e);
|
|
321
321
|
}
|
|
322
322
|
return s;
|
|
323
323
|
}
|
|
324
324
|
}),
|
|
325
325
|
startIndexOverscan: b,
|
|
326
326
|
startIndexVisible: y,
|
|
327
|
-
stopIndexOverscan:
|
|
328
|
-
stopIndexVisible:
|
|
327
|
+
stopIndexOverscan: S,
|
|
328
|
+
stopIndexVisible: x
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
331
|
+
function Ae(e) {
|
|
332
|
+
return L(() => e, Object.values(e));
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function je(e, t) {
|
|
335
335
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
336
|
-
return
|
|
336
|
+
return J(n, a) && J(r, o) && J(i, s);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Me(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 Y = "data-react-window-index";
|
|
342
|
+
function Ne({ 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 = Ae(u), h = L(() => P(s, je), [s]), [g, _] = z(null), v = Me(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = ke({
|
|
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: L(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
351
351
|
onResize: i,
|
|
352
352
|
overscanCount: o
|
|
353
353
|
});
|
|
354
|
-
|
|
354
|
+
re(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 = x({
|
|
360
360
|
align: e,
|
|
361
361
|
containerScrollOffset: g?.scrollTop ?? 0,
|
|
362
362
|
index: n
|
|
@@ -366,40 +366,40 @@ function se({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
366
366
|
top: r
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
}), [g,
|
|
369
|
+
}), [g, x]), G(() => {
|
|
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 = `${S + t}`;
|
|
374
|
+
return e.setAttribute(Y, 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:
|
|
381
|
+
S,
|
|
382
|
+
w
|
|
383
|
+
]), I(() => {
|
|
384
|
+
S >= 0 && w >= 0 && a && a({
|
|
385
|
+
startIndex: C,
|
|
386
|
+
stopIndex: T
|
|
387
387
|
}, {
|
|
388
|
-
startIndex:
|
|
389
|
-
stopIndex:
|
|
388
|
+
startIndex: S,
|
|
389
|
+
stopIndex: w
|
|
390
390
|
});
|
|
391
391
|
}, [
|
|
392
392
|
a,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
393
|
+
S,
|
|
394
|
+
C,
|
|
395
|
+
w,
|
|
396
|
+
T
|
|
397
397
|
]);
|
|
398
|
-
let
|
|
398
|
+
let E = L(() => {
|
|
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 = S; t <= w; t++) {
|
|
401
|
+
let n = y(t);
|
|
402
|
+
e.push(/* @__PURE__ */ te(h, {
|
|
403
403
|
...m,
|
|
404
404
|
ariaAttributes: {
|
|
405
405
|
"aria-posinset": t + 1,
|
|
@@ -420,21 +420,21 @@ function se({ 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
|
-
|
|
428
|
-
|
|
429
|
-
]),
|
|
427
|
+
S,
|
|
428
|
+
w
|
|
429
|
+
]), D = /* @__PURE__ */ B("div", {
|
|
430
430
|
"aria-hidden": !0,
|
|
431
431
|
style: {
|
|
432
|
-
height:
|
|
432
|
+
height: b(),
|
|
433
433
|
width: "100%",
|
|
434
434
|
zIndex: -1
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
|
-
return
|
|
437
|
+
return te(d, {
|
|
438
438
|
role: "list",
|
|
439
439
|
...p,
|
|
440
440
|
className: t,
|
|
@@ -446,518 +446,828 @@ function se({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
446
446
|
overflowY: "auto",
|
|
447
447
|
...f
|
|
448
448
|
}
|
|
449
|
-
},
|
|
449
|
+
}, E, e, D);
|
|
450
450
|
}
|
|
451
451
|
//#endregion
|
|
452
452
|
//#region src/types/virtual-row.ts
|
|
453
|
-
var
|
|
453
|
+
var X = /* @__PURE__ */ function(e) {
|
|
454
454
|
return e.Header = "header", e.Item = "item", e;
|
|
455
|
-
}({}),
|
|
456
|
-
return e.All = "all", e.Pinned = "pinned", e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
|
|
457
|
-
}({}), ce = (e) => `${60 + e * 23 % 35}%`, le = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", ue = (e, t) => t.rows[e].kind === Y.Item ? 36 : e === 0 ? 24 : 56, de = (e) => {
|
|
455
|
+
}({}), Pe = (e) => `${60 + e * 23 % 35}%`, Fe = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", Ie = (e, t) => t.rows[e].kind === X.Item ? 36 : e === 0 ? 24 : 56, Le = (e) => {
|
|
458
456
|
switch (e) {
|
|
459
|
-
case
|
|
460
|
-
case
|
|
461
|
-
default: return
|
|
457
|
+
case n.Shared: return n.Shared;
|
|
458
|
+
case n.Organization: return n.Organization;
|
|
459
|
+
default: return n.MyChats;
|
|
462
460
|
}
|
|
463
|
-
},
|
|
461
|
+
}, Re = (e, t) => {
|
|
464
462
|
let n = null;
|
|
465
|
-
for (let r of e) if (r.kind ===
|
|
463
|
+
for (let r of e) if (r.kind === X.Header) n = r.groupKey;
|
|
466
464
|
else if (r.item.id === t) return n;
|
|
467
465
|
return null;
|
|
468
|
-
},
|
|
469
|
-
let
|
|
470
|
-
if (t != null &&
|
|
471
|
-
let t =
|
|
472
|
-
t &&
|
|
473
|
-
} else
|
|
474
|
-
return
|
|
475
|
-
},
|
|
466
|
+
}, ze = (e, t, r) => {
|
|
467
|
+
let i = /* @__PURE__ */ new Set();
|
|
468
|
+
if (t != null && i.add(t), t === n.Pinned) {
|
|
469
|
+
let t = r.find((t) => t.id === e);
|
|
470
|
+
t && i.add(Le(t.source));
|
|
471
|
+
} else i.add(n.Pinned);
|
|
472
|
+
return i;
|
|
473
|
+
}, Be = (e, t, n, r) => {
|
|
476
474
|
let i = e.currentTarget.getBoundingClientRect();
|
|
477
475
|
if (e.clientY >= i.top + i.height / 2) return t;
|
|
478
476
|
let a = null, o = !1;
|
|
479
|
-
for (let e of n) if (e.kind ===
|
|
477
|
+
for (let e of n) if (e.kind === X.Header) o = e.groupKey === r;
|
|
480
478
|
else if (o) {
|
|
481
479
|
if (e.item.id === t) return a;
|
|
482
480
|
a = e.item.id;
|
|
483
481
|
}
|
|
484
482
|
return null;
|
|
485
|
-
},
|
|
486
|
-
tabContainer: "_tabContainer_153ct_1",
|
|
487
|
-
tabActive: "_tabActive_153ct_13"
|
|
488
|
-
}, ge = b(({ tabs: e, activeTabId: t, onTabChange: r, styles: i }) => {
|
|
489
|
-
let { tabClassName: a = "dial-tiny-semi-text" } = i?.typography ?? {};
|
|
490
|
-
return /* @__PURE__ */ k("div", {
|
|
491
|
-
className: "flex flex-nowrap gap-1",
|
|
492
|
-
role: "tablist",
|
|
493
|
-
children: e.map((e) => {
|
|
494
|
-
let i = t === e.id;
|
|
495
|
-
return /* @__PURE__ */ k("div", {
|
|
496
|
-
role: "tab",
|
|
497
|
-
"aria-selected": i,
|
|
498
|
-
className: "contents",
|
|
499
|
-
children: /* @__PURE__ */ k(m, {
|
|
500
|
-
label: e.label,
|
|
501
|
-
selected: i,
|
|
502
|
-
onClick: () => r(e.id),
|
|
503
|
-
className: n("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", a, he.tabContainer, i && he.tabActive)
|
|
504
|
-
})
|
|
505
|
-
}, e.id);
|
|
506
|
-
})
|
|
507
|
-
});
|
|
508
|
-
}), _e = [
|
|
483
|
+
}, Ve = [
|
|
509
484
|
{
|
|
510
|
-
value:
|
|
485
|
+
value: n.All,
|
|
511
486
|
labelKey: "all"
|
|
512
487
|
},
|
|
513
488
|
{
|
|
514
|
-
value:
|
|
489
|
+
value: n.MyChats,
|
|
515
490
|
labelKey: "myChats"
|
|
516
491
|
},
|
|
517
492
|
{
|
|
518
|
-
value:
|
|
493
|
+
value: n.Shared,
|
|
519
494
|
labelKey: "shared"
|
|
520
495
|
},
|
|
521
496
|
{
|
|
522
|
-
value:
|
|
497
|
+
value: n.Organization,
|
|
523
498
|
labelKey: "organization"
|
|
524
499
|
}
|
|
525
|
-
],
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
})
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
500
|
+
], He = P(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
|
|
501
|
+
let a = Ve.filter(({ value: e }) => !i?.includes(e));
|
|
502
|
+
return /* @__PURE__ */ B("div", {
|
|
503
|
+
role: "group",
|
|
504
|
+
"aria-label": t.groupAriaLabel ?? "Filter chats",
|
|
505
|
+
className: "flex flex-nowrap gap-1 px-3 py-2",
|
|
506
|
+
children: a.map(({ value: i, labelKey: a }) => /* @__PURE__ */ B(j, {
|
|
507
|
+
label: t[a],
|
|
508
|
+
appearance: M.Selectable,
|
|
509
|
+
selected: e === i,
|
|
510
|
+
onClick: () => n(i),
|
|
511
|
+
className: N("flex-1 justify-center rounded-full", r)
|
|
512
|
+
}, i))
|
|
513
|
+
});
|
|
514
|
+
}), Ue = { button: "_button_1vksy_1" }, We = P(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i }) => /* @__PURE__ */ B("div", {
|
|
537
515
|
className: "px-3 py-2",
|
|
538
|
-
style:
|
|
539
|
-
"--cp-new-chat-bg":
|
|
540
|
-
"--cp-new-chat-text":
|
|
516
|
+
style: r({
|
|
517
|
+
"--cp-new-chat-bg": i?.background,
|
|
518
|
+
"--cp-new-chat-text": i?.text,
|
|
519
|
+
"--cp-new-chat-focus-outline": i?.focusOutline
|
|
541
520
|
}),
|
|
542
|
-
children: /* @__PURE__ */
|
|
543
|
-
onClick:
|
|
521
|
+
children: /* @__PURE__ */ V("button", {
|
|
522
|
+
onClick: t,
|
|
544
523
|
type: "button",
|
|
545
|
-
className:
|
|
546
|
-
children: [/* @__PURE__ */
|
|
524
|
+
className: a("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", Ue.button),
|
|
525
|
+
children: [/* @__PURE__ */ B(he, {
|
|
547
526
|
size: 18,
|
|
548
|
-
stroke:
|
|
527
|
+
stroke: _,
|
|
549
528
|
className: "shrink-0"
|
|
550
|
-
}), /* @__PURE__ */
|
|
551
|
-
className:
|
|
529
|
+
}), /* @__PURE__ */ B("span", {
|
|
530
|
+
className: n,
|
|
552
531
|
children: e
|
|
553
532
|
})]
|
|
554
533
|
})
|
|
555
534
|
})), Z = {
|
|
556
|
-
skeletonColor: "var(--cp-skeleton-color, var(--bg-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
dropZoneActive: "
|
|
562
|
-
triggerActive: "
|
|
563
|
-
triggerIcon: "
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
535
|
+
skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
|
|
536
|
+
item: "_item_i3lsf_2",
|
|
537
|
+
itemActive: "_itemActive_i3lsf_15",
|
|
538
|
+
groupHeader: "_groupHeader_i3lsf_20",
|
|
539
|
+
taskBadge: "_taskBadge_i3lsf_24",
|
|
540
|
+
dropZoneActive: "_dropZoneActive_i3lsf_30",
|
|
541
|
+
triggerActive: "_triggerActive_i3lsf_35",
|
|
542
|
+
triggerIcon: "_triggerIcon_i3lsf_38",
|
|
543
|
+
unreadDot: "_unreadDot_i3lsf_46",
|
|
544
|
+
search: "_search_i3lsf_54"
|
|
545
|
+
}, Q = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
|
|
546
|
+
let d = o != null;
|
|
547
|
+
return /* @__PURE__ */ V("button", {
|
|
567
548
|
type: "button",
|
|
568
549
|
"aria-expanded": t,
|
|
569
|
-
"aria-controls":
|
|
570
|
-
onClick:
|
|
571
|
-
onDragOver:
|
|
572
|
-
|
|
550
|
+
"aria-controls": r,
|
|
551
|
+
onClick: n,
|
|
552
|
+
onDragOver: d ? (e) => {
|
|
553
|
+
d && (e.preventDefault(), c?.(o));
|
|
573
554
|
} : void 0,
|
|
574
|
-
onDragLeave:
|
|
575
|
-
|
|
555
|
+
onDragLeave: d ? (e) => {
|
|
556
|
+
d && (e.currentTarget.contains(e.relatedTarget) || l?.());
|
|
576
557
|
} : void 0,
|
|
577
|
-
onDrop:
|
|
578
|
-
|
|
558
|
+
onDrop: d ? (e) => {
|
|
559
|
+
d && (e.preventDefault(), u?.(o, o, null));
|
|
579
560
|
} : void 0,
|
|
580
|
-
className:
|
|
581
|
-
children: [t ? /* @__PURE__ */
|
|
582
|
-
stroke: .5,
|
|
561
|
+
className: a("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", i, Z.groupHeader, s && Z.dropZoneActive),
|
|
562
|
+
children: [t ? /* @__PURE__ */ B(se, {
|
|
583
563
|
size: 12,
|
|
584
564
|
className: "shrink-0",
|
|
585
565
|
"aria-hidden": !0
|
|
586
|
-
}) : /* @__PURE__ */
|
|
587
|
-
stroke: .5,
|
|
566
|
+
}) : /* @__PURE__ */ B(ce, {
|
|
588
567
|
size: 12,
|
|
589
568
|
className: "shrink-0 rtl:scale-x-[-1]",
|
|
590
569
|
"aria-hidden": !0
|
|
591
|
-
}), /* @__PURE__ */
|
|
570
|
+
}), /* @__PURE__ */ B(b, { text: e })]
|
|
592
571
|
});
|
|
593
|
-
},
|
|
594
|
-
let [
|
|
595
|
-
ee(
|
|
596
|
-
}, [
|
|
597
|
-
variant:
|
|
598
|
-
width:
|
|
599
|
-
height:
|
|
572
|
+
}, Ge = ({ item: e, isActive: n, onSelectConversation: r, searchQuery: i = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", itemIconBadgeClassName: u, taskBadgeClassName: d = "dial-caption-lead-semi-text", unreadIndicatorLabel: p = "Unread", rowGroupKey: m, rows: h, draggingId: b, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: D, onDragLeave: A, onDrop: j }) => {
|
|
573
|
+
let [M, ee] = z(!1), N = R(null), te = F((t) => {
|
|
574
|
+
ee(t), t && N.current && s?.(e, N.current);
|
|
575
|
+
}, [e, s]), P = o?.(e) ?? [], I = P.length > 0, ne = e.isIconLoading ? /* @__PURE__ */ B(O, {
|
|
576
|
+
variant: k.Circular,
|
|
577
|
+
width: g.LG,
|
|
578
|
+
height: g.LG,
|
|
600
579
|
color: Z.skeletonColor,
|
|
601
580
|
"aria-hidden": !0
|
|
602
|
-
}) : /* @__PURE__ */
|
|
603
|
-
src:
|
|
604
|
-
size:
|
|
605
|
-
initialsName:
|
|
606
|
-
labels: { tooltip:
|
|
607
|
-
styles: { badgeClassName:
|
|
608
|
-
}),
|
|
609
|
-
className:
|
|
610
|
-
children: [/* @__PURE__ */
|
|
581
|
+
}) : /* @__PURE__ */ B(t, {
|
|
582
|
+
src: e.iconUrl,
|
|
583
|
+
size: g.LG,
|
|
584
|
+
initialsName: e.iconTooltip ?? "",
|
|
585
|
+
labels: { tooltip: e.iconTooltip },
|
|
586
|
+
styles: { badgeClassName: u }
|
|
587
|
+
}), re = /* @__PURE__ */ V("span", {
|
|
588
|
+
className: "flex shrink-0 items-center",
|
|
589
|
+
children: [/* @__PURE__ */ B("span", {
|
|
590
|
+
className: "relative flex size-3 shrink-0 items-center justify-center",
|
|
591
|
+
children: e.isUnread && /* @__PURE__ */ V(ae, { children: [/* @__PURE__ */ B("span", {
|
|
592
|
+
className: a("size-[5.33px] rounded-full", Z.unreadDot),
|
|
593
|
+
"aria-hidden": !0
|
|
594
|
+
}), /* @__PURE__ */ B("span", {
|
|
595
|
+
className: "sr-only",
|
|
596
|
+
children: p
|
|
597
|
+
})] })
|
|
598
|
+
}), ne]
|
|
599
|
+
}), ie = Fe(I, M), L = e.showTaskBadge ? /* @__PURE__ */ V("span", {
|
|
600
|
+
className: a("flex h-5 shrink-0 items-center justify-center gap-0.5 rounded-full border pe-2 ps-1", Z.taskBadge, d),
|
|
601
|
+
children: [/* @__PURE__ */ B(de, {
|
|
611
602
|
size: 12,
|
|
612
|
-
"aria-hidden": !0
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
603
|
+
"aria-hidden": !0,
|
|
604
|
+
stroke: _
|
|
605
|
+
}), e.taskBadgeLabel]
|
|
606
|
+
}) : void 0, H = m != null, oe = F((e) => {
|
|
607
|
+
e.currentTarget.contains(e.relatedTarget) || A?.();
|
|
608
|
+
}, [A]), se = F((t) => {
|
|
609
|
+
if (!m || !h || !j) return;
|
|
610
|
+
t.preventDefault();
|
|
611
|
+
let n = Be(t, e.id, h, m);
|
|
612
|
+
j(e.id, m, n);
|
|
621
613
|
}, [
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
]),
|
|
627
|
-
return /* @__PURE__ */
|
|
628
|
-
className:
|
|
629
|
-
draggable:
|
|
630
|
-
onDragStart:
|
|
631
|
-
onDragEnd:
|
|
632
|
-
onDragOver:
|
|
633
|
-
|
|
614
|
+
e.id,
|
|
615
|
+
h,
|
|
616
|
+
m,
|
|
617
|
+
j
|
|
618
|
+
]), ce = e.id === b, U = e.id === C, le = m != null && (w?.has(m) ?? !1), ue = b != null;
|
|
619
|
+
return /* @__PURE__ */ V("li", {
|
|
620
|
+
className: a("group/conversation relative", ce && "cursor-grabbing opacity-50", U && le && "rounded", U && le && Z.dropZoneActive, ue && !ce && !le && "cursor-not-allowed"),
|
|
621
|
+
draggable: H || void 0,
|
|
622
|
+
onDragStart: H ? () => T?.(e.id) : void 0,
|
|
623
|
+
onDragEnd: H ? E : void 0,
|
|
624
|
+
onDragOver: H ? (t) => {
|
|
625
|
+
t.preventDefault(), D?.(e.id);
|
|
634
626
|
} : void 0,
|
|
635
|
-
onDragLeave:
|
|
636
|
-
onDrop:
|
|
637
|
-
children: [/* @__PURE__ */
|
|
638
|
-
href:
|
|
627
|
+
onDragLeave: H ? oe : void 0,
|
|
628
|
+
onDrop: H ? se : void 0,
|
|
629
|
+
children: [/* @__PURE__ */ B("a", {
|
|
630
|
+
href: e.href,
|
|
639
631
|
className: "contents",
|
|
640
|
-
onClick: (
|
|
641
|
-
|
|
632
|
+
onClick: (t) => {
|
|
633
|
+
e.href && (t.preventDefault(), r(e.id));
|
|
642
634
|
},
|
|
643
|
-
children: /* @__PURE__ */
|
|
644
|
-
iconBefore:
|
|
645
|
-
label: /* @__PURE__ */
|
|
646
|
-
text:
|
|
647
|
-
query:
|
|
648
|
-
className:
|
|
635
|
+
children: /* @__PURE__ */ B(f, {
|
|
636
|
+
iconBefore: re,
|
|
637
|
+
label: /* @__PURE__ */ B(S, {
|
|
638
|
+
text: e.title,
|
|
639
|
+
query: i,
|
|
640
|
+
className: l,
|
|
649
641
|
maxLines: 1
|
|
650
642
|
}),
|
|
651
|
-
iconAfter:
|
|
643
|
+
iconAfter: L,
|
|
652
644
|
textClassName: "min-w-0 flex-1",
|
|
653
|
-
"aria-current":
|
|
654
|
-
onClick:
|
|
655
|
-
tabIndex:
|
|
656
|
-
className:
|
|
645
|
+
"aria-current": n ? "page" : void 0,
|
|
646
|
+
onClick: e.href ? void 0 : () => r(e.id),
|
|
647
|
+
tabIndex: e.href ? -1 : void 0,
|
|
648
|
+
className: a("h-8 w-full justify-start gap-2 py-2 ps-0 after:pointer-events-none", ie, Z.item, n && Z.itemActive, M && Z.itemActive)
|
|
657
649
|
})
|
|
658
|
-
}),
|
|
659
|
-
className:
|
|
660
|
-
children: /* @__PURE__ */
|
|
661
|
-
items:
|
|
662
|
-
onOpenChange:
|
|
650
|
+
}), I && /* @__PURE__ */ B("div", {
|
|
651
|
+
className: a("absolute inset-y-0 end-1 flex items-center", M ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
|
|
652
|
+
children: /* @__PURE__ */ B(v, {
|
|
653
|
+
items: P,
|
|
654
|
+
onOpenChange: te,
|
|
663
655
|
matchReferenceWidth: !1,
|
|
664
|
-
listClassName: "w-[
|
|
665
|
-
children: /* @__PURE__ */
|
|
666
|
-
ref:
|
|
667
|
-
icon: /* @__PURE__ */
|
|
668
|
-
size:
|
|
656
|
+
listClassName: "w-[200px]",
|
|
657
|
+
children: /* @__PURE__ */ B(x, {
|
|
658
|
+
ref: N,
|
|
659
|
+
icon: /* @__PURE__ */ B(W, {
|
|
660
|
+
size: g.SM,
|
|
669
661
|
className: Z.triggerIcon,
|
|
670
|
-
"aria-hidden": !0
|
|
662
|
+
"aria-hidden": !0,
|
|
663
|
+
stroke: _
|
|
671
664
|
}),
|
|
672
|
-
size:
|
|
673
|
-
"aria-label":
|
|
674
|
-
className:
|
|
665
|
+
size: y.Small,
|
|
666
|
+
"aria-label": c,
|
|
667
|
+
className: a(M && Z.triggerActive)
|
|
675
668
|
})
|
|
676
669
|
})
|
|
677
670
|
})]
|
|
678
671
|
});
|
|
679
|
-
},
|
|
680
|
-
let
|
|
681
|
-
if (
|
|
682
|
-
let
|
|
683
|
-
return /* @__PURE__ */
|
|
672
|
+
}, Ke = ({ index: e, style: t, rows: r, expandedGroups: i, onToggleGroup: a, listId: o, activeConversationId: s, searchQuery: c, onSelectConversation: l, getActions: u, onActionMenuOpen: d, actionsLabel: f, unreadIndicatorLabel: p, styles: m, draggingId: h, dragOverId: g, allowedDropGroups: _, onDragStart: v, onDragEnd: y, onDragOver: b, onDragLeave: x, onDrop: S }) => {
|
|
673
|
+
let C = r[e];
|
|
674
|
+
if (C.kind === X.Header) {
|
|
675
|
+
let r = C.groupKey === n.Pinned;
|
|
676
|
+
return /* @__PURE__ */ B("div", {
|
|
684
677
|
role: "presentation",
|
|
685
678
|
style: t,
|
|
686
679
|
className: e === 0 ? "pt-0" : "pt-8",
|
|
687
|
-
children: /* @__PURE__ */
|
|
688
|
-
label:
|
|
689
|
-
isExpanded:
|
|
690
|
-
onToggle: () =>
|
|
691
|
-
listId:
|
|
692
|
-
className:
|
|
693
|
-
dropZoneGroupKey:
|
|
694
|
-
isDragOver:
|
|
695
|
-
onDragOver:
|
|
696
|
-
onDragLeave:
|
|
697
|
-
onDrop:
|
|
680
|
+
children: /* @__PURE__ */ B(Q, {
|
|
681
|
+
label: C.label,
|
|
682
|
+
isExpanded: i.has(C.groupKey),
|
|
683
|
+
onToggle: () => a(C.groupKey),
|
|
684
|
+
listId: o,
|
|
685
|
+
className: m?.groupHeaderClassName,
|
|
686
|
+
dropZoneGroupKey: r ? n.Pinned : void 0,
|
|
687
|
+
isDragOver: r && g === n.Pinned,
|
|
688
|
+
onDragOver: r ? b : void 0,
|
|
689
|
+
onDragLeave: r ? x : void 0,
|
|
690
|
+
onDrop: r ? S : void 0
|
|
698
691
|
})
|
|
699
692
|
});
|
|
700
693
|
}
|
|
701
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ B("div", {
|
|
702
695
|
role: "presentation",
|
|
703
696
|
style: t,
|
|
704
697
|
className: "pt-1",
|
|
705
|
-
children: /* @__PURE__ */
|
|
706
|
-
item:
|
|
707
|
-
isActive:
|
|
708
|
-
searchQuery:
|
|
709
|
-
onSelectConversation:
|
|
710
|
-
getActions:
|
|
711
|
-
onActionMenuOpen:
|
|
712
|
-
actionsLabel:
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
698
|
+
children: /* @__PURE__ */ B(Ge, {
|
|
699
|
+
item: C.item,
|
|
700
|
+
isActive: C.item.id === s,
|
|
701
|
+
searchQuery: c,
|
|
702
|
+
onSelectConversation: l,
|
|
703
|
+
getActions: u,
|
|
704
|
+
onActionMenuOpen: d,
|
|
705
|
+
actionsLabel: f,
|
|
706
|
+
unreadIndicatorLabel: p,
|
|
707
|
+
itemTitleClassName: m?.itemTitleClassName,
|
|
708
|
+
itemIconBadgeClassName: m?.itemIconBadgeClassName,
|
|
709
|
+
taskBadgeClassName: m?.taskBadgeClassName,
|
|
710
|
+
rowGroupKey: C.groupKey,
|
|
711
|
+
rows: r,
|
|
712
|
+
draggingId: h,
|
|
713
|
+
dragOverId: g,
|
|
714
|
+
allowedDropGroups: _,
|
|
715
|
+
onDragStart: v,
|
|
716
|
+
onDragEnd: y,
|
|
717
|
+
onDragOver: b,
|
|
718
|
+
onDragLeave: x,
|
|
719
|
+
onDrop: S
|
|
726
720
|
})
|
|
727
721
|
});
|
|
728
|
-
},
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
]),
|
|
734
|
-
let { colors:
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}, [
|
|
738
|
-
let [
|
|
739
|
-
|
|
740
|
-
}, []),
|
|
741
|
-
|
|
722
|
+
}, qe = (e, t) => t === n.All ? !0 : e.source === t, Je = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ye = new Set([
|
|
723
|
+
n.Pinned,
|
|
724
|
+
n.MyChats,
|
|
725
|
+
n.Shared,
|
|
726
|
+
n.Organization
|
|
727
|
+
]), Xe = P(({ conversations: e, isLoading: t, isOpen: i, onSelectConversation: o, activeConversationId: s, labels: f, onNewChat: p, styles: m, className: h, isOverlay: g = !1, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, activeFilter: S, onActiveFilterChange: C, isFilterTabsHidden: w = !1, hiddenSources: T }) => {
|
|
728
|
+
let { colors: E, typography: k, newChatButton: A, searchWrapperClassName: j } = m ?? {}, { title: M, emptyLabel: ee, noResultsLabel: N, loadingLabel: te = "Loading conversations", newChatLabel: P, searchPlaceholder: re, searchClearLabel: ie, filterLabels: ae, groupLabels: H, actionsLabel: oe, unreadIndicatorLabel: se, closeAriaLabel: ce } = f, [U, le] = z(""), [ue, de] = z(n.All);
|
|
729
|
+
I(() => {
|
|
730
|
+
S != null && de(S);
|
|
731
|
+
}, [S]);
|
|
732
|
+
let W = L(() => T?.length ? e.filter((e) => e.source == null || !T.includes(e.source)) : e, [e, T]), [fe, pe] = z(() => Ye), [me, he] = z(5), ge = ne(), _e = R(null), G = R(null), [ve, ye] = z(null), [be, K] = z(null), [xe, Se] = z(null), q = R(null), J = R(null), Ce = F(({ height: e }) => {
|
|
733
|
+
he(Math.ceil(e / 36 * 2));
|
|
734
|
+
}, []), we = F((e) => {
|
|
735
|
+
le(e ?? "");
|
|
736
|
+
}, []), Te = F((e) => {
|
|
737
|
+
pe((t) => {
|
|
742
738
|
let n = new Set(t);
|
|
743
739
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
744
740
|
});
|
|
745
|
-
}, []),
|
|
746
|
-
|
|
747
|
-
}, []),
|
|
748
|
-
let
|
|
749
|
-
|
|
750
|
-
}, [
|
|
751
|
-
|
|
752
|
-
}, [
|
|
753
|
-
|
|
754
|
-
}, []),
|
|
755
|
-
|
|
756
|
-
}, []),
|
|
757
|
-
let r =
|
|
758
|
-
|
|
741
|
+
}, []), Ee = F(() => {
|
|
742
|
+
q.current = null, J.current = null, ye(null), K(null), Se(null);
|
|
743
|
+
}, []), De = F((e, t) => {
|
|
744
|
+
let n = ze(e, Re(t, e), W);
|
|
745
|
+
q.current = e, J.current = n, ye(e), Se(n);
|
|
746
|
+
}, [W]), Oe = F(() => {
|
|
747
|
+
Ee();
|
|
748
|
+
}, [Ee]), ke = F((e) => {
|
|
749
|
+
K(e);
|
|
750
|
+
}, []), Ae = F(() => {
|
|
751
|
+
K(null);
|
|
752
|
+
}, []), je = F((e, t, n) => {
|
|
753
|
+
let r = q.current, i = J.current;
|
|
754
|
+
Ee(), r != null && r !== e && i?.has(t) && x?.({
|
|
759
755
|
draggedId: r,
|
|
760
756
|
targetGroupKey: t,
|
|
761
757
|
afterId: n
|
|
762
758
|
});
|
|
763
|
-
}, [
|
|
764
|
-
"--cp-
|
|
765
|
-
"--
|
|
766
|
-
"--cp-
|
|
767
|
-
"--cp-
|
|
768
|
-
"--cp-
|
|
769
|
-
"--cp-text
|
|
770
|
-
"--cp-new-chat-
|
|
771
|
-
"--cp-
|
|
772
|
-
"--cp-
|
|
773
|
-
"--cp-trigger-
|
|
774
|
-
"--cp-trigger-icon":
|
|
775
|
-
"--cp-
|
|
776
|
-
"--cp-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
759
|
+
}, [Ee, x]), Me = r({
|
|
760
|
+
"--cp-item-hover": E?.itemHover,
|
|
761
|
+
"--cp-item-active": E?.itemActive,
|
|
762
|
+
"--cp-text": E?.text,
|
|
763
|
+
"--cp-text-secondary": E?.textSecondary,
|
|
764
|
+
"--cp-new-chat-bg": A?.background,
|
|
765
|
+
"--cp-new-chat-text": A?.text,
|
|
766
|
+
"--cp-new-chat-focus-outline": A?.focusOutline,
|
|
767
|
+
"--cp-drop-zone-ring": E?.dropZoneRing,
|
|
768
|
+
"--cp-trigger-bg": E?.triggerBackground,
|
|
769
|
+
"--cp-trigger-icon": E?.triggerIcon,
|
|
770
|
+
"--cp-trigger-icon-idle": E?.triggerIconIdle,
|
|
771
|
+
"--cp-skeleton-color": E?.skeletonColor,
|
|
772
|
+
"--cp-task-badge-border": E?.taskBadgeBorder,
|
|
773
|
+
"--cp-task-badge-bg": E?.taskBadgeBackground,
|
|
774
|
+
"--cp-task-badge-text": E?.taskBadgeText,
|
|
775
|
+
"--cp-unread-dot": E?.unreadDot
|
|
776
|
+
}), Y = L(() => W.filter((e) => qe(e, ue) && Je(e, U)), [
|
|
777
|
+
W,
|
|
778
|
+
ue,
|
|
780
779
|
U
|
|
781
|
-
]),
|
|
780
|
+
]), Fe = L(() => Y.filter((e) => e.isPinned), [Y]), Le = L(() => Y.filter((e) => !e.isPinned && e.source !== n.Shared && e.source !== n.Organization), [Y]), Be = L(() => Y.filter((e) => !e.isPinned && e.source === n.Shared), [Y]), Ve = L(() => Y.filter((e) => !e.isPinned && e.source === n.Organization), [Y]), Ue = L(() => [
|
|
782
781
|
{
|
|
783
|
-
key:
|
|
784
|
-
label:
|
|
785
|
-
items:
|
|
782
|
+
key: n.Pinned,
|
|
783
|
+
label: H?.pinned ?? "Pinned",
|
|
784
|
+
items: Fe
|
|
786
785
|
},
|
|
787
786
|
{
|
|
788
|
-
key:
|
|
789
|
-
label:
|
|
787
|
+
key: n.MyChats,
|
|
788
|
+
label: H?.myChats ?? "My chats",
|
|
790
789
|
items: Le
|
|
791
790
|
},
|
|
792
791
|
{
|
|
793
|
-
key:
|
|
794
|
-
label:
|
|
795
|
-
items:
|
|
792
|
+
key: n.Shared,
|
|
793
|
+
label: H?.shared ?? "Shared",
|
|
794
|
+
items: Be
|
|
796
795
|
},
|
|
797
796
|
{
|
|
798
|
-
key:
|
|
799
|
-
label:
|
|
800
|
-
items:
|
|
797
|
+
key: n.Organization,
|
|
798
|
+
label: H?.organization ?? "Organization",
|
|
799
|
+
items: Ve
|
|
801
800
|
}
|
|
802
801
|
], [
|
|
803
|
-
|
|
804
|
-
|
|
802
|
+
H,
|
|
803
|
+
Fe,
|
|
805
804
|
Le,
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
]),
|
|
805
|
+
Be,
|
|
806
|
+
Ve
|
|
807
|
+
]), Q = L(() => {
|
|
809
808
|
let e = [];
|
|
810
|
-
for (let t of
|
|
811
|
-
kind:
|
|
809
|
+
for (let t of Ue) if (t.items.length !== 0 && (e.push({
|
|
810
|
+
kind: X.Header,
|
|
812
811
|
groupKey: t.key,
|
|
813
812
|
label: t.label
|
|
814
|
-
}),
|
|
815
|
-
kind:
|
|
813
|
+
}), fe.has(t.key))) for (let n of t.items) e.push({
|
|
814
|
+
kind: X.Item,
|
|
816
815
|
item: n,
|
|
817
816
|
groupKey: t.key
|
|
818
817
|
});
|
|
819
818
|
return e;
|
|
820
|
-
}, [
|
|
821
|
-
|
|
822
|
-
if (!
|
|
823
|
-
let e =
|
|
824
|
-
e >= 0 && (
|
|
819
|
+
}, [Ue, fe]);
|
|
820
|
+
I(() => {
|
|
821
|
+
if (!s || G.current === s) return;
|
|
822
|
+
let e = Q.findIndex((e) => e.kind === X.Item && e.item.id === s);
|
|
823
|
+
e >= 0 && (_e.current?.scrollToRow({
|
|
825
824
|
index: e,
|
|
826
825
|
align: "smart",
|
|
827
826
|
behavior: "smooth"
|
|
828
|
-
}),
|
|
827
|
+
}), G.current = s);
|
|
829
828
|
}, [
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
829
|
+
s,
|
|
830
|
+
Ue,
|
|
831
|
+
fe,
|
|
832
|
+
Q
|
|
834
833
|
]);
|
|
835
|
-
let
|
|
836
|
-
rows:
|
|
837
|
-
expandedGroups:
|
|
838
|
-
onToggleGroup:
|
|
839
|
-
listId:
|
|
840
|
-
activeConversationId:
|
|
834
|
+
let Ge = L(() => ({
|
|
835
|
+
rows: Q,
|
|
836
|
+
expandedGroups: fe,
|
|
837
|
+
onToggleGroup: Te,
|
|
838
|
+
listId: ge,
|
|
839
|
+
activeConversationId: s,
|
|
841
840
|
searchQuery: U,
|
|
842
|
-
onSelectConversation:
|
|
841
|
+
onSelectConversation: o,
|
|
843
842
|
getActions: _,
|
|
844
843
|
onActionMenuOpen: v,
|
|
845
|
-
actionsLabel:
|
|
844
|
+
actionsLabel: oe,
|
|
845
|
+
unreadIndicatorLabel: se,
|
|
846
846
|
styles: {
|
|
847
|
-
groupHeaderClassName:
|
|
848
|
-
itemTitleClassName:
|
|
849
|
-
itemIconBadgeClassName:
|
|
850
|
-
taskBadgeClassName:
|
|
847
|
+
groupHeaderClassName: k?.groupHeaderClassName,
|
|
848
|
+
itemTitleClassName: k?.itemTitleClassName,
|
|
849
|
+
itemIconBadgeClassName: m?.itemIconBadgeClassName,
|
|
850
|
+
taskBadgeClassName: m?.taskBadgeClassName
|
|
851
851
|
},
|
|
852
|
-
draggingId:
|
|
853
|
-
dragOverId:
|
|
854
|
-
allowedDropGroups:
|
|
855
|
-
onDragStart: (e) =>
|
|
856
|
-
onDragEnd:
|
|
857
|
-
onDragOver:
|
|
858
|
-
onDragLeave:
|
|
859
|
-
onDrop:
|
|
852
|
+
draggingId: ve,
|
|
853
|
+
dragOverId: be,
|
|
854
|
+
allowedDropGroups: xe,
|
|
855
|
+
onDragStart: (e) => De(e, Q),
|
|
856
|
+
onDragEnd: Oe,
|
|
857
|
+
onDragOver: ke,
|
|
858
|
+
onDragLeave: Ae,
|
|
859
|
+
onDrop: je
|
|
860
860
|
}), [
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
861
|
+
Q,
|
|
862
|
+
fe,
|
|
863
|
+
Te,
|
|
864
|
+
ge,
|
|
865
|
+
s,
|
|
866
866
|
U,
|
|
867
|
-
|
|
867
|
+
o,
|
|
868
868
|
_,
|
|
869
869
|
v,
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
870
|
+
oe,
|
|
871
|
+
se,
|
|
872
|
+
k?.groupHeaderClassName,
|
|
873
|
+
k?.itemTitleClassName,
|
|
874
|
+
m?.itemIconBadgeClassName,
|
|
875
|
+
m?.taskBadgeClassName,
|
|
876
|
+
ve,
|
|
877
|
+
be,
|
|
878
|
+
xe,
|
|
879
|
+
De,
|
|
880
|
+
Oe,
|
|
881
|
+
ke,
|
|
878
882
|
Ae,
|
|
879
|
-
je
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
orientation: o.Left,
|
|
887
|
-
title: F,
|
|
883
|
+
je
|
|
884
|
+
]), Xe = W.length === 0, Ze = W.length > 0 && Y.length === 0;
|
|
885
|
+
return /* @__PURE__ */ V(d, {
|
|
886
|
+
isOpen: i,
|
|
887
|
+
isOverlay: g,
|
|
888
|
+
orientation: u.Left,
|
|
889
|
+
title: M,
|
|
888
890
|
labels: {
|
|
889
|
-
ariaLabel:
|
|
890
|
-
closeLabel:
|
|
891
|
+
ariaLabel: M,
|
|
892
|
+
closeLabel: ce
|
|
891
893
|
},
|
|
892
894
|
onClose: y,
|
|
893
895
|
styles: {
|
|
894
896
|
colors: {
|
|
895
|
-
background:
|
|
896
|
-
border:
|
|
897
|
+
background: E?.background,
|
|
898
|
+
border: E?.border
|
|
897
899
|
},
|
|
898
|
-
typography: { fontClassName:
|
|
900
|
+
typography: { fontClassName: k?.fontClassName },
|
|
899
901
|
bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
|
|
900
|
-
cssVars:
|
|
901
|
-
titleClassName:
|
|
902
|
+
cssVars: Me,
|
|
903
|
+
titleClassName: k?.fontClassName,
|
|
902
904
|
headerClassName: "h-[64px]",
|
|
903
|
-
className:
|
|
905
|
+
className: a(i ? "w-[324px] mobile:w-full" : "w-0", h)
|
|
904
906
|
},
|
|
905
907
|
rightActions: b,
|
|
906
908
|
children: [
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
label:
|
|
909
|
-
onClick:
|
|
910
|
-
labelClassName:
|
|
911
|
-
colors:
|
|
909
|
+
/* @__PURE__ */ B(We, {
|
|
910
|
+
label: P,
|
|
911
|
+
onClick: p,
|
|
912
|
+
labelClassName: k?.newChatLabelClassName,
|
|
913
|
+
colors: A
|
|
912
914
|
}),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
915
|
+
/* @__PURE__ */ B("div", {
|
|
916
|
+
role: "search",
|
|
917
|
+
className: "px-3 py-2",
|
|
918
|
+
children: /* @__PURE__ */ B(D, {
|
|
919
|
+
wrapperClassName: a(Z.search, j),
|
|
920
|
+
value: U,
|
|
921
|
+
onChange: we,
|
|
922
|
+
placeholder: re,
|
|
923
|
+
clearLabel: ie,
|
|
924
|
+
"aria-label": re
|
|
925
|
+
})
|
|
920
926
|
}),
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
activeTab:
|
|
923
|
-
labels:
|
|
927
|
+
!w && /* @__PURE__ */ B(He, {
|
|
928
|
+
activeTab: ue,
|
|
929
|
+
labels: ae,
|
|
924
930
|
onChange: (e) => {
|
|
925
|
-
|
|
931
|
+
de(e), C?.(e);
|
|
926
932
|
},
|
|
927
|
-
tabClassName:
|
|
933
|
+
tabClassName: k?.tabClassName,
|
|
934
|
+
hiddenSources: T
|
|
928
935
|
}),
|
|
929
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ B("span", {
|
|
930
937
|
role: "status",
|
|
931
938
|
"aria-live": "polite",
|
|
932
939
|
className: "sr-only",
|
|
933
|
-
children:
|
|
940
|
+
children: t ? te : Xe ? ee : Ze ? N : ""
|
|
934
941
|
}),
|
|
935
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ B("div", {
|
|
936
943
|
className: "flex-1 overflow-hidden px-2 py-1",
|
|
937
|
-
children:
|
|
944
|
+
children: t ? /* @__PURE__ */ B("div", {
|
|
938
945
|
className: "flex flex-col gap-3 px-2 py-3",
|
|
939
|
-
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */
|
|
946
|
+
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ B(O, {
|
|
940
947
|
avatar: { size: 24 },
|
|
941
|
-
showTitle: { width:
|
|
948
|
+
showTitle: { width: Pe(t) },
|
|
942
949
|
paragraph: !1,
|
|
943
950
|
active: !0,
|
|
944
951
|
color: Z.skeletonColor
|
|
945
952
|
}, t))
|
|
946
|
-
}) :
|
|
947
|
-
listRef:
|
|
948
|
-
id:
|
|
953
|
+
}) : Xe ? /* @__PURE__ */ B(c, { label: ee }) : Ze ? /* @__PURE__ */ B(l, { label: N }) : /* @__PURE__ */ B(Ne, {
|
|
954
|
+
listRef: _e,
|
|
955
|
+
id: ge,
|
|
949
956
|
role: "list",
|
|
950
957
|
style: { height: "100%" },
|
|
951
|
-
rowComponent:
|
|
952
|
-
rowCount:
|
|
953
|
-
rowHeight:
|
|
954
|
-
overscanCount:
|
|
955
|
-
onResize:
|
|
956
|
-
rowProps:
|
|
958
|
+
rowComponent: Ke,
|
|
959
|
+
rowCount: Q.length,
|
|
960
|
+
rowHeight: Ie,
|
|
961
|
+
overscanCount: me,
|
|
962
|
+
onResize: Ce,
|
|
963
|
+
rowProps: Ge
|
|
964
|
+
})
|
|
965
|
+
})
|
|
966
|
+
]
|
|
967
|
+
});
|
|
968
|
+
}), Ze = 8e3, Qe = "flex size-7 shrink-0 items-center justify-center", $ = {
|
|
969
|
+
root: "_root_11lia_1",
|
|
970
|
+
text: "_text_11lia_5",
|
|
971
|
+
textSecondary: "_textSecondary_11lia_9",
|
|
972
|
+
divider: "_divider_11lia_13",
|
|
973
|
+
successIcon: "_successIcon_11lia_17",
|
|
974
|
+
errorIcon: "_errorIcon_11lia_21",
|
|
975
|
+
failureCount: "_failureCount_11lia_25",
|
|
976
|
+
warningIcon: "_warningIcon_11lia_35"
|
|
977
|
+
}, $e = ({ title: e, failedCount: t, isCollapsed: n, jobsId: r, labels: i, styles: o, onToggleCollapse: s, onClose: c }) => {
|
|
978
|
+
let l = o?.typography;
|
|
979
|
+
return /* @__PURE__ */ V("div", {
|
|
980
|
+
className: a($.divider, "mx-4 flex items-center justify-between py-3"),
|
|
981
|
+
children: [/* @__PURE__ */ V("div", {
|
|
982
|
+
className: "flex min-w-0 items-center gap-2",
|
|
983
|
+
children: [/* @__PURE__ */ B("span", {
|
|
984
|
+
className: a($.text, "truncate", l?.titleClassName || "dial-small-paragraph-semi-text"),
|
|
985
|
+
children: e
|
|
986
|
+
}), t > 0 && /* @__PURE__ */ B("span", {
|
|
987
|
+
className: a($.failureCount, "inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1", l?.failureCountClassName || "dial-small-paragraph-semi-text"),
|
|
988
|
+
children: t
|
|
989
|
+
})]
|
|
990
|
+
}), /* @__PURE__ */ V("div", {
|
|
991
|
+
className: "flex shrink-0 items-center gap-1",
|
|
992
|
+
children: [/* @__PURE__ */ B(x, {
|
|
993
|
+
"aria-label": n ? i.expandQueueAriaLabel : i.collapseQueueAriaLabel,
|
|
994
|
+
size: y.Small,
|
|
995
|
+
"aria-expanded": !n,
|
|
996
|
+
"aria-controls": r,
|
|
997
|
+
icon: B(n ? ue : le, {
|
|
998
|
+
size: g.SM,
|
|
999
|
+
className: $.textSecondary,
|
|
1000
|
+
stroke: _,
|
|
1001
|
+
"aria-hidden": !0
|
|
1002
|
+
}),
|
|
1003
|
+
onClick: s,
|
|
1004
|
+
className: Qe
|
|
1005
|
+
}), /* @__PURE__ */ B(x, {
|
|
1006
|
+
"aria-label": i.closeQueueAriaLabel,
|
|
1007
|
+
size: y.Small,
|
|
1008
|
+
icon: /* @__PURE__ */ B(_e, {
|
|
1009
|
+
size: g.SM,
|
|
1010
|
+
className: $.textSecondary,
|
|
1011
|
+
stroke: _,
|
|
1012
|
+
"aria-hidden": !0
|
|
1013
|
+
}),
|
|
1014
|
+
onClick: c,
|
|
1015
|
+
className: Qe
|
|
1016
|
+
})]
|
|
1017
|
+
})]
|
|
1018
|
+
});
|
|
1019
|
+
}, et = [".dial", ".zip"], tt = (e) => {
|
|
1020
|
+
let t = e.toLowerCase();
|
|
1021
|
+
return et.some((e) => t.endsWith(e)) ? pe : t.endsWith(".json") ? me : fe;
|
|
1022
|
+
}, nt = ({ job: t, labels: n, onCancel: r, styles: i }) => {
|
|
1023
|
+
let o = i?.typography, s = tt(t.fileName), c = t.status === e.Canceled;
|
|
1024
|
+
return /* @__PURE__ */ V("div", {
|
|
1025
|
+
className: "group flex items-center gap-2 px-4 py-2",
|
|
1026
|
+
children: [
|
|
1027
|
+
/* @__PURE__ */ B(s, {
|
|
1028
|
+
size: g.SM,
|
|
1029
|
+
stroke: _,
|
|
1030
|
+
className: $.textSecondary,
|
|
1031
|
+
"aria-hidden": !0
|
|
1032
|
+
}),
|
|
1033
|
+
/* @__PURE__ */ B(b, {
|
|
1034
|
+
text: t.fileName,
|
|
1035
|
+
className: a(c ? $.textSecondary : $.text, o?.jobLabelClassName || "dial-small-text"),
|
|
1036
|
+
contentClassName: "!z-[80]"
|
|
1037
|
+
}),
|
|
1038
|
+
t.status === e.InProgress && /* @__PURE__ */ V("div", {
|
|
1039
|
+
className: a("flex size-7 shrink-0 items-center justify-center", "grid"),
|
|
1040
|
+
children: [/* @__PURE__ */ B(A, {
|
|
1041
|
+
size: g.SM,
|
|
1042
|
+
ariaLabel: n.jobProgressAriaLabel(t.fileName),
|
|
1043
|
+
className: "pointer-events-none col-start-1 row-start-1 opacity-100 transition-opacity group-focus-within:opacity-0 group-hover:opacity-0"
|
|
1044
|
+
}), /* @__PURE__ */ B(x, {
|
|
1045
|
+
"aria-label": n.cancelJobAriaLabel(t.fileName),
|
|
1046
|
+
size: y.Small,
|
|
1047
|
+
icon: /* @__PURE__ */ B(_e, {
|
|
1048
|
+
size: g.SM,
|
|
1049
|
+
className: $.textSecondary,
|
|
1050
|
+
stroke: _,
|
|
1051
|
+
"aria-hidden": !0
|
|
1052
|
+
}),
|
|
1053
|
+
onClick: () => r(t.id),
|
|
1054
|
+
className: "col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"
|
|
1055
|
+
})]
|
|
1056
|
+
}),
|
|
1057
|
+
t.status === e.Success && /* @__PURE__ */ B("span", {
|
|
1058
|
+
className: "flex size-7 shrink-0 items-center justify-center",
|
|
1059
|
+
children: /* @__PURE__ */ B(U, {
|
|
1060
|
+
size: g.SM,
|
|
1061
|
+
stroke: _,
|
|
1062
|
+
className: $.successIcon,
|
|
1063
|
+
"aria-hidden": !0
|
|
957
1064
|
})
|
|
1065
|
+
}),
|
|
1066
|
+
t.status === e.Warning && /* @__PURE__ */ B(ee, {
|
|
1067
|
+
tooltip: n.jobWarningMessage(t.warningCode),
|
|
1068
|
+
contentClassName: "!z-[80]",
|
|
1069
|
+
asChild: !0,
|
|
1070
|
+
children: /* @__PURE__ */ B("span", {
|
|
1071
|
+
className: "flex size-7 shrink-0 items-center justify-center",
|
|
1072
|
+
role: "img",
|
|
1073
|
+
"aria-label": n.jobWarningMessage(t.warningCode),
|
|
1074
|
+
tabIndex: 0,
|
|
1075
|
+
children: /* @__PURE__ */ B(oe, {
|
|
1076
|
+
size: g.SM,
|
|
1077
|
+
className: $.warningIcon,
|
|
1078
|
+
"aria-hidden": !0
|
|
1079
|
+
})
|
|
1080
|
+
})
|
|
1081
|
+
}),
|
|
1082
|
+
t.status === e.Failed && /* @__PURE__ */ B(ee, {
|
|
1083
|
+
tooltip: n.jobErrorMessage(t.errorCode),
|
|
1084
|
+
contentClassName: "!z-[80]",
|
|
1085
|
+
asChild: !0,
|
|
1086
|
+
children: /* @__PURE__ */ B("span", {
|
|
1087
|
+
className: "flex size-7 shrink-0 items-center justify-center",
|
|
1088
|
+
role: "img",
|
|
1089
|
+
"aria-label": n.jobErrorMessage(t.errorCode),
|
|
1090
|
+
tabIndex: 0,
|
|
1091
|
+
children: /* @__PURE__ */ B(H, {
|
|
1092
|
+
size: g.SM,
|
|
1093
|
+
className: $.errorIcon,
|
|
1094
|
+
"aria-hidden": !0
|
|
1095
|
+
})
|
|
1096
|
+
})
|
|
1097
|
+
}),
|
|
1098
|
+
c && /* @__PURE__ */ B("span", {
|
|
1099
|
+
className: a($.textSecondary, "shrink-0", o?.canceledLabelClassName || "dial-small-text"),
|
|
1100
|
+
children: n.canceledLabel
|
|
958
1101
|
})
|
|
959
1102
|
]
|
|
960
1103
|
});
|
|
1104
|
+
}, rt = (e) => Math.round(e.reduce((e, t) => e + t.progress.percent, 0) / e.length), it = (t) => t.filter((t) => t.status !== e.InProgress).length, at = (e, t, n) => e && t ? n.closeQueueConfirmDescriptionMixed : t ? n.closeQueueConfirmDescriptionFailed : n.closeQueueConfirmDescriptionInProgress, ot = P(({ title: t, jobs: n, onClose: i, onCancel: o, labels: s, styles: c }) => {
|
|
1105
|
+
let [l, u] = z(!1), d = ne(), [f, p] = z(!1), g = c?.colors, _ = {
|
|
1106
|
+
...r({
|
|
1107
|
+
"--cp-transfer-queue-bg": g?.background,
|
|
1108
|
+
"--cp-transfer-queue-text": g?.text,
|
|
1109
|
+
"--cp-transfer-queue-text-secondary": g?.textSecondary,
|
|
1110
|
+
"--cp-transfer-queue-success-icon": g?.successIcon,
|
|
1111
|
+
"--cp-transfer-queue-error-icon": g?.errorIcon,
|
|
1112
|
+
"--cp-transfer-queue-warning-icon": g?.warningIcon,
|
|
1113
|
+
"--cp-transfer-queue-divider": g?.divider,
|
|
1114
|
+
"--cp-transfer-queue-failure-count-bg": g?.failureCountBackground,
|
|
1115
|
+
"--cp-transfer-queue-failure-count-text": g?.failureCountText
|
|
1116
|
+
}),
|
|
1117
|
+
...c?.cssVars
|
|
1118
|
+
}, v = n.some((t) => t.status === e.InProgress), b = n.some((t) => t.status === e.Failed), x = n.length > 0 && n.every((t) => t.status === e.Success), S = F(() => {
|
|
1119
|
+
v || b ? p(!0) : i();
|
|
1120
|
+
}, [
|
|
1121
|
+
v,
|
|
1122
|
+
b,
|
|
1123
|
+
i
|
|
1124
|
+
]), C = F(() => {
|
|
1125
|
+
p(!1), i();
|
|
1126
|
+
}, [i]), w = F(() => {
|
|
1127
|
+
u((e) => !e);
|
|
1128
|
+
}, []);
|
|
1129
|
+
if (I(() => {
|
|
1130
|
+
if (!x) return;
|
|
1131
|
+
let e = setTimeout(i, Ze);
|
|
1132
|
+
return () => clearTimeout(e);
|
|
1133
|
+
}, [x, i]), n.length === 0) return null;
|
|
1134
|
+
let T = n.filter((t) => t.status === e.Failed).length;
|
|
1135
|
+
return /* @__PURE__ */ V("div", {
|
|
1136
|
+
role: "status",
|
|
1137
|
+
"aria-live": "polite",
|
|
1138
|
+
style: _,
|
|
1139
|
+
className: a($.root, "w-[370px] max-w-[calc(100vw-2rem)] rounded-xl shadow-md", c?.rootClassName),
|
|
1140
|
+
children: [
|
|
1141
|
+
/* @__PURE__ */ B($e, {
|
|
1142
|
+
title: t,
|
|
1143
|
+
failedCount: T,
|
|
1144
|
+
isCollapsed: l,
|
|
1145
|
+
jobsId: d,
|
|
1146
|
+
labels: s,
|
|
1147
|
+
styles: c,
|
|
1148
|
+
onToggleCollapse: w,
|
|
1149
|
+
onClose: S
|
|
1150
|
+
}),
|
|
1151
|
+
l && v && /* @__PURE__ */ B(E, {
|
|
1152
|
+
value: rt(n),
|
|
1153
|
+
size: y.Small,
|
|
1154
|
+
"aria-label": s.queueProgressAriaLabel,
|
|
1155
|
+
"aria-valuetext": s.queueProgressValueText(it(n), n.length)
|
|
1156
|
+
}),
|
|
1157
|
+
!l && /* @__PURE__ */ B("div", {
|
|
1158
|
+
id: d,
|
|
1159
|
+
className: a("flex max-h-[40vh] flex-col overflow-y-auto py-1", c?.bodyClassName),
|
|
1160
|
+
children: n.map((e) => /* @__PURE__ */ B(nt, {
|
|
1161
|
+
job: e,
|
|
1162
|
+
labels: s,
|
|
1163
|
+
onCancel: o,
|
|
1164
|
+
styles: c
|
|
1165
|
+
}, e.id))
|
|
1166
|
+
}),
|
|
1167
|
+
/* @__PURE__ */ B(m, {
|
|
1168
|
+
open: f,
|
|
1169
|
+
header: s.closeQueueConfirmHeader,
|
|
1170
|
+
description: at(v, b, s),
|
|
1171
|
+
confirmLabel: s.closeLabel,
|
|
1172
|
+
cancelLabel: s.cancelLabel,
|
|
1173
|
+
variant: h.Danger,
|
|
1174
|
+
onConfirm: C,
|
|
1175
|
+
onClose: () => p(!1)
|
|
1176
|
+
})
|
|
1177
|
+
]
|
|
1178
|
+
});
|
|
1179
|
+
});
|
|
1180
|
+
ot.displayName = "ImportExportQueue";
|
|
1181
|
+
//#endregion
|
|
1182
|
+
//#region src/components/RenameConversationPopup/RenameConversationPopup.tsx
|
|
1183
|
+
var st = P(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
|
|
1184
|
+
let [f, m] = z(t), [h, v] = z(!1), [y, b] = z(null), S = R(null), E = R(!1), D = R(0);
|
|
1185
|
+
I(() => {
|
|
1186
|
+
let n = e && !E.current;
|
|
1187
|
+
if (E.current = e, !e) {
|
|
1188
|
+
D.current += 1, v(!1);
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
if (!n) return;
|
|
1192
|
+
D.current += 1, m(t), b(null), v(!1);
|
|
1193
|
+
let r = setTimeout(() => S.current?.focus(), 0);
|
|
1194
|
+
return () => clearTimeout(r);
|
|
1195
|
+
}, [e, t]), I(() => () => {
|
|
1196
|
+
D.current += 1;
|
|
1197
|
+
}, []);
|
|
1198
|
+
let O = s(f.trim()), k = i(O) > 255, j = n || O === "" || O === t.trim() || k, M = F(() => {
|
|
1199
|
+
j || a(O);
|
|
1200
|
+
}, [
|
|
1201
|
+
j,
|
|
1202
|
+
a,
|
|
1203
|
+
O
|
|
1204
|
+
]), ee = F((e) => {
|
|
1205
|
+
e.key === "Enter" && M();
|
|
1206
|
+
}, [M]), N = F(async () => {
|
|
1207
|
+
if (h) return;
|
|
1208
|
+
let e = ++D.current;
|
|
1209
|
+
v(!0), b(null);
|
|
1210
|
+
try {
|
|
1211
|
+
let t = await l();
|
|
1212
|
+
if (e !== D.current) return;
|
|
1213
|
+
m(o(t));
|
|
1214
|
+
} catch {
|
|
1215
|
+
if (e !== D.current) return;
|
|
1216
|
+
b(u.renameWithAiError);
|
|
1217
|
+
} finally {
|
|
1218
|
+
e === D.current && v(!1);
|
|
1219
|
+
}
|
|
1220
|
+
}, [
|
|
1221
|
+
h,
|
|
1222
|
+
l,
|
|
1223
|
+
u.renameWithAiError
|
|
1224
|
+
]), te;
|
|
1225
|
+
return te = k ? u.nameTooLongError : y ?? r ?? void 0, /* @__PURE__ */ B(w, {
|
|
1226
|
+
open: e,
|
|
1227
|
+
header: u.popupTitle,
|
|
1228
|
+
size: T.Sm,
|
|
1229
|
+
onClose: c,
|
|
1230
|
+
mainButtons: n ? void 0 : [{
|
|
1231
|
+
label: u.cancelLabel,
|
|
1232
|
+
onClick: c
|
|
1233
|
+
}, {
|
|
1234
|
+
label: u.saveLabel,
|
|
1235
|
+
variant: p.Primary,
|
|
1236
|
+
disabled: j,
|
|
1237
|
+
onClick: M
|
|
1238
|
+
}],
|
|
1239
|
+
children: /* @__PURE__ */ B("div", {
|
|
1240
|
+
className: d?.bodyClassName,
|
|
1241
|
+
style: d?.cssVars,
|
|
1242
|
+
children: n ? /* @__PURE__ */ B("div", {
|
|
1243
|
+
className: "h-[120px] px-6 py-4",
|
|
1244
|
+
children: /* @__PURE__ */ B(A, { size: 50 })
|
|
1245
|
+
}) : /* @__PURE__ */ V("div", {
|
|
1246
|
+
className: "flex items-start gap-2 px-6 py-3",
|
|
1247
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1248
|
+
className: "min-w-0 flex-1",
|
|
1249
|
+
children: /* @__PURE__ */ B(C, {
|
|
1250
|
+
inputRef: S,
|
|
1251
|
+
value: f,
|
|
1252
|
+
placeholder: u.inputPlaceholder,
|
|
1253
|
+
error: te,
|
|
1254
|
+
onChange: (e) => m(o(e ?? "")),
|
|
1255
|
+
onKeyDown: ee
|
|
1256
|
+
})
|
|
1257
|
+
}), /* @__PURE__ */ B(x, {
|
|
1258
|
+
"aria-label": u.renameWithAiLabel,
|
|
1259
|
+
tooltipProps: { tooltip: u.renameWithAiLabel },
|
|
1260
|
+
disabled: h || n,
|
|
1261
|
+
onClick: N,
|
|
1262
|
+
icon: h ? /* @__PURE__ */ B(A, { size: g.MD }) : /* @__PURE__ */ B(ge, {
|
|
1263
|
+
size: g.MD,
|
|
1264
|
+
stroke: _
|
|
1265
|
+
})
|
|
1266
|
+
})]
|
|
1267
|
+
})
|
|
1268
|
+
})
|
|
1269
|
+
});
|
|
961
1270
|
});
|
|
1271
|
+
st.displayName = "RenameConversationPopup";
|
|
962
1272
|
//#endregion
|
|
963
|
-
export {
|
|
1273
|
+
export { Xe as ConversationPanel, ot as ImportExportQueue, st as RenameConversationPopup, tt as getTransferFileIcon };
|