@epam/ai-dial-conversation-panel 1.2.0-dev.50 → 1.2.0-dev.58
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/FilterTabs/FilterTabs.d.ts +5 -0
- package/components/FilterTabs/FilterTabs.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +316 -319
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
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
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,
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { Fragment as ae, jsx as
|
|
6
|
-
import { IconAlertCircleFilled as
|
|
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, FilterChips as x, GhostIconButton as S, Highlight as C, Input as w, Popup as T, PopupSize as E, ProgressBar as D, Search as O, Skeleton as ee, SkeletonVariant as k, Spinner as A, Tooltip as j, mergeClasses as te } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { createElement as M, memo as N, useCallback as P, useEffect as F, useId as ne, useImperativeHandle as re, useLayoutEffect as ie, useMemo as I, useRef as L, useState as R } from "react";
|
|
5
|
+
import { Fragment as ae, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
6
|
+
import { IconAlertCircleFilled as oe, IconAlertTriangleFilled as V, IconCaretDownFilled as se, IconCaretRightFilled as ce, IconCheck as le, IconChevronDown as H, IconChevronUp as ue, IconClock as de, IconDotsVertical as fe, IconFile as U, IconFileZip as W, IconJson as pe, IconPlus as me, IconSparkles as he, IconX as ge } from "@tabler/icons-react";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
|
-
var
|
|
8
|
+
var _e = {
|
|
9
9
|
newChatButton: "dial-cp-new-chat-button",
|
|
10
10
|
search: "dial-cp-search"
|
|
11
|
-
}, G = typeof window < "u" ? ie :
|
|
12
|
-
function
|
|
11
|
+
}, G = typeof window < "u" ? ie : F;
|
|
12
|
+
function ve(e) {
|
|
13
13
|
if (e !== void 0) switch (typeof e) {
|
|
14
14
|
case "number": return e;
|
|
15
15
|
case "string":
|
|
@@ -17,11 +17,11 @@ function ye(e) {
|
|
|
17
17
|
break;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
let { styleHeight: s, styleWidth: c } =
|
|
22
|
-
styleHeight:
|
|
23
|
-
styleWidth:
|
|
24
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
20
|
+
function ye({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
21
|
+
let { styleHeight: s, styleWidth: c } = I(() => ({
|
|
22
|
+
styleHeight: ve(o?.height),
|
|
23
|
+
styleWidth: ve(o?.width)
|
|
24
|
+
}), [o?.height, o?.width]), [l, u] = R({
|
|
25
25
|
height: t,
|
|
26
26
|
width: n
|
|
27
27
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
@@ -45,7 +45,7 @@ function be({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
45
45
|
i,
|
|
46
46
|
s,
|
|
47
47
|
c
|
|
48
|
-
]),
|
|
48
|
+
]), I(() => ({
|
|
49
49
|
height: s ?? l.height,
|
|
50
50
|
width: c ?? l.width
|
|
51
51
|
}), [
|
|
@@ -54,16 +54,16 @@ function be({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
54
54
|
c
|
|
55
55
|
]);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
let t =
|
|
57
|
+
function be(e) {
|
|
58
|
+
let t = L(() => {
|
|
59
59
|
throw Error("Cannot call during render.");
|
|
60
60
|
});
|
|
61
61
|
return G(() => {
|
|
62
62
|
t.current = e;
|
|
63
|
-
}, [e]),
|
|
63
|
+
}, [e]), P((e) => t.current?.(e), [t]);
|
|
64
64
|
}
|
|
65
65
|
var K = null;
|
|
66
|
-
function
|
|
66
|
+
function xe(e = !1) {
|
|
67
67
|
if (K === null || e) {
|
|
68
68
|
let e = document.createElement("div"), t = e.style;
|
|
69
69
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
@@ -72,8 +72,8 @@ function Se(e = !1) {
|
|
|
72
72
|
}
|
|
73
73
|
return K;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
if (t === "horizontal" && n) switch (
|
|
75
|
+
function Se({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
76
|
+
if (t === "horizontal" && n) switch (xe()) {
|
|
77
77
|
case "negative": return -r;
|
|
78
78
|
case "positive-descending":
|
|
79
79
|
if (e) {
|
|
@@ -93,7 +93,7 @@ function J(e, t) {
|
|
|
93
93
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
94
94
|
return !0;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Ce({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
97
97
|
if (t === 0) return 0;
|
|
98
98
|
if (typeof n == "number") return t * n;
|
|
99
99
|
{
|
|
@@ -101,9 +101,9 @@ function we({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
|
101
101
|
return q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function we({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
105
105
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
106
|
-
let s =
|
|
106
|
+
let s = Ce({
|
|
107
107
|
cachedBounds: t,
|
|
108
108
|
itemCount: r,
|
|
109
109
|
itemSize: i
|
|
@@ -115,7 +115,7 @@ function Te({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
115
115
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Te({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
119
119
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
120
120
|
for (; u < a;) {
|
|
121
121
|
let n = e.get(u);
|
|
@@ -134,7 +134,7 @@ function Ee({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
134
134
|
stopIndexOverscan: l
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function Ee({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
138
138
|
let r = /* @__PURE__ */ new Map();
|
|
139
139
|
return {
|
|
140
140
|
get(i) {
|
|
@@ -171,8 +171,8 @@ function De({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
174
|
+
function De({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
175
|
+
return I(() => Ee({
|
|
176
176
|
itemCount: e,
|
|
177
177
|
itemProps: t,
|
|
178
178
|
itemSize: n
|
|
@@ -182,7 +182,7 @@ function Oe({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
182
182
|
n
|
|
183
183
|
]);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Oe({ containerSize: e, itemSize: t }) {
|
|
186
186
|
let n;
|
|
187
187
|
switch (typeof t) {
|
|
188
188
|
case "string":
|
|
@@ -194,17 +194,17 @@ function ke({ containerSize: e, itemSize: t }) {
|
|
|
194
194
|
}
|
|
195
195
|
return n;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
let { height: u = n, width: d = n } =
|
|
197
|
+
function ke({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
198
|
+
let { height: u = n, width: d = n } = ye({
|
|
199
199
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
200
200
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
201
201
|
element: e,
|
|
202
202
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
203
203
|
style: t
|
|
204
|
-
}), f =
|
|
204
|
+
}), f = L({
|
|
205
205
|
height: 0,
|
|
206
206
|
width: 0
|
|
207
|
-
}), p = r === "vertical" ? u : d, m =
|
|
207
|
+
}), p = r === "vertical" ? u : d, m = Oe({
|
|
208
208
|
containerSize: p,
|
|
209
209
|
itemSize: s
|
|
210
210
|
});
|
|
@@ -221,11 +221,11 @@ function Ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
221
221
|
c,
|
|
222
222
|
d
|
|
223
223
|
]);
|
|
224
|
-
let h =
|
|
224
|
+
let h = De({
|
|
225
225
|
itemCount: a,
|
|
226
226
|
itemProps: o,
|
|
227
227
|
itemSize: m
|
|
228
|
-
}), g =
|
|
228
|
+
}), g = P((e) => h.get(e), [h]), [_, v] = R(() => Te({
|
|
229
229
|
cachedBounds: h,
|
|
230
230
|
containerScrollOffset: 0,
|
|
231
231
|
containerSize: p,
|
|
@@ -236,7 +236,7 @@ function Ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
236
236
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
237
237
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
238
238
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
239
|
-
}, C =
|
|
239
|
+
}, C = P(() => Ce({
|
|
240
240
|
cachedBounds: h,
|
|
241
241
|
itemCount: a,
|
|
242
242
|
itemSize: m
|
|
@@ -244,9 +244,9 @@ function Ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
244
244
|
h,
|
|
245
245
|
a,
|
|
246
246
|
m
|
|
247
|
-
]), w =
|
|
247
|
+
]), w = P((t) => Te({
|
|
248
248
|
cachedBounds: h,
|
|
249
|
-
containerScrollOffset:
|
|
249
|
+
containerScrollOffset: Se({
|
|
250
250
|
containerElement: e,
|
|
251
251
|
direction: r,
|
|
252
252
|
isRtl: i,
|
|
@@ -274,9 +274,9 @@ function Ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
274
274
|
if (!e) return;
|
|
275
275
|
let t = () => {
|
|
276
276
|
v((t) => {
|
|
277
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
277
|
+
let { scrollLeft: n, scrollTop: o } = e, s = Te({
|
|
278
278
|
cachedBounds: h,
|
|
279
|
-
containerScrollOffset:
|
|
279
|
+
containerScrollOffset: Se({
|
|
280
280
|
containerElement: e,
|
|
281
281
|
direction: r,
|
|
282
282
|
isRtl: i,
|
|
@@ -302,8 +302,8 @@ function Ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
302
302
|
]), {
|
|
303
303
|
getCellBounds: g,
|
|
304
304
|
getEstimatedSize: C,
|
|
305
|
-
scrollToIndex:
|
|
306
|
-
let s =
|
|
305
|
+
scrollToIndex: be(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
306
|
+
let s = we({
|
|
307
307
|
align: t,
|
|
308
308
|
cachedBounds: h,
|
|
309
309
|
containerScrollOffset: n,
|
|
@@ -313,7 +313,7 @@ function Ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
313
313
|
itemSize: m
|
|
314
314
|
});
|
|
315
315
|
if (e) {
|
|
316
|
-
if (s =
|
|
316
|
+
if (s = Se({
|
|
317
317
|
containerElement: e,
|
|
318
318
|
direction: r,
|
|
319
319
|
isRtl: i,
|
|
@@ -331,26 +331,26 @@ function Ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
331
331
|
stopIndexVisible: x
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
return
|
|
334
|
+
function Ae(e) {
|
|
335
|
+
return I(() => e, Object.values(e));
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function je(e, t) {
|
|
338
338
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
339
339
|
return J(n, a) && J(r, o) && J(i, s);
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function Me(e) {
|
|
342
342
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
343
343
|
}
|
|
344
|
-
var
|
|
344
|
+
var Ne = "data-react-window-index";
|
|
345
345
|
function Pe({ 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 }) {
|
|
346
|
-
let m =
|
|
346
|
+
let m = Ae(u), h = I(() => N(s, je), [s]), [g, _] = R(null), v = Me(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = ke({
|
|
347
347
|
containerElement: g,
|
|
348
348
|
containerStyle: f,
|
|
349
349
|
defaultContainerSize: n,
|
|
350
350
|
direction: "vertical",
|
|
351
351
|
itemCount: c,
|
|
352
352
|
itemProps: m,
|
|
353
|
-
itemSize:
|
|
353
|
+
itemSize: I(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
354
354
|
onResize: i,
|
|
355
355
|
overscanCount: o
|
|
356
356
|
});
|
|
@@ -374,7 +374,7 @@ function Pe({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
374
374
|
let e = Array.from(g.children).filter((e, t) => {
|
|
375
375
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
376
376
|
let n = `${S + t}`;
|
|
377
|
-
return e.setAttribute(
|
|
377
|
+
return e.setAttribute(Ne, n), !0;
|
|
378
378
|
});
|
|
379
379
|
if (v) return l.observeRowElements(e);
|
|
380
380
|
}, [
|
|
@@ -383,7 +383,7 @@ function Pe({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
383
383
|
l,
|
|
384
384
|
S,
|
|
385
385
|
w
|
|
386
|
-
]),
|
|
386
|
+
]), F(() => {
|
|
387
387
|
S >= 0 && w >= 0 && a && a({
|
|
388
388
|
startIndex: C,
|
|
389
389
|
stopIndex: T
|
|
@@ -398,11 +398,11 @@ function Pe({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
398
398
|
w,
|
|
399
399
|
T
|
|
400
400
|
]);
|
|
401
|
-
let E =
|
|
401
|
+
let E = I(() => {
|
|
402
402
|
let e = [];
|
|
403
403
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
404
404
|
let n = y(t);
|
|
405
|
-
e.push(/* @__PURE__ */
|
|
405
|
+
e.push(/* @__PURE__ */ M(h, {
|
|
406
406
|
...m,
|
|
407
407
|
ariaAttributes: {
|
|
408
408
|
"aria-posinset": t + 1,
|
|
@@ -429,7 +429,7 @@ function Pe({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
429
429
|
m,
|
|
430
430
|
S,
|
|
431
431
|
w
|
|
432
|
-
]), D = /* @__PURE__ */
|
|
432
|
+
]), D = /* @__PURE__ */ z("div", {
|
|
433
433
|
"aria-hidden": !0,
|
|
434
434
|
style: {
|
|
435
435
|
height: b(),
|
|
@@ -437,7 +437,7 @@ function Pe({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
437
437
|
zIndex: -1
|
|
438
438
|
}
|
|
439
439
|
});
|
|
440
|
-
return
|
|
440
|
+
return M(d, {
|
|
441
441
|
role: "list",
|
|
442
442
|
...p,
|
|
443
443
|
className: t,
|
|
@@ -453,37 +453,37 @@ function Pe({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
453
453
|
}
|
|
454
454
|
//#endregion
|
|
455
455
|
//#region src/types/virtual-row.ts
|
|
456
|
-
var
|
|
456
|
+
var Y = /* @__PURE__ */ function(e) {
|
|
457
457
|
return e.Header = "header", e.Item = "item", e;
|
|
458
|
-
}({}), Fe = (e) => `${60 + e * 23 % 35}%`,
|
|
458
|
+
}({}), Fe = (e) => `${60 + e * 23 % 35}%`, X = (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 === Y.Item ? 36 : e === 0 ? 24 : 56, Le = (e) => {
|
|
459
459
|
switch (e) {
|
|
460
460
|
case n.Shared: return n.Shared;
|
|
461
461
|
case n.Organization: return n.Organization;
|
|
462
462
|
default: return n.MyChats;
|
|
463
463
|
}
|
|
464
|
-
},
|
|
464
|
+
}, Re = (e, t) => {
|
|
465
465
|
let n = null;
|
|
466
|
-
for (let r of e) if (r.kind ===
|
|
466
|
+
for (let r of e) if (r.kind === Y.Header) n = r.groupKey;
|
|
467
467
|
else if (r.item.id === t) return n;
|
|
468
468
|
return null;
|
|
469
|
-
},
|
|
469
|
+
}, ze = (e, t, r) => {
|
|
470
470
|
let i = /* @__PURE__ */ new Set();
|
|
471
471
|
if (t != null && i.add(t), t === n.Pinned) {
|
|
472
472
|
let t = r.find((t) => t.id === e);
|
|
473
|
-
t && i.add(
|
|
473
|
+
t && i.add(Le(t.source));
|
|
474
474
|
} else i.add(n.Pinned);
|
|
475
475
|
return i;
|
|
476
|
-
},
|
|
476
|
+
}, Be = (e, t, n, r) => {
|
|
477
477
|
let i = e.currentTarget.getBoundingClientRect();
|
|
478
478
|
if (e.clientY >= i.top + i.height / 2) return t;
|
|
479
479
|
let a = null, o = !1;
|
|
480
|
-
for (let e of n) if (e.kind ===
|
|
480
|
+
for (let e of n) if (e.kind === Y.Header) o = e.groupKey === r;
|
|
481
481
|
else if (o) {
|
|
482
482
|
if (e.item.id === t) return a;
|
|
483
483
|
a = e.item.id;
|
|
484
484
|
}
|
|
485
485
|
return null;
|
|
486
|
-
},
|
|
486
|
+
}, Ve = [
|
|
487
487
|
{
|
|
488
488
|
value: n.All,
|
|
489
489
|
labelKey: "all"
|
|
@@ -500,37 +500,34 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
500
500
|
value: n.Organization,
|
|
501
501
|
labelKey: "organization"
|
|
502
502
|
}
|
|
503
|
-
],
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}, i))
|
|
516
|
-
});
|
|
517
|
-
}), We = { button: "_button_1vksy_1" }, Ge = P(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i }) => /* @__PURE__ */ B("div", {
|
|
503
|
+
], He = N(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => /* @__PURE__ */ z(x, {
|
|
504
|
+
items: I(() => Ve.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
|
|
505
|
+
value: e,
|
|
506
|
+
label: t[n]
|
|
507
|
+
})), [t, i]),
|
|
508
|
+
value: e,
|
|
509
|
+
onChange: n,
|
|
510
|
+
stretch: !0,
|
|
511
|
+
"aria-label": t.groupAriaLabel ?? "Filter chats",
|
|
512
|
+
className: "px-3 py-2",
|
|
513
|
+
chipClassName: te("!px-2", r)
|
|
514
|
+
})), Ue = { button: "_button_1vksy_1" }, We = N(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i }) => /* @__PURE__ */ z("div", {
|
|
518
515
|
className: "px-3 py-2",
|
|
519
516
|
style: r({
|
|
520
517
|
"--cp-new-chat-bg": i?.background,
|
|
521
518
|
"--cp-new-chat-text": i?.text,
|
|
522
519
|
"--cp-new-chat-focus-outline": i?.focusOutline
|
|
523
520
|
}),
|
|
524
|
-
children: /* @__PURE__ */
|
|
521
|
+
children: /* @__PURE__ */ B("button", {
|
|
525
522
|
onClick: t,
|
|
526
523
|
type: "button",
|
|
527
|
-
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",
|
|
528
|
-
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, _e.newChatButton),
|
|
525
|
+
children: [/* @__PURE__ */ z(me, {
|
|
529
526
|
size: 18,
|
|
530
527
|
stroke: _,
|
|
531
528
|
className: "shrink-0",
|
|
532
529
|
"aria-hidden": !0
|
|
533
|
-
}), /* @__PURE__ */
|
|
530
|
+
}), /* @__PURE__ */ z("span", {
|
|
534
531
|
className: n,
|
|
535
532
|
children: e
|
|
536
533
|
})]
|
|
@@ -546,9 +543,9 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
546
543
|
triggerIcon: "_triggerIcon_i3lsf_38",
|
|
547
544
|
unreadDot: "_unreadDot_i3lsf_46",
|
|
548
545
|
search: "_search_i3lsf_54"
|
|
549
|
-
},
|
|
546
|
+
}, Ge = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
|
|
550
547
|
let d = o != null;
|
|
551
|
-
return /* @__PURE__ */
|
|
548
|
+
return /* @__PURE__ */ B("button", {
|
|
552
549
|
type: "button",
|
|
553
550
|
"aria-expanded": t,
|
|
554
551
|
"aria-controls": r,
|
|
@@ -563,104 +560,104 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
563
560
|
d && (e.preventDefault(), u?.(o, o, null));
|
|
564
561
|
} : void 0,
|
|
565
562
|
className: a("group flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", i, Z.groupHeader, s && Z.dropZoneActive),
|
|
566
|
-
children: [t ? /* @__PURE__ */
|
|
563
|
+
children: [t ? /* @__PURE__ */ z(se, {
|
|
567
564
|
size: 12,
|
|
568
565
|
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
569
566
|
"aria-hidden": !0
|
|
570
|
-
}) : /* @__PURE__ */
|
|
567
|
+
}) : /* @__PURE__ */ z(ce, {
|
|
571
568
|
size: 12,
|
|
572
569
|
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
573
570
|
"aria-hidden": !0
|
|
574
|
-
}), /* @__PURE__ */
|
|
571
|
+
}), /* @__PURE__ */ z(b, { text: e })]
|
|
575
572
|
});
|
|
576
|
-
},
|
|
577
|
-
let [
|
|
578
|
-
|
|
579
|
-
}, [e, s]),
|
|
573
|
+
}, Q = ({ 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: x, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: D, onDragLeave: O, onDrop: A }) => {
|
|
574
|
+
let [j, te] = R(!1), M = L(null), N = P((t) => {
|
|
575
|
+
te(t), t && M.current && s?.(e, M.current);
|
|
576
|
+
}, [e, s]), F = o?.(e) ?? [], ne = F.length > 0, re = e.isIconLoading ? /* @__PURE__ */ z(ee, {
|
|
580
577
|
variant: k.Circular,
|
|
581
578
|
width: g.LG,
|
|
582
579
|
height: g.LG,
|
|
583
580
|
color: Z.skeletonColor,
|
|
584
581
|
"aria-hidden": !0
|
|
585
|
-
}) : /* @__PURE__ */
|
|
582
|
+
}) : /* @__PURE__ */ z(t, {
|
|
586
583
|
src: e.iconUrl,
|
|
587
584
|
size: g.LG,
|
|
588
585
|
initialsName: e.iconTooltip ?? "",
|
|
589
586
|
labels: { tooltip: e.iconTooltip },
|
|
590
587
|
styles: { badgeClassName: u }
|
|
591
|
-
}),
|
|
588
|
+
}), ie = /* @__PURE__ */ B("span", {
|
|
592
589
|
className: "flex shrink-0 items-center gap-0.5",
|
|
593
|
-
children: [/* @__PURE__ */
|
|
590
|
+
children: [/* @__PURE__ */ z("span", {
|
|
594
591
|
className: "relative flex size-3 shrink-0 items-center justify-center",
|
|
595
|
-
children: e.isUnread && /* @__PURE__ */
|
|
592
|
+
children: e.isUnread && /* @__PURE__ */ B(ae, { children: [/* @__PURE__ */ z("span", {
|
|
596
593
|
className: a("size-[5.33px] rounded-full", Z.unreadDot),
|
|
597
594
|
"aria-hidden": !0
|
|
598
|
-
}), /* @__PURE__ */
|
|
595
|
+
}), /* @__PURE__ */ z("span", {
|
|
599
596
|
className: "sr-only",
|
|
600
597
|
children: p
|
|
601
598
|
})] })
|
|
602
|
-
}),
|
|
603
|
-
}),
|
|
599
|
+
}), re]
|
|
600
|
+
}), I = X(ne, j), oe = e.showTaskBadge ? /* @__PURE__ */ B("span", {
|
|
604
601
|
className: a("flex h-5 shrink-0 items-center justify-center gap-0.5 rounded-full border pe-2 ps-1", Z.taskBadge, d),
|
|
605
|
-
children: [/* @__PURE__ */
|
|
602
|
+
children: [/* @__PURE__ */ z(de, {
|
|
606
603
|
size: 12,
|
|
607
604
|
"aria-hidden": !0,
|
|
608
605
|
stroke: _
|
|
609
606
|
}), e.taskBadgeLabel]
|
|
610
|
-
}) : void 0,
|
|
611
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
612
|
-
}, [
|
|
613
|
-
if (!m || !h || !
|
|
607
|
+
}) : void 0, V = m != null, se = P((e) => {
|
|
608
|
+
e.currentTarget.contains(e.relatedTarget) || O?.();
|
|
609
|
+
}, [O]), ce = P((t) => {
|
|
610
|
+
if (!m || !h || !A) return;
|
|
614
611
|
t.preventDefault();
|
|
615
|
-
let n =
|
|
616
|
-
|
|
612
|
+
let n = Be(t, e.id, h, m);
|
|
613
|
+
A(e.id, m, n);
|
|
617
614
|
}, [
|
|
618
615
|
e.id,
|
|
619
616
|
h,
|
|
620
617
|
m,
|
|
621
|
-
|
|
622
|
-
]),
|
|
623
|
-
return /* @__PURE__ */
|
|
624
|
-
className: a("group/conversation relative",
|
|
625
|
-
draggable:
|
|
626
|
-
onDragStart:
|
|
627
|
-
onDragEnd:
|
|
628
|
-
onDragOver:
|
|
618
|
+
A
|
|
619
|
+
]), le = e.id === b, H = e.id === x, ue = m != null && (w?.has(m) ?? !1), U = b != null;
|
|
620
|
+
return /* @__PURE__ */ B("li", {
|
|
621
|
+
className: a("group/conversation relative", le && "cursor-grabbing opacity-50", H && ue && "rounded", H && ue && Z.dropZoneActive, U && !le && !ue && "cursor-not-allowed"),
|
|
622
|
+
draggable: V || void 0,
|
|
623
|
+
onDragStart: V ? () => T?.(e.id) : void 0,
|
|
624
|
+
onDragEnd: V ? E : void 0,
|
|
625
|
+
onDragOver: V ? (t) => {
|
|
629
626
|
t.preventDefault(), D?.(e.id);
|
|
630
627
|
} : void 0,
|
|
631
|
-
onDragLeave:
|
|
632
|
-
onDrop:
|
|
633
|
-
children: [/* @__PURE__ */
|
|
628
|
+
onDragLeave: V ? se : void 0,
|
|
629
|
+
onDrop: V ? ce : void 0,
|
|
630
|
+
children: [/* @__PURE__ */ z("a", {
|
|
634
631
|
href: e.href,
|
|
635
632
|
className: "contents",
|
|
636
633
|
onClick: (t) => {
|
|
637
634
|
e.href && (t.preventDefault(), r(e.id));
|
|
638
635
|
},
|
|
639
|
-
children: /* @__PURE__ */
|
|
640
|
-
iconBefore:
|
|
641
|
-
label: /* @__PURE__ */
|
|
636
|
+
children: /* @__PURE__ */ z(f, {
|
|
637
|
+
iconBefore: ie,
|
|
638
|
+
label: /* @__PURE__ */ z(C, {
|
|
642
639
|
text: e.title,
|
|
643
640
|
query: i,
|
|
644
641
|
className: l,
|
|
645
642
|
maxLines: 1
|
|
646
643
|
}),
|
|
647
|
-
iconAfter:
|
|
644
|
+
iconAfter: oe,
|
|
648
645
|
textClassName: "min-w-0 flex-1",
|
|
649
646
|
"aria-current": n ? "page" : void 0,
|
|
650
647
|
onClick: e.href ? void 0 : () => r(e.id),
|
|
651
648
|
tabIndex: e.href ? -1 : void 0,
|
|
652
|
-
className: a("h-8 w-full justify-start gap-2 py-2 ps-0 after:pointer-events-none",
|
|
649
|
+
className: a("h-8 w-full justify-start gap-2 py-2 ps-0 after:pointer-events-none", I, Z.item, n && Z.itemActive, j && Z.itemActive)
|
|
653
650
|
})
|
|
654
|
-
}),
|
|
655
|
-
className: a("absolute inset-y-0 end-1 flex items-center",
|
|
656
|
-
children: /* @__PURE__ */
|
|
657
|
-
items:
|
|
658
|
-
onOpenChange:
|
|
651
|
+
}), ne && /* @__PURE__ */ z("div", {
|
|
652
|
+
className: a("absolute inset-y-0 end-1 flex items-center", j ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
|
|
653
|
+
children: /* @__PURE__ */ z(v, {
|
|
654
|
+
items: F,
|
|
655
|
+
onOpenChange: N,
|
|
659
656
|
matchReferenceWidth: !1,
|
|
660
657
|
listClassName: "w-[200px]",
|
|
661
|
-
children: /* @__PURE__ */
|
|
662
|
-
ref:
|
|
663
|
-
icon: /* @__PURE__ */
|
|
658
|
+
children: /* @__PURE__ */ z(S, {
|
|
659
|
+
ref: M,
|
|
660
|
+
icon: /* @__PURE__ */ z(fe, {
|
|
664
661
|
size: g.SM,
|
|
665
662
|
className: Z.triggerIcon,
|
|
666
663
|
"aria-hidden": !0,
|
|
@@ -668,20 +665,20 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
668
665
|
}),
|
|
669
666
|
size: y.Small,
|
|
670
667
|
"aria-label": c,
|
|
671
|
-
className: a(
|
|
668
|
+
className: a(j && Z.triggerActive)
|
|
672
669
|
})
|
|
673
670
|
})
|
|
674
671
|
})]
|
|
675
672
|
});
|
|
676
|
-
},
|
|
673
|
+
}, 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 }) => {
|
|
677
674
|
let C = r[e];
|
|
678
|
-
if (C.kind ===
|
|
675
|
+
if (C.kind === Y.Header) {
|
|
679
676
|
let r = C.groupKey === n.Pinned;
|
|
680
|
-
return /* @__PURE__ */
|
|
677
|
+
return /* @__PURE__ */ z("div", {
|
|
681
678
|
role: "presentation",
|
|
682
679
|
style: t,
|
|
683
680
|
className: e === 0 ? "pt-0" : "pt-8",
|
|
684
|
-
children: /* @__PURE__ */
|
|
681
|
+
children: /* @__PURE__ */ z(Ge, {
|
|
685
682
|
label: C.label,
|
|
686
683
|
isExpanded: i.has(C.groupKey),
|
|
687
684
|
onToggle: () => a(C.groupKey),
|
|
@@ -695,11 +692,11 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
695
692
|
})
|
|
696
693
|
});
|
|
697
694
|
}
|
|
698
|
-
return /* @__PURE__ */
|
|
695
|
+
return /* @__PURE__ */ z("div", {
|
|
699
696
|
role: "presentation",
|
|
700
697
|
style: t,
|
|
701
698
|
className: "pt-1",
|
|
702
|
-
children: /* @__PURE__ */
|
|
699
|
+
children: /* @__PURE__ */ z(Q, {
|
|
703
700
|
item: C.item,
|
|
704
701
|
isActive: C.item.id === s,
|
|
705
702
|
searchQuery: c,
|
|
@@ -723,38 +720,38 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
723
720
|
onDrop: S
|
|
724
721
|
})
|
|
725
722
|
});
|
|
726
|
-
},
|
|
723
|
+
}, qe = (e, t) => t === n.All ? !0 : e.source === t, Je = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ye = new Set([
|
|
727
724
|
n.Pinned,
|
|
728
725
|
n.MyChats,
|
|
729
726
|
n.Shared,
|
|
730
727
|
n.Organization
|
|
731
|
-
]),
|
|
732
|
-
let { colors: E, typography:
|
|
733
|
-
|
|
734
|
-
S != null &&
|
|
728
|
+
]), Xe = N(({ 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 }) => {
|
|
729
|
+
let { colors: E, typography: D, newChatButton: k, searchWrapperClassName: A } = m ?? {}, { title: j, emptyLabel: te, noResultsLabel: M, loadingLabel: N = "Loading conversations", newChatLabel: re, searchPlaceholder: ie, searchClearLabel: ae, filterLabels: oe, groupLabels: V, actionsLabel: se, unreadIndicatorLabel: ce, closeAriaLabel: le } = f, [H, ue] = R(""), [de, fe] = R(n.All);
|
|
730
|
+
F(() => {
|
|
731
|
+
S != null && fe(S);
|
|
735
732
|
}, [S]);
|
|
736
|
-
let
|
|
733
|
+
let U = I(() => T?.length ? e.filter((e) => e.source == null || !T.includes(e.source)) : e, [e, T]), [W, pe] = R(() => Ye), [me, he] = R(5), ge = ne(), G = L(null), ve = L(null), [ye, be] = R(null), [K, xe] = R(null), [Se, q] = R(null), J = L(null), Ce = L(null), we = P(({ height: e }) => {
|
|
737
734
|
he(Math.ceil(e / 36 * 2));
|
|
738
|
-
}, []), Te =
|
|
739
|
-
|
|
740
|
-
}, []), Ee =
|
|
735
|
+
}, []), Te = P((e) => {
|
|
736
|
+
ue(e ?? "");
|
|
737
|
+
}, []), Ee = P((e) => {
|
|
741
738
|
pe((t) => {
|
|
742
739
|
let n = new Set(t);
|
|
743
740
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
744
741
|
});
|
|
745
|
-
}, []), De =
|
|
746
|
-
|
|
747
|
-
}, []), Oe =
|
|
748
|
-
let n =
|
|
749
|
-
|
|
750
|
-
}, [
|
|
742
|
+
}, []), De = P(() => {
|
|
743
|
+
J.current = null, Ce.current = null, be(null), xe(null), q(null);
|
|
744
|
+
}, []), Oe = P((e, t) => {
|
|
745
|
+
let n = ze(e, Re(t, e), U);
|
|
746
|
+
J.current = e, Ce.current = n, be(e), q(n);
|
|
747
|
+
}, [U]), ke = P(() => {
|
|
751
748
|
De();
|
|
752
|
-
}, [De]), Ae =
|
|
753
|
-
|
|
754
|
-
}, []), je =
|
|
755
|
-
|
|
756
|
-
}, []), Me =
|
|
757
|
-
let r =
|
|
749
|
+
}, [De]), Ae = P((e) => {
|
|
750
|
+
xe(e);
|
|
751
|
+
}, []), je = P(() => {
|
|
752
|
+
xe(null);
|
|
753
|
+
}, []), Me = P((e, t, n) => {
|
|
754
|
+
let r = J.current, i = Ce.current;
|
|
758
755
|
De(), r != null && r !== e && i?.has(t) && x?.({
|
|
759
756
|
draggedId: r,
|
|
760
757
|
targetGroupKey: t,
|
|
@@ -765,9 +762,9 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
765
762
|
"--cp-item-active": E?.itemActive,
|
|
766
763
|
"--cp-text": E?.text,
|
|
767
764
|
"--cp-text-secondary": E?.textSecondary,
|
|
768
|
-
"--cp-new-chat-bg":
|
|
769
|
-
"--cp-new-chat-text":
|
|
770
|
-
"--cp-new-chat-focus-outline":
|
|
765
|
+
"--cp-new-chat-bg": k?.background,
|
|
766
|
+
"--cp-new-chat-text": k?.text,
|
|
767
|
+
"--cp-new-chat-focus-outline": k?.focusOutline,
|
|
771
768
|
"--cp-drop-zone-ring": E?.dropZoneRing,
|
|
772
769
|
"--cp-trigger-bg": E?.triggerBackground,
|
|
773
770
|
"--cp-trigger-icon": E?.triggerIcon,
|
|
@@ -777,84 +774,84 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
777
774
|
"--cp-task-badge-bg": E?.taskBadgeBackground,
|
|
778
775
|
"--cp-task-badge-text": E?.taskBadgeText,
|
|
779
776
|
"--cp-unread-dot": E?.unreadDot
|
|
780
|
-
}),
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
]),
|
|
777
|
+
}), X = I(() => U.filter((e) => qe(e, de) && Je(e, H)), [
|
|
778
|
+
U,
|
|
779
|
+
de,
|
|
780
|
+
H
|
|
781
|
+
]), Le = I(() => X.filter((e) => e.isPinned), [X]), Be = I(() => X.filter((e) => !e.isPinned && e.source !== n.Shared && e.source !== n.Organization), [X]), Ve = I(() => X.filter((e) => !e.isPinned && e.source === n.Shared), [X]), Ue = I(() => X.filter((e) => !e.isPinned && e.source === n.Organization), [X]), Ge = I(() => [
|
|
785
782
|
{
|
|
786
783
|
key: n.Pinned,
|
|
787
|
-
label:
|
|
788
|
-
items:
|
|
784
|
+
label: V?.pinned ?? "Pinned",
|
|
785
|
+
items: Le
|
|
789
786
|
},
|
|
790
787
|
{
|
|
791
788
|
key: n.MyChats,
|
|
792
|
-
label:
|
|
793
|
-
items:
|
|
789
|
+
label: V?.myChats ?? "My chats",
|
|
790
|
+
items: Be
|
|
794
791
|
},
|
|
795
792
|
{
|
|
796
793
|
key: n.Shared,
|
|
797
|
-
label:
|
|
794
|
+
label: V?.shared ?? "Shared",
|
|
798
795
|
items: Ve
|
|
799
796
|
},
|
|
800
797
|
{
|
|
801
798
|
key: n.Organization,
|
|
802
|
-
label:
|
|
803
|
-
items:
|
|
799
|
+
label: V?.organization ?? "Organization",
|
|
800
|
+
items: Ue
|
|
804
801
|
}
|
|
805
802
|
], [
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
803
|
+
V,
|
|
804
|
+
Le,
|
|
805
|
+
Be,
|
|
809
806
|
Ve,
|
|
810
|
-
|
|
811
|
-
]), Q =
|
|
807
|
+
Ue
|
|
808
|
+
]), Q = I(() => {
|
|
812
809
|
let e = [];
|
|
813
|
-
for (let t of
|
|
814
|
-
kind:
|
|
810
|
+
for (let t of Ge) if (t.items.length !== 0 && (e.push({
|
|
811
|
+
kind: Y.Header,
|
|
815
812
|
groupKey: t.key,
|
|
816
813
|
label: t.label
|
|
817
|
-
}),
|
|
818
|
-
kind:
|
|
814
|
+
}), W.has(t.key))) for (let n of t.items) e.push({
|
|
815
|
+
kind: Y.Item,
|
|
819
816
|
item: n,
|
|
820
817
|
groupKey: t.key
|
|
821
818
|
});
|
|
822
819
|
return e;
|
|
823
|
-
}, [
|
|
824
|
-
|
|
825
|
-
if (!s ||
|
|
826
|
-
let e = Q.findIndex((e) => e.kind ===
|
|
827
|
-
e >= 0 && (
|
|
820
|
+
}, [Ge, W]);
|
|
821
|
+
F(() => {
|
|
822
|
+
if (!s || ve.current === s) return;
|
|
823
|
+
let e = Q.findIndex((e) => e.kind === Y.Item && e.item.id === s);
|
|
824
|
+
e >= 0 && (G.current?.scrollToRow({
|
|
828
825
|
index: e,
|
|
829
826
|
align: "smart",
|
|
830
827
|
behavior: "smooth"
|
|
831
|
-
}),
|
|
828
|
+
}), ve.current = s);
|
|
832
829
|
}, [
|
|
833
830
|
s,
|
|
834
|
-
|
|
835
|
-
|
|
831
|
+
Ge,
|
|
832
|
+
W,
|
|
836
833
|
Q
|
|
837
834
|
]);
|
|
838
|
-
let
|
|
835
|
+
let Xe = I(() => ({
|
|
839
836
|
rows: Q,
|
|
840
|
-
expandedGroups:
|
|
837
|
+
expandedGroups: W,
|
|
841
838
|
onToggleGroup: Ee,
|
|
842
839
|
listId: ge,
|
|
843
840
|
activeConversationId: s,
|
|
844
|
-
searchQuery:
|
|
841
|
+
searchQuery: H,
|
|
845
842
|
onSelectConversation: o,
|
|
846
843
|
getActions: _,
|
|
847
844
|
onActionMenuOpen: v,
|
|
848
|
-
actionsLabel:
|
|
849
|
-
unreadIndicatorLabel:
|
|
845
|
+
actionsLabel: se,
|
|
846
|
+
unreadIndicatorLabel: ce,
|
|
850
847
|
styles: {
|
|
851
|
-
groupHeaderClassName:
|
|
852
|
-
itemTitleClassName:
|
|
848
|
+
groupHeaderClassName: D?.groupHeaderClassName,
|
|
849
|
+
itemTitleClassName: D?.itemTitleClassName,
|
|
853
850
|
itemIconBadgeClassName: m?.itemIconBadgeClassName,
|
|
854
851
|
taskBadgeClassName: m?.taskBadgeClassName
|
|
855
852
|
},
|
|
856
853
|
draggingId: ye,
|
|
857
|
-
dragOverId:
|
|
854
|
+
dragOverId: K,
|
|
858
855
|
allowedDropGroups: Se,
|
|
859
856
|
onDragStart: (e) => Oe(e, Q),
|
|
860
857
|
onDragEnd: ke,
|
|
@@ -863,37 +860,37 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
863
860
|
onDrop: Me
|
|
864
861
|
}), [
|
|
865
862
|
Q,
|
|
866
|
-
|
|
863
|
+
W,
|
|
867
864
|
Ee,
|
|
868
865
|
ge,
|
|
869
866
|
s,
|
|
870
|
-
|
|
867
|
+
H,
|
|
871
868
|
o,
|
|
872
869
|
_,
|
|
873
870
|
v,
|
|
874
|
-
oe,
|
|
875
871
|
se,
|
|
876
|
-
|
|
877
|
-
|
|
872
|
+
ce,
|
|
873
|
+
D?.groupHeaderClassName,
|
|
874
|
+
D?.itemTitleClassName,
|
|
878
875
|
m?.itemIconBadgeClassName,
|
|
879
876
|
m?.taskBadgeClassName,
|
|
880
877
|
ye,
|
|
881
|
-
|
|
878
|
+
K,
|
|
882
879
|
Se,
|
|
883
880
|
Oe,
|
|
884
881
|
ke,
|
|
885
882
|
Ae,
|
|
886
883
|
je,
|
|
887
884
|
Me
|
|
888
|
-
]), Ze =
|
|
889
|
-
return /* @__PURE__ */
|
|
885
|
+
]), Ze = U.length === 0, Qe = U.length > 0 && X.length === 0;
|
|
886
|
+
return /* @__PURE__ */ B(d, {
|
|
890
887
|
isOpen: i,
|
|
891
888
|
isOverlay: g,
|
|
892
889
|
orientation: u.Left,
|
|
893
|
-
title:
|
|
890
|
+
title: j,
|
|
894
891
|
labels: {
|
|
895
|
-
ariaLabel:
|
|
896
|
-
closeLabel:
|
|
892
|
+
ariaLabel: j,
|
|
893
|
+
closeLabel: le
|
|
897
894
|
},
|
|
898
895
|
onClose: y,
|
|
899
896
|
styles: {
|
|
@@ -901,75 +898,75 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
901
898
|
background: E?.background,
|
|
902
899
|
border: E?.border
|
|
903
900
|
},
|
|
904
|
-
typography: { fontClassName:
|
|
901
|
+
typography: { fontClassName: D?.fontClassName },
|
|
905
902
|
bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
|
|
906
903
|
cssVars: Ne,
|
|
907
|
-
titleClassName:
|
|
904
|
+
titleClassName: D?.fontClassName,
|
|
908
905
|
headerClassName: "h-[64px]",
|
|
909
906
|
className: a(i ? "w-[324px] mobile:w-full" : "w-0", h)
|
|
910
907
|
},
|
|
911
908
|
rightActions: b,
|
|
912
909
|
children: [
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
label:
|
|
910
|
+
/* @__PURE__ */ z(We, {
|
|
911
|
+
label: re,
|
|
915
912
|
onClick: p,
|
|
916
|
-
labelClassName:
|
|
917
|
-
colors:
|
|
913
|
+
labelClassName: D?.newChatLabelClassName,
|
|
914
|
+
colors: k
|
|
918
915
|
}),
|
|
919
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ z("div", {
|
|
920
917
|
role: "search",
|
|
921
|
-
className: a("px-3 py-2",
|
|
922
|
-
children: /* @__PURE__ */
|
|
923
|
-
wrapperClassName: a(Z.search,
|
|
924
|
-
value:
|
|
918
|
+
className: a("px-3 py-2", _e.search),
|
|
919
|
+
children: /* @__PURE__ */ z(O, {
|
|
920
|
+
wrapperClassName: a(Z.search, A),
|
|
921
|
+
value: H,
|
|
925
922
|
onChange: Te,
|
|
926
|
-
placeholder:
|
|
927
|
-
clearLabel:
|
|
928
|
-
"aria-label":
|
|
923
|
+
placeholder: ie,
|
|
924
|
+
clearLabel: ae,
|
|
925
|
+
"aria-label": ie
|
|
929
926
|
})
|
|
930
927
|
}),
|
|
931
|
-
!w && /* @__PURE__ */
|
|
932
|
-
activeTab:
|
|
933
|
-
labels:
|
|
928
|
+
!w && /* @__PURE__ */ z(He, {
|
|
929
|
+
activeTab: de,
|
|
930
|
+
labels: oe,
|
|
934
931
|
onChange: (e) => {
|
|
935
|
-
|
|
932
|
+
fe(e), C?.(e);
|
|
936
933
|
},
|
|
937
|
-
tabClassName:
|
|
934
|
+
tabClassName: D?.tabClassName,
|
|
938
935
|
hiddenSources: T
|
|
939
936
|
}),
|
|
940
|
-
/* @__PURE__ */
|
|
937
|
+
/* @__PURE__ */ z("span", {
|
|
941
938
|
role: "status",
|
|
942
939
|
"aria-live": "polite",
|
|
943
940
|
className: "sr-only",
|
|
944
|
-
children: t ?
|
|
941
|
+
children: t ? N : Ze ? te : Qe ? M : ""
|
|
945
942
|
}),
|
|
946
|
-
/* @__PURE__ */
|
|
943
|
+
/* @__PURE__ */ z("div", {
|
|
947
944
|
className: "flex-1 overflow-hidden py-1 pe-3 ps-2",
|
|
948
|
-
children: t ? /* @__PURE__ */
|
|
945
|
+
children: t ? /* @__PURE__ */ z("div", {
|
|
949
946
|
className: "flex flex-col gap-3 px-2 py-3",
|
|
950
|
-
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */
|
|
947
|
+
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ z(ee, {
|
|
951
948
|
avatar: { size: 24 },
|
|
952
949
|
showTitle: { width: Fe(t) },
|
|
953
950
|
paragraph: !1,
|
|
954
951
|
active: !0,
|
|
955
952
|
color: Z.skeletonColor
|
|
956
953
|
}, t))
|
|
957
|
-
}) : Ze ? /* @__PURE__ */
|
|
958
|
-
listRef:
|
|
954
|
+
}) : Ze ? /* @__PURE__ */ z(c, { label: te }) : Qe ? /* @__PURE__ */ z(l, { label: M }) : /* @__PURE__ */ z(Pe, {
|
|
955
|
+
listRef: G,
|
|
959
956
|
id: ge,
|
|
960
957
|
role: "list",
|
|
961
958
|
style: { height: "100%" },
|
|
962
|
-
rowComponent:
|
|
959
|
+
rowComponent: Ke,
|
|
963
960
|
rowCount: Q.length,
|
|
964
|
-
rowHeight:
|
|
961
|
+
rowHeight: Ie,
|
|
965
962
|
overscanCount: me,
|
|
966
963
|
onResize: we,
|
|
967
|
-
rowProps:
|
|
964
|
+
rowProps: Xe
|
|
968
965
|
})
|
|
969
966
|
})
|
|
970
967
|
]
|
|
971
968
|
});
|
|
972
|
-
}),
|
|
969
|
+
}), Ze = 8e3, Qe = "flex size-7 shrink-0 items-center justify-center", $ = {
|
|
973
970
|
root: "_root_11lia_1",
|
|
974
971
|
text: "_text_11lia_5",
|
|
975
972
|
textSecondary: "_textSecondary_11lia_9",
|
|
@@ -978,77 +975,77 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
978
975
|
errorIcon: "_errorIcon_11lia_21",
|
|
979
976
|
failureCount: "_failureCount_11lia_25",
|
|
980
977
|
warningIcon: "_warningIcon_11lia_35"
|
|
981
|
-
},
|
|
978
|
+
}, $e = ({ title: e, failedCount: t, isCollapsed: n, jobsId: r, labels: i, styles: o, onToggleCollapse: s, onClose: c }) => {
|
|
982
979
|
let l = o?.typography;
|
|
983
|
-
return /* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ B("div", {
|
|
984
981
|
className: a($.divider, "mx-4 flex items-center justify-between py-3"),
|
|
985
|
-
children: [/* @__PURE__ */
|
|
982
|
+
children: [/* @__PURE__ */ B("div", {
|
|
986
983
|
className: "flex min-w-0 items-center gap-2",
|
|
987
|
-
children: [/* @__PURE__ */
|
|
984
|
+
children: [/* @__PURE__ */ z("span", {
|
|
988
985
|
className: a($.text, "truncate", l?.titleClassName || "dial-small-paragraph-semi-text"),
|
|
989
986
|
children: e
|
|
990
|
-
}), t > 0 && /* @__PURE__ */
|
|
987
|
+
}), t > 0 && /* @__PURE__ */ z("span", {
|
|
991
988
|
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"),
|
|
992
989
|
children: t
|
|
993
990
|
})]
|
|
994
|
-
}), /* @__PURE__ */
|
|
991
|
+
}), /* @__PURE__ */ B("div", {
|
|
995
992
|
className: "flex shrink-0 items-center gap-1",
|
|
996
|
-
children: [/* @__PURE__ */
|
|
993
|
+
children: [/* @__PURE__ */ z(S, {
|
|
997
994
|
"aria-label": n ? i.expandQueueAriaLabel : i.collapseQueueAriaLabel,
|
|
998
995
|
size: y.Small,
|
|
999
996
|
"aria-expanded": !n,
|
|
1000
997
|
"aria-controls": r,
|
|
1001
|
-
icon:
|
|
998
|
+
icon: z(n ? ue : H, {
|
|
1002
999
|
size: g.SM,
|
|
1003
1000
|
className: $.textSecondary,
|
|
1004
1001
|
stroke: _,
|
|
1005
1002
|
"aria-hidden": !0
|
|
1006
1003
|
}),
|
|
1007
1004
|
onClick: s,
|
|
1008
|
-
className:
|
|
1009
|
-
}), /* @__PURE__ */
|
|
1005
|
+
className: Qe
|
|
1006
|
+
}), /* @__PURE__ */ z(S, {
|
|
1010
1007
|
"aria-label": i.closeQueueAriaLabel,
|
|
1011
1008
|
size: y.Small,
|
|
1012
|
-
icon: /* @__PURE__ */
|
|
1009
|
+
icon: /* @__PURE__ */ z(ge, {
|
|
1013
1010
|
size: g.SM,
|
|
1014
1011
|
className: $.textSecondary,
|
|
1015
1012
|
stroke: _,
|
|
1016
1013
|
"aria-hidden": !0
|
|
1017
1014
|
}),
|
|
1018
1015
|
onClick: c,
|
|
1019
|
-
className:
|
|
1016
|
+
className: Qe
|
|
1020
1017
|
})]
|
|
1021
1018
|
})]
|
|
1022
1019
|
});
|
|
1023
|
-
},
|
|
1020
|
+
}, et = [".dial", ".zip"], tt = (e) => {
|
|
1024
1021
|
let t = e.toLowerCase();
|
|
1025
|
-
return
|
|
1026
|
-
},
|
|
1027
|
-
let o = i?.typography, s =
|
|
1028
|
-
return /* @__PURE__ */
|
|
1022
|
+
return et.some((e) => t.endsWith(e)) ? W : t.endsWith(".json") ? pe : U;
|
|
1023
|
+
}, nt = ({ job: t, labels: n, onCancel: r, styles: i }) => {
|
|
1024
|
+
let o = i?.typography, s = tt(t.fileName), c = t.status === e.Canceled;
|
|
1025
|
+
return /* @__PURE__ */ B("div", {
|
|
1029
1026
|
className: "group flex items-center gap-2 px-4 py-2",
|
|
1030
1027
|
children: [
|
|
1031
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ z(s, {
|
|
1032
1029
|
size: g.SM,
|
|
1033
1030
|
stroke: _,
|
|
1034
1031
|
className: $.textSecondary,
|
|
1035
1032
|
"aria-hidden": !0
|
|
1036
1033
|
}),
|
|
1037
|
-
/* @__PURE__ */
|
|
1034
|
+
/* @__PURE__ */ z(b, {
|
|
1038
1035
|
text: t.fileName,
|
|
1039
1036
|
className: a(c ? $.textSecondary : $.text, o?.jobLabelClassName || "dial-small-text"),
|
|
1040
1037
|
contentClassName: "!z-[80]"
|
|
1041
1038
|
}),
|
|
1042
|
-
t.status === e.InProgress && /* @__PURE__ */
|
|
1039
|
+
t.status === e.InProgress && /* @__PURE__ */ B("div", {
|
|
1043
1040
|
className: a("flex size-7 shrink-0 items-center justify-center", "grid"),
|
|
1044
|
-
children: [/* @__PURE__ */
|
|
1041
|
+
children: [/* @__PURE__ */ z(A, {
|
|
1045
1042
|
size: g.SM,
|
|
1046
1043
|
ariaLabel: n.jobProgressAriaLabel(t.fileName),
|
|
1047
1044
|
className: "pointer-events-none col-start-1 row-start-1 opacity-100 transition-opacity group-focus-within:opacity-0 group-hover:opacity-0"
|
|
1048
|
-
}), /* @__PURE__ */
|
|
1045
|
+
}), /* @__PURE__ */ z(S, {
|
|
1049
1046
|
"aria-label": n.cancelJobAriaLabel(t.fileName),
|
|
1050
1047
|
size: y.Small,
|
|
1051
|
-
icon: /* @__PURE__ */
|
|
1048
|
+
icon: /* @__PURE__ */ z(ge, {
|
|
1052
1049
|
size: g.SM,
|
|
1053
1050
|
className: $.textSecondary,
|
|
1054
1051
|
stroke: _,
|
|
@@ -1058,55 +1055,55 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1058
1055
|
className: "col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"
|
|
1059
1056
|
})]
|
|
1060
1057
|
}),
|
|
1061
|
-
t.status === e.Success && /* @__PURE__ */
|
|
1058
|
+
t.status === e.Success && /* @__PURE__ */ z("span", {
|
|
1062
1059
|
className: "flex size-7 shrink-0 items-center justify-center",
|
|
1063
|
-
children: /* @__PURE__ */
|
|
1060
|
+
children: /* @__PURE__ */ z(le, {
|
|
1064
1061
|
size: g.SM,
|
|
1065
1062
|
stroke: _,
|
|
1066
1063
|
className: $.successIcon,
|
|
1067
1064
|
"aria-hidden": !0
|
|
1068
1065
|
})
|
|
1069
1066
|
}),
|
|
1070
|
-
t.status === e.Warning && /* @__PURE__ */
|
|
1067
|
+
t.status === e.Warning && /* @__PURE__ */ z(j, {
|
|
1071
1068
|
tooltip: n.jobWarningMessage(t.warningCode, t.warningNames),
|
|
1072
1069
|
contentClassName: "!z-[80]",
|
|
1073
1070
|
asChild: !0,
|
|
1074
|
-
children: /* @__PURE__ */
|
|
1071
|
+
children: /* @__PURE__ */ z("span", {
|
|
1075
1072
|
className: "flex size-7 shrink-0 items-center justify-center",
|
|
1076
1073
|
role: "img",
|
|
1077
1074
|
"aria-label": n.jobWarningMessage(t.warningCode, t.warningNames),
|
|
1078
1075
|
tabIndex: 0,
|
|
1079
|
-
children: /* @__PURE__ */
|
|
1076
|
+
children: /* @__PURE__ */ z(V, {
|
|
1080
1077
|
size: g.SM,
|
|
1081
1078
|
className: $.warningIcon,
|
|
1082
1079
|
"aria-hidden": !0
|
|
1083
1080
|
})
|
|
1084
1081
|
})
|
|
1085
1082
|
}),
|
|
1086
|
-
t.status === e.Failed && /* @__PURE__ */
|
|
1083
|
+
t.status === e.Failed && /* @__PURE__ */ z(j, {
|
|
1087
1084
|
tooltip: n.jobErrorMessage(t.errorCode),
|
|
1088
1085
|
contentClassName: "!z-[80]",
|
|
1089
1086
|
asChild: !0,
|
|
1090
|
-
children: /* @__PURE__ */
|
|
1087
|
+
children: /* @__PURE__ */ z("span", {
|
|
1091
1088
|
className: "flex size-7 shrink-0 items-center justify-center",
|
|
1092
1089
|
role: "img",
|
|
1093
1090
|
"aria-label": n.jobErrorMessage(t.errorCode),
|
|
1094
1091
|
tabIndex: 0,
|
|
1095
|
-
children: /* @__PURE__ */
|
|
1092
|
+
children: /* @__PURE__ */ z(oe, {
|
|
1096
1093
|
size: g.SM,
|
|
1097
1094
|
className: $.errorIcon,
|
|
1098
1095
|
"aria-hidden": !0
|
|
1099
1096
|
})
|
|
1100
1097
|
})
|
|
1101
1098
|
}),
|
|
1102
|
-
c && /* @__PURE__ */
|
|
1099
|
+
c && /* @__PURE__ */ z("span", {
|
|
1103
1100
|
className: a($.textSecondary, "shrink-0", o?.canceledLabelClassName || "dial-small-text"),
|
|
1104
1101
|
children: n.canceledLabel
|
|
1105
1102
|
})
|
|
1106
1103
|
]
|
|
1107
1104
|
});
|
|
1108
|
-
},
|
|
1109
|
-
let [l, u] =
|
|
1105
|
+
}, 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 = N(({ title: t, jobs: n, onClose: i, onCancel: o, labels: s, styles: c }) => {
|
|
1106
|
+
let [l, u] = R(!1), d = ne(), [f, p] = R(!1), g = c?.colors, _ = {
|
|
1110
1107
|
...r({
|
|
1111
1108
|
"--cp-transfer-queue-bg": g?.background,
|
|
1112
1109
|
"--cp-transfer-queue-text": g?.text,
|
|
@@ -1119,30 +1116,30 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1119
1116
|
"--cp-transfer-queue-failure-count-text": g?.failureCountText
|
|
1120
1117
|
}),
|
|
1121
1118
|
...c?.cssVars
|
|
1122
|
-
}, 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 =
|
|
1119
|
+
}, 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 = P(() => {
|
|
1123
1120
|
v || b ? p(!0) : i();
|
|
1124
1121
|
}, [
|
|
1125
1122
|
v,
|
|
1126
1123
|
b,
|
|
1127
1124
|
i
|
|
1128
|
-
]), C =
|
|
1125
|
+
]), C = P(() => {
|
|
1129
1126
|
p(!1), i();
|
|
1130
|
-
}, [i]), w =
|
|
1127
|
+
}, [i]), w = P(() => {
|
|
1131
1128
|
u((e) => !e);
|
|
1132
1129
|
}, []);
|
|
1133
|
-
if (
|
|
1130
|
+
if (F(() => {
|
|
1134
1131
|
if (!x) return;
|
|
1135
|
-
let e = setTimeout(i,
|
|
1132
|
+
let e = setTimeout(i, Ze);
|
|
1136
1133
|
return () => clearTimeout(e);
|
|
1137
1134
|
}, [x, i]), n.length === 0) return null;
|
|
1138
1135
|
let T = n.filter((t) => t.status === e.Failed).length;
|
|
1139
|
-
return /* @__PURE__ */
|
|
1136
|
+
return /* @__PURE__ */ B("div", {
|
|
1140
1137
|
role: "status",
|
|
1141
1138
|
"aria-live": "polite",
|
|
1142
1139
|
style: _,
|
|
1143
1140
|
className: a($.root, "w-[370px] max-w-[calc(100vw-2rem)] rounded-xl shadow-md", c?.rootClassName),
|
|
1144
1141
|
children: [
|
|
1145
|
-
/* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ z($e, {
|
|
1146
1143
|
title: t,
|
|
1147
1144
|
failedCount: T,
|
|
1148
1145
|
isCollapsed: l,
|
|
@@ -1152,26 +1149,26 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1152
1149
|
onToggleCollapse: w,
|
|
1153
1150
|
onClose: S
|
|
1154
1151
|
}),
|
|
1155
|
-
l && v && /* @__PURE__ */
|
|
1156
|
-
value:
|
|
1152
|
+
l && v && /* @__PURE__ */ z(D, {
|
|
1153
|
+
value: rt(n),
|
|
1157
1154
|
size: y.Small,
|
|
1158
1155
|
"aria-label": s.queueProgressAriaLabel,
|
|
1159
|
-
"aria-valuetext": s.queueProgressValueText(
|
|
1156
|
+
"aria-valuetext": s.queueProgressValueText(it(n), n.length)
|
|
1160
1157
|
}),
|
|
1161
|
-
!l && /* @__PURE__ */
|
|
1158
|
+
!l && /* @__PURE__ */ z("div", {
|
|
1162
1159
|
id: d,
|
|
1163
1160
|
className: a("flex max-h-[40vh] flex-col overflow-y-auto py-1", c?.bodyClassName),
|
|
1164
|
-
children: n.map((e) => /* @__PURE__ */
|
|
1161
|
+
children: n.map((e) => /* @__PURE__ */ z(nt, {
|
|
1165
1162
|
job: e,
|
|
1166
1163
|
labels: s,
|
|
1167
1164
|
onCancel: o,
|
|
1168
1165
|
styles: c
|
|
1169
1166
|
}, e.id))
|
|
1170
1167
|
}),
|
|
1171
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ z(m, {
|
|
1172
1169
|
open: f,
|
|
1173
1170
|
header: s.closeQueueConfirmHeader,
|
|
1174
|
-
description:
|
|
1171
|
+
description: at(v, b, s),
|
|
1175
1172
|
confirmLabel: s.closeLabel,
|
|
1176
1173
|
cancelLabel: s.cancelLabel,
|
|
1177
1174
|
variant: h.Danger,
|
|
@@ -1181,33 +1178,33 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1181
1178
|
]
|
|
1182
1179
|
});
|
|
1183
1180
|
});
|
|
1184
|
-
|
|
1181
|
+
ot.displayName = "ImportExportQueue";
|
|
1185
1182
|
//#endregion
|
|
1186
1183
|
//#region src/components/RenameConversationPopup/RenameConversationPopup.tsx
|
|
1187
|
-
var
|
|
1188
|
-
let [f, m] =
|
|
1189
|
-
|
|
1190
|
-
let n = e && !
|
|
1191
|
-
if (
|
|
1184
|
+
var st = N(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
|
|
1185
|
+
let [f, m] = R(t), [h, v] = R(!1), [y, b] = R(null), x = L(null), C = L(!1), D = L(0);
|
|
1186
|
+
F(() => {
|
|
1187
|
+
let n = e && !C.current;
|
|
1188
|
+
if (C.current = e, !e) {
|
|
1192
1189
|
D.current += 1, v(!1);
|
|
1193
1190
|
return;
|
|
1194
1191
|
}
|
|
1195
1192
|
if (!n) return;
|
|
1196
1193
|
D.current += 1, m(t), b(null), v(!1);
|
|
1197
|
-
let r = setTimeout(() =>
|
|
1194
|
+
let r = setTimeout(() => x.current?.focus(), 0);
|
|
1198
1195
|
return () => clearTimeout(r);
|
|
1199
|
-
}, [e, t]),
|
|
1196
|
+
}, [e, t]), F(() => () => {
|
|
1200
1197
|
D.current += 1;
|
|
1201
1198
|
}, []);
|
|
1202
|
-
let O = s(f.trim()),
|
|
1203
|
-
|
|
1199
|
+
let O = s(f.trim()), ee = i(O) > 255, k = n || O === "" || O === t.trim() || ee, j = P(() => {
|
|
1200
|
+
k || a(O);
|
|
1204
1201
|
}, [
|
|
1205
|
-
|
|
1202
|
+
k,
|
|
1206
1203
|
a,
|
|
1207
1204
|
O
|
|
1208
|
-
]),
|
|
1209
|
-
e.key === "Enter" &&
|
|
1210
|
-
}, [
|
|
1205
|
+
]), te = P((e) => {
|
|
1206
|
+
e.key === "Enter" && j();
|
|
1207
|
+
}, [j]), M = P(async () => {
|
|
1211
1208
|
if (h) return;
|
|
1212
1209
|
let e = ++D.current;
|
|
1213
1210
|
v(!0), b(null);
|
|
@@ -1225,11 +1222,11 @@ var ct = P(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCa
|
|
|
1225
1222
|
h,
|
|
1226
1223
|
l,
|
|
1227
1224
|
u.renameWithAiError
|
|
1228
|
-
]),
|
|
1229
|
-
return
|
|
1225
|
+
]), N;
|
|
1226
|
+
return N = ee ? u.nameTooLongError : y ?? r ?? void 0, /* @__PURE__ */ z(T, {
|
|
1230
1227
|
open: e,
|
|
1231
1228
|
header: u.popupTitle,
|
|
1232
|
-
size:
|
|
1229
|
+
size: E.Sm,
|
|
1233
1230
|
onClose: c,
|
|
1234
1231
|
mainButtons: n ? void 0 : [{
|
|
1235
1232
|
label: u.cancelLabel,
|
|
@@ -1237,33 +1234,33 @@ var ct = P(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCa
|
|
|
1237
1234
|
}, {
|
|
1238
1235
|
label: u.saveLabel,
|
|
1239
1236
|
variant: p.Primary,
|
|
1240
|
-
disabled:
|
|
1241
|
-
onClick:
|
|
1237
|
+
disabled: k,
|
|
1238
|
+
onClick: j
|
|
1242
1239
|
}],
|
|
1243
|
-
children: /* @__PURE__ */
|
|
1240
|
+
children: /* @__PURE__ */ z("div", {
|
|
1244
1241
|
className: d?.bodyClassName,
|
|
1245
1242
|
style: d?.cssVars,
|
|
1246
|
-
children: n ? /* @__PURE__ */
|
|
1243
|
+
children: n ? /* @__PURE__ */ z("div", {
|
|
1247
1244
|
className: "h-[120px] px-6 py-4",
|
|
1248
|
-
children: /* @__PURE__ */
|
|
1249
|
-
}) : /* @__PURE__ */
|
|
1245
|
+
children: /* @__PURE__ */ z(A, { size: 50 })
|
|
1246
|
+
}) : /* @__PURE__ */ B("div", {
|
|
1250
1247
|
className: "flex items-start gap-2 px-6 py-3",
|
|
1251
|
-
children: [/* @__PURE__ */
|
|
1248
|
+
children: [/* @__PURE__ */ z("div", {
|
|
1252
1249
|
className: "min-w-0 flex-1",
|
|
1253
|
-
children: /* @__PURE__ */
|
|
1254
|
-
inputRef:
|
|
1250
|
+
children: /* @__PURE__ */ z(w, {
|
|
1251
|
+
inputRef: x,
|
|
1255
1252
|
value: f,
|
|
1256
1253
|
placeholder: u.inputPlaceholder,
|
|
1257
|
-
error:
|
|
1254
|
+
error: N,
|
|
1258
1255
|
onChange: (e) => m(o(e ?? "")),
|
|
1259
|
-
onKeyDown:
|
|
1256
|
+
onKeyDown: te
|
|
1260
1257
|
})
|
|
1261
|
-
}), /* @__PURE__ */
|
|
1258
|
+
}), /* @__PURE__ */ z(S, {
|
|
1262
1259
|
"aria-label": u.renameWithAiLabel,
|
|
1263
1260
|
tooltipProps: { tooltip: u.renameWithAiLabel },
|
|
1264
1261
|
disabled: h || n,
|
|
1265
|
-
onClick:
|
|
1266
|
-
icon: h ? /* @__PURE__ */
|
|
1262
|
+
onClick: M,
|
|
1263
|
+
icon: h ? /* @__PURE__ */ z(A, { size: g.MD }) : /* @__PURE__ */ z(he, {
|
|
1267
1264
|
size: g.MD,
|
|
1268
1265
|
stroke: _
|
|
1269
1266
|
})
|
|
@@ -1272,6 +1269,6 @@ var ct = P(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCa
|
|
|
1272
1269
|
})
|
|
1273
1270
|
});
|
|
1274
1271
|
});
|
|
1275
|
-
|
|
1272
|
+
st.displayName = "RenameConversationPopup";
|
|
1276
1273
|
//#endregion
|
|
1277
|
-
export {
|
|
1274
|
+
export { _e as CONVERSATION_PANEL_CLASS, Xe as ConversationPanel, ot as ImportExportQueue, st as RenameConversationPopup, tt as getTransferFileIcon };
|