@epam/ai-dial-conversation-panel 1.3.0-dev.28 → 1.3.0-dev.282
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 +3 -0
- package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts.map +1 -1
- package/components/ConversationList/ConversationList.d.ts +5 -0
- package/components/ConversationList/ConversationList.d.ts.map +1 -0
- package/components/ConversationListHeader/ConversationListHeader.d.ts +5 -0
- package/components/ConversationListHeader/ConversationListHeader.d.ts.map +1 -0
- package/components/ConversationListSection/ConversationListSection.d.ts +5 -0
- package/components/ConversationListSection/ConversationListSection.d.ts.map +1 -0
- package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
- package/components/ConversationRow/ConversationRow.d.ts +5 -0
- package/components/ConversationRow/ConversationRow.d.ts.map +1 -1
- package/components/RenameConversationPopup/RenameConversationPopup.d.ts.map +1 -1
- package/components/RowRenderer/RowRenderer.d.ts +1 -1
- package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +6 -0
- package/constants/public-class-names.d.ts.map +1 -1
- package/constants/virtual-list.d.ts +6 -0
- package/constants/virtual-list.d.ts.map +1 -1
- package/index.css +3 -2
- package/index.d.ts +8 -0
- package/index.d.ts.map +1 -1
- package/index.js +1576 -695
- package/models/conversation-list-header.d.ts +82 -0
- package/models/conversation-list-header.d.ts.map +1 -0
- package/models/conversation-list-section.d.ts +63 -0
- package/models/conversation-list-section.d.ts.map +1 -0
- package/models/conversation-list.d.ts +139 -0
- package/models/conversation-list.d.ts.map +1 -0
- package/models/panel-props.d.ts +28 -53
- package/models/panel-props.d.ts.map +1 -1
- package/models/virtual-row.d.ts +5 -0
- package/models/virtual-row.d.ts.map +1 -1
- package/package.json +6 -6
- package/types/conversation-kind.d.ts +7 -0
- package/types/conversation-kind.d.ts.map +1 -0
- package/types/conversation-row-variant.d.ts +8 -0
- package/types/conversation-row-variant.d.ts.map +1 -0
- package/{components/ConversationPanel/utils.d.ts → utils/conversation-filter.d.ts} +5 -2
- package/utils/conversation-filter.d.ts.map +1 -0
- package/utils/conversation-row.d.ts +9 -2
- package/utils/conversation-row.d.ts.map +1 -1
- package/components/ConversationPanel/utils.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -1,33 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PanelEmpty as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { IconCaretDownFilled as
|
|
1
|
+
import { ConversationKind 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, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, Dropdown as g, ElementSize as _, EllipsisTooltip as v, FilterChips as y, GhostIconButton as b, Highlight as x, Input as S, LiveRegion as C, LiveRegionElement as w, LiveRegionPoliteness as T, MenuItemMark as E, Popup as D, PopupSize as O, Search as k, Skeleton as A, SkeletonVariant as j, Spinner as M, mergeClasses as N } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { Fragment as P, createElement as F, memo as I, useCallback as L, useEffect as R, useId as z, useImperativeHandle as ee, useLayoutEffect as B, useMemo as V, useRef as H, useState as U, useSyncExternalStore as W } from "react";
|
|
5
|
+
import { Fragment as te, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
6
|
+
import { IconCaretDownFilled as q, IconCaretRightFilled as J, IconChevronDown as ne, IconChevronRight as re, IconDotsVertical as ie, IconFilter2 as ae, IconPlus as oe, IconSearch as se, IconSparkles as ce, IconX as le } from "@tabler/icons-react";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
|
-
var
|
|
8
|
+
var ue = {
|
|
9
9
|
newChatButton: "dial-cp-new-chat-button",
|
|
10
|
-
search: "dial-cp-search"
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
search: "dial-cp-search",
|
|
11
|
+
list: "dial-cp-list",
|
|
12
|
+
listHeader: "dial-cp-list-header",
|
|
13
|
+
listSection: "dial-cp-list-section"
|
|
14
|
+
}, Y = typeof window < "u" ? B : R;
|
|
15
|
+
function de(e) {
|
|
16
|
+
let t = e;
|
|
17
|
+
for (; t;) {
|
|
18
|
+
if (t.dir) return t.dir === "rtl";
|
|
19
|
+
t = t.parentElement;
|
|
20
|
+
}
|
|
21
|
+
return !1;
|
|
22
|
+
}
|
|
23
|
+
function fe() {
|
|
24
|
+
return () => {};
|
|
25
|
+
}
|
|
26
|
+
function pe() {
|
|
27
|
+
return W(fe, () => !1, () => !0);
|
|
28
|
+
}
|
|
29
|
+
function X(e) {
|
|
30
|
+
return e?.ownerDocument.defaultView ?? window;
|
|
31
|
+
}
|
|
32
|
+
function me(e) {
|
|
33
|
+
return X(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
|
|
34
|
+
}
|
|
35
|
+
function he(e) {
|
|
13
36
|
if (e !== void 0) switch (typeof e) {
|
|
14
37
|
case "number": return e;
|
|
15
|
-
case "string":
|
|
16
|
-
if (e.endsWith("px")) return parseFloat(e);
|
|
17
|
-
break;
|
|
38
|
+
case "string": if (e.endsWith("px")) return parseFloat(e);
|
|
18
39
|
}
|
|
19
40
|
}
|
|
20
|
-
function
|
|
21
|
-
let { styleHeight: s, styleWidth: c } =
|
|
22
|
-
styleHeight:
|
|
23
|
-
styleWidth:
|
|
24
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
41
|
+
function ge({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
42
|
+
let { styleHeight: s, styleWidth: c } = V(() => ({
|
|
43
|
+
styleHeight: he(o?.height),
|
|
44
|
+
styleWidth: he(o?.width)
|
|
45
|
+
}), [o?.height, o?.width]), [l, u] = U({
|
|
25
46
|
height: t,
|
|
26
47
|
width: n
|
|
27
48
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
28
|
-
return
|
|
49
|
+
return Y(() => {
|
|
29
50
|
if (i === null || d) return;
|
|
30
|
-
let t =
|
|
51
|
+
let t = me(i);
|
|
52
|
+
if (!t) return;
|
|
53
|
+
let n = new t((e) => {
|
|
31
54
|
for (let t of e) {
|
|
32
55
|
let { contentRect: e, target: n } = t;
|
|
33
56
|
i === n && u((t) => t.height === e.height && t.width === e.width ? t : {
|
|
@@ -36,8 +59,8 @@ function B({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
36
59
|
});
|
|
37
60
|
}
|
|
38
61
|
});
|
|
39
|
-
return
|
|
40
|
-
|
|
62
|
+
return n.observe(i, { box: e }), () => {
|
|
63
|
+
n?.unobserve(i);
|
|
41
64
|
};
|
|
42
65
|
}, [
|
|
43
66
|
e,
|
|
@@ -45,7 +68,7 @@ function B({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
45
68
|
i,
|
|
46
69
|
s,
|
|
47
70
|
c
|
|
48
|
-
]),
|
|
71
|
+
]), V(() => ({
|
|
49
72
|
height: s ?? l.height,
|
|
50
73
|
width: c ?? l.width
|
|
51
74
|
}), [
|
|
@@ -54,114 +77,200 @@ function B({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
54
77
|
c
|
|
55
78
|
]);
|
|
56
79
|
}
|
|
57
|
-
function
|
|
58
|
-
let t =
|
|
59
|
-
throw Error("Cannot call
|
|
80
|
+
function _e(e) {
|
|
81
|
+
let t = H(() => {
|
|
82
|
+
throw Error("Cannot call an event handler while rendering.");
|
|
60
83
|
});
|
|
61
|
-
return
|
|
84
|
+
return Y(() => {
|
|
62
85
|
t.current = e;
|
|
63
|
-
}, [e]),
|
|
86
|
+
}, [e]), L((...e) => t.current?.(...e), [t]);
|
|
64
87
|
}
|
|
65
|
-
var
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
88
|
+
var ve = /* @__PURE__ */ new WeakMap();
|
|
89
|
+
function ye(e = !1, t = document) {
|
|
90
|
+
let n = ve.get(t);
|
|
91
|
+
if (n === void 0 || e) {
|
|
92
|
+
let e = t.createElement("div"), r = e.style;
|
|
93
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
94
|
+
let i = t.createElement("div"), a = i.style;
|
|
95
|
+
a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e), ve.set(t, n);
|
|
72
96
|
}
|
|
73
|
-
return
|
|
97
|
+
return n;
|
|
74
98
|
}
|
|
75
|
-
function
|
|
76
|
-
if (t === "horizontal" && n) switch (
|
|
99
|
+
function be({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
100
|
+
if (t === "horizontal" && n) switch (ye(!1, e?.ownerDocument ?? document)) {
|
|
77
101
|
case "negative": return -r;
|
|
78
|
-
case "positive-descending":
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
break;
|
|
102
|
+
case "positive-descending": if (e) {
|
|
103
|
+
let { clientWidth: t, scrollWidth: n } = e;
|
|
104
|
+
return n - t - r;
|
|
105
|
+
}
|
|
84
106
|
}
|
|
85
107
|
return r;
|
|
86
108
|
}
|
|
87
|
-
function
|
|
109
|
+
function xe({ container: e, element: t, onChange: n }) {
|
|
110
|
+
let r = X(t), i = me(t), a = r.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), o = i ? new i(n) : void 0, s = (e) => !e.isConnected || (e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, c = a ? new a((e) => {
|
|
111
|
+
e.some((e) => Array.from(e.addedNodes).some(s) || e.removedNodes.length > 0 && e.nextSibling !== null && s(e.nextSibling)) && (u(), n());
|
|
112
|
+
}) : void 0, l = /* @__PURE__ */ new Set(), u = () => {
|
|
113
|
+
for (let e of l) o?.unobserve(e);
|
|
114
|
+
l.clear(), c?.disconnect();
|
|
115
|
+
let n = t;
|
|
116
|
+
for (; n !== e;) {
|
|
117
|
+
let e = n.parentElement;
|
|
118
|
+
if (e === null) break;
|
|
119
|
+
if (o) for (let e = n.previousElementSibling; e !== null; e = e.previousElementSibling) l.add(e), o.observe(e);
|
|
120
|
+
c?.observe(e, { childList: !0 }), n = e;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return u(), () => {
|
|
124
|
+
o?.disconnect(), c?.disconnect();
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function Se(e) {
|
|
128
|
+
return e.window === e;
|
|
129
|
+
}
|
|
130
|
+
function Ce(e, t) {
|
|
131
|
+
return t === "window" ? e ? X(e) : null : t ?? null;
|
|
132
|
+
}
|
|
133
|
+
function we(e, t) {
|
|
134
|
+
return Se(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
|
|
135
|
+
}
|
|
136
|
+
function Te(e, t) {
|
|
137
|
+
let n = Se(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
|
|
138
|
+
return t === "vertical" ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
|
|
139
|
+
}
|
|
140
|
+
function Ee(e, t) {
|
|
141
|
+
let { overflowX: n, overflowY: r } = X(e).getComputedStyle(e), i = t === "vertical" ? r : n;
|
|
142
|
+
return i === "visible" || i === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
143
|
+
}
|
|
144
|
+
function De({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
|
|
145
|
+
let i = t === "vertical", a, o;
|
|
146
|
+
if (Se(r)) {
|
|
147
|
+
let { documentElement: e } = r.document;
|
|
148
|
+
a = 0, o = i ? e.clientHeight : e.clientWidth;
|
|
149
|
+
} else {
|
|
150
|
+
let e = r.getBoundingClientRect();
|
|
151
|
+
a = i ? e.top + r.clientTop : e.left + r.clientLeft, o = i ? r.clientHeight : r.clientWidth;
|
|
152
|
+
}
|
|
153
|
+
let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f = be({
|
|
154
|
+
containerElement: e,
|
|
155
|
+
direction: t,
|
|
156
|
+
isRtl: n,
|
|
157
|
+
scrollOffset: i ? e.scrollTop : e.scrollLeft
|
|
158
|
+
}), p = !i && n ? d - s : a - l, m = p + o, h = Math.max(0, p), g = Math.min(u, m);
|
|
159
|
+
return {
|
|
160
|
+
offset: f + h,
|
|
161
|
+
size: Math.max(0, g - h),
|
|
162
|
+
viewportOffset: f + p,
|
|
163
|
+
viewportSize: o
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function Oe({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
|
|
167
|
+
let i = Se(n) ? n.document.documentElement : n, a = X(i).getComputedStyle(i), o = (e) => {
|
|
168
|
+
let t = parseFloat(e ?? "");
|
|
169
|
+
return !Number.isFinite(t) || t < 0 ? 0 : e.endsWith("px") ? t : e.endsWith("%") ? t * r / 100 : 0;
|
|
170
|
+
};
|
|
171
|
+
if (e === "vertical") return {
|
|
172
|
+
end: o(a.scrollPaddingBottom),
|
|
173
|
+
start: o(a.scrollPaddingTop)
|
|
174
|
+
};
|
|
175
|
+
let s = o(a.scrollPaddingLeft), c = o(a.scrollPaddingRight);
|
|
176
|
+
return t ? {
|
|
177
|
+
end: s,
|
|
178
|
+
start: c
|
|
179
|
+
} : {
|
|
180
|
+
end: c,
|
|
181
|
+
start: s
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function ke(e, t = "Assertion error") {
|
|
88
185
|
if (!e) throw console.error(t), Error(t);
|
|
89
186
|
}
|
|
90
|
-
function
|
|
187
|
+
function Ae(e, t) {
|
|
91
188
|
if (e === t) return !0;
|
|
92
|
-
if (!!e != !!t || (
|
|
93
|
-
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
189
|
+
if (!!e != !!t || (ke(e !== void 0), ke(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
190
|
+
for (let n in e) if (!Object.hasOwn(t, n) || !Object.is(t[n], e[n])) return !1;
|
|
94
191
|
return !0;
|
|
95
192
|
}
|
|
96
|
-
function
|
|
193
|
+
function je({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
97
194
|
if (t === 0) return 0;
|
|
98
195
|
if (typeof n == "number") return t * n;
|
|
99
196
|
{
|
|
100
197
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
101
|
-
return
|
|
198
|
+
return ke(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
102
199
|
}
|
|
103
200
|
}
|
|
104
|
-
function
|
|
105
|
-
if (
|
|
106
|
-
let
|
|
201
|
+
function Me({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
|
|
202
|
+
if (r < 0 || r >= i) throw RangeError(`Invalid index specified: ${r}`, { cause: `Index ${r} is not within the range of 0 - ${i - 1}` });
|
|
203
|
+
let c = t.get(r), l = je({
|
|
107
204
|
cachedBounds: t,
|
|
108
|
-
itemCount:
|
|
109
|
-
itemSize:
|
|
110
|
-
}),
|
|
111
|
-
switch (e === "smart" && (e =
|
|
112
|
-
case "start": return
|
|
113
|
-
case "end": return
|
|
114
|
-
case "center": return c.scrollOffset
|
|
115
|
-
default: return
|
|
205
|
+
itemCount: i,
|
|
206
|
+
itemSize: a
|
|
207
|
+
}), u = (e) => n ? Math.max(0, Math.min(l - s, e)) : e, d = u(c.scrollOffset), f = n ? Math.max(0, c.scrollOffset - s + c.size) : c.scrollOffset - s + c.size, p = c.size > s ? o >= c.scrollOffset && o <= f : o >= f && o <= c.scrollOffset;
|
|
208
|
+
switch (e === "smart" && (e = p ? "auto" : "center"), e) {
|
|
209
|
+
case "start": return d;
|
|
210
|
+
case "end": return f;
|
|
211
|
+
case "center": return u(c.scrollOffset + c.size / 2 - s / 2);
|
|
212
|
+
default: return p ? o : o < f ? f : d;
|
|
116
213
|
}
|
|
117
214
|
}
|
|
118
|
-
function
|
|
119
|
-
let a = r - 1
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
215
|
+
function Ne({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
216
|
+
let a = r - 1;
|
|
217
|
+
if (r === 0) return {
|
|
218
|
+
startIndexVisible: 0,
|
|
219
|
+
stopIndexVisible: -1,
|
|
220
|
+
startIndexOverscan: 0,
|
|
221
|
+
stopIndexOverscan: -1
|
|
222
|
+
};
|
|
223
|
+
let o, s, { itemSize: c } = e;
|
|
224
|
+
if (c !== void 0) c > 0 ? (o = Math.max(0, Math.min(a, Math.floor(t / c))), s = Math.max(o, Math.min(a, Math.ceil((t + n) / c) - 1))) : (o = 0, s = 0);
|
|
225
|
+
else {
|
|
226
|
+
let r = 0, i = Math.min(a, Math.max(0, e.size - 1));
|
|
227
|
+
for (; r < i;) {
|
|
228
|
+
let n = Math.floor((r + i) / 2), a = e.get(n);
|
|
229
|
+
a.scrollOffset + a.size > t ? i = n : r = n + 1;
|
|
230
|
+
}
|
|
231
|
+
for (; r < a;) {
|
|
232
|
+
let n = e.get(r);
|
|
233
|
+
if (n.scrollOffset + n.size > t) break;
|
|
234
|
+
r++;
|
|
235
|
+
}
|
|
236
|
+
for (o = r, s = r; s < a;) {
|
|
237
|
+
let r = e.get(s);
|
|
238
|
+
if (r.scrollOffset + r.size >= t + n) break;
|
|
239
|
+
s++;
|
|
240
|
+
}
|
|
129
241
|
}
|
|
130
|
-
return
|
|
242
|
+
return {
|
|
131
243
|
startIndexVisible: o,
|
|
132
244
|
stopIndexVisible: s,
|
|
133
|
-
startIndexOverscan:
|
|
134
|
-
stopIndexOverscan:
|
|
245
|
+
startIndexOverscan: Math.max(0, o - i),
|
|
246
|
+
stopIndexOverscan: Math.min(a, s + i)
|
|
135
247
|
};
|
|
136
248
|
}
|
|
137
|
-
function
|
|
249
|
+
function Z({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
138
250
|
let r = /* @__PURE__ */ new Map();
|
|
139
251
|
return {
|
|
252
|
+
itemSize: typeof n == "number" ? n : void 0,
|
|
140
253
|
get(i) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
case "number":
|
|
148
|
-
a = n;
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
254
|
+
if (ke(i < e, `Invalid index ${i}`), typeof n == "number") return ke(i >= 0, `Invalid index ${i}`), {
|
|
255
|
+
size: n,
|
|
256
|
+
scrollOffset: i * n
|
|
257
|
+
};
|
|
258
|
+
for (; r.size - 1 < i;) {
|
|
259
|
+
let e = r.size, a = n(e, t);
|
|
151
260
|
if (e === 0) r.set(e, {
|
|
152
261
|
size: a,
|
|
153
262
|
scrollOffset: 0
|
|
154
263
|
});
|
|
155
264
|
else {
|
|
156
265
|
let t = r.get(e - 1);
|
|
157
|
-
|
|
266
|
+
ke(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
158
267
|
scrollOffset: t.scrollOffset + t.size,
|
|
159
268
|
size: a
|
|
160
269
|
});
|
|
161
270
|
}
|
|
162
271
|
}
|
|
163
272
|
let a = r.get(i);
|
|
164
|
-
return
|
|
273
|
+
return ke(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
165
274
|
},
|
|
166
275
|
set(e, t) {
|
|
167
276
|
r.set(e, t);
|
|
@@ -171,8 +280,8 @@ function de({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
171
280
|
}
|
|
172
281
|
};
|
|
173
282
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
283
|
+
function Pe({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
284
|
+
return V(() => Z({
|
|
176
285
|
itemCount: e,
|
|
177
286
|
itemProps: t,
|
|
178
287
|
itemSize: n
|
|
@@ -182,513 +291,844 @@ function J({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
182
291
|
n
|
|
183
292
|
]);
|
|
184
293
|
}
|
|
185
|
-
function
|
|
294
|
+
function Fe({ containerSize: e, itemSize: t }) {
|
|
186
295
|
let n;
|
|
187
296
|
switch (typeof t) {
|
|
188
297
|
case "string":
|
|
189
|
-
|
|
190
|
-
break;
|
|
191
|
-
default:
|
|
192
|
-
n = t;
|
|
298
|
+
ke(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), ke(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseFloat(t) / 100;
|
|
193
299
|
break;
|
|
300
|
+
default: n = t;
|
|
194
301
|
}
|
|
195
|
-
return n;
|
|
302
|
+
return typeof n == "number" && !(Number.isFinite(n) && n > 0) && (n = 0), n;
|
|
196
303
|
}
|
|
197
|
-
function
|
|
198
|
-
let { height:
|
|
199
|
-
defaultHeight:
|
|
200
|
-
defaultWidth:
|
|
304
|
+
function Ie({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, defaultScrollOffset: r = 0, direction: i, isRtl: a = !1, itemCount: o, itemProps: s, itemSize: c, onResize: l, overscanCount: u, scrollElement: d }) {
|
|
305
|
+
let f = d !== void 0, p = f ? Ce(e, d) : e, { height: m = n, width: h = n } = ge({
|
|
306
|
+
defaultHeight: i === "vertical" ? n : void 0,
|
|
307
|
+
defaultWidth: i === "horizontal" ? n : void 0,
|
|
201
308
|
element: e,
|
|
202
|
-
mode:
|
|
309
|
+
mode: i === "vertical" ? "only-height" : "only-width",
|
|
203
310
|
style: t
|
|
204
|
-
}),
|
|
311
|
+
}), g = H({
|
|
205
312
|
height: 0,
|
|
206
313
|
width: 0
|
|
207
|
-
}),
|
|
208
|
-
containerSize:
|
|
209
|
-
itemSize:
|
|
314
|
+
}), [_, v] = U(n), y = f ? _ : i === "vertical" ? m : h, b = Fe({
|
|
315
|
+
containerSize: y,
|
|
316
|
+
itemSize: c
|
|
210
317
|
});
|
|
211
|
-
|
|
212
|
-
if (typeof
|
|
213
|
-
let e =
|
|
214
|
-
(e.height !==
|
|
215
|
-
height:
|
|
216
|
-
width:
|
|
217
|
-
}, { ...e }), e.height =
|
|
318
|
+
Y(() => {
|
|
319
|
+
if (typeof l == "function") {
|
|
320
|
+
let e = g.current;
|
|
321
|
+
(e.height !== m || e.width !== h) && (l({
|
|
322
|
+
height: m,
|
|
323
|
+
width: h
|
|
324
|
+
}, { ...e }), e.height = m, e.width = h);
|
|
218
325
|
}
|
|
219
326
|
}, [
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
327
|
+
m,
|
|
328
|
+
l,
|
|
329
|
+
h
|
|
223
330
|
]);
|
|
224
|
-
let
|
|
225
|
-
itemCount:
|
|
226
|
-
itemProps:
|
|
227
|
-
itemSize:
|
|
228
|
-
}),
|
|
229
|
-
cachedBounds:
|
|
230
|
-
containerScrollOffset:
|
|
231
|
-
containerSize:
|
|
232
|
-
itemCount:
|
|
233
|
-
overscanCount:
|
|
234
|
-
})), { startIndexVisible:
|
|
235
|
-
startIndexVisible: Math.min(
|
|
236
|
-
startIndexOverscan: Math.min(
|
|
237
|
-
stopIndexVisible: Math.min(
|
|
238
|
-
stopIndexOverscan: Math.min(
|
|
239
|
-
},
|
|
240
|
-
cachedBounds:
|
|
241
|
-
itemCount:
|
|
242
|
-
itemSize:
|
|
331
|
+
let x = Pe({
|
|
332
|
+
itemCount: o,
|
|
333
|
+
itemProps: s,
|
|
334
|
+
itemSize: b
|
|
335
|
+
}), S = pe(), [C] = U(() => S || f ? 0 : r), w = L((e) => x.get(e), [x]), [T, E] = U(() => Ne({
|
|
336
|
+
cachedBounds: x,
|
|
337
|
+
containerScrollOffset: C,
|
|
338
|
+
containerSize: y,
|
|
339
|
+
itemCount: o,
|
|
340
|
+
overscanCount: u
|
|
341
|
+
})), { startIndexVisible: D, startIndexOverscan: O, stopIndexVisible: k, stopIndexOverscan: A } = {
|
|
342
|
+
startIndexVisible: Math.min(o - 1, T.startIndexVisible),
|
|
343
|
+
startIndexOverscan: Math.min(o - 1, T.startIndexOverscan),
|
|
344
|
+
stopIndexVisible: Math.min(o - 1, T.stopIndexVisible),
|
|
345
|
+
stopIndexOverscan: Math.min(o - 1, T.stopIndexOverscan)
|
|
346
|
+
}, j = L(() => je({
|
|
347
|
+
cachedBounds: x,
|
|
348
|
+
itemCount: o,
|
|
349
|
+
itemSize: b
|
|
243
350
|
}), [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
]),
|
|
248
|
-
|
|
249
|
-
containerScrollOffset: U({
|
|
351
|
+
x,
|
|
352
|
+
o,
|
|
353
|
+
b
|
|
354
|
+
]), M = L((t) => {
|
|
355
|
+
let n = be({
|
|
250
356
|
containerElement: e,
|
|
251
|
-
direction:
|
|
252
|
-
isRtl:
|
|
357
|
+
direction: i,
|
|
358
|
+
isRtl: a,
|
|
253
359
|
scrollOffset: t
|
|
254
|
-
})
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
360
|
+
});
|
|
361
|
+
return Ne({
|
|
362
|
+
cachedBounds: x,
|
|
363
|
+
containerScrollOffset: n,
|
|
364
|
+
containerSize: y,
|
|
365
|
+
itemCount: o,
|
|
366
|
+
overscanCount: u
|
|
367
|
+
});
|
|
368
|
+
}, [
|
|
369
|
+
x,
|
|
260
370
|
e,
|
|
261
|
-
|
|
262
|
-
r,
|
|
371
|
+
y,
|
|
263
372
|
i,
|
|
264
373
|
a,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
374
|
+
o,
|
|
375
|
+
u
|
|
376
|
+
]), N = H(!1);
|
|
377
|
+
Y(() => {
|
|
378
|
+
if (!e || o === 0 || f || N.current || (N.current = !0, r <= 0)) return;
|
|
379
|
+
let t = i === "horizontal" && de(e);
|
|
380
|
+
if (be({
|
|
381
|
+
containerElement: e,
|
|
382
|
+
direction: i,
|
|
383
|
+
isRtl: t,
|
|
384
|
+
scrollOffset: i === "vertical" ? e.scrollTop : e.scrollLeft
|
|
385
|
+
}) !== 0) return;
|
|
386
|
+
let n = be({
|
|
387
|
+
containerElement: e,
|
|
388
|
+
direction: i,
|
|
389
|
+
isRtl: t,
|
|
390
|
+
scrollOffset: r
|
|
391
|
+
});
|
|
392
|
+
typeof e.scrollTo == "function" ? e.scrollTo({
|
|
393
|
+
behavior: "instant",
|
|
394
|
+
[i === "vertical" ? "top" : "left"]: n
|
|
395
|
+
}) : i === "vertical" ? e.scrollTop = n : e.scrollLeft = n;
|
|
396
|
+
}, [e, o]), Y(() => {
|
|
397
|
+
if (f && e && p) return;
|
|
398
|
+
let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) : Ne({
|
|
399
|
+
cachedBounds: x,
|
|
400
|
+
containerScrollOffset: C,
|
|
401
|
+
containerSize: y,
|
|
402
|
+
itemCount: o,
|
|
403
|
+
overscanCount: u
|
|
404
|
+
});
|
|
405
|
+
E((e) => Ae(t, e) ? e : t);
|
|
269
406
|
}, [
|
|
407
|
+
x,
|
|
270
408
|
e,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
409
|
+
y,
|
|
410
|
+
i,
|
|
411
|
+
M,
|
|
412
|
+
C,
|
|
413
|
+
f,
|
|
414
|
+
o,
|
|
415
|
+
u,
|
|
416
|
+
p
|
|
417
|
+
]), Y(() => {
|
|
418
|
+
if (!e || f) return;
|
|
275
419
|
let t = () => {
|
|
276
|
-
|
|
277
|
-
let { scrollLeft: n, scrollTop:
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
containerSize:
|
|
286
|
-
itemCount:
|
|
287
|
-
overscanCount:
|
|
420
|
+
E((t) => {
|
|
421
|
+
let { scrollLeft: n, scrollTop: r } = e, s = be({
|
|
422
|
+
containerElement: e,
|
|
423
|
+
direction: i,
|
|
424
|
+
isRtl: a,
|
|
425
|
+
scrollOffset: i === "vertical" ? r : n
|
|
426
|
+
}), c = Ne({
|
|
427
|
+
cachedBounds: x,
|
|
428
|
+
containerScrollOffset: s,
|
|
429
|
+
containerSize: y,
|
|
430
|
+
itemCount: o,
|
|
431
|
+
overscanCount: u
|
|
288
432
|
});
|
|
289
|
-
return
|
|
433
|
+
return Ae(c, t) ? t : c;
|
|
290
434
|
});
|
|
291
435
|
};
|
|
292
436
|
return e.addEventListener("scroll", t), () => {
|
|
293
437
|
e.removeEventListener("scroll", t);
|
|
294
438
|
};
|
|
295
439
|
}, [
|
|
296
|
-
|
|
440
|
+
x,
|
|
297
441
|
e,
|
|
298
|
-
|
|
299
|
-
|
|
442
|
+
y,
|
|
443
|
+
i,
|
|
300
444
|
a,
|
|
301
|
-
|
|
445
|
+
f,
|
|
446
|
+
o,
|
|
447
|
+
u
|
|
448
|
+
]);
|
|
449
|
+
let P = _e(() => {
|
|
450
|
+
if (!e || !p) return;
|
|
451
|
+
let { offset: t, size: n, viewportSize: r } = De({
|
|
452
|
+
containerElement: e,
|
|
453
|
+
direction: i,
|
|
454
|
+
isRtl: a,
|
|
455
|
+
scrollTarget: p
|
|
456
|
+
});
|
|
457
|
+
v(r);
|
|
458
|
+
let s = Ne({
|
|
459
|
+
cachedBounds: x,
|
|
460
|
+
containerScrollOffset: t,
|
|
461
|
+
containerSize: n,
|
|
462
|
+
itemCount: o,
|
|
463
|
+
overscanCount: u
|
|
464
|
+
});
|
|
465
|
+
E((e) => Ae(s, e) ? e : s);
|
|
466
|
+
});
|
|
467
|
+
return Y(() => {
|
|
468
|
+
f && P();
|
|
469
|
+
}), Y(() => {
|
|
470
|
+
if (!f || !e || !p) return;
|
|
471
|
+
let t = X(e), n = () => P();
|
|
472
|
+
p.addEventListener("scroll", n, { passive: !0 }), e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("resize", n);
|
|
473
|
+
let r, i = me(e);
|
|
474
|
+
i && !Se(p) && (r = new i(n), r.observe(p));
|
|
475
|
+
let a = xe({
|
|
476
|
+
container: Se(p) ? p.document.documentElement : p,
|
|
477
|
+
element: e,
|
|
478
|
+
onChange: n
|
|
479
|
+
});
|
|
480
|
+
return () => {
|
|
481
|
+
p.removeEventListener("scroll", n), e.removeEventListener("scroll", n), t.removeEventListener("resize", n), r?.disconnect(), a();
|
|
482
|
+
};
|
|
483
|
+
}, [
|
|
484
|
+
e,
|
|
485
|
+
f,
|
|
486
|
+
p,
|
|
487
|
+
P
|
|
302
488
|
]), {
|
|
303
|
-
getCellBounds:
|
|
304
|
-
getEstimatedSize:
|
|
305
|
-
|
|
306
|
-
let
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
489
|
+
getCellBounds: w,
|
|
490
|
+
getEstimatedSize: j,
|
|
491
|
+
getScrollPositionForIndex: _e(({ align: t = "auto", index: n }) => {
|
|
492
|
+
let r = ({ clamp: e, containerScrollOffset: r, containerSize: i, padding: a }) => {
|
|
493
|
+
if (a.start === 0 && a.end === 0) return Me({
|
|
494
|
+
align: t,
|
|
495
|
+
cachedBounds: x,
|
|
496
|
+
clamp: e,
|
|
497
|
+
containerScrollOffset: r,
|
|
498
|
+
containerSize: i,
|
|
499
|
+
index: n,
|
|
500
|
+
itemCount: o,
|
|
501
|
+
itemSize: b
|
|
502
|
+
});
|
|
503
|
+
let s = Me({
|
|
504
|
+
align: t,
|
|
505
|
+
cachedBounds: x,
|
|
506
|
+
clamp: !1,
|
|
507
|
+
containerScrollOffset: r + a.start,
|
|
508
|
+
containerSize: Math.max(0, i - a.start - a.end),
|
|
509
|
+
index: n,
|
|
510
|
+
itemCount: o,
|
|
511
|
+
itemSize: b
|
|
512
|
+
}) - a.start;
|
|
513
|
+
return e ? Math.max(0, Math.min(j() - i, s)) : s;
|
|
514
|
+
};
|
|
515
|
+
if (f && e && p && !Ee(e, i)) {
|
|
516
|
+
let { viewportOffset: t, viewportSize: n } = De({
|
|
517
|
+
containerElement: e,
|
|
518
|
+
direction: i,
|
|
519
|
+
isRtl: a,
|
|
520
|
+
scrollTarget: p
|
|
521
|
+
}), o = r({
|
|
522
|
+
clamp: !1,
|
|
523
|
+
containerScrollOffset: t,
|
|
524
|
+
containerSize: n,
|
|
525
|
+
padding: Oe({
|
|
526
|
+
direction: i,
|
|
527
|
+
isRtl: a,
|
|
528
|
+
scrollTarget: p,
|
|
529
|
+
viewportSize: n
|
|
530
|
+
})
|
|
531
|
+
}) - t, s = i === "horizontal" && a ? -o : o;
|
|
532
|
+
return {
|
|
533
|
+
scrollOffset: we(p, i) + s,
|
|
534
|
+
scrollTarget: p
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
let s = e ? i === "vertical" ? e.scrollTop : e.scrollLeft : 0, c = f && e ? i === "vertical" ? e.clientHeight : e.clientWidth : y, l = r({
|
|
538
|
+
clamp: !0,
|
|
539
|
+
containerScrollOffset: be({
|
|
317
540
|
containerElement: e,
|
|
318
|
-
direction:
|
|
319
|
-
isRtl:
|
|
541
|
+
direction: i,
|
|
542
|
+
isRtl: a,
|
|
320
543
|
scrollOffset: s
|
|
321
|
-
}),
|
|
322
|
-
|
|
323
|
-
|
|
544
|
+
}),
|
|
545
|
+
containerSize: c,
|
|
546
|
+
padding: e ? Oe({
|
|
547
|
+
direction: i,
|
|
548
|
+
isRtl: a,
|
|
549
|
+
scrollTarget: e,
|
|
550
|
+
viewportSize: c
|
|
551
|
+
}) : {
|
|
552
|
+
end: 0,
|
|
553
|
+
start: 0
|
|
324
554
|
}
|
|
325
|
-
|
|
555
|
+
});
|
|
556
|
+
if (e && (!f || p)) {
|
|
557
|
+
if (l = be({
|
|
558
|
+
containerElement: e,
|
|
559
|
+
direction: i,
|
|
560
|
+
isRtl: a,
|
|
561
|
+
scrollOffset: l
|
|
562
|
+
}), !f && typeof e.scrollTo != "function") {
|
|
563
|
+
let e = M(l);
|
|
564
|
+
Ae(T, e) || E(e);
|
|
565
|
+
}
|
|
566
|
+
return {
|
|
567
|
+
scrollOffset: l,
|
|
568
|
+
scrollTarget: e
|
|
569
|
+
};
|
|
326
570
|
}
|
|
327
571
|
}),
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
572
|
+
scrollTarget: p,
|
|
573
|
+
startIndexOverscan: O,
|
|
574
|
+
startIndexVisible: D,
|
|
575
|
+
stopIndexOverscan: A,
|
|
576
|
+
stopIndexVisible: k
|
|
332
577
|
};
|
|
333
578
|
}
|
|
334
|
-
function
|
|
335
|
-
|
|
579
|
+
function Le(e) {
|
|
580
|
+
let [t, n] = U(e);
|
|
581
|
+
return Ae(t, e) ? t : (n(e), e);
|
|
336
582
|
}
|
|
337
|
-
function
|
|
583
|
+
function Re(e, t) {
|
|
338
584
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
339
|
-
return
|
|
585
|
+
return Ae(n, a) && Ae(r, o) && Ae(i, s);
|
|
340
586
|
}
|
|
341
|
-
|
|
587
|
+
var ze = "data-react-window-index", Be = "data-index";
|
|
588
|
+
function Ve(e) {
|
|
589
|
+
let t = e.getAttribute(ze) ?? e.getAttribute(Be);
|
|
590
|
+
return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
|
|
591
|
+
}
|
|
592
|
+
var He = 1e3, Ue = 500;
|
|
593
|
+
function We(e) {
|
|
594
|
+
return 1 - (1 - e) ** 3;
|
|
595
|
+
}
|
|
596
|
+
function Ge({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, itemCount: i, itemElements: a, scrollTarget: o, getScrollPositionForIndex: s }) {
|
|
597
|
+
let c = e === "vertical", l = H(null), u = H(void 0), d = _e(() => {
|
|
598
|
+
l.current = null, u.current !== void 0 && (u.current.view.cancelAnimationFrame(u.current.id), u.current = void 0);
|
|
599
|
+
}), f = _e(() => {
|
|
600
|
+
let e = X(t);
|
|
601
|
+
u.current = {
|
|
602
|
+
id: e.requestAnimationFrame(p),
|
|
603
|
+
view: e
|
|
604
|
+
};
|
|
605
|
+
}), p = _e(() => {
|
|
606
|
+
u.current = void 0;
|
|
607
|
+
let o = l.current;
|
|
608
|
+
if (!o) return;
|
|
609
|
+
let p = performance.now();
|
|
610
|
+
if (!t || !r || o.index >= i || o.animation !== void 0 && p >= o.animation.deadline) {
|
|
611
|
+
d();
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
let m = s({
|
|
615
|
+
align: o.align,
|
|
616
|
+
index: o.index
|
|
617
|
+
});
|
|
618
|
+
if (m !== void 0) {
|
|
619
|
+
let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, Te(r, e)));
|
|
620
|
+
o.animation === void 0 && (o.animation = {
|
|
621
|
+
deadline: p + (o.smooth ? Ue : 0) + He,
|
|
622
|
+
startOffset: we(r, e),
|
|
623
|
+
startTime: p
|
|
624
|
+
});
|
|
625
|
+
let l = o.smooth ? (p - o.animation.startTime) / Ue : 1;
|
|
626
|
+
if (l < 1) {
|
|
627
|
+
let { startOffset: e } = o.animation;
|
|
628
|
+
o.stableFrames = 0, r.scrollTo({
|
|
629
|
+
behavior: "instant",
|
|
630
|
+
[c ? "top" : "left"]: e + (s - e) * We(l)
|
|
631
|
+
});
|
|
632
|
+
} else if (Math.abs(s - we(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
|
|
633
|
+
behavior: "instant",
|
|
634
|
+
[c ? "top" : "left"]: s
|
|
635
|
+
});
|
|
636
|
+
else {
|
|
637
|
+
let e = a.current;
|
|
638
|
+
if (!(e.some((e) => Ve(e) === o.index) && e.every((e) => {
|
|
639
|
+
let t = Ve(e);
|
|
640
|
+
if (t === void 0 || t >= i) return !0;
|
|
641
|
+
let r = c ? e.offsetHeight : e.offsetWidth;
|
|
642
|
+
return Math.abs(n(t).size - r) <= 1;
|
|
643
|
+
}))) o.stableFrames = 0;
|
|
644
|
+
else if (++o.stableFrames >= 2) {
|
|
645
|
+
d();
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
f();
|
|
651
|
+
});
|
|
652
|
+
return Y(() => {
|
|
653
|
+
let e = o ?? t;
|
|
654
|
+
if (!e) return;
|
|
655
|
+
let n = (e) => {
|
|
656
|
+
switch (e.key) {
|
|
657
|
+
case "ArrowUp":
|
|
658
|
+
case "ArrowDown":
|
|
659
|
+
case "ArrowLeft":
|
|
660
|
+
case "ArrowRight":
|
|
661
|
+
case "PageUp":
|
|
662
|
+
case "PageDown":
|
|
663
|
+
case "Home":
|
|
664
|
+
case "End":
|
|
665
|
+
case " ": d();
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
return e.addEventListener("wheel", d, { passive: !0 }), e.addEventListener("touchstart", d, { passive: !0 }), e.addEventListener("pointerdown", d), e.addEventListener("keydown", n), () => {
|
|
669
|
+
d(), e.removeEventListener("wheel", d), e.removeEventListener("touchstart", d), e.removeEventListener("pointerdown", d), e.removeEventListener("keydown", n);
|
|
670
|
+
};
|
|
671
|
+
}, [
|
|
672
|
+
d,
|
|
673
|
+
t,
|
|
674
|
+
o
|
|
675
|
+
]), L(({ align: n = "auto", behavior: i = "auto", index: a }) => {
|
|
676
|
+
if (r && n === "smart") {
|
|
677
|
+
let t = s({
|
|
678
|
+
align: "auto",
|
|
679
|
+
index: a
|
|
680
|
+
});
|
|
681
|
+
n = t === void 0 || t.scrollOffset === we(t.scrollTarget, e) ? "auto" : "center";
|
|
682
|
+
}
|
|
683
|
+
let o = s({
|
|
684
|
+
align: n,
|
|
685
|
+
index: a
|
|
686
|
+
});
|
|
687
|
+
if (d(), o && typeof o.scrollTarget.scrollTo == "function") {
|
|
688
|
+
let { scrollOffset: e, scrollTarget: s } = o;
|
|
689
|
+
if (r) {
|
|
690
|
+
let e = i === "smooth" && t?.ownerDocument.visibilityState !== "hidden";
|
|
691
|
+
if (l.current = {
|
|
692
|
+
align: n,
|
|
693
|
+
index: a,
|
|
694
|
+
smooth: e,
|
|
695
|
+
stableFrames: 0
|
|
696
|
+
}, f(), e) return;
|
|
697
|
+
}
|
|
698
|
+
s.scrollTo({
|
|
699
|
+
behavior: r ? "instant" : i,
|
|
700
|
+
[c ? "top" : "left"]: e
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
}, [
|
|
704
|
+
d,
|
|
705
|
+
e,
|
|
706
|
+
t,
|
|
707
|
+
r,
|
|
708
|
+
c,
|
|
709
|
+
f,
|
|
710
|
+
s
|
|
711
|
+
]);
|
|
712
|
+
}
|
|
713
|
+
function Ke({ callback: e, element: t, enabled: n = !0 }) {
|
|
714
|
+
let r = _e(e);
|
|
715
|
+
R(() => {
|
|
716
|
+
if (!n || !t) return;
|
|
717
|
+
let e = X(t), i = e.requestAnimationFrame(() => {
|
|
718
|
+
i = e.requestAnimationFrame(r);
|
|
719
|
+
});
|
|
720
|
+
return () => {
|
|
721
|
+
e.cancelAnimationFrame(i);
|
|
722
|
+
};
|
|
723
|
+
}, [
|
|
724
|
+
t,
|
|
725
|
+
n,
|
|
726
|
+
r
|
|
727
|
+
]);
|
|
728
|
+
}
|
|
729
|
+
function qe({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
|
|
730
|
+
if (r < 0 || i < r) return [];
|
|
731
|
+
let a = [], o = /* @__PURE__ */ new Set(), s = !0;
|
|
732
|
+
for (let t of e) {
|
|
733
|
+
let e = t.getAttribute("aria-posinset");
|
|
734
|
+
if (e === null) continue;
|
|
735
|
+
let c = Number(e) - 1;
|
|
736
|
+
if (!/^\d+$/.test(e) || c < r || c > i || o.has(c) || t.getAttribute("aria-setsize") !== `${n}`) {
|
|
737
|
+
s = !1;
|
|
738
|
+
break;
|
|
739
|
+
}
|
|
740
|
+
o.add(c), a.push({
|
|
741
|
+
element: t,
|
|
742
|
+
index: c
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
if (s && a.length > 0) return a;
|
|
746
|
+
let c = Math.min(e.length, i - r + 1);
|
|
747
|
+
return (t ? e.slice(e.length - c) : e.slice(0, c)).map((e, t) => ({
|
|
748
|
+
element: e,
|
|
749
|
+
index: r + t
|
|
750
|
+
}));
|
|
751
|
+
}
|
|
752
|
+
function Je(e) {
|
|
342
753
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
343
754
|
}
|
|
344
|
-
var
|
|
345
|
-
function
|
|
346
|
-
let
|
|
347
|
-
|
|
348
|
-
|
|
755
|
+
var Ye = "data-react-window-sizer";
|
|
756
|
+
function Xe({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffset: r = 0, listRef: i, onResize: a, onRowsRendered: o, overscanCount: s = 3, rowComponent: c, rowCount: l, rowHeight: u, rowKey: d, rowProps: f, scrollElement: p, tagName: m = "div", style: h, ...g }) {
|
|
757
|
+
let _ = Le(f), v = V(() => I(c, Re), [c]), [y, b] = U(null), x = Je(u), S = V(() => x ? (e) => u.getRowHeight(e) ?? u.getAverageRowHeight() : u, [x, u]), C = pe(), [w, T] = U(() => C && x), E = H(u);
|
|
758
|
+
Y(() => {
|
|
759
|
+
w && E.current !== u && T(!1);
|
|
760
|
+
}, [w, u]), Ke({
|
|
761
|
+
callback: () => T(!1),
|
|
762
|
+
element: y,
|
|
763
|
+
enabled: w
|
|
764
|
+
});
|
|
765
|
+
let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: L } = Ie({
|
|
766
|
+
containerElement: y,
|
|
767
|
+
containerStyle: h,
|
|
349
768
|
defaultContainerSize: n,
|
|
769
|
+
defaultScrollOffset: r,
|
|
350
770
|
direction: "vertical",
|
|
351
|
-
itemCount:
|
|
352
|
-
itemProps:
|
|
353
|
-
itemSize:
|
|
354
|
-
onResize:
|
|
355
|
-
overscanCount:
|
|
771
|
+
itemCount: l,
|
|
772
|
+
itemProps: _,
|
|
773
|
+
itemSize: S,
|
|
774
|
+
onResize: a,
|
|
775
|
+
overscanCount: s,
|
|
776
|
+
scrollElement: p
|
|
777
|
+
}), z = H([]), B = Ge({
|
|
778
|
+
direction: "vertical",
|
|
779
|
+
element: y,
|
|
780
|
+
getCellBounds: D,
|
|
781
|
+
isDynamicSize: x,
|
|
782
|
+
itemCount: l,
|
|
783
|
+
itemElements: z,
|
|
784
|
+
scrollTarget: k,
|
|
785
|
+
getScrollPositionForIndex: A
|
|
356
786
|
});
|
|
357
|
-
|
|
787
|
+
ee(i, () => ({
|
|
358
788
|
get element() {
|
|
359
|
-
return
|
|
789
|
+
return y;
|
|
360
790
|
},
|
|
361
|
-
scrollToRow
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
if (
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
});
|
|
379
|
-
if (v) return l.observeRowElements(e);
|
|
791
|
+
scrollToRow: B
|
|
792
|
+
}), [y, B]);
|
|
793
|
+
let W = w && x && j === 0;
|
|
794
|
+
Y(() => {
|
|
795
|
+
if (!y) return;
|
|
796
|
+
let e = Array.from(y.children).filter((e) => !e.hasAttribute(Ye)), t = qe({
|
|
797
|
+
elements: e,
|
|
798
|
+
isFlowLayout: W,
|
|
799
|
+
rowCount: l,
|
|
800
|
+
startIndex: j,
|
|
801
|
+
stopIndex: N
|
|
802
|
+
}), n = t.map(({ element: e }) => e);
|
|
803
|
+
if (e.forEach((e) => {
|
|
804
|
+
n.includes(e) || e.removeAttribute(ze);
|
|
805
|
+
}), t.forEach(({ element: e, index: t }) => {
|
|
806
|
+
e.setAttribute(ze, `${t}`);
|
|
807
|
+
}), z.current = n, x) return u.observeRowElements(n);
|
|
380
808
|
}, [
|
|
381
|
-
g,
|
|
382
809
|
v,
|
|
810
|
+
y,
|
|
811
|
+
x,
|
|
812
|
+
W,
|
|
383
813
|
l,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
814
|
+
u,
|
|
815
|
+
d,
|
|
816
|
+
_,
|
|
817
|
+
j,
|
|
818
|
+
N
|
|
819
|
+
]), R(() => {
|
|
820
|
+
j >= 0 && N >= 0 && o && o({
|
|
821
|
+
startIndex: M,
|
|
822
|
+
stopIndex: L
|
|
390
823
|
}, {
|
|
391
|
-
startIndex:
|
|
392
|
-
stopIndex:
|
|
824
|
+
startIndex: j,
|
|
825
|
+
stopIndex: N
|
|
393
826
|
});
|
|
394
827
|
}, [
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
828
|
+
o,
|
|
829
|
+
j,
|
|
830
|
+
M,
|
|
831
|
+
N,
|
|
832
|
+
L
|
|
400
833
|
]);
|
|
401
|
-
let
|
|
834
|
+
let te = V(() => {
|
|
402
835
|
let e = [];
|
|
403
|
-
if (
|
|
404
|
-
let n =
|
|
405
|
-
e.push(/* @__PURE__ */
|
|
406
|
-
...
|
|
836
|
+
if (l > 0) for (let t = j; t <= N; t++) {
|
|
837
|
+
let n = D(t);
|
|
838
|
+
e.push(/* @__PURE__ */ F(v, {
|
|
839
|
+
..._,
|
|
407
840
|
ariaAttributes: {
|
|
408
841
|
"aria-posinset": t + 1,
|
|
409
|
-
"aria-setsize":
|
|
842
|
+
"aria-setsize": l,
|
|
410
843
|
role: "listitem"
|
|
411
844
|
},
|
|
412
|
-
key: t,
|
|
845
|
+
key: d ? d(t, _) : t,
|
|
413
846
|
index: t,
|
|
414
|
-
style: {
|
|
847
|
+
style: W ? { width: "100%" } : {
|
|
415
848
|
position: "absolute",
|
|
416
849
|
left: 0,
|
|
417
850
|
transform: `translateY(${n.scrollOffset}px)`,
|
|
418
|
-
height:
|
|
851
|
+
height: x ? void 0 : n.size,
|
|
419
852
|
width: "100%"
|
|
420
853
|
}
|
|
421
854
|
}));
|
|
422
855
|
}
|
|
423
856
|
return e;
|
|
424
857
|
}, [
|
|
425
|
-
h,
|
|
426
|
-
y,
|
|
427
858
|
v,
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
859
|
+
D,
|
|
860
|
+
x,
|
|
861
|
+
W,
|
|
862
|
+
l,
|
|
863
|
+
d,
|
|
864
|
+
_,
|
|
865
|
+
j,
|
|
866
|
+
N
|
|
867
|
+
]), K = /* @__PURE__ */ G("div", {
|
|
433
868
|
"aria-hidden": !0,
|
|
869
|
+
[Ye]: "",
|
|
434
870
|
style: {
|
|
435
|
-
|
|
871
|
+
position: W ? "absolute" : void 0,
|
|
872
|
+
top: W ? 0 : void 0,
|
|
873
|
+
height: O(),
|
|
436
874
|
width: "100%",
|
|
437
875
|
zIndex: -1
|
|
438
876
|
}
|
|
439
|
-
});
|
|
440
|
-
return
|
|
877
|
+
}, "sizer"), q = /* @__PURE__ */ G(P, { children: e }, "children"), J = /* @__PURE__ */ G(P, { children: te }, "rows");
|
|
878
|
+
return F(m, {
|
|
441
879
|
role: "list",
|
|
442
|
-
...
|
|
880
|
+
...g,
|
|
443
881
|
className: t,
|
|
444
|
-
ref:
|
|
882
|
+
ref: b,
|
|
445
883
|
style: {
|
|
446
884
|
position: "relative",
|
|
447
|
-
maxHeight: "100%",
|
|
448
885
|
flexGrow: 1,
|
|
449
|
-
|
|
450
|
-
|
|
886
|
+
...p === void 0 && {
|
|
887
|
+
maxHeight: "100%",
|
|
888
|
+
overflowY: "auto"
|
|
889
|
+
},
|
|
890
|
+
...h
|
|
451
891
|
}
|
|
452
|
-
},
|
|
892
|
+
}, ...W ? [q, J] : [J, q], K);
|
|
453
893
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
894
|
+
var Ze = /* @__PURE__ */ Object.assign(Xe, { displayName: "List" }), Q = /* @__PURE__ */ function(e) {
|
|
895
|
+
return e.All = "all", e.Chat = "chat", e.Task = "task", e;
|
|
896
|
+
}({}), Qe = /* @__PURE__ */ function(e) {
|
|
897
|
+
return e.Avatar = "avatar", e.Indicator = "indicator", e;
|
|
898
|
+
}({}), $e = /* @__PURE__ */ function(e) {
|
|
457
899
|
return e.Header = "header", e.Item = "item", e;
|
|
458
|
-
}({}),
|
|
900
|
+
}({}), et = (e, t) => t === n.All || e.source === t, tt = (t, n) => {
|
|
901
|
+
if (n === Q.All) return !0;
|
|
902
|
+
let r = t.kind ?? e.Chat;
|
|
903
|
+
return n === Q.Task ? r === e.Task : r === e.Chat;
|
|
904
|
+
}, nt = (e, t) => !t || e.title.toLowerCase().includes(t.toLowerCase()), rt = (e) => `${60 + e * 23 % 35}%`, it = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", at = (e, t) => {
|
|
905
|
+
let n = t.rows[e];
|
|
906
|
+
return t.rowVariant === Qe.Indicator ? n.kind === $e.Item ? 34 : e === 0 ? 32 : 40 : n.kind === $e.Item ? 36 : e === 0 ? 24 : 56;
|
|
907
|
+
}, ot = 5, st = (e) => Math.max(ot, Math.ceil(Math.ceil(e / 36) / 2)), ct = (e, { startIndex: t, stopIndex: n }) => {
|
|
908
|
+
let r = /* @__PURE__ */ new Set();
|
|
909
|
+
for (let i = Math.max(0, t); i <= Math.min(n, e.length - 1); i++) {
|
|
910
|
+
let t = e[i];
|
|
911
|
+
t.kind === $e.Item && r.add(t.item.id);
|
|
912
|
+
}
|
|
913
|
+
return [...r];
|
|
914
|
+
}, lt = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), ut = (e) => {
|
|
459
915
|
switch (e) {
|
|
460
|
-
case
|
|
461
|
-
case
|
|
462
|
-
default: return
|
|
916
|
+
case n.Shared: return n.Shared;
|
|
917
|
+
case n.Organization: return n.Organization;
|
|
918
|
+
default: return n.MyChats;
|
|
463
919
|
}
|
|
464
|
-
},
|
|
920
|
+
}, dt = (e, t) => {
|
|
465
921
|
let n = null;
|
|
466
|
-
for (let r of e) if (r.kind ===
|
|
922
|
+
for (let r of e) if (r.kind === $e.Header) n = r.groupKey;
|
|
467
923
|
else if (r.item.id === t) return n;
|
|
468
924
|
return null;
|
|
469
|
-
},
|
|
925
|
+
}, ft = (e, t, r) => {
|
|
470
926
|
let i = /* @__PURE__ */ new Set();
|
|
471
|
-
if (
|
|
927
|
+
if (t != null && i.add(t), t === n.Pinned) {
|
|
472
928
|
let t = r.find((t) => t.id === e);
|
|
473
|
-
t && i.add(
|
|
474
|
-
} else i.add(
|
|
929
|
+
t && i.add(ut(t.source));
|
|
930
|
+
} else i.add(n.Pinned);
|
|
475
931
|
return i;
|
|
476
|
-
},
|
|
932
|
+
}, pt = (e, t, n, r) => {
|
|
477
933
|
let i = e.currentTarget.getBoundingClientRect();
|
|
478
934
|
if (e.clientY >= i.top + i.height / 2) return t;
|
|
479
935
|
let a = null, o = !1;
|
|
480
|
-
for (let e of n) if (e.kind ===
|
|
936
|
+
for (let e of n) if (e.kind === $e.Header) o = e.groupKey === r;
|
|
481
937
|
else if (o) {
|
|
482
938
|
if (e.item.id === t) return a;
|
|
483
939
|
a = e.item.id;
|
|
484
940
|
}
|
|
485
941
|
return null;
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
value: t.All,
|
|
489
|
-
labelKey: "all"
|
|
490
|
-
},
|
|
491
|
-
{
|
|
492
|
-
value: t.MyChats,
|
|
493
|
-
labelKey: "myChats"
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
value: t.Shared,
|
|
497
|
-
labelKey: "shared"
|
|
498
|
-
},
|
|
499
|
-
{
|
|
500
|
-
value: t.Organization,
|
|
501
|
-
labelKey: "organization"
|
|
502
|
-
}
|
|
503
|
-
], Oe = k(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => /* @__PURE__ */ I(v, {
|
|
504
|
-
items: N(() => De.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: D("!px-2", r)
|
|
514
|
-
})), ke = { button: "_button_vjird_1" }, Ae = k(({ label: e, onClick: t, labelClassName: r = "dial-small-semi-text", colors: a, className: o }) => /* @__PURE__ */ I("div", {
|
|
515
|
-
className: "px-3 py-2",
|
|
516
|
-
style: n({
|
|
517
|
-
"--cp-new-chat-bg": a?.background,
|
|
518
|
-
"--cp-new-chat-text": a?.text,
|
|
519
|
-
"--cp-new-chat-focus-outline": a?.focusOutline
|
|
520
|
-
}),
|
|
521
|
-
children: /* @__PURE__ */ I(d, {
|
|
522
|
-
label: e,
|
|
523
|
-
textClassName: r,
|
|
524
|
-
iconBefore: /* @__PURE__ */ I(ae, {
|
|
525
|
-
size: 18,
|
|
526
|
-
stroke: m,
|
|
527
|
-
className: "shrink-0",
|
|
528
|
-
"aria-hidden": !0
|
|
529
|
-
}),
|
|
530
|
-
onClick: t,
|
|
531
|
-
className: i("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", ke.button, o, se.newChatButton)
|
|
532
|
-
})
|
|
533
|
-
})), Z = {
|
|
942
|
+
}, $ = {
|
|
534
943
|
skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
|
|
535
|
-
item: "
|
|
536
|
-
itemActive: "
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
944
|
+
item: "_item_gcqru_2",
|
|
945
|
+
itemActive: "_itemActive_gcqru_15",
|
|
946
|
+
itemIndicator: "_itemIndicator_gcqru_24",
|
|
947
|
+
indicatorDot: "_indicatorDot_gcqru_28",
|
|
948
|
+
groupHeader: "_groupHeader_gcqru_32",
|
|
949
|
+
dropZoneActive: "_dropZoneActive_gcqru_36",
|
|
950
|
+
triggerActive: "_triggerActive_gcqru_40",
|
|
951
|
+
triggerIcon: "_triggerIcon_gcqru_43",
|
|
952
|
+
unreadDot: "_unreadDot_gcqru_51",
|
|
953
|
+
search: "_search_gcqru_59",
|
|
954
|
+
list: "_list_gcqru_70"
|
|
955
|
+
}, mt = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", variant: o = Qe.Avatar, dropZoneGroupKey: s, isDragOver: c, onDragOver: l, onDragLeave: u, onDrop: d }) => {
|
|
956
|
+
let f = s != null, p = o === Qe.Indicator;
|
|
957
|
+
return /* @__PURE__ */ K("button", {
|
|
546
958
|
type: "button",
|
|
547
959
|
"aria-expanded": t,
|
|
548
960
|
"aria-controls": r,
|
|
549
961
|
onClick: n,
|
|
550
|
-
onDragOver:
|
|
551
|
-
|
|
962
|
+
onDragOver: f ? (e) => {
|
|
963
|
+
f && (e.preventDefault(), l?.(s));
|
|
552
964
|
} : void 0,
|
|
553
|
-
onDragLeave:
|
|
554
|
-
|
|
965
|
+
onDragLeave: f ? (e) => {
|
|
966
|
+
f && (e.currentTarget.contains(e.relatedTarget) || u?.());
|
|
555
967
|
} : void 0,
|
|
556
|
-
onDrop:
|
|
557
|
-
|
|
968
|
+
onDrop: f ? (e) => {
|
|
969
|
+
f && (e.preventDefault(), d?.(s, s, null));
|
|
558
970
|
} : void 0,
|
|
559
|
-
className:
|
|
560
|
-
children: [
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
971
|
+
className: a("group flex h-6 w-full items-center gap-1 rounded text-start", p ? "px-2" : "py-1 pe-3", i, $.groupHeader, c && $.dropZoneActive),
|
|
972
|
+
children: [
|
|
973
|
+
!p && (t ? /* @__PURE__ */ G(q, {
|
|
974
|
+
size: 12,
|
|
975
|
+
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
976
|
+
"aria-hidden": !0
|
|
977
|
+
}) : /* @__PURE__ */ G(J, {
|
|
978
|
+
size: 12,
|
|
979
|
+
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
980
|
+
"aria-hidden": !0
|
|
981
|
+
})),
|
|
982
|
+
p ? /* @__PURE__ */ G("span", {
|
|
983
|
+
className: "max-w-full min-w-0",
|
|
984
|
+
children: /* @__PURE__ */ G(v, { text: e })
|
|
985
|
+
}) : /* @__PURE__ */ G(v, { text: e }),
|
|
986
|
+
p && (t ? /* @__PURE__ */ G(ne, {
|
|
987
|
+
size: m.SM,
|
|
988
|
+
stroke: h,
|
|
989
|
+
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
990
|
+
"aria-hidden": !0
|
|
991
|
+
}) : /* @__PURE__ */ G(re, {
|
|
992
|
+
size: m.SM,
|
|
993
|
+
stroke: h,
|
|
994
|
+
className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
995
|
+
"aria-hidden": !0
|
|
996
|
+
}))
|
|
997
|
+
]
|
|
569
998
|
});
|
|
570
|
-
},
|
|
571
|
-
let [
|
|
572
|
-
|
|
573
|
-
}, [
|
|
999
|
+
}, ht = I(({ item: e, isActive: n, onSelectConversation: r, searchQuery: i = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", unreadItemTitleClassName: u = "dial-small-semi-text", itemIconBadgeClassName: d, unreadIndicatorLabel: p = "Unread", variant: v = Qe.Avatar, rowGroupKey: y, rows: S, draggingId: C, dragOverId: w, allowedDropGroups: T, onDragStart: E, onDragEnd: D, onDragOver: O, onDragLeave: k, onDrop: M }) => {
|
|
1000
|
+
let [N, P] = U(!1), F = H(null), I = L((t) => {
|
|
1001
|
+
P(t), t && F.current && s?.(e, F.current);
|
|
1002
|
+
}, [e, s]), R = V(() => o?.(e) ?? [], [o, e]), z = R.length > 0, ee = V(() => ({ tooltip: e.iconTooltip }), [e.iconTooltip]), B = V(() => ({ badgeClassName: d }), [d]), W = v === Qe.Indicator, te = e.leadingIcon ? /* @__PURE__ */ G("span", {
|
|
574
1003
|
className: "flex size-6 shrink-0 items-center justify-center",
|
|
575
|
-
children:
|
|
576
|
-
}) :
|
|
577
|
-
variant:
|
|
578
|
-
width:
|
|
579
|
-
height:
|
|
580
|
-
color:
|
|
1004
|
+
children: e.leadingIcon
|
|
1005
|
+
}) : e.isIconLoading ? /* @__PURE__ */ G(A, {
|
|
1006
|
+
variant: j.Circular,
|
|
1007
|
+
width: m.LG,
|
|
1008
|
+
height: m.LG,
|
|
1009
|
+
color: $.skeletonColor,
|
|
581
1010
|
"aria-hidden": !0
|
|
582
|
-
}) : /* @__PURE__ */
|
|
583
|
-
src:
|
|
584
|
-
size:
|
|
585
|
-
initialsName:
|
|
586
|
-
labels:
|
|
587
|
-
styles:
|
|
588
|
-
}),
|
|
1011
|
+
}) : /* @__PURE__ */ G(t, {
|
|
1012
|
+
src: e.iconUrl,
|
|
1013
|
+
size: m.LG,
|
|
1014
|
+
initialsName: e.iconTooltip ?? "",
|
|
1015
|
+
labels: ee,
|
|
1016
|
+
styles: B
|
|
1017
|
+
}), q = it(z, N), J = /* @__PURE__ */ K("span", {
|
|
589
1018
|
className: "flex size-6 shrink-0 items-center justify-center",
|
|
590
|
-
children: [/* @__PURE__ */
|
|
591
|
-
className:
|
|
1019
|
+
children: [/* @__PURE__ */ G("span", {
|
|
1020
|
+
className: a("size-2 rounded-full", e.isUnread ? a("size-[7.11px]", $.unreadDot) : $.indicatorDot),
|
|
592
1021
|
"aria-hidden": !0
|
|
593
|
-
}), /* @__PURE__ */
|
|
1022
|
+
}), e.isUnread && /* @__PURE__ */ G("span", {
|
|
594
1023
|
className: "sr-only",
|
|
595
|
-
children:
|
|
1024
|
+
children: p
|
|
596
1025
|
})]
|
|
597
|
-
})
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
1026
|
+
}), ne = e.isUnread && !W ? /* @__PURE__ */ K("span", {
|
|
1027
|
+
className: "flex size-6 shrink-0 items-center justify-center",
|
|
1028
|
+
children: [/* @__PURE__ */ G("span", {
|
|
1029
|
+
className: a("size-[7.11px] rounded-full", $.unreadDot, z && (N ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
|
|
1030
|
+
"aria-hidden": !0
|
|
1031
|
+
}), /* @__PURE__ */ G("span", {
|
|
1032
|
+
className: "sr-only",
|
|
1033
|
+
children: p
|
|
1034
|
+
})]
|
|
1035
|
+
}) : void 0, re = y != null, ae = L((e) => {
|
|
1036
|
+
e.currentTarget.contains(e.relatedTarget) || k?.();
|
|
1037
|
+
}, [k]), oe = L((t) => {
|
|
1038
|
+
if (!y || !S || !M) return;
|
|
1039
|
+
t.preventDefault();
|
|
1040
|
+
let n = pt(t, e.id, S, y);
|
|
1041
|
+
M(e.id, y, n);
|
|
604
1042
|
}, [
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
]),
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
-
className:
|
|
612
|
-
draggable:
|
|
613
|
-
onDragStart:
|
|
614
|
-
onDragEnd:
|
|
615
|
-
onDragOver:
|
|
616
|
-
|
|
1043
|
+
e.id,
|
|
1044
|
+
S,
|
|
1045
|
+
y,
|
|
1046
|
+
M
|
|
1047
|
+
]), se = e.id === C, ce = e.id === w, le = y != null && (T?.has(y) ?? !1), ue = C != null;
|
|
1048
|
+
return /* @__PURE__ */ K("li", {
|
|
1049
|
+
className: a("group/conversation relative", se && "cursor-grabbing opacity-50", ce && le && "rounded", ce && le && $.dropZoneActive, ue && !se && !le && "cursor-not-allowed"),
|
|
1050
|
+
draggable: re || void 0,
|
|
1051
|
+
onDragStart: re ? () => E?.(e.id) : void 0,
|
|
1052
|
+
onDragEnd: re ? D : void 0,
|
|
1053
|
+
onDragOver: re ? (t) => {
|
|
1054
|
+
t.preventDefault(), O?.(e.id);
|
|
617
1055
|
} : void 0,
|
|
618
|
-
onDragLeave:
|
|
619
|
-
onDrop:
|
|
620
|
-
children: [/* @__PURE__ */
|
|
621
|
-
href:
|
|
1056
|
+
onDragLeave: re ? ae : void 0,
|
|
1057
|
+
onDrop: re ? oe : void 0,
|
|
1058
|
+
children: [/* @__PURE__ */ G("a", {
|
|
1059
|
+
href: e.href,
|
|
622
1060
|
className: "contents",
|
|
623
|
-
onClick: (
|
|
624
|
-
|
|
1061
|
+
onClick: (t) => {
|
|
1062
|
+
e.href && (t.preventDefault(), r(e.id));
|
|
625
1063
|
},
|
|
626
|
-
children: /* @__PURE__ */
|
|
627
|
-
iconBefore:
|
|
628
|
-
label: /* @__PURE__ */
|
|
629
|
-
text:
|
|
630
|
-
query:
|
|
631
|
-
className:
|
|
1064
|
+
children: /* @__PURE__ */ G(f, {
|
|
1065
|
+
iconBefore: W ? J : te,
|
|
1066
|
+
label: /* @__PURE__ */ G(x, {
|
|
1067
|
+
text: e.title,
|
|
1068
|
+
query: i,
|
|
1069
|
+
className: e.isUnread ? u : l,
|
|
632
1070
|
maxLines: 1
|
|
633
1071
|
}),
|
|
634
|
-
iconAfter:
|
|
1072
|
+
iconAfter: ne,
|
|
635
1073
|
textClassName: "min-w-0 flex-1",
|
|
636
1074
|
"aria-current": n ? "page" : void 0,
|
|
637
|
-
onClick:
|
|
638
|
-
tabIndex:
|
|
639
|
-
className:
|
|
1075
|
+
onClick: e.href ? void 0 : () => r(e.id),
|
|
1076
|
+
tabIndex: e.href ? -1 : void 0,
|
|
1077
|
+
className: a("h-8 w-full justify-start py-2 after:pointer-events-none", W ? "gap-0.5 ps-0" : "gap-2 ps-3", q, $.item, W && $.itemIndicator, n && $.itemActive, N && $.itemActive)
|
|
640
1078
|
})
|
|
641
|
-
}),
|
|
642
|
-
className:
|
|
643
|
-
children: /* @__PURE__ */
|
|
644
|
-
items:
|
|
645
|
-
onOpenChange:
|
|
1079
|
+
}), z && /* @__PURE__ */ G("div", {
|
|
1080
|
+
className: a("absolute inset-y-0 flex items-center", W ? "inset-e-2" : "inset-e-1", N ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
|
|
1081
|
+
children: /* @__PURE__ */ G(g, {
|
|
1082
|
+
items: R,
|
|
1083
|
+
onOpenChange: I,
|
|
646
1084
|
matchReferenceWidth: !1,
|
|
647
1085
|
listClassName: "w-[200px]",
|
|
648
|
-
children: /* @__PURE__ */
|
|
649
|
-
ref:
|
|
650
|
-
icon: /* @__PURE__ */
|
|
651
|
-
size:
|
|
652
|
-
className:
|
|
1086
|
+
children: /* @__PURE__ */ G(b, {
|
|
1087
|
+
ref: F,
|
|
1088
|
+
icon: /* @__PURE__ */ G(ie, {
|
|
1089
|
+
size: W ? m.SM : m.MD,
|
|
1090
|
+
className: $.triggerIcon,
|
|
653
1091
|
"aria-hidden": !0,
|
|
654
|
-
stroke:
|
|
1092
|
+
stroke: h
|
|
655
1093
|
}),
|
|
656
|
-
size:
|
|
1094
|
+
size: _.Small,
|
|
657
1095
|
"aria-label": c,
|
|
658
|
-
className:
|
|
1096
|
+
className: a(W && "size-6! min-h-0! min-w-0! p-1!", N && $.triggerActive)
|
|
659
1097
|
})
|
|
660
1098
|
})
|
|
661
1099
|
})]
|
|
662
1100
|
});
|
|
663
|
-
}),
|
|
664
|
-
let
|
|
665
|
-
if (
|
|
666
|
-
let r =
|
|
667
|
-
return /* @__PURE__ */
|
|
668
|
-
role: "
|
|
669
|
-
style:
|
|
670
|
-
className: e
|
|
671
|
-
children: /* @__PURE__ */
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
1101
|
+
}), gt = (e, t) => t ? e === 0 ? "pt-2" : "pt-4" : e === 0 ? "pt-0" : "pt-8", _t = ({ 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, rowVariant: h = Qe.Avatar, draggingId: g, dragOverId: _, allowedDropGroups: v, onDragStart: y, onDragEnd: b, onDragOver: x, onDragLeave: S, onDrop: C }) => {
|
|
1102
|
+
let w = r[e], T = h === Qe.Indicator;
|
|
1103
|
+
if (w.kind === $e.Header) {
|
|
1104
|
+
let r = w.groupKey === n.Pinned;
|
|
1105
|
+
return /* @__PURE__ */ G("div", {
|
|
1106
|
+
role: "listitem",
|
|
1107
|
+
style: t,
|
|
1108
|
+
className: gt(e, T),
|
|
1109
|
+
children: /* @__PURE__ */ G(mt, {
|
|
1110
|
+
variant: h,
|
|
1111
|
+
label: w.label,
|
|
1112
|
+
isExpanded: i.has(w.groupKey),
|
|
1113
|
+
onToggle: () => a(w.groupKey),
|
|
675
1114
|
listId: o,
|
|
676
1115
|
className: m?.groupHeaderClassName,
|
|
677
|
-
dropZoneGroupKey: r ?
|
|
678
|
-
isDragOver: r &&
|
|
679
|
-
onDragOver: r ?
|
|
680
|
-
onDragLeave: r ?
|
|
681
|
-
onDrop: r ?
|
|
1116
|
+
dropZoneGroupKey: r ? n.Pinned : void 0,
|
|
1117
|
+
isDragOver: r && _ === n.Pinned,
|
|
1118
|
+
onDragOver: r ? x : void 0,
|
|
1119
|
+
onDragLeave: r ? S : void 0,
|
|
1120
|
+
onDrop: r ? C : void 0
|
|
682
1121
|
})
|
|
683
1122
|
});
|
|
684
1123
|
}
|
|
685
|
-
return /* @__PURE__ */
|
|
1124
|
+
return /* @__PURE__ */ G("div", {
|
|
686
1125
|
role: "presentation",
|
|
687
|
-
style:
|
|
688
|
-
className: "pt-1",
|
|
689
|
-
children: /* @__PURE__ */
|
|
690
|
-
|
|
691
|
-
|
|
1126
|
+
style: t,
|
|
1127
|
+
className: T ? "pt-0.5" : "pt-1",
|
|
1128
|
+
children: /* @__PURE__ */ G(ht, {
|
|
1129
|
+
variant: h,
|
|
1130
|
+
item: w.item,
|
|
1131
|
+
isActive: w.item.id === s,
|
|
692
1132
|
searchQuery: c,
|
|
693
1133
|
onSelectConversation: l,
|
|
694
1134
|
getActions: u,
|
|
@@ -696,189 +1136,638 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
696
1136
|
actionsLabel: f,
|
|
697
1137
|
unreadIndicatorLabel: p,
|
|
698
1138
|
itemTitleClassName: m?.itemTitleClassName,
|
|
1139
|
+
unreadItemTitleClassName: m?.unreadItemTitleClassName,
|
|
699
1140
|
itemIconBadgeClassName: m?.itemIconBadgeClassName,
|
|
700
|
-
rowGroupKey:
|
|
1141
|
+
rowGroupKey: w.groupKey,
|
|
701
1142
|
rows: r,
|
|
702
|
-
draggingId:
|
|
703
|
-
dragOverId:
|
|
704
|
-
allowedDropGroups:
|
|
705
|
-
onDragStart:
|
|
706
|
-
onDragEnd:
|
|
707
|
-
onDragOver:
|
|
708
|
-
onDragLeave:
|
|
709
|
-
onDrop:
|
|
1143
|
+
draggingId: g,
|
|
1144
|
+
dragOverId: _,
|
|
1145
|
+
allowedDropGroups: v,
|
|
1146
|
+
onDragStart: y,
|
|
1147
|
+
onDragEnd: b,
|
|
1148
|
+
onDragOver: x,
|
|
1149
|
+
onDragLeave: S,
|
|
1150
|
+
onDrop: C
|
|
710
1151
|
})
|
|
711
1152
|
});
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
]),
|
|
718
|
-
let { colors:
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
let J = N(() => E?.length ? e.filter((e) => e.source == null || !E.includes(e.source)) : e, [e, E]), [Y, fe] = F(() => Ie), [pe, me] = F(5), he = te(), ge = P(null), ye = P(null), [xe, Ce] = F(null), [Ee, De] = F(null), [ke, je] = F(null), Me = P(null), Le = P(null), Re = A(({ height: e }) => {
|
|
723
|
-
me(Se(e));
|
|
724
|
-
}, []), ze = A((e) => {
|
|
725
|
-
ue(e ?? "");
|
|
726
|
-
}, []), Be = A((e) => {
|
|
727
|
-
fe((t) => {
|
|
1153
|
+
}, vt = /* @__PURE__ */ new Set([
|
|
1154
|
+
n.Pinned,
|
|
1155
|
+
n.MyChats,
|
|
1156
|
+
n.Shared,
|
|
1157
|
+
n.Organization
|
|
1158
|
+
]), yt = I(({ conversations: e, isLoading: t, isUpdatingTitles: i = !1, preserveActiveSearchResult: o = !1, onSelectConversation: s, activeConversationId: u, labels: d, searchQuery: f = "", activeFilter: p = n.All, activeTypeFilter: m = Q.All, hiddenSources: h, rowVariant: g, getActions: _, onActionMenuOpen: v, onMoveConversation: y, onVisibleConversationIdsChange: b, styles: x, id: S, className: T }) => {
|
|
1159
|
+
let { colors: E, typography: D, itemIconBadgeClassName: O } = x ?? {}, { emptyLabel: k, emptyDescription: j, noResultsLabel: M, noResultsDescription: N, sharedEmptyDescription: P = N, tabEmptyLabels: F, loadingLabel: I = "Loading conversations", updatingTitlesLabel: ee = "Updating conversation names", groupLabels: B, actionsLabel: W, unreadIndicatorLabel: te } = d, q = V(() => h?.length ? e.filter((e) => e.source == null || !h.includes(e.source)) : e, [e, h]), [J, ne] = U(() => vt), [re, ie] = U(5), ae = z(), oe = H(null), se = H(null), [ce, le] = U(null), [Y, de] = U(null), [fe, pe] = U(null), X = H(null), me = H(null), he = L(({ height: e }) => {
|
|
1160
|
+
ie(st(e));
|
|
1161
|
+
}, []), ge = L((e) => {
|
|
1162
|
+
ne((t) => {
|
|
728
1163
|
let n = new Set(t);
|
|
729
1164
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
730
1165
|
});
|
|
731
|
-
}, []),
|
|
732
|
-
|
|
733
|
-
}, []),
|
|
734
|
-
let n =
|
|
735
|
-
|
|
736
|
-
}, [
|
|
737
|
-
|
|
738
|
-
}, [
|
|
739
|
-
|
|
740
|
-
}, []),
|
|
741
|
-
|
|
742
|
-
}, []),
|
|
743
|
-
let r =
|
|
744
|
-
|
|
1166
|
+
}, []), _e = L(() => {
|
|
1167
|
+
X.current = null, me.current = null, le(null), de(null), pe(null);
|
|
1168
|
+
}, []), ve = L((e, t) => {
|
|
1169
|
+
let n = ft(e, dt(t, e), q);
|
|
1170
|
+
X.current = e, me.current = n, le(e), pe(n);
|
|
1171
|
+
}, [q]), ye = L(() => {
|
|
1172
|
+
_e();
|
|
1173
|
+
}, [_e]), be = L((e) => {
|
|
1174
|
+
de(e);
|
|
1175
|
+
}, []), xe = L(() => {
|
|
1176
|
+
de(null);
|
|
1177
|
+
}, []), Se = L((e, t, n) => {
|
|
1178
|
+
let r = X.current, i = me.current;
|
|
1179
|
+
_e(), r != null && r !== e && i?.has(t) && y?.({
|
|
745
1180
|
draggedId: r,
|
|
746
1181
|
targetGroupKey: t,
|
|
747
1182
|
afterId: n
|
|
748
1183
|
});
|
|
749
|
-
}, [
|
|
750
|
-
"--cp-item-hover":
|
|
751
|
-
"--cp-item-active":
|
|
752
|
-
"--cp-text":
|
|
753
|
-
"--cp-text-secondary":
|
|
754
|
-
"--cp-
|
|
755
|
-
"--cp-
|
|
756
|
-
"--cp-
|
|
757
|
-
"--cp-
|
|
758
|
-
"--cp-
|
|
759
|
-
"--cp-
|
|
760
|
-
"--cp-
|
|
761
|
-
"--cp-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
1184
|
+
}, [_e, y]), Ce = r({
|
|
1185
|
+
"--cp-item-hover": E?.itemHover,
|
|
1186
|
+
"--cp-item-active": E?.itemActive,
|
|
1187
|
+
"--cp-text": E?.text,
|
|
1188
|
+
"--cp-text-secondary": E?.textSecondary,
|
|
1189
|
+
"--cp-drop-zone-ring": E?.dropZoneRing,
|
|
1190
|
+
"--cp-trigger-bg": E?.triggerBackground,
|
|
1191
|
+
"--cp-trigger-icon": E?.triggerIcon,
|
|
1192
|
+
"--cp-trigger-icon-idle": E?.triggerIconIdle,
|
|
1193
|
+
"--cp-skeleton-color": E?.skeletonColor,
|
|
1194
|
+
"--cp-unread-dot": E?.unreadDot,
|
|
1195
|
+
"--cp-indicator-dot": E?.indicatorDot,
|
|
1196
|
+
"--cp-list-font-family": D?.fontFamily
|
|
1197
|
+
}), [we, Te] = U(null);
|
|
1198
|
+
R(() => {
|
|
1199
|
+
if (!o || !f || !u) {
|
|
1200
|
+
Te(null);
|
|
1201
|
+
return;
|
|
1202
|
+
}
|
|
1203
|
+
let e = q.find((e) => e.id === u);
|
|
1204
|
+
Te((t) => e && nt(e, f) ? t?.id === e.id && t.query === f ? t : {
|
|
1205
|
+
id: e.id,
|
|
1206
|
+
query: f
|
|
1207
|
+
} : t?.id === u && t.query === f ? t : null);
|
|
1208
|
+
}, [
|
|
1209
|
+
o,
|
|
1210
|
+
f,
|
|
1211
|
+
u,
|
|
1212
|
+
q
|
|
1213
|
+
]);
|
|
1214
|
+
let Ee = L((e) => {
|
|
1215
|
+
o && f && Te({
|
|
1216
|
+
id: e,
|
|
1217
|
+
query: f
|
|
1218
|
+
}), s(e);
|
|
1219
|
+
}, [
|
|
1220
|
+
o,
|
|
1221
|
+
f,
|
|
1222
|
+
s
|
|
1223
|
+
]), De = o && f !== "" && we?.query === f && we.id === u ? we.id : void 0, Oe = V(() => q.filter((e) => et(e, p) && tt(e, m) && (nt(e, f) || e.id === De)), [
|
|
765
1224
|
q,
|
|
766
|
-
|
|
767
|
-
|
|
1225
|
+
p,
|
|
1226
|
+
m,
|
|
1227
|
+
f,
|
|
1228
|
+
De
|
|
1229
|
+
]), ke = V(() => Oe.filter((e) => e.isPinned), [Oe]), Ae = V(() => Oe.filter((e) => !e.isPinned && e.source !== n.Shared && e.source !== n.Organization), [Oe]), je = V(() => Oe.filter((e) => !e.isPinned && e.source === n.Shared), [Oe]), Me = V(() => Oe.filter((e) => !e.isPinned && e.source === n.Organization), [Oe]), Ne = V(() => [
|
|
768
1230
|
{
|
|
769
|
-
key:
|
|
770
|
-
label:
|
|
771
|
-
items:
|
|
1231
|
+
key: n.Pinned,
|
|
1232
|
+
label: B?.pinned ?? "Pinned",
|
|
1233
|
+
items: ke
|
|
772
1234
|
},
|
|
773
1235
|
{
|
|
774
|
-
key:
|
|
775
|
-
label:
|
|
776
|
-
items:
|
|
1236
|
+
key: n.MyChats,
|
|
1237
|
+
label: B?.myChats ?? "My chats",
|
|
1238
|
+
items: Ae
|
|
777
1239
|
},
|
|
778
1240
|
{
|
|
779
|
-
key:
|
|
780
|
-
label:
|
|
781
|
-
items:
|
|
1241
|
+
key: n.Shared,
|
|
1242
|
+
label: B?.shared ?? "Shared",
|
|
1243
|
+
items: je
|
|
782
1244
|
},
|
|
783
1245
|
{
|
|
784
|
-
key:
|
|
785
|
-
label:
|
|
786
|
-
items:
|
|
1246
|
+
key: n.Organization,
|
|
1247
|
+
label: B?.organization ?? "Organization",
|
|
1248
|
+
items: Me
|
|
787
1249
|
}
|
|
788
1250
|
], [
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
]),
|
|
1251
|
+
B,
|
|
1252
|
+
ke,
|
|
1253
|
+
Ae,
|
|
1254
|
+
je,
|
|
1255
|
+
Me
|
|
1256
|
+
]), Z = V(() => {
|
|
795
1257
|
let e = [];
|
|
796
|
-
for (let t of
|
|
797
|
-
kind:
|
|
1258
|
+
for (let t of Ne) if (t.items.length !== 0 && (e.push({
|
|
1259
|
+
kind: $e.Header,
|
|
798
1260
|
groupKey: t.key,
|
|
799
1261
|
label: t.label
|
|
800
|
-
}),
|
|
801
|
-
kind:
|
|
1262
|
+
}), J.has(t.key))) for (let n of t.items) e.push({
|
|
1263
|
+
kind: $e.Item,
|
|
802
1264
|
item: n,
|
|
803
1265
|
groupKey: t.key
|
|
804
1266
|
});
|
|
805
1267
|
return e;
|
|
806
|
-
}, [
|
|
807
|
-
|
|
808
|
-
if (!
|
|
809
|
-
let e =
|
|
810
|
-
e >= 0 && (
|
|
1268
|
+
}, [Ne, J]);
|
|
1269
|
+
R(() => {
|
|
1270
|
+
if (!u || se.current === u) return;
|
|
1271
|
+
let e = Z.findIndex((e) => e.kind === $e.Item && e.item.id === u);
|
|
1272
|
+
e >= 0 && (oe.current?.scrollToRow({
|
|
811
1273
|
index: e,
|
|
812
1274
|
align: "smart",
|
|
813
1275
|
behavior: "smooth"
|
|
814
|
-
}),
|
|
1276
|
+
}), se.current = u);
|
|
815
1277
|
}, [
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
1278
|
+
u,
|
|
1279
|
+
Ne,
|
|
1280
|
+
J,
|
|
1281
|
+
Z
|
|
820
1282
|
]);
|
|
821
|
-
let
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}, [
|
|
825
|
-
let
|
|
826
|
-
rows:
|
|
827
|
-
expandedGroups:
|
|
828
|
-
onToggleGroup:
|
|
829
|
-
listId:
|
|
830
|
-
activeConversationId:
|
|
831
|
-
searchQuery:
|
|
832
|
-
onSelectConversation:
|
|
1283
|
+
let Pe = H(Z);
|
|
1284
|
+
R(() => {
|
|
1285
|
+
Pe.current = Z;
|
|
1286
|
+
}, [Z]);
|
|
1287
|
+
let Fe = L((e) => ve(e, Pe.current), [ve]), Ie = V(() => ({
|
|
1288
|
+
rows: Z,
|
|
1289
|
+
expandedGroups: J,
|
|
1290
|
+
onToggleGroup: ge,
|
|
1291
|
+
listId: ae,
|
|
1292
|
+
activeConversationId: u,
|
|
1293
|
+
searchQuery: f,
|
|
1294
|
+
onSelectConversation: Ee,
|
|
833
1295
|
getActions: _,
|
|
834
1296
|
onActionMenuOpen: v,
|
|
835
|
-
actionsLabel:
|
|
836
|
-
unreadIndicatorLabel:
|
|
1297
|
+
actionsLabel: W,
|
|
1298
|
+
unreadIndicatorLabel: te,
|
|
1299
|
+
rowVariant: g,
|
|
837
1300
|
styles: {
|
|
838
|
-
groupHeaderClassName:
|
|
839
|
-
itemTitleClassName:
|
|
840
|
-
|
|
1301
|
+
groupHeaderClassName: D?.groupHeaderClassName,
|
|
1302
|
+
itemTitleClassName: D?.itemTitleClassName,
|
|
1303
|
+
unreadItemTitleClassName: D?.unreadItemTitleClassName,
|
|
1304
|
+
itemIconBadgeClassName: O
|
|
841
1305
|
},
|
|
842
|
-
draggingId:
|
|
843
|
-
dragOverId:
|
|
844
|
-
allowedDropGroups:
|
|
845
|
-
onDragStart:
|
|
846
|
-
onDragEnd:
|
|
847
|
-
onDragOver:
|
|
848
|
-
onDragLeave:
|
|
849
|
-
onDrop:
|
|
1306
|
+
draggingId: ce,
|
|
1307
|
+
dragOverId: Y,
|
|
1308
|
+
allowedDropGroups: fe,
|
|
1309
|
+
onDragStart: Fe,
|
|
1310
|
+
onDragEnd: ye,
|
|
1311
|
+
onDragOver: be,
|
|
1312
|
+
onDragLeave: xe,
|
|
1313
|
+
onDrop: Se
|
|
850
1314
|
}), [
|
|
851
|
-
|
|
1315
|
+
Z,
|
|
1316
|
+
J,
|
|
1317
|
+
ge,
|
|
1318
|
+
ae,
|
|
1319
|
+
u,
|
|
1320
|
+
f,
|
|
1321
|
+
Ee,
|
|
1322
|
+
_,
|
|
1323
|
+
v,
|
|
1324
|
+
W,
|
|
1325
|
+
te,
|
|
1326
|
+
g,
|
|
1327
|
+
D?.groupHeaderClassName,
|
|
1328
|
+
D?.itemTitleClassName,
|
|
1329
|
+
D?.unreadItemTitleClassName,
|
|
1330
|
+
O,
|
|
1331
|
+
ce,
|
|
852
1332
|
Y,
|
|
853
|
-
|
|
854
|
-
|
|
1333
|
+
fe,
|
|
1334
|
+
Fe,
|
|
1335
|
+
ye,
|
|
1336
|
+
be,
|
|
1337
|
+
xe,
|
|
1338
|
+
Se
|
|
1339
|
+
]), Le = f !== "" || p !== n.All || m !== Q.All, Re = Oe.length === 0, ze = Re && Le, Be = Re && !Le, Ve = ze && f === "" && m === Q.All ? F?.[p] : void 0, He = Ve?.label ?? M, Ue = p === n.Shared && f === "" ? P : N, We = Ve?.description ?? Ue, Ge = !t && !Re, Ke = H(null), qe = H(null), Je = H(b);
|
|
1340
|
+
R(() => {
|
|
1341
|
+
Je.current = b;
|
|
1342
|
+
}, [b]);
|
|
1343
|
+
let Ye = L((e) => {
|
|
1344
|
+
qe.current && lt(qe.current, e) || (qe.current = e, Je.current?.(e));
|
|
1345
|
+
}, []), Xe = L((e) => {
|
|
1346
|
+
Ke.current = e, Ye(ct(Z, e));
|
|
1347
|
+
}, [Z, Ye]);
|
|
1348
|
+
return R(() => {
|
|
1349
|
+
Ge ? Ke.current && Ye(ct(Z, Ke.current)) : (Ke.current = null, Ye([]));
|
|
1350
|
+
}, [
|
|
1351
|
+
Ge,
|
|
1352
|
+
Z,
|
|
1353
|
+
Ye
|
|
1354
|
+
]), /* @__PURE__ */ K("div", {
|
|
1355
|
+
id: S,
|
|
1356
|
+
style: Ce,
|
|
1357
|
+
className: a("flex-1 overflow-hidden px-3", $.list, D?.fontClassName, g !== Qe.Indicator && "py-1", T, ue.list),
|
|
1358
|
+
children: [/* @__PURE__ */ G(C, {
|
|
1359
|
+
visuallyHidden: !0,
|
|
1360
|
+
as: w.Span,
|
|
1361
|
+
children: t ? I : i ? ee : Be ? k : ze ? He : ""
|
|
1362
|
+
}), t ? /* @__PURE__ */ G("div", {
|
|
1363
|
+
className: "flex flex-col gap-3 px-2 py-3",
|
|
1364
|
+
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ G(A, {
|
|
1365
|
+
avatar: { size: 24 },
|
|
1366
|
+
showTitle: { width: rt(t) },
|
|
1367
|
+
paragraph: !1,
|
|
1368
|
+
active: !0,
|
|
1369
|
+
color: $.skeletonColor
|
|
1370
|
+
}, t))
|
|
1371
|
+
}) : Be ? /* @__PURE__ */ G(c, {
|
|
1372
|
+
label: k,
|
|
1373
|
+
description: j
|
|
1374
|
+
}) : ze && f !== "" && i ? /* @__PURE__ */ G(c, { label: ee }) : ze ? /* @__PURE__ */ G(l, {
|
|
1375
|
+
label: He,
|
|
1376
|
+
description: We
|
|
1377
|
+
}) : /* @__PURE__ */ G(Ze, {
|
|
1378
|
+
listRef: oe,
|
|
1379
|
+
id: ae,
|
|
1380
|
+
role: "list",
|
|
1381
|
+
style: { height: "100%" },
|
|
1382
|
+
rowComponent: _t,
|
|
1383
|
+
rowCount: Z.length,
|
|
1384
|
+
rowHeight: at,
|
|
1385
|
+
overscanCount: re,
|
|
1386
|
+
onResize: he,
|
|
1387
|
+
onRowsRendered: Xe,
|
|
1388
|
+
rowProps: Ie
|
|
1389
|
+
})]
|
|
1390
|
+
});
|
|
1391
|
+
}), bt = {
|
|
1392
|
+
title: "_title_mvx21_2",
|
|
1393
|
+
filterValue: "_filterValue_mvx21_12",
|
|
1394
|
+
filterIndicator: "_filterIndicator_mvx21_17"
|
|
1395
|
+
}, xt = "!size-6 !min-h-0 !min-w-0 !p-1", St = [
|
|
1396
|
+
{
|
|
1397
|
+
value: n.All,
|
|
1398
|
+
getLabel: (e) => e.all
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
value: n.MyChats,
|
|
1402
|
+
getLabel: (e) => e.personal ?? "Personal"
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
value: n.Shared,
|
|
1406
|
+
getLabel: (e) => e.shared
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
value: n.Organization,
|
|
1410
|
+
getLabel: (e) => e.organization
|
|
1411
|
+
}
|
|
1412
|
+
], Ct = [
|
|
1413
|
+
{
|
|
1414
|
+
value: Q.All,
|
|
1415
|
+
getLabel: (e) => e.all
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
value: Q.Chat,
|
|
1419
|
+
getLabel: (e) => e.chat ?? "Chat"
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
value: Q.Task,
|
|
1423
|
+
getLabel: (e) => e.task ?? "Task"
|
|
1424
|
+
}
|
|
1425
|
+
], wt = I(({ labels: e, isExpanded: t = !0, onToggleExpanded: i, controlsId: o, searchQuery: s = "", isSearchOpen: c = !1, onSearchChange: l, onSearchOpenChange: u, activeFilter: d = n.All, onFilterChange: f, activeTypeFilter: p = Q.All, onTypeFilterChange: v, hiddenSources: y, actions: x, styles: S, className: C }) => {
|
|
1426
|
+
let w = S?.typography?.titleClassName ?? "dial-tiny-lead-semi-text", T = S?.typography?.searchTextClassName ?? "dial-tiny-text", D = S?.colors?.filterValue, O = H(null), A = H(null), j = H(c), M = e.filterLabels.groupAriaLabel ?? "Filter chats", N = e.filterActiveLabel ?? "Filters applied", P = z(), F = d !== n.All || p !== Q.All, I = l != null && u != null;
|
|
1427
|
+
R(() => {
|
|
1428
|
+
c ? A.current?.focus() : j.current && O.current?.focus(), j.current = c;
|
|
1429
|
+
}, [c]);
|
|
1430
|
+
let ee = L(() => {
|
|
1431
|
+
u?.(!0);
|
|
1432
|
+
}, [u]), B = L(() => {
|
|
1433
|
+
l?.(""), u?.(!1);
|
|
1434
|
+
}, [l, u]), U = L((e) => {
|
|
1435
|
+
l?.(e ?? "");
|
|
1436
|
+
}, [l]), W = L((e) => {
|
|
1437
|
+
e.key === "Escape" && (e.stopPropagation(), B());
|
|
1438
|
+
}, [B]), q = V(() => {
|
|
1439
|
+
let { filterLabels: t } = e, n = r({ "--cp-list-header-filter-value": D }), i = (e, t) => () => /* @__PURE__ */ K(te, { children: [/* @__PURE__ */ G("span", {
|
|
1440
|
+
className: "min-w-0 flex-1 truncate text-start",
|
|
1441
|
+
children: e
|
|
1442
|
+
}), /* @__PURE__ */ G("span", {
|
|
1443
|
+
className: a("shrink-0", bt.filterValue),
|
|
1444
|
+
style: n,
|
|
1445
|
+
children: t
|
|
1446
|
+
})] }), o = [];
|
|
1447
|
+
if (v) {
|
|
1448
|
+
let e = Ct.map(({ value: e, getLabel: n }) => ({
|
|
1449
|
+
key: e,
|
|
1450
|
+
label: n(t),
|
|
1451
|
+
mark: E.Check,
|
|
1452
|
+
checked: e === p,
|
|
1453
|
+
onClick: () => v(e)
|
|
1454
|
+
})), n = Ct.find(({ value: e }) => e === p);
|
|
1455
|
+
o.push({
|
|
1456
|
+
key: "filter-type",
|
|
1457
|
+
label: t.type ?? "Type",
|
|
1458
|
+
renderItem: i(t.type ?? "Type", n ? n.getLabel(t) : t.all),
|
|
1459
|
+
children: e
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
if (f) {
|
|
1463
|
+
let e = St.filter(({ value: e }) => !y?.includes(e)), n = e.find(({ value: e }) => e === d);
|
|
1464
|
+
o.push({
|
|
1465
|
+
key: "filter-origin",
|
|
1466
|
+
label: t.origin ?? "Origin",
|
|
1467
|
+
renderItem: i(t.origin ?? "Origin", n ? n.getLabel(t) : t.all),
|
|
1468
|
+
children: e.map(({ value: e, getLabel: n }) => ({
|
|
1469
|
+
key: e,
|
|
1470
|
+
label: n(t),
|
|
1471
|
+
mark: E.Check,
|
|
1472
|
+
checked: e === d,
|
|
1473
|
+
onClick: () => f(e)
|
|
1474
|
+
}))
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1477
|
+
return o;
|
|
1478
|
+
}, [
|
|
1479
|
+
e,
|
|
1480
|
+
y,
|
|
855
1481
|
d,
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
_,
|
|
1482
|
+
p,
|
|
1483
|
+
f,
|
|
859
1484
|
v,
|
|
860
|
-
|
|
1485
|
+
D
|
|
1486
|
+
]), J = V(() => r({
|
|
1487
|
+
"--cp-list-header-title": S?.colors?.title,
|
|
1488
|
+
"--cp-list-header-title-focus": S?.colors?.titleFocus,
|
|
1489
|
+
"--cp-list-header-filter-indicator": S?.colors?.filterIndicator
|
|
1490
|
+
}), [
|
|
1491
|
+
S?.colors?.title,
|
|
1492
|
+
S?.colors?.titleFocus,
|
|
1493
|
+
S?.colors?.filterIndicator
|
|
1494
|
+
]), ie = (e) => a("flex min-h-6 items-center justify-between ps-2", e, C, ue.listHeader);
|
|
1495
|
+
if (I && c) return /* @__PURE__ */ K("div", {
|
|
1496
|
+
role: "search",
|
|
1497
|
+
style: J,
|
|
1498
|
+
className: ie("gap-2"),
|
|
1499
|
+
onKeyDown: W,
|
|
1500
|
+
children: [/* @__PURE__ */ G(k, {
|
|
1501
|
+
containerClassName: "min-w-0 flex-1",
|
|
1502
|
+
wrapperClassName: a("h-6! min-h-0! py-1! pe-2! [&_svg]:size-4!", T),
|
|
1503
|
+
inputRef: A,
|
|
1504
|
+
value: s,
|
|
1505
|
+
onChange: U,
|
|
1506
|
+
placeholder: e.searchPlaceholder,
|
|
1507
|
+
clearLabel: e.searchClearLabel,
|
|
1508
|
+
"aria-label": e.searchPlaceholder
|
|
1509
|
+
}), /* @__PURE__ */ G(b, {
|
|
1510
|
+
icon: /* @__PURE__ */ G(le, {
|
|
1511
|
+
size: m.SM,
|
|
1512
|
+
stroke: h,
|
|
1513
|
+
"aria-hidden": !0
|
|
1514
|
+
}),
|
|
1515
|
+
size: _.Small,
|
|
1516
|
+
className: xt,
|
|
1517
|
+
"aria-label": e.searchCloseLabel,
|
|
1518
|
+
onClick: B
|
|
1519
|
+
})]
|
|
1520
|
+
});
|
|
1521
|
+
let oe = /* @__PURE__ */ G("span", {
|
|
1522
|
+
className: w,
|
|
1523
|
+
children: e.title
|
|
1524
|
+
});
|
|
1525
|
+
return /* @__PURE__ */ K("div", {
|
|
1526
|
+
style: J,
|
|
1527
|
+
className: ie(),
|
|
1528
|
+
children: [i ? /* @__PURE__ */ K("button", {
|
|
1529
|
+
type: "button",
|
|
1530
|
+
"aria-expanded": t,
|
|
1531
|
+
"aria-controls": o,
|
|
1532
|
+
onClick: i,
|
|
1533
|
+
className: a("group flex items-center gap-1 rounded", bt.title),
|
|
1534
|
+
children: [oe, t ? /* @__PURE__ */ G(ne, {
|
|
1535
|
+
size: m.SM,
|
|
1536
|
+
stroke: h,
|
|
1537
|
+
className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
1538
|
+
"aria-hidden": !0
|
|
1539
|
+
}) : /* @__PURE__ */ G(re, {
|
|
1540
|
+
size: m.SM,
|
|
1541
|
+
stroke: h,
|
|
1542
|
+
className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
|
|
1543
|
+
"aria-hidden": !0
|
|
1544
|
+
})]
|
|
1545
|
+
}) : /* @__PURE__ */ G("span", {
|
|
1546
|
+
className: bt.title,
|
|
1547
|
+
children: oe
|
|
1548
|
+
}), /* @__PURE__ */ K("div", {
|
|
1549
|
+
className: "flex items-center gap-2",
|
|
1550
|
+
children: [
|
|
1551
|
+
I && /* @__PURE__ */ G(b, {
|
|
1552
|
+
ref: O,
|
|
1553
|
+
icon: /* @__PURE__ */ G(se, {
|
|
1554
|
+
size: m.SM,
|
|
1555
|
+
stroke: h,
|
|
1556
|
+
"aria-hidden": !0
|
|
1557
|
+
}),
|
|
1558
|
+
size: _.Small,
|
|
1559
|
+
className: xt,
|
|
1560
|
+
"aria-label": e.searchOpenLabel,
|
|
1561
|
+
onClick: ee
|
|
1562
|
+
}),
|
|
1563
|
+
(f || v) && /* @__PURE__ */ G(g, {
|
|
1564
|
+
items: q,
|
|
1565
|
+
placement: "bottom-end",
|
|
1566
|
+
matchReferenceWidth: !1,
|
|
1567
|
+
children: /* @__PURE__ */ G(b, {
|
|
1568
|
+
icon: /* @__PURE__ */ K("span", {
|
|
1569
|
+
className: "relative inline-flex",
|
|
1570
|
+
children: [/* @__PURE__ */ G(ae, {
|
|
1571
|
+
size: m.SM,
|
|
1572
|
+
stroke: h,
|
|
1573
|
+
"aria-hidden": !0
|
|
1574
|
+
}), F && /* @__PURE__ */ G("span", {
|
|
1575
|
+
"aria-hidden": !0,
|
|
1576
|
+
className: a(bt.filterIndicator, "absolute -inset-e-0.5 -top-0.5 size-1.5 rounded-full")
|
|
1577
|
+
})]
|
|
1578
|
+
}),
|
|
1579
|
+
size: _.Small,
|
|
1580
|
+
className: xt,
|
|
1581
|
+
"aria-label": M,
|
|
1582
|
+
"aria-describedby": F ? P : void 0
|
|
1583
|
+
})
|
|
1584
|
+
}),
|
|
1585
|
+
F && (f || v) && /* @__PURE__ */ G("span", {
|
|
1586
|
+
id: P,
|
|
1587
|
+
className: "sr-only",
|
|
1588
|
+
children: N
|
|
1589
|
+
}),
|
|
1590
|
+
x
|
|
1591
|
+
]
|
|
1592
|
+
})]
|
|
1593
|
+
});
|
|
1594
|
+
}), Tt = I(({ conversations: e, isLoading: t, isUpdatingTitles: r, preserveActiveSearchResult: i, onSelectConversation: o, activeConversationId: s, labels: c, requestedFilter: l, isFilterHidden: u = !1, onFilterChange: d, isTypeFilterHidden: f = !1, onTypeFilterChange: p, hiddenSources: m, headerActions: h, getActions: g, onActionMenuOpen: _, onMoveConversation: v, onVisibleConversationIdsChange: y, styles: b, listClassName: x, className: S }) => {
|
|
1595
|
+
let C = z(), [w, T] = U(""), [E, D] = U(!1), [O, k] = U(!0), [A, j] = U(n.All), [M, N] = U(Q.All);
|
|
1596
|
+
R(() => {
|
|
1597
|
+
l != null && j(l);
|
|
1598
|
+
}, [l]);
|
|
1599
|
+
let P = L((e) => {
|
|
1600
|
+
j(e), d?.(e);
|
|
1601
|
+
}, [d]), F = L((e) => {
|
|
1602
|
+
T(e), e !== "" && k(!0);
|
|
1603
|
+
}, []), I = L((e) => {
|
|
1604
|
+
D(e), e && k(!0);
|
|
1605
|
+
}, []), ee = L((e) => {
|
|
1606
|
+
N(e), p?.(e);
|
|
1607
|
+
}, [p]), B = L(() => k((e) => !e), []);
|
|
1608
|
+
return /* @__PURE__ */ K("section", {
|
|
1609
|
+
"aria-label": c.title,
|
|
1610
|
+
className: a("flex min-h-0 flex-1 flex-col px-1 pt-4", S, ue.listSection),
|
|
1611
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1612
|
+
className: "px-3 pb-2",
|
|
1613
|
+
children: /* @__PURE__ */ G(wt, {
|
|
1614
|
+
labels: c,
|
|
1615
|
+
isExpanded: O,
|
|
1616
|
+
onToggleExpanded: B,
|
|
1617
|
+
controlsId: C,
|
|
1618
|
+
searchQuery: w,
|
|
1619
|
+
isSearchOpen: E,
|
|
1620
|
+
onSearchChange: F,
|
|
1621
|
+
onSearchOpenChange: I,
|
|
1622
|
+
activeFilter: A,
|
|
1623
|
+
onFilterChange: u ? void 0 : P,
|
|
1624
|
+
activeTypeFilter: M,
|
|
1625
|
+
onTypeFilterChange: u || f ? void 0 : ee,
|
|
1626
|
+
hiddenSources: m,
|
|
1627
|
+
actions: h,
|
|
1628
|
+
styles: b?.header
|
|
1629
|
+
})
|
|
1630
|
+
}), /* @__PURE__ */ G("div", {
|
|
1631
|
+
hidden: !O,
|
|
1632
|
+
inert: !O,
|
|
1633
|
+
className: O ? "flex min-h-0 flex-1 flex-col" : "hidden",
|
|
1634
|
+
children: /* @__PURE__ */ G(yt, {
|
|
1635
|
+
id: C,
|
|
1636
|
+
conversations: e,
|
|
1637
|
+
isLoading: t,
|
|
1638
|
+
isUpdatingTitles: r,
|
|
1639
|
+
preserveActiveSearchResult: i,
|
|
1640
|
+
onSelectConversation: o,
|
|
1641
|
+
activeConversationId: s,
|
|
1642
|
+
labels: c,
|
|
1643
|
+
searchQuery: w,
|
|
1644
|
+
activeFilter: A,
|
|
1645
|
+
activeTypeFilter: M,
|
|
1646
|
+
hiddenSources: m,
|
|
1647
|
+
rowVariant: Qe.Indicator,
|
|
1648
|
+
getActions: g,
|
|
1649
|
+
onActionMenuOpen: _,
|
|
1650
|
+
onMoveConversation: v,
|
|
1651
|
+
onVisibleConversationIdsChange: y,
|
|
1652
|
+
styles: b?.list,
|
|
1653
|
+
className: x
|
|
1654
|
+
})
|
|
1655
|
+
})]
|
|
1656
|
+
});
|
|
1657
|
+
}), Et = [
|
|
1658
|
+
{
|
|
1659
|
+
value: n.All,
|
|
1660
|
+
labelKey: "all"
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
value: n.MyChats,
|
|
1664
|
+
labelKey: "myChats"
|
|
1665
|
+
},
|
|
1666
|
+
{
|
|
1667
|
+
value: n.Shared,
|
|
1668
|
+
labelKey: "shared"
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
value: n.Organization,
|
|
1672
|
+
labelKey: "organization"
|
|
1673
|
+
}
|
|
1674
|
+
], Dt = I(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
|
|
1675
|
+
let a = V(() => Et.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
|
|
1676
|
+
value: e,
|
|
1677
|
+
label: t[n]
|
|
1678
|
+
})), [t, i]);
|
|
1679
|
+
return /* @__PURE__ */ G(y, {
|
|
1680
|
+
items: a,
|
|
1681
|
+
value: e,
|
|
1682
|
+
onChange: n,
|
|
1683
|
+
stretch: !0,
|
|
1684
|
+
"aria-label": t.groupAriaLabel ?? "Filter chats",
|
|
1685
|
+
className: "px-3 py-2",
|
|
1686
|
+
chipClassName: N("px-2!", r)
|
|
1687
|
+
});
|
|
1688
|
+
}), Ot = { button: "_button_vjird_1" }, kt = I(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i, className: o }) => {
|
|
1689
|
+
let s = r({
|
|
1690
|
+
"--cp-new-chat-bg": i?.background,
|
|
1691
|
+
"--cp-new-chat-text": i?.text,
|
|
1692
|
+
"--cp-new-chat-focus-outline": i?.focusOutline
|
|
1693
|
+
});
|
|
1694
|
+
return /* @__PURE__ */ G("div", {
|
|
1695
|
+
className: "px-3 py-2",
|
|
1696
|
+
style: s,
|
|
1697
|
+
children: /* @__PURE__ */ G(f, {
|
|
1698
|
+
label: e,
|
|
1699
|
+
textClassName: n,
|
|
1700
|
+
iconBefore: /* @__PURE__ */ G(oe, {
|
|
1701
|
+
size: 18,
|
|
1702
|
+
stroke: h,
|
|
1703
|
+
className: "shrink-0",
|
|
1704
|
+
"aria-hidden": !0
|
|
1705
|
+
}),
|
|
1706
|
+
onClick: t,
|
|
1707
|
+
className: a("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", Ot.button, o, ue.newChatButton)
|
|
1708
|
+
})
|
|
1709
|
+
});
|
|
1710
|
+
}), At = I(({ conversations: e, isLoading: t, isUpdatingTitles: i, preserveActiveSearchResult: o, isOpen: s, onSelectConversation: c, activeConversationId: l, labels: f, onNewChat: p, styles: m, className: h, isOverlay: g = !1, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, onVisibleConversationIdsChange: S, activeFilter: C, onActiveFilterChange: w, isFilterTabsHidden: T = !1, hiddenSources: E }) => {
|
|
1711
|
+
let { colors: D, typography: O, newChatButton: A, searchWrapperClassName: j, headerClassName: M, headerActionsClassName: N, newChatButtonClassName: P } = m ?? {}, { title: F, emptyLabel: I, emptyDescription: z, noResultsLabel: ee, noResultsDescription: B, sharedEmptyDescription: H, tabEmptyLabels: W, loadingLabel: te, updatingTitlesLabel: q, newChatLabel: J, searchPlaceholder: ne, searchClearLabel: re, filterLabels: ie, groupLabels: ae, actionsLabel: oe, unreadIndicatorLabel: se, closeAriaLabel: ce } = f, [le, Y] = U(""), [de, fe] = U(n.All);
|
|
1712
|
+
R(() => {
|
|
1713
|
+
C != null && fe(C);
|
|
1714
|
+
}, [C]);
|
|
1715
|
+
let pe = L((e) => {
|
|
1716
|
+
Y(e ?? "");
|
|
1717
|
+
}, []), X = r({
|
|
1718
|
+
"--cp-text": D?.text,
|
|
1719
|
+
"--cp-new-chat-bg": A?.background,
|
|
1720
|
+
"--cp-new-chat-text": A?.text,
|
|
1721
|
+
"--cp-new-chat-focus-outline": A?.focusOutline
|
|
1722
|
+
}), me = V(() => ({
|
|
1723
|
+
emptyLabel: I,
|
|
1724
|
+
emptyDescription: z,
|
|
1725
|
+
noResultsLabel: ee,
|
|
1726
|
+
noResultsDescription: B,
|
|
1727
|
+
sharedEmptyDescription: H,
|
|
1728
|
+
tabEmptyLabels: W,
|
|
1729
|
+
loadingLabel: te,
|
|
1730
|
+
updatingTitlesLabel: q,
|
|
1731
|
+
groupLabels: ae,
|
|
1732
|
+
actionsLabel: oe,
|
|
1733
|
+
unreadIndicatorLabel: se
|
|
1734
|
+
}), [
|
|
1735
|
+
I,
|
|
1736
|
+
z,
|
|
1737
|
+
ee,
|
|
1738
|
+
B,
|
|
1739
|
+
H,
|
|
861
1740
|
W,
|
|
1741
|
+
te,
|
|
1742
|
+
q,
|
|
1743
|
+
ae,
|
|
1744
|
+
oe,
|
|
1745
|
+
se
|
|
1746
|
+
]), he = V(() => ({
|
|
1747
|
+
colors: D,
|
|
1748
|
+
typography: {
|
|
1749
|
+
fontFamily: O?.fontFamily,
|
|
1750
|
+
groupHeaderClassName: O?.groupHeaderClassName,
|
|
1751
|
+
itemTitleClassName: O?.itemTitleClassName,
|
|
1752
|
+
unreadItemTitleClassName: O?.unreadItemTitleClassName
|
|
1753
|
+
},
|
|
1754
|
+
itemIconBadgeClassName: m?.itemIconBadgeClassName
|
|
1755
|
+
}), [
|
|
1756
|
+
D,
|
|
1757
|
+
O?.fontFamily,
|
|
862
1758
|
O?.groupHeaderClassName,
|
|
863
1759
|
O?.itemTitleClassName,
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
Ue,
|
|
870
|
-
We,
|
|
871
|
-
Ge,
|
|
872
|
-
Ke
|
|
873
|
-
]), nt = J.length === 0, rt = J.length > 0 && Q.length === 0;
|
|
874
|
-
return /* @__PURE__ */ re(u, {
|
|
875
|
-
isOpen: a,
|
|
1760
|
+
O?.unreadItemTitleClassName,
|
|
1761
|
+
m?.itemIconBadgeClassName
|
|
1762
|
+
]);
|
|
1763
|
+
return /* @__PURE__ */ K(d, {
|
|
1764
|
+
isOpen: s,
|
|
876
1765
|
isOverlay: g,
|
|
877
|
-
orientation:
|
|
878
|
-
title:
|
|
1766
|
+
orientation: u.Left,
|
|
1767
|
+
title: F,
|
|
879
1768
|
labels: {
|
|
880
|
-
ariaLabel:
|
|
881
|
-
closeLabel:
|
|
1769
|
+
ariaLabel: F,
|
|
1770
|
+
closeLabel: ce
|
|
882
1771
|
},
|
|
883
1772
|
onClose: y,
|
|
884
1773
|
styles: {
|
|
@@ -888,168 +1777,160 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
888
1777
|
},
|
|
889
1778
|
typography: { fontClassName: O?.fontClassName },
|
|
890
1779
|
bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
|
|
891
|
-
cssVars:
|
|
1780
|
+
cssVars: X,
|
|
892
1781
|
titleClassName: O?.fontClassName,
|
|
893
|
-
headerClassName:
|
|
894
|
-
headerActionsClassName:
|
|
895
|
-
className:
|
|
1782
|
+
headerClassName: a("h-[64px]", M),
|
|
1783
|
+
headerActionsClassName: N,
|
|
1784
|
+
className: a(s ? "w-[324px] mobile:w-full" : "w-0", h)
|
|
896
1785
|
},
|
|
897
1786
|
rightActions: b,
|
|
898
1787
|
children: [
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
label:
|
|
1788
|
+
/* @__PURE__ */ G(kt, {
|
|
1789
|
+
label: J,
|
|
901
1790
|
onClick: p,
|
|
902
1791
|
labelClassName: O?.newChatLabelClassName,
|
|
903
|
-
colors:
|
|
904
|
-
className:
|
|
1792
|
+
colors: A,
|
|
1793
|
+
className: P
|
|
905
1794
|
}),
|
|
906
|
-
/* @__PURE__ */
|
|
1795
|
+
/* @__PURE__ */ G("div", {
|
|
907
1796
|
role: "search",
|
|
908
|
-
className:
|
|
909
|
-
children: /* @__PURE__ */
|
|
910
|
-
wrapperClassName:
|
|
911
|
-
value:
|
|
912
|
-
onChange:
|
|
913
|
-
placeholder:
|
|
914
|
-
clearLabel:
|
|
915
|
-
"aria-label":
|
|
1797
|
+
className: a("px-3 py-2", ue.search),
|
|
1798
|
+
children: /* @__PURE__ */ G(k, {
|
|
1799
|
+
wrapperClassName: a($.search, j),
|
|
1800
|
+
value: le,
|
|
1801
|
+
onChange: pe,
|
|
1802
|
+
placeholder: ne,
|
|
1803
|
+
clearLabel: re,
|
|
1804
|
+
"aria-label": ne
|
|
916
1805
|
})
|
|
917
1806
|
}),
|
|
918
|
-
!
|
|
919
|
-
activeTab:
|
|
920
|
-
labels:
|
|
1807
|
+
!T && /* @__PURE__ */ G(Dt, {
|
|
1808
|
+
activeTab: de,
|
|
1809
|
+
labels: ie,
|
|
921
1810
|
onChange: (e) => {
|
|
922
|
-
|
|
1811
|
+
fe(e), w?.(e);
|
|
923
1812
|
},
|
|
924
1813
|
tabClassName: O?.tabClassName,
|
|
925
1814
|
hiddenSources: E
|
|
926
1815
|
}),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
}, t))
|
|
944
|
-
}) : nt ? /* @__PURE__ */ I(s, { label: ae }) : rt ? /* @__PURE__ */ I(c, { label: oe }) : /* @__PURE__ */ I(_e, {
|
|
945
|
-
listRef: ge,
|
|
946
|
-
id: he,
|
|
947
|
-
role: "list",
|
|
948
|
-
style: { height: "100%" },
|
|
949
|
-
rowComponent: Ne,
|
|
950
|
-
rowCount: $.length,
|
|
951
|
-
rowHeight: be,
|
|
952
|
-
overscanCount: pe,
|
|
953
|
-
onResize: Re,
|
|
954
|
-
rowProps: tt
|
|
955
|
-
})
|
|
1816
|
+
/* @__PURE__ */ G(yt, {
|
|
1817
|
+
conversations: e,
|
|
1818
|
+
isLoading: t,
|
|
1819
|
+
isUpdatingTitles: i,
|
|
1820
|
+
preserveActiveSearchResult: o,
|
|
1821
|
+
onSelectConversation: c,
|
|
1822
|
+
activeConversationId: l,
|
|
1823
|
+
labels: me,
|
|
1824
|
+
searchQuery: le,
|
|
1825
|
+
activeFilter: de,
|
|
1826
|
+
hiddenSources: E,
|
|
1827
|
+
getActions: _,
|
|
1828
|
+
onActionMenuOpen: v,
|
|
1829
|
+
onMoveConversation: x,
|
|
1830
|
+
onVisibleConversationIdsChange: S,
|
|
1831
|
+
styles: he
|
|
956
1832
|
})
|
|
957
1833
|
]
|
|
958
1834
|
});
|
|
959
|
-
}),
|
|
960
|
-
let [
|
|
961
|
-
|
|
962
|
-
let n = e && !
|
|
963
|
-
if (
|
|
964
|
-
|
|
1835
|
+
}), jt = I(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
|
|
1836
|
+
let [f, g] = U(t), [_, v] = U(!1), [y, x] = U(null), E = H(null), k = H(!1), A = H(0);
|
|
1837
|
+
R(() => {
|
|
1838
|
+
let n = e && !k.current;
|
|
1839
|
+
if (k.current = e, !e) {
|
|
1840
|
+
A.current += 1, v(!1);
|
|
965
1841
|
return;
|
|
966
1842
|
}
|
|
967
1843
|
if (!n) return;
|
|
968
|
-
|
|
969
|
-
let r = setTimeout(() =>
|
|
1844
|
+
A.current += 1, g(t), x(null), v(!1);
|
|
1845
|
+
let r = setTimeout(() => E.current?.focus(), 0);
|
|
970
1846
|
return () => clearTimeout(r);
|
|
971
|
-
}, [e, t]),
|
|
972
|
-
|
|
1847
|
+
}, [e, t]), R(() => () => {
|
|
1848
|
+
A.current += 1;
|
|
973
1849
|
}, []);
|
|
974
|
-
let
|
|
975
|
-
|
|
1850
|
+
let j = s(f.trim()), N = i(j) > 255, P = n || j === "" || j === t.trim() || N, F = L(() => {
|
|
1851
|
+
P || a(j);
|
|
976
1852
|
}, [
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
]),
|
|
981
|
-
e.key === "Enter" &&
|
|
982
|
-
}, [
|
|
1853
|
+
P,
|
|
1854
|
+
a,
|
|
1855
|
+
j
|
|
1856
|
+
]), I = L((e) => {
|
|
1857
|
+
e.key === "Enter" && F();
|
|
1858
|
+
}, [F]), z = L(async () => {
|
|
983
1859
|
if (_) return;
|
|
984
|
-
let e = ++
|
|
985
|
-
v(!0),
|
|
1860
|
+
let e = ++A.current;
|
|
1861
|
+
v(!0), x(null);
|
|
986
1862
|
try {
|
|
987
1863
|
let t = await l();
|
|
988
|
-
if (e !==
|
|
989
|
-
g(
|
|
1864
|
+
if (e !== A.current) return;
|
|
1865
|
+
g(o(t));
|
|
990
1866
|
} catch {
|
|
991
|
-
if (e !==
|
|
992
|
-
|
|
1867
|
+
if (e !== A.current) return;
|
|
1868
|
+
x(u.renameWithAiError);
|
|
993
1869
|
} finally {
|
|
994
|
-
e ===
|
|
1870
|
+
e === A.current && v(!1);
|
|
995
1871
|
}
|
|
996
1872
|
}, [
|
|
997
1873
|
_,
|
|
998
1874
|
l,
|
|
999
1875
|
u.renameWithAiError
|
|
1000
|
-
]),
|
|
1001
|
-
return
|
|
1876
|
+
]), ee = y ?? r ?? void 0, B;
|
|
1877
|
+
return B = N ? u.nameTooLongError : ee, /* @__PURE__ */ G(D, {
|
|
1002
1878
|
open: e,
|
|
1003
1879
|
header: u.popupTitle,
|
|
1004
|
-
size:
|
|
1880
|
+
size: O.Sm,
|
|
1005
1881
|
onClose: c,
|
|
1006
1882
|
mainButtons: n ? void 0 : [{
|
|
1007
1883
|
label: u.cancelLabel,
|
|
1008
1884
|
onClick: c
|
|
1009
1885
|
}, {
|
|
1010
1886
|
label: u.saveLabel,
|
|
1011
|
-
variant:
|
|
1012
|
-
disabled:
|
|
1013
|
-
onClick:
|
|
1887
|
+
variant: p.Primary,
|
|
1888
|
+
disabled: P,
|
|
1889
|
+
onClick: F
|
|
1014
1890
|
}],
|
|
1015
|
-
children: /* @__PURE__ */
|
|
1891
|
+
children: /* @__PURE__ */ K("div", {
|
|
1016
1892
|
className: d?.bodyClassName,
|
|
1017
1893
|
style: d?.cssVars,
|
|
1018
|
-
children:
|
|
1894
|
+
children: [/* @__PURE__ */ G(C, {
|
|
1895
|
+
politeness: T.Assertive,
|
|
1896
|
+
visuallyHidden: !0,
|
|
1897
|
+
as: w.Span,
|
|
1898
|
+
children: !n && !N && ee
|
|
1899
|
+
}), n ? /* @__PURE__ */ G("div", {
|
|
1019
1900
|
className: "h-[120px] px-6 py-4",
|
|
1020
|
-
children: /* @__PURE__ */
|
|
1021
|
-
}) : /* @__PURE__ */
|
|
1901
|
+
children: /* @__PURE__ */ G(M, { size: 50 })
|
|
1902
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1022
1903
|
className: "flex items-start gap-2 px-6 py-3",
|
|
1023
|
-
children: [/* @__PURE__ */
|
|
1904
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1024
1905
|
className: "min-w-0 flex-1",
|
|
1025
|
-
children: /* @__PURE__ */
|
|
1026
|
-
inputRef:
|
|
1027
|
-
value:
|
|
1906
|
+
children: /* @__PURE__ */ G(S, {
|
|
1907
|
+
inputRef: E,
|
|
1908
|
+
value: f,
|
|
1028
1909
|
placeholder: u.inputPlaceholder,
|
|
1029
|
-
error:
|
|
1030
|
-
onChange: (e) => g(
|
|
1031
|
-
onKeyDown:
|
|
1910
|
+
error: B,
|
|
1911
|
+
onChange: (e) => g(o(e ?? "")),
|
|
1912
|
+
onKeyDown: I
|
|
1032
1913
|
})
|
|
1033
|
-
}), /* @__PURE__ */
|
|
1914
|
+
}), /* @__PURE__ */ G(b, {
|
|
1034
1915
|
"aria-label": u.renameWithAiLabel,
|
|
1035
1916
|
tooltipProps: { tooltip: u.renameWithAiLabel },
|
|
1036
1917
|
disabled: _ || n,
|
|
1037
1918
|
"aria-busy": _,
|
|
1038
|
-
onClick:
|
|
1039
|
-
icon: _ ? /* @__PURE__ */
|
|
1919
|
+
onClick: z,
|
|
1920
|
+
icon: _ ? /* @__PURE__ */ G("span", {
|
|
1040
1921
|
className: "flex",
|
|
1041
1922
|
"aria-hidden": !0,
|
|
1042
|
-
children: /* @__PURE__ */
|
|
1043
|
-
}) : /* @__PURE__ */
|
|
1044
|
-
size:
|
|
1045
|
-
stroke:
|
|
1923
|
+
children: /* @__PURE__ */ G(M, { size: m.MD })
|
|
1924
|
+
}) : /* @__PURE__ */ G(ce, {
|
|
1925
|
+
size: m.MD,
|
|
1926
|
+
stroke: h,
|
|
1046
1927
|
"aria-hidden": !0
|
|
1047
1928
|
})
|
|
1048
1929
|
})]
|
|
1049
|
-
})
|
|
1930
|
+
})]
|
|
1050
1931
|
})
|
|
1051
1932
|
});
|
|
1052
1933
|
});
|
|
1053
|
-
|
|
1934
|
+
jt.displayName = "RenameConversationPopup";
|
|
1054
1935
|
//#endregion
|
|
1055
|
-
export {
|
|
1936
|
+
export { ue as CONVERSATION_PANEL_CLASS, yt as ConversationList, wt as ConversationListHeader, Tt as ConversationListSection, At as ConversationPanel, Qe as ConversationRowVariant, Q as ConversationTypeFilter, jt as RenameConversationPopup };
|