@epam/ai-dial-conversation-panel 1.2.0-dev.99 → 1.3.0-dev.5

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