@epam/ai-dial-conversation-panel 1.1.0-dev.39 → 1.1.0-dev.391

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