@epam/ai-dial-conversation-panel 1.0.0-dev.481 → 1.0.0-dev.486

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { DeploymentIcon as e, Highlight as t, buildCssVars as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
2
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 } from "@epam/ai-dial-ui-kit";
4
- import { createElement as y, memo as b, useCallback as x, useEffect as S, useId as C, useImperativeHandle as w, useLayoutEffect as T, useMemo as E, useRef as D, useState as O } from "react";
5
- import { jsx as k, jsxs as A } from "react/jsx-runtime";
6
- import { IconCaretDownFilled as j, IconCaretRightFilled as M, IconDotsVertical as N, IconPlus as P } from "@tabler/icons-react";
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";
7
7
  //#region ../../node_modules/react-window/dist/react-window.js
8
- var F = typeof window < "u" ? T : S;
9
- function I(e) {
8
+ var I = typeof window < "u" ? E : C;
9
+ function L(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 I(e) {
14
14
  break;
15
15
  }
16
16
  }
17
- function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
18
- let { styleHeight: s, styleWidth: c } = E(() => ({
19
- styleHeight: I(o?.height),
20
- styleWidth: I(o?.width)
21
- }), [o?.height, o?.width]), [l, u] = O({
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({
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 F(() => {
25
+ return I(() => {
26
26
  if (i === null || d) return;
27
27
  let t = new ResizeObserver((e) => {
28
28
  for (let t of e) {
@@ -42,7 +42,7 @@ function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
42
42
  i,
43
43
  s,
44
44
  c
45
- ]), E(() => ({
45
+ ]), D(() => ({
46
46
  height: s ?? l.height,
47
47
  width: c ?? l.width
48
48
  }), [
@@ -51,26 +51,26 @@ function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
51
51
  c
52
52
  ]);
53
53
  }
54
- function te(e) {
55
- let t = D(() => {
54
+ function ee(e) {
55
+ let t = O(() => {
56
56
  throw Error("Cannot call during render.");
57
57
  });
58
- return F(() => {
58
+ return I(() => {
59
59
  t.current = e;
60
- }, [e]), x((e) => t.current?.(e), [t]);
60
+ }, [e]), S((e) => t.current?.(e), [t]);
61
61
  }
62
- var L = null;
63
- function R(e = !1) {
64
- if (L === null || e) {
62
+ var z = null;
63
+ function te(e = !1) {
64
+ if (z === 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 ? L = "positive-descending" : (e.scrollLeft = 1, L = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), L;
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;
69
69
  }
70
- return L;
70
+ return z;
71
71
  }
72
- function z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
- if (t === "horizontal" && n) switch (R()) {
72
+ function B({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
+ if (t === "horizontal" && n) switch (te()) {
74
74
  case "negative": return -r;
75
75
  case "positive-descending":
76
76
  if (e) {
@@ -81,26 +81,26 @@ function z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
81
81
  }
82
82
  return r;
83
83
  }
84
- function B(e, t = "Assertion error") {
84
+ function V(e, t = "Assertion error") {
85
85
  if (!e) throw console.error(t), Error(t);
86
86
  }
87
- function V(e, t) {
87
+ function H(e, t) {
88
88
  if (e === t) return !0;
89
- if (!!e != !!t || (B(e !== void 0), B(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
89
+ if (!!e != !!t || (V(e !== void 0), V(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 H({ cachedBounds: e, itemCount: t, itemSize: n }) {
93
+ function U({ 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 B(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
98
+ return V(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
99
99
  }
100
100
  }
101
- function U({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
101
+ function ne({ 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 = H({
103
+ let s = U({
104
104
  cachedBounds: t,
105
105
  itemCount: r,
106
106
  itemSize: i
@@ -131,11 +131,11 @@ function W({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
131
131
  stopIndexOverscan: l
132
132
  };
133
133
  }
134
- function ne({ itemCount: e, itemProps: t, itemSize: n }) {
134
+ function G({ itemCount: e, itemProps: t, itemSize: n }) {
135
135
  let r = /* @__PURE__ */ new Map();
136
136
  return {
137
137
  get(i) {
138
- for (B(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
138
+ for (V(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 ne({ itemCount: e, itemProps: t, itemSize: n }) {
151
151
  });
152
152
  else {
153
153
  let t = r.get(e - 1);
154
- B(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
154
+ V(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 B(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
161
+ return V(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 ne({ itemCount: e, itemProps: t, itemSize: n }) {
168
168
  }
169
169
  };
170
170
  }
171
- function G({ itemCount: e, itemProps: t, itemSize: n }) {
172
- return E(() => ne({
171
+ function K({ itemCount: e, itemProps: t, itemSize: n }) {
172
+ return D(() => G({
173
173
  itemCount: e,
174
174
  itemProps: t,
175
175
  itemSize: n
@@ -183,7 +183,7 @@ function re({ containerSize: e, itemSize: t }) {
183
183
  let n;
184
184
  switch (typeof t) {
185
185
  case "string":
186
- B(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), B(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
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;
187
187
  break;
188
188
  default:
189
189
  n = t;
@@ -192,20 +192,20 @@ function re({ containerSize: e, itemSize: t }) {
192
192
  return n;
193
193
  }
194
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 } = ee({
195
+ let { height: u = n, width: d = n } = R({
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 = D({
201
+ }), f = O({
202
202
  height: 0,
203
203
  width: 0
204
204
  }), p = r === "vertical" ? u : d, m = re({
205
205
  containerSize: p,
206
206
  itemSize: s
207
207
  });
208
- T(() => {
208
+ E(() => {
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 = G({
221
+ let h = K({
222
222
  itemCount: a,
223
223
  itemProps: o,
224
224
  itemSize: m
225
- }), g = x((e) => h.get(e), [h]), [_, v] = O(() => W({
225
+ }), g = S((e) => h.get(e), [h]), [_, v] = k(() => W({
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: S, stopIndexOverscan: C } = {
231
+ })), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: x, stopIndexOverscan: C } = {
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 = x(() => H({
236
+ }, w = S(() => U({
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
- ]), E = x((t) => W({
244
+ ]), T = S((t) => W({
245
245
  cachedBounds: h,
246
- containerScrollOffset: z({
246
+ containerScrollOffset: B({
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 F(() => {
265
- v(E((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
264
+ return I(() => {
265
+ v(T((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
266
266
  }, [
267
267
  e,
268
268
  r,
269
- E
270
- ]), F(() => {
269
+ T
270
+ ]), I(() => {
271
271
  if (!e) return;
272
272
  let t = () => {
273
273
  v((t) => {
274
274
  let { scrollLeft: n, scrollTop: o } = e, s = W({
275
275
  cachedBounds: h,
276
- containerScrollOffset: z({
276
+ containerScrollOffset: B({
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 V(s, t) ? t : s;
286
+ return H(s, t) ? t : s;
287
287
  });
288
288
  };
289
289
  return e.addEventListener("scroll", t), () => {
@@ -299,8 +299,8 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
299
299
  ]), {
300
300
  getCellBounds: g,
301
301
  getEstimatedSize: w,
302
- scrollToIndex: te(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
- let s = U({
302
+ scrollToIndex: ee(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
+ let s = ne({
304
304
  align: t,
305
305
  cachedBounds: h,
306
306
  containerScrollOffset: n,
@@ -310,14 +310,14 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
310
310
  itemSize: m
311
311
  });
312
312
  if (e) {
313
- if (s = z({
313
+ if (s = B({
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 = E(s);
320
- V(_, e) || v(e);
319
+ let e = T(s);
320
+ H(_, e) || v(e);
321
321
  }
322
322
  return s;
323
323
  }
@@ -325,38 +325,38 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
325
325
  startIndexOverscan: b,
326
326
  startIndexVisible: y,
327
327
  stopIndexOverscan: C,
328
- stopIndexVisible: S
328
+ stopIndexVisible: x
329
329
  };
330
330
  }
331
331
  function ae(e) {
332
- return E(() => e, Object.values(e));
332
+ return D(() => e, Object.values(e));
333
333
  }
334
- function K(e, t) {
334
+ function oe(e, t) {
335
335
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
336
- return V(n, a) && V(r, o) && V(i, s);
336
+ return H(n, a) && H(r, o) && H(i, s);
337
337
  }
338
- function oe(e) {
338
+ function se(e) {
339
339
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
340
340
  }
341
- var se = "data-react-window-index";
342
- function ce({ 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 = E(() => b(s, K), [s]), [g, _] = O(null), v = oe(l), { getCellBounds: x, getEstimatedSize: C, scrollToIndex: T, startIndexOverscan: D, startIndexVisible: A, stopIndexOverscan: j, stopIndexVisible: M } = ie({
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({
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: E(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
350
+ itemSize: D(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
351
351
  onResize: i,
352
352
  overscanCount: o
353
353
  });
354
- w(r, () => ({
354
+ T(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 = T({
359
+ let r = w({
360
360
  align: e,
361
361
  containerScrollOffset: g?.scrollTop ?? 0,
362
362
  index: n
@@ -366,40 +366,40 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
366
366
  top: r
367
367
  });
368
368
  }
369
- }), [g, T]), F(() => {
369
+ }), [g, w]), I(() => {
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 = `${D + t}`;
374
- return e.setAttribute(se, n), !0;
373
+ let n = `${E + t}`;
374
+ return e.setAttribute(ce, n), !0;
375
375
  });
376
376
  if (v) return l.observeRowElements(e);
377
377
  }, [
378
378
  g,
379
379
  v,
380
380
  l,
381
- D,
381
+ E,
382
382
  j
383
- ]), S(() => {
384
- D >= 0 && j >= 0 && a && a({
385
- startIndex: A,
383
+ ]), C(() => {
384
+ E >= 0 && j >= 0 && a && a({
385
+ startIndex: O,
386
386
  stopIndex: M
387
387
  }, {
388
- startIndex: D,
388
+ startIndex: E,
389
389
  stopIndex: j
390
390
  });
391
391
  }, [
392
392
  a,
393
- D,
394
- A,
393
+ E,
394
+ O,
395
395
  j,
396
396
  M
397
397
  ]);
398
- let N = E(() => {
398
+ let N = D(() => {
399
399
  let e = [];
400
- if (c > 0) for (let t = D; t <= j; t++) {
401
- let n = x(t);
402
- e.push(/* @__PURE__ */ y(h, {
400
+ if (c > 0) for (let t = E; t <= j; t++) {
401
+ let n = y(t);
402
+ e.push(/* @__PURE__ */ b(h, {
403
403
  ...m,
404
404
  ariaAttributes: {
405
405
  "aria-posinset": t + 1,
@@ -420,21 +420,21 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
420
420
  return e;
421
421
  }, [
422
422
  h,
423
- x,
423
+ y,
424
424
  v,
425
425
  c,
426
426
  m,
427
- D,
427
+ E,
428
428
  j
429
- ]), P = /* @__PURE__ */ k("div", {
429
+ ]), P = /* @__PURE__ */ A("div", {
430
430
  "aria-hidden": !0,
431
431
  style: {
432
- height: C(),
432
+ height: S(),
433
433
  width: "100%",
434
434
  zIndex: -1
435
435
  }
436
436
  });
437
- return y(d, {
437
+ return b(d, {
438
438
  role: "list",
439
439
  ...p,
440
440
  className: t,
@@ -454,25 +454,25 @@ var q = /* @__PURE__ */ function(e) {
454
454
  return e.Header = "header", e.Item = "item", e;
455
455
  }({}), J = /* @__PURE__ */ function(e) {
456
456
  return e.All = "all", e.Pinned = "pinned", e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
457
- }({}), le = (e) => `${60 + e * 23 % 35}%`, ue = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", de = (e, t) => t.rows[e].kind === q.Item ? 36 : e === 0 ? 24 : 56, fe = (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) => {
458
458
  switch (e) {
459
459
  case J.Shared: return J.Shared;
460
460
  case J.Organization: return J.Organization;
461
461
  default: return J.MyChats;
462
462
  }
463
- }, pe = (e, t) => {
463
+ }, me = (e, t) => {
464
464
  let n = null;
465
465
  for (let r of e) if (r.kind === q.Header) n = r.groupKey;
466
466
  else if (r.item.id === t) return n;
467
467
  return null;
468
- }, me = (e, t, n) => {
468
+ }, he = (e, t, n) => {
469
469
  let r = /* @__PURE__ */ new Set();
470
470
  if (t != null && r.add(t), t === J.Pinned) {
471
471
  let t = n.find((t) => t.id === e);
472
- t && r.add(fe(t.source));
472
+ t && r.add(pe(t.source));
473
473
  } else r.add(J.Pinned);
474
474
  return r;
475
- }, he = (e, t, n, r) => {
475
+ }, ge = (e, t, n, r) => {
476
476
  let i = e.currentTarget.getBoundingClientRect();
477
477
  if (e.clientY >= i.top + i.height / 2) return t;
478
478
  let a = null, o = !1;
@@ -485,18 +485,18 @@ var q = /* @__PURE__ */ function(e) {
485
485
  }, Y = {
486
486
  tab: "_tab_1mi6x_1",
487
487
  tabActive: "_tabActive_1mi6x_13"
488
- }, ge = b(({ tabs: e, activeTabId: t, onTabChange: n, tabClassName: i = "dial-tiny-semi-text" }) => /* @__PURE__ */ k("div", {
488
+ }, _e = x(({ tabs: e, activeTabId: t, onTabChange: n, tabClassName: i = "dial-tiny-semi-text" }) => /* @__PURE__ */ A("div", {
489
489
  className: "flex flex-nowrap gap-1",
490
490
  children: e.map((e) => {
491
491
  let a = t === e.id;
492
- return /* @__PURE__ */ k(_, {
492
+ return /* @__PURE__ */ A(_, {
493
493
  label: e.label,
494
494
  selected: a,
495
495
  onClick: () => n(e.id),
496
496
  className: r("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, Y.tab, a && Y.tabActive)
497
497
  }, e.id);
498
498
  })
499
- })), _e = [
499
+ })), ve = [
500
500
  {
501
501
  value: J.All,
502
502
  labelKey: "all"
@@ -513,122 +513,125 @@ var q = /* @__PURE__ */ function(e) {
513
513
  value: J.Organization,
514
514
  labelKey: "organization"
515
515
  }
516
- ], ve = b(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ k("div", {
516
+ ], ye = x(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ A("div", {
517
517
  className: "mx-3 my-2",
518
- children: /* @__PURE__ */ k(ge, {
519
- tabs: _e.map(({ value: e, labelKey: n }) => ({
518
+ children: /* @__PURE__ */ A(_e, {
519
+ tabs: ve.map(({ value: e, labelKey: n }) => ({
520
520
  id: e,
521
521
  label: t[n]
522
522
  })),
523
523
  activeTabId: e,
524
524
  onTabChange: (e) => n(e),
525
- tabClassName: r
525
+ tabClassName: y(r, "flex-1")
526
526
  })
527
- })), ye = { button: "_button_1ggx8_1" }, be = b(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text" }) => /* @__PURE__ */ k("div", {
527
+ })), be = { button: "_button_1ggx8_1" }, xe = x(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text" }) => /* @__PURE__ */ A("div", {
528
528
  className: "px-3 py-2",
529
- children: /* @__PURE__ */ A("button", {
529
+ children: /* @__PURE__ */ j("button", {
530
530
  onClick: t,
531
531
  type: "button",
532
- className: r("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1", ye.button),
533
- children: [/* @__PURE__ */ k(P, {
532
+ className: r("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1", be.button),
533
+ children: [/* @__PURE__ */ A(F, {
534
534
  size: 18,
535
535
  stroke: 2,
536
536
  className: "shrink-0"
537
- }), /* @__PURE__ */ k("span", {
537
+ }), /* @__PURE__ */ A("span", {
538
538
  className: n,
539
539
  children: e
540
540
  })]
541
541
  })
542
542
  })), X = {
543
543
  skeletonColor: "var(--cp-skeleton-color, var(--bg-layer-4, #d1dbea))",
544
- header: "_header_dr0k7_1",
545
- item: "_item_dr0k7_5",
546
- itemActive: "_itemActive_dr0k7_11",
547
- groupHeader: "_groupHeader_dr0k7_16",
548
- dropZoneActive: "_dropZoneActive_dr0k7_20",
549
- trigger: "_trigger_dr0k7_28",
550
- triggerActive: "_triggerActive_dr0k7_28",
551
- triggerIcon: "_triggerIcon_dr0k7_31"
552
- }, xe = ({ item: n, isActive: i, onSelectConversation: a, searchQuery: o = "", getActions: s, actionsLabel: c = "More actions", itemTitleClassName: p = "dial-small-text", itemIconBadgeClassName: _, rowGroupKey: y, rows: b, draggingId: S, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: D, onDragLeave: j, onDrop: M }) => {
553
- let [P, F] = O(!1), I = s?.(n) ?? [], ee = I.length > 0, te = n.isIconLoading ? /* @__PURE__ */ k(h, {
544
+ header: "_header_1nqh6_1",
545
+ item: "_item_1nqh6_5",
546
+ itemActive: "_itemActive_1nqh6_11",
547
+ groupHeader: "_groupHeader_1nqh6_16",
548
+ dropZoneActive: "_dropZoneActive_1nqh6_21",
549
+ trigger: "_trigger_1nqh6_29",
550
+ triggerActive: "_triggerActive_1nqh6_29",
551
+ triggerIcon: "_triggerIcon_1nqh6_32"
552
+ }, 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 }) => {
553
+ let [I, L] = k(!1), R = O(null), ee = S((e) => {
554
+ L(e), e && R.current && c?.(n, R.current);
555
+ }, [n, c]), z = s?.(n) ?? [], te = z.length > 0, B = n.isIconLoading ? /* @__PURE__ */ A(h, {
554
556
  variant: g.Circular,
555
557
  width: u.LG,
556
558
  height: u.LG,
557
559
  color: X.skeletonColor,
558
560
  "aria-hidden": !0
559
- }) : /* @__PURE__ */ k(e, {
561
+ }) : /* @__PURE__ */ A(e, {
560
562
  src: n.iconUrl,
561
563
  size: u.LG,
562
564
  initialsName: n.iconTooltip ?? "",
563
565
  tooltip: n.iconTooltip,
564
- badgeClassName: _
565
- }), L = ue(ee, P), R = y != null, z = x((e) => {
566
- e.currentTarget.contains(e.relatedTarget) || j?.();
567
- }, [j]), B = x((e) => {
568
- if (!y || !b || !M) return;
566
+ badgeClassName: y
567
+ }), V = de(te, I), H = b != null, U = S((e) => {
568
+ e.currentTarget.contains(e.relatedTarget) || N?.();
569
+ }, [N]), ne = S((e) => {
570
+ if (!b || !x || !F) return;
569
571
  e.preventDefault();
570
- let t = he(e, n.id, b, y);
571
- M(n.id, y, t);
572
+ let t = ge(e, n.id, x, b);
573
+ F(n.id, b, t);
572
574
  }, [
573
575
  n.id,
576
+ x,
574
577
  b,
575
- y,
576
- M
577
- ]), V = n.id === S, H = n.id === C, U = y != null && (w?.has(y) ?? !1), W = S != null;
578
- return /* @__PURE__ */ A("li", {
579
- className: r("group/conversation relative", V && "cursor-grabbing opacity-50", H && U && "rounded", H && U && X.dropZoneActive, W && !V && !U && "cursor-not-allowed"),
580
- draggable: R || void 0,
581
- onDragStart: R ? () => T?.(n.id) : void 0,
582
- onDragEnd: R ? E : void 0,
583
- onDragOver: R ? (e) => {
584
- e.preventDefault(), D?.(n.id);
578
+ F
579
+ ]), W = n.id === C, G = n.id === w, K = b != null && (T?.has(b) ?? !1), re = C != null;
580
+ return /* @__PURE__ */ j("li", {
581
+ className: r("group/conversation relative", W && "cursor-grabbing opacity-50", G && K && "rounded", G && K && X.dropZoneActive, re && !W && !K && "cursor-not-allowed"),
582
+ draggable: H || void 0,
583
+ onDragStart: H ? () => E?.(n.id) : void 0,
584
+ onDragEnd: H ? D : void 0,
585
+ onDragOver: H ? (e) => {
586
+ e.preventDefault(), M?.(n.id);
585
587
  } : void 0,
586
- onDragLeave: R ? z : void 0,
587
- onDrop: R ? B : void 0,
588
- children: [/* @__PURE__ */ k("a", {
588
+ onDragLeave: H ? U : void 0,
589
+ onDrop: H ? ne : void 0,
590
+ children: [/* @__PURE__ */ A("a", {
589
591
  href: n.href,
590
592
  className: "contents",
591
593
  onClick: (e) => {
592
594
  n.href && (e.preventDefault(), a(n.id));
593
595
  },
594
- children: /* @__PURE__ */ k(d, {
595
- iconBefore: te,
596
- label: /* @__PURE__ */ k(t, {
596
+ children: /* @__PURE__ */ A(d, {
597
+ iconBefore: B,
598
+ label: /* @__PURE__ */ A(t, {
597
599
  text: n.title,
598
600
  query: o,
599
- className: p,
601
+ className: _,
600
602
  maxLines: 1
601
603
  }),
602
604
  textClassName: "min-w-0",
603
605
  "aria-current": i ? "page" : void 0,
604
606
  onClick: n.href ? void 0 : () => a(n.id),
605
607
  tabIndex: n.href ? -1 : void 0,
606
- className: r("flex h-8 w-full items-center justify-start gap-2 rounded-xl py-2 ps-3", L, X.item, i && X.itemActive, P && X.itemActive)
608
+ 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)
607
609
  })
608
- }), ee && /* @__PURE__ */ k("div", {
609
- className: r("absolute inset-y-0 end-1 flex items-center", P ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
610
- children: /* @__PURE__ */ k(f, {
611
- items: I,
612
- onOpenChange: F,
610
+ }), te && /* @__PURE__ */ A("div", {
611
+ 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"),
612
+ children: /* @__PURE__ */ A(f, {
613
+ items: z,
614
+ onOpenChange: ee,
613
615
  matchReferenceWidth: !1,
614
616
  listClassName: "w-[140px] cp-dropdown-overlay",
615
- children: /* @__PURE__ */ k(m, {
616
- icon: /* @__PURE__ */ k(N, {
617
+ children: /* @__PURE__ */ A(m, {
618
+ ref: R,
619
+ icon: /* @__PURE__ */ A(P, {
617
620
  size: u.SM,
618
621
  className: X.triggerIcon,
619
622
  "aria-hidden": !0
620
623
  }),
621
624
  appearance: l.Ghost,
622
625
  size: v.Small,
623
- "aria-label": c,
624
- className: r("flex items-center justify-center rounded", X.trigger, P && X.triggerActive)
626
+ "aria-label": p,
627
+ className: r("flex items-center justify-center rounded", X.trigger, I && X.triggerActive)
625
628
  })
626
629
  })
627
630
  })]
628
631
  });
629
- }, Se = ({ 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 }) => {
632
+ }, 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 }) => {
630
633
  let d = o != null;
631
- return /* @__PURE__ */ A("button", {
634
+ return /* @__PURE__ */ j("button", {
632
635
  type: "button",
633
636
  "aria-expanded": t,
634
637
  "aria-controls": i,
@@ -643,301 +646,304 @@ var q = /* @__PURE__ */ function(e) {
643
646
  d && (e.preventDefault(), u?.(o, o, null));
644
647
  } : void 0,
645
648
  className: r("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, X.groupHeader, s && X.dropZoneActive),
646
- children: [t ? /* @__PURE__ */ k(j, {
649
+ children: [t ? /* @__PURE__ */ A(M, {
647
650
  stroke: .5,
648
651
  size: 12,
649
652
  className: "shrink-0",
650
653
  "aria-hidden": !0
651
- }) : /* @__PURE__ */ k(M, {
654
+ }) : /* @__PURE__ */ A(N, {
652
655
  stroke: .5,
653
656
  size: 12,
654
657
  className: "shrink-0 rtl:scale-x-[-1]",
655
658
  "aria-hidden": !0
656
- }), /* @__PURE__ */ k(p, { text: e })]
659
+ }), /* @__PURE__ */ A(p, { text: e })]
657
660
  });
658
- }, Ce = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, listId: a, activeConversationId: o, searchQuery: s, onSelectConversation: c, getActions: l, actionsLabel: u, styles: d, draggingId: f, dragOverId: p, allowedDropGroups: m, onDragStart: h, onDragEnd: g, onDragOver: _, onDragLeave: v, onDrop: y }) => {
659
- let b = n[e];
660
- if (b.kind === q.Header) {
661
- let n = b.groupKey === J.Pinned;
662
- return /* @__PURE__ */ k("div", {
661
+ }, 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 }) => {
662
+ let x = n[e];
663
+ if (x.kind === q.Header) {
664
+ let n = x.groupKey === J.Pinned;
665
+ return /* @__PURE__ */ A("div", {
663
666
  role: "presentation",
664
667
  style: t,
665
668
  className: e === 0 ? "pt-0" : "pt-8",
666
- children: /* @__PURE__ */ k(Se, {
667
- label: b.label,
668
- isExpanded: r.has(b.groupKey),
669
- onToggle: () => i(b.groupKey),
669
+ children: /* @__PURE__ */ A(Ce, {
670
+ label: x.label,
671
+ isExpanded: r.has(x.groupKey),
672
+ onToggle: () => i(x.groupKey),
670
673
  listId: a,
671
- className: d?.groupHeaderClassName,
674
+ className: f?.groupHeaderClassName,
672
675
  dropZoneGroupKey: n ? J.Pinned : void 0,
673
- isDragOver: n && p === J.Pinned,
674
- onDragOver: n ? _ : void 0,
675
- onDragLeave: n ? v : void 0,
676
- onDrop: n ? y : void 0
676
+ isDragOver: n && m === J.Pinned,
677
+ onDragOver: n ? v : void 0,
678
+ onDragLeave: n ? y : void 0,
679
+ onDrop: n ? b : void 0
677
680
  })
678
681
  });
679
682
  }
680
- return /* @__PURE__ */ k("div", {
683
+ return /* @__PURE__ */ A("div", {
681
684
  role: "presentation",
682
685
  style: t,
683
686
  className: "pt-1",
684
- children: /* @__PURE__ */ k(xe, {
685
- item: b.item,
686
- isActive: b.item.id === o,
687
+ children: /* @__PURE__ */ A(Se, {
688
+ item: x.item,
689
+ isActive: x.item.id === o,
687
690
  searchQuery: s,
688
691
  onSelectConversation: c,
689
692
  getActions: l,
690
- actionsLabel: u,
691
- itemTitleClassName: d?.itemTitleClassName,
692
- itemIconBadgeClassName: d?.itemIconBadgeClassName,
693
- rowGroupKey: b.groupKey,
693
+ onActionMenuOpen: u,
694
+ actionsLabel: d,
695
+ itemTitleClassName: f?.itemTitleClassName,
696
+ itemIconBadgeClassName: f?.itemIconBadgeClassName,
697
+ rowGroupKey: x.groupKey,
694
698
  rows: n,
695
- draggingId: f,
696
- dragOverId: p,
697
- allowedDropGroups: m,
698
- onDragStart: h,
699
- onDragEnd: g,
700
- onDragOver: _,
701
- onDragLeave: v,
702
- onDrop: y
699
+ draggingId: p,
700
+ dragOverId: m,
701
+ allowedDropGroups: h,
702
+ onDragStart: g,
703
+ onDragEnd: _,
704
+ onDragOver: v,
705
+ onDragLeave: y,
706
+ onDrop: b
703
707
  })
704
708
  });
705
- }, we = (e, t) => t === J.All ? !0 : e.source === t, Te = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ee = new Set([
709
+ }, Te = (e, t) => t === J.All ? !0 : e.source === t, Ee = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, De = new Set([
706
710
  J.Pinned,
707
711
  J.MyChats,
708
712
  J.Shared,
709
713
  J.Organization
710
- ]), Z = b(({ conversations: e, isLoading: t, isOpen: l, onSelectConversation: u, activeConversationId: d, labels: f, onNewChat: p, styles: m, className: g, getActions: _, onToggle: v, headerActions: y, onMoveConversation: b, activeFilter: w, onActiveFilterChange: T }) => {
711
- let { colors: j, typography: M } = m ?? {}, { title: N, emptyLabel: P, noResultsLabel: F, loadingLabel: I = "Loading conversations", newChatLabel: ee, searchPlaceholder: te, searchClearLabel: L, filterLabels: R, groupLabels: z, actionsLabel: B, closeAriaLabel: V } = f, [H, U] = O(""), [W, ne] = O(J.All);
712
- S(() => {
713
- w != null && (ne(w), T?.(w));
714
- }, [w]);
715
- let [G, re] = O(() => Ee), [ie, ae] = O(5), K = C(), oe = D(null), se = D(null), [ue, fe] = O(null), [he, Y] = O(null), [ge, _e] = O(null), ye = D(null), X = D(null), xe = x(({ height: e }) => {
714
+ ]), 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 }) => {
715
+ 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);
716
+ C(() => {
717
+ T != null && (G(T), E?.(T));
718
+ }, [T]);
719
+ 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 }) => {
716
720
  ae(Math.ceil(e / 36 * 2));
717
- }, []), Se = x((e) => {
721
+ }, []), Ce = S((e) => {
718
722
  re((t) => {
719
723
  let n = new Set(t);
720
724
  return n.has(e) ? n.delete(e) : n.add(e), n;
721
725
  });
722
- }, []), Z = x(() => {
723
- ye.current = null, X.current = null, fe(null), Y(null), _e(null);
724
- }, []), De = x((t, n) => {
725
- let r = me(t, pe(n, t), e);
726
- ye.current = t, X.current = r, fe(t), _e(r);
727
- }, [e]), Oe = x(() => {
726
+ }, []), Z = S(() => {
727
+ be.current = null, X.current = null, pe(null), Y(null), ve(null);
728
+ }, []), Oe = S((t, n) => {
729
+ let r = he(t, me(n, t), e);
730
+ be.current = t, X.current = r, pe(t), ve(r);
731
+ }, [e]), ke = S(() => {
728
732
  Z();
729
- }, [Z]), ke = x((e) => {
733
+ }, [Z]), Ae = S((e) => {
730
734
  Y(e);
731
- }, []), Ae = x(() => {
735
+ }, []), je = S(() => {
732
736
  Y(null);
733
- }, []), je = x((e, t, n) => {
734
- let r = ye.current, i = X.current;
735
- Z(), r != null && r !== e && i?.has(t) && b?.({
737
+ }, []), Me = S((e, t, n) => {
738
+ let r = be.current, i = X.current;
739
+ Z(), r != null && r !== e && i?.has(t) && x?.({
736
740
  draggedId: r,
737
741
  targetGroupKey: t,
738
742
  afterId: n
739
743
  });
740
- }, [Z, b]), Me = n({
741
- "--cp-bg": j?.background,
742
- "--sb-border": j?.border,
743
- "--cp-item-hover": j?.itemHover,
744
- "--cp-item-active": j?.itemActive,
745
- "--cp-text": j?.text,
746
- "--cp-text-secondary": j?.textSecondary,
747
- "--cp-new-chat-hover": j?.newChatHoverBackground,
748
- "--cp-new-chat-active": j?.newChatActiveBackground,
749
- "--cp-new-chat-bg": j?.newChatBackground,
750
- "--cp-new-chat-text": j?.newChatText,
751
- "--cp-new-chat-shadow-blue": j?.newChatShadowBlue,
752
- "--cp-new-chat-shadow-blue-hover": j?.newChatShadowBlueHover,
753
- "--cp-new-chat-shadow-blue-active": j?.newChatShadowBlueActive,
754
- "--cp-new-chat-shadow-purple": j?.newChatShadowPurple,
755
- "--cp-new-chat-shadow-purple-hover": j?.newChatShadowPurpleHover,
756
- "--cp-new-chat-shadow-purple-active": j?.newChatShadowPurpleActive,
757
- "--cp-drop-zone-ring": j?.dropZoneRing,
758
- "--cp-trigger-bg": j?.triggerBackground,
759
- "--cp-trigger-icon": j?.triggerIcon,
760
- "--cp-trigger-icon-idle": j?.triggerIconIdle,
761
- "--cp-skeleton-color": j?.skeletonColor
762
- }), Q = E(() => e.filter((e) => we(e, W) && Te(e, H)), [
744
+ }, [Z, x]), Ne = n({
745
+ "--cp-bg": M?.background,
746
+ "--sb-border": M?.border,
747
+ "--cp-item-hover": M?.itemHover,
748
+ "--cp-item-active": M?.itemActive,
749
+ "--cp-text": M?.text,
750
+ "--cp-text-secondary": M?.textSecondary,
751
+ "--cp-new-chat-hover": M?.newChatHoverBackground,
752
+ "--cp-new-chat-active": M?.newChatActiveBackground,
753
+ "--cp-new-chat-bg": M?.newChatBackground,
754
+ "--cp-new-chat-text": M?.newChatText,
755
+ "--cp-new-chat-shadow-blue": M?.newChatShadowBlue,
756
+ "--cp-new-chat-shadow-blue-hover": M?.newChatShadowBlueHover,
757
+ "--cp-new-chat-shadow-blue-active": M?.newChatShadowBlueActive,
758
+ "--cp-new-chat-shadow-purple": M?.newChatShadowPurple,
759
+ "--cp-new-chat-shadow-purple-hover": M?.newChatShadowPurpleHover,
760
+ "--cp-new-chat-shadow-purple-active": M?.newChatShadowPurpleActive,
761
+ "--cp-drop-zone-ring": M?.dropZoneRing,
762
+ "--cp-trigger-bg": M?.triggerBackground,
763
+ "--cp-trigger-icon": M?.triggerIcon,
764
+ "--cp-trigger-icon-idle": M?.triggerIconIdle,
765
+ "--cp-skeleton-color": M?.skeletonColor
766
+ }), Q = D(() => e.filter((e) => Te(e, W) && Ee(e, U)), [
763
767
  e,
764
768
  W,
765
- H
766
- ]), Ne = E(() => Q.filter((e) => e.isPinned), [Q]), Pe = E(() => Q.filter((e) => !e.isPinned && e.source !== J.Shared && e.source !== J.Organization), [Q]), Fe = E(() => Q.filter((e) => !e.isPinned && e.source === J.Shared), [Q]), Ie = E(() => Q.filter((e) => !e.isPinned && e.source === J.Organization), [Q]), Le = E(() => [
769
+ U
770
+ ]), 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(() => [
767
771
  {
768
772
  key: J.Pinned,
769
- label: z?.pinned ?? "Pinned",
770
- items: Ne
773
+ label: B?.pinned ?? "Pinned",
774
+ items: Pe
771
775
  },
772
776
  {
773
777
  key: J.MyChats,
774
- label: z?.myChats ?? "My chats",
775
- items: Pe
778
+ label: B?.myChats ?? "My chats",
779
+ items: Fe
776
780
  },
777
781
  {
778
782
  key: J.Shared,
779
- label: z?.shared ?? "Shared",
780
- items: Fe
783
+ label: B?.shared ?? "Shared",
784
+ items: Ie
781
785
  },
782
786
  {
783
787
  key: J.Organization,
784
- label: z?.organization ?? "Organization",
785
- items: Ie
788
+ label: B?.organization ?? "Organization",
789
+ items: Le
786
790
  }
787
791
  ], [
788
- z,
789
- Ne,
792
+ B,
790
793
  Pe,
791
794
  Fe,
792
- Ie
793
- ]), $ = E(() => {
795
+ Ie,
796
+ Le
797
+ ]), $ = D(() => {
794
798
  let e = [];
795
- for (let t of Le) if (t.items.length !== 0 && (e.push({
799
+ for (let t of Re) if (t.items.length !== 0 && (e.push({
796
800
  kind: q.Header,
797
801
  groupKey: t.key,
798
802
  label: t.label
799
- }), G.has(t.key))) for (let n of t.items) e.push({
803
+ }), K.has(t.key))) for (let n of t.items) e.push({
800
804
  kind: q.Item,
801
805
  item: n,
802
806
  groupKey: t.key
803
807
  });
804
808
  return e;
805
- }, [Le, G]);
806
- S(() => {
809
+ }, [Re, K]);
810
+ C(() => {
807
811
  if (!d) return;
808
- let e = Le.find((e) => e.items.some((e) => e.id === d))?.key;
809
- if (e && !G.has(e)) {
812
+ let e = Re.find((e) => e.items.some((e) => e.id === d))?.key;
813
+ if (e && !K.has(e)) {
810
814
  re((t) => new Set(t).add(e));
811
815
  return;
812
816
  }
813
- if (se.current === d) return;
817
+ if (ce.current === d) return;
814
818
  let t = $.findIndex((e) => e.kind === q.Item && e.item.id === d);
815
- t >= 0 && (oe.current?.scrollToRow({
819
+ t >= 0 && (se.current?.scrollToRow({
816
820
  index: t,
817
821
  align: "smart",
818
822
  behavior: "smooth"
819
- }), se.current = d);
823
+ }), ce.current = d);
820
824
  }, [
821
825
  d,
822
- Le,
823
- G,
826
+ Re,
827
+ K,
824
828
  $
825
829
  ]);
826
- let Re = E(() => ({
830
+ let ze = D(() => ({
827
831
  rows: $,
828
- expandedGroups: G,
829
- onToggleGroup: Se,
830
- listId: K,
832
+ expandedGroups: K,
833
+ onToggleGroup: Ce,
834
+ listId: oe,
831
835
  activeConversationId: d,
832
- searchQuery: H,
836
+ searchQuery: U,
833
837
  onSelectConversation: u,
834
838
  getActions: _,
835
- actionsLabel: B,
839
+ onActionMenuOpen: v,
840
+ actionsLabel: V,
836
841
  styles: {
837
- groupHeaderClassName: M?.groupHeaderClassName,
838
- itemTitleClassName: M?.itemTitleClassName,
842
+ groupHeaderClassName: N?.groupHeaderClassName,
843
+ itemTitleClassName: N?.itemTitleClassName,
839
844
  itemIconBadgeClassName: m?.itemIconBadgeClassName
840
845
  },
841
- draggingId: ue,
842
- dragOverId: he,
843
- allowedDropGroups: ge,
844
- onDragStart: (e) => De(e, $),
845
- onDragEnd: Oe,
846
- onDragOver: ke,
847
- onDragLeave: Ae,
848
- onDrop: je
846
+ draggingId: de,
847
+ dragOverId: ge,
848
+ allowedDropGroups: _e,
849
+ onDragStart: (e) => Oe(e, $),
850
+ onDragEnd: ke,
851
+ onDragOver: Ae,
852
+ onDragLeave: je,
853
+ onDrop: Me
849
854
  }), [
850
855
  $,
851
- G,
852
- Se,
853
856
  K,
857
+ Ce,
858
+ oe,
854
859
  d,
855
- H,
860
+ U,
856
861
  u,
857
862
  _,
858
- B,
859
- M?.groupHeaderClassName,
860
- M?.itemTitleClassName,
863
+ v,
864
+ V,
865
+ N?.groupHeaderClassName,
866
+ N?.itemTitleClassName,
861
867
  m?.itemIconBadgeClassName,
862
- ue,
863
- he,
868
+ de,
864
869
  ge,
865
- De,
870
+ _e,
866
871
  Oe,
867
872
  ke,
868
873
  Ae,
869
- je
870
- ]), ze = e.length === 0, Be = e.length > 0 && Q.length === 0;
871
- return /* @__PURE__ */ A(c, {
874
+ je,
875
+ Me
876
+ ]), Be = e.length === 0, Ve = e.length > 0 && Q.length === 0;
877
+ return /* @__PURE__ */ j(c, {
872
878
  isOpen: l,
873
879
  orientation: s.Left,
874
- title: N,
880
+ title: P,
875
881
  labels: {
876
- ariaLabel: N,
877
- closeLabel: V
882
+ ariaLabel: P,
883
+ closeLabel: H
878
884
  },
879
- onClose: v,
885
+ onClose: y,
880
886
  styles: {
881
887
  colors: {
882
- background: j?.background,
883
- border: j?.border
888
+ background: M?.background,
889
+ border: M?.border
884
890
  },
885
- typography: { fontClassName: M?.fontClassName },
891
+ typography: { fontClassName: N?.fontClassName },
886
892
  bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
887
- cssVars: Me,
888
- titleClassName: M?.fontClassName,
893
+ cssVars: Ne,
894
+ titleClassName: N?.fontClassName,
889
895
  headerClassName: "h-[64px]",
890
896
  className: r(l ? "w-[325px] border-s border-e mobile:w-full" : "w-0", g)
891
897
  },
892
- rightActions: y,
898
+ rightActions: b,
893
899
  children: [
894
- /* @__PURE__ */ k(be, {
895
- label: ee,
900
+ /* @__PURE__ */ A(xe, {
901
+ label: R,
896
902
  onClick: p,
897
- labelClassName: M?.newChatLabelClassName
903
+ labelClassName: N?.newChatLabelClassName
898
904
  }),
899
- /* @__PURE__ */ k(o, {
900
- placeholder: te,
901
- value: H,
902
- onChange: U,
903
- clearLabel: L
905
+ /* @__PURE__ */ A(o, {
906
+ placeholder: ee,
907
+ value: U,
908
+ onChange: ne,
909
+ clearLabel: z
904
910
  }),
905
- /* @__PURE__ */ k(ve, {
911
+ /* @__PURE__ */ A(ye, {
906
912
  activeTab: W,
907
- labels: R,
913
+ labels: te,
908
914
  onChange: (e) => {
909
- ne(e), T?.(e);
915
+ G(e), E?.(e);
910
916
  },
911
- tabClassName: M?.tabClassName
917
+ tabClassName: N?.tabClassName
912
918
  }),
913
- /* @__PURE__ */ k("span", {
919
+ /* @__PURE__ */ A("span", {
914
920
  role: "status",
915
921
  "aria-live": "polite",
916
922
  className: "sr-only",
917
- children: t ? I : ze ? P : Be ? F : ""
923
+ children: t ? L : Be ? F : Ve ? I : ""
918
924
  }),
919
- /* @__PURE__ */ k("div", {
925
+ /* @__PURE__ */ A("div", {
920
926
  className: "flex-1 overflow-hidden px-2 py-1",
921
- children: t ? /* @__PURE__ */ k("div", {
927
+ children: t ? /* @__PURE__ */ A("div", {
922
928
  className: "flex flex-col gap-3 px-2 py-3",
923
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ k(h, {
929
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ A(h, {
924
930
  avatar: { size: 24 },
925
- showTitle: { width: le(t) },
931
+ showTitle: { width: ue(t) },
926
932
  paragraph: !1,
927
933
  active: !0,
928
934
  color: "var(--bg-layer-4)"
929
935
  }, t))
930
- }) : ze ? /* @__PURE__ */ k(i, { label: P }) : Be ? /* @__PURE__ */ k(a, { label: F }) : /* @__PURE__ */ k(ce, {
931
- listRef: oe,
932
- id: K,
936
+ }) : Be ? /* @__PURE__ */ A(i, { label: F }) : Ve ? /* @__PURE__ */ A(a, { label: I }) : /* @__PURE__ */ A(le, {
937
+ listRef: se,
938
+ id: oe,
933
939
  role: "list",
934
940
  style: { height: "100%" },
935
- rowComponent: Ce,
941
+ rowComponent: we,
936
942
  rowCount: $.length,
937
- rowHeight: de,
943
+ rowHeight: fe,
938
944
  overscanCount: ie,
939
- onResize: xe,
940
- rowProps: Re
945
+ onResize: Se,
946
+ rowProps: ze
941
947
  })
942
948
  })
943
949
  ]