@epam/statgpt-conversation-list 0.5.0 → 0.6.0-rc.0

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 (3) hide show
  1. package/index.js +1 -1
  2. package/index.mjs +378 -369
  3. package/package.json +4 -4
package/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { jsxs as S, jsx as h, Fragment as Ee } from "react/jsx-runtime";
1
+ import { jsxs as b, jsx as h, Fragment as Ee } from "react/jsx-runtime";
2
2
  import k from "classnames";
3
- import P, { createContext as Re, useContext as Se, useState as B, useRef as me, useMemo as K, useCallback as O, useEffect as ne } from "react";
4
- import { cloneDeep as Ve, uniqBy as Xe, omit as Ke } from "lodash";
5
- import { Popup as le, PopUpSize as ce, Button as j, Loader as be, InputWithIcon as Me, Input as Ze, PopUpState as $, Dropdown as Ae, HighlightText as Je, IconButton as qe } from "@epam/statgpt-ui-components";
6
- import { IconCheck as et, IconCopy as tt, IconDotsVertical as nt, IconCaretRightFilled as ot, IconX as rt, IconSearch as st } from "@tabler/icons-react";
7
- import it from "jszip";
8
- import { getConversationAttachments as at, SHARE_CONVERSATION_ROUTE as Ie, getClearedConversationName as ve, ONBOARDING_MODEL_POSTFIX as lt, cleanConversationNames as q } from "@epam/statgpt-shared-toolkit";
9
- import { InvitationType as ct, getSharedConversationsRequest as se, ShareTarget as ie } from "@epam/statgpt-dial-toolkit";
10
- var _ = /* @__PURE__ */ ((t) => (t.DELETE = "delete", t.EXPORT = "export", t.SHARE = "share", t.RENAME = "rename", t))(_ || {}), U = /* @__PURE__ */ ((t) => (t.SHARED = "shared", t.TODAY = "today", t.YESTERDAY = "yesterday", t.WEEK = "week", t.EARLIER = "earlier", t))(U || {});
3
+ import I, { createContext as Re, useContext as Se, useState as O, useRef as me, useMemo as Z, useCallback as D, useEffect as oe } from "react";
4
+ import { cloneDeep as Xe, uniqBy as Ke, omit as Ze } from "lodash";
5
+ import { Popup as ce, PopUpSize as ue, Button as W, Loader as be, InlineAlert as Je, InlineAlertType as qe, InputWithIcon as Me, Input as et, PopUpState as Y, Dropdown as Ae, HighlightText as tt, IconButton as nt } from "@epam/statgpt-ui-components";
6
+ import { IconCheck as ot, IconCopy as rt, IconInfoCircle as st, IconDotsVertical as it, IconCaretRightFilled as at, IconX as lt, IconSearch as ct } from "@tabler/icons-react";
7
+ import ut from "jszip";
8
+ import { getConversationAttachments as dt, SHARE_CONVERSATION_ROUTE as Ie, getClearedConversationName as ve, ONBOARDING_MODEL_POSTFIX as ht, cleanConversationNames as q } from "@epam/statgpt-shared-toolkit";
9
+ import { InvitationType as ft, getSharedConversationsRequest as ie, ShareTarget as ae } from "@epam/statgpt-dial-toolkit";
10
+ var z = /* @__PURE__ */ ((t) => (t.DELETE = "delete", t.EXPORT = "export", t.SHARE = "share", t.RENAME = "rename", t))(z || {}), F = /* @__PURE__ */ ((t) => (t.SHARED = "shared", t.TODAY = "today", t.YESTERDAY = "yesterday", t.WEEK = "week", t.EARLIER = "earlier", t))(F || {});
11
11
  const pe = (t, s) => t?.resources?.filter((r) => r?.parentPath === s)?.map((r) => {
12
12
  const a = `${r?.bucket}/${s}`, u = r?.url?.split("/")?.slice(1)?.join("/");
13
13
  return {
@@ -16,38 +16,38 @@ const pe = (t, s) => t?.resources?.filter((r) => r?.parentPath === s)?.map((r) =
16
16
  id: u,
17
17
  isShared: !0
18
18
  };
19
- }) || [], ut = (t) => ({
20
- [U.SHARED]: t
21
- }), dt = {
22
- [U.TODAY]: [],
23
- [U.YESTERDAY]: [],
24
- [U.WEEK]: [],
25
- [U.EARLIER]: []
26
- }, xe = (t, s) => t.toDateString() === s.toDateString(), ht = (t, s) => {
19
+ }) || [], pt = (t) => ({
20
+ [F.SHARED]: t
21
+ }), mt = {
22
+ [F.TODAY]: [],
23
+ [F.YESTERDAY]: [],
24
+ [F.WEEK]: [],
25
+ [F.EARLIER]: []
26
+ }, xe = (t, s) => t.toDateString() === s.toDateString(), gt = (t, s) => {
27
27
  const r = new Date(
28
28
  t.getFullYear(),
29
29
  t.getMonth(),
30
30
  t.getDate() - 1
31
31
  );
32
32
  return xe(s, r);
33
- }, ft = (t, s) => {
33
+ }, Ct = (t, s) => {
34
34
  const r = t.getTime() - s.getTime();
35
35
  return Math.floor(r / (1e3 * 60 * 60 * 24));
36
- }, ye = (t) => t.updatedAt || Number(t.id?.split("-").pop()), pt = (t) => {
37
- const s = /* @__PURE__ */ new Date(), r = Ve(dt);
36
+ }, ye = (t) => t.updatedAt || Number(t.id?.split("-").pop()), Et = (t) => {
37
+ const s = /* @__PURE__ */ new Date(), r = Xe(mt);
38
38
  for (const a of t)
39
39
  if (a.updatedAt) {
40
40
  const u = new Date(a.updatedAt);
41
41
  let c;
42
- xe(s, u) ? c = r[U.TODAY] : ht(s, u) ? c = r[U.YESTERDAY] : ft(s, u) <= 7 ? c = r[U.WEEK] : c = r[U.EARLIER], c?.some(
42
+ xe(s, u) ? c = r[F.TODAY] : gt(s, u) ? c = r[F.YESTERDAY] : Ct(s, u) <= 7 ? c = r[F.WEEK] : c = r[F.EARLIER], c?.some(
43
43
  (C) => C.id === a.id
44
44
  ) || c.push(a);
45
45
  }
46
46
  return r;
47
47
  }, Pe = (t) => t?.sort(
48
48
  (s, r) => (ye(r) || 0) - (ye(s) || 0)
49
- ), mt = (t, s) => t === U.SHARED ? s?.shared || "Shared" : t === U.TODAY ? s?.today || "Today" : t === U.YESTERDAY ? s?.yesterday || "Yesterday" : t === U.WEEK ? s?.lastWeek || "Last week" : s?.earlier || "Earlier", De = Re(null);
50
- function V() {
49
+ ), vt = (t, s) => t === F.SHARED ? s?.shared || "Shared" : t === F.TODAY ? s?.today || "Today" : t === F.YESTERDAY ? s?.yesterday || "Yesterday" : t === F.WEEK ? s?.lastWeek || "Last week" : s?.earlier || "Earlier", De = Re(null);
50
+ function K() {
51
51
  const t = Se(De);
52
52
  if (!t)
53
53
  throw new Error(
@@ -55,27 +55,27 @@ function V() {
55
55
  );
56
56
  return t;
57
57
  }
58
- const gt = ({
58
+ const wt = ({
59
59
  onCloseModal: t,
60
60
  deleteConversation: s,
61
61
  locale: r
62
62
  }) => {
63
- const { titles: a, disableModalDividers: u, isSmallModalButton: c } = V();
64
- return /* @__PURE__ */ S(
65
- le,
63
+ const { titles: a, disableModalDividers: u, isSmallModalButton: c } = K();
64
+ return /* @__PURE__ */ b(
65
+ ce,
66
66
  {
67
67
  heading: a?.deleteTitle ?? "Delete conversation",
68
68
  portalId: "delete-conversation",
69
69
  containerClassName: "delete-conversation-popup",
70
- size: ce.SM,
70
+ size: ue.SM,
71
71
  dividers: !u,
72
72
  onClose: t,
73
73
  closeButtonTitle: a?.close ?? "Cancel",
74
74
  children: [
75
75
  /* @__PURE__ */ h("div", { className: "px-6 py-4 sm:px-0", lang: r, children: a?.deleteMessage ?? "Are you sure you want to delete this conversation? This action cannot be undone." }),
76
- /* @__PURE__ */ S("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
76
+ /* @__PURE__ */ b("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
77
77
  /* @__PURE__ */ h(
78
- j,
78
+ W,
79
79
  {
80
80
  buttonClassName: "cancel-button",
81
81
  title: a?.cancel ?? "Cancel",
@@ -86,7 +86,7 @@ const gt = ({
86
86
  }
87
87
  ),
88
88
  /* @__PURE__ */ h(
89
- j,
89
+ W,
90
90
  {
91
91
  buttonClassName: "text-button-primary text-button-primary-error",
92
92
  title: a?.delete ?? "Delete",
@@ -100,19 +100,19 @@ const gt = ({
100
100
  ]
101
101
  }
102
102
  );
103
- }, Ct = (t) => {
104
- const s = yt(
105
- at(t)
103
+ }, yt = (t) => {
104
+ const s = bt(
105
+ dt(t)
106
106
  ).map((r) => ({
107
107
  ...r,
108
108
  relativePath: "",
109
109
  contentLength: 0
110
110
  }));
111
- return Xe(
111
+ return Ke(
112
112
  s,
113
- (r) => oe(r.relativePath, r.name)
113
+ (r) => re(r.relativePath, r.name)
114
114
  );
115
- }, Et = (t) => t.endsWith("/"), vt = (t) => {
115
+ }, Nt = (t) => t.endsWith("/"), Rt = (t) => {
116
116
  const s = t.toLowerCase();
117
117
  return [
118
118
  "data:",
@@ -125,18 +125,18 @@ const gt = ({
125
125
  "telnet://",
126
126
  "api/files"
127
127
  ].some((r) => s.startsWith(r));
128
- }, wt = (t) => {
129
- const s = oe(
128
+ }, St = (t) => {
129
+ const s = re(
130
130
  ...t.split("/").map((a) => decodeURIComponent(a))
131
131
  ), r = s.lastIndexOf("/");
132
132
  return {
133
133
  absolutePath: s.slice(0, r),
134
134
  name: s.slice(r + 1)
135
135
  };
136
- }, yt = (t) => t ? t.map((s) => {
137
- if (!s.url || vt(s.url) || Et(s.url))
136
+ }, bt = (t) => t ? t.map((s) => {
137
+ if (!s.url || Rt(s.url) || Nt(s.url))
138
138
  return null;
139
- const { absolutePath: r, name: a } = wt(s.url);
139
+ const { absolutePath: r, name: a } = St(s.url);
140
140
  return {
141
141
  id: s.url,
142
142
  name: a,
@@ -145,44 +145,44 @@ const gt = ({
145
145
  absolutePath: r
146
146
  };
147
147
  }).filter(Boolean) : [];
148
- async function Nt(t, s) {
149
- const r = Ct(t), a = new it();
148
+ async function Mt(t, s) {
149
+ const r = yt(t), a = new ut();
150
150
  r.forEach((p) => {
151
- const e = encodeURI(oe(p.absolutePath, p.name)), o = s(`${e}`.replace("files/", "")), n = Rt(p.folderId), i = oe("res", n, p.name);
151
+ const e = encodeURI(re(p.absolutePath, p.name)), o = s(`${e}`.replace("files/", "")), n = At(p.folderId), i = re("res", n, p.name);
152
152
  a.file(i, o);
153
153
  });
154
154
  const u = {
155
155
  version: 5,
156
- history: [t].map(St) || [],
156
+ history: [t].map(It) || [],
157
157
  folders: []
158
158
  }, c = JSON.stringify(u, null, 2);
159
159
  return a.file("conversations/conversations_history.json", c), await a.generateAsync({ type: "base64" });
160
160
  }
161
- const Rt = (t) => {
161
+ const At = (t) => {
162
162
  const s = t.split("/");
163
- return s.length > 2 ? oe(...s.slice(2)) : void 0;
164
- }, St = (t) => Ke(t, ["publicationInfo"]), oe = (...t) => t.filter(Boolean).join("/");
165
- function bt(t, s) {
163
+ return s.length > 2 ? re(...s.slice(2)) : void 0;
164
+ }, It = (t) => Ze(t, ["publicationInfo"]), re = (...t) => t.filter(Boolean).join("/");
165
+ function xt(t, s) {
166
166
  const r = document.createElement("a");
167
167
  r.download = s, r.href = t, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(t);
168
168
  }
169
- var Mt = Object.defineProperty, ae = Object.getOwnPropertySymbols, Te = Object.prototype.hasOwnProperty, Oe = Object.prototype.propertyIsEnumerable, Ne = (t, s, r) => s in t ? Mt(t, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[s] = r, ge = (t, s) => {
169
+ var Pt = Object.defineProperty, le = Object.getOwnPropertySymbols, Te = Object.prototype.hasOwnProperty, Oe = Object.prototype.propertyIsEnumerable, Ne = (t, s, r) => s in t ? Pt(t, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[s] = r, ge = (t, s) => {
170
170
  for (var r in s || (s = {}))
171
171
  Te.call(s, r) && Ne(t, r, s[r]);
172
- if (ae)
173
- for (var r of ae(s))
172
+ if (le)
173
+ for (var r of le(s))
174
174
  Oe.call(s, r) && Ne(t, r, s[r]);
175
175
  return t;
176
176
  }, Ce = (t, s) => {
177
177
  var r = {};
178
178
  for (var a in t)
179
179
  Te.call(t, a) && s.indexOf(a) < 0 && (r[a] = t[a]);
180
- if (t != null && ae)
181
- for (var a of ae(t))
180
+ if (t != null && le)
181
+ for (var a of le(t))
182
182
  s.indexOf(a) < 0 && Oe.call(t, a) && (r[a] = t[a]);
183
183
  return r;
184
184
  };
185
- var Z;
185
+ var J;
186
186
  ((t) => {
187
187
  const s = class v {
188
188
  /*-- Constructor (low level) and fields --*/
@@ -263,9 +263,9 @@ var Z;
263
263
  m.push(y);
264
264
  }
265
265
  u(m.length == E);
266
- const R = v.getNumDataCodewords(d, o) * 8;
267
- u(m.length <= R), r(0, Math.min(4, R - m.length), m), r(0, (8 - m.length % 8) % 8, m), u(m.length % 8 == 0);
268
- for (let g = 236; m.length < R; g ^= 253)
266
+ const N = v.getNumDataCodewords(d, o) * 8;
267
+ u(m.length <= N), r(0, Math.min(4, N - m.length), m), r(0, (8 - m.length % 8) % 8, m), u(m.length % 8 == 0);
268
+ for (let g = 236; m.length < N; g ^= 253)
269
269
  r(g, 8, m);
270
270
  let w = [];
271
271
  for (; w.length * 8 < m.length; )
@@ -360,12 +360,12 @@ var Z;
360
360
  throw new RangeError("Invalid argument");
361
361
  const i = v.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][o], l = v.ECC_CODEWORDS_PER_BLOCK[n.ordinal][o], f = Math.floor(v.getNumRawDataModules(o) / 8), d = i - f % i, E = Math.floor(f / i);
362
362
  let m = [];
363
- const R = v.reedSolomonComputeDivisor(l);
363
+ const N = v.reedSolomonComputeDivisor(l);
364
364
  for (let g = 0, y = 0; g < i; g++) {
365
365
  let A = e.slice(y, y + E - l + (g < d ? 0 : 1));
366
366
  y += A.length;
367
- const T = v.reedSolomonComputeRemainder(A, R);
368
- g < d && A.push(0), m.push(A.concat(T));
367
+ const L = v.reedSolomonComputeRemainder(A, N);
368
+ g < d && A.push(0), m.push(A.concat(L));
369
369
  }
370
370
  let w = [];
371
371
  for (let g = 0; g < m[0].length; g++)
@@ -687,7 +687,7 @@ var Z;
687
687
  c.NUMERIC_REGEX = /^[0-9]*$/, c.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, c.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
688
688
  let C = c;
689
689
  t.QrSegment = c;
690
- })(Z || (Z = {}));
690
+ })(J || (J = {}));
691
691
  ((t) => {
692
692
  ((s) => {
693
693
  const r = class {
@@ -699,7 +699,7 @@ var Z;
699
699
  };
700
700
  r.LOW = new r(0, 1), r.MEDIUM = new r(1, 0), r.QUARTILE = new r(2, 3), r.HIGH = new r(3, 2), s.Ecc = r;
701
701
  })(t.QrCode || (t.QrCode = {}));
702
- })(Z || (Z = {}));
702
+ })(J || (J = {}));
703
703
  ((t) => {
704
704
  ((s) => {
705
705
  const r = class {
@@ -716,14 +716,14 @@ var Z;
716
716
  };
717
717
  r.NUMERIC = new r(1, [10, 12, 14]), r.ALPHANUMERIC = new r(2, [9, 11, 13]), r.BYTE = new r(4, [8, 16, 16]), r.KANJI = new r(8, [8, 10, 12]), r.ECI = new r(7, [0, 0, 0]), s.Mode = r;
718
718
  })(t.QrSegment || (t.QrSegment = {}));
719
- })(Z || (Z = {}));
720
- var ee = Z;
721
- var At = {
719
+ })(J || (J = {}));
720
+ var ee = J;
721
+ var Dt = {
722
722
  L: ee.QrCode.Ecc.LOW,
723
723
  M: ee.QrCode.Ecc.MEDIUM,
724
724
  Q: ee.QrCode.Ecc.QUARTILE,
725
725
  H: ee.QrCode.Ecc.HIGH
726
- }, Le = 128, Be = "L", ke = "#FFFFFF", Fe = "#000000", Ue = !1, ze = 1, It = 4, xt = 0, Pt = 0.1;
726
+ }, Le = 128, Be = "L", ke = "#FFFFFF", Fe = "#000000", Ue = !1, ze = 1, Tt = 4, Ot = 0, Lt = 0.1;
727
727
  function _e(t, s = 0) {
728
728
  const r = [];
729
729
  return t.forEach(function(a, u) {
@@ -750,20 +750,20 @@ function _e(t, s = 0) {
750
750
  function $e(t, s) {
751
751
  return t.slice().map((r, a) => a < s.y || a >= s.y + s.h ? r : r.map((u, c) => c < s.x || c >= s.x + s.w ? u : !1));
752
752
  }
753
- function Dt(t, s, r, a) {
753
+ function Bt(t, s, r, a) {
754
754
  if (a == null)
755
755
  return null;
756
- const u = t.length + r * 2, c = Math.floor(s * Pt), C = u / s, p = (a.width || c) * C, e = (a.height || c) * C, o = a.x == null ? t.length / 2 - p / 2 : a.x * C, n = a.y == null ? t.length / 2 - e / 2 : a.y * C, i = a.opacity == null ? 1 : a.opacity;
756
+ const u = t.length + r * 2, c = Math.floor(s * Lt), C = u / s, p = (a.width || c) * C, e = (a.height || c) * C, o = a.x == null ? t.length / 2 - p / 2 : a.x * C, n = a.y == null ? t.length / 2 - e / 2 : a.y * C, i = a.opacity == null ? 1 : a.opacity;
757
757
  let l = null;
758
758
  if (a.excavate) {
759
- let d = Math.floor(o), E = Math.floor(n), m = Math.ceil(p + o - d), R = Math.ceil(e + n - E);
760
- l = { x: d, y: E, w: m, h: R };
759
+ let d = Math.floor(o), E = Math.floor(n), m = Math.ceil(p + o - d), N = Math.ceil(e + n - E);
760
+ l = { x: d, y: E, w: m, h: N };
761
761
  }
762
762
  const f = a.crossOrigin;
763
763
  return { x: o, y: n, h: e, w: p, excavation: l, opacity: i, crossOrigin: f };
764
764
  }
765
- function Tt(t, s) {
766
- return s != null ? Math.max(Math.floor(s), 0) : t ? It : xt;
765
+ function kt(t, s) {
766
+ return s != null ? Math.max(Math.floor(s), 0) : t ? Tt : Ot;
767
767
  }
768
768
  function He({
769
769
  value: t,
@@ -775,20 +775,20 @@ function He({
775
775
  size: C,
776
776
  boostLevel: p
777
777
  }) {
778
- let e = P.useMemo(() => {
778
+ let e = I.useMemo(() => {
779
779
  const d = (Array.isArray(t) ? t : [t]).reduce((E, m) => (E.push(...ee.QrSegment.makeSegments(m)), E), []);
780
780
  return ee.QrCode.encodeSegments(
781
781
  d,
782
- At[s],
782
+ Dt[s],
783
783
  r,
784
784
  void 0,
785
785
  void 0,
786
786
  p
787
787
  );
788
788
  }, [t, s, r, p]);
789
- const { cells: o, margin: n, numCells: i, calculatedImageSettings: l } = P.useMemo(() => {
789
+ const { cells: o, margin: n, numCells: i, calculatedImageSettings: l } = I.useMemo(() => {
790
790
  let f = e.getModules();
791
- const d = Tt(a, u), E = f.length + d * 2, m = Dt(
791
+ const d = kt(a, u), E = f.length + d * 2, m = Bt(
792
792
  f,
793
793
  C,
794
794
  d,
@@ -809,14 +809,14 @@ function He({
809
809
  calculatedImageSettings: l
810
810
  };
811
811
  }
812
- var Ot = (function() {
812
+ var Ft = (function() {
813
813
  try {
814
814
  new Path2D().addPath(new Path2D());
815
815
  } catch {
816
816
  return !1;
817
817
  }
818
818
  return !0;
819
- })(), Lt = P.forwardRef(
819
+ })(), Ut = I.forwardRef(
820
820
  function(s, r) {
821
821
  const a = s, {
822
822
  value: u,
@@ -840,12 +840,12 @@ var Ot = (function() {
840
840
  "boostLevel",
841
841
  "marginSize",
842
842
  "imageSettings"
843
- ]), { style: m } = E, R = Ce(E, ["style"]), w = f?.src, g = P.useRef(null), y = P.useRef(null), A = P.useCallback(
844
- (Y) => {
845
- g.current = Y, typeof r == "function" ? r(Y) : r && (r.current = Y);
843
+ ]), { style: m } = E, N = Ce(E, ["style"]), w = f?.src, g = I.useRef(null), y = I.useRef(null), A = I.useCallback(
844
+ ($) => {
845
+ g.current = $, typeof r == "function" ? r($) : r && (r.current = $);
846
846
  },
847
847
  [r]
848
- ), [T, b] = P.useState(!1), { margin: L, cells: H, numCells: Q, calculatedImageSettings: D } = He({
848
+ ), [L, S] = I.useState(!1), { margin: B, cells: _, numCells: j, calculatedImageSettings: T } = He({
849
849
  value: u,
850
850
  level: C,
851
851
  minVersion: n,
@@ -855,63 +855,63 @@ var Ot = (function() {
855
855
  imageSettings: f,
856
856
  size: c
857
857
  });
858
- P.useEffect(() => {
858
+ I.useEffect(() => {
859
859
  if (g.current != null) {
860
- const Y = g.current, N = Y.getContext("2d");
861
- if (!N)
860
+ const $ = g.current, R = $.getContext("2d");
861
+ if (!R)
862
862
  return;
863
- let I = H;
864
- const x = y.current, F = D != null && x !== null && x.complete && x.naturalHeight !== 0 && x.naturalWidth !== 0;
865
- F && D.excavation != null && (I = $e(
866
- H,
867
- D.excavation
863
+ let x = _;
864
+ const P = y.current, G = T != null && P !== null && P.complete && P.naturalHeight !== 0 && P.naturalWidth !== 0;
865
+ G && T.excavation != null && (x = $e(
866
+ _,
867
+ T.excavation
868
868
  ));
869
- const W = window.devicePixelRatio || 1;
870
- Y.height = Y.width = c * W;
871
- const J = c / Q * W;
872
- N.scale(J, J), N.fillStyle = p, N.fillRect(0, 0, Q, Q), N.fillStyle = e, Ot ? N.fill(new Path2D(_e(I, L))) : H.forEach(function(ue, re) {
873
- ue.forEach(function(de, he) {
874
- de && N.fillRect(he + L, re + L, 1, 1);
869
+ const H = window.devicePixelRatio || 1;
870
+ $.height = $.width = c * H;
871
+ const X = c / j * H;
872
+ R.scale(X, X), R.fillStyle = p, R.fillRect(0, 0, j, j), R.fillStyle = e, Ft ? R.fill(new Path2D(_e(x, B))) : _.forEach(function(te, de) {
873
+ te.forEach(function(se, he) {
874
+ se && R.fillRect(he + B, de + B, 1, 1);
875
875
  });
876
- }), D && (N.globalAlpha = D.opacity), F && N.drawImage(
877
- x,
878
- D.x + L,
879
- D.y + L,
880
- D.w,
881
- D.h
876
+ }), T && (R.globalAlpha = T.opacity), G && R.drawImage(
877
+ P,
878
+ T.x + B,
879
+ T.y + B,
880
+ T.w,
881
+ T.h
882
882
  );
883
883
  }
884
- }), P.useEffect(() => {
885
- b(!1);
884
+ }), I.useEffect(() => {
885
+ S(!1);
886
886
  }, [w]);
887
- const G = ge({ height: c, width: c }, m);
888
- let X = null;
889
- return w != null && (X = /* @__PURE__ */ P.createElement(
887
+ const V = ge({ height: c, width: c }, m);
888
+ let Q = null;
889
+ return w != null && (Q = /* @__PURE__ */ I.createElement(
890
890
  "img",
891
891
  {
892
892
  src: w,
893
893
  key: w,
894
894
  style: { display: "none" },
895
895
  onLoad: () => {
896
- b(!0);
896
+ S(!0);
897
897
  },
898
898
  ref: y,
899
- crossOrigin: D?.crossOrigin
899
+ crossOrigin: T?.crossOrigin
900
900
  }
901
- )), /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement(
901
+ )), /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(
902
902
  "canvas",
903
903
  ge({
904
- style: G,
904
+ style: V,
905
905
  height: c,
906
906
  width: c,
907
907
  ref: A,
908
908
  role: "img"
909
- }, R)
910
- ), X);
909
+ }, N)
910
+ ), Q);
911
911
  }
912
912
  );
913
- Lt.displayName = "QRCodeCanvas";
914
- var Ye = P.forwardRef(
913
+ Ut.displayName = "QRCodeCanvas";
914
+ var Ye = I.forwardRef(
915
915
  function(s, r) {
916
916
  const a = s, {
917
917
  value: u,
@@ -937,7 +937,7 @@ var Ye = P.forwardRef(
937
937
  "title",
938
938
  "marginSize",
939
939
  "imageSettings"
940
- ]), { margin: m, cells: R, numCells: w, calculatedImageSettings: g } = He({
940
+ ]), { margin: m, cells: N, numCells: w, calculatedImageSettings: g } = He({
941
941
  value: u,
942
942
  level: C,
943
943
  minVersion: n,
@@ -947,11 +947,11 @@ var Ye = P.forwardRef(
947
947
  imageSettings: d,
948
948
  size: c
949
949
  });
950
- let y = R, A = null;
950
+ let y = N, A = null;
951
951
  d != null && g != null && (g.excavation != null && (y = $e(
952
- R,
952
+ N,
953
953
  g.excavation
954
- )), A = /* @__PURE__ */ P.createElement(
954
+ )), A = /* @__PURE__ */ I.createElement(
955
955
  "image",
956
956
  {
957
957
  href: d.src,
@@ -964,8 +964,8 @@ var Ye = P.forwardRef(
964
964
  crossOrigin: g.crossOrigin
965
965
  }
966
966
  ));
967
- const T = _e(y, m);
968
- return /* @__PURE__ */ P.createElement(
967
+ const L = _e(y, m);
968
+ return /* @__PURE__ */ I.createElement(
969
969
  "svg",
970
970
  ge({
971
971
  height: c,
@@ -974,8 +974,8 @@ var Ye = P.forwardRef(
974
974
  ref: r,
975
975
  role: "img"
976
976
  }, E),
977
- !!l && /* @__PURE__ */ P.createElement("title", null, l),
978
- /* @__PURE__ */ P.createElement(
977
+ !!l && /* @__PURE__ */ I.createElement("title", null, l),
978
+ /* @__PURE__ */ I.createElement(
979
979
  "path",
980
980
  {
981
981
  fill: p,
@@ -983,31 +983,31 @@ var Ye = P.forwardRef(
983
983
  shapeRendering: "crispEdges"
984
984
  }
985
985
  ),
986
- /* @__PURE__ */ P.createElement("path", { fill: e, d: T, shapeRendering: "crispEdges" }),
986
+ /* @__PURE__ */ I.createElement("path", { fill: e, d: L, shapeRendering: "crispEdges" }),
987
987
  A
988
988
  );
989
989
  }
990
990
  );
991
991
  Ye.displayName = "QRCodeSVG";
992
- const Bt = (t, s) => ({
993
- invitationType: ct.LINK,
992
+ const zt = (t, s) => ({
993
+ invitationType: ft.LINK,
994
994
  resources: [
995
995
  {
996
996
  url: `conversations/${encodeURI(t)}`
997
997
  },
998
998
  ...s
999
999
  ]
1000
- }), kt = (t) => {
1000
+ }), _t = (t) => {
1001
1001
  const s = t?.invitationLink?.split("/").at(-1) || "";
1002
1002
  return `/${Ie}/${s}`;
1003
- }, Ft = (t, s) => s?.find((r) => {
1003
+ }, $t = (t, s) => s?.find((r) => {
1004
1004
  const a = t?.id?.split("/")?.pop(), u = r?.url?.split("/")?.pop() || "";
1005
1005
  return u === a || decodeURI(u) === a;
1006
- }), Ut = (t) => t?.messages?.filter(
1006
+ }), Ht = (t) => t?.messages?.filter(
1007
1007
  (r) => !!r?.custom_content?.attachments
1008
1008
  )?.flatMap((r) => r?.custom_content?.attachments?.map((a) => ({
1009
1009
  url: a?.url || ""
1010
- })) || [])?.filter((r) => !!r?.url) || [], zt = ({
1010
+ })) || [])?.filter((r) => !!r?.url) || [], Yt = ({
1011
1011
  conversation: t,
1012
1012
  locale: s,
1013
1013
  onCloseModal: r,
@@ -1025,103 +1025,112 @@ const Bt = (t, s) => ({
1025
1025
  shareRemoveAccessToUsers: d,
1026
1026
  chatName: E,
1027
1027
  getSharedConversations: m,
1028
- revokeSharedConversations: R,
1028
+ revokeSharedConversations: N,
1029
1029
  baseUrl: w,
1030
1030
  id: g,
1031
1031
  clientSharedPage: y,
1032
- clientSharedProp: A
1032
+ clientSharedProp: A,
1033
+ shareAlertMessage: L
1033
1034
  }) => {
1034
- const [T, b] = B(null), [L, H] = B(), [Q, D] = B(!1), [G, X] = B(!1), [Y, N] = B(), I = me(null), x = me(null), F = K(() => t?.id ? decodeURI(t.id) : g?.[0] && g?.[1] && s ? decodeURI(`${g[0]}/${s}/${g[1]}`) : null, [t?.id, g, s]), W = K(() => {
1035
- if (!T)
1035
+ const [S, B] = O(null), [_, j] = O(), [T, V] = O(!1), [Q, $] = O(!1), [R, x] = O(), P = me(null), G = me(null), H = Z(() => t?.id ? decodeURI(t.id) : g?.[0] && g?.[1] && s ? decodeURI(`${g[0]}/${s}/${g[1]}`) : null, [t?.id, g, s]), X = Z(() => {
1036
+ if (!S)
1036
1037
  return "";
1037
- const z = w || window.location.origin;
1038
+ const U = w || window.location.origin;
1038
1039
  if (w && w !== window.location.origin && y && A) {
1039
- const te = T.split(
1040
+ const ne = S.split(
1040
1041
  `/${Ie}/`
1041
1042
  )?.[1];
1042
- return `${z}/${y}?${A}=${te}`;
1043
+ return `${U}/${y}?${A}=${ne}`;
1043
1044
  }
1044
- return `${z}/${s}${T}`;
1045
- }, [w, T, s, y, A]), J = O(
1046
- async (z) => {
1047
- const te = await m?.(
1048
- se(ie.OTHERS)
1045
+ return `${U}/${s}${S}`;
1046
+ }, [w, S, s, y, A]), te = D(
1047
+ async (U) => {
1048
+ const ne = await m?.(
1049
+ ie(ae.OTHERS)
1049
1050
  );
1050
- if (te)
1051
- return Ft(
1052
- { id: z },
1053
- te.resources
1051
+ if (ne)
1052
+ return $t(
1053
+ { id: U },
1054
+ ne.resources
1054
1055
  );
1055
1056
  },
1056
1057
  [m]
1057
1058
  );
1058
- ne(() => {
1059
- if (!F || I.current === F)
1059
+ oe(() => {
1060
+ if (!H || P.current === H)
1060
1061
  return;
1061
- I.current = F, D(!1), x.current?.abort();
1062
- const z = new AbortController();
1063
- return x.current = z, (async () => {
1062
+ P.current = H, V(!1), G.current?.abort();
1063
+ const U = new AbortController();
1064
+ return G.current = U, (async () => {
1064
1065
  try {
1065
- const fe = await u?.(F), je = Bt(
1066
- F,
1067
- Ut(fe)
1068
- ), we = await c?.(je), We = await J(F);
1069
- if (z.signal.aborted || !we)
1066
+ const fe = await u?.(H), We = zt(
1067
+ H,
1068
+ Ht(fe)
1069
+ ), we = await c?.(We), Ve = await te(H);
1070
+ if (U.signal.aborted || !we)
1070
1071
  return;
1071
- b(kt(we)), H(We), D(!0);
1072
+ B(_t(we)), j(Ve), V(!0);
1072
1073
  } catch (fe) {
1073
- if (z.signal.aborted)
1074
+ if (U.signal.aborted)
1074
1075
  return;
1075
- D(!1), console.error("Error sharing conversation", fe);
1076
+ V(!1), console.error("Error sharing conversation", fe);
1076
1077
  }
1077
1078
  })(), () => {
1078
- z.abort(), I.current = null;
1079
+ U.abort(), P.current = null;
1079
1080
  };
1080
1081
  }, [
1081
- F,
1082
+ H,
1082
1083
  c,
1083
1084
  u,
1084
- J
1085
+ te
1085
1086
  ]);
1086
- const ue = O(() => {
1087
- x.current?.abort(), I.current = null, r(), b(null), D(!1), X(!1);
1088
- }, [r]), re = O(() => {
1089
- X(!0), navigator.clipboard.writeText(W || "");
1090
- }, [W]), de = async () => {
1087
+ const de = D(() => {
1088
+ G.current?.abort(), P.current = null, r(), B(null), V(!1), $(!1);
1089
+ }, [r]), se = D(() => {
1090
+ $(!0), navigator.clipboard.writeText(X || "");
1091
+ }, [X]), he = async () => {
1091
1092
  try {
1092
- if (N(!0), L && await R?.({
1093
- resources: [L]
1094
- }), F) {
1095
- const z = await J(F);
1096
- x.current?.signal.aborted || H(z);
1093
+ if (x(!0), _ && await N?.({
1094
+ resources: [_]
1095
+ }), H) {
1096
+ const U = await te(H);
1097
+ G.current?.signal.aborted || j(U);
1097
1098
  }
1098
- } catch (z) {
1099
- console.error("Error revoking shared conversation", z);
1099
+ } catch (U) {
1100
+ console.error("Error revoking shared conversation", U);
1100
1101
  } finally {
1101
- x.current?.signal.aborted || N(!1);
1102
+ G.current?.signal.aborted || x(!1);
1102
1103
  }
1103
- }, he = O(() => /* @__PURE__ */ h(
1104
- j,
1104
+ }, je = D(() => /* @__PURE__ */ h(
1105
+ W,
1105
1106
  {
1106
- buttonClassName: G ? "text-button-secondary" : "text-button-primary",
1107
- iconBefore: G ? /* @__PURE__ */ h(et, { width: 20, height: 20 }) : /* @__PURE__ */ h(tt, { width: 20, height: 20 }),
1108
- title: G ? l ?? "Copied" : i ?? "Copy link",
1109
- disabled: G,
1110
- onClick: re
1107
+ buttonClassName: Q ? "text-button-secondary" : "text-button-primary",
1108
+ iconBefore: Q ? /* @__PURE__ */ h(ot, { width: 20, height: 20 }) : /* @__PURE__ */ h(rt, { width: 20, height: 20 }),
1109
+ title: Q ? l ?? "Copied" : i ?? "Copy link",
1110
+ disabled: Q,
1111
+ onClick: se
1111
1112
  }
1112
- ), [G, re, l, i]);
1113
- return /* @__PURE__ */ S(
1114
- le,
1113
+ ), [Q, se, l, i]);
1114
+ return /* @__PURE__ */ b(
1115
+ ce,
1115
1116
  {
1116
1117
  heading: n ?? "Share link",
1117
1118
  portalId: "share",
1118
- size: ce.SM,
1119
+ size: ue.SM,
1119
1120
  dividers: a,
1120
- onClose: ue,
1121
+ onClose: de,
1121
1122
  closeButtonTitle: e ?? "Close",
1122
1123
  children: [
1123
- Q ? /* @__PURE__ */ S("div", { className: "share flex flex-col gap-y-4 overflow-auto px-6 pb-6 sm:p-0", children: [
1124
- t?.name ? /* @__PURE__ */ S("div", { className: "share-info flex w-full", children: [
1124
+ T ? /* @__PURE__ */ b("div", { className: "share flex flex-col gap-y-4 overflow-auto px-6 pb-6 sm:p-0", children: [
1125
+ L ? /* @__PURE__ */ h(
1126
+ Je,
1127
+ {
1128
+ type: qe.Note,
1129
+ icon: /* @__PURE__ */ h(st, { width: 16, height: 16 }),
1130
+ children: L
1131
+ }
1132
+ ) : null,
1133
+ t?.name ? /* @__PURE__ */ b("div", { className: "share-info flex w-full", children: [
1125
1134
  /* @__PURE__ */ h("p", { className: "share-info-title body-1 mr-1 text-neutrals-800", children: E ?? "Chat name:" }),
1126
1135
  /* @__PURE__ */ h(
1127
1136
  "h3",
@@ -1132,9 +1141,9 @@ const Bt = (t, s) => ({
1132
1141
  }
1133
1142
  )
1134
1143
  ] }) : null,
1135
- /* @__PURE__ */ S("div", { className: "share-info flex", children: [
1144
+ /* @__PURE__ */ b("div", { className: "share-info flex", children: [
1136
1145
  /* @__PURE__ */ h("p", { className: "share-info-title body-1 mr-1 text-neutrals-800", children: C ?? "Link expiration date:" }),
1137
- /* @__PURE__ */ S("h3", { children: [
1146
+ /* @__PURE__ */ b("h3", { children: [
1138
1147
  "3 ",
1139
1148
  p ?? "days"
1140
1149
  ] })
@@ -1143,7 +1152,7 @@ const Bt = (t, s) => ({
1143
1152
  Ye,
1144
1153
  {
1145
1154
  className: "min-h-[200px] self-center rounded border border-neutrals-600 p-2",
1146
- value: W,
1155
+ value: X,
1147
1156
  size: 200
1148
1157
  }
1149
1158
  ),
@@ -1154,33 +1163,33 @@ const Bt = (t, s) => ({
1154
1163
  containerClasses: "share-input-container",
1155
1164
  cssClass: "share-input",
1156
1165
  readonly: !0,
1157
- placeholder: W,
1158
- value: W,
1166
+ placeholder: X,
1167
+ value: X,
1159
1168
  inputId: "conversationLink",
1160
- iconAfterInput: he()
1169
+ iconAfterInput: je()
1161
1170
  }
1162
1171
  )
1163
1172
  ] }) : /* @__PURE__ */ h("div", { className: "flex items-center justify-center p-6", children: /* @__PURE__ */ h(be, {}) }),
1164
- Q ? t && L ? /* @__PURE__ */ h("div", { className: "remove-access", children: /* @__PURE__ */ h(
1165
- j,
1173
+ T ? t && _ ? /* @__PURE__ */ h("div", { className: "remove-access", children: /* @__PURE__ */ h(
1174
+ W,
1166
1175
  {
1167
1176
  title: d ?? "Remove access to all users",
1168
1177
  buttonClassName: "remove-access-button py-3 px-4",
1169
1178
  isSmallButton: !0,
1170
- disabled: Y,
1171
- onClick: de
1179
+ disabled: R,
1180
+ onClick: he
1172
1181
  }
1173
1182
  ) }) : /* @__PURE__ */ h("p", { className: "body-2 share-footer text-neutrals-800", children: o ?? "This chat has not been shared with anyone yet." }) : /* @__PURE__ */ h("div", {})
1174
1183
  ]
1175
1184
  }
1176
1185
  );
1177
- }, _t = ({
1186
+ }, Qt = ({
1178
1187
  conversation: t,
1179
1188
  onCloseModal: s,
1180
1189
  renameConversation: r,
1181
1190
  locale: a
1182
1191
  }) => {
1183
- const { titles: u, disableModalDividers: c, isSmallModalButton: C } = V(), [p, e] = B(t?.name || ""), o = (i) => {
1192
+ const { titles: u, disableModalDividers: c, isSmallModalButton: C } = K(), [p, e] = O(t?.name || ""), o = (i) => {
1184
1193
  e(i);
1185
1194
  }, n = () => {
1186
1195
  const i = `${t?.folderId}/${encodeURIComponent(ve(p))}-${(/* @__PURE__ */ new Date()).getTime()}`;
@@ -1189,19 +1198,19 @@ const Bt = (t, s) => ({
1189
1198
  `conversations/${i}`
1190
1199
  );
1191
1200
  };
1192
- return /* @__PURE__ */ S(
1193
- le,
1201
+ return /* @__PURE__ */ b(
1202
+ ce,
1194
1203
  {
1195
1204
  heading: u?.renameTitle ?? "Rename conversation",
1196
1205
  portalId: "rename-conversation",
1197
1206
  containerClassName: "rename-conversation-popup",
1198
- size: ce.SM,
1207
+ size: ue.SM,
1199
1208
  dividers: !c,
1200
1209
  onClose: s,
1201
1210
  closeButtonTitle: u?.close ?? "Cancel",
1202
1211
  children: [
1203
1212
  /* @__PURE__ */ h("div", { className: "px-6 py-4 sm:px-0", lang: a, children: /* @__PURE__ */ h(
1204
- Ze,
1213
+ et,
1205
1214
  {
1206
1215
  inputId: "rename",
1207
1216
  value: p,
@@ -1209,9 +1218,9 @@ const Bt = (t, s) => ({
1209
1218
  cssClass: "w-full"
1210
1219
  }
1211
1220
  ) }),
1212
- /* @__PURE__ */ S("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
1221
+ /* @__PURE__ */ b("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
1213
1222
  /* @__PURE__ */ h(
1214
- j,
1223
+ W,
1215
1224
  {
1216
1225
  buttonClassName: "cancel-button",
1217
1226
  title: u?.cancel ?? "Cancel",
@@ -1222,7 +1231,7 @@ const Bt = (t, s) => ({
1222
1231
  }
1223
1232
  ),
1224
1233
  /* @__PURE__ */ h(
1225
- j,
1234
+ W,
1226
1235
  {
1227
1236
  buttonClassName: "text-button-primary text-button-primary",
1228
1237
  title: u?.save ?? "Rename",
@@ -1238,13 +1247,13 @@ const Bt = (t, s) => ({
1238
1247
  }
1239
1248
  );
1240
1249
  }, Qe = Re(null);
1241
- function $t({
1250
+ function Gt({
1242
1251
  children: t,
1243
1252
  value: s
1244
1253
  }) {
1245
1254
  return /* @__PURE__ */ h(Qe.Provider, { value: s, children: t });
1246
1255
  }
1247
- function Ht() {
1256
+ function jt() {
1248
1257
  const t = Se(Qe);
1249
1258
  if (!t)
1250
1259
  throw new Error(
@@ -1252,78 +1261,78 @@ function Ht() {
1252
1261
  );
1253
1262
  return t;
1254
1263
  }
1255
- const Yt = ({
1264
+ const Wt = ({
1256
1265
  conversation: t,
1257
1266
  triggerButton: s,
1258
1267
  isDisabled: r
1259
1268
  }) => {
1260
- const a = V(), {
1269
+ const a = K(), {
1261
1270
  locale: u,
1262
1271
  deleteConversation: c,
1263
1272
  renameConversation: C,
1264
1273
  getConversation: p,
1265
1274
  getFileBlob: e,
1266
1275
  shareConversationProps: o
1267
- } = Ht(), n = K(() => {
1268
- const b = [
1276
+ } = jt(), n = Z(() => {
1277
+ const S = [
1269
1278
  {
1270
- key: _.DELETE,
1279
+ key: z.DELETE,
1271
1280
  title: a?.titles?.delete ?? "Delete",
1272
- icon: a.actionsIcons?.[_.DELETE]
1281
+ icon: a.actionsIcons?.[z.DELETE]
1273
1282
  }
1274
1283
  ];
1275
- return t?.model?.id?.endsWith(lt) ? b : [
1284
+ return t?.model?.id?.endsWith(ht) ? S : [
1276
1285
  ...t.isShared ? [] : [
1277
1286
  {
1278
- key: _.SHARE,
1287
+ key: z.SHARE,
1279
1288
  title: a?.titles?.share ?? "Share",
1280
- icon: a.actionsIcons?.[_.SHARE]
1289
+ icon: a.actionsIcons?.[z.SHARE]
1281
1290
  },
1282
1291
  {
1283
- key: _.RENAME,
1292
+ key: z.RENAME,
1284
1293
  title: a?.titles?.rename ?? "Rename",
1285
- icon: a.actionsIcons?.[_.RENAME]
1294
+ icon: a.actionsIcons?.[z.RENAME]
1286
1295
  }
1287
1296
  ],
1288
1297
  {
1289
- key: _.EXPORT,
1298
+ key: z.EXPORT,
1290
1299
  title: a?.titles?.export ?? "Export",
1291
- icon: a.actionsIcons?.[_.EXPORT]
1300
+ icon: a.actionsIcons?.[z.EXPORT]
1292
1301
  },
1293
- ...b
1302
+ ...S
1294
1303
  ];
1295
1304
  }, [
1296
1305
  t.isShared,
1297
1306
  t?.model?.id,
1298
1307
  a.titles,
1299
1308
  a.actionsIcons
1300
- ]), [i, l] = B($.Closed), [f, d] = B($.Closed), [E, m] = B($.Closed), R = O(() => {
1301
- l($.Closed);
1302
- }, [l]), w = O(() => {
1303
- d($.Closed);
1304
- }, [d]), g = O(() => {
1305
- m($.Closed);
1306
- }, [m]), y = O(() => {
1307
- c(t), R();
1308
- }, [t, c, R]), A = O(
1309
- (b, L) => {
1310
- C(b, L), g();
1309
+ ]), [i, l] = O(Y.Closed), [f, d] = O(Y.Closed), [E, m] = O(Y.Closed), N = D(() => {
1310
+ l(Y.Closed);
1311
+ }, [l]), w = D(() => {
1312
+ d(Y.Closed);
1313
+ }, [d]), g = D(() => {
1314
+ m(Y.Closed);
1315
+ }, [m]), y = D(() => {
1316
+ c(t), N();
1317
+ }, [t, c, N]), A = D(
1318
+ (S, B) => {
1319
+ C(S, B), g();
1311
1320
  },
1312
1321
  [C, g]
1313
1322
  );
1314
- return /* @__PURE__ */ S(Ee, { children: [
1323
+ return /* @__PURE__ */ b(Ee, { children: [
1315
1324
  /* @__PURE__ */ h(
1316
1325
  Ae,
1317
1326
  {
1318
1327
  containerClassName: "ml-3 hidden group-hover:flex",
1319
- triggerButton: s ?? /* @__PURE__ */ h(Qt, { disabled: r }),
1328
+ triggerButton: s ?? /* @__PURE__ */ h(Vt, { disabled: r }),
1320
1329
  options: n,
1321
1330
  openedClassName: "!flex action-menu-opened",
1322
- onOptionSelect: (b) => {
1323
- b === _.DELETE && l($.Opened), b === _.SHARE && d($.Opened), b === _.RENAME && m($.Opened), b === _.EXPORT && p(decodeURI(t.id)).then((L) => {
1324
- Nt(L, e).then((H) => {
1325
- bt(
1326
- `data:application/zip;base64,${H}`,
1331
+ onOptionSelect: (S) => {
1332
+ S === z.DELETE && l(Y.Opened), S === z.SHARE && d(Y.Opened), S === z.RENAME && m(Y.Opened), S === z.EXPORT && p(decodeURI(t.id)).then((B) => {
1333
+ Mt(B, e).then((_) => {
1334
+ xt(
1335
+ `data:application/zip;base64,${_}`,
1327
1336
  `chat_with_attachments_${(/* @__PURE__ */ new Date()).toLocaleDateString()}.dial`
1328
1337
  );
1329
1338
  });
@@ -1332,16 +1341,16 @@ const Yt = ({
1332
1341
  disabled: r
1333
1342
  }
1334
1343
  ),
1335
- i === $.Opened && /* @__PURE__ */ h(
1336
- gt,
1344
+ i === Y.Opened && /* @__PURE__ */ h(
1345
+ wt,
1337
1346
  {
1338
1347
  locale: u,
1339
1348
  deleteConversation: y,
1340
- onCloseModal: R
1349
+ onCloseModal: N
1341
1350
  }
1342
1351
  ),
1343
- f === $.Opened && /* @__PURE__ */ h(
1344
- zt,
1352
+ f === Y.Opened && /* @__PURE__ */ h(
1353
+ Yt,
1345
1354
  {
1346
1355
  conversation: t,
1347
1356
  locale: u,
@@ -1349,8 +1358,8 @@ const Yt = ({
1349
1358
  ...o
1350
1359
  }
1351
1360
  ),
1352
- E === $.Opened && /* @__PURE__ */ h(
1353
- _t,
1361
+ E === Y.Opened && /* @__PURE__ */ h(
1362
+ Qt,
1354
1363
  {
1355
1364
  conversation: t,
1356
1365
  locale: u,
@@ -1359,7 +1368,7 @@ const Yt = ({
1359
1368
  }
1360
1369
  )
1361
1370
  ] });
1362
- }, Qt = ({ disabled: t }) => /* @__PURE__ */ h(
1371
+ }, Vt = ({ disabled: t }) => /* @__PURE__ */ h(
1363
1372
  "div",
1364
1373
  {
1365
1374
  className: k(
@@ -1367,7 +1376,7 @@ const Yt = ({
1367
1376
  t ? "cursor-not-allowed" : "cursor-pointer"
1368
1377
  ),
1369
1378
  children: /* @__PURE__ */ h(
1370
- nt,
1379
+ it,
1371
1380
  {
1372
1381
  width: 20,
1373
1382
  height: 20,
@@ -1383,8 +1392,8 @@ const Yt = ({
1383
1392
  onConversationClick: a,
1384
1393
  isDisabled: u
1385
1394
  }) => {
1386
- const { titles: c, conversationItemIcon: C } = V(), p = me(null), e = ve(t?.name);
1387
- return ne(() => {
1395
+ const { titles: c, conversationItemIcon: C } = K(), p = me(null), e = ve(t?.name);
1396
+ return oe(() => {
1388
1397
  if (t?.id === s && p?.current) {
1389
1398
  const o = p.current.parentElement?.parentElement?.parentElement;
1390
1399
  if (o) {
@@ -1395,7 +1404,7 @@ const Yt = ({
1395
1404
  });
1396
1405
  }
1397
1406
  }
1398
- }, [t, s]), /* @__PURE__ */ S(
1407
+ }, [t, s]), /* @__PURE__ */ b(
1399
1408
  "div",
1400
1409
  {
1401
1410
  ref: p,
@@ -1408,7 +1417,7 @@ const Yt = ({
1408
1417
  onClick: () => !u && a(t.folderId, t?.id),
1409
1418
  title: u ? c?.noActionsAllowed : e,
1410
1419
  children: [
1411
- /* @__PURE__ */ S("div", { className: "flex min-w-0 flex-1 items-center", children: [
1420
+ /* @__PURE__ */ b("div", { className: "flex min-w-0 flex-1 items-center", children: [
1412
1421
  C || null,
1413
1422
  /* @__PURE__ */ h(
1414
1423
  "h3",
@@ -1420,7 +1429,7 @@ const Yt = ({
1420
1429
  ),
1421
1430
  title: u ? c?.noActionsAllowed : e,
1422
1431
  children: r?.length ? /* @__PURE__ */ h(
1423
- Je,
1432
+ tt,
1424
1433
  {
1425
1434
  text: e,
1426
1435
  highlightText: r
@@ -1429,29 +1438,29 @@ const Yt = ({
1429
1438
  }
1430
1439
  )
1431
1440
  ] }),
1432
- /* @__PURE__ */ h(Yt, { conversation: t, isDisabled: u })
1441
+ /* @__PURE__ */ h(Wt, { conversation: t, isDisabled: u })
1433
1442
  ]
1434
1443
  }
1435
1444
  );
1436
- }, Gt = ({
1445
+ }, Xt = ({
1437
1446
  handleConversationClick: t,
1438
1447
  selectedConversationId: s,
1439
1448
  groupLabel: r,
1440
1449
  groupedConversations: a,
1441
1450
  isDisabled: u
1442
1451
  }) => {
1443
- const { titles: c } = V(), [C, p] = B(!1), e = O(() => {
1452
+ const { titles: c } = K(), [C, p] = O(!1), e = D(() => {
1444
1453
  p((o) => !o);
1445
1454
  }, [p]);
1446
- return /* @__PURE__ */ S("div", { children: [
1447
- /* @__PURE__ */ S(
1455
+ return /* @__PURE__ */ b("div", { children: [
1456
+ /* @__PURE__ */ b(
1448
1457
  "div",
1449
1458
  {
1450
1459
  className: "conversation-group-items-title mb-3 inline-flex cursor-pointer items-center gap-1 text-neutrals-700",
1451
1460
  onClick: e,
1452
1461
  children: [
1453
1462
  /* @__PURE__ */ h(
1454
- ot,
1463
+ at,
1455
1464
  {
1456
1465
  className: k(
1457
1466
  "w-3 h-3 conversation-group-items-arrow",
@@ -1459,7 +1468,7 @@ const Yt = ({
1459
1468
  )
1460
1469
  }
1461
1470
  ),
1462
- /* @__PURE__ */ h("span", { className: "body-3 conversation-group-items-title-text", children: mt(r, c) })
1471
+ /* @__PURE__ */ h("span", { className: "body-3 conversation-group-items-title-text", children: vt(r, c) })
1463
1472
  ]
1464
1473
  }
1465
1474
  ),
@@ -1485,13 +1494,13 @@ const Yt = ({
1485
1494
  }
1486
1495
  )
1487
1496
  ] }, r);
1488
- }, jt = ({
1497
+ }, Kt = ({
1489
1498
  searchQuery: t,
1490
1499
  isExpandedSearch: s,
1491
1500
  onSearchConversations: r,
1492
1501
  toggleSearchField: a
1493
1502
  }) => {
1494
- const { titles: u, searchIcon: c } = V();
1503
+ const { titles: u, searchIcon: c } = K();
1495
1504
  return /* @__PURE__ */ h(Ee, { children: s ? /* @__PURE__ */ h(
1496
1505
  Me,
1497
1506
  {
@@ -1501,32 +1510,32 @@ const Yt = ({
1501
1510
  cssClass: "h-auto",
1502
1511
  value: t,
1503
1512
  iconAfterInput: /* @__PURE__ */ h(
1504
- qe,
1513
+ nt,
1505
1514
  {
1506
1515
  buttonClassName: "text-button-tertiary items-center p-0 ml-4 border-0 w-5 h-5",
1507
1516
  onClick: a,
1508
- icon: /* @__PURE__ */ h(rt, {})
1517
+ icon: /* @__PURE__ */ h(lt, {})
1509
1518
  }
1510
1519
  ),
1511
1520
  onChange: r
1512
1521
  }
1513
1522
  ) : /* @__PURE__ */ h(
1514
- j,
1523
+ W,
1515
1524
  {
1516
1525
  buttonClassName: "text-button-tertiary p-0 search-button",
1517
- iconBefore: c || /* @__PURE__ */ h(st, { className: "size-5" }),
1526
+ iconBefore: c || /* @__PURE__ */ h(ct, { className: "size-5" }),
1518
1527
  onClick: a
1519
1528
  }
1520
1529
  ) });
1521
- }, Wt = ({
1530
+ }, Zt = ({
1522
1531
  conversations: t,
1523
1532
  selectedConversationId: s,
1524
1533
  searchQuery: r,
1525
1534
  handleConversationClick: a,
1526
1535
  isDisabled: u
1527
1536
  }) => {
1528
- const { titles: c } = V(), [C, p] = B([]);
1529
- return ne(() => {
1537
+ const { titles: c } = K(), [C, p] = O([]);
1538
+ return oe(() => {
1530
1539
  p(
1531
1540
  Pe(
1532
1541
  t?.filter(
@@ -1547,13 +1556,13 @@ const Yt = ({
1547
1556
  },
1548
1557
  e.id
1549
1558
  )) : /* @__PURE__ */ h("h3", { className: "text-neutrals-800", children: c?.noConversation ?? "No conversations yet" }) });
1550
- }, Vt = () => {
1551
- const { titles: t } = V();
1552
- return /* @__PURE__ */ S("div", { className: "flex flex-col p-8 text-center", children: [
1559
+ }, Jt = () => {
1560
+ const { titles: t } = K();
1561
+ return /* @__PURE__ */ b("div", { className: "flex flex-col p-8 text-center", children: [
1553
1562
  /* @__PURE__ */ h("p", { className: "text-neutrals-800", children: t?.noConversation ?? "No conversations yet" }),
1554
1563
  /* @__PURE__ */ h("p", { className: "mt-2 text-sm text-neutrals-800", children: t?.clickNewChat ?? 'Click "New Chat" to start a conversation' })
1555
1564
  ] });
1556
- }, ln = ({
1565
+ }, hn = ({
1557
1566
  handleConversationClick: t,
1558
1567
  selectedConversationId: s,
1559
1568
  actions: r,
@@ -1569,116 +1578,116 @@ const Yt = ({
1569
1578
  shareConversationProps: l,
1570
1579
  handleSelectedConversationRemove: f
1571
1580
  }) => {
1572
- const [d, E] = B({}), [m, R] = B(!0), [w, g] = B(""), [y, A] = B(!1), {
1573
- getConversations: T,
1574
- getSharedConversations: b,
1575
- deleteConversation: L,
1576
- renameConversation: H
1577
- } = r, Q = K(() => !!w?.length, [w]);
1578
- ne(() => {
1581
+ const [d, E] = O({}), [m, N] = O(!0), [w, g] = O(""), [y, A] = O(!1), {
1582
+ getConversations: L,
1583
+ getSharedConversations: S,
1584
+ deleteConversation: B,
1585
+ renameConversation: _
1586
+ } = r, j = Z(() => !!w?.length, [w]);
1587
+ oe(() => {
1579
1588
  E({
1580
- ...ut(o),
1581
- ...pt(p)
1589
+ ...pt(o),
1590
+ ...Et(p)
1582
1591
  });
1583
- }, [p, o]), ne(() => {
1584
- async function N() {
1592
+ }, [p, o]), oe(() => {
1593
+ async function R() {
1585
1594
  try {
1586
- R(!0);
1587
- const I = await T(e), x = await b(
1588
- se(ie.ME)
1595
+ N(!0);
1596
+ const x = await L(e), P = await S(
1597
+ ie(ae.ME)
1589
1598
  );
1590
- n(q(I)), i(
1599
+ n(q(x)), i(
1591
1600
  q(
1592
- pe(x, e)
1601
+ pe(P, e)
1593
1602
  )
1594
1603
  );
1595
- } catch (I) {
1596
- console.error("Error loading conversation", I);
1604
+ } catch (x) {
1605
+ console.error("Error loading conversation", x);
1597
1606
  } finally {
1598
- R(!1);
1607
+ N(!1);
1599
1608
  }
1600
1609
  }
1601
- N();
1610
+ R();
1602
1611
  }, [
1603
- T,
1612
+ L,
1604
1613
  n,
1605
1614
  e,
1606
- b,
1615
+ S,
1607
1616
  i
1608
1617
  ]);
1609
- const D = O(
1610
- async (N) => {
1618
+ const T = D(
1619
+ async (R) => {
1611
1620
  try {
1612
- await L(N);
1613
- const I = await T(e), x = await b(
1614
- se(ie.ME)
1621
+ await B(R);
1622
+ const x = await L(e), P = await S(
1623
+ ie(ae.ME)
1615
1624
  );
1616
- n(q(I)), i(
1625
+ n(q(x)), i(
1617
1626
  q(
1618
- pe(x, e)
1627
+ pe(P, e)
1619
1628
  )
1620
- ), s === N?.id && f();
1621
- } catch (I) {
1622
- console.error("Error deleting conversation", I);
1629
+ ), s === R?.id && f();
1630
+ } catch (x) {
1631
+ console.error("Error deleting conversation", x);
1623
1632
  }
1624
1633
  },
1625
1634
  [
1635
+ B,
1626
1636
  L,
1627
- T,
1628
1637
  e,
1629
- b,
1638
+ S,
1630
1639
  n,
1631
1640
  i,
1632
1641
  s,
1633
1642
  f
1634
1643
  ]
1635
- ), G = O(
1636
- async (N, I) => {
1644
+ ), V = D(
1645
+ async (R, x) => {
1637
1646
  try {
1638
- R(!0), await H(N, I);
1639
- const x = await T(e), F = await b(
1640
- se(ie.ME)
1647
+ N(!0), await _(R, x);
1648
+ const P = await L(e), G = await S(
1649
+ ie(ae.ME)
1641
1650
  );
1642
- n(q(x)), i(
1651
+ n(q(P)), i(
1643
1652
  q(
1644
- pe(F, e)
1653
+ pe(G, e)
1645
1654
  )
1646
1655
  );
1647
- } catch (x) {
1648
- console.error("Error renaming conversation", x);
1656
+ } catch (P) {
1657
+ console.error("Error renaming conversation", P);
1649
1658
  } finally {
1650
- R(!1);
1659
+ N(!1);
1651
1660
  }
1652
1661
  },
1653
1662
  [
1654
- T,
1663
+ L,
1655
1664
  e,
1656
- b,
1665
+ S,
1657
1666
  n,
1658
1667
  i,
1659
- H
1668
+ _
1660
1669
  ]
1661
- ), X = O(
1662
- (N) => {
1663
- g(N);
1670
+ ), Q = D(
1671
+ (R) => {
1672
+ g(R);
1664
1673
  },
1665
1674
  [g]
1666
- ), Y = O(() => {
1667
- A((N) => !N), g("");
1675
+ ), $ = D(() => {
1676
+ A((R) => !R), g("");
1668
1677
  }, [A]);
1669
1678
  return m ? /* @__PURE__ */ h(be, {}) : /* @__PURE__ */ h(
1670
- $t,
1679
+ Gt,
1671
1680
  {
1672
1681
  value: {
1673
1682
  locale: e,
1674
- deleteConversation: D,
1675
- renameConversation: G,
1683
+ deleteConversation: T,
1684
+ renameConversation: V,
1676
1685
  getConversation: r.getConversation,
1677
1686
  getFileBlob: r.getFileBlob,
1678
1687
  shareConversationProps: l
1679
1688
  },
1680
- children: /* @__PURE__ */ S(De.Provider, { value: C, children: [
1681
- !u && /* @__PURE__ */ S(
1689
+ children: /* @__PURE__ */ b(De.Provider, { value: C, children: [
1690
+ !u && /* @__PURE__ */ b(
1682
1691
  "div",
1683
1692
  {
1684
1693
  className: k(
@@ -1688,12 +1697,12 @@ const Yt = ({
1688
1697
  children: [
1689
1698
  !y && /* @__PURE__ */ h("h3", { className: "sm:body-2 text-neutrals-700", children: C?.titles?.allChats ?? "All Chats" }),
1690
1699
  /* @__PURE__ */ h(
1691
- jt,
1700
+ Kt,
1692
1701
  {
1693
1702
  searchQuery: w,
1694
1703
  isExpandedSearch: y,
1695
- onSearchConversations: X,
1696
- toggleSearchField: Y
1704
+ onSearchConversations: Q,
1705
+ toggleSearchField: $
1697
1706
  }
1698
1707
  )
1699
1708
  ]
@@ -1704,10 +1713,10 @@ const Yt = ({
1704
1713
  {
1705
1714
  className: k(
1706
1715
  "flex flex-col pr-4",
1707
- Q ? "gap-y-1" : "gap-y-6"
1716
+ j ? "gap-y-1" : "gap-y-6"
1708
1717
  ),
1709
- children: p?.length === 0 && o?.length === 0 ? /* @__PURE__ */ h(Vt, {}) : Q ? /* @__PURE__ */ h(
1710
- Wt,
1718
+ children: p?.length === 0 && o?.length === 0 ? /* @__PURE__ */ h(Jt, {}) : j ? /* @__PURE__ */ h(
1719
+ Zt,
1711
1720
  {
1712
1721
  conversations: [...o, ...p],
1713
1722
  searchQuery: w,
@@ -1716,16 +1725,16 @@ const Yt = ({
1716
1725
  isDisabled: c
1717
1726
  }
1718
1727
  ) : Object.entries(d).map(
1719
- ([N, I]) => I?.length > 0 && /* @__PURE__ */ h(
1720
- Gt,
1728
+ ([R, x]) => x?.length > 0 && /* @__PURE__ */ h(
1729
+ Xt,
1721
1730
  {
1722
1731
  isDisabled: c,
1723
- groupLabel: N,
1724
- groupedConversations: I,
1732
+ groupLabel: R,
1733
+ groupedConversations: x,
1725
1734
  handleConversationClick: t,
1726
1735
  selectedConversationId: s
1727
1736
  },
1728
- N
1737
+ R
1729
1738
  )
1730
1739
  )
1731
1740
  }
@@ -1734,28 +1743,28 @@ const Yt = ({
1734
1743
  ] })
1735
1744
  }
1736
1745
  );
1737
- }, Xt = ({
1746
+ }, qt = ({
1738
1747
  onCloseModal: t,
1739
1748
  disableModalDividers: s,
1740
1749
  signOut: r,
1741
1750
  isSmallButton: a,
1742
1751
  locale: u,
1743
1752
  titles: c
1744
- }) => /* @__PURE__ */ S(
1745
- le,
1753
+ }) => /* @__PURE__ */ b(
1754
+ ce,
1746
1755
  {
1747
1756
  heading: c?.popupTitle || "Log out?",
1748
1757
  portalId: "sign-out",
1749
1758
  containerClassName: "sign-out-popup",
1750
- size: ce.SM,
1759
+ size: ue.SM,
1751
1760
  dividers: !s,
1752
1761
  onClose: t,
1753
1762
  closeButtonTitle: "Cancel",
1754
1763
  children: [
1755
1764
  /* @__PURE__ */ h("div", { className: "px-6 py-4 sm:px-0", lang: u, children: c?.popupText }),
1756
- /* @__PURE__ */ S("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
1765
+ /* @__PURE__ */ b("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
1757
1766
  /* @__PURE__ */ h(
1758
- j,
1767
+ W,
1759
1768
  {
1760
1769
  buttonClassName: "cancel-button",
1761
1770
  title: c?.popupCancel || "Cancel",
@@ -1766,7 +1775,7 @@ const Yt = ({
1766
1775
  }
1767
1776
  ),
1768
1777
  /* @__PURE__ */ h(
1769
- j,
1778
+ W,
1770
1779
  {
1771
1780
  buttonClassName: "text-button-primary",
1772
1781
  title: c?.popupApply || "Sign Out",
@@ -1779,7 +1788,7 @@ const Yt = ({
1779
1788
  ] })
1780
1789
  ]
1781
1790
  }
1782
- ), cn = ({
1791
+ ), fn = ({
1783
1792
  userInfo: t,
1784
1793
  signOutAction: s,
1785
1794
  contactSupportUrl: r,
@@ -1787,16 +1796,16 @@ const Yt = ({
1787
1796
  locale: u,
1788
1797
  titles: c
1789
1798
  }) => {
1790
- const C = (R) => R?.split(" ")?.map((w, g) => g < 2 ? w[0].toUpperCase() : "")?.join("") ?? "", p = K(
1799
+ const C = (N) => N?.split(" ")?.map((w, g) => g < 2 ? w[0].toUpperCase() : "")?.join("") ?? "", p = Z(
1791
1800
  () => t?.name ? C(t?.name) : t?.email?.[0].toUpperCase() ?? "",
1792
1801
  [t]
1793
- ), [e, o] = B(!1), n = t?.name?.split(" "), i = n ? `${n?.[0] ?? ""} ${n?.[1]?.[0] ? n?.[1]?.[0] + "." : ""}` : t?.email ?? "", l = O(() => {
1802
+ ), [e, o] = O(!1), n = t?.name?.split(" "), i = n ? `${n?.[0] ?? ""} ${n?.[1]?.[0] ? n?.[1]?.[0] + "." : ""}` : t?.email ?? "", l = D(() => {
1794
1803
  o(!0);
1795
- }, []), f = O(() => {
1804
+ }, []), f = D(() => {
1796
1805
  o(!1);
1797
- }, []), d = O(() => {
1806
+ }, []), d = D(() => {
1798
1807
  window.open(r || "#", "_blank", "noopener,noreferrer");
1799
- }, [r]), E = K(() => /* @__PURE__ */ S("div", { className: "flex items-center gap-2", children: [
1808
+ }, [r]), E = Z(() => /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
1800
1809
  /* @__PURE__ */ h(
1801
1810
  "div",
1802
1811
  {
@@ -1817,8 +1826,8 @@ const Yt = ({
1817
1826
  children: (a?.showShortName ? i : t?.name) ?? t?.email ?? ""
1818
1827
  }
1819
1828
  )
1820
- ] }), [p, i, a, t]), m = K(() => /* @__PURE__ */ S("div", { className: k("py-1", a?.dropDownStyles), children: [
1821
- a?.settingsIcon && /* @__PURE__ */ S(
1829
+ ] }), [p, i, a, t]), m = Z(() => /* @__PURE__ */ b("div", { className: k("py-1", a?.dropDownStyles), children: [
1830
+ a?.settingsIcon && /* @__PURE__ */ b(
1822
1831
  "button",
1823
1832
  {
1824
1833
  className: k(
@@ -1833,7 +1842,7 @@ const Yt = ({
1833
1842
  ]
1834
1843
  }
1835
1844
  ),
1836
- a?.contactSupportIcon && /* @__PURE__ */ S(
1845
+ a?.contactSupportIcon && /* @__PURE__ */ b(
1837
1846
  "button",
1838
1847
  {
1839
1848
  className: k(
@@ -1858,7 +1867,7 @@ const Yt = ({
1858
1867
  )
1859
1868
  }
1860
1869
  ),
1861
- /* @__PURE__ */ S(
1870
+ /* @__PURE__ */ b(
1862
1871
  "button",
1863
1872
  {
1864
1873
  className: k(
@@ -1872,7 +1881,7 @@ const Yt = ({
1872
1881
  /* @__PURE__ */ h("span", { className: "shrink-0", children: a?.signOutIcon }),
1873
1882
  /* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.signOut || "Sign out" }),
1874
1883
  e && /* @__PURE__ */ h(
1875
- Xt,
1884
+ qt,
1876
1885
  {
1877
1886
  onCloseModal: f,
1878
1887
  signOut: () => s?.(),
@@ -1909,10 +1918,10 @@ const Yt = ({
1909
1918
  );
1910
1919
  };
1911
1920
  export {
1912
- Yt as ActionMenu,
1913
- _ as ActionMenuItem,
1914
- ln as ConversationList,
1915
- cn as User,
1916
- ut as getSharedConversationsGroup,
1921
+ Wt as ActionMenu,
1922
+ z as ActionMenuItem,
1923
+ hn as ConversationList,
1924
+ fn as User,
1925
+ pt as getSharedConversationsGroup,
1917
1926
  pe as transformSharedConversations
1918
1927
  };